#help-development

1 messages · Page 1288 of 1

rotund ravine
#

Damn i am smart guessing that straight away huh

kind hatch
#

Apparently ItemFlag#HIDE_POTION_EFFECTS was removed/renamed/merged with ItemFlag#HIDE_ADDITIONAL_TOOLTIPS somewhere along the lines of the 1.20.4 - 1.20.5 releases. (Over a year ago)
As for the reason why, I have no idea. I wonder if that was intentional or not, but I guess things can be removed from the API after all.

It's much better now with more flag choices, but weird decision to remove old stuff with no replacement in the interim period.

young knoll
#

Yes

#

It's only a compile time break, spigot will handle old plugins with ASM

trim quest
#

anyone uses SPI for multi-module maven structure ?

#

i need serious help

#

i done most of the things

#

just dont know how to use special-source to configure it.

#

my project structure is easy, each NMS submodule(these are dependend to EranoAPI) have implementation, their abstractions are located in EranoAPI.
EranoAPI do not depend any NMS submodule, its fetching its implementation with SPI, and Dist project shading those dependencies.

trim quest
slender elbow
#

how are you using the service loader to locate the provider? as in, the code that interacts with ServiceLoader

#

ah yeah, due to how spigot loads plugins, you need to specify the classloader, like ServiceLoader.load(MyService.class, plugin.getClassLoader())

rotund ravine
#

?blockpdc

undone axleBOT
trim quest
#

dont want to inject my main here

#

ok

#

i found better way

slender elbow
#

the thing is that you can't use the server's classloader in there, plugins live in their own CL, separate from the server, and the lookup needs to happen on the plugin classloader, not the server's

trim quest
slender elbow
#

looks good

trim quest
#

Today I was stupid and changed the JDK for a few modules in the editor.

#

now i dont know how to fix it

chrome beacon
trim quest
#

shade plugin

chrome beacon
#

yeah I understand why it's included but why is it being loaded

#

does it just loop all of them?

#

if that's the case you need to compile all of them with Java 8

trim quest
#

i set java 8 in EranoAPI-Parent pom.xml

#

but after that

#

i use this

chrome beacon
#

yeah that's fine just set the source/target/release of the maven compiler plugin

#

and tell it to compile to java 1.8

trim quest
#

i understand

#
[03:19:47 INFO]: === SPI DEBUG START ===
[03:19:47 INFO]: Looking for TPSHandlerFactory for version: 1.10.2
[03:19:47 INFO]: Available factories:
[03:19:47 INFO]: - Factory: me.erano.com.V1_21_R4.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_21_R3.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_21_R2.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_21_R1.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_20_R3.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_20_R2.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_19_R1.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_19_R2.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_19_R3.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_18_R1.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_18_R2.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false

#
[03:19:47 INFO]: - Factory: me.erano.com.V1_17_R1.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_16_R3.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_16_R2.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_16_R1.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_15_R1.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_14_R1.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_13_R2.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_13_R1.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_12_R1.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: - Factory: me.erano.com.V1_11_R1.performance.TPSHandlerFactoryImpl
[03:19:47 INFO]:   Supports version '1.10.2': false
[03:19:47 INFO]: === SPI DEBUG END ===
#
[03:19:47 ERROR]: Error occurred while enabling EranoAPI v1.0 (Is it up to date?)
java.lang.RuntimeException: No TPSHandlerFactory found for version 1.10.2
        at me.erano.com.api.performance.TPSHandlerFactoryClassMapper.getTPSHandlerFactory(TPSHandlerFactoryClassMapper.java:57) ~[?:?]
        at me.erano.com.api.CorePlugin.onEnable(CorePlugin.java:23) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:292) ~[spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.enablePlugin(CraftServer.java:373) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.enablePlugins(CraftServer.java:323) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at net.minecraft.server.v1_10_R1.MinecraftServer.t(MinecraftServer.java:412) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at net.minecraft.server.v1_10_R1.MinecraftServer.l(MinecraftServer.java:377) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at net.minecraft.server.v1_10_R1.MinecraftServer.a(MinecraftServer.java:332) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at net.minecraft.server.v1_10_R1.DedicatedServer.init(DedicatedServer.java:271) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:535) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at java.lang.Thread.run(Thread.java:834) [?:?]
[03:19:47 INFO]: Server permissions file permissions.yml is empty, ignoring it
[03:19:47 INFO]: Done (1,703s)! For help, type "help" or "?"
>pl
[03:20:06 INFO]: Plugins (1): EranoAPI
#

maybe regex stuff

#

im stupid

#

i guess now should work

#

still not working

[03:29:38 INFO]: Loaded factory: me.erano.com.V1_21_R4.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_21_R3.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_21_R2.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_21_R1.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_20_R3.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_20_R2.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_19_R1.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_19_R2.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_19_R3.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_18_R1.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_18_R2.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_17_R1.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_16_R3.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_16_R2.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_16_R1.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_15_R1.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_14_R1.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_13_R2.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_13_R1.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_12_R1.performance.TPSHandlerFactoryImpl
[03:29:38 INFO]: Loaded factory: me.erano.com.V1_11_R1.performance.TPSHandlerFactoryImpl
[03:29:38 ERROR]: Error occurred while enabling EranoAPI v1.0 (Is it up to date?)

>
#
java.lang.RuntimeException: No TPSHandlerFactory found for version 1.10.2
        at me.erano.com.api.performance.TPSHandlerFactoryClassMapper.getTPSHandlerFactory(TPSHandlerFactoryClassMapper.java:24) ~[?:?]
        at me.erano.com.api.CorePlugin.onEnable(CorePlugin.java:23) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:292) ~[spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.enablePlugin(CraftServer.java:373) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.enablePlugins(CraftServer.java:323) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at net.minecraft.server.v1_10_R1.MinecraftServer.t(MinecraftServer.java:412) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at net.minecraft.server.v1_10_R1.MinecraftServer.l(MinecraftServer.java:377) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at net.minecraft.server.v1_10_R1.MinecraftServer.a(MinecraftServer.java:332) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at net.minecraft.server.v1_10_R1.DedicatedServer.init(DedicatedServer.java:271) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:535) [spigot-1.10.2.jar:git-Spigot-de459a2-e669d32]
        at java.lang.Thread.run(Thread.java:834) [?:?]
[03:29:38 INFO]: Server permissions file permissions.yml is empty, ignoring it
[03:29:38 INFO]: Done (1,771s)! For help, type "help" or "?"
#

will test in other versions

#

api-version should be 1.13 ?

young knoll
#

Yes

trim quest
#

but i support 1.10+

young knoll
#

There is no api version before 1.13

slender elbow
#

api-version didn't exist before 1.13, so the lowest it can be is 1.13

young knoll
#

So the server will just ignore it anyway

slender elbow
#

before that it did not matter

trim quest
#

hmm i guess its work for 1.17

#

i changed to 1.13 now its working

#

for 1.17

#

something wrong with the 1.10.2

trim quest
#

for classloader info

young knoll
#

It’s not even checking your 1.10 factory

#

Did you typo something

trim quest
#

its checking 1.10+

#

except 1.10

#

idk why

trim quest
young knoll
#

It’s always the typo

#

Happens to the best of us

trim quest
#

I really appreciate guys

#

for the support

brazen badge
#

hello, is there any way to hide the bossbar and leave only the text to make a persistent announcement? The bossbar of the various bosses must remain

young knoll
#

Texture back to remove a specific colour of bossbar and then use that

#

Or shaders that only target the top bossbar

ebon nexus
#

how can i add minimessage support to my plugin

chrome beacon
buoyant viper
#

chat, does this look like a violation of record design

proven panther
buoyant viper
#

thats just how intellij looks???

proven panther
buoyant viper
#

thats the git commit author

#

inlay hints

proven panther
buoyant viper
#

have u never opened a project that is part of a git repo?

#

or well actually maybe u just turned off inlay hints idk

proven panther
buoyant viper
#

i mean so do i lol

#

but i use git for version control

proven panther
buoyant viper
#

F

proven panther
#

💔

#

Idk how to even fix it so at that point I just gave up on it

buoyant viper
#

😭

#

but yeah idk this is just how my IJ looks lol

#

n then if i click on where it says Hannah it opens the git blame screen that shows like who last modified what line

#

not that its important for me but

mortal vortex
wooden bay
buoyant viper
urban cloak
#

Default

#

Yes

#

New UI, dark theme

wooden bay
#

I'm tripping

urban cloak
#

You sound like you havent updated intellij since its release

wooden bay
#

Probably

urban cloak
#

Im using the eap versions through toolbox and i love to see what they cook

#

Even if some of it doesnt make it into a release

wooden bay
#

I'm lazy

urban cloak
#

It even has an auto updater wdym xd

wooden bay
#

no idea

#

Oh

#

Toolbox

young knoll
#

Doesn’t it just have a built in updater too

pliant topaz
#

yea

#

but afaik it doesnt work with major versions sadly

young knoll
#

Ah

fluid pond
#

https://hastebin.nl/9IR2hH6 why this is happening?

error:

[2025-06-28T12:36:04+0100] [Info] 3
[2025-06-28T12:36:04+0100] [Info] Target method type: (Listener,int)boolean
[2025-06-28T12:36:04+0100] [Info] Adapted type: (Object[])boolean
[2025-06-28T12:36:04+0100] [Info] Spreader type: (Object[])boolean
[2025-06-28T12:36:04+0100] [Info] Expected invoked type: ()CallbackInvoker
[2025-06-28T12:36:04+0100] [Info] Sam method type: (Object[])boolean
[2025-06-28T12:36:04+0100] [Info] method name: onConnectLowest123
[2025-06-28T12:36:04+0100] [Info] Param count: 1
[2025-06-28T12:36:04+0100] [Info] 5
[2025-06-28T12:36:04+0100] [Info] erro ta aq crlh
java.lang.IllegalArgumentException: not a direct method handle
at java.lang.invoke.MethodHandleStatics.newIllegalArgumentException(MethodHandleStatics.java:139)
at java.lang.invoke.MethodHandles$Lookup.revealDirect(MethodHandles.java:1343)
at java.lang.invoke.AbstractValidatingLambdaMetafactory.<init>(AbstractValidatingLambdaMetafactory.java:131)
at java.lang.invoke.InnerClassLambdaMetafactory.<init>(InnerClassLambdaMetafactory.java:155)
at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:299)
at com.lleps.jsamp.ListenerInvoker.<init>(ListenerInvoker.java:56)
at com.lleps.jsamp.MainCallbackListener.registerAnnotatedListener(MainCallbackListener.java:76)
at com.osguri.main.Main.onInit(Main.java:22)
at com.lleps.jsamp.MainCallbackListener.OnGameModeInit(MainCallbackListener.java:110)

onyx fjord
#

how do we register enchantments these days?

chrome beacon
#

ideally with datapacks but plugins load too late for adding those with code

#

but reflection is still an option

noble crown
#

or you could use paper api for that

wet breach
noble crown
#

with spigot, it does not, but it's still an option to consider

echo basalt
#

wake up bae new gongas alt just dropped

#

@ivory sleet wanna do the honors?»

smoky skiff
#

I cant upgrade the wooden sword to iron, stone etc also tools (bw1058)

grand flint
#

what

umbral ridge
#

schnitzel schwein

smoky skiff
#

But

#

Icnt upgrade

grand flint
#

this plugin is for developers

#

ask there

#

or in ur plugins discord server

plush sluice
#

does anyone know how i can return list of all enchantments for tabcompleter? without using any deprecated methods

plush sluice
#

found that but tbh i still dont know lol

young knoll
#

Easiest way would just be a simple loop

twin venture
#

hi so , iam back i guesss to programming ..

i was thinking about is thre something better in 2025 better than fawe / world edit?

young knoll
#

Loop over each enhancement and add the toString of its key to a list

twin venture
#

eaiser to handle , and faster to set blocks?

young knoll
#

No

#

FAWE is the best you’re gonna get for speed

twin venture
young knoll
#

(And jankiness)

twin venture
#

i try not too ..

young knoll
#

I mean

#

You can set blocks yourself

twin venture
#

or plugin

young knoll
#

A cage is just a hollow box

#

Easy enough to do with nested loops

#

Or the NBT structure system

twin venture
slender elbow
#

what exactly is the question?

twin venture
#

is there better alterntiave to fawae , im trying to make a caage system for skywwrs ..

slender elbow
#

you can use the spigot API to set blocks, yes, it isn't the fastest.. far from it, but if you want speed, FAWE is as good as you're gonna get

young knoll
#

It’s a cage

#

They’re tiny, the speed isn’t going to matter

slender elbow
#

¯_(ツ)_/¯

#

then just use the spigot api

#

to set blocks

young knoll
#

If you want to support fancy cages with intricate designs just use the NBT structure system

#

They’re not as compact as schematics but for a few cages it doesn’t matter

#

Also allows people to make custom cages pretty easily

#

Makes me wonder if I should use them, it would mean I don’t need any NMS but would also mean I use a bit more space

twin venture
#

cosmetics:
cages:
basic:
name: "&aBasic Cage"
price: 100
id: 1
rarity: COMMON
blocks:
top: GLASS
sides: LIGHT_BLUE_STAINED_GLASS
bottom: BLUE_STAINED_GLASS

obsidian_box:
  name: "&8Obsidian Box"
  price: 300
  id: 2
  rarity: RARE
  blocks:
    top: OBSIDIAN
    sides: OBSIDIAN
    bottom: BEDROCK
#

something like this i supose xd

#

easy fancy and editale

young knoll
#

Still somewhat limited

#

But yeah that works

twin venture
#

why its limited?

young knoll
#

What if I want my cage to have multiple blocks for the top

#

Or a trim made of stairs on the top

silent slate
#

Hey, setting my position in the tablist to 1 and another users position to 100 doesnt work. He still stays on top of me in the tablist.

I already checked that its defenitely setting those values

#

setPlayerListOrder() is what I am using

thorn isle
#

you can set the order manually now? back in my day we had to fuck with teams and invisible prefixes

silent slate
#

i guess

slender elbow
#

server version? client versions?

silent slate
#

paper 1.21.6, client: 1.21.1

thorn isle
#

i'm gonna throw a guess that the feature to sort them manually was added after 1.21.1 and so the client doesn't know about it

#

this is the other side of the "support everything since 1.8" coin

slender elbow
#

it was added in 1.21.2

#

additionally:

is sorted highest to lowest

#

so even if your client was up to date, someone with order 100 would show up above someone with order 1 because that's how it goes

silent slate
#

ok

#

i had it the other way around before, but it didnt work so i tried it lowest to highest

#

imma try it on 1.21.6

lilac dagger
#

i still do the teams to order

slender elbow
#

it just complicates things for no reason

tacit inlet
#

Hello, i use the adventure api with adventure-platform-bukkit as dependency, and i can't send action bar and title/subtitle : its not working, i don't know why, bossbars and chat messages works btw, and no error during compilation

#

adventure api is shaded in my .jar

#

if someone know about something ..

sly topaz
#

it is probably adventure just not supporting those in the bukkit-platform

tacit inlet
#

its weird because bossbar and chat message (with Component) are working

#

i tested on spigot 1.21.6, paper 1.21.6 and folia 1.21.6, not working :/

slender elbow
#

adventure-platform is not updated to 1.21.6 afaik

#

there was some pr for it

balmy valve
#

why does Damageable#getMaxDamage throw an exception for items with the default max damage

#

For example, a golden pickaxe

#

If I have not expliclity set the max damage component to a non default value, it throws an exception saying it doesnt have max damage

#

but it does

slender elbow
#

because

#

ItemMeta

thorn isle
#

because you are calling it on the ItemMeta, while the default max damage is not stored in the meta, but in the item prototype

#

only if you override it for that particular item does it get stored on the item meta

balmy valve
#

the default max damage is stored in the components

balmy valve
thorn isle
#

in the components of the prototype, yes

slender elbow
#

