#help-development

1 messages · Page 1022 of 1

dry forum
#

wdym

inner mulch
#

wdym

wet breach
#

you can add a passenger to a passenger

dry forum
#

then if the textdisplay has multiple lines of text they will overlap no?

eternal oxide
#

you have translation

inner mulch
#

these are the 3 options

dry forum
#

i already made everything i just need to make it follow the player so id like to do smthn with the code above to get it to move smoothly

inner mulch
#

okay but you cant

eternal oxide
#

transformations are best as you can smoothly scroll them up

inner mulch
#

passenger or it will not be smooth

dry forum
#

uhhh ok thanks

inner mulch
#

tbh easiest one is creating a display for each line

#

stack em

#

and done

dry forum
#

i already made everything and i cant rly redo everything + other plugins i have use passengers so i cant rly do that

#

im gonna have to find some other way

inner mulch
#

alr

young knoll
#

Or just do one display and manually add in newlines

inner mulch
#

good luck, but i have tried too, and i couldnt find anything for keeping stuff sync

eternal oxide
#

There is no other way for smooth

inner mulch
dry forum
#

i was gonna move the textdisplays over x amount of ticks

#

and see if that made it look any better

inner mulch
#

only way probably is predicting player movement

#

but that might not be smooth either

young knoll
inner mulch
eternal oxide
#

lag and client predictions will make it not smooth

young knoll
#

What

#

Why would the text on a single display overlap

golden turret
#

I have this project and this code to publish to github and locally. The core module includes all modules (except versions and bungee). I want that none of the versions submodules (except adapter) be included in the pom that gets published. How can i do that?

inner mulch
golden turret
young knoll
inner mulch
#

oh thats true

#

@dry forum

dry forum
#

huh

inner mulch
#

just add one on top of the player

#

and add each line by editing the text

#

coll had a big brain solution

dry forum
#

well im doing chat bubbles so that would look weird having just 1 bubble

inner mulch
#

you can add a synthetical gap

#

by creating a new line in between

dry forum
#

but its still all 1 display

#

so it would look weird

young knoll
#

Yeah passengers is the ideal solution

inner mulch
#

i guess, tbh coll solution is best

#

i wouldnt care too much

young knoll
#

Especially if the player themselves don’t need to see it

dry forum
#

i would do passengers but the text would overlap + ik some1 said smthn about translation to fix that? but i have no idea how that works

young knoll
#

It’s just an offset to the render position

eternal oxide
#

every time you add another passenger you perfomr a translation and all teh bubbles scroll up

dry forum
#

ohhhh

worthy yarrow
#

https://paste.md-5.net/gukaterene.cpp

[15:45:40] [Server thread/INFO]: CONSOLE issued server command: /eco give winwx 1000000
[15:45:40] [Server thread/INFO]: $1,000,000 added to winwx account. New balance: $1,304,421.24
[15:45:43] [Server thread/INFO]: 1304421.24230656
[15:45:43] [Server thread/INFO]: 1304421.24230656```

So the issue is that for some reason the value mapped in playerBalance is always the same as currentBalance in the handleConversion method, the point of doing this is because the rate is handled based on player balances and I want to prevent them from exploiting that given their balance changes during the interaction of the conversion menu
#

Perhaps I am cooked and just missing the simplest thing, but I have tried several ways and it still ends up being the same

agile hollow
#

in javascript i can make a "player" join in 1.20.6 server for stay afk?

harsh ruin
#

I've got a quick question, how do I cancel the scheduler after it's reached the limit?

sc.scheduleSyncRepeatingTask(Relula_AutoGrow.getPlugin(), () -> {
            if (ageable.getAge() == ageable.getMaximumAge()) {
              e.getPlayer().sendMessage("cancelled.. " + ageable.getAge());;
            } else {
              ageable.setAge(ageable.getAge()+1); //  ^^ Is reading "7", is it reading too early?
              e.getBlock().setBlockData(ageable);
            }
          }, 10L,10L);```
brittle geyser
#

how to get com.mojang.authlib.GameProfile variable, im using gradle

eternal oxide
#

run buildtools, then depend on spigot not spigot-api to have access to authlib

brittle geyser
#

do i need to put spigot into my plugin?

eternal oxide
#

no

brittle geyser
#

or just compileOnly

#

Naaah, i dont want to write 1000 code for all versions from 1.8 to 1.20.3

#

I want to get OfflinePlayers inventory, i found a code that do this

dry forum
#

do textdisplays not move when being added as a passenger to one another?

young knoll
#

They do if the bottom one moves

eternal oxide
#

you translate each one

young knoll
#

But the bottom one will never move on its own

eternal oxide
#

I think he means move up to stack

dry forum
#

i mean like, i think i have 3 text displays, passengered on top of one another, and they are all overlapping, i assumed they would work like armorstands or no?

eternal oxide
#

no

eternal oxide
#

translate each one by whatver offset it needs

dry forum
#

oh ok that makes it very easy then thanks

dry forum
#

is there anyway to like spawn a textdisplay and add as a passenger at the same time cuz i can see the textdisplay before its added as a passenger for a second and it looks kinda weird

young knoll
#

Use the spawn method with a consumer

dry forum
#

forgot that existed ty

