#help-development

1 messages ยท Page 311 of 1

quaint mantle
#

https://paste.md-5.net/wogewitiga.cs <- Error - Class -> https://paste.md-5.net/uboyicovet.java // So the commands for /crewadmin "set", "add", "remove" all work no problem. The /crewadmin check <player> isn't working along with the basecommand, although the basecommand is working but returns error. I'm guessing it's how i declared the target variable and amount variable? Don't know any other way of declaring as if I declare seperately inside the case's i will get errors as it's in scope

tawdry parcel
#

okay thank you so much

quaint mantle
#

Just trying to make my code cleaner so using a method for the args check, I know I can just not use the method and my problems would be solved but yeah

tawdry parcel
#

oh i think i misunderstood something too, i thought a library was the same as an api

jagged monolith
#

Yes and No. A library is more of a set of code, like a resource you can use to improve coding. An API is more of an interface that connects code together.

#

Like I have my own private library that just contains lots of methods and stuff to make things easier.

tawdry parcel
#

if I add the depency to my pom.xml file, as explained in the docs of citizens, intellij underlines it and says: Dependency 'net.citizensnpcs:citizens-main:2.0.30-SNAPSHOT' not found. How can I fix that?
pom.xml: https://paste.md-5.net/varuwopove.xml

          <dependency>
            <groupId>net.citizensnpcs</groupId>
            <artifactId>citizens-main</artifactId>
            <version>2.0.30-SNAPSHOT</version>
            <type>jar</type>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
#

Restarting IntelliJ fixed it

buoyant viper
#

yeah intellij caches are something

quaint mantle
#

Switch statement variables

lapis swan
#

If i do something like this:

a +=1
proxy.getScheduler().runAsync(Plugin, () -> { a+1})

//do more stuff with a 

Will a second call of the function change the output of the first call (if the first async stuff is still running)?

Will the do more stuff wait for the async stuff to be finished and therefore probably the hole plugin ?

topaz cape
#

the do more stuff won't wait

tardy delta
#

if a cant be captured it wont compile

#

also {a + 1} isnt even an expression

topaz cape
#

i assume its kinda of pseudo

tardy delta
#

if its a field, it will change again

#

brr now youre ending up with race conditions

#

well actually ig it runs the next tick

#

idk the impl of the bungeecord scheduler

topaz cape
tardy delta
#

so its ran instantly?

topaz cape
#

yes

#

still on a diff thread though

lapis swan
tardy delta
#

sounds like concurrency issues

#

as two threads may possibly change the value of a at the same time

#

as you said "will it change the ouput if the first runnable was still running", it really relies on luck

#

first runnable will probably scheduled earlier too

lapis swan
#

So it's not using a copy of the objects and just get's pointer ?

tardy delta
#

there are no pointers in java

#

and primitives are used by value anyway, not by reference

lapis swan
#

Okay my example was bad...


                    ServerInfo si = proxy.getServerInfo(serverName);
                    proxy.getScheduler().runAsync(JoinMeBungee.instance, () -> {
                        si.ping((result, error) -> {
                            if (result.getPlayers().getMax() <= result.getPlayers().getOnline()) {
                                playerSender.sendMessage(TextComponent.fromLegacyText("ยง8ยป ยงcDieser Server ist voll!"));

                            } else {
                                playerSender.connect(si);
                            }

                        });
                    });

I have this code and now I was worried that si may change.

does the lambda gets si as a reference (pretty much seems to be like a pointer) or a copy.

quiet ice
#

Try to change si.

tardy delta
#

as a reference?

#

im wondering what the question actually is

#

so whatever happens in si in sync, will also be visible in the async stuff

quiet ice
tardy delta
#

std::copy uwu

quiet ice
#

.clone()? Yes, that exists, but it is quite complex. And it is always invoked explicitly

lapis swan
#

So if there isn't something like a copy how do i even get my stuff thread save? If two players use the same command with different values nearly at the same time?

ivory sleet
#

You can compare and swap

vast raven
ivory sleet
#

Atomically

tardy delta
#

hoping the amount of players is correct ๐Ÿฅฒ

vast raven
remote swallow
#

pre 1.18.2 or something?

tardy delta
#

wait cant you ping async and connect sync?

remote swallow
#

theres a better way for that after 1.18 or whichever version

vast raven
remote swallow
#

are you 1.18 or higher

lapis swan
vast raven
remote swallow
#

ah, havent got any idea about that

vast raven
#

I mean there is a .setOwner() method for the SkullMeta

#

so based on my NMS knowledge, I've to paste the json profile prop. on a player, and then do the .setOwner() method

remote swallow
#

i can give you what the player skull stuff looked like on 1.17

#

im guessing it would go backwards

#
                        GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "");
            PropertyMap propertyMap = gameProfile.getProperties();
            propertyMap.put("textures", new Property("textures", texture));

            try {
                Field profileField = ((SkullMeta) meta).getClass().getDeclaredField("profile");
                profileField.setAccessible(true);
                profileField.set(meta, gameProfile);
                profileField.setAccessible(false);
            } catch (NoSuchFieldException | IllegalAccessException ex) {
                ex.printStackTrace();
            }
``` texture is a variable it accepts, url is `http://textures.minecraft.net/texture/`
echo basalt
#

I'd just put the base64 hash thing

#

so yeah, that

#

the textures thing is often just a base-64 encoded json with the textures URL it seems like

#

I finally got the motivation to actually code for once

#

got the idea to remake my image board system

buoyant viper
#

ImageFrame Pog like the plugin?

echo basalt
#

there's a plugin with that name?

#

I'm just like

#

redoing stuff

#

the proper way

buoyant viper
#

images on maps :p

echo basalt
#

oh that plugin

#

yeah no I'm doing something a bit more advanced

#

It's that concept

#

but like

#

you can click on them

#

and do stuff

#

custom shapes

#

placeholders, animations

buoyant viper
#

ill have to switch over when ur done with it...

echo basalt
#

this is more of a private project

#

I'm getting paid good

buoyant viper
#

tell them to change their conditions and make it Shareware

echo basalt
#

I remember there was a premium plugin that even had a web editor

#

for this

echo basalt
#

I basically get paid to do cool shit I come up with

#

so... no

buoyant viper
echo basalt
#

I can share the basics

buoyant viper
echo basalt
#

this should help with color caching and performance

tardy delta
echo basalt
#

This is used for an individual frame

#

And this is the main class

#

anything else you're on your own

buoyant viper
#

inch resting..

lapis swan
echo basalt
tardy delta
#

put a sync call in an async call

