#help-development
1 messages · Page 1288 of 1
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.
On spigot too?
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.
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())
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
I just changed but not sure i did correctly
dont want to inject my main here
ok
i found better way
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
looks good
Today I was stupid and changed the JDK for a few modules in the editor.
now i dont know how to fix it
huh why is it loading the 1.21 R4 on 1.10.2
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
yeah that's fine just set the source/target/release of the maven compiler plugin
and tell it to compile to java 1.8
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 ?
Yes
but i support 1.10+
There is no api version before 1.13
api-version didn't exist before 1.13, so the lowest it can be is 1.13
So the server will just ignore it anyway
before that it did not matter
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
look how stupid i am
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
Texture back to remove a specific colour of bossbar and then use that
Or shaders that only target the top bossbar
how can i add minimessage support to my plugin
chat, does this look like a violation of record design
Your intellij has a rather peculiar design I must say...
thats just how intellij looks???
Why is it written Hannah
K
have u never opened a project that is part of a git repo?
or well actually maybe u just turned off inlay hints idk
No I only make things myself
Mine is broken
F
😭
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
@buoyant viper vro i would not take ts
What theme is this
default im pretty sure
I'm tripping
You sound like you havent updated intellij since its release
Probably
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
I'm lazy
It even has an auto updater wdym xd
Doesn’t it just have a built in updater too
Ah
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)
how do we register enchantments these days?
ideally with datapacks but plugins load too late for adding those with code
but reflection is still an option
or you could use paper api for that
how does that help with spigot?
with spigot, it does not, but it's still an option to consider
?
I cant upgrade the wooden sword to iron, stone etc also tools (bw1058)
what
schwein
does anyone know how i can return list of all enchantments for tabcompleter? without using any deprecated methods
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Registry.html#ENCHANTMENT
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/registry/RegistryAware.html#getKeyOrNull()
declaration: package: org.bukkit.registry, interface: RegistryAware
declaration: package: org.bukkit, interface: Registry
found that but tbh i still dont know lol
Easiest way would just be a simple loop
hi so , iam back i guesss to programming ..
i was thinking about is thre something better in 2025 better than fawe / world edit?
Loop over each enhancement and add the toString of its key to a list
eaiser to handle , and faster to set blocks?
the thing is i don't want to use dependancy ..
(And jankiness)
i try not too ..
its a cage for skywars plugin so i dont really need the whole fawe api ..
or plugin
A cage is just a hollow box
Easy enough to do with nested loops
Or the NBT structure system
yeah but what about custom blocks? like for defult cage is glaass
what exactly is the question?
is there better alterntiave to fawae , im trying to make a caage system for skywwrs ..
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
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
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
why its limited?
What if I want my cage to have multiple blocks for the top
Or a trim made of stairs on the top
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
you can set the order manually now? back in my day we had to fuck with teams and invisible prefixes
i guess
server version? client versions?
paper 1.21.6, client: 1.21.1
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
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
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
i still do the teams to order
it just complicates things for no reason
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 ..
does it throw an error at runtime?
it is probably adventure just not supporting those in the bukkit-platform
no error :/
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 :/
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
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
the default max damage is stored in the components
item meta reads from components
in the components of the prototype, yes
fortunately ItemMeta a highly flexible system that is very similar to the system adopted by vanilla
which should be able to read from default components
ItemMeta works exclusively on the patch layer
not the resulting component map
stupid af
yeah why the hell
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
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
at what point do you have an IM without an IS anyway
when im working with a plugin that I didnt make that does that a lot
🫡
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
they do
i.e. itemmeta represents the patch and material/itemtype/whatever the prototype
then you can just toss a ternary at it
and if I dont have the itemstack
then you have to rewrite things to have the itemstack, or pass Material as well
🤦♂️ ** **
again i kind of recommend abandoning itemmeta altogether
why
"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
i guess what he's asking is more like "why is it like this"
If itemmeta is pulling from components at all why isn't it pulling from the actual map, insteadof the changemap
it definitely is unintuitive for itemmeta to not have any way to get the prototype components
I don't know the exact reason, but I assume since ItemMeta is seen as a snapshot, the changemap would be the equivalent representation
How?
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
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
I was gonna say
thank you!
when it comes to non-component items, it is a snapshot but when it comes to components it is a patch
I guess Id just disagree on this
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
I don't believe it is that bad of a decision, all things considered
unfortunately what we had was never good and is only getting farther apart from how things work under the hood
it overcomplicates using components
I assume md made it that way to simplify the implementation
how
ItemMeta was not designed for components
it looks like this because it looked like this a decade ago
despair
anyways, Ill just cope, but this is really dumb lol
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
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
Yea
data component in paper isn't really an API
it is just a 1 to 1 mapping of internals
but for bukkit api projects it's fine to use the components api too, it's tolerable
so the thing is just there for access, fair enough
the power/flexibility of nms without having to set up paper-userdev or remapping or whatever, basically
I don't dislike the idea, however it is a big jump from ItemMeta, given they more or less achieve the same things
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
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
There are plans to replace ItemMeta but yea
it isn't even really tech debt at this point, it's more like "we can't break the 1.8 plugins" debt
we should've just adopted multi-release jars at the time
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
dynamically loading code depending on the version was never a good pattern, but we all just feed into it
Works better on a site like modrinth
That supports filtering downloads by version and whatnot
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
Yes hello I download latest version and it no work on 1.8???!?
I downloaded packetevents, but it says I need protocollib? Can you fix?
It’s not like dynamically loading code based on version is that difficult
Just a little bit janky
it is increasingly difficult with the api-version shenanigans
and besides, it is just not a good pattern
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
I'll just convert to a datapack developer™
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
that's the only place I can exercise clean code
it turned out that itemstack::gettype was returning AIR for the trident, so the plugin considered the slot empty
imagine just how many valuable tridents you destroyed
What’s wrong with Inventory#addItem
i think i wanted to make sure everything fits before adding any items
muh atomic shop transactions
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"
I assume it was the legacy material support being funny
most likely
I am really glad we're past supporting those versions, with the exception of 1.8
See this is what happens when you can’t see into the future
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
Should have added an api version to the plugin back when you made it
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
why does discord make my life miserable, I want whatsapp stickers for free and not have to pay nitro
I was indeed
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
why tf does it download everything from everywhee
that's just how it is
I'm looking for a developer to work on a new survival season. ( free )
if you want free use chatgpt
It tries to look everywhere obv
I can work for free, as long as you dedicate your server network to my name, and I want a giant 48×48×128 statue of me in your spawn.
etercraft will be dope
sounds like a good deal
A giant player statue at spawn would go kinda hard
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
It’s 16
lame
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
declaration: package: org.bukkit.event.entity, class: EntityDamageByEntityEvent
Criticals are between entities
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
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"); }}}```
can't you infer that from the damage source? seems like no
where in your code are you instantiating this
also, I got to ask, is this some form of lag prevention mechanism? Because clearing items doesn't really help with lag
public static void main(String[] args)
spigot already has an item expiration feature, you can configure it in the spigot.yml iirc
It's intended to be, however this is also my first time making a plugin for Minecraft so it's for learning purposes too.
plugins aren't standalone programs, you have to make your main class extend JavaPlugin and execute it inside onEnable instead of main(args), which is for standalone execution
Oh! I had no idea, guess I dove a bit too deep for my first project lol. Thank you btw 😃
Also the game already handles item despawning. Adding another timer won't really help performance
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?
No, it holds a weak reference to the actual object, but you can't customize the equality comparison.
Make an ItemStack Wrapper
i meant that it deletes the value of the hashmap when weakreference is collected
i can just extend ItemStack right?
No
why not?
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
You could just store the entire command in the pdc
Anyway, you’ll never get your custom Itemstack back when doing stuff like Inventory#getItem
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
The cast will fail
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
Then make a wrapper for it
a wrapper for pdcs?
well yea, thats what im trying ig
Yeah something like
PDCWrapper wrapper = new PDCWrapper(meta.getPersistentDataContainer)
String myString = wrapper.getString(namespacedKey)
@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
so how do i delete my mapped object when the item is collected then?
You don’t
Every unique gun has a registry entry
Just like how every unique minecraft item has a registry entry
eh
so i use one Gun instance for all the items?
Alternatively you can store various stats about the gun in the pdc itself
what attribute system=
nop
naww
More like loss
😔
I’d just make a custom pdc type that handles converting everything you need
jokes on me most of the logic links to entities anyways
string pdc type wrapper using gson maybe :)
Pull the raw stats directly from the item, and lookup things like SpreadModel from a registry
Developers when they have to write actual code
money add then multiply
doesnt sound too bad but i feel like the code would be spreaded out a lot then
you don't want tightly coupled code
I mean most of it would just be in the custom type
^^ aka your codec
well for registering
making a codec also allows you to have uh
data versions and stuff
you can update the config and the item magically updates
yeah I dunno why I'm trying to suggest
is there any real issue to this?
clearly ignorant dev just tryna get paid and move on
I do enjoy being able to just assign fields to config values
I'm thinking
✨ 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
and where do i store the ammo component?
PDC
its always pdc 😔
Load and save from PDC, your in-memory stuff is basically just configurable values
better than tracking items by hand
Back in my day!
NBTAPI 🤮
maybe i do that or whatever I think you meant by that
Depends how much variance you expect to have
okay yea that might just be this then
Are there going to be 20 unique guns or 100000
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
What is this tf2
black ops 1
I don't share that kink
Meet the Sniper, one of nine playable character classes in Team Fortress 2.
Name: Sniper
Role: Support
Weapons: Sniper Rifle / SMG / Kukri
In his former life as a tracker of dangerous game in the unforgiving Australian outback, the Sniper would spend months by himself. Prolonged isolation taught him a valuable lesson: You don't have to r...
It’s not a kink he just spends a lot of time waiting
-# Or maybe it’s a kink
wait when i do the pdc thing, do i make the setter like
void setAmmo(ItemStack itemStack, int ammo)?
I would pass meta at least
so gun is completely immutable?
So you don’t keep cloning it
i see
woah its actually pretty doable
cuz i always have an itemstack instance where i need it
thanks guys and gn <3
for the record, you could've just used a WeakHashMap<ItemStack, GunData>, but if the PDC thing works for you then better
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
Anyone know if Java can read PIDs from COM ports?
use JavDoesUSB library
it uses FFMI so it is pretty modern
vow sexy
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
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?
isn't the default world always "world"? and if not, isn't there a way to get the default world by the config of the server f.e.?
otherwise (based on the first google result) your way of doing it seems to be the correct way
so i should check by the world name?
Pretty sure 0th index is always main world
i was just brainstorming loudly
Also please use variables that code is an eyesore
alright
idk if its gonna flop or become a hit so im just tryna get it out asap, i will clean it later
the name of the world can be changed
hence why comparing with strings is usually not the best
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
Personal preference
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
Is there any event for when a happy ghast gets tamed/a harness equipped?
i've been coding a custom plugin for them
wdym by diff the config?
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
do item frames always spawn opposite the wall ?
oh fr???
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
https://github.com/bsommerfeld/jshepherd handles that pretty well with built in auto-migration
ah should probably ping @short pilot for this
not quite the resources/ approach, but it gets close
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.
I wouldn't recommend using a random stateId
as that's used by the server and client to validate stuff
i also tried to use real stateId from player.containerMenu but still dont work
Could you show us how you're sending the packet
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.
it would probably break when any field is changed right? like when the item looses durability
or I use a WeakIdentityMap<ItemStack, GunData>?
there's a weak identity map?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerInteractEntityEvent.html check the item held and the entity type
declaration: package: org.bukkit.event.player, class: PlayerInteractEntityEvent
how much of your plugin's code do you guys unit test?
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
67%
coverage of public methods
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
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
i don't use unit tests tho i wanted to at some point
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
i agree
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?
not without external dependencies
this is also what I do for the most part
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
I don't evne test, straight to prod it goes
this is how it is implemented internally; each world maintains a list of players that they're added to when they enter that world and removed from when they leave it
Yea, I do think though, there is a certain value in unit testing by “mocking” Bukkit objects, especially if you try to prove why your implementation doesn’t work incorrectly (double negation in a non exhaustive logical reasoning), since mock bukkit not only mocks ur objects, but also emulates certain events and invariants etc
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
100% coverage or no coverage is the way, I won't hear anything else!!!