#
        TextDisplay display = playerLocation.getWorld().spawn(playerLocation, TextDisplay.class, entity -> {
            entity.setText(combined);
            entity.setInterpolationDelay(-1);
            entity.setBillboard(billboardType);
            entity.setSeeThrough(true);
            player.addPassenger(entity);

            Transformation transformation = new Transformation(
                    new Vector3f(0, (float) 0.75, 0),
                    entity.getTransformation().getLeftRotation(),
                    entity.getTransformation().getScale(),
                    entity.getTransformation().getRightRotation()
            );
            entity.setTransformation(transformation);
        });```

it still appears in my player for a second then teleports to where it should be, is there anyway to fix that?
worthy yarrow
#

Perhaps a bit of an offset at the spawn location? I don't think you can 100% prevent that

#

Thinking about it, that will mess with your transformation so you'd have to account for that as well

young knoll
#

Not once it’s added as a passenger

worthy yarrow
#

Ah ok

dry forum
#

that worked thanks

noble lantern
#

Question: How would I throw code back to the main thread once I'm in a Executor thread? I know I can just use the Bukkit schedulers method runTask and it will run on the main thread, but I'm mainly trying to figure out how to accomplish this on my own for a lib I'm doing for some plugins, tried googling this but there is assload's of conflicting statements about it

https://hastebin.com/share/coxemoseji.less

#

I tried using synchronized on an Object from the main class but, it appears it still called on the thread pool thread

eternal night
#

you don't without the scheduler

noble lantern
#

sadge I use that then

tardy delta
#

also that putIfAbsent seems dangerous

#

and wheres handleInteraction?

agile plover
#

Bump 🙏🙏

worthy yarrow
#

Ie: I need a way to derive the balance?

worthy yarrow
tardy delta
#

i would assume economy.getBalance returns the current one??

worthy yarrow
#

Yes but I need the balance to stay as is in the event their balance changes during the conversion

#

?paste

undone axleBOT
worthy yarrow
tardy delta
#

so you then save the new balance or smth?

worthy yarrow
#

The old one as it were

#

The point is to make sure their rate doesn't change given their balance does whilst trying to convert money -> apples

tardy delta
#

so these two lines always do the same

    double cachedBalance = this.playerBalance.get(player.getUniqueId());
    double currentBalance = economy.getBalance(player);
#

after the player was put in the map

worthy yarrow
#

That's what I was thinking so I'm not sure how to figure this

#

It should be an old balance compared to a new one in the event it actually changes

tardy delta
#

i mean youre updating the balance (economy.withdraw) and then removing it from mthe map

worthy yarrow
#

That's post conversion

tardy delta
#

then repopulating in the event with two values that are the same

worthy yarrow
#

Right

tardy delta
#

im confused but thats just me

worthy yarrow
#

I am too

tardy delta
#

shouldnt you be putting their balance in the map, the moment the inv opens?

worthy yarrow
#

Yeah that'd be smarter

tardy delta
#

then check when they click smth, compare it with their current balance (ask economy)

worthy yarrow
#

I still feel like it's going to return the same amount

#

Whether I cache on open or click

#

The map is never modified outside of the click method so

#

Except to remove the player

tardy delta
#

so the point was to avoid having a balance change between opening the inv and clicking on an item?

worthy yarrow
#

Rather when they click the buy button (case 22)

tardy delta
#

well ye same thing

worthy yarrow
#
private double calculatePlayerRate(Player player){
        Economy economy = NormalConversions.getEconomy();
        double playerBalance = economy.getBalance(player);
        double rate = playerBalance * this.baseRate;
        return Math.max(rate, this.rateThreshold);
    }```
#

The rates are decided as a percentage of the players balance

#

Which would change each time they want to convert apples

#

Meaning it introduces the fact they can figure a way to lesser their balance / rate in the middle of a conversion which is what I am trying to prevent

tardy delta
#

so ye just put their current balance in the map the moment they open the inv ig

worthy yarrow
#

?tas i suppose

undone axleBOT
tardy delta
#

anyways im going to bed

worthy yarrow
#

Also regarding putIfAbsent, rather I compute if absent?

tardy delta
#

dunno what happens with removing

river oracle
#

@worthy yarrow the first of CabernetMC's tooling is now on github

tardy delta
#

or when removing happens

#

i would just overwrite either way

worthy yarrow
#

Ok

worthy yarrow
river oracle
#

YES vineyard-core is now finished

#

unless I need to make tweaks to the core tooling

#

I probably need to add more customizability but that's ez

worthy yarrow
#

I guess my question was, are you actually going to commit to CabernetMC?

river oracle
#

yes I've commited lol well I've been clear from the beginning this is a hobby project I actually wanted to work on

#

maybe I haven't been clear

#

but yes its a hobby project I'm very interested in

worthy yarrow
#

You've told me several times it was a joke kek

river oracle
#

well generally yes

worthy yarrow
#

But it's getting more serious now eh?

river oracle
#

its not like it'll ever be a viable replacement for bukkit or anything

#

its just a fun hobby project

worthy yarrow
#

Maybe it will o_O

#

Bukkit is pretty meh

river oracle
#

yes, but
A. large ecosystem
B. Many developers and single time contributors, and continuous contributors, including myself

worthy yarrow
#

I mean, if it's good enough...

river oracle
#

its not about viability, moreso learning

young knoll
#

Put the effort for cabernet into Bukkit

worthy yarrow
#

Ah fairs

young knoll
#

Smh

river oracle
young knoll
#

Kek

#

Fair

worthy yarrow
remote swallow
#

miles stop typing here and get back to work

river oracle
#

fine

young knoll
#

What is epic forcing you to do now

remote swallow
#

cabernet

river oracle
young knoll
#

He’s too young for me to pay him

remote swallow
ivory sleet
#

Is Libby what people use to download runtime dependencies?

#

or some fork of it?

river oracle
#

its Libby, but can't you just make your own pretty easily?

#

ig it could be tricky without a bootstrap

remote swallow
#

libby fork

ivory sleet
#

Yea well I probably do have to end up writing my own

remote swallow
#

use my fork to save it in /libraries

young knoll
#

Smh just use the libraries feature

ivory sleet
#

Just tryina extract every inch of abstraction cuz me lazy :,)

ivory sleet
young knoll
#

Ah

#

Shade it

#

Thicc jar

ivory sleet
#

😭

#

Yea so my plan was to distribute thin and thicc jar

#

one w all the deps as an uber jar, and one where it downloads em at runtime

ivory sleet
#

i dont mind it being kotlin

remote swallow
#

wai

#

wrong link

young knoll
#

But can you fork Libby so it downloads itself at runtime too

remote swallow
young knoll
#

Big brain

remote swallow
ivory sleet
#

Hmm alright, Ill have a look

#

Ty

ivory sleet
#

yea consider it considered

young knoll
#

Be careful his oracle vps doesn’t die

ivory sleet
remote swallow
#

it wont

#

its always free

young knoll
#

It’s died at least once

#

Smh

remote swallow
#

that was like a year ago

river oracle
#

coll clearly does not easily forgive

young knoll
#

Nor do I forget

remote swallow
#

what did you have for dinner yesterday

young knoll
#

Veggie wraps

remote swallow
#

what about last monday

young knoll
#

Uhh

#

Pass

remote swallow
#

boom you forgot

young knoll
#

Shh

ivory sleet
#

Meant to say pastaaaa

harsh ruin
#

I have this code which regrows either wheat or carrots, but why is carrots not triggering?(when broken)

worldly ingot
#

I have a feeling your if statements aren't quite in the order you want them to be. Or at least is obstructing some logic you want run

#

If you're trying to replant carrots while you're holding a wooden hoe, it won't ever happen because your follow up condition checking for carrots is an else if

#

A note by the way - your block type will never be CARROT. That's an item. CARROTS is the block. You don't need to check both

harsh ruin
#

I found it out, thanks

dry forum
#

whats the best value to have interpolation at for a text display?

young knoll
#

Depends how often you are moving it

#

And how far

dry forum
#

it moves with the player

#

im just kinda confused on what the method does

eternal oxide
#

interpolation is how many ticks it takes to move from it's current position to the final transformation

analog lantern
#

how do i summon a lime dust ploom with 0 speed

#

i know theres a

double extra;
``` parameter
#

but its very confusing

analog lantern
young knoll
#

Usually it’s the extra parameter

#

But not all particles support speed

olive lance
#

henlo

#

who dislikes 1.8

river oracle
#

joe

#

he really hates 1.8 with a passion

river oracle
#

Does anyone know the opcode for default methods in interfaces? Is it INVOKEVIRTUAL or is it still invoked via INVOKEINTERFACE

#

I'm like 95% certain its the latter of the two, but I want to be sure

#

@worldly ingot whats Martin's discord name again

worldly ingot
#

derfrzocker

slender elbow
#

it's always been invokeinterface

river oracle
#

I just decompiled a class and looked at the bytecode

slender elbow
#

javap ftw

river oracle
#

I just used intellij

#

no javap usage for me :P maybe intellij did but I didn't

#

@lone jacinth So, I'm looking at commodore. I'm needing to change the InventoryView abstract class to an interface. I did this before by just checking the owner classpath and then changing the opcode

if (opcode == Opcodes.INVOKEVIRTUAL) {
  opcode = Opcodes.INVOKEINTERFACE;
}

However, commodore has changed quite a bit, I'm not quite sure where I'd need to place this. I've noticed their is a visitField and handleMethod methods in Commodore now. I figured I'd try to give it a crack by looking at the ASM you wrote for your other Abstract -> Interface PR, but commodore has changed a lot.
My main question is do I need to handle this for both the handleMethod and the visitFieldInsn override or can I get away with just putting it into handleMethod.

One other question I had was regarding itf boolean in handleMethod what exactly does it mean. I noticed you set it to true for the rewrite from INVOKESTATIC to INVOKEINTERFACE. What does setting it to true do exactly?

Based on your usage of itf in your PR I just ended up throwing itf=true at the bottom of my code in handleMethod

for (final String classPath : ABSTRACTS_TO_INTERFACE) {
  if(!owner.equals(classPath)) {
    continue;
  }
  if (opcode == Opcodes.INVOKEVIRTUAL) {
    opcode = Opcodes.INVOKEINTERFACE;
  }
  itf = true;
  break;
}```
young knoll
#

Being able to view bytecode in eclipse directly is pretty pog

river oracle
#

bytecode always looks so fun

young knoll
#

Pfft easily readable

#

Do u even programming

river oracle
#

yeah I've done a bit of assembly before

#

sept I'm not familiar with all of the JVM bytecode

slender elbow
#

stack machine go brrrrrr

wet breach
carmine mica
#

that's backwards

#

getContents should return everything. idk about 1.8 which is about 20 years out of date

#

it returns everything for players, getStorageContents only returns main inventory

wet breach
#

Just checked it and thought that too

carmine mica
#

what? the docs say the opposite

#

getStorageContents says that it excludes armor

#

getContents says all

#

the implementations back that up

wet breach
#

Getstorage doesnt say it excludes

carmine mica
wet breach
#

It may

#

Not that it does

carmine mica
#

it does

#

it literally excludes

#

and getContents doesn't

wet breach
#

Then it should be updated to not be ambiguious

carmine mica
#

Im looking at the implementations rn, idk why you are arguing the opposite of reality

wet breach
#

Anyways on with my day and blocking you

noble lantern
#

uhhmmm

#

am I tweaking or is intellij? Invalidated caches and everything but it still say 19 != 19

#

all modules are set to 19 too Wut

#

changing to java 21 fixed it nvm

blazing ocean
spice burrow
#

can you still add custom enchants to the enchant registry in 1.20.2+? I haven't found a way of freezing/unfreezing the registry and registering the enchant since Enchantment#registerEnchantment is no longer possible

torn shuttle
#

intellij....

#

I don't even understand why a window would be allowed to be resized to this size, much less somehow open at this size

lilac dagger
#

they wanted to flex their shrinking capabilities

#

which indeed is impressive

torn shuttle
#

flexing how compact the new ui is

lilac dagger
#

good luck doing anything productive

torn shuttle
#

wow you need to look at the code while programming?

#

I bet you also look at the keyboard while typing

#

and type with a single finger

carmine mica
torn shuttle
#

trash compactor ui

#

runs fine on 100px by 5 px monitors

#

well

#

time to create an entirely new plugin

#

I'm not looking forward to this one

#

I'm not even sure if it's a good idea tbh

carmine mica
#

It also might be a version thing, maybe 1.8 did it differently,

#

I would encourage building the server source for 1.8 and checking the method implementation yourself.

twin venture
#

Hi , i have some problems with data sync bettwen lobby / other servers so in game-1 server the data is stored in mysql , but when i join lobby its 0 kills , 0 wins , but in game-1 its 2 kills , 2 wins ..

#

sometimes it update sometimes its not ..

valid burrow
#

in general you shouldn’t save most data just before the player leaves

#

save it when acquired

twin venture
#

so when i kill a player , i save it to mysql?

#

but does not that cause performance issuses?

valid burrow
# twin venture oh ?

i would only do that if its data that changes literally like every 0.5 seconds

valid burrow
#

so unless you have 10k players

#

no problem

twin venture
#

ok thx

short drift
#
System.out.println(translationString.getText());
#

What's going on?

#
[10:55:02] [Server thread/INFO]: [TextComponent{text=, BaseComponent(style=net.md_5.bungee.api.chat.ComponentStyle@3d3af72, insertion=null, extra=[TranslatableComponent(format=%(?:(\d+)\$)?([A-Za-z%]|$), translate=custom.carrots.in.farmland, with=null, fallback=null), TextComponent{text= , BaseComponent(style=net.md_5.bungee.api.chat.ComponentStyle@3d3af72, insertion=null, extra=null, clickEvent=null, hoverEvent=null, reset=false)}, TextComponent{text=, BaseComponent(style=net.md_5.bungee.api.chat.ComponentStyle@3d3af72, insertion=null, extra=[TranslatableComponent(format=%(?:(\d+)\$)?([A-Za-z%]|$), translate=custom.ageable.ripe, with=null, fallback=null)], clickEvent=null, hoverEvent=null, reset=false)}, TextComponent{text=., BaseComponent(style=net.md_5.bungee.api.chat.ComponentStyle@3d3af72, insertion=null, extra=null, clickEvent=null, hoverEvent=null, reset=false)}], clickEvent=null, hoverEvent=null, reset=false)}]
rough ibex
#

can you post more code

short drift
#

It can't do recursive calls for TranslatableComponent ?

short drift
#
TextComponent translationString = new TextComponent(new TranslatableComponent(translationKey));
// Add a space for ageables.
translationString.addExtra(new TextComponent(" "));

// Check for growth stage and add a suffix message.
TextComponent suffixGrowthMessage = getSuffixGrowthMessage(ageable);
translationString.addExtra(suffixGrowthMessage);
translationString.addExtra(new TextComponent("."));
System.out.println(translationString.getText());
#

It would seem to me it's getting this.

#

