#help-development

1 messages · Page 1015 of 1

dawn flower
#

in what version

eternal night
#

1.19.1 /2

#

somewhere there

analog mantle
#

why you so sweaty with final in your method parameters

eternal night
#

my IDE screams at me for anything that could be final but isn't

worthy yarrow
#

^

eternal night
#

so it is just ingrained at this point

valid burrow
worthy yarrow
#

Hate those damn yellow highlights

eternal night
#

I enabled it on purpose LOL

analog mantle
worthy yarrow
#

Sometimes the ide knows what it’s talking about

eternal night
#

I dislike implicit mutability on variables

#

¯_(ツ)_/¯

valid burrow
#

bro whats the style points

eternal night
#

things changing annoy me

valid burrow
eternal night
#

KEKW thats fine

#

my variable references just better don't

worthy yarrow
#

Yk what I love? Di with static util classes

eternal night
worthy yarrow
#

Or even more so just static aboose

valid burrow
#

since someone on this server called me out for static abuse

#

i completely removed anything static from my code

analog mantle
worthy yarrow
#

Static is fine so long as it’s genuine util ie: absolutely no state

analog mantle
#

I have 1 util class in my whole project and never use static for anything else

dawn flower
#

what happens if i delete a message that doesnt exist for a specific player

analog mantle
#

I don't even make psvm static since java 22

worthy yarrow
#

Di for true util functions is kinda pointless

dawn flower
worthy yarrow
#

Uh

#

Wdym a message that doesn’t exist for a player?

dawn flower
#

so uh

#

if i have a signature for an old message

#

and try to delete that signature of a player that didnt receive the message with that signature

#

what happens

eternal night
#

nothing

dawn flower
#

good

worthy yarrow
#

^ but also why would you even allow that

dawn flower
#

i dont want to keep track of who has that specific message

worthy yarrow
#

Just don’t remove from players who haven’t the signature

#

Oh well

eternal night
#

I think

#

lemme recheck

worthy yarrow
#

Fair I guess

#

I’m pretty sure you’re correct lynx, I had something similar long time ago and I don’t remember anything actually happening

eternal night
#

It should be fine yea

dawn flower
#

alr

merry cove
#