Permissions added to player with PermissionAttachment are pernament?
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
nvm just found getShooter
https://pastebin.com/AtNL7LnQ roast my proxmox-backup-client deployment bash script
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Do a root check on startup:
if [[ $EUID -ne 0 ]]; then
... < some output idk
exit 1
fi
Also you should use -r with read
To prevent escape characters being consnumed
not needed
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++?
Rust just feels elitist at the very core.
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
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
i mean yea and its eco system isn't as developed- merely imo though (which is another noticeable issue itself)
So where i can storage it
Sorry for late response but i was sleeping
in a file, in a db or (not adviced) in PDC
Save it in a DB and load it in startup or smth
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
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
n.m.w.i.ItemStack#getDisplayName() ?
so like create a file for all the players (when they join), or just one file?
PDC?
PersistantDataContainer or smth like that?
im not that advanced
you're right
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?
You have the output directory set
that's also the wrong way of setting the output directory
Refer to this https://blog.jeff-media.com/how-to-make-maven-automatically-put-your-plugins-jar-into-your-test-servers-plugins-folder/
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...
oh thanks
this creates a component with a hover event holding the item data, but it looks like the data is parsed on the client into text, and there doesn't seem to be a way to get it on the serverside
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
I just spent 6 hours debugging race conditions
turns out I was listening to PlayerJoinEvent on my quit listener