Instead of this.

#

But then, that begs the question - what is the proper procedure for such things?

twin venture
#

maybe its loading the cached data?

short drift
#

If I do System.out.println(translationString.toPlainText()); I just get the translation key, not the translation text.

torn shuttle
#

Quick question, if I make a plugin that downloads another plugin (both mine) is this against spigot TOS? I want to make a plugin that manages resource packs (merging, hosting and such) and am wondering if I can make it so when people download some other plugin of mine that benefits from this plugin I can add a prompt to ask if they want to autodownload the rsp management plugin

short drift
#

Have you tried reading the TOS?

torn shuttle
#

yes

short drift
#

It didn't help?

#

Which part of the TOS are you concerned with?

torn shuttle
# short drift It didn't help?

nothing particularly specifies whether this is allowable, if it did I wouldn't really question it. Making plugins download other plugins from third party hosts as a feature sounds like it could lead to a lot of questionable situations, so I'm asking if there is a current ruling on it to err on the side of caution

short drift
#

AdvancedSeasons seems to load stuff dynamically.

#

They had some argument at one point with Spigot. But I don't know the details or whether it was related.

#

However, if there's nothing that specifically forbits you from doing this with their software - go right ahead.

#

Be sketchy.

#

If it makes you happy.

#

I doubt Spigot has a lot of incentives to sue its users.

torn shuttle
#

I'm not afraid of getting sued, I just want to be in good standing with a platform I've been using for a very long time and enjoy using and developing content for

short drift
#

Okay. I have nothing more to add to the conversation after that. Good luck.

merry cove
#

am so confused, is block position in nms now called blockpos? or is it the wrong variable.

short drift
#

Does it give you the correct position when you use it?

merry cove
pseudo hazel
#

maybe its a mapping thing?

merry cove
#

super random change, ill check

shadow night
#

All time I can remember I've been dealing with nms (mostly modding, not spigot) it was BlockPos

short drift
#

I tried all of these, none of them give me the translated string.

pseudo hazel
#

what is translationString

merry cove
#
        return new BlockPosition(block.getX(), block.getY(), block.getZ());
    }``` used to work 😐
sacred mountain
#

Anyone know what happened to the spigot website?

merry cove
#

its up for me

sacred mountain
pseudo hazel
#

reload

sacred mountain
#

any browser same thing

merry cove
#

its on your side

short drift
#

It has been cancelled.

pseudo hazel
#

hmm

sacred mountain
#

right

#

ok

pseudo hazel
#

restart pc

#

nuke the cookies

worthy yarrow
#

Oops sorry I took spigot down 🤷‍♂️

pseudo hazel
#

nuke the browser temp data

sacred mountain
#

o

#

k

#

:(

quaint mantle
#

Delete chrome

sacred mountain
#

i fixed it

merry cove
#

eff nms with confusing variables. going back to protocollibs 😢

sacred mountain
#

by using opera gx

sacred mountain
worthy yarrow
#

Oh boy

sacred mountain
#

i just reset my cache on chrome to no avail

#

so idk

#

bro what

#

the following error occured:

pseudo hazel
#

wtf xD

sacred mountain
#

The hiring developers forum is quite dead lol

#

I would create a portfolio and post, but over the 4 years ive had an account on spigot

#

i havent managed to post enough to reach 20 message

#

s

#

lol

shadow night
#

Lmao

lone jacinth
# river oracle <@266191667671859200> So, I'm looking at commodore. I'm needing to change the In...

itf means interface it is a flag to tell ASM that the method is from an interface. ASM needs this information to build the constant pool correctly.

You only need to change handleMethod.

You can also find an up to date version of commodore with the interface changes here: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1315/diff#src%2Fmain%2Fjava%2Forg%2Fbukkit%2Fcraftbukkit%2Futil%2FCommodore.java

wise rock
#

Anyone else having issues with the premium resource placeholders not being replaced?
I mean these placeholders, for example %%__USER__%%.
It happened on the latest update of my plugin, never had issues with that in the recent years.

lilac dagger
#

if you download the resource yourself it won't get replaced

dapper flower
#

Does enyone have a link to a guide on how to add sql to a plugin?

wise rock
#

i know but customers are having this issue

lilac dagger
#

it's nothing fancy really, you don't need to specify that it's for a plugin

#

just use the queries and the result set to do what you need

dapper flower
#

Oh alr ty

hazy parrot
#

Does anyone know why swagger is not respecting custom jackson module for scheme generation ? Seems like quite a few people had this problem but all of them managed to fix it by declaring custom ModelResolver bean which doesn't seem to work with me. Funny part is that swagger is respecting all jackson configurations (for example PropertyNamingStrategy) but only things its not respecting are custom modules.

quaint mantle
#

It took me just a single google search

#

If you don't know how to create a connection, is the same as if you were doing a standalone java application

DriverManager.getConnection("jdbc:mysql://<host>:<port>/<database>", "sql user", "sql password");

sql user and sql password can be null

valid burrow
lilac dagger
#

chat gpt would give the same result

#

it's like searching but tailored to your need

blazing ocean
tardy delta
lilac dagger
#

well, not if your requests are small

blazing ocean
#

haven't used it in months tho

lilac dagger
#

well, it's just the idea you created about chat gpt then

#

in most cases it's useful

blazing ocean
#

7/10 times it hallucinates

lilac dagger
fluid cypress
#

how can i add colors to a message defined by a config? afaik if you use escape codes like §c, that could not work in some cases, like printing to console, and the best is to use ChatColor, but how can i use it from a config? any helper method or something to replace placeholders for colors or something like that?

eternal oxide
#

placeholders

quasi gulch
#

Or you could use minimessage

fluid cypress
#

but is there something from the spigot api that does that? so i dont have to implement it myself

eternal oxide
#

like {GREEN} in teh config you parse and replace with ChatCOlor.GREEN

#

its very simple to do, you do it yourself

fluid cypress
#

ok, and what is the proper way to use translations?

#

manually? just a yaml file and thats it?

lilac dagger
#

Chatcolor translate from something

eternal oxide
#

translations?

fluid cypress
#

yea, different languages for chat messages and all that stuff

eternal oxide
#

different yml for each language

fluid cypress
#

so manually

fluid cypress
lilac dagger
#

yeah

fluid cypress
#

cool

lilac dagger
#

you can use & as a placeholder in config

fluid cypress
#

yea, thats what ive seen used in this game

quaint mantle
# fluid cypress so manually

I usually use a configuration file, in where you can specify a "language", for example

config.yml

Language: "english"

Then in a "lang" folder, I have a file called english.yml, with the messages
In code, when you want to obtain your messages, I would recommend having a class which obtains the correct message file for you

class MyMessagesObtainer {


    MyMessagesObject getMyMessage() {
        Config config = /*obtain config*/
        String lang = config.getString("Language", "english");

        File langFile = new File(plugin.getDataFolder() + "/lang", String.format("%s.yml", lang));
        if (!langFile.exists()) {
            langFile = new File(plugin.getDataFolder() + "/lang", "english.yml");
        }

        YamlConfiguration yaml = YamlConfiguration.loadConiguration(langFile);
        return new MyMessagesObject(yaml);
    }
}
pseudo hazel
#

I use an enum to store the keys to the translation and then just have a translate function to convert it to string

#

then I can do GAME_JOIN.translate(player.getDisplayName) for example

quaint mantle
#

The problem with that is that some translations might get too big using enums

#

But it's also another way of doing it

pseudo hazel
#

wdym too big

quaint mantle
#

Some plugins have translation files of more than 3K lines of translations

#

Imagine an enum of 3K entries

pseudo hazel
#

yeah

#

well my plugin doesnt have that many lines

quaint mantle
#

Yes, I mean, if somehow you expect your translations to be really big, don't use enums

blazing ocean
pseudo hazel
#

right I guess

#

but the rest of my approach would be the same

#

then id just call translate with the actual translation key

#

of where its stored in the yml

blazing ocean
#

right

#

i'd have an enum and an extension function on the player object allowing you to directly send translations with args

#

kotlin only ofc

pseudo hazel
#

I use static like a real champ

blazing ocean
#

🤢

pseudo hazel
#

public static void sendDebug(string message, player)

blazing ocean
#

why not just player.sendMessage(message) 😭

pseudo hazel
#

because I might have prefixes and stuff

#

but that is essentially what the function does

#

though it also supports the components since I use player.spigot()

young knoll
#

I’ve managed to abstract my custom library to take adventure components everywhere

#

And deal with them the best it can

blazing ocean
#

adventure my beloved

quaint mantle
#

(not)

blazing ocean
#

me when mixins

quaint mantle
#

Me when JavaScript Prototype

pseudo hazel
#

i dont use adventure

#

but its all kinda the same thing anyways

blazing ocean
pseudo hazel
#

like what

blazing ocean
#

audience

pseudo hazel
#

wtf is that

blazing ocean
#
pseudo hazel
#

who needs that when you already wasted time making it yourself

blazing ocean
pseudo hazel
#

well actually not waste

#

it would likely be the same amount of fime trying to figure out how to refactor it to use Audiences instead

quaint mantle
pseudo hazel
#

but mostly because I didnt know it was a thing

#

like 5 minutes ago I didnt know audiences were a thing for adventure components

young knoll
#

My current system is basically

  1. Adventure Bukkit adapter
  2. NMS
  3. Legacy serializer
quaint mantle
#

wdym by legacy serializer?

young knoll
#

It serializes it to a legacy string

quaint mantle
#

Do you mean that weird json string?

young knoll
#

No, an actual legacy string

pseudo hazel
#

yeah this is out of my area, I never used nms and hope to keep it that way

quaint mantle
blazing ocean
#

chat colours

young knoll
#

§4Red text wow

blazing ocean
#

components >>>>>

#

adventure is one of the main reasons i use p*per
i just need components on inventory titles sorry

quaint mantle
#

I dislike paper

young knoll
#

That's what NMS is for

pseudo hazel
#

wdym

quaint mantle
#

it modifies API alot that breaks many plugins

young knoll
#

And yk, Once choco gets that PR merged

#

:p

pseudo hazel
#

just use tolegacystring xD

young knoll
#

Yeah but that mangles fonts

#

And translatable components

shadow night
pseudo hazel
#

I guess

#

so there is no spigot api to get components on titles?

shadow night
#

If nms counts there is

pseudo hazel
#

well yeah

blazing ocean
pseudo hazel
#

I dont count that haha

blazing ocean
#

i also use an interface lib

#

which would make it even more incompatible

pseudo hazel
#

but okay, that would be a good usecase I suppose

#

but besides that I think pretty much anything else supports components

blazing ocean
#

and also have that be version-dependant and have it changed for 1.20.6

young knoll
#

Spigot is missing a ton of component stuff

blazing ocean
#

yea

young knoll
#

But we have a PR that is hopefully close

#

plz

blazing ocean
#

only messages suck

eternal night
pseudo hazel
#

well besides translatable inv titles I still havent heard anything xD

young knoll
#

Lynx don't make me hurt you

shadow night
#

Any kotlin users here

blazing ocean
#

just use translatable components bro

#

yes

#

hello

shadow night
#

Ya sure you want to talk about kotlin

blazing ocean
#

oh my god please

#

just ask

#

your damn question

eternal night
shadow night
#

There is no question

#

There is only...

blazing ocean
#

ffs

#

NO

shadow night
blazing ocean
#

alright i'm leaving

#

was fun herew

shadow night
#

Lmao

eternal night
shadow night
#

There goes rad

young knoll
#

Don't even bring that up

blazing ocean
#

i'm still here

young knoll
#

😩

blazing ocean
#

don't want my boost to expire

eternal night
#

When will my ban run out? You racist, take him down, I've been waiting for half a year!

young knoll
#

I'll make sure your ban never runs out

shadow night
blazing ocean
#

shut up

eternal night
#

Sadge Remove my ban from spigotmc

shadow night
blazing ocean
#

ffs

shadow night
#

trol

#

Last thing I'm dropping here is

blazing ocean
#

omg

#

so fluff

shadow night
#

Lol

#

Rads iconic phrase

#

Are MyClass::myMethod and (clazz, arg) -> clazz.myMethod(arg) the same

young knoll
#

Essentially yeah

#

Idk about bytecode wise, but functionally they are the same

lusty cipher
#

does anyone know why intellij keeps trying to run a generateTemplates task on gradle for some unknown reason

tardy delta
#

no, first one operator on class level, second one on instance level

shadow night
#

Just that it expects the instance to be passed

#

Unlike classInstance::myMethod

tardy delta
#

but the latter implies there are two params

pseudo hazel
#

its all the same thing

tardy delta
#

where clazz.myMethod uses the first param as receiver, not as param

#

or have i forget how java works again

blazing ocean
#

just use kotlin bro

tardy delta
#

this

shadow night
blazing ocean
#

what is kotlin hell

#

your code?

shadow night
#

Yes + the worst 1992 like formatting

blazing ocean
#

🤮

#

PLEASE press ctl-alt-l

shadow night
#
        class main {
       @JvmStatic
fun Main(Array<String> Args) {
println("fuck rad")
}
    }```
#

Enjoy

tardy delta
#

i totally forgot

blazing ocean
shadow night
tardy delta
#

wont compile

blazing ocean
#

why

#

is the class name lowercase

#

but the method uppercase

shadow night
#

Because I fucked up everything

blazing ocean
#

and the param syntax is wrong

shadow night
#

Exactly