so my dumb ass can't figure out how to use saveResource to generate the dirs & then add files from inside that dir in the project.

    public void load() {
        for (ConfigType configType : ConfigType.values()) {
            File file = getFile(configType);

            if(file.isDirectory() && file.mkdirs()) {
                File[] ymlFiles = file.listFiles((dir, name) -> name.endsWith(".yml"));
                if(ymlFiles != null) {
                    for(File x : ymlFiles) {
                        plugin.saveResource(x.getName(), false);
                    }
                }
            }

            if (!file.exists() && !file.isDirectory()) {
                plugin.saveResource(file.getName(), false);
            }

            if (file.isFile()) {
                YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file);
                yamlConfiguration.options().copyDefaults(true);
                configurations.putIfAbsent(configType, yamlConfiguration);
            }
        }
    }```

```    private File getFile(ConfigType configType) {
        return switch (configType) {
            case Messages -> new File(plugin.getDataFolder(), "messages.yml");
            case Items -> new File(plugin.getDataFolder(), "items.yml");
            case Mobs -> new File(plugin.getDataFolder(), "mobs.yml");
            case MobDir -> new File(plugin.getDataFolder(), "mobs");
            case ItemDir -> new File(plugin.getDataFolder(), "items");
            default -> new File(plugin.getDataFolder(), "config.yml");
        };
    }```
eternal night
#

the client does disconnect if the signature is not fully unpacked

#

but it should be iirc

#

give it a try anyway tho

dawn flower
#

i am

eternal night
dawn flower
#

is this whatsapp

#

can i make it not do that

remote swallow
#

or just resources/file

analog mantle
#

I just use json

remote swallow
#

for something like messages.yml use saveResource("messages.yml") for mobs use saveResource("mobs/mobs.yml")

remote swallow
dawn flower
remote swallow
merry cove
#

so it'll generate the dir?

#

I'll give it a go in a sec, ty!

kind hatch
#

Yes, it will.

misty ingot
#

man making a plugin which allows data saving in yml, sqlite and mysql is definitely not tough but pretty annoying

#

so much typing

analog mantle
#

Anybody know?

kind hatch
#

Wdym reset?

analog mantle
#

I have text that shouldn't have a clickevent on it, and I just wanna wipe it

#

.

remote swallow
#

just interface, implementing classes and make util methods

young knoll
#

Make multiple components, only adding the click event to the part you want, and then append them together

kind hatch
young knoll
#

Or use the component builder

analog mantle
#

lemem send code

#

?paste

undone axleBOT
misty ingot
remote swallow
#

type quicker

misty ingot
#

i just have 3 classes with 3 very simple methods, load(), createCache() and save(gib me cache)

misty ingot
#

hands hurt nonetheless

bronze wren
#

anyone got some useful kotlin libraries?

sullen wharf
#

does Damageable#damage ignore protection?

merry cove
#

[01:33:44] [Server thread/ERROR]: Error occurred while enabling PuppetMaster v1.0.01 (Is it up to date?)
java.lang.IllegalArgumentException: The embedded resource 'SkeletonItems.yml' cannot be found in plugins\puppetmaster-1.0.01.jar

merry cove
#

not really what I'm asking though

glad minnow
#

it is

#

it says that the file you're searching for isn't where you're searching

#

because it's not, it's in your resources folder

#

and you get the data folder

#

which != resources folder

#

data folder, where you can create a folder if not present, which is a folder in your plugins folder when the said plugin is started

#

the resources folder is in your source code, where you store your config file for example

merry cove
#

Ok, to me I still have no clue what you're trying to say. I am not asking to generate the plugin folder inside plugins/ ?

glad minnow
#

no that's not what i meant, sorry, let me explain rq

#

the file you're searching for, isn't in the plugin's data folder. it's in your resources folder. which created the error you sent

#

because it can't find it in the plugin's data folder

glad minnow
# merry cove

this is in your resources folder if i'm not mistaken, right? (english isn't my main language sorry)

merry cove
#

Yes, but why would the other configs outside the inner directories find it but not this 😮

kind hatch
#

Or just use #saveResource()

glad minnow
#

yeah should work too

sand spire
#

How do I know if a method accesses the "Bukkit API" for async code?

Because I can use Bukkit#getPlayer or Player#sendMessage without any issues
But if I use World#getNearbyEntities or Player#openInventory I will get an IllegalStateException and/or "failed main thread check"

Is there a way to distinguish these methods without running the code?
From javadocs: Asynchronous tasks should never access any API in Bukkit. Great care should be taken to assure the thread-safety of asynchronous tasks.

kind hatch
#

There's not currently an easy way to distinguish what's safe and not safe.

glad minnow
#

trial and error

merry cove
kind hatch
#

Trial and error and just asking around are your best bets.

sand spire
#

Alright thanks 👍

glad minnow
#

np

kind hatch
merry cove
#

ok, might be better if I explain what I am trying to achieve. I have config, message etc. in the plugin.getDatafolder(). inside the datafolder I have (in resources) a directory called items and mobs where I want to only add the files and directory if it doesn't exists. if it exists on the other hand I don't save the default file. so in other words, these two files should only load on the first plugin load.

glad minnow
kind hatch
#

^

#

#getDataFolder() returns the folder created on the server that your plugin uses.

#

It's named the same as your plugin name (in plugin.yml)

glad minnow
#

that's what i wanted to say when i first tried to help you

merry cove
#

Yes, hence why I added plugin.getDataFolder(), "items" + File.separator + "SkeletonItems.yml" items file seperator and the file name string here?

glad minnow
#

No, that searches for the file in the data folder of the plugin when it's made

#

What you want is in the Resources folder

kind hatch
glad minnow
#

^

merry cove
#

ahhhh

#

sorry for being this dumb lol

glad minnow
#

that's what i wanted to say all along 😭

#

no problem

#

should've explained better

merry cove
#

so doomed to happen

glad minnow
#

yeah sucks

merry cove
#

ok, now I figured out why it doesn't work but still got no clue how I can get it though

glad minnow
#

saveResource()

#

and the path to the file

#

or InputStream

#

however you like it

merry cove
#

ok, I think I understand.

glad minnow
#

allows you to access it, then you can make your initial code work

kind hatch
#

#saveResource() will be the easiest and it also has an option to not overwrite any existing files.

Usually people just write #saveResource("path/to/file", false); as to not overwrite any existing file.

glad minnow
#

^

kind hatch
#

If you want finer control, then you're probably gonna want to use InputStreams, or Jar Enumeration.

glad minnow
#

In conclusion, all 3 ways should help 👍

merry cove
#

this feels like trying to google how to center a div after 7 years of css

glad minnow
#

lmao

#

relatable

kind hatch
#

Me when flexbox

#

In all honesty, the API could use a QOL update on this front.
Just to make things a little easier to use. Especially for plugins with multiple files.

glad minnow
#

depends

#

not that many people need it

#

but i can also see how useful it can be

dawn flower
#

can http clients stay connected and ask for a new response multiple times (with different payloads) like websockets?

#

or do i have to reconnect it everytime

drowsy helm
#

one time

#

orelse the request times outs

#

and gets closed with a response

dawn flower
#

i just did that tho

#

and it's almost 4x faster...

#

good for me

drowsy helm
#

interesting

#

ah a request can have multiple responses but one status code

dawn flower
#

oh wait nvm

dawn flower
#

Enabled plugin with unregistered ConfiguredPluginClassLoader ... v... uh

#

how do i fix this

slender elbow
#

?whereami

merry cove
#

Is it possible to depend on a protocollib dev release using maven? aka in other words get the latest dev build as a dependency.

#

it autocompletes these, but none of them finds the artifact ID besides the 5.1.0 and 5.0.0 which makes me believe it doesn't allow dev dependencies >.<

analog mantle
#

Uh ik with gradle you can use jitpack and do master-SNAPSHOT

merry cove
#

didn't work in maven :/

drowsy helm
#
<dependency>
  <groupId>com.comphenix.protocol</groupId>
  <artifactId>ProtocolLib</artifactId>
  <version>5.2.0-20231209.220838-1</version>
</dependency>

is the latest

humble lynx
humble lynx
#

omg thank you

#

i think this website is a life saver

#

😭

analog mantle
#

How do I make a component not have all the previous formatting from the former component? I don't want that.

blazing ocean
#

components always inherit their styling from the parent

#

components are a tree

analog mantle
#

How can I make it so it won't?

#

I want a click event on one piece of text. Not the whole object. That's all I ask for, but nope.

upper hazel
#

is it possible to make a ship out of blocks and give possibility to control it? like in vehicles plugin? (smooth turns)

#

I don't mean the small models, I mean the big ones.

upper hazel
#

and what it's supposed to look like, roughly.

#

all the blocks are armourstands?

drowsy helm
#

yep, each block is 1 armourstand

#

will end up being laggy if theres a lot

#

and a lot of complex math

upper hazel
wet breach
#

and it wasn't laggy

#

at least not from the videos he showed

upper hazel
wet breach
#

probably can find them if you search the general chat history

upper hazel
#

by the way, can display entities be solid?

#

can the player stand and move in the display blocks?

analog mantle
drowsy helm
wet breach
#

here you go

#

here is one of them

drowsy helm
#

If no one has answered, we dont know

analog mantle
wet breach
analog mantle
#

IT IS

wet breach
blazing ocean
#

that does sound correct tho

#

show your code atleast

wet breach
#

no one here is paid to provide support nor does it cost you

#

you alternatively could make a post on the forums if it turns out you might have to wait for a while for a response

analog mantle
blazing ocean
#

...no?

blazing ocean
#

i haven't seen anything here?

upper hazel
analog mantle
wet breach
#

however though as you can see, it is actually pretty smooth

analog mantle
#

Wanna make it a third time?

blazing ocean
wet breach
#

such attitudes isn't going to garner you people wanting or willing to help fyi

nova notch
#

i dont think complaining about people not helping you will get you help

blazing ocean
#

it'll just let people to not want to help you

wet breach
#

its normal that some of us don't like to search through the history for what you posted some time ago and just easier if you gave us a link

#

I recommend taking a timeout and just cooling off though

analog mantle
upper hazel
#

that's cool but if these blocks can be solid then that's just perfect
I'll try to check

drowsy helm
#

and hes calling us the jerks lmao

analog mantle
wet breach
#

sure, and some of us don't get answers until a week later

hollow vessel
#

hi can someone help me?

drowsy helm
#

We are community members trying to help people because we are nice of0. We don't get paid, we don't do it for any gain

nova notch
analog mantle
#

Yes, for HOURS

wet breach
#

this is why you have to check which hand for the interact event

upper hazel
blazing ocean
#

you sometimes just have to figure it out on your own 🤷

wet breach
#

I think t he longest I have seen for someone to finally resolve an issue was like 2 months

blazing ocean
#

i had to figure out DFU for a while by myself by looking at the src 🤷

#

it was a real pain tho

wet breach
#

but it was mostly because those of us that could have provided the answer were not here at the time and just happened to be mostly busy 😛

analog mantle
hollow vessel
wet breach
# analog mantle I have tried. for hours.

this is normal for development. You will encounter walls like this. Best you can do is to keep researching and doing your best to resolve it or just come up with a temp solution for the time being until you can get it working

nova notch
#

sleeping also helps

blazing ocean
#

i always forget how ugly bungee chat components are

shadow night
blazing ocean
#

yea

wet breach
analog mantle
wet breach
#

but I am just telling you why the interact event in general is thrown twice

blazing ocean
#

adventure still exists if you want documented stuff

#
wet breach
#

just like conversation api

#

there is not really documentation for it

#

but the API is still there 😛

shadow night
#

Conversation api?

wet breach
#

yeah, and its one of the oldest parts of the API as well

#

and still not very well documented XD

blazing ocean
#

what's that

#

i'm sure dfu is worse

shadow night
#

What does it do

wet breach
#

it allows you to create chat channels and put players in there. You can even have them respond to server related messages

#

and read their specific inputs

#

let me show you an example

analog mantle
shadow night
blazing ocean
wet breach
#

so, what that conversation api in my plugin does, is it puts you in a channel where you can't see main chat, but retains main chat history so when you exit you can see what people were saying. But its handy when you don't want that to get in the way

blazing ocean
#

adventure bukkit platform exists

analog mantle
hollow vessel
wet breach
#

its setup to ask the player questions in which they provide their answers and takes that and applies it to the config

wet breach
analog mantle
blazing ocean
#

then change it..?

#

lol

wet breach
#

but regardless, I explained to you why the interact event gets ran twice

#

it runs for each hand, whether you want it to or not

analog mantle
shadow night
nova notch
analog mantle
#

Not worth it

nova notch
#

if it makes your code actually useable it is

blazing ocean
shadow night
wet breach
#

but its also one of the oldest api's to exist as well, introduced I think in 1.5? maybe slightly earlier

shadow night
wet breach
#

well the inventory api is quite old however when it was first introduced it was pretty rudimentary in that it allowed you to get the players inventory and some others but you had to know the slot numbers

#

if you wanted to move or add stuff

#

also, you had to specifically use air to clear out stuff

shadow night
hollow vessel
wet breach
#

yeah I don't think events for the inventory were not until later because at the time there wasn't much done with inventories

#

IE hoppers didn't exist

#

so moving items automatically from one inventory to another wasn't really a thing

shadow night
wet breach
#

also entities didn't have inventories either

shadow night
#

shitty times

wet breach
#

maybe so, but impressive none the less we still had plugins that did some cool stuff

#

I mean it should make you appreciate more just how much work had to go into them to make them function unlike today XD

#

holograms today are easy too, unlike in the past and with mojangs added display entities even easier

#

in the past you had to make use of horses and the negative age glitch 😛

shadow night
wet breach
#

well I don't understand what issue you are having with the event running twice

#

if you checked for appropriate hand it shouldn't be much of a problem

shadow night
#

Didn't we have a trick for this case

#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
hollow vessel
#

and still event is triggering twice

wet breach
#

it doesn't stop the event from running twice

#

it stops your code from running twice

#

as I said, the event will be thrown for both hands, but if you only need to run code if a particular hand is used, the above would make that happen

#

but the event will still be thrown twice

hollow vessel
#

okay, but the problem is i have condition that checks that

shadow night
#

It would be easier if we had code ig

hollow vessel
#

I sent it yesterdsy, let me find message

wet breach
#

yeah, or some better visualization of what the issue is. If you have a check for the condition, then that means only one of the events would match

#

however it also depends what is going on and causing the event to be thrown as well

shadow night
#

I hope this is not an issue of a person registering an event two times

wet breach
#

which means you might need to further expand your conditional check

hollow vessel
#

there it is

hollow vessel
pseudo hazel
#

you are using HAND

#

which I think is deprecated even

wet breach
#

it would appear you might want to inverse your check

#

and put all your code in the conditional block

pseudo hazel
#

oh its not nvm

wet breach
#

this way you are ensuring the rest of the code isn't being ran

hollow vessel
pseudo hazel
#

yeah my bad I was looking at something else

hollow vessel
#

okay when I will come home I will inverse this condition and check it

wet breach
#

sounds good

#

let us know how it goes 🙂

turbid flame
#

What might be the cause of player walking super slow?

I made proxy with build in limbo, when i connect player -> proxy -> server everything is just fine, when i connect player -> proxy -> limbo -> server player walk superrr slow. But i can fly normally. On limbo i don't send any other packets then JoinGame packet

Version 1.18

pseudo hazel
#

wtf is limbo

chrome beacon
#

Think of it as hypixels afk area if you've seen it

pseudo hazel
#

or the queue from 2b2t? or is that different

chrome beacon
#

yeah that queue too

turbid flame
#

I can add that the player can't really interact with block also because the client don't hover on them

chrome beacon
#

If the player has no chunk it will start to move slowly

#

and you yourself said you're not sending any chunks in limbo

misty ingot
#

man thinking of ideas for plugins to make literally just to keep me occupied is surprisingly hard

turbid flame
#

It will keep moving slowly?

chrome beacon
#

It will move normally once the chunks are loaded

thorn crypt
#

Hi, does anyone know how I could by using ProtocolLib, spawn a fake entity that only a target will see and check if this player hit this entity ?

turbid flame
#

But he still keeps walking slow

#

I can fly with normal speed

wet breach
#

you just running into what is called writers block, instead for development

#

how about making a mail/package delivery system and call it Squire ?

#

utilizes an entity that comes and delivers you mail/packages

thorn crypt
wet breach
#

you can credit me for the idea, feel free to implement it. Its been something I wanted to make just never really have time 😛

#

I was thinking of using an entity like the witch and use some particles to make them poof in and out of existence

#

this way it doesn't look weird that they just simply disappear especially if they appeared in your house or something XD

#

also, in terms of the mail when someone writes a message using chat, the item that gets delivered is a book

#

to make it look like mail 🙂

humble lynx
#

My favorite thing to do is make fun custom items, creativity can run wild there

wet breach
#

I take some inspirations from movies and shows too

#

or other games

thorn crypt
wet breach
#

yeah you could definitely do that too, using a portal

eternal oxide
#

You can't guarantee the player is on the ground

thorn crypt
#

creativity is everything for that

humble lynx
#

True, I made an item from that whistle thing from Guardians of the Galaxy

thorn crypt
eternal oxide
#

a poof appearing from smoke approach would be better

wet breach
#

which is really all that is needed

humble lynx
#

(you could make the witch float in the air as well)

wet breach
#

the whole entity thing is more or less for visuals

eternal oxide
#

use an EntityDisplay so no collision.

wet breach
#

when the entity is close enough to them, they will get a prompt in chat to open mail etc

#

and this opens an inventory for them to fetch their items

humble lynx
#

i wonder if scoreboards will ever be interactable

wet breach
#

if they don't fetch their items, the entity will come back after a bit of time to re-deliver again

#

this approach avoids having to ensure all bugs with the entity don't happen and could safely be ignored lol

eternal oxide
wet breach
#

Lol, wouldn't quite compare it to clippy XD

eternal oxide
#

Would you like some help getting yoru mail?/?

wet breach
#

lmao

drowsy helm
#

am I missing something with BT java -jar BuildTools.jar --dev --dont-update --compile craftbukkit im running this and in my CraftBukkit main ive repalced the Loading libs with System.out.println("Loading libraries, please wait... TEST"); just to test but its still printing the default

#

or does that ONLY compile craftbukkit?

wet breach
#

it should just only compile craftbukkit

#

just remove the compile portion, and it should build all the projects

misty ingot
wet breach
#

nice

misty ingot
#

im basically working on an adaptation of a vault plugin but super extensive

#

unfortunately it is hurting my fingers having to type that much

drowsy helm
wet breach
#

are you doing the changes via the patches?

drowsy helm
#

i thought BT generates the patches

wet breach
#

when it comes to customizations, I have always done them to spigot

wet breach
#

and ensure they are in the patches directory

#

but I have always ignored patches and just did my changes to spigot so I can't really say more on the whole patches thing =/

misty ingot
#

btw what sdk do yall use

wet breach
#

it is also the reason I don't contribute to spigot either since I don't like messing with patches

wet breach
#

I won't use anything less then java 17 though

misty ingot
#

a lot of people say use java 17

#

why not always use 22

#

21*

wet breach
#

well, it is required starting from a certain version that you have to use minimum java 17

drowsy helm
#

hmm time to do more research, I still don't fully understand the whole craftbukkit, bukkit, spigot build pipeline

misty ingot
#

if im making, say a 1.8-1.20 plugin i can use java 21 right

wet breach
misty ingot
#

also some people recommend using the zulu sdk

wet breach
#

and then the spigot patches are used

drowsy helm
#

yeah, but i thought bt did that all automatically

wet breach
drowsy helm
#

not sure if i have to do that manually or what

misty ingot
#

this sdk stuff is confusing im going back to python

wet breach
#

I also only use Oracle JDK

misty ingot
#

but ye i think ima keep to 1.13+

#

im currently using amazon sdk, people say zulu is the fastest so might try that

wet breach
#

fastest in what regard?

hazy parrot
#

I don't really think there is much difference

tender shard
drowsy helm
#

The performance difference is pretty negligible

wet breach
#

the only reason to use a different JDK is if you are also going to use a different JVM on top of that

#

and want whatever changes they made

misty ingot
#

hmmmmmmmmmmmmmmm
ok

#

time for oracle 21

wet breach
#

if you don't change the JVM you are using, then which JDK you compile against isn't going to really affect performance

misty ingot
#

well i hope this plugin goes well

wet breach
#

on another note, most people don't have projects or applications where they hit limits of a JVM to really even care about such things

misty ingot
#

yeah i dont think a vault plugin will be crashing someones server anytime soon

small valve
#

What event does Player#chat call? Is there a way I can view spigot api source code?

eternal oxide
#

?stash

undone axleBOT
dusty totem
#

Hey, which version is stable for now?

pseudo hazel
#

hopefully most of them

#

latest is 1.20.6

#

which is as stable as it will ever be

#

but that goes for all versions

dusty totem
#

I meant in the build tool if you are not adding a pram about the version to build this will build the stable version not last, so the stable is 1.20.6?

chrome beacon
#

if it builds 1.20.6 without a flag then it's the latest stable

dusty totem
chrome beacon
#

site last time I could check if the version was stable before I built it.
?

#

You should still update regularly

#

so it really isn't a waste to build it

dusty totem
#

if the version is LTS (stable) yes

chrome beacon
#

Spigot doesn't have lts

#

Only the latest release gets updated

glass inlet
#

I have a problem with my bungee plugins. Here's the bungee.yml files for both:

name: DataManager
main: net.hypple.plugin.datamanager.bungee.DataManager
version: 2.0.1
author: alan
name: FriendsManager
main: net.hypple.plugin.friendsmanager.bungee.FriendsManager
version: 1.0.1
author: alan
depend: [DataManager]
softdepend: [NewtorkManager]
#

As seen in the files the FriendsManager needs to be loaded after the DataManager but when I run this bungee I get this:

13:12:33 [INFO] Loaded plugin FriendsManager version 1.0.1 by alan
13:12:33 [INFO] Loaded plugin reconnect_yaml version git:reconnect_yaml:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Loaded plugin cmd_find version git:cmd_find:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Loaded plugin cmd_server version git:cmd_server:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Loaded plugin DataManager version 2.0.1 by alan
13:12:33 [INFO] Loaded plugin cmd_alert version git:cmd_alert:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Loaded plugin cmd_send version git:cmd_send:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Loaded plugin cmd_list version git:cmd_list:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [WARNING] Forced host server pvp is not defined
13:12:33 [WARNING] [FriendsManager] DataManager plugin not found or not enabled!
13:12:33 [INFO] [FriendsManager] Disabling FriendManager...
13:12:33 [INFO] Enabled plugin FriendsManager version 1.0.1 by alan
13:12:33 [INFO] Closing pending connections
13:12:33 [INFO] Disconnecting 0 connections
13:12:33 [INFO] Enabled plugin reconnect_yaml version git:reconnect_yaml:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Enabled plugin cmd_find version git:cmd_find:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Enabled plugin cmd_server version git:cmd_server:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] [DataManager] [DataManager]: Set to MySQL database.
13:12:33 [INFO] [DataManager] [DataManager]: Connected!
13:12:33 [INFO] Enabled plugin DataManager version 2.0.1 by alan
#

Here's the code for onEnable() of FriendsManager:

@Override
public void onEnable() {
    dataManager = (DataManager) getProxy().getPluginManager().getPlugin("DataManager");
    
    if(dataManager == null || !dataManager.IsSet())  {
        getLogger().warning("DataManager plugin not found or not enabled!");
        getLogger().info("Disabling FriendManager...");
        getProxy().stop();
        return;
    }
    CreateTables();
    BungeeCord.getInstance().pluginManager.registerListener(this, new EventListener(this));

    if(getProxy().getPluginManager().getPlugin("NetworkManager") != null) {
        networkManagerAPI = new NetworkManagerAPI(getProxy().getPluginManager().getPlugin("NetworkManager"));
        getProxy().getPluginManager().registerListener(this, new EventListenerNetworkManager(this));
    } else {
        getProxy().getPluginManager().registerListener(this, new EventListenerNoNetworkManager(this));
    }
    
    BungeeCord.getInstance().getPluginManager().registerCommand(this, new FriendCommand("f"));
    BungeeCord.getInstance().getPluginManager().registerCommand(this, new FriendCommand("friend"));
    BungeeCord.getInstance().getPluginManager().registerCommand(this, new FriendsCommand());
    LoadData();
}
worldly ingot
#

No? It's BungeeCord aPES_Think

drowsy helm
#

oh wait im tripping lol

glass inlet
#

Yeah it's BungeeCord

glad minnow
#

😬

drowsy helm
#

depends

#

not depend

#

and softDepends

glass inlet
#

Oh right different from spigot

#

woops

acoustic pendant
#

What's the best way on making a counter and knowing the time left?

drowsy helm
#

whats the usecase

#

you've asked an xy question

tardy delta
#

Instant representing the deadline?

acoustic pendant
torn shuttle
#

am I reading it right that 1.20.6 is still using R4?

acoustic pendant
tardy delta
#

ive seen that code like a week ago

acoustic pendant
#

yeah?

#

It's from the spigot page

tardy delta
#

why wouldnt that work

acoustic pendant
#

It is oriented for cooldown, but was thinking on using it my way

#

Well nvm

#

I can just use this lol

eternal oxide
#

location is not a good object to compare

tardy delta
#

where

#

oh wait

#

didnt see

torn shuttle
#

for reflections

#

seems like it's using R4

drowsy helm
#

was just looking at my bt output

acoustic pendant
#

How does Duration return the time?

tardy delta
#

what

eternal oxide
#

it doesn't

tardy delta
#

duration is a timespan, dunno what youre working on

eternal oxide
#

Duration is a measurement of time, it's not a specific time

acoustic pendant
#

I mean

#

But it returns x seconds

eternal oxide
#

if you ask for seconds, yes

glad minnow
#

You can parse it into different time units

#

Like #toNanos() etcetc

#

#toMinutes(), you can check what you want to retrieve from it by trying them

acoustic pendant
#

But if I use #toMinutes() when it is below 1min it just return 0 min

glad minnow
#

Then seconds

acoustic pendant
#

Should I make a system that detects if it is less than 1min and if it is do #toSeconds?

glad minnow
#

You can make a method that checks that sort of thing

#

Yep ^

acoustic pendant
#

k thanks

tardy delta
#

what you even doing

acoustic pendant
#

a timer but wanted to know the time left

glad minnow
#

Why use duration

acoustic pendant
#

Does runTaskTimer return the time left?

#

somehow

tardy delta
#

so display the time remaining, just check for each unit and append it to a string?

glad minnow
#

You can make a way easier process by making your own timer system

tardy delta
acoustic pendant
#

...

eternal oxide
#

you need to store a specific point in time in your map, not a durations

glad minnow
#

^

tardy delta
#

thats why i said use Instants

eternal oxide
#

map.put(key, Instant.now())

drowsy helm
#

just use instants then get time millis

#

simple

acoustic pendant
#

okay, i'll try then

eternal oxide
#

you can then do java if (map.get(key).plus(duration).isAfter(Instant.now())

acoustic pendant
#

And to get the time left for that timer, can I use #until ?

tardy delta
#

i assume you are storing the end time?

echo basalt
#

If the value returned is null you have a nasty npe

acoustic pendant
eternal oxide
#

ah

tardy delta
#

Duration.between(map.get(key), Instant.now()) no?

eternal oxide
#

I was assumign you store teh time it starts not ends

acoustic pendant
tardy delta
#

actually params the other way around

misty ingot
#

im getting the error Unsupported class file major version 65 when trying to compile my plugin
I looked far and wide but couldnt find a working solution

I am using Java 21
its using spigot 1.20.6-R0.1-SNAPSHOT
using api version 1.13 in plugin.yml

eternal night
#

gradle or maven?

worldly ingot
#

Yeah if it's on compile, it means your build system isn't using Java 21

#

Source level you might be, compile level probably not

blazing ocean
#

maybe change your project sdk in project structure (ctrl-shift-alt-s)

misty ingot
#

mavel

#

maven

wet breach
#

check the properties setting in the pom

misty ingot
#

im using graalvm-jdk-21
i have java 21 installed in the system

wet breach
#

its most likely set to a lower version

misty ingot
#

pom is also o n 12

#

on 21

wet breach
#

either you are not using maven to build

#

or you have a setting in the pom

#

its not a mystery

misty ingot
#

definitely using maven to build

wet breach
#

then you have a setting in the pom that is not set for 21

misty ingot
#

i aint lyin

wet breach
#

then you are not telling the IDE to use maven to build

#

what do you click to make it build?

misty ingot
#

the run button

#

never had this issue before but i also only used java 17 before this

wet breach
#

have you tried reloading maven? or clearing caches for IJ?

#

this makes like the 1000th person over a year or so who has issues with IJ, main reason I stick with NB

#

who wants an IDE that gives you problems -.-

misty ingot
#

whats NB

pliant topaz
#

IJ is nice

misty ingot
#

IJ feels good

wet breach
#

NB = NetBeans

misty ingot
#

but id be up for a switch if the other one feels better

pliant topaz
#

there's just too many factors that could leed to problems

misty ingot
#

how exactly do i reload maven :p or clear cache

shadow night
wet breach
wet breach
#

no one said you had to use the default lol

shadow night
pliant topaz
#

in 99.9% 'Repair IDE' fixes ur problems, if not it's most likely an PEBKAC

late sonnet
#

@misty ingot make a new task in the IDE for maven and change package for "--version" and check what tells in the info

wet breach
#

idk about the GH pilot plugin but you could look in the plugin repo for the IDE

shadow night
wet breach
#

I have a quad core 3.6ghz with 16GB of ram

shadow night
#

Well, that's pretty similar to my hardware

misty ingot
kind hatch
pliant topaz
wet breach
#

its whether or not does it perform what I need it to when I need it to without any issues

misty ingot
pliant topaz
late sonnet
wet breach
#

netbeans has never failed me. I have never once had an issue. Where as IJ suffers from cache dysync, dysncying of maven and the related. All these problems deriving from the IDE and not because you configured something wrong.

#

if you have to close out or restart your IDE to just get it working again, it doesn't sound like a very good IDE to me and would annoy me

#

since I like leaving my applications opened

late sonnet
pliant topaz
#

Is it an issue that ur using a higher Maven version than configured in pom?

kind hatch
#

Why do you have modules if you are using maven?

misty ingot
#

um holup intellij wont lemme open any projects :p

wet breach
pliant topaz
#

it's over 0.1 versions behind

#

Pom says 3.8.1 and he's using 3.9.6

misty ingot
#

ok problem solved a plugin got hecked

wet breach
#

but I also don't use IDE provided maven either

misty ingot
#

lemme see the module settings now

wet breach
#

I use an installed version so that I don't end up with million maven versions across my projects

late sonnet
shadow night
misty ingot
#

@late sonnet

wet breach
#

the IDE will generally download whatever version is specified in the POM

blazing ocean
wet breach
#

if you use IDE provided maven

shadow night
blazing ocean
#

yeah

#

but it just generates garbage for anything else

shadow night
#

Usually when I don't need it I just turn it off

misty ingot
kind hatch
#

Can you ?paste that plz

#

Mobile ui sucks with direct files.

undone axleBOT
misty ingot
shadow night
wet breach
#

your compiler is outdated

#

use 3.9.7

shadow night
#

There is no situation when you should use an outdated compiler, besides sometimes when it forces you to use a version from 2019

wet breach
#

well sometimes the default pom provided by the IDE

misty ingot
#

i may or may not have tried that

wet breach
#

puts an outdated maven version

late sonnet
wet breach
#

and some just forget to change it

wet breach
shadow night
wet breach
#

also, you should try using maven 3.9.7 in your IDE

wet breach
#

if you can't recommend installing maven

misty ingot
wet breach
#

well you need to update your maven version too

misty ingot
#

time to google how to do that

late sonnet
wet breach
#

so its using the right java version

#

just need to update maven

#

and the related plugins

chrome beacon
#

Intellij has updated the bundled maven

#

so it should work assuming Intellij is up to date

wet breach
#

they need to use 3.9

misty ingot
chrome beacon
#

See bundled is 3.9.6

misty ingot
#

may be time to switch away from ij

wet breach
#

hence I was recommending updating all of the maven stuff

chrome beacon
#

yeah

wet breach
#

3.8.1 compiler isn't very good to use 😛

late sonnet
chrome beacon
#

Update the shade plugin as well

misty ingot
#

alright well time to see how to do that exactly

chrome beacon
#

just change the version in the pom

wet breach
#

you just change the version in the pom

#

and then run a clean build

#

it should pull in the updated maven plugins

misty ingot
#

so i just

#

change it to 3.9.2 again

wet breach
#

3.13.0 is the latest for the compiler

misty ingot
#

ok so i change that to 3.13.0

kind hatch
#

Then try to compile again.

misty ingot
#

shade to 3.5.3

#

magically worked this time

#

what is this ide

wet breach
kind hatch
#

That’s just maven. :p

wet breach
#

well that is what happens when you use ide provided

misty ingot
#

it was always set to bundled

wet breach
#

if you were using an installed version, the error would had been more obvious

misty ingot
#

its still set to bundled

#

and now it works

#

tf

wet breach
#

well you didn't install maven either

#

so it being set to bundled is correct

chrome beacon
#

The issue never was the installed maven version

misty ingot
#

i did a total of nothing and the problem fixed itself

chrome beacon
#

it was the plugin versions

kind hatch
#

^

chrome beacon
#

Not sure why frostalf is so focused on the installed maven version

kind hatch
#

IJ is pretty good with downloading required tools. At least in my experience.

wet breach
#

I just don't consider maven and its plugins separate and that both should be checked

kind hatch
misty ingot
#

anyway i can finally actually start testing my plugin

wet breach
#

certain higher level versions of the plugins are not always supported if the maven version is too low

#

same is true of java versions and maven versions

#

if the maven version is too low, it may not support the new java version as there could have been changes that made the maven version incompatible

#

this has happened with java 9, 12, 17

wet breach
#

maybe the next breakage might convince you to try out NB

misty ingot
#

perhaps it will

rough drift
#

if a player opens a chest, is there a way I can edit the items inside that chest only for that player? I know that in InventoryOpenEvent there is a getView method, but the getTopInventory and getBottomInventory simply return Inventory instances, are those local to only the player or do they edit the acutal contents?

eternal night
#

actual contents

dusty totem
misty ingot
#

this is the peak of minecraft ui design

pseudo hazel
#

you cant get much better than that without resource packs xD

misty ingot
#
C:\Users\LEGION\Desktop\test servers\1.20>java -Xmx4G -Xms4G -jar server.jar nogui
Error: Unable to initialize main class net.minecraft.server.Main
Caused by: java.lang.NoClassDefFoundError: joptsimple/ValueConverter

hmm

#

downgraded from 1.20.6 to latest

chrome beacon
#

huh what jar did you use

#

Use the jars that's placed in the root folder where the BuildTools jar is

#

Don't try to grab and use an incomplete one

misty ingot
#

i may have grabbed the wrong jar

hollow vessel
torn shuttle
#

jetbrains makes IDEs for cowards, it can't even load my 15k line file

#

that is just one big string

glad minnow
#

💀

chrome beacon
#

Reminds me of when I tried to nano a massive file

#

Apparently it loads the entire file in to memory at once

torn shuttle
#

the funniest thing is why I need that file

#

I'm sending my entire wiki for all my plugins in plaintext to google gemini for it to do 24/7 ai support

#

I love it

chrome beacon
#

gemini 💀

#

but oh well it can probably answer the most common questions

#

99% of support requests are just people who don't read

torn shuttle
#

gemini 1.5 pro is a gigachad of a model, google really messed it up by naming it the same thing as the rest of their shitty lineup

#

it's not even close to the other models they have, it's genuinely better than gpt4 in several ways

#

also you probably have not tried it yet since it's still in invite-only access

#

1 mil context tokens, much faster response than gpt, almost perfect recall

#

can't really ask for better for a support bot at this stage

#

gpt is still doing 100k

#

also the api is free whereas a single query to gpt would cost me $2 with this token size, if it was even able to handle this context volume

chrome beacon
#

I'd rather use a selfhosted instance

#

of some open source model

torn shuttle
#

local models have incredibly low caps, bad recall and are generally nowhere near as good

#

plus hosting anything even remotely decent would be like $1/hour

chrome beacon
#

I don't think it's that bad

#

Should be enough for a simple support bot

torn shuttle
#

having tried that I'd much rather use gemini

#

plus gemini is free so why not

#

if google wants to scrape data from millions of tokens of my public wiki they're more than welcome to, I'd love it for them to do support on my behalf in the future lol

eternal oxide
#

I wrote a bot using Markov chains years ago. It was pretty good, at the beginning. As it learnt it got worse.

chrome beacon
#

llama should be decent

molten hearth
#

Perhaps it learned dark secrets

eternal oxide
#

Once AI reaches the stage it can offline converse and sex me up I'm done with humanity 😉

molten hearth
#

Real (I am horrified by this statement)

eternal oxide
#

It would be nice if it could cook too 😛

chrome beacon
eternal oxide
#

Profitable for them

chrome beacon
#

so that's what the modern chat bots do

chrome beacon
#

not you

vital sandal
#

how do I get the List for this packet?

astral pilot
#

yo guys. how do you properly manage config.yml

chrome beacon
undone axleBOT
chrome beacon
astral pilot
#

usually what u do

#

i need advice

vital sandal
chrome beacon
chrome beacon
astral pilot
vital sandal
#

hmm how to find a class that use it

chrome beacon
#

Take a look around

#

since you've decided to use unmapped it'll be a pain

#

but I believe I've warned you before about that

#

you decided to do everything the hard way for no reason

vital sandal
#

I'm maintain old code from previous devs :l

#

If I choose to do it that way

chrome beacon
#

Make your life easier and migrate

vital sandal
#

I have to change most of everything

#

instead of just 1 packet :l

echo basalt
#

🤔 is there any way to invert a kyori component

#

hm

blazing ocean
echo basalt
#

<red>a<green>b<blue>c -> <blue>c<green>b<red>a

blazing ocean
#

and that's mm which is kinda different in that case

onyx fjord
#

how do i prevent xp from being taken in PrepareAnvilEvent?

#

or perhaps a different event

onyx fjord
#

ik they are in spigot

echo basalt
#

I might be able to group them into formatting and text

#

I have a really hacky solution that kinda achieves the same result

#

so I won't bother much about it rn

slender elbow
pseudo hazel
#

yeah each component has a collection of children

eager rock
#

Hello, I have a plugin uploaded and there are 2 images in the description, but when I want to edit it, it only shows 1. Does anyone know a solution to this?

eager rock
upper hazel
#

will a plugin made on 1.12 display a tab list in versions higher if I create this class

#

why tab interface exists in 1.12 if this not work

chrome beacon
#

?notworking

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.

chrome beacon
#

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

upper hazel
#

it works but the tab does not display commands at all

#

this is not a question about errors in the code

#

Tab interface exists in 1.12 version

eternal oxide
#

Can't comment no code.

#

You are not even clear on yoru issue

upper hazel
#

you did not understand. The Tab Executor interface exists in 1.12 but 1.12 itself does not display any commands. Why does TabExecutor exist

eternal oxide
#

Tab somethign works in something version (not sure which) with some class, but doesn;t work in some other version (not sure which)

#

TabExecutor is not for commands, its for arguments

#

its a combination Interface

#

both TabCompleter and CommandExecutor

ivory sleet
#

yea its just an aggregate interface

upper hazel
#

yes i mean TabCompleter

ivory sleet
#

tabing has existed since like 1.8 if not even before

upper hazel
#

i dont remeber this name class

upper hazel
eternal oxide
#

So you didn't even get the name right. How do you expect us to understand and give you an answer

ivory sleet
#

altho the client, or even the server can may make mess it up

ivory sleet
#

like disabling it yk

upper hazel
#

hm

eternal oxide
#

So far (if I understand) you are having issues on 1.12 getting TabCompete to work on arguments?

upper hazel
chrome beacon
#

Are you using the tab key

chrome beacon
#

to display them

eternal oxide
#

then show us some code

chrome beacon
#

in 1.13 and older they aren't automatically visible

#

you need to hit the tab key

#

to autocomplete

#

Make sure you actually did that

upper hazel
#

this was a long time ago, I just thought about it before creating a new project for 1.12 haha

chrome beacon
#

TabCompleter works fine

upper hazel
#

lol

#

i was played minecraft 10 years but dont know obaut this agag

pliant topaz
wet breach
pliant topaz
#

hm

#

well, more people will theoretically (as far as statistics go) play on ur server because of the higher version range

eternal oxide
#

only pirates

pliant topaz
#

but I personally won't miss out on features only for a few more percent of players tbh

ivory sleet
#

i mean they've been told this before Luna

wet breach
#

the idea most dev's get is that by supporting outdated versions they gain a larger download. However, over time they will gain this anyways without supporting outdated versions

pliant topaz
ivory sleet
#

yeah I mean any1 who uses an outdated version gets flamed here in and out

#

:,)

wet breach
#

lol

brazen hollow
#

Hi, I have a little issue with a json file in the resources directory.
I am loading with this:

        // load config
        try (
                var configResource = FPRework.class.getResourceAsStream("logging.json")
        ) {
            if (configResource == null)
                throw new RuntimeException("Config file not found.");

            var configReader = new InputStreamReader(configResource);
            this.config = gson.fromJson(configReader, FPLoggerConfig.class);
            configReader.close();
        } catch (IOException ex) {
            this.warning("Couldn't load logging.json (read error). Using fallback configuration.");
        } catch (RuntimeException ex) {
            this.warning("Couldn't load logging.json (doesn't exist). Using fallback configuration.");
        }
```. The logging.json definitly exists
icy beacon
ivory sleet
#

