#help-development

1 messages · Page 1132 of 1

halcyon hemlock
#

Toml when?

glossy laurel
#

Yeah ik but

#

Bukkit has implemented BukkitConfiguration

#

Has it also implemented Gson?

hushed spindle
#

servers have access to gson if thats what you mean yes

#

its a standard library

young knoll
#

It’s part of the server jar

#

Not something Bukkit has added

glossy laurel
#

Right

#

Does it need extra dependencies?

hushed spindle
#

no

glossy laurel
#

Im ssuming no

#

Right

#

Is gson faster than yaml?

hushed spindle
#

i mean what are you wanting to use this for

#

do you have data to save or something

#

do you just wanna make some configs

glossy laurel
#

Yes, but im saving all my server files on yaml cuz idk how else to so like 💀

glossy laurel
hushed spindle
#

what kinda files

young knoll
#

Gson can do a lot of reflection stuff which probably slows things down

hushed spindle
#

like player data or what

young knoll
#

But if you write custom adapters for everything that probably helps

glossy laurel
young knoll
#

More like data f*cker upper amirite

blazing ocean
glossy laurel
hushed spindle
#

gson is easy to use and even more so if everything you save are plain ol java objects, no abstraction and stuff. if you do wanna save abstract objects you'll need custom adapters. not hard either, but for a beginner might be intimidating

young knoll
blazing ocean
#

what does it even do

hushed spindle
#

if you're saving items you'll also need a custom adapter

young knoll
#

Aka it only loads if needed to save memory

blazing ocean
#

mhm

young knoll
#

Although Mojang might have done that in vanilla now

#

No idea

glossy laurel
#

Hold up

#

What the hell are abstract object

#

I though there were only abstract classes

glossy laurel
glossy laurel
#

Wth is dfu

young knoll
#

Location is not a plain old java object

#

Because of the world component

blazing ocean
glossy laurel
glossy laurel
#

Btw I just remembered I dont save locations

#

Just vectors and a bunch of primitives

young knoll
#

World isn’t a plain java object

glossy laurel
#

And strings

young knoll
#

It’s got a bunch of fancy stuff attached to it

#

But you can make a custom adapater for it that just saves the uuid or name

glossy laurel
#

Is it cuz its abstract?

glossy laurel
#

I just remembered

#

Is itemstack plain ol java object

young knoll
#

No

#

You’d need to convert it to base64 or something

#

Or just the Map that bukkits api uses ig

glossy laurel
#

Why not 😭

#

Whats plain ol java object

#

Primitives and strings?

young knoll
#

Pretty much

mellow edge
#

1.) Talking about reflection, does anybody know whether if I already gained an instance of an object and a method and stored them somewhere (or have it pre-cached) and just invoked the method through that object how heavy would this be comparing to calling for example just classinstance.somemethod(); ? I mean I know how it works and that it iterates through all files when trying to gather an object for example.

Question 2 is whether it is possible to create a @EventHandler just from proxy or something like that (so you could for example listen to an event that doesn't yet exist) in older versions and has anyone ever done that? (I don't really need to do that since my project is modular but still I want to know that)

young knoll
#

Or objects that are then made up of said primitives and strings

#

Gson also has support for collections, maps, and uuids

glossy laurel
#

ANYWAYS

#

Anyone have a commpletablefuture basics tutorial

#

Or will I need to ask chatgpt

proper cobalt
#

Is there a discord server to get help with protocol lib development

glossy laurel
echo basalt
#

yeet

glossy laurel
#

Do you just put all your guides in this chat

#

💀

echo basalt
#

ye

glossy laurel
#

Lol

blazing ocean
echo basalt
#

alison stench windex

blazing ocean
#

crazy

ivory sleet
#

it used to be a good idea to cache those

#

like Method, Constructor etc

#

but i think there was a jep to make reflection faster

ivory sleet
#

ofc just invoking Class#instanceMethod will always be faster than its respective reflective invocation

grim hound
#

Or if you use any other invocation mechanism

grim hound
ivory sleet
#

method handles arent inherently fast

#

it depends what kind of method handle u use

grim hound
#

Never used it, but heard about LambdaMetaFactory

ivory sleet
#

yes

grim hound
#

After JIT optimizations they are just as fast tho

ivory sleet
#

but sadly LMF gets quite verbose is somewhat cumbersome to use and design around

#

yea JIT takes good care of reflection as well

grim hound
ivory sleet
#

@mellow edge for q2, yes thats alright

#

but unsure if u actually need it

ivory sleet
#

ye

#

for a poor script /dsl language i made

#

but it was abysmally catastrophic

#

(not LMF, but the lang)

river oracle
#

kotlin in craftbukkit???

river oracle
# young knoll https://tenor.com/view/bane-no-banned-and-you-are-explode-gif-16047504