#
ServerInfo si = ...
scheduler.async(() -> {
  si.ping().then((result, error) -> {
    scheduler.sync(() -> {
       if (si.getPlayers() < si.getMaxPlayers()) {
          player.connect(si);
        }
    })
  })
})```
livid dove
#

So I'm going through an old code thst takes core protect data, and gets the total amount of blocks broke in total by a player in x time...

The value is called "GesamtAbgebaut" .

This is by no means an important question but for my own sanity can anyone figure out what it stands for ? ๐Ÿ˜…

eternal oxide
#

Gesamt Abgebaut is german

tardy delta
#

google translate

eternal oxide
#

in English its TotalMined

tardy delta
#

lol

remote swallow
#

why dont we ask a german

tardy delta
#

ye if i put a space it translates correctly

buoyant viper
#

total dismantled

livid dove
#

Ahhhhh

cobalt thorn
#

Hi, i want to make an ATM and save inside the last transaction inside the block, how can i do it?

livid dove
#

Why didn't I think of that haha

remote swallow
#

@tender shard

tardy delta
remote swallow
#

is the block a chest

cobalt thorn
remote swallow
#

you would have to store it in the chunks pdc or uses alex's custom block pdc lib

buoyant viper
#

true i was thinking alexs pdcs

tardy delta
#

doesnt alex' lib also stores it in the chunk pdc?

remote swallow
#

this one does

tardy delta
#

or even world pdc

buoyant viper
#

probably

worn tundra
#

But last transaction sounds like something temporary

#

You could as well just store the data in memory

buoyant viper
worn tundra
#

???

#

That's not what was asked

#

If you're looking to make a larger history then it won't be efficient to store that in pdc

tender shard
buoyant viper
#

i look at like 3 words and make a reply based off of that

worn tundra
#

chat gpt karma farmer auto reply ahh bot type beat

buoyant viper
#

beep boop

velvet chasm
#

Is it possible to use a worldguard region in my plugin? Like have my plugin use a region created in worldguard.

tardy delta
#

love it how something so simple has so many assertions

worn tundra
#

Use the Worldguard api

tardy delta
#

๐ŸŒ

buoyant viper
#

the loop: part

tardy delta
#

otherwise it breaks out of the switch

buoyant viper
#

oh

#

forgot they use the same keywords tbh

hazy parrot
#

Just use flag

buoyant viper
#

yeah but then thats 1 more variable... and who likes those

hazy parrot
#

There is break label syntax wtf

#

First time seeing that

buoyant viper
#

yes its the only reason to ever use labels in java since we dont have goto (thank god)

frank kettle
#

is there a way to know if a block was placed by player other than creating a list of blocks placed by players myself?

tardy delta
#

this is also valid

hazy parrot
#

You always learn smth new ig

#

Is it bad practice?

#

Cuz I never saw it

buoyant viper
#

its rare practice OMEGALUL

tardy delta
#

if you need them you use them

formal jolt
#

Hello, i'm trying to make custom items slightly better than netherite but when i try to edit the damage of my sword with AttributeModifier my attack speed is changed too somebody know why ?

velvet chasm
#

How do you make a cuboid?

tardy delta
buoyant viper
#

well typically cubes have 8 points...

velvet chasm
#

cuboid/regoin

buoyant viper
#

get a min location, get a max location, create a bounding box with , boom, region

vale ember
formal jolt
#

Is theire a wiki page when i can see all base attribute value ?

vale ember
tardy delta
#

kinda refactored it

#

went from 1 failed test to 1 failed test ๐ŸŒ

vale ember
#

5 levels of indentation omg

tardy delta
#

blame java for not allowing default -> break loop;

vale ember
#

bwt why not use Character.isDigit?

tardy delta
#

cuz it does some internal bs

vale ember
#

wdym?

formal jolt
tardy delta
#

it acquires a CodePoint instance, searches for its properties in a big ass multiple dimensions array and does some bitwise operations

vale ember
#

add it via ItemMeta#addItemFlags

tardy delta
#

thats exactly why

vale ember
#

yeah but doesn't seem like any of the operations are heavy

#

just a few bitwise operations

tardy delta
#

its about speed my man, a switch can be 90% faster than an if

#

i tested it and case '0', '1', ..., '9' was 90% faster than if (c >= '0' && c <= '9')

vale ember
#

wow learned something new ig

tardy delta
#

depends on what youre checking but whatever

#

when are defaults parameters in C++ style a thing in java ๐Ÿฅบ

#

im tired of writing 5 methods that just call eachother with different arguments

hazy parrot
#

Another qol kotlin added

pseudo hazel
#

then make a better design

tardy delta
#

whats a qol

hazy parrot
#

Quality of life

tardy delta
#

kotlin cursed

#

im not going on that path

buoyant viper
vale ember
#

why do some much ppl hate kotlin here?

buoyant viper
#

C# really is a better java in so many cases but it lacks so much from Java too

tardy delta
#

cuz its cursed

buoyant viper
#

like idk a decent fucking excuse of an enum

tardy delta
#

๐Ÿ’€

buoyant viper
#

C# enums r such a joke theyre just glorified primitives

vale ember
tardy delta
#

and its also a fuunny language ๐Ÿ’€

buoyant viper
#

at least in Java theyre glorified Objects

tardy delta
#

rust enums best

vale ember
tardy delta
#

mans using std

vale ember
#

using namespace std; ๐Ÿคฎ

tardy delta
#

something i agree on

buoyant viper
buoyant viper
hazy parrot
buoyant viper
frank kettle
#

does anyone know if there's anything alike https://api.spigotmc.org/legacy/update.php?resource=id but for github releases? Spigot takes several hours to update its version which is kinda annoying if you have latest version it tells u there's a newest version for a older one because it's not updated yet....

tardy delta
#

what are gh releases tho?

hazy parrot
hazy parrot
tardy delta
#

ye but whats the point of it? giving the end user downloads?

frank kettle
hazy parrot
frank kettle
#

yeah i have the tag as the version.

tardy delta
#

hmm i should do that

#

should make my parser a cli tool too

frank kettle
#

but github will return instantly your latest version released, unlike spigot which has like 6+ hours of delay

tardy delta
#

hmm

hazy parrot
#

also its cool cuz you can make it pretty much automatic with gh workflow

frank kettle
#

also im starting to use more github so trying out this new small things is cool. specially if they improve something else.

warm light
#

What's wrong here? look like generateIsland is not working?

frank kettle
#

๐Ÿค”

hazy parrot
#

well, that is awesome , first steam account i saw that is this old

frank kettle
#

i wish i had my older discord account, it was also one of the oldest ๐Ÿคง

warm light
#

;-;

frank kettle
#

why bump something right in front of us still

#

people will help when those who know open channel.

warm light
#

okay ;-;

onyx fjord
#

how do i get item defautl display name?
itemMeta#getDisplayName returns empty string
and item#getType#name returns something like POTATO instead of the name player should see

vale ember
#

you can get the corresponding language file onhttps://assets.mcasset.cloud/1.19.2/assets/minecraft/lang/[locale].json, where [locale] is player#getLocale

frank kettle
#

client side, but I saw somewhere you can use nms to get it.

#

not sure if this still works, but maybe start there if you haven't

#

quite old thread

chrome beacon
#

The downside is that you cannot specify a specific language with them so it will always use the client language

onyx fjord
#

i see what if i just want it from one specific lang

vale ember
#

you can probably embed it inside of your plugin's resources, tho im not sure if that's legal

#

i just query it at runtime

warm light
vale ember
#

are there any errors?

tardy delta
#

cant you replace random.nextFloat() < 0.5 with random.nextBoolean()?

warm light
#

generateIsland method should add some blocks. but its not doing it

warm light
vale ember
#

why are you using deprecated createChunkData tho?

buoyant viper
#

have u considered that maybe every time youve ran the method, nextBound(101) was < 50

#

by sheer (un)luck

warm light
#

I loaded about 50+ chunk ._.

vale ember
#

try removing the if and check again

onyx fjord
#

i guess i could make it work for per players lang with packets

#

but not worth it for what im doing

vale ember
#

you don't need packets

tardy delta
#

^^

warm light
formal jolt
#

Hello i'm trying to do item with custom durability i try to use some DataContainer everything work fine i just dont uderstand why my item lore dont get updated:

vale ember
livid dove
#

If I have a Material object, how do I get the material name?

vale ember
#

.name()

#

it works on any enum

tardy delta
#

thats the enum consta,t name

vale ember
#

if you wanna the name as it is displayed in game ,than that's client dependant

livid dove
#

For context I've got all the data for every block broke (I.e. it's Material) and wanna be able to print the names of the materials

#

And say like X Block broken this many times

vale ember
#

yeah use TranslatableComponents

livid dove
#

?

vale ember
#

im not sure but i guess something like this should work

player.spigot().sendMessage(new TranslatableComponent("block.minecraft." + material.toLowerCase()));
paper falcon
#

what's this thing that when you hover over the black glass pane nothing happens, no item is being shown as if it is one

#

this is hypixel's sb menu

#

the normal one would be like this

tardy delta
#

packets?

#

/packets not being sent

echo basalt
#

nothing to do with packets

#

they probably just have an empty name / lore

#

it makes a very tiny box

tardy delta
#

i thought it was a (bigger than tiny) black box

echo basalt
#

whatever

marble granite
#

I'm having trouble with my config.yml. it says "top level is not a map", even though my config file is valid yaml (i put it into a yaml checker).

Here's my config:

npcs: 200

npcNames: 
  - "ghost_rider1"
  - "LithiumKid"
  - "nvdes1ara"
  - "Warmin22"
  - "sw0ii"
 

spawnCommandsnpc:  # need a slash '/'
  - "/msg IKEWW HELLOOOOOOOOOO"
 

spawnCommandsconsole:  # need no slash '/'
  - "msg %npc% hello, bot :)"
tardy delta
#

whats that supposed to mean

marble granite
#
org.bukkit.configuration.InvalidConfigurationException: Top level is not a Map.
        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:107) ~[pufferfish-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:160) ~[pufferfish-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:334) ~[pufferfish-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:165) ~[pufferfish-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:134) ~[pufferfish-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at cc.ikew.acf.BukkitCommandManager.<init>(BukkitCommandManager.java:136) ~[extendableSpoofer-1.0-SNAPSHOT.jar:?]
        at cc.ikew.extendablespoofer.ExtendableSpoofer.onEnable(ExtendableSpoofer.java:51) ~[extendableSpoofer-1.0-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[pufferfish-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[pufferfish-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[pufferfish-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:565) ~[pufferfish-1.19.2.jar:git-Pufferfish-39]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:479) ~[pufferfish-1.19.2.jar:git-Pufferfish-39]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:638) ~[pufferfish-1.19.2.jar:git-Pufferfish-39]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:424) ~[pufferfish-1.19.2.jar:git-Pufferfish-39]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[pufferfish-1.19.2.jar:git-Pufferfish-39]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1102) ~[pufferfish-1.19.2.jar:git-Pufferfish-39]
        at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:307) ~[pufferfish-1.19.2.jar:git-Pufferfish-39]
dull ridge
#

i've made a few commands using Command executor and registered them from plugin.yml etc. the commands work as intended but everytime i try to type new argument player names show up for autocomplete how can i disable that

#

do i add that to command executor?

#

ok thx

paper falcon
formal jolt
#

Does somebody know why the exact same custom item, is fine when i create it with a CraftingTable recipe but dont seem to get custom attribute, name and lore when i use a smithing recipe ?

Is that because it get data from de base objet ?

Can i change that ?

dull ridge
#

can i remove auto listed bukkit and mc commands like /about /ver /trigger

quaint mantle
#

How to protect a specific area

chrome beacon
chrome beacon
quaint mantle
#

No I want to write a plugin

chrome beacon
#

Then listen to an event check if it happens in an area (using an aabb) and cancel it if it is

dull ridge
#

is there a good source to look up for permissions and how they work, what can be achieved with them etc.

quaint mantle
chrome beacon
#

Range?

quaint mantle
#

yes

chrome beacon
#

What range

quaint mantle
#

For example, I want to protect the spawn

chrome beacon
#

You save the corners

#

And then check if the coords is between them

#

Otherwise it's just 3 if statements

eternal oxide
#

Create a BoundingBox for the area then call .contains

chrome beacon
#

^^ that works too

#

and if you're on 1.8 this api won't be available

#

so keep that in mind

dull ridge
#

do i have to manually give permissions once a player joins or does the permissions in plugin.yml automatically given how do they work?

#

i dont understand permissions

buoyant viper
#

u use a permissions plugin like LuckPerms or GroupManager

dull ridge
#

for example i would like to disable the autocompletion and usage of /ver /about /trigger for normal players and allow them only for admins

#

do i need groupmanager to do that

eternal oxide
#

Thats what permission plugins do

weak bear
#

Hey guys is it possible to give modded item in my plugin like using ID ?

river oracle
#

ID? Just make your own give command

#

Item ids don't even exist anymore

weak bear
#

Okay I understand but do you think that I can give an item to a player with the id 3921 ?

#

(That's a modded item)

river oracle
#

Wait your using a server software that supports mods and plugins

#

Who the fuck knows those are always shit just make it in the mod

weak bear
#

Okay

river oracle
#

Don't bother with the plugin and mod bs they are fundamentally different

#

If you need essentials equivalent use the FTB plugin

weak bear
#

Okay thx you

tardy delta
#

is there a way to implement Iterable<E> but for primitives so i can use for (char c : myObj)?

daring lark
#
        File file = new File(packageURL.getFile());```
