From ff7d6f4137a3812cb272dea83b82fda0eeed10fc Mon Sep 17 00:00:00 2001 From: Sergey Shatunov Date: Thu, 11 Feb 2016 16:52:32 +0700 Subject: [PATCH] Whoops, chunk coords stored in other order (fix #360) --- .../java/kcauldron/wrapper/VanillaChunkHashMap.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/kcauldron/wrapper/VanillaChunkHashMap.java b/src/main/java/kcauldron/wrapper/VanillaChunkHashMap.java index c85796f..e0a3fc6 100644 --- a/src/main/java/kcauldron/wrapper/VanillaChunkHashMap.java +++ b/src/main/java/kcauldron/wrapper/VanillaChunkHashMap.java @@ -13,7 +13,9 @@ public class VanillaChunkHashMap extends LongHashMap { @Override public void add(long key, Object value) { - manager.putChunk((Chunk) value); + final int z = (int) (key >>> 32); + final int x = (int) (key); + manager.putChunk((Chunk) value, x, z); } @Override @@ -23,15 +25,15 @@ public class VanillaChunkHashMap extends LongHashMap { @Override public Object getValueByKey(long key) { - final int x = (int) (key >>> 32); - final int z = (int) (key); + final int z = (int) (key >>> 32); + final int x = (int) (key); return manager.getChunk(x, z); } @Override public Object remove(long key) { - final int x = (int) (key >>> 32); - final int z = (int) (key); + final int z = (int) (key >>> 32); + final int x = (int) (key); return manager.remove(x, z); } }