]> git.lizzy.rs Git - LightOverlay.git/blobdiff - common/src/main/java/me/shedaniel/lightoverlay/common/CubicChunkPos.java
Update to 1.17
[LightOverlay.git] / common / src / main / java / me / shedaniel / lightoverlay / common / CubicChunkPos.java
index 576724e210615beca35ed593c5466b1293fa706e..5c3a18897e7adb0e9a75b75d17eb9366f5c8f60e 100644 (file)
@@ -2,8 +2,6 @@ package me.shedaniel.lightoverlay.common;
 
 import net.minecraft.core.BlockPos;
 
-import java.util.Objects;
-
 public class CubicChunkPos {
     public final int x;
     public final int y;
@@ -23,7 +21,7 @@ public class CubicChunkPos {
     
     public CubicChunkPos(BlockPos blockPos) {
         this.x = blockPos.getX() >> 4;
-        this.y = blockPos.getY() >> 4;
+        this.y = blockPos.getY() >> 5;
         this.z = blockPos.getZ() >> 4;
     }
     
@@ -53,7 +51,7 @@ public class CubicChunkPos {
     }
     
     public int getMinBlockY() {
-        return this.y << 4;
+        return this.y << 5;
     }
     
     public int getMinBlockZ() {
@@ -65,7 +63,7 @@ public class CubicChunkPos {
     }
     
     public int getMaxBlockY() {
-        return (this.y << 4) + 15;
+        return (this.y << 5) + 31;
     }
     
     public int getMaxBlockZ() {
@@ -80,8 +78,17 @@ public class CubicChunkPos {
         return x == that.x && y == that.y && z == that.z;
     }
     
+    @Override
+    public String toString() {
+        return "CubicChunkPos{" +
+               "x=" + x +
+               ", y=" + y +
+               ", z=" + z +
+               '}';
+    }
+    
     @Override
     public int hashCode() {
-        return Objects.hash(x, y, z);
+        return Long.hashCode(toLong());
     }
 }