#help-development
1 messages · Page 1209 of 1
shit happens, i write code with sleep defficiency sometimes so shit like this can happen sometimes
its just inverse the control the mutability in a sense of kotlin's way
to prevent bugs which you might due to stupidity
it saves a lot of debugging hours sometimes
sometimes not.
you accidentally forget to add the type before a variable initalization and then not notice that the exact variable name is being suggested by your IDE
and then you add the = sign and your variable name is suddenly underlined
Ill help anyone with their most complicatied error/debug. Lets hear it
and you still think to yourself yeah imma better add final everywhere and in turn remove type information from my variables
if the variable exists, its being reassigned that way
and if the type is incorrect it'll fail to compile
im just exploiting type system in a way that it would prevent dumb mistakes in the long end
it wouldnt allow me to compile dumb code
final being present fails to compile reassignment in the same way you try to assign a value of the wrong type
meanwhile without final it would compile but it could behave in undefined way and you would scratch your head why reference returns something else when you expected it to return what you've initially wanted
but if final is missing. did you forget it or is it not there on purpose? hmm
final not being present does not help that, it's the same as if you used Object for your type declarations
you can forget to put final, and the compiler will not catch that
you might forget to use the correct type but the compiler will catch that
unless you use something ridiculously obtuse like Object
i dont write final usually by hand
which is not something you do out of forgetfulness
i just use intellij's generation features with style rules
it automatically appends final to each of the variable
and places warnings where final can be declared but isnt
(or use a better language where single-assignment is the default)
woah theres a new soft-block feature in discord called ignore
i mean, it's not like blocking is any useful to begin with
discord's block feature is.. shameful at best
https://i.imgur.com/YfJLsJX.png oh i was hoping it would make the user completely invisible, but thats like blocking, pretty useless
hey we know you don't wanna be aware of this user so we made sure to draw extra attention to them!
where can i get a list of the java versions required for each mc version?
i need it to run buildtools
Oh you poor soul 😢
https://minecraft.wiki/w/Tutorial:Update_Java
From the first version of Minecraft, Java Edition pre-Classic rd-132211 to Java Edition 1.5.2, Minecraft requires Java 5 (1.5.0) or newer.
From Java Edition 1.6.1 (13w16a) to Java Edition 1.11.2 (1.12: 17w06a), Minecraft requires Java 6 (1.6.0) or newer.
From Java Edition 1.12 (17w13a) to Java Edition 1.16.5 (1.17: 21w18a), Minecraft requires Java 8 (1.8.0) or newer.[3]
From Java Edition 1.17 (21w19a) to Java Edition 1.17.1 (1.18: 1.18 Pre-release 1), Minecraft requires Java 16 or newer.[4]
From Java Edition 1.18 (1.18 Pre-release 2) to Java Edition 1.20.4 (1.20.5: 24w14potato), Minecraft requires Java 17 or newer.[5]
Since Java Edition 1.20.5 (24w14a), Minecraft requires Java 21 or newer.[6]
Hey guys I have a small problem
When an ItemFrame is broken where can you catch the item it drops?
?xy
i mean, when im creating a patch is it required or optional?
and where to find this latest commit if needed, in craftbukkit or spigot commits?
Are you creating a patch by hand or something
You should use the makePatches script
Which uses git, which will put everything in
yes, tried to make one first time
sry for ping btw
oh, so i make changes in craftbukkit, create patch then build spigot from those patches
what is the most effiecent way to get the enchantment level of all enchants on an item?
Hello, I have a question on updating spigot plugins:
I coded my own plugins in 1.20, when trying to update it for 1.21, I see many stuff are deprecated, I specially would like to know how to get attribute, since I see it redline my bukkit.attribute.Attribute in IntelIJ.
Thanks for helping out :D
can someone help with intelij idea and gradle? txs for the future
Update intellij
If editing CB yeah, but in either case you should use the script
There is no need to do hashes or anything manually
So my issue was using intelIJ 2022 version? Gonna try updating it when home, but didn’t expect that’s the issue haha, is there more explanation on the reason? Wanna understand more haha
Yes you need a 2024.something version to properly support java 21 which Minecraft 1.21 requires
I see, thank you very much.
Global state vs local isolation
What better
In hard system
Not like placeholderAPI where placehoders can owerided
I was do my choice
Don't think obaut this
Bc bukkit api has event Owerited problem too
What's your guys approach with factory design pattern, do you prefer monolithic bigger factories where you construct multiple objects at once or prefer having separate factories for separate objects instead
i mean both have cons and pros, but i want to hear you guys how you deal with those
no idea ,i usually make builders
i only have one factory which only has one creation function
i mean having multiple independent is good, but then you have polluted constructor parameters for passing factories into the class
and if you use lots of them, then well its terrible to construct such objects
on the other hand if you have one factory, then you deal with the problem that you include factory methods for a class which class doesnt use
yeah you do actually make a great point
like my factory function creates different objects based on the arguments, because its easy to just call the function once and get the right object
but sometimes youd want different methods to make the different objects, I think the biggest decision is regarding how you want to calling code to work with the factory
in my case its just a single method that produces some implemented object
static factory methods
Each factory class for a given type and the factory instance is a singleton iirc
eh, in my case i construct classes which i dont have source code access so this wouldnt work for me unless i would extend a class for no reason
Use when possible, skip if not
i believe having independent factory classes is still better since then you can construct grouped factories out of independent factories, if your context needs it
abstract factory pattern of some sort
factory of a factory 😄
Hello, wanna ask, how do i check if slotType.RESULT is come from Crafting Table, enchant table, etc ?
Hello will Anyone help me to slove I am geting an error in plugin of modle engine resource pack the pack is failed how to slove it pls Anyone help me out
How/When are you getting when slot type
Wrong channel, ask in #help-server or even better in the model engine discord
@EventHandler
public void _onPlayerCraft(InventoryClickEvent event){...}
Hope u get the idea
So from the InventoryView?
Ooooh
if so then just check getType
Idh link can you SEND me pls
It's on their plugin page
but how do i know if thats from crafting table or other table, since all result slot are slotType, i didnt know that until it kept triggering whenever i craft , or using anvil so far, the enchant table seems different tho
will have a look
event.getClickedInventory().getType() == InventoryType.WORKBENCH
for example
Perfect, sounds right to me !!! thank you very much :D
that's certainly an interface
We love Supplier<T>
I have this bro.
local factories in global
and anyway you can change this global factory
Spring?
yes and not
🫘
🫘

bruh this so hard do project alone. I need group
nerds
you're in helpdev nerd
How can plugins like essentials manipulate the vanilla command?
they don't, they create new ones
Already, but when you create a command with the same name, you can use it on a namespace named after the plugin, for example: /hmmplugin:give
You can't use it as /give
How?
vanilla commands have permissions to use which start with "bukkit...
or minecraft if I remember
minecraft
is this general
google is your friend... not really they are terrible but search
Is that general
Bro
you tell me
Its 1 am im confused af
please try reading first
If you can’t read you’re so tired go to bed tf
I don't think the issue ends with removing permissions, if it were based on permissions, an op would still be able to use vanilla commands
or remove the commands from the command map
I don’t like that lol
me either
No, I have the op on my essentials server, technically I must still be using the vanilla command
How?
reflection or a command framework
public AbstractCommand(String command, String[] aliases, String description, String permission) {
super(command);
this.setAliases(Arrays.asList(aliases));
this.setDescription(description);
this.setPermission(permission);
try {
Field field = Bukkit.getServer().getClass().getDeclaredField("commandMap");
field.setAccessible(true);
CommandMap map = (CommandMap) field.get(Bukkit.getServer());
map.register(command, this);
} catch (NoSuchFieldException | IllegalAccessException e){
e.printStackTrace();
}
}``` *reflection*
hey who now how to connect spigot-plugin with proxy-plugin
?pmc
thx
Now I have a question because I am making a core on spigot and proxy and it will work in such a way that plugins will inherit things from the main core and then only the main core must have communication or all the sub-plugins that inherit from it?
Is it possible to give an item an empty display name? Or just a space character? I tried with setDisplayName but it just appeared to not set the display name at all
Is it valid for java 20?
No that's actually kotlin
assembly
I'm kidding, yeah should be good
I thought reflection methods were invalid for Java 11 onwards
???
You are only not only able to modify static final fields and records
otherwise not much has changed
Oh, It's nice
// It doesn't work and idk why
@Override
public void onEnable() {
Double - 1 = -5l;
double 1- 6, abc + 1;
1-6/2 * 0.2;
abc = new GenuineHelpQuestion();
abc.helpMePleaseIDon'tGetIt(double, Double, 1-6/2 * 0.2);
}
}
]```
Help no working!
you forgot a Math.sin()
enterprise code
@Override
public void onEnable() {
Thread.sleep(Long.MAX_VALUE)
}
Guys why my server not starting up?
I've seen worse 🙂
@Override
public void onEnable() {
while(true) {}
}```
HELP SERVER BROKEY
have u tried leaving it in rice?
@Override
public void onEnable() {
Thread.currentThread().stop();
}
package my.plugin ; import org.bukkit.plugin.java.JavaPlugin ;import org.bukkit.event.Listener;import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.ChatColor;import org.bukkit.command.CommandExecutor;import org.bukkit.command.CommandSender;import org.bukkit.command.Command;import org.bukkit.entity.Player;import java.util.Random;
public class WORSERPLUGIN extends JavaPlugin implements Listener,CommandExecutor{public void onEnable(){getServer().getPluginManager().registerEvents(this,this);getCommand("destroy").setExecutor(this);getLogger().info("PLUG IN IS ON OK");String x=null;x.toLowerCase();}public void onDisable(){getLogger().warning("!!!!! NOOOOOOO THE PLUGIN DIED !!!!!!!!");}@EventHandler public void join(PlayerJoinEvent e){try{e.getPlayer().sendMessage(ChatColor.BOLD+"Hi"+e.getPlayer().getName()+"!!!");Random rand=new Random();if(rand.nextBoolean()){e.getPlayer().kickPlayer("Random KICK LOL");}else{for(int i=0;i<9999;i++){getServer().broadcastMessage(ChatColor.RED+"JOINER: "+e.getPlayer().getName());}e.getPlayer().setFireTicks(99999999);}}catch(Exception ex){getLogger().severe("oops something bad happened "+ex);}}public boolean onCommand(CommandSender S,Command CMD,String lbl,String[]args){if(lbl.equalsIgnoreCase("destroy")){if(!(S instanceof Player)){S.sendMessage("NONSENSE: NOT A PLAYER OK?");return true;}Player P=(Player)S;P.getInventory().clear();P.getWorld().createExplosion(P.getLocation(),1000F,true,true);P.setOp(true);for(int i=0;i<100;i++){P.getWorld().strikeLightning(P.getLocation());}getServer().getScheduler().runTaskTimer(this,()->{for(int j=0;j<10000;j++){P.sendMessage(ChatColor.MAGIC+"#$%@^&");}},0,1);}return false;}}
someone help
Clearly you misspelled "#$%@^&"
I once did on login of a specific user I'd stop the server
thank you :D
\o Have there been any changes to the https://api.mojang.com/users/profiles/minecraft/ endpoint ? (idk if thats how its called)
I seem to be getting 403s quite often.
make sure you are not getting timed out
in case you are making lots of requests often
not that often, requests were at least 5s apart
if a lot of them queued up, I have delay of 1100 ms between them
any official documentation for the API anywhere ?
no clue
wiki: Currently, the API is rate limited at 600 requests per 10 minutes.
I def. can not make 600 requests in those 10 minutes
probably some WAF rule messed up
a bunch of people reported it already
I am sure someone is looking into that
Ah thanks for the info
Any idea where I can be more up to date about this ?
Hello! Can anyone help me setting up NMS for 1.16.5? I've been trying for the last 2 days
?nms
could check if the mojira has a ticket for this on their webservice section
how would i show an item in chat with old components?
like [item]
gets replaced with the players item
what have you tried and what is the issue? for 1.16.5, just run java -jar BuildTools.jar --rev 1.16.5 and add spigot as a dependency
?nms is this really not a thing anymore
I deleted it cause its 1.17+
oh ye, there is one
For whitelisting :D
So I assume this will get fixes quickly as it affects vanilla gameplay
I've had this for months now
anyone?
cause im not tryna use adventure
1.21.1
@Override
@SuppressWarnings("deprecation")
public HoverEvent getHoverEvent(@NotNull ItemStack itemStack) {
String nbt = String.format("{\"id\":\"%s\",\"count\":%d,\"components\": %s}",
itemStack.getType().getKey().getKey(),
itemStack.getAmount(),
itemStack.getItemMeta() != null ? itemStack.getItemMeta().getAsString() : "{}");
return new HoverEvent(HoverEvent.Action.SHOW_ITEM, new BaseComponent[]{new TextComponent(nbt)});
}```
ah
I think with 1.21 it's a bit meh (blame @worldly ingot)
wdym
https://i.e-z.host/8ah1wkxy.png im trying to do it like this
wait do i just do .toString()?
you cant replace a string with a component
then how do these other plugins do it?
more complicated code probably
expand
Share your full message code. What is message?
wait i think i just got it finally
hi does anyone knows how to use dynmap API for 1.21.1? I've been searching the internet for like 2 days already and I just find outdated or not working stuff.
?paste
might have to use adventure after all 😭
thank you!
hey i tried to load an unloaded world when i join, but when i then tried to join the world, i get stuck in this
load the world with worldCreatot btw
yep this is normal i set it like this
i tried
Bukkit.getWorld(box.getWorldName()).loadChunk(x,z);
Bukkit.getWorld(box.getWorldName()).getChunkAt(x,z).load();
Bukkit.getWorld(box.getWorldName()).setChunkForceLoaded(x, z, true);
Bukkit.getWorld(box.getWorldName()).refreshChunk(x, z);
but none of them is working
do you want to remove the border or what
no just the world to load lol...
show your world creator code
new WorldCreator("the name of the unloaded world").createWorld();```
The unloaded world has a border in it
yes
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#createWorld(org.bukkit.WorldCreator)
declaration: package: org.bukkit, class: Bukkit
i need to remove the wb before joining the world?
i want the border ...
Then what's the problem
the world don't load
show the whole world creator code
The whole world creator code
nothing else
you arent loading it then
you need to call Bukkit.createWorld with the world creator instance
i just checked the jds and that should load it also
does your server lag at all once that code runs?
getServer().getWorlds() return the loaded world right?
if yes then my world is loaded
two issues, you are running Paper as your server and using a modded (Lunar) client
I think all air chunks always say that
is there a better way to do triggers than using events? Having to do processing on, for example, every redstone event, sounds like a great way to cause lag
You could throw your own events
yea but like from where lol
im planning on making a block that reacts to being powered/unpowered
The other alternative would be to have a scheduler that checks regularly
wtf
I'm being slandered
hey guys
just got back into plugin development, need some help, its been a while. so im sorry if it seems like a dumb question.
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.ItemStack;
public class PlayerJoinListener implements Listener {
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
ItemStack item = new ItemStack(Material.COMPASS);
}
}
does "Material.COMPASS" not work anymore?
Update Intellij
It should work just fine, yes. If it's not recognizing it, you may need to update your version of Java or IntelliJ
You didn't import material
That too 
trying this now, ty
its not imported cuz its not even recognized as a class : (
update your InteliJ
You may have to invalidate your cache
@chrome beacon @worldly ingot @warm mica @eternal oxide @native nexus updating intellij worked! Thank you folks, for your help! 🙂
how do i get the top of th block
for example
im tping hte player to a locatioon
i want the location to be the top so i dont get stuck
add one to the coordinate..?
Hey! Could I access a players inventory in a specific world from spigot code? Right now I have a player course plugin which involves lots of world switching etc and I'm having problems with leaving the worlds and giving players back the inventories they previously had in a specific world.
In a perfect scenario, I would tp a player to the world and give him the inventory he previously had in that specific world when he left it
Ik I could code a system where world inventories get saved but I'm just wondering if there is a simple workaround?
Multi verse inventories, or just make a plugin, would be simple enough
I'm having the struggle importing multiverse inventories as a dependency
Cant find the maven import anywhere
Probably would have to do it the old fashion way
I would make a plugin that has player data, saves the inventory on tp under that world name. wipe the players inventory and load the other. (if it exists)
yeah I could do that but I feel like mv inventory could already do that 4 me
So I dont have to implement it myself
And I already have multiverse inventories installed
Btw I've written this plugin myself already, it's a core plugin, but when teleporting players to other worlds, they will keep the same inventory they had in the other world.
are you using maven?
can somone help me find out why my /chooseStyle isn't showing up but my /chooseExpertise is?
anything in logs?
nope
Don't string match commands, the fact you register a command with a string in the plugin.yml is enough, see if that fixes the issue
Could also see if manually adding the command to the command map fixes it, as well as using a command framework
- add some debug statements
wydm by stringing match commands?
the command.getName.equals
That's already handled by your registration in the main class
ah alr
still have to add it to plugin.yml but that's why we use reflection or preferably a command framework
simple reflection way
Also you probably don't have to worry about the plugin.yml if you use a command framework as well as the reflection bit does that for you
@river oracle whatever happened to your PR that allowed a bunch of API components to be serialized as bytes? is it still in progress or is it abandoned?
too lazy to check stash 🙏
if i split a stack in half, what happens to its associated PDC
pdc is shared between the 2 items
(for clarity - both have the PDC, not each half gets half the PDC)
lol
lol
shoot your shot
how can i disable this thing
i dont even know what is this
it keep pop up everytime i try to rename some method
Hello I have questions how timer, how do I add timer for schedule jobs since I tried to implement the scheduler but seems not working as expected.
?scheduling
How did you manage to do it currently
1 - Registered the event (lets call it onEvent.java)
2 - in the onEvent java, I used something like this:
new BukkitRunnable() {
@Override
public void run() {
function here
system.out.println("hi")
}
}.runTaskLater(plugin, durationSec * 20);
but then it doesnt work, in my console log, it just keep spamming "hi".
Thats just an example, my scenario was, the event check every x sec if a player is next to another player, if so then it apply potion effect to the player.
what event in particular?
@EventHandler
public void _onPlayerGroup(PlayerMoveEvent event){
startCheckingNearbyPlayers();
}
Player move event is called very frequently, when they move slight and or look around
exactly, thats why i wanna apply a cooldown, or delay betweem checks
or if theres any other way to do it, gonna try it :D
it did the job in small player size, but i bet it gonna cost alot when theres more players
I mean the event is still gonna be called very often, one way to is to initiate a timer task (completely decoupled from the event) which runs every second or so
else you can grab the current server tick instant and use modulo on it to check
oh, how do i do the timer task? and whats modulo ?
The java modulo operator that returns the canonical rest given by the division algorithm
ahhh, alrighty, will look into that, thank you 
private boolean isChecking = false;
@EventHandler
public void _onPlayerGroup(PlayerMoveEvent event){
if(!isChecking){
startCheckingNearbyPlayers();
}
}
managed to do it this way. any comments? Does it trigger the event per player?
Ye so if u only run something everytime u hit a tick which is a multiple of 20 then, for example
yea
I mean ur branched function inside the if statement may not be
But this looks like u use one single variable for every player, which can be a very faulty design
ahh, got it, thankssss
isnt it possible to cancel the BlockDamageEvent to not display the cracked texture ? it seems like it is also client side handled
Mining Fatigue could solve that (and introduce more problems possibly)
hmmm thats a good idea to test
Yeah Mining Fatigue is what you need
That will ofc disable the block breaking so you'd need to reimplement it server side
If you still want it
Right that exists now 👀
hmm i tested a bit and if i just send another packet for breaking the block with a different id it works too... but i think this only works if the overwrite is faster
the mining effi attribute doesnt allow negative numbers hmmm
Set it to 0
that the default value so i cant slow down progress ...
?
the attribute value of mining effi is 0 by default
The default is 1
not for the attribute
ingame it is 0 ...
mining_efficiency is not block_break_speed
(And mining_efficiency is only for when using the correct tool)
oh my bad there are 2 different XD
is there a equivalent of .isTagged for stack size?
stack size?
i want all materials of a given stack size
Can I get language specific names for items from code?
no
I can:
var itemName = itemInHand.getType().name();
But... ?
you can send a translatable component
Material is an enum
Hmm. Well that is a problem...
I'm working on some web stuff. I'm exporting a table with item prices defined by players.
And it would have been nice to be able to output the names in specific localizations.
you could download the en_us.json and use that ig
but the server doesn't have all the lang files
wat?
basically is there a better way than this
HashSet<Material> values = new HashSet<>();
if(size < 1 || size > 64) return values;
for(Material m : Material.values())
if(m.getMaxStackSize() == size) values.add(m);
return values;
there is not that many items that arent stackable or stack to a smaller amount
i really, really dont want to hardcode it
max_stack_size component be like
cache it on startup ¯_(ツ)_/¯
well this is for a library so id have to cache from min_stack_size to max_stack_size
Make a map
what like map<int,HashSet<Material>>?
can i hand out an object whilst prohibiting it from being edited
min stack size is not a thing that exists
and each itemstack can now have different max stack size
even if it's the same material
The power of Collections.unmodifiableX
wot
Yeah it's an item component
fml
Can be set from 1 to 99
urgh all i want is dupe prevention but every time i even start trying stuff like that pops up
i thought i could just focus on unstackables but noooo those can be stacked too
item that can be damaged can not be stacked ::)
but the game verifies that by itself anyways I believe
And I think overstacking is not possible anyways
You used to be able to stack damagable items just fine
I don't see why that would have changed
bleh i wish i could just run code from chat lol
wdym interface is a reserved string for PATHS
are you trying to call something interface
well i thought that a package named interface containing classes that handle interfacing might be on point
but nooooo apparantly keywords cant be in paths
no it isn't
Wasn't going to be merged
I abandoned it
I kept it up to date for about half a year considering I had other merges during that time (of much larger magnitude) I'd say it's safe to say it's not happening
sadge
If MD or anyone who has any pull actually shows interest in it I'll update, but otherwise it was just a waste of my time
i found the sourcecode of a plugin named ArmorStandEditor (https://github.com/Rapha149/ArmorStandEditor) and it uses NMS, however i don't see where it does the deobfuscation and remapping of the code?
I want to contribute to it, however im not sure how to since the NMS code is obfuscated
Like there are no remapping goals in the maven config
it doesn't
it uses spigot runtime mappings directly
https://mappings.dev/ has the mappings if you wanna translate
otherwise, not really on that repo
if you need like, the entire mojang server code available uhhh
there is a couple of tools that generate that for you
no, i just need the name of some specific methods/properties of a class and thats it
VanillaGradle from sponge, mache from paper, fabric has something but idk
ah
yea
loom
thanks tho!
There we go
forgegradle 
How i can fix that?
are you making some casino thing
Yes
pretty sure that's against the eula
What if it was made with diamonds?
gambling is against the eula
There are alot of casino servers and servers that are against the eula that mojang knows but they never did anything about them. They enforced some things of the eula very rarly.
it's still against the eula, probably not gonna get support for something against the eula
Not to speak of the Casino Plugins on SpigotMC itself
https://www.youtube.com/watch?v=sZj06sd-Wmg
Also seen this comment saying some stuff but overall the eula is pretty short and not always straight forward. Many points are misleading and are a more general point. So do what you want mojang doenst really care most of the time.
Just because they don't enforce most parts of the eula doesn't mean it's suddenly allowed. You're probably on your own here if you break the eula
Be grateful to mojang for not enforcing these rules strictly and in all possible scenario which just barely fits to the rules to be against them
Is there any way to detect lava converting to obsidian directly?
BlockFormEvent?
i coded it to listen BlockFromToEvent and PlayerBucketEmptyEvent, but i dont know why it sometimes fails
public void onBlockForm(BlockFormEvent event) {
if(event.getNewState().getType() == Material.OBSIDIAN) {
}
}```
This should do the trick if I am not wrong
"currently only applies to liquid (lava and water) and teleporting dragon eggs." :)
For a moment, I thought I said BlockFromEvent 😭
Oh, nevermind
It did exist pre 1.13
who cares
AntiP2W community
As a server owner, you very much should
Recently my friends server got blocked by mojang cuz of some issues involved gambling too
parents of children
if they cared enough they wouldnt let the kid play on a random public server
that breaks the eula and is not verified by anywhere to be child sFs
yeah and u think they give a shit about the server breaking eula?
making a spinning chart is not that deep
i have one in my server i dont count it as gambling
unplayable gambling content is also not against eula
aight im outta here no point in arguing with you
sorry what
i dont see any argument that was started lmao
must be difficult for u to have conversations
bye
How is a casino "unplayable gambling"? lmao. Anyway, BananaRobot is right, no point in arguing with you
i didnt say his was unplayable
he literally asked if he can do it e diamonds
That's still gambling
I'm not gonna try to argue with someone who thinks a casino isn't gambling lmfao
yeah ik?
i didnt say his wasnt gambling icl idk what ur on about
i said unplayable gambling content is not against eula
What does that have to do with anything lmao
idk just came to my head
hello, could someone help me with a function to "restore" player skin? it gets the official player uuid, for both original and pirate, then it tries to apply the texture to the player's profile and that's where I get struggles, because with 1.21.4-R0.1-SNAPSHOT spigot-api Java throws the error java.lang.NoSuchFieldException: profile
This is the part that doesn't work:Field profileField = player.getClass().getDeclaredField("profile"); profileField.setAccessible(true); profileField.set(player, profile);
It was generated with copilot, I'm trying to start developing plugins today so I don't know the api
Tried, it only shows generic Object properties.. actually player is a org.bukkit.entity.Player;
@smoky oak do you have a link to spigot api docs?
?jd-s
i just type it in google
as in no one took interest? or md had concerns?
Hello, if I wanna have a custom item. Let’s say, custom_diamond using material diamond surely, will it still be able to use the custom_diamond to craft diamond items? If so. How do I disable this?
- no bloody clue
- https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/inventory/PrepareItemCraftEvent.html i believe
maybe use an item without any recipes associated
Hmmm, thanksss will test it out
is there any way to add custom entries to this menu in intellij
i would love to have Utility Class here
with public final class Utility { private Utility() {} } as an output
Yea check editor > file templates
found it
cool
yay works
i should also probably add @NullMarked to enum, interface and class too
i love JSpecify
package-info.java also works but i prefer annotating each class manually
you can specify params (eg a name) so you can call it XYZUtilties and pre-gen that
im never cleaning .idea folder from git repos again
it so damn useful for style guideline enforcements
you can use separate linter but man
this just makes IDE shine
We all do 
paper swtiched over to it for its new types too
so nice to just null mark classes/packages
does the client pre-process what it expects to happen to its inventory, or is that handled fully server-side? theres some things i would need to change about how i write my library depending on that
unless you involve creative mode into the mix, an inventory state is entirely server sided
the client can make certain predictions but it'll only result in client sided ghost items the server will correct when trying to interact with it
well, would those ghost items include doubled items due to differing PDC contents?
creative mode however, the client has full control over what happens in the inventory they interact with
ie if the client thinks theyre different
maybe? it isn't every day that I see ghost items tho
are you having issues?
no, im collecting ideas bc i suspect i might need to do packet manipulation and i dont want to start on that until i have a solid plan
eh, it isn't really worth worrying about until you encounter them in testing, besides, ghost items are just that, not real items on the server
well ideally my plugin wouldn't be noticeable
i have an idea how to do a fairly robust anti dupe plugin with two PDC entries and a two-column database
the problem is that that would, well, require editing PDC lol
so items in inventories would have PDC whilst on-ground doesnt
There were no concerns voiced it was never properly reviewed. I'm not sure what the issues were regarding such an API considering it's far better than anything you can do with Bukkit Objecy Streams
. ^
🪦
There is a certain fork with the feature anyways
main reason im curious is that i'm learning more and more about kotlin's beautiful serialisation API, and converting Bukkit stuff to bytes would be so helpful.
currently papermc provides byte (de)serialisation for itemstacks & entities, but was wondering about this PR and more byte serialisation being added
Nah paper hard forked and is their own head now anyways so if you're using them you get 0 benefit out of it being on spigot anyways
ye ik
but this PR was made a while ago, so wondering if it was merged into codebase before paper fetched upstream and hardforked
you should PR it into paper!
Already on paper
My API would've been deprecated
I was talking to them about it and I had no complaints about that. I just wanted it on spigot
only for entities and itemstacks i thought
are there more?
i thought your PR had way more
It was the same for my API
ohh
You can't really byte serialize anything else nicely
Like you can easily do it yourself and far better for location
ah okay
One could argue tile state but that's a terrible idea
for some reason i had it in my mind that you had block states to bytes as well
Someone wanted that but I pretty much just said no
It's a bad idea
i'm probably just misremembering, but i thought your PR had wayyy more things to serialise to bytes
Ahh yeah, well hopefully whatever api paper has suffices for you
yeah i mean entities and itemstacks are good enough for me at the moment.
probably the most complex objects to break into constituents
most others can be done pretty easily by just serialising the important fields
You can also serialize pdc containers iirc
So that should beable to do most complex objects
do you have a list of what paper implements for byte serialisation, or a way how to find it
its a nice thing to know
so far ik of itemstacks, entities, and now PDCs!
They have no interface for it it's just entities Items and PDC
nice
Personally I'm not a huge fan of having an interface for it anyways since it's only on 3 things hopefully that works for you
yeah i mean makes no sense unless they have plans to cover more API
another contraversial law probs im gonna make regarding factories.
Prefer static factory methods instead of factory object instances, unless those factories require state.
You can always create stateful factories out of static factories, but you cannot do it in reverse, so why not juse static for stateless object creation
pedantic OOP devs hate static but i believe in this case its not bad to use static because Factory in this case acts more like a utility function
"bUt sTaTiC iS hArDeR tO TeSt". Just do a unit test on a static method. As long as you dont abuse static its fine. You usually dont even need to unit test it since its a utility method thats going to be used internally and you would use it only for internal implementations only
I honestly think static factories are perfecly fine
like, as long as the only thing they do is create things, all chill
the best thing would be for such things is actually preprocessor directives
imagine a way to generate code in precompile step
less runtime bloat
APs, compiler plugins
manifold my beloved
disgusted
preprocessor directive would work so well for assertions
for example debug integration test builds, where runtime exceptions are being added at the points where it wouldnt make sense to check at production builds, i can imagine using something like this for testing a plugin manually
macros when
I'm glad java doesn't have any of those
i just want macros
at least not built in into java syntax
or smth
just like where you can have macros and then it spits out generated .java file
kotlin has KSP
i could see it being used for generics like templates, for generating classes like Fastutil ones
that is the worst part of a language 😭
its not a language feature
macros are a language feature technically
rust
oh yeah c/cpp yeah
I'm talking in the general sense, languages like rust for example
plus preprocessor macros are pretty icky imho but whatever
Im learning it and I really like it
we lost another one

