#help-development
1 messages · Page 1157 of 1
isn't it because it keeps a history of that to undo
just one undo
I specifically made sure to not keep a history for this one
Are you using we to place your rooms?
yeah because I am building it on top of the betterstructures stack
no he's using us
Blah
he is using your mom, thats why the memory is full
I just made my own schematic importing and placement system
that's a scam
is it
if you look at the type setting code without physics, it's pretty much identical
yup
because I am pasting via WE without physics and it's dreadfully slow
but that I can change easily
thing is I don't care about players
Does the game not automatically batch that?
they're not even going to be in the world until it's fully generated
I figured it would
if i could I'd just write the chunk files myself
pretty sure it does batch
You can write to the palette directly
i haven't found a batch solution
You’ll save the overhead of several function calls, but it won’t magically be 100x faster
I thought the datapalette trick could be done in async though
can you set blocks in async? that doesn't sound right
so wouldn't the datapalette be inherently much faster
I could just write my 100m blocks instantly and let the thread take care of it without blocking anything
That’s basically what the api does
I could be wrong but I am assuming here that if I do setblock 100m times in sync it will crash the server
Just with a few function calls
am I wrong?
I believe the api method calls the internal method in the chunk, which then calls the internal method in the palette
but I can't call setblock in async can I
same question
if I dump 100m operations in sync on a tick I am definitely going to crash it
right?
so even if the same methods are ultimately being called somewhere the fact I can't do it in async would kill it, unless I am mistaken and you can't modify datapalette in async (I've been told you can)
Try it I suppose
which part
Modifying the palette async
it sounds like it should work in async
if all the chunks are generated and preloaded before the async can do its magic
why not just do it as a chunk generator
chunk generators can be async and will be safe (and fast)
that is the best idea tho
yeah a chunk generator is the way to go
it'll probably require a lot of positional information
how do I tell a chunk generator to use the exact blocks I have there
how does mojang handle structures?
it might be worth looking into that
i think it's base land generation and then structures no?
how would this even work
i don't thnk it'll work for you because of conflicting modules
no idea how a world starts generating
the only way it could ever work is if I can feed the generator block by block bottom of the world to top of the world every single piece of info because this has to be pre-solved during generation
and then force generate select chunks with this data so I can cull it
pregenerate it and then just have the chunk generator "translate" from your pregeneration into the world?
pretty good idea actually
But doesn’t that just result in you doing it twice
Once to make the pregen and then once to translate it
not actually working with the blocks in first step
Since this is random you can’t just pregen a single world ahead of time
ayo, does anyone know a better way to revoke all advancements of a player without using a command or looping through progress
I assume looping through progress is how its done on the server side anyways, but jut making sure im not missing something easier
ok but how
do I get all the blocks in a chunk, somehow load them up into... something and then feed it to the generator and force load a chunk?
looks like a map generator to me
I recommend you select circuit-modified for the closest representation
the problem is when the collapsing fails it can shift what the solution ends up being
so it's not a linear generator
yeah I have the abstract pregen that handles this part of it
right so how do I do that second part
I have the block data for the entire map ready to load from the schematic modules
add a chunk generator that just reads your pregenerated solution
just override one of the generateX methods in ChunkGenerator and copy your pregenerated stuff into the chunkData argument
ok and how does this end up being faster than pasting it into the world the normal way, is chunkgenerator inherently async or something?
yes, and it will also not need to do any of the other tasks such as lighting updates used with a real world
gotcha, I'll give it a spin then
Could have sworn at first glance you wrote "Are you using we to place your mom?"
Thought that was really rude :(
too heavy, we couldnt do it (im joking)
if I want to load a world sequentially can I just modify my, say, structure override by loading it with specific data from a list and then manually load that chunk and move on to the next one?
Huh I wonder if I could handle my dungeon system that way
What do you use to store the pregenerated data
Is it just a list of (x, y, z, Block)
I can't realistically hold the full blocks
I can convert for each chunk every time but I can't just hold all of that data
Mmm
You could have a palette and hold the palette Id for the block
Heck the game technically already has a mapping for int -> block state
avoiding the palette is the whole point of this otherwise I could just use nms to write the entire thing in one go
Mmm yeah I don’t think the api exposes the block state map
You could make your own ig
when did bungee first launch?
why there no normal ass logger in java
I just want a separate logger that writes lines of text into a file
besides the main logger of the plugin
but all I can find is either some logger with .xml setup stuff or java's logger, which keeps making .lck and log.1, log.2 files to hell and back
slf4j, log4j
I just want to have a class that creates or appends to a singular file
I cant find any good example of those
you'd just use a log appender for that
they all use stupid xml setup scripts
do you have an example of that?
very odd question, but is there any instructions to compile spigot for 1.4.7?
i'm assuming the bukkit/craftbukkit submodules may have been screwed by the dmcas?
earliest is like 1.8
sadly seems to not have any verisons prior to 1.8
ah
well then you are out of luck
but 1.4.7 was so simple that you can probably write a server implementation in a weekend
I mean the downloads for it do exist
there was only like dirt
already spent way too much time trying to port beta 1.7.3's server to c++, going to take a break when it comes to projects like that
😅
lmao
fair
anyways does anyone have any examples of a simple logger that just logs some messages to a single specified file when I want
before I go out and just punch one together myself
simple things in the rest of the world seem to be convoluted in java land sadly
have u considered using a FileWriter at that point
yeah, can't seem to find the (exact) versions of craftbukkit/bukkit that i would prefer
disregard what i said above
👍
yeah thats what im about to do because everything else is just more complicated
it is now ur job to create the simple logger library

yeah
it has been like this for the past year
with the minecraft api's and java in general
stumble on some overcomplicated way to do something stupid
find out there are a billion existing libraries that are all overcomplicated
java is not made for me
atleast packetevents and placeholder are easy to use
but quite a few times its also just api that doesnt exist for some weird reason
so then you have to make a workaround
and everyone (including me) makes their own dumb ways of writing those workarounds
but I guess thats programming on API's in general
I don't know why you are relating this to java tbh
programming for a somewhat niche platform will always have its rough edges, but that is what makes is fun
yes you are right
im just being salty because my log folder is getting spammed by .lck files and new log files
with no actual way of turning it off
.lck files?
you only get stray .lck files when the process crashes with open file handles
that's what is confusing me, your server shouldn't be exiting that way lol
sigkill moment
So late
2:04 am
Soooooo late
well /reload does not give a fuck
I know /reload isnt supported
but its not what I want
but I have fixed the issue
by writing a class that writes text to a file
@pseudo hazel have you figured out how to write to a separate log file
because apparently you just had to add a file handler
that dont work
the file hander is what messes it up
I want to write to one file always
no matter what happened
so even if the server crashed, I want to keep writing to that file
but like I said I worked around it by just using a FileWriter
why did the file handler not work for you
well it created .lck files it wouldnt delete always
and for some forsaken reason it still made a new log file anyways
even if there was no .lck file
isn't this just a windows moment
probably
i've never had issues when i don't close my streams
(arch btw)
why is it creating lck files, how are you closing your server lol
i thought there was something something linux closing unclosed file handles
ah, welp
but thats besides the point
I could just nuke the server and then the .lck files stay as well
it is not beside the point, you shouldn't use reload
hotswapping 🔛🔝
💯
more like notswapping
kotlin hotswapping is so fun
if I leave my file streams open my os just closes them for me
i believe
it is really painless to setup, don't know why people find it so daunting
all you have to do is download Jetbrains's Runtime, JBR then add a few JVM flags as well as the debug ones and you're done
i've not had quite the same experience with windows however (@shadow night would know 🧌)
you can setup hotswapagent if you want to be fancy but eh, it isn't necessary for spigot development
windows closes file handles just fine
just a simple attached debugger works
but still, that does not take away from the fact that it still leaves the files of the server crashes, or just makes another log file regardless
well they were apparently still used by the then closed process
if the process is closed, file handles are discarded
the issue is when the process isn't closed properly rather
SIGTERM is closing properly
which can happen often in windows since you don't have much of an insight of whether things were actually closed
last time i used kotlin hotswap i had to disable like 3 plugins and do random stuff to enable some other stuff
idk it was weird
I mean, don't know if kotlin affects it at all, I am not a meth addict
it does not
java hotswapping is great
I use java like a sane, recovered addict
not a meth addict? smh
stop the cap
@sly topaz do you not like this stuff
why SIGTERM when u can SIGKILL 😎
I'd rather read yandere simulator's code
i often killall -9 java
just because intellij moment
i simply sudo reboot
cbf to reboot
just let it leak™️
welp, I gotta cook
thats Also what she said?
yeah so there is not a good reason to use the java logger then
I was trying something out but welp, I couldn't remember how one was supposed to get the log4j Logger instance
I suppose I could get the parent but I cba now that you already worked around your thing
in Paper it is even worse since they use slf4j, which is annoying when trying to do anything logging framework specific and support spigot
np, I was just curious if it was possible to dynamically add an appender anyway
it probably is, I just didn't dig deep enough
had to comment out a shit ton of code just to make it run in Spigot, didn't notice how Paper dependent my test plugin was
that's what I do till I notice it
anyway going to eep now it's 2:54am
yeah well to tell you the truth I am making a paper plugin
?whereami ?whereami ?whereami moment
but figured might as well ask here since logging should be a basic thing
but I guess logging is rocket science
fancy println
I know this is a dumb question, but how do I put a plugin I am developing into my .m2 so another plugin I am working on can depend on it?
I know this is a basic baby question but it's hard to find info on it
maven or gradle
maven
run the maven install goal
mvn install
just add the jar as a dependency 🗣️
NOOOOOOOO
very new to this, tried following tutorials to get started, the tutorial i found seems super helpful up until the point i need to run the plugin for the first time. his run button is immediately able to be used when he makes the project, mine can't be clicked. says "the file in the editor is not runnable". i assume its set to run the single file i have open and not the entire project? what do i need to do?
plugins aren't executables
you need to put it in the plugins folder and start up a server
whatever tutorial you watched probably had a run configuration setup beforehand
you can either setup one too, or if you are using a build system like gradle (which I hope you are), you can use a gradle plugin like jpenilla's run-task to automatically copy the compiled jar and boot up a server
if you don't know any of what the above message says, then don't bother with it too much yet. You'll eventually learn it
ok i think i see. i can run maven build, which makes a plugin jar, then i put that in my test server
thanks
hm
I wonder
it seems like potentially creating .... over 1 million text displays might be using some memory
that's kinda lame mojang
only .24gb though so where the hell is this leakcoming from
what is synchedentitydata$dataitem
I have 16 million instances of that taking up .5gb
actually why are they never unloading from memory either
bro made 1 million text displays and complained they have a sizeable memory footprint!??!
is it bad to have multiple listeners on the same event just for breaking up the classes into what they’re used for
No
how would i constantly clear specific items from a players inventory when they have a certain tag (im assuming scoreboardtags act like tags from the /tag command? correct me if im wrong or if theres a better alternative)
just use pdc and scan the inventory for the specific tag
what is pdc
?pdc
spigot nbt wrapper
sadge
turns out placing 1133932 barrels is bad for memory
wtf mojang
unplayable game
and then he died
man
this is slow
ok well 53 minutes to generate
that's not good
what the fuck
I feel like I'm going crazy because the references are not going away
so it's just keeping all of them loaded
why would it even do that
is there an event I can cancel to prevent a person being set on fire
not just the damage
fire resistance?
dont want the client to see
also I think you still get the fire effect even if you ahve fire resistance
yeah u do
i found this but i idk what combust is supposed to mean
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityCombustEvent.html
declaration: package: org.bukkit.event.entity, class: EntityCombustEvent
but maybe
maybe im just stupid and dont know what combust means
yeah my ass needs to go back to english class, this is definitely it
got it just by setting fire ticks to 0 during entity damage event with the reason of fire or fire ticks
thats definitely what i wouldve done too, offbrand entity combust event
is there a good way to profile async cpu performance
I'd start by uh
figuring out raw numbers / sec
Like knowing how many blocks per sec you're pasting
it's not for the paste
it's for the gen
got it down from like 18 minutes to 1:03 but I'd like to push it down even further
especially since it's for a test radius and the full thing is still close to like 40 minutes if we're going for a really big size (not sure I will use that though)
1 min is noice
yeah the original version of this could do this radius in less than a second unfortunately
it was even faster than what I currently had even for a 50 radius
the original version only had to account for modules of identical sizes
this version handles compound modules
ah
which is much worse than having to handle modules of different sizes too
since compound modules can be both flexible and inflexible at the same time
I am sort of regreting the way I implemented it though
and might revert it
on paper it's really neat, in practice it's massively slow and turns out to be very tricky to get builders to build for it correctly
this would be so much easier even if it was just bigger modules trying to mesh with smaller ones
if i was to make such a generator, i would try to use the power of cubes to make meta modules, that always meet at certain points
and somehow have the outer borders of these meta modules fit like puzzle pieces to other meta modules
half the point of this system is to not be forced to do something like that
this exact same generator can also generate cities
oh yeah
all the same generator, though those were using an older version of the code
and are a bit basic
but i think the surface can be done separately from the dungeon structures
bump
format maybe?
pretty sure it says the size below upload
it dont
anyways i used to be able to upload any image I want, idk why its asking me to resize now
hows everyone odin
yes
no idea what odin is
so in that case my odin is fine i guess
Please close the git client
Use a try-with-resources or something but close the fucking git client
The git client instance won't be gc'd because it isn't closed and while it isn't closed it will be holding onto files in .git blocking other git clients from opening
It isn't about windows not closing file streams, it's about windows holding onto open files. Your linux isn't closing them either until the java process is stopped, but your linux is also not preventing the opening of the same file multiple times while it is still open
And not closing closeables is always a bad idea
is that wave function collapse?
yeah ^
neat
Is this the new and improved custom chunk generator version
this is happening because the associated logger is not being closed
it is not an OS related thing rather a code issue
for(Handler h:log.getHandlers())
{
h.close(); //must call h.close or a .LCK file will remain.
}
an example of where lck files are coming from
?
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
what is wrong with this
when i get this error:
i just build the server jar like every time before ^^
Did you run build tools --remapped
always like this: java -Xms512M -Xmx2024M -jar BuildTools.jar --dev --remapped
somehow removing "--dev" worked
You need to use JDK 21
its mandatory or optional?
If you want to support older versions you can set an older release target
certain versions require a certain minimum java version, in this case 1.21 requires jdk 21
Ok, so JDK 21 and above right?
right
thanks
why do i get the error cannot access net.minecraft.world.level.block.Block
at: import net.minecraft.world.level.block.Block;
it worked in older versions without any problem and the class is not private or smth at all:
public class Block extends BlockBehaviour implements ItemLike {
Make sure you're using Java 21
and that you have nms added to the project correcttly
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>```
should be correct... the imports are not red marked or smth ... but i use java 23 ... i guess that might be a problem then ?
Update the maven plugins
also you seem to have multiple java versions specified in that pom
is there a easy way to update the versions ?
i dont know the new version but lucky for me its showing me valid versions
Intellij should only show versions you've used before
and are in your local maven repo
They're not necessarily up to date
i guess it worked now, thanks
(updatet to highest version available and removed <configuration> <source>16</source> <target>16</target> </configuration>
from <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.13.0</version> <configuration> <source>16</source> <target>16</target> </configuration> </plugin>
You can just remove that entire plugin if you don't want to use it
(which you're not doing with the configuration removed)
hmmm i dont know why it exists but thanks again
It exists to set what java version to compile and target
so if you're using jdk 23 to compile the plugin is still compatible with Java 21 for example
with it removed you will need a java 23 server
probably not working again because language level changes
i used some that requeried java 16 but then all imports were not accepted again but no changed to jdk21 it works probably again
How do I spawn a persistent Entity in Spigot 1.8?
is it possible to change knockback with events?
This is for LivingEntity only
Normal entities don’t despawn
So why are they despawning?
Idk, gonna need more info
EntityKnockbackEvent
I just spawn an entity
I'll try to remove a plugin but I doubt it's him
Maybe it's not ticksAlived?
I think it's when I move away I'll confirm now
Players say it's when I walk away but I think it has to do with ticksAlived
Did you make a custom entity
wdym custom entity
dont you need mods for that
no
well then you should probably make a class that extends entity
as long as it looks like a vanilla mob to the client it's fine
Im using EnderCrystal.class
Show us how you're spawning it
also make sure you're not outside of the render distance
nvm I thought @chrome beacon you were asking the question
same pfp
EnderCrystal mob = (EnderCrystal) loc.getWorld().spawnEntity(loc, EntityType.ENDER_CRYSTAL);
mob.setCustomName("Custom Mob");
Use the spawn method that accepts a consumer if you want to modify it
modify with what method?
Modify inside the consumer
"1.8 is 10 years old 🤓"
fr?
b-but Hypixel
which stats
idk what u saying
The bstats
im using spawn method
The method is called spawn
let me see
hypixel's the only 1.8 server
Entity.spawn()?
and it prolly disabled it
world#spawn
did 1.8 have bukkit runnable still
yes
lol
Entity#spawnentity isnt the same thing?
That class should be quite old
no
spawn then modify
vs
modify then spawn
what even is Entity#spawnEntity
it still happens in same tick no?
Yes but the spawn event won't have your data
modify what? the customname?
valid
and the client might see regular entity flash for a second because it's spawned without the data
spawn at 0 0 0 and then tp
trust
And to be persistent I don't need to set a custom name? Just simply use the method
EndCrystals don't despawn
EnderCrystal entity = loc.getWorld().spawn(loc, EnderCrystal.class);
entity.setCustomName("Custom Mob");
entity.setCustomNameVisible(true);
Use the consumer
+1
I am using ENtity.spawnentity and it is disappearing
why entity.spawnentity
Are you outside the render distance of it
But I want it not to respawn if it stays far away
respawn??
You're not making much sense
despawn*
do you want entities that are in unloaded chunks to stay loaded or something
sorry, dspawn**
it doesnt
the entity is despawning if it stays away I believe, I'm seeing this. I'm seeing if it's when I stay away or when ticksAlived reaches 6000.
so how are they desspawning?
You're doing something to them
no
or they are getting damaged causing them to explode
nope
Are you on a strange fork of fork of fork of fork of fork
I believe it is the removal of entities when it reaches 6000 tickslived
if so make sure that's not the cause
flamepaper
If that's the case, I don't know how to solve it because spigot.yml can't be blacklisted.
Again they shouldn't be despawning because of that
That would break the end entirely
the fork probably made some data for end crystals
^^
i doubt
and others just despawn ig
Recreate the issue on Spigot
?whereami
nope
nope what
it's not ticks alived
you just told us it was
okay so youre saying
you stop seeing the crystal
wait for X time
go back
and its gone?
I can't tell you, I'm unloading the chunk and the console says that the ender crystal chunk was despawned but then when I come back the ender_crystal is there, but on the production server sometimes the ender_crystal disappears and I don't know what they do to make it disappear.
can i use multiple listeners witout lagging the server? I want have better code structure, so I dont wanna everything to be in one class
How can I have a few servers communicate that are linked to the same proxy?
Database, or plugin messaging
Can't use plugin messages, they're empty
Redis pubsub
what do you mean empty
or simillar
wait why is returning in the middle of code considered good practise?
Youre supposed to fill them with info
it is simple if else, I am implementing new plants, so i want to have one class per each crop
plugin messages don't work when there are no players
Wouldnt it be worse when debugging?
just checking via nbt tags if thats the specific plant
Doesn't sound like a good usecase for multiple listeners
What's redis exactly?
so put everything in one class
peak
an in memory database that can do pubsub messaging
No
Pubsub?
oh I see, use one listener and then call different classes
sounds to me like it just gets unloaded
thats what I do. Is this the way?
i think it is the best one to have clean code
👌
it depends on what it is you want to communicate or the purpose
and whether or not said communication needs to be instant
chunkunloadevent and check if chunk have ender crystal
If I spawn an entity in an unloaded chunk, will the entity remain in the chunk?
Then it gets unloaded
not despawned
That's two different things
Less indentation is easier to read
Yes, the entity is not disappearing but for some reason on the production server it is disappearing and players say it is when unloading the chunk
And guard clauses keep the mental gymnastics simple
Do you have a tutorial for the best solution for proxy servers?
And would the address of each server need to be configured manually?
all of the servers would need to connect to the redis instance
disagreed
yes
peak
no it fucking isn't
wasnt multiple returns considered bad practise
very peak
no?
beautiful 🥹
okay not those return true's
I need to update a armorstand in unspawned chunks. What do I do?
Don't
okay but
why
So how do I do a hologram count?
There's no need to update it when it's never viewed
the hologram is still because I moved away https://imgur.com/a/Gvpv6zH
I dont think saving holograms only on world is a good idea
Yes, and then the armorstand doesn't disappear
2 holograms bro
okay wait
so whats the problem
The hologram is stuck at 52 seconds 2 hours ago lol
why?
because when trying to remove an armorstand that is not in a loaded chunk nothing will happen
update it
Are you storing a direct reference to the entity
no, uuid
then dont
make it lazy
but to get an armorstand from the uuid I need to go through world.getEntities() and this method returns all the entities that are in loaded chunks
??
I think you should save something more than uuid then
or save all armor stands you want to remove in a list
and when theyre loaded remove them
at least thats what I think
Yo
I heard that Lettuce is a better alternative to Redis
Redis is what most people use with their servers which is why I recommended it
So does redis need to be installed separately or smthg?
yes
Ah
I never seen use for redis, I just use sockets
Sockets work too
I'm just looking for a way to have servers communicate
Could you link any of your source code where you use sockets?
Just look on example about ServerSocket and Socket
Server socket has accept()
That you can use to listen to new clients
And Socket allows you to read input and output
Accept gives you a Socket btw
So far I only figured out how to use a thread per client
So it's a blocking read?
Yeah
Accept, reading from input and output is blocking
But there's nio sockets too
Which seem super cool if I ever find time to look into them
armorstand references are not maintained
I will always call chunk.load before trying to get the armorstand
world#getentities only returns entities in loaded chunks bro
yes
I know
thats why you save the uuids of armor stands you want removed in a list if they are unloaded
but do this check always in chunkunloadevent? It is much more performance to do the check when i want to update the armorstand
what are you saying
what check
Looping getEntities is a bad idea
that too
Looping every unloaded chunk is an even worse idea
Imaging a server with thousands of chunks that loop could take over an hour
🔥
Instead of tps it's hpt
dont you just wanna save an armor stand's position
spt
and just load the chunk before removing it
real
hours per tick
and then the armor stands have to get updated every second
and server dies
wait can you actually loop all unloaded chunks somehow
Nothing stops you from doing that
nah but like how
but uh it's not exactly a good idea
can you get all generated chunks somehow?
I didn't do it
location.getchunk.load is 1 time every second a bad idea?
Don't do it like that 💀
dude tell me
As I've said don't update the armor stand when it's not loaded
^^
so I only update if it is to remove
sure
what problem
Imagine, there is a one minute timer on an armorstand, and when one minute reaches it says a status: enabled or disabled. The timer is going down and then the chunk unloads, so the timer will no longer go down on the armorstand, but it will in my cache. Then when the timer reaches 0 seconds the armorstand is still not updated because the chunk was unloaded and then the chunk is loaded because a player comes close and does not see the changes in the armorstand.
I can update the armorstand line in the chunkloadevent, but I think I will have worse performance than loading the chunk before updating the line.
so youre saying that updating an armor stand once its loaded will have worse performance than updating it every second?
Im not follownig
Of course, the chunkloadevent is called +2000 times in a second
and I have to check in each loaded chunk all entities if they contain an armorstand
and how would you update the armor stand otherwise
before getting the armorstand by uuid, load the chunk
how will you get it by uuid
public static List<ArmorStand> getArmorStands(World world) {
List<ArmorStand> list = new ArrayList<>();
for (Object object : ((CraftWorld) world).getHandle().entityList) {
if (object instanceof Entity minecraftEntity) {
org.bukkit.entity.Entity bukkitEntity = minecraftEntity.getBukkitEntity();
if (bukkitEntity instanceof ArmorStand) {
list.add((ArmorStand) bukkitEntity);
}
}
}
return list;
}
What can I use to make an item stay in a player's inventory until it breaks, for example I used onPlayerDropItem to prevent them from dropping the item
This is not enough, I also prevented him from falling when he died with onPlayerDeath, but it is still not enough
how do I put it
youre still looping all entities every second
For example, to prevent deletion with the trash command
except this time its the ones in loaded chunks too
what's the problem? it's the only way to get an armorstand in the world
try to cancel inventory click events if the item gets placed outside the inventory
whats the problem?
looping all entities
is the problem
what
how do you want to update an armor stand without interacting with entities
iterate through the entities of a chunk in chunkloadevent?
okay so you dont want to loop all newly loaded entities
so you want to loop all entities instead?
Makes sense, let me test it
but this way it is called +1000 times in 1 second. that way it is called every second
dont forget shift clicks
the problem is not the loop but the frequency
lmao its just kind of a gamble
also
list.add(armorStand);
}```
It's better to update an armorstand by interacting world.getentities every 1 second but before interacting, load the chunk (1 call to location.loadchunk every second and interact all loaded entities every second) OR in the chunkloadevent interact all entities in that chunk, check if they contain an armorstand to update and if so, update it (less entities to interact but much more frequently maybe 1000 times per second I don't know but then it distributes the load I don't know?)
Do you prefer the 2nd option?
what the problem
what I would do is store all chunks that contain armor stands in them
lol very difference -'
yea
me neither 🤔
essentially if you would do that
it would be kind of "whats faster"
but what would that change
so you dont have to loop all entities in all loaded chunks
keeping the chunks in reference they don't unload?
no not that-
ye
💀
You would do the 1st option but instead of interacting with all the loaded entities, you would interact with the chunk entities, right?
chunk.load every 1 second is not a problem then
because if you walk thousands of chunks are loaded
because I didn't load the chunk before
It's better to update an armorstand by interacting chunk.getentities every 1 second but before interacting, load the chunk (1 call to location.loadchunk every second and interact all chunk entities every second. This option is good right
for what
have worse performance prob
but i ll not use world#getentities more
so you think that you getting all entities and then checking their type is better than bukkits method of getting entities by class
i think yes
how come
have to go through all the classes
not how Id do it probably but it should work
and checking by types is just a equals on each entity
slower than what
This introduces an extra layer of type checking through reflection-like operations (isAssignableFrom), which is more computationally expensive compared to a simple instanceof check.
gpt is utterly drunk
its true?
😂
gpt the type of guy to say code is slower cuz it has more lines of code
does anyone have any idea why it downloads 1.20.1/1.21.1 even thou i select 1.20/1.21
cuz 1.20 isnt used
i dont care it shows my name btw
the plugin i compile does and thats why i cant build it
Why are you using nms to get armor stands?
I disagree, GPT does not draw these conclusions
because i want
im pretty sure thats a bug tbh
any conclusions gpt draws you ahev to inhale with a bucket of salt
better way right
but I guess it could be true in this case
please tell me youre sarcastic
right...
please
your job is teh first one to get taken by AI
real
actually wtf is isAssignableFrom
ive never heard of it
if anyone here used commandapi by jorel, can you make it so that a check is run everytime u run a command in the same subcommand thingy
so u dont have to run it every time
Successful, I did it but I can't do it for death, I'm still trying to make the item stay in the inventory when the player dies
yeah me neither
cancel drops
and give them the item
no?
but isAssignableFrom does actually exist
but how do you know its being used by the method in question
Can I keep chunk references in a list or do I have to keep location references and use location.getchunk when needed?
no
entitiesbyclass use it
Do you mean to prevent the item from dropping? Or to clear the inventory and give the item back when the player dies?
i decompiled the code
dont keep chunk references
anyone know where i can report a bug about buildtools?
☠️
is that you had said that from what I had noticed and I found it strange
lawyers
this is a memory question
where are you
?jira
W hat exactly is the bug though
location.chunk.load every 1 second is not a problem then???
When I say "save chunks" I dont mean "save chunk references"
avg chatgpt user
but its microoptimization
One of the most common issues we get is people using jre
so it doesnt matter either way
bro???? you're wrong
I can be everything you can imagine but I'm not a clairvoyant
yeah pumpkin is just slandering
real
clairvoyant
r u fr rn
it doesnt download correct versions
translator
no shit
here
nah but fr dont use 1.21
i dont 
then whats the problem
there is no difference
another plugin dev uses it
omg
and now i cant build it
and if there is you would have to find out which is better for your usecase
rip
y
and im not spoonfeeding you
im not chatgpt
im not helping cuz I dont have knowledge to offer fr
you aren't obligated to talk
That's most likely not a bug
Versions get replaced
E.g. 1.20
I believe 1.21 was replaced too
yea
I believe 1.19.3 was replaced as well? It happens a good bit
its more fast instanceof or entity.gettype.equals(entitype...)
1.19.3? random version to be replaced
If the version is replaced you shouldn't be on it
Superceeding happens when there is 100% no reason to use that version
what if I want my bugs
crash exploits are love, crash exploits are life
it really doesnt matter that much
nanosecond differences
ok thanks
but there's no need for that
Before calling chunk.load, should I call chunk.isloaded?
what
i need do it
"It's better to update an armorstand by interacting chunk.getentities every 1 second but before interacting, load the chunk (1 call to location.loadchunk every second and interact all chunk entities every second. This option is good right"
can you please speak proper english
@hushed spindle 🙏
what you didn't understand
I did its just hard to read
You shoudl not be updating armor stands in unloaded chunks
have to read it twice to get it
https://imgur.com/a/hMwzXyt its true?
Wait until the chunk loads naturally and then update them
weve told him that
its certainly chatgpt
but isn't it more performant to loop through all entities in a chunk every second rather than looping through all entities every time a chunk is loaded?
no
just stop looping all entities in all loaded chunks
u see what i say?
looping every second you are forcing chunks to remain loaded and performign updates when they are not needed
**all entities in a chunk **
no I dont
3 chunks only
only update on loaded chunks and yoru overhead is MUCH lower
Why would you loop all entities in all chunks that get loaded
but is 3 cuhnks only
also, cant cant u check the .load method, perhaps it already contains an isloaded check
It doe4sn;t matter how many chunks it is
I always keep 3 chunks in memory but I don't have to keep iterating thousands of times.
if no one is near them they do not need to be updated
but in its own way I have to go through several entities very frequently
but most of the time there will be people nearby
argue all you like, you have been told why its not a good idea and is not performant
its just bad code design
fr
besides, correct me if im wrong, but most of the time loaded chunks dont have any entities in them
I think keeping 3 chunks always loaded is much more performance-enhancing than iterating thousands of entities in the chunkloadevent but ok
they do, but they don;t tick