#help-development
1 messages · Page 1252 of 1
except my handleablehandler managed a event class -> event executor map
instead of manually listening to and forwarding every event in the game
it's not every event-
@sonic goblet Whats the skull for?
what is going on here
you are setting a player to spectate an entity and then hiding that entity from the player?
how is that supposed to work
oh wait thats dumb actually yeah
hiding an entity from a player will send a destroy entity packet to the player to delete the entity on their end, and then suppress all position/metadata updates going to that player
well yes but spectating is both client and server side
so then how do I keep the spectator from seeing the armorstand
you can't spectate an entity that doesn't exist
you can't see the armorstand anyway if you're spectating it
unless you're in third person with f5
yes you can
i don't think you see the spectated entity
that'd be silly, no?
you're inside its head
if the entity were visible all you would be seeing is its head from the inside
oop nvm your right
Bukkit.getScheduler().runTaskAsynchronously(StaryEvents.getInstance(), () -> {
countdown = 10;
while (players.size() < playerlimit) {
Bukkit.getLogger().info("Countdown: " + countdownInitCommand);
if (countdownInitCommand) {
Bukkit.getScheduler().runTask(StaryEvents.getInstance(), () -> {
for (Player player : players) {
player.sendMessage(String.valueOf(countdown));
if (StaryEvents.getInstance().getConfig().getBoolean("messages.wmsgenabled")) {
player.sendMessage(StaryEvents.getInstance().getConfig().getString("messages." + "waitingmessage"));
}
}
});
Hi guys, I'm freaking out with this one, i've been working on a minigame events plugin and I was fixing some things in the countdown. I made so that countdownInitCommand is a boolean that's set to true when i do a certain command. When that boolean is on true, it prints the countdown in the chat. Now what's the problem here? See the Bukkit.getLogger().info("Countdown: " + countdownInitCommand);? If I remove this thing (the logger thing) it just does not work. I don't know why, but if i remove the logger, or I don't put a println that prints the countdownInitCommand it just does not work, it does not start the countdown neither sends anything in the chat.
Help
Don't use a while loop like that
You're wasting a ton of resources for no reason
Use a ticking task
?scheduling
mh
so i do a ticking task and cancel the task when countdown finishes
has sense
the easiest way to go about self-cancelling tasks (and indeed one of the very few reasons to use them) is BukkitRunnable
you can use runTaskTimer which has cancel()
the bukkittasks returned by BukkitScheduler::runX can also be cancelled, but not easily from within the task itself
take for example
BukkitTask myTask = scheduler.runTaskTimer(() -> {
//do something
if (stopCondition) myTask.cancel(); //compile error; myTask has not yet been assigned
})
versus bukkitrunnable
new BukkitRunnable(){
@Override public void run() {
//do something
if (stopCondition) this.cancel();
}
}.runTaskTimer()
the tradeoff is that you get two levels of indentation, more boilerplate, and an ugly anonymous local class
the best imo is if you create a BukkitRunnable class and use it like so
depends a bit on how lightweight the stuff you're putting in the task is, but yeah, this is the most "proper" way of going about it
you can also do
schedluer.runTaskTimer(task -> {
if(condition) {
task.cancel();
}
}
oh yeah those exist as well
I'm using this Bukkit.getScheduler().runTaskTimer(this, new Isometric_GM(this), 1, 1); with a run method in Isometric_GM
O(k * m * n)
k is the number of base packets to scan
m is the number of filters
n is the number of metadata (classes)
Is that a lot?
i try create package scan logic
that doesn't tell me anything about the numbers you're dealing with, time complexity depends on the scale you're working with
that said you probably can't get worse than k*n*m
for plugins
mm yes
during classloading? more than once?
it's acceptable for things to take a while at startup
I feel like we're not getting anywhere, what are you actually trying to do?
once
what are you scanning them for and what are you trying to find
to find the annotations I need from the classes. (I use reflection to load classes) The process is mainly onEnable, but there is a possibility that not only
so this is why i want to know how long this can be
annotations for what
i will creating di
is there any particular reason you aren't just using Guice or Dagger
well, I won't be able to see anything if I have to keep digging details out of you lol
my suggestion is to just do it and worry about the speed later
well i think this enough information for you get how long this can be
your bigger plugin?
it is not
I need numbers to figure that out, not ideas
if your annotations are supposed to be in every class on every plugin you have, then sure, it is probably going to take time
if not, then maybe not
so this is why i ask how many classes and packages you has in your bigger plugin
I don't know any plugin that goes past a thousand classes
so we have thousand classes hmmm
does spigot resolve order of hard depends?
what do you mean
if you put a plugin in your depend list, then it'll load after that plugin
like if you give
depends = [p1,p2,p3]
does it actually load p1 first then p2 and p3
or does it just make sure the plugin loads b4 p1,p2,p3
it just makes sure teh plugin loads before any of these, but doesn't change the loading order for them
they'll still load alphanumerically I believe
if you need a specific order of loading then you are probably doing something wrong
should be fine if you only do it once but like, try it and see; shade in a big library like fastutils and see how long it takes
time to shade spigot
lolol
if you haven't done that at least once you aren't a true plugin developer
that's so real
alr time to test
i selectively shade parts of spigot into my velocity plugin (yamlconfig) to keep my config management platform agnostic 🤡
@sly topaz ok, was messing around with the datafixers, and even after i apply the datafixer it still doesnt remove the "levels" part
also snakeyaml and fastutil and a few others
total number of classes in the fat jar is like 20k
there's a fork of configurate that supports it
and then again it fails the update
can you show me how you applied the datafixer?
private String runDataFixer(String string) throws IllegalArgumentException {
try {
CompoundTag compoundTag = TagParser.parseCompoundFully(string);
int oldDataVersion = getDataVersionOrDefault(compoundTag);
if (oldDataVersion == DATA_VERSION) {
return string;
}
setDataVersionToCurrent(compoundTag);
Tag fixedTag = DataFixers.getDataFixer().update(
References.ENTITY,
new Dynamic<>(NbtOps.INSTANCE, compoundTag),
oldDataVersion,
DATA_VERSION
).getValue();
return fixedTag.toString();
} catch (CommandSyntaxException exception) {
throw new IllegalArgumentException("Failed to run data fixer: " + string, exception);
}
}
i did look at configurate at one point
but honestly if i'm moving away from bukkit configs i'll probably just rawdog it with snakeyaml
you aren't applying the villager trade data fixer there tho
you should be using References.VILLAGER_TRADE or whatever it is called
oh shit yeah, i swear that didnt exist on 1.20
well it probably doesn't exist in 1.20
also i have like a ton of issues with nms and stuff that ill ask in a bit, but imma first try to get it working on 1.21.5 lol
since the data fixer is for upgrading from the 1.20 to 1.21 or whatever
out of curiosity, why are you running datafixer on mobs manually
they stored a villager snapshot onto an item stack
and now facing issues upgrading items that come from old minecraft version to new mc version
paper iirc has builtin entity (de)serialization to bytes methods that take care of datafixers
i use those for shoving mobs into my items
sir, this is spigot
you mean <unnamed fork that must not be named>
previously uh
i used the structure block api
i captured a structure with the entity in it, then saved it to file
then shoved the file bytes into the pdc
it'd have been easier if that Byte Serializable PR from Y2k was merged, but sadly that never got touched again
just like Choco's component PR
it was fucking ultra-clown but it did work
the fork where i have negetive aura
wouldn't that still mess with deserialization tho
nms handles it when the structure gets loaded
that is why u don't use nbt,pdc and shit just store it into a sqlite data base 🧠
would just have used a data fixer manually like we were trying yesterday lol
(i would do that)
the more you work with nms the more you realize the winning move is not to play
actually would sqlite be any slower
eh, it might be the case for volatile things such as making custom entities but things like applying data fixers or dealing with nbt isn't that bad
Still doesnt work, the levels key is still there
it's gotten pretty alright with mojmapped paper now, since the bytecode is stable
hm, try messing with the old data version?
define messing
my hacky item frame map image plugin using nms loads flawlessly on 1.21.4 despite being built against 1.21
try setting it to a lower number version
never would've worked pre-mojmap
wherever that nbt was actually valid
mojang mappings are goated
is there any way to modify ai from tamed animals?
i mean should be 1.20
I want to make them walk in a specific way, do certain things and so on, I wanted to know if it's possible.
how can i do that
u can fork spigot and patch ai 💀 /s
well, if you give me a few hours, I can give it a go at it myself
i tried with 1.19 as the old data version, but still the same
in the meantime and in case it just doesn't work as we expect, you can try the other solution, which is just manually upgrading the format
paper and maybe spigot too have a mob goals api
yeah let me try that i guess
though i don't remember if you can pass custom goals to it
create a custom mob class and override its movement functions
inb4 I get it to work but that solution ends up working and you just use that lol
the pathfinder api also goes a long way in making mobs do things
there is no pathfinder API
all ai really is is a bunch of logic telling the pathfinder to go to places and look at directions
there is on a certain fork
but we are not using certain fork here, are we
we are
in the game its implemented as goals for muh modularity and oop, but just running your own tick loop on it and puppeteering it with the pathfinder achieves about the same thing
though being fair, there's a surprising amount of people that don't ask in the paper discord for whatever reason
they're actually replacing all of that with brains now
there's fewer and fewer mobs with goals every update
yeeeah but the brain is basically goals with a bunch of extra nonsense on top
like memories
eh, the brain stuff is easier to hack around
if you want to make a custom memory or whatever it is just two methods or so
i'm not sure, i've never really tried working with either goals or brain
there is no brain api either
it isn't an easy task, I think Choco tried at some point but couldn't come up with a good design to make everyone happy
personally
too simple and people would've found it limiting, too complex and people wouldn't use it
i think we expose a "kill brain" button
and then expose the pathfinder, navigation control, and jump control
and let plugins make calls to those as they like
let the plugin author decide what form of ai they want to use; be it decision trees or whatever else
the unnamed fork also mentioned they wanna add a brain api
Is there any generic dependency resolver
no for plugins
yeah
leme check aether
ok, manually updating works, but for some reason now "upgraded" villagers will only spawn once i guess since they have the same uuid, but this doesnt happen with villagers that were stored in this version (not really the biggest issue but still)
could just remove the UUID from the nbt honestly
I do wonder how that doesn't happen with new ones tho
how are you spawning them?
does the new version not contain an UUID or something?
it doesnt
i guess that explains it
Okk, this is a fix that works for now so
and the uuid issue is niche enough that its not a problem
and it gets fixed if u place down the villager and pick it up again
If you care about it being more elegant as far as nbt handling goes, you could use adventure-nbt to deal with transforming the nbt
Also, I now have the problem of a couple enum constants having changed, i.E: PotionEffectType.SLOW -> SLOWNESS
between 1.20 and 1.20.5
how, the nbt should use the minecraft names
and since i compile with api version 1.20.5 to have EntitySnapshot, those throw an execption on <1.20.5
no no not related to the nbt
just in other places in the plugin
have you set the api version in your plugin.yml?
i mean i could access EntitySnapshot through Reflection but idk if thats the best idea
You want a multimodule project
One module for the old version and one for the new version
yep
to what, it should be the lowest version you support
but wait i set it as 1.20
and compiled with 1.20.5
is that the problem or?
yes
i REALLY dont want that
Then reflection it is
I am honestly not sure why even support 1.20 at this point lol, do you happen to have bstats integration in your plugin?
reflection 💪 💪 💯 🤑 💰
nop
i mean, why not support it :p
I recommend it, helps one decide whether a version is worth maintaining as you can get information which server platform and version your users are using your plugin
because it's clearly hindering your development process, is it not? 🤔
well to be fair, upgrading the format is doing most of that, and that one couldn't be helped
barely anyone knows you have to care about data version or what even DFU is when dealing with these things
yep, im fine with using reflection to get entity snapshots its honestly not that big of a deal its only used in one class so
was just wondering if theres another way
I honestly would just support 1.20.6 instead of trying to support all the way down to 1.20
nowadays, minecraft minor versions contain major internal changes, and so the API adjusts as it sees fit
i think most of the people who are outdated are under 1.20.6
that's when the datacomponent nonsense got added in, right
1.20.4 at the worst tho, not 1.20
i mean the main reason why people don't update is plugin breakage
and the datacomponents are probably the biggest case of that in recent history
so anyone on any version past that is almost certainly on 1.21.1-4
so i don't think going down to 1.20.6 makes much sense; you'd want to go lower to capture additional servers
there are actually more 1.20.3 servers than 1.20.6, that's interesting
oh nevermind, I misread 1.21.3
people who got past it are liable to be on latest anyway
people who didn't, well, didn't
few if any would stick to .6
1.20.1 has more servers than 1.20.4 though you are right on that one
although i suppose slimefun specifically supported up to 1.20.6 and not any further for a long time
i myself use 1.20.1 as the goto 1.20 version
but iirc that was because of some paper itemstack refactor
why not 1.20.2, I don't think there were any major changes there
or 1.20.3 even
1.20.4 is where the major changes came so it is more or less understandable, 1.20.1 I do not get
idk it just stuck
pie charts are so annoying
mmm pie
when i ran servers i never upgrade unless i specifically run into an issue
well, very popular is an overstatement
i mean compared to latest release of 1.20
ok i actually ran 1.20 prod
leme see which version I last used (discord srv w)
3.1k servers vs 12.5k servers, it is a difference
no .5 on the chart?
Hi people, someone have some method to show DisplayBlock to player using packets? I was using some method but it's not working on 1.21.5
java.lang.NoClassDefFoundError: net/minecraft/world/level/Level
i was also contributing to that 1.20.1 pie piece
very sad
why would people be using .5
idk they run every other version
1.20.5 came with the component changes and 1.20.6 fixed some data loss issue
help the fish are shrinking
lol
ok discord upload limit too small
this is the reason i stopped hosting servers 💀
Guys can someone help-me, my plugin is getting error on java.lang.NoClassDefFoundError: net/minecraft/world/level/Level but i'm using latest spigot version
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
?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.
what was this for
Can i make rare mobs tameable, and does Minecraft make them follow you? Something like frogs, goats, or something like that?
possibly not
You can make the AI follow you with some nms
!verify
Usage: !verify <forums username>
See ^^
can you help me a bit with that?
i just want to do that
custom tamable
Take a look at the follow goal and add it to the entity you want
You will most likely have to tweak it slightly
declaration: package: org.bukkit.entity, interface: Entity
at this?
or do i need to create custom entity with nms
That's not nms
@sly topaz finally uploaded the 1.21.5 version, thanks a lot for your help! (also looking forward to the EntitySnapshot data version bugfix)
Hi, I have a question. I dev a plugin that places an image on a map. There are four zoom levels.
The basic level is 128x128, and level 4 is supposed to be able to display 2048x2048.
However, I don't think you can display images at that resolution, right (2048x2048) ?
That was my first concern, but it's remmaped, sounds like this class is missing /=
the actual graphic on the map is always 128 by 128 pixels
the zoom levels refer to how many blocks that represents
at the highest zoom level its pixel per block
zooming out means 2x2 and then 4x4 and so on blocks are represented by one pixel
so for rendering an image the zoom level is irrelevant
okay so the max resolution is 128x128 (thanks)
Could you send your pom
?paste
are nms classes still relocated to a version specific package on spigot
And how are you building the plugin?
Using eclipse
No, but craftbukkit classes are
hey
if i turn off the AI on the Villager entity, would i still be able to use setAware(true)
or does setAware depend on AI
so.. no movement at all im guessing
how the heck do i make the villager look at nearby players if they get closer than n blocks to him
You want the villager to look around but not move?
yes
im making custom villagers with custom trades
and once they're placed down i dont want them to move, only look around
Could probably force them to look at a player yourself with a task
oh
setting ai to none and manually updating their orientation is possible but iirc the head-body rotation gets fucked if you do that
unless you do it over protocollib
having a lot of villagers with any sort of ai enabled is also bad news performance wise
yeah
would be a nice touch if villager looked at the nearest player within n blocks
instead of just standing there like dead XD
i've always used mythicmobs for my npcs
and im talking about smooth look, not changing the head direction in an instant
spawn a zombie, add a look at nearby players goal, and disguise it as a villager
they have an api?
if you want you can add a go to location goal to have it walk back to its post if a player pushes it
prooobably but get fucked trying to use it, it's closed source and their api-help channel is crickets
so you're down to decompiling their horrid codebase and trying to reverse engineer it with zero documentation
You can use Citizens
unless if i add some particles around them to make them look .. not so dead
or, every tick teleport it to the location it was placed
mythicmobs is also the last plugin i'd want to require as a dependency for my plugin
shit comes with tons of baggage
the default configuration overrides the stats of a bunch of vanilla mobs
your reviews section will be 30% WHY DO CAVE SPIDERS HAVE 300 HEALTH
yeah .. i dont know how im gonna do this
to be performance friendly
and efficient
it would be a single set position packet
if you're on paper, use the goals api to remove all ai goals, and then use the lookAt method on LivingEntity
that exists?? XD
it might exist on spigot too, dunno
iirc setting setAware to false will break lookAt because it stops the navigation controller or whatever being ticked
but you can also try doing that
i'm not 100%
sorry, I'll wait till you guys are done.
ok ill try
ok, I'm stuck, how to you detect a left click on a falling sand block? I have tried to use the interact but it doesn't seem to have a getClickedEntity()
PlayerInteractEvent + raytrace, or PlayerInteractEntityEvent, or PlayerInteractAtEntityEvent
i think the latter two might be for right clicks only
i'm not sure if left clicking an entity without damaging it fires any event apart from interact
What version are you on
in what instance would getItemMeta return null even
air
ic
it doesn't
1.21.4
perhaps EntityDamageByEntityEvent?
not sure if it counts as real damage tho
it doesn't count as damage as the falling sand has no hp.
I tried that already.
it doesn't even broadcast a message.
<redacted fork> has an event for this
what is that?
paper
oh, ok.
You said the forbidden word. Time to unalive 🔫
I am currently using purpur though.
purpur is a fork of pufferfish which is a fork of paper
oh, I had no clue,
I've been using a spigot page though to code and it seems to work, why is that?
it still inherits all the code from spigot
paper was a spigot fork until december 2024 so it has everything spigot has had until then
ah ok.
is there a list of minecraft:behavior..... - GoalKey ?
do you know which one does arclight use?

Hello, I'm on the 1.21.5 spigot build and I'm trying to play with the blocks_attacks component. I want to give any sword this component, but I can't get it working, I'm grabing the ItemMeta to do that, but it doesn't work, while changing the displayName works. My code does not cause any errors, but doesn't do anything. I tried to system.out.println to see how it looks, and it says the the meta is unspecific...
Is it fine to paste code here ? Is it the right place to ask for help ?
hybrids are buggy messes of software you shouldn't be using
?paste
chuck it in that
Arclight is a bunch of Mixins based on Paper
and send the link
arclight seems to be relatively stable though and from what I've seen seems to work fine with all the bigger mods and plugins.
but it's not exactly a fork
well, we're not gonna be able to help you with those
for what we know, some mod could just be removing the entire logic
since mods can just do that
I'm not really asking for arclight just wondering for future use.
I didn't know we could do that, that's great
have you verified
if (meta != null && droppedItem.getType().toString().endsWith("_SWORD")) {
is evaluating to true?
and also use tags
yup, if you drop a sword
how did you make yours colored?
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
I removed all my console.logs when sharing but in my code I have a printline everytime there's a if
oh wow, that may be useful, thank you!
I can't even join paper discord for help. That sucks.
Did you get yourself banned
hm looks fine to me, maybe some of the values are illegal?
try adding these
blocksAttacks.setBlockDelaySeconds(0);
blocksAttacks.setDisableCooldownScale(0);
blocksAttacks.setBlockSound(Sound.ENTITY_PLAYER_HURT);
blocksAttacks.setItemDamageThreshold(0);
blocksAttacks.setItemDamageBase(0);
blocksAttacks.setItemDamageFactor(0);
one by one and see if it fails at any point
or even just test with 1 and see if it applies at all
I removed all of them and it's not even working
it looks like this now : https://paste.md-5.net/xomupesazo.cs
since all the value are optional or defaults to some kind of value, it should result on something, but it doesn't
If you try and get the block component after a tick what does it give you?
i removed all goals with Bukkit.getMobGoals().removeAllGoals() but that didn't do it and then i tried to be more specific with GoalKey.of(Villager.class, "minecraft:behavior.random_stroll") but that didn't help either. villager was walking around like nothing happened.. with bukkitrunnable now that works but .. it's meh.. no smooth looking transition.. and yeah if i set ai to false lookAt doesnt work ..
There's a syntax to wait ?
Runnables/bukkit scheudler
ohhh
What is the things called when you have something like this:
unity nameHere {
char,
int,
double,
float,
}``` is should look soemthing like this
You talking about enums?
or maybe records?
enums probably
no, if I am not mistaken enums are words reprisenting numbers while what I am talking about is saying this one variable type nameHere can be used like this:
nameHere name = 'c'
name = 5
name = 4.3
name = 5.3532244
and all the following would be valid.
I have seen it once in c++ but never seen it used.
these will all be valid if and only if the type of that variable is double
i guess i gotta go with NMS for villagers XD
found this on reddit:
/summon minecraft:villager ~ ~ ~ {Attributes:[{Name:"generic.movementSpeed", Base: 0d}]}
// Modify the villager's movement speed
double newMovementSpeed = 0.0; // Set this value to whatever you want (0.0 = no movement)
villager.getAttribute(Attribute.MOVEMENT_SPEED).setBaseValue(newMovementSpeed);
// Additional customizations
villager.setCustomName("InnKeeper");
villager.setCustomNameVisible(true);
if you're looking for inferred types, that's var
but when printing out it would print out as the respected variable type,
each variable has a fixed type determined at compile time
if you try assigning an int to a double variable, it will get cast, i.e. converted to, a double
so
double name = 'c'
name = 5
name = 4.3
name = 5.3532244
will compile and the values will be 67.0, 5.0, 4.3 and 5.3532244 respectively
but the type is always double
if you do var name = 'c' the type (at compile time) becomes char because 'c' is a char, and the subsequent assignments will not compile
https://paste.md-5.net/pehatizufi.java
nope :/ that's what i get when I try to see what's inside the ItemMeta : UNSPECIFIC_META:{meta-type=UNSPECIFIC}
But when I use that meta object to change the displayName, it works. Only the BlocksAttackComponent doesn't work at all
Whats the output of /version in your server
Could very well be that
This server is running CraftBukkit version 4473-5pigot-e339edc-20401f1 (MC: 1.21.5) (Implementing API version 1.21.5-R0.1-SNAPSHOT)
Checking version, please wait...
You are running the latest version
Also check the actual output of get blocking component not just the string value of meta
Jt might not show it in that
Basically, from what I understand there's no way to create a BlocksAttacksComponent from 0, I use .getBlocksAttackComponent() on a Item Meta object because the javadocs says that .getBlocksAttackComponent() creates it if there's not
Yeah im saying if you get it from meta again after a tick, then check whichever value you changed
no clue what is being done here but try setting the item stack back onto the dropped item
If it’s default still, it means setting it in the meta isnt working correctly
whether itemstacks you get from places are views or clones is incredibly inconsistent
man villagers are pain in the ass
so just getting one and editing it might not change the item in whatever place you got it from
how do you assign a trade to a villager?
I think the code for it is messed up
that's what I think too. The BlocksAttacksComponent seems to work, but setting it inside the ItemMeta seems to not work
it is checking whether the blocksAttacks component is null and if so, it sets it to null
probably meant to be the other way around
Oh lol there ya go
Free pr
you can try and set it via reflection to see if i is just taht
it's marked as notnull in my IDE, so I think it can't be null
it isn't using nullability annotations in the code, it is probably inherited from the package though if that's the case, I wonder how it ended up skipping them
there is a bug in spigot
But youll have to wait to get accepted. I cna make one once I get home
If you can it'd be great, I'm not accustomed to the java ecosystem at all
in the meantime, you can use reflection to set it
it'll probably be fixed soon enough tho
When I proposed to report it I was thinking about an issue on some github repository, jira is just an unknown land to me
This doesn't work.
- Villager is still walking around??
- Villager profession is not updated
Villager villager = (Villager) player.getWorld().spawnEntity(player.getLocation(), EntityType.VILLAGER);
Bukkit.getMobGoals().removeAllGoals(villager, GoalType.MOVE);
villager.setProfession(Villager.Profession.ARMORER);
I'll be fine, I remember how much pain I felt when I had to deal with reflections, I can wait
villagers are fucked
if its for personal use just get citizens/mythicmobs
same ^^3hrs on blocksAttacks component, but that's just skill issue from me i guess
i quite like betonquest's original approach to npcs
where, while it did not implement any, it did provide command based hooks into them
I want something small.. a small plugin, I dont need much xD and my goal is kinda to make everything by myself
so you could create an npc with essentially any plugin that supports running commands
and then betonquest would take care of the not-npc side of things
best of both worlds in my view
get a good npc plugin for npcs, and then a good quest plugin for quests
or in your case shops, or whatever you were doing
all i want is a simple villager with custom trades. I know you can create it easily with commandblock but.. with code .. its pain in the ass
yea im making shops
im thinking, you cant modify villagers properties if its not spawned in the world, so, like what am i doing wrong here
none of the two functions work
but as soon as i set AI to false everything works
MerchantRecipe
its this stupid AI that controls everything lol
they're apparently called recipes
Villager::getRecipes; the list is mutable iirc, but doublecheck
merchantrecipe is a public constructor bukkit class like itemstack, no factory involved
Villager villager = (Villager) player.getWorld().spawnEntity(player.getLocation(), EntityType.VILLAGER);
Bukkit.getMobGoals().removeAllGoals(villager, GoalType.MOVE);
villager.setProfession(Villager.Profession.ARMORER);
ItemStack itemStack = new ItemStack(Material.IRON_INGOT, 1);
MerchantRecipe recipe = new MerchantRecipe(itemStack, 10);
recipe.addIngredient(itemStack);
villager.setRecipes(List.of(recipe));
ive tried this and it doesnt change it
for professions iirc you have to increase the level to 1
not sure what might be up with the recipes; does the gui still appear or does it refuse to trade altogether?
it refuses to trade
ive increased the level to 1 and profession still hasnt changed
that'd be because of the profession or level, the trades themselves probably still work
does setting the profession work if you don't touch the goals?
Villager villager = (Villager) player.getWorld().spawnEntity(player.getLocation(), EntityType.VILLAGER);
villager.getAttribute(Attribute.MOVEMENT_SPEED).setBaseValue(0);
villager.setVillagerLevel(1);
villager.setProfession(Villager.Profession.ARMORER);
ItemStack itemStack = new ItemStack(Material.IRON_INGOT, 1);
MerchantRecipe recipe = new MerchantRecipe(itemStack, 10);
recipe.addIngredient(itemStack);
villager.setRecipes(List.of(recipe));
no
now its not moving but profession and recipes dont work still
after disabling the AI again.. everything works.. its just not looking around

what is the point of remove functions if they don't even work Bukkit.getMobGoals().remove ....
is there way to play a completely specific sound (e.g. type of a cat ambient sound and not different (random) one every single time)?
are you creating a custom entity?
no
getMobGoals 🤨 🧻
please provide a better solution
then eat that toilet paper
dw i'm in the paper team already
1.21.5 when?
30th february 2048
they should work
if they don't, then you are either using it wrong or there's a bug in paper
I just noticed, the MobGoals class has no documentation on any of the methods lol, how did that get merged
martin, you've been writting for ages what's up
https://jd.papermc.io/paper/1.21.5/com/destroystokyo/paper/entity/ai/MobGoals.html im looking at it now
idk.. ill figure it out
is there a reason you don't ask in the paper discord
eh in paper they are less friendly xD they all roast and "how didnt you know that" "why didnt you do that"
I am honestly amazed the Spigot discord didn't become like that, it used to be the norm in the forums lol
Hello,
I saw a discussion about datafixers here today. May I ask what does datafixers library even do (from mojang I think)? I am confused from the name "data fixer". I saw some codecs Codec, MapCodec, and other classes used in the source code they use but what is it truly used for?
is that the message that took you so long to write
I thought you were writing the bible
I was waiting on the right time.
tbh dfu is two libraries together in a way
DFU is a library Mojang created to help with migrations between versions
https://gist.github.com/Drullkus/1bca3f2d7f048b1fe03be97c28f87910
This has some nice explanation of Codecs + Examples
thanks I'll sure look into it
Again, it's just the Codecs part of DFU
yes, I can see from the source code that it has many more classes
that's a pretty good resource
Fabric has some docs for this too https://docs.fabricmc.net/develop/codecs
Hello i am java developer curently working on project some minecraft server.. i am wonder is there any chance to use server icon more than 64x64?
Not sure, I think I also USED it in neoforge but I am really not sure whether the Codec there was the same thing
Most likely yes
no
how in the fu
does my plugin connect to a server
that's not running
not only that, it even fetches info from there and executes all queries
...and the actual server somehow doesn't log anything
even tho it has the exact connection params-
is it localhost being ambigious?
this, wtf is this
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
has anyone used ItemMeta.setItemModel?
I can't get my own model.
My item properties:
"model": {
"type": "select",
"property": "custom_model_data",
"fallback": {
"type": "model",
"model": "item/mace"
},
"cases": [
{
"when": "hat",
"model": {
"type": "model",
"model": "template:item/farmer_hat"
}
},
{
"when": "bighat",
"model": {
"type": "model",
"model": "template:item/bighat"
}
},
{
"when": "stitch",
"model": {
"type": "model",
"model": "template:item/stitch"
}
},
{
"when": "cakehat",
"model": {
"type": "model",
"model": "template:item/cakehat"
}
},
{
"when": "helmet",
"model": {
"type": "model",
"model": "template:item/helmet"
}
}
]
}
}```
What did you pass to setItemModel
meta.setItemModel(new NamespacedKey("template", "farmer_hat"));
I don't know what to put there
I recommend you use the CustomModelDataComponent
instead and set the string to what you want
I'm not sure what setItemModel does internally
But your model appears to be called item/farmer_hat
So wouldn't that be what you want to use
vanilla mace is minecraft:item/mace to get this in setItemModel use "minecraft", "mace"
so my model is "template", farmer_hat"
@chrome beacon do you know how to use it?
.
Get it from item meta
and then call set strings with a list of strings (probably only containing the value you want, but there can be multiple)
Is your model farmer_hat or item/farmer_hat
You appear to have one thing in your json and another in your code
public void onJoin(PlayerJoinEvent event) {
ItemStack farmerHat = new ItemStack(Material.MACE);
ItemMeta meta = farmerHat.getItemMeta();
assert meta != null;
meta.setDisplayName("Farmer Hat");
meta.setItemName("fsfsf");
meta.setItemModel(new NamespacedKey("template", "farmer_hat"));
farmerHat.setItemMeta(meta);
event.getPlayer().getInventory().addItem(farmerHat);
}```
if I use this meta.setItemModel(new NamespacedKey("minecraft", "cobblestone")); I will get this
Bump
ItemMeta#getCustomModelDataComponent()
isn't one supposed to use item model nowadays
for most cases yeah
do you know how to use it because I have a problem
what is your problem
bump
also you haven't answered md's question
i need some tutorial on how to make textures
iirc the ItemModel takes in models from items/ folder
you're replacing the mace (you can define custom btw, no need to replace)
So you'd set it to the mace model
To use it you add a string of either "hat", "bighat" or the others into the custom model data component
I believe this is how it works, I never actually used it
open paint
gimp
idk how to make them working on minecraft with custom models
well that is a different question now
Aseprite 😇
any tutorial on doesn't work
Are you looking at a tutorial for the version you're on
because the resourcepack format has changed quite a bit recently
there is none for the 1.21.4
Well all the examples you have are either on wiki or in the vanilla resource pack
serious? where i can find it>
which one
wiki is just google
the RP is either in the jar or I can send you github link
ye send me all the link u want i just want to make like a custom block like a pot
https://github.com/misode/mcmeta/tree/assets/assets/minecraft
I think this is the vanilla RP
meta.getCustomModelDataComponent().setStrings(Arrays.asList("hat")); ???
Probably ?
ye but idk how to put the item like i have the .json of a custom item but idk how to set it
This is the 1.21.4 commit https://github.com/misode/mcmeta/tree/12b05227c31b64d4d5fd7cf3696e750e8ab5cd4a/assets/minecraft
I don't know if your item model definition is correct
can u send me a link for the wiki on how i can use a model from blender?
you can't
^^
minecraft models have their own "special" format
sorry not blender blockbench
You can use Blockbench to make those models
yeye i wanted to type blockbanch but i typed blender
how to call my model with a command and get a string from CustomModelDataComponent then I get hat
but when I add hat to custommodeldata it doesn't work anymore
I really have to learn how to use the new model format lol
{
"parent": "item/generated",
"textures": {
"layer0": "item/carved_pumpkin"
},
"overrides": [
{
"predicate": {
"custom_model_data": 1
},
"model": "block/custom/vaso1"
}
]
}
but if i do /give @p carved_pumpkin[minecraft:custom_data={carved_pumpkin:1}] i get a normal one
version ?
But I do not think this would be correct in any
custom_data != custom_model_data
1.21.4
Just ask here
I clearly don't know enough and idk if there's ppl who know here
https://discord.gg/QAFXFtZ
yeah custom data is not custom model data
ty
Isn’t this what item_model was added for
It’s much simpler than the new custom model data
well yes, but you still have to create two files instead of only one (the model itself) if you want to use it
custom model data still has its uses if you want to use tints or other stuff btw
is it, I just know that's what people have been saying but I haven't bothered to look at it yet
being completely honest, I have never made an item model or a resourcepack in my life, I just have helped people with their resource packs problem because 90% of the time it is just looking at the wiki
I should probably make one just so I can understand these issues better lol
You need two files for item_model?
I believe the value in that component refers to item model definition. If that is the case, then yes, you need two. I am not sure tho.
You need the item model and the texture
And for custom_model_data you need… a model and a texture
And an entry in a third file
I love item_model
hm?
probs weird question but maybe we can discuss this here
do identifier method really belong in classes?
like identifier is being used for registering something somewhere usually
so shouldnt it belong in some other class which wraps the object it identifies
like RegistryEntry<Foo> which contains getId() and getValue() methods
instead of placing getId() inside Foo class
nothing apart that the class implementation now is responsible for implementing proper identifiers for registries
which is... fine if things are simple
Sometimes the id is useful within class
Maybe for hash code, or like if there is some utility method (trivial example to print and identify)
i mean do you have more than one id for an object?
no, its just theoretical question. what i wanted to empasize that in that case your id for the object is global, its just that it feels like having local identifiers specified for the container it stores the values sound more cleaner
i think having 1 id for an object is better, how would you find the local ids for an object for each container?
it really depends on the system, not every object needs an identity, but in Java we're used for that to be the case as there's no real alternative to it right now
if i had to guess it could be used to implement multiple cache layers for the same object references which are different in terms of speed and underlying data structure, thus ids might differ to support those structures better
I can't figure out how to set a blockstate
I need to set a block to a fence and have specific sides active
like the actual vanilla meaning of blockstate
what event is fired when right clicking an entity (Sittable)
im using PlayerInteractAtEntityEvent and even if i cancel the event it doesnt work
Are you cancelling for both hands?
Just use PlayerInteractEntityEvent
Block#setBlockData
yes
let me try
worked tysm
how do you create an instance of block data?
im trying to look at the heirachy and can only find Interfaces
Material.STONE.createBlockData
some blocks have a specific BlockData subclass, that is documented in the Material entry
pretty sure yeah
if the string also contains the block like lever[powered=true] you can use Bukkit.createBlockData(string)
ah ok that might be easier
I'm still have issues registering these enchantments. Here is my code error is in error.txt
I like this question.
No identification of instances of a type doesn’t necessarily belong to the specification of a type itself. Sometimes an identification lives inside a middleware layer, and then providing an isomorphic mapping may prove enough. (That is for some instance of type T, you can go from Id -> T but also T -> Id inversely).
If an identifier is universally unique or locally unique to some degree, it may prove useful to embed the id as a part of a type’s members, just look how often we use the UUIDs of players in Minecraft for all kinds of identifications as an example. Now I’d argue for that hashCode does not uniquely identify, seeing as two disjoint instances may yield the same return value, moreover two different hashcodes may turn out to be the same in a small-capacity hash-based data structure, it’s truly somewhat of a special case.
Even in databases its not always a case of having a clear id attribute embedded, although its usually the case seeing as it helps optimizing indexing, but also other kinds of identification. However, sometimes you may see these multi joined attributes that are used to identify tuples in some scheme. For example (a poor example) it may be the case phone number joined with full name is unique to a specific tuple.
Hey! How can I add the EconomyGUIShop API to my gradle ?
It's not being recognized for some reason
My build.gradle
group = 'io.github.derec4'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
mavenLocal()
maven {
name = "spigotmc-repo"
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
maven {
name = "essentialsx-releases"
url = "https://repo.essentialsx.net/releases/"
}
maven {
name = "papermc"
url = "https://papermc.io/repo/repository/maven-public/"
}
maven {
name = "economyshopgui"
url = 'https://jitpack.io'
}
}
dependencies {
compileOnly "org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT"
compileOnly("org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT:remapped-mojang")
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
compileOnly 'net.luckperms:api:5.4'
compileOnly 'net.essentialsx:EssentialsX:2.20.1'
compileOnly 'com.github.Gypopo:EconomyShopGUI-API:5.21.0'
}
lombokgroid detected
if it's supposed to come from jitpack, try passing it the commit hash or a release as the version
i've always found jitpack to be extremely finicky
aight ill test it
people argue that it's a compiler hack and shouldn't be used in a professional scenario
a lot of noise about an alt+insert with extra steps
you are maliciously painting it
it can save hundreds of lines of boilerplate
But I like my boilerplate
I mean one problem with lombok, just like with static singletons, dependencies become extremely hidden with for example the constructor generation. Some argue its boilerplate but id beg to differ.
Another issue is its consistency, as soon as u stray away from the canonical transparent constructors, you end up having to write out the constructor anyway in plain Java, now ur code is gonna be half-assed with some members being lombok generated, and similar members being manually written out. This complicates the source code-... remember code reads more times than it writes usually.
fascinating arguments
I can keep going
Another point people make is its generated non null checks
and yes, at first, that looks quite scrumptious, but it fails on a deeper level, for example its quite limited and don't support, generic type parameter nullability, more so afaik there is no proper support for, for example, initialization that regards monotonic null to non-null behavior or lazy initialization. Not sure how lombok handles components that initialize one another either...
Checkers-framework here is simply superior since it does it the proper way, or more proper I should say- for example it generates its own type system of the system and then performs checks etcetera...
I do admit it definitely gives the developer some other fancy hacks like extension methods or like annotations on annotations (higher ordered annotations?)- but its just a hack and at the end of the day, you still have your static method where it just make it looks like the first argument is the receiver, R apply(T this, U arg1, V arg2) is just static R apply(T obj, U arg1, V arg2) (T this is the receiver parameter, often times not written out)
And as I did mention before, many of its verbosity-reduction annotations fit for standard code, but as soon as u stray away from the "standard format" of things you start having to write it out manually and bye bye consistency...
Tho I should say I do get why people prefer infix to prefix notation
Anyone here knows a good npc api alternative to citizen? I don't want to work with nms itself
Why not use Citizens
Citizens is simply "too much" for my use case, something smaller would do just as well
have u checked fancynpcs? heard its supposed to be decent
Yeah I tried that, but seems to be a bit broken on 1.21.4, the set-turn-method doesn't change anything, if I disable the collidable they no longer spawn idk. just copied the stuff from their wiki
Doesn't look like FancyNPCs is any smaller than Citizens
remove all the ai goals from the mob and then pilot it around with LivingEntity::lookAt + pathfinder api
They did not want to use nms
i think there is api for all 3, at least on paper
also player npcs
Sir this is Spigot
players aren't doable via api i don't think
can't u override or smth
imo the most robust solution in such a case would be to depend on libsdisguises to disguise something else as a player
libdsiguises has a decent api, is used by many servers, and is very robust in terms of what it can do
e.g. it can copy a player's skin and equipment, or arbitrarily set the disguise to be on fire, swimming, gliding, etc.
it even comes with a mineskin api which will allow you to load custom skins from a .png in just a few lines of code and apply them to your npcs
While smaller than Citizens that just seems like a lot of unnecessary work
Citizens is also just more common for making NPCs
maybe there is some small player-npc library somewhere, but "small" plus "nms" usually equals "unmaintained"
so i think ideally you'd stick with citizens or libsdisguises
Citizens >>
or mythicmobs if you already happen to have it or it's adjacent to what you're doing already
citizens is the industry standard pretty much
Well, thats interesting.
Are you running Spigot
Paper, but I expected Citizens to have no problem with that.
?whereami
Time for a bug report for them
(protocollib works fine on paper 🐮 )
That error just looks like Citizens failing to handle that Paper doesn't relocate Craftbukkit
not protocollib
libsdisguises
and yeah those field names are the obfuscated ones
seems like an oversight since there clearly is some sort of handling for the mojmapped server, based on the immediately preceding message
hoi
so the solution is to just use scala, got it
?
scala has a lot of nice sugar to address those issues without having all those pitfalls
and it is in my agenda to push scala
scala isnt the only jvm languge that provide syntactic sugar for different semantics
but it is the best imho
not sure how you can conclude scala from infix and prefix notation
replying to the least message in a message chain
how to check if a player is in a world?
not particularly about infix and prefix
a player is always in a world after the login iirc, but if you want to be safe use player.getWorld() != null
player.getWorld().getId().equals(otherWorldId)
my job is using lombok all over the place and i despise it, and we actually have a blackduck report screaming that our code is insecure because a @NonNull annotated member is not being assigned due to lombok's shitty constructor generation and I had to write a full ass report about why it's a false positive when we could have avoided it by just not using shitty ass lombok to begin with so im with conclube on this one
I don't remember if it is .getId
It's not
real
was it .getUniqueId?
No
then what was it
You can just use equals on two worlds
I'd rather not store worlds
and use their IDs instead
ID's are just their names right?
I mean okay, either way scala suffers from its own issues, like you get into this mix whether you’re writing functional or oo, like it is trying to do too much, you can write the same thing a billion different ways all which are considered the “convention”
player.getWorld().getName() and then?
no, use player.getWorld().getUID().equals(otherWorldId)
do not compare by name or world reference
Sure thanks
Wait you guys actually use lombok, for how long if I may ask?
A) a world "test" can be unloaded, a different one loaded with the same name, and your check will fail
B) do not store references to worlds because it can cause memory leaks
That's true, but we do not know if they're storing it or not
Im not
assuming they want to check it later
then compare instances
I have no idea how long they've been using it, I'm still a relatively new hire. I've inherited a legacy application and it has lombok spam. However let me tell you right now, my new greenfield project will NOT be using it and I don't care what they say

This is a very large fintech company in the philippines btw
yes but i need to compare it
oh, like a comparator?
(otherWorldId)
as in, sorting?
no u wrote it in the command u sent it
Oh woaw, shame on them
oh, the otherWorldId is just the same as player.getWorld().getUID() but replace player.getWorld() with another world variable
iirc worlds are either identity elements, or implement hashcode/equals correctly
i.e. safe for collections and .equals
not uncommon to see enabledWorlds.contains(player.getWorld())
memory leaks galore 💀
yes you do want to listen to world unload and world load to maintain the set
looks like they are identity elements
i remember back in the days, iirc CraftWorld#equals used to use == comparison on its UUID objects
lmaooo
💀
do people still just use vault
or use smth else
iirc vault still uses usernames instead of uuids
If I remember vault can use offline player
yes it can
it uses double still right?
idk last time I implemented an economy over its api I got a headache, but I do think many servers still use vault?
vault is "fine" as in it's the bare minimum of an economy interface with a bunch of largely useless features like per-world currencies on top
i've heard reserve is all the rage these days but from what i looked at it, it's the same deal except it has way more largely useless features on top
Can't I just use player.getWorld().getName().equalsIgnoreCase("lobby")?
what i really miss in vault is the concept of transactions, going from one account to another; mostly for logging
vault by base only supports withdraw and deposit from an account, with zero awareness of where the money is going to or coming from
it isn't hard to implement, no, but if you do, then your eco implementation is no longer directly compatible with vault
currently 100% of eco accessors do transactions by first doing withdraw and then doing deposit on another account
I mean I dislike that there's no async response type from the api, I mean realistically on a large network a transaction may need to synchronize over multiple nodes (ofc there's ways to deal w it, but like it sucks that u need a workaround for it)
but as an eco plugin, you have no way of knowing which withdraw is paired with which deposit
hello, did you report the bug ?
No I'm pretty sure they completed what vault was meant to be
Yeah that is true
it's "feature complete" yes
does it support name changes?
just their features are two thirds useless
it supports uuids in the form of offlineplayers, but only if the eco implementation actually handles those correctly
and i don't think any do
it'd have been nice if they had segregated a separate interface for the account stuff and the per-world stuff icl
the per world stuff is the most inane nonsense ever imo
yea
if you want anyone to hook into whatever you're doing, yeah
💀
personally i'm honestly debating about getting rid of vault and using my eco plugin directly on my server
mostly because of the transaction issue
but this will involve forking and modifying all economy-interfacing plugins on the server to use the eco plugin directly
That is fine for your own personal server but most people use vault because many plugins use the same
yeah, that is the issue
That would suck ass
it's not an option if you expect your plugin to be used by others
yeah
well, i'm already like 80% the way there
i think the only third party eco related plugin i have is towny
and i think that maybe allows for registrations of eco interfaces without having to fork it
i think network/blocking economy calls is probably beyond the scope of most servers because it requires so many changes in business code
you basically have to refactor every main thread eco call to futures or taskchain or something; commands, shop interactions, all manner of things
which is doable but 90% of plugins just don't, and then you end up blocking 25ms on mt because someone traded with a villager; it's not plug-and-play
so i think it makes sense for vault not to support it
is syncying two server economy not a thing in vault really?
by the time you need and can make use of it you probably have rewritten all your eco related plugins yourself anyway, and vault becomes a pointless middleman
I mean sure, its just a bit annoying since it does support offline players, lets say a consumer invokes ur economy for an offline player, ye well nice lets load that blockingly
ofc u can decide to just reject
i suppose the assumption is that all balances are loaded on startup
offlineplayers always have an uuid iirc so there wouldn't be a network call to mojang, just disk io, which you can do on startup
depends on how that call to offlineplayers is done. If all you have is a name, then it will make a call to mojang servers to obtain the uuid to then look
thats rather naive to assume, especially if you grow a significant amount of unique players
but yea ur probably right
but that's handled in Bukkit.getOfflinePlayer, no? by the time you get the offlineplayer by name, the uuid has been fetched
i don't think an offlineplayer instance can exist without an uuid
one can exist without a name, and then getting its name will do blocking io again
correct
which i suppose will make your eco backend shit bricks if its name based
i mean if u have ur eco backend name based ur hardcore trolling already
i think mine is name based 🤡 offline mode server, you see
lol
💀
can always implement your own UUID scheme
instead of just relying on uuids coming from names lol
Ok how do i correctly implement vault
yeah i'm probably going to switch to uuids anyway to support username changes
im starting from scratch so leme do it properly
I can't help you there, I have never bothered with vault and have found it quite pointless
iirc the reason why i did it name based is because towny didn't support uuids at the time
I think I tried using vault once before and it was more of a pain then anything else
its really fun if the mix of plugins is right
so I just tossed it away
its not that bad for simple stuf
yeah it isn't really of any use beyond interoperability with other eco plugins
ye no, it 100% works
Vault2 when
a complete and thread-safe vault eco impl can be as a simple as a single class with a ConcurrentMap<UUID,AtomicDouble> with like 4-line impls of each vault api method
unless you have people calling the name based methods in which case you will be fucked
these days, eco plugins have their own api's
Not the popular ones 🤣
BigDecimal for best coverage 🧠
No one should use essentials
shore
its brain damage
Just take any Number, AtomicDouble and BigDecimal extend Number right?
there was a time when vault was indeed handy and that was when all these eco plugins didn't have api's lol. But that was like over a decade ago
yeah, but atomicdouble becomes largely useless if treated as a regular number
since you will only have access to plain get/set
we should make vault2
you are welcome to lead the charge on that
I mean tbf i could use the built in methods on ConcurrentMap
like replace, putIfAbsent, computeIfPresent etc
they are atomic
they are, but they perform a teeny tiny bit worse
true
for one computeX is an exclusive lock on the bucket
I need to learn more async stuf before doing smth that big
this seems cool
atomic double has low-level addAndGet and suchlike which are lockless on most if not all architectures, iirc in worst case implemented as a compare and exchange loop
but basically boil down to a single instruction unless you're on like fucking arm or something
yep, which is the disadvantage if u opt w BigDecimal, u may have to write atomicity and synchronization on software level
arm can be weird sometimes
that said i really don't think that's a hotspot you need to care about 🤡 using the concurrentmap compute methods is fine
Missing annotation
oooh @EventHandler
i think the mcdev plugin should emit a warning about that
@manic delta is the player login event firing multiple times bug fixed for you in latest spigot build?
yeah do it, a fix was pushed
is it commented on my issue request?
no just build the main branch
it was merged
you can remove everything after # btw
real thx