#help-development
1 messages · Page 1176 of 1
That was added in 1.8
Number Format I think?
Actually, fun fact, you can't see your active effects in 1.9+ in the top right on Hypixel
I added that today too lol
Wow he added the hide particles and hide icon flags
hes turning into chopixel
Well presumably the collection is unmodifiable
^
I mean yeah but hm
Or maybe the collection just isn’t having your shit today
how did it work and stop working
peak liskov substitution moment
I think it's because this guy is on a build from a year ago
what if some idiot passed an unmodifiable collection through api
and using content from two months ago
I did change to non-immutable lists a few months back
man I simultaneously barely did anything and did a bunch of stuff today
I hate these limbos
Yo @young knoll when ya get the chance can you rewrite this so that it's actually proper plz lmfao
Should be correct for the most part, though I'm failing to optimize it further cause I don't use spigot's api much kek
^ me
Just realized that early returns if the chunks are the same, reee (╯°□°)╯︵ ┻━┻
would the player.setHealth(0); call a PlayerDeathEvent?
Did you try it?
Generally its considered bad practice
what is better practice for it?
Player#damage(123456)
alright thanks
(Thats also pretty much what /kill does too)
actually minecraft uses: entity.kill(worldlevel)
which then calls:
remove(Entity.RemovalReason.KILLED, Cause.DEATH);
gameEvent(GameEvent.ENTITY_DIE);
Hm
what? I heard it was using the damage so you can actually survive the /kill using healthboost
but its not using damage to kill the player (that wouldnt be clean at all)
alright
can i open a custom menu or do something?? when player open the advancements menu?
or can i check, when player open advencement menu?
i think its client side completly
https://wiki.vg/Protocol#Select_Advancements_Tab Well there are some packets related to it
oh thats S2C
yes you can, a packet is sent from the player to server
Event when?
I can always keep the hunger at maximum with this: (aside from checking if the entity is a player etc etc) java @EventHandler public void onHunger(FoodLevelChangeEvent event) { event.setFoodLevel(20); } Is it possible to disable client-side shaking of these meat icons when the player is sprinting? Is it possible to hide the hunger bar without texture pack?
You can't hide it without a resource pack no
But you can use the saturation effect
the saturation effect puts an icon in the inventory and top-right and also gives particles (which maybe can be hidden by cancelling packets... but idk) which is worse than just the small shaking
but I thought there's another way
thanks though
Saturation can be hidden in the top right
And the particles
I don’t think you can hide the inventory icon tho
I mean does it actually disable shaking?
becuase I don't see how if all of that is server-side
how is that server side
It’s based on saturation
You can also just rename the status effect with a resource pack
Iirc it shakes when your saturation drops
yea
I meant server decides when the saturation will drop and then updates it to client
but if server never lets the saturation drop, hunger bar shouldn't shake if i'm not mistaken
yea
oh I think i get it
even though the food level is always 20, server sends updates to change it to 20, coming from this event?
Sorry for off topic question but do you guys know any simulator that simulate logic gate with builtin VHDL simulator (similar to logisim evolution but not using ModelSim)
asking for help on gui programs is your first issue
there's no docs for it, i've searched it
only for certain things
that Program is so old
and my uni forces it to use it
i mean it still has windows XP like toolbar
it doesnt even have antialiasing for font rendering
its just a pixel perfect font
i like those
f aa
Home page of Gohufont, a monospace bitmap font
this is my favourite
I don't need any of the functionality WG has, so it'll just overcomplicate things, and I need more than just a bounding box so I'd still need to create a class, which uses a BoundingBox & go from there
better than reimplmenting what basically a bounding box does
what u even trying to do
Eh. I already have it mostly sorted, no point in rewriting it to use a bounding box.
trigger zone -> designated area within a game where entering or interacting with it causes a specific event or action to occur.
Usually invisible, many things use this or similar lol
I'm sure some smart people can spot additional improvements and things I messed up
Yea, I think I cam work with that
I assume I just RegionManager#getRegions(Chunk) & then do my checks as usual @young knoll ?
There's getRegionsForLocation
Ah, guess I'd just extend region then and go from there KEK
Anyone here know how mojank handles y axis generation when it comes to world / chunk generation?
Yea, might as well just extend region. I'm sure i'd come up with some other use for it too lol
What about it?
Need a rough idea of how it’s done so I can try and do something similar in my wfc impl
The main thing is just 3D noise
woah gradle kotlin
I found a thing about perlin noise, know anything about it?
To be fair now that I'm thinking about it, I've got a relatively simple fairway pathing function already implemented, technically speaking I just have to flip the direction if you will to produce hills and such.... I think
Semi certain indexing by chunk is gonna saturate that map rather quickly for larger areas
Wrong reply