how could i get package as a file? i have sth like this.
error:
```java.lang.NullPointerException: Cannot invoke "java.net.URL.getFile()" because "packageURL" is null
        at me.placek.rdcakelib.RDCakeLib.registerAllListeners(RDCakeLib.java:36) ~[RDCakeLib.jar:?]
        at me.placek.rdcakelib.RDCakeLib.onEnable(RDCakeLib.java:22) ~[RDCakeLib.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:565) ~[paper-1.19.2.jar:git-Paper-260]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:479) ~[paper-1.19.2.jar:git-Paper-260]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.reload(CraftServer.java:1025) ~[paper-1.19.2.jar:git-Paper-260]
        at org.bukkit.Bukkit.reload(Bukkit.java:930) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:54) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]```
tardy delta
#

new File(getClass().getPackage().getClass().getProtectionDomain().getCodeSource().getLocation().getFile())?

quaint mantle
tardy delta
#

ye that sucks

#

and implementing a custom iterator wouldnt work either

daring lark
tardy delta
#

just check stackoverflow

daring lark
#

i did

#

nothing works

daring lark
# tardy delta `new File(getClass().getPackage().getClass().getProtectionDomain().getCodeSource...
        at me.placek.rdcakelib.RDCakeLib.registerAllListeners(RDCakeLib.java:35) ~[RDCakeLib.jar:?]
        at me.placek.rdcakelib.RDCakeLib.onEnable(RDCakeLib.java:22) ~[RDCakeLib.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:565) ~[paper-1.19.2.jar:git-Paper-260]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:479) ~[paper-1.19.2.jar:git-Paper-260]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.reload(CraftServer.java:1025) ~[paper-1.19.2.jar:git-Paper-260]```
tardy delta
#

uhh idk

hardy wren
#

Hi, does someone have a library to create menus ?

hybrid spoke
undone axleBOT
hardy wren
#

thx god, i'm asking dev, not search motor

tardy delta
#

bing ๐Ÿ’€

dusk flicker
#

?yahoo

undone axleBOT
tardy delta
#

bruh

#

?edge

#

?firefox

#

bunch of idiots

dusk flicker
#

those are browsers my dude

#

not search engines

hybrid spoke
tardy delta
#

?duckduckgo

hybrid spoke
#

still waiting for ?ecosia

hardy wren
tardy delta
#

google it

dusk flicker
#

as another dev, advising to use the search engine

hardy wren
#

maybe am i colleceting 5+ advices to get the better one

hybrid spoke
#

do we have that many search engines?

#

?bing

undone axleBOT
hybrid spoke
#

?google

undone axleBOT
hybrid spoke
#

?yahoo

undone axleBOT
hardy wren
#

maybe not

tender shard
hardy wren
#

thx

tender shard
#

SpiGUI, GUI Utilitiy, Inventory Framework, Tubing Framework, MilkGUI, ... ...

#

I personally don't use any of those

tardy delta
#

i use my own stuff

hardy wren
#

what are u using so ?

tender shard
#

I wrote my own stuff but it's not public

#

at least not right now

hardy wren
#

ok

river oracle
#

I use my own its Open Source, but its not very complex

wicked remnant
tender shard
#

well at least in 99.999% of cases

tender shard
#

oh yikes, ProtocolLib

hybrid spoke
#

kind of

wicked remnant
#

its not ProtocolLib

hybrid spoke
#

just proxy sided

wicked remnant
#

but protocol manipulation yes

tender shard
#

I doubt that ANY gui library has support for that

wicked remnant
#

you can send inventories to the client without having to mess with raw protocol but its kind of limited in terms of functionality

i have a plugin for bedrock form (geyser)/inventory menu support and the main thing that is stopping me from dropping inventory menu support is not knowing if there is notable and well maintained inventory system for proxies

#

so i just keep on with it

#

the main thing that sucks is that there is no established placeholder system for proxies or im unaware of it

river oracle
#

@wet breach Since you suggested storing some data in NBT last night I'll ask you. I should store all the block data in one NBT file correct? Also how should it be formatted? Do I just start with the compound tag than do Map<String, Tag> for all my blocks String being location, Tag being the blocks data. Seems most logical to me just gotta make sure I don't fuck this storage up xD

pseudo hazel
#

why are we not using pdc for this exactly?

#

persistentdatacontainer

river oracle
#

I mean I could, but as frostalf was explaining last night pdc doesn't exactly clean itself up nicely. Also blocks don't have PDC

remote swallow
#

custom block data by alex

pseudo hazel
#

I see

river oracle
#

I use that :)

#

I just also want to try out NBT as it seems like a pretty good storage format and its not messy

remote swallow
#

use it harder

#

nbt is jank

river oracle
#

not really JNBT is quite a nice api

remote swallow
#

nbt is confusing lol

wet breach
#

its really not all that confusing

river oracle
wet breach
#

yep

river oracle
#

okay ๐Ÿ‘๐Ÿฝ

wet breach
#

and then you can separate NBT stuff with end tags

river oracle
#

wdym by end tags

wet breach
#

end tags are an indicator that you have reached well the end of the data

#

since this NBT file is your own

#

you could place 2 end tags together to mark that its the end/beginning of another NBT section

#

you are not restricted or must follow how MC stores NBT data ๐Ÿ™‚

river oracle
#

I was just thinking of using 1 NBT compound. than each key (string) would be a location and each tag would just be the data within that location

#

do you think that is a fair technique?

wet breach
#

Yeah that should work

river oracle
#

?paste

undone axleBOT
river oracle
wet breach
#

looks fine

tender shard
remote swallow
river oracle
# wet breach looks fine

damn thats fairly time efficent saved 1 million blocks in 3 seconds. And Its very unlikely numbers get even close to that big as well

wet breach
#

or to denote you reached the end of the file

#
in the TAG_Compound is over, and indeed all of the NBT file.```
wet breach
#

