#help-development
1 messages · Page 875 of 1
its named after my lib Pineapple
Next time i make a new plugin im naming it after a fruit
i name all my libraries either a word in another language or after some random tihng
my Database Library is called Raven
what is the best way to make events compatible from 2 different plugins if there is a possibility that 1 event will be processed in 2 two plugins at once
Priorities
@EventHandler(priority = EventPriority.HIGHEST)
I have no idea why but when i launch my server im getting a warning about the server couldnt read my config correct
Config: https://pastebin.com/D1RvhAPr
which one is best
i mean what priority is usually given if the role is the same
CTRL + LEFT_CLICK on it too jump to the enum
hmm could be a NORMAL
I think their is EventPriority.NORMAL that's given by default
HIGHEST
Event call is critical and must have the final say in what happens to the even
LOWEST
Event call is of very low importance and should be run first, to allow other plugins to further customise the outcome
@eternal night kinda confused how to include the core in my published jar. Right now it only contains the modules code https://paste.md-5.net/uricuhohix.cs. Are you sure I don't need shadow jar?
for example, there is protectionStones which processes possibly playerMoveEvent and my plugin does the same
both need send message to player
what they in region
Ok is their some sort of interference occuring?
Whats wrong?
Can someone help me please?
Yeah i dont see the problem with two plugins listening to the same event
Its very common that multiple plugins listen to same event lol
(I assume) that when processing the event, a message is sent to the player about the player entering the territory, my plugin does the same
Thats nothing u can change with EventPriority
If that other plugin sends the message
And you cannot disable it, therefore you must remove that plugin, or change that plugins code to not do that
Otherwise your stuck with two plugins doing the same thing
I just said that it wont matter
Either way the message will be sent from that other plugin
I just said
Re-read what i said please
What i would do:
-
See if you can change the message in the other plugin to include the message you would have wanted to send in your plugin's 'PlayerMoveEvent'
-
Decompile the other plugin and just change it manually, and then re-compile
?
I just didn’t expect everything to be like this, I was told that protectionStones will be in the assembly just now
what do you mean assembly?
Have you tried configuring it to stop the message from sending? As I suggested previously.
translation error - I mean I didn't expect it to be like this because I was told the build would only change now
You just said the same thing haha, i still don't know what you mean by 'the assembly'.
@burnt elm Purpur. jk jk
what?
silkspawners
Yes?
Purrrpurrr
guys, there's a homeless cat in here
why are you purring at me lmao
Im using Luckperms and SilkSpawners and i just need someone to guide me through setting it up man 🥲
Im sorry, it is hard for me as ive never done any of this before and understand nothing lmao.... I tried typing the command for permissions in minecraft but it still dont work so im out of luck
out of luck with luckperms? how strange
thanks for the help.
i'm sorry, i didn't mean to to be mean, it was just a joke, i haven't played with those two and i don't know how i can help you on top of my head
easiest option is /lp editor
its a web editor and it gives auto completion for most commands
also lets you easily add and manage groups
you can find SilkSpawners permissions likely on their plugin page or wiki if they have one
This article will help you install and set up LuckPerms into your server.
these seem to be helpful
Does this work if im not the owner for the server?
if you don't have any form of operator you can't setup luckperms
so no i suppose in that sense
Ok tysm! Ill read all of this in a sec
Ok so i do have operator. For example; I tried using the "silkspawners.break.*" on myself in the lp editor website. But it still didnt work. What am i doing wrong...
Did you save it from the editor
Yes! I clicked the save button and ingame it said i loaded x many configs blabla
https://paste.md-5.net/adapoxenov.md
this means i can't make this task run in async?
Mm songoda
[22:32:16 INFO]: item^3: block.minecraft.stone
[22:32:16 INFO]: item^4: block.minecraft.air
for
Bukkit.broadcastMessage("item^3:"+item.getType().getBlockTranslationKey();
Bukkit.broadcastMessage("item^4: "+item.getTranslationKey());
i'm doing an ItemStack builder and it's not working, i think this may be the issue.
you have to use it inside a translation component
hmm, thanks
a feature of the plugin is making the server die soon
i've to optimize it somehow
java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Float (java.lang.Integer and java.lang.Float are in module java.base of loader 'bootstrap')
why can i not cast a int to a float?
player.spigot().sendMessage(new TranslatableComponent(item.getType().getBlockTranslationKey()));
wdym?
read what choco said
Soon you'll be able to have an ItemType and just pass it directly to a TranslatableComponent 
k thx i'll try it
marry me
I'll marry ur wife too
Taken like bacon
Caused by: java.lang.ClassNotFoundException: net.md_5.bungee.api.chat.TranslatableComponent at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:147) ~[bukkit-1.20.1-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[bukkit-1.20.1-R0.1-SNAPSHOT.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] at fr.axsc6_l.wamasterv3.interfaces.Interface.command(Interface.java:104) ~[?:?] at fr.axsc6_l.wamasterv3.commands.Commands.onCommand(Commands.java:48) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[bukkit-1.20.1-R0.1-SNAPSHOT.jar:?] ... 23 more
for
why are you running bukkit
also you cant broadcast a translateable component
you need to use Player#spigot().sendMessage
k
isn't bukkit and spigot the same ?
Anyne knows fix to this? Why sometimes when adding to a value it eather does something that ends with 0001 or 9999 and dosnt round it even tho all i did was add 0.2 to the value
it's a problem from java (the actual language)
there is the same problem with python
how did you even get a bukkit jar
Yay floating point precision
me?
yeah
yeah how did you even get that
I have my guesses
wait a second, it's 69mb too
what craftbukkit
it's recent
Well yeah
It’s 1.20.1
dont use it
why are they still releasing such jars
fuck knows
Is there a way to avoid it?
one site even realease vanilla mc jars
Round your output
some of my plugins for example won't work on craftbukkit
Or numberformat it
that's the first website when writing bukkit or spigot
using double does the same issue?
it's double in precision
Exactly!
Because the decimal point floats
for (List<String> arg :argss){
for (String i : arg){Bukkit.broadcastMessage(i);}
Material m = Material.valueOf(arg.get(1));
ItemStack item = new ItemStack(m,Integer.parseInt(arg.get(2)));
inv.setItem(Integer.parseInt(arg.get(0)),item);```
this does not works
arg contains:
[22:54:48 INFO]: 20
[22:54:48 INFO]: STONE
[22:54:48 INFO]: 0
[22:54:48 INFO]: 0
[22:54:48 INFO]: -1
[22:54:48 INFO]: ¤name¤
[22:54:48 INFO]: €lore1€
[22:54:48 INFO]: €lore2€
but i did try without and it's still not working
What
?
What is argsss
What doesn’t work
This looks cursed
it is there is arg, args and argss
it's not putting anything in the inventory
Did you try to run it again
Qick question, does use of Public Static hurt efficiency? I use it in my Manager classes that manage stuff like setting new locations so that i can call them form anywhere with just <class>.<function>().
yes
Yeah you can’t do that
no way to fix?
Make a new runnable
Yes
Anyone knows?
no, just don't abuse it
use it for utils, singletons and some other things
like static final fields
In general, using public static fields nonfinal is considered a bad practice mainly because its hard to maintain
public static final can be fine,
private static is fine for singleton instances
public static methods that are stateless and pure
I might need to learn what exaclty public, private, static and final stand for. but thanks ill note that. Up to this point i just used public and if the editor corrected me i changed it lol
public and private is for if you can access a method field from outside or not while final is to prevent fields from being reassignable and for methods it prevents sub classes from overridding said method
if final is used in the class declaration it prevents subclasses from extending said class
Yeah, atm i only use static for utils and for GUI's
you might wanna reconsider in guis
I use it to call openInventory command
So it comes out as <guiname>.openInventory(player)
yeah but if you hold an object somewhere you could then do events checks on said inventory
using names to check if you are in a specific inventory is quiet dangerous since deluxemenu found out what happened
i dont use names My classes are the gui name
how do you check in your click event if you are in the right menu?
i said <guiname> bc all guis have a class that is named after the gui
check if it is the inv object
for (List<String> arg :argss){
Material m = Material.valueOf(arg.get(1));
ItemStack item = new ItemStack(m,Integer.parseInt(arg.get(2)));
player.spigot().sendMessage(new TranslatableComponent(item.getType().getBlockTranslationKey()));
Bukkit.broadcastMessage(arg.get(2)+arg.get(0));
inv.setItem(Integer.parseInt(arg.get(0)),item);}
got this in chat
but th inv is empty (it's an inventory)
When creating ui it saves the inventory as inv and then i just check if it is the inv
value
alright
inv = Bukkit.createInventory(null, 27, StringManager.parse("&6Backpack"));
initItems(player);
player.openInventory(inv);```
example of how i would save it and create it at the same time
And StringManager would represent one of my Utils classes for strings
StringManager is misleading, name it a StringUtil instead
why is inv still empty??
You are setting the itemstack amount to 0
I know this dosent belong to here but i dont know where i else should get help
So i have a plugin that i can connect mysql to, but when i try it i am getting this error in the console
Caused by: java.sql.SQLInvalidAuthorizationSpecException: Access denied for user 'root'@'localhost' (using password: NO)
And all the information is typed right in, i have checked many times
Very useful IJ
meh, i'm just dumb xDD thx anyways
did u forgot default or smth
Either type my beloved
No idea about Kotlin, but couldn't it be that result is nullable thus it is expected from you to also handle the null branch
Hello, with nms in 1.20.4, to spawn an entity, X Y and Z types are "Double", but EntityDataSerializers don't have Double, how I must do ?
The spawn entity packet takes doubles
it's a sealed class, there are only these two subclasses. and it also compiles fine
its again only IJ complaining
but IJ complains all the time when depending on a shaded project artifact duh
meanwhile gradle doesnt complain
yes I know but there isn't Double in EntityDataSerializers
I'm supposed to set it in the entity ?
so the coordinates will be sent with ClientboundAddEntityPacket
As I said the packet takes the coordinates
which packet ?
Add entity
this packet the the coodinates of the entity in the constructor, there isn't other way to set it
Yeah
Use the constructor?
???
?whereami
bro
i'm using paper but I need to test my plugin on spigot servers
It’s one or the other my dude
So this was an xy problem all along
ik
Use spigot as dependency
if you support spigot, depend on spigot ^
?xy
If spigot is ur usecase
I need to use paper for nms
?nms
Spigot has maven remapping too
maven 😐
if you are fucking around in internals you need two different sets of modules anyway
there is 0 guarantee that papers internal functions remotely close to spigots
or that the same methods exists
maven > gradle
the problem is that this method use maven
??????
Ignore DaFeist
what did I do to you? :(
Gradle is pain
thanks Olivo
not that this matters
Paper is more simple to manage nms
I mean, either drop spigot as a supported platform or figure out how to import and remap it under gradle
If u wanna use paperweight and paper, .. ^^
if you wanna support the maximum amount of servers for your plugin, you just use spigot nms
completely wrong
spigot nms is spigot NMS
it is not guaranteed to be compatible with paper
paper nms 99% works with spigot nms
haven't had an issue with it yet
we change stuff
wanna die
ill yank ur mom
Go wat the ash
I don't fck want to use maven
I'd say I'll yank yours, I doubt my gym journey is along far enough
gradle is x100 better than maven
You don't have to
Maybe ? but I don't have it :/
I s2g stfu xD
are you living in another universe?
maven looks like html wtf broo
maven is like a regular pan and gradle is like one of those industrial frying machines
actually @tender shard do you recall thje spigot gradle plugin
patrick choe spigot remapper
Idk
Google gave this
which one do you mean
maven is like an air fryer and gradle is like making a campfire yourself to cook your food
the one epic linked
?
The actual comparison should be more accurate in difficulty
Gradle is nowhere near making ur own campfire
if the only addition you can make to a conversation is trashing on build tools, maybe find a better discussion to be apart of
yes that's what I also always use
So this would gave me nms with spigot ?
no im just bored and I got triggered
go to general to be bored 
well but nobody was talking there
and yea
What event is triggered when giving an allay an item?
PlayerInteractAtEntityEvent and PlayerInteractEntityEvent both doesn't seem to work.
Interesting
Ok thanks everyone, Il'l check this tomorrow
quick last side node
spigot NMS is not always compatible with paper NMS
if you need/want both, have modules for both or at least the option to do so
Ok Il'l try with both
?paste
Hey, I keep getting "Operation not allowed after ResultSet closed" on the getCoins method
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
don't return ResultSet
its inside try-with-resources
it will be closed before you use it again
i would personally use consumer here
but you can also return CachedResultSet
why does git claim that my main branch is up to date with remote, even though there's new commits (which I also could successfully pull)
Because you didn't git fetch :p
Would a function be alright?
hm looks like I really have to read a book about git. the unfortunate thing is that all those books start with 100 pages of trivial stuff so I get bored before they get to stuff I don't know lol
like yeah I bought a book about git, I don't want to read 50 pages about the advantages of git duh
I mean I never read a book but you're always going to learn something new about git as time goes on. Best you can do is just fuck up and learn
can't see why would you use function here, but sure why not
Learning fixup commits and interactive rebasing was a life changer
idk I really prefer reading books, if only they'd start with the interesting stuff right ahead 🥲
now you have to explaint hese
Dude I wish all novels would just give away the ending at the beginning 😔 ✊
git out or I'll commit a crime, choco

I had to learn that the hard way lol
wanting to contribute to a certain project that works around patches and stuff
🤔
Purpurfisj
Spigot does it, but yes, I do have to work on Paper forks at work lol
(not Hypixel - just clarifying)
Fuck
heretic
dang
I was just about to say when did they update
git commit --fixup <reference> lets you basically amend a commit's contents later down the line. It will commit to the HEAD of your branch and the commit message of the reference one and prepend "fixup!" for an interactive rebase to automatically find it and be like "ayo this is a fixup, imma squash this"
and interactive rebases lets you do pretty much anything with each individual commit
including squashing, editing, amending a message, or even reordering if you want
Choco ill give you 9 freddos and a dog for ur hypixel ftp info
he thinks we're using FTP
dong
Oh wait you have auto instance starting so its kubernates type thing
Smh
I append my offer to all hypixel logins and domains of them
With BungeeCord being multithreaded, do I need to use concurrent collections if I access them in an event handler, or is it safe to use normal ones?
would need to be concurrent or otherwise thread safe
an event to do with a certain player will always be on the same thread though
so event handlers are called on the player's connection thread?
Yes
anyone know how to get the player's ip?
is it player.getAddress().getAddress().getHostAddress()
it says geta
declaration: package: net.md_5.bungee.api.connection, interface: Connection
so i have a wand where i select 2 locations, then a square of particles is created to highlight the selection but the particles are off by a bit, any reason for this?
https://pastebin.com/Xmwtr0pJ
https://imgur.com/a/eMWhNEz
hello all, does anyone know of a shop chest plugin that uses minecraft metals like iron, gold, diamond, and emerald as currency or do i have to make one
I am struggling with a dumb thing
I am trying to push my project to my github repo
but it keeps missing some of the packages
i cant figure out how to force push everything
Why is reload different from a stop and then start
And is there a way using code to reload a specific plugin
how do i get a map canvas from a map
Add all of it first using git add
I am using eclipse
What exactly do you mean? If it's a map item you can get it from the mapmeta / id
declaration: package: org.bukkit.map, interface: MapCanvas
this
so i can draw on it
Yes but where do you want to get from
a map
A map item?
yeah
?jd
then maprenderer?
Yes then you add a custom renderer
im so confused
its a class you can extend
Hello I'm back, so i'm trying to make a plugin with paper packets and spigot packets, but I don't understand how I'm suppose to import spigot packets
there is no API for packets
?nms
but what are "paper packets" or "spigot packets"?
there's only NMS / mojang / vanilla / however you wanna call it packets
If the server sent a custom packet to a client the client would leave the server with an error of invalid packet afaik
I mean, when u use paper methods to use packets, on a spigot server this isn't working
does anybody know why this method works on my 1.20 project and not on this 1.8.9 plugin ?
says "Cannot resolve method 'of' in 'ChatColor'"
Well, it should be obvious that if a fork of spigot, paper, adds something, spigot does not have that and can't work with it
paper also doesnt have any packet api
?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.
.
got it
1.8 only has the regular 0-9 and a-f colors
Ok I will resume my main problem, I'm trying to spawn an entity through packets, with paper it works, but with spigot I need to define x y and z pos of the entity, but I just can't
show your code
I don't undertstand how I'm supposed to define entity pos with spigot only
packets work exactly the same on spigot and paper. so how does your current code look like?
private void build() {
final Display display = this.getDisplayType();
display.setBillboardConstraints(net.minecraft.world.entity.Display.BillboardConstraints.FIXED);
display.setInvulnerable(true);
display.setPos(this.location.getX(), this.location.getY(), this.location.getZ());
display.setYRot(this.yaw);
display.setXRot(0);
display.setId(this.entityId);
this.display = display;
}
this is my entity
setPos method doesn't exist with spigot
packets for displays seems needlessly complicated, they don't even tick
which type / class is "Display"?
so really no reason to make them fake, you can have tens of thousands of them and the server won't care
also this ^
Entity
^
I don't undestand BuildTools
what do u mean ?
- Download it: https://hub.spigotmc.org/jenkins/job/BuildTools
- Double click it
- Select version and select "Create remapped artifact"
- Compile
Using packets for entities makes sense if you want to avoid load on the server
Display entities are incredibly cheap and don't cause any meaningful load
I precise that I have to use those entities in huge quantities
They do absolutely nothing on the server, they just sit there and have no physics or anything
Ok, so use packet isn't a good solution ?
you should just spawn them normally using spigot
It adds a lot of complexity for little to no benefit
I made packet to make them visible in a certain distance
and why don't you just use the builtin setViewRange method? https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Display.html#setViewRange(float)
declaration: package: org.bukkit.entity, interface: Display
in 99% of cases, using packets is a bad idea
does buildtool have latest as revision?
GREAT
bro I made a fck subprojet system for gradle
so that all versions of packets should be compatible with my plugin
yes
"latest" usually isn't really latest until a month later
uh
--dev ?
oh thank you
Hello did you know how can I check if a player is behind entity when interact with it ? Thanks you in advance
What is the difference between VehicleExitEvent and EntityDismountEvent?
Is VehicleExitEvent only for controllable entities?
i think yes
Yes
Check out the .rayTrace methods
i like the angle method in vector as well for this
Hello everyone!
I'm trying to make a cosmetic plugin that allows to equip armor and cosmetic at same time.
So i tried to overwrite PacketPlayOutSetSlot, PacketPlayOutWindowItems and PacketPlayOutEntityEquipment.
But it didn't worked when inventory is open. (except player's inventory)
So, can i filter PacketPlayOutSetSlot and PacketPlayOutWindowItems packets by inventory? (stateId?)
Sry for my bad english
Sounds a bit hacky, but you can get the container ID from the nms player
Thank you for your answer!
It works like this before.
Do u know why this following error is produced ?
java.lang.Throwable: null```
My code :
```java
public void delete() {
for (final ItemDisplay item : this.items) {
item.remove();
}
for (final TextDisplay text : this.texts) {
text.remove();
}
for (final ItemDisplay border : this.borders) {
border.remove();
}
}
Cannot remove entity off-main
you are calling .remove() off the servers main thread
[11:54:42 WARN]: Skipping Entity with id zombie
[11:54:42 INFO]: [Rxlism: Unable to summon object]```
does anybody know what could be causing this ?
it happens with any mob, even without specifying a tag
try a sheep
and the game is not in peaceful mode
[11:57:48 WARN]: Skipping Entity with id sheep
[11:57:48 INFO]: [Rxlism: Unable to summon object]```
this is minecraft 1.8.8
blocked location
have you set a game rule for mobspawning?
nope, just spun up a spigot server didnt change any gamerule
no clue then
had to capitailze zombie to Zombie lol
Hi. There's a plugin on a server I play one where, when you click an item in a gui, it sends the player some text in chat which says "Click me to do x". When you click it, it opens up the players text box field, and pastes some text in there. I'd like to do something similar with my plugin.
For example, in one of my plugins double chest guis, when you click a compass, I'd like it to send one of these "click me" links to the player, who can then click the link and have the starting part of a command pasted into the text box, such as "/search for whatever you want ", where the player can then fill in the last part of the command.
The gui bit I have figured out, but could someone point me towards a method which can fill in the text box? Thanks.
ClickEvent.Action.SUGGEST_COMMAND
https://www.spigotmc.org/wiki/the-chat-component-api/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Perfect, this is exactly what I was looking for. Have a nice day.
Is there any sort of entity sound event or some way for me to know when entities make a sound
What sound do you want to detect
Do u know if there a way to get the block picked in inventory in creative (middle click), and maybe replace it ?
parrot tweeting
i can intercept the packet but its the sound packet not entity sound packet, so it doesnt tell me which entity it is only where it is
looking at the libsdisguises source, it looks like they just compare the sound and entity coordinates until a match is found
The client has full control over the player inventory when in creative
You'll only see slot set packets
But maybe getNearbyEntities is faster?
hence the Creative event
Is there a way to prevent null packets?
?
if you don't manually throw "null" into the sendPacket method, there won't be any
Don't send them 
No I meant
the packet in the string being too long / it has null values
You can't
If the packet can have a null value it can have a null value
You could always wrap in Optional but like java optional is cringe for parameters
Are you sending nulls in a packet???
I thought it was C2S but that last statement makes me think it's S2C
I don't think the server would crash from receiving null in a single packet
Idiots everyone know the client is always a scummy little liar
indeed
I just started developing using spigot and I am trying to alter the drop logic for sweet berry bushes. I have two events, PlayerHarvestBlock and BlockBreakEvent which calls a function to drop the correct items. However I need to cancel the ordinary drops as well, it was easy to do in the BlockBreakEvent by just setting the dropitems to false.
But when I set the cancelled to true in the harvest event it stopped obviously but that also included the de-aging of the bush. How do I manually change the age of the berry bush?
I wonder if the latest snapshot helps with that
BlockData
It's probably just Ageable
^ cast the BlockData to Ageable
I tried:
if (block.getType() == Material.SWEET_BERRY_BUSH) {
Ageable crop = (Ageable)block.getBlockData();
}
``` But it returns an error
Basically it says it can't cast to ageable
Oh God classic API momwnt
You want org.bukkit.block.data.ageable
org.bukkit.block.data.type.Ageable
Uhh aktually there is no type
What is the other Ageable from
entity
Bruh
So this is the correct one:
import org.bukkit.block.data.Ageable;
At least it isn't structure
Yeah
Alright I'll compile and check
Structure is cursed
Also this is my first time using spigot so I don't know a lot sorry
Top 3 naming conventions in Spigot:
- Silly
Nooo, imagine if we have like 6 Tag classes, 11 Structure classes, and like 10 packages that are named almost the same
That would confuse the shit out of newcomers
And that'd be soo funny
Actually you should listen to machine IMHO name it PossiblyPartialltyPlacedReallyDependsWhenYourWorkingOnItStructure

I think imma do generated structure
Since I might be exposing them before they are fully placed soon™️
Actually you shouldn't PR structure stuff since datapacks can do it tbh
Let's not upgrade the API
We need to redo the plugin loading systrm at some point tho it aint ready for the config phase
Yes but shh
That's gonna be weird to implement
My first thought is load: REGISTRY or something
Yeah but you can't access the server yet iirc xD
Fr but what api would be expozed that's the real question
Registry stuff
ig
Or at the very least you could copy a datapack into the datapack folder before the server loads them
Plugin+Datapack all in one would be coolio
But Bukkits world system is so wack
Not what I'm on about I'm on about how it's stored lol
ah the seperate folders?
Yeah
Shouldn't be too bad
Why is it stored like that lol
What's the historical reason
I'm forking spigot and removing all patches to create VanillaSpigot
It'll do exactly what it says 
Only L is VanillaSpigot doesn't have plugins
I mean
Datapacks that add custom worlds still work fine afaik, so I don't see any issues
Oh yeah ik I just the deviation from Vanilla there is weird wonder what the reason is
Go scroll through PR history :p
Is there a way to add data to planted crops so that when you harvest them you get different drops depending on that
yesn't
basically you'll need to use blockpdc library, by default in vanilla though the answer is no
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
guh scrolling back to 2014 be like
Block PDC in spigot when
And there is no way at all to do something similar in vanilla?
Imagine
You could like
look at how the library sent above works and write it yourself
you could have your own NBT file, but that's just block PDC with extra steps
that'd get laggy though
Well I started writing the project in spigot and the library says it's for bukkit. So yknow
bukkit = spigot
Ok so it works for both
bukkit does not exist separetely from spigot
they are equivalent
spigot both maintains and updates the Bukkit API
Spigot API == Bukkit API and vice versa there are only a few things you can find that are specifically API to spigot
.spigot().sendMessage looking dumbfounded
its about to get yeeted away
by Choco :P
as soon as he writes his ASM xD
inserting a new operation is certainly doable 
choco gets to asm sendMessage(BaseComponent[]) into sendMessage(BaseComponent) 😈
Yea I know xD
truly going to be a great time I'm sure
What I'm trying to accomplice is making custom berries, idk if it's possible but I want to try
not that I understand why that needs to be in ASM
given that you are not yanking the old methods out
MD wants to yank them out
or are you ? is .spigot().sendMessage dropped ?
interesting
Well then that makes more sense yea
I think he wants to drop the patch from spigot
Well, you can drop the pathc from spigot and just re-implement it in bukkit
its possible it'll just require a few hacks likely
that doesn'T matter
but if the methods are gone that means this will be waiting for 1.20.5 or 1.21
I think we want to leave the Spigot interfaces behind here can't say for sure, but I'd guess that's the goal
which yay
Well if you are, then you could just do a normal forward to the new methods by rewriting the impl
So do I clone the repo into my project file?
the tihng with components though is removing the fact that the Array exists
no use the maven repository
if you aren't using Maven I'd highly reccomend switching to it
Well no
I've never used it before so let's see how this goes
that is only a thing if you actually drop those methods
which, insane to some degree
the array needs to go imho they should be dropped
it's a legacy articact :P
Yea but now you are in API break world
which means this whole shit needs (or should, but hey, this is spigot) to be deprecated first for removal
during which you'd have the old methods properly forward to the new ones
Sorry for asking so much but how do I require it with maven?
that I can't argue with, 
Yeah choco gets to write the asm
there's a <dependency> section in the forums post. Add that to your pom.xml
cries
I mean, ASM does not matter either
copy paste
<dependency>
<groupId>com.jeff-media</groupId>
<artifactId>custom-block-data</artifactId>
<version>2.2.2</version>
<scope>compile</scope>
</dependency>```
you'd still break API
into your dependencies block
you won't break ABI
but still an API break, which is annoying and should probably be left to a new version
yeah should probably give heads upwith deprecated for removal first
It's red
tbh
Sometimes, people suggest you to change something in your pom.xml, and then IntelliJ starts to complain: That is totally normal. You simply have to click the “maven reload button” in IntelliJ. Maven will then continue to download the required dependency/plugin, if it’s available. After a few seconds, everything should be fine. You can find the.....
but I digress, ever since the setResourcePack trash I lost my hope
Thanks
maybe that's something to be brought up either on discord or the PR :P
I'm new to everything java so yeah
ASMing some of the spigot interfaces was easy, but the others have additional methods
what happened with that xD
and then read the second headline "How to sahde dependencies" from here, then you can use it @silent ice https://blog.jeff-media.com/common-maven-questions/
People just getting started with maven always ask me the same 3 questions, so here’s a a short FAQ! How to change the output directory? Read this. How to shade dependencies and what it means Sometimes you are using certain libraries (for example, my CustomBlockData class, or similar stuff) that is not already present at...
the method prior to 1.20.2 would replace the resource pack of the client because the client could only have one.
With the addition of stacking packs, some mystical neuron ended up having the method now only add the sent pack.
It does not drop the existing ones
which is a complete and udder API break
with no warning or anything
now, if my "texture switch plugin" (a plugin I actually did write) calls the method on 1.20 it properly switches the resource pack.
If it does so on 1.20.2 it just adds it
classic spigot moment. Truly I do love this software
sorry?
i dont remember if i take that xd
We talked about that in an issue
that the addition of addResourcePack would be benefitial
because you could revert setResourcePack back to its proper API promise
and have new plugins that need the stacked pack mechanic use the new method
ohhh then not sorry that PR still in wait mode xd
the PR handle set like set (remove all and add the new) and include the add
niceee 🙏
yea phoenix talked about it a couple days ago in paper
if wanna check and avoid.. comments when the PR was merged 
yeah i get a correction because forget reset the RP in the set method.
nice
yea, it has been annoying because on paper we reverted the initial API break back to the proper impl.
And then people were sobbing that them abusing the API break did not work on paper
fun times
yeah its like the DamageSource PR... xd

pleae.. i rebase that like 1 week ago..
Yea miles pinged me yesterday
kinda sad they gutted their open source version like that
Well, my offer stands eternal to implement a CLA bot for the orange slime myself
could be a fun community project
what?
gitlab's community edition
Imagine 5000 closed PRs though
slash commands please xd
Because cla
I mean

paper does not have a CLA and we are at 3.8k closed PRs
I think it would be fine
Closed as in rejected?
ohh... many time with not using gitlab... i remember a self hosted version only xd
for the work use more bitbucket cloud.. and LIKE how a yarn build in local take 2min and in cloud take 30min
only 2.6k merged 
your paper PR has a 70% chance of being merged

So 1.2k yeeted
yes 
yeah....
the count origin item in InventoryMoveItemEvent
that many itemstacks xd
we have another PR session today, maybe I'll bump it 
i dont remember the last comments maybe i get stuck in how handle and surrender try more
I kinda want to revive ArmorEquipEvent, but afaik the author isn't dead just busy
Although it has been a little while :p
the worst author to be busy is johnrengelman
and ask permission for colaborate in that PR?
True I could do that
like Choco with the docs xd
I was going to then I got busy too xD
Or shoot Diamond a message on discord to see how they are
gradle shadow plugin has not seen a new commit in 10 months 
John is ded
easiest ad ever
put it under org.spigotmc
there is a fork of the guy that PRed the java 21 support
idk how popular that got
and if they moved it into a more stable environment than a fucking user account 

must be a fun thing
guh
in my case is only one class with conflicts... i hope what is broke now xd
does gradle shadow have an option to completely leave a certain class/file untouched, e.g. not apply any relocations to that?
i just installed the vaultapi but idk why i'm getting that error:
java.lang.ExceptionInInitializerError: null
at org.giutv.giukitop.onEnable(giukitop.java:31) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[hub.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) ~[hub.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) ~[hub.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) ~[hub.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) ~[hub.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) ~[hub.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) ~[hub.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) ~[hub.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) ~[hub.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) ~[hub.jar:git-Spigot-21fe707-741a1bd]
at java.lang.Thread.run(Thread.java:1623) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.plugin.RegisteredServiceProvider.getProvider()" because "rsp" is null
at org.giutv.managers.VaultHook.setupChat(VaultHook.java:30) ~[?:?]
at org.giutv.managers.VaultHook.<clinit>(VaultHook.java:55) ~[?:?]
... 12 more```
if you need more info about that just ask thx for the help
doubt
maybe package wise
but rly doubt class wise
"rsp" is null
Are you developing or administrating
ye but idk how to change it
developing
that'd be enough
Time to fork shadow bois
wdym?
private static Economy econ = null;
private static Permission perms = null;
private static Chat chat = null;
public static boolean setupEconomy() {
if (getServer().getPluginManager().getPlugin("Vault") == null) {
return false;
}
RegisteredServiceProvider<Economy> rsp = Bukkit.getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
return false;
}
econ = rsp.getProvider();
return econ != null;
}
public static boolean setupChat() {
RegisteredServiceProvider<Chat> rsp = Bukkit.getServicesManager().getRegistration(Chat.class);
chat = rsp.getProvider();
return chat != null;
}
public static boolean setupPermissions() {
RegisteredServiceProvider<Permission> rsp = Bukkit.getServicesManager().getRegistration(Permission.class);
perms = rsp.getProvider();
return perms != null;
}
public static Economy getEconomy() {
return econ;
}
public static Permission getPermissions() {
return perms;
}
public static Chat getChat() {
return chat;
}
static {
if (Bukkit.getPluginManager().getPlugin("Vault") != null) {
setupEconomy();
setupChat();
setupPermissions();
}
}
}
that my vaulthook
static aboos
you call rsp.getProvider() in setupChat even though rsp is null
You do not null-check rsp before calling getProvider
Sniped 😢
Same thing with setupPermissions btw
oh ok then i have tho put a check on the rsp if it's null thx i will try and gave feedback
please
armor equip event would be the love of my life
Yeah and don't do that... Make a constructor that would call these methods at least, instead of calling them immediately
How would I ensure my plugin loads after worldedit? Because only loadbefore exists not loadafter
Depend on it afaik
softdepend
No promises but I'll have a look :p
Should
🙏🏻
@icy beacon ok no error rn but the when i do /vault-info it send [Vault] Economy: None [null] why?
Please do not ping me
sry
I am not sure why that could happen tbh, but very possibly it's because of you calling the methods in a static block
Try doing this
i just searched bleeh in discord gif lol
don't abuse static blocks
what if plugin1 has loadbefore: plugin2 and plugin2 has loadbefore: plugin1
And instantiating the class in onEnable
make a proper singleton
Ty
Is there a way to remove the error "org.bukkit.plugin.InvalidPluginException: Unsupported API version X.XX" ?
and just check via other methods made by me ?
do not use invalid api versions in plugin.yml
dont declare an api version
bad idea
I am now silly 😛
If you want to support old versions
lol
Generally using api version 1.13 is recommended
But if I dont precise api-version I have an error with Material enum
why not just declare a proper api version instead of none?
What error with the enum?
i didnt declare api in a 1.8 coded plugin and worked in latest
No legacy enum constant for BARREL. Did you forget to define a modern (1.13+) api-version in your plugin.yml?
ofc it works, with all the legacy material shit and stuff
depending on which api you use
as I told you, you have to declare an api version
so I can't load older version ?
even if its 1.19 ?
yes
ok
It's just a minimum version
ofc, api-version is the "minimum supported version"
1.8?!!!!
yes
and 1.12 and earlier do not check api-version
^
because they are ancient
and how can i call it back in the main file?
and don't know that this setting existed for 6 years now
Just create an instance of your class in onEnable
what
Not main
lol
Typo
what?
do NOT create a new instance of your plugin
TYPOO
oh
For example
public void onEnable() {
VaultHook hook = new VaultHook();
hook.setupPermissions();
// etc
}
You could do this
Instaed of your static block
Or, since your methods are static, you don't even need an instance
Just do VaultHook.setupPermissions() etc
i had to remove the static how u said becuase when i check with /vault-info i get null
Yeah then do this
wdym you get null? what is null?
^
and do you have any economy or chat plugin installed?
what economy plugin i have to install i want to make a custom one
Ah
then you have to register your own service provider
Well this is out of my territory I've never done that so I'll let Alex take over with helping here lol
Hi, where did I mess up?
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find com.sk89q.worldedit:worldedit-bukkit:7.1.18.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/sk89q/worldedit/worldedit-bukkit/7.1.18/worldedit-bukkit-7.1.18.pom
- https://repo.papermc.io/repository/maven-public/com/sk89q/worldedit/worldedit-bukkit/7.1.18/worldedit-bukkit-7.1.18.pom
- https://oss.sonatype.org/content/groups/public/com/sk89q/worldedit/worldedit-bukkit/7.1.18/worldedit-bukkit-7.1.18.pom
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
compileOnly 'com.sk89q.worldedit:worldedit-bukkit:7.1.18'
you just create your own class that implements / extends vault's Economy class, then register it to the services manager, and that's it
you didnt declare the repo for worldedit
oh
ok nice
i can't use that one? ```public final class VaultHook {
private static Economy econ = null;
private static Permission perms = null;
private static Chat chat = null;
public boolean setupEconomy() {
if (getServer().getPluginManager().getPlugin("Vault") == null) {
return false;
}
RegisteredServiceProvider<Economy> rsp = Bukkit.getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
return false;
}
econ = rsp.getProvider();
return econ != null;
}
public boolean setupChat() {
RegisteredServiceProvider<Chat> rsp = Bukkit.getServicesManager().getRegistration(Chat.class);
if (rsp == null) {
return false;
}
chat = rsp.getProvider();
return chat != null;
}
public boolean setupPermissions() {
RegisteredServiceProvider<Permission> rsp = Bukkit.getServicesManager().getRegistration(Permission.class);
if (rsp == null) {
return false;
}
perms = rsp.getProvider();
return perms != null;
}
public static Economy getEconomy() {
return econ;
}
public static Permission getPermissions() {
return perms;
}
public static Chat getChat() {
return chat;
}
}```
you want to make an economy plugin therefor you need to supply the economy behaviour
what?
i thought you wanted to write your own economy plugin
what do you even want to do
Can't make an economy plugin without making an economy plugin?
??
yes i want to create a my own economy plugin
then why do you try to hook into existing economy plugins
and why do you get the chat and permissions provider?
what do you need them for?
i just uploaded the default file of vaultapi i was editing it for what i need
i want to create an economy hook in vaultapi
there is no "default file of vaultapi" ?
They mean the example usage
then you have to extend/implement the Economy interface
as explained in the forums post
https://github.com/MilkBowl/VaultAPI Implementing Vault
that's not what you want to do. That example is for when you want to use an existing chat / permission / economy plugin
you have to implement this interface https://milkbowl.github.io/VaultAPI/
the economy one
and then you have to register it to the bukkit serviceprovider
oh okay
it implements a lot of method i have to edit that or i can just use it?
i don't think you know what vault even is
do you already have your own economy logic?
storing a player's amount of money, etc?
no
then you cannot hook it into vault
does OfflinePlayer#getPlayer() only return a player if the player's online?
yes
okay
Is it possible at all to make an item glow without adding an enchantment to it, or is the only way just adding a useless enchantment
You have to write your economy system first. and when it's done, you can write an implementation for Vault's economy interface, that delegates all the calls to your own economy thing. Then other plugins can use your economy plugin through vault
from what I know you have to add a useless enchant
Absolutely no other way?
iirc that was "fixed"
it was possible to set the Enchants tag to an empty [] tag compound
but IIRC that is also not possible anymore
Bc I am already adding a spoof enchantment, but 1.20.4 fucked with custom enchantments so I now have to add a real one
Guess I'll check vanilla
i have to fillup all the methods created from the implements of the Economy up or i can just fill the needed?
which do you think are "not needed"?
nothing sry xd can i use AbstractEconomy?
ofc, it implements Economy
So in singleplayer 1.20.4 /give @p diamond_sword{Enchantments:[{}]} 1 works, but not on a spigot server
Did we change this for a reason or?
Probably deemed as a vanilla bug and thus fixed
maybe in CB.. i remember a few check for enchantments for clear invalid things... maybe consider a empty enchantments like ignored
yeah I'll have a look at it
Is there any way to listen for a ClientboundSoundPacket synchronously?
Bukkit,runtask
I have to match up the packets location and an entities location and I can only read the packet asynchronously and the locations dont line up anymore
It's a time based thing though
ah, no then
I've seen LibsDisguises do it with protcollib but im trying without
then it should work without as well, you're probably thinking the problem wrongly
I thought onPacketSending was always called asynchronously, but then the code checks if it's async return?
@Override
public void onPacketSending(PacketEvent event) {
if (event.isCancelled() || event.isAsync() || event.isPlayerTemporary()) {
return;
}
handleNamedSoundEffect(event);
}
Modern plib has an option for both
Is synchronous packet listening hard to implement without protocollib
idk
what like invent a time machine
hmm
Surely you would have to pause the main thread then resume
but that just sounds so wrong
there needs to be a sound event they need to add taht
even if some of the sounds are client side
public void onPlayerInteractEntity(PlayerInteractEntityEvent e) {
Player p = e.getPlayer();
Entity entity = e.getRightClicked();
if (entity instanceof EnderDragon) {
entity.addPassenger(p);
}
}
}
``` So, here, it isn't letting me actually ride the dragon when I right click.
Hey, why is my plugin message not being sent from spigot, am I missing anything?
public class BungeeListener implements PluginMessageListener {
private final SpigotPlugin plugin;
public BungeeListener(final SpigotPlugin plugin) {
this.plugin = plugin;
}
/**
* A method that will be thrown when a PluginMessageSource sends a plugin
* message on a registered channel.
*
* @param channel Channel that the message was sent through.
* @param player Source of the message.
* @param message The raw message that was sent.
*/
@Override
public void onPluginMessageReceived(final @NotNull String channel, final @NotNull Player player, final byte @NotNull [] message) {
if (!channel.equalsIgnoreCase("login:inject")) {
return;
}
UUID target = UUID.fromString(new String(message));
Player online = Bukkit.getPlayer(target);
if (online == null) {
plugin.logger().log(LogLevel.SEVERE, "Tried to inject into offline player {0}", target);
return;
}
plugin.logger().log(LogLevel.INFO, "Injecting into player with UUID {0}", target);
ClientInjector injector = plugin.getSpigot().getInjector();
injector.inject(player);
System.out.println("Sending message");
online.sendPluginMessage(plugin, "login:inject", new byte[0]);
}
}
public void onEnable() {
getServer().getMessenger().registerIncomingPluginChannel(this, "login:inject", new BungeeListener(this));
getServer().getMessenger().registerOutgoingPluginChannel(this, "login:inject");
}
When BungeeCord sends the message, it works, spigot receives it and logs everything, but then in BungeeCord, I don't receive anything
how does your bungee code look like?
I managed to fix it for now by delaying the sending from spigot by 1 second, but I don't think that's how I should do it
@Override
public void onPluginMessageReceived(final @NotNull String channel, final @NotNull Player player, final byte @NotNull[] message) {
if (!channel.equalsIgnoreCase("login:inject")) {
return;
}
UUID target = UUID.fromString(new String(message));
Player online = Bukkit.getPlayer(target);
if (online == null) {
plugin.logger().send(LogLevel.SEVERE, "Tried to inject into offline player {0}", target);
return;
}
ClientInjector injector = plugin.getSpigot().getInjector();
injector.inject(online);
Bukkit.getScheduler().runTaskLater(plugin, () ->
Bukkit.getServer().sendPluginMessage(plugin, "login:inject", new byte[0]), 20);
}
hi, I'm having the issue that DataWatcher, DataWatcherRegistry, DataWatcherObject and PacketPlayOutEntityMetadata don't exist when using remapped NMS. doesn't work using this:
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
works using this:
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
and I don't want to use un-remapped NMS because I'm not a psychopath
remapped:
