#help-development
1 messages · Page 926 of 1
that can be used if u want to do stuff atomically supposing the map is one of those concurrent ones
and the atomic objects I prob dont even need to go through
So I'm assuming these are javadocs, and only spigot and bukkit have them
In intellij i have two projects set up, one for 1.16.5 and one for 1.20.4, and here are the differences when I view bukkit's LivingEntity interface:
I want to see javadoc instead of decompiled code in 1.20.4, but I'm not able to figure out where's the setting for that (is it in maven or intellij or something else), could anyone help me?
I currently have a normal map in a liveobject, i will look into these methods
Have you tried clicking the "Download Sources" button ?
...
I want to add that there is a sources jar in my folder ~\.m2\repository\org\spigotmc\spigot-api\1.16.5-R0.1-SNAPSHOT, but there isn't one for 1.20.4, it only contains snapshot.jar and snapshot-shaded.jar
BuildTools should have an option to install sources
I fixed the problem by enabling these options in BuildTools jar, the sources jar was generated
That's it, thank you
how do i set keepinventory for only one player?
Listen for their death save the inv and then give it to them when they respawn
Do you know java
what if they leave or something
yes
Then use ur knowledge, i showed you the way spoonfeeding isnt good
i havent meant i need code
?
yea i can store his items in hashmap or something
but
what if he is dead BECAUSE he left
can you give items to offline people? no
Yes you can
you can?
With a custom inv System, by saving the inv in a DB and changing it
prob on login
does giving items to player work when they have respawn screen and havent been respawned?
?tryandsee
?trying takes more time than asking
If you are concerned just enable to gamerule for insta respawn with no death screen
oh PlayerDeathEvent actually has .setkeepinventory
how do i make this disappear?
i clicked something on keyboard accidentally and it appeared
What are we looking at?
i dont know myself
otherwise i would have googled it
and?
looks like git blame?
it goes away
no it opened this

