#help-development

1 messages · Page 1157 of 1

torn shuttle
#

like, really mass pasting

sullen marlin
#

isn't it because it keeps a history of that to undo

lilac dagger
#

just one undo

torn shuttle
#

I specifically made sure to not keep a history for this one

young knoll
#

Are you using we to place your rooms?

torn shuttle
#

yeah because I am building it on top of the betterstructures stack

sullen marlin
#

no he's using us

young knoll
#

Blah

pseudo hazel
#

he is using your mom, thats why the memory is full

torn shuttle
#

md_5

#

pls

young knoll
#

I just made my own schematic importing and placement system

torn shuttle
#

do the mass block writing thing in the api

sullen marlin
#

that's a scam

torn shuttle
#

is it

sullen marlin
#

if you look at the type setting code without physics, it's pretty much identical

torn shuttle
#

uh

#

are you really sure about that one

lilac dagger
#

yup

torn shuttle
#

because I am pasting via WE without physics and it's dreadfully slow

#

but that I can change easily

lilac dagger
#

you're still sending changes for each block 1 at a time

#

to the players i mean

torn shuttle
#

thing is I don't care about players

young knoll
#

Does the game not automatically batch that?

torn shuttle
#

they're not even going to be in the world until it's fully generated

young knoll
#

I figured it would

torn shuttle
#

if i could I'd just write the chunk files myself

sullen marlin
#

pretty sure it does batch

young knoll
#

You can write to the palette directly

lilac dagger
#

i haven't found a batch solution

young knoll
#

You’ll save the overhead of several function calls, but it won’t magically be 100x faster

torn shuttle
#

I thought the datapalette trick could be done in async though

#

can you set blocks in async? that doesn't sound right

young knoll
#

No

#

Not without some janky hacks like FAWE does

torn shuttle
#

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

young knoll
#

That’s basically what the api does

torn shuttle
#

I could be wrong but I am assuming here that if I do setblock 100m times in sync it will crash the server

young knoll
#

Just with a few function calls

torn shuttle
#

am I wrong?

young knoll
#

I believe the api method calls the internal method in the chunk, which then calls the internal method in the palette

torn shuttle
#

but I can't call setblock in async can I

young knoll
#

Wait I forgot a step

#

API -> Chunk -> ChunkSection -> Palette

torn shuttle
#

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)

young knoll
#

Try it I suppose

torn shuttle
#

which part

young knoll
#

Modifying the palette async

lilac dagger
#

it sounds like it should work in async

#

if all the chunks are generated and preloaded before the async can do its magic

sullen marlin
#

why not just do it as a chunk generator

#

chunk generators can be async and will be safe (and fast)

lilac dagger
#

that is the best idea tho

#

yeah a chunk generator is the way to go

#

it'll probably require a lot of positional information

torn shuttle
#

how do I tell a chunk generator to use the exact blocks I have there

lilac dagger
#

how does mojang handle structures?

#

it might be worth looking into that

#

i think it's base land generation and then structures no?

torn shuttle
#

how would this even work

lilac dagger
#

i don't thnk it'll work for you because of conflicting modules

#

no idea how a world starts generating

torn shuttle
#

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

sullen marlin
#

pregenerate it and then just have the chunk generator "translate" from your pregeneration into the world?

lilac dagger
#

pretty good idea actually

young knoll
#

But doesn’t that just result in you doing it twice

#

Once to make the pregen and then once to translate it

lilac dagger
#

not actually working with the blocks in first step

young knoll
#

Since this is random you can’t just pregen a single world ahead of time

pseudo hazel
#

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

torn shuttle
#

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?

sullen marlin
#

I maybe dont understand your thing

#

it's not just a glorified world generator?

torn shuttle
#

not really

floral drum
#

hi mr michael

#

how is your australian day

sullen marlin
#

looks like a map generator to me

torn shuttle
#

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

sullen marlin
#

that's why you pregenerate it?

#

pregenerate it and then copy it into MC

torn shuttle
#

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

sullen marlin
#

add a chunk generator that just reads your pregenerated solution

torn shuttle
#

what do I need to do to get it to read that

