Hello!
My server was lagging and i found out that a base had 3k tile entities. I tped to the player's base only to find that he moved his single player building to our server using your mod.
The issue is that every single block is a disguised structure block which is a tile entity.
Can you make it so they change to normal blocks?
I removed his structures (that were just empty buildings) and the lag was fixed.
As I see it: this is impossible, as we need to be able to save the copied block state.
It does not fit in a normal Blockstate and therefore needs to be written to nbt - TileEntity.
It seems like total waste, but I have no idea how to get around this...?
I guess the best you can do is just disable Construction blocks on your server?
@MajorTuvok How do mods like the older chisel mod ( the one with ramps and shit where you would right click on the wooden structure to apply the new block? was that all TileEntity based? ) also, how does chisel (Algos one) handle the lag side of things, I've herd it's only hard for the client to run but server is pretty much untouched
It probably doesn't help that ConstructionBlockTileEntitys save two blockstates, rather than one. I asked Dire, and he said he's not sure if they even need to do so.
Likely should be something we look into then :+1:
What we can do is leave the blocks as-is, but store a optimized set of BlockPoss and listen for block replace events. When such event is triggered, if its targeting position is inside the set, we drop a construction paste item instead.
To summarize a discussion we had on Discord: there's little we can do performance wise...
We can remove an unnecessary blockstate, but that won't help performance.
Could you maybe do some sampling to show that your Problems come from construction blocks (and if so what is taking up the processing time)? Ender io conduit facades are Tiles too and I have never heard of them killing performance. Especially as construction blocks do nothing during the tick, I'm not convinced that we were the performance killers.
I hope these construction blocks don't implement ITickable? If they do then maybe that would be something to fix. If they don't then I don't think having them tile entities should cause that much lag. Unless they also have a TESR associated with them?
Fortunately, the tileentities of construction blocks neither implement ITickable, nor use a TESR. Instead, they use extended blockstates with the mimicked blockstates saved as unlisted properties, and are mapped to custom models that return the quads of the models of those mimicked blockstates in IBakedModel#getQuads.
Like Phylo said no ticks and no tesrs. They are about as performant as they can be :). Disable them on your server if they are causing issues. It鈥檚 my understanding that They shouldn鈥檛 cause tps lag. Only a bit of loading lag when you go to the area as it sends all the data to your client.
As we don't seem to do anything wrong, closing. There must have been something else causing the lag...
Did the person who pasted the building maybe build something laggy inside?
To verify validity, provide sampling that buildinggadgets is causing the lag.
Sorry that we can't do more...