blazing ocean
#

and you don't even need it to be static and a class

shadow night
#

Enjoy

#

Do you like this

class Main {
@JvmStatic
fun Main(Array<String> args) {
val numbers = arrayOf(1, 2, 3, 4, 5)
 val result = mutableListOf<Int>()
for (i in numbers)
{
if (i % 2 == 0) {
 result.add(i * 2) }
 else { result.add(i * 3) }
}
 for (j in result)
 println("Value: " + j)
val map = mutableMapOf<String, Int>()
 map.put("One", 1)
 map.put("Two", 2)
 map.put("Three", 3)
 for ((key, value) in map)
 println(key + ": " + value)
try {
val quotient = 10 / 0
 println("Quotient: " + quotient)
}
 catch (e: ArithmeticException) {
 println("Divide by zero error")
}
}
}  ``` (author: chatgpt)
tardy delta
#

you dont even need a class

blazing ocean
#

what the fuck

#

die

tardy delta
#

actually buildList 🤓

blazing ocean
#

buildList and buildMap my beloved

lusty cipher
#

just use Scala

blazing ocean
#

who are you, steel?

tardy delta
#

might look into it

honest echo
#

is it possible to have certain biome in specific area/block ?

blazing ocean
honest echo
blazing ocean
#

/fillbiome

#

idk how bukkit handles it

shadow night
blazing ocean
#

yes

#

yes i do

shadow night
#

Lol

#
public class Main {
    public static void main(String[] args) {
        System.out.println("no you don't");
    }
}```
chrome beacon
#

They're working on a better main method

shadow night
blazing ocean
#

yea

shadow night
chrome beacon
blazing ocean
#

so fucking cursed

shadow night
#

Yk how IJ has a convert java to kotlin feature? Lets convert minecraft to kotlin

blazing ocean
#

yes!!

#

nullability will produce 10000 compiler errors

#

need to fix those manually

shadow night
#

Lmao

tardy delta
#
val offhandList = items.toMutableList().also {
  removeAll(main)
  removeAll(armorList)
}```
blazing ocean
#

🤓

shadow night
#

Just feed it into chatgpt

blazing ocean
tardy delta
#

ah ye it would be it.removeAll, too bad use apply

blazing ocean
#

apply >>>>

tardy delta
#

i once did kotlin val sharedViewModel by run { val internalVm = viewModel(factory = SharedViewModel.Factory) remember { mutableStateOf(internalVm) } }

blazing ocean
#

why you using a delegate

shadow night
#

Is extension function kotlin terminology for method or what

blazing ocean
#

no

tardy delta
#

cuz android

blazing ocean
#
fun Player.foo() = sendMessage("HELLO")

player.foo()
tardy delta
#

gotta realize that methods dont exist

#

everything is a function

#

player.foo(bar) is literally foo(player, bar)

#

exactly what an extension function does

blazing ocean
#

yea

#

just adds them onto existing objects

shadow night
#

Could've continued this but I'm not

pseudo hazel
#

whats a data class

blazing ocean
#

record

tardy delta
#

i wanna get technical

#

dont let me talk about indy bootstraps

pseudo hazel
#

i see

tardy delta
#

right on time

pseudo hazel
blazing ocean
#

probs idk

#

maybe singletons instead

#

since objects are also just singletons

twilit wharf
#

I cant seem to figure out how to support multiple java versions with my plugin. I am supporting all of 1.20 NMS versions, and 1.20.5+ requires Java 21, and < 1.20.5 is Java 17. I cant compile the 1.20 dependency without 21, meaning that the NMS module has to be 21, meaning that my core module has to be 21 since it includes the NMS module, and < 1.20.5 doesnt support java 21 (ASM is outdated). What am I doing wrong?

#

The 1.20.5 and 1.20.6 dependencies dont resolve if I use any version under 21

dire marsh
#

disableAutoTargetJvm is probably what you want

twilit wharf
#

I just tried that, however it doesnt work how I want

#

The code which is compiled in 1.17 can now no longer access the NMS code, even though it resolves the depencency, so it still wont compile.

eternal night
#

you'd have to a) disableAutoTargetJVM and then also define java 17 as both source and target

twilit wharf
#

it is compiling in 1.17

eternal night
#

or whatever your shared version is

#

is this open source?

twilit wharf
#

No

#

I honestly probably setup my gradle modules wrong

#

but my main module, which has my generic code, has "nms" modules for each version, which it only imports and uses the one corresponding to the server version

#

oh wait, the NMS modules hsould also have the disable auto target thing, one sec

eternal night
#

Yea I mean,

java {
  disableAutoTargetJvm()
  toolchain.languageVersion = JavaLanguageVersion.of(21)
  sourceCompatibility = JavaVersion.VERSION_17
  targetCompatibility = JavaVersion.VERSION_17
}
#

should basically work for nearly all your modules

river oracle
#

Pineapple 🍍

twilit wharf
#

I cant believe its that simple

#

I went to a different discord and they wanted me to like completely restructure and recode my entire plugin

quiet ice
#

They probably interpreted your request as wishing to go with the MRJ route

twilit wharf
#

MRJ?

quiet ice
#

Multi-Release-Jar

primal stirrup
#

Hi there,
I am having an issue with development of my bungee plugin where it says the following, Cannot invoke "java.util.List.isEmpty()" because the return value of "net.md_5.bungee.api.plugin.PluginDescription.getLibraries()" is null
But I haven’t set the field not was it an issue before the 1.20.5/6 update

vague swallow
#

is Player#canSee(Entity) also false when the entity is invisible but not hidden?

marble hearth
#

Does anyone have experience developing faction servers? we got some people working on it but we were looking for suggestions and advices moving forward

tardy delta
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

pseudo hazel
#

unless you are specifically looking for people

#

?services

undone axleBOT
silent wave
#
org.bukkit.plugin.InvalidPluginException: Cannot find main class `cc.catpvp.ArcherUpgrades'
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:65) ~[Spigot.jar:1.8.8-R0.2-SNAPSHOT]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:113) ~[Spigot.jar:1.8.8-R0.2-SNAPSHOT]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:314) ~[Spigot.jar:1.8.8-R0.2-SNAPSHOT]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:232) ~[Spigot.jar:1.8.8-R0.2-SNAPSHOT]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:311) ~[Spigot.jar:1.8.8-R0.2-SNAPSHOT]
    at net.minecraft.server.v1_8_R3.DedicatedServer.init(Unknown Source) ~[Spigot.jar:1.8.8-R0.2-SNAPSHOT]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(Unknown Source) ~[Spigot.jar:1.8.8-R0.2-SNAPSHOT]
    at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_202]
