#help-development
1 messages ยท Page 323 of 1
does it have an auto latest version thing
no, maven itself doesnt have that feature. maven always requires you to specify a version
otherwise the build wouldnt be reproducable
and that's basically the idea of maven ๐
that's also why maven central doesnt allow redeployment of versions not ending in -SNAPSHOT
ah
thx
hey @tender shard
i've looked into your frame using java and get some inspirations
my frame? wdym?
that
ah
this better fucking work
i've created my own java frame with a automatically resizing, what do you think about that?
i called it ResponsibleLayout
its for my GameEngine
nice
thats pretty cool. been looking at doing that for a bit too. but i could not get it done yet.
shouldnt it be Responsive
yeah
oh thanks, typo error xD
i will change rn
but cool
Configurate: https://github.com/SpongePowered/Configurate/
Record Builder: https://github.com/Randgalt/record-builder
@tender shard Could you add these ^^
and adventure too
configurate ๐ฅฐ
Configurate is great. Sadly the yaml improvments are taking quite a long time, so no comment support
sure
but first I'll add kotlin support
after that I'll add the libraries
record builder looks cool tbh
it that open source?
How do you access the gui?
would love to take a peek
it's in another repo but it's not finished yet
๐
I'll finish it after adding kotlin and the new libs
but you can already use IntelliJ to use the archetype
Dm me after so 
Its not published yet, but the engine will be open source, yes ๐
Okay, thanks
just check the readme: https://github.com/JEFF-Media-GbR/spigot-plugin-archetype
does it have a repo on github yet? so i can star it
You need to add kotlin support thought it interopt with Java seamlessly
i always like trying small game engines and seeing how they do stuff
Is posible to create plugins diretly over IJ instead of using Maven plugins?
LIke allows Vscode

it however requires to put kotlin files into src/main/kotlin, and obv I also have to use a different __mainClass__
oh i was told that their api was not free and you have to paid for getting access to it
๐
wdym
Couldn't u just configure the class path to be different
Hmm well who knows
If you want open source solutions just use vscode or vscodium
hmm
what the hell
oh i forgot RETURN
nah ๐ฅฒ
im trying to inject shit into the app class loader
if i can load a class with a unrestricted protection domain
and then have it call AccessController#doPrivileged
it might do something?
Just use the sun Unsafe to yeet all reflection safeguards and you're in it
created it https://github.com/ItsLaivy/LaivyEngine
what is the difference between material.toString() and material.name()?
oh yeah
wait
bruh
i forgot
but how do i call the mthods
lovely. looking forward to the progress ๐
Regular reflection?
paper api be like
no but i dont have access to them
that's an enum lol
Well you need to set them to be accessible
yes
im not using paper api
but for that i need special privileges
toString() could be overriden. name() should not be overriden. for 99.9% of enums, both are the same
what kinds?
JPMS priviliges or something else entirely?
Does it talk anything about not opened to module X
yeah
Yeah, then you can add the opens stuff through the sun unsafe
but if i can load a class with this, maybe it will not cry?
ill try
ig
https://github.com/xxDark/deencapsulation/blob/master/src/main/java/dev/xdark/deencapsulation/Deencapsulation.java plus it isn't that hard to pull of
@rotund ravine you are the only person I know who uses kotlin for plugins. Is the stdlib basically always required, or do people only sometimes need it in spigot? basically - when someone sets "useKotlin" to true in my archetype, would I rather automatically also add STDLib, or should that be a normal option in the dependencies thingy?
you basically always want the stdlib
most of their extensions on everything is in the stdlib