although when I stated about the 10 millions blocks from helping that one developer, we came up with a custom binary storage where they used a character of their choosing to denote separations. And they just straight saved the bytes of the data

#

this was needed because they wanted redundancy

#

well not redundancy

#

they wanted error correction

#

which at some point you are going to want to have if this is a public plugin

river oracle
#

this plugin is for a server that I doubt will ever have a large scale of players

wet breach
#

Reason being when servers crash they don't get to save data or are in the middle of doing so, and you don't want your users being stuck with a corrupted file lmao

#

only being corrupt because its missing data or only has partial data

wet breach
#

given what you are doing

#

and the file size should be relatively small too

#

like no more then 10mb depending how much information it is storing

remote swallow
#

just save a sqlite db to every chunk you need data in

#

totally not laggy

river oracle
wet breach
#

and that is super easy to load into memory ๐Ÿ™‚

#

only other caveat of memory mapping files is making sure you have the memory to do so ๐Ÿ˜›

#

so at 2.4mb that is no problem lol

fluid cypress
#

How can i spawn a falling block with no gravity?

#

and how do i specify the block type that i want

wet breach
#

just remove the compression you are doing

#

caveat is it will be a slightly larger file but not that much more lol

tender shard
river oracle
wet breach
#

nice

tardy delta
#

why would you

#

and yes, have fun

tender shard
remote swallow
#

yo alex

tardy delta
#

uh idk how bungeecord works, doesnt that file yml files support?

#

wondering the same thing

wet breach
#

serialize it and save it

#

IE turn it into base64 save that

#

then you can easily pull the data somewhere else

tardy delta
#

or do like geol and praise binary

wet breach
#

same way you serialized

#

you would use Base64 to decode instead of encode

#

and then you would just re-create your itemstack object from the data

tawdry parcel
#

Hey guys, I want to open an inventory and in the tutorial I watched they used ItemBuilder(), but for some reason, ItemBuilder() is not existing and it's underlined ||Cannot resolve symbol 'ItemBuilder'||. My Code:

Inventory inventory = Bukkit.createInventory(null, 3*5, "Select Map");
inventory.setItem(10, new ItemBuilder(Material.OAK_SAPLING));
tardy delta
#

i hope your itembuilder is not extending itemstack

#

ah you dont have one ๐Ÿ’€

#

thats more a mapping than a filter

tender shard
tardy delta
#

dont collect a stream to stream it again

remote swallow
#

ItemBuilder is probably their item builder class

tardy delta
#

what do you actually want to sort

tender shard
remote swallow
#

well the tuts itembuilder class

tardy delta
#

and a ServiceInfoSnapshot is a server?

#

sort(Comparator.comparingInt(server.getPlayers().size())) or sth

regal scaffold
#

@tender shard Hey! I was just in the middle of a discussion about your CustomBlockData resource! Crazy to see you here

tawdry parcel
#

but how can I set a custom display name, because this is not working: ```java
inventory.setItem(10, new ItemStack(Material.OAK_SAPLING).getItemMeta().setDisplayName("Island"));

#

it says 'setItem(int, org.bukkit.inventory.ItemStack)' in 'org.bukkit.inventory.Inventory' cannot be applied to '(int, void)'

tardy delta
#

you have to set the itemmeta back

#

cuz getItemMeta returns a copy

regal scaffold
#

I was trying to store a object with 3 List<> in a PersistantDataContainer but I wasn;t able to do that so now I'm trying to store a JSON string of the object but I'm still having issues with accessing the data

tawdry parcel
tender shard
regal scaffold
#

Oh my man

#

6 hours searching for resources and never saw that

#

Let me give that a try!

#

Do you think I should continue with my json object approach

tender shard
regal scaffold
#

Or change to entire class

remote swallow
#

spigot help dev is great

tender shard
regal scaffold
#
package me.tomisanhues2.deepstorage.utils;

import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.entity.Item;

import java.io.Serial;
import java.io.Serializable;
import java.util.*;

public class ItemInformation implements Serializable {

    private List<String> itemName;

    private List<Integer> itemAmount;

    private List<UUID> playerUUID;


    public ItemInformation() {
        this.itemName = new ArrayList<>();
        this.itemAmount = new ArrayList<>();
        this.playerUUID = new ArrayList<>();
    }

    public List<String> getName() {
        return itemName;
    }
    public List<Integer> getAmount() {
        return itemAmount;
    }
    public List<UUID> getUUID() {
        return playerUUID;
    }

    public void setItemName(List<String> itemName) {
        this.itemName = itemName;
    }

    public void setItemAmount(List<Integer> itemAmount) {
        this.itemAmount = itemAmount;
    }

    public void setPlayerUUID(List<UUID> playerUUID) {
        this.playerUUID = playerUUID;
    }

}
tender shard
#

gimme a second

regal scaffold
#

I need it to be accessible

#

โค๏ธ

tardy delta
#

::comparingInt i said

regal scaffold
#

Thanks a lot I've been stuck in this for at least 6 hours had to even get some sleep I was stressed out

tender shard
#

or, if you wanna store a list, use DataType.asList(DataType.CONFIGURATION_SERIAZABLE)

regal scaffold
#

I don't need a list of it

#

I need 1 object per block, that's it

tender shard
#

e.g.

pdc.set(myKey, DataType.CONFIGURATION_SERIAZABLE, myObject);
tardy delta
#
.sorted(server -> {
  int onlinePlayers = server.getProperty(ONLINE_PLAYERS).orElse(0);
  return Comparator.comparingInt(() -> onlinePlayers);
});```?
regal scaffold
#