the only thing that should get me banned is this horrific shit

            if (!(entity instanceof ITileEntityContainer container) || (atBlock = container.createMenu(player.nextContainerCounter(), player.getInventory(), player)).getType() != type) {
                if (atBlock == null) {
                    return block.defaultBlockState().getMenuProvider(this.world, this.position).createMenu(player.nextContainerCounter(), player.getInventory(), player);
                }
                return atBlock;
            }```
mellow edge
# ivory sleet <@617014442802151567> for q2, yes thats alright

Thanks for response both. With Q2 I meant if I can with proxies somehow attach annotations to proxies for spigot to invoke the method on the given event (that I pretend doesn't exist) but I quickly realised that making the project modular is much more neat than using reflection

alpine urchin
river oracle
#

PacketEvents 💪

buoyant viper
blazing ocean
glossy marsh
fleet minnow
#

What kind of server plugins are people interested in? any thoughts?

fleet minnow
glossy marsh
safe sleet
#

Anyone know how to fix this? I'm trying install the BuildTools.exe and this happens
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project spigot: Fatal error compiling: error: release version 21 not supported -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <args> -rf :spigot Error compiling Spigot. Please check the wiki for FAQs. If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support. java.lang.RuntimeException: Error running command, return status !=0: [C:\WINDOWS\system32\cmd.exe, /D, /C, C:\Users\Nexcodian\Downloads\BuildTools\apache-maven-3.9.6/bin/mvn.cmd, -Dbt.name=4316, clean, install] at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042) at org.spigotmc.builder.Builder.runProcess(Builder.java:967) at org.spigotmc.builder.Builder.runMaven0(Builder.java:936) at org.spigotmc.builder.Builder.runMavenServer(Builder.java:905) at org.spigotmc.builder.Builder.startBuilder(Builder.java:683) at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)

fleet minnow
#

what does java -version tell you

safe sleet
#

It's 21

fleet minnow
#

are you using the command promt, or the gui?

safe sleet
#

GUI

#

How do I know which JDK version that need for BuidTools.exe?

fleet minnow
#

did you set your path correctly?

#

by where it says java executable does it look something like this?

safe sleet
#

Yes it's the exact same as this

fleet minnow
#

which version of build tools did you download?

safe sleet
safe sleet
fleet minnow
#

what is your operating system?

safe sleet
#

Windows 11

fleet minnow
#

do you mind sharing your screen in a vc?

safe sleet
#

Yeah

#

@fleet minnow Thanks for the help

fleet minnow
robust jolt
#

Hi, I was trying to make a plugin for integrate custom item. My goal is make a command giving an item that can be used everytime with the right click and teleport the player and other stuffs. I didn't find any problem in any of these task, except for the customitem itslef. I don't know how to make the customitem and recognize it in the course of the time: restart, etc..

young knoll
#

?pdc

robust jolt
#

Thanks

halcyon hemlock
#

good evening everyone

lyric spindle
#

Hi guys! I am learning how to create plugins for velocity and ran into a problem when creating a configuration
[13:29:57 ERROR]: Can't create plugin proxyvelocity
java.lang.NoClassDefFoundError: dev/dejvokep/boostedyaml/dvs/versioning/Versioning
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:?]
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3373) ~[?:?]
at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2555) ~[?:?]
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:299) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:121) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:737) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.UntargettedBindingProcessor$1.visit(UntargettedBindingProcessor.java:54) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.UntargettedBindingProcessor$1.visit(UntargettedBindingProcessor.java:36) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.UntargettedBindingImpl.acceptTargetVisitor(UntargettedBindingImpl.java:52) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.UntargettedBindingProcessor.visit(UntargettedBindingProcessor.java:35) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.UntargettedBindingProcessor.visit(UntargettedBindingProcessor.java:27) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.BindingImpl.acceptVisitor(BindingImpl.java:99) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.AbstractProcessor.lambda$process$0(AbstractProcessor.java:53) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at java.base/java.util.ArrayList.removeIf(ArrayList.java:1672) ~[?:?]
at java.base/java.util.ArrayList.removeIf(ArrayList.java:1660) ~[?:?]
at com.google.inject.internal.AbstractProcessor.process(AbstractProcessor.java:50) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:216) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]

    at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.createPlugin(JavaPluginLoader.java:129) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
    at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:168) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
    at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:369) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
    at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:240) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
    at com.velocitypowered.proxy.Velocity.main(Velocity.java:71) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]

Caused by: java.lang.ClassNotFoundException: dev.dejvokep.boostedyaml.dvs.versioning.Versioning
at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass0(PluginClassLoader.java:87) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass(PluginClassLoader.java:64) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]

I don't understand what's going on, but the import class is dev.dejvokep.boostedyaml.dvs.version control.Version Control

Not in my project at all

fleet minnow
#

Ensure that BoostedYAML is properly included as a dependency in your pom.xml

young knoll
#

And shaded

lyric spindle
# fleet minnow Ensure that BoostedYAML is properly included as a dependency in your pom.xml

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<relocations>
<relocation>
<pattern>dev.dejvokep.boostedyaml</pattern>
<!-- Replace this -->
<shadedPattern>me.plugin.libs</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>

<dependency>
<groupId>dev.dejvokep</groupId>
<artifactId>boosted-yaml</artifactId>
<version>1.3</version>
</dependency>

is everything right?

glossy laurel
#

How do I detect when player is about to die and make them go to spectator at the same location, preferably skipping over the death part? I had been using EntityDamageEvent and canelling it if hp < 0 but the amount of issue thats caused is crazy

eternal oxide
#

in the damage event check if health - finalDamage <= 0

#

if it is cancel the event and set spectator

glossy laurel
#

I was doing that but

#

Wait

glossy laurel
eternal oxide
#

getFinalDamage

glossy laurel
#

Yeah thats what ive been using i think

#

And

#

It doesnt register when people take token into hand at last second

#

For ?? reason

#

And it doesnt work when another plugin modifies damage later

eternal oxide
#

token? you mean a totem?

#

if they equip a totem they will not die

#

you need to be listening late to allow other plugins to modify damage

#

Priority High

glossy laurel
#

And appearantly if they take it in their hand last second it breaks

#

And doesnt register

#

Is there some inventory update time or smth

glossy laurel
eternal oxide
#

If they equip it just before the damage hits they will not die

glossy laurel
#

🤷‍♂️

eternal oxide
#

No High goes after normal

glossy laurel
#

Why

#

Wb low

remote swallow
#

Lowest Low Normal High Highest Monitor

glossy laurel
#

That doesnt really matter tho

remote swallow
#

it does

glossy laurel
#

I need to fix the totem bug and idk how

remote swallow
#

if you listen on normal but something modifies on high you wont know about it

eternal oxide
#

If they equip a totem before teh damage there is nothing to fix

#

The totem gets used and they don't die

glossy laurel
#

Does damage and death occur on same tick?

eternal oxide
#

probably not

glossy laurel
#

Fu

#

Fr? 😭

grim ice
#

does checking event.getFrom().equals(event.getTo()) in player move event exclude the cases where the player moves their head

eternal oxide
#

no

#

compare x/y/z or toVector first

grim ice
#

how many times

#

does the event run a second

#

20 times, right?

rough drift
#

each received packet

#

it is not fixed

grim ice
#

o

eternal oxide
#

it can be hundreds

slender elbow
#

there is a minimum delta for it to fire

#

in fact, if you move in very small amounts, the event won't fire at all

glossy laurel
#

Guys, does totem check occur on entitydeathevent or entitydamageevent?

#

And if its deathevent, does it run on the same tick as damage event

eternal oxide
#

you can easily check yoruself. sysout in each event

glossy laurel
#

Hm

#

Okay then tell me this

#

If someone dies

#

Nvm actually

#

F this

#

How do you do command cooldowns in plugin.yml

eternal oxide
#

You don't

blazing ocean
#

?cooldown no idea if this is for commands

#

wait

remote swallow
#

?cooldowns

undone axleBOT
blazing ocean
#

i thought thag was a thing???

#

oh ffs

remote swallow
#

plural

glossy laurel
#

When a player dies

#

Can I respawn them and do stuff with them at the same tick

eternal oxide
#

no

glossy laurel
#

Nah thats it

#

Im switching to paper

#

Good bye

blazing ocean
#

lol

lofty violet
#

hello ~ ,I'm trying to find an event that listens for when a player uses a brush on a block in Minecraft. Is there a specific event for this player-block interaction?

eternal oxide
#

interact event

lofty violet
# eternal oxide interact event

thx,but I tried it interact event can only detect the first time a player right clicks on a block, not when he brushes the block.

and it seems that when the player keeps right clicking on the block it only triggers the interactEvent once.

sly topaz
#

I'm asking since I don't play newer versions so I don't understand the concept of brushing lol

eternal oxide
#

I can honestly say I've never brushed a block

sly topaz
#

I know it is a new thing but idk what it does nor if the server sends a packet regarding more than the initial interaction tbh

#

let me check ig

glossy laurel
lofty violet
#

Since I'm trying to make a Dark Souls-like message system, I wanted to use Brush to do the reading of the messages

sly topaz
#

it is similar to breaking block animation, there must be a packet sent

glossy laurel
#

How do I switch to paper

eternal oxide
#

lol

#

asking in Spigot how to switch to paper

lofty violet
sly topaz
glossy laurel
eternal night
#

might be worth asking in paper instead

blazing ocean
#

?whereami

lofty violet
torn shuttle
#

guys

#

my sister gave me a ticket for minecraft the movie for my birthday

#

I just turned 30

eternal oxide
#

refund it. Don't let anyone profit from that trash

lofty violet
torn shuttle
#

... the movie isn't out

#

it's out in like 6 months

grim ice
#

how do i prevent Entity.setLeashHolder(null) from dropping a leash item

glossy laurel
lofty violet
grim ice
glossy laurel
sly topaz
#

so, there's just no event to handle that, but there could be one

#

make an issue in the jira about it

glossy laurel
#

Guys, only the knockback itself is cancelled on entityKnockbackEvent but everything else is on entityDamageEvent (like particles and entity turning red) right?

sly topaz
#

you want to disconnect the leash holder from the leashed entity, without the leash dissapearing?

glossy laurel
#

so I assume just make the leash disappear

sly topaz
#

that's what setting leash holder to null does

#

ah right but the leash item drops

worldly ingot
#

Like I said yesterday or whenever it was I responded, it's probably a CraftBukkit bug that can be fixed. We've fixed a lot of method calls dropping lead items when they shouldn't

sly topaz
#

ig if you wanted it to drop then you could just drop it yourself

worldly ingot
#

Entity#setLeashHolder() shouldn't

#

Yes

slender elbow
#

choco

sly topaz
#

Paper has an event to define that behavior it seems

slender elbow
#

i am STARVING of doggo pics

worldly ingot
#

Well that's because I'm not with the doggos at the moment lol

#

In 2 weeks I will

slender elbow
#

D:

#

😔

eternal oxide
#

Best doggo ever. RIP Jan 2024

worldly ingot
#

Very fluffy

slender elbow
#

nooo poor baby

eternal oxide
#

She was 17.5 years old though

grim ice
slender elbow
#

jesus

#

still a baby

#

pets are always baby

eternal oxide
#

yep

remote swallow
junior cradle
#

How can I make the world I created so that all the changes that were in it are not saved? and so that blocks are not updated like the gravity of blocks is not a purely zero world
I even tried through NMS and it was useless!

 private void noSaveWorld(@NotNull final World world) {
        final ServerLevel serverLevel = ((CraftWorld) world).getHandle();
        serverLevel.hasPhysicsEvent = false;
        serverLevel.noSave = true;
    }
vast ledge
#

Just clone the world you wan to default to, and on start delete the copy, and copy it again

junior cradle
blazing ocean
#

You just copy the directory and then create the world with the name of that directory

glossy laurel
#

does Inventory.getContents() get a snapshot of an inventory or like a pointer or smth

#

like can it change after you get it

peak depot
#

why is new TranslatableComponent(mobOrder.get(0).getTranslationKey()).getTranslate() not giving me the translate?

remote swallow
#

you have to send the component

#

the server has no idea what the translation is, the client translates it when it recieves it

peak depot
#

as a TextComponent?

remote swallow
#

iirc you should be able to just send the translateable component directly

#

Player#spigot().sendMessage

robust jolt
#

Hi, does Spigot integrate some kind of command parent system?

#

Like /mypluginprefix <command> <args>

remote swallow
#

sub commands are entirely up to you to create

robust jolt
#

ok, thanks

glossy laurel
junior cradle
young knoll
#

There’s APIs that are already part of spigot

#

That can copy a folder

junior cradle
young knoll
#

What

slender elbow
#

just delete and copy the folder

young knoll
#

Actually wait spigot deprecated the built in Apache commons didn’t it

#

You can still just shade it yourself tho

ancient plank
#

yer

#

been having that on my plugins, keep forgetting about it then I go to build and fwomp I gotta go shade it

young knoll
#

And with that you can use FileUtils#copyDirectory

river oracle
young knoll
#

Wat

river oracle
#

So like mark the version they use ad provided

young knoll
#

But spigot includes everything minecraft does

#

Because yknow, obviously

river oracle
young knoll
#

The api might not

#

But obviously the server does

river oracle
#

Unless md patched out where they use it I'd be unsure to say it's gone

#

It's in their library list iirc

young knoll
#

Just check the pom smh

river oracle
#

Maybe it's just unused in internals and md cut it

young knoll
#

Seems weird for Mojang to just leave it around

#

But I guess they’ve done weirder things

river oracle
#

It's so weird

#

Like they recently bundled asm??? And jackson

#

Like wat

young knoll
#

I assumed they used asm for something

#

Do they not?

river oracle
slender elbow
#

minecraft performs no reflection, let alone runtime code generation

#

asm and jackson are a transitive dependency of some microsoft library

#

that they use in.. like... three lines of code

smoky oak
#

does anyone know what it means here by 'path not found'?

remote swallow
#

dont forget we have azure in mc now

eternal night
#

We also have tracy

remote swallow
#

whos tracy

slender elbow
#

daddy's little girl

eternal night
river oracle
young knoll
#

It’s a debugger

river oracle
#

Ah

eternal night
young knoll
#

/ performance analyzer

river oracle
eternal night
#

Think like, spark but for the client

#

I guess

slender elbow
#

OrdOrOrOrdOrdOrOrOrdOrdOrOrOrdOrdOrOrOrdOrdOrOrOrdOrdOrOrOrdOrdOrOrOrd

eternal night
slender elbow
#

true

river oracle
young knoll
#

How many generics is too many generics

remote swallow
#

872

river oracle
young knoll
#

Quadlet<Triplet<Pair<A, B>, C>, D>

sly topaz
river oracle
eternal night
proper cobalt
#

Hey guys I am spawning armor stands like this successfully

    public static int spawnEntity(Player player, Location location, EntityType entity) {
        // 0x01
        PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.SPAWN_ENTITY);

        int id = intRange.getRandom();

        packet.getIntegers().write(0, id); // VarInt
        packet.getUUIDs().write(0, UUID.randomUUID()); // UUID
        packet.getEntityTypeModifier().write(0, EntityType.ARMOR_STAND); // VarInt (StructureModifier<EntityType>)

        packet.getDoubles() // Double
                .write(0, location.getX())
                .write(1, location.getY())
                .write(2, location.getZ());

        packet.getIntegers() // Angle
                .write(0, (int) (location.getPitch() * 256.0F / 360.0F))
                .write(1, (int) (location.getYaw() * 256.0F / 360.0F));

        protocolManager.sendServerPacket(player, packet);

        return intRange.getRandom();
    }

But I can't put a diamond block on the armor stand head for example

    public static void setEquipment(Player player, int entityId, String base64) {
        // 0x5B

        // TODO(): Unfinished

        PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_EQUIPMENT);

        packet.getIntegers().write(0, entityId);
        List<Pair<EnumWrappers.ItemSlot, ItemStack>> list = new ArrayList<>();

        if (base64 != null) {
            System.out.println("jpg");
            list.add(new Pair<>(EnumWrappers.ItemSlot.HEAD, new ItemStack(Material.DIAMOND_BLOCK)));
        }

        packet.getSlotStackPairLists().write(0, list);

        protocolManager.sendServerPacket(player, packet);
    }

Theres no errors, whats wrong

sly topaz
#

where does the getSlotStackPairLists method come from

proper cobalt
#

protocollib

sly topaz
#

that isn't a method of PacketContainer though

proper cobalt
#
    public StructureModifier<List<Pair<EnumWrappers.ItemSlot, ItemStack>>> getSlotStackPairLists() {
        return this.getLists(BukkitConverters.getPairConverter(EnumWrappers.getItemSlotConverter(), BukkitConverters.getItemStackConverter()));
    }
proper cobalt
sly topaz
#

oh nvm it is from AbstractStructure, which PacketContainer extends

proper cobalt
#

Yea

blazing ocean
sly topaz
#

also, try it on a real entity instead of a fake one

#

wait

#

you're using a random number for the entity id

#

you shouldn't do that, it could pick a number of an already existing entity

#

use Bukkit.getUnsafe().nextEntityId()

eternal night
blazing ocean
slender elbow
sly topaz
remote swallow
#

my favourite purpurmc emote

remote swallow
sly topaz
#

I already questioned yesterday why they're doing client-side entities at all but who knows

eternal night
sly topaz
eternal night
#

nextEntityId() is paper-api only

remote swallow
#

what is the message directly before he sent the paper emote

sly topaz
#

that's crazy 🐢

#

I always forget to look in spigot javadocs when chatting here

remote swallow
#

stay in paper 👍

eternal night
#

not that, imo, that is a smart method anyway. PL should supply something

echo basalt
#

protocollib has a method for that

eternal night
#

yea perfect

#

the API exposing network ids is dumb

sly topaz
#

in a different note, it kinda surprised me to see how the packet is encoded

#

I wouldn't expect Mojang to write code that cares about bandwidth to this extent, though I don't know with what frequency the set entity equipment packet is sent

eternal night
#

a good amount of times. The packet is sent whenever like durability changes e.g.

sly topaz
#

that makes sense, good that they're saving that one extra byte then

eternal night
#

Yea KEKW

#

tbf I wonder if they could improve that and potentially only send like, a DataComponentPatch

#

instead of the full stack

sly topaz
#

aside from checking the count, it just checks if the component maps aren't the same when checking if there were equipment changes, so you might be right

#

do component patches have a codec tho

glossy laurel
#

what is this nms nerd talk 😭

proper cobalt
#

ill try what u said tho

#

wait bruh i was calling the random function again at the end

#

thats prob why

#

well i meant to return id, which i do now but still nothing

proper cobalt
#

maybe something here is wrong?

#
public void spawn(Player player, Location location) {
        int id = PacketEntityUtils.spawnEntity(player, location, EntityType.ARMOR_STAND);
        PacketEntityUtils.setEquipment(player, id, ConfigValue.Wardrobe.LEFT_BUTTON_SKIN.getValue());
    }
sly topaz
# proper cobalt thats prob why

it doesn't matter, if it is the same entity id as an existing one, that'll cause issues (though I think adding an existing entity id will cause a warning in console)

#

also, did you try setting the equipment of a real armor stand, or just a random mob?

proper cobalt
proper cobalt
sly topaz
#

since the spawn entity is in fact working properly

proper cobalt
#

yeah

#

what do u suggest i try

sly topaz
#

spawn an entity the normal way

proper cobalt
#

kk

opaque cove
#

Hi I have some problems with this lines 😄 Can someonehelp me?
package de.stauder.test.listener;

import org.bukkit.GameMode;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerGameModeChangeEvent;
import org.bukkit.plugin.Plugin;

public class GamemodeListener implements Listener {

@EventHandler
public void onGamemode (PlayerGameModeChangeEvent event, Plugin plugin) {
    if (!event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
        event.getPlayer().setGameMode(GameMode.SURVIVAL);
    }
}

}

sly topaz
proper cobalt
#

yeah ill try that

sly topaz
opaque cove
#

It wont activate the plugin if i start the server

sly topaz
#

also, you can just cancel the event instead of setting the gamemode to survival

sly topaz
opaque cove
#

yep

sly topaz
#

well, send it then

#

?paste

undone axleBOT
opaque cove
#

i changed it now to: @EventHandler
public void onGamemode(PlayerGameModeChangeEvent event, Plugin plugin) {
if (!event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
event.setCancelled(true);
}
}
}

sly topaz
#

why is there a plugin parameter in the method

proper cobalt
#

would you look at that, the entity spawned using World#spawnEntity does have the diamond helmet

opaque cove
#

the error code is too long for discord

sly topaz
proper cobalt
#

so how can i also allow the packet armor stand to hold the helmet

#

well look what im doing now

sly topaz
proper cobalt
#
public static int spawnEntity(Player player, Location location, EntityType entity) {
        // 0x01
        PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.SPAWN_ENTITY);

        int id = Bukkit.getUnsafe().nextEntityId();

        packet.getIntegers().write(0, id); // VarInt
        packet.getUUIDs().write(0, UUID.randomUUID()); // UUID
        packet.getEntityTypeModifier().write(0, EntityType.ARMOR_STAND); // VarInt (StructureModifier<EntityType>)

        packet.getDoubles() // Double
                .write(0, location.getX())
                .write(1, location.getY())
                .write(2, location.getZ());

        packet.getIntegers() // Angle
                .write(0, (int) (location.getPitch() * 256.0F / 360.0F))
                .write(1, (int) (location.getYaw() * 256.0F / 360.0F));

        protocolManager.sendServerPacket(player, packet);

        return id;
    }
#

Now the id cant be wrong

opaque cove
#

i pasted it there but what now? 😄

sly topaz
#

well, save it and send the link here

#

there's buttons on the top right

opaque cove
#

lol it says it cannot find the main class but i didnt changed it xD

#

it cannot find the main class but i never changed it i think

sly topaz
#

why is the main class called Test

#

can you send a screenshot of your folder structure

opaque cove
#

cause this started as a test 😄

sly topaz
#

also, make sure there isn't a typo or something

sly topaz
#

let me check the client code, maybe it is disallowing the change of equipment from non-existing entities, though that doesn't make sense at all

proper cobalt
opaque cove
#

i cant send pictures here

opaque cove
sly topaz
#

(they sent it in DMs, putting it here for context)

#

@opaque cove this main class is called Main, not Test lol

#

check if the DamageSource#getEntity is an evoker spell

deft locust
#

how can i make the memory usage profiler with spark?

proper cobalt
#

maybe theres a way to spawn a real armor stand but just hide it from everyone except one player instead of using packets @sly topaz

opaque cove
#

i tested several de.stauder.test etc pp things but it still cant find it

sly topaz
#

or Player#hideEntity if it is already spawned

proper cobalt
#

yeah but i need one player to see it

#

doesnt that hide it for evrryone

sly topaz
#

no, that hides it for the player you call it on

#

so, you'd have to do it for everyone but that player

proper cobalt
#

kk

sly topaz
#

what are you doing with this armor stand by the way

proper cobalt
#

gonna make it like a button

#

ill add a custom head with arrows

#

and then like invis potion

sly topaz
#

could just use display entities instead

proper cobalt
#

not on latest vers

#

wait

#

display entities exist on 1.19.4 right

#

thats my version

sly topaz
#

yes

proper cobalt
#

nice and i can spawn custom heads and listen to when theyre clicked ye

sly topaz
#

you'd have to spawn an interaction entity since they don't have a hitbox, but yes

eternal oxide
#

there is no interact on display entities

#

I typed slow

proper cobalt
#

ok so just spawn 2 display entities

#

cooll

sly topaz
#

honestly, if you want the interaction it might be worth to just use the armor stand lol

#

but idk, use what you feel is the best

proper cobalt
#

ah ok

eternal oxide
#

just add an Interact entity as a passenger to a DisplayEntity

proper cobalt
#

whats the display entity for a block called

eternal oxide
#

use Display Entities. BlockDisplays are a pain

sly topaz
#

it's all the same, and if they need to display a block they have to use a block display lol

#

or a transformed item display but eh

proper cobalt
#

its asking for BlockData

#

how can i pass a custom skull into that

sly topaz
#

do you have it as an item?

#

if so, just use an item display

proper cobalt
#

ok

glossy laurel
#

does replacing a plugin jar of a plugin that is currently being used in the server affect the plugin's functionality

opaque cove
#

My code doesnt seem to work ._. I created a new project so it can finde the main class etc but my code wont cancel changin the gamemode

echo basalt
glossy laurel
#

does it

#

can it*

#

result in a bunch of NPEs, tab completers and events breaking?

eternal oxide
#

yes

glossy laurel
#

uhm

sly topaz
#

why are you doing that anyway

glossy laurel
#

I may or may not have just cooked a 70 player server

sly topaz
#

testing in prod 💀

#

schedule a restart my man

glossy laurel
#

well basically I thought it doesn't affect anything

eternal oxide
#

Blame it on Mojang and promise a server wipe with the next update

glossy laurel
#

appearantly it does

opaque cove
#

Pls help me ._. this code wont stop me from changing the gamemode

public class GamemodeListener implements Listener {

@EventHandler
public void onChange(PlayerGameModeChangeEvent event) {
    if (!event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
        event.setCancelled(true);
    }
}

}

eternal oxide
#

get teh mode from the event not the player

sly topaz
#

ah, that too

opaque cove
proper cobalt
eternal oxide
#

yes

proper cobalt
#

awesome

lapis lark
#

an error for buildtools on 1.21.1, windows. any workarounds so far?

opaque cove
#

My testing server is crashing with this code ._. I want to interrupt all commands that puts u in another gamemode other than survival. and if ur in another gamemode then ur going to be in survival by the plugin. how can i do that?

#

@EventHandler
public void onChange(PlayerGameModeChangeEvent event) {
if (event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
event.setCancelled(true);}
else {
if (!event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
event.getPlayer().setGameMode(GameMode.SURVIVAL);
}
}
}
}

eternal oxide
#

event.getNewGameMode() !=

opaque cove
#

why the != ?

eternal oxide
#

whatever == or != depends on the logic you want

#

You currently are checking the players current game mode, not the new one trying to be set

opaque cove
#

but im already checking it by getting their gamemode with event.getPlayer().getGameMode()

eternal oxide
#
if (event.getNewGameMode() != GameMode.SURVIVAL) {
event.setcancelled(true);
}```
young knoll
#

