#help-development
1 messages · Page 1261 of 1
never had any issues with it personally
Using the library downloader is not shading
But you wouldn't shade in this case
I know
It's just that spigot itself uses shading for providing the libraries at runtime
And when you got a server running multiple plugins, depending on the same library
it would cause an issue
At least that's what I heard
that doesn't sound right
doesn't mean it isn't against it
Well, in that case, my issue is sorted, I'll use the libraries feature 🙂
"it's not illegal if they don't see me"
https://central.sonatype.org/terms.html
It's up to sonatype to determine whether or not it's abuse.
In short, if you're doing something that you think we may not approve of, it's probably going to be flagged as abuse, so don't do it. If you're not sure, ask us at http://www.sonatype.com/contact/general-inquiry. The fact that you take the time to ask first sets you apart from the abusers who expect unlimited free bandwidth. Direct communication will generally enable us to help you accomplish your goals without negatively affecting the community's resource.
don't the libraries get cached anyway?
They do
That's not quite what I meant. They simply state excessive bandwidth/requests which a plugin with a couple hundred downloads probably won't cause.
I'd say it's a bit different from Forge/Spigot/Paper etc that can get hundreds of thausands of installs
@light sinew Is the GUI showing up yet?
confirmed
Is this good or i should use the default menu feature?
Hello!
Guys, tell me please, how can I build spigot-api manually?
?bt
Depends on your usecase and also which you prefer
there is almost 0 reason to do this unless ur working on a fork or a PR tbh
but yeah, use BuildTools
it will generate the necessary files to manually build it
Usage: !verify <forums username>
man
i just wanna permanently delete all these folders because it feels like bloatware
or move them to a different dir
Heyy, I have a Linux Vserver. I try to figure out, how i can install a minecraft server mit mods on it! I got it actually with a tutorial, but somehow, If I am in the Minecraft console I cant return to the Linux Server, do you know how i can do it?
Can disable all of those pretty sure
by using spigot :pepelaugh:
at least remapped and spark have system properties
at most all three do