Caused by: java.lang.ClassNotFoundException: cc.catpvp.ArcherUpgrades
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_202]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100) ~[Spigot.jar:1.8.8-R0.2-SNAPSHOT]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:85) ~[Spigot.jar:1.8.8-R0.2-SNAPSHOT]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_202]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_202]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_202]
    at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_202]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:63) ~[Spigot.jar:1.8.8-R0.2-SNAPSHOT]
    ... 7 more```
#

idk why isnt working

tender shard
eternal oxide
#

InvalidPluginException: Cannot find main class `cc.catpvp.ArcherUpgrades'

silent wave
#

dude, lookup my plugin.yml

tender shard
#

?paste your main class

undone axleBOT
silent wave
#
main: cc.catpvp.ArcherUpgrades
version: 1.0
author: SimplyJC_
description: Archer Upgrades to CatPvP
commands:
  togglearcher:
    description: Toggles different types of archer effects on or off.
    usage: /togglearcher <poison|slowness|wither>
eternal oxide
#

thats wrong

#

but we can't tell you what it should be as you've shown no code

silent wave
#

forget it, i already found the problem 🤣

#

in my plugin.yml y putted cc.catpvp.ArcherUpgrades, but for some reason in my main class the package was cc.catpvp.simplyjc 🤣

regal lake
#

Does this no longer work in 1.20.6 ?

net.minecraft.world.item.ItemStack nmsStack = CraftItemStack.asNMSCopy(itemStack);
CompoundTag compound = nmsStack.getTag();

It seems there is no getTag method.

hushed garnet
#

Does DecoratedPot have a container interface implemented? I can't seem to get anything working...

slender elbow
#

they use data components now

#

what are you using nms for anyway?

regal lake
#

Because of legacy structure 😄
So i have to migrate the data, right ?
But how can i do that if there is no more NBT data?

slender elbow
#

do what exactly?

#

but ideally you should migrate your system away from nms

#

and use the api instead

edgy crystal
regal lake
#

Yea if nms no longer exits, i have to do that.
But how can i use the new system, if i don't have access to the old data right ?
As example my item has a custom durability as nbt data which i have to migrate to the new system, right ?

edgy crystal
river oracle
#

Binary serialization! But its kinda a pain to implement because the ItemStack class

edgy crystal
#

compile took 4 minutes and 20 sec

young knoll
#

I mean even custom durability could have used PDC

#

since 1.14

eternal oxide
#

?paste a log

undone axleBOT
regal lake
#

I don't knew that, so there i no way to migrate the old data right ?
So i have to create migration command or something like that in a old version?

young knoll
#

I'm sure you could

clear elm
#

Hey i have the problem that im doing a tpa plugin and curently im doing the /tpaccept <player> feature that means i accept the tpa of the 1 arg but my problem is idk how i can do it casue rn im doing it with a hashmap but the hashmap overrides everytime a player executes the command so the player can only have 1 tpa request at the same time
tpa2.put(p, ptp);
this is from the /tpa <player> command and p is the command execute and
can prob someone help me

young knoll
#

The old data should be loaded into the CustomData tag or something

slate mortar
edgy crystal
slate mortar
#

so yes, every player can only have a single value, if you use a map

regal lake
#

Okay, so i have to do migration command/event to PDC.
Is there a good PDC tutorial/documentation to learn that ?

blazing ocean
#

?pdc

regal lake
#

Thanks

clear elm
young knoll
#

You should use the actual custom durability component for 1.20.6 tho

slate mortar
regal lake
#

The custom durability is just one part, there are some options which are saved on the ItemStack 🙂

clear elm
young knoll
#

Put that in the list of requests then

slate mortar
#

yea, just make a "Request" class, that has a number (might be ms, seconds, whatever), and the target's uuid

young knoll
#

Record (UUID, Instant)

#

:p

slate mortar
#

records to be cute

#

especially when used with intellij's inline brackets

clear elm
#

so i can do a own expireation time for every value?

young knoll
#

mhm

clear elm
#

i need that every value gets his own experation time

slate mortar
#

wdym? you make a map that has the player (who runs the command) as key, and a list of requests as value, so Map<UUID, List<TPARequest>> for instance

#

obviously you will need to manage somehow to decrease the expiration timer every X seconds

young knoll
#

That's why you use an instant

clear elm
#

but how can i make that the request expire after an amount of time

slate mortar
#

idk what an instant even is lol

young knoll
#

And just check against the instant when they run the accept command

slate mortar
#

does it automatically count down?

young knoll
#

Nah it's just a fancy wrapper for a timestamp

slate mortar
#

oh

#

thats awesome

clear elm
#

thats my question

young knoll
#

?

slate mortar
#

only one active request per player per time

clear elm
#

yea thats exacly the problem

slate mortar
#

so they don't overlap i assume

#

when adding to the map, just remove the old request if existing

young knoll
#

^

clear elm
#

i dont want that the player can only have 1 tpa per time

slate mortar
#

well

young knoll
#

That's what the list is for

slate mortar
#

then don't remove it?

young knoll
#

Map<UUID,** List<TPARequest>**>

slate mortar
#

yea

clear elm
#

but every tpa should havbe his own experation time

slate mortar
#

yea

#

that's what the request class/record is for

pseudo hazel
#

thats inside the request

young knoll
#

That goes in the TPARequest object

slate mortar
#

it handles its own expiration

clear elm
#

now i understand

pseudo hazel
#

and then youll just have some function that grants the request and checks for a valid one

slate mortar
#

eg.

public record TPARequest(UUID target, Instant creationTimestamp){}
blazing ocean
#

i hate that you have to add the {}

slender elbow
#

hate is a strong word

pseudo hazel
#

yeah

#

i do hate it

tardy delta
#

kotlin data classes

blazing ocean
pseudo hazel
#

but not so much that I switch to another language khajiit

tardy delta
#

it is

slate mortar
#

then you have a map of those, eg ```java
private final Map<UUID, List<TPARequest>> requests = new HashMap<>;

clear elm
#

what means eg

slate mortar
#

for example

blazing ocean
#

example given

pseudo hazel
#

example given

clear elm
#

okay

slate mortar
#

meh

#

i wasnt that wrong

pseudo hazel
#

but you werent right either

slate mortar
#

"for example" vs "example given"

#

f you

pseudo hazel
#

xD

#

i mean ots close enough

ancient plank
#

it's all semantics

slate mortar
#

anyway, then whenever you run the tpa command (/tpa <target>), you just add it to the map, with ```java
requests.put(sendingPlayer.getUUID(), new TPARequest(targetPlayer.getUUID(), Instant.now()));

#

assuming it's "Instant.now()"

#

never used it

clear elm
#

what is Instant.now()

pseudo hazel
#

its a timestamp

slate mortar
#

the current time

#

basically

clear elm
#

im doing it like this
System.currentTimeMillis()

pseudo hazel
#

and when the player types tpaccept you check if the timestamp is within the time limit of the current time

slate mortar
#