You are calling setGameMode in the game mode change event

#

Which calls the event again

eternal night
#

to infinity and beyond

left jay
#

hey so my command doesnt work, can someone help with this?

public class Mace implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
        if (commandSender instanceof Player player) {
            ItemStack mace = new ItemStack(Material.WOODEN_SHOVEL, 1);
            player.getInventory().setItem(1, mace);
        }
        return true;
    }
}

getCommand("generatemace").setExecutor(new Mace());
robust jolt
#

Hi, how can I get a player from a string?

#

Like the playername

left jay
young knoll
#

Bukkit#getPlayer or getPlayerExact

robust jolt
#

Thanks

river oracle
#

I feel love getPlayerExact does what most people think getPlayer does

young knoll
#

Is getExact case insensitive

#

Or is it exact exact

river oracle
#

Exact is exact getPlayer is the weird one

young knoll
#

Boo

river oracle
#

I'd have to reread the java doc to remember what it does

young knoll
#

I want it at least case insensitive

river oracle
#

?jd-s

undone axleBOT
young knoll
#

Ah exact is case insensitive

#

Nice

river oracle
#

TIL matchPlayer exists

young knoll
#

getPlayer just looks for the closest match

#

I know essentials uses it for their commands

#

Can be pretty convenient sometimes