it's required.
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.8.0</version>
<scope>compile</scope>
</dependency>
is this the correct dependency? and it's gotta be shaded and relocated, right?
idk what it is in maevn
yeah but the groupid and artifactid
they are correct right?
because it says jetbrains
alrighty thx
if you use LATEST as the version
maven will always pull the latest version
@remote swallow
Is there a way to just remove the visual of the multilpayer tab list?
I tried a plugin for that but it may be negatively interfering with other aspects of the server
Thanks for the help on the chat earlier btw, that worked well
Wdym
Do you have an example pic?
When a player hits tab, all players online are shown. I just want to remove this feature so players don't know who is online
I can't post images, but I'd have an example if I could
Usage: !verify <forums username>
Or use imgur
time to find my forums username, lol
what is an np?
I think i mean nms
Please im fkg exausted with the output its giving me
So u just want plauer names?
I'll read up on this a bit
and your expected output is?
does kotlin java init blocks?
E.g.
public class MyClass {
{
System.out.println("Init block");
}
}
alternatively you can do string concat without hundreds to .appends
Anyways, what the hell is your issue here
Want plauers to just have their own name?
This format:
/<command> <argument> <usage> - <description>
Also what mc version
one sec, pulling up screenshot
The output is not what i expected
Do you want colors? Then use NamedColor or whatever it is
how wuld I do a public getter in kotlin?
would I just make the field public?
If possible, I'd just like the menu to disappear entirely. This is the closest I have right now, but it only looks like that if only one player is online. Version: 1.19.3
And for bold/italic/whatever you use https://javadoc.io/doc/net.kyori/adventure-api/latest/net/kyori/adventure/text/format/TextDecoration.html
oh wait, that's not adventure...
I wondered why u were giving adventure lol
?jd
I mean using adventure is a good idea for new plugins
So, what do you recommed me?
Also could md PLEASE update bungee-chat to use something that's not an outdated java for javadocs
Interesting. My client console is spamming this message. That's probably a bad sign. "Ignoring player info update for unknown player 442e0d95-3ad7-44d8-a55c-61176228c303"
Please for none programming questions, use #help-server
class MyPlugin: JavaPlugin() {
companion object {
lateinit val instance: MyPlugin
}
init {
instance = this
}
}
Can I use "val" here, or do I have to make the instance field "var"?
@rotund ravine
that makes sense, just thought this one was weird. Thank you all for the help today
@sterile token Just use the builder then
new ComponentBuilder("Hello ").color(ChatColor.RED).
append("World").color(ChatColor.BLUE). append("!").bold(true).create();
Hmn?
I wasnt using Component or yes? Im confused now
๐คฃ
Component builder, not component
Wait let me check my code
Oh LMAO Component from Java
No? Wait you broken my brains
how ze fuck did you not realize that
stop taking so much alcohol, you'll be dead in a few years if you continue like that
I havent drink since 4 months, when end this month
I was using StrinBuilder because i thought it was more efficient rather components
oh i cannot use components, cuz of sender thing, where they dont support it
Well you just forgot that & is not \u00A7
(\u00A7 is also known as ยง)
๐ค
Please dont tell nothing about my one-liners i know what you think
and here we have someone overcomplicating a non-problem again
Yes, it should be a 0-liner
No, im not overcomplicating the thing is just i dont udnerstand the reason of the output im getting
And I have no clue what you are doing with your stream
Never used .reduce myself, probably that's the reason of my confusion
I prefer my recursive approach to placeholders
private String applyPlaceholders(String string, int startIndex, Map<String, String> placeholders) {
int indexStart = string.indexOf("${", startIndex);
if (indexStart == -1) {
return string;
}
int indexEnd = string.indexOf('}', indexStart);
String property = string.substring(indexStart + 2, indexEnd);
String replacement = placeholders.get(property);
if (replacement == null) {
return applyPlaceholders(string, indexEnd, placeholders);
}
return string.substring(0, indexStart) + replacement + string.substring(indexEnd + 1);
}
private String applyPlaceholders(String string, Map<String, String> placeholders) {
if (string == null) {
return null;
}
return applyPlaceholders(string, 0, placeholders);
}
Much nicer than streams and will defo no break
it does at it is named
it reduces things to a single string
so it can take arrays, and collapse them down for instance
I would call that collect, but whatever
They are different concepts, i toguth the same as you
well that is a form of it, but it doesn't do it the same way
Anyways, I'd double check the Chat.style and your reduce functions
yeah should double check the reduce functions
because it can produce results you were probably not expecting
also reduce can be done in parrallel too
sure
oh
yeah need var with lateinit
@tender shard You can just do this i guess.
companion object {
val INSTANCE: EnderStorage by lazy { getPlugin(EnderStorage::class.java) }
}
override fun onEnable() {
server.pluginManager.registerEvents(this, this)
}
We don't really do the whole singleton thing a lot in kotlin, atleast i don't.
.java? what's the .java for?
It wants java class object
kotlin has it's own kotlin class object
Surprised u didn't ask what the lazy was
https://github.com/JEFF-Media-GbR/spigot-plugin-archetype @chrome beacon Added TaskChain, Configurate, RecordBuilder, MiniMessage and Adventure
oh
gotta change that
i thought lazy means this
public static MyPlugin getInstance() {
if(instance == null) {
instance = (MyPlugin) JavaPlugin.getPlugin(MyPlugin.class);
}
return instance;
}
It does
if i need singleton, i basically use object
TaskChain is fixed
dk if its good pratcice, but it works
DI is just annoying when it's a singleton anyway
not really that hard
?di
ofc it's not hard
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
it's just annoying
I mean it kotlin it's basically just https://puu.sh/Jxeri/fcea324d3f.png
Scala >>> Kt
Scala is not that much better and their stdlib is so big
I have used both.
oh really
yeah
I was thinking what sub type to learn
kotlin
Cuz java can be deof really easy
And what about in terms of security
security?
Its compiled directly to binary right?
probably the same as java
I mean basically the same as java
Okay, because i have read that Java derivated are more diff to deobf cuz they didnt create much deobfuscation tools
And im really considering moving to a java derivaated
me likey
configurate isnt on md's github
oh
that why
I'd use sponge's ver
for me that amount of class its pretty desorgnized
Like it has many classes for doing something, which can be put together ๐
have you ever looked at EssentialsX
they have plenty of backends, you can't really merge them
Then they also have custom buildscript logic because ... gradle, you know
if i have done that i would be already death
then half of the other root-directory folders are just metadata for other shit
just because you can put them together doesn't mean it is better to do so. Sometimes there is a feature where it is ideal to just have it by itself instead of combined with another thing
also, small classes are more optimal then large ones due to the stack and objects etc
The rest that remains is abstraction logic that is required once you want to support a wide array of languages
Half of those classes are kinda useless of the general user
yeah that why, has many useless things that library
Well useless for the consumer, useful (or even necessary) for the lib
That problem is that im looking for a lib for files, to based on it and create my custom one
Because i dont like depending on 3rd parties
Good luck parsing anything without 3rd party libs
I guess you can use XML?
Yeah, you'd be pretty much locked into XML
Or java properties if you fancy that
No no with that mean creating a library similar to Spigot ones, but prpeared for supporting many formats Yaml, Json, Xml, Tomson
Yeah, then suddenly all those classes are required internally
or ini files
You'd have to write your own parser for that, no?
not really, basic princpal of ini files is key value
Na i already seen a propotype similar to what i will do, and each module didnt have more than 30 classes
That is over engeering from my view making many classes for somethign which can be done in less
everything can be done with less
again doesn't make it better lol
not sure why you have this idea that more classes means unoptimal
Yes make it better, because if someone new looks over the same library with less and the same with more, they willl really udnerstand more the simplier one, its basic ligic
less != simple
The core module has stupid amounts of classes, the others ones not https://github.com/SpongePowered/Configurate/tree/master/format/gson/src/main/java/org/spongepowered/configurate/gson
that a config library?
Yikes
We are arguing about coding less and more, the same thing
๐ค
That wouldn't be possible without the relatively high amounts of classes in the core module (which come from the abstraction)
Heck, for HOCON it is just 2 classes https://github.com/SpongePowered/Configurate/tree/master/format/hocon/src/main/java/org/spongepowered/configurate/hocon
Basically I am arguing that it is too annoying to look at other libraries that perform exactly the same function, but one has a lot of programming that makes it more difficult to understand and on the other hand, there are those that make it simpler
what
Yeah that is really shity looking for libraries, because they code the exactly the same logic, but with more things when can be reduced a lot
But idk maybe they are programming preferences, that devs like overcomplicating other people to understand they code
As long as the lib does what it is supposed to do I can never complain
Okay too rare, many times to be a self critical person and tell it like it is
That also extends to plugins, but usually the assumption is "it doesn't work, and if it does it will break soon" there
Bukkit plugin devs are strange people when it comes to maintainability
That yes i totally agree with you and mainly my arguments was related to plugins
Not like you are also the best there ever is either
do you remember all the relevant stuff in Java at all times? some things are required to be optimal, other times they are not. If it doesn't need to be optimal use the simplest code for it
Yes obviously I know, but it's annoying because they really know and have the experience to make it simpler, but they still do it the way they want to do it.
but all these libs exist because of varying requirements
yes because it is their project
therefore it makes sense they are going to do it the way they want it
I see your point frost, so programmers are bipolar. Because they complain when you reinvent the wheel, but that's not why they do it.
generally its also just a good idea to have each class only do one thing for Decoupling reasons
its like you complaining that I want to put a V8 into my car when a V6 is simpler
sure, V6 is simpler but in the end it is my car and it is my choice
So devs are bipolar thats the conclusion
Bigger is better
or you are and just complaining about stuff that don't warrant a complaint because you arn't going to do anything about it anyways
Because then they complain when you write your own logic for doing something which is already created
What do you mean, who said that? That's why I'm working so hard on this project, our goal is to provide simplicity to people in every way, during implementation, maintenance, etc. to create good libraries and not like all the harcode ones that exist so far. Which weigh an eternity, are not simple to implement, have bad documentation, are horribly maintained.
what are you making?
A project which has an objetive to create actually pretty useful libraries which will make programming plugin really easier
that is very very hard to pull of in practice
uhh
yes you are making your own project, which isnt the same as fixing all the other projects you are not in control of therefore no reason to complain about them
You'll see what I mean with that once you use it for something other than the intended purpose
I know, that why i started the dicussion to see what people think about that, to finally make a conclusion
The class was not found
It's an NMS class
The starloader-launcher (a mod launcher of mine) was meant to be usable for everything and be pretty maintainable.
As it turns out that statement held true for one game, but not for others
Are you sure that the tasks that perform that action are triggered?
Wdym?
Oh, you're probably using maven
Yep
Why did I read gradle...
you read what you read, i read gradle too
I'd still check whether the specialsource plugin is configured properly, but I cannot help you much further than that I am afraid
You're not using a remapper?
Lmao I forgot that yeah
Java++
Why the heck my code wasnt doing the associated componets jump a line:
// Using this code
TextComponent component = new TextComponent("\n &f&l" + command.getName() + " &7Help\n");
// But works with
TextComponent component = new TextComponent("\n &f&l" + command.getName() + " &7Help \n \n");
It doesnt make sense
cuz minecraft doesnt translate \n afaik
library?
Bungee components
\n in itemlore doesnt work either, would be nice tho
Yeah in lore it doesn't work at all
In chat it does
At worst just send empty components I guess
Arrays.stream("text\ntext2".split("\n")).map(TextComponent::new).toList();
nothing can go wrong with that, especially since we do not live in UDP world
Streams my beloved
the only fun thing about them is that they look fancy
in rust streams and normal loops compile to the same thing ๐ฅฒ
with enough JIT that may be the same case in java world
the streams impl code looks terrible
yeah unfortunate mc doesn't use UDP for some things
UDP chat would be the bane of plugin devs
lol
but I guess its fortunate that mc doesn't use UDP otherwise we would get a whole lot more people complaining about their firewalls
huh, firewalls work differently?
Is that the reason the lookup of local servers always does not work?
between udp and tcp yes
I need some help https://www.reddit.com/r/MinecraftPlugins/comments/10i0145/i_am_trying_to_make_a_minecraft_server_and_i_want/
0 votes and 4 comments so far on Reddit
probably, UDP doesn't require an active connection, it is just assumed that it should go there lol
Im not using item lore
what have I done lol
Sent an image of wide code
@alpine urchin is the packet handler not called packet_handler in netty anymore?
it is
I'm getting the same error...
how do you two
get the same error
does this have to do
with me
or my projects
I'm not the one who pinged you
ok, its probaby a thread issue
i was just injecting into netty
you might be adding a handler on the wrong thread
im on the main thread
I am doing the same thing ๐
wdym
have you tried channel.pipeline().execute i think its called
then put a runnable
qhere u add the handler
it might fix ot
but the error isnโt consistent rigjt
not every time
ye
Hmm
try as i advised
np
There isn't anything called channel.pipeline().execute
Could it be channel.eventLoop().submit you're talking about?
can't find that
yes
When the gui is closed, the player is given the items that he put there, but when the menu is recreated, they are also given out. Can you recommend something?
I mean that when the menu is reopened, the closing event is triggered.
I mean, when closing on ESC, it gives me an item that is in the menu (from slot 1). But when choosing a color, I recreate the menu (2) to change the title to replace the texture. And as a result, the closing event is triggered.
Donโt reopen the menu and just edit the contents
Is there an easy way to copy a jar file into a project to be able to do modifications instead of manually having to copy each file over?
There is no method that changes the name of the gui.
only nms
Well then deal with it
Donโt give item if you are still in an active โconversationโ with the player
Wdym?
I want to modify an existing jar without having the source code in a download
And yes I have permission to do it
git clone?
Decompile it
any tutorial on how to set up coding with intellij IDE?
Yes but decompiling it then to rebuild it I have to copy every single file over
I use jdgui I'm guessing gotta use something different
Use luyten
Thanks
That's what i use
Doesnโt look that messy
Do I then do new project from existing sources?
what for
Well
if your trying to edit that you are gonna need more than winrar
Nono
I already decompiled with
luyten I have a zip
I assume unzip and new project from existing
You can try
ask them for the source
^
It was a while ago
Else find their classes and copy those
because looking at that, all luyten does is just convert the .jar to .zip
Then make a new maven project, copy paste it in and start solving lib errors
And perhaps .class to .java
@regal scaffold Some of the are probably shaded in
But I feel if I import
Open plugin.yml
It'll be a shitshow
most are probably
Open plugin.yml
It's gonna be a mess no?
open plugin.yml
Going going
name: BRBarriers
version: '1.0-SNAPSHOT'
main: com.unclecole.brbarriers.BRBarriers
api-version: 1.19
prefix: BR-Barriers
authors: [ Cole ]
description: Barriers plugin
commands:
barriers:
com.unclecole.brbarriers. Copy this folder
Well slightly, but yes that's a start.
Damn
Obviously you need to recreate it from what you gather it needs.
Can you link me to the plugin page?
wouldnt surprise me if they still have source
I'll ask
But now that I think of it
I could just get the folder
and insert it into another plugin
And build both inside 1 jar
Since I have the rights to it
Would have to change some stuff to make it work in 1 only
@regal scaffold what ya wamma change?
exactly what file should i put in the dependencies? i put the spigot file that i downloaded to run the server but it doesnt seem to be working, or perhaps i should put another "extension"?
It's legit a 1 line fix
Ah I'll nned more context
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
check what the barrer listener class line 80 is
if (itemStack != null && BarrierData.barrierKeys.get(s).isKey(itemStack)) {
doesnt help
oh god
please tell me you didnt pay more than like 20$ for that
dont expose collections
nono
The problem is
When a player teleports anywhere on the server with any command
It just gives error
Functionality works when intended
But if anyone teleports it doesn't return
So thinks it met a block
your get returns null
like just check if event is in right world or anything and do nothing
Yes because it shouldn't be getting called
On random teleports
Just the plugins teleports
He never added a check
So his teleport event for specific plugin runs when I type /spawn completely unrelated
if I have a enum .valueOf() and the valueOf doesn't exist because of a typo in chat, how can I prevent the No enum constant error?
I mean you can catch it
try catch
or you can not use valueOf, either works
or write your own valueOf which returns null
makes sense
how are you gonna add custom materials to an enum
what methods
:?
i have no clue what you're sayin
You can't add to an enum at runtime
but either way doesnt work
anyways the constant is fine for what spigot does
How I'd fix it is
they do?
Import the plugin to ur project as a dependency
what class are you talking about specifically
because, for example, PotionEffectType has the get methods necessary
AND has a values() static accessor for the array of types
it's basically an enum, just as constants
it would make more sense to let class T implement Iterable<T>
Extend the main class, override onEnable and copy paste the same onEnable except for registering that single listener, write your own listener, register that one instead and ur done
Shade the entire plugin
And let the plugin.yml load ur main class
Other option is to write empty classess / methods for everything in the class u wamna change to make it compilable
I wanna try
Then open the jar, and replace the .class file
but you can

I mean you can check those that extend Keyed, perhaps
but other than that, I dont believe so
Tag does extend Keyed
but he aint looking for the enums xd
ah enum alike
whats the best/easiest way for me to serialize a class that is on its own abstract but I have like 3 implementations of it that all need serialization to a file like yaml or json or whatever
You can just use bukkits serilizable
how can I read a list of my serialized objects then
just using getList and casting?
no
Essentially yes iirc
Yes
Might be worth checking instanceof on individual items
okay and how do I know if I deserialize the base class which subclass i get
Hm if a list is empty, how do you check its type?
Well you don't have to
Kinda
So
oh well I guess I have a problem before that
which is that the deserialization method needs to be static
ConfigurationSerialization.registerClass(Class2.class, "SecondClass");
You have to register them
Or a constructor
Or you serialize and deserialize frm a configuration section
yeah
or atleast I think so xD
its in a yaml configuration file so I assume those are configuration sections if I get them that way
so why did you ask?
is there like a secret trick
Isnt that just when the block model takes up more than a normal block space
doors iirc
Dont think it contains any special property apart from that
nvm im just gonna let itemstack do the serialization for me lmao
I am already converting my classes to itemstacks with pdc which is also serialization
Slightly related to development, Does the spigot website offer a way to post a resource update through an API or something? Ideally I'd like a resource update to be posted when a new GitHub version is released
thats not what hes asking right?
they want to actually post the update
but i dont think spigot has that kind of support
I'm not looking for an update checker, I am specifically looking for a POST api or whether there is one
you can only get information i believe
spigot's api -> https://spiget.org/
Yeah I figured, just wanted to be sure
It's kind of bothersome to have to release a release in two places every time since I'd like the spigot page where the plugin is actually findable to be up to date, but have a semi automated release build pipeline on github
well, some people for example only release a bit bigger updates on spigot
and beta releases / small changes are available on github
or something like jenkins
The way I do it is I have an external URL pointed to that specific release. Only posting large updates would mean that people would still be getting versions with (patched) bugs. Right now we only release with significant bugpatches anyways
I mean the stinky way would just be using reflection and using it either way
No problem though, it takes 3 minutes since I can literally copy the content of the github release and have it work with all urls functional
I need some hand, im confuse why i need to use it duplicated, when it should be: platform.getProvider().getSomeSpigotMethod()
This is my implementation
Agree, i find nms really gross because its force to make things over the which you shouldnt be making
but like, obviously ?
You have a Platform<SpigotPlatform>
lol
a platform of a platform

Oh that why
yes
think of it as free obfuscation
Nop, its called Fluid something?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerBucketEmptyEvent.html
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerBucketFillEvent.html
declaration: package: org.bukkit.event.player, class: PlayerBucketEmptyEvent
declaration: package: org.bukkit.event.player, class: PlayerBucketFillEvent
and for actual movement of the things theres https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/BlockFromToEvent.html
declaration: package: org.bukkit.event.block, class: BlockFromToEvent
very useful
the fuck?
i think some people are a bit slow
excuse me you part of the pane lteam?
i think so, since he isnt dead
I'm part of the ligma team
presumably he left the server to go ask bill gates
Hey
If I'm making a world generator is there any way to not have to change the bukkit.yml to add the generator
can someone help me with this https://pastebin.com/LTBPzW2V
would be cool to know the problem
actually why do you have 2 else statements for the same if statement
That's my point how would I initiate another else or do I need to?
you would use another if statement
wdym another else
there is no other else
you can do something... or do something else
meaning whatever you didnt do at first
if {} else if {} else {}
you probably want to add an else if yeah
How would you designed a translate method for bungee and spigot colors?
Aren't bungee colors the same as spigot colors?
and if we're on the same page, you can just check CraftBukkit and see the exact implementation & design
Because i need to call method for replacing colors but as far i dont know what platform they use, i cannot call ChatColor#translateAlternativeCodes()
mm you can
- determine the software at runtime, then use reflection to get the right ChatColor class and invoke the method, the signature is the same
- reimplement based on https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/ChatColor.java#216
- use https://github.com/Moderocky/Glass and use reflection to just get the class, then it'll generate bytecode at runtime so you aren't invoking the method via reflection
@sterile token
of those all, I'd recommend #2
ehm but do note that the code in ChatColor falls under GPLv3
so if you do copy that you'll need to abide by those terms- a full copy of GPLv3 is provided @ https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/LICENCE.txt
I dont care about licenses tho
๐
But thanks for advice
What too many things all mixxed
You want to get server name from bungeecord right?
yes
Wait oh no, its the oppsite what you want
Lmao i cannot help i dont understand your questions
he wants to get the server name listed in the bungeecord configs from the backend spigot server
am I correct @quaint mantle
oh ok
i understand now
yes
and the first reply to this is causing the problem you were talking about, right? https://www.spigotmc.org/threads/bungeecord-get-server-name.60616/
yep
because you should already know your server names
if it was a public plugin, I could understand needing to do that because you obviously wouldn't know what names everyone else chooses
but personal use you already have that information
just create a config file to hold your server names
https://github.com/SpigotMC/BungeeCord/blob/5467e3a8424fdc4b72a26fc35d9a0432333fa4b2/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java#L520 it should return 2 things through the buffer
both the command "GetServer" again, and the server name
i know it worked a few years ago but now it only return getserver nothing else idk why
public class MyPlugin extends JavaPlugin implements PluginMessageListener {
@Override
public void onEnable() {
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this);
}
@Override
public void onDisable() {
//make sure to unregister the registered channels in case of a reload
this.getServer().getMessenger().unregisterOutgoingPluginChannel(this);
this.getServer().getMessenger().unregisterIncomingPluginChannel(this);
}
@Override
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
if (!channel.equals("BungeeCord")) {
return;
}
ByteArrayDataInput in = ByteStreams.newDataInput(message);
String subchannel = in.readUTF();
if (subchannel.equals("SomeSubChannel")) {
// Use the code sample in the 'Response' sections below to read
// the data.
}
}
}
(from https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel)
That'll call readUTF() once, which'll remove "GetServer" from it, and then you call in.readUTF() again to get the actual server name
if (subchannel.equals("SomeSubChannel")) {
// Use the code sample in the 'Response' sections below to read
// the data.
}
to
if (subchannel.equals("GetServer")) {
String serverName = in.readUTF();
}
definitely should work, at least according to Bungecord source code
ill try
@quaint mantle please for long codes use ?paste
that was me mate
Ohh sorry
yo itzdlg, im just about to test this and realised how the hell do i write stuff via DEFAULT
wdym
i have a switch statement to check the value of args[0] and have default:return false;} but it doesnt get called when i dont supply an argument
try removing a )
no error atm, im just confused how do i write from ItemBuilder.DEFAULT
ItemFactory.DEFAULT.write?
so i am blind
paste the ItemFactory code
because all DEFAULT is is a static constant of an instnace of ItemFactory