one is a superset of the other
hi guys i need help
im trying to change player nametag color with scoreboard teams only work for chatcolor
but hex colors not working
someone know any method for do this?
or other method for customize player's nametag?
couldnt u just delete Spark
or is spark integrated into Paper
global config has a spark.enabled flag
what's wrong with spark?
nothing, just not everyone always needs/wants the perf profiler enabled lol
thank you
When I upload an update to my plugin, the latest version isn't displayed on the next API page. I've tried deleting the update and uploading it again, but nothing. It still doesn't update. Any help?
https://api.spigotmc.org/legacy/update.php?resource=124156
I've been waiting for an hour since I uploaded the update.
why are ItemFlag not hiding the potion effects?
Which flags are you using
is there a difference between setting item flags on ItemStack or ItemMeta
I just did ItemFlag.values() at this point XD
so everything
should probably set it with ItemMeta if i had to guess lol
ty pixie
It doesn’t work on paper
xD wil ltry
?jd-s
why doesnt it work on paper
i still cant get it to work
stuff like that is also showing up
When I upload an update to my plugin, the latest version isn't displayed on the next API page. I've tried deleting the update and uploading it again, but nothing. It still doesn't update. Any help?
https://api.spigotmc.org/legacy/update.php?resource=124156
I've been waiting for an hour since I uploaded the update.
so you are using paper right lol
you have to add a dummy attribute
on spigot it was patched but paper not yet
this one?
I cant join their server
why lol
I think i got banned a few years ago
XD
i think some of the staff got pissed off and banned me without a proper reason...but yea
?paste
Rip
As far as I can tell, it's accurate.
ever thought to appeal
to get support for the software your using
Hummm
@kind hatch
Why do I get that version? I'm using the same link
Could be the cloudflare cache, but I'm not 100% sure.
Might take a while for it to propagate if that is the case.
How strange..
Typically it's updated within 30 minutes.
Appeal here https://papermc.io/community/guidelines, and then get support from the proper discord
But I have seen it take 2 hours before
hello, what menu api are you using? It seems such a pretty clean code
holy shit ur alive?
yeah hahah, still havent died ahahha
Hi guys, I am at a loss here... I have some custom patches to change some things required for custom plugins that were developed a while ago, my developer is no longer around and can't hire another just yet, I am following this guide https://www.spigotmc.org/threads/tutorial-adding-custom-patches-to-spigot.158694/ but what do I do since I already have the .patch files at hand? I tried to add them directly into the Bukkit-Patches and Craftbukkit-Patches folders but there was an error after compilation, something about a maven repository being blocked.
They are intended for a 1.8.8 spigot, since that is the core that the custom plugins require.
Minecraft 1.8.8 is 9 years, 8 months old.
has it nearly been a decade already?? feels like yesterday
Dude you're also 824 years old now
don't mention it
danke
824 truely was a great year
BC?
Yea, still had old combat mechanics back then
Hello, I am trying to get rid of the logic for players sleeping to skip the night. So far I can do this by using the vanilla gamerule to over 100% sleepers required, but it sends an action bar to the player still. Is there any way that I can just make people allowed to get in bed without triggering any of the time skip logic?
TimeSkipEvent.setCancelled(true)
I was just getting to that, and yes I am very aware that 1.8.8 is old, but this is an old core. I just want to get it back up and running first and then go from there. They are custom protocol support patches allowing 1.8 to 1.18 and some custom API changes.
I am just trying something again and if it errors I'll get back to you
(It's been a long time, it's slowly coming back to me lol)
this does not get rid of the action bars
did you set the gamerule back to normal
I did
it says "Sleeping through this night"
even though, yes the time skip is cancelled
that event doesnt happen until like 3 seconds after the player enters the bed and gets the action bar popup
oh I misunderstood, you dont want any message. Might be able to cancel interact and .skeep them yourself?
yeah
Ill look into that
Hello! I'm currently implementing a simplified version of Spigot's event model from scratch to learn more about event dispatching and listener registration systems. Do you have any advice on architectural patterns or design tips for building a clean and flexible event system? @sullen marlin
I nearly finished GoF book
You don't need to ping md for this
Spigot's system is pretty flawed imo 😉
*Bukkit
Would love to hear how you’d architect an event dispatcher and listener registry from scratch.
care to elaborate?
why the check on line 25? Shouldnt be necessary if registration is handled properly
and line 15, shouldnt handlers be static?
the whole HandlerList bs is pretty bs and unintuitive that if an event subclass has its own list, listening to the superclass (also with its own list) won't call the listener
it's really confusing and having to know which events are listenable over their superclasses is not good dx when it feels more like an impl detail
so many people have been caught up in the fact that interacting with armour stands doesn't call the PlayerInteractEntityEvent
but its direct subclass that has its own handler list
its cheap copy of spigot api im not professional as you are.
just want to improve myself at it
because if you are listening to an event subclass that doesn't have its own handler list, then you'll get an exception 😁
do you have any book recommendation md5
If you're going to make your own event system, I honestly really recommend just creating your own subscription type event like how LuckPerms does theirs
@sullen marlin I managed to fix it, one of the patches were not applying so I had to skip it, it was a patch for implementing sentry for exception monitoring
Does not say what the problem is with it though
breeze.getPersistentDataContainer().set(StaticKeys.damageableNMSKey, PersistentDataType.BYTE, (byte) (1));
``` if (!(livingEntity.getPersistentDataContainer().has(StaticKeys.damageableNMSKey, PersistentDataType.BYTE))) return;
byte value = livingEntity.getPersistentDataContainer().get(StaticKeys.damageableNMSKey, PersistentDataType.BYTE);```
would anyone know why this would be returning false (the second block)
you're not setting the itemmeta back
itemmeta?
nvm
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalArgumentException: Invalid namespace. Must be [a-z0-9._-]: Clans [in thread "Server thread"]
Uh it's a part of my code
what is the best way to compare inventories? is there some sort of identifier that can be set to each inventory
I dont want to compare all items in inventories because that could take a long time
What are you trying to compare
on click event, i just need to make sure that the inventory that is clicked, is the right one
eg
Wdym right one
on click event, how do i know when I have clicked this custom inventory
holy shit i just realized plugins use the java.util.Logger ?!
this whole time i thought they used Apache
how do you ban a player permanently
ban() takes in reason, expires, and source.. soo expires should be like maximum INT or something?
I think most plugins that handle bans just kick the player using AyncPlayerPreLoginEvent or PlayerLoginEvent
or event.setResult or something along those lines
ty
Well in my opinion the lack of proper registration allowing you too see a list of registered events, i would also love if one could listen to a group of events at once. for example "PlayerEvent".
TIL URI#create(String) exists
that's the proper way to create a URL now
ive been doing fuckin new URL(String).toURI() for like ages now
URI.create(...).toURL()
yeah ive been doing the Very archaic method instead
is there plugin init state that could make it load before another plugin even gets registered/recognized
id imagine not but i got a super awesome amazing idea for an auto updater
You can use the update folder though
the what
If you make a folder called update inside of the plugins folder you can put your updated jar there
Spigot should then use them during the next restart
This feature has been around for a real long time now but it's not very known
hm
Maybe not necessarily a specific question but more of a general outlet that I need to bring out. One thing that makes me hate coding is that when learning basics and all that you usually never really get anywhere specific. Most guides or tutorials that I followed for Java specially never really go much further than basic knowledge, so when I want to create something new, I always get hard stuck because I just don’t know how to do it, and asking for help or googling things sometimes helps but I don’t want to look things up every minute because I’m just so new. Are there any people here that feel the same or were like this and somehow got past it? Genuine question 
You need to learn the basics, once thast is done you are only limited by your imagination
And problem solving skills
how can I read the frames of a gif while preserving its alpha in colors?
cuz uh, all googling results don't preserve the alpha
Coding is 80% typing, 20% googling. It’s not like a math problem where you have to figure it out without any help.
As long as you understand what you are potentially copy pasting, then you are fine
I know I had to ignore the stuff that I wasn’t supposed to understand, and that was very deep for me to adapt and to learn since I was very used to understanding something fully- step by step. For example why and when do you write {}, and what exactly System.out.println does, why is it just print() in python etc.
GIFs don't have an alpha channel
that's what I heard but
I'm looking at one right now
it has a transparent background
and .gif
it doesn't achieve transparency the same way, they have a color palette which contains a transparent bit
that means that if you are parsing color properly, transparency should be kept
why
does this
happpeeeennn
What are the best websites to check for help, spigot forums primarily or?
Really depends on the specific problem, for spigot specific problems- yeah forums is best
If its an API question, here. If its Java, google
Tbh, AI can be quite helpful at times ngl
Ai can be used a search engine, most have the feature to search in the web
Being a proficient programmer also means being good at optimising google search
"rust static mutable no unsafe" fr fr
it seems to skip pixels without any transparency?
wait wait wait
when you say bit
you mean like
bit bit
or like
~8 bit?
is it like "color or no color" or does it have an alpha param
it doesn't have an alpha channel, as mentioned
you have a color palette that allows only for 8-bit
so its a true false
sec I am losign
Well what if I don’t know if it’s a spigot or Java problem haha
They are two distinct things
I think it would be more spigot related or at least spigot / paper
transparency is just treated as another color in the palette
that said, what is the code in question that is causing you trouble
its a mix of stack overflow guy's code, mine & deep seek's
private static final class ImageFrame {
private final int delay;
private final BufferedImage image;
private final String disposal;
private final int width, height;
private static int i;
public ImageFrame(BufferedImage image, int delay, String disposal, int width, int height) throws IOException {
this.image = image;
this.delay = delay;
this.disposal = disposal;
this.width = width;
this.height = height;
var f = new File(Main.DATA_FOLDER, i++ + "whythefuckdoyounotwork.png");
ImageIO.write(this.image, "png", f);
}
public ImageFrame(BufferedImage image) {
this.image = image;
this.delay = -1;
this.disposal = null;
this.width = -1;
this.height = -1;
}
public BufferedImage getImage() {
return image;
}
public int getDelay() {
return delay;
}
public String getDisposal() {
return disposal;
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
}
private static BufferedImage copyImage(BufferedImage source) {
BufferedImage copy = new BufferedImage(source.getWidth(), source.getHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D g = copy.createGraphics();
g.setComposite(AlphaComposite.Src);
g.drawImage(source, 0, 0, null);
g.dispose();
return copy;
}
if you need it
devious file name
You're using AlphaComposite.Src which doesn't respect alpha blending, change it to SrcOver and see if it works
you could also make a class for the metadata instead of just putting everything on the method lol
I assume Src refers to like isTransparent = alpha < 128?
it's mostly copied code, iss fineee
also, what about these?
ah, wait no, not the code-
oh now it works
thanks man ;]
the GIF format seems to have a thing called GCE which is like a header that's added per frame
that tells you whether a frame has transparency and the color index in the palette to treat as transparent
GIFs also seems to support local color tables however I don't think most GIFs readers support that feature
what the hell are those
have you worked with graphics like this before that you knew about the alpha composite?
more or less, I've done a lot of JavaFX at some point which forced me to learn a few things when it comes to image formats too lol
okay, maybe a bit of an odd question but uh
...why does this code draw the images over the very first frame?
like
well, you're not disposing of the previous frame properly it seems, but I haven't yet looked at the code to verify
the code seems to be a bit convoluted
you also don't seem to be handling the doNotDispose disposal method
how do I
you just take the frame and copy it over
I am having a hard time reading this on mobile lol, let me wake up and turn on my pc
hi, I have a question. I'm recently learning modding on 1.21 by using my known experience on 1.20 modding but it seems that custom payloads got changed. Is there any way to use the updated custom payloads on modded client to communicate with Bukkit/Spigot servers? It seems that newer Spigot has patched DiscardedPayload and forced it to hold data but unfortunately this is undone on vanilla clients.
I've searched around this but nothing useful. :/ Since DiscardedPayload is a record I had no idea on how to do workarounds using Mixin in my mod.
Help I want help
I want share EVRYONE my plugin for Minecraft server
How to create projects can you tell me
I can't find projects option
Are you trying to upload your plugin to spigotmc?
Make sure 2FA is enabled
Yes it's already on
i like your enthusiasm
Thank you for helping 😊
Then you should have a post resource button in the top right of the resources page
I am New so that's why I don't know
It's?
Can you come vc i will show my screen share
Olivo BRO help
Also if you're on mobile it's centered at the top
Thank you
I-
um
it doesn't
um
this breaks it, very much
\o chat
how do I call the thing that prepends messages from certain plugins/mods ?
The [Skyblocker] in this instance
sounds lame lul
bro skipped english class
Hi peeps :)
I just have a quick question about maven. I am familiar with what maven does and more or less how it works. But just to make sure I understand it right:
does maven manage updating your spigot api version for you? does it do it automatically or every time I build it?
if the version is postfixed with -SNAPSHOT, it will fetch the latest snapshot of that version
but no, it won't automatically increment the version itself
^ it doesn't do this every time you build though, there is a cache duration
is there any way to make a Wolf play this animation?
https://media.discordapp.net/attachments/1211513474681675820/1363880572153364590/Wolf_shaking.webp?ex=6807a444&is=680652c4&hm=0572dbae06f9efef7915abf192cf975b47707b7e9dfbc4bbdebaa60b63bc7639&=&animated=true
i see a isWet() on his class
interesting.. because I just opened a plugin from a while ago and I'm pretty sure I had some errors that werent there and they were all api related
for example if you build against 1.21.4-R0.1-SNAPSHOT, you will always build the latest build of 1.21.4; but it will not automatically switch to 1.21.5
ahhh bingo.. I havent worked on it since almost a year
I see and If I want to update I just change the pom.xml and rebuild?
this is one of the biggest issues with maven, that is, it caches the dependencies locally in your .m2, so even though your repositories might no longer serve those builds or have gone completely offline, your local setup will build; but the build isn't reproducible for anyone else, defeating the point of a build tool
declaration: package: org.bukkit.entity, interface: Entity
declaration: package: org.bukkit, enum: EntityEffect
this is a huge pet peeve for statelessness purists
wait so you're telling me out of the box maven doesnt do what it's supposed to do?
it does, but as with all solutions and things in this world, there are caveats
oh thank you
oh if you're offline
well that would make sense if you're offline. it'd only look for local repos or smth
but yes you can just change the version in the pom if you want to build against say 1.21.5 instead
wait till you hear about 300GB ~/.gradles
ahh nice
i have 10 of those, one for each paper userdev project 🤡
how do you guys launch a local server for testing? I've been using the build tool so far but I'm not sure how easy it is to just have multiple minecraft version and host swap between them
imagine buildtools except it gets cloned along with all of its intermediate steps for every individual project
these aren't too huge
but man loom caches are huge
speaking of paper userdev, it has a runServer goal which will launch the server directly from the IDE with the plugin you're working on, with debugger capability
what????
It loves to auto rebuild
nope, that's run-task
When I'm testing stuff..
Doesn't literally everything have that?
no...
can you send me some documentation so I can set this up? this sounds wild
boom Paper update
you're testing on WHAT??!

