#help-development
1 messages · Page 1014 of 1
yea, my dumb ass couldn't find puppetMob.getTarget(); sorry 😛
And this happened to me before, but then the packets were sent without compression
But now I do compress them
So no idea what's going on
So basically you do everything the channel handlers would do so that you can write it directly
if a command executed from a player gives a Player commandsender, and the console gives a ConsoleCommandSender, then what does a command block give?
Funnily enough, BlockCommandSender
Damn this is the best question with the best response
lmao
sad, couldve been CommandBlockCommandSender
how to detect block getting powered by another block
declaration: package: org.bukkit.event.block, class: BlockRedstoneEvent
but that doesnt get called when a block like for example grass block is powered, only gets called when a redstone activate-able block gets activated
edit: BlockPhysicsEvent is the closest thing I can get to what I want to achieve
pls help spigot1.20.6 why does not it work import org.bukkit.Material;
How are you depending on Spigot @sterile sapphire @fervent void
huh?
This works in spigot 1.16.5
import org.bukkit.Material;
ItemStack gameSelector = new ItemStack(Material.CHEST);
ItemMeta gameSelectorMeta = gameSelector.getItemMeta();
gameSelectorMeta.setDisplayName("§aGame Selector");
gameSelector.setItemMeta(gameSelectorMeta);
why not in spigot 1.20.6
Wanna explain what didnt work?
Material in the item slot is displayed in red and when I try to import it it doesn't exist
is your intellij outdated....
nop
does anyone know why this doesn't work?
as of: the player that gets a packet compressed with this disconnects with DataFormatException
I make sure to write it directly
Was about to ?notworking you
so that it's not handled by any channel handlers
So why are you making it hard for yourself by directly working with the channels that way
this is the server src
I need to send a lot of packets
don't question it
I've already made up my mind
ok
im trying to do shadow relocation, bc its good, apparently, it avoids conflicts and stuff, and im getting weird errors like NoClassDefFound on classes that definitely are inside the fat jar, checked with jar -tf, but they only happen sometimes, not always. anyways, im getting errors every time a relocated class is used (i guess). for example:
java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
$ jar -tf build/libs/MispleaseEconomy-0.1.0-SNAPSHOT.jar | grep Intrinsics
io/github/misdocumeno/mispleaseeconomy/relocated/kotlin/jvm/internal/Intrinsics.class
more stuff...
i tried using a coroutine tho and it does works, apparently
runBlocking {
println("hello from coroutine")
}
so idk what could be the problem, i dont even know if im doing the relocation properly. this is the build.gradle.kts file
https://pastes.dev/izWbsWxlPZ
bc its an implementation? idk, should i?
should i remove org.jetbrains.kotlin too from the relocate thing?
dunno, i only know you need the kotlin runtime included at runtime
yea, and thats implementation(kotlin("stdlib"))
which its groupid is kotlin, isnt it?
btw someone said to use the "bukkit's kotlin library loader", but i didnt find anything online about that. i also remember someone saying to use another shadow plugin, bc the one im using will stop being supported soon or something like that
Libraries is a feature in plugin.yml
There should be some documentation on the wiki for it
Sigh
but what does it do, i dont get it https://www.spigotmc.org/wiki/plugin-yml/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
it reuses the same library for multiple plugins somehow if it can?
Yes
It loads the libs into the plugins classpath
mmm
It downloads and caches the library from central and then injects it into the plugins classloader
then, i change implementation(kotlin("stdlib")) to compileOnly(kotlin("stdlib")), add the groupid + artifactid + version of kotlin stdlib to plugin.yml
and thats it
?
cool, i guess i should add the serialization and exposed libraries too, right?
You can if you want to
ok, so after doing that, i dont have to relocate kotlin and org.jetbrains.kotlin, right?
Anyone can help me? I can't import the plugins file java in the plugins folder mc server
but i still have problems with exposed
java.util.ServiceConfigurationError: org.jetbrains.exposed.sql.DatabaseConnectionAutoRegistration: Provider org.jetbrains.exposed.jdbc.ExposedConnectionImpl not found
at java.util.ServiceLoader.fail(ServiceLoader.java:593) ~[?:?]
at java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1219) ~[?:?]
at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228) ~[?:?]
at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) ~[?:?]
at java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) ~[?:?]
at java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) ~[?:?]
at io.github.misdocumeno.mispleaseeconomy.relocated.kotlin.collections.CollectionsKt___CollectionsKt.firstOrNull(_Collections.kt:277) ~[MispleaseEconomy-0.1.0-SNAPSHOT.jar:?]
at org.jetbrains.exposed.sql.Database.<clinit>(Database.kt:111) ~[MispleaseEconomy-0.1.0-SNAPSHOT.jar:?]
at io.github.misdocumeno.mispleaseeconomy.database.Database.init(Database.kt:20) ~[MispleaseEconomy-0.1.0-SNAPSHOT.jar:?]
at io.github.misdocumeno.mispleaseeconomy.MispleaseEconomy.onEnable(MispleaseEconomy.kt:58) ~[MispleaseEconomy-0.1.0-SNAPSHOT.jar:?]
Database.kt
fun init(dataFolder: File) {
economyDb = Database.connect("jdbc:sqlite:${File(dataFolder, "economy.db")}", driver = "org.sqlite.JDBC") // this is line 20
transaction(economyDb) {
SchemaUtils.create(Balances)
SchemaUtils.create(Transactions)
}
}
i removed it from the relocation, i changed it to compileOny, and i added it to libraries in plugin.yml, and now i get a different error
java.util.ServiceConfigurationError: org.jetbrains.exposed.sql.DatabaseConnectionAutoRegistration: org.jetbrains.exposed.jdbc.ExposedConnectionImpl not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:593) ~[?:?]
at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1244) ~[?:?]
at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) ~[?:?]
at java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) ~[?:?]
at java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) ~[?:?]
at kotlin.collections.CollectionsKt___CollectionsKt.firstOrNull(_Collections.kt:277) ~[MispleaseEconomy-0.1.0-SNAPSHOT.jar:?]
at org.jetbrains.exposed.sql.Database.<clinit>(Database.kt:111) ~[MispleaseEconomy-0.1.0-SNAPSHOT.jar:?]
at io.github.misdocumeno.mispleaseeconomy.database.Database.init(Database.kt:20) ~[MispleaseEconomy-0.1.0-SNAPSHOT.jar:?]
Can you help me please?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
i dont even understand your question
I can't import the plugins file java in the plugins folder mc server
The amount inside the plugins folder but it still gives me plugins 0 in the console
copy pasting the same question wont do it. it depends on your host provider. you should ask on #help-server tho
im stupid, i forgot to change implementation to compileOnly in one of the three exposed dependencies, but now i get again a different error
java.lang.LinkageError: loader constraint violation: when resolving method 'org.jetbrains.exposed.sql.Database org.jetbrains.exposed.sql.Database$Companion.connect$default(org.jetbrains.exposed.sql.Database$Companion, java.lang.String, java.lang.String, java.lang.String, java.lang.String, kotlin.jvm.functions.Function1, org.jetbrains.exposed.sql.DatabaseConfig, kotlin.jvm.functions.Function1, int, java.lang.Object)' the class loader 'MispleaseEconomy-0.1.0-SNAPSHOT.jar' @331f68f3 of the current class, io/github/misdocumeno/mispleaseeconomy/database/Database, and the class loader java.net.URLClassLoader @59b6eab1 for the method's defining class, org/jetbrains/exposed/sql/Database$Companion, have different Class objects for the type kotlin/jvm/functions/Function1 used in the signature (io.github.misdocumeno.mispleaseeconomy.database.Database is in unnamed module of loader 'MispleaseEconomy-0.1.0-SNAPSHOT.jar' @331f68f3, parent loader java.net.URLClassLoader @1ed6993a; org.jetbrains.exposed.sql.Database$Companion is in unnamed module of loader java.net.URLClassLoader @59b6eab1, parent loader java.net.URLClassLoader @1ed6993a)
at io.github.misdocumeno.mispleaseeconomy.database.Database.init(Database.kt:20) ~[MispleaseEconomy-0.1.0-SNAPSHOT.jar:?]
at io.github.misdocumeno.mispleaseeconomy.MispleaseEconomy.onEnable(MispleaseEconomy.kt:58) ~[MispleaseEconomy-0.1.0-SNAPSHOT.jar:?]
according to this, could be bc im shadowing it https://www.spigotmc.org/threads/linkageerror-loader-constraint-violation.539644/
but im pretty sure im not, this is the build.gradle.kts file now after all the changes
https://pastes.dev/8IN4ZV56Nv
and this is the libraries section in plugin.yml
libraries:
- org.jetbrains.kotlin:kotlin-stdlib:2.0.0
- org.jetbrains.exposed:exposed-core:0.50.1
- org.jetbrains.exposed:exposed-jdbc:0.50.1
- org.jetbrains.exposed:exposed-java-time:0.50.1
does anyone have good networking experience with linux? im trying to create a dummy network interface where all the traffic is actually redirected to eth0
ok so uhhh, i added all the serialization dependencies to the bukkit library loader too, and apparently everything works fine now, for some reason. so, now if i make another plugin using the same dependencies, there wont be any conflicts bc of loading the same class twice, right? meaning i dont need to relocate stuff, and i also reduce the jar size, right? its all benefits? there are no cons to this?
i don't even need to include all that 🤔
is there a way to prevent all the [SpigotLibraryLoader] spam in the console?
i have it as an impl in gradle, as well as the gradle plugin
yea but that can cause conflicts if two plugins shadow the same dependency and the same version
in theory
well idk, some people here may have something to say about that i guess
unless i didnt understand correctly, you have to shadow your dependencies, obviously, to make them exist during runtime, but you also have to relocate them, bc if two plugins shadow the same dependency, the jvm will do weird stuff when loading the same thing twice, or something like that
but shadowing everything, including libraries that are quite common, like the kotlin stdlib, increases the fat jar size, thats why the spigot library loaded exists
yea, that jar is pretty fat
Imo the smaller the jar the better
if you're making the entire server, 🤷
but also, i was having problems with relocating stuff, so it just works now, and the shadow plugin will supposedly stop being supported soon
or so i been told
are you using johnrengelman/shadow
goooler/shadow
whats the new one?
works for j21
The spigot classloader shenanigans are a bit all over the place
id("io.github.goooler.shadow")
What does the spigot classloader even do
ok, but im on java 17
like what?
Well the problem is more how plugins load what classes
i really hate those
plugin A can load/access plugin B's classes without issue
🤔
Why can I not make the main class of my plugin a class from another plugin