fortunately ItemMeta a highly flexible system that is very similar to the system adopted by vanilla

balmy valve
#

which should be able to read from default components

slender elbow
#

ItemMeta works exclusively on the patch layer

#

not the resulting component map

#

stupid af

balmy valve
#

yeah why the hell

slender elbow
#

because

#

community feedback is overrated

balmy valve
#

Thats so unintuitive

#

and makes it overall less useful

thorn isle
#

if you're on paper, you can probably use their component api to get it; i don't remember if it also only works on the patch and ignores the prototype, though

#

i mostly use nms for item properties these days

balmy valve
#

their component api works

#

but that works off of itemstack

#

not item meta

thorn isle
#

my personal recommendation is for you to abandon itemmeta altogether

#

it sucked before and it sucks even harder now and i doubt it'll ever get any better

slender elbow
#

at what point do you have an IM without an IS anyway

balmy valve
#

when im working with a plugin that I didnt make that does that a lot

slender elbow
#

🫡

thorn isle
#

i suppose the patch-prototype principle still kind of applies here, though i don't remember if spigot or even paper have a way to get the default properties of the prototype from e.g. material

balmy valve
#

they do

thorn isle
#

i.e. itemmeta represents the patch and material/itemtype/whatever the prototype

#

then you can just toss a ternary at it

balmy valve
#

and if I dont have the itemstack

thorn isle
#

then you have to rewrite things to have the itemstack, or pass Material as well

balmy valve
#

🤦‍♂️ ** **

thorn isle
#

again i kind of recommend abandoning itemmeta altogether

sly topaz
#

why

eternal night
#

"How do I get the non patch values while only having the patch representation without passing something that represents the archetype" is a useless question

thorn isle
#

i guess what he's asking is more like "why is it like this"

balmy valve
#

If itemmeta is pulling from components at all why isn't it pulling from the actual map, insteadof the changemap

thorn isle
#

it definitely is unintuitive for itemmeta to not have any way to get the prototype components

sly topaz
#

I don't know the exact reason, but I assume since ItemMeta is seen as a snapshot, the changemap would be the equivalent representation

balmy valve
#

How?

thorn isle
#

that said you could also argue that it's unintuitive for itemmeta to also include the prototype values, since e.g. an item inheriting the default max damage from its prototype isn't really item metadata as we're used to thinking about it in bukkit

sly topaz
#

as in, ItemMeta being just a carrier or changes rather than a snapshot of the ItemStack

#

though the way it is right now is kind of a mixed ball

balmy valve
#

I was gonna say

thorn isle
#

in the end the answer is that itemmeta is unintuitive

#

one way or another

tacit inlet
sly topaz
#

when it comes to non-component items, it is a snapshot but when it comes to components it is a patch

balmy valve
thorn isle
#

that's how it's been treated in bukkit, so far

#

the itemmeta of an item with no "custom" changes made to it is empty

#

in that sense this current system is a fairly aligned continuation of what we had, which i guess is why it was implemented that way

sly topaz
#

I don't believe it is that bad of a decision, all things considered

thorn isle
#

unfortunately what we had was never good and is only getting farther apart from how things work under the hood

balmy valve
#

it overcomplicates using components

sly topaz
#

I assume md made it that way to simplify the implementation

balmy valve
#

how

eternal night
#

ItemMeta was not designed for components

#

it looks like this because it looked like this a decade ago

slender elbow
#

hear me out

#

FORTUNATELY

thorn isle
#

despair

balmy valve
#

anyways, Ill just cope, but this is really dumb lol

sly topaz
#

has paper's data components API been released? last time I looked at that channel it was just about trying out builder pattern on everything which was well, a decision

thorn isle
#

it's been out in some kind of form for quite a while, but it's marked as experimental so my entire plugin is always linted yellow

#

it's quite alright iirc

#

i mean i prefer nms because at this point the component api is just a very very thin wrapper over nms and most of my projects use nms anyway, so might as well

eternal night
#

Yea

#

data component in paper isn't really an API

#

it is just a 1 to 1 mapping of internals

thorn isle
#

but for bukkit api projects it's fine to use the components api too, it's tolerable

sly topaz
#

so the thing is just there for access, fair enough

thorn isle
#

the power/flexibility of nms without having to set up paper-userdev or remapping or whatever, basically

sly topaz
#

I don't dislike the idea, however it is a big jump from ItemMeta, given they more or less achieve the same things

thorn isle
#

and as such without any of the stability guarantees of the bukkit api, i.e. shit can and will change under you and md5 won't be around to bytecode bandaid it at runtime

#

but seeing how legacy materials and other horrid shit turned out, i consider this a pro and not a con

sly topaz
#

at the time I remember the discussions being at wanting to replace ItemMeta, but ig that's a long way ahead still

#

it isn't a bad abstraction, the implementation is just questionable given the tech debt it carries

eternal night
#

There are plans to replace ItemMeta but yea

thorn isle
#

it isn't even really tech debt at this point, it's more like "we can't break the 1.8 plugins" debt

sly topaz
#

we should've just adopted multi-release jars at the time

thorn isle
#

which i know is an exaggeration but the point is that changing the way how itemmeta works is going to break everything, and bukkit does try to keep a fairly stable api

sly topaz
#

dynamically loading code depending on the version was never a good pattern, but we all just feed into it

young knoll
#

Works better on a site like modrinth

#

That supports filtering downloads by version and whatnot

sly topaz
#

yeah, it is pretty nice when you click download and it asks what platform and version

#

nothing stopping people from putting a big red text at the top of the resource overview being like:

downloads for versions

thorn isle
#

NOT WORK ON 1.8

#

DEAD PLUGIN

young knoll
#

Yes hello I download latest version and it no work on 1.8???!?

sly topaz
#

I downloaded packetevents, but it says I need protocollib? Can you fix?

young knoll
#

It’s not like dynamically loading code based on version is that difficult

#

Just a little bit janky

sly topaz
#

it is increasingly difficult with the api-version shenanigans

#

and besides, it is just not a good pattern

thorn isle
#

i'll disagree with any sort of runtime transformations made to any classes on the principle that it makes it difficult to make educated decisions about the runtime at compile time

young knoll
#

Good code? In something adjacent to game development?

#

Impossible

sly topaz
#

I'll just convert to a datapack developer™

thorn isle
#

once upon a time i remember writing a shop plugin which would put items in empty inventory slots when buying things; later on in 1.13 i started getting reports about the plugin destroying tridents and other newly-added items

sly topaz
#

that's the only place I can exercise clean code

thorn isle
#

it turned out that itemstack::gettype was returning AIR for the trident, so the plugin considered the slot empty

sly topaz
#

imagine just how many valuable tridents you destroyed

young knoll
#

What’s wrong with Inventory#addItem

thorn isle
#

i think i wanted to make sure everything fits before adding any items

#

muh atomic shop transactions

sly topaz
#

I need acid in my life

#

I mean, ACID

thorn isle
#

i also vaguely remember having the same problem with block::gettype, with my rtp plugin teleporting people into solid 1.13+ blocks

#

because again, they were "air"

sly topaz
#

I assume it was the legacy material support being funny

thorn isle
#

most likely

sly topaz
#

I am really glad we're past supporting those versions, with the exception of 1.8

young knoll
#

See this is what happens when you can’t see into the future

thorn isle
#

i didn't really have the patience to debug it at length at the time, the first thing i tried was setting the api-version in plugin.yml to 1.13 and iirc it worked

young knoll
#

Should have added an api version to the plugin back when you made it

sly topaz
#

didn't it start existing in 1.13

#

am I missing the joke

thorn isle
#

i wish they had added some unobtanium material like UNKNOWN to the enum instead of returning a constant that already is associated with certain things like empty inventory/world space

sly topaz
#

why does discord make my life miserable, I want whatsapp stickers for free and not have to pay nitro

sly topaz
#

I was indeed

thorn isle
#

the joke is that i wrote it in 1.12 and it immediately broke in 1.13 because of a system that was meant to add legacy compatibility with 1.12, in a way that was completely unforeseeable

spare hazel
#

