#help-development

1 messages · Page 561 of 1

charred blaze
#

enter sleep mode

wise mesa
#

There is no reason to run the game at a higher framerate than your monitor

charred blaze
#

it says

#

help

eternal oxide
#

your bios probably has internal disabled

wise mesa
#

Just switch it back

quaint mantle
#

turn it off and plug it back into it's original place and boot it

charred blaze
#

ok can i switch it back

wise mesa
#

And limit your fps

quaint mantle
#

yes

eternal oxide
#

move teh cable back and then enable vsync

charred blaze
#

ok

wise mesa
#

Enable vsync or limit fps

quaint mantle
#

install sodium and limit your fps to 60 or enable vsync so it limits it to your monitor's refresh rate

eternal oxide
#

I have an i7 3770k with a GTX 1070 with 32 gig of ram. I run at 60 fps/vsync

tardy delta
#

dang

noble lantern
#

dang theres no method for just getting the vanilla name of an item still

charred blaze
#

its still no video input

#

hellpppppp

quaint mantle
charred blaze
eternal oxide
#

I';m betting you bent a pin moving the cable

quaint mantle
#

send cable pic then 😭

ocean hollow
#

how to indent new line?

eternal oxide
#

um, that looks the wrong place

#

thats not in a video card

charred blaze
#

ill be executed

quaint mantle
tardy delta
charred blaze
#

oh

quaint mantle
#

did you apply a lot of force when you were switching ?

eternal oxide
#

That monitor cabel does not looked plugged in to me

ocean hollow
eternal oxide
#

it looks like its wedged

charred blaze
#

no i didnt

#

its on correct place btw

tardy delta
#

no hdmi cable?

eternal oxide
#

its 15 pin d type

#

230 volt so he's in teh UK it looks

quaint mantle
#

also the pc didnt look likeit was even turned on, ethernet leds werent flashing

charred blaze
agile anvil
tardy delta
#

hmyes very clear

eternal oxide
#

cable looks good

charred blaze
#

what do i do??????

eternal oxide
#

plugin it back in and make sure you didn;t knock any other cables loose

charred blaze
#

ok wait

agile anvil
charred blaze
#

its still no video input

#

helppp

eternal oxide
#

does it have power?

charred blaze
#

wdym

#

its booted

eternal oxide
#

is it actually turning on?

charred blaze
#

i hear coolers

#

i hear some windows sound also

tardy delta
#

what sound

charred blaze
#

help pls

eternal oxide
#

turn yoru monitor off then back on

charred blaze
#

idk