doesnt your ide pop up with like 2 methods when you typed DEFAULT lol
it somehow only appears with read
lmao the fuck
intellij jank
oh well
?
need to send your whole code
at least, the entire commandexecutor
ok that worked thank you @compact haven ๐
np sebii
well you definitely aren't checking console
because you'll have a fat error in there
ArrayIndexOutOfBoundsException
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
correct
small error
you may not access a value at an index that doesn't exist
so the default will only trigger if args[0] was set, meaning you had 1 argument, and it'll trigger if it was netierh "create" nor "collect"
you'l need an if statement at the top there to make sure that index exists
can i do case null:
no
f
it throws an error mate, you need that if statement
outside of the switch statement
if (args.length == 0) {
player.sendMessage("/command <collect|create>");
return true;
}
beat me to it
if you have your usage message setup properly, just a return false will do
nah u return false then it sends the message
refer
I am well aware of how CommandExecutor functions xd
or are you ๐ค
look at the message right above you

also, just a heads up, your switch will go to the default case if it's Collect, or any case variation of them
make sure you #toLowerCase() in the switch statement before you check the cases
it was 0
My Spigot Plugin Generator is finally done and fully working, at least on Windows. Maybe someone can try whether it also works on macOS and/or Linux? @remote swallow maybe?
ive only got wsl installed atm
where is those dependencies from?
from the archetype-metadata.xml
it automatically generates that from the latest archetype version from github
now I just gotta setup github actions and then people can use it
idk much about archetypes tbh
do you manually list dependencies? or does it compile from something else
it's taken from here https://github.com/JEFF-Media-GbR/spigot-plugin-archetype/blob/master/src/main/resources/META-INF/maven/archetype-metadata.xml
u know how to fix that xd
probably
thats my fault but u can fix that
just set handlers to a new ArrayList in Builder
ah so yeah you manually list them
yeah, pull requests for new dependencies are welcome
do you have any specific criteria if someone was to PR their dependency on that list? 
it shouldnt be something totally niche
i.e. can I PR CLOUD and IF there lmao
sure
that's swing + FlatLaf
how the fuck do github actions + releases work
all actions that I find on google are "syntax errors"
what works?
do these look at all any different
BetterItemConfig rewrite type thing
nice
these look identical to me
im hoping on that
i now just need to convert the name to its actual name
@tender shard dependMockBukkit is default'ed true
tried it out without any depends and it generated in pom.xml, checked archetype-metadata
and the readme says all are meant ot be false by default