i try to 😭

pseudo hazel
#

I atleast try to not deprecate everything directly in the next version, but I usually want to support 2-3 versions max

wet breach
#

I only support the latest stable. They can use one of the older versions of my plugins if they want to use an outdated server version

#

I have no interest in back porting features

#

think I have somethink like 200k downloads on my plugins

#

not that I have updated any of them lately >>

worthy yarrow
#

Frost just too busy

wet breach
#

o.o

pseudo hazel
#

its more like if you have to backport everything youll miss out on the new cool features

clear elm
#

how can i do clickable messages in chat

wet breach
#

use chat components

clear elm
#

liek this where a command executes when i click on the "CLICK TO ACCEPT"

clear elm
wet breach
#

?components

undone axleBOT
wet breach
#

@clear elm ^

hard badge
#

can anyone help me in call about tab

clear elm
clear elm
#

just give me an example

full rock
#

Is qprotect obfuscator allowed for plugins?

pseudo hazel
#

idk

#

probably not

broken nacelle
#
component.setClickEvent(new ClickEvent(ClickEvent.Action.ACTION YOU WANT, executeAction));
fluid cypress
#

if i open a config file from another plugin, like Bukkit.getPluginManager().getPlugin("something").getConfig(), will it be updated if the plugin owner of that config does reloadConfig or something like that to get the changes from disk? or do i have to do it myself? and what if i do YamlConfiguration.loadConfiguration bc the yaml file is not config.yml?