did u click this?
^
oh that one
yes that one
yea it works
This looks like git blame to me as well
thanks
git "blame"?
It tells you who to blame for each line
u can see whoever to blame for that piece of work
When something inevitably breaks
how do i check for errors after changing something in other classes rather than clicking on each of them?
compile untill it works 😂
lol
In fairness, I’ve had instances where I’ve named a boolean parameter something similar lol
I avoid it but it happens sometimes 
why is it bad tho isnt that what a boolean is for?
enabled or disabled?
It is, it’s just that people tend to use more relevant or descriptive names
Either “elytraAllowed” or “state”
okay
Or Like isThisVariavleTrueOrFalseINeedToKnowCuzItsTheElyrtaToggle
@river oracle ocp
Honestly not a huge deal though lol. It’s a parameter name. Worst case it shows up in parameter descriptions via Javadocs or your IDE via code mining
big disagree
I disagree with ur face
choco when will the foraging update release?
...
I don't name my variables because I don't have variables, they violate the idea of OCP
i ussually just use _, __, ___
really helps with readability!
whats the size of Bukkit Maps?
i used 128x128 but thats gives OutoufBoundsException
Minecraft maps have a resolution of 128x128
uh
Usually it's 128 (0-127) so I have no idea
at sun.awt.image.IntegerInterleavedRaster.setDataElements(IntegerInterleavedRaster.java:297) ~[?:?]
at java.awt.image.BufferedImage.setRGB(BufferedImage.java:1016) ~[?:?]
at io.github.unjoinable.whosthatpixelmon.MapCommand.onCommand```
oh 0-127
xD i used 1-128
i sometimes forget things start with 0 in this game
It's everywere
1 question
when u use bukkit renderer , does it execute for every player that loads the same map or is it only for 1 map
Hey guys, does anyone have tips for using GSON to serialize native Spigot objects (like Location and an ItemStack[]) to strings that can be stored in an SQL database? I currently get errors about fields that are inaccessible, like Location's world Reference (java.lang.Reference)
Custom adapter
yea make a type adapter to make it use the world uuid
Hello everyone, I am getting this error on plugin load:
java.lang.IllegalArgumentException: unknown world
I have a location saved in the config, the plugin loads the world referenced in the location as soon as it loads, but the error still shows up... Any idea how to fix?
Yes, i can give you a simple example on how to write a custom serializer.
Would this be a custom typeadapator for the Reference, or for the Location?
for the location
That'd be helpful! I just haven't created a custom type adaptor before but I can probably find code on the web, that works too.
If I add multiverse and softdepend it then mv loads the world before my plugin enables, but I don't really want to use mv
i always fix this with just having my own location object
only converting to bukkit's object when i need it
meaning the worlds already going to be loaded
Ah, yeah wanted to avoid that
But if that's the only way
rip
public class LocationAdapter implements JsonSerializer<Location>, JsonDeserializer<Location> {
private final Type typeToken = new TypeToken<Map<String, Object>>(){}.getType();
@Override
public JsonElement serialize(Location src, Type typeOfSrc, JsonSerializationContext context) {
return context.serialize(src.serialize());
}
@Override
public Location deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
return Location.deserialize(context.deserialize(json, typeToken));
}
}
You can use this adapter for any ConfigurationSerializable like ItemStacks.
It also works for Location[] or any Collection<Location> automatically.
Registering it on a Gson instance:
Gson gson = new GsonBuilder()
.disableHtmlEscaping()
.registerTypeAdapter(Location.class, new LocationAdapter())
.create();
There is another approach where you simply register a TypeHierarchyAdapter for the ConfigurationSerializeable interface, which simply
lets you auto serialize every Spigot object. But it requires reflections because your need to get the classes and then fetch a static method.
Interesting, thank you! It's good to note I can just use the serialize and deserialize methods. Also, what does "requires reflections" mean?
It means that you would have to use java reflections to wire a TypeHierarchyAdapter.
They can be tricky, slow and unsafe.
I normally write my gson deserializers fully by myself because I'm extra
Could I also just make a generic typeadapter for ConfigurationSerializable and then use casting when deserializing to map it back to the original object?
Nope, you dont have access to the static deserialize method that way
*Would need reflections
I mean... you could pass a Function.
Hm, let me just write something
not all classes are public, like item stack/item meta is package private so you would need reflection to access it anyway
So an adapter like this wouldn't work?
import com.google.gson.*;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import java.lang.reflect.Type;
import java.util.Map;
public class ConfigurationSerializableAdapter implements JsonSerializer<ConfigurationSerializable>, JsonDeserializer<ConfigurationSerializable> {
@Override
public JsonElement serialize(ConfigurationSerializable src, Type typeOfSrc, JsonSerializationContext context) {
// Serialize the ConfigurationSerializable object
Map<String, Object> serialized = src.serialize();
return context.serialize(serialized);
}
@Override
public ConfigurationSerializable deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
// Deserialize the JSON element back to a ConfigurationSerializable object
Map<String, Object> serialized = context.deserialize(json, Map.class);
return ConfigurationSerialization.deserialize(serialized);
}
}
ConfigurationSerialization.deserializeObject(serialized) this method doesnt exist
niether does deserialize
This is the best i could come up with, without using reflections.
public class SpigotTypeAdapter<T extends ConfigurationSerializable> implements JsonSerializer<T>, JsonDeserializer<T> {
private final Type typeToken = new TypeToken<Map<String, Object>>() {}.getType();
private final Function<Map<String, Object>, T> spigotProxy;
public LocationAdapter(Function<Map<String, Object>, T> spigotProxy) {
this.spigotProxy = spigotProxy;
}
@Override
public JsonElement serialize(T src, Type typeOfSrc, JsonSerializationContext context) {
return context.serialize(src.serialize());
}
@Override
public T deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
Map<String, Object> data = context.deserialize(json, typeToken);
return spigotProxy.apply(data);
}
}
Then register with:
Gson gson = new GsonBuilder()
.disableHtmlEscaping()
.registerTypeAdapter(Location.class, new SpigotTypeAdapter<>(Location::deserialize))
.create();
then u would just register one for each one u wanna use ? 😂
i know i was just updating it to match the deserialize methods i know do exist for certain concrete classes
i mean yea that works
Yep, at least you dont have to create a new class for each
Neat, thanks!
Gson gson = new GsonBuilder()
.disableHtmlEscaping()
.registerTypeAdapter(Location.class, new SpigotTypeAdapter<>(Location::deserialize))
.registerTypeAdapter(ItemStack.class, new SpigotTypeAdapter<>(ItemStack::deserialize))
.registerTypeAdapter(BoundingBox.class, new SpigotTypeAdapter<>(BoundingBox::deserialize))
...
.create();
Looks fine
Hmm. ItemStack might need a registerTypeHierarchyAdapter because the impl is scuffed
wait until you find out none of those classes are final :^)
Wait until you find out I extend ItemStack
Auxilor? Is that you?
why does it not work in inventoryclickevent to cancel the drop of an item from inventory java if(event.getSlot() == -999 || event.getSlot() == -1 || event.getAction().toString().contains("DROP")){ player.sendMessage(ChatColor.RED + "Cancelled!"); event.setCancelled(true); }
1.12.2
What makes you say that? It looks to have the same serialize/deserialize methods as others like Location
Wait until you find out there are 2 ItemStacks
Just call registerTypeHierarchyAdapter for ItemStack.class instead.
Ok 👍🏼 I'd like to know why if you have the patience/time to explain
In short
CraftItemStack
Has anybody worked with Commons Compress? I'm trying to read the contents of files in a tar archive. But entry.getFile() (entry.file) is null so I cannot read them. What am I doing wrong?
(trigger warning: kotlin)
private fun InputStream.asPack() = TarArchiveInputStream(this).use fullUse@ { tar ->
var entry = tar.nextEntry
while (entry != null) {
println("Iterating over ${entry.name}. File null? ${entry.isFile} | Directory? ${entry.isDirectory}") // for pack_metadata.json gives "File null? true | Directory? false
if (entry.isDirectory) {
entry = tar.nextEntry
continue
}
if (!entry.name.endsWith(".json")) {
entry = tar.nextEntry
continue
}
// irrelevant logic
entry = tar.nextEntry
continue
}
I'd like to avoid temp files if possible too ^^
The problem is, that the runtime class wont always be the bukkit ItemStack. It mostly is CraftItemStack.
This means that Gson looks for a TypeAdapter on the CraftItemStack.class which it wont find.
Registering a TypeHierarchAdapter instead of a TypeAdapter, lets Gson scan the entire TypeHierarchy for a viable adapter.
why do I feel like itemstack should've been an interface with a static factory method
Ahh okay, thanks this makes a lot of sense
I assume there's a reason for the distinction?
One is a wrapper around an NMS item stack for more direct modification of item data, other is API
is it possible to have a leash go between 2 locations
atleast we got ItemMeta right and that's just NMS
that way ItemMeta can eventaully be fixed without destroying the API
We just turn ItemStack into an interface
Bytecode 
And then cry because of the constructor
You mean like this?
I used packets, which spawned invisible slimes. Then i made one the holder and the other one the leashed.
yea
how to set a position for EntityArmorStand?? i cant find the method
Spigot NMS 1.20.4 (obfuscated)
To be fair, could easily ASM that to ItemFactory calls
It's either move() or setPos()
Depends on your mappings I suppose
Yeah it should be moveTo()
NMS uses moveTo() anyways
setPos() might not send a packet to update the client. Unsure of the difference off memory
Hey, is rhis message normal?
** „Reminder! All resources are the sole responsibility of individual authors and not SpigotMC. Access may be removed at any time. Please refer to the premium resource guidelines.“ **
And do i get it gernerally, or because someone took permissions to a plugin from me?
Just a general reminder that plugins are not immutable and can be deleted from the website at any time
Be sure to download and keep up to date frequently if you want to continue using it
Are you volunteering?
No :)
But, can the owner of the plugin, remove my Access? Also if i didn‘t do anything
I don't believe they can
Ok, because today at 10 am (mez) when i saw this in school, i was afraid, and had fear, that someone took me perms from a plugin, or thag i didnt had acces anymore to one plugin
Oh, Yarn's mappings seem to imply that moveTo() does in fact refresh the position :p
setPos() does not
boo obfuscated
¯_(ツ)_/¯
Use remapped :c
I can assure you that nobody here is going to remember obfuscated names by heart 
It would be less work to use remapped
I used
new EntityArmorStand(EntityTypes.d, nmsPlayer.dM());
instead of
new EntityArmorStand(nmsPlayer.dM(), loc.getX(), loc.getY(), loc.getZ());
😭
idk
why opening an Inventory can call InventoryCloseEvent??
If another is open
If you already have one open
I don't have inventory open, before opening a new one
I have resolved this by, unfortunately, resorting to temp files. I extract the entire archive to a temporary folder and read its files instead of archive's files
[18:29:49 INFO]: Close java if (args.length == 1 && (args[0].equals("play"))) { chessInventory = new ChessInventory(SumeruChess.plugin); Board board = new Board(); player.openInventory(chessInventory.getInventory()); board.drawPieces(player, chessInventory.getInventory(), board.getBlackWhiteBoard()); ChessModel model = new ChessModel(SumeruChess.plugin, board.getBlackWhiteBoard()); Bukkit.getServer().getPluginManager().registerEvents(new ChessListener(model), SumeruChess.plugin); } ChessListener.java java @EventHandler public void onInventoryClose(InventoryCloseEvent event) { if (event.getInventory().getHolder() instanceof ChessInventory) { System.out.println("Close"); event.getHandlers().unregisterAll(this); } }
oh no InventoryHolders
public ChessInventory(SumeruBrain plugin) {
inventory = plugin.getServer().createInventory(this, 54, "Chess Board");
}```
ok wtf
What could be the problem? by the way, I have drawPieces running via Bukkit.getScheduler().runTask(SumeruChess.plugin,()-> {
due to cancelledpackethandleexception in an attempt to run it in asynchronously
why i cant find noGravity and setCustomName methods
i think so
it was setNoGravity last time i used nms
im creating a plugin that uses packets
I wish
add a nag anytime a plugin uses one.
another one?
Why is it so important to not systout tho
I agree no point in stopping using sysout
bump
That why I use errout
Devs only did it to stop being harrassed
Just good practice to properly identify where messages are coming from
oh i didnt see that sorry
bump
I believe that would reset the changes
can i force intellij to compile and to stop caring about errors?
when a player re-joins, is the new player object created or is the old one kept? if it changes I must literaly recode everything
UUID > Player reference
the old one is stale after a re join
yeah...
why would u wanna do this ;dd
im refractoring stuff and just want to test while doing it but there are so many erros
😠
should I change everything to name strings or UUIDs
uuid's
Use eclipse
feel you xD
I haven't found the solution...
Eclipse can just replace uncompilable methods with a throw statement
though I recommend just fixing your code
Eclipse will replace methods with invalid code with stubs to it's best effort, so evidence of a superior IDE here
i just want to test something while replacing stuff
fixing it is not an option currently
i mean. that is assuming you even should wanna do this
which is debatable
I mean you shouldn't use eclipse to build production builds anyways
So this behaviour won't sneak into prod at which point it is fair game
You shoudl be using Maven so your underlying IDE doesn;t matter
yo guys which path do i need for hibernate configs?
src/main/resources/hibernate.cfg.xml <- this one good enough?
or does it look for the full path?
that path is invalid at runtime
which path then?
it depends on how you are packaging yoru jar
at runtime there would be no path, all resources are copied to your jar root
ok
hey! does anyone know of a crates plugin where you have to press stop at a certan time to recieve a certan reward?
so it shows in a gui with a stop button. when you press it you get the focused item
sorry
i wasnt the guy asking the question so ping him
okay which is a correct statement, if u are using entities as reference have fun with your memory leaks, uuid's are better and this is not to discuss
yes im dumb
entity references are fine in 99% of cases
plz wtf is going on
why is PlayerTextures a feature then..? what is its exact use?
somebody has violated the ocp
OH NO
guys one class per command or one class for every command?
Yes but refrencing the entity/player prevents it from being GCed
one class per
depends, but generally one per command
And a entity/player not being GCed is more expensive than a UUID not being GCed
isnt that gonna look stupid on a big plugin
no its not, single responsibility
like one class for an /discord command
lua better
keeps it clean
java too hard
gotcha.. so that's why Player doesn't have a Player#setProfile but PlayerProfile had a PlayerProfile#setPlayerTextures
Sounds like a skill issue
UUID > entity reference
WeakSet + Clean up code
object oriantated is for noobs
Go code in haskell then
four gigabytes of libraries for tetris
But beware because you might never return to oop again
join java server
look inside
people complaining about java
oh yeah I don't disagree with that, java is horrible in quite a few aspects
generics
already put forward my opinions about it :p
type erasure?
okay, still type erasure bad
okay nerd
yes but other languages have better generics
with no type erasure
guys what is java good for besides finding a job and minecraft
everything except games I'd say?
working in enterprise xD
+1 this
why no game
they're such a mess
after working in several languages with generics pretty heavily
unclear unreadable unmaintainable code
I mean you can make games in java if you really want to
java just isnt good for games, minecraft should have never been made in java
not to say they are useless - they are useful - just badly implemented
c++ is much faster in for rendering applications (games)
c++ is better for this
But the existing big game engines are not java based
c# is also fine
people
Ah yes java bad but C# good
every game dev?
LibGDX 
like c
Even though they are both JIT
C# is pain
violates the ocp
java not bad at all, just different purpose
too bad nerd
smh make your own one then
c++ is language is older then all of us together#
okay c++ still fast
what's your point exactly?
isn't maturity desireable?
isnt C faster
isnt python older than java lol
i need some new shit
Depends on how you write the code
im young and hungry
i could really shave off that millisecond off my hello world program
thank god c exists to save the day
a whole ms for hello world 👀
writing c because it's "fast" is dumb - c should be written for other reasons
mainly simplicity and compatibility with running on bare metal very easily
It is
you're probably not gonna be making games where the language difference matters
in terms of performance
i make gta 7 alone
👍
?kick @quaint mantle toxic attitude
does it have sex
Done. That felt good.
vr sex
gross thats sinful
???
not interested
requirement for aaa's
smh not an AAAA game
compile time included if you write go :PP
You can’t walk around here calling people “dumb fucks”, end of story
i programm in machine code to get more fast
so not if I use another language >:)
gotta squeeze every last bit out of your memory
i dunno i think mindfuck is a good language
or was it brainfuck
forgor
actually you should make your games in HolyC
writes in c-sharp for years
uses go for apporximately two minutes
"i switched back to c# from go :("
@ivory sleet wink wink
Goroutines?
who is this md_5
i'm ya go guy
Or what u now call them 😅
golang my beloved
founder/starter of the spigotmc project

md4 💪
is he rich
no not really
He lives in Australia
wow xd
he's australian though 
imagine spending your life on this and then some stupid people come and make a better version of the thing you did
hm?
paper
if getting lost in a thousand patches each conflicting another is better than see yourself out to the paper server sir
All of the work on spigot was required for paper to be born
ntm it's a fork as coll said
"whats a fork"
And all of the work on bukkit/craftbukkit was required for spigot to be born
cant we just use a spoon or what
spork
imagine you open a company build it and then someone else makes it better
spork
Lynx if you mention the hardfork I will hard fork you 🍴 😡
250 ide warnings in a single vanilla nms class 💪
softspoon*
comicallysmallknife
tbf the non-decompiled NMS code is probably a bit less trash
spork
decompilers are impressively accurate and with the mappings i would say there are just minor structural differences
doesn't warrant it being total crap at points
birthday party plastic cutlery
I mean I assume the actual Mojang devs aren't sitting there with 6000 ide warnings like
they're using notepad++ to code didnt you know
a little config setting adjustment and ALL those warnings go away 🙂
guys how do i know when to create a new class for something
pink paper plate that says Princess in a cursive font and absolutely nothing else
they just have @SupressWarnings("all") everywhere and remove it on obf
?paste
i dont do this whole classes thing i write my plugins in 1 file
you are the real g
what are these classes your talking about i dont write in files
files just got added to computers 2.1, they're pretty cool, should check them out
they're like a thing you do in what they call "school" but idk i never been
okay but what about files 2
netflix wont fund a files season 2
doesnt have enough "pdf files" or whatever they called
pdfs arent even that good
My plugin creates custom worlds but when the server restarts they are unloaded. and if a player disconnects and logs in after a restart, they will be placed on the default world because the world they disconnected on is unloaded.
I've made all the code to load the world when you teleport to it and such and I know MultiverseCore loads every world on server start but I don't want to load every world right away, only if needed.
I tried loading the world on PlayerJoinEvent but I still get teleported to the default "world" world, where should I load the worlds instead or should I load all of them on server start? I'm afraid this might cause unnecessary lag to the server.
You'd have to load them before the join event
PreLoginEvent is deprecated
async pre join event
Maybe start the loading in AsyncPlayerPreLogin and block until it's done
You can block that event for up to 30 seconds before the client gives up
i would assume world loading isnt fast enough to be doable on a playerjoinevent, you could teleport em to that world when its loaded or alternatively keep track of all the custom worlds players are in and only load those worlds
or asyncpreloginevent sounds good
ok i will try asyncpreloginevent
ty guys, i shall be back if i need more assistance
🫡
https://paste.md-5.net/lolaruyiro.cpp
Im having issues setting up hibernate. Does anyone know what might be wrong, do i need to provide more information?
It seems the player location on AsyncPlayerPreLoginEvent does not save the world(It's saved as null so I can't use it to find which world to load), i will need to setup a local yml file most likely with which world each player disconnected on and then know which world it is to load on PreLogin 🤔
There is no player location in that event
use the UUID with getOfflinePlayer and get the last location of said OfflinePlayer
I created a OfflinePlayer with it using the UUID
and then checked the location of the offlineplayer
yes, its what i did
Define issues
@EventHandler
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
OfflinePlayer player = Bukkit.getOfflinePlayer(event.getUniqueId());
PlebUniverse.getInstance().getLogger().info("Player: " + player.getName() + ", location: " + player.getLocation().toString());
}```
Logs:
`Player: Miau_, location: Location{world=null,x=1.7512713417714039,y=77.0,z=-4.453081250598158,pitch=21.70218,yaw=-145.50967}`
there are the errors in the link
Well if the world isn't loaded yeah, it's gonna be null
Idk if you can get the raw name/uuid of it instead
what should I do if inventoryclickevent cancels the event of dragging an item, but not cancel using buttons such as 1,2,3,4 on the keyboard that also move the item?
Depends on which part of this is unwanted
I want to cancel dragging an item using the keyboard buttons in the inventory altogether
You cant drag items using the keyboard buttons
declaration: package: org.bukkit.event.inventory, enum: InventoryAction
declaration: package: org.bukkit.event.inventory, enum: ClickType
Choose your poison
I have added local .jar as dependency and can I find usages of method from lib class inside lib?
Now when I use find usages its only show me inside my code
I need to find usages inside lib
Yeah it won't index for those usages
Try looking for the source of the plugin
if it's not available decompile it and then search
on paper theres a PlayerShieldDisableEvent, is there a equivalent in spigot, or what would be the best event, for my plan?: I want to play a own sound if I disable a shield with a axe-hit. also I want to detect a hit on a shield with an item, which do not disable the shield.
I mean, yea you can I guess
iirc you can get the players item
that it is using
getActiveItem
Hi, I need PacketPlayOutEntity class but I use spigot mapoings and this class is not there, adding cradtbukkit.jar as a library I have access to this class, but when building maven it throws the error "cannot find symbol"
just got that, that looks fine?
public void onEntityDamage(EntityDamageByEntityEvent event) {
if (!(event.getEntity() instanceof Player) || !(event.getDamager() instanceof Player)) return;
Player target = (Player) event.getEntity();
Player attacker = (Player) event.getDamager();
if (target.isBlocking()) {
if (isAxe(attacker.getInventory().getItemInMainHand().getType()) || isAxe(attacker.getInventory().getItemInOffHand().getType())) {
attacker.playSound(attacker.getLocation(), Sound.ENTITY_ITEM_BREAK, 1, 1);
}
} else {
if (event.getCause() == EntityDamageEvent.DamageCause.ENTITY_ATTACK) {
attacker.playSound(attacker.getLocation(), Sound.BLOCK_WOOD_HIT, 1, 1);
}
}
}
private boolean isAxe(Material material) {
return material == Material.WOODEN_AXE ||
material == Material.STONE_AXE ||
material == Material.IRON_AXE ||
material == Material.GOLDEN_AXE ||
material == Material.DIAMOND_AXE;
}
}
probably? xD I mean just test it
map men
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Yeah alright
I just wanted to replicate the physics of the fireballs like in this video
I believe all you would need to do is detect when a player rmbs with a fireball, launch it as a projectile and the velocity should take care of itself because it's just an explosion
yep
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Please dont mass ping, and dont advertise or look for developers on the discord.
The spigot forum has a "hiring" section.
Hi. Im having this error where when I send "/pauseclock", "/resumeclock" and "/final" nothing happens. The console has no errors when I issue it.
I'm also having another error where after the first is created, any more clocks will automatically result in "End of Quarter" and the progress refuses to go down. This even happens if the clock has ended/I rejoin and it doesn't work anymore.
Here is the script:
https://paste.md-5.net/nucodabamo.java
All commands are registered in the Main and in my plugin.yml
Any idea of what can be happening?
public static void main(String[] args) {
File path = new File(System.getProperty("user.dir"));
JsonHandler config = new JsonHandler("test.json", path);
config.set("test.1", "test");
config.set("test.2", "test");
System.out.println("keys=" + config.getKeys());
System.out.println("keys=" + config.getKeys(true));
}```
Results
keys=[]
keys=[]
?paste
https://paste.md-5.net/ofalinoxom.java - Code where issue takes place. Totally sure something related the set() and mapKeys() methods
Im rechecking them but im not really sure, whats happening tho
wouldnt make it more sense to swap those two params of jsonhandler
yeah i was thinking that right now tho hehe
but so far im re checking to see what can be happening
we need a bit more than that mate
getkeys
isnt is in the same file? Maybe i confused the files
for now i didnt implement the file loading / saving, just doing it by memory to test
But i still cant find what happening i will start debugging line by line
Hi. Im having this error where when I
What plug-in is used to create rank keys?
and crate keys / crate
Tryna find a good one
what about the rank as keys
do u mean claimable items to claim ranks?
what about like money wdraw
u know that
one
or naw
fairly sure this one is pretty aight on that front https://www.spigotmc.org/resources/beastwithdraw-multy-withdraw.13896/
?paste
https://paste.md-5.net/dulorepeyi.xml
how is there a classnotfoundexception?
do u have the shade plugin?
yes
i dont have winrra
ok
jar --list -f file.jar 💪
disclaimer: only for zip
hmm javas char endianness is platform dependent right?
like the classfile spec says be, but the lang types are platform dependent
I'm fairly sure it's gauranteed to be big
the jvm operates in big endian, yes
IMO char is fairly dumb
?
it's just an int in disguise
its 16 bit utf16
I thought a char was a byte
all numeric types are one or two ints in disguise
char is an unsigned 16 bit value iirc
nope
char can't store every single character
never knew that
Which is sadge
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
?
what
yeah what?
thats not really services
god forbid someone uses #bot-commands 🙏
im having issues setting up hibernate, all the tutorials are outdated, does somebody know which dependencies i need and to get a sessionfactory?
olivo everywhere it says i only need the core, but when trying so i get classnotfoundexceptions?
Did you provide it at runtime
is the scope of core runtime?
you need to shade it in to your plugin or use the library loader
and which class is missing
Caused by: java.lang.ClassNotFoundException: org.glassfish.jaxb.runtime.v2.ContextFactory
Caused by: jakarta.xml.bind.JAXBException: Implementation of Jakarta XML Binding-API has not been found on module path or classpath.
these two
💀
what
bro its shaded into it idk what these errors mean my plugin isnt usually 30mb
Could you send your pom
that does look like the right one
hmm, akward
i can send u my full error maybe it will help, not sure if this is just some spigot plugin cant load stuff
?paste
Try adding:
requires java.xml.bind;
requires com.sun.xml.bind;
to a module-info.java file
if it doesn't help try setting up a minimal project that recreates the issue
and send it so I can play around with your setup
yeah that won't help
I see service loader in the stack trace, you'd have to set the thread's context classloader to the plugin one
Emily to the rescue 🎉
? what does this mean
magic runes
wherever you initialize hibernate
ClassLoader old = Thread.curentThread().getContextClassLoader()
Thread.curentThread().setContextClassLoader(plugin.getClassLoader())
// .. initialize hibernate
Thread.curentThread().setContextClassLoader(old)
whether that be in onEnable or wherever
okay, plugin has to be hibernate in this case?
uh yeah, whatever thing is shipping hibernate
alternatively, hibernate might have a way to configure the classloader it uses
but idk about that
its a module, im not sure how i can access that
then just do getClass().getClassLoader
in onenable?
well, if it isn't a plugin it doesn't have an onEnable
that's just a way to access the current classloader
you'd do that in that separate module
i accessed the class loader and now i have an even bigger error
it seemed to do something
?paste
no clue, but it seems it isn't finding some class
never used hibernate so idk what the specifics of that one are
It's trying to use the hibernate reactive api
It's a separate dependency and you've probably told it to use it somewhere
so core has the ability to act with classes it hasnt got any impl of?
why does core do that :(
i guess i gotta find this reactive dependency
Hey, quick question, why does 1 and 2 trigger if in the config I only have "Place"??
Have you tried printing the values (of getString) rather than 1 and 2
is there a default value set
"If the String does not exist but a default value has been specified, this will return the default value."
thanks @slender elbow and @chrome beacon i managed to get it to work with your help. :)
Oh
check docs yep
Is there a way to solve that without removing the default value?
yikes this is not scalable
hey, I have a server that needs to reset the map every restart, I did this in a simple way by disabling auto save. However, it causes a memory leak and crash, which is honestly predictable. Is there any alternative I can do? Even better if the chunks are reset after unloading them.
How can there be a memory leak if you restart the application?
and crash?
How exactly are you restarting
if you're using the spigot restart method then make sure to delay the startup a bit in your script so the server has time to stop
Anyone know a good way to get the color of leather Horse Armor? I looked at the Docs and they arent super useful. 90% of the stuff works only for wool. :/
Doesnt the LeatherArmorMeta include that? I would assume it does.
I did too but all it returns is "Cannot be cast"
It does yes
Please refrain from using single letter variables. Having descriptive names for your variables and methods is essential for clean code.
I would also reuse your variables instead of calling get-chains every second line.
It will make your code look much cleaner.
I usually only use single variables for things that either cannot be mistaken "p" or things that are used once "c"
p tells the user nothing
decorated pot
Depending on where that snippet is running, you're probably just casting the meta of all items to LeatherArmorMeta
perpetual torment
Pepsi
As an aside, call getItemMeta() once and hold it in a variable. It clones the ItemMeta each time you invoke it so invoking it twice just creates an unnecessary copy
It's also nullable for air, but if you're instanceof checking it to LeatherArmorMeta that's already covered
Interesting getting uuid through the player profile
I just don't drink soda
@young knoll MD being in the reviewers section of your ItemType/BlockType PR made my heart jump
maybe maybe maybe
What package is sent when an object is enchanted in animation to the owner of the object?
I think the item is just replaced
https://imgur.com/a/UlBoZp5 I'm making chess in minecraft, I've combined two inventories and I want to find out if it's possible to use a resource pack to remove that field named "Inventory" that separates the two inventories
How exactly
You set the key for it to ""
can you tell me what it's called
this inventory
container.inventory=Inventory?
or key.categories.inventory=Inventory
You should try both
But the problem with that is that you may remove the "Inventory" from every other inventory
One way could be to rename your chess inventory with a special character of which you assign a texture of a whole inventory, and maybe that can override the "Inventory" in the middle
This is probably the better way to do it
https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/resource-packs/1244109-chestchess-play-chess-in-minecraft-texture-pack I found such a good chess resource pack, but the download link is not available)
I created an inventory texture, but I don't know how to apply it, I set a name for my inventory, where should I put the texture, I understand that somewhere in assets\minecraft\textures\gui\container
suppose I add unicode at the beginning of inventory description \u2661Ches Board
what's next?
I'm not an expert on resource pack
I was just on this page) but it's not for 1.12.2
can I set a texture for an item in the inventory?
the texture will be very large and will cover the entire inventory
As I remember you can't do that before 1.13 or so
The itemtexture would match the size of a slot
But I'm no expert, maybe you can try
I belive you can, lemme search a video real quick
https://www.youtube.com/watch?v=bv_wYNs5L6M
I think this is sufficiently "outdated" for it to work in 1.12
Indeed
It is not exactly a tutorial, but there is a template resourcepack included in the description
I want to store Locations in an sqlite db. So I store the name of the location, x,y,z,yaw and pitch. Would it be better to have an auto incrementing primary key and check for the name every time or just use the name as a primary key? The names are supposed to be unique but ofc the players could try to create a warp twice
lookup time would be near identical, doesnt really matter
atleast with the name as primary key you can't have copies but otherwise not much benefit
Hi guys, my Server crashes when i remove an Item in here:
ItemStack itemStack = event.getItem().clone();
itemStack.setAmount(1);
if (player.getInventory().containsAtLeast(itemStack, 1)) {
player.getInventory().removeItem(itemStack);
Rubbellose rubbellose = new Rubbellose(Main.getInstance().playerManager);
rubbellose.startGame(player);
} else {
player.sendMessage(Main.error + "Du hast keinen Rubbellos im Inventar!");
}
} else if (event.getItem().getItemMeta().getDisplayName().contains("XP-Case")) {
ItemStack itemStack = event.getItem().clone();
itemStack.setAmount(1);
if (player.getInventory().containsAtLeast(itemStack, 1)) {
player.getInventory().removeItem(itemStack);
} else {
player.sendMessage(Main.error + "Du hast keinen XP-Case im Inventar!");
}
} else if (event.getItem().getItemMeta().getDisplayName().equals("§6§lCase")) {
ItemStack itemStack = event.getItem().clone();
itemStack.setAmount(1);
if (player.getInventory().containsAtLeast(itemStack, 1)) {
player.getInventory().removeItem(itemStack);
new Case(player);
} else {
player.sendMessage(Main.error + "Du hast keinen Case im Inventar!");
}```
if i just do "new Case(player)", the case opens, everything is working. but if i remove it, the server crashes?
hi. I've imported NMS with mojang mappings to my project and used it, however, it says NoSuchMethodError when the method I've created which has NMS in it
https://pastes.dev/AeSi5VfpOb
log: https://pastes.dev/0RZexpk5VD
show the whole class
do you get an error message?
the whole class is basically a PlayerInteractListener
?nms
those arent Moj map classes
which line is erroring, there are two removeItems
getting an crash report:
// Shall we play a game?
Time: 12.03.24, 10:40
Description: Exception in server tick loop
java.lang.AssertionError: TRAP
at net.minecraft.server.v1_16_R3.ItemStack.checkEmpty(ItemStack.java:153)
at net.minecraft.server.v1_16_R3.ItemStack.setCount(ItemStack.java:944)
at net.minecraft.server.v1_16_R3.PlayerInteractManager.a(PlayerInteractManager.java:439)
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1573)
at net.minecraft.server.v1_16_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:32)
at net.minecraft.server.v1_16_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1)
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:28)
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18)
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(SourceFile:144)
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(SourceFile:118)
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1061)
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1054)
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(SourceFile:127)
at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1038)
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:970)
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273)
at java.base/java.lang.Thread.run(Thread.java:829)
oh cool the trap exception
i dont know, it just crashes if i remove the item
been a while since I've seen it
but the item is removed in the end
itemStack.setAmount(1);
if (player.getInventory().containsAtLeast(itemStack, 1)) {
player.getInventory().removeItem(itemStack);``` bit of a conflict of interest
you're setting count then removing the item in the same tick, should do one or the other
it was like that before:
itemStack.setAmount(1);
player.getInventory().removeItem(itemStack);
ah, does it automatically remove the item if stack size = 0 ?
than i could do this:
itemStack.setAmount(itemStack.getAmount() - 1);
no, itll look for an item stack in inventory that is 1 stack size
it doesnt remove just 1
yeah that should work
ill try it
ah nice, now it works - thanks @drowsy helm
now trying to set block using NMS, but I got this error
IllegalArgumentException: Cannot get ID of Modern Material
public void setBlock(@NotNull Location location,
@NotNull Material material) {
val world = location.getWorld();
val x = location.getBlockX();
val y = location.getBlockY();
val z = location.getBlockZ();
if (y < 0 || y > 512) return;
val worldServer = ((CraftWorld) world).getHandle();
val chunk = worldServer.getChunkIfLoaded(x >> 4, z >> 4);
val chunkSection = chunk.getSections()[y >> 4];
val blockState = Block.stateById(material.getId());
chunkSection.setBlockState(x & 0xf, y & 0xf, z & 0xf, blockState);
}```
val yikes
pretty sure you gotta createBlockData and get an nms version of that
I have something somewhere
Yeah
how to convert it to nms thing
BlockData is a Bukkit class
val blockState = ((CraftBlockData) material.createBlockData()).getState();
nvm, it works if i only have 1 item in hand, if there are 2 items (i mean the amount), server crashes
good ol' 1.16
now it gives no error, but it doesn't place the block
public void setBlock(@NotNull Location location,
@NotNull Material material) {
val world = location.getWorld();
val x = location.getBlockX();
val y = location.getBlockY();
val z = location.getBlockZ();
if (y < 0 || y > 512) return;
val worldServer = ((CraftWorld) world).getHandle();
val chunk = worldServer.getChunkIfLoaded(x >> 4, z >> 4);
val chunkSection = chunk.getSections()[y >> 4];
val blockState = ((CraftBlockData) material.createBlockData()).getState();
chunkSection.setBlockState(x & 0xf, y & 0xf, z & 0xf, blockState);
}```
what if you relog
Block{minecraft:diamond_block}
Then yeah it works
does someone know if hibernate operations are async or do i need to use completablefuture and stuff?
so why am I not seeing it?
for someone who also get this error, this is the solution:
ItemStack itemStack = event.getItem();
itemStack.setAmount(itemStack.getAmount() - 1);
if (itemStack.getAmount() >= 1) player.getInventory().setItemInMainHand(itemStack);
Probably something changed in nms
could you send your code?
I don't have anything to set blocks fast :)
last time I messed with blocks in nms it was uh
either client-sided blocks or hacky craftblock impls
as they usually call a class that belongs to a specific group of objects and loads them from the config
{
"textures": {
"texture": "guis/board_center"
},
"elements": [
{
"from": [ -16, -16, 15.9375 ],
"to": [ 32, 32, 16 ],
"faces": {
"north": { "uv": [ 11, 16, 0, 5 ], "rotation": 180, "texture": "#texture" },
"south": { "uv": [ 0, 5, 11, 16 ], "texture": "#texture" }
}
}
],
"display": {
"firstperson_lefthand": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 0, 0 ],
"scale": [ 0, 0, 0 ]
},
"gui": {
"rotation": [ 0, 0, 0 ],
"translation": [ 72, -74, -80 ],
"scale": [ 3.66, 3.66, 3.66 ]
}
}
}
[14:01:08] [Client thread/ERROR]: Unable to parse metadata from minecraft:textures/guis/board_center.png
java.lang.RuntimeException: broken aspect ratio and not an animation
at cdq.a(SourceFile:213) ~[1.12.2.jar:?]
at cdp.b(SourceFile:101) [1.12.2.jar:?]
at cdp.a(SourceFile:76) [1.12.2.jar:?]
at cgb.n(SourceFile:763) [1.12.2.jar:?]
at cgb.a(SourceFile:188) [1.12.2.jar:?]
at cgc.a(SourceFile:23) [1.12.2.jar:?]
at cev.c(SourceFile:105) [1.12.2.jar:?]
at cev.a(SourceFile:93) [1.12.2.jar:?]
at bib.f(SourceFile:761) [1.12.2.jar:?]
at bib$7.run(SourceFile:2601) [1.12.2.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
at h.a(SourceFile:46) [1.12.2.jar:?]
at bib.az(SourceFile:991) [1.12.2.jar:?]
at bib.a(SourceFile:419) [1.12.2.jar:?]
at net.minecraft.client.main.Main.main(SourceFile:123) [1.12.2.jar:?]``` texture - https://imgur.com/a/lFy30Ss
I made a board based on the parts of the images
but how do I get the ratio right for the texture
I only have the top and bottom of the board displayed correctly
try making it a 1:1 ratio
256x256?
sure
I figured it out
here is the code if you want:
https://pastes.dev/P3ZOrdEGzN
yikes updating individual blocks
val in java?
yeah, basically you have to cache the blocks and update it
lombok
chunk update / multi block
since when can lombok introduce new keywords, compiler plugin?
compiler hack
and what does it expand into?
var has been a thing since java 12 iirc
im talking about val
val is something like var
probably final var then
oh really?
but is that okay for a single block though
it works
Maybe add a multiblock change method which lets you change multiple blocks and sends the chunk update packets
Cries in api
maybe we could make a full multi block change api
and maybe add support for fake blocks
I mean there is a multi block change api
there is api that wraps the multi block change packet
Isnt it about to be deprecated already?
but no proper 5 trillion blocks per second api
I pray
if a player has taken an item from the inventory to the cursor, then inventoryclickitem should be called and inside I can get this item player.getItemOnCursor() or event.getCursor right?
?tryandsee
already
pretty sure it's gonna be the event's current item
it's before it's put to the cursor
^
(or, if putting an item in an inventory, it'll be the other way around)
how do I accurately determine when a player takes something into the cursor?
InventoryClickEvent
private boolean isWhitePiece(ItemStack item) {
return item != null &&
item.getType() != Material.AIR &&
(Objects.equals(item.getItemMeta().getDisplayName(), "White pawn") ||
Objects.equals(item.getItemMeta().getDisplayName(), "White rook") ||
Objects.equals(item.getItemMeta().getDisplayName(), "White queen") ||
Objects.equals(item.getItemMeta().getDisplayName(), "White king") ||
Objects.equals(item.getItemMeta().getDisplayName(), "White bishop") ||
Objects.equals(item.getItemMeta().getDisplayName(), "White knight"));
}
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if (!(event.getInventory().getHolder() instanceof ChessInventory) && !event.getInventory().getType().equals(InventoryType.PLAYER)) {
return;
}
Player player = (Player) event.getWhoClicked();
if (event.getClick().isKeyboardClick()) {
player.sendMessage(ChatColor.RED + "Недопустимый ход!");
event.setCancelled(true);
return;
}
ItemStack currentItem = event.getCurrentItem();
ItemStack cursorItem = event.getCursor();
if (!isValidMove(event, currentItem, cursorItem)) {
player.sendMessage(ChatColor.RED + "Invalid Move");
event.setCancelled(true);
return;
}
if (player.getItemOnCursor() != null && !isWhitePiece(player.getItemOnCursor())) {
player.setItemOnCursor(null);
}
if (event.getClick().isLeftClick()) {
handleLeftClick(event, player);
}
}
``` everything works except for this``` if (player.getItemOnCursor() != null && !isWhitePiece(player.getItemOnCursor())) {
player.setItemOnCursor(null);
}```
when I capture a pawn named "Black pawn"
Please don't compare items by name
You should create a layer on top of this.
Create a ChessBoard and an abstract ChessFigure, a ChessRuleset etc.
It will help you a great deal.
Yep
And if you have a chess board class, you might be able to use it to not compare stuff by name
I already have everything divided into many classes and there is no abuse of static fields
I dont see any use of those classes here.
Btw using a custom InventoryHolder is a pretty expensive way of handling custom inventories, because on every click the method getHolder() will clone the entire inventory again.
what's wrong with comparing by name, i can't select an item in the inventory that is not a figure, and absolutely all pieces have a displayName
someone can just name an item like that and put it in
this is not allowed. I have a lot of conditions that disallow making "unacceptable moves"
oh you can just make an acceptable move but add a new piece
there is nothing stopping that
to add a item called as piece, need to close the inventory to take it, and the game will stop at the same time
you don't need to close the inventory
inventory clears at game start
Anyways. You should link this inventory to a custom ChessBoard class. And then create an instance of ChessPiece for every ItemStack on the field.
ChessPiece should be abstract so you can create all the other classes like Pawn, Queen etc. You should also give them a color this way.
Then do your entire logic with Board positions, ChessPieces and a fixed set of rules for the chessboard.
The spigot logic should be linked to this in a way that lets you write it once and never touch it again.
you can pickup items
I will cancel this event
¯_(ツ)_/¯
Thanks for the tips
PS: writing a proper chess ruleset is actually quite tricky. I would honestly just shade a chess library and simply link a board state to your spigot inventory.
I have a chessmodel class that analyzes the list of available moves + stockfish
WE MAKING IT OUT OF THE POSITIVE TPS WITH THIS ONE 🔥 🗣️ 🔥 🔥 🗣️ 🔥 🗣️
It's justified, moreover, stockfish does everything asynchronously
it was a joke
hey, i'm trying to create a splash potion with an effect, i'm trying this:
private val healthPotion = ItemStack(Material.SPLASH_POTION, 1).apply {
val meta = itemMeta
if (meta is PotionMeta) {
meta.apply {
basePotionType = PotionType.INSTANT_HEAL
customEffects.add(PotionEffect(PotionEffectType.HEAL, 1, 2))
}
}
}
and this just gives me these:
you need to set the item meta after editing it
thats what meta.apply does
does it?
cursed kotlin
^
wait does it not do that automatically
any easy way to upload resources to textures.minecraft.net (programmatically) apart from skin uploads ..? I swear there was some weird thing with education edition a while ago.. might be a dumb question though
hdb clearly does this somehow-- as an example https://minecraft-heads.com/custom-heads/head/81948-warden-dye if you decode the base64 in the item data you'll see a valid textures.minecraft.net url
mineskin has an api iirc
hdb makes you do it manually
First you have to create a Minecraft Skin. Focusing on the head portion of the skin.
You can design a completely new skin, or you can use an existing head as a base. You can download an existing head's skin file by going to the head page and selecting Download at the bottom.
To create skin designs, some people use programs like paint.net, Photoshop, and MCSkin 3D. You can also use free skin editors from sites like PlanetMinecraft, NovaSkin and The Skindex.
When your skin is finished, upload the skin to your Java Minecraft account, and generate a give code using our Head Command Generator.
Once you have created the give code, you can change back your skin without it affecting the newly generated head.
Either that or you use mineskin
it looks awesome but how do they do it
just a few accounts and then api requests to mojang to change their skins and get the texture value back?
since old textures stay after skin changes iirc
yeah they do, it's at the bottom of the page
there has to be a more convenient way ugh
https://www.reddit.com/r/Minecraft/comments/nv8xkk/comment/h621xvw/ almost certain this is the education edition thing I was thinking of
yeah so the game accepts *.minecraft.net URLs, not just textures.minecraft.net
if I want to save the items of an inventory (like a player vault) is it best to just save an array of ItemStack
instead of Inventory
you can do both
but I'd just save an array of items
as this is the thing you want to store
does ThreadLocalRandom only need to be initialized once? or is ThreadLocalRandom#current() always different and I have to reinitialize it each time I generate a new number?
ok so I should just do private List<ItemStack[]> vaults; (list cause there are multiple vaults)
How to set this?
Example: (Please see it not for a AD)
What
How do you reinitialize it
ThreadLocalRandom.current() returns ThreadLocalRandom
since It's a static method It's kind of confusing
is PlayerSwapHandsItemEvent in an inventory called, if so seperately of a the clickevent?
it doesn't create a new one @umbral ridge
ok thanks!!
it's a single instance, you can also set it by Thread.currentThread().setRandom() iirc
@EventHandler
public void setMotd(ServerListPingEvent e) {
e.setMaxPlayers(/*And here a STRING-Message*/);
}
How to set this?
Example: (Please see it not for a AD)
you need to return an invalid version
you need packets
also stop spamming
and set the invalid version text
p sure the event doesnt allow for that
also stop spamming
^
e 😠
event 😃
variable names are important @mighty gazelle
me naming it ev or the full event name
bukkitEvent
name it eve
Okay
not naming it event is kinda cringe
event is just the peak name for events
serverListPingEvent
no
mhm
you've said it four times
ServerListPingEvent eventPingListServer;
because variable names are important
I agree xD
you can't know what "e" is, but "event" you know that it's an event variable
yes
"e" could be a variable for an exception, but I even name exceptions with "ex" or even exception sometimes
yeah variables help reading stuff
How can I make packets for this?
i've once seen some1 perform complex math with
double a
double b
double c
no one knows what happened in the method
Google it
Jeka allows you to
it's a library downloading library
and what the issue?
yeah I don't usually use one-character variable names
anywhere
It's bad practice
Looks like the shutdown method is causing that error
Could you remove it and just get the stacktrace for your setup method
Could try this
https://www.spigotmc.org/threads/beginners-guide-to-itemstacks.623654/ 7smile7, thanks for the wonderful tutorial
It mentioned the wrong class loader in the stacktrace so I assumed it was the same issue as yesterday