sly topaz
#

matchPlayer does the same, but the name isn't confusing

young knoll
#

matchPlayer returns a list

eternal night
#

#getFirst

young knoll
#

What if it’s empty

eternal night
#

But that method is pre tab-complete era

#

cry about it

young knoll
#

Now I need an isEmpty check instead of a null check

#

How will I survive

river oracle
eternal night
river oracle
#

But before that even I gotta do plugin loader shenanigans

#

Welp ima stay focused on inventory for now and cope later

eternal night
#

See, if you manage to get that merged, at least you could always be proud of the person that initiated softspoon

sly topaz
#

wait, why is matchPlayer deprecated in paper I was looking at the impl method lol

river oracle
young knoll
#

Ah wait no I can use streams

#

Perfect

eternal night
young knoll
#
Player player = Bukkit.matchPlayer(name).stream().findFirst().orElse(null);
#

Beautiful

eternal night
#

next coll finds out about guava iterables

river oracle
#

Well not like yall care kekw

eternal night
#

Iterables.getFirst(Bukkit.matchPlayer("SuckMa"), null)

river oracle
eternal night
sly topaz
#

wish List had a getOrDefault

young knoll
#

I only use pure java

sly topaz
#

probably commons

young knoll
#

With Lombok of course

river oracle
eternal night
#