#

(in async)

sullen marlin
#

just override one of the generateX methods in ChunkGenerator and copy your pregenerated stuff into the chunkData argument

torn shuttle
#

ok and how does this end up being faster than pasting it into the world the normal way, is chunkgenerator inherently async or something?

sullen marlin
#

yes, and it will also not need to do any of the other tasks such as lighting updates used with a real world

torn shuttle
#

gotcha, I'll give it a spin then

worldly ingot
#

Thought that was really rude :(

wraith delta
torn shuttle
#

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?

young knoll
#

Huh I wonder if I could handle my dungeon system that way

#

What do you use to store the pregenerated data

torn shuttle
#

modules

#

that's the problem

young knoll
#

Is it just a list of (x, y, z, Block)

torn shuttle
#

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

young knoll
#

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

torn shuttle
#

avoiding the palette is the whole point of this otherwise I could just use nms to write the entire thing in one go

young knoll
#

Mmm yeah I don’t think the api exposes the block state map

#

You could make your own ig

quaint mantle
#

when did bungee first launch?

pseudo hazel
#

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

remote swallow
#

slf4j, log4j

pseudo hazel
#

I just want to have a class that creates or appends to a singular file

#

I cant find any good example of those

sly topaz
#

you'd just use a log appender for that

pseudo hazel
#

they all use stupid xml setup scripts

pseudo hazel
exotic owl
#

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?

pseudo hazel
#

is it not in buildtools?

#

?buildtools

undone axleBOT
remote swallow
#

earliest is like 1.8

young knoll
#

Everything before 1.8 is lost to time

#

Officially

exotic owl
pseudo hazel
#

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

young knoll
#

I mean the downloads for it do exist

pseudo hazel
#

there was only like dirt

young knoll
#

Just not from official sources

#

You’re on your own past that 😉

exotic owl
#

😅

pseudo hazel
#

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

buoyant viper
#

have u considered using a FileWriter at that point

exotic owl
#

disregard what i said above

#

👍

pseudo hazel
buoyant viper
pseudo hazel
#

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

sly topaz
#

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

pseudo hazel
#

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

sly topaz
#

.lck files?

eternal oxide
#

you only get stray .lck files when the process crashes with open file handles

sly topaz
#

that's what is confusing me, your server shouldn't be exiting that way lol

blazing ocean
#

sigkill moment

worthy yarrow
blazing ocean
#

2:04 am

worthy yarrow
#

Soooooo late

pseudo hazel
#

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

sly topaz
#

@pseudo hazel have you figured out how to write to a separate log file

#

because apparently you just had to add a file handler

pseudo hazel
#

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

sly topaz
#

why did the file handler not work for you

pseudo hazel
#

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

blazing ocean
#

isn't this just a windows moment

pseudo hazel
#

probably

blazing ocean
#

i've never had issues when i don't close my streams trollface (arch btw)

pseudo hazel
#

but the logger is the one deciding it needs to make new files

#

not windows

sly topaz
#

why is it creating lck files, how are you closing your server lol

pseudo hazel
#

windows doesnt have anything to do with it

#

I am not

#

/reload

blazing ocean
#

i thought there was something something linux closing unclosed file handles

sly topaz
#

ah, welp

pseudo hazel
#

but thats besides the point

#

I could just nuke the server and then the .lck files stay as well

sly topaz
#

it is not beside the point, you shouldn't use reload

pseudo hazel
#

well I want to

#

because its fast

sly topaz
#

hotswapping 🔛🔝

blazing ocean
#

💯

pseudo hazel
#

more like notswapping

remote swallow
#

kotlin hotswapping is so fun

blazing ocean
#

i believe

sly topaz
#

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

pseudo hazel
#

I tried it once but it didnt work

#

granted that was like 1.5 yrs ago

blazing ocean
sly topaz
#

you can setup hotswapagent if you want to be fancy but eh, it isn't necessary for spigot development

sly topaz
blazing ocean
#

just a simple attached debugger works

pseudo hazel
#

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

blazing ocean
sly topaz
#

if the process is closed, file handles are discarded

#

the issue is when the process isn't closed properly rather

blazing ocean
#

SIGTERM is closing properly

sly topaz
#

which can happen often in windows since you don't have much of an insight of whether things were actually closed

remote swallow
blazing ocean
#

what

#

kotlin hotswap works just fine

remote swallow
#

idk it was weird

sly topaz
#

I mean, don't know if kotlin affects it at all, I am not a meth addict

blazing ocean
#

it does not

remote swallow
#

java hotswapping is great

sly topaz
#

I use java like a sane, recovered addict

blazing ocean
#

not a meth addict? smh

sly topaz
blazing ocean
#

@sly topaz do you not like this stuff

buoyant viper
#

why SIGTERM when u can SIGKILL 😎

sly topaz
#

I'd rather read yandere simulator's code

blazing ocean
#

just because intellij moment

buoyant viper
#

i simply sudo reboot

blazing ocean
#

cbf to reboot

sly topaz
#

just let it leak™️

buoyant viper
#

thats what she said

#

?

sly topaz
#

welp, I gotta cook

buoyant viper
#

thats Also what she said?

pseudo hazel
sly topaz
#

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

pseudo hazel
#

yeah dont worry

#

thanks for helping me out though

sly topaz
#

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

blazing ocean
#

anyway going to eep now it's 2:54am

pseudo hazel
#

yeah well to tell you the truth I am making a paper plugin

blazing ocean
#

?whereami ?whereami ?whereami moment

pseudo hazel
#

but figured might as well ask here since logging should be a basic thing

#

but I guess logging is rocket science

blazing ocean
#

fancy println

restive mango
#

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

remote swallow
#

maven or gradle

restive mango
#

maven

remote swallow
#

run the maven install goal

buoyant viper
#

mvn install

restive mango
#

ty

#

😄

sly topaz
#

just add the jar as a dependency 🗣️

buoyant viper
#

NOOOOOOOO

summer halo
#

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?

sly topaz
#

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

summer halo
#

ok i think i see. i can run maven build, which makes a plugin jar, then i put that in my test server

sly topaz
#

yep

#

maven package rather but same deal

summer halo
#

thanks

torn shuttle
#

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

buoyant viper
#

bro made 1 million text displays and complained they have a sizeable memory footprint!??!

torn shuttle
#

yes

#

they're distributed among what should be unloaded or unloading chunks

fading drift
#

is it bad to have multiple listeners on the same event just for breaking up the classes into what they’re used for

worthy yarrow
#

No

summer halo
#

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)