chrome beacon
#

Generally you'd want to avoid touching another plugins config

#

there's usually no good reason to do so

fluid cypress
#

except when there is no other way?

#

unless by touching you mean modifying it, i dont

pseudo hazel
#

the other way is to instruct users to change the config of that plugin

fluid cypress
#

but i dont want to change anything

#

i want to get the price of something from its config

#

and i want to get the value that the plugin is using

#

meaning, i need to know when the plugin has reloaded its config, if possible

chrome beacon
#

not possible

eternal oxide
#

the plugin likely has an API

chrome beacon
#

^^

#

Interact with the plugins api instead

fluid cypress
#

yea, it does, but i didnt find a way

#

specifically, im trying to get the configured price for plot claim

#

plotsquared

#

the plot claim event doesnt have a price property

#

or cost or balance or something

#

there is a lot of stuff on the plot object tho, there may be the price somewhere

chrome beacon
#

Did a quick look at the source and found the PriceFlag*

fluid cypress
#

like, you can set a price for your own plot, so someone else can buy it

#

im not sure tho

chrome beacon
#

try it and see

fluid cypress
#

yea, the price flag is 0, even tho im paying 5k as configured

chrome beacon
#

what's the setting and where

fluid cypress
#

plugins/PlotSquared/config/worlds.yml, worlds.<worldname>.economy

