#help-development

1 messages · Page 412 of 1

tardy delta
#

ahh cmon

#

what is this crap

heavy mural
#

I see, thank you

#

Now it's time to look over the internet how to create a clientside entity in 1.19.3 🫡

rough drift
#

ProtocolLib or NMS

heavy mural
#

Nms

rough drift
#

Ouch

tender shard
rough drift
#

good luck lmfao

tardy delta
#

bruh git bash

heavy mural
#

Is protocollib better approachable hmmm?

tardy delta
#

i dont even have that crap

tender shard
quaint mantle
#

It is because the final character is delete which is not a printable one\

chrome beacon
tender shard
#

protocollib is so much more complicated

rough drift
tender shard
#

NMS packets are easy

rough drift
#

I don't like protocol

heavy mural
#

Ah but I only use 1 version

rough drift
#

but, on the other hand it's easier to maintain lol

tender shard
rough drift
#

ah then NMS is fine

rough drift
tender shard
#

ProtocolLib be like getIntegers().set(2, someThing)

#

it'll always compile

#

then fail on runtime

#

with NMS you can see whether it compiles and what fields you need etc

rough drift
#

fair point

#

I mostly like protocol for it's listeners

tender shard
#

change in NMS = you instantly see what has changed.
in protocollib, you'll just get an error on runtime

rough drift
#

Simple command time map BABYYYYYYYYYY

heavy mural
#

Okay ill give it a try through NMS
Do any of you happen to have a good source where I can learn how to create an entity clientside only in 1.19.3?

chrome beacon
#

Only if they register the commands properly

tender shard
tardy delta
#

you better be kiddin' me

rough drift
#

Plugin#getDescription()#getCommands

#

yep

chrome beacon
tardy delta
#

/gradlew?

#

no such file or dir

chrome beacon
#

./gradlew

tardy delta
#

ahh cmon man

chrome beacon
#

Looks like your wrapper is broke or smth

#

Try redownloading it

tender shard
#
SimpleCommandMap commandMap = ((CraftServer) Bukkit.getServer()).getCommandMap();
Stream<PluginCommand> myPluginsCommands = commandMap.getCommands().stream()
        .filter(command -> command instanceof PluginCommand)
        .map(command -> (PluginCommand) command)
        .filter(command -> command.getPlugin().equals(myPlugin));
rough drift
#

Can anyone take a look at #1084938453730459770, it seems as if the angle between the vectors does not change even with the new location

tardy delta
#

redownloading it? i just downloaded gradle?

tender shard
tardy delta
#

so

tender shard
#

no it's not

#

it's not NMS

rough drift
#

Yeah because it's NMS

#

You don't need it for what you're doing

tardy delta
#

spoonfeed me please 🥹

rough drift
#

that snippet is not what you need though

tardy delta
tender shard
#

yeah it's craftbukkit

rough drift
#
for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
  for(Map<String, Map<String, Object>> commands : plugin.getDescription().getCommands()) {
    for(String name : commands.keySet()) {
        PluginCommand command = plugin.getCommand(name);
        // Do your thing with the command
    }
  }
}
``` @last temple @tender shard
tender shard
#

you can do it version-independent with reflection:

    Class<?> craftServerClass = Bukkit.getServer().getClass();
    Method getSimpleCommandMapMethod = craftServerClass.getMethod("getCommandMap");
    SimpleCommandMap commandMap = getSimpleCommandMapMethod.invoke(Bukkit.getServer());
rough drift
#

alex the spigot api literally has it built in

tender shard
rough drift
#

Of course, it's his plugin

tender shard
rough drift
#

morice do you need dynamically generated commands as well

rough drift
#

I don't think he wants dyn commands

#

ah, then go with alex's

tender shard
#

why would one loop over their own plugin.yml

rough drift
#

oh alr

#

then go with alex's, my bad

tender shard
rough drift
#

Also I am wondering why the fuck does the angle between two locations not change if I change their pos

#

like what the hell

tender shard
#

I haven't been to any math classes in the last 12 years lol

#

oh wait, 10 years

rough drift
#

I am bad at maths in general

undone axleBOT
rough drift
#

you should really cache the commands FYI

tender shard
#

you should rethrow the exception, so you get a proper stacktrace in case it goes wrong

tardy delta
#

already hating it

tender shard
#

just warp it into a RuntimeException in the catch block

rough drift
#

Yeah, for each player relog or perm update it will loop over every registered command (and it's aliases)

chrome beacon
tardy delta
#

now only find it

chrome beacon
#

I usually just kill every Java program running but you could start by killing the one with lowest cpu usage

rough drift
#

Spigot do be having opinionated maths fr

tardy delta
#

WMIC PROCESS where "Name like 'java%' AND CommandLine like '%GradleDaemon%'" Call Terminate did the job

worldly mountain
tender shard
#

just kill all gradles with bash ```sh
ps aux | grep gradle | awk '{print $2}' | kill -9

tardy delta
#

windows

tender shard
#

no git bash?

tardy delta
#

ah yes

#

@worldly mountain i know you

worldly mountain
#

I was about to say the same thing

tardy delta
#

making plugins huh

worldly mountain
tardy delta
#

dang

#

no command frameworks 🥹

worldly mountain
#

Huh?

heavy mural
tender shard
tender shard
#

are you using maven?

#

if so:

#

?nms

heavy mural
#

I am

#

nice

worldly mountain
tender shard
#

Not really D:

tardy delta
#

ahh cmon

#

how did the build fail but did it launch the server 🤔

tender shard
#

Does minestom exit with non-0 return code?

tardy delta
#

no

tender shard
#

Run your commandmap stuff one tick later

#

Oh wait you do it in a listener already?

#

Forget what i said

tardy delta
#

still this bruh

heavy mural
#

I had once 2 listeners by accident so everything was casted twice

#

;)

rough drift
#

nah, spigot is already fuckin running opinionated maths

#

it's spigot's issue tbh

tender shard
#

The extra slash is worldedit

#

//brush is /brush in the map

#

are you sure your filter() things are correct?

#

print out your commandsToRemove thing

#

I don't think so, but just try it

eternal oxide
#

the / is part of the command, WE/WG have extra aliases like //br

rough drift
#

Still don't understand the why

heavy mural
tender shard
#

np

rough drift
rough drift
limpid nexus
tender shard
#

Listen on lowest, maybe the other plugins use the preprocessevent to do their stuff :X

remote swallow
quiet ice
#

Does anyone know how to make eclipse not insert @NotNull or @Nullable twice when creating method stubs?

#

And with that I don't mean switching to annotations-java5, I'd like to stay with the recent one

tender shard
#

Use java5-annotations

#

Oh

#

Well

rough drift
#

LMAO

remote swallow
tender shard
#

Then get another ide

quiet ice
#

Well then, time to figure out how to compile eclipse from source

tender shard
#

Whats the problem with java 5 annitations?

rough drift
#