why tf does it download everything from everywhee

thorn isle
#

that's just how it is

gaunt tangle
#

I'm looking for a developer to work on a new survival season. ( free )

nova notch
#

if you want free use chatgpt

rotund ravine
civic oxide
thorn isle
#

sounds like a good deal

young knoll
#

A giant player statue at spawn would go kinda hard

thorn isle
#

what's the maximum scale attribute value again? although building a physical statue might look better

#

off the top of my head i think it was 64, so that'd make the statue ~120 blocks tall

young knoll
#

It’s 16

thorn isle
#

lame

nova notch
#

you could just use a giant if that works

#

its close enough right

hollow oxide
#

hello, is there a way to detect critical hit?

I want to detect a critical hit in a

    @EventHandler
    public void onEntityDamage(EntityDamageEvent event) {
        if (!(event instanceof EntityDamageByEntityEvent edbee)) return;

        Entity damager = edbee.getDamager();
        if (!(damager instanceof LivingEntity livingDamager)) return;
        if (!event.iscritical()) return;

        //do stuff
    }

thx for any answers

hollow oxide
#

it's for arrows right?

#

ok no i get it

#

thx

#

but my IDE don't somehow did i do something wrong?

#

ok I know, it's because i'm in 1.21.1 and it's not there

rotund ravine
#

eip

#

Also didn't see this was spgito woop

#

guess u gotta hack a bit on spigot

floral aspen
#