have you tried
Paulem has
oh right
Two plugins - one main class, what a beauty that would be
im not sure what you mean. then i shouldnt use the spigot library loader? tbh it spams a lot in console, and i dont remember seeing all that spam ever, so, i guess most plugins dont use it, and there is a reason for that?
Well you generally would want to shade and relocate if possible, especially with shit like the kotlin standard library
but why
in my sv there seems to be only one plugin that uses that
[07:06:23] [Server thread/INFO]: [SpigotLibraryLoader] [SuperiorSkyblock2] Loading 1 libraries... please wait
[07:06:24] [Server thread/INFO]: [SpigotLibraryLoader] [SuperiorSkyblock2] Loaded library /mnt/2tb/misplease/server/libraries/org/openjdk/nashorn/nashorn-core/15.4/nashorn-core-15.4.jar
[07:06:24] [Server thread/INFO]: [SpigotLibraryLoader] [SuperiorSkyblock2] Loaded library /mnt/2tb/misplease/server/libraries/org/ow2/asm/asm/7.3.1/asm-7.3.1.jar
[07:06:24] [Server thread/INFO]: [SpigotLibraryLoader] [SuperiorSkyblock2] Loaded library /mnt/2tb/misplease/server/libraries/org/ow2/asm/asm-commons/7.3.1/asm-commons-7.3.1.jar
[07:06:24] [Server thread/INFO]: [SpigotLibraryLoader] [SuperiorSkyblock2] Loaded library /mnt/2tb/misplease/server/libraries/org/ow2/asm/asm-analysis/7.3.1/asm-analysis-7.3.1.jar
[07:06:24] [Server thread/INFO]: [SpigotLibraryLoader] [SuperiorSkyblock2] Loaded library /mnt/2tb/misplease/server/libraries/org/ow2/asm/asm-tree/7.3.1/asm-tree-7.3.1.jar
[07:06:24] [Server thread/INFO]: [SpigotLibraryLoader] [SuperiorSkyblock2] Loaded library /mnt/2tb/misplease/server/libraries/org/ow2/asm/asm-util/7.3.1/asm-util-7.3.1.jar
idk why would a skyblock plugin need to anaylze an abstract syntax tree
a javascript runtime
then again, why would a skyblock plugin need that
anyway, so back to relocation then?
i was having some errors, i never did shadow relocation
Well the library loader is iirc isolated to the specific plugins?
which is going to be a whole mess if you write in kotlin and have plugin dependencies
Asm is weird
so you'd need to declare a dependency between the plugins
is this how you relocate the kotlin stdlib? and everything else https://pastes.dev/WbgrBxWm7b
i get this error when trying to connect to the db with exposed
https://pastes.dev/3UtFJNyU5H
if i dont relocate exposed, so there is no db error, and i join the server, then i get another error, ClassNotFound with kotlin/jvm/internal/Intrinsics.class or something like that iirc
i have no idea
i dont understand why would that be the case but i belive and trust you
tbf, I doubt that is even going to remotely work
kotlin is such a fucking mess with its dependency
i miss npm install
you have your one library that is written in kotlin that uses one version of kotlin
you have your own plugin that uses a different version of kotlin
so now its just fucked
How great it is to be a java user
so, to avoid errors with all of that
i should shadow and relocate
even if it ends up being a 50mb fat jar
right? tbh i dont care about size
i just care about
not having errors
Well you can give it a go
idk if you actually have a kotlin version missmatch
or if the library loader is just doing funsies
did you check the build.gradle.kts file? its the first link
Well the question is more, what do the kotlinx dependencies rely on
which, I do not code in that script language much, I don't know
mmm
so you mean there could be a difference in kotlin versions between
my plugin and the dependencies
is that what you mean? im not sure if i follow
Well the error you posted at least implies that your plugins classloader loaded a kotlin class somehow (which would imply you shaded it?) and then your library loader also loaded the Function1 class from its kotlin stdlib
and can anyone give me an example of a working plugin written in kotlin, so i know how you add and shadow and relocate the stdlib properly
you are not running shadowJar are you?
you mean ./gradlew shadowJar?
Yea
yea i do that
:/
but what error are you looking at?
okay then the error is just on your end
^
yea thats very likely
like, if you define kotlin standard lib as a dependency to be loaded by the library classloader
but that was when i was using
you cannot also shade it
the spigot library loader
and i already fixed that
by adding all dependencies to libraries in plugin.yml
but you said that could be
a problem
so im back with shadow relocating stuff
and now im back to the previous error
you added the stlib to the libraries no?
here, the second url
is the error i have now
yea, but forget about that
thats literally already working
but now im not sure about using the spigot library loader, so i want to fix the shadow thing
the problem with the spigot library loader was that i was adding exposed and stdlib to libraries in plugin,yml, but i was still shadowing kotlinx-serialiation
thats all fixed now
scripting language
\😭
Ehhh, I mean I'd guess that you are missing a relocation somewhere there
presumably they use some service discovery that fails post relocation
ok, yea
im probably missing something
bc i also got a ClassNotFound on kotlin/jvm/internal/Intrinsics.class or something like that
so im pretty sure the relocation is wrong somehow
it all worked fine before the relocation
uhh
i remember seeing something
about that
and chatgpt said it was fine
let me check
chatgpt is rather useless 
yea pretty much
this
$ jar -tf build/libs/MispleaseEconomy-0.1.0-SNAPSHOT.jar | grep DatabaseConnectionAutoRegistration
META-INF/services/org.jetbrains.exposed.sql.DatabaseConnectionAutoRegistration
io/github/misdocumeno/mispleaseeconomy/relocated/org/jetbrains/exposed/sql/DatabaseConnectionAutoRegistration.class
ChatGpt is fun to play with like siri
the META-INF/services
points to the previous location
and chatgpt said that was normal, i assume it isnt?
yea, it could be pretty useful tho sometimes
its like gambling idk
Can't rely on it all the time if you don't give it enough context
Gpt def needs you to be precise for any worth while result
yea totally, if you give it enough context, and its not biased to agree with you in everything, even when you are not sure and you are just asking
then its useful
It's best as an SQL generator when needed imo, however the more advanced shit gets you're basically coding it yourself in english
Wait lul I was looking up why is the skyblock plugin using nashorn
@eternal night so that thing inside META-INF should have been relocated too, but the john rengelman plugin doesnt do that. ill try using the newer shadow plugin, goooler or something like that
i see its a fork of john rengelman, so i asume i dont have to change any config about it?
Yea, I do not know. The linked issue talks about some transformer to load
You can always shade it to get rid of it if that is what you are trying to do
so try adding mergeServiceFiles()
well, i changed the plugin and everything is the same. the service inside META-INF is still the same
ill try that
I mean yea the fork is just like 70 commits on top
its not going to fix every issue lol
i was hoping it was a totally separated project or something
nah it is a straight fork mainly for java 21 support
now the service is being relocated apparently
$ jar -tf build/libs/MispleaseEconomy-0.1.0-SNAPSHOT.jar | grep DatabaseConnectionAutoRegistration
io/github/misdocumeno/mispleaseeconomy/relocated/org/jetbrains/exposed/sql/DatabaseConnectionAutoRegistration.class
META-INF/services/io.github.misdocumeno.mispleaseeconomy.relocated.org.jetbrains.exposed.sql.DatabaseConnectionAutoRegistration
noice
ok, now i get a different error
progress 
yay
something about the service
id love to know what a service is
might wanna yank minimize()
ill try that
Services are a way to discover implementations of interfaces
i guess thats how exposed magically knows when im declaring a table
like in this case ExposedConnection is an interface, but what actual implementation is loaded is configured via a service