cause you can't reply properly: @young knoll
Like, the way WG does it is a tree
but yea, this is what I'm using this for @proper cobalt lol
If it helps the explanation of my idea... essentially just flip this horizontally and now I'm generating hills... hopefully
inb4 no hill
What's inb4 kek
inbefore
inb4: used to predict something that will be posted by another user
But that requires slightly more effort
in before
“Inb4” (short for “in before”) is used to predict something that will be posted by another user. “Inb4” can also be used to predict something that will happen, like a thread being locked or a user being banned.
PRTree library from http://www.khelekore.org/prtree/index.shtml - EngineHub/PRTree
maybe
Damn so you're saying I'm not gonna make hills?? D:
inb4 it's anything except a hill
I think you're just a hater
kek
no it's you
Yea, so slightly more effort as Coll said lol
I don't have access
no?
on some you can
it says #unknown
If I can figure out how to make it work with my current system,yes.
that and when I click it says I don't have access 😦
This is easier said than done, however, given how it's coded
Hmmm chunk alignment for my tile placement would be cool
Eh. If anything I can just use Colls solution 😎
Yea, no idea how to use that repo in a real-world scenario and I'm not gonna dig through WG just to see how they impl it
How are your old pcs optic 🤓😂
in storage
I'll just use Coll's solution, knowing the dev community someone at some point will complain and provide the needed solution KEK
ha
just use wg 🤦♂️
Don't need it
Overly complicated for what I need
I don't need literally any part of WG outside of the region stuff, so there's no point making it a hard requirement.
Using this instead, since it's only want I need lol
I'd use this, but I cba to figure out how to actually use it in real world use cases kek
Also, even if I did use WorldGuard I'd have to figure out which classes to extend & shit just to do what I need to do
Not doing protection or anything of the sort, just actions depending on location & prerequisites as a bare minimum.
Relying on something like WG is absolutely overkill (and pointlessly forcing a dependency)
you just want to do actions / allow stuff in specific regions ?
There's a lot of other stuff that this specific thing will depend on
see the bare minimum
It's a trigger, the things you can do with it are basically infinite as long as you code it in kek
when i use a kotlin extension function, can i call it from java?
as an extension, no
It's just a static function taking in the original class
fun String.test() = true
turns to
public static bool test(String string) {
return true;
}
or something similar
okay, so i cannot use it from java :/
No, that's why it's a kotlin feature
you can use them from java, just not as foo.bar()
bar(foo)
Probably gonna be stuck relying on worldedit though, everything I can find for mass block changes are outdated kek
more like, world edit
Yeah, WE lmfao
the one useful class isn't updated for 1.21.1 and uses nms and is a bitch to update (╯°□°)╯︵ ┻━┻
this can create a new world: java WorldCreator wc = new WorldCreator(worldName); World newWorld = wc.createWorld(); if (newWorld == null) { player.sendMessage("§cnewWorld == null"); return; } player.teleport(new Location(newWorld, 0, 0, 0)); player.setFlying(true); but I'd like the world to be temporary, preferably only in memory but that could be complicated, so I'll stick to removing all players out of it and then calling Bukkit#unloadWorld, but are there any other references to the world in other places which I should clear before deleting the world files?
Only if you store references to it
ah okay so it's completely safe then
is there a way to disable creating the files at all without using reflection and touching stuff i'm not supposed to? (I guess it would work - it's still a world but without calling the serialization code)
it isn't possible without touching internals, no
even by using internals, I think it's pretty doomed? IIRC the whole thing kind of depends on files existing
you could probably get away by using a fake file system or something but eh
and even if you do manage to do it, you'd have to re-implement it for Paper since they do change a bunch of that stuff kek
yes that is very possible on linux by just chaging the world's folder into tmpfs or something like that
but the entire nms "level" and obc CraftWorld is very long and confusing to newcomers
I was gonna use this since I already have NMS setup but again, rewriting and updating would be a biiitch kek
https://paste.md-5.net/ivojasocim.java
it isn't worth the effort really
simply because you'll have to endlessly worry about it shitting on itself on newer versions in unexpected ways
better just depend on WE/FAWE and let them worry about the side-effects of that
Actually, that wouldn't be a big problem for me as I already deal with NMS in another resource lol
I mean, it isn't so much about dealing with NMS but understanding and keeping up with the underlying system
plus if you support Paper at all, the system is wildly different so you'd also have to understand paper changes on top
Fuck paper lol
I agree