looks pog Epic
did u enjoy refactoring xd
do you guys hate me
and those are?
well ive only spent
you dared show me a sidebar from eclipse or netbeans
maximum 12 hours on it
bc i dont think its bc i have 3 Ah.java
thats one of them
then what do you use?
IntelliJ
buddy you don't need bad code for me to hate you, hatred is my default feeling
its eclipse
none of these shitty "release artifacts" actions work and github also nowhere explains how to do it
at least the default isnt depressed
look at ntdi's nzcore or something along those lines
Damn. That's an optimistic outlook lol
cant find them
if he said depressed i would say "dial 988"
alex did u see my tag
refer
yeah that's because all maven-archetypes basically include a unit test, but true I should remove that
Close some tabs 
choco u cant even read the titles when I am seriously looking into something
You probably don't need those 15 S/O tabs
only the icons show
thought that would be more
You're all masochists. I'm sitting at only a single pinned tab at the moment, Slack
when I join a team using slack it'll be open, sometimes
i sometimes have over 100
that doesnt do any release
there's definitely a github workflow for publishing to github packages
same concept
im confused
somehow before my PotionEffect.toString converted it to its common name, on my createSection it doesnt
u dun fucked up
but where
@tender shard honestly they dont even have an API request for it https://docs.github.com/en/rest/packages?apiVersion=2022-11-28
you might be out of luck here
idk, send code
one moment
@Override
public void write(ItemStack item, ConfigurationSection section) {
ItemMeta meta = item.getItemMeta();
if (meta instanceof PotionMeta potionMeta) {
if (potionMeta.hasCustomEffects()) {
ConfigurationSection potionSection = section.createSection("effects");
for (PotionEffect customEffect : potionMeta.getCustomEffects()) {
ConfigurationSection customEffectSection = potionSection.createSection(customEffect.getType().toString());
if (!customEffect.isAmbient()) customEffectSection.set("ambient", false);
if (!customEffect.hasParticles()) customEffectSection.set("particles", false);
if (!customEffect.hasIcon()) customEffectSection.set("icon", false);
customEffectSection.set("amplifier", customEffect.getAmplifier());
customEffectSection.set("duration", customEffect.getDuration());
}
}
}
}
``` and old one was ```java
if (potionMeta.hasCustomEffects()) {
Map<String, String> potionEffectValueMap = new HashMap<>();
for (PotionEffect effect : potionMeta.getCustomEffects()) {
StringBuilder builder = new StringBuilder();
builder.append(effect.getAmplifier());
builder.append(" ; ");
builder.append(effect.getDuration());
potionEffectValueMap.put(effect.toString().toUpperCase(Locale.ROOT), builder.toString());
}
configurationSection.set("effects", potionEffectValueMap);
}
how do i sterilize an ItemStack
effect.toString() != effect.getType().toString()
and?
potionSection.createSection(customEffect.getType().toString()); in new code
potionEffectValueMap.put(effect.toString().toUpperCase(Locale.ROOT), builder.toString()); in old code
the only difference is the inclusion of getType()
and of course the toUpperCase, but that wont modify it past upper case, ofc
customEffect.toString() spits out INCREASE_DAMAGE:(60t-x3)
my guess is that the rest of the nonsense is removed when it adds it to the configuration section
split('(')
no
split(':')[0]