quaint mantle
#
[16:13:58 WARN]:        at RCore-1.0-shaded.jar//dev.relismdev.rcore.storage.localStorage.lambda$set$0(localStorage.java:45)
[16:13:58 WARN]:        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[16:13:58 WARN]:        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[16:13:58 WARN]:        at java.base/java.lang.Thread.run(Thread.java:833)```

in my msgListener class i can access the socket object and emit/listen, but on my localStorage class (in which i imported the socket the same way as the msgListener class) it throws ...localStorage.socket is null, anybody know why ?
tardy delta
#

ill let the help desk guy handle this lmao

charred blaze
eternal oxide
#

Can;t really help then, unless you are local to me

#

Bristol here

tardy delta
#

😄

charred blaze
#

whattt

#

what do i do now

eternal oxide
#

run away from home

charred blaze
#

good idea

#

and survive how

quaint mantle
tardy delta
quaint mantle
agile anvil
charred blaze
#

wait i have idea

tardy delta
#

youre slow

noble lantern
#

time for a refactor bois

charred blaze
#

some time it was doing this like that and i just needed tu punch case little bit 💀

quaint mantle
tardy delta
#

just pass a param into the constructor and set it as a field

agile anvil
#

You should probably learn java properly before playing with advanced things such as Sockets

quaint mantle
charred blaze
#

ok nothing. its still like that

tardy delta
#

just pass it into the constructor of the class that needs that socket

charred blaze
#

what do i do now?

coarse finch
#

do yall know how i can get the collision box of a block entity

quaint mantle
tardy delta
#

raw sockets :(

charred blaze
#

say thanks?

#

bruh hello?

eternal oxide
charred blaze
#

hey

eternal oxide
#

If it still has no video you need to open it up and make sure your video card is correctly seated

charred blaze
#

what does wiggle mean sorry my english aint good

eternal oxide
#

Need parents consent if a minor

charred blaze
tardy delta
#

:)

quaint mantle
charred blaze
#

ah ok

#

wait

#

still nothing

#

goodbye everyone

#

💀

eternal oxide
#

did you tighten the screws on teh cable?

charred blaze
#

seriously

quaint mantle
charred blaze
#

screw

eternal oxide
#

dead cable or video card then

charred blaze
charred blaze
#

can u guys look in screen i sent

eternal oxide
#

what screen?

charred blaze
#

photo

eternal oxide
#

discord dropping messages

#

I see no photo

charred blaze
#

bruh why was i even thinking about unplugging something

eternal oxide
#

its not there for me

charred blaze
#

eh

#

brah

charred blaze
tardy delta
#

test

eternal oxide
#

its not there for me

tardy delta
#

discord had a stroke or was that just me?

eternal night
#

na same

charred blaze
#

yes it had

zenith gate
#

how can you set the health of the wither? Modifying their attribute and setting their health doesn't work.

tardy delta
#

another ddos attack 👀

supple compass
#

After I updated the version to 1.20, 'CraftItemStack' does not exist. How can I change ItemStack to nms

eternal night
#

I mean, the class is still around

eternal oxide
#

?bt

undone axleBOT
eternal night
#

so your setup is scuffed/wrong import ?

supple compass
#

i run it using --rev 1.20.1

chrome beacon
#

and how are you importing it

supple compass
#

maven

chrome beacon
#

Show your pom

#

?paste

undone axleBOT
supple compass
eternal night
#

?nms

eternal oxide
#

CraftItemStack shoudl be there with those settings

#

Intelij or Eclipse?

supple compass
#

Intellij

eternal oxide
#

clear caches?

charred blaze
#

thanks guys for broking pc i guess

#

💀

eternal oxide
#

I told you not to move it 😉

#

as the PC boots it's detectign a video card

#

but no output

#

monitor or cable is most likely

supple compass
#

I thought it worked, but i get this error when the server loads the plugin

tender shard
#

did you not compile using mvn package?

supple compass
#

I build using intellij artifact, and this is my plugin pom:

quaint mantle
supple compass
vivid hill
#
public class BotConfig {

    private static final FileConfiguration fileConfiguration;


    static {
        fileConfiguration = LinkCommand.getPlugin().getConfig();
    }

    public static String getToken() {
        return fileConfiguration.getString("token");
    }
}

is that a bad way to something like this. (Getting a value (String) from the config.yml file)

tender shard
#

you have to use maven

#

mvn package

supple compass
#

Can you let me know how to do that in Intellij

zenith gate
#
public void teleportToVault(Player playerName) {
        if(!(playerVaultCheck(playerName))) return;
        Location spawn = plugin.getServer().getWorld(playerName.getName() + "'s Vault").getSpawnLocation();
        playerName.teleport(spawn);

    }

Will this teleport the player to that world, or just teleport to the coordinates from the current world?

tender shard
zenith gate
supple compass
#

Wow it worked!! Thanks a lot!!

frail pilot
zenith gate
#

But that will work? it'll teleport them to that world, and to that worlds spawn?

frail pilot
#

Well if the World exist, yes

deft thistle
zenith gate
quaint mantle
#

What kind of input does the Location data-type take?

#

For reference, 0,0,0 is something it won't accept

frail pilot
frail pilot
kind hatch
#

Location takes a World object then 3 doubles.

fluid river
#

world x y z

hazy parrot
#

Your ide will scream possible constructors at you

fluid river
#

where yaw and pitch are just default(0, 0)

hazy parrot
#

Assuming you are not using notepad

quiet ice
frail pilot
#

?

quaint mantle
astral scroll
quaint mantle
tardy delta
#

by learning about constructors

kind hatch
#

and object instantiation.

quaint mantle
river oracle
undone axleBOT
quaint mantle
#

Bro.... I know what constructors are and instead of ?learnjava screaming at me actually explain

tardy delta
#

nothing to elaborate about, thats not valid syntax

quaint mantle
#

i don't want to be spoonfed

#

just explain....

tardy delta
#

well we arent

river oracle
#

this isn't really a learning java server its pretty much just spigot help, not many people here wanna teach java

quaint mantle
#

The only reason i ask for help in dm's is so people can't shit ?learnjava like they just drank 12 litres of blender'd taco bell

river oracle
tardy delta
#

oh now hes gonna ask it there

river oracle
subtle folio
#

lmfao that discord is for asking that there

quaint mantle
#

Location, is a spigot function. I would like to add +1 on z axis. Are there any ways of doing this.

tardy delta
#

thats not even a function

subtle folio
#

you can create a new location and add 1 to it with the add method

quaint mantle
# quaint mantle yes

Thank you for your valuable answer and interesting contribution to this conversation.

subtle folio
#

this will help

river oracle
#

I already sent it

quaint mantle
eternal oxide
subtle folio
#

oh sorry

quaint mantle
subtle folio
#

i didn’t see

tardy delta
#

hows he gonna call a method if he cant even create an object

subtle folio
#

#notmyproblem

river oracle
#

honestly should join the java learning server i sent if he wants to learn java

#

their are people who want to teach and explain java there

quaint mantle
# eternal oxide Sarcasm will get you nowhere here

how do i get tripwire face in "if" ?java Tripwire tripwire = (Tripwire) e.getBlockState().getBlockData(); if (e.getBlockState().getLocation().getWorld() != null && tripwire.getFaces().add(BlockFace.EAST)) {

eternal oxide
#

getFacing

subtle folio
#

why are you doing that in a if statement

#

unless your checking for it to be a success j thought #add was void

subtle folio
#

i

quaint mantle
subtle folio
#

autocorrect

eternal oxide
#

j thought too

quaint mantle
#

but what need i do ?

subtle folio
#

?learnjava

undone axleBOT
river oracle
#

man

subtle folio
#

learn about the == operator

quaint mantle
#

what does that have to do with anything

river oracle
#

i believe

subtle folio
#

for checking what face it is?

quaint mantle
subtle folio
river oracle
quaint mantle
subtle folio
quaint mantle
#

and ty your link was useful

river oracle
#

oh maybe they didn't see it

quaint mantle
#

am i get wrong block ?

river oracle
subtle folio
#

getFaces().contains()

river oracle
#

oh yeah

#

smart

subtle folio
#

it’s a set

#

then you can put in BlockFace.EAST in there

subtle folio
#

saving that

quaint mantle
#

if you told a goldfish to climb up a tree it'd feel stupid

#

it was joke

#

🙂

#

i mean at that point i'd agree

subtle folio
#

bro calm down

quaint mantle
#

but where we know basic stuff, and we just want to progress helping us is more useful

#

then sending an entire resource with 72,000 pages worth of stuff on java

subtle folio
river oracle
subtle folio
#

that’s more basic then basic

eternal oxide
#

Your idea of "knowing the basic stuff" is different to ours it seems

quaint mantle
#

I found out what i needed

#

im newbie too

#

Location newLocation = blockCoord.subtract(0, 1, 0);

#

they tell me to learn java

subtle folio
#

yes

river oracle
#

shouldn't you clone locations? I've always wondered

quaint mantle
subtle folio
eternal oxide
river oracle
#

ahhh

river oracle
#

then

quaint mantle
#

goddamit

eternal oxide
#

Dep[ends how you get teh Location. they are not always clones

quaint mantle
#

^

river oracle
#

stop being so salty

#

it has to do with spigot internals

subtle folio
quaint mantle
#

Yk what it's fine

river oracle
#

so it makes sense

quaint mantle
#

go back to posting "Learn java" gifs in the java discord

river oracle
subtle folio
#

then that’s normal

river oracle
#

ahhh okay I thought I was dumb

quaint mantle
river oracle
quaint mantle
#

always wanted me a mushroom house

#

its tripwire and this is mushroom colony

#

looks sick

subtle folio
#

is that vanilla ?

river oracle
quaint mantle
quaint mantle
subtle folio
#

i see

quaint mantle
#

looks cool

subtle folio
quaint mantle
#

Nothing

#

😄

#

😄

#

u guys give me guide for how to add chace

eternal oxide
#

chase?

quaint mantle
#

my dyslexia kicked in for the better, reading it as chance

river oracle
quaint mantle
#

make an item destroy event

#

then do random 1,3

river oracle
#

^

quaint mantle
#

then spawn an entity of that block

#

at that coordinate

#

with that amount of stack

river oracle
#

even better you could use BlockDropEvent and change the item drops iirc

quaint mantle
#

That works too

eternal oxide
#

^

quaint mantle
#

^

river oracle
quaint mantle
#

?whereami

quaint mantle
#

@vague swallow the chad is still here

eternal oxide
#

I thought I already did BlockDrop temEvent with you poinetr?

quaint mantle
#

is isnt set material in first index ?

river oracle
#

tbh

#

instead of trying to find it in the list

#

I mean I'd assume it'd be in the first slot

eternal oxide
#

Its a Collection of Items, you have to get each Item, get it's ItemStack and modify it

quaint mantle
eternal oxide
#

no point

river oracle
#

isn't the list mutable?

eternal oxide
#

I already showed you how to modify the drops in BlockDropItem

river oracle
#

I'm pretty sure you could just edit the list

eternal oxide
#

no

#

you can remove from the list, not add

river oracle
#

no? that is kinda lame :(

eternal oxide
#

You can modify each result but you can;t add

river oracle
eternal oxide
#

No clue

#

For just replacing existing drops or blocking it's fine

#

as its all Item wrappers

charred blaze
#

guys

#

it booted

#

thank god

river oracle
#

this is the moment of all time

quaint mantle
#

wait chace is luck or chance is luck in english ?

#

btw @eternal oxide coding what you sent me into something that fits what i'm doing is taking a while but it's working i think

quaint mantle
#

Chance is how probably something to happen

#

luck is something is more likely to happen

#

e.g., if you were lucky, then you would be more likely to win the lottery/at casinos

#

but there is always a chance you will win something

#

(Don't go gambling, very small chance you will win)

#

(It woulnd't be a business if it didn't make money)

#

alright but ineed custom drops for % chace

subtle folio
#

yeah

mortal hare
quaint mantle
#

for this bukkit have feature like bukkit runnable ?

#

or i need do custom ?

subtle folio
#

Why would you need a runnable for loot drops?

quaint mantle
#

i just give example

subtle folio
#

BukkitRunnable will work fine

eternal oxide
#

you don;t need any of it. you don;t even need dropNaturally

quaint mantle
quaint mantle
quaint mantle
eternal oxide
#

no

mortal hare
#

just use ThreadLocalRandom

mortal hare
subtle folio
mortal hare
subtle folio
#

most random

#

plus if pointer was mentioning runnables then mutlithreaded safety would be important

worldly ingot
#

It won't matter enough

quaint mantle
eternal oxide
#
    public void onBlockDropItem(BlockDropItemEvent event) {

        event.getItems().forEach(item -> {
            ItemStack drop = item.getItemStack();
            if (drop.getType() == Material.WHITE_CONCRETE) {
                ItemMeta meta = drop.getItemMeta();
                meta.setDisplayName(ChatColor.WHITE + "Granite Bricks");
                drop.setItemMeta(meta);
                item.setItemStack(drop);
            }
        });
    }```Just fill in your drops, instead of this.
