Huge Structure Blocks [Fabric & Forge]

Huge Structure Blocks [Fabric & Forge]

321k Downloads

Limited to length of x=127 on fabric server

Kuphi opened this issue ยท 4 comments

commented

When adding fabric-api-0.79.0+1.19.4.jar and viewdistancefix-1.19.4-1.0.0.jar to both the server and client mods folders, the maximum supported structure length is 127. I tested this on a fresh local install using tlaun.ch and for the server https://fabricmc.net/use/server/, both Minecraft java v1.19.4

The same issue does not exist when playing single player, which has a working 512 limit.

I don't know how to solve this issue. There is a Forge mod which also had a limit of 127x127x127 until version 1.16.5, which was then increased. Maybe the solution rests inside their repository: https://www.curseforge.com/minecraft/mc-mods/structure-expansion (Probably here: nanite/Structure-Expansion@84217ce )

Thanks for looking into it!

commented

I can reproduce, but I don't know where the 127 limit comes from, I searched the entire Minecraft source code for 128 and 127 integers but there is nothing relating to structures.

I already do everything that other mod does, although in a better way (that mod has the metadata limit bug and it also doesn't need to replicate the entire nbt read/write methods, though I think they've fixed it in later commits).

commented

Right, the problem is because Mojang uses writeByte here:

 @Override
public void write(PacketByteBuf buf) {
    buf.writeBlockPos(this.pos);
    buf.writeEnumConstant(this.action);
    buf.writeEnumConstant(this.mode);
    buf.writeString(this.templateName);
    buf.writeByte(this.offset.getX());
    buf.writeByte(this.offset.getY());
    buf.writeByte(this.offset.getZ());
    buf.writeByte(this.size.getX());
    buf.writeByte(this.size.getY());
    buf.writeByte(this.size.getZ());

...which of course has a min of -128 and max of 127.

commented

Thanks for looking into it! So far, copying the world from the server to local minecraft is a fast & easy workaround.

commented

Should be fixed in c2b36c8

libs.zip