From f7e022d2c823d087e4a9763e098f18e4e014b4e8 Mon Sep 17 00:00:00 2001 From: SirYwell Date: Sat, 14 Jan 2023 21:17:28 +0100 Subject: [PATCH] Fix biome math --- .../core/extent/clipboard/DiskBasedClipboard.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskBasedClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskBasedClipboard.java index a177275a1..c87f0c1c6 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskBasedClipboard.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskBasedClipboard.java @@ -1,5 +1,6 @@ package com.fastasyncworldedit.core.extent.clipboard; +import com.fastasyncworldedit.core.util.MathMan; import com.fastasyncworldedit.core.util.io.MemoryFile; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.WorldEditException; @@ -90,7 +91,13 @@ public sealed class DiskBasedClipboard implements Clipboard { } private static long requiredBiomeEntries(BlockVector3 dimensions) { - return requiredEntries(dimensions.divide(4)); + // biomes are based on 4*4*4, so we can divide the dimensions of the region by 4 + BlockVector3 biomeDimensions = BlockVector3.at( + MathMan.ceilDiv(dimensions.getX(), 4), + MathMan.ceilDiv(dimensions.getY(), 4), + MathMan.ceilDiv(dimensions.getZ(), 4) + ); + return requiredEntries(biomeDimensions); } @Override