quaint mantle
#

how u see my code ?

#

where u know granite bricks ?

eternal oxide
#

I gave you the code to start with 🙂

mortal hare
#

spigot 👏 should 👏 implement 👏 adventure 👏 api

eternal night
river oracle
subtle folio
charred blaze
#

adventure api?

river oracle
#

you could PR it but it'd probably get denied

eternal night
#

BaseComponent[] stonks

river oracle
subtle folio
mortal hare
river oracle
#

spigotchan says no to Adventure API

subtle folio
#

you know you’re able to shade adventure api yourself right?

worldly ingot
#

I've said this before. The only way Adventure would ever get integrated into Spigot would be if a downstream contributor created a pull request to do so

subtle folio
#

your not limited to what spigot gives you

small current
#

Adventure API ? why dont you adventure and touch some grass

worldly ingot
#

And even then, you'd have to somehow convince md to use a library not maintained by Spigot

eternal night
mortal hare
subtle folio
subtle folio
#

if you really wanted to you could host your own spigot fork with adventure shaded

mortal hare
#

im lazy

#

that's why im screaming about it

eternal night
#

honestly what would that do xD

#

whats the point of forking spigot to have adventure in it xD

subtle folio
eternal night
#

ah 😅

vague swallow
#

Whyyyyy

river oracle
#

I just want my components mann

worldly ingot
#

Trying

mortal hare
vague swallow
worldly ingot
#

Guava is a pretty well-established standard and we actively use Guava features in Bukkit

river oracle
#

for now 🥲

mortal hare
quaint mantle
#

how many times a day do you get pinged

mortal hare
#

there are many features on paper that would break on spigot if used without any wrappers by devs

river oracle
quaint mantle
eternal oxide
#