drowsy helm
summer halo
#

what is pdc

drowsy helm
#

?pdc

drowsy helm
#

spigot nbt wrapper

halcyon hemlock
#

dun dun dun

#

nanananaaaaaaaaaaa nanaa nananananananaaaaaaaaaaa dun dun dun

torn shuttle
#

sadge

#

turns out placing 1133932 barrels is bad for memory

#

wtf mojang

#

unplayable game

drowsy helm
#

wrong

#

my mate barry placed 1133933 last tuesday

torn shuttle
#

and then he died

#

man

#

this is slow

#

ok well 53 minutes to generate

#

that's not good

nova notch
torn shuttle
#

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

fading drift
#

is there an event I can cancel to prevent a person being set on fire

#

not just the damage

nova notch
#

fire resistance?

fading drift
#

dont want the client to see

#

also I think you still get the fire effect even if you ahve fire resistance

#

yeah u do

nova notch
#

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

fading drift
#

got it just by setting fire ticks to 0 during entity damage event with the reason of fire or fire ticks

nova notch
#

thats definitely what i wouldve done too, offbrand entity combust event

torn shuttle
#

is there a good way to profile async cpu performance

echo basalt
#

figuring out raw numbers / sec

#

Like knowing how many blocks per sec you're pasting

torn shuttle
#

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)

lilac dagger
#

1 min is noice

torn shuttle
#

it's only a radius of 10 chunks

#

(which really is 21x25x21 chunks)

#

48s

lilac dagger
#

ah

#

i thought it was bigger

torn shuttle
#

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

lilac dagger
#

what changed between the two?