Hey, I've been working on a plugin to clear ground items every 5 minutes and using println in my IDE it seems to be working exactly as intended, however absolutely nothing is happening on my server. I know the plugin is getting loaded due to the server console showing "Plugin Activated" However absolutely nothing is happening from there. Is this an issue with my code or likely something else? For reference I am sheduling a timer every second clearTimer.scheduleAtFixedRate(clearitems, 0, 1000); and checking the countdown inside to remove items at 5 minutes ```TimerTask clearitems = new TimerTask() {
int countdown=300;
public void run() {

    if (countdown>0) {
        countdown--;
        System.out.println(countdown);
        }
    else{
            countdown=300;
            World w = Bukkit.getServer().getWorld("world");
             for(Entity e: w.getEntities()) {
                if(e instanceof Item) {
                    e.remove();
                    System.out.println("REMOVED ENTITIES");
                    Bukkit.broadcastMessage(ChatColor.RED+""+ChatColor.BOLD + "ITEMS CLEARED");    }}}```
sly topaz
#

can't you infer that from the damage source? seems like no

sly topaz
#

also, I got to ask, is this some form of lag prevention mechanism? Because clearing items doesn't really help with lag

floral aspen
sly topaz
#

spigot already has an item expiration feature, you can configure it in the spigot.yml iirc

floral aspen
sly topaz
floral aspen
chrome beacon
#

Also the game already handles item despawning. Adding another timer won't really help performance

robust helm
#

sooo how do i assign an object to an ItemStack for the lifetime of the ItemStack instance?
Current approach is a Map<String, ItemData> where the key is a uuid stored in both the ItemData and the itemstack's PDC, but now I need a unregister() method which I is hard to call at all the events

#

I kinda need a Map<WeakReference<ItemStack>, ItemData> where i can implement the get() logic myself, so that it compares the uuids

#

or does WeakReference even work like that?

mortal vortex
#

Make an ItemStack Wrapper

robust helm
robust helm
young knoll
#

No

robust helm
#

uhh wait

#

im only using it to create items with actions bound to it, like an item that runs a command on right click

#

so im the one calling new ItemStack

#
public abstract class AbstractItem extends ItemStack implements Item {

    @NotNull
    protected abstract ItemStack getItemStack();

    @Getter
    private final String uid = UUID.randomUUID().toString();

    @Override
    public ItemStack newUniqueStack() {
        ItemStack item = getItemStack();
        ItemUidHelper.setUid(item, this.getUid());
        return item;
    }

    public void onRightClick(ClickContext ctx) {
    }
}

basically

young knoll
#

You could just store the entire command in the pdc

robust helm
#

yea but i need it to be more flexible

#

and i also want to save state

young knoll
#

Anyway, you’ll never get your custom Itemstack back when doing stuff like Inventory#getItem

robust helm
#

what if i just have a registry with all AbstractItems, then find the matching in interact event

#

or just compare using the id stored in a PDC, then cast

young knoll
#

The cast will fail

sullen marlin
#

Pretty sure PDC is the right option here

#

You gotta put it all in PDC

young knoll
#

For custom items I just save a key in the pdc that I map to whatever I need

#

If I just wanted to store a command in them I would just put it all in pdc though

robust helm
#

pdcs are kinda annoying

#

with the boilerplate

young knoll
#

Then make a wrapper for it

robust helm
#

a wrapper for pdcs?

robust helm
young knoll
#

Yeah something like

#
PDCWrapper wrapper = new PDCWrapper(meta.getPersistentDataContainer)

String myString = wrapper.getString(namespacedKey)
robust helm
#
@Getter
public class GunImpl extends AbstractItem implements Gun {

    private final String name;
    private final int customModelData;
    private final Gun.Stats stats;
    private final ReloadMechanic reloadMechanic;
    private final ShootMechanic shootMechanic;
    private final DamageModel damageModel;
    private final BulletHitHandler bulletHitHandler;
    private final BulletTracer bulletTracer;
    private final SoundDesign soundDesign;
    private final SpreadModel spreadModel;

    private final ItemStack itemStack;
    private int ammo;

yeah.. this is gonna be fun

#

maybe i just stick to calling unregister(), but then just unregister everything on map change or sth

young knoll
#

Just store a key in the item

#

And map that to a gun via some kind of registry

robust helm
#

so how do i delete my mapped object when the item is collected then?

young knoll
#

You don’t

#

Every unique gun has a registry entry

#

Just like how every unique minecraft item has a registry entry

echo basalt
#

eh

robust helm
#

so i use one Gun instance for all the items?

young knoll
#

Alternatively you can store various stats about the gun in the pdc itself

echo basalt
#

at work we just do items with this crazy ass attribute system

#

at least most of them

robust helm
echo basalt
#

one I wrote :)

#

prolly like 5-10k lines of code by itself

robust helm
#

is it foss?

#

or usable for spigot even?

echo basalt
#

nop

robust helm
#

naww

young knoll
#

More like loss

echo basalt
#

😔

young knoll
#

I’d just make a custom pdc type that handles converting everything you need

echo basalt
#

jokes on me most of the logic links to entities anyways

robust helm
#

string pdc type wrapper using gson maybe :)

young knoll
#

Pull the raw stats directly from the item, and lookup things like SpreadModel from a registry

echo basalt
#

just write codecs

robust helm
#

gson is automatic

#

im not getting paid by hour

echo basalt
#

lame

#

I'm semi I stay automatic

young knoll
#

Developers when they have to write actual code

echo basalt
#

money add then multiply

robust helm
echo basalt
#

you don't want tightly coupled code

young knoll
#

I mean most of it would just be in the custom type

echo basalt
#

^^ aka your codec

robust helm
echo basalt
#

making a codec also allows you to have uh

#

data versions and stuff

#

you can update the config and the item magically updates

robust helm
#

config?

#

i like hardcoding my stuff

echo basalt
#

yeah I dunno why I'm trying to suggest

robust helm
echo basalt
#

clearly ignorant dev just tryna get paid and move on

young knoll
#

I do enjoy being able to just assign fields to config values

echo basalt
#

✨ components ✨

#

You'd have a "gun template" which defines basically its model, particles, color, max ammo

#

And then you'd have like an "ammo component" which defines how much ammo the weapon has

robust helm
#

and where do i store the ammo component?

echo basalt
#

PDC

robust helm
#

its always pdc 😔

echo basalt
#

Load and save from PDC, your in-memory stuff is basically just configurable values

#

better than tracking items by hand

young knoll
#

Back in my day!

echo basalt
#

NBTAPI 🤮

robust helm
young knoll
#

Depends how much variance you expect to have

robust helm
young knoll
#

Are there going to be 20 unique guns or 100000

robust helm
#

maybe 20 different guns

#

and many instances

echo basalt
#

by doing it with components you can add extra components specific to each gun

#

For example I had a flamethrower back in the day that had its own start, idle and stop sound

#

and that had to be tracked per gun because 2 ppl could use flamethrowers independently

#

You can also go wild with ammo and generic types, we had a grenade launcher where it shot a fuse

#

or a shotgun where it shot pellets

young knoll
#

What is this tf2

echo basalt
#

black ops 1

young knoll
#

Ah

#

So no jars of throwable piss

echo basalt
#

I don't share that kink

young knoll
#

It’s not a kink he just spends a lot of time waiting

#

-# Or maybe it’s a kink

robust helm
#

wait when i do the pdc thing, do i make the setter like
void setAmmo(ItemStack itemStack, int ammo)?

echo basalt
#

Eh I'd split it into its own class but realistically

#

you just edit the meta yeah

young knoll
#

I would pass meta at least

robust helm
#

so gun is completely immutable?

young knoll
#

So you don’t keep cloning it

robust helm
#

i see

#

woah its actually pretty doable

#

cuz i always have an itemstack instance where i need it

#

thanks guys and gn <3

sly topaz
#

ig it'd get collected before the item stops existing in the word, since item stack instances are not persistent

#

doing it all in the PDC is kind of annoying if you have to extrapolate the data for anything, since it requires the data being loaded into the word and having access to that inventory somehow

mortal vortex
#

Anyone know if Java can read PIDs from COM ports?

sly topaz
#

it uses FFMI so it is pretty modern

wet breach
mortal vortex
#

vow sexy

wet breach
#

technically there is no native solution in java which is fine, it really isn't that much less efficient to use JNI/JNA which is what anything you find lib wise will do

#

Sun microsystems did at one point had some kind of plan to bring native serial port into java, but it died. One day we might have it

spare hazel
#
if(event.getPlayer().getWorld().equals(SkyMine.getPlugin().getServer().getWorlds().get(0))) return;

is this a good way to distinguish the default world from the other worlds?

hybrid spoke
#

otherwise (based on the first google result) your way of doing it seems to be the correct way

spare hazel
#

so i should check by the world name?

drowsy helm
#

Pretty sure 0th index is always main world

hybrid spoke
drowsy helm
#

Also please use variables that code is an eyesore

spare hazel
#

alright

#

idk if its gonna flop or become a hit so im just tryna get it out asap, i will clean it later

wet breach
#

hence why comparing with strings is usually not the best

hybrid spoke
#

ah right

#

seems like i was inactive for too long in the spigot context

short pilot
#

For configs, what's the difference between creating the config using code, line by line, vs having the config.yml existing in the resources folder?

#

The latter just seems more convenient for me, and then reading values from there on startup/reload

chrome beacon
#

Personal preference

flint coyote
#

Line by line saves you the effort to diff the config once you add new entries to an existing config.
But there's libs that do exactly that for you for the resources folder approach as well

short pilot
#

Is there any event for when a happy ghast gets tamed/a harness equipped?

#

i've been coding a custom plugin for them

flint coyote
#

Well if the plugin was already loaded on a server, the config was copied from that plugin version. If you then change the resources/config.yml and update the plugin, it won't be copied again. So if you want to add the new entries, you'll have to find the changes between the two versions and add them programatically

#

Or you encourage the server owners to add them manually ofc

lilac dagger
#

do item frames always spawn opposite the wall ?

short pilot
#

i see

#

id never want the user to have to manually add; ill do a diff check

#

actually

#

wait yes the first option seems a lot more sensible now; youd never have to do a diff check ty for this knowledge

hybrid spoke
#

ah should probably ping @short pilot for this

#

not quite the resources/ approach, but it gets close

worn plinth
#

Hello i used ClientboundContainerSetSlotPacket on versions below 1.21.3 with random stateId like 999999 to send fake item to player (this item need to be fake, only to display as a cosmetic) and everything works, but when i tried to make it on 1.21.3 this item isn't appear in player's inventory, also console nothing throws, so maybe anyone know what can cause this problem.

chrome beacon
#

I wouldn't recommend using a random stateId

#

as that's used by the server and client to validate stuff

worn plinth
#

i also tried to use real stateId from player.containerMenu but still dont work

chrome beacon
#

Could you show us how you're sending the packet

worn plinth
#

okay that was insanely simple to solve, before i resigned from using SendEquipment packet because it was producing wear sound effect which i can't disable, now on this version it doesn't produce this sound effect.

robust helm
robust helm
#

or I use a WeakIdentityMap<ItemStack, GunData>?

lilac dagger
#

there's a weak identity map?

mortal hare
#

how much of your plugin's code do you guys unit test?

pseudo hazel
#

10%

#

I wrote a configuration thingy lately that I had written a few tests for

#

probably not really unit tests

#

but everything else just either works in full or is bugged and gets fixed

#

no point in unit testing when my unit is the plugin itself

ivory sleet
#

coverage of public methods

fickle spindle
#

hello i'm developing a game mode based on 2 worlds so i'm thinking about handling 2 diff chat for the game and one for the lobby. I want to make the join message only for the lobby players so i trough to do a for looping all the players in a world for send the message to them there is a more optimised way?
another stuff that i trough about is a list with all the players that updates when someone join / leave the world lobby thanks for your help

mortal hare
#

i personally never mock bukkit api calls, and instead externalize most of the logic outside bukkit api's scope so that i can properly unit test without touching minecraft related objects and types

lilac dagger
mortal hare
#

i do believe unit tests first off all test how much your code is modularized but at the same introduces bloat that you might not need in a first place (testing is good, i just dont like how code needs to be structured differently and in more bloated way to support it)

#

so its double edge sword for me

lilac dagger
#

i agree

mortal hare
#

i wonder though how do people in ts/js languages unit test their code

#

like how can you mock a function that's inside another function

#

if you dont mock it its not unit test if its from another module?

robust helm
echo basalt
#

I don't unit test

#

unit testing means I'm doubting my own abilities

sly topaz
#

it just makes life easier to be able to unit-test your logic. When it comes to something that depends on game behavior however I do not add mock tests for them, at that point it just feels pointless given the game can change at any rate

rough drift
thorn isle
buoyant viper
#

all or nothing baby

ivory sleet
#

And to some extent unit testing itself isn’t about testing literally every function, although naively speaking one may find themselves believing in that approach

sly topaz
ivory sleet
mint nova
#

Permissions added to player with PermissionAttachment are pernament?

young knoll
#

No

#

Lost on restart

ornate patio
#

is there an event for when a player shoots an arrow that lets me access the both the arrow entity and the shooter

#

and how do i get the owner from an AbstractArrow

#

im trying to write a plugin that undos the random change in 1.21.6 that removes ownership of an arrow when its owner logs off

ornate patio
#

nvm just found getShooter

tender shard
mortal vortex
#

Also you should use -r with read

#

To prevent escape characters being consnumed

tender shard
#

nobody besides root will ever be ablt to execute that anyway

#

and even if, it would just fail to do something and then exit because -e

#

I hate rust

#

one of my coworkers wrote some shit in rust and now I have to maintain it and I don't know rust and everything looks like this
&&self
<-- &self

trait trait &self whatever

#

if rust would support actual OOP (inhertiance or at least c++'s virtual funcs etc) it'd be great. Where's Rust++?

mortal vortex
#

How source code is lexxed equates to nothing in terms of runtime performance.

#

There is no valid reason for the syntax to be so shit

sly topaz
#

Eh, the issue with Rust for anyone coming from higher level languages is the fact that it feels high-level but actually isn't. Once one starts approaching it with mindfulness of what low-level primitives it tries to expose with all those symbols on its syntax, it isn't as bad as one's first impression might have started as

#

And I personally hate saying arguments which imply "someone's holding it wrong", but the case applies here. It is a language with a bunch of powerful features inherited from ML-family of languages, so it takes more getting used to than anybody jumping on a Rust project they've been dumped on has been prepared for

ivory sleet
mint nova
#

Sorry for late response but i was sleeping

hybrid spoke
vast ledge
echo basalt
#

don't load it in startup you're breaking the entire concept of a database

#

basically becomes a slow memory leak

#

just read whenever, cache it for a bit, save again

#

use futures

thorn isle
#

i remember someone here saying that there was an easy way in nms somewhere to get the i18n translated tooltip of an item? like with all the attribute modifier lines and such, without having to build it yourself

#

anybody have any recollection of where that is

slender elbow
#

n.m.w.i.ItemStack#getDisplayName() ?

mint nova
mint nova
#

PersistantDataContainer or smth like that?

mint nova
slender elbow
#

yet

#

one day you'll have to do that, there is no saying when

mint nova
#

you're right

left jay
#

hey so jitpack can't find my NMLAttributes github repo, even though i have it set to public. am i doing something wrong with my pom here?

chrome beacon
#

that's also the wrong way of setting the output directory

#

If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...

left jay
#

oh thanks

thorn isle
#

i specifically need the actual text it would render into, to put it on a text display entity

#

found it i think ItemStack::getTooltipLines

#

kind of looks like this might be used only on the client side

#

only usage i see in the server is it being exposed under bukkit Unsafe, which is quite nice; no nms needed for this after all

#

well, on paper

echo basalt
#

I just spent 6 hours debugging race conditions

#

turns out I was listening to PlayerJoinEvent on my quit listener

sly topaz
hardy sundial
#

anyone know a good Command library for 1.8 that supports async and annotations

sly topaz
#

ItemStack#computeTooltipLines or whatever it was called

sly topaz
cedar silo
#

Pls help me to copilition one plugin

hardy sundial
#

command run asynchronously so i can do stuff like database actions inside the command

sly topaz
#

The command won’t run asynchronously, but you can just spin a (virtual) thread for whatever you might need it

#

Though if you’re on 1.8, then you’re probably on java 8 as well. In which case BukkitScheduler#runTaskAsynchronously is probably better. That or CompletableFuture#supplyAsync

#

Anyhow, I believe most command frameworks support that version, I’d go with ACF or CommandAPI for 1.8

young knoll
#

I still don’t entirely understand virtual threads vs thread pool

hardy sundial
#

Thanks, yeah 1.8 is very old ACF doesnt support async CommandAPI is not for 1.8 and something Cloud their implementation seems incomplete

sly topaz
hardy sundial
#

sadly

sly topaz
#

Anything asynchronous you’ll have to do manually

hardy sundial
#

Ah I see thanks

sly topaz
#

But you could achieve the same making your own, just nice to have as a standardized API. Besides it plays nice with concepts like structured concurrency

trim quest
#

spigot is single-threaded(main event loop) right ? i assume that it is but it is offer async processing.

sly topaz
trim quest
#

just like javascripts main event loop

#

it is the old way to handle async processing, before parallel & concurrent programming. it is support interleaving operations

young knoll
#

Generally the async events have async in the name

sly topaz
#

I always forget they’re asynchronous at all given you can access and modify world data just fine there lol

hardy sundial
#

I may have found one its called LiteCommands supports 1.8 and old async 🙂

celest charm
#

Hi guys, is there a way to generate a World without water?

young knoll
#

You could go over every chunk after generation and remove the water

#

Not pretty but it’d work

#

The alternative is to make your own world generator

celest charm
#

I'm trying to make an UHC Plugin and generate ideal worlds to play on

thorn isle
#

there is probably a knob you can twist with a datapack to set the ocean level to 0 or -64 or something

young knoll
#

Is that part of the worldgen datapack?

#

That’d probably work then

thorn isle
#

i know the value isn't hardcoded, it's definitely data-driven from somewhere, and most data-driven things can be adjusted with a datapack

#

no clue what the property name is or how you'd go about changing it, though

celest charm
#

mh

thorn isle
celest charm
#

is there a library i can use to manipulate world generation easily? Like mineral veins more long, more lava and water pools etc.?

thorn isle
#

you can turn certain features off with the worldcreator api i think

#

but for proper control it's either nms or datapacks

#

or alternatively a custom world generator plugin that lets you adjust those options; i recall there being two or three fairly high profile world gen plugins out there, but no clue if they're still alive

left jay
#

't really help with github being blind as hell

celest charm
#

imma prolly look at some UHC plugin and see how they do it

trim quest
#

i mean you can write your own.

thorn isle
#

depending on what you want to do async, it might happen out of the box

celest charm
thorn isle
#

e.g. the async tab complete event is async

chrome beacon
thorn isle
#

he had some jitpack not finding something issue

hardy sundial
#

I dont wanna write my own

chrome beacon
#

Jitpack won't find the jar if you change the output dir

#

though I assume you fixed that since I warned about it earlier

#

Jitpack has the build log could you link it and the repo

left jay
# chrome beacon Jitpack has the build log could you link it and the repo
GitHub

Plugin for the attributes of the No Man's Land server - Somebodys-home/NMLAttributes

#

so like, what specifically about the output dir does jitpack look for

chrome beacon
#

You should have noticed this when you compiled locally

#

Make sure you're actually using maven and not artifacts

#

You seem to have to a replace all on plugin to nmlAttributes and broken the pom

left jay
#

oh damn youre so right

#

i havent looked at this pom in 5 months lmao

echo basalt
#

why can't I cancel VehicleMoveEvent

#

cancelling pushes from the wind charge effect has never been this convoluted ffs

#

I'm about to bytebuddy this shit

left jay
# chrome beacon yeah that pom isn't valid

ok i can't find answers anywhere else so i gotta ask
what did you mean when u said my output directory was a problem and how does jitpack even look for the jars anyways?

cedar flume
#

Hey!
Im wondering if anyone can tell me when did Enchantment.DURABILITY change to Enchantment.UNBREAKING ?
as in which MC/Spigot version?
wanting to keep my notes accurate 🙂

cedar flume
echo basalt
#

mm bytebuddy my beloved

#

having to use unsafe too

#

I love this

#

cool now I just need to hook this up to worldguard

potent crescent
#

ops. i thought this is

#

sorry

slender elbow
#

why are you using unsafe for instance fields 🤔

echo basalt
#

private final

#

on java 21

#

now I'm just wondering how I'll fire a bukkit event from this

#

and listen on my own plugin with a diff classloader

#

reflection maybe?

ornate patio
#

how do i loop through all entities in the server, loaded and unloaded

#
for (World world : Bukkit.getServer().getWorlds()) {
    for (Entity entity : world.getEntitiesByClass(AbstractArrow.class)) {

this only gets all loaded entities

drowsy helm
chrome beacon
#

Uh why

drowsy helm
#

this just sounds like an xy problem

chrome beacon
#

^^

ornate patio
chrome beacon
#

?xy

drowsy helm
#

?xy

#

got removed huh

ornate patio
#

i think i remember that tag actually

#

ik what u mean

#

lemme explain

slender elbow
drowsy helm
#

The XY problem is asking about your attempted solution rather than your actual problem.

ornate patio
#

minecraft 1.21.6 changed a super random feature where if a player shoots an arrow and logs out, the arrow will eventually lose its ownership attribute

#

it wasn't like this in 1.21.5

echo basalt
#

reflection giving me classloader issues rn

#

how do I do this hm

ornate patio
#

i'm trying to implement a fix for this by storing the shooter in the arrow's PDC, then whenever a player logs on it goes through all arrows and reapplies ownership to any unowned arrows

#

the arrows are useful for technical wireless redstone systems that track the player's look vector

chrome beacon
#

Reapply it when it's loaded

young knoll
echo basalt
#

how tf

ornate patio
#

i guess that works for my case specifically with my redstone contraptions since theres an ender pearl stasis chamber, but there are some other ones that require the arrows to keep ownership even in unloaded chunks

#

additionally though, Projectile#setShooter behaves unpredictably when the owner is offline

#

so i'd need to also check every loaded chunk whenever a player logs on

chrome beacon
echo basalt
#

yeah I'm honestly lost

chrome beacon
#

Also is this an issue on Vanilla

echo basalt
#

got my code running in the nms classloader and now I dunno how to run it back on the plugin class

slender elbow
#

why do you have code in the nms classloader lol

echo basalt
#

bytebuddy intercepting nms methods iirc it'd bug out without

#

at least it did when I fucked with FileConfiguration

slender elbow
#

well that's different

#

FileConfig lives in the same jar, and thus cl, as the rest of spigot, and the server

echo basalt
#

welp still breaks so

#

eh

#

still how tf do I call an event for this

#

unless I can access WE directly from the nms classloader >:)

slender elbow
#

i mean, plugins are separate cls

#

what are you trying to do anyway? why do you need bb

stiff harbor
#

Anyone have a good example of a falling block plugin?

echo basalt
#

I can't intercept ignoresExplosion on entities because bb doesn't redefine for subclasses

#

so I'm running advice on ServerExplosion's explode method and running a custom DamageCalculator that nullifies kb

#

KnockbackEvent doesn't fire, VehicleMoveEvent isn't cancellable

#

I'm not gonna teleport entities

#

or emulate enchants

slender elbow
#

knockback event doesn't fire?

echo basalt
#

nope

#

at least not for boats

slender elbow
#

i mean

#

knockback event is for living entities only, no?

#

yes

#

boats aren't among the living

echo basalt
#

the fuck can I do

#

customer's specifically using boats to test

young knoll
#

Kill them

#
  • For legal reasons that’s a joke
chrome beacon
echo basalt
#

seems to work let's pray I can fuck with WG here

#

no errors

#

I call this a victory

slender elbow
#

mojang making ServerExplosion a final class :despair:

echo basalt
#

:(

#

don't make me emulate the enchant

#

disable that shit entirely with registry hacks and make my own copypasta logic

wraith delta
#

Context; if you use 1.21 api then the plugin won’t work on 1.8

Question; if I add 1.8 api AND 1.21 can the plugin work on all versions but also be able to provide the latest content if available

#

Obviously you can’t have latest content in old versions but to make the plugin available on all versions…

vast ledge
#

If you use reflection it's fine

#

E.g. sign editing with colors codes, make a reflection class with the functions and on startup init either the class for 1.21 or 1.8

#

Tbh I like abstract classes more but I'll get stabbed if I say use abstract

wraith delta
#

Would be nice if ppl just used the latest version -.-

#

So much to offer

vast ledge
#

Yea, it would, but people are sadly people so that ain't gna happen

sly topaz
#

you have to put 1.21.7 as API version in your plugin.yml so it works on latest, but load the 1.8 classes reflectively

#

also make sure that shared logic doesn't import anything that doesn't exist in 1.8, i.e. abstract classes/methods which didn't exist in 1.8, as well as behavior changes such as the ones from the interact event

young knoll
#

Modules would be good here

#

Depending on how much differs between 1.8 and 1.21 for your plugin

misty ingot
#

i am using gradle and I need to access the API of a plugin whos jar i have (in libs folder)
i havent used gradle before so how would i go about doing this?

mortal vortex
#

So on your repositories, add:

repositories {
    flatDir {
        dirs 'libs'
    }
    .... // ur maven n shit
}
#

Then for your depends:

implementation(":foo:1.2.3")
misty ingot
#

that being
implementation(":<plugin_name>:<version>")
right

mortal vortex
#

but yes

misty ingot
#

bukkit:H4sIAAAAAAAA/0WMwQ7CIBAFnxIbQ2PsqR/....
what kind of item serialization is this?

grand flint
#

1.8 servers are dropping day by day

misty ingot
#

making a plugin for someone, this is what they are giving in the config

#

prolly should just ask them huh

misty ingot
#

doesnt look much like i would expect base64 to be

celest charm
#

Since when OSSRH went down, even on the Spigot repo, Gradle can't find this dependancy net.md-5:bungeecord-chat:1.8-SNAPSHOT

wet breach
celest charm
#

I don't want to locally import the Spigot dependancy everytime

wet breach
#

not like its going to change

celest charm
#

yeah

#

you right

sly topaz
#

this method spread like wildfire back in the bukkit days, it is how people used to serialize items back then

#

still kinda is today, you can use a bukkit object IO stream, I am not sure whether it retains or makes use of DFU in order to handle upgrades though

sly topaz
#

but I personally just setup a private github repository with a package if i deem it necessary

slender elbow
#

no dfu for u

thorn isle
#

leave it to bukkit to go "yea so the format the data is in is an impl detail, just idk convert it into base64 and store it in your config as a string or something"

tender jetty
#

Hello "The ONLY way to have your plugin correctly compile while including PALE_OAK materials (and all other latest 1.21 materials like newer copper and tuff variants) is to update your spigot-api-1.21.7-R0.1-SNAPSHOT.jar to a truly comprehensive and up-to-date build. You would need to use Spigot's BuildTools to generate the absolute latest 1.21.7 API JAR."

ai says pale oak isnt in 1.21.7 api, anytone else got this problem?

thorn isle
#

it says it is in 1.21.7 but not in anything lower

twin venture
#

hi so have been working on a system where when a lobby server start (it will first load cosmetics , kits from config files ) , only in lobby and after it get loaddded seccfully , it will send these kits , cosmetics .. etc into redis , further more when a game server start it will pull this data into local cache of that specfic server

is this a good aproch? i want to have the kits , cosmetics .. etc configurations only in lobby servers ..

and game servers will pull the data from redis ..

thorn isle
#

which is also wrong

#

it should be in 1.21.4 and anything higher, since the api version corresponds to the game version

#

if you have a particular error or an issue you're trying to solve, you can start by describing it

wet breach
#

its what I did in the past when I was doing a lot of moving around

#

this way it didn't really matter what system I had accessed to I can still do all my stuff regardless 🙂

#

but you can always setup a remote maven repo too and works just as good

tender jetty
thorn isle
#

how are you determining this

wet breach
#

its never wrong

tender jetty
#

// NEW UNIFIED SET FOR PLANK SOURCES
private static final Set<Material> ALL_PLANK_SOURCE_WOOD = EnumSet.of(
// All Logs (from your ALL_LOGS list)
Material.OAK_LOG, Material.SPRUCE_LOG, Material.BIRCH_LOG,
Material.JUNGLE_LOG, Material.ACACIA_LOG, Material.DARK_OAK_LOG,
Material.CRIMSON_STEM, Material.WARPED_STEM,
Material.STRIPPED_OAK_LOG, Material.STRIPPED_SPRUCE_LOG, Material.STRIPPED_BIRCH_LOG,
Material.STRIPPED_JUNGLE_LOG, Material.STRIPPED_ACACIA_LOG, Material.STRIPPED_DARK_OAK_LOG,
Material.STRIPPED_CRIMSON_STEM, Material.STRIPPED_WARPED_STEM,
Material.MANGROVE_LOG, Material.STRIPPED_MANGROVE_LOG,
Material.CHERRY_LOG, Material.STRIPPED_CHERRY_LOG,
Material.PALE_OAK_LOG, Material.STRIPPED_PALE_OAK_LOG, // NEW: PALE_OAK_LOG
// All Wood Blocks (from your ALL_WOOD_BLOCKS list)

wet breach
#

just ask it, and it bestows wisdom untu thee

tender jetty
#

Description Resource Path Location Type
PALE_OAK_PLANKS cannot be resolved or is not a field Starttutorial.java /starttutorial/src/main/java/starttutorial line 1562 Java Problem
PALE_OAK_LOG cannot be resolved or is not a field Starttutorial.java /starttutorial/src/main/java/starttutorial line 1575 Java Problem

#

im prob doin smthn

#

and dont know it

thorn isle
#

and what is this

tender jetty
#

my dope plugin for dope stuff

tender jetty
#

but i need all da blox

thorn isle
#

it definitely is defined in the API

tender jetty
#

dang wtf

wet breach
thorn isle
#

have you set your api-version in plugin.yml

tender jetty
#

yes

#

1.21.7

#

OHOHOHOHOH

#

WAI9T

#

wait

#

nehvertmind

thorn isle
#

it doesn't accept minor versions

#

needs to be 1.21

#

if your ide/build tool isn't finding it, it could be that you are including a lower version of bukkit as a transitive dependency with your build tool

#

what build tool are you using? print a dependency tree and see if something else is including older versions of bukkit

tender jetty
#

thats what i think i missed, about to try it

thorn isle
#

a common culprit is the worldedit/worldguard api, which include bukkit 1.13

tender jetty
#

eclipse

thorn isle
#

consider switching to a proper build tool like maven or gradle instead of building with the ide

tender jetty
#

cheers and thank you so much for your help 🙂

#

i still gots lotz 2 learn

thorn isle
#

oh yeah and consider using material tags instead of hardcoding a set of materials

#

that's what they're for

thorn isle
#

something something Tag.LOGS_THAT_BURN

#

or just logs

wet breach
#

its the best until you get some convoluted build script going on

#

XD

#

then its like, alright lets not touch it anymore less we break everything

tender jetty
#

yeah... too many legs thats why

tender jetty
wet breach
twin venture
#

or user data?

#

did you understand my point?

wet breach
#

anything. Redis is a caching mechanism mainly or memory DB. It is possible to have something happen and the data just not be present in redis

twin venture
#

i want it to be editable in lobby ladedd first from main lobby server , and then it will be pushed to all game servers

#

its important to have it only in lobby

#

as i don't want to have like config files for every server edited

thorn isle
#

as long as you get it to work it sounds like a sensible approach

twin venture
#

btw iam using lettuce rn its like a better ver of redis

thorn isle
#

what's the lifecycle/lifespan of the game servers

twin venture
wet breach
#

Thats fine, my question was more geared to though what is the backup plan if redis doesn't contain the data though? The DB should have it and generally it isn't just going to be missing from there assuming its setup properly

thorn isle
#

i probably wouldn't worry about using redis as a keystore or a cache or anything and just use its messaging system to send over the data on game server startup, and keep it in the game server's memory until the game is complete and it restarts, since you probably don't want to be changing your game properties while a game is running

wet breach
#

and how would you know that data is missing from redis o.O

twin venture
#

it will loaod the data to game servers once the game server restart (start)

thorn isle
#

for this something more intended for messaging might be better, like rabbitmq

#

but redis does have some basic messaging functionality as well and should get the job done

twin venture
#

what is better for perfoormance? / easy to manage?

wet breach
#

I suppose I just fail to see the advantage here

#

not saying using redis is wrong btw

#

you can absolutely use it

thorn isle
#

i think a messaging system is probably easier since it doesn't come with the extra baggage of a keystore

twin venture
#

you mean rabbitmq?

thorn isle
#

the easiest and most maintainable way would probably still just be a database, though

wet breach
#

is there multiple lobbies?

twin venture
thorn isle
#

like just have the lobby update a mysql database on startup/config reload/whatever, and have the game servers read the data from the database into memory when they start up

thorn isle
#

you don't need redis or messaging for this

twin venture
#

and it will load it into memory (local cache of that game server)

thorn isle
#

just plain old mysql will do

twin venture
#

??

twin venture
wet breach
twin venture
#

i like mysql but i want to have it simple for end user

wet breach
#

you can?

#

the end user doesn't need to mess with the tables or anything

#

you can just have java set all that up for them

thorn isle
#

redis isn't really any simpler to set up than mysql

#

if anything mysql is easier because it's still the more established solution

twin venture
#

this is the current cosmetics.yml file :

eternal night
#

aren't both just a docker container to be spun up somewhere

wet breach
#

also, mysql also has memory only DB albeit it is used differently then redis but operates basically the same

thorn isle
#

e.g. lots of shared hosting services come with free mysql servers set up on the side, very few come with the same for redis

#

and probably exactly none for fringe shit like rabbitmq

#

if you want to make it 100% hands-free for the end user, you could use plugin messaging to send over the config through the actual network connection between the lobby and the backend, without any sql/redis/message queue server setup

#

but that is 🤡

twin venture
#

the one on the right is the lobby server :
one on the left is game server

thorn isle
#

plugin messaging does have the downside that it requires a player to connect to the backend before anything can be sent, but since it's a minigame backend that spins up for players, that shouldn't be a big problem

#

still my recommendation would be a sql database

twin venture
#

thanks

wet breach
#

there is a better way if you are going to have multiple lobbies

thorn isle
#

web config ui 🤡

lilac dagger
#

i use sockets for my communication between servers

wet breach
#

ideally in a multiple lobby multiple minigame server setup assuming the minigames are not all different is to have the lobbies and minigame servers together. So, for example. if you have 10 lobbies, each lobby server can manage 10-20 minigames(they are just separate worlds and don't necesssarily need to be on a separate physical server from the lobby). In this scenario we only need to have the lobby pull the data and just keep it in memory and then when the minigame worlds just get created/destroyed and they use said info already in memory.

lilac dagger
#

it's pretty cool

#

my system allows seemless transition to any number of games on each server from the lobby

wet breach
lilac dagger
#

java sockets

#

most likely sockets of whatever java extends from

wet breach
lilac dagger
#

yep

wet breach
#

makes sense

thorn isle
#

use jni bindings between YamlConfiguration and a native implementation in C and allocate shared virtual memory so every backend's config is actually backed by the same physical memory

lilac dagger
#

it's really efficient vs the 1 game per server method

wet breach
#

and save the trouble with JNI

thorn isle
#

probably doable these days with MemorySegment as well

#

although for sharing memory between processes i think you still do need jni and C, java memory segments/unsafe mmap only acts in the process's own virtual address space and won't be shared with other processes

wet breach
#

memory mapping is handled by the OS

#

while technically you can have 2 memory mappings that are separate, you could also just have a single one in memory as well

paper viper
#

You could use the FFR API too

wet breach
#

but they all map to the same resource and you can communicate between all applications on the system so its not inherently restricted to just the JVM either

paper viper
#

I’m going to be honest I dislike JNI because of the stupid method names lmao

#

I’d rather use JNA

#

Which is slower yes

thorn isle
#

i actually am not sure how foreign function/memory access is implemented under the hood

paper viper
#

It’s faster than JNI for recent benchmarks

#

It only really recently surpassed

wet breach
paper viper
#

But honestly even the FFR API itself can be very annoying to work with for big libraries

#

It’s just doesn’t translate well

#

When I look at JNA code, the method names, types, returns, and everything lines up well

wet breach
#

basically FFR is the advanced version of memory mapping

#

where you are given more direct access to memory outside of the JVM

#

where as memory mapping is more indirect

thorn isle
#

i should probably look into it one of these days, can't really think of anything sensible to use it for off the top of my head, though

wet breach
#

lol

#

its always funny like that with new api's sometimes

#

when finally something comes to the language its like, well now I don't know why I want it now

lilac dagger
#

i never needed access to direct memory

misty ingot
#

how can i check if an item is glowing?

echo basalt
#

Check for EnchantmentGlintOverride or if it has enchants?

#

Any idea how I can disable the "durability" text in 1.21.4? hide_additional_tooltip does nothing

thorn isle
#

i think at that point in time it was already under its own component

#

although in between mojang changing the way how it works for 3 versions in a row and spigot and paper representing each of those changes differently in the api, i have no idea anymore

eternal night
#

Presumably the hidden component component needs to include durability

smoky anchor
eternal night
#

Oh

#

But who cares about that

pseudo hazel
#

its client side for sure

#

basically anything that appears with f3+h cant be hidden

slender elbow
#

yeah on that version the only thing that will hide it is, well, hide_tooltip

#

which is just going with the nuclear option

#

unless you want to tell the client the item is never damaged, but then that does not display the durability bar

stiff harbor
#

Anyone know where to change in the config files to hide score from scoreboard? Im using score to order the text on the screen but I want to hide the red text on the rightside (the score)

worldly ice
#

i believe it's a property on the objective itself

#

not sure if you can modify it with the api tho

echo basalt
#

heheha

slender elbow
#

tbf that's sort of the point lol

#

not exactly for that but yeah

thorn isle
#

i've seen something similar done