If you’re gonna do it on paper then they got an API method for it
anyone know a good Command library for 1.8 that supports async and annotations
ItemStack#computeTooltipLines or whatever it was called
What does support asynchrony mean
Pls help me to copilition one plugin
command run asynchronously so i can do stuff like database actions inside the command
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
I still don’t entirely understand virtual threads vs thread pool
Thanks, yeah 1.8 is very old ACF doesnt support async CommandAPI is not for 1.8 and something Cloud their implementation seems incomplete
There was just no asynchronous completions/commands back then
sadly
Anything asynchronous you’ll have to do manually
Ah I see thanks
It is just a forkjoin thread pool with a light wrapper around threads to make them lighter for context switching and what not
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
spigot is single-threaded(main event loop) right ? i assume that it is but it is offer async processing.
Harder to say it is the case nowadays, since Minecraft has moved quite a few of the logic off main. But yes, it is primarily single-threaded for what’s worth
just like javascripts main event loop
it is the old way to handle async processing, before parallel & concurrent programming. it is support interleaving operations
Generally the async events have async in the name
I always forget they’re asynchronous at all given you can access and modify world data just fine there lol
I may have found one its called LiteCommands supports 1.8 and old async 🙂
Hi guys, is there a way to generate a World without water?
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
I'm trying to make an UHC Plugin and generate ideal worlds to play on
there is probably a knob you can twist with a datapack to set the ocean level to 0 or -64 or something
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
mh
i'm pretty sure they have some low-level optimizations specifically relating to blocking io that makes them more efficient than what you could achieve on your own, at least without like jni or something
is there a library i can use to manipulate world generation easily? Like mineral veins more long, more lava and water pools etc.?
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
ok so again, thanks for the advice, but that didn
't really help with github being blind as hell
imma prolly look at some UHC plugin and see how they do it
bro you can provide async without library
i mean you can write your own.
depending on what you want to do async, it might happen out of the box
saw one using WorldEdit
e.g. the async tab complete event is async
blind?
he had some jitpack not finding something issue
I dont wanna write my own
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
oh thats what you ment by the output dir i did not know that
https://jitpack.io/#Somebodys-home/NMLAttributes
https://github.com/Somebodys-home/NMLAttributes
so like, what specifically about the output dir does jitpack look for
yeah that pom isn't valid
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
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
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?
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 🙂
1.20.5
ty
mm bytebuddy my beloved
having to use unsafe too
I love this
cool now I just need to hook this up to worldguard
This sounds like a #help-server issue
why are you using unsafe for instance fields 🤔
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?
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
you'd have to go through every single chunk
Uh why
this just sounds like an xy problem
^^
wdym
?xy
unless you are working with JPMS modules, reflection will work just fine
The XY problem is asking about your attempted solution rather than your actual problem.
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
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
Reapply it when it's loaded
No @undone axle has fallen and can’t get up
how tf
using ChunkLoadEvent?
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
There's another event for entities
yeah I'm honestly lost
Also is this an issue on Vanilla
got my code running in the nms classloader and now I dunno how to run it back on the plugin class
why do you have code in the nms classloader lol
bytebuddy intercepting nms methods iirc it'd bug out without
at least it did when I fucked with FileConfiguration
yaeh
well that's different
FileConfig lives in the same jar, and thus cl, as the rest of spigot, and the server
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 >:)
i mean, plugins are separate cls
what are you trying to do anyway? why do you need bb
Anyone have a good example of a falling block plugin?
fucking with server explosions because there's no good way to cancel windburst knockback
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
knockback event doesn't fire?
i mean
knockback event is for living entities only, no?
yes
boats aren't among the living
Fall block plugin?
mojang making ServerExplosion a final class :despair:
:(
don't make me emulate the enchant
disable that shit entirely with registry hacks and make my own copypasta logic
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…
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
Yea, it would, but people are sadly people so that ain't gna happen
yes, but only because it is a version older than api-version property (aka before 1.13)
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
Modules would be good here
Depending on how much differs between 1.8 and 1.21 for your plugin
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?
having a dedicated libs folder makes it seem like you might have more than one? If thats the case, use flatDir
So on your repositories, add:
repositories {
flatDir {
dirs 'libs'
}
.... // ur maven n shit
}
Then for your depends:
implementation(":foo:1.2.3")
that being
implementation(":<plugin_name>:<version>")
right
no .jar
but yes
bukkit:H4sIAAAAAAAA/0WMwQ7CIBAFnxIbQ2PsqR/....
what kind of item serialization is this?
it is
1.8 servers are dropping day by day
From where
making a plugin for someone, this is what they are giving in the config
prolly should just ask them huh
base64 probably
doesnt look much like i would expect base64 to be
Since when OSSRH went down, even on the Spigot repo, Gradle can't find this dependancy net.md-5:bungeecord-chat:1.8-SNAPSHOT
seems sonatype only has as far back as 1.16
damn, so what repo should I use?
I don't want to locally import the Spigot dependancy everytime
might have to. not sure why this would be a problem?
not like its going to change
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
tbf I also hate doing that given I switch workspaces a lot
but I personally just setup a private github repository with a package if i deem it necessary
no dfu for u
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"
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?
it says it is in 1.21.7 but not in anything lower
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 ..
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
why not use a server for your workspace instead?
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
Basically, as far as spigot 1.21.7 is concerned, pale oak does not exist in the game
how are you determining this
// 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)
just ask it, and it bestows wisdom untu thee
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
and what is this
my dope plugin for dope stuff
but i need all da blox
it definitely is defined in the API
dang wtf
shhh, the AI says it doesn't exist
have you set your api-version in plugin.yml
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
thats what i think i missed, about to try it
a common culprit is the worldedit/worldguard api, which include bukkit 1.13
eclipse
consider switching to a proper build tool like maven or gradle instead of building with the ide
using maven, and i think i should stop spending 2 days awake at a time because the brain forgets the little details...
cheers and thank you so much for your help 🙂
i still gots lotz 2 learn
oh yeah and consider using material tags instead of hardcoding a set of materials
that's what they're for
Okay
the ant build
best tool
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
. 🙂
yeah... too many legs thats why
yep tagz r OP ty
what happens if the data is missing from redis?
do you mean cosmetics , kits data?
or user data?
did you understand my point?
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
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
as long as you get it to work it sounds like a sensible approach
btw iam using lettuce rn its like a better ver of redis
what's the lifecycle/lifespan of the game servers
game serer start , player's join , finish game , server restart
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
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
and how would you know that data is missing from redis o.O
ofc
it will loaod the data to game servers once the game server restart (start)
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
what is better for perfoormance? / easy to manage?
I suppose I just fail to see the advantage here
not saying using redis is wrong btw
you can absolutely use it
i think a messaging system is probably easier since it doesn't come with the extra baggage of a keystore
you mean rabbitmq?
the easiest and most maintainable way would probably still just be a database, though
is there multiple lobbies?
i assume there will be , in this case it will fail xDD
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
exactly
you don't need redis or messaging for this
and it will load it into memory (local cache of that game server)
just plain old mysql will do
??
naah
this is what I was thinking, thus where does redis come into all this? lol
i like mysql but i want to have it simple for end user
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
redis isn't really any simpler to set up than mysql
if anything mysql is easier because it's still the more established solution
this is the current cosmetics.yml file :
aren't both just a docker container to be spun up somewhere
also, mysql also has memory only DB albeit it is used differently then redis but operates basically the same
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 🤡
the one on the right is the lobby server :
one on the left is game server
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
naah i would not do the plugin messaging , i will consider do the sql database
thanks
there is a better way if you are going to have multiple lobbies
web config ui 🤡
yeah?
i use sockets for my communication between servers
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.
it's pretty cool
my system allows seemless transition to any number of games on each server from the lobby
unix sockets?
oh TCP socket
yep
makes sense
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
it's really efficient vs the 1 game per server method
you could just do memory mapping
and save the trouble with JNI
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
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
You could use the FFR API too
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
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
i actually am not sure how foreign function/memory access is implemented under the hood
it brings the native solutions you suggested into the JVM itself
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
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
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
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
i never needed access to direct memory
how can i check if an item is glowing?
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
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
Presumably the hidden component component needs to include durability
F3 + H
I think that is client side tho
not on 1.21.4 :) :(
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
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)
i believe it's a property on the objective itself
not sure if you can modify it with the api tho
watch me use the new custom model data stuff to render the durability bar
heheha
i've seen something similar done