Take a look at the paperweight test plugin
You can use that as a base
the paper propaganda is insane
convert now
I would never 
"Premature -Optimization- Abstraction is the root of all evil."
In this video, we explore premature abstraction — what it is, why it's harmful, and how to avoid overengineering your code before real requirements emerge.
0:00 Real life analogy
1:28 Example
2:17 Issues with Premature Abstraction
5:24 Key Takeaway
5:32 Premature Optimization?
5...
man this feels like me
its so tempting to make code abstractions by assumption that you're gonna need this
Hello I add in resources my plugin how to share EVRYONE can download my plugin
Help me
help me
Yes
i have no idea what you mean, sorry
No problem
What do you need help with
aren't you the same guy who just asked this 5 minutes ago and got handheld all the way to the "post resource" ui on the site?
you want to build your plugin?
My plugin is ready
😕
what are those resources?
Idk 😶
🤡
you want to share your plugin?
You already did share your plugin?
thank you
I don't understand what the problem is?
you shared it with us
@chrome beacon now he did
now @zenith lance don't send me the link
send to EVERYONE
So my plugin is ready for everyone
fresh out the oven
Everyone can download?
yes
as ready as can be
code duplication is far cheaper than wrong abstractions is such a good statement ngl
Can you check please
how about let your friends check?
Accept my request
no
Please check your can download or not
try downloading it in a private tab/window
presumably though if its listed it can be downloaded, idk why you're making such a fuss about this
Hiya, quick question - how do you get team prefixes of a specific player?
declaration: package: org.bukkit.scoreboard, interface: Team
declaration: package: org.bukkit.scoreboard, interface: Scoreboard
ty!
I believe so
why does my new gradle project come unfinished? I am using intelliJ minecraft dev plugin
is there a way to freeze a player and stop them from moving+jumping
apart from cancelling move event
What version are you on
1.21.4
event.getView().getTitle() because it's not the inventory that has a title, it's the view
ty choco
I wouldn't recommend comparing inventory title names if you're implementing menu UIs, but that's a separate problem lol
that's one of the steps im making because i cant use equals on inventories because they're dynamic
hmmmmmm
Player#openInventory() returns an InventoryView if you want to hold reference to and compare that
== is fine but you can use .equals() if you really want to
Comes out the same. Don't think the IV implementations override it
yea ill have to use inventoryview because i cant compare titles either.. that's dynamic too
but first i need to smoke a 🚬
I have this and i have to somehow store the InventoryView.
because as soon I use the command /ban <player> , the data is sent to the sql server, and a ban data is stored, ban state saved as PENDING. So I'm still thinking things through.. after you select the values and click the green dye, data is updated in the sql server, and the player is banned.
so how do I make this secure.. InventoryView could be in a HashMap<UUID, InventoryView> ? I guess I have to create the entire class and cache all of that aaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhh that is bs
forgot to add the PENDING enum to the sql server
Yeah a Map<UUID, InventoryView> is totally fine. Just be sure to remove it from the map when the inventory closes too
Not that it matters too much tbh
yeah
so i have my aternos (iknow im broke okay) an i am trying to ad smartspawners for about an hour already and it doesnt work can somone help me?
wait no way
it works
Hello, I would like to ask: The server has Vault and Essentials installed, so why does the following code not deduct money from a player when I run it?
private static final Economy economy = getServer().getServicesManager().getRegistration(Economy.class).getProvider();
economy.withdrawPlayer(player, amount);
static final
which class is this in?
if it's in your plugin main class, or any class initialized by your main class' clinit, it will run before vault/essentials has a chance to register any providers
i always took vault for granted for economy stuff but how does it store the data persistently?
i've actually never thought about it
nvm i forgot vault is just an abstraction lol
you still need economy plugins to support it lol
Yeah the economy plugin itself has a DB or config that persists. Vault is just a compatibility layer for developers
This is something Vault doesn't explain well enough. Vault services should be loaded lazily
tbh after all those years i still dont get it why its not implemented under bukkit api
Why would an economy abstraction be under the Bukkit API?
i try try
why would permissions be under Bukkit api
vanilla has permission levels, vanilla does not have an economy system
^
fair enough
Like 0, 1,
probably not because of that but because there's many instances of how economy persistence can be implemented
Tried, gave up. Too many different wants
I tried speaking with economy developers but ultimately the idea was shut down by Paper developers who wanted so many different things
Which is usually why most of my PRs get doomed to review hell lol
One thing too is that not every server needs an economy. Maybe it’s better to have it be like a plugin server extension than something built in
No, an abstract API directly in Bukkit should definitely be a thing
Sponge has one, even
there's one for permissions so i don't see why we couldn't have one for economy
why not two?
That sounded sarcastic, I'm being serious lol
Actually unifying economy would probably be better. I took a look at Sponge’s and honestly it would be very useful so there aren’t a million different economy plugins to hook into
how do I know know what the dependency parameters are when I would like to utilize a plugin in my project?
like world edit's for example
Heya, on the PlayerDeathEvent is the getEntity method returning the player that died or the thing that caused the deatrh?
I assume the player
usually when you need the killer you do getKiller() or maybe this method is outdated
its been a while since I made a plugin
what packets do i need to send in order to change a player's head rotation? neither entity look nor entity head rotation do anything
Yeah those are the packets
PacketContainer enforceRotation1 = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_HEAD_ROTATION);
enforceRotation1.getIntegers().writeSafely(0, entity.getEntityId());
enforceRotation1.getBytes().writeSafely(0, (byte) (playerEyeYaw*256F / 360F));
PacketContainer enforceRotation2 = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_LOOK);
enforceRotation2.getIntegers().writeSafely(0, entity.getEntityId());
enforceRotation2.getBytes().writeSafely(0, (byte) (playerEyeYaw*256F / 360F));
enforceRotation2.getBytes().writeSafely(1, (byte) (playerEyePitch*256F / 360F));
Bukkit.broadcastMessage("Yaw " + playerEyeYaw*256F / 360F + " pitch " + playerEyePitch*256F / 360F);
ProtocolLibrary.getProtocolManager()
.broadcastServerPacket(enforceRotation1);
ProtocolLibrary.getProtocolManager()
.broadcastServerPacket(enforceRotation2);
this does nothing
Are you making NPCs
Teleport the player if you want to rotate them
i need to change the player's rotation every 4 ticks
if i teleport them they would be stuck in place
(i tested this already)
neither of those are the packets you're looking for
oh
what you want to do is send a relative move/teleport packet
and set the yaw/pitch to relative
thanks
or if you want to enforce a specific direction, rather than rotate, set them to absolute and the xyz fields to relative
🙏
you either use a hosting platform or run apache/whatever on your own server
teach me king
what distribution are you using
cloud falre
what
well you first have to actually make the website
and then you can think about hosting
well
@craggy lagoon where are you running your minecraft server?
how do i make a website
cloudflare pages is great
from my compute
i was asking them for their server distro
start off by learning HTML, CSS and JS
not relevant though?
very relevant if they want a tutorial on how to set up apache
not relevant if they haven't even made the website yet
i only know english
those are programming languages-
what is apache
troll elsewhere
not relevant for now
.
i dont want to
no website for you then
hello i found an old plugin for a hardcore server that kicks everyone and regens the world when anyone dies. i just want to make one small tweak to it but i have no clue how plugin development or java at all works. can anyone help me out?
sure
is it open source or do you only have the jar
what do you want to change about it?
ill take a look
thanks bro much appreciated
what minecraft version are you gonna use it on
1.21.5 but this version was working fine when i tested it
no source code but depending on how the classes are laid out it could be easy to selectively recompile the part of it that'd include the delay
its two classes
lol
the furthest i got was i could see the java classes but couldnt edit them i got no clue how it works ive only worked with python
recaf allows u to pretty easily edit the classes directly
but i forgot how to add libraries in there
@deep parrot do you want it to broadcast a message or something
sure
cant send files here
here
will try it now
ok there might be an issue with formatting
let me know if u see  in chat
this one shouldnt have that issue
yeah saw the A but other than that working perfectly tysm man
nvm fixed thanks again much appreciated
search for java devs
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Okay, I don't wanna be like overreliant, but every change I make that results in the primary frame not showing up also results in some other gifs having their frames be corrupted
Just like before the src alpha component switch
Also, doNotDispose frames render correctly without doing anything else here (again, except for the primary frame being the background)
I am honestly more confused by the code tbh, what are you trying to do with the gif?
because if you're just trying to read the frames of a gif, you don't have to do all that
I have 2 plugins that depend on each other to make a basketball game, one does the basketball stuff and the other keeps score, the only problem is, is that only one game can run at a time. How would I generally make it so you can create multiple at a time and then those individual games keep track of themselves
confusing scenario
are the plugins developed by you or are you using someone else's?
By me, but I didnt forsee the issue of multiple people trying to play at once and the plugin mixes the 2 games together. So if someone wants to shoot the ball in one game, but someone else has the ball in a different one it causes issues because the plugins think they are the same game
it also broadcasts every message it sends instead by the individual players in each game, but I dont understand how I could group them together
Spigot uses MCP, right?
no
it does not
I don't think anything has used MCP in ages
well I was using it, but that's also just because someone has told me
what is used nowadays?
what are you trying to do
well I already used MCP, I was just wondering how .patch files can be made, I think Spigot has them
like how is Spigot set-up?
when they edit server source code, are those .patch files created right when hitting CTRL + S to save?
I am
Xd
I couldn't do it with a gif img reader
@silver robin forgot to @ u
you make a commit to the Bukkit or CraftBukkit repo, and those commits get transformed into patches when running rebuildPatches.sh
so Spigot doesn't even make patches?
the commits are patches
like it's all just from Bukkit and CraftBukkit?
for the most part, yes
and the other part?
well, there's a few patches from the Spigot repository, but those are not really used anymore in development
they can be made by making a commit on the respective Spigot-API/Spigot-Server folders that get generated when you run applyPatches.sh, however Spigot doesn't do development there, aside from the few patches that actually reside there due to historical reasons
oh because I was also wondering about how one can contribute changes for Spigot, but if it's like not at Spigot then, uhh idk 🤷
you just clone the Bukkit and Craftbukkit repositories and then make your changes
once you make your changes and test them, make a commit (preferably on a different branch) on each repository with your changes applied and then you just push them to your stash fork
once you push them to the fork you can make a PR from the bitbucket UI
but what are you trying to use the gif frames for
when i use compileOnly in build.gradle, and the needed dependency is a plugin which is added to dependsin plugin.yml, it should work without any further configuration right? as long as the dependency plugin is on the server
Yes, but that sounds like a leading question
What is your issue?
i have a Utils plugin which is required by my lobby plugin. utils plugin is build as a fat-jar and has an artifact in MavenLocal. my project uses compileOnly(<the utils artifact>) and depends: [<utils plugin>], but i still get a NoClassDefFound error
if utils plugin is disabled, it should not work right?
Show the build scripts for both plugins
?paste
If the Utils plug-in is disabled then it most likely won’t work, yeah
wait im probably stupid
Lol
and do they use MCP?
No
Spigot has its own set of mappings if that’s what you’re interested in
There’s MCP-Reborn but that’s also become inactive as of lately
@sly topaz alr i was stupid. now that the utils plugin is enabled it works correctly
ty!!
But why
I need to select at most 16 frames out of a short gif and later reanimate it
and how does one use them?
vanilla gradle
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
hi fellas
my custom entity keeps following even after the player crosses a large distance and im not sure why, since i specified false in the constructor for field followingTargetEvenIfNotSeen
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0D, false));
Is it to do with the max follow range on the server settings perhaps?
so how else?
I need diff types of infos about a game like the player count team played amount, map etc I want to make all of that in a var which statement I should use ? Because rn I'm using 4 vars and I don't think this is the right way
Hi chat
like you want info about the minigame state?
I want to make a var with all this stuff and don't create 10
What you're asking is extremely vague
can you show your current code
I have some public static int/string that I want to list all of them in 1 single var for make it easier to see and don't fill my code with this vars
Other ways I would use a database but I don't have to do any saving data so I think it's useless
sounds like you just need to use a record class?
again, without code I have no clue what you are talking about
I will explain better tmrw
Can you send me a resource for see how this work
Hey guys I get a versioning issue when using worldedit's BukkitAdapter..
cannot access com.sk89q.worldedit.bukkit.BukkitAdapter
bad class file: C:\Users\gamer.m2\repository\com\sk89q\worldedit\worldedit-bukkit\7.3.4\worldedit-bukkit-7.3.4.jar(/com/sk89q/worldedit/bukkit/BukkitAdapter.class)
class file has wrong version 65.0, should be 61.0
Looks like you're using an old Java version to compile
I don't believe I updated any packages
why would this happen all of a sudden unless something got updated. but I dont think maven does that on its own?
it has been almost a year since I worked on that plugin so maybe that?
but files have been unchanged
Maven uses the jdk set in path
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
<version>7.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.3.4</version>
<scope>provided</scope>
</dependency>
<dependency>```
You don't need to modify the pom
Just change the version of Java maven is using in your environmental variables
That would be in path or JAVA_HOME
im using IntelliJ, wouldnt I just change the project SDK?
You can change the java version in your pom
Environment variable is a round about way of doing that
I believe that sets it for you
Yes
Pointing to the jdk install location there is not recommended
Don't put system specific file paths in there 🙏
What? It’s not pointing to a file location
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
on phone so no format, but you can set compiler target version
The jdk cannot understand a Java version newer than itself
Which is the issue here
Source/Target won't change which jdk is being used
Only what version the compiler is targetting
So setting that will change nothing
Ah you right
why do some people develop plugins in kotlin?
why?
because some people prefer kotlin over java
fair enough
Those people are weird
but like why would someone decide that
-# Gottem
also fair
you're weird smh
i think it has something to do with peoples background like i come from c# and java is more natural to me
Nah I think it’s just personal preference
it is just personal preference
but personal preference comes from background
says who
I'm probably the biggest kotlin fan in this server and I started out with JS and Java
Java was my first lang as well
so yea no
my friend (@ suitsnap) told me to try kotlin one day and I've been using it for almost two years now yea
does it have any advantages to when you coded with java?
I mean it’s just another language
I mean, look at the docs of the language and see for yourself
I solved this. This is sent to the client as a SERVER_CHAT packet, so I intercept and cancel it if it has the translation key "sleep.players_sleeping" or "sleep.skipping_night", no need to fake put the player into a bed
tbf
kotlin and java are pretty similar
java is sometimes slightly longer in some of its definitions
they aren't that similar
and kotlin is sometimes too implicit
var being a variable is also something no other languages would dare to do
so unique to java
explicit mutability is a good thing
aren't editors best for that?
and have the compiler see for itself whether something is actually mutable
are you suggesting mutability to be inferred
that's the stupidest thing I've ever heard lmao
i'll take explicit mutability over explicit immutability any day of the week
final abuse in java vars is one of my pet peeves
definitely
sometimes its just unnecessary to define
no it isn't
what I was going for-
I'm talking immutable primitives
but, why
okay, so that we're on the same page
I mean that local variables (be it primitives or object references) should not need to have an explicit mutability keyword used, as it can be inferred by the compiler
.
inferred mutability in some places brings the clarity level down to zero ngl
i generally don't like making it explicit either way, because mutability/immutability doesn't really describe what we try to achieve most of the time
are you coding in a notepad
how is that relevant
generally when you want locals to be final, you don't actually want them to be final; you want two or more variables to be coherent
ah, if only IDEs existed
e.g. you have variable a and variable b and some constraint between a and b must always hold; suppose assert (a == 10 - b)
a or b or both or neither being final doesn't quite represent this
mutating one is fine but if and only if you mutate both and respect the constraint
is there a language that makes this easier somehow
just curious
i'm not aware of any that really makes it easy natively, but anything that supports tuples natively makes it easier, since then you can make a and b a tuple
kinda wild that java.util does not have a Pair class
oop purists want you to create a case-specific class for each pair
e.g. Map.Entry is essentially just a pair
i do kind of see the point but it is excruciatingly inconvenient most of the time for sure
its more than that
its associated with a map
I guess you could instantiate it without a map, but like, why
yes
I do not see the point
there is an OptionalInt
(unfortunately)
why would there not be a Pair, IntPair etc
i hate optionals
optionals are so painful
We unite then
but we fuck with Option and Maybe :D
tbh, records make it pretty simple to create a specific bi value type
hmmm i wonder if we could use npc's with pathfinding algorithm agents
i suppose it has been done before
Npcs with pathfinding has indeed been done before
I just use an invis zombie and make the npc mirror it’s location
I want to equip them with guns and make a gta online style
Hmmm
So cool
Could look in to Sentinel
mojang mappings are just the names of classes/methods/fields
it has nothing to do with the usage of those, no decompiler can heuristically tell where any given 20 or 50 int literal in a method is coming from
public void spawnCustomZombie(Location loc) {
Zombie zombie = loc.getWorld().spawn(loc, Zombie.class);
zombie.setHealth(20);
TextDisplay display = (TextDisplay)loc.getWorld().spawnEntity(loc.clone().add(0, 2.5, 0), EntityType.TEXT_DISPLAY);
display.setText(ChatColor.RED + "❤ " + zombie.getHealth());
zombie.addPassenger(display);
zombie.setCustomNameVisible(true);
}```
so how do i get the textdisplay to actually show up here, zombie spawns fine, no errors, just no display
keep in mind that text displays are invisible from behind
so unless you are looking at it from a particular direction, you won't see it
try enabling billboarding on it
code looks fine
display.setBillboard(Display.Billboard.CENTER); like this yes?
myeah
never worked with textdisplays ever 😭
hm okay so yes i can see it fine, but yeah t disappears from behind, any info on how to fix this
Dont think you can for the static ones
You can just mirror it on the other side
public void spawnCustomZombie(Location loc) {
Zombie zombie = loc.getWorld().spawn(loc, Zombie.class);
zombie.setHealth(20);
TextDisplay display = (TextDisplay)loc.getWorld().spawnEntity(loc.clone().add(0, 2.5, 0), EntityType.TEXT_DISPLAY);
display.setText("[RARE] Zombie\n" + ChatColor.RED + "❤ " + zombie.getHealth());
display.setBillboard(Display.Billboard.CENTER);
display.setDefaultBackground(false);
display.setShadowed(false);
display.setSeeThrough(true);
zombie.addPassenger(display);
}```
no clue how but this lets me see the display from behind
Maybe the see through option?
I mean
If it’s got a billboard set to centre it should never really have a “behind”
It always renders facing the camera
^ not sure the technical side of it but I use billboard text displays as nametags on all the entities on my server and you can see them from all sides
That should work
whatever it is, i am glad it worked ahaha, i am wonderng if i can get rid of the dark box that is around the text
I am coding a bunch of features and keep getting kicked for
[02:49:53 INFO]: kingbluesapphire lost connection: Internal Exception: java.io.IOException: Error while read(...): Connection reset by peer
How do i find out more
is that the only thing that's sent?
so, the health display gets refreshed when it gets damage?
where can i see all the events in spigot
is it possible to listen to player.setHealth
navigate to the Event class and click on implementations in your IDE
nope
does anyone know why using Player#breakBlock is so much laggier than when a player breaks a block normally ingame
It shouldn’t be
How are you invoking it
i made a custom mining system that sets the players mining speed to 0 and then keeps track of block damage itself, and then when a block should be broken it is
so the player is no longer breaking blocks itself and for every time that they would, a block is broken
so no more blocks are broken than usual
the damage system seems to not be a cause itself but timings are showing that this system is really very laggy with a bunch of players and that Player#breakBlock is the major cause of it
in another matter i made some custom events and invoking those also seems to be disproportionately laggy compared to other spigot events, could be related
are custom events and their listeners not cached?
Show code
Show spark report
what is the most clean code way of handling alot of messages in the plugin? like help commands and error messages, joining lobby, losing a game and so on
first I had strings lying around the whole code base. then I unified a "message handler" class that can be interacted with
but I still find my solution kind of unclean
basically I have a config file with all the messages the plugin will ever output. I save them each in its own variable and add a public getter for my plugin's use
but I still feel like there could be a more dynamic way of doing this? I'm not sure
There’s really no other way. I mean you can skip the getter methods and make them static constants because they don’t change. But other than that that’s the most you can really do
okay, atleast I know i'm not doing nything stupidly unscalable
I have a Locale interface with just constants and it’s like 600 lines long
don't cache them and access directly from a config with path
That’s no different from a constant
hmm.. but don't I get a slight performance boost when I read from the cache instead of doing a hundred read opperations each second?
the plugin is a minigame and is supposed to work for days under stress. so initial load times are not that big od an issue
The issue isn’t performance. You should use a constant for messages because they could be used multiple times (design wise it’s easier to just change the key in the constant), and they are not changeable. Keeping them as a singleton constant would be ideal
don't load your config every single time to read a message, cache it and then access the message, entries inside of the config are basically cached because it's a map inside
ahhh I see
i understand that I was taking to Fqsler
but finals have to be initialized.
how do I do that when I first have to read the config
How I do is I have a separate properties file and load it into a ResourceBundle
That’s how most software these days do it
Like the locale_en_us.properties
And then I just have a class dedicated to storing these constants and loading them all at once at start
huh.. that's new to me.. do u have a resource out there I can read through? or a video i can watch?
Idk waht ResourceBundles are
I use minimessage and adventure components to color my messages, as well as arguments
But I have a locale class like this https://github.com/PulseBeat02/MurderRun/blob/main/src/main/java/me/brandonli/murderrun/locale/Message.java
I load my properties through my manager https://github.com/PulseBeat02/MurderRun/blob/main/src/main/java/me/brandonli/murderrun/locale/TranslationManager.java
You don’t have to do this btw
I know I'm just looking for a really scalable way to manage my messages before I add 200 messages
also to let users manage their own localizations or to add mroe laguages later
i need to store diff info about a game but i think it's useless to do it with a databse how can i store datas like Player amount, map name, player limit, whitelist, player for team blue, player for team red etc
variables 🧠
or just in a file
ye i'm currenly using a lot of var there isn't a way for store all with the same var and then like test.playeramount test.x for all the stuff?
This is what Objects are for
what scenarios would EntitiesLoadEvent be called, besides a chunk being loaded by player?
Whenever a chunk is loaded I would guess
I assume the game always loads entities when a chunk is loaded? Idk
Every time any entity goes through the portal, it loads the chunk
Is there a way to check if a player is pressing w, a, s, d, space or shift when he's sitting on an armor stand?
i dont think so is there?
maybe listening for things that would correspond to that
but not the keys itself
I believe shift is the only one
You can most definitely do it on something rideable
isnt there some kinda input event?
I saw a vehicle plugin one where you could fly helicopters by ascending and descending with space and shift and moving forward and backward with with w and s and turning left and right with a and d
yeah this is one I meant
Thanks!
It is possible to send to the player clickable text outside chat? From what I have looked is not possible in actionbar, scoreboard or title. Or it is?
That's what I thought too, just making sure. Thanks
I'm starting to think there isn't a way to get the actual frames of a gif
there def is
I know that aseprite can open gifs as animations
I mean as BufferedImages in java
used this one
first frame is always the background I am losing it
as youve been told yesterday too, (record) classes is what youre looking for. and at least classes are basic java
like whyyyy
this happens every time I try to fix that
is it possible to set the amount of an unstackable item, like enchanted book? because ItemStack#setAmount doesnt seem to work
first you gotta ItemMeta setMaxStackSize
oh thanks, that worked!
keep in mind that this will not work if the item is damageable like armour, tools etc
public void noBlowUpCreeper(EntityExplodeEvent e) {
if (e.getEntity().equals(EntityType.CREEPER)) {
e.setCancelled(true);
}
}```
anyone know why this isn't working? events are registered and stuff so not quite sure whats going wrong
an entity isn't an entity type
ah
for enums you can also just use ==
#.getEntity().getType() ?
e.getEntity().getType()
ok so im kinda having a brainfart rn
if i want all except the last one i just do ~0x0100 right?
another alternative (though i dont recommended doing this, and instead do what the people above me already said) is to do e.getEntity() instanceof Creeper
flags &= ~0x100 yes
Hmmm
im trying to use this packet
to rotate the player's yaw by 3 degrees
PacketContainer headRotation = new PacketContainer(PacketType.Play.Server.ENTITY_TELEPORT);
headRotation.getIntegers().writeSafely(0, player.getEntityId()).writeSafely(1, ~0x0100);
headRotation.getDoubles().writeDefaults();
headRotation.getFloat().writeSafely(0, 3f).writeSafely(1, 0f);
headRotation.getBooleans().writeSafely(0, player.isOnGround());
protocolManager.broadcastServerPacket(headRotation);
when i do this
i get
illuminator3 moved too quickly! 82.34877574138198,-93.0,-182.19995843594901
i don't think that has been a bitmask on the packet class for a long time
that's what it is in the protocol but the actual class is like some FlagSet object
wait
wrong packet
i meant this one
https://mappings.dev/1.21.5/net/minecraft/network/protocol/game/ClientboundTeleportEntityPacket.html it's a Set<Relative> what you need to alter
[private final int net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport.b, private final net.minecraft.world.entity.PositionMoveRotation net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport.c, private final java.util.Set net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport.d, private final boolean net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport.e]
you were faster than me
how would i do this with protocollib? im not sure if it can wrap enums
i love that theres no documentation on this
Is it possible to deliver a message to an offline player?
what do you mean by that
Save their UUID's to a yaml, get it through the yaml and deliver the stored message?
sure why wouldnt that be possible
what kind of message are we talking
but won't it return null?
you can check for login event
and deliver message then
the /msg command is vanilla
this packet doesnt exist for me
i imported nms insetad of just api
My brain is still funking out
but ClientboundTeleportEntityPacket doesnt exist
Are you using maven or Gradle?
what version too
Old versions of Intellij do not support Java 21 which Minecraft uses and can cause issues with classes missing
^
For some reason it's very common not to keep IJ up to date in here 💀
...
im joking
I use 1.8.8 with java 21
gradle
not with classes missing in the library i imported
its literally not present in the jar file
Which remapper are you using
Anyway, when a player logs into the server, I store their UUID or username in a YAML file. Then I retrieve it from the YAML as a string. Will it return null?
Or am I doing something wrong
why would returning from yaml return null
show code?