I will commit fell out of the world

remote swallow
#

whats the problem with intellij

tender shard
#

Using them also fixes the javadocs bug

quiet ice
tender shard
#

You can

tardy delta
#

goddamn gradle

remote swallow
#

gradle is love

tardy delta
#

why cant it just work straight from the beginning

quiet ice
#

I believe you cannot - only on methods, fields and variables

tardy delta
#

prev time i cloned this project it worked just fine

quiet ice
#

So you cannot have generics annotated with @NotNull or @Nullable

tender shard
#

which annotations do you currently use?

#

jetbrains?

quiet ice
#

jetbrains of course

#

The eclipse builtin ones are sus

tender shard
#

oh yeah true, they don't have TYPE_USE

#

lombok annotations support types 😛

quiet ice
#

but once you have TYPE_USE and METHOD/FIELD you have the bug occuring

tender shard
#

where / how does it create double annotations?

#

can you show an example

#

all I can say is that lombok's annotations are great and they also don't have the javadoc bug that jetbrains annotations have

heavy mural
#

Do you happen to have a code snippet of spawning an entity clientside only somewhere? I am a bit overwhelmed by the amount of options 🫠

quiet ice
#

Lombok probably doesn't support METHOD and FIELD - which is the only proper way of doing it

tender shard
#

it does

quiet ice
#

Could very well be that IJ doesn't have this bug

#

It really isn't that hard to fix once you find the source.

#

Should just be a weekend project

tender shard
inland siren
#

1.19 packet naming conventions 👎

heavy mural
#

I see. That'll do I was actually fairly close then 🫡

tender shard
#

1.19? They've been called like that forever

heavy mural
#

Tyty

inland siren
#

PacketPlayOutEntitySpawn days

tender shard
#

that's the spigot name

#

mojang never used that name

inland siren
#

oh yeah i forgot i always just used spigot mappings

#

still the better naming conventions

tender shard
#

I don't think so

heavy mural
tender shard
#

you usually send both

inland siren
#

thats a metadata packet

#

vs a spawn packet

tender shard
#

first you spawn it, then the meta data

#

that's how I make "fake entities" visible to a player

#

the "Object entity" is an NMS entity

#

PacketUtils is trivial

heavy mural
#

I see :)
Do you happen to know if a player is able to hit through their clientside entity? As in does it hit a player behind the clientside entity if it's in the way?

tender shard
#

I don't know that

#

probably not

#

since the client itself sends "I clicked on entity with id 123" to the server

heavy mural
#

Fair fair 🤔 I guess I'll find a workaround for that

round finch
#

what do i need to know then it comes to thread and running multiple instance of the minigame on thread?

#

talking about java + spigot ofc

#

would the propper way be to start more threads?

quiet ice
#

If the threads are short-lived: don't.

round finch
#

yeah it is term run for the game itself

hazy parrot
#

any reason you want each instance to be on seperate thread ?

round finch
#

idk I'm just asking consider your question i might consider to make it appear to be on thread

quartz basalt
#

the error is because the beam isnt getting targeted though ( @quaint mantle )

#

the direct cause of the problem is the runnable im asuming

#

the input is the squid which definetly exists

warm mica
quartz basalt
#

this.scheduler = Bukkit.getScheduler().scheduleSyncRepeatingTask(SuperShows.getInstance(), () -> guardian.setTarget(squid), 0L, 1L);

round finch
#

ahh thanks man!

#

probably sounds about right

quartz basalt
#

no it runs once every 1 tick

#

to constantly update it

quartz basalt
#

ill just send my original problem incase anyone else knows

