#help-development
1 messages · Page 1154 of 1
Making that kitten sad would be enough to make me run away and crime
don't fucking reload
exactly
after some investigation i found out that somehow, calling MineComboPlugin.getInstance() in the MilestonesSupport class still returns the old instance
is there a way i could fix that?
by not reloading
Reloading isn't suppoted :>
if I make MineComboPlugin.getInstance() return a static variable the old one is returned
Plugman will fail to unload static references
just don't reload ffs
that doesnt fix the problem
do not use anything static if you INSIST on using plugman
then how would i access the things i want from the other plugin?
Or just don't reload 👍
i tried using the ServiceProvider system but it falls into this same situation
yes it does
btw
There is no work around. Plugman/reload breaks on static reference. There is No fix
this is how i am detecting the enable and disable
Tf
why are you registering all your listeners manually
and just STOP RELOADING
it will solve ALL YOUR PROBLEMS
no
then glhf you're on your own
it will only make them not to happen
there is literally no fix
what in the fuck is that
everything is fixable
no it isn't
all it takes is time
okay make a custom jvm then or something
Brother that is some messed up code
Yes you can fix it. You have to clear the Classloader, which requires restarting Spigot
why are they not each there own JavaPlugin
bet they're gonna try doing it without restarting
lol
because restarting takes time !!! not my 20 seconds wasted
but muh cpu cycles
so they would rather spend hours on end trying to make working reloading when they could just
not
That moment when restarting takes 10 seconds 😭
it takes longer than that
I had a server that took 10 times longer to start lol
skill issue
But tbf it was a modded server
with the amount of things i end up commonly hooking or needing im forced to have about 6 plugins excluding my own
im forced to because thatgs what they work with
F
I think I confused people with this. I don't want it to be async. I just want to set sign data and then open it in ui right after
call the open in the next tick
i could technically make basic af plugins that replicate the features of them so they might be a bit lighter on starter
but i dont think i have the effort for that
where is this
On a inventory click event
How will this effect the server? Or is the delay client side?
Bukkit.getScheduler().runTaskLater(Homes.getPlugin(), () -> player.openSign(sign), 3);
It will effect the server by waiting 3 ticks to run that code
But it won't stop everything for 3 ticks right?
Everything meaning everything outside the plugin
No it won't it will schedule for thr task in 3 ticks
Which will throw it within a tick loop and then it will be run after 3 ticks
If you wish to pause the entire server use Thread.sleep
lag machines cannot beat the simplicity of Thread.sleep
my personal favourite is a ```java
while (true) {
new Thread(() -> {
while (true)
Thread.sleep(1000);
}
idk if thats valid java anymore
i use kotlin too much
as you should!
don't be a pussy
java is still better, and this is a fact, not an opinion
yes I said it, bite me
grr
Can you store a collection with PersistentDataType?
yes however you have to create the PDT yourself or use MorePersistentTypes or whatever the library was called
You can store anything if know how to count bytes
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
ultimately, any collection boils down to one or more array of elements
Is there not a jar to add an external library with?
Or do I just add the src files?
most people use a build system, get the jar from central if you dont
What is central?
maven central
We have list types now, actually

PersistentDataType.LIST.integers(), or PersistentDataType.LIST.listTypeFrom(PersistentDataType.WHATEVER)
because lynx is cool
As if I'd ever contribute to paper 
He's famously a never-Paper developer

I'm more of a cardboard guy myself, personally
sturdier 
You mean the Bukkit fabric hybrid?
Smh
Yes :)
I like the multithreaded ones better
my fav one was that japanese one
I can't remember the name now
is that what hygot aims to be
cartserver?
that's a hybrid, not a multithreaded one
why do mojang dont support server cores and plugins by company? Why do it have to do community?
🤔
they even nms obfuscate
They also provide mappings for us
Why else would they be called mojmaps
?nms
Spigot mappings were the community (md) provided ones
oh
Does md get some profit from spigot?
before mojmap were distributed, yarn was the most popular set of mappings
he makes money from Spigot yes, the better question is: is it enough? That I can't answer
I mean, it's a colossal job, and I cant see some obvious ways to get money
only from site
premium plugins, Spigot gets a cut from it, also sponsors and donations
I dont think thats enough
hey
😔
you'd be surprised
it is way less than before giving Paper probably takes the bull of it nowadays but should be enough
the 172.x ips are internal, right?
Spigot do not get a cut
If spigot got a cut spigot could be liable for any issues, the premium plugin purchase I'd entirely between thr buyer and seller
Can confirm. No cut
how does Spigot even run itself then, I was under the impression that was the business model
Ads and donations
How do md get profit?
I mean, it's a colossal work
And afaik md doesn't take anything
money laundering
And from spigot?
No
😔
probably just enough to maintain the SpigotMC infrastructure
He's a lawyer/solicitor
then again, no one forces them to do this job, so it is mostly out of passion I presume
"solicitor" 
He's lawyer?? Not a programmer?
Hes a pimp
He's both
you can be both things lol
He's multiperson?
he programs lawyers
LMAO
yes, md is multiple persons in one
He has bpd fr
mister slap
Robots or smth
Why no one speaks about md_5 he can be enstein 21 century
I Robot
Just thinking that he is working as a lawyer, and was one of the creators of Spigot makes me feel miserable
You are the dumbest smart person I know
im clown
why would that make you feel miserable
Some people just don't want to do programming full time and have other things they want to do
Because he's much smarter than I
That wasn’t directed at you mate it was because Emily referenced I robot lol
bro I would DIE to defend a criminal
oh
I mean
I was thinking more along the lines of "He's a stripper" but...
what
Yeah that too
it isn't about being smart, just dedication to see your projects through
Show me that slime
Every human has the ability to memorize information, use that to your advantage
Use them eyes to point ur hands into uploading husky photos
I can't make me reading literature, im procrastinating and understand it
technically everything is literature to an extent
Well, I have to read literature medieval
go to psychologist and tell them you have troubles concentrating, they can tech you techniques to help you stay focused, goes a long way
It's just another thing that I will procrastinate
procrastination is a shit
or they will just prescribe something and send you on your way lmao
Yes it is
that or they derive you to a psychiatrist for ADHD meds kek
may God help us 🙏
The thing is that I should read this literature not in my native language
basically this lol. Forgot pyschologists don't prescribe only diagnose
and it makes it worse
in germany its medical weed
Zombified piglin on latest
this is confusing me
Medical weed isnt the same as adhd meds. And for those that dont know most adhd meds are based on the same chemical structure as meth lol
thx
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
How do you get uuid? I want to do if (uuid == "32hf")
From the spigot server? Check if there are players on your server, if there are none you could try to ping it
Player#getUniqueId
how do i ping it? sorry im so new to plugin messager
Plugin messenger only works when there are players on your server. If you have players, you know that it's up because otherwise they couldn't join at all
To ping, you can use something like this https://github.com/lucaazalim/minecraft-server-ping
thanks to you both
Anyone know of a clean way to increase player movement speed in lava?
Could have sworn there was a swimming speed attribute
Oh there is
Movement efficiency they call it
Oh, wait, no nevermind
water_movement_efficiency in 1.21.2
No lava_movement_efficiency though
Where is lava movement speed actually calculated?
what does "actually" mean
you are asking like literally what that means or what Grogy meant?
Give them speed 3 million
probably on the client
Unfortunately speed doesn't work in lava lol
F
how can i cast ServerPlayer to Player?
you cannot cast an nms class to a bukkit class
iirc there's getBukkitEntity method on there but not sure
Yeah there is that method
Are BungeeCord servers (or just proxy servers in general) started with ROOT perms?
never fucking do that
It's not that bad
As far as I know, placeholderapi supports it as %rank% but essentialsx supports it as {Rank}, so what should we do about this?
Essentials {}
Placeholderapi %%
🤔
People make it seem worse than it is
Or am I wrong?
I am trying to show Rank in essentialsx chat format from my own plugin via placeholderapi
why would you say that
if a plugin gets compromised/exploited, the whole server is at risk with root perms, instead of just the minecraft stuff
even if you were right, which you aren't, that's making light of a security flag, wonder how that's going to help anyone
if its "your own plugin" then dont use essentialsx, make your own chat format plugin
ess should support % tho
chat formatting is about 5 lines of code
The only reason to run something with root permissions is if it installs/manages something in directories you need to have root access to read/write (or similar situations, but most commonly it's installers)
Otherwise, you should pretty much always run it with normal user permissions, some people also like to isolate their minecraft and bungeecord servers in docker containers
I already have one, if I'm trying to use essentialsx there's a reason :/
?paste
https://paste.md-5.net/sowafococu.java
the simplest
If you already have a chat format plugin then you don’t need essentials chat. Essentials uses a low priority so your own plugins override it
Okay then let's do it like that
How to use priorities?
(priority = x) next to @EventHandler
Don’t need it unless another plugin is conflicting with yours. Essentials is the lowest so any other plugin will override its commands.
@EventHandler(priority = EventPriority.HIGHEST) would be a example tho
Thanks, yeah i understood, I just want to know in order to improve my code
but how do you know if another plugin will conflict with yours in the first place
ideally you would wanna prevent that instead of patch it after the fact
You don’t want to set it if you don’t need it, if you use public plugins rather than all your own. Your highest priority event could disrupt an anti grief plugin.
alright, I feel like thats a better answer, thanks
Sure but you’re right how would you know if it will conflict. You’ll have to run the code and find out.
Hello, could someone help me? I have a code that works like this:
A player have a tool with custom enchants (Like money booster or essence booster) and you can toggle if you want the autosell mode or not. So sometimes when you are using the autosell (Which displays how much money you got every minute) it says that you have won a crazy high amount of money... It only happens with the money as you can see in the image I sent. (Dinero conseguido = money obtained) Sorry if the code is a bit long but had to do it that way. I cant find what's wrong there.
I would make debug but don't know how to replicate this bug.
The method calculateAutoSellDrops is which manages the amount of money, but inside have onother methods that boost money such as calculateBoostersAdder or CalculateBoostersValue.
I saw some plugins having the capability to execute root commands
So I asked
Has any1 else had problems with loading Multiverse api using maven? I'm following along their github usage guide for including the project but it cant find the jar file in their repo.
<dependency>
<groupId>com.onarandombox.multiversecore</groupId> <!-- Don't forget to replace this -->
<artifactId>Multiverse-Core</artifactId> <!-- Replace this as well -->
<version>4.3.1</version> <!-- This too -->
<scope>provided</scope>
</dependency>
com.onarandombox.multiversecore:Multiverse-Core:jar:4.3.1 was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
I'm trying to spawn a BlockDisplay like in this command in my plugin:
/summon block_display ~ ~ ~ {Passengers:[{id:"minecraft:block_display",block_state:{Name:"minecraft:acacia_planks",Properties:{}},transformation:[1f,0f,0f,-0.5f,0f,1f,0f,-0.5f,0f,0f,1f,-0.5f,0f,0f,0f,1f]}]}
so it'll be centered (like it should be).
I discovered I need to use setTransformation() but I have no idea how to use it. please help thanks
Have you also added the repository?
Yes.
Send throuh your whole pom
<repository>
<id>OnARandomBox</id>
<url>https://repo.onarandombox.com/content/groups/public/</url>
</repository>
?paste
Though, the error shows that its searching the spigot repo
Not the Multiverse's repo
Dont know why is that
try forcing the update
Wdym by that
How can I do that
Depends on the IDE
Ctrl + Ctrl (Run Anything) then write maven package -U in IJ
The POM for com.onarandombox.multiversecore:Multiverse-Core:jar:4.3.1 is missing, no dependency information available
Shiit wait
I think i fixed it
yeah
changed version to 4.3.0
But he had 4.3.1 in his example in github and I checked the latest version was also 4.3.1 in spigot version history
So I just used 4.3.1
My bad
4.3.1 does exist
is it in the maven repo
yes
publication seems to be fucked up, they have like 5 different multiverse-cores all with different capitalization lol
How do I make the world not render to specific players?
The whole world
ye I misread
Why do you need that ?
Do you still need them to be able to walk and interact with the world ?
@dawn flower You could theoretically send them a resourcepack with shaders that would just... not render anything.
Without a resource pack
Yeah
I want to completly blind them. That's the closest I could think of
Horrible idea but
Create 6 text display entities, with one character, a black square
Position them around the center of the player viewpoint, move it with the player.
Player will see literally nothing but the UI like that.
Maybe someone has better idea :D
I tried exactly that
lmao, how did that work ?
But it wouldn't work properly
Why
For some reason, they don't want to get properly aligned
Well then you're doing something wrong
Maybe
can you elaborate on "properly align" ?
You should be able to use the transform to rotate and offset it and have it set to uhhh some render mode
It was a mess, not close to a square (I made them ride the player)
Even though theoratically it should've formed a square around the player's head
I'm pretty much 100% sure you can do this
Maybe try the display entity studio or whatever, grab the transformation values from there ?
I'll try
Yeah I did it again and it's not aligned at all
This is how it looks in the studio and ingame
Can you send the uhh commands ?
interesting
Let me try
/summon text_display ~ ~1.5 ~ {transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,-1f,-0.2f],scale:[20f,10f,1f]},text:'" "',background:-16777216,billboard:"center"}
This works lul
Only one text entity required
I don't think the studio is happy with text display entities.
@dawn flower
Creates big black ugly screen right in front of the player
The player just sees black
If you rotate 180 degrees you don't see it
Yes you do
It is translated -0.2 in z, so in front of the player.
it also rotates around its center, which is positioned in the players head
Did you make it ride the player?
I just did one command and commands can't make it ride a player
You gotta edit it yourself for riding a player
You're welcome
Entity#setVisibleByDefault and Player#showEntity
Does setVisibleByDefault hide it from new players that join?
Do you need packets to make an entity glow for one player only
setVisibleByDefault ?
since when is that a thing
like 1.19 or so
yes
is there any convenient way to make certain players invisible in tab
to all players
and show them again
without iterating through all players with hidePlayer
i mean, hidePlayer will not only hide from tab, but also from the world if they're near
i wonder if setVisibleByDefault works properly on Players
I remember someone complaining that setInvisible would just make the entity invisible (which I assume is setting the datawatcher flag) but setVisibleByDefault doing the same as hideEntity which basically destroys the entity from the client-side yesterday
I send an arm animation packet first
and only then I send the keep alive
so why
does the client always somehow reply to the keep alive first?
wtf
keep alive is faster to process, so you get the response faster, I guess
...
the client uses 1 netty thread for that
it doesn't make sense
no race conditions is possibly taking place
100% of the time
the keep alive response is sent first
like I make the player swing his own hand
maybe that slows him down?
my guess is the arm swing is probably pushed to the main thread but the keep-alive isn't
so he sends that he swung his hand
bruh
btw, except keep alives and the arm swing
are there any more packets the client needs to respond to?
as a way to measure ping by myself
ping packet
but like, none of that is gonna be reliable
the client can send any packets at any time if it wants to, artificially delay responses etc
not the vanilla client of course
yeah I know
but if he reacts to some packets quicker than to the ones meant to measure ping
get that boi
I mean, that shouldn't happen since ping packet is the simplest form of a packet there is
is there any quick way to check what version packets like this were added?
ping packet has been a thing forever
welcome to hacked clients
asking for the future
wiki.vg has a version history changelog, it is not very complete in terms of detail but works for getting a general idea of what the changes were in the protocol
where's the history changelog?
check revisions on wvg/Protocol
yup
https://wiki.vg/Protocol_version_numbers has a table with links
but you can compare with that one so I guess it is more useful
wiki.vg used to be way more complete, nowadays it doesn't document the semantics around the packets as much
Hello everyone, can I ask about NMS here please ?
I have a performance problem with something I can't tell, and I don't know where I should search for information 😦 (screenshot)
Just a reminder that 3 hours of debugging can save you 15 minutes of reading documentation
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
Thank you 🙏
How did you end up with fabric intermediary
Fairly certain spark just does that
Unless they're running some weird fork like cardboard
Isn't it more of a reimpl than a fork tho
Yeah ig
But I believe I have seen spark with unmapped names? Might be false memories or something
doesn't spark have an option for mappings
why would you do that
well uh
it looks nice
that does not explain anything
think harder, not smarter
Yeah but it only maps into named, not intermediary or unnamed I believe
still does not explain anything
just explain WHY you're allocating manually
cuz it's way more optimized compared to storing it not within bytebufs
answer my question and not something completely different with no context lmao
just explain WHY you're allocating manually
cuz it's way more optimized compared to storing it not within bytebufs
where are you even allocating manually then
wdym where
is allocating like 100x60KB a lot?
bypassed
the server would need to manage roughly that amount of data
yeah I know
screenshot => api request to openai
and tell me, what do you need to take a screenshot?
to get the capacha as a pic
so you'd need to create the 3d graphics for that, correct?
i mean
there's lots of ways to
like?
no its just to bypass it nothing to help you sorry
os apis, display apis
well I check for whether the player has a valid protocol like a normal player would
and then I also ask for captcha
which requires 3 things normal botters don't have
?
if you want to bot that server just use MC inbuilt screenshot function ig
con why the reaction
brother
and what do you think needs to be on that screen?
mc?
yes
brother you lowkey doing that capacha in minecraft
?
text capacha is easily bypassable using simple ai
(if you were to host a bot attack)
capacha
this is a 3d text captcha
yeah still
u know there's something called garbage collecting
wdym?
why would i care about that? just make a screenshot, send it to openai and off you go
i doubt all those 100 players join at the exact same time triggering the allocation to happen in a spike
brah, y'all really have no idea what I'm trying to have you think of
i mean it'll still only be 600mb which get gc'ed eventually
which might make it easier for bots to read
clearly it does
I'm talking about the opposite side here
brah
average cracked server
nah no way
?
Do you want to protect your server with capacha?
pretty tired when ppl have no idea about what you're trying to say
why do you keep saying capacha
then explain what you're tryna say ffs
how you call it then
You're not explaining ANYTHING
thus stfu all of you for a sec
it's captcha
If you were to host a bot attack
you'd want the server to suffer signifcant performance issues
not the other way around
thus you implement every single one of your bots with minimal protocol
so no 3d generation is taking place
yeah hate to break it this isnt much performance cost
if you wanted to simulate N amount of 3d graphics
you'd need a lot of cpu
dedicated servers for that
bro youre server is creating the captcha not the client
thus making the attacker need to spend a lot resources
so your just putting load on the server
more than the server would
another thing
is that the protocol in botters isn't usually complete
so checking for specific patterns (like replying to only certain packets)
makes it easier to differentiate
if you got a good enough bot software it just spoofs them
another thing is that there'd need to be people willing
to write whole botting programs
wich again isnt realy costing in terms of memory
i mean azalea is somewhat complete and easy to use...
to actually bypass your very specific captcha
bro is making cloudflare turnstile
is that a botter?
all you need to do is take a screenshot and parse it to chatgpt
then get the response and send that in chat
yeah, I ain't speaking with someone who isn't even willing to listen
then do it
come one
make a botter that'll bypass my antibot
come on
it's so easy isn't it?
yeah it is
then do it
I'll be waiting
I'll ping you in a week to ask for the progress
me when somebody tells me to do it without having an actual server
😭
you better keep your word
shadow im sure that captcha will stop some players
but its obviously not that difficult to bypass
i think thats what they were alluding at
well my antibot uses pretty much every single concept all better and lesser known antibots use (to determine protocol correctness)
and additionally replaces the captcha with a 3d text instead of a map captcha
the capuchin kinda cool tho
Goals
- Do everything a vanilla client can do.
[...]- Don't trigger anticheats.
brother im gonna send you a snippet to do the screen and one that sends and handles the ai part I am not spending hours doing the whole other part since idk about you but I got a personal life
👍
like
I've been searching for so long
on how to make a captcha your average philb would understand
and yet the bots wouldn't have the slightest clue on how to do it
and when I get an idea for this
I always remind myself of this
i mean it's really not that hard
you only need a way to find out where all the armour stands are, which is obviously easy asf, or take a screenshot
and you need openai keys ig
slide the puzzle until it fits in the image
?
brother please
read first
then reply
helps
i have. it's really not worth arguing with you tho, as you're proving again
how do i get the object of a block (i need ancient debris), like im trying to check if the block in the blockbreakevent is ancient debris (yes i know i can do event.getBlock().getBlockData().getAsString() == "minecraft:ancient_debris", but that doesnt feel like the right way to do it)
@grim hound
event.getBlock().getType() == Material.ANCIENT_DEBRIS

whats the import for Material? my ide for some reason cant autofill it
and org.bukkit.Material isnt working
update intellij
^
yea thats a good idea im still using 2023
and btw @grim hound I hate to make rads opinion count but in this case it does
crazy
I mean he's a good guy
real
to this i meant
Like this is a full sentence
That ends here
And he just didn't see it
@peak depot you on the other hand
Well
Um
To not say the R word
There's a command neither spigot nor paper likes that sounds similar to what I'd call you
i did see it and read it
Then what did you mean here?
@grim hound
I mean, reversing a tilted giant 3d text into 2d image requires math I have no clue about
It should stop many people
for (LivingEntity entity : entities) {
byte bitmask = 0;
bitmask |= (byte) (entity.getFireTicks() == 0 ? 0x01 : 0x0);
bitmask |= (byte) (entity.isSneaking() ? 0x02 : 0x0);
bitmask |= (byte) ((entity instanceof Player && ((Player) entity).isSprinting()) ? 0x08 : 0x00);
bitmask |= (byte) (entity.isSwimming() ? 0x10 : 0x0);
bitmask |= (byte) (entity.isInvisible() ? 0x20 : 0x0);
bitmask |= (byte) (!stop ? 0x40 : 0x0);
bitmask |= (byte) (entity.isGliding() ? 0x80 : 0x0);
List<WrappedDataValue> dataValues = new ArrayList<>();
dataValues.add(new WrappedDataValue(0, WrappedDataWatcher.Registry.get(Byte.class), bitmask));
packet.getDataValueCollectionModifier().write(0, dataValues);
for (Player player : players) {
manager.sendServerPacket(player, packet);
}
}```
No errors, stop is false but doesn't make the entity glow
Where do you set the glow value?
bitmask |= (byte) (!stop ? 0x40 : 0x0);
how should i go about saving data between launches?
Should really make some constants for those magic values
They mean absolutely nothing to the reader
yea i took some example code for custom configs files thanks
I know this is a dumb question, but how do I get the namespace for a plugin (the name that all of its namespacedkeys are stored under)?
key.getNamespace() ?
should just be its name
getName().toLowerCase(Locale.ROOT) prob
yeah, but what is a plugin's name
like where is ti defined
in the plugin.yml
Plugin#getName() in shambles
When sending block changes to a player I assume ray tracing for collision checks would not work on these blocks?
Spoofed client-side changes will not be reflected server-side, yes
Wouldn't think so
Is there a way to use datapack functions with code instead of using console commands?
no
I am asking for help when I made the npc puvodni and then the iaentity Citizens model on the npc. And he sees ten npc with a model. And then when I restart the server or turn it off and then turn it on and the npc model with ia and disappears. I don't see why for a reason? https://ibb.co/74b0B1y
And please message
don't crosspost
How do I make the text display's rendering priority higher than blocks whilst not rendering mobs? Basically if you set "see through" to true it renders on top of blocks but renders entities behind it
Now it doesn't, huh?
this really isn't anything you can control, rendering is client sided
I could've sworn I could see mobs behind it if it was see through
you could maybe attempt something with a large amount of packet manipulation, but even then you can't actually change the render order you can just lie to the client on a mass scale to attempt to define a rendering order
Well can I make mobs behind it render
Ok now I can see the mobs behind it
This is so confusing
Yo guys I'm currently developing my first plugin and it's a medium sized one, anyone that could talk 1 on 1 with me in vc and give me some pointers?
You can ask your questions here
or if you want feedback you can ask in #1100941063058894868
Bro the text display's see through is so bugged
I'm developing a plugin where each player has their own world with a worldborder that goes 64x64 blocks. I already know how to create the world (its a void world actually) but idk how to load it without blocking the main thread, since rn when I'm loading the world everything stops working for a few seconds. It might be that cuz I'm doing this on my localhost server which is pretty small, but not sure.
Maybe I could load just like 5x5 chunks and not the whole world
WorldCreator worldCreator = new WorldCreator(p.getName() + "_course" + (amount + 1)).type(WorldType.FLAT).generatorSettings("{\"layers\": [{\"block\": \"air\", \"height\": 1}], \"biome\":\"plains\"}")
.generateStructures(false);
World voidWorld = worldCreator.createWorld();
voidWorld.getWorldBorder().setCenter(0, 0);
voidWorld.getWorldBorder().setSize(64);
Location spawnLoc = new Location(voidWorld, 0, 64, 0);
voidWorld.getBlockAt(spawnLoc).setType(Material.DIRT);
p.teleport(spawnLoc.add(0, 1, 0));
ChunkGenerator and getFixedSpawnLocation if I good remember
You can't not block the main thread but if you use a fixed spawn location and turn spawn chunks off it'll be faster
My suggestion, use the same world give each player their own border within that one world
How could I turn spawn chunks off
Wdym by that
What does it do
WorldCreator#setkeepSpawnInMemory iirc
So that wont load the spawn chunks?
If i set it to false
So when I'll initially create the world it will cause less lag, and only when a player joins the world is when it loads the chunks right?
Yes
The thing is im running world#createWorld() in order to get the World variable
Oh you can do it with worldcreator too>?
Why not use math and just spread out the players in one world though
I cant give each player a world border
I could use barriers though
I'll think about it when all else fails
Yeah Player#setWorldBorder is great
How could I set a fixed spawn location with WorldCreator doe?
You need to set it on every login but it's still great
Custom ChunkGenerator
I will try it for sure but I'm just asking, would it make everything noticeably faster or just barely a bit?
When it comes to world creation
And the main thread
It takes about 5ms to load a world with a fixed spawn location and spawn chunks disabled
Gotchu.
WorldCreator worldCreator = new WorldCreator(p.getName() + "_course" + (amount + 1)).type(WorldType.FLAT).generatorSettings("{\"layers\": [{\"block\": \"air\", \"height\": 1}], \"biome\":\"plains\"}")
.generateStructures(false);
worldCreator.generator(new VoidWorldChunkGenerator());
worldCreator.keepSpawnInMemory(false);
World voidWorld = worldCreator.createWorld();
Location spawnLoc = new Location(voidWorld, 0, 64, 0);
voidWorld.getWorldBorder().setCenter(0, 0);
voidWorld.getWorldBorder().setSize(64);
voidWorld.getBlockAt(spawnLoc).setType(Material.DIRT);
//p.teleport(spawnLoc.add(0, 1, 0));
It still seems to take about 5 seconds
or like 3-4
You are setting a block in it
That’s gonna force chunk loading
Also show the chunk generator class
Just setting the spawn location:
public class VoidWorldChunkGenerator extends ChunkGenerator {
@Override
public Location getFixedSpawnLocation(World world, Random random) {;
return new Location(world, 0, 64, 0);
}
}
Yeah then it’s the block setting
Yep, that was fast lol
Under a second
@young knoll thanks bro.
I'm just wondering does spigot by default just load all the chunks in the world during world creation, and when you do the trick I did, you just load all the chunks yourself when you get close enough?
It loads the spawn chunks
But it must be a lot of chunks then?
It’s a decent amount
Gotchu, well certainly enough to cause a 3 second wait
Looks like that event is cancellable no?
It has a getBlocks method which I guess you could iterate over and check for the materials of the portal
i used the deprecated one entityportalcreateevent
Why would you do that?
idk
declaration: package: org.bukkit.event.world, class: PortalCreateEvent
that sounds like a problem for #help-server
Lets say I want to make a cosmetics mod that allows the user to wear a 3d model like glasses using a command
How do I attach the model (like you would by putting a helmet on) without actually taking up that inventory slot?
Have an entity riding as passenger
The thing with this is the player can see it on their screen if it blocks the camera
so change the model
What
its a model with custom model data
Yeah
if it collides with the eyes where it is sat on a passenger, so change the model location
i dont think many helmets collide with the eyes
The helmet is litearlly on your entire head wdym
its not a brick your eyes are out
or you can just add clear textures to the inside of it
you can add a texture to the inside and it makes the whole thing clear from that side afaik
Yeah I don't want the glasses to be covering the players vision
They are just a cosmetic
hey if i do new MyClassName("Hii") in my testClass, then i do some method that modifies some this.variable, if i do new MyClassName("Hii") in a different class, and i do something to get this.variable, will i get the same as i did with testClass?
Like if i give same parameters and that
Each instance has its own copy of all non-static variables
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
ty
how do i add prefixes and suffixes in player names to show up in tab?
with a tab plugin
do I have to use nms if I want to do it myself
Since you can't save an ItemStack to PersistentData, and Minecraft removed item IDs, how do I load a ItemStack from a string name?
Unless there is a better way instead of string
Base64 it no?
Ohhh that's helpful thank you but I meant Material
I don't need the whole ItemStack
I'm sure there is a easier way to get just the Material?
Use material.name()
Oh yeah, a white wool now it's just WHITE_WOOL, before it was a WOOL with 0 data.
To get material from string, use Material.matchMaterial
And Material.getMaterial
or that one
Perfect, exactly what I needed
No
You can set their tablist name
Or use teams
is there a way to get net.minecraft.world.item.ItemStack by org.bukkit.inventory.ItemStack?
CraftItemStack#asNMSCopy
but what are you trying to do
sending throught nms
When I want to run a async task on BungeeCord but repeating. Should I create a repeating task and then call runAsync in that task to run code async or is just creating a repeating task enough?
runTaskTimerAsync()?
idk if its the same on bungeecord or not
No such thing on BungeeCord.
does bungeecord use the bukkitscheduler, or no?
it probably uses some other scheduler, since its not bukkit
Yeah
Nvm I found my answer. Schedule is async. I should've read the javadocs 🤦♂️
Whats the usual way of modifying persistent data containers? I'm currently just getting the pdc, changing variables around and setting it again.
But the thing is, once I do that it somehow breaks it, I can't get it anymore from other parts of my code, deserialization fails.
Ill provide the code
?paste
Nullpointer on line 69: https://paste.md-5.net/dezihateyo.cpp
PlayerCourse.class https://paste.md-5.net/sopeyejape.java
Here im setting the new spawnpoint by resetting persistent data container: https://paste.md-5.net/vumenajemo.java
And this also produces the error on line 33: https://paste.md-5.net/ixofitabok.java
This is the error: https://paste.md-5.net/ecenogecer.cs
This is quite a bit of code but if anyone could take a look at it and help me out i'd be grateful asf
Basically the issue seems to be that after modifying the PDC with a command, it somehow fks it up and when I try to get the pdc after that it just produces an error
is there a way to set the number in tablist to health dynamically so it updates automatically or do I have to update it every time a player takes damage
through scoreboard shit
Doing automatically is possible
any guides or like code examples?
Use the Health criteria
I got it so it shows icons of hearts but i dont know how to make it show numbers
There's a rendertype property for objectives
You should be able to set it to something and display numbers instead of icons
(Not sure if the API has this tho)
It does
private static void showTablistHealth(Player playerViewing, Player player) {
Objective objective = playerViewing.getScoreboard().getObjective(DisplaySlot.PLAYER_LIST);
if (objective == null)
objective = playerViewing.getScoreboard().registerNewObjective("playerlist", "health");
objective.setDisplaySlot(DisplaySlot.PLAYER_LIST);
objective.setDisplayName(ChatColor.YELLOW.toString());
objective.getScore(player.getName()).setScore((int) player.getHealth());
player.setHealth(player.getHealth());
}```
this is what I have
I found something
EnumScoreboardHealthDisplay.INTEGER
looks like I need to use nms I think
I'm on 1.8.8 and dont see the property
._.
sorry for not specifying earlier
I yearn for the day 1.8 fucking dies
I can't believe some ppl are still stuck in 9+ years old version
what's your problem with it?
It's 9 years old and people still expect support
Basically that
Well, then somebody else will help, it's an open channel, not just for the spigot staff
Objective health = scoreboard.registerNewObjective("health", "dummy");
health.getScore(player.getName()).setScore(player.getHealth());
health.setDisplaySlot(DisplaySlot.PLAYER_LIST);```
That would require manually updating it
ive got this far
public static void showTablistHealth(Player playerViewing, Player player) {
Objective objective = playerViewing.getScoreboard().getObjective(DisplaySlot.PLAYER_LIST);
if (objective == null) {
objective = playerViewing.getScoreboard().registerNewObjective("playerlist", "health");
CraftScoreboard craftScoreboard = (CraftScoreboard) playerViewing.getScoreboard();
// get field final net.minecraft.server.v1_8_R3.Scoreboard board;
net.minecraft.server.v1_8_R3.Scoreboard nmsScoreboard = craftScoreboard.getHandle();
// run method "a" to change the display type
nmsScoreboard.getObjective("playerlist").a(IScoreboardCriteria.EnumScoreboardHealthDisplay.INTEGER);
}
objective.setDisplayName(ChatColor.YELLOW.toString());
objective.getScore(player.getName()).setScore((int) player.getHealth());
}```
except it just doesn't change to health
when running the method a should run handleObjectiveChanged and then
super.handleObjectiveChanged(scoreboardobjective);
if (this.b.contains(scoreboardobjective)) {
this.sendAll(new PacketPlayOutScoreboardObjective(scoreboardobjective, 2));
}
this.b();```
I hope Mojang makes JE latest version only as well
No
@orchid gazelle look at this fool
Meh I actually disagree there
That'd fuck servers so hard
true, 1.12.2 is still the best version
everything above 1.12.2 is garbage
Mojang should make JE 1.12.2 only
Whether we go back in time or forwards, we’ll still be asking for component support
just mod it in?
too lazy
might as well just use the latest version
there is no actual difference other than small stuff
which is only qol improvements
so no reason to keep sticking to a 7 year old version
it is just 100x better
?1.12 when
garbage game-destructing features, all mods got garbage
okay old man
Cafebabe should interrupt with an ?1.8 or a ?1.12 considering anyone mentions a Minecraft version number
well I'm not pinging the devs 💀
hypixel is 1.22
not yet
hypixel is 2.7.10
frfr
hypixel is 1.hype
Hypixel has actually surpassed a need for versioning
They are just hypixel at this point
Hygot
dont they have their own server implementation at this point?
It’s hygote but the e is silent
aka the thing paper will do soon™
they did what paper could only dream of
pixe
I am so fucking close
its showing up on tablist but didnt update when I ate a golden apple
Objective objective = playerViewing.getScoreboard().getObjective(DisplaySlot.PLAYER_LIST);
CraftScoreboard craftScoreboard = (CraftScoreboard) playerViewing.getScoreboard();
net.minecraft.server.v1_8_R3.Scoreboard nmsScoreboard = craftScoreboard.getHandle();
if (objective == null) {
System.out.println("Registering objective");
nmsScoreboard.registerObjective("tabhealth", new ScoreboardCriteriaInteger("health", EnumChatFormat.YELLOW));
}
objective = playerViewing.getScoreboard().getObjective("tabhealth");
objective.setDisplaySlot(DisplaySlot.PLAYER_LIST);
objective.setDisplayName(ChatColor.YELLOW.toString());
objective.getScore(player.getName()).setScore((int) player.getHealth());
player.setHealth(player.getHealth());```
this shows on tablist
shows 20 in yellow
but doesnt update when I eat
when you eat?
any help would be appreciated
is it possible to make normal world to hardcore world using plugin?
Me saying this with malicious intent
just do some situps and build a hard core yourself
That was a good one
my core is hard /giggidy
you die - you are spectator
there is no gamerule like that
normal hardcore does not do that either
how?
Normal hardcore means you die - you become spectator
normal hardcore does not let you respawn
Well, yes
So it's possible to change world from normal to hardcore?
yes, gamerule
unless this is out of date https://feedback.minecraft.net/hc/en-us/community/posts/24287009192589--gamerule-hardcore
ah its a suggestion
I see
Well it's not approved
it's just a request
lol fr, I didn't see that
wild
why kotlin looks like if typescript and java have a child
type system is almost 1:1 to TS, not sure which copied whom
lol kotlin's type system is nothing compared to typescript's
prove
kotlin doesn't even have union types or type literals, conditional types
variable type declaration is almost the same you use the same syntax, even optionals are defined in the same fashion
what i meant is not a type system but more like a type syntax
TS's type system is turning complete, you can't do that with kotlin
scala's type system is far more similar
oh, sure
kt
val foo: String
ts
const foo: string
kt
val foo: String?
ts
const foo: string?
you can have a const in kotlin
also function declaration types are also kinda similar you have dynamic function types like in typescript, you dont need to define it as a SAM interface (Runnable, Consumer, BiConsumer)
instead you can just write declaration type you really expect and not what are predefined and are imported
uhhhh
you might wanna review your typescript
you can only do foo?: string in parameters, and you can't do string?, you need to specify string | undefined
yeah ik, i was just too lazy to initialize the variables
yea you're right ? is not allowed in declarations, only in object properties or function parameters
type SlotStrings<Tuple extends readonly [...unknown[]]> = {
[Index in keyof Tuple]: Tuple[Index] extends string ? string : never;
};
:p
this is the most complex types i've written in TS
i dont even remember how this shit works anymore lol
bunch of type mapping which is barely readable
i remember i've wanted to make that you can only input known object property keys in such recursive types
but the type gotten so complex that ts just threw the error that it too expensive to compute
yeah no i think i'm good what the fuck
yeah inferring type would work better:
type SlotStrings<Tuple extends readonly [...unknown[]]> = {
[Index in keyof Tuple]: Tuple[Index] extends infer Element & string ? Element : never;
};
that way you would preserve string literals
imma go with
in this
Yo what's up plugin nation
For the last few weeks I've been cooking up a plugin that I'm very passionate about. Within my plugin I have a few GUIs where the user can change settings and stuff, and I have material placeholders for the items you click within the GUI like you see everywhere else.
For example a "return" button is often an arrow or feather, an "exit" button is often a barrier block. You often see this on popular servers.
I would really like to make my plugin look super clean. So I was thinking about having a custom resource pack that comes along with my plugin to change some of the textures of stuff in my GUI.
My question is: would that make sense to do?
Obviously it makes the GUIs look neater, but it comes at a "cost" to of the server having to use my custom resource pack. Do other plugins also do this, or is shipping a resource pack alongside a plugin atypical?
you can make the resource pack optional
i myself like custom resource packs, especially with something like slimefun
it makes the plugins so immersive
I thought there was some plugin that let you customize gui placeholder items like borders and stuff
I thought it was itemsadder or something
Yeah good idea. I'll definitely do that.
The slimefun comparison is perfect!
Exactly how I'd want it to work, if you like the plugin you download the resourcepack to make it more immersive
Does it allow you to make custom textures?
Just to be clear I'm not asking how to make items with custom names, lore, tags etc.
Rather I'm asking how to replace a barrier block for example with a custom red X texture
No I get that, I just thought I did a commission for someone who didn’t need any fancy ui layouts since they were able to just edit it themselves through another plugin, if I had to guess yes it allows custom textures (probably just a plug and play url kinda thing)
could be ia or oraxen
or the other hundreds that exist
packed promo!?!?!
are we able to put olivers mom in one
nah client would crash
you'd effectively just be ddossing yourself
hey, can someone have a look, why its not working?
i guess there is problem getting the last damager?
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Also, nice arrow. Might wanna look into guard clauses.
Sorry, i made few changes, will send it here and tell exactly what i want
Player is beeing teleported when hit Y level - lets say 0, i have it in config, but i cant get the lasdamager
i was trying to use hashmap to put inside it lastdamager and damaged player, after teleport remove the damaged player
i have this hashmap: private final Map<UUID, UUID> killerMap = new HashMap<>();
i'm trying to call "public GameState getState()" from other class, but it results in null, first image is code from class that is called "GameManager" and other are from class that is called "ProtectionListeners" and that class is where i'm trying to get it to, i have set InventoryClickEvent for now just to get the value in there...
what i'm doing wrong?
Not enough information
How do you get your gameManager instance? Where does state/gameManager get initialized/set?
i'm getting it from the other class - gameManager.getState()
and gameManager is currently set in same class where is the "base" (image)
and it is perfectly functional in same class, but when i try to get it in other class, the problem starts here
You're never assigning gameManager anywhere
I'm suprised it let you compile that
ooc: He can compile it because gameManager is not final ?
what do you mean?
i also forgot one class:
name is: "GameState.java"
yeah that's why
Your variable doesn't have a value
it is null
You need to give it one
it has, it is assigned for now by just moving
You are not assinging gameManager in that screenshot