#

did you increase the big O complexity?

torn shuttle
#

the original version only had to account for modules of identical sizes

#

this version handles compound modules

lilac dagger
#

ah

torn shuttle
#

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

lilac dagger
#

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

torn shuttle
#

half the point of this system is to not be forced to do something like that

#

this exact same generator can also generate cities

lilac dagger
#

oh

#

so it's not dungeon only?

torn shuttle
#

no

#

I've posted some of the other stuff here as well

lilac dagger
#

oh yeah

lilac dagger
#

but i think the surface can be done separately from the dungeon structures

torn shuttle
#

of course you can do that

#

it's not what I'm trying to do

proud badge
#

bump

lilac dagger
#

format maybe?

proud badge
#

ok turns out it has to be 96x96

#

resized and it works now

lilac dagger
#

pretty sure it says the size below upload

proud badge
#

it dont

#

anyways i used to be able to upload any image I want, idk why its asking me to resize now

lilac dagger
#

uh

#

it does to me

proud badge
#

ok idk why then

#

weird

halcyon hemlock
#

hows everyone odin

proud badge
#

yes

lilac dagger
#

no idea what odin is

halcyon hemlock
#

odin is a god of gods

#

what else

lilac dagger
#

so in that case my odin is fine i guess

shadow night
#

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

zealous osprey
lilac dagger
#

yeah ^

zealous osprey
#

neat

young knoll
#

Is this the new and improved custom chunk generator version

lilac dagger
#

it's older stuff

#

before chunk generator

wet breach
#

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

charred saddle
#

?

spiral light
#
        <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 ^^

sullen marlin
#

Did you run build tools --remapped

spiral light
#

always like this: java -Xms512M -Xmx2024M -jar BuildTools.jar --dev --remapped

#

somehow removing "--dev" worked

summer gale
#

A general question..
Is JDK 17 unsupported for 1.21.1 API?

#

something like that

chrome beacon
#

You need to use JDK 21

summer gale
chrome beacon
#

If you want to support older versions you can set an older release target

wet breach
summer gale
#

Ok, so JDK 21 and above right?

wet breach
#

right

summer gale
#

thanks