#
        at nesancodev.com.supershows.lasers.Laser.target(Laser.java:71) ~[SuperShows-1.0-SNAPSHOT.jar:?]
        at nesancodev.com.supershows.lasers.LaserCommand.onCommand(LaserCommand.java:25) ~[SuperShows-1.0-SNAPSHOT.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        ... 23 more```
 why is getTarget returning null?
#
   public Laser(String name) {
        this.name = name;
    }

    public void create(Location location) {
        this.location = location;

        this.guardianStand = (ArmorStand) location.getWorld().spawnEntity(location, EntityType.ARMOR_STAND);
        this.squidStand = (ArmorStand) location.getWorld().spawnEntity(location, EntityType.ARMOR_STAND);

        this.guardian = (ElderGuardian) location.getWorld().spawnEntity(location, EntityType.ELDER_GUARDIAN);
        this.squid = (Squid) location.getWorld().spawnEntity(location, EntityType.SQUID);

        this.scheduler = Bukkit.getScheduler().scheduleSyncRepeatingTask(SuperShows.getInstance(), () -> guardian.setTarget(squid), 0L, 1L);

        guardianStand.setInvisible(true);
        guardianStand.setGravity(false);
        guardianStand.setInvulnerable(true);
        guardianStand.setCollidable(false);
        squidStand.setInvisible(true);
        squidStand.setGravity(false);
        squidStand.setInvulnerable(true);
        squidStand.setCollidable(false);

        guardian.setInvisible(true);
        guardian.setGravity(false);
        guardian.setInvulnerable(true);
        guardian.setCollidable(false);
        guardian.setLaser(true);
        squid.setInvisible(true);
        squid.setGravity(false);
        squid.setCollidable(false);
        squid.setInvulnerable(true);

        guardianStand.addPassenger(guardian);
        squidStand.addPassenger(squid);
    }```
warm mica
#

You left the important line out

quartz basalt
#

huh?

warm mica
#

Error is talking about Laser#target and you are instead showing Laser#create

quartz basalt
#

the only relevent thing from the target method is Location baseLocation = guardian.getTarget().getLocation(); which is where the error is from

weak meteor
#

Can someone help me with my code?

#

it just doesnt open the inventory

inland siren
#

?paste

undone axleBOT
inland siren
#

need to see the code so people can help with the code

weak meteor
#

ive tried all the ways posibles and just i wanna do it

#

just the easiest and non complex way

inland siren
#

naming conventions 😭

weak meteor
#

and im hurried up bc my friend needs it for the next week

weak meteor
#

please

inland siren
#

e.getWhoClicked().sendMessage("PENEEENENEN"); is this line running

weak meteor
#

yep

#

it is

weak meteor
quiet ice
#

@tender shard Tried to reproduce the null annotations issue with the 2023-03 release candidate and it seems fixed. Let's hope that stays like that until tomorrow when eclipse 2023-03 is released for good

worldly ingot
#

Which annotation issue?

#

Did Eclipse fix the duplicate annotation issue in the jdk?

#

I fucking hope so >:((

ruby mesa
#

how would I check if an itemstack is a door for example instead of checking every single type of door

worldly ingot
#

Tag.DOORS.isTagged()

#

Or WOODEN_DOORS if you want only wooden ones

ruby mesa
#

nvm I asked chatgpt

round finch
#

chatgpt replaces spigot help lol

ruby mesa
#

fr

#

well sometimes

round finch
#

easier then someone or something points out what you need

#

heh

ruby mesa
#
public boolean isTrapdoor(ItemStack itemStack) {
    Material material = itemStack.getType();
    if (material.isBlock()) {
        BlockData blockData = Bukkit.createBlockData(material);
        return blockData instanceof Trapdoor;
    }
    return false;
}```
do u think this would work tho
#

idk

round finch
#

are you trying to make a check?

ruby mesa
#

yea

#

cuz there is different types of trapdoors

#

so im not tryna make 1000 if statements

round finch
#

hm?

keen horizon
#

can anyone help me edit a plugin to only happen when shifting

jagged monolith
#

Without saying what the plugin is, providing a link to it etc.. It's a bit hard for anyone to help.

keen horizon
#

its a combat plugin

wet breach
#

Does it have a github repo link?

#

If it isnt open source then most here are probably not going to touch it

#

First because it is a pain to decompile and then recompile and second its closed source

vocal cloud
#

Looks closed source to me. Would be easier to just pay someone to make a copy of it lol. Not a lot going on reading the desc

vital sandal
#

why i get this err :l?

quaint mantle
#

How can I disable MongoDB logging in server console?

#

I am using MongoClient

graceful oak
#

I was working on an auto smelt tool and while it works it doesnt turn logs into charcoal which I want it to do. I am looping through FurnaceRecipe's any reason why that wouldnt count?

young knoll
#

We’d need to see some code

graceful oak
# young knoll We’d need to see some code
public void cookDrops(UUID uuid){
        List<ItemStack> items = blockDrops.get(uuid);
        Iterator<Recipe> iter = Bukkit.recipeIterator();
        for(ItemStack i: items){
            Bukkit.getPlayer(uuid).sendMessage(String.valueOf(i.getType()));
            while (iter.hasNext()) {
                Recipe recipe = iter.next();
                if (!(recipe instanceof FurnaceRecipe)) continue;
                if (((FurnaceRecipe) recipe).getInput().getType() != i.getType()) continue;
                ItemStack result = recipe.getResult();
                result.setAmount(i.getAmount());
                items.add(result);
                items.remove(i);
            }
        }
    }
#

Everything smelts that can except for logs or thats at least the only one I noticed

storm stump
#

Why do all my NMS entities disappear when I die and hit respawn?

river oracle
#

Probably despawning?

storm stump
#

I can teleport far away and they work fine

#

Plus I still hear them walking towards me on the grass

wet breach
#

Teleporting is different from respawning

storm stump
#

Well they should stay since I have their Entity.persistent = true

#

And they do

#

I hear their footsteps

#

Just no visuals

storm stump
#

The armor stands (holograms, separate) are not being sent

wet breach
#

Two different areas of code. Respawning the server already knows you are not around. Teleporting not so much the case because unlike respawning teleporting isnt part of the ticking for everything else

storm stump
#

I'm thinking about making an NMS entity tracker for this btw

#

Where would I get started

#

Where should I look

wet breach
#

But if this is something you are working on we need code

#

?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.

wet breach
#

Also since you are messing with nms, which not sure why. It can sometimes bypass things

graceful oak
wet breach
#

Nms isnt designed to be messed with. Therefore there isnt inherent checks to see what you are or are not doing. If you spawn an entity via nms and lets say its not a real entity but done via packets. Then the server isnt going to know about it or track it. Also depending on what code you are touching you dont have the protections of the api or in some cases tracking

storm stump
#

Ye of course

warm mica
storm stump
#

I understand that

storm stump
#

Are there any articles or anything about writing my own entity tracker?

wet breach
#

But as i also said respawning and teleporting touch two different areas of code

young knoll
#

That code is what I’ve used in the paste

#

Worked fine in 1.18

warm mica
wet breach
#

Yeah still dont know why they are messing with nms

#

Or if they even need to

storm stump
#

The benefits for using NMS for me is I can have a fake entity displayed to the user that my invisible, server-only entity can send to clients. Only one set of pathfinding code has to be written and I don't have to extend a bunch of entity classes for each entity type

#

Also I have holograms

#

Per-player holograms will also be a facet

wet breach
#

Holograms dont inherently require nms

storm stump
#

No, but per-player holograms do

wet breach
#

Not even

storm stump
#

And they are also more efficient when only done with NMS

storm stump
#

But i'm going the nms route for those reasons

wet breach
#

Alright. Atleast we know now

storm stump
#

I also want to have player characters as mobs

#

Need nms for that

graceful oak
#

Ill try this out

wet breach
#

You are going to need an entity tracker for your fake entities

#

That much i can say

young knoll
#

Yeah the charcoal recipe is a single recipe with multiple possible ingredients

storm stump
#

That I'm aware of but are there any resources on what creating an entity tracker entails?

young knoll
#

Hence why my code handles MaterialChoice

storm stump
#
public interface NetworkEntity {
    void addViewer(Player player);
    void removeViewer(Player player);
    Location getPosition();
}```
#

I want to have an interface like that

#

Where viewers can be added and removed for the class

#

And the position is also returned

wet breach
storm stump
#

Map of what to what

#

Chunk to Entity?

#

Should I iterate over all players on tick and give them nearby chunks of entities?

wet breach
#

A map containing entities or objects that contain your entities. If you want to map to chunks you can either add that info to your entities or have a double map for that

#

And since these are fake entities you could also make the map thread safe too if you want to access it from other threads

#

But see how much more complex it can be? Lol what you need is dependent on your requirements that you identify and there is numerous ways to do this all with their own benefits and drawbacks

storm stump
#

Yea it does seem complex

wet breach
#

But at minimum you only need a list or map to hold your entities or objects so they dont disappaer

#

Then from there you make it accessible to the rest of your code

#

Which can cause you to change from list to say concurrenthashmap instead. But that isnt something we can determine for you

#

All we can do is just give you concepts and sudo code lol

storm stump
#

Is it good practice to send packets from other threads or are they already queued up for you and sent asynch on 1.12.2?

wet breach
#

Netty sends packets async however that doesnt mean you cant use a thread to send a packet through netty and you might want to if its only purpose is to do that because now that piece of code isnt running on the main thread

storm stump
#

Interesting

#

I'm just trying to think of how I should determine when a client needs to be sent the entity again

wet breach
#

The only thing to worry about with threads is concurrent modification exceptions. Some things like a list for example cant be modified and read from at the same time if the list lives on the main thread and you are trying to do things with it from another thread. So a way around this is to sometimes clone that list locally to the thread

#

Just depends what the list is and if its ok of the data in it is slightly outdated or of the data isnt expected to change right away

storm stump
#

Will I be informed about a ConcurrentModificationException or will a race condition randomly break something without my knowledge?

wet breach
#

If a cme happens it will be thrown in the cpnsole

#

Race condition is different and that can happen and harder to detect sometimes but that is what profilers are for

#

Another thing that can happen is deadlocking

#

Which is the opposite of race conditions

storm stump
#

Two mutexes waiting on each other

wet breach
#

Yep

storm stump
#

Does Java have mutexes

wet breach
#

Or waiting on the same resource that wont be freed

#

Mutexes yes but more for networking side. It is typically referred to contexts because you dont need two threads to deadlock you can deadlock a single thread on itself

storm stump
#

So back on the entity tracker discussion (I know I'm sorry 😅 ) what happens if I send a spawn packet for an existing entity? Will the entity just be updated since the client should notice the existing entity id?

graceful oak
buoyant viper
wet breach
storm stump
#

So avoid it because it's UB

wet breach
#

You should do your best to avoid it or you can just go ahead and find out what happens

#

Its one of those undertermined things lol

storm stump
#

Lmao yea and since I'll be using a ViaVersion proxy for the network probably best to avoid any shit like that

#

Could vary between users

wet breach
#

Indeed

#

Welp back to work for me. If these are things that interest you and you are wanting to explore the code and intrinsics more in depth. Recommend verifying and sticking around. Plenty of us who have knowledge to dispel. Not just me lol

storm stump
#

Yessir thank you very much for giving up 30 minutes to teach me

#

Definitely appreciated

graceful oak
#

I am using the OnPlayerAnimation to run player.sendBlockDamage and the mining speed and everything is perfect but I get a weird few frames where the block breaking animation flickers any thought why that would be?

Its too much code to send if you really need to see it I can get a few pastebin files but essentials its onPlayerAnimation runs a function that gets an object from a map I made that updates the block progress(in the object) and every time the animation event is played it updates the block progress(in the game) to to number

vernal oasis
#

It looks kinda like it's setting the frame back to default then the next one?

#

Like 1 > 0 > 2 > 0...

wet breach
#

Since you are sending the block damage manually you need to cancel the block damage event

#

Otherwise you are just fighting the server

graceful oak
drowsy helm
graceful oak
#

Not haste

#

I mean mining fatigue

wet breach
#

Not sure what potion effects have to do with the event

drowsy helm
#

mining fatigue max will negate the damage

#

easier then cancelling the packet

wet breach
#

Or just cancel the event

#

Not sure why that is hard

rain sierra
#

Yo, im having trouble understanding the new event.joinMessage() component, since event.setJoinMessage() is depreciated im not sure how to make custom join and leave messages now. Im using Kotlin. Any pointers? Checked the docs and it was no help.

wet breach
#

Also not even sure if mining fatigue stops the event in spigot

rain sierra
#

mb, didnt know they had help channels

remote swallow
#

should be paper-dev

drowsy helm
wet breach
#

Even if they didnt this is still spigot. Not help for whatever fork you are using

graceful oak
remote swallow
#

they deprecate all string bukkit stuff and make people use minimessage components

wet breach
#

That is on two iterations the object is the same thus same packet being sent twice

#

If this is something being done async with the reading and updating of the object i would probably toss the synchronized keyword on map or list holding your object to see if that is the case. Synchronized makes it impossible for two things to being doing something with it

#

Seems it would be easier if you were using block damage event

#

Because you can more easily control the damage to it without resorting to some manual method

buoyant viper
#

Component.text("stuff") iirc

graceful oak
# wet breach Seems it would be easier if you were using block damage event

Well the block damage event only fires when you first hit the block it doesn't continue as you are mining it so I would have to automate the mining then cancel it if the abort event was fired I figured it would just be better to have it based on the animation so I can control the speed a little better as they are mining.

wet breach
#

Ah got it. Well i am work so not sure what is best then to ensure you are not sending duplicate data. Might have to look to see where that might be happening

buoyant viper
#

?jd-s me

undone axleBOT
rain sierra
tender shard
#

yeah in paper every string method is deprecated

buoyant viper
#

no fuckin way they forked bungeecord chat just to put god damn Deprecation marks

remote swallow
#

fuckin semver

young vine
tardy delta
#

Strings for chat huh

#

Change my mind

eternal oxide
#

Yeah I'm happy with Strings for most things

#

The only use for components is clickable etc

tardy delta
#

Let them provide a string method that wraps it in a component then

#

But lemme guess Paper doesnt doo that

buoyant viper
#

?jd

young vine
buoyant viper
#

theres a ChatEvent, that might be the best youll get

#

also wtf is the command to get specific docs

#

i know ?jd-s for spigot but

#

is it like

#

?jd-bc

buoyant viper
#

oh

#

?jd-chat

#

?jd-bcchat

#

?jd-bchat

eternal oxide
#

?jd

buoyant viper
#

theres jd-s jd-bc and id imagine one for bc-chat

#

?jd-bc-chat

#

damn..

#

wait

buoyant viper
#

?jd-bcc

buoyant viper
#

aha

eternal oxide
#

🙂

buoyant viper
#

gotta start documenting the commands in spigot discord

kind hatch
#

There's some bot command to list them all. That's the real one you should remember. I wish I did

eternal oxide
#

itn't that the ?cc one that only works in trivia?

buoyant viper
#

?cc list

tender shard
young vine
#

I can't do anything about people asking in the wrong place, we have to deal with that too

tender shard
#

I know lol

young vine
#

And for normal string (with no color), sendMessage (Component.text("string")) isn't that worse, especially with static imports, plus it's explicit

eternal oxide
#

In my opinion Spigot is the API. No fork should make changes to the root, only additions.

tender shard
#

additions, nice. changes to the original api however, not a good idea

young vine
#

Ok so we have to stuck with bad decision from upstream? Or unwillingness to innovate?

#

The methods aren't broken, just deprecated because there are better alternatives

eternal oxide
#

innovate all you want, in your own methods. Changes to the Spigot API shoudl only be made by Spigot.

young vine
#

You can choose to ignore that, they aren't deprecated for removal

tender shard
young vine
#

No, devs can choose

#

Either depend on spigot or depend on our API

#

Just like server owners are choosing

#

We make sure stuff is backwards compatible with upstream, at least for now

eternal oxide
#

Server owners are not choosing the API, they are choosing for performance.

young vine
#

In the future devs will have to make a choice, just like most server admins already made a choice

tender shard
#

does anybody know the translation key names for builtin enchantments? can't find them in code rn

#

copilot suggested "enchantment.myplugin.enchantmentname" for me

eternal oxide
#

lol

young vine
tender shard
#

not really, 99% of server owners don't even know what an API is

eternal oxide
#

I disagree

tender shard
#

all they know is "paper is faster" so they use paper

young vine
#

I.e. we allow you to get a block state without cloning it, or get a chunk without loading it sync, or teleporting without sync chunk loads

eternal oxide
#

Yes, performance improvements, but the server owner knows nothign of whats behind the curtain

young vine
#

Not ever server owners knows that, but many plugin devs already state that their plugin makes use of such API if available and thus will on better on paper

#

So devs are educating server owners, like they should

eternal oxide
#

I only write for Spigot so can;t comment on any forks "improvements"

tender shard
#

uugh why does this not suppress the warning D:

#

oh i'm stupid

#

it's "deprecation" not "deprecated"

young vine
eternal oxide
#

Spigot all the way baby, I dislike the Paper community so When/If spigot dies I'm gone.

tender shard
#

is there an intellij shortcut to jump to the currently open class?

#

I.e. I got ClassA open in the editor and I wanna have it selected in the Project folder

buoyant viper
tender shard
#

said nobody ever

buoyant viper
#
.spigot().sendMessage(new ComponentBuilder("Text").create());```
eternal oxide
#

thats clean

buoyant viper
#

as someone said a while while while ago, having to make them arrays just hurts inside a little

tender shard
#

how would you create a message in spigot components like this?
<red>This is red text<gold><click link="https://somelink">Click Here to open whatever

#

e.g. only the golden part should be clickable / run a command / whatever

jagged monolith
#

That's using MiniMessage isn't it?

tender shard
#

yeah it's an example to show how the message should look like

#

basiocally this:

kind hatch
tender shard
#

the Download | Donate | Changelog thing

tender shard
young vine
kind hatch
tender shard
#

hm idk why it's not Alt+F1 for me, I'm using the default keymap with only minor changes lol

buoyant viper
tender shard
#

hm thx I'll try this later

buoyant viper
#

maybe mini meant Bukkit

#

since bungee chat components r spigot-api stuff

tender shard
#

yeah bungeecord components are definitely part of spigot api

buoyant viper
#

yes, thru the kind of weird .spigot() method

young vine
#

I meant spigots fork of Bukkit

tender shard
young vine
#

I doesn't know why shit is still separated

#

It's confusing as heck

#

Anyways, whenever talking with Choco why spigot doesn't use components in more places, that's the response I get

buoyant viper
#

maybe once Choco completely integrates Components, itll migrate to bukkit sunglasses

young vine
#

Is that before or after spigots fork of Bukkit updates to modern java versions?

tender shard
#

what would be the advantage of using >8 for bukkit?

buoyant viper
#

im with alex on that one, what benefit is it for the API to update?

young vine
#

Why hold back? Lol

buoyant viper
#

i cant think of anything outstandingly obvious rn

tender shard
young vine
#

There are plenty of new language additions that are useful for apis, i.e. sealed classes

young vine
tender shard
#

and which class in bukkit would you like to make sealed?

young vine
tender shard
tender shard
#

brb

young vine
#

Which is the majority

buoyant viper
young vine
eternal oxide
#

yep

buoyant viper
#

o

#

thx

#

im probably the only person that will advocate for spigot components if ur usin spigot

#

xd

eternal oxide
#

to date I have had no use of components

jagged monolith
tender shard
swift sequoia
pseudo hazel
#

1.18+ xD

young vine
jagged monolith
young vine
#

When you can just let the compiler help you

buoyant viper
tender shard
young vine
#

Just that adventure mirrors vanilla more closely and builds proper tree like structures and not arrays

young vine
tender shard
#

One sec

buoyant viper
#

i would honestly have to look @ stash to see why in gods name it returns an array

young vine
#

And you can still compile with target 8 even if you use libs that target newer stuff Alex

#

At least am pretty sure you can

tender shard
#
    /**
     * Gets the lowest possible building height for a world. It's the same as {@link World#getMinHeight()} but also works on 1.16.4 and earlier
     */
    public static int getWorldMinHeight(final @Nonnull World world) {
        return HAS_WORLD_MIN_HEIGHT_METHOD ? world.getMinHeight() : 0;
    }
#

this is what I'm talking about

swift sequoia
tender shard
#

I use world.getminHeight() in 1.17+ but just "0" on 1.16

#

I couldnt do that when using 1.16 api

young vine
#

So again, no disadvantage of just bumping, right now the uscases get blocked before they can even surface

kind hatch
tender shard
#

because I don't have any better idea

young vine
#

Abstraction and modules would be the clean way

tender shard
#

for such a tiny thing?

#

I mean that's a one-line method

#

I mean, sure, generally you're right, but a module for a one line method? that sounds a bit overkill to me

swift sequoia
buoyant viper
#

wtf is the keybind to autoformat in intellij

#

my mind is stuck in VScode rn

tender shard
kind hatch
#

CTRL + ALT + L

buoyant viper
#

thank u

tender shard
#

or Cmd+Alt+L on mac

buoyant viper
#

i kept trying alt+shift+F

#

and like alt shift L

#

bc i vaguely remembered L

young vine
#

If it's just one you can stick to that obviously, no need for anything fancy

tender shard
kind hatch
buoyant viper
#

oh yeah, components r required for actionbar, unless im stupid

young vine
#

And again, setting spigots fork of Bukkit to java 17 will not make that usecase impossible

tender shard
#

I check the McVersion three times in the entire project

#

plus sometimes I'm doing stuff like "does method exist" because sometimes, stuff gets added "inbetween", e.g. WorldInfo#getMinHeight() was added in 1.16.5 but it's only available in one of the latest 1.16.5 versions

#

and some people are stupid and use outdated versions of outdated versions

young vine
#

I wouldn't even cater to that

buoyant viper
#

all fun n games til u got .append hell

tender shard
#

create a getGenitive(String name) method

#

if it ends with "s", you'd only append ' but not 's

buoyant viper
#

damn

tender shard
#

Jesus' blood

buoyant viper
#

what if their displayname ends with a formatting code thonk

tender shard
#

strip it of all color codes

buoyant viper
#

damn

#

u right

tender shard
#

if it ends with s, you append ', otherwise you append 's

young vine
young vine
buoyant viper
#

spigot-api :v no components in bukkit stuff

tender shard
#

thanks copilot, very useful suggestion lmao

buoyant viper
#

did not know stripColor existed i was almost about to write a method to do that

#

oh, cool

#

didnt think my code using Translatable was gonna be right on first try

#

im guessing i should use something else for if theyve named an item tho

tender shard
#

hm I get weird errors after upgrading from MockBukkit 1.18 to 1.19 D:

Stacktrace: https://paste.md-5.net/egilufusex.rb
Line 40 in UnitTest.java: ```java
package com.jeff_media.jefflib;

import be.seeseemelk.mockbukkit.MockBukkit;
import be.seeseemelk.mockbukkit.MockPlugin;
import be.seeseemelk.mockbukkit.ServerMock;
import lombok.Getter;
import org.bukkit.World;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;

public class UnitTest {

@Getter
ServerMock server;
@Getter
MockPlugin plugin;

@BeforeEach
void setup() throws IllegalAccessException {
    server = MockBukkit.mock();
    plugin = MockBukkit.createMockPlugin(); // <--------- line 40
    JeffLib.setPluginMock(plugin);
}

@AfterEach
void destroy() {
    MockBukkit.unmock();
}

}

Pom.xml: https://paste.md-5.net/hozodegune.xml

Already had to switch from spigot to paper-api for MockBukkit 1.19 to run, but it's still throwing errors when doing createMockPlugin(), which worked fine in 1.18.

Any ideas? D:
buoyant viper
#

ive seen many ways to inline annotations but that is in fact a new one

tender shard
#

well that's basically just the same as this

#

but without the spaces, it indeed looks funny

buoyant viper
#

dear God...

#

"@Paper" ?

tender shard
#

Yeah thats my annotation to tell people this will only work on paper

#

For javadocs and stuff

buoyant viper
#

o

tender shard
#

I wish I could find a way to automatically generate the javadoc tag from the annotation but I haven't found an easy to do this

#

currently I need to add both the annotation, and the javadoc tag, and I hate that

#

if anyone knows how I can make javadoc generate the tag automatically from the annotation, pls lemme know

#

in the meantime I'll drink some more coffee until I get cardiac arrhythmia

wet breach
tender shard
#

yeah, even if it wasn't meant to be extended, why disallow it?

#

e.g. the Enchantment class

wet breach
#

This true in most languages. Always make use of the lowest version possible and only bump if necessary

indigo frost
#

look i really need some help. I'm making a plugin and I have events registered that only work in a certain world (a multiverse plugin world) in my testing server everything works, but in the actual server, the events dont work at all. What do i do

quaint mantle
#

hello.

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

quaint mantle
#

What happens to UUIDs when a server runs with online-mode=false?

indigo frost
#

the events do not get registered

wet breach
kind hatch
quaint mantle
#

what is the difference?

tender shard
wet breach
tender shard
kind hatch
wet breach
#

Difference being offline uuids are not guaranteed to be unique. And anyone can use whatever name they want.

quaint mantle
#

okay, i have this database where i am storing UUIDs. Now I need to test some stuff with 2 players probably but i don't have second minecraft account so I might try running the server with online-mode=false and join with a second minecraft instance.

quaint mantle
#

not UUIDs, just the usernames.

wet breach
#

Best to just use online mode. We dont support offline mode servers

kind hatch
#

We do for testing purposes.

#

Not full blown server scale operations.

quaint mantle
#

probably won't run this in for online-mode=false during production but i need to test stuff right now.

wet breach
#

Correct

quaint mantle
#

so, what happens to UUIDs that have been previously registered?

wet breach
#

What do you mean?

quaint mantle
#

say i join with the same username on both offline and online modes, do they both get different UUIDs?

kind hatch
#

Yep

wet breach
#

Yes

quaint mantle
#

ok.

indigo frost
tender shard
tender shard
indigo frost
#

ill put one

tender shard
#

btw with "registering events", do you mean event listeners, or did you write actual event classes?

indigo frost
#
    public static void onPlaceKey(BlockPlaceEvent event){
        if(event.getItemInHand().getItemMeta().equals(ItemManager.key0.getItemMeta())){
            Bukkit.getWorld(world).getBlockAt(event.getBlockPlaced().getLocation()).setType(Material.AIR);
            if(event.getPlayer().getGameMode().toString().equalsIgnoreCase("survival")){
                event.getPlayer().getInventory().addItem(ItemManager.key0);
                event.getPlayer().getInventory().removeItem(ItemManager.key0);
            }
        }
        if(event.getItemInHand().getItemMeta().equals(ItemManager.key1.getItemMeta())){
            Bukkit.getWorld(world).getBlockAt(event.getBlockPlaced().getLocation()).setType(Material.AIR);
            if(event.getPlayer().getGameMode().toString().equalsIgnoreCase("survival")){
                event.getPlayer().getInventory().addItem(ItemManager.key1);
                event.getPlayer().getInventory().removeItem(ItemManager.key1);
            }
        }
        if(event.getItemInHand().getItemMeta().equals(ItemManager.key2.getItemMeta())){
            Bukkit.getWorld(world).getBlockAt(event.getBlockPlaced().getLocation()).setType(Material.AIR);
            if(event.getPlayer().getGameMode().toString().equalsIgnoreCase("survival")){
                event.getPlayer().getInventory().addItem(ItemManager.key2);
                event.getPlayer().getInventory().removeItem(ItemManager.key2);
            }
        }
        if(event.getItemInHand().getItemMeta().equals(ItemManager.key3.getItemMeta())){
            Bukkit.getWorld(world).getBlockAt(event.getBlockPlaced().getLocation()).setType(Material.AIR);
            if(event.getPlayer().getGameMode().toString().equalsIgnoreCase("survival")){
                event.getPlayer().getInventory().addItem(ItemManager.key3);
                event.getPlayer().getInventory().removeItem(ItemManager.key3);
            }
        }
        if(event.getItemInHand().getItemMeta().equals(ItemManager.key4.getItemMeta())){
            Bukkit.getWorld(world).getBlockAt(event.getBlockPlaced().getLocation()).setType(Material.AIR);
            if(event.getPlayer().getGameMode().toString().equalsIgnoreCase("survival")){
                event.getPlayer().getInventory().addItem(ItemManager.key4);
                event.getPlayer().getInventory().removeItem(ItemManager.key4);
            }
        }
    }```
wet breach
#

?paste

undone axleBOT
indigo frost
#

this is in an event class

wet breach
#

Use the paste link please

indigo frost
#

so in my testing server it works

tender shard
#

it's a listener, not an event class

buoyant viper
#

oh dear Christ

tender shard
#

btw have you ever heard about loops? o0

wet breach
#

Lol

tender shard
#

why is there 5 times the exact same code

indigo frost
#

they're different

tender shard
#

yeah you changed one number

kind hatch
#

Yea, but the bulk of it is the same.

indigo frost
#

different item

tender shard
#

use a proper loop pls lol

#

I mean, what are you gfoing to do if you wanna change one line? change it 5 times?

indigo frost
quaint mantle
#

uh

kind hatch
#

Holy fuck

quaint mantle
#

how do i create two different offline mode usernames?

#

and launch instances of minecraft with those?

kind hatch
#

I think you need to have the launcher disconnected from the internet and login with mojang authentication.

#

Password shouldn't matter if it's offline.

tender shard
#
  1. why is the class called "KeyEvents" if it doesn't declare any events but only listens to existing ones?
  2. You didn't show how you register your listener
  3. Stop repeating yourself thousands of times, that is extremely bad code.
indigo frost
#

my theory is that cause before I was getting an error cause the world I was trying to load was coming back as null (since it wasn't loaded cause it was a multiverse world) so i added code in my main class and it works now but I think that it still comes back as null just no error

tender shard
#

all of this could be done with 3 simple for loops within like 5 lines

indigo frost
#

ill give my main class

kind hatch
tender shard
#

the listener is definitely registered. probably one of your thousands of if statements evaluates to false, probably ItemMeta.equals(ItemManager.keyX.getItemMeta())

#

also erm, why do you store the name of the world, only to do Bukkit.getWorld later on?

#

why not store the world directly?

young vine
#

And no, thats not what paper does for existing API

tender shard
#
String world = myWorld.getName();
Bukkit.getWorld(world).... // This is pointless
indigo frost
#

i had it different

kind hatch
indigo frost
#

but i changed something

#

then didn't feel like changing it back

tender shard
#

idk the whole class is a total mess, I'd rewrite everything from scratch

young vine
indigo frost
#

i can

#

just the issue isn't it not working

#

it just doesn't work in the server i add it to

young vine
indigo frost
#

it works in the test server

tender shard
#

what even is ItemManager.key0 ?

#

etc

#

is that a damagable item?

kind hatch
#

Probably an itemstack

tender shard
#

if so, it'll only work if the durability is the same

indigo frost
tender shard
#

you should identify your custom items by PDC tags instead of comparing the item meta

livid dove
#

I've been busting my ass off trying to find a nice, clear and consise explanation for how the nbtlongarray in region file's section chunks is formatted / how it applies the pallete to say which block is where.

I can't think of anywhere else to ask to get advice on where to find said guidance?

indigo frost
#

idk how to use PDC lol

kind hatch
#

?pdc

indigo frost
#

confuses the fuck outta me

tender shard
indigo frost
#

there are multiple args but yeah

tender shard
#

also why are you printing "This is not a valid entity" when Integer.parseInt fails?

#

shouldn't it rather print "That is not a valid integer"?

indigo frost
#

min is 1 max is 4

kind hatch
tender shard
#

you should learn how to use for loops tbh

indigo frost
#

i just grouped it with the amount cause if its 0 or negative it gives same message

indigo frost
#

this is early

tender shard
#

in one executor?

kind hatch
livid dove
tender shard
#

why don't you just use one executor per command

indigo frost
#

in one class

tender shard
#

but why

vale sigil
#

Saving potion effects on death and giving them back on respawn

livid dove
indigo frost
#

less classes idk

livid dove
indigo frost
#

but still these things are the issue

#

yes

#

the code works

#

it just doesnt work in the server im adding it to

#

so it must be something to do with other plugins

#

probably multiverse

tender shard
#

imagine you throw everything you have in one drawer instead of having separate drawers for socks, underpants, tshirts etc

#

sounds pretty stupid

kind hatch
livid dove
#

Oh right interesting.

Honestly follow the rule I learned in the engineering industry.

You could beat ur skull up the wall for literal hours trying to find the problem.. or you can have a mega brain and remove each plugin one by one (or add 1 by 1 to another server) until you find the problem

tender shard
#

or check out EventDebugger

tender shard
indigo frost
livid dove
livid dove
# quasi flint binary search be like

I remember the time a lands plugin bug where land titles were not showing up was, I shit you not, caused by a loop in a datapack that had remained unused for over 4 months, in 1 file..m for the zoom in of a musket weapon reseting titles....

Sometimes stupid shit is only found via the shot gun approach haha

kind hatch
livid dove
# quasi flint lol

Look if literally nasal can waste millions of dollars by, I shit you not, converting from metric to imperial wrong when doing thrust calcs, leading to a Martian prove burning up in the atmosphere, we as spiggot devs are not gonna avoid the stupid shit either haha

tender shard
vocal cloud
#

^

#

Fix the tech debt instead of making it worse

livid dove
tender shard
#

also true

indigo frost
#

also how would i make a reload command that updates the plugin and adds the changes without me having to restart the server

#

the server im adding it to doesn't let u do /reload or /reload confirm

livid dove
#

This entire field is built on having to clean up after shit code , including our own. Don't take that away from him 😉

tender shard
#

usually you can just call reloadConfig() if you grab your values from there during runtime

#

if you cache them somewhere, then cache the new values again

kind hatch
#

Assuming that they are using the default config though.

tender shard
#

however caching it is usually pointless as getConfig() is basically just a Map<String,Object>

tawny remnant
#

how do i check for a tag in a different class?

#

NBT tag

tender shard
#

i dont understand that question

livid dove
#

Can you give some context ?

tender shard
#

also why are you using NBT tags instead of PDC?

tawny remnant
tender shard
#

I definitely didn't send anything about NBT

wispy wyvern
#

hey, im trying to interact with my custom block, for example right click and it does something.

undone axleBOT
tender shard
#

that allows you to store data in blocks

#

so you can identify your custom blocks

tawny remnant
#

it is PDC

tender shard
#

ah ok. well then, why would it be a problem to check it from another class?

tawny remnant
#

its red

#

i dont know how to get it from somewhere else

tender shard
#

what is "red"?

#

show a screenshot pls

tawny remnant
#

the tag name

tender shard
#

if "it's red", there for sure will be some proper error message if you hover over it

drowsy helm
#

are you passing the plugin instance in?

tender shard
#

also wdym with tag name? do you mean the NamespacedKey?

tawny remnant
#

yes

tender shard
#

create a field in your main class for the namespacedkey, then pass that key to all the instances where you need it

#

or pass your main instance instead and get it from there

wispy wyvern
indigo frost
#

@tender shard so i've determined it's not an issue with the worlds

wet breach
wispy wyvern
#

without any external repo?

tender shard
indigo frost
#

are there are plugins that completely disable events

tender shard
#

if there'd be a builtin way, I wouldn't have spent hours writing CustomBlockData lol

tawny remnant
#

I dont get it how do i access a NamespacedKey created in a different class

hybrid spoke
tender shard
#

ofc one could write a plugin that deregisters all listeners for any event, but why would anyone do that?

tawny remnant
#

how do i check for the pdc tag from a different class please help

tender shard
#

I have sent you my blog post about DI / static getter twice already

tawny remnant
#

i dont know how to get the tag tho

tender shard
indigo frost
drowsy helm
#

what do you mean by "arent working"

indigo frost
#

Example I have an event that makes a block disappear when you place it

#

In my testing server it works

tender shard
# tawny remnant i dont know how to get the tag tho
  1. declare a field in your main class, either public or with a getter, that holds the NamespacedKey
  2. check my blog post to pass your main instance to other instances, then you can use it to get your namespacedkey
indigo frost
#

In the sever I added it to it does nothing

#

@drowsy helm

tender shard
indigo frost
#

So why does it work in one place but not another

tawny remnant
tender shard
#
public class MyPlugin {
  public NamespacedKey myKey = new NamespacedKey(this, "myKey");
  public static MyPlugin instance;

  {
    instance = this;
  }
}

Other class:

public class OtherClass {
  @EventHandler
  public void doSth(SomeEvent event) {
    NamespacedKey myKey = MyPlugin.instance.myKey;
  }
}
#

that's the basic idea

#

usually you'd want to use a getter instead of public fields, but the idea is the same

tawny remnant
#

whoa

#

i think it worked

tender shard
#

It would be weird if it wouldnt work lol

vocal cloud
#

Ugh the whole make a singleton with a public var instead of a static var class

tender shard
#

as I said, it was just an example to show it in the most compact way lol

round finch
#

probably the most simple version thb

tender shard
#

I also sent my blog post that also explains proper DI sooo 😄

vocal cloud
#

Don't even need DI. For keys I'd make them in a static class

tender shard
#

are you using the fromString method?

round finch
#

it would also be possible to make a get method just a note

tender shard
#

because for the constructor you need the plugin instance

round finch
#
  • dependency injection

takes main class (Main Main)

setter for other classes

quaint mantle
#

yo

#

i keep get an `Error: internal error: (java.lang.exceptioninitilializererror) this is first time setting up a spigot plugin so any more experienced guys know if theres like a common cause to this?

round finch
#

alr guys what is the safe way to store bukkit runnable threads?

#

i'm learning to make multi threads

vocal cloud
#

Depends on how you'll access them?

round finch
#

it is for minigames

#

idk just wanna run multi instances

vocal cloud
#

So where do runnables come in?

jagged monolith
quaint mantle
#

yea yea true idk thought i was making some simple mistake lmao

round finch
#

possible to link me some source?

vocal cloud
#

Don't look at me you asked

round finch
#

i literally got no clue

round finch
wet breach
round finch
#

i just assume using bukkit and not java threads hmm

wet breach
#

Bukkit just extends runnable and thread which you can do as well. If you have to store runnables might as well just have your own threads to make it easier

round finch
#

i dont know if i gotta be real

#

OH CHEZ

wet breach
#

Stop spamming

#

?paste

undone axleBOT
round finch
#

help that guy

wet breach
#

Use that link

#

Please

quaint mantle
#

sorry my computer isnt letting me put in text doc

round finch
#

that is a text link

wet breach
#

Thats fine, just put it at that link and remove it from here

round finch
#

paste into it

#

and put link here

wet breach
#

Thank you

quaint mantle
#

yeah if anyone knows whats going its literally just an onenable and on disable method in the code lol

wet breach
#

Use oracle jdk

quaint mantle
#

yeah i am

wet breach
#

Then not sure why its complaining about not being able to use a sun package

round finch
#

java.lang.ExceptionInInitializerError: Exception java.lang.IllegalAccessError: class com.intellij.util.io.FileChannelUtil

wet breach
#

What java version are you using?

quaint mantle
#

1.19

wet breach
#

Certain you dont have another installed that it is being used instead?

quaint mantle
quaint mantle
#

cause i usually use 1.8

wet breach
#

I would try downgrading to java 18

quaint mantle
#

i did as well lol

wet breach
#

Weird

#

Welp have to wait for someone else who uses intellij i dont use it

#

@tender shard any ideas?

quaint mantle
#

ah yea i figured it was sm to do with intellij being dum

wet breach
#

Well it says in the error that it is something with intellij

quaint mantle
#

yeah may try it in eclipse

wet breach
#

I personally use netbeans

round finch
#

why you use netbeans?

#

just wonder

quaint mantle
#

ill try that then ive heard its pretty good

wet breach
#

Because i like its layout and i dont encounter any of the problems thst others have with intellij.

#

Also i can fine tune its resource usage as well

round finch
#

me neither 😏
basic eclipse user

wet breach
#

Or optimize it

round finch
#

you can't have an intellij error if you dont have intellij

#

;))

wet breach
#

I can even specify specifically which jdk to use for it too

round finch
#

with eclipse I can do that in projects

#

plus some default settings

wet breach
#

Well i meant for the ide

#

I can specify what jdk the ide itself should use to run on

round finch
#

i wanna learn intellij so i can become a better dev

wet breach
#

But like i always see people with intellij have cache problems or maven issues. In netbeans i have neither of those problems at all.

round finch
quaint mantle
round finch
#

being able to understand more ides helps bruh

wet breach
#

Using an ide that is comfortable for you makes you a better dev

quaint mantle
#

yea

wet breach
#

You dont need to use these other ides if you dont want to. Doesnt change your understanding of java or how you can use the code

round finch
#

just expanding my knowledge lol

#

hey @wet breach how would I store my threads

#

what is safest way if i wanna access them

vocal cloud
#

A list? A map? It really depends on how you want to access them

round finch
#

cancel?

vocal cloud
#

get().cancel()?

#

Again it really depends on how you want to access them

round finch
#

alright i just go ahead figure something out
while making it

wet breach
#

You can either store the thread object in a list or map or store the thread id.

#

I would store the thread object if its a daemon thread and ids for all the others

round finch
#

i would like to store the id

#

seems more optimized

#

for my thing

wet breach
#

And then ideally you want to make threads that are not daemon threads self cancelling

#

And then daemon threads should have a loop where it checks a boolean if it should close out. Not that it makes much difference but should. Main thread will force close daemon threads when main thread is shutting down

round finch
#

ahh.. hmm

#

kind new to this

wet breach
#

You can set the kind of thread it is when creating the thread object

#

Welp time to go home for me uwu

round finch
#

thanks for informing me!! 😄

#

💚

#

take care frostalf

tawny remnant
#

how do i identify the cause of my plugin not working?

round finch
#

does it spit out any exceptions from console?

#

or did you do the human error

#

missing code or misspelled?

wet breach
#

The hard part about multi threading isnt actually the making or tracking of threads. Its making sure you dont encounter deadlocks and cme's as well as occasionally race conditions. On top of that it is also ensuring you are not spawning too many threads and dispersing the work load adequately between them if that is the purpose of them. Threads require ram to be created. So with defaults and not much in your thread class if you spawn 1000 threads its going to require and consume just over 3gb of ram

chrome beacon
tawny remnant
#

i cant read

wet breach
#

Google can read

#

And speak to you

round finch
#

did you remember to export it correctly?

#

with the plugin.yml

#

YourPlugin.jar/plugin.yml

wet breach
#

Decompile? O.o

round finch
#

my bad

#

i mean export

#

faceplam

tawny remnant
#

its the first time its not working

#

i worked on that plugin for weeks

wet breach
#

Well you are also using purpur

round finch
#

Click on project and export

wet breach
#

So if it worked before then might want to see about that fork you are using. This is spigot

round finch
#

make sure plugin.yml is included

#

and plugin.yml is at the right place

tawny remnant
#

it is

wet breach
#

Doubt its the plugin.yml causing a cast exception

round finch
#

alright

#

just making sure

tawny remnant
#

its says its the CSTMItems doesnt it?

#

clas

#

s

wet breach
#

Its more likely they are trying to instantiate their own main class or casting the main class instance

round finch
#

java.lang.ClassCastException: class me.Danko.CSTMItems cannot be cast to class org.bukkit.plugin.Plugin

eternal oxide
tawny remnant
#

meaning?

wet breach
#

Could be that too

tender shard
wet breach
#

?nocode