Appreciate the help!

tender shard
#
PersistentDataType<byte[], ItemInformation> itemType = new ConfigurationSerializableDataType<>(ItemInformation.class);
regal scaffold
#

Wait I think what my issue might be then

tardy delta
#

what about Comparator.comparingInt(() -> /*your method*/);

regal scaffold
#

Cause this is very similar to what I've been doing

tender shard
#

afk 5 mins

regal scaffold
#

I'm trying to make a class with a lot of static methods to access and change the data

#

Could that be the problem?

undone spindle
#

does someone have an example how to work with permissions?

tardy delta
#

use Comparator.comparing

#

then ServiceInfoSnapshot::compareTo afaik

#

wait Comparator is weird

regal scaffold
#

@tender shard whenver you get back. In the example you have your class extending SerializableConfiguration but the method you have is using a map<> for the data. I believe I need to implement the serializable method correctly in my class to make it work and I can't figure out how.

Specifically I'm trying to make a create() function like this

 public static void createNewStorage(Player p, Chest chest) {
        //Call location persistence also
        ItemInformation itemInformation = new ItemInformation();
        List<String> itemName = new ArrayList<>();
        List<Integer> itemAmount = new ArrayList<>();
        List<UUID> playerUUID = new ArrayList<>();

        playerUUID.add(p.getUniqueId());

        itemInformation.setItemName(itemName);
        itemInformation.setItemAmount(itemAmount);
        itemInformation.setPlayerUUID(playerUUID);

        chest.getPersistentDataContainer().set(STORAGE, DataType.CONFIGURATION_SERIALIZABLE, itemInformation);

        Location location = chest.getLocation();
        chest.getPersistentDataContainer().set(LOCATION, PersistentDataType.STRING, location.toString());
        chest.update();

    }
tardy delta
#

doesnt comparingInt work with amount of players?

#

show

#

put the players field in the comparingInt body

#

also IntFunction is x -> int not () -> int

tender shard
remote swallow
#

pings alex when he was here 30 seconds ago

tender shard
#

can you send that as text?

regal scaffold
#

Sorry I'm lost now mfn

undone axleBOT
regal scaffold
#

PersistentDataType<byte[], ItemInformation> itemType = new ConfigurationSerializableDataType<>(ItemInformation.class);

remote swallow
#

everyone needing help from alex

terse raven
#

ayo has anyone here ever worked with mongodb / pojo before?
because i am running into this problem and i dont know why:

problem: ```
Caused by: org.bson.codecs.configuration.CodecConfigurationException: Failed to decode 'SavedPlayer'. Decoding 'role' errored with: readStartDocument can only be called when CurrentBSONType is DOCUMENT, not when CurrentBSONType is STRING


db creation:
```java
ConnectionString connectionString = new ConnectionString(uri);
        CodecRegistry codecRegistry = CodecRegistries.fromRegistries(MongoClientSettings.getDefaultCodecRegistry(),
                CodecRegistries.fromProviders(PojoCodecProvider.builder().automatic(true).build()));

        MongoClientSettings clientSettings = MongoClientSettings.builder()
                .applyConnectionString(connectionString)
                .codecRegistry(codecRegistry)
                .build();
        mongoClient = MongoClients.create(clientSettings);
        mongoDatabase = mongoClient.getDatabase("mining_simulator");```

me reading it:
```java
 public SavedPlayer getPlayer(UUID uuid) {
        MongoCollection<SavedPlayer> savedPlayerCollection = mongoDatabase.getCollection("players", SavedPlayer.class);
        return savedPlayerCollection.find(Filters.eq("uuid", uuid.toString())).first();
    }```

the "pojo-class":
```java
public class SavedPlayer {
    private ObjectId _id;
    private UUID uuid;

    @BsonProperty(value = "role")
    private String role;
    private Map<String, Integer> currencies;
    private Map<String, ObjectId> inventories;

    
}```
tender shard
# regal scaffold Sorry I'm lost now mfn
private PersistentDataType<byte[], ItemInformation> dataType = new ConfigurationSerializableDataType(ItemInformation.class);

// then later
pdc.set(myKey, dataType, myItemInformationObject);
tardy delta
#

whats the code

regal scaffold
#

Nowhere does it say anythign about the block

tardy delta
#

sorted takes a Comparator

remote swallow
#

pdc is a PersistentDataContainer

tardy delta
#

not a lambda

remote swallow
#

you get the container from where you would need it

tardy delta
regal scaffold
#

I'm even more confused now lmao. So does that mean the data is not actually stored directly on the block itself but like a global container?

tardy delta
#

then no (snapshot -> return Comparator.comparingInt)

remote swallow
tardy delta
#

only one lambda

regal scaffold
#

That's what I'm using

remote swallow
#

you are probably using more pdc

#

i dont think more pdc includes that directly

regal scaffold
#

Wait so

#

Can I actually store an object using morepdc on a block using blockpdc?

#

lol

tender shard
#

what are you trying to do?

tardy delta
#
sorted(Comparator.comparingInt(server -> server.getPlayers().orElse(0)))```
regal scaffold
#

omg my plugin gonna be full of alex's resources

#

jesus

remote swallow
tardy delta
#

what is sent, does that work?

remote swallow
tardy delta
#

it better not

tender shard
#
    private static class Something {
        int value;

        public int getValue() {
            return value;
        }
    }

// later:
final List<Something> activeServers = services.stream().sorted(Comparator.comparingInt(Something::getValue)).collect(Collectors.toList());
hazy parrot
#

Comparator is funct interface

#

So you can use lambda

#

It just takes two args

tardy delta
#

hes trying to use sorted with a lambda which returns a comparator which is not how it works

tender shard
#

so if you wanna sort a Something list object by their values, just do COmparator.comparingInt(Something::getValue)

tardy delta
#

my logic flawed again

#

1 damn test failing

#

why am i not using && tho

tender shard
#

since always

tardy delta
#

you better be kiddin me

tender shard
#

a char is basically like the ascii value

#

e.g. 'a' is 65 or sth

tardy delta
#

a char is a fancy int with a different size

#

like a boolean is a glorified byte

tender shard
#

'a' + (char) 1 == 'b'

tardy delta
#

i believe there arent even opcodes for booleans and chars

#

๐Ÿ’€

sand raven
#

how would I get a potion effect to last forever, and show "xx.xx" for the duration in the inventory?

#

i already tried Integer.MAX_VALUE and -1, neither worked

rotund ravine
sand raven
rotund ravine
#

Should work

#

Itโ€™s duration

sand raven
#

yea

rotund ravine
#

Did it return true when you added it?

