Remove Spigot Server Patch 0332 - Allow Saving of Oversized Chunks


As anarchy servers are fairly popular and so is the chunk dupe that some of them have, (overloading the chunk with data) I’ve tried removing the patch that Spigot uses to implement a fix, but removing the patch’s file and the entry when you do ./paper e server then remove the entry with Allow Saving of Oversized Chunks.


How do I remove Spigot Server Patch 332 (Allow Saving of Oversized Chunks) successfully?


You already figured out what patch to remove. Fortunately for you, only patch 358 also touches something nearby to what 332 does.

To loose paper support and get the dupe back - remove patch file 332 and then run ./paper patch. It’ll fail at applying patch 358-Fix-World-isChunkGenerated-calls to NMS/ Just take a look at the patch that failed and the conflict resolution should be easy enough.

Once resolved, you should have the source of your server with your awesome dupe!

This was discussed on discord, papers patch does NOT touch saving, nor does spigots, so removing either of those patches will do nothing you’re intending, you’d need to patch the chunk save method to not save if it’s oversized, aka: remove mojangs oversized save call

public void close() throws IOException {
    ByteBuffer bytebuffer = ByteBuffer.wrap(this.buf, 0, this.count);

    bytebuffer.putInt(0, this.count - 5 + 1);
    RegionFile.this.a(this.b, bytebuffer);

If I remove RegionFile.this.a(this.b, bytebuffer);, which calls the oversize chunk detector, I’m assuming that the chunks will never save to the “oversized” chunk file?

That sounds dangerous and likely not what you want… you’d have to find the code that checks sizes.

But you’re better off simply writing a plugin that allows players to dupe by a command, it would be much safer and less lag for your server.

This is a horrible way to allow duping.

This exploit will destroy your servers performance. 2b players were HAPPY when it was fixed…