actually wait

pseudo hazel
#

yeah same thing

blazing ocean
slate mortar
#

it's a list of requests

blazing ocean
#

basically same thing as instant

ancient plank
#

instant is just more convenient

blazing ocean
#

yup

slate mortar
#

not tested obv

#

also make sure it's a mutable list

pseudo hazel
#

yeah and tpaccept is just removing a request until you find one that hasnt expired or until its empty

eternal oxide
#

why are you messing with records and Lists if it's just a tpa timer?

slate mortar
clear elm
#

im pretty new to java

eternal oxide
#

it's it on the player accepting ANY tpa?

slate mortar
#

cuz i'm pretty sure modifying the list directly doesnt change it

slender elbow
#

the first step for a very flexible and robust tpa plugin is using spring boot

pseudo hazel
#

well

#

the first step is learning java

clear elm
slate mortar
#

the first step is finding an IDE uwu

pseudo hazel
#

the first step is getting born

wet breach
pseudo hazel
#

so gg, you are already at step 2

clear elm
shadow night
#

tpa is short for "teleport accept" right?

wet breach
#

well, its not teleport all >>

shadow night
#

lol

#

that would be tpall

pseudo hazel
#

yeah its tp accept

clear elm
pseudo hazel
#

the command is usually tpaccept, so a nice way to say it is just tpa

pseudo hazel
#

because /tp is already a vanilla command also

slate mortar
shadow night
clear elm
slate mortar
#

ehh

#

does spigot have some sort of tick event?

shadow night
young knoll
#

We have the scheduler

slate mortar
#

ugh

#

on the client, i always use a custom ClientTickEvent

shadow night
#

I have a tick event in my lib so I don't care

blazing ocean
#

fabric my beloved

slate mortar
#

^

young knoll
#

I mean it's literally the same thing

shadow night
clear elm
#

so how can i remove the tpa from the list after some time and refresh the list in the hashmap?

slate mortar
#

anyway, then i guess you just create a scheduler when the request is created, and cancel it (and remove the request) after X time

shadow night
slate mortar
eternal oxide
#

From memory so fix any typos

private static Map<UUID, Instant> timeout = new HashMap<>();

public isExpired(UUID id) {
  return !timeout.getorDefault(id, Instant.now()).isAfter(Instant.now());
}

public void setTimeout(UUID id) {
 timeout.put(id, Instant.now().plus(10, TimeUnit.SECONDS);
}```
clear elm
shadow night
slate mortar
shadow night
#

another issue is when IJ comes up with indexing for 30 minutes

shadow night
#

but I haven't experienced that for a while

slate mortar
#

i once opened my linux home dir in ij

#

it indexed for a good 2 hours

shadow night
#

lmao

slate mortar
#

good times

shadow night
#

my downloads dir would take longer

slate mortar
#

i mean, it indexed my whole installed steam library

ancient plank
#

lol

shadow night
#

lmao

slate mortar
#

about 200gb

regal lake
#

Does not every ItemStack has ItemMeta ?

slate mortar
#

i think some don't

chrome beacon
#

Air doesn't have item meta

clear elm
slate mortar
#

"record" is just a class

#

that automatically does some fancy stuff

regal lake
#

In my case its a blaze rod, but i need item meta to use PDC, right ? 😅

chrome beacon
#

yes

slate mortar
#

non-air items do have meta's

#

should*

shadow night
#

where does minecraft store whether a chunk is a slime chunk or not? when working with fabric

regal lake
#

But why i get

java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.meta.ItemMeta.getPersistentDataContainer()" because "itemMeta" is null
clear elm
slate mortar
#

huh

slate mortar
#

the same way you create a new class, just a record instead

clear elm
#

whats a record 💀

slate mortar
#

a class

#

that does a lot of fancy shit automatically

#

eg. creating getters

clear elm
slate mortar
#

wait

#

ij cant create records?

#

just create a class then, and change the "public class" to "public record"

#

and replace it with what i sent

quaint mantle
#

Or lower

chrome beacon
quaint mantle
#

IDE knows that

clear elm
#

17

slate mortar
#

mm

clear elm
shadow night
slate mortar
#

yea paste what i sent

quaint mantle
#

Records were added in jdk 20

ancient plank
#

kappa

regal lake
# chrome beacon Show your code

The itemstack will be passed through a few methods but at all it's this:

ItemStack itemStack = player.getInventory().getItemInMainHand()
ItemMeta itemMeta = itemStack.getItemMeta();
NamespacedKey key = new NamespacedKey(this.plugin, "bw-" + path);
PersistentDataContainer persistentDataContainer = itemMeta.getPersistentDataContainer();
slate mortar
ancient plank
#

16 take it or leave it

quaint mantle
#

16?

shadow night
quaint mantle
#

Wait

#

Really?

slate mortar
#

ya

clear elm
slate mortar
#

yea

#

cuz it's wrong

clear elm
#

it dont exsits for me

slate mortar
#

oh

#

i see

#

which java are you using

#

you need 16 at least

clear elm
#

where can i see this 💀

slate mortar
#

press ctrl+alt+shift+s

chrome beacon
regal lake
#

It is not air, i have blaze rod in the hand 😄

quaint mantle
#

If your language level is set to any lower than 16, it doesn't matter the java version you are using

slate mortar
#

both the jdk and lang level should be at least 16

clear elm
slate mortar
#

or sdk

#

idk what ij calls it

quaint mantle
#

JDK

clear elm
slate mortar
#

huh

#

set the lang level to 17

quaint mantle
#

SDK default uses the java version

#

Weird

#

He shouldn't need to do that

slate mortar
#

yea i'm confused

clear elm
#

this 17?

slate mortar
#

the fuck

ancient plank
#

I've experienced it where it uses 8 even when im on 21

#

and it's soooo annoying

slate mortar
#

that should theoretically have records

clear elm
#

done i try

ancient plank
#

17 has it

clear elm
#

nah it dont

quaint mantle
#

Check module version

slate mortar
#

tf

quaint mantle
#

I mean

#

In modules tab

quaint mantle
#

You are probably using a different language level for module

slate mortar
#

fuck it, ima see what tf ij is doing

quaint mantle
#

Time to switch to vim

#

😔

clear elm
#

i have this

slate mortar
#

its red tho

quaint mantle
slate mortar
#

why

quaint mantle
#

Record is probably a class called Record

wet breach
#

@shadow night you will probably have fun with this if you really need to modify the slime chunk stuff

slate mortar
#

cna you hover over it, an see what it says

chrome beacon
#

it's a keyword it should be lowercase

slate mortar
#

yea but if the class is shown

#

it should have the keyword too

slate mortar
#

yea

quaint mantle
#

Try creating a class which extends Record

quaint mantle
#

😳

slate mortar
#

it has them

slate mortar
#

whats that black magic