sand raven
rotund ravine
#

How are you adding it to the entity

sand raven
#

ohhh

#
e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 2));
rotund ravine
#

That returns true if it was applied

sand raven
#

i can confirm it's applying

#

it just shows the integer value

#

in the inventory screen

rotund ravine
#

What does it show?

sand raven
#

lemme get a screenshot

#

it's just the 32bit integer limit instead of xx.xx like i want

sand raven
rotund ravine
#

And in survival?

sand raven
kind hatch
#

I'm pretty sure the xx.xx potion effect timer was patched out in 1.19.3

remote swallow
#

^^

rotund ravine
#

Ah well there is the problem then

tender shard
regal scaffold
#

Still working on it

#

Having Caused by: java.lang.ClassNotFoundException: com.jeff_media.morepersistentdatatypes.datatypes.serializable.ConfigurationSerializableDataType

#

After correctly shading

#

But figuring it out

tender shard
#

doesnt look like you correctly shaded it

#

?paste your pom.xml

undone axleBOT
regal scaffold
#

Well that's probably right xd

tender shard
#

how did you compile the jar?

#

you gotta use mvn package

quiet ice
regal scaffold
tender shard
#

that's wrong

#

you gotta use maven

#

otherwise it ignores your pom.xml

regal scaffold
#

That explains

#

a lot

#

like, a lot

#

Probably why my gson didn't work either before then

tender shard
#

๐Ÿ˜„

regal scaffold
#

So prob could've done this 7 hours ago

remote swallow
#

im pretty sure spigot ships gson with it

regal scaffold
#

I love you

#

both

opal juniper
#

it does

tender shard
#

np lol

regal scaffold
#

Oh nvm then I'm just an idiot

#

xd

#

Unsupported class file major version 60

#

So we begin

tender shard
#

upgrade maven-shade-plugin to 3.4.1

#

btw for VaultAPI in your dependencies, set the <scope> to provided

#

like you did for spigot

#

because you do NOT want to shade vault

regal scaffold
#

โค๏ธ changed it

rotund ravine
#

Would be fun

regal scaffold
#

Let me upgrade my maven

tender shard
#

doesnt intellij ship its own maven?

regal scaffold
#

It does

#

But no clue how to update, i'm searching rn

tender shard
#

the included version should be fine

remote swallow
#

are you by change using java 8 to run the server

regal scaffold
#

Well clicking run on package you said gives me error

#

Let me check

tender shard
#

which error?

regal scaffold
remote swallow
#

did you reload maven

tender shard
#

?paste your pom again pls

undone axleBOT
remote swallow
#

this button

rotund ravine
#

Are you running maven with the correct java version?

regal scaffold
#

Yes

#

Multiple times

wet breach
regal scaffold
tender shard
#

erm

tender shard
#

line 33

wet breach
#

change this

tender shard
#

line 15 is irrelevant

remote swallow
#

^^

tender shard
#

change maven-shade-plugin to 3.4.1 and itll work

wet breach
tender shard
#

why would the maven-shade-plugin care about language level 8

regal scaffold
#

Fixed

wet breach
#

intelliJ will use it, Netbeans ignores it as it should

regal scaffold
#

omg

#

This would be impossible

#

without this discord

#

wtf

tender shard
#

the solution is to change maven-shade-plugin to 3.4.1 in line 33

regal scaffold
#

Still same error tho

#

Oh wait

#

I know wh

#

1 sedc

wet breach
#

already told you

remote swallow
#

:kekw:

wet breach
#

remove line 15

regal scaffold
#

Can I automatically export the maven jar to my plugin folder?

#

Changing the maven working directory>

tender shard
#

line 15 doesnt even do anything frostalf

#

it's just a property and it isnt even used anywhere

wet breach
#

but first lets get it working

regal scaffold
#

It exported

#

Correctly

regal scaffold
regal scaffold
#

Addding rn

wet breach
remote swallow
#

my brain isnt braining so im just gonna check, would if ((HEX_PATTERN.matcher(color1).matches() && HEX_PATTERN.matcher(color2).matches()) || (VALID_NAME_VALUE.containsKey(color1) && VALID_NAME_VALUE.containsKey(color2))) check if the arg color 1 and color 2 are either correct hex's or correct valid names

river oracle
#

from my project it should help you

remote swallow
#

im good atm

#

my brain just isnt braining and i cant figure out if thats correct

river oracle
#

what are you tryna to do

wet breach
remote swallow
#

check if a color1 and color2 are either valid hex or a valid colour name

regal scaffold
#

Still not working @tender shard
Caused by: java.lang.ClassNotFoundException: com.jeff_media.morepersistentdatatypes.datatypes.serializable.ConfigurationSerializableDataType

river oracle
#

and relocate

regal scaffold
#

We did that

remote swallow
river oracle
#

how are you compiling

wet breach
#

to check for valid hex you need a regex to check for that its at least 6 characters and within the appropriate ranges of characters

remote swallow
#

yeah

#

got that part

regal scaffold
wet breach
#

then you should be good ๐Ÿ™‚

remote swallow
regal scaffold
#

It's what alex said lol

wet breach
# regal scaffold

selecting package is appropriate, it encompasses everything before it

#

install is handy if you want it to have it in your .m2 directory

#

like you want to use it as a dependency for something else

regal scaffold
#

But still getting error with the class

wet breach
#

deploy is used if you want to do everything but also upload it somewhere

regal scaffold
#

Caused by: java.lang.ClassNotFoundException: com.jeff_media.morepersistentdatatypes.datatypes.serializable.ConfigurationSerializableDataType

wet breach
#

what does your pom look like now?

regal scaffold
#

I'll change your line 15 if you tell me what to change it to

regal scaffold
#

It's outputting correctly but when I load on server that's what it comes

wet breach
#

while it isn't used it shouldn't be there

#

maven compiler needs to be version 3.10.1

regal scaffold
#

Still error

#

Changed maven, reloaded and removed the line

iron palm
#

Do you guys suggest to register a plugin messaging channel for each chat conversation between helper and player for something like a party chat or idk?

tender shard
#

it should be 16 or higher

regal scaffold
#

19

#

Language levle 16

wet breach
#

think it is their pattern that is messing it up

#

in the shade

tender shard
#

it does compile fine, right?

regal scaffold
#

Yes

tender shard
#

can you send the .jar here?

#

or DM it to me if you dont wanna upload it here

regal scaffold
#

wait 1 sec

wet breach
# regal scaffold Yes

change this <pattern>com.jeff_media.morepersistentdatatypes</pattern>
to
<pattern>com.jeff_media</pattern>

remote swallow
#

they would need the morepersistent stuff

wet breach
#

it would include it automatically

#

because its after the pattern

remote swallow
#

if they dont include it but had mutliple com.jeff_media deps it would relocate to 1 location and probably break something

wet breach
#

well they only have 1 dependency

tender shard
#

@regal scaffold you messed up the outputDIrectory

#

you are NOT supposed to change it in the shade plugin

#

but in the .jar plugin. I sent you a blog post earlier

regal scaffold
#

That would explain a lot

regal scaffold
#

Clearly didn't read it correctly

wet breach
#

yep that is the other thing

tender shard
#

remove this

#

and use the maven-jar-plugin to change it

wet breach
#

or compiler

tender shard
#

no

#

not in the compiler plugin

#

otherwise it breaks the shading

#

the maven-jar-plugin is the only proper way to change the output location if one wants to correctly shade stuff

wet breach
#

not exactly true

regal scaffold
#

How would I use the plugin?

tender shard
#

the solution from my blog post will definitely work

wet breach
#

yes it will work

regal scaffold
#