I only test against Spigot

vague swallow
vague swallow
subtle folio
#

paper devs can go enjoy their built in text components

vague swallow
#

I mean ?whereamI

subtle folio
#

i have strings

mortal hare
#

for example there are experimental brigadier api support on paper

#

try using that on and spigot support is gone

vague swallow
quaint mantle
eternal night
subtle folio
quaint mantle
#

me have no more soul

mortal hare
subtle folio
#

ohh

#

like registering without the plug-in.yml

mortal hare
#

basically bypasses bukkit command api

subtle folio
#

yeah yeah

#

tbf bukkit command api isn’t horrible until you have more then 4 commands

#

😅

quaint mantle
#
if true                        {
    if true                    {
        if true                {
            if true            {
               True = false    ;
               False = true    ;
               while True      {
               system.out.println("Something")
                               }
                               }
                               }
                               }
                               }

HELPPP WHY MY CODE NO WORK

mortal hare
#
#define true false
#define false true
subtle folio
river oracle
#

this emoji is horrible

subtle folio
#

why are the insults getting so personal 😭

quaint mantle
subtle folio
#

?verify

#

broski

quaint mantle
#

broski

#

don't you broski me

#

i'm pure-bread polish

#

I can prove it too: "Kurwa!"

subtle folio
quaint mantle
#

omfg

#

you know that song is about depression and 5 grams of cocaine

#

about a guy struggling with his addiction

#

and pushing people out of his life for drugs

#

it's depressing asf and some rando on the internet played it over a cow dancing

#

and now it's a "meme"

tardy delta
subtle folio
#

i though booleans weren’t 1 bit

#

rather 256

tardy delta
wise mesa
#

how can I delete a world

#

do I just unload it and then delete the folder

subtle folio
#

yep

wise mesa
#

okay

#

is it possible I could do it in onLoad to avoid having to unload it

#

just have it already be unloaded

young knoll
#

Probably

#

Just make sure you have load: STARTUP

subtle folio
#

try it maybe it’ll work

wise mesa
#

alright

#

does onenable run earlier as well if you load startup

#

or just load

subtle folio
#

just load

wise mesa
#

oh perfect

#

thank you so much

eternal oxide
#

do it in onLoad rather than changing yoru startup

#

onLoad runs before worlds load

wise mesa
#

only if you have load: STARTUP

#

that's the whole point

#

it changes when the plugin loads

eternal oxide
#

BUT check Bukkit.getWorlds().isEmpty(), else the server is restarting

wise mesa
#

the default is POSTWORLD

eternal oxide
#

yes, thats my point

#

changing the load order will mess with many things

young knoll
#

Not really

eternal oxide
#

using onLoad messes with nothing

young knoll
#

onLoad is too late unless you use load: STARTUP

eternal oxide
#

wrong

#

on Load run before worlds load

young knoll
#

The default is literally called POSTWORLD

#

Because it runs post world

tall dragon
#

does some1 here know if its possible to show an inventory on hover text?, i thought it was but i cant remember

eternal oxide
#

yes, POSTWORLD runs onEnable POSTWORLD

#

onLoad runs when your plugin is loaded, BEFOR worlds

young knoll
#

onEnable always runs post world

eternal oxide
#

nope

wise mesa
#

its talking about loading, not enabling

eternal oxide
#

I can 100% guarantee, with POSTWORLD onLoad runs before worlds

wise mesa
#

why don't we test it?

young knoll
#

Only one way to find out

#

Someone test it

eternal oxide
#

I already use it

wise mesa
#

okay well my plugin currently loads postworld

#

so let me restart my server and see when it loads

eternal oxide
#

NO

wise mesa
#

i mean its currently set to postworld

eternal oxide
#

stop/start

kind hatch
#

I'm pretty sure he's right. Plugins get loaded before the worlds, hence #onLoad(), then the worlds load, and then all #onEnables() get called.

wise mesa
#

yes i am stopping my server and starting it

young knoll
#

Yes that’s what restart means

eternal oxide
#

as I already said reload will not work as teh worlds remain loaded

wise mesa
#

im not reloading?

#

why would I be reloading

young knoll
#

Restart and reload are the same word now

#

I just changed it, as the official uhh

eternal oxide
#

pretty much

young knoll
#

King of English

#

Not to be confused with the king of England

pseudo hazel
#

🙏

#

same difference

eternal oxide
#

on a startup in onLoad Bukkit.getWorlds().isEmpty() will be true and you will be able to modify the base world files

wise mesa
#

okay yea it loads my plugin before the world

#

so it really should be called enable

#

not load

eternal oxide
#

nope

#

loading is not enabling

young knoll
#

The worlds may not be in the worlds lost yet

wise mesa
#

i know

#

but the setting

#

in plugin.yml

young knoll
#

But I think they are loaded in memory

wise mesa
#

should be called enable

#

if that's what it changes

eternal oxide
#

no worlds are not loaded in memory, if thats what you mean

wise mesa
#

like coll it doesn't show the preparing spawn area text until after my plugin loads

#

and some enable before that and some enable after it

#

mine enables after it

#

so yes it changes the behavior of enable, not of load

#

which means the setting is named incorrectly

#

but now it can never be changed

eternal oxide
#

Guarantee 100% in a POSTWORLD setting onLoad runs before the world files are even touched.

wise mesa
young knoll
#

It must have had that behaviour at one point

#

Otherwise why the name

eternal oxide
#

its teh plugin onLoad not the worlds

#

Spigot loads all plugins, then loads worlds, then runs each plugin onEnable

#

Which is why you will error out storing Locations in your config if you access yoru config in a Field or before onEnable is called

wise mesa
#

elgarl who are you talking to

eternal oxide
#

The world, it's listening

wise mesa
#

we're just saying that the setting in plugin.yml is currently misnamed

#

because it's called "load"

#