you fool

#

Yea google commons iterables

river oracle
#

Commons is dead I killed it with my own two hands

young knoll
#

That’s

sly topaz
young knoll
#

Not

#

Pure

#

I will be speaking to your manager

eternal night
river oracle
#

Coll only writes bytecode for maximum jvm speed

young knoll
#

Ah yes of course

river oracle
#

INVOKESPECIAL Coll1234567

young knoll
#

Raw ASM is too fast for me but I still like to get a similar flavour

river oracle
#

ASM has the perfect language design

sly topaz
river oracle
young knoll
#

I’m special :D

river oracle
#

Who knows

#

My mum said in all the kinds of special

eternal night
young knoll
river oracle
remote swallow
#

i love the fact that mum is meant to be british version but i dont know any british person who uses it

#

only americans

sly topaz
#

I am restraining myself from making an autism joke

sly topaz
remote swallow
#

no

#

i meant to send it here

sly topaz
#

very development indeed

remote swallow
#

this is just general 2

#

always has been always will be

proper cobalt
#

is there an alternative to GameProfile in spigot

eternal oxide
#

PlayerProfile

#

GameProfile is NMS

sly topaz
#

actually just a mojang library, but it is internal as well EmojiNerd

eternal oxide
#

yep

sly topaz
#

I hate how nms became synonymous with internal classes in the bukkit community

