mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 01:17:47 +01:00
Fix negative sections
This commit is contained in:
parent
2af150c1f0
commit
3ded16f6e5
@ -1,6 +1,5 @@
|
||||
package net.minestom.server.instance;
|
||||
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.Tickable;
|
||||
import net.minestom.server.Viewable;
|
||||
import net.minestom.server.data.Data;
|
||||
@ -25,7 +24,6 @@ import net.minestom.server.utils.chunk.ChunkSupplier;
|
||||
import net.minestom.server.utils.chunk.ChunkUtils;
|
||||
import net.minestom.server.utils.player.PlayerUtils;
|
||||
import net.minestom.server.world.biomes.Biome;
|
||||
import net.minestom.server.world.biomes.BiomeManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -50,8 +48,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
*/
|
||||
public abstract class Chunk implements BlockGetter, BlockSetter, Viewable, Tickable, DataContainer {
|
||||
|
||||
protected static final BiomeManager BIOME_MANAGER = MinecraftServer.getBiomeManager();
|
||||
|
||||
public static final int CHUNK_SIZE_X = 16;
|
||||
public static final int CHUNK_SIZE_Z = 16;
|
||||
public static final int CHUNK_SECTION_SIZE = 16;
|
||||
|
@ -277,7 +277,7 @@ public class Palette implements PublicCloneable<Palette> {
|
||||
* @return the section index of the position
|
||||
*/
|
||||
public static int getSectionIndex(int x, int y, int z) {
|
||||
y %= CHUNK_SECTION_SIZE;
|
||||
y = Math.floorMod(y, CHUNK_SECTION_SIZE);
|
||||
return y << 8 | z << 4 | x;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user