eh, now that Moonrise is its own separate thing, it is easier to keep up with than reading the mumbled together patches
Only reason I'm struggling is I'm updating 1.9 code to 1.21.1 and some classes just outright don't exist it seems lol
import net.minecraft.server.v1_9_R2.BlockPosition;
import net.minecraft.server.v1_9_R2.Chunk;
import net.minecraft.server.v1_9_R2.EntityPlayer;
import net.minecraft.server.v1_9_R2.EnumSkyBlock;
import net.minecraft.server.v1_9_R2.IBlockData;
import net.minecraft.server.v1_9_R2.Packet;
import net.minecraft.server.v1_9_R2.PacketPlayOutMapChunk;
import net.minecraft.server.v1_9_R2.PlayerChunk;
import net.minecraft.server.v1_9_R2.TileEntity;
import net.minecraft.server.v1_9_R2.World;
Those are old spigot mappings
https://mappings.dev/ to the rescue
Also the version isn't part of NMS classes anymore
Yea, I know lmao
to be exact, it's not nms anymore either xD
I'm getting flashbacks
and again, some of those classes just outright don't exist anymore which is where the struggling is from lol
ClientboundLevelChunkWithLightPacket
jfc and I thought some of my names were long KEK
that's not even that long
mojang usually isn't too bad with the names
they're really bad with the generics though
meanwhile spigot IBlockData
my favourite interface
what was that codec with a bunch of generic params lol
How'd you figure that out lmao
keeping up with the changes, probably 😛
50% memory 50% searching "chunk" in the mappings site
linkie my beloved
I knew it was ClientboundSomethingChunkSomethingPacket
lol
how can I find out where these messages are coming from? I'd like to disable printing them, I hope I don't have to hook into log4j
i though of searching string "Modifier:" but no idea where to search
I mean, regardless of where they're coming from, you'll have to hook into the logger
be it either via a filter or some other way
😞
why didn't it work when I searched it
AAAAAAAA it's this small thing
tbf I also didn't see it at first glance lol
Too bad spigot doesn't have a proper API for this lmao
are these per server
server isn't really made for mass block changes at all
too bad 😎
worldedit does everything in a single tick, no?
what's up with FAWE nowadays, is it still reliable or did it go back to being unreliable
ah, I can just ripe FAWE code then KEK
Yea, it's using NMS
Does anyone know how to add custom advancement toasts, since my current code just doesn't send anything
im pretty sure this is advertising
cuz i got them as well i never added them
they r user apps, u use them in every server
but why do they display if i didnt add them to my user
is there an event for when a player changes the item they are holding? either by selecting items in their hotbar or by moving items in their inventory?
https://www.spigotmc.org/threads/event-for-when-a-player-switches-hotbar-slot.85786/
it's PlayerItemHeldEvent
discord probably got paid for that, if you try to use any of those, it will ask you to authorize separately
PlayerItemHeldEvent fires when they change via the number keys
No direct event fires if they move items tho
ik it does
I remember seeing an interesting way to detect hotbar changes using vanilla command blocks, around 3-4 years ago, people made scrolling useful
for the inventory click, hotbar slots depend on the inventory: https://www.spigotmc.org/wiki/raw-slot-ids/
can i get the types of a class? like Map<String, Integer>, i would want to get String.class and Integer.class
generics don't exist at runtime
ah getting specifics from generics
not even class generics?
no
I mean if the map is not empty is it possible to get any entry from it and extract classes from it?
and what the fuck is the xy
You can actually get the generics from a declared field
ie List<String> strings = blah blah
how would i get String.class from that?
I love how deep the copy/paste has gone on that class
From RedLib to my lib to Pineapple
what method contains the code?
create(String)
wow you actually found the class
Wasn’t that hard
im working with configs, how can i get all children of fines config section?
Ye
getKeys(false)
on the fines configuration section
Hello, I am back with likely a "duh" type of question. What is the process for removing an armor piece from somebody's armor content inventory? Is it just #getInventory().remove(ItemStack armorPiece);?
I have code for a custom death system for my plugin, and I am trying to force-drop Binding Curse armors... this code unfortunately does not remove the not null ItemStack armorPiece from their inventory using the method above
you can remove from slot i guess
Would that then require getting the slot number for removal? There must be an easier way
then like EquipmentSlot.HELMET but idk if its a method im on phone
hmmmmm ok
That seems to work. Interesting! Thank you so much
Merci, have a wonderful weekend
You can just set the slot to null
Player#getEquipment#setHelmet(null)
what did you do?
because i see my solution doesnt exist
Im looking for work, so if you guys need a plugin made read my bio and i can hlep
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/
ok
Maybe not the best channel to post this in but; what folder structure does everyone here use to organize their projects?
I personally tend to create folders for everything my plugin tries to do (e.g. a folder for teams, discord (integration), database utilities) but this gets messy over time
Deciding between two categories is harder. Maybe it's just a problem with my way of doing things, not sure, but at one point you will code something that might fit in multiple categories. Could also just be overthinking this, I dunno.
structure however you see fit
the only normal structure you should adhere to is the src/main/java and src/main/test folders
also using your package name, but otherwise honestly whatever you do is up to you
If the system has it's own manager class usually I do that in it's own package
Wdym?
like if you have a discord manager class, and a teams manager class, and database manager I would partition those to their own folders
then a shared folder generally
hmm i see
but try not to fall for analysis paralysis
at the end of the day it doesn't matter that much
very true. I'm just interested in the topic though, I haven't looked much at other plugins and their structure
Guess this is that one occasion where github search comes in handy lol
me spending 5 min trying to name a variable
Why is my inventory open event not firing?
public class InvOpen implements Listener {
public InvOpen(Wicklow2 plugin) {
Bukkit.getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void onOpen(InventoryOpenEvent event) {
System.out.println("EVENT CALLED"); //never printing
PlayerMemory m = MemoryUtility.getPlayerMemory((Player) event.getPlayer());
System.out.println(m.isReloading());
if(m.isReloading()) {
event.setCancelled(true);
}
}
}
Main:
new InvOpen(this);
it wont fire for the player's own inventory (client doesnt tell server)
it will fire for chests etc
fcuck
real
what exactly r u trying to achive
like what is your end goal
so real that i just did it again 😭
took me 20 min to make an interface and a record
im so efficient with my time
My buildtools on mac doesnt open gui earlier it did then i installed jdk 21 via homebrew and gui stopped and it wld extract in the bground. any idea how to fix?
Does the jar launch?
Or have you only tried the dmg file
via terminal ?yes
but when i directly open the jar it does stuff in background no window and terminal works but i want the gui
Weird when we made that gui we have like one guy who had a Mac so it might be nearly impossible for me to actually bug fix here. Best you can try is running it from the command line at this point
well no other option
this broke when i installed a new java version is it related to that? whay jvm shld i be using aac to the mac guy?
No clue I usually have a 10,000 foot poll between myself and any apple project
Did you try running it command line with the gui flag
Might be useful to see if you get a stacktrace
Run it just add --gui
Might be an issue with launching through double click on Mac
In which case we can't do much
Yeah that happens sometimes but doesn't actually cause any issues afaik
I'm listening to ClientboundBlockUpdatePacket for canceling block updates, the problem is when i right click on 1 block, 1 time, i receive the backet 4 times for 2 diffent xyz, any idea why?
for my minigame I have a kit, however I have split my plugins into 3, one lobby, one for minigames, and a core plugin
should I store the kit data into core, lobby or minigame considering I have to access the kit in minigames and modify the kit in lobby
What does core contain?
I would imagine minigames
since core would be used by both; are kits used by both? probably not
core contains like the framework for both plugins
the database is split into core, lobby, and minigames
however I need to access the kit from minigames and also change it from lobby
and lobby does not load the minigames part of the database
and vice versa
but I want to keep all my match related code together tbh
I got it figured out tbh
gonna keep it all inside minigames
and then just modify it directly from lobby
what is the latest specialsource version? for 1.21
2.0.3 on maven
k
ik that's sad
you can detect when a player presses something in the player's inventory tho so you can still do something
Can someone help me with ProtocolLib, it seems I cannot modify armor stand metadata using the entity metadata packet, this is very strange errors.
Errors: https://paste.md-5.net/uximixitub.bash
Code: https://paste.md-5.net/afeduxusaz.cs
Apparently this line throws an error
WrappedDataWatcher watcher = new WrappedDataWatcher();
Could anyone help me set up bungeecord?
Don't crosspost
oops sorry
Stay in #help-server
hm Make sure ProtocolLib is up to date
I'll make sure once again.
Okay, just tested, same errors.
Same errors on server version 1.20.1 and 1.21.
Apparently it's a known bug https://github.com/dmulloy2/ProtocolLib/issues/3296
Versions above 1.20.4 should work
It runs a different piece of code for it
Send that error
On 1.21 it kicked me out, I'll send the errors in a moment.
This is the error https://paste.md-5.net/iwivowomaz.bash
I just remembered, my bad
also any reason why you need packets for that
It's for a cosmetic plugin, the armor stand will be mounted to player and I want the plugin doesn't cause any performance impact to the server.
Similar to this plugin https://polymart.org/resource/magic-cosmetics-20-off.2070 or if you know OriginRealms cosmetics system.
Having a regular armor stand as passenger won't have much of a peroformance impact
It will just save you a lot of time
Even if there are 200 players on the server?
We need two armor stands per player.
are both passengers
Yes passengers
Oh and also if I remember correctly the player cannot be teleported if there is an entity mounting them.
at 200 players you have other concerns
I think that's the main reason why I need packets.
I have actually, the player cannot be teleported if there is an entity mounting them.
Specifically armor stand, I only tested with armor stand.
Yeah I remember that when I got the same stress as Billy in the comment section had 2 years ago lmao
My best bet is to wait for ProtocolLib has a fix for that then?
How does .setCollidable() work()
I have two accounts on the server, set collidable to false for both but they can still push each other
If I call A.hidePlayer(B) (so A cannot see B), then B can push A, but cannot be pushed by A (B doesn't feel anything when pushing A) (this behaviour may be different on paper, the same with placing a block into a spot where someone who is hidden from you is standing, but i'm talking about collisions specifically)
are pushing physics clientside or serverside?
nvm I'll just set collisionRule to never for all teams since some players are in various teams
btw i forgot to mention that this software that SAP pushes is so bad that it needs Visual Basic compatibility installed in Windows 11 for its functionality
is there a way to have custom invs of the same type by changing the inv name?
?
wait
like that those both be in while using the generic54 textutre but named diffrently
like that in that
you can create more then 1 inventory with different items and names ^^
so then just call it eg inv1.png and then use Bukkit#createinv(null, 54, "inv1") or how
yeah those are both custom uis later
I mean, your inventory will be dynamically created, the texture scales
that wouldnt work
u would need some sort of custom font character which acts as an overlay. Or use one slot of the inventory for an item with a custom model also acting as the overlay
changing the texture itself would only be useful if it should be applied to any kind of this inventory type
so basicly I should use that https://www.spigotmc.org/threads/custom-inventory-uis-updated.635897/
yes
ofc some things might've changed in newer versions (talking about how ressourcepacks are structured etc)
i wonder if we could use minecraftvanilla shaders to draw GUI's
do shaders work outside fabulous graphics mode?
i've saw some mimimap concept made with serverside position handling code and then it somehow informs shader with necessary information to draw the position and surroundings
basically he made serverside minimap mod with server resource pack
you technically could but that doesn't mean that you should
Vanilla shaders are not that efficient and by drawing an entire gui it could theoratically cause fps drops especially on lower end systems
which isn't ideal
using fonts isnt efficient either
but could be a nice concept to allow for more dynamic guis
thats true, but a shader would consume much more resources than a font
i mean utilizing some kind of vertex shader and fragment shader doesnt sound that bad
it isn't really, it's just that afaik the shaders offered by resourcepacks are way less performant
but as a normal shaderpack it could definitly be something to consider
but would also require iris or some sort
i kinda fell in love with that idea now ;-;
Getting back into plugin development; ChatColor seems to be deprecated. Trying to translate color codes into actual colors using ChatColor.translateAlternativeColorCodes, what should i use instead?
ChatColor isn't deprecated on Spigot
Oh? Probably using Paper then, lemme check
Yeah I'm using paper. I remember using that, mb
Curious to know if I need to set the line width and other characteristics in a TextDisplay entity?
You don't need to, no
Is there a default? I'll do some experimenting. Just curious
No idea
https://imgur.com/a/T7jWTVG how can i fix this?
Ok, I have the text display - it is displaying text as intended. I am unsure how to remove the chat background from the text
I believe it's possible?
Background color
What Color should I use?
Do I specify as null maybe? Sorry
One with 0 for the alpha
To create scoreboard teams is better to use the main scoreboard or using new scoreboard and show it to the player. For example for a duels plugin that have red/blue team?
if u have a problem with wrapping lmk
cuz line width in in pixels
but u cant get the pixels in a string
technically you can
whats best way to get hypothetical damage an item would deal if it were to hit a player
that's a tricky one. pretty sure I resorted to doing all the damage math myself in the past
problem's mostly just dealing with attributes and enchants
alright
Hey can i get the right Click on an Armorstand?
the event PlayerInteractEntityEvent doesn't work and the PlayerArmorStandManipulateEvent is not the simple right click
PlayerInteractAtEntityEvent
I try
any way to set sword's attack damage & pickaxe mine speed withought nms?
Attributes
im.getAttributeModifiers().put(Attribute.GENERIC_ATTACK_DAMAGE, what do you put here? It takes type AttributeModifier);
AttributeModifier class is a bit weird, been looking at javadocs
ItemMeta#getAttribute(Attribute).addModifier(Modifier)
ItemMeta doesn't seem to have the getAttribute method. is it a different itemMeta? (EX: is there a sword meta or something)
Oh it's just ItemMeta#addAttributeModifier
right but that takes in an AttributeModifier which has a bunch of weird parameters. can I just get the existing damage modifier on the sword and increase it? or is there not one...
that's what the modifier is for
create one for your custom modifier id (like plugin:cool-damage-increase), with the amount and just add operation or whatever
Material#getDefaultAttributeModifiers
yeah that works thanks
is Material.WHEAT used for both the item and the crop?
@pseudo hazel Do you think any documentation is needed for AdvancementRequirements? Compared to regular advancement criteria and when developers should use it?
Hey sorry this is old but how exactly would this work? Do i start a task when i first open the websocket connection and then close it on stop? They dont seem to have a method to run code on stop
I would recommend not using scoreboards at all for this
if you ultimately want to, for that kind of thing you'd want the main scoreboard
yes
ultimately for the block
just block onDisable
Is it possible to get the NBT data from a playerhead that I click? and if so, there are dics for that
ItemMeta#getAsString
No dicks sorry
What data do you want
You could use pdc
can i pay somehow else, without using paypal?
i would like to buy 2 different plugins but the only way to pay is paypal and i dont have it and i cant make it as well
this
No
no
i cant upload a image sec
?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
I know!
maybe one day in the future... maybe
BlockData#getAsString
actually that won't return the nbt per se, just the block state
What values from that do you want though
this is so rigged
I think they want the texture value
like why, then they are not geting my money
All of them? If so just do as Javier said
If it's the texture it's in the BlockState
the nbt data.
Why
no
Are you displaying it?
if you open a web socket you'll need from my experience 2 threads, one for setup/read and one common one for write, if a read throws an exception instead of blocking you can assume the connection is closed
Spigot doesn't make money from the resources section
to get the custom values.
what custom values
^
Yeah like what are you on about
is there something you are adding in the NBT?
It seems like you should be using PDC
if so, you should be using PDC for that
that is the PDC
Ah, the non pdc values. :p
That is pdc
wdym?
oh the map of string strings right?
ok but I can't use or set pdc with every block but that's exactly what I want
I think the PR that added that explained it pretty well
well it should be used if the normal criteria arent sufficient
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
which would be when you actually want to know the progress of someone's advancement
It's a tile entity though
It's changed a little since then, but md is wondering if additional documentation is needed to not confuse developers on when to use criteria vs requirements.
Utterly pointless here
oh
ok but I can't use or set pdc with every block but that's exactly what I want
well I havent kept up with those changes
for now ive just been using the nms for it
yeah but blocks don't have nbt, so they're most likely confused
Nothing too complicated. Just some abstraction around the list of list of strings
i'd have to read over them and see what the original reason was for me wanting to have it separate
AdvancementRequirements (parent list)
AdvancementRequirement (sublist)
but pretty sure that was just because without the requirements its impossible to know the progress of complicated advancements
AdvancementRequirement#getRequiredCriteria()
Do you have stash access?
idk if its already there but a snippit from the minecraft wiki could be added
on how the advancements work in the json format
idk
If you can view this, then you do. All the updates are in this PR.
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/1067/overview
do I just log in with my spigot account?
No you need a jira account and to have signed the cla
I dont have permission to access bitbucket
I wonder why the PRs aren't publicly viewable sometimes.
It shouldn't harm anything since the only people who can submit PRs are the ones with accounts. (i.e. the ones who have signed the cla)
View and create perms aren't separated
That's hella dumb
Blame atlassian
bitbucket L, gitlab handles this properly
I will
bitbukkit
Gitlab killed their open source edition's features
so how do I get permission
sign a little contract 
?cla
time sell my soul to md
oh not just your soul
your firstborn too
and address
a dress
and phone number
You have to wear a dress
I don't remember doing that myself
however I signed it in 2016 so it could've been the case
only one thing can i use the pdc for all blocks or only for the Blocks with inventory (Chests and Playerheads...)
(yes i know i can set NBT for entitys but i now mean only this^^)
you can use PDC for any entity, that includes tile entities which include chests and player heads
if you want to set PDC for non-tile blocks, use chunk pdc
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
thnaks yes the rest i know i was not sure abour more block can have pdc.
but this is the same as the older versions.
okay well signing the cla is going a bit too far imo
it is a trivial thing
so ill just once again explain why I wanted to access the advancement requirements, and thats simply because I wanted to distinguish between advancements that only need you to collect a single item out of a possible list, and advancements that require you to complete the whole list
are you trying to do it now? If so you'll have to do it with internals until that PR is merged
I think I can link back to the minecraft wiki as part of the documentation if anything.
yeah
should be sufficient
return ((CraftAdvancement)advancement).getHandle().value().requirements().requirements().size(); idk if this counts as reflection
CraftAdvancement has no getHandle method
you just have a compiler plugin that expands those invocations/references to reflection calls
but that's also pretty ass
wait what
oh yeah it does, I was just blind
private static final MethodHandles.Lookup LOOKUP;
private static final VarHandle HANDLE_VAR_HANDLE;
static {
try {
LOOKUP = MethodHandles.privateLookupIn(CraftAdvancement.class, MethodHandles.lookup());
HANDLE_VAR_HANDLE = LOOKUP.findVarHandle(CraftAdvancement.class, "handle", AdvancementHolder.class);
} catch (ReflectiveOperationException e) {}
}
public static AdvancementHolder getHandle(Advancement advancement) {
return (AdvancementHolder) HANDLE_VAR_HANDLE.get(advancement);
}
so I wrote this for no reason
I just did a minute ago
I was looking at the craftbukkit source but I just didn't see the getHandle method
I did find it strange since all craft classes have a way to access the handle
Is it a flag ? or it is the lore of the item ? how can i remove it ?
(i talk about the "Wild Armor Trim", "Applies to:" and "Ingredients")
ItemFlag#HIDE_ARMOR_TRIM
ItemStack Item = new ItemStack(Material.WILD_ARMOR_TRIM_SMITHING_TEMPLATE);
ItemMeta meta = Item.getItemMeta();
Item.setAmount(1);
assert meta != null;
PersistentDataContainer data = meta.getPersistentDataContainer();
data.set(Keys.custom_GuiItems, PersistentDataType.INTEGER, Keys.GUIItems.get(Keys.PremiumTrue));
meta.setDisplayName("§x§2§F§F§A§E§2§lP§x§6§8§F§C§E§9§lR§x§A§0§F§D§F§1§lE§x§D§9§F§F§F§8§lM§x§9§E§E§C§E§B§lI§x§6§3§D§A§D§E§lU§x§2§8§C§7§D§1§lM");
List<String> lore = PremiumTrueGetStrings();
meta.setLore(lore);
meta.setUnbreakable(true);
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
meta.addItemFlags(ItemFlag.HIDE_ARMOR_TRIM);
meta.addItemFlags(ItemFlag.HIDE_DYE);
meta.addItemFlags(ItemFlag.HIDE_PLACED_ON);
Item.setItemMeta(meta);
PremiumTrueHomes = Item;
this is my code...
Oh, it's the template itself
i tried everythings lmao
You'll probably want #HIDE_ADDITIONAL_TOOLTIP
thats an API ?
Yes
"maybe"
If not that, it may be #HIDE_ENCHANTS
Minecraft is very weird on how they categorize those tooltips
yeah i will try ty
shadow did you see mine and raydans project
?
I don't think so
whats the problem ?
Oh yeaaa
spigot plugin development toolchain
spigotclip baby
I wanted to make that at some point
I probably should make one yea
Those are some large patch files. :p
the entire repo is about 6gb
Yeeeesh
you need to put these into folders so one can do sparse checkout
Oh, I'm dumb. I thought it was a git patch.
inb4 someone forks whatever this is and introduces malware on the binary patches
it is a git patch, just a binary one
bsdiff yea
kekw
you need to introduce a signing mechanism so people don't abuse of it
We are doing hashing
elaborate tho
and I mean
the patch generator is open source
ill patch ur patches with malware
I mean, you'd just encrypt the patches and have the patch applier tool decrypt them
why exactly
yea idk, sounds pretty useless
I mean
you can literally just bspatch the vanilla jar with the generated patches
which is also just what the tests do
not useless at all!!!
I've noticed that this doesn't work if the player joins the server for the first time. (the player is teleported somewhere else). It works when they rejoin right after. The message still gets logged, its the setSpawnLocation that doesn't work. I'm using multiverse-core but it shouldn't be a problem because i've set it as a depend in the plugin.yml, and this handler is registered after, so this one should be the last. Where's the problem? java @EventHandler(priority=org.bukkit.event.EventPriority.HIGHEST) public void onSpawn(PlayerSpawnLocationEvent event) { getLogger().info("Setting spawn location for " + event.getPlayer().getName()); event.setSpawnLocation(new Location(minigameWorld, 21.690, 65.0, -26.928)); }
it works for sure
okay wow I now removed all plugins and it's working well
guess I'll have to ask multiverse-core about this
i think multiverse core teleports the player during player join event
first join / second join doesn't exists in spigot/bukkit
then use /mv setspawn
am i going crazy or what? i've discovered a phenomenon that the longer i design something in figma the more i dislike it, but then you come back months later to see the result - it looks good 🥲
im always like, this so bad!!!! I need to tweak this slightly. After it, i'm satisfied, but couple moments later, the cycle repeats
Fr, that is the life of a designer
whats the best way of seeing if a player is connected to any server through velocity
By asking paper
same as bungee, plugin messages
I wrote up a class for this if anyone wants to review it in the thread
Hi, I have a ConcurrentHashMap that stores ItemStack objects representing the contents of player backpacks. Each player has their own backpack.
I want to implement an auto-condense feature for the backpacks. For example, if a player has 9 iron ingots in their backpack, they will be replaced with 1 iron block. To achieve this, I plan to run a task every minute that iterates through the backpacks of all online players and performs the condense operation.
My question is: can this task be safely run asynchronously, or should it always be done on the main thread?
most likely main thread
you could iterate through all the backpacks on an async thread
but then run any code that changes the player or the world on the main thread
Why does this need to be executed asynchronously?
I afraid of lag, i hope this won't cause any lag if i do it in a async task
Have you stress tested it to confirm whether it could cause lag?
In either way there’s probably a better way you could go about this, mainly splitting up this “big operation” to take place during several ticks during execution.
Like don't process all online backpack in the same time and split into multiple task ?
is there a way to copy all resources to plugins folder?
How can I decide who's to show or hide from player list in the tab list, is it possible using spigot api or do I need to use packets?
is there an easy way to make player's armor invisible withought removing it, storing it and then applying the defense that it would normally give because that sounds like a pain
You can use packets for that.
Hey everyone, can a map communicate with another plugin?
For example: if I called a map(which is located in "Plugin1"), in "Plugin2", and I added events to prevent players in the map from breaking blocks in "Plugin1", and used "Plugin2" to add those players, would "Plugin1" use those changes?
I'm only asking because I've tried doing that, but "Plugin1" isn't reading those changes to the map that were made by "Plugin2".
Yes, to both scenarios you are talking about a hashmap?
Can you explain how you're doing it since it's not working?
public static void addPlayerToWar(UUID playerUUID) {
FreeForAll.hasSpawned.remove(playerUUID);
FreeForAll.isInGuildWar.put(playerUUID, true);
Bukkit.getLogger().info("[FreeForAll] Added to isInGuildWar: " + Bukkit.getPlayer(playerUUID).getName());
Bukkit.getLogger().info("[FreeForAll] Removed from hasSpawned: " + Bukkit.getPlayer(playerUUID).getName());
Bukkit.getLogger().info("[FreeForAll] Current isInGuildWar map: " + isInGuildWar);
Bukkit.getLogger().info("[FreeForAll] Current hasSpawned map: " + hasSpawned);
}
public static void removePlayerFromWar(UUID playerUUID) {
FreeForAll.isInGuildWar.remove(playerUUID);
FreeForAll.hasSpawned.put(playerUUID, true);
Bukkit.getLogger().info("[FreeForAll] Removed from isInGuildWar: " + Bukkit.getPlayer(playerUUID).getName());
Bukkit.getLogger().info("[FreeForAll] Added to hasSpawned: " + Bukkit.getPlayer(playerUUID).getName());
Bukkit.getLogger().info("[FreeForAll] Current isInGuildWar map: " + isInGuildWar);
Bukkit.getLogger().info("[FreeForAll] Current hasSpawned map: " + hasSpawned);
}
I'm doing it like this.
And calling both methods in the other plugin.
and what is the error
Also Plugin1 uses Maven while the other uses Gradle & Kotlin.
ok, but you're sure the dependency is working?
implementation(files("D:/1- DEV/Guilds/FreeForAll-1.0.jar"))
Also just to be clear, I've never used Gradle nor Kotlin before.
What happens when u use thesem ethods you posted?
I've disabled the "shop" command for players in the "isInGuildWar", and I've added them to that map using the Guilds plugin, but if I use /shop, I'm still able to.
The command exists in the FreeForAll plugin.
if (FreeForAll.isInGuildWar.containsKey(player.getUniqueId())) {
player.sendMessage(ChatColor.RED + "You cannot shop while in a battle.");
return true;
}
?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
Hey i have used this code and this is my NTB.
NTB: https://prnt.sc/HtDMnPL4JXrw
But i get false from the Console Input
[09:09:53 INFO]: [CrystalRewards] false
oh i mean the pbc
well, crystalrewards is lowercase, where as you are using uppercase, I don't really use pdc but I am pretty sure its case sensitive
this is the console log
your pdc data shows crystalrewards as being lowercase
yes
but your code from what I see, shows it uppercase, not sure if it matters but I am pretty sure it does
i try thanks that i have not seen.
I have 96 wheat in a map,
public void removeItem(ItemStack item, int amount) {
Integer existingAmount = items.get(item);
int newAmount = existingAmount - amount;
if (newAmount <= 0) {
items.remove(item);
} else {
items.put(item, newAmount);
}
checkFull();
}
``` I do removeItem with a amount a 64, so now i have 32 wheat, but now when i redo this method existingAmount is null, the get method didin't find the key in the map, after debuging the map is not empty, i can see 32 wheat ... So i don't understand what is wrong is someone have an idear ?
wdym
and why is it surprising that Spigot is GPL-licensed
what is items
i was dont know it
but this not what i mean
this is funny dont you think?
This depends on what you're doing to that ItemStack. I know you're not doing this in this method, but if its amount is actually changing somewhere else, that changes its hashcode
If, for example, you threw that same ItemStack instance into an Inventory#removeItem() call, Bukkit will change the stack's amount
Every property, including amount, is calculated in ItemStack's hashCode() and equals() methods. They're generally pretty bad Map keys
If you don't need to check for a specific ItemStack's data and only care about the type, maybe a Material is better
val uuid = NamespacedKey(CrystalRewards.instance.name.lowercase(Locale.getDefault()), "uuid")
meta.persistentDataContainer[key, PersistentDataType.INTEGER] = args.args[0] as Int
meta.persistentDataContainer[uuid, PersistentDataType.STRING] = UUID.randomUUID().toString()```
This is the creation code.
val state: TileState = event.clickedBlock!!.state as TileState
val container: PersistentDataContainer = state.persistentDataContainer
val key = NamespacedKey(CrystalRewards.instance.name.lowercase(Locale.getDefault()), "crystals")
val uuid = NamespacedKey(CrystalRewards.instance.name.lowercase(Locale.getDefault()), "uuid")
val haskey = container.has(key, PersistentDataType.INTEGER)
if (!haskey) CrystalRewards.instance.logger.info(haskey.toString())
This is the get code
but i get false in the console but the playerhad has the data.
maybe anyone can help me?
electroniccat[no-ping] — Today at 8:45 AM
Item meta is on the item, block state is that of the block
You’re storing data in one place and trying to read it from another
Y2K_ — Today at 8:45 AM
yeah that and if you do edit the block state you have to update it iirc the block state returns a clone
I see
if you are using the custom block data lib, I think it partially handles that for you
only for blocks tho, not tile states
can someone help me lmao
how is Material.matchMaterial("BIRCH_LOG") null for the breakpoint but a Material for the evaluator?
missed api-version or something?
server on 1.19 api_version set api_version: 1.13
I should probably update that but does Material.matchMaterial even rely on api_version?
u using api-version or api_version?
ah definitely api_version by mistake
should probably recompile before restarting my debug server LOL
It works now, sorry LMAO

can I just say I love that we figured out debuggers and all
the whole System.out.println is at least 10x more mentally draining
just unbearably inefficient for plugin dev since you have to restart the server all the time
hotswapping >>>
being able to have some degree of freedom to hotswap things as well as stepping through code with a debugger is the most efficient workflow one can get
ideally, I hope for a time someone makes a hotswap agent plugin to actually make the whole thing more stable
I love how you can do it for mixins too on Fabric
||or as their docs say, hotwrapping: https://fabricmc.net/wiki/tutorial:hotswapping#hotwrapping_mixins||
OH SHIT THEY FIXED IT
ah modmuss did
Hey my PlayerInteractEvent is double but it only works with the right click and the left click. what can I do about it.
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
thanks i will try
Is there a way to cast or wrap a Slime to a Creature? It only extends Mob
and why do you need to do that
There is any way to like cache maps? And load/unload it when needed?
MapMeta implements ConfigurationSerializable so can be saved/loaded
Its for loading and resetting the maps, idk if that will help
like maybe using zip files
and unzip it to the worlds container
You mean world not map then
yeah sorry!
I noticed that EntityRemoveEvent is currently experimental, is there an alternative event?
how are you debugging in your ide
It's not crazy effective because if your breakpoint is in the main thread then it will crash the server after a few seconds but still much quicker than writing print statements because either way you'd need to recompile and restart the server
You can disable the watchdog and not make it crash I think
you can run a debugger for mc without running the server in ur ide
how
create a new remote jvm debug script, copy the arguments and add it to ur server start script, start ur server and run the debug config
na
it takes like 2 min
copy what arguments bro
nah bro
ok
aight can u set it up for me
on anydesk or sum shi
@river oracle that would be appreciated
@river oracle
Hi lynx
yeah I just do it this way because it's easier for my workflow
yeah @river oracle
Hey, how can I get the MFH_Globe head to put it in a GUI ?
and wich heads could I use to get flags like france, etc
Head base and then set the player profile on the SkullMeta
When I try I get the steve skin for MFH_Globe, can I just texture like e3RleHR1cmVzOntTS0lOOnt1cmw6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjU5ZThkNDE5NmZlYTgyNzAyNWMyOTI3YTZmY2Q2ZTk4ZDAzMDA1NzM3MTIzOGE3N2FlNGNkZGViY2U4NjQ3NyJ9fX0= ?
You should use the url they give
Not the base64
Yes
okay thank you !
I'm looking to optimize this chat handler. With around 250 online players, would it be efficient to clear the viewer list and then:
If party chat is enabled, add only up to 4 party members.
Otherwise, add only players in the same world?
private final String COMMA = "<gray>: ";
private final String PARTY_PREFIX = "<dark_gray>[<light_purple>Party<dark_gray>] ";
@EventHandler(priority = EventPriority.HIGHEST)
public void onAsyncChat (AsyncChatEvent e) {
Player p = e.getPlayer();
World world = p.getWorld();
// This is a Caffeine cache, providing fast and efficient access to user data.
User user = UsersCache.getUser(p.getUniqueId());
Party party = user.getParty();
boolean isPartyChat = party != null && user.isPartyChat();
// TODO: Change the default prefix color if needed
String teamColor = (user.getTeam() != null ? user.getTeam().getId().getHexColor() : "<gray>");
// TODO: Do i need to put a space before the message ?
// case 1 -> [Party] Notch: Hi World! (isPartyChat)
// case 2 -> <color>Notch: Hi World! (in game) , color=team's color
// case 3 -> <gray>Notch: Hi World!
Component displayPrefix = mm((isPartyChat ? PARTY_PREFIX : teamColor))
.append(mm(user.getName() + COMMA));
e.renderer((source, sourceDisplayName, message, viewer) ->
displayPrefix.append(message)
);
/*
Filter the message to only:
if chat toggles to party -> party members
otherwise to the sender's world players
*/
if (isPartyChat) {
var partyMembers = party.getMembers();
e.viewers().removeIf(viewer -> viewer instanceof Player && partyMembers.contains(((Player) viewer).getUniqueId()));
} else {
e.viewers().removeIf(viewer -> viewer instanceof Player && ((Player) viewer).getWorld() != world);
}
}
Seems fine. Nothing more you can really do to improve performance tbh. Probably doesn't need to have HIGHEST priority though
Also, : is a colon, not a comma :p
yk highest is the lowest priority right?
Hey choco you ever have to do any custom generation stuff for your minigame impls?
That's confusing. Highest is called last*
"highest" = final say
"lowest" = others can override what you set
lol ok
No. Everything is built by the builders :p
really??
Yes. We have a build team lol
Wow that's actually so surprising
dang I was hoping you knew about perlin noise and wfc kek
go into the minestom server for this
I mean perlin noise isn't particularly complicated. It's just a math function that gives you smooth waves
ull get all sorts of generation
If you want more than just simple perlin noise, you have to generate other types of noise that you can stack on top of one another
It's less about the function and more about implementing it in a way that fits my needs ya know
will check, thanks mane
you don't implement it in any other way than it is described
you just tweak the params to generate the type of noise you want
that said, what are you trying to do exactly, world generation?
of sorts... course generation for disc golf and I was thinking perlin noise looked nice for some y axis generation (hills and what have you)
doesn't sound too complicated, just slap a chunk generator and copy a perlin noise function that works with minecraft blocks and you're good?
Like I said, it's not a matter of implementing perlin noise differently. It's applying noise with different input parameters and laying them on top of one another
perlin noise has been implemented in MC before, probably the server itself has an impl even
I'll read more into it, I've only recently gotten the wfc impl to a point that looks decent so
https://adrianb.io/2014/08/09/perlinnoise.html is a good article on it and includes the octaves that I'm talking about
what does wfc mean
Bukkit has an implementation
wave function collapse
It's a procedural generation algorithm
(at least in the cases it's most used for)
In fact, Bukkit also has perlin octaves generator, https://hub.spigotmc.org/javadocs/spigot/org/bukkit/util/noise/PerlinOctaveGenerator.html
doesn't setting it to HIGHEST makes sense ? so it wont modify the event before other plugins like litebans
so if the player muted and I perform all the processing (like filtering viewers and formatting) then the message get cancelled it could negatively impact performance
This was one of the nicer gens
I mean, filtering like that isn't all that performance heavy anyway, but you're right
I think you're overcomplicating it
perlin noise + some custom structure placements for the holes and whatnot of the golf course should be good enough
Well
I'm surprised I never stumbled upon this class
I thought I had seen all bukkit had to offer yet, guess not
When you say custom I feel like you mean just pre designed maps (in the sense of obstacle placement) right?
My whole point for this generation stuff was to implement an entire randomized course generator in that the course tiles are randomized as well as the actual obstacles that are placed perhaps you get bored of the first 9 courses that are genned with the plugin or something, just generate some more ya know
I've probably been looking at too many game impls of world gen and would be better off turning this whole project into an actual game kek
I mean, there is no reason for the obstacles/hazards to be procedurally generated per se
Well there are constraints ofc
just have it be some kind of structure with modifiable params that make it distinct enough from each other
The tiles you see in that pic are fairway, obstacle, water, tee (start), and pin (end)
I feel this won't be "randomized" enough as it were
it will, that's how every generator in a game works
if you don't feel it is random enough, you just add another parameter
Yeah that's true
Also that pic isn't the best considering my tile sizes are 16x16
I was gonna try and do some blending of sorts
I mean, if you already got that working then it's probably best you continue with that, as you will have a harder time adapting your code now
I definitely think you are making your life harder with this though, lol
if anything, I'd recommend looking outside of minecraft for procedural generation tutorials, just game dev in general, will give you a better outlook on what it entails
afterwards you'll just have to figure out how to apply that knowledge to the constraints of chunk generators
Yeah that's fair enough, I will see what I can do with what I have and maybe rewrite it later
at least it's somewhat decent right now
Is there a readable way to store the state of a block in a YAML file?
Currently, I'm storing generator locations in the format world,120.50,120.0,-860.5, and each generator has an associated image (item frame). I need a method to store both the block's state and the location of the item frame in the YAML file. Should I directly store the block state, or i need to encode it, perhaps using Base64? Here’s what I have in the config:
Generators:
1:
Type: IRON
Location: -11,65,-12
Item-Frame: # THATS WHAT I AM TALKING ABOUT
Image: #iron.png
also can i just store the facing like NORTH, SOUTH, EAST, WEST.
or this is wont work ?
You can just store the facing
How can I work with images in item frames (not GIFs)? Is there a library or tool to simplify this ?
Hi
is there any kind of javadoc/documentation of the NMS remapping by spigot? I can't find much information on how things work in the latest versions like NPCs, ... I was still working on obfuscated mojang 1.17 last week 😅
There are no JD for obf or mojmapped NMS hosted publicly as it would be illegal
though just use citizens
I can host publicly
would like to have a word with you
I'll host it in russia so they can't do anything
smart
Until they trace it back to you
raydan yours includes parchment right?
Yup
parchment for sploon when?
Dw I'll pay with crypto and use a random yandex email
We'll need layered mappings I believe
hi, you can check : https://github.com/Xxathyx/MediaPlayer and http://54.38.185.225/mediaplayer/doc/
is there a way to use plugin message channels to check if a player is online by UUID?
doesnt really answer my question
do I need to use PlayerList to get names of all players
and then run UUIDOther on all of those player names
and then compare uuids?
Try GetServer and check the reply?
You can probably use OfflinePlayer#getName
I want to be able to support messaging a player from a server that the player has never joined
so offlineplayer wont return a name
at least thats how I interpret OfflinePlayer to work
it should do a server lookup, if it doesn't, use this GET https://sessionserver.mojang.com/session/minecraft/profile/<uuid>
I am creating a world then reload the server and when i am trying to get this world it returns null
I'd personally just create a plugin on the proxy to get this kind of information
you need to load the world each time the server is restarted
yeah I am atp
I'm thinking I should write some sort of system where I have like a NetworkPlayer object that stores uuid, name
and itll just get it from my velocity plugin when requested
that exists inside velocity itself
I honestly completely underestimated how much effort it would be to split my plugin in 3
instead of relying on bungeecord built-in channels, you can just make custom channels for any specific information that you may want
yeah I'm doing that now
but I don't want to create like a channel for name, uuid, and any other info like
what if I create my own object that will just be transferred through channels
I mean, you create a channel for the plugin in question, then subchannel for specific requests
sorry its hard to explain what I mean
I get what you mean, you just want to transfer the whole thing instead of requesting specific information each time
I'm basically just having to rewrite my message manager that handles replies and shit
and I created my own velocity plugin to handle sending messages by uuid
and now I'm having the issue where I display to the sender the player name of the reciever, however if theyre on a different server the only way I can think to get their name is to look it up from velocity
and theres just so many calls and the code is disgusting
Bukkit.createWorld ?
yes
ok
as long as the world exists, it'll just load it instead of creating a new one
weird but ok
it's because Bukkit doesn't manage any other worlds than the default ones
you need to save the worlds you loaded to a file, then load them up again on server startup or whenever you want
I can imagine if this is your first rodeo with IPC
ideally, you would have all this kind of information in a database, and just query the database itself instead
so like
that's usually how people go with this since it is easier than setting up a system to request information from a specific backend at a time
cache player name and uuid in a database when they join thru velocity
and then in plugin just query database
basically
whats the downsides
depending on the information you store, querying to the database won't be as immediate which ultimately leads to adding an instant access cache layer, and just have the database for persistence
that's often done with redis or some kind of pub/sub system as you've experienced
far out
there are other ways to go about that, but for information like this it should be fine to just query the database and have a local cache with caffeine
whats caffiene
a local cache library, it's the successor to Guava's cache basically
I see
honestly ur right I might give up on this plugin message shit for uuid and name
other way to go about it and that people seem to have an easier time with is just loading everything from database on server startup
