#help-development
1 messages · Page 1094 of 1
Don't call respawn directly in the death event
but i call spigot.respawn on playerdeath
why
delay it 1 tick at minimum
why
So the player isn't respawn before the death event is finished
spigot.respawn is just causing this bug. I just need to set monitor priority
.
no
and it also doesn't have that death animation but that's not a problem
Don't change the state in the event
hey i need some help
Have you seen the API itself?
._.
but scheduling for 1 tick later is still error prone bro
imagine that the server is lagged
items:
A:
price-mode: CLASSIC_ALL
product-mode: CLASSIC_ALL
products:
1:
material: ENCHANTED_BOOK < WHAT DO I PUT HERE IF I WANT A SPECIFIC ENCHANT
amount: 1
buy-prices:
1:
economy-plugin: Vault
amount: '1.1'
placeholder: '{amount}$'
start-apply: 0
OLIVOOOOOOOOO
too bad
what can i do about it
doesn't do much of a difference
You really should just update and use the gamerule
update what
but I'm going to assume you're on 1.8
poor olivo
if this happens, the state will not change
If that's not your plugin ask in #help-server
right you were the alt of the guy that got banned
wdym
Bro I'm not anyone's alt
look at the creation date of my account
2020 you weren't even born
why are you so toxic?
toxic? he made a very serious accusation
defaming without proof is a crime
OLIVOOOOOOOOOOOOOOOOOO
HELP ME
Yes your honor, he defamed me in the SpigotMC Discord group. I want reparations
@ivory sleet do you agree with this guy 🗿
In that case it will still be 1 tick
is there an easy way to make sure a world I load is doing voidworld-type generation as in it just generates void?
it feels like this should be easy to do
so long as teh Generator is available with an empty overridden surface method
hm
thanks bae ❤️
nice 🙂
rate the code I wrote
terrible
beautiful
I'm not sure if this is a joke or not
Not saying its bad, just its auto generated overrides from a class
wait actually how is this even applied to a WorldCreator
wc.generator(new VoidGenerator());
oh
check the message after the message elg linked
I just made it static
oops
there now everything gets to be static
we love static
lovely
but isnt need tick
next question is weirder, I have someone sending me timings where worlds I am loading seem to be freaking out while saving despite me having it set to not autosave
because is fixed if i chagne the priroity of spigot.respawn to monitor
any ideas
get this man a job in life saving technology
buddy I make minecraft mods my job is way more important than lame shit like medicine or science
King shit
Always a good idea to change the outcome of an event in MONITOR. Nothing could possibly go wrong there. /s
why are you trying to respawn after death? What I usually do if I want to do this is I just use EntityDamageByEntityEvent, and if the health is <=0 just teleport them to spawn or something
Just don't bother talking to them
to love to ignore advice
they'd rather argue with you that they're right when asking for help
object VoidGenerator : ChunkGenerator {
override fun generateSurface(info: WorldInfo, rng: Random, x: Int, z: Int, data: ChunkData) = Unit
override fun shouldGenerateNoise() = false
override fun shouldGenerateBedrock() = false
override fun shouldGenerateCaves() = false
}
wc.setGenerator(VoidGenerator)

How about you tell use what you are actually trying to do.
wdym
(in one message)

