9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-29 03:59:06 +00:00

Fixed Dust of Revealing Pt.1

This commit is contained in:
Vatuu
2022-05-16 17:33:15 +02:00
parent 44c707e059
commit ccc2ed0806
7 changed files with 26 additions and 8 deletions

View File

@@ -58,6 +58,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class Mantle {
private final File dataFolder;
private final int worldHeight;
private final int minY;
private final Map<Long, Long> lastUse;
@Getter
private final Map<Long, TectonicPlate> loadedRegions;
@@ -76,11 +77,12 @@ public class Mantle {
* the world's height (in blocks)
*/
@BlockCoordinates
public Mantle(File dataFolder, int worldHeight) {
public Mantle(File dataFolder, int worldHeight, int minY) {
this.hyperLock = new HyperLock();
this.closed = new AtomicBoolean(false);
this.dataFolder = dataFolder;
this.worldHeight = worldHeight;
this.minY = minY;
this.io = new AtomicBoolean(false);
dataFolder.mkdirs();
unload = new KSet<>();
@@ -330,7 +332,7 @@ public class Mantle {
}
/**
* Gets the data tat the current block position This method will attempt to find a
* Gets the data at the current block position This method will attempt to find a
* Tectonic Plate either by loading it or creating a new one. This method uses
* the hyper lock packaged with each Mantle. The hyperlock allows locking of multiple
* threads at a single region while still allowing other threads to continue
@@ -352,6 +354,7 @@ public class Mantle {
@SuppressWarnings("unchecked")
@BlockCoordinates
public <T> T get(int x, int y, int z, Class<T> t) {
y -= minY;
if(closed.get()) {
throw new RuntimeException("The Mantle is closed");
}