OH I see what I messed up

wet breach
#

Also, finalname

#

is just a tag by itself under the build tag

tender shard
#
<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>16</source>
                    <target>16</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <outputDirectory>C:\MyServer\Plugins</outputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <relocations>
                                <relocation>
                                    <pattern>com.jeff_media.morepersistentdatatypes</pattern>
                                    <shadedPattern>me.tomisanhues2.deepstorage.morepersistentdatatypes</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
#

like this @regal scaffold

remote swallow
#

alex are we gonna handle nicks or do we just leave that to cmi

wet breach
tender shard
regal scaffold
#

When I first was around like 6 years ago cmi didn't exist

#

Is there beef O.o?

remote swallow
#

cmi is so bad

tender shard
#

I'm kinda fucked up by CMI, I opened an issue in 2021 and still didnt get a reply from the dev

regal scaffold
#

lol

remote swallow
#

if i say anymore conclure will bonk me

river oracle
#

#shit-talk-plugins when

regal scaffold
#

Maven also didn't get used in spigot

#

I remember that

wet breach
regal scaffold
#

Sure, anything would help!

tender shard
#
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

then in plugin.yml, do

version: ${project.version}
wet breach
#

that doesn't always work

remote swallow
#

normally does

#

if not recompile

wet breach
#

if it doesn't work for you I will show you how I do it

regal scaffold
#

Moment of truth

tender shard
#

why would that not work? how else would you do it?

wet breach
tender shard
#

google replacer? to filter a simple property?

wet breach
#

Yes because sometimes I have issues with Maven not doing it

tender shard
#

just use mvn clean once, then the {project.version} will always work if filtering is setup

wet breach
#

especially when shading

remote swallow
#

seems very un-necessary

regal scaffold
#

Alright listen

#

We've evolved

regal scaffold
#

to a different error now

tender shard
regal scaffold
wet breach
#

always worked for you doesn't mean that no one else has ever encountered the problem

#

it is the very reason I use replacer plugin

#

otherwise I wouldn't use it

tender shard
wet breach
regal scaffold
#

    public static void createNewStorage(Player p, Chest chest) {
        //Call location persistence also
        ItemInformation itemInformation = new ItemInformation();
        List<String> itemName = new ArrayList<>();
        List<Integer> itemAmount = new ArrayList<>();
        List<UUID> playerUUID = new ArrayList<>();

        playerUUID.add(p.getUniqueId());

        itemInformation.setItemName(itemName);
        itemInformation.setItemAmount(itemAmount);
        itemInformation.setPlayerUUID(playerUUID);

49      chest.getPersistentDataContainer().set(STORAGE, getDataType(), itemInformation);
        chest.update();

    }
#
    private static PersistentDataType<byte[], ItemInformation> dataType = new ConfigurationSerializableDataType(ItemInformation.class);

    public static PersistentDataType<byte[], ItemInformation> getDataType() {
        return dataType;
    }
#

Is what epicebic and I did

remote swallow
#

wrong reply be like

tender shard
#

oh I see

#

what's STORAGE?

regal scaffold
#

I thought the static would screw stuff up

#

public static final NamespacedKey STORAGE = new NamespacedKey((Plugin) Plugin.get(), "infinite.storage");

remote swallow
#

its the Plugin.get

#

probably

#

or the . in the key

wet breach
#

not sure if I would be using statics

regal scaffold
#

Haven't had issues with the namespacedkey at all

remote swallow
#

is your main class called Plugin?

regal scaffold
#

Yes

river oracle
#

also having the ability to recover data is just a not a loss of time at all

tender shard
#

show your ItemInformation class

#

it seems like your serialize() method returns null

regal scaffold
#

You gonna flame me for this one mfn

wet breach
regal scaffold
#

Ok yes so i'm not even gonna send it lol

remote swallow
tender shard
#

you gotta return a Map with all the information

#

example:

regal scaffold
#

I asked about this I think the reply got lost somewhere

remote swallow
#

it cant be worse than what ive wrote before

regal scaffold
#

How do I return a map with 3 List<Objects>

remote swallow
#

Map<String, Object>

#

or List

tender shard
#
class ItemINformation iimplements ConfigurationSeriazable {
  int age;

  public Map<String,Object> serialize() {
    Map<String,Object> map = new HashMap<>();
    map.put("age", age);
    return map;
  }
}
#

basically, everything you want to save has to be in the map that you return

regal scaffold
#

Oh my

#

So the String, Object is just a key system

#

It's not the actual data

#

The example on your page makes it seem like it's the exact data

remote swallow
#

String is the key, Object is the data

wet breach
regal scaffold
#

Here we go again

wet breach
tender shard
#
public class ItemInformation implements ConfigurationSerializable {
    
    private final int age;
    private final String name;

    public ItemInformation(int age, String name) {
        this.age = age;
        this.name = name;
    }

    @Override
    public Map<String, Object> serialize() {
        Map<String,Object> map = new HashMap<>();
        map.put("age", age);
        map.put("name", name);
        return map;
    }
    
    public static ItemInformation deserialize(Map<String, Object> map) {
        return new ItemInformation((int) map.get("age"), (String) map.get("name"));
    }
}

Here's an example for a working ConfigurationSeriazable class @regal scaffold

tender shard
#

you need both the serialize and desertialize method

river oracle
regal scaffold
wet breach
#

IE redundancy

river oracle
#

makes sense and pretty much aligns with everything I learned in the IT class I took about making sure your storage doesn't fail

tender shard
regal scaffold
#

map.get("age")

wet breach
tender shard
#
List<String> someStrings = (List<String>) map.get("someStrings");
wet breach
#

and it shouldn't be the cause that your plugin just fails completely

regal scaffold
#

And then I need a constructor for 3 parameters to create object right?

wet breach
#

if the storage is corrupted it should just make a new one, and then notify the user about it if the plugin isn't capable of repairing the damage

#

or if the user has it set, repair what you can, remove the damaged stuff

tender shard
#

basically your deserialize() method takes a Map, and turns that map into your object again

#

can you show your ItemInformation class again? I'll show how I'd do it

regal scaffold
#

1 sec I wanna figure this one out

#

HOLY CRAP NO MORE CRASHES

#

Ok now I need to test that it's working

#

Lets say I wanna add data to the pdc right?

tender shard
#

yes?

regal scaffold
#

Ok little error

#

But unrelated

#
    public static void createNewStorage(Player p, Chest chest) {
        //Call location persistence also
        ItemInformation itemInformation = new ItemInformation();
        List<String> itemName = new ArrayList<>();
        List<Integer> itemAmount = new ArrayList<>();
        List<UUID> playerUUID = new ArrayList<>();
//This line adds the current player UUID to the list
        playerUUID.add(p.getUniqueId());

        itemInformation.setItemName(itemName);
        itemInformation.setItemAmount(itemAmount);
        itemInformation.setPlayerUUID(playerUUID);

        chest.getPersistentDataContainer().set(STORAGE, getDataType(), itemInformation);
        chest.update();

    }
#