I need to catch the killer of an entity in playerdeathevent and keep the spigot.respawn in playerdeathevent
I changed the priority of spigot.erspawn to monitor and it solved the problem
Why are you respawning on playerdeathevent though
One step back, what is this for? Paint us a picture.
but they told me that I should do spigot.respawn 1 tick later because of the playerdeath state, something like that
to force respawn
So do what I said it's way better and less error prone
what if they have totem
Lets stop giving advice until we actually have enough information. We have no idea what hes trying to do.
want scala?
or is that handled before the event
fair enough
not sure, I agree with 7smile, we will wait until we know what he is trying to do
Guys
I need a little help with something
Now I made an item list, and I add the item with the /additem command, and each item has a chance rate called chance: and it is set to 100 at the time, I fix this manually.
hello is there a way using nms in 1.20.4 to create light on a block surface
yes
When I say /giveitem, I get the item. I set a chance rate system so that it gives it according to chance, but it seems like it does not give the item according to chance.
hello, i want to anonimize players : so i want to change their skin to a steave skin or whatever. i've tryed many things but it din't work (i'm on 1.21)
If anyone can help 🙏
hello olivo 😭🙏🏽 how would i approach that
Cant you just place light blocks now?
oh fr
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
also is there a way using resource packs to just display text anywhere on the screen? i've heard of it but idk what the approaches are
yes
fun getItemBasedOnChance(itemsConfig: List<Any>): ItemStack? {
// Calculate total chance
val totalChance = itemsConfig.sumOf { (it as Map<*, *>)["chance"] as? Int ?: 0 }
// Generate a random number between 0 and totalChance
val randomChance = Random.nextInt(totalChance)
var cumulativeChance = 0
for (itemConfig in itemsConfig) {
val itemMap = itemConfig as? Map<*, *>
val itemType = itemMap?.get("itemType") as? String
val chance = itemMap?.get("chance") as? Int ?: 0
cumulativeChance += chance
if (randomChance < cumulativeChance) {
val itemDataFile = File(dataFolder, "ItemData.yml")
val itemDataConfig = YamlConfiguration.loadConfiguration(itemDataFile)
val itemKey = itemDataConfig.getKeys(false).find { key ->
val itemStack = itemDataConfig.getItemStack(key)
itemStack?.type?.name == itemType
}
return if (itemKey != null) {
itemDataConfig.getItemStack(itemKey) ?: ItemStack(Material.matchMaterial(itemType) ?: Material.AIR)
} else {
ItemStack(Material.matchMaterial(itemType) ?: Material.AIR)
}
}
}
// If no item was selected, return null
return null
}
Gotta work on those questions
sorry !
here is the last thing i've tried :
PlayerProfile playerProfile = player.getPlayerProfile();
try {
URL url_1 = new URL("http://textures.minecraft.net/texture/3b60a1f6d562f52aaebbf1434f1de147933a3affe0e764fa49ea057536623cd3");
playerProfile.getTextures().setSkin(url_1);
playerProfile.update();
player.sendMessage("Your skin has been changed");
} catch (IllegalStateException | IOException | NullPointerException exception) {
player.sendMessage("Failed to set skin");
}
(the url is the alex skin)
Try not to ask yes/no questions when you don't want a yes/no answer
essentially you use a bossbar or action bar and custom fonts and negative space to draw anything anywhere
sorry 😭🙏🏽 im on mobile ive just realized that
ohhhh that's actually smart
okay thank you
its possible check if player click on to go the menu on playerrespawn menu?
yeah it's more complicated than that
you will need to mess with the server internals
or only with packets
don;t call .update()
You are rolling by weight, not by chance
if the player leaves without respawn. how i verify on playerjoin?
if the player leaves without respawn. how i verify on playerjoin?
player.isdead?
is the player in the respawn screen when they rejoin?
hmm should i update with show and hide ?
if so isdead might work
any idea why even though I'm doing world.setAutoSave(false) I am getting someone showing up with logs of worlds loaded through this code causing massive saving lag?
the menu appears?
I have no idea how to do this, what do you suggest?
calling .update() refreshes the data. You don;t want to do that as I believe it will wipe what you just set
how would one approach making a player locked into 3rd person if that is possible
i assume thats client side only
Might have something forcing saves
yes camera perspective is client only
a backup plugin for example
that's kind of what I was thinking as well
i thought of using an npc as a player and having the player be a spectator / camera but that seemed janky
ahh
but that should get logged if it happens right
not sure
how the getdrops on playerrespawn/playerdeath work? Are event.getdrops in playerdeathevent only dropped in playererspawnevent?
If the client wants, he can just fly away from his character and discover everything around him.
There is no way of locking that down.
you're talking about the equivalent of a save-all command being run right
yeah
what about cancelling move event ?
Dunno if its possible, since I'm still new, but would it possible to make a plugin that can turn off and on a server at 12pm every night?
no
off yes on no
The server has no idea if the client* is using free cam
Fuck
ohhh
are you using a panel
You can write a plugin which calls a restart. But that is usually handled externally.
Oh yeah, I forgot they can do that
oh right u could call the restart if u have a startup script registered in the config file i think?
but otherwise ur other solution could just be using a panel's API and having an external service
good luck
Thanks gang
The items are dropped when an entity dies.
fun getItemBasedOnChance(itemsConfig: List<Any>): ItemStack? {
// Toplam şans oranını hesapla
val totalChance = itemsConfig.sumOf { (it as Map<*, *>)["chance"] as? Int ?: 0 }
// Rastgele bir sayı üret
val randomChance = Random.nextInt(totalChance)
// Şans ağırlıklarına göre item seçimi yap
var cumulativeChance = 0
for (itemConfig in itemsConfig) {
val itemMap = itemConfig as? Map<*, *>
val itemType = itemMap?.get("itemType") as? String
val chance = itemMap?.get("chance") as? Int ?: 0
cumulativeChance += chance
if (randomChance < cumulativeChance) {
// ItemData.yml'den item detaylarını al
val itemDataFile = File(dataFolder, "ItemData.yml")
val itemDataConfig = YamlConfiguration.loadConfiguration(itemDataFile)
// Item anahtarını bul
val itemKey = itemDataConfig.getKeys(false).find { key ->
val itemStack = itemDataConfig.getItemStack(key)
itemStack?.type?.name == itemType
}
return if (itemKey != null) {
itemDataConfig.getItemStack(itemKey) ?: ItemStack(Material.matchMaterial(itemType) ?: Material.AIR)
} else {
ItemStack(Material.matchMaterial(itemType) ?: Material.AIR)
}
}
}
// Eğer hiçbir item seçilmediyse, null döndür
return null
}
Is it good enough to allow him to choose items correctly based on luck?
Or do you suggest another method?
Don't load the file every time you run that method 💀
You cant properly define chances directly. It is always goint to be a weight based system.
So should it continue like this?
Why do people insist on using Kotlin when starting out lately? Ive discovered more beginners with kt than java in the past days.
wait, am I crazy, why is this red?
communities harass mfs to use kotlin instead of java 24/7
😭🙏🏽
because it looks like less effort
it just looks like java and typescript had a child
its a nice language
but between kotlin and java just is preference
@blazing ocean he's talking about you btw
its more of a dialect
😭😭😭

thats another way to say it yeah
no but seriously
?
Maybe its a lot, but relative
2% for a single task is quite a lot
Ah thats not 2% of ticks, its 2% of ticks that lagged iirc
yeah was going ot say it's .05% of a tick
Show timings
Yeah, on the top right, change from All -> Lag
Those tasks take almost 4s at times
actually it doesn't let me click on lag
oh
I had to extend the timeline nvm
ah well I guess reloading the entire thing would in fact cause a problem
It looks like this only happened at a single tick
it's weird though
because if I skip the last data point which is when I relaoded the plugin I still get the same read but can't access the lag tab
hm
well I deanonymizied the key tasks so at least it should make it easier to find out what's going on
This looks like some massive IO or chunk loading
But only at 1 single tick in an entire hour
timings :ugh:
Honestly i sometimes prefer it over spark, since spark doesnt profile single ticks. Only averages.
So outliers just get thrown in and skew the data
huh
you can see the time per tick (mspt) rather than percentage any given call tree took, averaged over the sampling time, but not % (also you can measure ticks over n ms long)
tf
now that I set my worlds to not save it seems to be corrupting the entities in them
this is just weird
is it somehow saving the entities somewhere? Even though they're tagged not to be saved?
When you pick up the XP particle from the ground, there is a sound effect, what is the name of that sound effect?
declaration: package: org.bukkit, enum: Sound
old version
yep
ORB_PICKUP
what makes meta#setCustomModelData
what do you mean "what makes"
what do
you do?
wouldn't even be useful to you on 1.8
its a value to assign a custom model to an ItemStack from a resource pack
not like resource packs exist of any use in 1.8
hum ok
bro im not 1.8
shut up
you are
fun fact: your browser logs to journalctl
what does it log
i have an alias for sudo journalctl -xeu
whats the -xeu
logs of a process/service
hey do someone have ever created an explorer map that's pointing to a trial chamber for exemple ?
what are good inventory apis for 1.8
sorry
hello i just learned about the SlimeSplitEvent is there something similar for Magma Cubes?
oh
can i somehow make a font be above another font?
im gonna check that now
what
How to use the manipulation tactic, making an armorstand visible on one player's screen, and invisible on another
Mmmm
Player#hideEntity
i want to use fonts to make gui look different, but also still have the gui title
you could use packets or set livingEntity.setVisibleByDefault(false); and then use player.showEntity()
okay and that still doesn't explain your question
it does
Thank uuu
I will try
no, your question still doesn't make sense
@inner mulch try to explain what you want to do a bit better
i know what they're trying to do but don't understand their question
me neither 🤷♂️
Just use double, it covers pretty much all of them
No
Cast it to primitive double
Hm, unboxing
Make a null check and call ((Number) val).doubleValue() instead
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
use the luckperms api then
isnt possible without?
i dont want show the perms setted by my plugin on chat
its possible?
Why are you giving player permission from your plugin?
Asking bc there could be another solution to your problem
control recipes
? like if player has permission to craft something
yes
Why does your plugin need to give these permissions why can't luckperms / other perms plugins
bro
i ll use luckperms api
I'm just asking. I can't think of any uses where your plugin would need to give a player permissions unless its a permissions plugin
Bro I didn't make a recipe plugin with playerdata itself
When interacting with a recipe, I give a permission and if the player has that permission he can craft the item
it even has more performance
I just wanted it to not be displayed in the chat when giving permissions
Why can't you do player.hasPermission()
yes, but I still fail to see why you need to give a player a permission to check if they have permission to do something. Doesn't that cancel itself out?
I give up
how i add perm without appears on chat?
public static void addPermission(UUID userUuid, String permission) {
LuckPermsProvider.get().getUserManager().modifyUser(userUuid, user -> user.data().add(Node.builder(permission).build()));
}
This seems like you're trying to do something in an approach that can be approached another way
You're not giving specifics of what you're trying to do
I already said everything
When interacting with a recipe, I give a permission and if the player has that permission he can craft the item
what does this mean
why when interacting with a recipe do you give a player a permission
TO CRAFT A ITEM
why is this given to him while he is crafting the item
is this a level based crafting system or something
ITS GIVEN FOR HIM WHEN HE INTERACT WITH RECIPE ITEM
That makes no sense
Lmao okay
shouldnt appear on chat
maybe for admins as a log record
also u can use vault permission api to add permissions alternatively
outerLoop:
for (Player player : Bukkit.getOnlinePlayers()) {
for { continue outerloop};
this exists? -,-
Yes but it's so blegh there's like no use case
goto?
have use case
see
I need to give continue in 2 fors and that does the job.
it's rarely useful, only if you need to break out of nested loops and such
break label
glad we have that
Never knew that thing existed
https://paste.md-5.net/ufawabikuw.cs why not works?I give ./tpa and the player does not receive the message (but after a few restarts he already receives the message, very strange). Then he accepts the tpa, and I am not even teleported to him, I am teleporated to a random place on the map.
I'm trying to make a gradle script for my NMS implementations using userdev
apply plugin: 'java'
apply plugin: 'io.papermc.paperweight.userdev'
ext {
minecraftVersion = project.hasProperty('minecraftVersion') ? project.minecraftVersion : '1.17.1-R0.1-SNAPSHOT'
}
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
maven {
url = "https://repo.papermc.io/repository/maven-public/"
}
}
dependencies {
paperweight.paperDevBundle(minecraftVersion)
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
options.encoding = 'UTF-8'
}
but it ends up failing to build
https://paste.itsme.to/ipirawutix.yaml
here is my script implementation:
plugins {
id 'io.papermc.paperweight.userdev' version '1.7.1'
}
ext {
minecraftVersion = '1.17.1-R0.1-SNAPSHOT'
}
apply from: rootProject.file("version/script/remapped.gradle")
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.Companion.REOBF_PRODUCTION```
any idea on how to make something work?
maybe something better than userdev
doesn't 1.17 require java 17?
no, that starts with 1.18 (or maybe it does require 17 for decompiling but should compile to 8 just fine)
but i tried java 17 and 21
nothing worked
ah, 1.17 required java 16
maybe it's just my phone but I don't see anything in that paste
its like 7k lines
@-@
oh
Patch Summary:
Un-changed files: 2420
Added files: 0
Changed files: 680
Removed files: 0
Missing files: 0
Failed matches: 2
Exact matches: 4470
Access matches: 0
Offset matches: 0
Fuzzy matches: 0
Overall Quality 99.96%
ends with this
😭
99.96% should be fine no?
Is it not possible to save a Player instance in a my User instance?
My user instance is only valid if it is also online
you are very vague
world#dropitem, world#dropitemnaturally, player#getinventory#additem need itemstack clone?
I usually do if it’s an item that already exists
Proper procedure is to only keep the players UUID instead of hard references to the Player object.
You dont need a clone here, but you should not rely on ItemStacks consistency.
But be more specific on what you are doing, then we can give a more concise answer.
why? my User is only != null if the player is online
I just go off whether the itemstack exists somewhere or not, like if you have a gui of items for example, give the player a clone of said item that they may have clicked on instead of defining a whole new itemstack object
but I believe these 3 methods clone the passed itemstack
Sporadically. Deciding if this matters, depends on what you are using those methods for.
for example if I give an itemstack to the player and then some plugin edits that itemstack or the player simply drops that itemstack I wanted to know if the itemstack I used would have the quantity modified or not
Sometimes
Bro, I know when to clone, I just don't know if these 3 methods already give a clone
In short: Dont keep ItemStack references around, unless you specifcally use them as prototypes
brother I know what a clone of an object is
and once again you don't answer the question
I want to know if the 3 methods i mentioned already clone the passed itemstack or not
Which one? You spewed a few.
world#dropitem, world#dropitemnaturally, player#getinventory#additem
this methods
I wanted to know which of these 3 doesn't clone
or all can clone, i don't know
hey guys, im lookin for a gui api or like an inventory api to use in my plugin, any suggestions? - to create menus
Thats an implementation detail you should not concern yourself with.
Internally craftcopies of ItemStacks are created quite sporadically.
Tell us what you are trying to do, and we can give you some proper advice.
Bro, do I have to invent an example to understand if a method clones an itemstack or not?
If you want to write one yourself:
https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/
Otherwise i only know Triumph. Havent used it in a while tho.
this seems appropriate because most of the public ones i could find didnt support 1.7 so making my own is probably the best way, thanks for the post
I already answered this question. Internal cloning can happen based on a plethora of conditions.
The ItemStacks dont always keep their references.
see this
ok see paste pls
Yes, what about this?
answer yes or no to the question I asked on the paste
The answer is: Sometimes
what?
Which of those words confuses you
see this
so bukkit keeps changing the internal code of the method, it changes it whenever it wants
^ this means sometimes the item stack will be cloned
for one player it doesn't clone the itemstack and for another it clones, I understand. thanks
The method contains conditions. If some conditions are met, the itemstack gets cloned. If not, then it wont.
This means there is a possibility for both.
which conditions
Irrelevant implementation details.
Can I do this without worrying that the variable will have different attributes later?
No, this is what i meant by prototyping.
If you keep an ItemStack as a prototype, then you should always clone it.
Dont keep ItemStacks on the heap unless you use them as prototypes.
ItemStacks are meant to live on the stack only.
prototypes you mean like in a menu?
ItemStacks are meant to live on the stack only.
what
Yeah, pretty much. Unless you use them as prototypes i would probably never throw them on the heap.
not sure what you mean by that
less memory use
Pretty much all of these implementations use CraftItemStack#asCraftCopy or #asNMSCopy, so they will always use a copy
Hello i need help with an issue im getting with a plugin where can i write to get help for this ?
some kbs
#help-server but more so in that plugins support discord if they have one
The memory use is irrelevant
event#getdrops on palyerdeath contain item nulls?
hm thank you
I do it because of this and legibility too
technically all objects are on the heap anyway
I'll tell anyone who's going to read it that that itemstack is only meant to be read
i was wondering if smile was drunk or what was going on
how would you throw it on the heap anyways
and the stack means something else in javaland
doesnt new ItemStack create it on the heap?
If we are talking about memory usage, yes. I was more concerned about the scope.
what do you mean by stack and heap in terms of scope?
but also "heap" doesn't mean native heap vs native stack either 🤓 it could be in the native stack but it's considered to be in the vm heap
ruh roh
Ive created a guild type plugin and im getting an error for "Command 'guild' not found in plugin.yml" im not sure what i can do for this im using IntelliJ IDEA.
well is it in plugin.yml?
Whenever you use the new keyword, you're allocating memory for that object on the heap
In the plugin.yml you have to define a commands section then list guild as a command
private final ItemStack item = new ItemStack(Material.DIAMOND);
public void doSomething() {
ItemStack item = new ItemStack(Material.DIAMOND);
}
Both are technically allocated on the heap, but the reference inside the method is on the stack, meaning it will
get freed, right when the method scope is left.
right , but thats not what smile meant
using weird terms
just say "keep it as a local variable"
right
Should look like this @burnt oriole
its on the function stack
name: Guilds
version: 1.0
main: me.senju.guilds.GuildsPlugin
api-version: 1.21
commands:
guild:
description: The main command for guild operations
usage: /<command>
this is how it looks
i get what you mean
so how would you save something to the scope heap
do you mean like a map of itemstacks as member variable
smile's swole af he'll skin you alive
Well the item variable inside the method is located on the stack while the item field is on the heap as well.
Both objects are on the heap ofc
Did you register the command?
I've registered my event and everything but my code aint wanting to work it claims there is "no usages" and it claims that the event is never used... coding on latest version.. (never ran into this problem ever...)
my code:
@EventHandler
public void onPostLogin(PostLoginEvent event) {
ProxiedPlayer player = event.getPlayer();
onFriendJoin(player);
}
@EventHandler
public void onPlayerDisconnect(PlayerDisconnectEvent event) {
ProxiedPlayer player = event.getPlayer();
onFriendLeave(player);
}
*everything else works fine, i have implemented Listener and have registered the class in my main file, how can i fix this little issue..?
Anyways, i oversimplified it. Probably irrelevant for ole.
into my commands class ?

but the field is in the local variable array, not the stack 🤓
shut up nerd
getCommand("guild").setExecutor(new GuildCommand()); in your main or wherever you initialize your components
you're in the local variable array
Suppress the warning
Ah, and in which memory section you think this lays?
in the void
the vm doesn't make any guarantees about that
right in between intel 13th gen and intel 14th gen
but it wont work still though if i do..?
package me.senju.guilds;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.command.PluginCommand;
public class GuildsPlugin extends JavaPlugin {
@Override
public void onEnable() {
// Retrieve and set the command executor
PluginCommand command = this.getCommand("guild");
if (command != null) {
command.setExecutor(new GuildCommand(this));
} else {
getLogger().warning("Command 'guild' not found in plugin.yml");
}
// Register events
getServer().getPluginManager().registerEvents(new GuildListener(), this);
// Initialize GuildManager
GuildManager.getInstance().loadGuilds();
}
@Override
public void onDisable() {
// Save guild data
GuildManager.getInstance().saveGuilds();
}
}
this is my main inititialize
i consider stack to be the stack per frame 🤓
?paste
well lets not get nerdy
Do this instead of whatever the hell PluginCommand object is kek
I've never seend this before
since when is this a thing lol
well maybe I am misunderstanding, but both of the code is the same, except in yours you just cut to the chase
static has to initialize in some order
which is probably top down
Which is better imo anyway
compiler on its best
That command initialization just looks so goofy
yeah true
(yes)
depends on the compiler 🤓
although i do agree that it's goofy when it's a constant expression
it really doesn't, it's in the language spec lol
oh it is?
yea
amazing
they really did think of everything
someone probably ran into StackOverflow when programming that
this is the first time im making one mb
@lost matrix I implemented your inventory thing from the post in kotlin and its working wonders on 1.7, tyvm
It's ok lol, just never seen it done like this so I assumed it was wrong
Hi, I need help sry https://mclo.gs/FyesCfc
english only please
?whereami
isn't asd a bungeecord bug?
Are you asking how Fast NBT is operating in the microseconds and why yours is operating in the nanoseconds? Or...?
no idea what I'm looking at even
event#getdrops on palyerdeath contain item nulls?
It shouldn't have null items, no
but I have a guarantee that I won't have it if nothing is changed?
how do i make it so that i can use & instead of §
Yeah. Bukkit calls that event with non-null items in that list
https://paste.md-5.net/anenutoxaj.bash Can I save the itemstack with a quantity of 20 with private final itemstack = .... and always call this item in addItem?
Yeah that should be fine
note: without cloning the variable
additem clones the past itemstack right?
It doesn't, but CraftBukkit needs to make an NMS copy of your Bukkit ItemStack anyways
because they told me that there were certain conditions to clone or not in getinventory#additem
The only true concern with not cloning it is that another listener might alter your item
But that's about it
I didn't understand. Can you give an example?
set another quantity in another listener in this itemstack for example?
private static final ItemStack EXAMPLE = new ItemStack(Material.STONE, 64);
@EventHandler
private void firstlistener(PlayerDeathEvent event) {
event.getDrops().add(EXAMPLE); // no clone
}
@EventHandler(priority = EventPriority.HIGH)
private void secondlistener(PlayerDeathEvent event) {
event.getDrops().forEach(stack -> stack.setAmount(stack.getAmount() / 2));
System.out.println(EXAMPLE.getAmount()); // This is now 32
}
Sure yeah
oh ok
thx
Not sure. Haven't looked too much into Fast NBT. I'm sure they've figured out some way to pack a lot of data very quickly into a byte stream or something
If it's a list of items, maybe they're doing item serialization in parallel, then joining them all together into a single stream at the end. No clue :p
So if I give EXAMPLE to the player and he drops the item and has less quantity, does it update the quantity in EXAMPLE?
where can i find bungeecord gradle for 1.20.6
Oh, no. What the player does to the item in their inventory won't affect it at all
What matters is what other parts of your code do to that instance
Example is constant within the code, ie: any time you use this constant for example to give the stack to the player the value will always be 64
What they do with these items after the fact has no effect on the actual constant
but bukkit doesn't edit this instance when the player dies idk?
But instead of 1.19-R0.1-SNAPSHOT it'll be 1.20.6-R0.1-SNAPSHOT
Nope. CraftBukkit has to make a copy to turn it into an ItemStack that the server understands
ok thanks
Do you clone for guarantee?
i tried but it shows me an error: https://pastebin.com/42bctq8W
You do realize nano is faster than micro right
I'm just curious as to why mine is faster, even without significant optimizations
Oh, yeah, you're right lol
Actually, no optimizations
My mistake, it's 1.20-R0.3-SNAPSHOT
Bungee doesn't normally update its API for minor versions because it doesn't really ever have to, but there are different revisions. The latest revision for 1.20 is R0.3
In the future, you can always check the Nexus :) https://hub.spigotmc.org/nexus/#browse/browse:public:net%2Fmd-5%2Fbungeecord-api
Sonatype Nexus Repository
what is https://wiki.vg/Chunk_Format#Biome_registry a biom exactly? it seem to be a little 4x4 chunk? in chunk update packet I should to give an array of byte or int but Idk what it should be exactly?
Anyone know why I sometimes get this error
Caused by: java.lang.IllegalArgumentException: Specified class does not exist
Its coming from a class that extends ConfigurationSerializable
Only happens sometimes
It seems like it happens when I stop my server then start it again quickly?
But its not persistent
Loading configs before your plugin is loaded. For example by not using the onEnable as your first entrypoint.
Can also be caused by the /reload command. Never use that one.
override fun onEnable() {
// Set the instance for those annoying classes we can't use DI on
instance = this
// splash screen fun yay
splash()
// Save the default main cfg
saveDefaultConfig()
// Register our classes
registerManagers()
registerListeners()
registerSerialization()
registerCommands()
// Save data on interval
val interval = TimeUnit.MINUTES.toMillis(20L)
object : BukkitRunnable() {
override fun run() {
saveData()
}
}.runTaskTimerAsynchronously(this, interval, interval)
}
thats my onEnable
im not using onLoad
using Plugman?
are your serialized objects stored in the main config.yml file?
if so register the serialization stuff in onLoad()
config.yml gets loaded before onEnable iirc
config gets loaded on first touch
does saveDefaultConfig count as touch?
I don;t believe so
then registerManagers or registerListeners or sth loads the config
No its a seperate yml file
register it in onLoad
The serialization or what
yes
or move registerSerialization() to the top of onEnable
lmao im going to bed
ok good night lol
u2
the issue is still persisting would i replace this : @Override
public void onEnable() {
// Register commands
PluginCommand guildCommand = this.getCommand("guild");
if (guildCommand != null) {
guildCommand.setExecutor(new GuildCommand(this));
} else {
getLogger().warning("Command 'guild' not found! Make sure it's defined in plugin.yml.");
}
with what you had provided ?
I mean yeah I think so? Idk steaf said they achieve the same thing but I guess try what I said and see if it works
@Override
public void onEnable() {
// Register commands
getCommand("guild").setExecutor(new GuildCommand(this));
// Register events
getServer().getPluginManager().registerEvents(new GuildListener(this), this);
// Load configuration
saveDefaultConfig(); // Ensure config.yml is included in resources
// Initialize tax manager
TaxManager.initialize(this);
i have changed it to this although i get a larger error now lmao
Hey, im looking to add a tab complete for my command, the first arg being player and the 2nd being my provided list of strings. this is the logic i have but it just seems to be adding both to the 2nd arg instead of one to the first and the other to the 2nd. idk if i have my logic wrong or if there is something im missing
public static class VoteTabCompleter implements TabCompleter {
@Override
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings) {
final List<String> completions = new ArrayList<>();
if (strings.length == 2) {
for (int i = 0; i < strings.length; i++) {
if (i == 0) {
Role.roles.forEach(role -> completions.add(role.getName()));
} else {
List<Player> onlinePlayers = new ArrayList<>(Bukkit.getOnlinePlayers());
onlinePlayers.forEach(player -> completions.add(player.getName()));
}
}
}
return completions;
}
}
}
Send the errors
you can't send completions for two arguments at once. onTabComplete gets called every time a player types one letter, and then it has to return exactly what is supposed to be shown right now
all you need is this:
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
if(args.length == 2) {
// return list of role names
}
if(args.length == 1) {
return null; // null means the client tabcompletes player names
}
// They're typing a third or fourth or fifth argument, don't suggest anything
return Collections.emptyList();
}
oh sick tysm
Also can I see the GuildCommand class? @burnt oriole
And put them in a paste please
?paste
?paste
?
Just put the class and error in the paste
Then click save
and send the link
mate
accident.
Thats what the paste link is for
?paste
Do you need me to show you
Do the plugin.yml and main class now
maybe its one of the other features of my plugin ?
Where can I find resources that go in depth about each facet of the rust programming language?
maybe its the tax system ? since i dont have an econ plugin or anything
This wouldn't effect the registering of the command
hm
The only thing I can think of is perhaps you didn't use the updated JAR file with the command in the plugin.yml?
There is a way to "connect" / "teleport" a player to another server? 🤔
Like I said, exactly the same impl and it works for me
like the api version ?
No the command
version: '${project.version}'
main: nuclearkat.testingsomethingelse.TestingSomethingElse
api-version: '1.21'
commands:
guild:
description: Main command for guilds
usage: /<command> [subcommand]```
Specifically the commands bit
How are you building the project?
Package / install buttons?
Im Using IntelliJ Idea then i just use build / rebuild
as for packages
i have each module in seperate packages
Go to the maven tab or wtv then lifecycle and then try install / package
See if that jar works
okay
I really don't know what else could be going wrong unless your plugin.yml is not actually being compiled with the rest of the plugin, but then it shouldn't even enable so I'm quite unsure
Ik I said I’d sleep but insomnia is hitting, I have a quick question
Is NBT persistent
Like without using PDC just straight NBT
Will it be persistent
yes
Only on items
Alright and NBT has existed since Minecraft 1.0 right
I was sceptical because I heard people saying if you put an item with NBT data on an item frame and then you take it back out the NBT is gone
that would be a bug
stuff like anvil renames is usually saved in nbt
and if you reapply an item it doesnt lose its name
so idk who said that
i installed with maven still same issue
Alright cool I’ll use NBT then thanks
why not use pdc
I'm so confused dude I really don't know, I literally copy pasted from your impl and it works
or are you in an ancient version
Yeah the version is quite ancient
1.7 right?
1.7
yeah jeez
nbt was a "good" idea at the time ig
ill run some tests adding stuff and things thanks for the help
What’s wrong with NBT
It's just gross
You're right
I can't make a proper criticism because I only ever used it once and I hated it soooo
Never used it again
But why would I anyway? pdc is the way now
I mean it’s essentially just a fancy map
(dont even talk to me about version support)
I'm sure you're right but I really don't have a reason to support this ancient technology
So I didn't and just stuck to 1.13+
There was an early version of pdc in 1.13
oh I guess that's what I'm thinking about then
But it’s not compatible with actual pdc
If the item dropped as an item entity in old versions like 1.7 then yes the nbt gets lost and would need to be reapplied once item is picked up again.
What was it just prototype pdc impl basically?
No way named items lost their name just from being dropped back then
I mean I know 1.7 was primitive but it wasn’t that primitive
They didnt lose their names as that was stored differently. Talking about the rest of the nbt stuff
Ugh I think I’ll just do it by item name
I know I know anvils and what not but I’ll just disable anvils
Lol i wasnt saying it wasnt nbt
Just that it had its own spot specifically for it in both item entities and items. Where as nbt data gets lost because the entity didnt have a spot for such data and the item did
But there wasnt much in terms of nbt data back then anyways, most times you would just use damage values depending on the item
Hi, can anyone help me solve an error please? Am i allowed to post it here?
If its help relating to programming or you are making something related to that #help-development
Otherwise #help-server
But here is fine too if its just a simple question lol
It's related to the ChestShop plugin. When I try to do /iteminfo on any enchanted book, a get an error report in console
Then I'd seek help in the ChestShop discord
#help-server someone might be able to help
thanks
But it's always recommended that you reach out to the specific plugin's support channel
tbf the chat does look like general
It appears item entities in 1.7.10 handled custom data just fine
On a related note man does 1.7.10 feel old now
Lol
Maybe it was something to do with the api. I am pretty sure there was instances where items would lose their data sometimes.
So I’m fine to use NBT without worry then?
I mean idk how the api will handle it
I wouldn't say without worry
I haven't used the 1.7.10 api since 1.8 came out :p
There is a way to "connect" / "teleport" a player to another server? 🤔
Server on the same network or?
If it’s on the same network you need to setup a proxy
If it’s not then you can’t
?pmc
do any of you guys know how I can incorporate items created with the executableitems editor into give commands in java
bc im trying to /give and copying the items nbt from the command console but its not working and just appears as a regular item as if the nbt is invalid or something
it has worked before with summon commands but never with give wanted to see if any of you guys knew
Do you have a plugin that is messing with the give command
You can try /minecraft:give
yes but you change it to minecraft:give yes i know this the issue is the copies nbt from the item made by executableitems isnt working in a give command
im pasting it exactly as is
minecraft:give @p minecraft:honey_bottle{tag: {PublicBukkitValues: {"executableitems:ei-id": "dragonfireale", "executableitems:ei-disablestack": "f1a930ac-7f2c-4a55-bd79-774ed95ace8a", "score:usage": 1}, display: {Name: '{"extra":[{"text":"Dragonfire Ale"}],"text":""}', Lore: ['{"extra":[{"text":"It has a fiery, hot feel..."}],"text":""}']}, CustomModelData: 4, HideFlags: -25}, Count: 1b}
Is executable items a plugin?
Not sure then, you’d have to check with them
idk where im supposed to contact them so i just assumed someone on spigot would know something
this server isn’t plugin specific lol
If its a plugin you can look at the plugin resource page if they have any links.
no but i just was looking to see if anyone knew anything bc im totally stumped lol
Generally most will have a github link where you can create issues.
ok
kk thx
Names binary tag tag
Nbt may have been great pre pdc but why the hell would you use it now
i use it for my schematic format
Can you not do this and put it in the container?
what
What do you mean by format
And this can’t be stored with pdc?
bro 💀
I’m so confused
it's a fucking schematic
Save a reference to the schematic in the pdc then
am i gonna put a schematic into an items pdc??
what pdc??
Yes
Store the entire thing in the item used to place it
i'd just need to get its nms compound tag
The players data file be damned
oh no
I just save a schem reference by name in the pdc for that structures plugin I was working on
okay and how is the schematic gonna be saved
i really don't understand how my schematics are relevant to pdcs
someone sent a tool a while back that was on some github that allows you to basically decode text
it uses ai to help out
Well I rather meant just a reference
decoding text is crazy
I mean you could just save it via the minecraft structure format
Bigger file size tho
fuck minecraft structures
all kinds, base 64 included
they are slow asf to place
i know there are base64 tools out there
can't even be placed async smh
but i'm looking for this specific one
Ig this is why I don’t reinvent world edit kek
I mean
Mmm
what
Ah yes because schematics can be placed async
i place mine async
on skibidi toilet
what in the name of everything that is holy is that nick
I’m curious, what would you call WE if not essentially “structure management”
swiss army knife for builders
mmmm
i might be
elaborate
I guess a better question is what does your lib offer that we doesn’t
What do you mean by custom schematics
Well you can’t edit the world state async
..custom schematics
me when nms
Unless you start directly editing the chunk palette
no i'm setting block state async
isn't this just any schematic? I don't understand what custom means in this context
my own?
fuck you
dont insult my name
Which would make any other schematic technically custom?
but true
I swear just setting the block state async with NMS also doesn’t work
well it works
Hence the fuckery with fawe
well yea
I assume your schema structure differs from we then?
yes
i am already scared
Gotta love when they have to make new definitions
I wonder what shall not is interpreted as
doesn't look like they have the ability to add regions, markers and assign data values to those (and the schem itself)
No
I mean you can use a marker entity as a marker
But no you can’t make regions, schematics are just designed to contain a build
its not really new definitions
its been around for like 20 years i think
the standard that is
Oh I just assumed RFC was their thing
i fucking had to
on skibidi toilet
this fucking brainrot
Why is the word brainrot associated with all the gen a lingo shit
idk I just use it on a daily basis
I use it for when I feel something is rotting my brain
logical i suppose
why?
Because I don’t?
kek
discord helper
Idk I don’t even know what channel it is
what if I would need help in #verification
stop using client mods that show hidden channels
I mean I think it’s just the verify channel
it is
that's fucking dumb
i dont use client mods sadly
discord is dumb
Go talk to chloe
fr
She'll show you the ins/outs of discord client mods kek
well
i kinda like it when chromium strangles my ram
3:50 am, should i go sleep kat
yes
Normal bed time?
as his boss
somewhat
I say grind til you sleep at the computer
👍
you're getting fired
You want the work done or not psh
well
Bad management fr
If you have no other goals then sleep yes
hm
btw what do u even work with?
i mean you know
kat how do you like em btw
Can you add color?
wdym
i can colour the background easily
but the text is a HUGE pain
since i'm using shaders
i'm just passing in some arbitrary color to the shader (on my text) which then removes the color and shadow
means i'd have to set the color to something else
Well if it's too much of a pain then I think it's fine as is
doable
tell me how to integrate it then
Huh I thought it was just custom fonts and the action bar
Didnt follow any of this, but how about just setting the opacity`?
this is all autogenerated btw, i would never fucking dare to write this by hand
Loser
can fuck with other stuff
- i can use opacity with my colour anyway
rad you should write a book
no
a book about coding in console
fuck you
i was about to give you a raise
I think it's because I didn't tell you to sleep
truly
huge skill issue
smh
smh you
Worst boss every swear
why is it asymmetrical
its been that way ever since they added it
thats more like it
if you're not careful enough I will subjugate you to SCRUM practices
please
EXCLUSIVELY

please no

I've got 3 projects ready for production but haven't gotten paid yet how sad
clearly a skill issue
Well it's a good thing I actually like the project ideas
good night pookie bear
Have a good sleep, see you in aprox 7 hours
and no kat i'm not asking you to read me a bedtime story
Your loss
that sounds so threatening considering you live on the other side of the planet
I had a good one cooked up
damn
It's funny because I know your sleep schedule
I know exactly when to attack >:)
one eye open sir, one eye open
goodnight rad
anyway Kat what are you working on?
on your free time ofc
i already know ur job schedule is tight
i mean ofc i do
Oh I don't have free time, I work for the job 100% of the time sir
that's concerning
What is free time if I'm not getting paid for it psh
you have a point
Real note however, hybrid skyblock / rpg core
not yet kek
aww