#

use: true, and claim price

#

there is merge and sell too

chrome beacon
#

Here's an example on how they fetch the price

acoustic pendant
#

Hey, so i'm trying to change players color name, but TAB overwrites it as I'm trying to do it via Team, I tried using TAB api but it didn't work, and the color didn't change. Could someone help me?

#
        TabPlayer tabPlayer = plugin.tab.getPlayer(player.getName());
        if (plugin.tab.getNameTagManager() instanceof UnlimitedNameTagManager) {
            UnlimitedNameTagManager nameTagManager = (UnlimitedNameTagManager) plugin.tab.getNameTagManager();
            nameTagManager.setName(tabPlayer, color + player.getName());
            System.out.println(3);
        } else {
            System.out.println(1);
            NameTagManager nameTagManager = plugin.tab.getNameTagManager();
            nameTagManager.pauseTeamHandling(tabPlayer);
        }```
#

tried that

twilit wharf
#

but then 1.20.6 wont compile. Do I need multiple versions of my plugin? If so then how does a plugin like TAB support all versions with one jar?

fluid cypress
#

and what currentPlots is? i guess the size in plots? like 1, or 1x2, o 2x2, etc

chrome beacon
#

you have the code available

#

scroll up

fluid cypress
#

i mean in the config

#

i remember i saw something about a configurable expression for the price, depending on how many plots the player owns or something like that

#

it has to be that

chrome beacon
#

Guess I have to screenshot it for you... ignore this :p

fluid cypress
#

thats not what i mean

#

but nvm, it doesnt matter what the expression is, as long as i use the proper arguments

chrome beacon
#

yeah I know

#

I shouldn't multitask :p

fluid cypress
#

Limit and GLOBAL are both static, so i guess that if i simply do Settings.Limit.GLOBAL from my plugin, ill get the same value

chrome beacon
#

from the name I would assume it's the total number of plots

fluid cypress
#

i guess this should work

@Subscribe
fun onPlayerClaimPlot(event: PlayerClaimPlotEvent) {
    val cost = event.plot.area?.prices?.get("claim")
    val price = cost?.evaluate(
        (if (Settings.Limit.GLOBAL) {
            event.plotPlayer.plotCount
        } else {
            event.plotPlayer.getPlotCount(event.plotPlayer.location.worldName)
        }).toDouble()
    )
    println("${event.plotPlayer} claimed ${event.plot} for $price")
}
tawdry echo
#
        for (RegisteredListener listener : BlockBreakEvent.getHandlerList().getRegisteredListeners()) {
            if (listener.getListener().getClass() == a.class) {
                BlockBreakEvent.getHandlerList().unregister(listener);
                break;
            }
        }

does it will unregister only BlockBreakEvent if Listener class has other more events? I need to rewrite that one

chrome beacon
#

Instead of looping every listener just keep track of your own listener

#

it will only unregister that specific event

#

if you use that unregister method

blazing ocean
swift dew
#
                    ItemStack itemStack = inventory.getItem(i);
                    ItemData itemData = ItemUtils.getDataFromItemStack(itemStack);

                    itemData.setBaseStats(CustomItems.itemsFromID.get(itemData.getBaseStats().getId()));

                    inventory.setItem(i, ItemUtils.makeItem(itemData, itemStack.getAmount(), showPrice));```
```public static ItemStack makeItem(BaseStats baseStats, int amount, boolean showPrice){
        ItemData itemData = new ItemData(baseStats.getId(), CustomItems.itemsFromID.get(baseStats.getId()).getName(), CustomItems.itemsFromID.get(baseStats.getId()).getDescription(), null, false, CustomItems.itemsFromID.get(baseStats.getId()).getBaseRarity(), CustomItems.itemsFromID.get(baseStats.getId()), CustomItems.itemsFromID.get(baseStats.getId()).getStats());
        return makeItem(itemData, amount, showPrice);
    }```
anyone has any idea on why do these 2 dont stack? playerdata is a serializable custom persisant data type
#

(both basestats and itemdata values are the same in both items)

tardy delta
#

adding pdc to an item makes it not stackable

swift dew
#

is there any way to change that or is it a minecraft thing

eternal oxide
#

their hash and equals would need to match too

swift dew
#

hash and equals?

eternal oxide
#

Object comparison

swift dew
#

also running the first code to the 2nd item's result makes them stackable again

grim hound
#

If you invoke thenAccept on a CompletableFuture

#

What thread is that executed on?

swift dew
#

main

#

everything

grim hound
swift dew
#

how is itemmeta hash determined

#

main thread

blazing ocean
grim hound
#

Is there someone more knowledgeable?

eternal oxide
#

It completes on teh calling thread, if teh future completed

swift dew
tardy delta
#

always useful when the jd dont mention it lol

#

please dont read the cf impl 😢

swift dew
#

where else can i read it

#

also they have the same description, name, flags and everything

#

they are all determined by itemdata

remote swallow
#

like this

tardy delta
#

just google spigot stash Craft{some spigot classname}

blazing ocean
remote swallow
#

item meta is flipped

#

idk

chrome beacon
blazing ocean
chrome beacon
remote swallow
#

yeah, that method seems chunky

swift dew
#

their itemmetas are identical too

grim hound
swift dew
#

hashmaps are serializable right?

grim hound
grim hound
#

I think

swift dew
#

their hashcodes match but they dont stack

grim hound
#

Nbt

swift dew
#

this is very comfusing

#

persistant data are identical too