But then ```java
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.contains(Object)" because the return value of "me.tomisanhues2.deepstorage.utils.ItemInformation.getUUID()" is null

tender shard
#

getUUID() returns null

#

show your ItemInformation class pls

remote swallow
#

alex what do we want the chat format of, im guessing rank: nick ยป messag

regal scaffold
#
package me.tomisanhues2.deepstorage.utils;

import org.bukkit.configuration.Configuration;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.entity.Item;

import java.io.Serial;
import java.io.Serializable;
import java.util.*;

public class ItemInformation implements ConfigurationSerializable {

    private List<String> itemName;

    private List<Integer> itemAmount;

    private List<UUID> playerUUID;


    public ItemInformation() {
        this.itemName = new ArrayList<>();
        this.itemAmount = new ArrayList<>();
        this.playerUUID = new ArrayList<>();
    }

    public ItemInformation(List<String> itemName, List<Integer> itemAmount, List<UUID> playerUUID) {
        this.itemName = itemName;
        this.itemAmount = itemAmount;
        this.playerUUID = playerUUID;
    }

    public List<String> getName() {
        return itemName;
    }
    public List<Integer> getAmount() {
        return itemAmount;
    }
    public List<UUID> getUUID() {
        return playerUUID;
    }

    public void setItemName(List<String> itemName) {
        this.itemName = itemName;
    }

    public void setItemAmount(List<Integer> itemAmount) {
        this.itemAmount = itemAmount;
    }

    public void setPlayerUUID(List<UUID> playerUUID) {
        this.playerUUID = playerUUID;
    }


    @Override
    public Map<String,Object> serialize() {
        Map<String,Object> map = new HashMap<>();
        map.put("name", itemName);
        map.put("amount", itemAmount);
        map.put("uuid", playerUUID);
        return map;
    }

    public static ItemInformation deserialize(Map<String, Object> map) {
        List<String> someStrings = (List<String>) map.get("someStrings");
        List<Integer> someInts = (List<Integer>) map.get("someInts");
        List<UUID> someUUIDs = (List<UUID>) map.get("someUUIDs");
        return new ItemInformation(someStrings, someInts, someUUIDs);
    }
}
tender shard
#

do we need ranks? I thought showing the server name is more relevant than any rank

regal scaffold
#

Wait I think I know

regal scaffold
#

If you see it don't tell me just yet

tardy delta
regal scaffold
#

Ok no I don't know

#

I thought it had something to do with

#

My constructors

tender shard
#

btw you cannot serialize UUIDs, you need to turn them into strings. and yeah, your constructor should not allow null values or uninitialized variables

regal scaffold
#

oh are you serious

#

So List<UUID> needs to change to List<String>

wet breach
#

you could serialize the UUID using base64 and then it would be a string

#

but its just easier to store the UUID as a string itself

#

because you can do UUID.getString()

#

or toString()

#

forget which it has

regal scaffold
#

Ok let me change that

remote swallow
wet breach
#

and then you can do UUID.fromString(UUIDstring)

#

and that gets you your UUID object back

tardy delta
#

serializing an uuid to base64 ๐Ÿค”

tender shard
# regal scaffold Ok let me change that
package me.someone.myplugin;

import org.bukkit.configuration.serialization.ConfigurationSerializable;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.stream.Collectors;

public class ItemInformation implements ConfigurationSerializable {

    private List<String> itemName = new ArrayList<>();

    private List<Integer> itemAmount = new ArrayList<>();

    private List<UUID> playerUUID = new ArrayList<>();
    
    public ItemInformation() {
    }

    public ItemInformation(List<String> itemName, List<Integer> itemAmount, List<UUID> playerUUID) {
        this.itemName = Objects.requireNonNull(itemName);
        this.itemAmount = Objects.requireNonNull(itemAmount);
        this.playerUUID = Objects.requireNonNull(playerUUID);
    }

    public List<String> getName() {
        return itemName;
    }
    public List<Integer> getAmount() {
        return itemAmount;
    }
    public List<UUID> getUUID() {
        return playerUUID;
    }

    public void setItemName(List<String> itemName) {
        this.itemName = itemName;
    }

    public void setItemAmount(List<Integer> itemAmount) {
        this.itemAmount = itemAmount;
    }

    public void setPlayerUUID(List<UUID> playerUUID) {
        this.playerUUID = playerUUID;
    }


    @Override
    public Map<String,Object> serialize() {
        Map<String,Object> map = new HashMap<>();
        map.put("name", itemName);
        map.put("amount", itemAmount);
        map.put("uuid", playerUUID.stream().map(UUID::toString).collect(Collectors.toList()));
        return map;
    }

    public static ItemInformation deserialize(Map<String, Object> map) {
        List<String> someStrings = (List<String>) map.get("someStrings");
        List<Integer> someInts = (List<Integer>) map.get("someInts");
        List<UUID> someUUIDs = ((List<String>) map.get("someUUIDs")).stream().map(UUID::fromString).collect(Collectors.toList());
        return new ItemInformation(someStrings, someInts, someUUIDs);
    }
}
#

note, I dont save the UUID as UUID, but map them toString. Then in deserialize, we do the opposite

wet breach
tender shard
#

that's required because UUID doesnt implement ConfigurationSeriazable

regal scaffold
#

ooooooooooooooooooooooooo

#

Ok ok

#

I was doing the other approach

wet breach
#

not that UUID needs to given it has methods to turn it into a String lol

remote swallow
regal scaffold
#

Changing List<UUID> to List<String>

tender shard
#

yeah that would ofc also work

wet breach
regal scaffold
#

Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because the return value of "org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(java.util.Map)" is null

#

Still error

wet breach
#

you have something null

remote swallow
#

oh alex can i get invited to be contrib on bungeecore so i can commit this when i finish

regal scaffold
#
  public static ItemInformation getStorage(Chest chest) {
        return chest.getPersistentDataContainer().get(STORAGE, getDataType());
    }```
remote swallow
#

The-Epic

regal scaffold
#

Maybe the UUID thing you made didn't work

tender shard
#

in onEnable() on the first line, do ConfigurationSerialization.registerClass(ItemInformation.class)

regal scaffold
#

Yeah ok it was commented out from before

#

:/

#

Still null

#

Same error

tender shard
#

do you still have any ItemInformation objects in your config that might still be null?

regal scaffold
#

Yeah very possible

#

How can I delete all?

tender shard
#

reset your config to a fresh one, then try again

#

oh wait, you are using PDC

regal scaffold
#

yeah lol

#

I was worried

#

That asking what you mean would sound terrible

#

lmao

tender shard
#

where did you save the data? in blocks using CustomBlockData?

regal scaffold
#

Chest

#

so no CustomBlockData

#

Delete the map?

remote swallow
#

chests are tile entities iirc

tender shard
#

you could just destroy the chests or use a new world for testing or sth

remote swallow
#

or just place a new chest

regal scaffold
#

Placing a new chest should work but doesn't

#

lmao I've been testing for a bit

tender shard
#

show your PlayerInteractEvent code

regal scaffold
#
    public void actionRight(PlayerInteractEvent e) {
        Chest chest = (Chest)e.getClickedBlock().getState();
        Player p = e.getPlayer();
        e.setCancelled(true);
        ItemInformation info = Keys.getStorage(chest);
        Bukkit.getLogger().info(info.toString());
        if (info.getUUID().contains(e.getPlayer().getUniqueId())){
            p.openInventory((new Utils()).getMainMenu(info.getName(), chest));
        } else {
            p.sendMessage(Aliases.NOT_ALLOWED);
        }
    }
remote swallow
#

?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
}
tender shard
#

what does Keys.getStorage do? It looks like you simply don't have any data at that block

regal scaffold
#
    public void chestInteract(PlayerInteractEvent e) {
        if (!verify(e))
            return;
        if (e.getAction() == Action.RIGHT_CLICK_BLOCK)
            actionRight(e);
    }```
remote swallow
#

also your utils probably shouldnt need to be initalized

regal scaffold
#
    public static ItemInformation getStorage(Chest chest) {
        return chest.getPersistentDataContainer().get(STORAGE, getDataType());
    }
elfin atlas
#

How I'm able to edit or remove stuff with the the bukkit FileConfiguration? And does I'm able to for each the whole File?

tender shard