spiral light
#

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 {

chrome beacon
#

and that you have nms added to the project correcttly

spiral light
#
            <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 ?
chrome beacon
#

Send your entire pom

#

?paste

undone axleBOT
spiral light
chrome beacon
#

Update the maven plugins

#

also you seem to have multiple java versions specified in that pom

spiral light
#

is there a easy way to update the versions ?

chrome beacon
#

You just replace the old version number with the new one

#

Not that hard

spiral light
#

i dont know the new version but lucky for me its showing me valid versions

chrome beacon
#

Intellij should only show versions you've used before

#

and are in your local maven repo

#

They're not necessarily up to date

spiral light
#

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>

chrome beacon
#

You can just remove that entire plugin if you don't want to use it

#

(which you're not doing with the configuration removed)

spiral light
#

hmmm i dont know why it exists but thanks again

chrome beacon
#

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

spiral light
#

probably not working again because language level changes

chrome beacon
#

?

#

Are you using newer language features

spiral light
#

i used some that requeried java 16 but then all imports were not accepted again but no changed to jdk21 it works probably again

young knoll
#

What language level is type switching

#

It’s like 21 isn’t it

bold plume
#

How do I spawn a persistent Entity in Spigot 1.8?

young knoll
#

setRemoveWhenFarAway(false)

#

I assume that existed 10 years ago, idk

fading drift
#

is it possible to change knockback with events?

bold plume
young knoll
#

Normal entities don’t despawn

bold plume
#

So why are they despawning?

young knoll
#

Idk, gonna need more info

young knoll
bold plume
#

I'll try to remove a plugin but I doubt it's him

#

Maybe it's not ticksAlived?

young knoll
#

What are you spawning

#

When is it despawning

bold plume
#

Players say it's when I walk away but I think it has to do with ticksAlived

chrome beacon
#

Did you make a custom entity

bold plume
chrome beacon
#

your own entity class

#

extending an existing one and spawning that

glossy laurel
#

dont you need mods for that

chrome beacon
#

no

glossy laurel
#

well then you should probably make a class that extends entity

chrome beacon
#

as long as it looks like a vanilla mob to the client it's fine

bold plume
chrome beacon
#

Show us how you're spawning it

#

also make sure you're not outside of the render distance

glossy laurel
#

same pfp

bold plume
#

EnderCrystal mob = (EnderCrystal) loc.getWorld().spawnEntity(loc, EntityType.ENDER_CRYSTAL);
mob.setCustomName("Custom Mob");

chrome beacon
#

Use the spawn method that accepts a consumer if you want to modify it

bold plume
chrome beacon
#

Modify inside the consumer

bold plume
#

but what method

#

im on spigot 1.8

glossy laurel
#

oh my god

#

rip support

chrome beacon
#

spawn method

#

It should still exist

#

if not too bad

glossy laurel
#

"1.8 is 10 years old 🤓"

lilac dagger
#

All the stats showed that 1.8.8 was barely played anymore

#

What gives?

chrome beacon
#

b-but Hypixel

glossy laurel
#

which stats

bold plume
lilac dagger
#

The bstats

bold plume
#

im using spawn method

chrome beacon
bold plume
#

let me see

glossy laurel
bold plume
#

Entity.spawn()?

glossy laurel
#

and it prolly disabled it

chrome beacon
#

world#spawn

glossy laurel
#

did 1.8 have bukkit runnable still

chrome beacon
#

yes

glossy laurel
#

lol

bold plume
chrome beacon
#

That class should be quite old

chrome beacon
#

spawn then modify
vs
modify then spawn

glossy laurel
#

what even is Entity#spawnEntity

glossy laurel
chrome beacon
#

Yes but the spawn event won't have your data

bold plume
glossy laurel
chrome beacon
#

and the client might see regular entity flash for a second because it's spawned without the data

chrome beacon
#

in this case changing the name

glossy laurel
#

trust

bold plume
chrome beacon
#

EndCrystals don't despawn

bold plume
#

EnderCrystal entity = loc.getWorld().spawn(loc, EnderCrystal.class);
entity.setCustomName("Custom Mob");
entity.setCustomNameVisible(true);

chrome beacon
#

Use the consumer

glossy laurel
#

+1

bold plume
glossy laurel
#

why entity.spawnentity

chrome beacon
bold plume
chrome beacon
#

so you want it to despawn

#

but the issue is that it's despawning

#

???

glossy laurel
chrome beacon
#

You're not making much sense

bold plume
glossy laurel
#

do you want entities that are in unloaded chunks to stay loaded or something

bold plume
glossy laurel
chrome beacon
#

^^

#

EndCrystals don't despawn

bold plume
#

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.

bold plume
chrome beacon
#

You're doing something to them

bold plume
#

no

chrome beacon
#

or they are getting damaged causing them to explode

bold plume
#

nope

chrome beacon
#

Are you on a strange fork of fork of fork of fork of fork

bold plume
#

I believe it is the removal of entities when it reaches 6000 tickslived

chrome beacon
#

if so make sure that's not the cause

chrome beacon
#

so yes

#

Make sure they're not the cause

bold plume
chrome beacon
#

Again they shouldn't be despawning because of that

#

That would break the end entirely

glossy laurel
#

the fork probably made some data for end crystals

chrome beacon
#

^^

glossy laurel
#

so they dont respawn

#

like

#

end end crystals

glossy laurel
#

and others just despawn ig

chrome beacon
glossy laurel
bold plume
#

nope

glossy laurel
#

nope what

bold plume
#

it's not ticks alived

glossy laurel
#

you just told us it was

#

okay so youre saying

#

you stop seeing the crystal

#

wait for X time

#

go back

#

and its gone?

bold plume
#

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.

chrome beacon
#

Why would the console say it despawned

#

(what did you do to send that message)

quaint mantle
#

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

chrome beacon
#

yes

#

It's more about what you do in the listeners

grim hound
#

How can I have a few servers communicate that are linked to the same proxy?

proud badge
#

Database, or plugin messaging

grim hound
#

Can't use plugin messages, they're empty

chrome beacon
#

Redis pubsub

proud badge
#

what do you mean empty

chrome beacon
#

or simillar

glossy laurel
#

wait why is returning in the middle of code considered good practise?

proud badge
#

Youre supposed to fill them with info

quaint mantle
chrome beacon
glossy laurel
quaint mantle
chrome beacon
#

Doesn't sound like a good usecase for multiple listeners

grim hound
quaint mantle
chrome beacon
chrome beacon
grim hound
#

Pubsub?

chrome beacon
#

publish/subscribe

#

Think of it like events

quaint mantle
#

oh I see, use one listener and then call different classes

glossy laurel
glossy laurel
quaint mantle
glossy laurel
#

👌

wet breach
#

and whether or not said communication needs to be instant

bold plume
#

If I spawn an entity in an unloaded chunk, will the entity remain in the chunk?

chrome beacon
#

not despawned

#

That's two different things

echo basalt
bold plume
#

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

echo basalt
#

And guard clauses keep the mental gymnastics simple

grim hound
#

And would the address of each server need to be configured manually?

chrome beacon
#

all of the servers would need to connect to the redis instance

glossy laurel
blazing ocean
#

no it fucking isn't

glossy laurel
glossy laurel
blazing ocean
#

no?

blazing ocean
glossy laurel
#

okay not those return true's

bold plume
#

I need to update a armorstand in unspawned chunks. What do I do?

chrome beacon
#

Don't

bold plume
chrome beacon
#

There's no need to update it when it's never viewed

bold plume
glossy laurel
#

I dont think saving holograms only on world is a good idea

bold plume
bold plume
glossy laurel
#

so whats the problem

bold plume
glossy laurel
#

why?

bold plume
# glossy laurel why?

because when trying to remove an armorstand that is not in a loaded chunk nothing will happen

glossy laurel
#

update it

chrome beacon
#

Are you storing a direct reference to the entity

bold plume
bold plume
#

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

bold plume
glossy laurel
#

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

grim hound
#

Yo

#

I heard that Lettuce is a better alternative to Redis

chrome beacon
grim hound
chrome beacon
#

yes

grim hound
#

Ah

lilac dagger
#

I never seen use for redis, I just use sockets

chrome beacon
#

Sockets work too

grim hound
lilac dagger
#

Sockets can do that

#

Server socket for server and socket for client(s)

grim hound
#

Could you link any of your source code where you use sockets?

lilac dagger
#

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

grim hound
lilac dagger
#

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

bold plume
#

I will always call chunk.load before trying to get the armorstand

bold plume
glossy laurel
#

yes

#

I know

#

thats why you save the uuids of armor stands you want removed in a list if they are unloaded

bold plume
glossy laurel
#

what check

chrome beacon
glossy laurel
#

that too

chrome beacon
#

Looping every unloaded chunk is an even worse idea

#

Imaging a server with thousands of chunks that loop could take over an hour

glossy laurel
#

🔥

chrome beacon
#

Instead of tps it's hpt

glossy laurel
#

dont you just wanna save an armor stand's position

glossy laurel
chrome beacon
#

hpt

glossy laurel
glossy laurel
chrome beacon
#

hours per tick

glossy laurel
#

and then the armor stands have to get updated every second

#

and server dies

#

wait can you actually loop all unloaded chunks somehow

chrome beacon
#

Nothing stops you from doing that

glossy laurel
#

nah but like how

chrome beacon
#

but uh it's not exactly a good idea

glossy laurel
#

can you get all generated chunks somehow?

bold plume
#

location.getchunk.load is 1 time every second a bad idea?

chrome beacon
#

Don't do it like that 💀

glossy laurel
#

dude tell me

chrome beacon
#

As I've said don't update the armor stand when it's not loaded

glossy laurel
#

why tf would you update an armor stand

#

that noone sees

chrome beacon
#

^^

bold plume
glossy laurel
#

sure

bold plume
#

ok thanks

#

but this way I will continue to have the same problem

glossy laurel
#

what problem

bold plume
#

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.

glossy laurel
#

Im not follownig

bold plume
#

and I have to check in each loaded chunk all entities if they contain an armorstand

glossy laurel
#

and how would you update the armor stand otherwise

bold plume
#

before getting the armorstand by uuid, load the chunk

glossy laurel
#

how will you get it by uuid

bold plume
#

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;
}
slate siren
#

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

glossy laurel
#

youre still looping all entities every second

slate siren
#

For example, to prevent deletion with the trash command

glossy laurel
#

except this time its the ones in loaded chunks too

bold plume
glossy laurel
glossy laurel
#

looping all entities

#

is the problem

bold plume
#

how do you want to update an armor stand without interacting with entities

#

iterate through the entities of a chunk in chunkloadevent?

glossy laurel
#

okay so you dont want to loop all newly loaded entities

#

so you want to loop all entities instead?

bold plume
glossy laurel
bold plume
glossy laurel
#

I mean

#

you can use packets

#

to check when someone sees the armor stand

glossy laurel
#

also

#
                    list.add(armorStand);
                }```
bold plume
#

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?

glossy laurel
#

check the difference

glossy laurel
bold plume
#

lol very difference -'

glossy laurel
bold plume
#

idk why intellij dont warn

#

but ok

#

thx

glossy laurel
glossy laurel
#

it would be kind of "whats faster"

bold plume
glossy laurel
bold plume
#

keeping the chunks in reference they don't unload?

glossy laurel
bold plume
#

ye

glossy laurel
#

bro just skulled

#

lol

bold plume
#

chunk.load every 1 second is not a problem then

bold plume
glossy laurel
#

WAIT ARE YOU SAYING YOU LOADED A CHUNK AND THEN GOT ENTITIES IN WHOLE WORLD

#

☠️

bold plume
glossy laurel
#

okay I dont know what youre doing tbh

#

also

#

World#getEntities()

bold plume
#

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

glossy laurel
#

also

#

World#getEntitiesByClass()

#

:?

bold plume
glossy laurel
#

getting the armor stands only

bold plume
#

have worse performance prob

bold plume
glossy laurel
bold plume
#

i think yes

glossy laurel
#

how come

bold plume
#

have to go through all the classes

glossy laurel
glossy laurel
#

wdym??

bold plume
#

and checking by types is just a equals on each entity

glossy laurel
#

????

#

what types

#

wdym

bold plume
#

gpt say class is more slow

#

xd

glossy laurel
#

What gpt

#

what are you on about

glossy laurel
bold plume
#

This introduces an extra layer of type checking through reflection-like operations (isAssignableFrom), which is more computationally expensive compared to a simple instanceof check.

pseudo hazel
#

gpt is utterly drunk

glossy laurel
#

utterly*

#

fr

bold plume
glossy laurel
#

gpt the type of guy to say code is slower cuz it has more lines of code

mossy crest
#

does anyone have any idea why it downloads 1.20.1/1.21.1 even thou i select 1.20/1.21

mossy crest
#

i dont care it shows my name btw

bold plume
mossy crest
eternal oxide
#

Why are you using nms to get armor stands?

bold plume
bold plume
mossy crest
bold plume
#

xd

#

but @glossy laurel

pseudo hazel
#

any conclusions gpt draws you ahev to inhale with a bucket of salt

pseudo hazel
#

but I guess it could be true in this case

bold plume
#

gpt is always right

#

gpt doesn't make mistakes if you know how to ask

glossy laurel
pseudo hazel
#

right...

glossy laurel
#

please

pseudo hazel
#

your job is teh first one to get taken by AI

glossy laurel
#

real

pseudo hazel
#

but like for real though

#

its not just about instanceof vs isAssignableFrom

glossy laurel
#

ive never heard of it

proper cobalt
#

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

slate siren
pseudo hazel
#

yeah me neither

glossy laurel
#

and give them the item

#

no?

pseudo hazel
#

but isAssignableFrom does actually exist

#

but how do you know its being used by the method in question

glossy laurel
#

guys where did he get the getEntitiesByClass body

#

spigot api source where 😭

bold plume
#

Can I keep chunk references in a list or do I have to keep location references and use location.getchunk when needed?

bold plume
bold plume
slate siren
# glossy laurel cancel drops

Do you mean to prevent the item from dropping? Or to clear the inventory and give the item back when the player dies?

bold plume
mossy crest
#

anyone know where i can report a bug about buildtools?

glossy laurel
bold plume
glossy laurel
#

lawyers

glossy laurel
#

where are you

undone axleBOT
river oracle
#

W hat exactly is the bug though

bold plume
#

location.chunk.load every 1 second is not a problem then???

glossy laurel
#

avg chatgpt user

pseudo hazel
#

but its microoptimization

river oracle
pseudo hazel
#

so it doesnt matter either way

bold plume
#

I can be everything you can imagine but I'm not a clairvoyant

pseudo hazel
#

yeah pumpkin is just slandering

glossy laurel
glossy laurel
#

r u fr rn

mossy crest
bold plume
glossy laurel
mossy crest
glossy laurel
bold plume
#

or is it better to use packets

mossy crest
glossy laurel
pseudo hazel
mossy crest
#

another plugin dev uses it

glossy laurel
mossy crest
#

and now i cant build it

pseudo hazel
#

and if there is you would have to find out which is better for your usecase

glossy laurel
mossy crest
#

y

glossy laurel
#

idk

#

just

#

XD

glossy laurel
#

im not chatgpt

pseudo hazel
#

but rn you arent even helping

#

you are just hating

glossy laurel
#

yes

#

very

pseudo hazel
#

so then f off

#

go hate in #general

glossy laurel
pseudo hazel
#

you aren't obligated to talk

glossy laurel
#

yea

#

exactly

river oracle
#

Versions get replaced

#

E.g. 1.20

#

I believe 1.21 was replaced too

glossy laurel
#

yea

river oracle
#

I believe 1.19.3 was replaced as well? It happens a good bit

bold plume
#

its more fast instanceof or entity.gettype.equals(entitype...)

glossy laurel
#

1.19.3? random version to be replaced

river oracle
#

If the version is replaced you shouldn't be on it

chrome beacon
#

Superceeding happens when there is 100% no reason to use that version

glossy laurel
river oracle
#

Wants crash exploits

#

Wild behavior

glossy laurel
#

crash exploits are love, crash exploits are life

glossy laurel
#

nanosecond differences

chrome beacon
#

You can tell it to build a specific build

#

If you really want 1.20

bold plume
#

ok thanks

chrome beacon
#

but there's no need for that

bold plume
#

Before calling chunk.load, should I call chunk.isloaded?

chrome beacon
#

Don't load the chunk

#

I've said this so many times now

bold plume
#

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"

glossy laurel
mossy crest
bold plume
glossy laurel
#

I did its just hard to read

eternal oxide
#

You shoudl not be updating armor stands in unloaded chunks

glossy laurel
#

have to read it twice to get it

bold plume
eternal oxide
#

Wait until the chunk loads naturally and then update them

glossy laurel
glossy laurel
bold plume
eternal oxide
#

no

bold plume
#

how no

#

chunkloadevent is called I don't know 200 times in 1 second with few players

glossy laurel
bold plume
eternal oxide
#

looping every second you are forcing chunks to remain loaded and performign updates when they are not needed

bold plume
glossy laurel
eternal oxide
#

only update on loaded chunks and yoru overhead is MUCH lower

glossy laurel
#

Why would you loop all entities in all chunks that get loaded

bold plume
glossy laurel
#

also, cant cant u check the .load method, perhaps it already contains an isloaded check

eternal oxide
#

It doe4sn;t matter how many chunks it is

bold plume
#

I always keep 3 chunks in memory but I don't have to keep iterating thousands of times.

eternal oxide
#

if no one is near them they do not need to be updated

bold plume
bold plume
eternal oxide
#

argue all you like, you have been told why its not a good idea and is not performant

glossy laurel
#

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

bold plume
#

I think keeping 3 chunks always loaded is much more performance-enhancing than iterating thousands of entities in the chunkloadevent but ok

eternal oxide
#

they do, but they don;t tick