proper cobalt
#

it was working with GameProfile BUT it was applying the wrong skin

#
        PlayerProfile profile = Bukkit.getPlayer(owner).getPlayerProfile();

        Set<ProfileProperty> properties = profile.getProperties();

        String value = "";
        String signature = "";

        for (ProfileProperty property : properties) {
            if (property.getName().equals("textures")) {
                value = property.getValue();
                signature = property.getSignature();
            }
        }
#

the value decoded is valid but the signature is just random characters

#

but i believe thats normal

#

idk'

young knoll
#

Well not the external libs but shh

slender elbow
#

didn't it also relocate non-api libraries into obc?

#

like fastutil

left jay
remote swallow
#

did you register it in plugin.yml

left jay
#

Yep

sly topaz
left jay
sly topaz
#

also, even if it doesn't show up there, is it being executed properly when you use it?

left jay
wary harness
#

why am I getting this error

#

[Server thread/WARN]: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_21_R1.inventory.CraftMetaItem cannot be cast to class org.bukkit.inventory.meta.SkullMeta (org.bukkit.craftbukkit.v1_21_R1.inventory.CraftMetaItem and org.bukkit.inventory.meta.SkullMeta are in unnamed module of loader java.net.URLClassLoader @77a567e1)

hazy parrot
#

are u casting ItemMeta to skull meta ?

olive vault
#

https://paste.md-5.net/axejiyerif.java

I took this from CraftServers createWorld(WorldCreator) method, I need help as i'm getting an error that I have no idea is causing it

java.lang.NoSuchMethodError: 'net.minecraft.core.IdMap net.minecraft.core.RegistryAccess$Frozen.registryOrThrow(net.minecraft.resources.ResourceKey)'

Line 148 - edited

Any help would be appreciated, 😛

wary harness
hazy parrot
olive vault
#

I'm using nms lol

hazy parrot
#

me when i dont even open the link

remote swallow
#

do you have everything that that guide tells you to add

olive vault
#

I compiled purpurs source code, used "build" and all classes load and I did minecraftserver.log and it worked

remote swallow
#

you arent remapping is my guess

hazy parrot
#

^ that is most likely the issue

sly topaz
#

why are you duplicating the createWorld method

olive vault
#

making it less sync

sly topaz
#

fork of spigot/paper or just a plugin?

olive vault
sly topaz
#

I'd recommend just forking if you are attempting to do that

#

though it isn't an easy one still

olive vault
#

its just one method though

#

im removing weird functions like customdimensions

#

in the world creation

sly topaz
#

that doesn't matter, it is a long method that access many parts of the server

#

the reason it hasn't been done yet is because if you want to do it properly, it is kind of a pain in the ass

olive vault
#

if I fork it i would have to change so many classes, Im ujst changing one method

#

whats not proper about that

sly topaz
#

I mean if it works for you, godspeed, not going to stop you there

olive vault
#

so any reason for the error?

sly topaz
#

yeah, this kind of thing is kind of glhf, you're modifying server internals so only people that have deal with internals to this extent would know

#

besides that looks weird

#

why do you have a separate class for the method, where are you implementing this

olive vault
#

in my plugin

#

my server loads 3 worlds in 1 method, (its a speedrun server) so it needs to be async

#

which is very difficult ik

sly topaz
#

why not just load the worlds on startup

olive vault
#