just don't depend on that plugin with another
so, things that i learned today
that woulkd explode
there is something called services
what do you mean
and this is an economy provider, i plan to make other plugins depend on it

besides the vault interface
just don't expose kotlin then
you mean the thing that has to be included as a dependency to other projects?
Well if you are writing an economy provider
should they all add it as compileOnly?
and other plugins use its API types that are written in kotlin
no
but your plugin now has kotlin relocated to your package
so they'd expect to get a kotlin type at the normal kotlin package
and boom
mmm
ok but
in theory, if i want to make the api accessible to java projects too
then
Yea then you'd write the API without kotlin anyway
yea
👍
i know kotlin is not that adopted yet here, idk why
i dont plan to make it public tho, so
I mean, dependencies are already a mess
but its open source, so idk
yea i see that
kotlin stdlib is fucking annoying to work with between plugins
Idk much about kotlin but I prefer the strictness of java as it were
Well, you can just properly keep your API and impl separated
write your java interfaces in the API
and then you can implement that in kotlin as much as you want
just the API/nterface to other plugins are best off in java to not get absolutely hammered with dependency issues
yea yea, sure, that was the idea in the first place, i didnt even think about making a kotlin api, didnt think that could be possible
That and the overwhelming majority of plugins are written in Java so you're immediately closing off access to your API in doing so
I mean it is and it can make some kotlin consumers feel a lot nicer
I'm so sorry
yea exactly
well thanks again 👍
wym
ah don't start the kotlin vs java discussion
it happens every other week, its boring
^
mr choco you're so stinky
i dont use kotlin or java enough to have a strong opinion about it, but i can be sure i hate java
tho most of the reasons about why i hate java, like the way it handles dependencies, are also present in kotlin, so 💁♀️
at least i can stop using semicolons
I mean I'm not much for debating languages as everyone has their reasoning for using one over the other, however if you're getting into programming semicolons are really something you need to get used to
It's like second nature at this point for me
huh what's wrong with how dependencies are handled?
i mean its the same as using punctuation when writing normally
same
not writing semicolons just feels wrong
legit. In JS you don't really need them, but I use them anyways because the code looks naughty asf without it
Just best practice imo. I get at the start its annoying to remember, but once you start doing it, it gets to a point where you don't even realize you're using them
Hi , so iam back again with more questions so iam working on skywars plugin (big plugin) , and i used redis and sql , idk if its the best setup
1- player login to bungee (bungee load his data from sql and it send it to redis)
2- when player change server it will request the data from redis
3- after player quit the network (it will save his data) .. such as kills , deaths , cosmtics .. , killeffect
or is there a better aproch?
iam at work rn , and i have nothing to do i wana waste time xD (9 hours till i get back home)
I mean it sounds like a normal caching approach besides maybe instead of grabbing from redis when chnanging server it should save into the db then load into redis once joined again
the concern is what if he has data, the server crashes between joins
that data is gone
It can do both. I don’t see why you would want to reload it into redis though
https://www.spigotmc.org/resources/featherboard.2691/ When I try to enter this site, an error occurs. What should I do now
Are you logged in
What error
Probably the not logged in error
hmmm so ,
no reids
1- player joins lobby or skywars games servers (it load his data from sql )
2- player leave it will save his data to sql from cache system
should i log in?
You need to be logged in to see premium plugins
I think your system is fine how it is. Just have an intermediary system that saves from redis to the db occasionally as well as on player leave
Does playeLeave fire on server crashes?
how about having cosmetics loaded on lobby server only and it send the cosmrtics data to all sub servers
not player data but cosmetics data
depends on the crash
No, thats what the occasional saving is for
nothing is guaranteed to run during a crash
That’s what I thought ok
i will send how i do the cosmetics loading for games + lobby server
I would shy away from using a minecraft instance as a backplane like that
hmm?
Have a management application detached from a minecraft instance
More robust
Unless im misunderstanding what you’re saying
well i wanted to make it good but not too complex
hello, I'm making an companies role system plugin but I have some problem.
Error: https://paste.md-5.net/zadulifayi.js
Main Class: https://paste.md-5.net/unasipiwel.java
AssumiCommand (HireCommand): https://paste.md-5.net/wetijibatu.java
LicenziaCommand (Fire a personCommand): https://paste.md-5.net/erujuqabuh.java
i didnt know that this plugin cost money lol
are there any free plugin like featheboard?
TAB
Looks like you're implicitly casting to a hashmap
and what you're getting isn't a hashmap
ok i will use this thanks
, new TypeToken<Map<String, String>>(){}.getType());
whats this whole thing
Guessing that tells gson to read it as a map
so how can I fix
Can just pass the map class then cast it
Don't cast it
What changes should I make to the code?
Your map is <String, Object> and your token is <String, String>
Not sure if java will like that
look at all the messages above
everytime i add a dependency, i get a problem for some reason
far more often than in other languages
everything
but yea
kotlin, the shadow plugin, having to manually add a dependency to a config file, jvm target version
compilation stages, or lifecycles, maven vs gradle, kts, groovy, etc etc
I mean you don't have to do all of that to get things working
Gradle can be a pain though
yea i know, but there isnt much abstraction to all of that
? what do you want it to be
for example in javascript, there are a lot of frameworks, a lot of build tools, but generally they are abstracted enough to just run a command or two and thats it, without even having to open a single config file
but yea, i know its a me problem, bc i code stuff on java or kotlin for a few weeks, then i leave it for months and i forget everything
I'd say js frameworks and build systems are far worse
i made my own boilerplate tool bc of that
also it's just one command or two with Java as well
it depends, but yea, you could say that
but you can do npx frameworktool init
That's loading a template
There are templates available for Java projects too
Alex has a great one for Spigot
me when copy/pasting a string in a text file is too much
what about adding a dependency
Just paste it to the file
implementation, compilyOnly, runtimeOnly, provided, shadowing, relocating, etc etc
again that's a gradle problem
you gotta check the last version manually
just use maven if it's too complex
xml 🤢
but again, its a me problem, i know, bc i understand the pain of non js devs using javascript
so i guess its the same thing
and their pain is probably greater than mine
but the thing is, i dont know how the build tools work in js, and i can still use them
thats not the case with gradle/java in general
this is literally the first plugin i make using gradle
but yea, maybe maven was easier
I wouldn't recommend anyone to start with Gradle
yea, i made like 10 plugins with maven and java, so i guess im ready to use gradle and kotlin
i never used this many dependencies tho
Shoot for more 😛
and i wanted to start using the kotlin ecosystem, exposed instead of raw sql for example
back to the errors again, im not sure where the error is being originated, there is something that hasnt been properly relocated
https://pastes.dev/xYLUep5sOT
the stdlib has been properly relocated
$ jar -tf build/libs/MispleaseEconomy-0.1.0-SNAPSHOT.jar | grep Intrinsics
io/github/misdocumeno/mispleaseeconomy/relocated/kotlin/jvm/internal/Intrinsics.class
more stuff...
the event
class MispleaseEconomyEvents : Listener {
@EventHandler
fun onPlayerJoin(event: PlayerJoinEvent) {
EconomyProvider.createPlayerAccount(event.player)
}
}
wait
thats not even the same plugin
yeah
lol?...
Your other plugin was depending on kotlin not being relocated ig
yea but what does this plugin relocation have to do with that plugin?
can i use the vault on 1.20.4
yes
the other plugin was using the non-relocated version of kotlin
inside of this plugin
to work before
why is there a plugin inside of a plugin
but that plugin doesnt have anything to do with this plugin
im using the aternos server thing
there isnt
wth
Doesn't matter
?tas
and there is no 1.20.4 for the vault
you should ask on #help-server
This is why we relocate so you don't accidentally end up using code from other jars
vault wasnt updated for a long time, and it doesnt need to
Aternos is literally the worst server hosting provider
just use it
Even my phone is better
mmm
so
doesnt really seem that bad
yes
the kotlin lib in your plugin
but its relocated
It really is, if you would have experience with other free hosting you'd know how much more freedom and how much less pain you can have by not using aternos
it's not specifically looking for your plugin
and the error you're seeing is that it can't find the kotlin stdlib
whata another good one then
@fickle mantle never asked but did you get everything working?
your own PC 
Idk, a lot of free hosting from my days became paid or closed
Nowadays I use my own hardware
Or a paid hosting provider
how do you use your own pc
You set up a server there
ask in #help-server
what is it looking for then, and how did it "find" my economy plugin in the process
It's looking for the kotlin stdlib
anywhere in the runtime
and no it's not finding anything
then it doesnt have anything to do with the economy plugin? and why isnt it finding anything if the stdlib is shadowed in that plugin jar, just not relocated?
and yes it has nothing to do with your economy plugin
how do you know that? i didnt show anything about the other plugin. this is the build.gradle.kts from the other plugin https://pastes.dev/1CteizkXXZ
if it was shadowed that error wouldn't be happening
Shading is when you put a library or something like that into your jar and relocating is when you change its location (package name)
and how can that happen given that build.gradle.kts?
and yea, its doesnt show up when doing jar -tf and grep
i was having problems with shadow not shadowing stuff
I was developing a gradle plugin recently and the jar was empty when my task extended the Jar task but the jar was full when it didn't :/
i fixed it by removing the dependencies block inside of the shadowJar task
what is the use of the dependencies block in shadowJar then?
i do
and in fact, i am using that plugin right now
oh yeah you pretty much never want to explicitly add dependencies there, shadow will take care of 'em
and it was working
just in the regular dependencies block, implementation the dependencies you want to shade, compileOnly the ones you don't (like the spigot api) 👍
ok so, to relocate kotlin stdlib, i need to relocate both "kotlin" and "org.kotlin.jetbrains", right?
Wdym, you don't have to shade the spigot api? 😮
uh sounds about right, idk what org.kotlin.jetbrains contains but sure lol
again, chatgpt told me to, so im not sure if its right
and relocating doesnt seem to be a popular thing to do in general
outside of minecraft plugins
so i didnt find much online
yeah that's because it isn't something that is really needed in the real world
it's more of an ugly hack
yea, pretty much
it feels wrong to do too
maybe i could look at the most popular plugin thats written in kotlin? any idea which one is it?
yeah :) Thank you
in 1.20.6 the method ItemFactory#hoverContentOf(ItemStack) no longer works, is there an alternative?
waiting pretty much if that is ever going to come back
hmm ok
im tired of randomly getting this error, i dont know why it happens, it only happens sometimes, most of the time it doesnt
https://pastes.dev/yu8qK4L5sp
it doesnt make sense, why does it say class not found on a method? and on a method of a class of my own plugin? from a class that is clearly used all the time. it has something to do with coroutines? it has to
the method:
import kotlinx.coroutines.*
object Database {
private val job = Job()
private val coroutineScope = CoroutineScope(Dispatchers.IO + job)
// stuff... other methods
fun waitToComplete() {
runBlocking {
job.complete()
job.join()
}
}
}
its called from onDisable
override fun onDisable() {
QuickShop.insertPendingLogs()
Database.waitToComplete()
}
basically the idea was to wait for every database transaction to finish before shuting down the server
Are u using reload
i even tried adding a Thread.sleep on db insertion methods, and it is working fine, it waits, all as expected
that error just happens randomly sometimes
no
Disabling with plugman or anything like that ?
i have plugman installed tho, idk if that matters, and im using purpur
no
Well if it's happening sometimes, something is messing with classpath
and what could that be?
and can that be changed during runtime?
well im not even sure what classpath is
Did you do a full server restart after changing code in the plugin
yes
plugman really breaks static classes
i alwas do
Remove plugman then
just having it installed?
no, if you reload
bc im not doing plugman reload
then its not that
im not using it bc it causes problems with exposed, the orm library
Using plugman is generally a bad idea
well, it depends i guess
What if they are true utility with nothing actually being stored in said class?
I just can't figure out this transformation matrix math problem
I got the entire thing working but because the bones are individually rotated 180 degrees away from where they should be by mojang I just can't figure out a solution
MEG?
no, my own model plugin
Oh how lovely
but what does the error implies? that the class stopped existing during runtime? like, "unloaded"? if thats even possible. that the method never existed? is it normal to get that error on a method?
everything works and it works for the versions before mojang changed the default rotation of these display entities
but them rotating the display entities is just messing me up
I thought I saw something of rotations being limited to 22.5 degrees when it came to model stuffs
wait, can the error be caused bc of changing the jar file in disk while the server is running?
has nothing to do with that, I got that part down
Ah gotcha
i sometimes get the error on SuspendLambda too, and that is definitely included in the jar
u dont use the plugins/update folder?
you were asked if you were doing this
where?
you asked about the reload command and plugman, right?
a folder where to put in plugins, a reload will unload the current version of the plugin and start the one in the update folder
Olivo asked if you did a full restart, but it didn;t include replacing teh jar live
So then you have no way of defining your own rotations for the display entities?
I do
yea i do a full restart, but sometimes i do the compile command before stop on the sv
bc im dumb
not good
i would assume the jar would be just copied entirely to memory at server start
Sorry just trying to give you some rubber duck programming 😛
so that only works when you do reload instead of restarting the sv?
copy your jar to a folder called update
teh server will copy from there to teh plugins folder at startup
great, didnt know that
it also works for reloads no?
it shoudl but who knows with reload
i have multiple "items" (that are all structure blocks), how do I give each one a different texture?
are they blocks or actually items
item since you can't place structure blocks in survival
You could probably use the custom model data tag then
how would i do that?
alr
ty
also
how would I around letting players apply enchant books (i.e. efficiency) to the item (which is a structure block) via an anvil?
or is that even possible?
you can probably use the anvil event
any docs?
declaration: package: org.bukkit.event.inventory, class: PrepareAnvilEvent
how would I use that to modify the behaviour then?
is it possible to replace a chat messaage with a base component in spigot using eaither protocol lib or adventure api??
modify the view
I believe
Hi, does anyone know how to block experimental releases on Renovate in PR?
Cannot get ID for packet class net.md_5.bungee.protocol.packet.LoginSuccess how to fix this error
maybe you can check in the docs https://docs.renovatebot.com/configuration-options/
for specify the type of releases to get... or disable the auto-merge for that reps
Configuration Options usable in renovate.json or package.json
how to disable auto merge ?
I've been trying to modify a vanilla Minecraft shader in a resource pack to detect when the first pixel is pure red -> do stuff. But I can't seem to be able to get it working.
I've tried that the shader does work by coloring all objects indiscriminately red from the fragment shader.
But when I try to be more picky about which objects I colorred, that's where it fails.
Configuration Options usable in renovate.json or package.json
I already searched but I can't find it
[16:18:25 ERROR]: Could not pass event BlockFromToEvent to WorldGuard v7.0.10+d9424b1 how to fix this
?paste whole error
also seems to be a wrldguard issue
hmm if you define the packages rules you can check this https://docs.renovatebot.com/configuration-options/#matchupdatetypes
i found this thread in github maybe can help you.
https://github.com/renovatebot/renovate/discussions/13652
..
Here's my shader code:
https://pastebin.com/F9mwE901
I wonder if the UV coordinate range is between 0 and 1?
you try in spigot?
paper
try in spigot if throw a error maybe its a issue in the plugin or a issue in paper.
looks like version mismatch issue
i have to reinstall whole server ?
whole plugins en aLL
try in another you only need start not?
the spam is when start the server?
what does MSPT stand for ?
server works properly but spam in console only
Milliseconds per tick
what is the version of the server?
Cannot get ID for packet class net.md_5.bungee.protocol.packet.LoginSuccess how to fix this error still not able to fix when another player join this erros comes
1.20.4
oh god
you need downgrade the plugin then.. the changelog show the last version only support 1.20.5 and 1.20.6
or upgrade your server to 1.20.6
oh but it is not any problem there so is it ok spam in console only ?
well the plugin cannot work property... if you have issues you cannot get support for that
if i change server jar i have to reset my world locations en all ?
if you upgrade your server no.. the world is updated but then you cannot downgrade the server version...
try backup your world and test upgrading the server
ohk i am downloading paper 1.20.5
i doubt you'll get shader help here ngl
but there's also barely any places that know about shaders
?whereami
@granite cloud
Yes. I am aware. But it's not complex code.
try directly 1.20.6
its the same than 1.20.5 with a hotfix for a llamas issue.
https://minecraft.wiki/w/Java_Edition_1.20.6
the mc commands community might be able to help you, mc font magic is also helpful with shaders
Thanks.
all plugins are upgraded to 1.20.6 ?
if the plugins works in 1.20.5 then works in 1.20.6
Plugins are pretty broken on 1.20.6. Stick to 1.20.4 if you can.
but my console is spamming
what plugins?
see here
Well, for example AdvancedSeasons.
Doesn't work either
try then ask in the renovate github maybe they can provide an alternative
Cannot get ID for packet class net.md_5.bungee.protocol.packet.LoginSuccess how to fix this error what will be solution here ?
when play try to join this error comes
Ok thanks for your help
howcome @worldly ingot
I dunno. Do I look like a W/E maintainer? 
Smells like NMS 🧐
I mean yeah, they avoid the api abstractions at all costs lol
is there an easy way to get a plugin object if I have the name of its jar file
how to fix whenever i type something in text like hi it shows hihi means double
you could open the jar file and look into its plugin.yml
the name of the jar file itself does not necessarily match the plugin name
pls someone help
that's what I was thinking
makes sense
appreciate it
just ask the PluginManager ig
sounds like an xy problem
i have a plugin that I use for development that updates plugins
why do you need a plugin to update plugins
That won’t work well. There are a lot of plugins that update removing support for previous server versions, in the future you’ll gradually have issues. As well as when a plugin dev makes big changes and you wonder why this and that is happening
Keeping up to date relies on you to be there and test things
Oh ok I didn’t read past that sorry.
but you don't need a plugin for this unless you are on some shitty host that doesn't give you console control
How can I send a commandsender a formatted message with clickevents n such?
I have a BaseComponent with the text I wanna send
Yeah, you are right.
But it has the possibility of coming with convenience if you truly trust the plugins you use.
it is not convenient
it requires starting the server to simply update
and then restart
when you could just update the plugins before the server even starts
It just doesn't give me an option to send a BaseComponent, only strings.
CommandSender.spigot().sendMessage(...)
Ok. But if the server is already up and running, it can be convenient.
no
How could I do it for a paper TextComponent now? Is that possible?
still requires a restart
Ok. Idc.
adventure platform bukkit
of course you don't
Go tell him, it's not my server.
I am just pointing out it is inferior
I never denied.
I just said there is a possibility of it being convenient in some cases.
ok, something inferior can't be convenient
and I already pointed out the one scenario where it would work
im aware of the problems
it only updates my plugin
for faster development
its on a remote server
it currently restarts the server to update
Can you please explain more?
im testing to see if reloading the plugin is a viable option
how do you have a "paper" TextComponent
why don't you make use of sftp?
if you want it more faster
we had this exact discussion about a year ago
my current setup is
i commit change
jenkins server builds plugin
the updater plugin auto downloads any changed plugins from jenkins on restart
jenkins could just upload wherever you want it to go
I'm happy with my current setup
however the dev server has a large number of plugins and takes a significant amount of time to start up
so I'm trying to see if reloading the plugin without restarting the server is a viable option
right....an yet you want faster but don't take the approach that would be faster
especially when im debugging stuff and am only making small changes like adding a few debug messages
seems about right
???
reloading is generally not that much of a vibe
if you are live coding, run it using jetbrains runtime and hot reload
i figured i could deal with the drawbacks
¯_(ツ)_/¯
i do that when i run locally
but i've been running into issues remote debugging
it only lets me hotswap once
and then spams the console with errors
and since there's multiple people developing at the same time its not super feasible
this is the best solution we've found for the team since we're all working on different parts of the plugin at once
you just commit your changes and then run /stop to see them
im just testing to see if this might be an improvement to my development time
and why do you say that this would be faster than what im currently doing
I mean, you can try ™️ Not that spigot has the ability to just reload a single thing
its downloading from itself, the time difference would be negligible
just put your plugin in the update folder and reload?
whats this even about
who runs a ton of plugins on a dev server
many dependencies
we have a weird setup
i wouldn't say its a ton of plugins but the ones we have take a while to start up
like libsdisguises and mythicmobs
i mean
can you not pluginManager.disablePlugin(plugin)
and then load the plugin?
thats what the update folder is for
Yea but you'd need a plugin for that
that updates stuff
¯_(ツ)_/¯
would do that
put your new plugin in plugins/update, reload server and it will swap the jars
but i don't want to reload every plugin
because of the drawbacks
i just want to reload my plugin
i feel like this isn't that crazy idk
anyways back to what I was doing
i am going to read the jar file to see what the plugin name is so i can get the old plugin instance from the plugin manager
if you have a jenkins ci, it can just upload instead of waiting for some other thing to download
you can even at the same time have that ci invoke a script to restart your server as well
so in one build action, everything is done for you
so
I would prefer for that to not happen
because sometimes people are in the middle of things and don't want the server to be updated/restarted immediately
im okay with the current approach
also ive given up on the reloading nonsense just gonna stick to the current setup of restarting the server
Not if you didn't build it
whenever I restart my server I get this issue
I tried looking for a fix but all I found was that its something related to maven dependencies
?paste
looks like you're not shading jackson
that's my maven config
you said restart, does that mean on initial start it works just fine?
Yes, the only case in which I get this exception is when I restart server while I build a new plugin version
it then erases all .json files
that I have stored in server directory
Im also getting this warning
I tried shading jackson but I cant figure it out
- Don't use Plugman to reload.
- Don't replace the jar with the server running.
What's a Plugman?
then your issue is number 2
okay I understand
if it only happens on a restart
so dont rebuild plugin while server is open
rebuilding and then just reloading was very convenient
its not safe. Place new jar in an update folder and then restart
is this warning something I should care about?
no
where should I place update folder?
and change this path to the update directory?
This guide explains how to install most basic plugins on your server. You must already have a running CraftBukkit server set up and have knowledge of how to use the Minecraft server console. If you do not have a server set up please go to Setting up a server and follow the instructions there. This guide does not cover setting up an SQL database ...
how to make plugins with nms work with other versions?
multi module
How it looks like? Have any examples?
?nms go there and look at posts. one is about modules
this one? https://blog.jeff-media.com/maven-multi-module-setup-for-supporting-different-nms-versions/
Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...
yes
thanks!
Why does my text have a click event on all of it when I only specified a click event on a single component?
does that happen to be the parent component
no
Show your code
you were running out of prefixes to try 🙂
I'm having a strange issue in intellij idea
Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.20.4-R0.1-SNAPSHOT in dmulloy2-repo (https://repo.dmulloy2.net/repository/public/)
i have run build tools for that version with --remapped
idk
i checked and its in my local repo
idk why it can't find it
i see the problem is that the dmulloy2-repo has spigot publicly, for some reason??
shoudl be fine then, so long as you did actually build that version
1.20.4 remapped
yes
but for some reason 1.20.4 appears to be in the dmulloy2-repo
like i was just scrolling through the nexus
no, its just looking there for it, and its not found
look in your local .m2
its in there
screenshot
there is no remapped jar there
????? ur right
how did this happen
i built with --remapped
im just going to rebuild and not use the gui this time
🤞
How can I manipulate with black heart particles after hitting entity?
Hey, I've a few async tasks in my plugin and async stuff doesn't show up in profilers, any idea how can I see the usage of those tasks?
why wouldn't they show up in a profiler?
what profiler are you using that can't see a method being invoked?
I use Spark
that explains it
under spark you'd need to instruct it which thread it needs to profile. that can be a bit difficult to pull off if you aren't manually naming your threads
okay well that was def the problem its working now
¯_(ツ)_/¯
blame async-profiler for how it works, but really that design decision makes sense
I am trying to make a tab in paper spigot but I cant make it so the name in tab for a player is diferent from the display name for a player
anyone know how i could make players name different from name in tab
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
Is it possible to make blocks floating on the surface without lags and friezes?
timing reports are completely useless imo
They should be removed in this day and age.
blocks floating on what surface?
water
They may tell you how long your code blocks in a given task, but that knowledge would be useless as you would not know which exact piece of code that is (which spark can tell you with better accuracy)
spawn an item without gravity or use ItemDisplay
how to correctly add protocolLib for 1.20.4 server?
hmm, so does /spark profiler start --thread * solve my issue?
it could? Frankly, it has been a LONG while since I used spark - so I don't know if wildcards are supported or if they even have an intended effect
but it never hurts to try
elgar can you join call
please i need help with it
it dosent let me send code so i can show you
ill friend you so we not strangers
But I like candy
can somone else join call with me
please
I am trying to make a tab in paper spigot but I cant make it so the name in tab for a player is diferent from the display name for a player
anyone know how i could make players name different from name in tab
for what?
?whereami
there ought to be APIs out there that can do that for you
and that does not seem like one need to be in VC for that
Isn’t there setPlayerListName
well paperspigot would be 1.8 minecraft - so chances are the method was not available back then (which would explain why they ask here and not in papercord)
What might be the cause of player walking super slow?
I made proxy with build in limbo, when i connect player -> proxy -> server everything is just fine, when i connect player -> proxy -> limbo -> server player walk superrr slow. But i can fly normally. On limbo i don't send any other packets then JoinGame packet
you can set the walking speed differently from flying speed - but idk how that would be something that randomly happens
Version 1.18
It's not randomly it happens only when i first connect to limbo when there is lack of probably some packets
But i don't know which ones XD
I tried filtering damage indicator packets but they dont seem to be filtered
is there any other way to remove or reduce number of damage indicator particles from event?
has protocolsupport been abandoned?
How can I reset the clickevent on text?
Hi! I have problem, my player interact event is calling twice, I've already have check ```java
if (event.getHand() != EquipmentSlot.HAND) {
return;
}
but it doesn't change anything, I got registered this event once.
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
He’s already got a check for the hand
oh im blind
Mmm show more code
?paste
how do i get the signature of a message in AsyncPlayerChatEvent
you don't
how do u get it then
not on spigot at all
paper has some API
uh no it doesnt?
if that is an option
lol, he told you lynx
bump
?
paper has API on AsyncChatEvent
it doesnt
AsyncChatEvent
oh crap
@EventHandler
public void on(final AsyncChatEvent event) {
final SignedMessage.Signature signature = event.signedMessage().signature();
}
the paper snippet ^
(if you need this for deletion, paper has Player#deleteMessage too)
yeah i saw that
^
Hmm, I mean, have ya attached a debugger?
Beyond that, make sure you are on a vanilla mc client and on latest
the interact events are at the mercy of what the client sends
I am on fabric 1.19.3
when did the signature thing get added