From 59399124fa168566b4a2113df6a8678db4486824 Mon Sep 17 00:00:00 2001 From: cyberpwn Date: Sat, 21 Aug 2021 00:29:01 -0400 Subject: [PATCH] Fix mantle --- .../com/volmit/iris/util/mantle/Mantle.java | 33 ++----------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/volmit/iris/util/mantle/Mantle.java b/src/main/java/com/volmit/iris/util/mantle/Mantle.java index 4d120dfae..a5ad56d6b 100644 --- a/src/main/java/com/volmit/iris/util/mantle/Mantle.java +++ b/src/main/java/com/volmit/iris/util/mantle/Mantle.java @@ -80,7 +80,7 @@ public class Mantle { unload = new KSet<>(); loadedRegions = new KMap<>(); lastUse = new KMap<>(); - ioBurst = MultiBurst.burst; + ioBurst = new MultiBurst("Iris Mantle[" + dataFolder.hashCode() + "]", Thread.MIN_PRIORITY, Runtime.getRuntime().availableProcessors() / 2); Iris.debug("Opened The Mantle " + C.DARK_AQUA + dataFolder.getAbsolutePath()); } @@ -126,19 +126,6 @@ public class Mantle { get(x >> 5, z >> 5).getOrCreate(x & 31, z & 31).flag(flag, flagged); } - /** - * Check very quickly if a tectonic plate exists via cached or the file system - * @param x the x region coordinate - * @param z the z region coordinate - * @return true if it exists - */ - @RegionCoordinates - public boolean hasTectonicPlate(int x, int z) - { - Long k = key(x, z); - return loadedRegions.containsKey(k) || fileForRegion(dataFolder, k).exists(); - } - /** * Iterate data in a chunk * @param x the chunk x @@ -150,11 +137,6 @@ public class Mantle { */ @ChunkCoordinates public void iterateChunk(int x, int z, Class type, Consumer4 iterator, MantleFlag... requiredFlags) { - if(!hasTectonicPlate(x >> 5, z >> 5)) - { - return; - } - for (MantleFlag i : requiredFlags) { if (!hasFlag(x, z, i)) { return; @@ -173,11 +155,6 @@ public class Mantle { */ @ChunkCoordinates public boolean hasFlag(int x, int z, MantleFlag flag) { - if(!hasTectonicPlate(x >> 5, z >> 5)) - { - return false; - } - return get(x >> 5, z >> 5).getOrCreate(x & 31, z & 31).isFlagged(flag); } @@ -234,12 +211,7 @@ public class Mantle { throw new RuntimeException("The Mantle is closed"); } - if(!hasTectonicPlate(x >> 5, z >> 5)) - { - return null; - } - - if (y < 0 || y >= worldHeight) { + if (y < 0) { return null; } @@ -291,6 +263,7 @@ public class Mantle { Iris.reportError(e); } + ioBurst.shutdownNow(); Iris.debug("The Mantle has Closed " + C.DARK_AQUA + dataFolder.getAbsolutePath()); }