it makes a world under the players uuid_NETHER, uuid_THE_END, uuid_NORMAL

#

actually last one is just uuid

#

and the seed changes too

#

so that

sly topaz
#

so you make a world per player that joins? That doesn't sound sustainable at all lol

#

welp, good luck

olive vault
#

ty

pliant topaz
olive vault
#

they are

#

after 1 hour or when server restarts

pliant topaz
#

thats good, sounds pretty sustainable

olive vault
#

but the problem is world loading lags the server a shit ton

#

like 3000 milis

#

but the server can handle after it loads

#

the plugins all coded i just gotta fix world generation

sly topaz
#

why not just disable spawn chunks, when creating, that's what causes the lag spike for the most part (since it has to generate those)

olive vault
#

already did

#

TRISTATE.FALSE

#

i remember that since it took me a hour to figure out that slightly fixes it

sly topaz
olive vault
#

I saw that but they dont accept seeds

#

atleast not what i looked at it before

#

also its not 1.21.1

grim ice
#

how do I send files along with http requests

#

Similar to this, in python

#

Found this example:

#

But this sends a url instead of a file

#

nvm

olive vault
#

Because making a fork is not an option for me

hybrid spoke
#

or use mvworld they do it a bit faster

olive vault
#

im using purpur

hybrid spoke
#

otherwise cancel spawn chunk generation

#

that will save up a lot of time on world generation

olive vault
#

already did

#

in the code in the video its set to false

#

it says it takes 2 ms but does it really??

#

theres gotta be some functions taking up thread

hybrid spoke
#

no idea what keepSpawnLoaded does, but i always cancelled the event

#

could do the same but no idea

hybrid spoke
olive vault
#

ooo good idea but

#

idk how to use spark lol

#

all I know is the cmds

hybrid spoke
#

yeah just put it on your server, start the profiler, do your world generation, stop the profiler and it will spit out a link

#

you can just post it and we have a look together

olive vault
#

I made a new speedrun and thats what spark pooped out

#

also it thinks odilitamenus is at 30% cause im using it as an api for inventory creatoin

hybrid spoke
#

everytime i follow the high percentages it ends up in native lol

olive vault
#

oh like java source code ? lol

hybrid spoke
#

i mean im not that good at analyzing spark either, but this looks not normal to me

olive vault
#

im using pelican panel

#

docker

#

1000% cpu

#

10 gb ram

hybrid spoke
#

ah

olive vault
#

aikers flags

#

I just looked on reddit, i think thats normal

#

wish I could do another linux java thingy

hybrid spoke
young knoll
#

Disable keepSpawnInMemory in the WorldCreator

#

And have a fixed spawn location

olive vault
#

but thats deprecated?

#

alr nvm

#

ill do that

young knoll
#

Neither of those are deprecated

olive vault
#

in purpur it is

#

'keepSpawnInMemory(boolean)' is deprecated and marked for removal

hazy parrot
#

?whereami

quiet ice
olive vault
#

but Im rarely using purpurs classes so I doubt it matters

#

or papers

young knoll
#

Clearly it does

#

Since it’s not deprecated for removal on spigot

olive vault
#

Ill just cancel the event in WorldInitEvent

#

since its deprecated

quiet ice
#

I'd recommend to look at why they are deprecated first

olive vault
#

@Deprecated(forRemoval = true) // Paper

#

oh

remote swallow
#

read the javadocs

