#help-development
1 messages · Page 1145 of 1
umm
what about ConfigurationOptions#pathSeparator(char)????
are u sure that snakeyaml doesn't already support keys with dots ?
i would say it does according to this comment https://github.com/FasterXML/jackson-dataformats-text/issues/431#issuecomment-1720326186
oh
yeah that would work
thats god
everywhere you access that config
if your separator is @, you would call config.get("some@path") i assume
yeaha`
i mean i want that
so you could already have wrote config.setString("my.cool.path") if you now change that seperate to @ you would have to go and change your existing config.setString to config,setString("my@cool@path")
why not just write permissions as my,permission,is,cool
instead of flipping up everything else
i dont knonw
So I update all players' scoreboards every second (It has a live time counter) in a runTaskTimer, but it takes up quite a bit of server resources. Is there any way to optimize it? Can you set players' scoreboards async or something?
no
you cant set it async
whats the code you wrote for it
it seems to work fine for me
(im only testing with like 10-20 players though atm)
0.18% on 20ish players
Retrieves player data from hashmap
Sets 7 lines to values
?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.
liek how are you settings the lines, how are getting the information to put in the lines
etc
and is that 0.18% per tick?
or once every second
not sure what I expected but rewriting ItemMeta is a pain
Are you making your own server
no, trying to clean this mess up
I pretty much only do spigot PRs and on the side I work on my own software from scratch, but I haven't had time to touch it since August between other projects
Hey, anyone here familiar with PermissionAttachments?
I am setting a PermissionAttachment but when the player relogs, they then lose the attachment.
Yeah that’s how it works
Right but some permissionattachments I'm noticing are persisting
such as minecraft. and bukkit. permissions
so everytime they join the server again, I should be setting their permission attachment?
im so glad i chose to just use the in-built serializers for my project 🤣
Yes
i thought it would persist in memory
i guess its tied to the player obj though
alright well thanks
Whenever the player relogs its a new player object
I wrote my own itemstack serializers because bukkit's serialization system results in ugly configs
dang thats hard. i might do that one day. how'd you do it?
I assume the minecraft and Bukkit ones are added by the server itself
million interfaces
🤣 😢
dfu:
dfwho?
dfu
nah no need this is just for like
dfcoll
whyat is dfu
Data fixer upper
It’s what Mojang uses to update data between minecraft versions
Might be slightly cursed
xD
does bukkitobjectoutputstream/input stream still break based on version changes?
🤣 what
Probably shouldn't but probably does
wear a helmet 👍
I wonder if there's a way to mass refactor variable names based on criteria
BOOS and BOIS are horrible way to serialize Item stacks anyways
you should really just use NMS, i have a byte serialization API in queue, but who knows when if ever it will get merged
my birthday isn't tomorrow hto
you won't get me that easily
what... but my birthday isn't actually tomorrow
if itd oesnt' get merged until my birthday I'll have to wait a year
that'd be a horrific time
oh yeah its totally today
how could you ever forget I know we maintain such a very close friendship I'm almost surprised you forgot
I'm beyond stunned, just don't forget again
oh no I'm so heart broken
why don't you just put it in your calendar to give the illusion of caring
that way next October 1st you can ping @river oracle and say happy birthday and then I'll be like oh wow I can't believe you remembered I'm soooo touched
such a thoughtful soul
yo
i hope it does. and yeah they are a horrible way to serialize, but its one of the only ways i know atm for serializing to a db. i dont wanna use nms cause then version dependent yfm
I should really just throw together a small library for good QOL stuff that should just be in the API and isn't and maintain it
the NMS for some small stuff isn't that big
the only true thing I can think of rn is components and the data serialization
what are components again?
a much more rich way to interact and display text
e.g. you can have certain click events and hover events
you can also much more easily display RGB and hex values without hastle. Its all around much better than legacy text
the only downside imho is the need for some good parsing library like Minedown or Minimessage, but honestly Minimessage is great
I have my own ripoff that kinda half works xD
XD
I mean, doesn't adventure bukkit adapter exist already
lol you could barely call that thing an adapter it only works for stuff spigot already has component support for
which is nothing
do we know when itemstack.tobytes or whatever is gonna be merged?
🤷♂️ its really up to MD if it ever does
🤣 the tm
you don't have to wait around for it to be merged tho, you could just copy the impl into an utility method
I think we're on a merge freeze for features because 1.21.2 is coming up soon here
don't think this PR would affect upgrading that much if at all tho
but welp, I know it is hard to be flexible when working with projects of this scale
When support for hybrid servers :p
hybrid servers can go kick the bucket already
kek
true actually - does it require nms?
yes
it uses internals pretty heavily for obvious reasons
rip i might wait then im tryna avoid nms this time around 🤣
yeah that's fair
Hey, so earlier I've installed nms using maven and a local jar which worked fine. Now I want to directly add the jars into my project cause I want to add multi version project* structure > libraries. So I did that, went over to modules and added it as a dependency. Invalidated cache and restarted the intellij and still can't see any trace in-code?
don't directly add jars to your project
just do multi module projects correctly and you'll be fine
Well, how do I add support for multiple versions when the <plugin> specialsource only takes one?
yo @river oracle is the new bytes serialization gonna support persistentdatacontainers or whatever they're called?
GameProfileSerializer.addCurrentDataVersion(base); why is it called GameProfilerSerializer
it uses NMS which serializes everything
PDC is just glorified NBT, so yes
WW
im not gonna lie i have no clue what this means
💀
I was asking Y2K since this is part of the impl in ItemStack serialize method
why would an ItemStack do anything with game profiles besides maybe skulls
oh mb
either something I don't understand is going on or that class is terribly named
Don't ask me ask spigot
terrible ass name 🤷♂️ I wouldn't even use spigot maps if I were in charge
well if you get tempted here is the impl
I was looking at it, it is pretty trivial actually
if i were in charge every method and variable would be obfuscated and there would be two layers of obfuscation - nms would be obfuscated, and i'd introduce sms - spigotminecraftserver. so first you have to tackle obfuscation of sms then nms 🔥
🤣
I just don't know at a glance what methods one might not have full visibility to
someone hire this guy
Y2K, does the full NBT also contain the components?
Only download available is .txt file with all the code
why does this look so deceivingly simple
based
yes I'm just using the ItemStacks method
it handles all that stuff
it is really simple, all it is doing is passing NBT from a stream to another
public Tag save(HolderLookup.Provider provider, Tag tag) {
if (this.isEmpty()) {
throw new IllegalStateException("Cannot encode empty ItemStack");
} else {
return (Tag)CODEC.encode(this, provider.createSerializationContext(NbtOps.INSTANCE), tag).getOrThrow();
}
}
well that tells me absolutely nothing since I do not know what the CODEC is encoding in this case lol
nvm looks complicated now 🤣
the ItemStack codec does this
() -> RecordCodecBuilder.create(
instance -> instance.group(
ITEM_NON_AIR_CODEC.fieldOf("id").forGetter(ItemStack::getItemHolder),
ExtraCodecs.intRange(1, 99).fieldOf("count").orElse(1).forGetter(ItemStack::getCount),
DataComponentPatch.CODEC.optionalFieldOf("components", DataComponentPatch.EMPTY).forGetter(itemStack -> itemStack.components.asPatch())
)
.apply(instance, ItemStack::new)
its basically just encoding the ItemStack instance that it is in
I'm taking an NMS ItemStack and encoding it using their built in save method which turns it into a Tag
I just then encode that tag into bytes and run it through DFU when I read it
it encodes the patch, that's interesting
yeah iirc the patch has extra information or something
wouldn't the patch have less information?
I don't fully understand DataComponents yet
me neither, so we are both at a loss here lol
I will probably learn more as I reimplement ItemMeta, but for now I am clueless as hell
I just haven't properly taken a look at it tbh, it doesn't look too complex
why reimplement ItemMeta, it is fine as it is
the component related methods are definitely horribly named though, who though getFood was a good idea
I do things as toy problems all the time
besides, it just doesn't scale
is there going to be a getter-initializer method for every single component in an item
based on the changes Mojang have been making it seems like components won't really be stable either
they've really been switching stuff around
yeah but that's the every day thing, I'm more worried at the fact components have received the love they deserve, considering how much functionality they enable
Paper's attempt at it isn't bad either, just a bit too "raw" which is a shame
The issue with components is you need some light wrapper that won't break when stuff inevitablly changes
then again, once it is merged they'll probably iterate on it which at least is a step forward
I don't believe they're going to keep this pace in terms of changes tho, it may just be the case now since it is all relatively new and they aren't too sure on how to expose functionality
yeah that's true
once they find a good balance, they'll stop changing the existing components as much and the worry will just be any new ones they might add
yeah hopefully
also the current impl is a bit meh was curious if I could clean it up post NBT with the data components API
does anyone know how to add custom textures to mulitple items coded to the same item?
custom model data
look up "how to make multiple custom textures using custom model data" and theres a bunch of tutorials
Thanks bro!
Agreed. md_5 thinks so too.
No the implementation is terrible
paper nuking CraftItemStack and just making it plug straight into nms
I am not aware of how bad the implementation is, but the API design is fine
||removed components|| ||ItemFlag||
I mean, components are still a relatively new concept, so it's only fair that it's kind of a mess on that side right now
more so with spigot since it isn't like there's too much involvement from the community to decide on what would be a proper design that can also work with the current API
even in Paper, which I deem more open on that side, people barely comment on it so no meaningful progress has been made yet
LOL is that real?
yes
broke some ancient popular plugin because it was doing hacky shit with non-item itemstacks
had to rewrite half of it because paper made a breaking change, go figure
why do i feel like my bukkitobjectoutputstream serialization is going to break in the next update 💀
🤣
it shouldnt™️
what are you serializing
itemstacks 💀
it should update as item stacks are versioned
are you just wanting to store it as a bytearray or just kv in a yaml config
what? CraftItemStack still exists with barely any changes. Not sure what you are talking about "breaking change". Anything not in the API is... not in the API. so any change isn't really "breaking" any sort of api contract
Or was it regular itemstacks delegating to craft delegating to nms
Something about being able to have non-item itemstacks broke with paper
And only paper
I mean we throw an exception for non-item ItemStack instances, but that's been the case for like at least 7 years
Oh, we don't throw an exception for that. We just state in the Javadocs that it's undefined behaviour. Maybe Paper does lol
chat for generating empty void worlds, if you have a void world as your main world, how would you go about making sure it doesn't swap to normal generation after a restart. i know theres the config setting in bukkit, but multiverse doesn't use that so im wondering if theres another way
Yo so we recently made an SMP where a plugin has so many totems and each of them have an ability they do or give you an effect. But the dev coded it to where they are not there own items. So you can’t get them in creative menu or /give only a special command. Does anyone at all know how we can still get textures in them? Please dm and we can msg or call idc
If you cant add custom model data for whatever reason, the only other thing i can think of would be using the CIT (Custom Item Texture) feature in optifine, which can change textures depending on the item's name
but you really should just talk to the dev about adding model data to them
you shouldn't be having to use CIT nowadays
nobody uses optifine and most players don't have CIT resewn
thats why i said if you cant do custom model data
unless theres a 3rd option im unaware of
uh
yeah idk about that
but yeah i do agree CIT is kinda ass, just the only other thing i could think of
custom model data really isn't that hard to do
its not but it is also up to whether that dev feels like doing it or not
CIT + anvil is a fallback option
anvil?
yeah but you need your users to have cit resewn or optifine
there's also tools like packed (shameless self promo) that can generate everything for you
this will probably look like a question from a guy who doesn't know anything of java, but...
what's static actually meant for?
can you pay people to do code reviews
Modifier that detach a method or variable from the instance of an object
If you don't know this, you probably better learn some basic OOP before continuing
anyone know the best way to only allow players to break player placed blocks in 1.8.8?
list of locations or add nbt/metadata to blocks
This is probably not a good answer, but we use it for “global things” - in short. Now there are a lot of erroneous ways to use this keyword, so its often encouraged to dissuade ur usage of it if you’re unfamiliar with Object Oriented Programming.
Oh okay i understand
Thanks
Yea, we have a couple of things that can be static:
variables, functions and classes (might have missed something)
so yea
the staticness of those things has to be explicitly written in ur program before you compile it, for example so it’s not like a variable will just turn static
went with this approach:
event.getBlock().setMetadata("playerPlaced", new FixedMetadataValue(XinCraft.getInstance(), true));
if (!block.getBlock().hasMetadata("playerPlaced")) {
Utilities.send(event.getPlayer(), ChatColor.RED + "You can only break blocks placed by a player!");
event.setCancelled(true);
}```
is there a way to make sure players are always sent to a specific world no matter what world they logged out at?
without just teleporting on playerjoinevent
I’m not sure but you may be able to teleport them in the login event already
Making it more seamless just
anyone have any idea why I cant set a players scoreboard during PlayerJoinEvent and I have to process it in the next tick?>
actually even doing 0 delay it will work but not if I outright call it
new BukkitRunnable() {
@Override
public void run() {
XinCraft.getInstance().getScoreboardManager().updateScoreboards(player.getWorld());
}
}.runTaskLater(XinCraft.getInstance(), 0);```
Until the join event is finished the Player has not fully joined
A scheduling of 0 is also next tick (in all instances other than when called when already in a runnable.
teleporting works tbh its just scoreboard
ill prolly chuck it all in a runnable for safety tho
do runnables hinder performance at all?
extra complexity always adds an overhead, but nothing noticable
^ Three edits for typos. Doing good this morning.
anyone have a code example for manipulating the tab list by adding header and footer
without other plugins
nvm got it!
is there a way i can let players move through cobwebs faster without having to intercept the playermove event and manually modify their speed?
I think you can use the movement_efficiency attribute
"A factor to improve walking on terrain that slows down movement. A value of 1 removes the slowing down."
Or it may only be for soulsand and such and not cobwebs
I am not sure about this
sadge
Weaving potion effect actually reduces the slowdown to 50%
i have an arena plugin and i want to make it so that when the first person enters it tps them to a certain spot and if another person comes in it checks if there is a first person
how do i do that
cache the players
how would i do that
on the playerMoveEvent check if they enter the arena
got that
create a global variable for example in this case a Player that stores the first player
when the second player enters you check if the player object holds a player and if so you got both your players now
alright thansk
np
(World) config.get("arenaWorld")
do u know why this is giving me errors
yes
Because a config will never return a world object
you can't store nor retrieve a World object from a config
oh
Use Bukkit.getWorld(name)
(Or uuid)
Is there someone fluent with hibernate? Im failing with managing my db communitation in my plugin, need some guidance
I think the is Server.spigot().getTps()
^ NOT in Spigot
MinecraftServer.getServer().recentTps
Oh nvm that is no longer a thing
the first element in the array?
Oh I just forgot the nms dependency. Then it is a thing
The array is 1min,5min,15min
so depending on what you need take any of those
It sometimes returns more than 20, at least it used to in 1.18 - so you might wanna do some testing and show 20 if it's > 20
yeah ur right it returns 22 lol
How do prison/gens/dungeon servers generate such astronomical amounts of money, like 1.30569E80? Because I heard the limit was 10 trillion with Vault due to the Java double limitation.
BigInt
I think
or they just have a small value with and a type / multiplier
So they edit vault source code ?
Even if i do my own eco plugin with Bigint is my plugin will work with vault ?
Yes, usually what they do is they store the range (Units, Tens, Hundreds, Thousands, etc) and they store a single floating point number for it
Ok so basicly i will need this:
private double base; // The floating-point part (e.g: 1.3)
private int exponent; // The magnitude (e.g: 80 for E80 for 1.30569E80)
🚫 floating point
BIG DECIMAL
Hey there,
Im here and want to download Spigot 1.8.8. Everytime I tried to download it, I end up on a "Page not found" side 😑
can y help me 😄
it does, but you have to build a newer version first
mhh ok
thx
If I were in charge if you ran the command to get 1.8 your PC would short circuit and explode just he glad I'm not in charge.
ok.
Using 1.8 is a crime enough but the ignorance to use regular spigot with 1.8 now that's just a war crime
People should use UltraMegaOutdatedVersionButUpdatedBecauseThisVersiomHasSoManyExploitsSpigot
👀
@tender shard would say rusty spigot
I did talk to the dev and he’s wanting me to do it since I kinda already payed and he said it’s easy to do but I just don’t know how to like put the custom model data onto the items
In the code or whatever
He said he already added custom model data keys in the config
the chinese copper certified psu should just blow up
if each item has a custom model key then you would just override the totem model file and use the ids to point to different textures
in a resourcepack obv
there are definitely downloads for 1.8.8 spigot
1.8 was awesome
nms and add NBTTags on ItemStacks, then do the same you would with modern spigot versions and PDCs
yo smile wanna see something cute I just faced
If you send an image of your mirror im banning you
client's server is having awful TPS drops due to Inventory#getHolder spam
this is the first plugin I see
😊
That is indeed cute
mfnalex made this
💀
it hogs 40% mspt
getClass().getHolder().toLowerCase() is actually wild
method fires on every inventory open, close and click
Wait, i just saw how often the call getHolder() o.O
If you simply cache it at the beginning you already 10x your performance
A few other notable plugins that hog performance due to inventoryholder:
- HDB
- Worldguard
- Coreprotect my beloved
- Invedit
- dupeprotect
- tradeshop
yeah that's actually slightly under the actual difference between the smallest call and the biggest call
real world improvement is closer to 13x
In newer versions the holder doesnt get cloned anymore iirc
Are they running a fork?
Can't say I've had issues with WorldGuard
probably
I also can't say I've ran a server outside of a test localhost environment
I believe they don't do crazy checks with it
but it still shows up
it only does it on invopen though
lot less bad than on click
WG used to scale O(N) with region count. Thats why i implemented a chunk mapped region system back then. But its quite decent now honestly.
not as bad as running an autoclicker on a barrel full of nbt
or having 20 people doing it
5.5% on inv open is not good
ItemScanner, i already see the vision... removing items during playtime
"dupe protect" more like "don't give creative mode"
welp gotta run, got a driving lesson in 20 mins and haven't had lunch yet
Wait, let me leak something from code i have to maintain right now, brb
I experienced this first-hand with https://raytracing.github.io/books/RayTracingTheNextWeek.html#boundingvolumehierarchies and it was amazing lol
mm i should finish those, but also zzzz
Guess what one has to do in order to add a new GUI to this...
oh no
don't open a shulker box you'll crash the server
shmile
what happened to your guide
please tell me you didnt write that in the first place
It sits cozy and implemented at the modern rewrite of this mess
wtf am I even looking at
how does it even keep going
@remote swallow can't wait to drop 1.20 support 🙏 it'll be so nice to beable to remove MenuScene
I mean all my plugins support 1.20.4 too
yeah and im still on it
I figured once 1.22 drops this christmas we could probably drop 1.20s
maybe ill update when 1.22 comes out
you know idk if itll be a 1.22 christmas
oh I think it will
im thinking a 1.21.15 chrismas
I wonder if the creaking will be 1,22
or 1.21.3
oh yeah its snapshot wednesday I wonder what they cooked up this week
no way omg right guys so crazy
they are wrapping up the bundles drop
so I wouldn't be surprised if its just a RC
or just a bunch of bug fixes
trueee
we prob won't get anything new content wise till creaking snapshots start
no I didn't'
loads of new features and only displays 1.19.4 but more to come later
enlighten me
oh I do hope they end up adding the minecart and redstone stuff
but I doubt that'd be soon if they did
if they update redstone maybe just maybe bedrock will too 👀 imagine redstone compatibility between versions that'd be wild
wonder if they plan to make any parity additions
Bundles & Exploits
Is there someone fluent with hibernate? Im failing with managing my db communitation in my plugin, need some guidance
Firefly :(
I dont have perms to upload log files
verify
?paste
i want an end update
where they end it all
and I want a java update, where they add a java block
because bedrock already got their block
I am VERY confused. I can give a fireball both a direction and a velocity. But what? How does velocity relate to a vector?
it probably sets dirX, dirY, dirZ accordingly but what if I for example set the direction to player's eye location and then the velocity to 1, 1, 0
a Vector (velocity) tells the amplitude of each axis for movement
um, amplitude is the wrong word
ok so my solution was to not set the direction to the fireball and just set the velocity:
fireball.setVelocity(p.getEyeLocation().getDirection().multiply(2));
Is there anyone here who is good with adding update notifications with the PostLoginEvent class for Velocity? I am trying to add functionality for update notifications on my Velocity plugin but my Maven Clean Install always returns a ton of errors.
We do Bungee here not Velocity
Gotcha. My bad. Where could I get velocity help then? And why do you guys not help with Velocity, even though there are a ton of velocity plugins on SpigotMC?
There ae no Velocity plugins on SpigotMC
There are Bungee plugins which also run on Velocity
there isnt any velocity exclusives on spigot but there is velocity plugins on there
you just have a module per type
huh
Thanks for that information. I appreciate it.
ik this technically isnt coding.. but is anyone a texture pack dev? i need someone to make a texture pack with custom model data to it
this should be all the info you need to add some custom models into a resource pack
haven't heard "texture pack" since 1.5 👵
why do I think that doing that makes the fireball go a little bit off the desired path/direction
anyone know how to hide a player from another players view, without hiding him from the tablist, I have already tried several ways, but I don't understand much about packets.
Think you can just:
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#hidePlayer(org.bukkit.plugin.Plugin,org.bukkit.entity.Player)
unsure if that hides from Tab or not, id imagine not?
declaration: package: org.bukkit.entity, interface: Player
didn't I tell you to just look up a tutorial, which I've used in the past and know it shows you exactly what to do
hell even chatgpt could do it
It’ll hide them from tab
if you hide them with hideEntity, would that also affect tab in that case?
yes
Darn
Uhhh did u?
yes... I'm guessing you didn't even bother to do that
Uhm bro ima be completely honest I have been doing so much shi for the thing I’m trying to do I probably just forgot about it
I have had to do so much coding and I just started for the plugin and other stuff for the server loo
*lol
But we did try
the thing is you've asked 3 times about it now when there's literally a tutorial
this kind of conversation is not going to go anywhere
Fr
if they didn't understand with that tutorial, they won't magically understand now. If you feel frustrated by that then just don't answer to their question
they are asking someone to make it
I mean, they're allowed to, if someone wants to do it then all good
they probably won't find anyone without offering payment but that is not to dismiss the request
Nah ima pay them I didn’t know I was aloud to say that here tho
ok well that takes time and money when this is a step by step guide
technically it would be better in the forums, but I think it is fine here too?
Oh ok
Guys i need to create a silent chest, a kind of chest that when u open it, the animation and the sound don't appear
Well I mean when money ain’t a problem and it’ll take more time with me doing it I’m going to be honest 😂
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
And then pay someone and take more time to update it, it's better to learn how to do it on your own
i wanna do this, i just can't figure out how to do it
how to do what
Ahh thank you!
make a post?
!
they thought you were answering to them when that was directed to Rooster
you have to get the BlockState and cast it to Lidded
then the Lidded block state has open and close methods
Have a good day bro
Yea thanks I appreciate it no matter what it is
I mean, requesting a service is just as fine. I personally wouldn't wanna deal with making textures at all, it requires some creative skills besides the technical knowledge and that isn't readily obtainable
Nah that I get, I mean the custom model data part
Which is really just copy pasting some json files
Yea we already have the textures for them we just need to import them in since there technically not there own item
holy shit
this the real shit
yes
this one the og fr
but that serves a purpose no?
why have everything on there wth
whats the black thing, why would one that accepts the same shape as what put int it
9v to usb
new charger
USB-A is 5v by default so glhf
when vape to water hose?
did I walk into the wrong discord channel
nah its dev
oh shit
we just young and dumb
nah my bad chat I ain't know this was the cable club
ok, so if I spawn a fireball it immidiently moves in a direction... Ok, no problem, lets set its velocity to vector 0 0 0, still moving... Ok, lets set its direction to 0 0 0, well of course that would work but the velocity is still there, so when I RESET the direction to something else, again it starts moving even though the velocity is simply 0. I am VERY confused. Code:
Location eyeLoc = p.getEyeLocation();
Fireball fireball = p.getWorld().spawn(eyeLoc, Fireball.class);
fireball.setVelocity(new Vector(0, 0, 0)); //DOESN'T STOP THE FIREBALL
fireball.setDirection(new Vector(0, 0, 0));
so how the hell should I stop the fireball the correct way?
Yeah fireballs generally suck when it comes to moving them, but if you don't invoke setVelocity() or setDirection() at all, it shouldn't move anymore
ffor some reason just spawning it still moves in the direction specified by the yaw and pitch of the location
Why are you wanting to spawn a stationary fireball?
yes
why do you want to spawn it?
I want to shoot it from the player's eye location, but just using Player#launchProjectile behind the scenes spigot code will use gaussian algorithm to slightly shift the direction. So I just want to spawn it any give myself the velocity and everything but for now I can't even stop it
then as Olivo said, do it in the consumer of spawn
why wouldn't post spawn setVelocity call work
fireballs are a pain when messing with velocity/direction
ok
You should always use the consumer anyways
It's just worth building the good habit regardless
additionally zero acceleration
Best to do your stuff before it even enters the world
as a fireball has acceleration not velocity
Just take the derivative of it's velocity 🤓
That's kinda a weird decision tho
I wonder why it has acceleration and not velocity
Is it considered a bad practice when two objects are dependent on one another to hold independent pointers to one another on both objects
did anyone understand what I just said?
Yeah I don't get it but generally unless you need to refactoring it's not. Huge desl
did you mean: `
Fireball fireball = e.getPlayer().getWorld().spawn(e.getPlayer().getEyeLocation(), Fireball.class, since_when_is_this_a_thing-> {
since_when_is_this_a_thing.setVelocity(new Vector(0, 0, 0));
});
in my case
there are players
and there are parties
and I store what party a player is in on each player, and I store on every party what players are in it
and you need to initialize both pointers independently (and clear them independently when a player leaves a party and stuff like that)
So im just wondering if this need to remove something that essentially does the same thing in 2 places
is considered bad
I had a stroke while trying to read that help
is DamageModifier being removed? in 2016 there was a post about it but it's still around....
i dont know any alternative for using it
Hello guys, I'm trying to send plugin message to another server, like, guild -> lobby
I tried like this :
protected void send(@NotNull Message message, @NotNull OnlineUser sender) {
final ByteArrayDataOutput messageWriter = ByteStreams.newDataOutput();
messageWriter.writeUTF("Forward");
messageWriter.writeUTF("ALL");
messageWriter.writeUTF("lobby");
// Write the plugin message
try (final ByteArrayOutputStream messageByteStream = new ByteArrayOutputStream()) {
try (DataOutputStream messageDataStream = new DataOutputStream(messageByteStream)) {
messageDataStream.writeUTF(plugin.getGson().toJson(message));
messageWriter.writeShort(messageByteStream.toByteArray().length);
messageWriter.write(messageByteStream.toByteArray());
}
} catch (IOException e) {
plugin.getServer().getLogger().info("Exception dispatching plugin message");
return;
}
sender.sendPluginMessage(BUNGEE_CHANNEL_ID, messageWriter.toByteArray());
}
public final void onReceive(@NotNull String channel, @NotNull OnlineUser user, byte[] message) {
if (!channel.equals(BUNGEE_CHANNEL_ID)) {
return;
}
final ByteArrayDataInput inputStream = ByteStreams.newDataInput(message);
short messageLength = inputStream.readShort();
byte[] messageBody = new byte[messageLength];
inputStream.readFully(messageBody);
try (final DataInputStream messageReader = new DataInputStream(new ByteArrayInputStream(messageBody))) {
Message newMessage = plugin.getMessageFromJson(messageReader.readUTF());
} catch (IOException e) {
}
}
but onRecieved not work at all
how can I send data to another server?
PS I already register out going, and incoming (THe Channel name is BungeeCord)
Is tthere a player on the target server
for whole thing to work you got to have minimum one player on that server where are you sending data
I recommend doing it yourself with sockets
so you don't depend on player connection
How do sponge mixins work? And would it be able to somehow do it in a spigot plugin
No
Spigot plugins load too late for it to work
You can bootstrap Mixins and then launch the server
Well how do they work though
They use classloaders to modify the bytecode of loaded classes
You can just use Ignite
not that far, don't think Ignite does that at least lol
Ignite uses separate plugins
alr thx
only if you want to build it in
otherwise its not necessary
I'll rewrite you if you aren't careful
Poor Floyd
I love writing code that works the first try
hey it just happened fo rme
the fact it involved CompletableFutures and running code multi-threaded is why I'm so stunned
I'm so used to multi threaded code blowing up that I'm surprised it works even if its simple
Lies
Okay JerryTheCarry
your just mad you aren't the carry
Jery*
fr doesn't even have the respect to spell it right
JarieTheCarie
Math is annoying
Is there any decent way to randomly visit all points within a 3d region randomly, but assure their are no repeats without keeping a list of every coordinate that needs to be visited?
e.g. if I want to randomly check coordinates with the region (0, 0, 0) to (200, 100, 200)
well what do you mean by "keeping a list"
if you mean literally keeping a List<Location>, then yes, but if you mean any form of tracking already visited spots, no
e.g. generating a list of all coordinates in the region prior to visiting them randomly
its not random if you can't go back to the same spot, probably by some definition
the issue is I'm checking for spawn locations for something within a region and collecting them for later. Right now I do scans chunk by chunk asynchronously by grabbing a chunk snapshot on the main thread and over time scanning every block in the chunk that is within the region their is a possible spawn in. The issue I found is I don't want to generate EVERY spawn point, but I want the spawn points to be dispersed randomly
yeah, you could randomly shuffle a list of all possible spots, but that violates one of your constraints
I just wasn't sure if that'd be too memory heavy if I'm scanning like 100 or 200 chunks
well this list doesn't have to be kept in memory
how else would I keep it. I mean ideally I wouldn't want to immediately flush it to the disc IO read writes would slow. Especially if I want to retrieve them like 5 or so minutes after the scan. The man idea would I would scan for spawn locations 2 minutes or so prior to the event. I'd end up only storing in reality 20 or 30 spawn locations in the final output, but I want to get those 20 or 30 spawn locations as randomly as possible
previously I just scanned over chunks from 0-16 on x z and between my y constraints, but this provided a much to predictable spot for locations especially after culling down to the 20 or 30 results
just encode the location into 1D so that it is space-efficient
search up morton order, or space-filling curve
it's kinda annoying to encode with custom Y-values tbh
you can optimize out the list if you ignore air too, ig
looping twice would end up being less efficent though cuz I'd have to filter for air then do checks
looping through some locations shouldn't be expensive, besides I assume you aren't going to do this more than once considering the scale
it'll be done more than once, but only every few hours realistically
more so since if encoded, a good chunk (no pun intended) would be in the cache
it'll be also done on another thread and 5 minutse prior to the event occurring
you either optimize for memory usage or for overall algorithm efficiency
I'm mostly worried about memory usage vs algo efficency
because the algo can fair to lag a bit since its on another thread
it can cause noisy neighbor issues at worst
considering I'll have 2-5 minutes to do the processing I feel fairly confident about being able to process it in time
the process shouldn't take more than a few seconds
I'm just concerned about storing that many valid locations in a list given lax spawn rules
if you encode them in a long with something like morton, it should be fairly efficient
given that you can also ignore a good part of the chunk (as you wouldn't logically spawn anything above the highest building block, maybe the height map can help with that)
yeah I already have clamps with y values in place
so that's not an issue
I also assume that this is naturally generated terrain and not player-created
its envoys so probably a custom warzone map
if it is player-created then there's a whole other lot of issues considering the massive build height, but as long as you can clamp the Y-axis to an extent it should be fine
I'm not the one doing the clamping
Its configurable so the server owner can decide which are valid spawn blocks y clamps to stop envoys from spawning out of bounds etc
so unless the owner was a literal dumbass, which is definitely possible I'm not too worried
at the very worst, it'd be ~200MB per chunk
but then again, you'd discard the chunk once you've already gone through it, and a self-avoiding space-filling curve would make sure of that
do ping me whenever you accidentally cause a OOM and crash the server
will do
its probably better than some other public plugins xD
I mean, if you are worrying about this kind of thing, it should be good, you are aware of the scale so all-else is just apply the most tricks so that it becomes space-efficient enough for it to not be an issue
the more space-efficient, the faster it can be done as well, given reasonable compression algorithms
I could also split chunks into smaller regions
which would take up less area
hopefully the HAT people get done with it soon so we can abuse the hell out of gpu for this kind of number-crunching
yo ik i have asked plenty of times and i have gotten anwsers! but now its to the point that it still doesnt work lol can someone VC and help us XD
can you get the protocol version in AsyncPlayerPreLoginEvent?
protocol version is a constant
you can get it anywhere at any time for any reason
you can even get the protocol version in your Hyper Multi Threaded program
you could get the protocol version if you were on the ISS sending all of your server data byte by byte to your computer remotely
Hell you can get the data version without even starting spigot!
for further reference here is minecrafts main class
@DontObfuscate
public static void main(String[] strings) throws IOException {
SharedConstants.tryDetectVersion();
``` as you notice it detects the version before it even runs the CLI options
If you mean the client protocol version, it's always going to be whatever the server version is. They can't join the server if it's different
If you're running ViaVersion, you can use ViaVersion's API to get the player's protocol version
"but in my custom fork ..."
Via.getAPI().getPlayerProtocolVersion(player);
no player have to exist on targetserver?
is there any way to send a data to another server without velocity?
There are a lot of ways. One could use services like RabbitMQ or my favourite Redis Pub/Sub to actively send data across servers
oh, just with plugin message is impossible?
I wonder if you can fake a player connection or socket for that
hmm got it thank you guys
Of course you can. It's a funny idea but very hacky to say the least
Idk about plugin messaging, I have never looked at it. I just know that MQ's or Redis can pull it off
but I think that's not a good way
It was a joke
oh lol
anyone know what I can use to replicate fake players and right clicking them to open gui
What do you mean by replicate fake players?
like for example hypixel when you right click the bedwars player itll open an inventory gui
but its not a real player but it looks as such
Oh, spawning an NPC. You have multiple ways, harder or easier
If you are quite new to this you can use Citizens api. It got you covered for spawn, interactions etc
Otherwise you can use packet wise actions to handle that
how can I learn what packets I need to send
You can use the minecraft protocol wiki.vg to find all the packets information
You also have a bunch of tutorials/forum posts online for that
do you have one on hand?
Does anyone have a tutorial for efficient index search that does not require to iterate through all messages (like the search discord does in phrase search)?
Nop but you could easily find some on google I believe 🙂
PacketEvents' tutorial
Just be sure to check your version
Does npc spawn as an example I think
What kind of document do you want to search? Messages, Articles, ...?
Just like messages on discord
Any length pretty much
And you can search for a word or a phrase
You have many ways of doing it. But the more documents you will have will make it the harder to create.
I recommend using existing libraries for that: they are efficient, and cover everything for you
I don't need it for anything
For instance I can think of Apache Lucene
I just want to learn how it's done
Mmmh. In that case I recommend you to read about Trie, Information Retrieval, Ranking algos (BM25, ...), Vector Search and Embeddings, Inverted Index
Wait npcs are literally fake players with packets?
Yes
elasticsearch?
they want to understand the actual implementation of those search engines rather than using one
we have finally done it!! but now mc packs is saying Missing mcmeta data: Invalid resource pack.
what do we do now i cant find any tutrorials on this one
thats what im usimg
and im trying to get the key or whatever it is so i can fource the resaurce pack on the server
When creating the zip did you zip the folder or the contents. Bc the pack needs to have its content in the zip directly not in another folder
Uh oh blue
??
I ran into the same issue ages ago trying to generate packs, only some zipping libraries zip the contents properly
I normally boost the server and my nitro has expired
my friend i think zipped the folder
i think..
he just gave me the download
and ti auto zipped it
Your pack should look like this when zipped
MyPack.zip:
assets/
pack.mcmeta
I'm guessing it's a zipped folder
or nah
?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
.
is the mcmeta valid JSON
That looks like a zipped folder
Yep absolutely
how do i just zip the contents
If your on windows open the pack folder, select the content being assets pack and icon then press share and zip
Select the contents, rigth click and click "Create archive"?
what about the rest?
just the assets?
or everything
you have to archive everything
It just has to be the same as your current archive, but instead of being in a subdirectory, it has to be in the root directory
so i just highlight the assets, pack.mcmeta and pack.png and right click and press add files to archive
sorry im super tires so might sound like a dumb question
Yes
and it says add files ot add? do i just say cancel?
what
it popped up a diff menu and it says select files to add and has alll my files
i can press ok
or cancel
then press ok
ok yeah now I'm confused on what you are doing
are you, like, rearchiving the files from the archive?
ima be honest idk i just right clicked like i said and then pressed the add items to archive
i went in the files
*file
You need to select then in windows not winrar
Do you have the top bar open
If yes press share then zip
If not on the right press the down arrow then do those steps
looks like the share button doesnt like highlight
you dont have the files selected
oh
You could tell it was win11 from the winrar screenshot
i wasnt looking that closely on my phone
but it just auto zips it to winrar
Understandable
or was i not supposed to zip it
auto zips to winrar?
ye
so .rar?
like it just auto makes a winrar zip folder
that's just called a zip
if you wanna zip with winrar, select them, right click open the more options panel hover over winrar press add to archive then change the extension to zip
winrar is just the application to view a zip
all you should care about is that the file extension is .zip
Is moving item on top of other is InventoryDragEvent?
looks like a click event..
but like, moving the item is a drag event
so it would be both
The drag event is only fired if you keep your mouse clicked down and drag it across the inventory, resulting in the items being split.
Your video shows the InventoryClickEvent of which you can get the cursor and the clicked item.
Who was working with reflection lib? You was have bugs?
uh?
which bugs?
also, you don't really need a reflection lib, unless you mean the reflect package under java
Single slot drag event is the bane of my existence
ikr
i fixed it, but it took a while
mojang can be add block nbt like items?
what
in this way, blocks can be given different properties, etc. we can give it that would be great
i mean feature like nbt
can someone recommend this to mojang?
keep in mind that mojang will probably not give a single fuck
thats right xd
generic blocks being able to have custom attributes like nbt would be a terrible thing
why
i don't know but thanks to this we could bring new blocks to the game without mods
btw
i mean nbt tag
you only need 1 block to do that
wdym for that
if they added a single custom block whick was keyed
it could be used to represent any number of custom blocks
all items have nbt tag
ah
what
wait
was i talking about something different all along?
yes, but they do not exist in the world in numbers of 65535 per chunk
forget what i said
ok 🙂
not on each block but yes to a custom one
if this happens, i hope the game will make new blocks easier.
Items have much meta as they are not really represented in the world, only to each player in an inventory. You can see custom model data if dropped but the number of occurances is miniscule
if every block in the world could have custom model data it would result in a massive processing overhead
What about custom model data for entities
even if it is only 1 block, it is enough and this block does not even need to be in the world.
I would like this more
I'd like both
custom model data for an entity could require a lot of streamed data
But peopel have been asking for a long time for custom blocks
One custom block thats keyed would be enough.
I'd even like streamed texture data rather than the current resource packs
So plugins would contain their own texture data easily
does anyone have a utility that translates color from text(hex, classic) through adventure api? If you have it, can you give it to me?
oh wait
btw here not only spigot users 🙂
there isn't really a good way to do this because legacy is inconsistent versus minimessage
You could make a parsing tool to parse most legacy signs into minimessage, but I would just use minimessage if you're going to use minimessage
This will not happen
Mojank is very agains these hacky solutions
They will straight up give us custom blocks
Just like we have trims, paintings, banner patters and more
I will attempt to eat a sock if they add one "custom" block
I mean, they are on track as fuck for custom items already
can i cange player's health bar to hardcore health bar in game? with any method
You'd have to spoof to the player that the world is in hardcore mode
That value is only part of the login packet though, which is just sent once on login. You'd have to listen for that outgoing packet and change the value. I don't know what the client will do if you re-send the packet after they've logged in and received it once already
or ya could use a texturepack if you want it for everyone
aight guys ty
seems this person has an open source plugin for it:
https://github.com/cerus-mc/hardcore-hearts
Yeah, which does exactly what I said :p
Which actually is written by Cerus, I'm realizing, who is also on Hypixel with me 
i remember when cerus would be here sometimes
He's too cool for you guys now
ohhh that's why you're here

i'm pretty good at making minigames too
what the FUCK 😦
lol
Is there any event fired when a command block executes
yeah
for (Player player : PortalEnterListener.playersInArena) {
anyone know why im getting a null error in this? the code still runs though
ServerCommandEvent should be executed with the command block being the command sender
presumably because playersInArena is null?
ah nevermind, there's no event for that
paste the error^
[info] null eror
ah yes
presumably you are removing from that list while iterating
Yea
alr thanks
The exception you were looking for btw was caused by: java.util.ConcurrentModificationException
In case you run into this again
org.bukkit.event.EventException: null just means, an event handler thew an exception. The actual reason is in the cause stack
what does "using a function" mean
PortalEnterListener.playersInArena.remove(p);
}```
I mean, yea, just callign a function that then removes it does not change a thing
have a look at removeIf
What about iterators :(
iterate yourself back to java 8
Thoughts or not worth it?
Works with any custom object and stores into configs with ease

I mean, terrible people would say, configurate can do that too
Tho I guess it is a nice utility for the bukkit yaml api
Does setItemStack in config set nbt tags?
heh
Haven't checked but my one does
and potentially break your items on version upgrades
I’ll break you on version upgrade


