mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-14 11:46:08 +00:00
Performance Improvements
This commit is contained in:
@@ -21,6 +21,8 @@ package com.volmit.iris.util.mantle;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.engine.mantle.MantleWriter;
|
||||
import com.volmit.iris.engine.object.basic.IrisPosition;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeaturePositional;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
@@ -101,6 +103,20 @@ public class Mantle {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain a cached writer which only contains cached chunks.
|
||||
* This avoids locking on regions when writing to lots of chunks
|
||||
* @param x the x chunk
|
||||
* @param z the z chunk
|
||||
* @param radius the radius chunks
|
||||
* @return the writer
|
||||
*/
|
||||
@ChunkCoordinates
|
||||
public MantleWriter write(EngineMantle engineMantle, int x, int z, int radius)
|
||||
{
|
||||
return new MantleWriter(engineMantle, this, x, z, radius);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lower a flag if it is raised. If the flag was lowered (meaning it was previously raised), execute the runnable
|
||||
* @param x the chunk x
|
||||
@@ -911,4 +927,8 @@ public class Mantle {
|
||||
private static double lengthSq(double x, double z) {
|
||||
return (x * x) + (z * z);
|
||||
}
|
||||
|
||||
public int getWorldHeight() {
|
||||
return worldHeight;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user