olive vault
#
  • @deprecated use {@link #keepSpawnLoaded(net.kyori.adventure.util.TriState)}
#

told u

#

i was right

#

the tristate is correct

young knoll
#

It’s not correct

#

This is the spigot discord

quiet ice
#

So just use that method instead

olive vault
#

and I need help with a spigot problem

#

ive been using that method

#

the problem is my world loading is laggy

young knoll
#

Did you set a fixed spawn

olive vault
#

I will do that

#

ill set it to like 0 100 0

#

and disable fall dmg for like 3 seconds

young knoll
#

How is that a tri state anyway

quiet ice
young knoll
#

What does having it unset do

olive vault
#

its just a boolean

eternal night
#

default to config on UNSET

olive vault
#

oo

young knoll
#

What config

eternal night
#

a paper config

young knoll
#

Ah one of your cringe files

eternal night
young knoll
#

Always clogging up my disk space

#

And uhh

#

Yeah

eternal night
remote swallow
#

ur bandwidth

young knoll
#

Yeah everyone knows the config gets sent to the client

quiet ice
# eternal night default to config on UNSET

Controls if a world should be kept loaded or not, default (NOT_SET) will use the servers standard configuration, otherwise, will act as an override towards this setting
Yep

young knoll
eternal night
#

One would hope I recall that javadoc, I reviewd that PR KEKW

young knoll
#

Spigot loads fast now

#

Thanks Mojang

remote swallow
eternal night
#

Who does sftp tho

quiet ice
remote swallow
#

no the real question is who does ftp

quiet ice
#

I use sftp, what else?

young knoll
#

ftp

eternal night
#

scp stonks

young knoll
#

The government can spy on my config files and bad code all they want!

remote swallow
#

fuck the police alert

eternal night
quiet ice
#

Well, gradle doesn't support any of the three anyways lol

eternal night
#

Yea the gradle task are pretty ass for that

young knoll
#

Pretty sure gradle is an SCP

quiet ice
#

I have no idea what scp is tbh

#

But if it requires a private-public key pair, it probably doesn't support it in a decent manner (or it does, just with a bunch of Asterisks that make it kinda not worth it sometimes)

young knoll
#

No it requires several D class personnel though

olive vault
#

lol

quiet ice
#

Don't worry, my mixins will handle the job

#

Otherwise if all stricks reißen, I shall use ASM.

eternal night
#

Alle Stricke reißen never

olive vault
#

so noone knows another method to make the world load faster?

echo basalt
echo basalt
olive vault
#

its a old server

#

like 2012

#

(dedicated)

#

also what do I do about teleporting the player to a unloaded chunk

#

should I load the chunks before I teleport the player?

young knoll
#

You could

#

And do so slower

olive vault
#

wait

#

how would I load it slower

#

oh wait nvm

#

im stupid

#

🤓

#

ill use bukkit scheduler

spare pilot
#

Hi! I'm programming mobs with MythicMobs and so far everything has been correct, but I have a question that maybe someone can help me with. I’m creating pillagers that, instead of having crossbows, have bows (so they have the same attack range as players). However, when I give them the bow, it seems like they can’t use it and remain passive. If I remove the - BOW HAND argument, they revert to using crossbows and attack without any problem. Does anyone know what I might be doing wrong? I’m new to this and feeling a bit lost. Thanks in advance! I’m including the code in case it’s useful:
Execrat:
Type: PILLAGER
Display: 'Execrat'
Health: 30
Damage: 5
Equipment:

  • LEATHER_HELMET HEAD
  • BOW HAND
    Options:
    PreventOtherDrops: true
    AlwaysShowName: true
    Despawn: true
    Glowing: false
olive vault
#

bro just made a discord account to join this server

spare pilot
#

I already had one but redirected me to create new one (i'm a boomer, my bad). I don't know if I posted this in the correct place, sorry if I didn`t! I just clicked de discord link in the official plugin web. Didn't want to bother anyone, sorry!

remote swallow
spare pilot
#

Oh! Thanks so much!

undone axleBOT
ancient forge
#

is someone willing to help me in dms Im trying to send a .txt note of my code in here but i cant attach. Please msg me in dms if you can help

river oracle
#

?paste

undone axleBOT
maiden gorge
#

Hello there! I am working on a project making a Multi-Sports Network on Minecraft with multiple different sports! I am in need of a Coder / Developer that can create plugins for different sports such as, American Football, Baseball and many more! If you are interested in helping out with the project, please DM me and we can talk more about it! I can give any information and details about the project if you would like to know any other details about it!

Thank you and have a good day!

river oracle
ancient forge
#

alright

undone axleBOT
ancient forge
ancient forge
#

lmk if this works i added 2 classes to it. I added my listener and my cmd class

#

So the error that im getting is that the world is null

#

and the if statements leading up to the teleport(lines 50-63) no message is sent

river oracle
#

doing menus like this is very not great

#

I'd refactor your setup

#

?gui

ancient forge
#

what about the world issue??

young knoll
#

You know location is directly configuration serializable

#

I believe there’s even a getLocation for convenience

ancient forge
#

Well i have the location saved, but i do not understand why it is having issues. If i look in the warp file that is created for each warp it has to world and the name is just world. I check the world name and all it is, is world, so i do not understand why I cam getting null

humble tulip
#

design wise, it it okay if an object interacts with it's manager?

#

like if i call cancel on an object, it's okay to remove itself from a map in it's manager?

drowsy helm
#

like it's fine to do, just doesn't follow SRP

ancient forge
#

anyone help me please??

humble tulip
#

that seems so roundabout tho

#

but also cleaner in instances

#

imma do what feels right ig

drowsy helm
#

thats if it utilised OOP

humble tulip
#

i see

#

just feels wrong putting a addScoreToGame method in a manager

#

rather than in the game class itself

drowsy helm
#

whats the context?

humble tulip
#

a running minigame. basically alongside a regular server, not a dedicated minigame

#

players get score by killing entities

#

i need to check on each score add if the score has reached a threshold

#

and then do something if it does like end the game

wet breach
ancient forge
wet breach
#

Nvm found your issue

#

You forgot . at the last of the paths

#

So its world but should be .world

ancient forge
#

i adapted to a mistake

wet breach
#

You misunderstand

ancient forge
#

oh

#

let me double check

wet breach
#

String worldName = config.getString( "warps." + warpName + "world");

#

At the end it should be .world

#

Same for all the other paths

ancient forge
#
  2world: world
  2x: -151.3256430023556
  2y: 76.0
  2z: -54.476496705921825
  2yaw: 99.499916
  2pitch: 17.722551
  2admin: false

this is how it saves

wet breach
#

Ok saving is not your issue

ancient forge
#

im still calling it wrong?

wet breach
#

I told you the issue

#

You are missing . In your paths at the end

wet breach
#

Making the path incorrect

ancient forge
#

What confuses me is for a normal /warp it works and i dont have the . in the paths

drowsy helm
#

As long as it’s not too convoluted

ancient forge
#

im still getting name cannot be null for the 2 lines i stated

humble tulip
#

But then ill have to call a method from the game manager via the game class

wet breach
#

All the paths in that method need fixing

ancient forge
#

should i change it for the saving as well then and try that?

wet breach
#

Probably

#

Because without that . Your path is actually warpnameworld

#

When it should be warpname.world

ancient forge
#

im still getting the same error

#

saying that the world is null

#

?paste

undone axleBOT
wet breach
#

Well lets see the stacktrace and the updated stuff now

ancient forge
#

this is what i have now with the listener and other

wet breach
#

Ok lets see the stacktrace

ancient forge
#

here is the exact error

wet breach
#

Ok well that is not an error with location. That is a problem in your listener with some kind of name

#

So in onClick your conditional checks are setup incorrectly where the bottom portion doesnt check if warpname is not null

quaint mantle
#

?cooldown

#

?cooldowns

undone axleBOT
quaint mantle
#

is there any way to add cooldown to items? is it possible with packets?

ancient forge
#

well when i click in chat i set it so it would print the warpname and it prints as shown

wet breach
#

Well for some reason that bottom portion is not getting the warpname because it gets set in the first if but only if that first condition runs

#

But when that first condition doesnt run but the second one does. Warpname is set to null since nothing changed it

#

I can only tell you what the error is saying

#

Your conditions need to be restructured to avoid that scenario

young knoll
#

It’s per material tho

quaint mantle
#

oh

#

i see

#

well i guess ill have to do it other way

viscid carbon
#

Java counts from zero, is there a better way to make it 1?

viscid carbon
#

if (this.getTaskAmount(uuid, task) >= taskManager.getTasksRequirement(task).amount() - 1) {

quaint mantle
#

why u want it

#

js count from 0

young knoll
#

Java indexes things from 0

#

It does not count from 0

#

A list with 1 item will have a size of 1

quaint mantle
#

but for java it's "0"

viscid carbon
#

I know but say i put that the amount is 5

Diamond_block broke: 1
Diamond_block broke: 2
Diamond_block broke: 3
Diamond_block broke: 4
Diamond_block broke: 5
Diamond_block broke: 0```
quaint mantle
#

put 4

#

🤷🏻‍♂️

viscid carbon
#

i always have just did what i need - 1 xD

if (this.getTaskAmount(uuid, task) >= taskManager.getTasksRequirement(task).amount() **- 1**) {
}```
quaint mantle
#

k

viscid carbon
#

k

young knoll
#

You can always increment before you check

#

Either works

worldly ingot
#

I thought **- 1** was some weird-ass Java syntax I'd never seen before

#

I realize now you were emphasizing