#help-development
1 messages · Page 1015 of 1
why you so sweaty with final in your method parameters
my IDE screams at me for anything that could be final but isn't
^
so it is just ingrained at this point
just.. disable it lmao
Hate those damn yellow highlights
I enabled it on purpose LOL
Why
Sometimes the ide knows what it’s talking about
bro whats the style points
things changing annoy me
you will change
Yk what I love? Di with static util classes

Or even more so just static aboose
since someone on this server called me out for static abuse
i completely removed anything static from my code
Static is fine so long as it’s genuine util ie: absolutely no state
I have 1 util class in my whole project and never use static for anything else
what happens if i delete a message that doesnt exist for a specific player
I don't even make psvm static since java 22
Di for true util functions is kinda pointless
does it throw an exception or does nothing
so uh
if i have a signature for an old message
and try to delete that signature of a player that didnt receive the message with that signature
what happens
nothing
good
^ but also why would you even allow that
i dont want to keep track of who has that specific message
Fair I guess
I’m pretty sure you’re correct lynx, I had something similar long time ago and I don’t remember anything actually happening
It should be fine yea
alr
so my dumb ass can't figure out how to use saveResource to generate the dirs & then add files from inside that dir in the project.
public void load() {
for (ConfigType configType : ConfigType.values()) {
File file = getFile(configType);
if(file.isDirectory() && file.mkdirs()) {
File[] ymlFiles = file.listFiles((dir, name) -> name.endsWith(".yml"));
if(ymlFiles != null) {
for(File x : ymlFiles) {
plugin.saveResource(x.getName(), false);
}
}
}
if (!file.exists() && !file.isDirectory()) {
plugin.saveResource(file.getName(), false);
}
if (file.isFile()) {
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file);
yamlConfiguration.options().copyDefaults(true);
configurations.putIfAbsent(configType, yamlConfiguration);
}
}
}```
``` private File getFile(ConfigType configType) {
return switch (configType) {
case Messages -> new File(plugin.getDataFolder(), "messages.yml");
case Items -> new File(plugin.getDataFolder(), "items.yml");
case Mobs -> new File(plugin.getDataFolder(), "mobs.yml");
case MobDir -> new File(plugin.getDataFolder(), "mobs");
case ItemDir -> new File(plugin.getDataFolder(), "items");
default -> new File(plugin.getDataFolder(), "config.yml");
};
}```
the client does disconnect if the signature is not fully unpacked
but it should be iirc
give it a try anyway tho
i am

do you have stuff like resources/folder/file
or just resources/file
I just use json
for something like messages.yml use saveResource("messages.yml") for mobs use saveResource("mobs/mobs.yml")
cool
?
spigot will automatically make it retain that structure in your data folder
Yes, it will.
man making a plugin which allows data saving in yml, sqlite and mysql is definitely not tough but pretty annoying
so much typing
Anybody know?
Wdym reset?
nah not really
just interface, implementing classes and make util methods
Make multiple components, only adding the click event to the part you want, and then append them together
This depends on how you write the component.
Or use the component builder
well yes but
my hands, they hurt
I already do.
https://paste.md-5.net/yabuwaviha.php
type quicker
i just have 3 classes with 3 very simple methods, load(), createCache() and save(gib me cache)
anyone got some useful kotlin libraries?
does Damageable#damage ignore protection?
Well?
welp, I need ot use seperator and store the file name, but apparently this is wrong? new File(plugin.getDataFolder(), "items" + File.separator + "SkeletonItems.yml"); ?
[01:33:44] [Server thread/ERROR]: Error occurred while enabling PuppetMaster v1.0.01 (Is it up to date?)
java.lang.IllegalArgumentException: The embedded resource 'SkeletonItems.yml' cannot be found in plugins\puppetmaster-1.0.01.jar
not really what I'm asking though
it is
it says that the file you're searching for isn't where you're searching
because it's not, it's in your resources folder
and you get the data folder
which != resources folder
data folder, where you can create a folder if not present, which is a folder in your plugins folder when the said plugin is started
the resources folder is in your source code, where you store your config file for example
Ok, to me I still have no clue what you're trying to say. I am not asking to generate the plugin folder inside plugins/ ?
no that's not what i meant, sorry, let me explain rq
the file you're searching for, isn't in the plugin's data folder. it's in your resources folder. which created the error you sent
because it can't find it in the plugin's data folder
this is in your resources folder if i'm not mistaken, right? (english isn't my main language sorry)
Yes, but why would the other configs outside the inner directories find it but not this 😮
Or just use #saveResource()
yeah should work too
How do I know if a method accesses the "Bukkit API" for async code?
Because I can use Bukkit#getPlayer or Player#sendMessage without any issues
But if I use World#getNearbyEntities or Player#openInventory I will get an IllegalStateException and/or "failed main thread check"
Is there a way to distinguish these methods without running the code?
From javadocs: Asynchronous tasks should never access any API in Bukkit. Great care should be taken to assure the thread-safety of asynchronous tasks.
There's not currently an easy way to distinguish what's safe and not safe.
trial and error
Yes, but need conditions to it. else I would. if the directory exists I don't want to generate the file.
Trial and error and just asking around are your best bets.
Alright thanks 👍
np
Not sure I follow since conditions are really easy to check against.
File file = new File(plugin.getDataFolder());
if (file.exists() && file.isDirectory()) {
return;
}
plugin.saveResource("path/to/file");
ok, might be better if I explain what I am trying to achieve. I have config, message etc. in the plugin.getDatafolder(). inside the datafolder I have (in resources) a directory called items and mobs where I want to only add the files and directory if it doesn't exists. if it exists on the other hand I don't save the default file. so in other words, these two files should only load on the first plugin load.
plugin#getDataFolder() doesn't return what you want
^
#getDataFolder() returns the folder created on the server that your plugin uses.
It's named the same as your plugin name (in plugin.yml)
that's what i wanted to say when i first tried to help you
Yes, hence why I added plugin.getDataFolder(), "items" + File.separator + "SkeletonItems.yml" items file seperator and the file name string here?
No, that searches for the file in the data folder of the plugin when it's made
What you want is in the Resources folder
That's where you want the file to go, but that's not searching inside your plugin jar.
It's searching the server plugin directory.
^
we both have english as a second language xd
so doomed to happen
yeah sucks
ok, now I figured out why it doesn't work but still got no clue how I can get it though
ok, I think I understand.
allows you to access it, then you can make your initial code work
#saveResource() will be the easiest and it also has an option to not overwrite any existing files.
Usually people just write #saveResource("path/to/file", false); as to not overwrite any existing file.
^
If you want finer control, then you're probably gonna want to use InputStreams, or Jar Enumeration.
In conclusion, all 3 ways should help 👍
this feels like trying to google how to center a div after 7 years of css
Me when flexbox
In all honesty, the API could use a QOL update on this front.
Just to make things a little easier to use. Especially for plugins with multiple files.
can http clients stay connected and ask for a new response multiple times (with different payloads) like websockets?
or do i have to reconnect it everytime
oh wait nvm
Enabled plugin with unregistered ConfiguredPluginClassLoader ... v... uh
how do i fix this
?whereami
Is it possible to depend on a protocollib dev release using maven? aka in other words get the latest dev build as a dependency.
it autocompletes these, but none of them finds the artifact ID besides the 5.1.0 and 5.0.0 which makes me believe it doesn't allow dev dependencies >.<
Uh ik with gradle you can use jitpack and do master-SNAPSHOT
didn't work in maven :/
Sonatype Nexus Repository
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.2.0-20231209.220838-1</version>
</dependency>
is the latest
I'm trying to use the block action from the wiki.vg (https://wiki.vg/Protocol#Block_Action), but nothing relevant is popping up for me.
These are the only options that come up for me when trying to use block action. (1.20.4)
https://i.imgur.com/CYf1Kr6.png
How do I make a component not have all the previous formatting from the former component? I don't want that.
How can I make it so it won't?
I want a click event on one piece of text. Not the whole object. That's all I ask for, but nope.
is it possible to make a ship out of blocks and give possibility to control it? like in vehicles plugin? (smooth turns)
I don't mean the small models, I mean the big ones.
with armourstand heads, yeah
yep, each block is 1 armourstand
will end up being laggy if theres a lot
and a lot of complex math
any ideas on how to fix it ?
coll managed to do this with display entities if I recall
and it wasn't laggy
at least not from the videos he showed
Do you have those videos? Can you show me, please?
probably can find them if you search the general chat history
by the way, can display entities be solid?
can the player stand and move in the display blocks?
I've literally been asking all day about this and nobody has helped me. I'm starting to get pretty annoyed.
You arent entitled to help. People here do it to be nice
here you go
here is one of them
If no one has answered, we dont know
Thanks for being a jerk abt it.
sometimes what you ask for may not be possible, or some are just not familiar enough to give you a response. As for your question on this, in order to have a click event on just a piece of text it needs to be its own component and not part of another.
IT IS
whether they are a jerk or not, it is simply a fact that you are not entitled to help and those who help here do so to be nice and done freely and are volunteers
no one here is paid to provide support nor does it cost you
you alternatively could make a post on the forums if it turns out you might have to wait for a while for a response
I have... twice...
...no?
i haven't seen anything here?
is it possible to stand on these blocks?)
maybe, not entirely sure. That would be something to converse with Coll since he is one of the few I know of that has been messing witht display entities like this
however though as you can see, it is actually pretty smooth
Wanna make it a third time?
yesterday doesn't count...
such attitudes isn't going to garner you people wanting or willing to help fyi
i dont think complaining about people not helping you will get you help
it'll just let people to not want to help you
its normal that some of us don't like to search through the history for what you posted some time ago and just easier if you gave us a link
I recommend taking a timeout and just cooling off though
that's cool but if these blocks can be solid then that's just perfect
I'll try to check
and hes calling us the jerks lmao
It's been about 15 hours for crying out loud
sure, and some of us don't get answers until a week later
hi can someone help me?
We are community members trying to help people because we are nice of0. We don't get paid, we don't do it for any gain
and have you tried solving it on your own in that time?
Yes, for HOURS
if I recall, it gets called twice because you have two hands
this is why you have to check which hand for the interact event
or even two weeks
you sometimes just have to figure it out on your own 🤷
I think t he longest I have seen for someone to finally resolve an issue was like 2 months
i had to figure out DFU for a while by myself by looking at the src 🤷
it was a real pain tho
but it was mostly because those of us that could have provided the answer were not here at the time and just happened to be mostly busy 😛
I have tried. for hours.
read my message, I have already check that
this is normal for development. You will encounter walls like this. Best you can do is to keep researching and doing your best to resolve it or just come up with a temp solution for the time being until you can get it working
sleeping also helps
i always forget how ugly bungee chat components are
Sometimes you end up just replacing one little thing that didn't even seem related and it fixes everything
yea
no you have to check explicitly which hand, not just hand
I develop every day, with properly documented code. There is effectively zero docs on components for some reason.
but I am just telling you why the interact event in general is thrown twice
adventure still exists if you want documented stuff
yeah sometimes documentation is lacking and its unfortunate sometimes
just like conversation api
there is not really documentation for it
but the API is still there 😛
Conversation api?
yeah, and its one of the oldest parts of the API as well
and still not very well documented XD
What does it do
it allows you to create chat channels and put players in there. You can even have them respond to server related messages
and read their specific inputs
let me show you an example
I would LOVE to use adventure, it's the better of the two, but my command doesn't support adventure.
Ooo reminds me of some multiverse plugin
how does a command not support it 🤔
so, what that conversation api in my plugin does, is it puts you in a channel where you can't see main chat, but retains main chat history so when you exit you can see what people were saying. But its handy when you don't want that to get in the way
adventure bukkit platform exists
I'm FORCED to use
sender.spigot().sendMessage(pseudoFormat(player, parseMode.name()));
i had checked if(event.getHand != EquipmentSlot.Hand) { return;}
its setup to ask the player questions in which they provide their answers and takes that and applies it to the config
why
this doesn't check explicit hand, just hand in general. You have mainhand and offhand
That's what my command uses
but regardless, I explained to you why the interact event gets ran twice
it runs for each hand, whether you want it to or not
And rewrite my ENTIRE command system?
I remember a server that had a verification system where you'd get asked questiona related to the rules and you need to answer them, then these questions get checked later and you are allowed to play
yes
Not worth it
if it makes your code actually useable it is
((Audience) player).sendMessage(Component)
It seems like it is
That is one way to use it, the possibilities are endless really but point being though, this conversation api is documented a little bit but not very well to where you could easily know what needs to be done XD
but its also one of the oldest api's to exist as well, introduced I think in 1.5? maybe slightly earlier
When was the inventory api introduces? b1.7.3 cb doesn't got it
so what i have to do
well the inventory api is quite old however when it was first introduced it was pretty rudimentary in that it allowed you to get the players inventory and some others but you had to know the slot numbers
if you wanted to move or add stuff
also, you had to specifically use air to clear out stuff
b1.7.3 doesn't have inventory events, Bukkit#createInventory and generally anything useful
the EquipmentSlot enum has var HAND and OFF_HAND so i think i check it
yeah I don't think events for the inventory were not until later because at the time there wasn't much done with inventories
IE hoppers didn't exist
so moving items automatically from one inventory to another wasn't really a thing
And we didn't have a normal event system yet
also entities didn't have inventories either
shitty times
maybe so, but impressive none the less we still had plugins that did some cool stuff
I mean it should make you appreciate more just how much work had to go into them to make them function unlike today XD
holograms today are easy too, unlike in the past and with mojangs added display entities even easier
in the past you had to make use of horses and the negative age glitch 😛
I recently (last year) made a b1.7.3 plugin that added a creative inv by using nms
what I have to do?
well I don't understand what issue you are having with the event running twice
if you checked for appropriate hand it shouldn't be much of a problem
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
}
it doesn't stop the event from running twice
it stops your code from running twice
as I said, the event will be thrown for both hands, but if you only need to run code if a particular hand is used, the above would make that happen
but the event will still be thrown twice
okay, but the problem is i have condition that checks that
It would be easier if we had code ig
I sent it yesterdsy, let me find message
yeah, or some better visualization of what the issue is. If you have a check for the condition, then that means only one of the events would match
however it also depends what is going on and causing the event to be thrown as well
I hope this is not an issue of a person registering an event two times
which means you might need to further expand your conditional check
there it is
no I registered it once
it would appear you might want to inverse your check
and put all your code in the conditional block
oh its not nvm
this way you are ensuring the rest of the code isn't being ran
it is not
yeah my bad I was looking at something else
okay when I will come home I will inverse this condition and check it
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
Version 1.18
wtf is limbo
like an empty server that you can keep players in
Think of it as hypixels afk area if you've seen it
or the queue from 2b2t? or is that different
yeah that queue too
It's waiting for chunks
But it gets chunks, world is loading normally after switching from limbo to server
I can add that the player can't really interact with block also because the client don't hover on them
If the player has no chunk it will start to move slowly
and you yourself said you're not sending any chunks in limbo
man thinking of ideas for plugins to make literally just to keep me occupied is surprisingly hard
So even if the server sends chunk packet later
It will keep moving slowly?
It will move normally once the chunks are loaded
Hi, does anyone know how I could by using ProtocolLib, spawn a fake entity that only a target will see and check if this player hit this entity ?
But the chunks are loaded after he connects from limbo to normal server
But he still keeps walking slow
I can fly with normal speed
it isn't all that hard
you just running into what is called writers block, instead for development
how about making a mail/package delivery system and call it Squire ?
utilizes an entity that comes and delivers you mail/packages
Thats a good idea 😭
you can credit me for the idea, feel free to implement it. Its been something I wanted to make just never really have time 😛
I was thinking of using an entity like the witch and use some particles to make them poof in and out of existence
this way it doesn't look weird that they just simply disappear especially if they appeared in your house or something XD
also, in terms of the mail when someone writes a message using chat, the item that gets delivered is a book
to make it look like mail 🙂
My favorite thing to do is make fun custom items, creativity can run wild there
Or maybe a wall that get out of the ground, and the entity come out of the wall, a little like it's hogwart x)
yeah you could definitely do that too, using a portal
You can't guarantee the player is on the ground
creativity is everything for that
True, I made an item from that whistle thing from Guardians of the Galaxy
but you can kind of check
a poof appearing from smoke approach would be better
while true, you can guarantee the player recieves their items though
which is really all that is needed
(you could make the witch float in the air as well)
the whole entity thing is more or less for visuals
use an EntityDisplay so no collision.
when the entity is close enough to them, they will get a prompt in chat to open mail etc
and this opens an inventory for them to fetch their items
i wonder if scoreboards will ever be interactable
if they don't fetch their items, the entity will come back after a bit of time to re-deliver again
this approach avoids having to ensure all bugs with the entity don't happen and could safely be ignored lol
So you are adding "Clippy" to minecraft.
Lol, wouldn't quite compare it to clippy XD
Would you like some help getting yoru mail?/?
lmao
am I missing something with BT java -jar BuildTools.jar --dev --dont-update --compile craftbukkit im running this and in my CraftBukkit main ive repalced the Loading libs with System.out.println("Loading libraries, please wait... TEST"); just to test but its still printing the default
or does that ONLY compile craftbukkit?
it should just only compile craftbukkit
just remove the compile portion, and it should build all the projects
🔥idea
im trying to work on a little something (currently unoriginal) but if i get to that I will make sure to give you full credit
nice
im basically working on an adaptation of a vault plugin but super extensive
unfortunately it is hurting my fingers having to type that much
still seems to be ignoring the changes to craftbukkit
are you doing the changes via the patches?
i thought BT generates the patches
when it comes to customizations, I have always done them to spigot
I am not sure of that, but I do know that if you want builtools to keep the changes you need to create patches of your changes
and ensure they are in the patches directory
but I have always ignored patches and just did my changes to spigot so I can't really say more on the whole patches thing =/
btw what sdk do yall use
it is also the reason I don't contribute to spigot either since I don't like messing with patches
I think the recent one I use at the moment is java 21
I won't use anything less then java 17 though
well, it is required starting from a certain version that you have to use minimum java 17
hmm time to do more research, I still don't fully understand the whole craftbukkit, bukkit, spigot build pipeline
if im making, say a 1.8-1.20 plugin i can use java 21 right
craftbukkit/bukkit are built first with whatever patches apply to it, then those repos are cloned into spigot-api and spigot-server
also some people recommend using the zulu sdk
and then the spigot patches are used
yeah, but i thought bt did that all automatically
maybe, I personally don't support outdated versions or really super outdated ones
the wiki does mention using makePatches.sh
not sure if i have to do that manually or what
this sdk stuff is confusing im going back to python
I also only use Oracle JDK
but ye i think ima keep to 1.13+
im currently using amazon sdk, people say zulu is the fastest so might try that
fastest in what regard?
I don't really think there is much difference
They‘re all the same lol
The performance difference is pretty negligible
the only reason to use a different JDK is if you are also going to use a different JVM on top of that
and want whatever changes they made
if you don't change the JVM you are using, then which JDK you compile against isn't going to really affect performance
well i hope this plugin goes well
on another note, most people don't have projects or applications where they hit limits of a JVM to really even care about such things
yeah i dont think a vault plugin will be crashing someones server anytime soon
What event does Player#chat call? Is there a way I can view spigot api source code?
?stash
declaration: package: org.bukkit.event.player, class: AsyncPlayerChatEvent
FrostalfTypingEvent
Hey, which version is stable for now?
hopefully most of them
latest is 1.20.6
which is as stable as it will ever be
but that goes for all versions
I meant in the build tool if you are not adding a pram about the version to build this will build the stable version not last, so the stable is 1.20.6?
if it builds 1.20.6 without a flag then it's the latest stable
I raised this question because on the site last time I could check if the version was stable before I built it.
I don't want to build it for nothing.
site last time I could check if the version was stable before I built it.
?
You should still update regularly
so it really isn't a waste to build it
if the version is LTS (stable) yes
I have a problem with my bungee plugins. Here's the bungee.yml files for both:
name: DataManager
main: net.hypple.plugin.datamanager.bungee.DataManager
version: 2.0.1
author: alan
name: FriendsManager
main: net.hypple.plugin.friendsmanager.bungee.FriendsManager
version: 1.0.1
author: alan
depend: [DataManager]
softdepend: [NewtorkManager]
As seen in the files the FriendsManager needs to be loaded after the DataManager but when I run this bungee I get this:
13:12:33 [INFO] Loaded plugin FriendsManager version 1.0.1 by alan
13:12:33 [INFO] Loaded plugin reconnect_yaml version git:reconnect_yaml:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Loaded plugin cmd_find version git:cmd_find:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Loaded plugin cmd_server version git:cmd_server:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Loaded plugin DataManager version 2.0.1 by alan
13:12:33 [INFO] Loaded plugin cmd_alert version git:cmd_alert:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Loaded plugin cmd_send version git:cmd_send:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Loaded plugin cmd_list version git:cmd_list:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [WARNING] Forced host server pvp is not defined
13:12:33 [WARNING] [FriendsManager] DataManager plugin not found or not enabled!
13:12:33 [INFO] [FriendsManager] Disabling FriendManager...
13:12:33 [INFO] Enabled plugin FriendsManager version 1.0.1 by alan
13:12:33 [INFO] Closing pending connections
13:12:33 [INFO] Disconnecting 0 connections
13:12:33 [INFO] Enabled plugin reconnect_yaml version git:reconnect_yaml:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Enabled plugin cmd_find version git:cmd_find:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] Enabled plugin cmd_server version git:cmd_server:1.20-R0.3-SNAPSHOT:52ab21b:1844 by SpigotMC
13:12:33 [INFO] [DataManager] [DataManager]: Set to MySQL database.
13:12:33 [INFO] [DataManager] [DataManager]: Connected!
13:12:33 [INFO] Enabled plugin DataManager version 2.0.1 by alan
Here's the code for onEnable() of FriendsManager:
@Override
public void onEnable() {
dataManager = (DataManager) getProxy().getPluginManager().getPlugin("DataManager");
if(dataManager == null || !dataManager.IsSet()) {
getLogger().warning("DataManager plugin not found or not enabled!");
getLogger().info("Disabling FriendManager...");
getProxy().stop();
return;
}
CreateTables();
BungeeCord.getInstance().pluginManager.registerListener(this, new EventListener(this));
if(getProxy().getPluginManager().getPlugin("NetworkManager") != null) {
networkManagerAPI = new NetworkManagerAPI(getProxy().getPluginManager().getPlugin("NetworkManager"));
getProxy().getPluginManager().registerListener(this, new EventListenerNetworkManager(this));
} else {
getProxy().getPluginManager().registerListener(this, new EventListenerNoNetworkManager(this));
}
BungeeCord.getInstance().getPluginManager().registerCommand(this, new FriendCommand("f"));
BungeeCord.getInstance().getPluginManager().registerCommand(this, new FriendCommand("friend"));
BungeeCord.getInstance().getPluginManager().registerCommand(this, new FriendsCommand());
LoadData();
}
is that paper
No? It's BungeeCord 
oh wait im tripping lol
Yeah it's BungeeCord
😬
What's the best way on making a counter and knowing the time left?
Instant representing the deadline?
I was thinking on that
am I reading it right that 1.20.6 is still using R4?
R0.1
Can i do it like this? just a example
ive seen that code like a week ago
why wouldnt that work
It is oriented for cooldown, but was thinking on using it my way
Well nvm
I can just use this lol
location is not a good object to compare
no, the package names, the ones that go 1_20_R0 R1 R2 and so on
for reflections
seems like it's using R4
was just looking at my bt output
How does Duration return the time?
what
it doesn't
duration is a timespan, dunno what youre working on
Duration is a measurement of time, it's not a specific time
if you ask for seconds, yes
You can parse it into different time units
Like #toNanos() etcetc
#toMinutes(), you can check what you want to retrieve from it by trying them
But if I use #toMinutes() when it is below 1min it just return 0 min
Then seconds
Should I make a system that detects if it is less than 1min and if it is do #toSeconds?
k thanks
what you even doing
a timer but wanted to know the time left
Why use duration
so display the time remaining, just check for each unit and append it to a string?
You can make a way easier process by making your own timer system
what time left ¯_(ツ)_/¯
...
you need to store a specific point in time in your map, not a durations
^
thats why i said use Instants
map.put(key, Instant.now())
okay, i'll try then
you can then do java if (map.get(key).plus(duration).isAfter(Instant.now())
Not a fan of this
i assume you are storing the end time?
If the value returned is null you have a nasty npe
Yea
ah
Duration.between(map.get(key), Instant.now()) no?
I was assumign you store teh time it starts not ends
That was what I said before...
actually params the other way around
im getting the error Unsupported class file major version 65 when trying to compile my plugin
I looked far and wide but couldnt find a working solution
I am using Java 21
its using spigot 1.20.6-R0.1-SNAPSHOT
using api version 1.13 in plugin.yml
gradle or maven?
Yeah if it's on compile, it means your build system isn't using Java 21
Source level you might be, compile level probably not
maybe change your project sdk in project structure (ctrl-shift-alt-s)
check the properties setting in the pom
im using graalvm-jdk-21
i have java 21 installed in the system
its most likely set to a lower version
either you are not using maven to build
or you have a setting in the pom
its not a mystery
definitely using maven to build
then you have a setting in the pom that is not set for 21
then you are not telling the IDE to use maven to build
what do you click to make it build?
the run button
never had this issue before but i also only used java 17 before this
have you tried reloading maven? or clearing caches for IJ?
this makes like the 1000th person over a year or so who has issues with IJ, main reason I stick with NB
who wants an IDE that gives you problems -.-
whats NB
IJ is nice
IJ feels good
NB = NetBeans
but id be up for a switch if the other one feels better
there's just too many factors that could leed to problems
how exactly do i reload maven :p or clear cache
All the other IDEs give me an early 2000's feeling
myself and MD use netbeans 🙂
you can change the style of netbeans
no one said you had to use the default lol
Does it got a gh copilot plugin and is it faster than IJ
in 99.9% 'Repair IDE' fixes ur problems, if not it's most likely an PEBKAC
@misty ingot make a new task in the IDE for maven and change package for "--version" and check what tells in the info
idk if its faster then IJ but you can modify the resources it is allowed to have. I typically have around like 100 projects and it opens them up in matter of seconds
idk about the GH pilot plugin but you could look in the plugin repo for the IDE
How good is your hardware tho
I have a quad core 3.6ghz with 16GB of ram
Well, that's pretty similar to my hardware
I’d be nice if we could see the whole pom
IJ is slower, yes, but not by that much
honestly I don't really care which is faster as that isn't how I assess my IDE's
its whether or not does it perform what I need it to when I need it to without any issues
@late sonnet
in the end it's really all coming down to preference tbh
okay and project settings has all in java 21?
netbeans has never failed me. I have never once had an issue. Where as IJ suffers from cache dysync, dysncying of maven and the related. All these problems deriving from the IDE and not because you configured something wrong.
if you have to close out or restart your IDE to just get it working again, it doesn't sound like a very good IDE to me and would annoy me
since I like leaving my applications opened
module settings...
Is it an issue that ur using a higher Maven version than configured in pom?
Why do you have modules if you are using maven?
um holup intellij wont lemme open any projects :p
it shouldn't be an issue typically, but they should keep it relatively the same whenever possible
ok problem solved a plugin got hecked
but I also don't use IDE provided maven either
lemme see the module settings now
I use an installed version so that I don't end up with million maven versions across my projects
same here mostly for keep updated and avoid strange things with the IDE xd
I have like 3 of them installed because of some shit that required maven 3.6.1 or something like that
@late sonnet
the IDE will generally download whatever version is specified in the POM
copilot 🤢
if you use IDE provided maven
It's not great at writing code but it's great at copy pasting with replacements
Usually when I don't need it I just turn it off
full pom
Sometimes when I get sent java files I have to download them, import them into termux, open termux and nvim or cat them to read
There is no situation when you should use an outdated compiler, besides sometimes when it forces you to use a version from 2019
well sometimes the default pom provided by the IDE
i may or may not have tried that
puts an outdated maven version
or a pregenerated pom that things still use old versions
and some just forget to change it
try 3.13.0 instead
I once had the issue that some dependency or plugin or something like that, I don't quite remember, required me to install maven 2.6.1 or something along those lines to work
also, you should try using maven 3.9.7 in your IDE
if you can't recommend installing maven
a better list
Unsupported class file major version 65
well you need to update your maven version too
time to google how to do that
strange the embed maven not support that if i remember can... xd
65 is java 21 fyi
so its using the right java version
just need to update maven
and the related plugins
Intellij has updated the bundled maven
so it should work assuming Intellij is up to date
the maven version they are using is 3.8
they need to use 3.9
See bundled is 3.9.6
may be time to switch away from ij
yeah their pom was set to use a super old compiler
hence I was recommending updating all of the maven stuff
yeah
3.8.1 compiler isn't very good to use 😛
nah...
just try a local maven and not bundled for better control
Update the shade plugin as well
alright well time to see how to do that exactly
just change the version in the pom
you just change the version in the pom
and then run a clean build
it should pull in the updated maven plugins
3.13.0 is the latest for the compiler
ok so i change that to 3.13.0
Then try to compile again.

That’s just maven. :p
well that is what happens when you use ide provided
it was always set to bundled
if you were using an installed version, the error would had been more obvious
The issue never was the installed maven version
i did a total of nothing and the problem fixed itself
it was the plugin versions
^
Not sure why frostalf is so focused on the installed maven version
IJ is pretty good with downloading required tools. At least in my experience.
I can't say for certain if they changed it or not. the installed maven version or the one set dictates the versions of the plugins that can be used
I just don't consider maven and its plugins separate and that both should be checked
AFAIK, even if there was a limit imposed, you could always override it with plugin snapshots.
anyway i can finally actually start testing my plugin
certain higher level versions of the plugins are not always supported if the maven version is too low
same is true of java versions and maven versions
if the maven version is too low, it may not support the new java version as there could have been changes that made the maven version incompatible
this has happened with java 9, 12, 17
develop to your hearts content until the next major breakage 😉
maybe the next breakage might convince you to try out NB
perhaps it will
if a player opens a chest, is there a way I can edit the items inside that chest only for that player? I know that in InventoryOpenEvent there is a getView method, but the getTopInventory and getBottomInventory simply return Inventory instances, are those local to only the player or do they edit the acutal contents?
actual contents
Stable version is 1.20.4 not 1.20.6
this is the peak of minecraft ui design
you cant get much better than that without resource packs xD
C:\Users\LEGION\Desktop\test servers\1.20>java -Xmx4G -Xms4G -jar server.jar nogui
Error: Unable to initialize main class net.minecraft.server.Main
Caused by: java.lang.NoClassDefFoundError: joptsimple/ValueConverter
hmm
downgraded from 1.20.6 to latest
huh what jar did you use
Use the jars that's placed in the root folder where the BuildTools jar is
Don't try to grab and use an incomplete one
i may have grabbed the wrong jar
doesn't help
jetbrains makes IDEs for cowards, it can't even load my 15k line file
that is just one big string
💀
Reminds me of when I tried to nano a massive file
Apparently it loads the entire file in to memory at once
the funniest thing is why I need that file
I'm sending my entire wiki for all my plugins in plaintext to google gemini for it to do 24/7 ai support
I love it
gemini 💀
but oh well it can probably answer the most common questions
99% of support requests are just people who don't read
gemini 1.5 pro is a gigachad of a model, google really messed it up by naming it the same thing as the rest of their shitty lineup
it's not even close to the other models they have, it's genuinely better than gpt4 in several ways
also you probably have not tried it yet since it's still in invite-only access
1 mil context tokens, much faster response than gpt, almost perfect recall
can't really ask for better for a support bot at this stage
gpt is still doing 100k
also the api is free whereas a single query to gpt would cost me $2 with this token size, if it was even able to handle this context volume
local models have incredibly low caps, bad recall and are generally nowhere near as good
plus hosting anything even remotely decent would be like $1/hour
having tried that I'd much rather use gemini
plus gemini is free so why not
if google wants to scrape data from millions of tokens of my public wiki they're more than welcome to, I'd love it for them to do support on my behalf in the future lol
I wrote a bot using Markov chains years ago. It was pretty good, at the beginning. As it learnt it got worse.
llama should be decent
Perhaps it learned dark secrets
Once AI reaches the stage it can offline converse and sex me up I'm done with humanity 😉
Real (I am horrified by this statement)
It would be nice if it could cook too 😛
more profitable if it can sell your private info while working
Profitable for them
so that's what the modern chat bots do
yo guys. how do you properly manage config.yml
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
Take a look at how vanilla uses it
no i mean like how do you manage it
usually what u do
i need advice
how :l
wdym?
Open a class that uses it
like what's the best practice in it
hmm how to find a class that use it
Take a look around
since you've decided to use unmapped it'll be a pain
but I believe I've warned you before about that
you decided to do everything the hard way for no reason
well
I'm maintain old code from previous devs :l
If I choose to do it that way
Make your life easier and migrate
wdym invert
<red>a<green>b<blue>c -> <blue>c<green>b<red>a
wouldn't that just be inverting the children and putting the parent at the end?
and that's mm which is kinda different in that case
how do i prevent xp from being taken in PrepareAnvilEvent?
or perhaps a different event
arent components arrays internally?
ik they are in spigot
I might be able to group them into formatting and text
I have a really hacky solution that kinda achieves the same result
so I won't bother much about it rn
it's a tree structure
yeah each component has a collection of children
Hello, I have a plugin uploaded and there are 2 images in the description, but when I want to edit it, it only shows 1. Does anyone know a solution to this?
can you show us the editor?
i fixed it it was some formatting problem but thanks tho! 🙂
will a plugin made on 1.12 display a tab list in versions higher if I create this class
why tab interface exists in 1.12 if this not work
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
it works but the tab does not display commands at all
this is not a question about errors in the code
Tab interface exists in 1.12 version
.
you did not understand. The Tab Executor interface exists in 1.12 but 1.12 itself does not display any commands. Why does TabExecutor exist
Tab somethign works in something version (not sure which) with some class, but doesn;t work in some other version (not sure which)
TabExecutor is not for commands, its for arguments
its a combination Interface
both TabCompleter and CommandExecutor
yea its just an aggregate interface
yes i mean TabCompleter
tabing has existed since like 1.8 if not even before
i dont remeber this name class
and work?
So you didn't even get the name right. How do you expect us to understand and give you an answer
yes
altho the client, or even the server can may make mess it up
Sorry)
like disabling it yk
hm
So far (if I understand) you are having issues on 1.12 getting TabCompete to work on arguments?
this mean that it can work but not display?
Are you using the tab key
yes
not display arguments
to display them
then show us some code
in 1.13 and older they aren't automatically visible
you need to hit the tab key
to autocomplete
Make sure you actually did that
this was a long time ago, I just thought about it before creating a new project for 1.12 haha
TabCompleter works fine
hah
lol
i was played minecraft 10 years but dont know obaut this agag
Why not work with a newer version?
because people seem to love supporting old versions for no good reasons
hm
well, more people will theoretically (as far as statistics go) play on ur server because of the higher version range
only pirates
but I personally won't miss out on features only for a few more percent of players tbh
i mean they've been told this before Luna
the idea most dev's get is that by supporting outdated versions they gain a larger download. However, over time they will gain this anyways without supporting outdated versions
didnt see it haha
lol
Hi, I have a little issue with a json file in the resources directory.
I am loading with this:
// load config
try (
var configResource = FPRework.class.getResourceAsStream("logging.json")
) {
if (configResource == null)
throw new RuntimeException("Config file not found.");
var configReader = new InputStreamReader(configResource);
this.config = gson.fromJson(configReader, FPLoggerConfig.class);
configReader.close();
} catch (IOException ex) {
this.warning("Couldn't load logging.json (read error). Using fallback configuration.");
} catch (RuntimeException ex) {
this.warning("Couldn't load logging.json (doesn't exist). Using fallback configuration.");
}
```. The logging.json definitly exists
What do you mean you don't develop exclusively for the latest snapshot?!
i try to 😭
I atleast try to not deprecate everything directly in the next version, but I usually want to support 2-3 versions max
I only support the latest stable. They can use one of the older versions of my plugins if they want to use an outdated server version
I have no interest in back porting features
think I have somethink like 200k downloads on my plugins
not that I have updated any of them lately >>
JavaPlugin::getResource exists
Frost just too busy
o.o
its more like if you have to backport everything youll miss out on the new cool features
how can i do clickable messages in chat
use chat components
liek this where a command executes when i click on the "CLICK TO ACCEPT"
can you give me an example
?components
For hoverable, clickable, hex colored, or otherwise complex text, use the component API. Documentation can be found here:
https://www.spigotmc.org/wiki/the-chat-component-api/
@clear elm ^
can anyone help me in call about tab
ty
can you prob give the right component
just give me an example
Is qprotect obfuscator allowed for plugins?
TextComponent
component.setClickEvent(new ClickEvent(ClickEvent.Action.ACTION YOU WANT, executeAction));
if i open a config file from another plugin, like Bukkit.getPluginManager().getPlugin("something").getConfig(), will it be updated if the plugin owner of that config does reloadConfig or something like that to get the changes from disk? or do i have to do it myself? and what if i do YamlConfiguration.loadConfiguration bc the yaml file is not config.yml?
Generally you'd want to avoid touching another plugins config
there's usually no good reason to do so
except when there is no other way?
unless by touching you mean modifying it, i dont
the other way is to instruct users to change the config of that plugin
but i dont want to change anything
i want to get the price of something from its config
and i want to get the value that the plugin is using
meaning, i need to know when the plugin has reloaded its config, if possible
not possible
the plugin likely has an API
yea, it does, but i didnt find a way
specifically, im trying to get the configured price for plot claim
plotsquared
the plot claim event doesnt have a price property
or cost or balance or something
there is a lot of stuff on the plot object tho, there may be the price somewhere
Did a quick look at the source and found the PriceFlag*
thats for selling it
like, you can set a price for your own plot, so someone else can buy it
im not sure tho
try it and see
yea, the price flag is 0, even tho im paying 5k as configured
what's the setting and where
plugins/PlotSquared/config/worlds.yml, worlds.<worldname>.economy
use: true, and claim price
there is merge and sell too
Hey, so i'm trying to change players color name, but TAB overwrites it as I'm trying to do it via Team, I tried using TAB api but it didn't work, and the color didn't change. Could someone help me?
TabPlayer tabPlayer = plugin.tab.getPlayer(player.getName());
if (plugin.tab.getNameTagManager() instanceof UnlimitedNameTagManager) {
UnlimitedNameTagManager nameTagManager = (UnlimitedNameTagManager) plugin.tab.getNameTagManager();
nameTagManager.setName(tabPlayer, color + player.getName());
System.out.println(3);
} else {
System.out.println(1);
NameTagManager nameTagManager = plugin.tab.getNameTagManager();
nameTagManager.pauseTeamHandling(tabPlayer);
}```
tried that
but then 1.20.6 wont compile. Do I need multiple versions of my plugin? If so then how does a plugin like TAB support all versions with one jar?
great, but any idea where the expression comes from?
and what currentPlots is? i guess the size in plots? like 1, or 1x2, o 2x2, etc
i mean in the config
i remember i saw something about a configurable expression for the price, depending on how many plots the player owns or something like that
it has to be that
Guess I have to screenshot it for you... ignore this :p
thats not what i mean
but nvm, it doesnt matter what the expression is, as long as i use the proper arguments
Limit and GLOBAL are both static, so i guess that if i simply do Settings.Limit.GLOBAL from my plugin, ill get the same value
from the name I would assume it's the total number of plots
yes
i guess this should work
@Subscribe
fun onPlayerClaimPlot(event: PlayerClaimPlotEvent) {
val cost = event.plot.area?.prices?.get("claim")
val price = cost?.evaluate(
(if (Settings.Limit.GLOBAL) {
event.plotPlayer.plotCount
} else {
event.plotPlayer.getPlotCount(event.plotPlayer.location.worldName)
}).toDouble()
)
println("${event.plotPlayer} claimed ${event.plot} for $price")
}
for (RegisteredListener listener : BlockBreakEvent.getHandlerList().getRegisteredListeners()) {
if (listener.getListener().getClass() == a.class) {
BlockBreakEvent.getHandlerList().unregister(listener);
break;
}
}
does it will unregister only BlockBreakEvent if Listener class has other more events? I need to rewrite that one
Instead of looping every listener just keep track of your own listener
it will only unregister that specific event
if you use that unregister method
HandlerList.unregister(Listener)
ItemStack itemStack = inventory.getItem(i);
ItemData itemData = ItemUtils.getDataFromItemStack(itemStack);
itemData.setBaseStats(CustomItems.itemsFromID.get(itemData.getBaseStats().getId()));
inventory.setItem(i, ItemUtils.makeItem(itemData, itemStack.getAmount(), showPrice));```
```public static ItemStack makeItem(BaseStats baseStats, int amount, boolean showPrice){
ItemData itemData = new ItemData(baseStats.getId(), CustomItems.itemsFromID.get(baseStats.getId()).getName(), CustomItems.itemsFromID.get(baseStats.getId()).getDescription(), null, false, CustomItems.itemsFromID.get(baseStats.getId()).getBaseRarity(), CustomItems.itemsFromID.get(baseStats.getId()), CustomItems.itemsFromID.get(baseStats.getId()).getStats());
return makeItem(itemData, amount, showPrice);
}```
anyone has any idea on why do these 2 dont stack? playerdata is a serializable custom persisant data type
(both basestats and itemdata values are the same in both items)
adding pdc to an item makes it not stackable
is there any way to change that or is it a minecraft thing
their hash and equals would need to match too
hash and equals?
Object comparison
also running the first code to the 2nd item's result makes them stackable again
What?
check the impl
Is there someone more knowledgeable?
u mean this?
where else can i read it
also they have the same description, name, flags and everything
they are all determined by itemdata
like this
just google spigot stash Craft{some spigot classname}
why is 61 the magic number
prime number
the int has to be huge right
Ideally you'd use Objects#hashCode instead
yeah, that method seems chunky
their itemmetas are identical too
It probably overflows many times
hashmaps are serializable right?
What do you need the hash code for?
.
their hashcodes match but they dont stack
Nbt
thats fine