Skip to content

Commit 5c8f3bc

Browse files
committed
Tweak biome maths on Fabric & NeoForge
1 parent 75d84aa commit 5c8f3bc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/FabricWorld.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public boolean setBiome(BlockVector3 position, BiomeType biome) {
253253
// Screw it, we know it's really mutable...
254254
var biomeArray = (PalettedContainer<Holder<Biome>>) chunk.getSection(chunk.getSectionIndex(position.y())).getBiomes();
255255
biomeArray.getAndSetUnchecked(
256-
position.x() & 3, position.y() & 3, position.z() & 3,
256+
(position.x() >> 2) & 3, (position.y() >> 2) & 3, (position.z() >> 2) & 3,
257257
getWorld().registryAccess().lookup(Registries.BIOME)
258258
.orElseThrow()
259259
.getOrThrow(ResourceKey.create(Registries.BIOME, Identifier.parse(biome.id())))

worldedit-neoforge/src/main/java/com/sk89q/worldedit/neoforge/NeoForgeWorld.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public boolean setBiome(BlockVector3 position, BiomeType biome) {
243243
LevelChunk chunk = getWorld().getChunk(position.x() >> 4, position.z() >> 4);
244244
var biomes = (PalettedContainer<Holder<Biome>>) chunk.getSection(chunk.getSectionIndex(position.y())).getBiomes();
245245
biomes.getAndSetUnchecked(
246-
position.x() & 3, position.y() & 3, position.z() & 3,
246+
(position.x() >> 2) & 3, (position.y() >> 2) & 3, (position.z() >> 2) & 3,
247247
getWorld().registryAccess().lookupOrThrow(Registries.BIOME)
248248
.getOrThrow(ResourceKey.create(Registries.BIOME, Identifier.parse(biome.id())))
249249
);

0 commit comments

Comments
 (0)