but it doesn't change when the plugin loads

#

the plugin always loads and calls onLoad before the world is loaded

#

its when it enables that the setting affects

#

so it shouldn't be called load

wise mesa
eternal oxide
#

correct it shoudl be called enable not load

wise mesa
#

it would be interesting to know how we got there

#

@sullen marlin

#

🙏

eternal oxide
#

perhaps get a new entry added. Does exactly the same just called enabled

wise mesa
#

the least we could do is change the entry on the wiki

eternal oxide
#

leave load: available but scrub all references

wise mesa
#

i would do it but I want to get confirmation from md first about what it does

#

so we'll wait and see if he responds to my ping

quaint mantle
#

its fine ?

eternal oxide
#

no

#

they overlap

quaint mantle
#

v

eternal oxide
#

so a chance of 50 would apply both

quaint mantle
#

oh i knoqw

eternal oxide
#

in that modified 40 would apply to both

quaint mantle
#

i need delete =

eternal oxide
#

yep 🙂

quaint mantle
#

its fine now ?

eternal oxide
#

yes

quaint mantle
#

alright ty

quaint mantle
#

u guys said use getfaces.contains

#

but if i do

#

not work only for EAST

#

works for all EAST faces

#

i mean

#

EAST, NORTH or EAST or EAST, SOUTH, WEST

#

i wanna only for EAST

#

am i need use equals ?

eternal oxide
#

what exactly are you trying to check?

quaint mantle
#

but tripwire have much faces

#

EAST-NORTH-SOUTH

#

EAST-SOUTH

#

NORTH-SOUTH

eternal oxide
#

those are enabled faces. You want to see which direction it is facing?

quaint mantle
#

contains is checking all east faces

quaint mantle
#

east face

#

not east-south

#

or more

eternal oxide
#

now sure what you mean by that

quaint mantle
#

so i need use equals for this

#

not contains

#

but contains give warning

eternal oxide
#

No idea what you are asking

quaint mantle
#

😮 wait

#

1m

eternal oxide
#

I can;t read text in vidoes on discord

quaint mantle
#

ah

#

first one is tripwire[east=true] so drop mushroom

#

second one is tripwire[north=true] so no drop mushroom

#

third one is tripwire[east=true,north=true] so drop mushroom

#

but i don't wanna third one

#

only for first one

#

and i did t his in my code

#

tripwire.getFaces().contains(BlockFace.EAST)

#

wait

#

i changed

eternal oxide
#

yeah I believe a tripwire is going to have all faces on a plane, N,E,S,W

quaint mantle
#

third one is drop mushroom bcs i did contains

eternal oxide
#

The getFaces on TripWire is not the directions it is facing

quaint mantle
#

ah yes

eternal oxide
#

its teh faces which are enabled

#

so you could place next to it and it will auto connect

#

its not the facing of the block

#

have you tried setting the faces when you place the tripwire?

rough drift
#

Thoughts on List<T> list = new ArrayList<>(), listView = Collections.unmodifiableList(this.list);?

eternal oxide
#

if you only want one, set teh face

#

you have to set all the others to false

quaint mantle
#

but i can add more blocks with tripwire and they faces will contains EAST

eternal oxide
#

yes because those are allowed faces

#

show me where you set teh faces

quaint mantle
#

example my next block is desert-grass and this faces is east,north this drop mushroom _?

eternal oxide
#

yep you only set one face

#

set all the rest to false

#