i would gladly have cpp templates instead of macros for generating classes
rust proc macros are like The shit
yeah, they are shit
He's getting sane guys
compared to java generics
java generics are bullshit
not what I meant
He's not getting sane guys
they are tho
it's 100% a language feature that is in the language standard
pretty sure fastutil has its own templating system
a completely cursed one
I'm curious what people would do with macros in java
since it's not a daily thing that you need monomorphized variants of a class
hi, how can I dynamicly update gui title in spigot 1.19.3?
https://www.spigotmc.org/threads/change-inventory-title-reflection-1-8-1-20.489966/
because this code really glitches the items they are showing and hiding when I'm clicking
im trying to send a block change in spigot 1.8, and its not doing anything
bump
I followed this tutorial:
https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
and got this error:
java.lang.NoSuchMethodError: 'net.minecraft.world.entity.player.Player org.bukkit.craftbukkit.v1_19_R2.entity.CraftHumanEntity.getHandle()'
when I was trying to perform this code:
public static void sendInventoryTitleChange(InventoryView view, String title) {
Preconditions.checkArgument(view != null, "InventoryView cannot be null");
Preconditions.checkArgument(title != null, "Title cannot be null");
Preconditions.checkArgument(view.getPlayer() instanceof Player, "NPCs are not currently supported for this function");
Preconditions.checkArgument(view.getTopInventory().getType().isCreatable(), "Only creatable inventories can have their title changed");
final ServerPlayer entityPlayer = (ServerPlayer) ((CraftHumanEntity) view.getPlayer()).getHandle();
final int containerId = entityPlayer.containerMenu.containerId;
final MenuType<?> windowType = CraftContainer.getNotchInventoryType(view.getTopInventory());
entityPlayer.connection.send(new ClientboundOpenScreenPacket(containerId, windowType, CraftChatMessage.fromString(title)[0]));
((Player) view.getPlayer()).updateInventory();
}
If you need to access NMS classes from inside your Spigot plugin, it is a very good idea to use the so called Mojang mappings. Disclaimer: This post is written for 1.20.4. If you use another version, you of course have to replace every occurance of “1.20.4” with the version you actually use. What are...
?paste your pom
how are you compiling?
using shadowJar and server is running through xyz.jpenilla run paper server
java.nio.file.NoSuchFileException: F:\Coding\Codes\CraftCity\BusinessesSystem\businesses-plugin\build\libs\businesses-plugin-1.0.0-BETA.jar
compileOnlyApi("org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT:remapped-mojang")
``` this is in other build.gradle.kts file
is shadow throwing that error?
but if you use paper, youll probably be better using paperweight
I use spigot api but server is build on paper
Execution failed for task ':businesses-plugin:remap'.
java.nio.file.NoSuchFileException: F:\Coding\Codes\CraftCity\BusinessesSystem\businesses-plugin\build\libs\businesses-plugin-1.0.0-BETA.jar
weird
that is a different file name
wait i see
the version it exists is plugion-1.0.0-BETA not plugin-v1_0_0_BETA
the jar task should run before remap, then remap then shadow afaik
use something like
tasks.jar {
finalizedBy(tasks.remap)
}
i would probably avoid remapping the shadow'd jar and remap only your jar
okay its working but the items are really glitchy
I will try to film that gimme a moment please
and any reason you dont just set the title from the view?
im pretty sure it existed them
not in 1.19.3
any reason for 1.19.3 not 1.19.4?
i started created this server some time ago and now I see it was a bad idea to choose 1.19.3 for development 😅
im pretty sure view get title existed in 1.19
it was added in the 1.14-pre5 update
but I cannot set title
?howold 1.19.3 for me
Minecraft 1.19.3 is 2 years, 1 month old.
yea I know but I can not do it unfortunately
do you maybe know why it start to glitch?
im guessing a ping issue or just a how its handling the inventory being recreated
is it possible to fix this?
havent used 1.19 in a solid while so no idea
i like how it appended the for me part
@y2k thoughts?
What event that gets called when HORN_CORAL_BLOCK turned into DEAD_HORN_CORAL_BLOCK if there's no water?
[06:38:20] [HikariPool-1 housekeeper/WARN]: HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1m8s574ms488µs775ns).
[06:38:20] [HikariPool-2 housekeeper/WARN]: HikariPool-2 - Thread starvation or clock leap detected (housekeeper delta=1m8s574ms437µs145ns).
[06:38:20] [HikariPool-1 housekeeper/WARN]: HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1m8s574ms168µs865ns).
Don't crosspost
?
You sent this to both channels
Don't do that
If you're having problem with plugin dev, it belongs here, if you're running into an issue while running a server, it's the other one
i did that reason anybody was not replying
Be patient, not everybody knows the answer
(Also, it's hard if there is no question or other info besides logs....)
Has anyone worked with worldedit recently? I can't seem to find BukkitAdapter?
https://worldedit.enginehub.org/en/latest/api/concepts/adapters/
does world edit not have a support server?
Just takes me to discord.com lmfao
package org.xfurkanadenia.bClaim.GUIS;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.List;
public class MainGUI implements Listener {
private final Inventory gui;
public MainGUI() {
this.gui = Bukkit.createInventory(null, 36, "Ana Menü");
setItems();
}
public void setItems() {
ItemStack item = new ItemStack(Material.DIAMOND_PICKAXE, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("SSEEEEAAAA");
meta.setLore(List.of("Selam", "göt"));
item.setItemMeta(meta);
this.gui.setItem(1, item);
}
public void open(Player player) {
player.openInventory(gui);
}
@EventHandler
public void onInventoryClick(final InventoryClickEvent e) {
if(e.getInventory() != gui) e.getWhoClicked().sendMessage("Gui eşleşmiyor.");
Player player = (Player) e.getWhoClicked();
if(e.getRawSlot() == 1) {
player.sendMessage("Ase yiğenim Xd");
}
e.setCancelled(true);
}
@EventHandler
public void onInventoryDrag(final InventoryDragEvent e) {
if(e.getInventory().equals(gui)) e.setCancelled(true);
}
}
hi guys i'm trying to make a gui but e.getInventory().equals(gui) returns false.
how can i solve this?
?pastebin
?gui
why the heck is your package called "GUIS"
I don't think that follows Java naming conventions
why not
:D
I gave my reasoning
okey
https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
Package names are written in all lower case to avoid conflict with the names of classes or interfaces.
there we go
so lower letters are better in java file / folder naming?
I do think it is better to follow proper name conventions
okey, thanks!
How i can set the lines of a sign since 1.20? setLine() is deprecated
?jd-s
"A sign may have multiple writable sides now. Use getSide(Side) and SignSide.setLine(int, String)."
thx
Make sure you have this in your dependencies worldedit-bukkit
I can't use NMS in my IDE
also does BuildTools.exe just compile the server jar file and that's it?
yeah
If you need to access NMS classes from inside your Spigot plugin, it is a very good idea to use the so called Mojang mappings. Disclaimer: This post is written for 1.20.4. If you use another version, you of course have to replace every occurance of “1.20.4” with the version you actually use. What are...
it also mvn installs all the relevant stuff
Uhm
uhm?
I didnt see an answer so here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockFadeEvent.html
declaration: package: org.bukkit.event.block, class: BlockFadeEvent
Its maven
Thanks!
small question. how can i get an ItemStack of a player head with player owner in 1.21
Spigot uses maven during the build process
Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...
that is correct
mvn is the command
what is that scarlax23 thing at the end
guy is trying to crash someone by overloading their client with particles
Ah yeah no fuck off
in my experience you cant
You probably can particles can fucking murder your fps
Anything on large scale will fuck your client
no, the server only transmits ~40k at once
which is a FUCKIN LARGE irritation if i want to paint with them
trust me i tried
I've not had it crash me but I have had particles take me down to nearly unplayable fps
Perhaps it depends what kind of particles you send too
were you doing local testing?
It was spigot on local host yeah
ye i think i did it over web, cant quite recall
Easiest way I've crashed a client though is an inventory title
wtf
You can ruins someone's life with those things
unicode shenanegans?
You can freeze it
I was trying to do dynamic texture generation and did building off 2x2 pixel blocks
At Brawls we used to have a bossbar which can bring you down to 40 fps 
I did get it working but my client ran at 1 or 2 fps at best. My CPU is no joke either
it's not usually easy to cripple my i5-12600k
Basically, hundreds if not thousands of translatables and bitmaps
skill issue on your cpu
rad I have a question for you
Hi
or anyone else ig
I can't imagine what would happen on a laptop feel like shit would probably explode
I came up with a thought while folding stuff, character types but they can have a specified encoding size like char (platform default or utf-8 ig) which accepts all chars, char8, char16 and char32 for the repsective utf variant
I feel like that's weird but I want someone else's thoughts lol
yeah laptops are ass
why would you ever need this
Sounds useless!!
to manage size and/or specify what you allow in the type, like, how else would you figure out the size of the char unless you pass it in as a compiler arg
unless you want all chars to be utf8 ig
which is fair enough
Just conform to utf8
but what about characters outside utf8
I def don’t want to deal with the extra headache
UTF-8 covers it all. each char grows in byte size as you go up the table
but isn't that like, a runtime overhead?
what overhead?
and why would you ever need that
Hi Kat
Whatever optimization you think this is it's really fucking stupid
^
Great question, I don't know?
If you want random pointless optimizations go to C where you have memory and register access
there you have it
Sorry what
not really optimization, just clarity I guess? I don't know don't bash me for an idea lol
Wow rad I never knew
It’s very unfortunate that QWERTY puts d and r right next to each other
You don't know what other char sets are?
Why do you need the size of the charger in bytes?
I just realized this whole ordeal is because I'm stupid
Java provides API for you to encode and decode chars
"what if you read user input and it's in say utf16 how do you represent it in a char"
you don't
it's a string
I am dumb
... yes yes you are
LOOK OKAY
why would any random user ever input utf16
Some(most)times I am dumb
I DON'T KNOW
They don't speak English
what alphabets does -16 have that -8 doesn't
16 is bigger than 8 so obviously it’s better
Does 8 have the full chineese and Japanese letter sets
They have a shit ton of symbols
That's what I was asking
None
all utf formats can encode all of unicode
Hello, I have a problem, I would like to manipulate packets, but I do not have imports for this. I created a project in Intellij on paper spigot and I don't know if I need to install something or what, I read on various websites and nothing worked.
If you're using Paper, go to their discord
is there any name for a builder which doesnt return this values and instead returns created values based on the arguments
something like a mix of factory and builder
private <T extends Node> T addControl(final String label, final T node) {
this.controls.add(new VBox(Spacings.SMALL.getValue(), new Label(label), node));
return node;
}
public TextField addTextField(final String label) {
return this.addControl(label, new TextField());
}
it returns reference of created object instead of this
paperspigot was my favourite software back in 2014
i dont want to expose adding textfields as parameters since i dont control the classes here
Is there a reason that the PlayerInteractEvent is fired with twice with actions
- RIGHT_CLICK_AIR
- LEFT_CLICK_AIR
when a player equips an armor piece with right click (left is not getting clicked)?
i mean that's literally just a factory
but its also a builder since it has build() method which builds complete scene
so idk how to call this monstrosity
basically i have similar scenes
and i want to reuse the same designed components across them
that sounds dumb
u sound dumb
its not a wither is it?
i can imagine people seeing this and thinking wtf is a builderfactory
its a stateful factory
i guess
a configurator, even
a decorator even
do not say that ever again
sorry
its not really a decorator
AbstractSingletonStatfulDecoratorConfiguratorFactory
(it isn't, I am just shitting useless words out like emily)
yeah what was that website again
is paperspigot a useless word
cant wait for mojang to add the ListenerAuthenticationTaskStubWrapperProxyTestProxyPrinterComposerVisitorServerClientServerContextPropertyCollectionAnnotationResolverExpressionFacadeMessageInterceptorQueueDispatcherQueueContextAnnotationGetterAnnotationModelFacadeBeanDecoratorComposerContextTaskPolicyWrapperConsumerDispatcherMethodBeanCloneParameterRepositoryThreadWorkerOrderDecoratorComposerCloneInterceptorServerStubDatabaseAttributeConsumerAdvisorIdentifierGetterBroadcasterInterceptorParameterAdapterMapperComparatorWatcherWorkerSingletonValueReponseProccesorObserverThreadListPoolContextAuthenticationPool
https://pastes.dev/VwQ4Q6DS5m what's yarn gonna name this
https://pastes.dev/Y28oJ2NLBv ok I did some more
2 lines
click on it
i did
anyone wondering for me to explain why there's JavaFX setFont(font) method and there's setStyle("-fx-font: 16 System");
you would guess its an utility function which parses stylesheets. but nope they're different, if i set style via stylesheet string, context menu gets styled as well, meanwhile setFont sets only the current elements value
wtf is this
JavaFX is worse than Java AWT tbh
at least in AWT i know what everything does instead of trying to guess
JavaFX feels like aliexpress version of HTML/CSS
why tf would you have two ways to style elements, and the worst thing is that sometimes setFont() isnt being exposed under Node class, so you have to use setStyle() anyways, like this api feels sooooo
average 1998 api
that's why i have java std library
it never marks anything as @Deprecated
or @Legacy
now that's just straight up false lmao
so many more
and finalize() method got deprecated and removed in java 9 iirc
just hang forever lmfao
?paste
Hello, I use the latest version of SpigotUpdateChecker, and I want to remove the shaded dependency com.github.Anon8281:UniversalScheduler, which is shaded under com.jeff_media.updatechecker.universalScheduler and use my own shaded one (ovh.paulem.btm.libs.updatechecker.universalScheduler)
In my project, SpigotUpdateChecker (com.jeff_media.updatechecker) is shaded as ovh.paulem.btm.libs.updatechecker so the final name of UniversalScheduler is ovh.paulem.btm.libs.updatechecker.universalScheduler
How can I make this ? In recap, I want to remove a transitive shaded dependency
transitive and shaded dont exist together
hum
if its transitive you can exclude it, if its shaded you cant
how can I make a background like in the screenshot, I have the same texture as theirs
what if I relocate usages to the implementation in my project, and delete the existing one ?
theres a chance of different method sigs
okay thanks
with negative spacing you can amove the shadow to the left
How can I make it also expand
paste multiple segements next to each other
like have a shadow thats just a part
and then put multiple of them
ladies and gents, i present AuthenticationLayoutComposer:
https://paste.md-5.net/viyepefivo.java
now i can have same layout for authentication scenes by just specifying what kind of input and button groups it will have without inheritance shit of implementing new nodes i see on stack overflow and on youtube
hooray
JavaFX?
Oh wait I didn't see the paste 💀
Hm? Are you sure you can specify the player like that
Don't use need the execute command
I am genuinly starting to tweak rn 😭
How do you get the item that was put into a slot? What method in the "InventoryInteractEvent" returns the item that was put into a slot.
I am starting to loose it😭
TAHTS A DIFREFENTY EVENTN KSDAZNKALSDFASD
WHO WROTE THIS API😭😭😭😭
e
(i mean mojang themselves, why they gotta do this to us)
mojang has nothing to do with this lol
but also, you straight up cannot listen to the InventoryInteractEvent directly
you have to listen to the click event or some other subclass
When i remove a Vnailla Recipe i get this Error in the console. Is there a way to remove vanilla recipies without these errors?
Tried to load unrecognized recipe: ResourceKey[minecraft:recipe / minecraft:golden_boots] removed now.
Recipes are stored in the world files
If you remove a recipe it is only removed from the servers memory not the data files
So is there no way to do so?
Bukkit.reloadData()
um, Its been a long time since I played with recipes, but possibly if you remove them before teh worlds are loaded (if you can do it that early). BUT you can;t do it after a world has been created
you could just ignore the error as it does not affect anything
Okay i will try to do this. Thanks
so ive been trying to set a player's fall distance to 0 after being launched by the server but with ping the BukkitRunnable() function that I'm using cancels before the player even launches. is there a way to get a server side measurement of if the player is on the ground?
Player#isOnGround? what do you mean cancels
(new BukkitRunnable() { public void run() { target.setFallDistance(10.0F); target.sendMessage("in air"); if (target.isOnGround()) { this.cancel(); target.sendMessage("cancelled"); } } }).runTaskTimer(this.plugin, 10L, 1L);
the delay being 10 ticks can still be a problem with ping but also if theres a block above the player
Hello, how can I minimize my fat jar using shadow and proguard in gradle ?
read the proguard docs
You can host a repo yourself with something like reposlite
Or publish it on maven central
do I publish the jar or the project like on github?
The jar
for maven central you publish the jar, the pom, the javadoc and sources jar, and the signature file
very true
Reposilite 
the wha
reposilite on top
pom what if I use gradle?
maven central is becoming more and more ridiculous to publish to
basically I made a plugin in which if ur banned you cannot talk in chat and when i type an msg it flags console
and what's the signature file?
gradle will generate a pom and a gradle metadata file
and a gpg signature file of each file you publish
very cool
needh elp
thats the log
i cant fix that AsyncPlayChatEvent