why would you split at the parenthesis
you dont want anything at or after the colon
oh yeah
how do i desterilize an ItemStack from its sterilized string form
ItemStack.deserialize?
i need a Map
how did you even manage to get a itemstack to string
yeah u just assuming we know tf u talking about
ItemStack#sterilize()
in a database
well you have 1 issue
ItemStack.serialize gives you a Map<String, Object>
what are you doing with that
yes then i do .toString() and get something like {v=2975, type=SPRUCE_SIGN, meta=TILE_ENTITY_META:{meta-type=TILE_ENTITY, lore=["(+NBT)"], internal=H4sIAAAAAAAA/03KuwrCQBCF4YkghAgWgiBWYWsRvFR2Kl7ACxa+wLgZw+i6K5sJGiTvroIEu3P4/ggggubMOH1dWGEpjpiGUOMEmje2pD2eZZJxakOoz51xHuong/r6uUd6yhi6LyWfoSZqz/aCqdt4zoTRqvLXjKBVNTtMKD4VlQ3/bIuFy6VX2QA6lU1zLexsvHZ5RqoMoLEy7sE2/YYQQPuAd/J9bQgtJUs2Qp6SAOANphosA+AAAAA=, blockMaterial=SPRUCE_SIGN}}
yeah dont do that

use #fromByteArray #toByteArray #toComplexString and #fromComplexString from the paste I sent above
u just need those methods I sent over my entire item util class
you would need to convert that json back to a map, if you want to deserialze
toReadableString to store in db?
toComplexString
toReadable is simply meant for displaying to users
and only has the name of the item & amount
and no from method, either
sorry I had given u the wrong methods
you need to and from complexString lol
along with the byte array ones
what are the byte array ones for?
to actually serialize the object
hmm good idea
if your database engine has a blob column type, u can use those directly
im using sqlite jdbc driver

so i would assume it has blob lol
SQLite is dynamically typed basically
ugh that sucks
So it doesnโt actually care
I mean what's the point of running maven when you cannot even release the artifacts lmao
the workflows are sooo useless
u can auto release to anything else lol
okay that works, now my old isue is converting them to the creal name of the effect
u can publish a docker image, publish to nexus
i could also run mvn deploy locally, which is like 10 time sfaster
and I dont need to give github my nexus password
yeah and that only works for you, meaning if I had write and I pushed it wouldnt work
and u also wouldnt have any other CI actions
remember that CI/CD isn't meant for 1 person and just a solution to deploy, like it's meant for a lot more than that
I could just give you the nexus credentials, because if you got push permissions to the repo, you can push anything to the repo you like, anyway
sure, but then what about a code quality check when PRs are made, that's a github workflow xd
hm idk most of these "code quality" things are complete bullshit
i'd much rather use maven's checkstyle plugin
welp I'm not going to argue the usefullness of CI/CD pipelines
depends how the repo is setup
they'll test the code to make sure it compiles, run tests automatically, and then deploy if so
you could have a symlink to of a directory to another repo
and they wouldn't have push access for that
i always thought that with github actions, you just make it run maven package, and then the .jar is automatically in the "Releases" section
github actions != github packages
obviously it's not the same thing
but github repo also != github packages or github actions
please for the love of god
they are
tell me if there is a way to make google shuffle in search results from "spigot Javadocs" at the end if I type something like "Enchantment"
i just have the jds pinned
Nerd
no
theres no .getKey method on it anywhere
are you confusing PotionEffect w PotionEffectType?
okay well
^^ my q
Hey I was the one who made that keyed