tripwire.getAllowedFaces().forEach(face -> { tripwire.setFace(face, false)};

#

or soemthing like

#

then set the only face you want

quaint mantle
#

w8

#

i try

rough drift
tardy delta
#

forgot <> and newline

rough drift
#

I typed it so wrong lmao

#

Yeah no using the , initializer thing

tardy delta
#

remove this lol

rough drift
#

Just asking if it looks any good

#

I usually don't do that

tardy delta
#

whats supposed to not look good lol

rough drift
#

Two variables in one line initialization

tardy delta
#

just dont

rough drift
#

yeah ik, looks kinda bad, wanted a second opinion

pseudo hazel
#

oh

#

yeah I steer away

#

you win nothing

#

all you do is make it harder to read

hybrid spoke
#

he wins lines

#

less lines = faster

rough drift
#

ong

pseudo hazel
#

faster for who

hybrid spoke
#

everyone

#

thats why i also have no spaces

rough drift
#

@hybrid spoke Project in question is around 8.3k lines (excluding whitespace/comments)

hybrid spoke
#

bet you can do that in 10

rough drift
#

Maybe

late sonnet
#

for any chance any has a command with sign using many colors in text?

rough drift
#

wdym

ornate patio
#

is it possible to get all tab completes programmatically

#

what i mean is

#

for example, entering the string "su" and getting back an array of all tab completes such as "summon"

tall furnace
ornate patio
eternal oxide
#

oh ignore me, I didn;t read your question

young knoll
#

You can theoretically call the tab complete method for the command yourself

#

If you have the command instance

#

iirc it's a public method

quaint mantle
#

What am I meant to use in replace of ChatColor? since I see ChatColor is deprecated?

young knoll
#

You are depending on the paper api

quaint mantle
#

Yes im aware

#

I assumed it was fine to talk about a paper api in here? if not please direct me to the support server for paper

eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

young knoll
quaint mantle
kind hatch
#

Why do people still assume that? Paper is a fork. All forks should be considered as a separate project.

quaint mantle
#

I do consider it a seperate project.

#

I just assumed since it was based on spigot, the people inside of the spigot server would be okay answering a question about it

#

I guess I was mistaken

shadow night
#

Didn't know paper was gay, ah, it's month of the pride

quaint mantle
earnest wasp
#

hello, How get Signe Lines condition in java ? please

river oracle
#

why are people extending InventoryView? wtf who does this

mortal hare
#

then it could be passed to another plugin

#

via events

#

and if plugin has interface classes

#

it can access them

young knoll
#

InventoryHolder is common to extend

#

But dang InventoryView is new

river oracle
#

I'm jsut reading through papers comments

#

on Them adding adventure compoents to setTitle

#

and apparently people use InventoryView?

mortal hare
#

just deprecate setTitle(string)

river oracle
#

I feel like if you're extending InventoryView there just is a better way, but either way your plugins going to break in the 1.20+

ancient plank
#

tile

river oracle
#

@young knoll when are you gonna push the BuildTools GUI stuff

#

i'll be around to test it whenever I'm just bored and wanna click some buttons :P

deft thistle
#

PresistentDataContainer was implemented in what spigot version?

kind hatch
#

1.13

deft thistle
#

thank you

young knoll
#

1.14

#

1.13 had an early version that was differnt

tall furnace
deft thistle
#

the point of it is to save data in minecraft itens that get serialized and unserialized? (or am I not getting something?)

eternal oxide
#

pdc on offline players will be the best thing ever

tall furnace
#

Or things like signs and chests which are technically not blocks.

quaint mantle
#

which one?

tall furnace
quaint mantle
eternal oxide
#

data

quaint mantle
#

i did

#

but i got this error

deft thistle
#

So if I give a player an item whose pdc<String,String> "name" = "hi" even after the server restarts, if i get the item's pdc and try to grab the string by key "name" I'll get hi?

quaint mantle
#
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData cannot be cast to class org.bukkit.block.data.type.Tripwire (org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData and org.bukkit.block.data.type.Tripwire are in unnamed module of loader 'app')```
tall furnace
#

getState just gets a snapshot of the block at that instant.

eternal oxide
#

look at your other code, you already did it

tall furnace
deft thistle
#

ooh ok

quaint mantle
#

but this sets

#

i need set false to other faces?

eternal oxide
#

same place

deft thistle
#

back in my good old days of Skript I'd check the item lore lmao
(dont kill me)

tall furnace
#

I didn't use Skript tho

#

But yeah, saving data in the lines on a sign sucked because then you had to have specific information visible. Now it's all invisible and the formatting can look like whatever you want.

deft thistle
#

I mean you could also save it on NBT

#

it'd be presistent right?

tall furnace
#

NBT requires NMS code, no? That would break across versions.

deft thistle
#

Idk I never did NBT in java only in skript xD

eternal oxide
#

pdc is stored in nbt

#

in it's own container is all

deft thistle
#

ooh so that's how wit works

tall furnace
deft thistle
#

^ big plus

eternal oxide
#

if you use /data you can see the pdc data

deft thistle
#

Any ideas for first minigame plugin?
Maybe duels or something

eternal oxide
#

competition slime ranching

#

pretty sure it's never been done

deft thistle
#

Anyone here used worldguard api?

#

Is it good?

agile anvil
#

Well, if you have worldguard and need to do something worldguard related, there is no other choices

deft thistle
#

I was thinking about having it when making a minigame

agile anvil
#

For what?

deft thistle
#

As a first minigame Duels
There would be a arena region and a lobby region.

agile anvil
#

I advise you to handle it by yourself!

#

Funnier and you'll learn how cuboid works

deft thistle
#

Alright

turbid crest
#

Hey 🙂 I'm trying to change a player trim, and here is my code:

        ArmorMeta meta = (ArmorMeta) e.getNewItem().getItemMeta();
        meta.setTrim(new ArmorTrim(TrimMaterial.DIAMOND, TrimPattern.SILENCE));
        e.getNewItem().setItemMeta(meta);

But nothing happens, no error, just nothing

eternal oxide
#

there is no getNewItem() method in any Spigot event

turbid crest
#

I'm using the paper PlayerArmorChangeEvent method

eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

kind hatch
#

?whereami

turbid crest
#

okey

coarse finch
#

does logging in an enum not work or something

eternal oxide
#

logging in an enum?

coarse finch
#

yes

eternal oxide
#

explain

coarse finch
#

like plugin.getLogger().info("text")

eternal oxide
#

where are you trying to use it?

coarse finch
#

in a method in an enum

eternal oxide
#

then it will run when you call the method

coarse finch
#

its not though

eternal oxide
#

then you are not actually calling it or its erroring out

deft thistle
#

So I kinda feel like I need a little help on this
I plan to follow MVC architecture

A arena model is going as follows:

public class ArenaModel {
    private String name;
    private Player playerOne, playerTwo;
    private Location spawnOneLocation, spawnTwoLocation;
    private Cuboid arenaCuboid;
    private Cuboid spawnOneCuboid,spawnTwoCuboid;
    private ArenaState arenaState;
    
    private Listener arenaListener;

}```
Would make a areaState a enum be a good idea?
vocal cloud
#

How many states are there?

#

if 2 then bool

deft thistle
#

maybe it's going to be
WAITING
FIGHTING
FINISHED

young knoll
#

Then an enum is fine

coarse finch
eternal oxide
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

coarse finch
#

so basically, i have an enum (LogUtil.info() is a wrapper for plugin.getLogger().info()):

public enum CollisionData {
    PITCHER_CROP(((player, version, data, x, y, z) -> getPitcherCropBox(version, data)), StateTypes.PITCHER_CROP)
    
    private static CollisionBox getPitcherCropBox(ClientVersion version, WrappedBlockState block) {
      LogUtil.info("Pitcher Crop");
      switch (block.getHalf()) {
          // there is too many cases here to send, but it returns a collision box.
      }
  }
}```and i have code that gets the value: 
```java
CollisionBox data = CollisionData.getData(state.getType()).getMovementCollisionBox(player, player.getClientVersion(), state, x, y, z);```the returned data is correct, but no logs are sent
#

(StateTypes is from packetevents)

vast ledge
#

?

eternal oxide
#

you never call that method

#

ah in your lambda

coarse finch
vast ledge
#

Is ur method getting called?

#

Yea probably

#

have you tired using the
LogUtil.info("test text, print on startup");

#

outside of the function

coarse finch
#

logutil works fine

vast ledge
#

ok

#

U sure ur not just missing it?

eternal oxide
#

what is yoru getData method?

coarse finch
#
public static CollisionData getData(StateType state) { // TODO: Find a better hack for lava and scaffolding
    return state.isSolid() || state == StateTypes.LAVA || state == StateTypes.SCAFFOLDING ? rawLookupMap.getOrDefault(state, DEFAULT) : NONE;
}```
#

rawLookupMap is a hashmap containing every StateType and associated data

eternal oxide
#

I see no issue with those snippets

coarse finch
#

yeah thats what i dont get

#

ill see if it works inside getData

zenith gate
#
public static boolean vaultCheck() {
        for (World world : plugin.getServer().getWorlds()) {
            return world.getName().equals("VaultTemplate");
        }
        return false;
    }

Does this look wrong?

tardy delta
#

getWorld() != null maybe, idk if that throws

coarse finch
eternal oxide
#

so its not calling your lambda or it's consuming the error

#

actually

#

your getOrDefault is just a map lookup, so isn;t hitting the enum

coarse finch
#

oh yeah that would probably be it

zenith gate
eternal oxide
zenith gate
#

I have a check on server startup, and it gets ran in a command.

eternal oxide
#

when at server startup?

quaint mantle
#
    @EventHandler
    public void onPlace(PlayerInteractEvent e) {
        if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
        if (e.getItem() == null || e.getClickedBlock() == null) return;

        BlockFace blockFace = e.getBlockFace();
        Block block = e.getClickedBlock().getRelative(blockFace);
        Block block2 = block.getRelative(BlockFace.DOWN);
        ItemStack item = e.getItem();
        ItemMeta meta = item.getItemMeta();
        BlockState state = block.getState();
        Tripwire tripwire = (Tripwire) state.getData();

        if (meta == null) return;
        if (!meta.hasCustomModelData()) return;

        if (e.getHand() == EquipmentSlot.HAND) {
            if (item.getType() == Material.PAPER) {
                e.setCancelled(true);
                e.getPlayer().swingMainHand();
                tripwire.setFace(BlockFace.WEST,true);
                block.setBlockData(tripwire, false);
            }```
#

@eternal oxide i can't fix that error

#

java.lang.ClassCastException: class org.bukkit.material.MaterialData cannot be cast to class org.bukkit.block.data.type.Tripwire (org.bukkit.material.MaterialData and org.bukkit.block.data.type.Tripwire are in unnamed module of loader 'app')

zenith gate
quaint mantle
#

no ide errors but i got this error in console when right click block

eternal oxide
#

don;t getData, thats not the tripwire

#

its BlockData I believe

quaint mantle
#

i did

tardy delta
quaint mantle
#

Tripwire tripwire = (Tripwire) block.getBlockData();

#

i used this

tardy delta
#

you sure the relative is correct type?

eternal oxide
quaint mantle
orchid trout
quaint mantle
#

new CheckAndExtrude().checkBlock(newLocation, mat); Would this run the function inside of that class?

#

Doesn't seem to work at all so i'm just double-checking

tardy delta
#

well idk about the code, im just saying

quaint mantle
tardy delta
#

you create a new object and call checkblock

#

discord ded?

quaint mantle
tardy delta
worldly ingot
quaint mantle
orchid trout
#

aaaa

worldly ingot
#

All that being said, your whole getUser() method is unnecessary. You can replace the whole body of that method with just a map.get() call

orchid trout
#

thankyou

zenith gate
worldly ingot
#
    public User getUser(UUID uuid) {
        return userMap.get(uuid);
    }```
quaint mantle
#

Choco can u help me ?java.lang.ClassCastException: class org.bukkit.material.MaterialData cannot be cast to class org.bukkit.block.data.type.Tripwire (org.bukkit.material.MaterialData and org.bukkit.block.data.type.Tripwire are in unnamed module of loader 'app')

#

why i got this ?

#
    @EventHandler
    public void onPlace(PlayerInteractEvent e) {
        if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
        if (e.getItem() == null || e.getClickedBlock() == null) return;

        BlockFace blockFace = e.getBlockFace();
        Block block = e.getClickedBlock().getRelative(blockFace);
        Block block2 = block.getRelative(BlockFace.DOWN);
        ItemStack item = e.getItem();
        ItemMeta meta = item.getItemMeta();
        BlockState state = block.getState();
        Tripwire tripwire = (Tripwire) state.getData();

        if (meta == null) return;
        if (!meta.hasCustomModelData()) return;

        if (e.getHand() == EquipmentSlot.HAND) {
            if (item.getType() == Material.PAPER) {
                e.setCancelled(true);
                e.getPlayer().swingMainHand();
                tripwire.setFace(BlockFace.WEST,true);
                block.setBlockData(tripwire, false);
            }```
tardy delta
#

debug block type

worldly ingot
#

BlockState#getData() returns MaterialData, not BlockData

wary harness
#

some one can recommend good GUI lib

#

for making shops

quaint mantle
young knoll
#

You need to use getBlockData

wary harness
#

left rigth click actions and so on

quaint mantle
#

i tried iswear

#

wait fix my code

#

and show errors

orchid trout
#

leftover from list of user

worldly ingot
#

You also definitely don't need the state from that block at all

quaint mantle
#
        BlockFace blockFace = e.getBlockFace();
        Block block = e.getClickedBlock().getRelative(blockFace);
        Block block2 = block.getRelative(BlockFace.DOWN);
        ItemStack item = e.getItem();
        ItemMeta meta = item.getItemMeta();
        Tripwire tripwire = (Tripwire) block.getBlockData();```
remote swallow
#

is there a cleaner way to do this, that wouldnt error on the fromString or value of

                UUID minecraftUID = null;
                if (userDataObject.has("minecraftUID")) minecraftUID = UUID.fromString(userDataObject.getAsJsonObject("minecraftUID").getAsString());
                Long discordUID = null;
                if (userDataObject.has("discordUID")) discordUID = Long.valueOf(userDataObject.getAsJsonObject("discordUID").getAsString());
hazy parrot
#

what do you want it to do if uuid or long isn't valid ?

quaint mantle
#

java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData cannot be cast to class org.bukkit.block.data.type.Tripwire (org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData and org.bukkit.block.data.type.Tripwire are in unnamed module of loader 'app')

remote swallow
hazy parrot
#

best bet is try/catch, i dont think there is any method such as TryParse in c#

remote swallow
#

kk thanks

worldly ingot
# quaint mantle ```java BlockFace blockFace = e.getBlockFace(); Block block = e....
    @EventHandler
    public void onPlace(PlayerInteractEvent event) {
        if (event.getAction() != Action.RIGHT_CLICK_BLOCK || event.getHand() == EquipmentSlot.OFF_HAND) {
            return;
        }

        Block clickedBlock = event.getClickedBlock();
        if (clickedBlock == null || clickedBlock.getType() != Material.TRIPWIRE_HOOK) {
            return;
        }

        ItemStack itemStack = event.getItem();
        if (itemStack == null || itemStack.getType() != Material.PAPER || !itemStack.hasItemMeta()) {
            return;
        }

        ItemMeta itemMeta = itemStack.getItemMeta();
        if (!itemMeta.hasCustomModelData()) {
            return;
        }

        Block block = clickedBlock.getRelative(event.getBlockFace());
        Tripwire tripwire = (Tripwire) state.getBlockData();

        event.setCancelled(true);
        event.getPlayer().swingMainHand();
        tripwire.setFace(BlockFace.WEST, true);
        block.setBlockData(tripwire, false);
    }```
This is how I would rewrite this for a number of reasons
- Early return to avoid unnecessary nesting
- Checking very fast conditions early on (ItemStack#getItemMeta() can be expensive, so we want to avoid it)
- Remove the BlockState because you don't need it at all, you're just operating on the BlockData anyways
quaint mantle
#

omg

remote swallow
#

Heart early returns

worldly ingot
#

That would probably accomplish what you were aiming for

#

Wrote it all in Discord though so mind any typos or syntax errors

round finch
#

Choco flex

#

did you right it on pc or phone

quaint mantle
#

actually my plugin works if player right click any blocks and if clicked block face is air set tripwire with face

worldly ingot
#

Desktop, yeah. I'm not on mobile lol

round finch
#

that would be big flex if it was mobil lol

#

the pain thb when writing on mobil

#

writes java code on an old nokia 🤣

compact haven
#

I’ve written so much java code for people here on the phone

compact haven
#

so painful

quaint mantle
#

I need to find a way of getting all the coordinates of connected blocks of the same type. This is so that I can extrude them whichever way the player is facing. I've already written code to extrude one block, however i need to find a way of finding all connected blocks without a loop/very simple loop. Any ideas?

#

(no speenfood)

tardy delta
#

do you already know constructors or was that another dude

quaint mantle
tardy delta
#

tell me

quaint mantle
#

can i give an example?

tardy delta
#

yes

remote swallow
#

huh

eternal oxide
#

did you give up on teh code I gave you?

remote swallow
#

the Connection class suports addng custom types

quaint mantle
#
public final class Class_Name {
    public void Class_Name(JavaPlugin plugin) {
        this.plugin = plugin
    }
}
remote swallow
#

naming conventions where

quaint mantle
#

💀

#

it's an example

chrome beacon
#

You follow conventions in examples 💀

#

Otherwise the one reading it might fail to follow the conventions

tardy delta
#

otherwise the examples will come to your house at night

quaint mantle
#
    @EventHandler
    public void onPlace(PlayerInteractEvent e) {
        if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
        if (e.getItem() == null || e.getClickedBlock() == null) return;

        Block block = e.getClickedBlock().getRelative(e.getBlockFace());
        Block block2 = block.getRelative(BlockFace.DOWN);
        ItemStack item = e.getItem();
        ItemMeta meta = item.getItemMeta();
        Tripwire tripwire = (Tripwire) block.getBlockData();

        if (meta == null) return;

        if (item.getType() == Material.PAPER &&
        block2.getType() == Material.GRASS_BLOCK &&
                block.getType() == Material.AIR) {

                e.setCancelled(true);
                tripwire.setFace(BlockFace.WEST,true);
                block.setBlockData(tripwire, false);

        }
    }```
Is this code supposed to work?
remote swallow
#

oh lmfao

#

its not even a constructor

chrome beacon
tall furnace
#

XD

tardy delta
#

i bet neither of us saw 💀

quaint mantle
#

i might be getting hella confused

tall furnace
#

It's just a method named the same name as the class

round finch
tardy delta
#

constructor has no return type

remote swallow
quaint mantle
orchid trout
#

when i have itemstack array sometimes random items' amounts just decrement

quaint mantle
quaint mantle
#

ok

remote swallow
quaint mantle
#
public class Class_Name{
  int AverageVariable;
  public Class_Name() {
    AverageVariable = 2;
  }
}
orchid trout
#

what jree fava lessons mean

fluid river
#

they mean what they mean

#

is the Oreos guy trying to learn java pre-basics?

vast ledge
#

WHY

#

WHY

fluid river
#

ok

vast ledge
#

Why ist

int AverageVariable;

//Supposed to be 
int averageVariabel;
#

@quaint mantle

vast ledge
#

?naming

chrome beacon
#

?conventions

vast ledge
#

ye

#

that

quaint mantle
quaint mantle
#

it doesn't have to be 😭