From 7d2c4aba10d4cb1d694460a07dc309150acde0d6 Mon Sep 17 00:00:00 2001 From: Steffen Temme Date: Fri, 2 Dec 2016 16:18:16 +0100 Subject: [PATCH 1/3] Added a TFC_Climate instance and function resolving through it to allow replacing of the instance and therefore the functions. This allows Addons to alter the temperature calculations. --- .../com/bioxx/tfc/Core/TFC_Climate.java | 282 ++++++++++++------ 1 file changed, 192 insertions(+), 90 deletions(-) diff --git a/src/Common/com/bioxx/tfc/Core/TFC_Climate.java b/src/Common/com/bioxx/tfc/Core/TFC_Climate.java index f317b9a20..fb5e15190 100644 --- a/src/Common/com/bioxx/tfc/Core/TFC_Climate.java +++ b/src/Common/com/bioxx/tfc/Core/TFC_Climate.java @@ -21,109 +21,136 @@ public class TFC_Climate private static final float[] Y_FACTOR_CACHE = new float[441]; private static final float[] Z_FACTOR_CACHE = new float[30001]; private static final float[][] MONTH_TEMP_CACHE = new float[12][30001]; + + //the instance is used to resolve the static function calls. + private static TFC_Climate instance; //private static int[][] insolationMap; + //it is not possible to create an instance ecept for the class itself + private TFC_Climate() + { + + } + //this method handles all calls for the instance + public static TFC_Climate getInstance() + { + if(instance == null){ + instance = new TFC_Climate(); + } + return instance; + } + + //this allows extending classes to replace the standard instance with its own + protected static void setInstance(TFC_Climate climate){ + instance = climate; + } + /** * All Temperature related code */ + //static functions call a private function via the instance public static void initCache() { + getInstance()._initCache(); + } + //the private functions contain the original code + private void _initCache(){ //internationally accepted average lapse time is 6.49 K / 1000 m, for the first 11 km of the atmosphere. I suggest graphing our temperature - //across the 110 m against 2750 m, so that gives us a change of 1.6225 / 10 blocks, which isn't /terrible/ - //Now going to attemp exonential growth. calculations but change in temperature at 17.8475 for our system, so that should be the drop at 255. - //therefore, change should be temp - f(x), where f(x) is an exp function roughly equal to f(x) = (x^2)/ 677.966. - //This seems to work nicely. I like this. Since creative allows players to travel above 255, I'll see if I can't code in the rest of it. - //The upper troposhere has no lapse rate, so we'll just use that. - //The equation looks rather complicated, but you can see it here: - // http://www.wolframalpha.com/input/?i=%28%28%28x%5E2+%2F+677.966%29+*+%280.5%29*%28%28%28110+-+x%29+%2B+%7C110+-+x%7C%29%2F%28110+- - // +x%29%29%29+%2B+%28%280.5%29*%28%28%28x+-+110%29+%2B+%7Cx+-+110%7C%29%2F%28x+-+110%29%29+*+x+*+0.16225%29%29+0+to+440 - - for (int y = 0; y < Y_FACTOR_CACHE.length; y += 1) { - // temp = temp - (ySq / 677.966f) * (((110.01f - y) + Math.abs(110.01f - y)) / (2 * (110.01f - y))); - // temp -= (0.16225 * y * (((y - 110.01f) + Math.abs(y - 110.01f)) / (2 * (y - 110.01f)))); - - // float ySq = y * y; - // float diff = 110.01f - y; - // float factor = (ySq / 677.966f) * ((diff + Math.abs(diff)) / (2 * diff)) - // + 0.16225f * y * ((diff - Math.abs(diff)) / (2 * diff)); - - //more optimization: using an if should be more efficient (and simpler) - float factor; - if (y < 110) { - // diff > 0 - factor = y * y / 677.966f; // 17.85 for y=110 - } else { - // diff <= 0 - factor = 0.16225f * y; // 17.85 for y=110 - } - Y_FACTOR_CACHE[y] = factor; - } - - for(int zCoord = 0; zCoord < getMaxZPos() + 1; ++zCoord) - { - float factor = 0; - float z = zCoord; - - factor = (getMaxZPos()-z)/(getMaxZPos()); - - Z_FACTOR_CACHE[zCoord] = factor; - - for(int month = 0; month < 12; ++month) - { - final float MAXTEMP = 35F; - - double angle = factor * (Math.PI / 2); - double latitudeFactor = Math.cos(angle); - - switch(month) - { - case 10: - { - MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP-13.5*latitudeFactor - (latitudeFactor*55)); - break; + //across the 110 m against 2750 m, so that gives us a change of 1.6225 / 10 blocks, which isn't /terrible/ + //Now going to attemp exonential growth. calculations but change in temperature at 17.8475 for our system, so that should be the drop at 255. + //therefore, change should be temp - f(x), where f(x) is an exp function roughly equal to f(x) = (x^2)/ 677.966. + //This seems to work nicely. I like this. Since creative allows players to travel above 255, I'll see if I can't code in the rest of it. + //The upper troposhere has no lapse rate, so we'll just use that. + //The equation looks rather complicated, but you can see it here: + // http://www.wolframalpha.com/input/?i=%28%28%28x%5E2+%2F+677.966%29+*+%280.5%29*%28%28%28110+-+x%29+%2B+%7C110+-+x%7C%29%2F%28110+- + // +x%29%29%29+%2B+%28%280.5%29*%28%28%28x+-+110%29+%2B+%7Cx+-+110%7C%29%2F%28x+-+110%29%29+*+x+*+0.16225%29%29+0+to+440 + + for (int y = 0; y < Y_FACTOR_CACHE.length; y += 1) { + // temp = temp - (ySq / 677.966f) * (((110.01f - y) + Math.abs(110.01f - y)) / (2 * (110.01f - y))); + // temp -= (0.16225 * y * (((y - 110.01f) + Math.abs(y - 110.01f)) / (2 * (y - 110.01f)))); + + // float ySq = y * y; + // float diff = 110.01f - y; + // float factor = (ySq / 677.966f) * ((diff + Math.abs(diff)) / (2 * diff)) + // + 0.16225f * y * ((diff - Math.abs(diff)) / (2 * diff)); + + //more optimization: using an if should be more efficient (and simpler) + float factor; + if (y < 110) { + // diff > 0 + factor = y * y / 677.966f; // 17.85 for y=110 + } else { + // diff <= 0 + factor = 0.16225f * y; // 17.85 for y=110 + } + Y_FACTOR_CACHE[y] = factor; } - case 9: - case 11: - { - MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP -12.5*latitudeFactor- (latitudeFactor*53)); - break; - } - case 0: - case 8: - { - MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP -10*latitudeFactor- (latitudeFactor*46)); - break; - } - case 1: - case 7: - { - MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP -7.5*latitudeFactor- (latitudeFactor*40)); - break; - } - case 2: - case 6: - { - MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP - 5*latitudeFactor- (latitudeFactor*33)); - break; - } - case 3: - case 5: - { - MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP -2.5*latitudeFactor- (latitudeFactor*27)); - break; - } - case 4: + + for(int zCoord = 0; zCoord < getMaxZPos() + 1; ++zCoord) { - MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP -1.5*latitudeFactor- (latitudeFactor*27)); - break; + float factor = 0; + float z = zCoord; + + factor = (getMaxZPos()-z)/(getMaxZPos()); + + Z_FACTOR_CACHE[zCoord] = factor; + + for(int month = 0; month < 12; ++month) + { + final float MAXTEMP = 35F; + + double angle = factor * (Math.PI / 2); + double latitudeFactor = Math.cos(angle); + + switch(month) + { + case 10: + { + MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP-13.5*latitudeFactor - (latitudeFactor*55)); + break; + } + case 9: + case 11: + { + MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP -12.5*latitudeFactor- (latitudeFactor*53)); + break; + } + case 0: + case 8: + { + MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP -10*latitudeFactor- (latitudeFactor*46)); + break; + } + case 1: + case 7: + { + MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP -7.5*latitudeFactor- (latitudeFactor*40)); + break; + } + case 2: + case 6: + { + MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP - 5*latitudeFactor- (latitudeFactor*33)); + break; + } + case 3: + case 5: + { + MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP -2.5*latitudeFactor- (latitudeFactor*27)); + break; + } + case 4: + { + MONTH_TEMP_CACHE[month][zCoord] = (float)(MAXTEMP -1.5*latitudeFactor- (latitudeFactor*27)); + break; + } + } + } } - } - } - } } - + protected static float getZFactor(int zCoord) { if(zCoord < 0) @@ -217,6 +244,10 @@ protected static float getTempSpecificDay(World world,int day, int x, int z) } public static float getHeightAdjustedTemp(World world, int x, int y, int z) + { + return getInstance()._getHeightAdjustedTemp(world, x, y, z); + } + private float _getHeightAdjustedTemp(World world, int x, int y, int z) { float temp = getTemp(world, x, z); temp += getTemp(world, x+1, z); @@ -249,6 +280,10 @@ public static float getHeightAdjustedTemp(World world, int x, int y, int z) } public static float adjustHeightToTemp(int y, float temp) + { + return getInstance()._adjustHeightToTemp(y, temp); + } + private float _adjustHeightToTemp(int y, float temp) { //internationally accepted average lapse time is 6.49 K / 1000 m, for the first 11 km of the atmosphere. I suggest graphing our temperature //across the 110 m against 2750 m, so that gives us a change of 1.6225 / 10 blocks, which isn't /terrible/ @@ -271,6 +306,10 @@ public static float adjustHeightToTemp(int y, float temp) } public static float getHeightAdjustedTempSpecificDay(World world,int day, int x, int y, int z) + { + return getInstance()._getHeightAdjustedTempSpecificDay(world, day, x, y, z); + } + private float _getHeightAdjustedTempSpecificDay(World world,int day, int x, int y, int z) { float temp = getTempSpecificDay(world, day, x, z); temp = adjustHeightToTemp(y,temp); @@ -278,6 +317,10 @@ public static float getHeightAdjustedTempSpecificDay(World world,int day, int x, } public static float getHeightAdjustedTempSpecificDay(World world,int day, int hour, int x, int y, int z) + { + return getInstance()._getHeightAdjustedTempSpecificDay(world, day, hour, x, y, z); + } + private float _getHeightAdjustedTempSpecificDay(World world,int day, int hour, int x, int y, int z) { float temp = getTemp(world, day, hour, x, z); temp = adjustHeightToTemp(y,temp); @@ -285,6 +328,10 @@ public static float getHeightAdjustedTempSpecificDay(World world,int day, int ho } public static float getHeightAdjustedBioTemp(World world,int day, int x, int y, int z) + { + return getInstance()._getHeightAdjustedBioTemp(world, day, x, y, z); + } + private float _getHeightAdjustedBioTemp(World world,int day, int x, int y, int z) { float temp = getBioTemp(world, day, x, z); temp = adjustHeightToTemp(y,temp); @@ -292,11 +339,19 @@ public static float getHeightAdjustedBioTemp(World world,int day, int x, int y, } public static float getMaxTemperature() + { + return getInstance()._getMaxTemperature(); + } + private float _getMaxTemperature() { return 52; } public static float getBioTemperatureHeight(World world,int x, int y, int z) + { + return getInstance()._getBioTemperatureHeight(world, x, y, z); + } + private float _getBioTemperatureHeight(World world,int x, int y, int z) { float temp = 0; for(int i = 0; i < 12; i++) @@ -310,6 +365,10 @@ public static float getBioTemperatureHeight(World world,int x, int y, int z) } public static float getBioTemperature(World world,int x, int z) + { + return getInstance()._getBioTemperature(world, x, z); + } + private float _getBioTemperature(World world,int x, int z) { float temp = 0; for(int i = 0; i < 24; i++) @@ -327,6 +386,10 @@ public static float getBioTemperature(World world,int x, int z) * Provides the basic grass color based on the biome temperature and rainfall */ public static int getGrassColor(World world, int x, int y, int z) + { + return getInstance()._getGrassColor(world, x, y, z); + } + private int _getGrassColor(World world, int x, int y, int z) { float temp = (getTemp(world, x, z) + getMaxTemperature()) / (getMaxTemperature() * 2); @@ -343,6 +406,10 @@ public static int getGrassColor(World world, int x, int y, int z) * Provides the basic foliage color based on the biome temperature and rainfall */ public static int getFoliageColor(World world, int x, int y, int z) + { + return getInstance()._getFoliageColor(world, x, y, z); + } + private int _getFoliageColor(World world, int x, int y, int z) { float temperature = getHeightAdjustedTempSpecificDay(world, TFC_Time.getDayOfYear(), x, y, z); float rainfall = getRainfall(world, x, y, z); @@ -366,6 +433,10 @@ public static int getFoliageColor(World world, int x, int y, int z) * Provides the basic foliage color based on the biome temperature and rainfall */ public static int getFoliageColorEvergreen(World world, int x, int y, int z) + { + return getInstance()._getFoliageColorEvergreen(world, x, y, z); + } + private int _getFoliageColorEvergreen(World world, int x, int y, int z) { //int month = TFC_Time.getSeasonAdjustedMonth(z); float rainfall = getRainfall(world, x, y, z); @@ -387,8 +458,11 @@ public static int getFoliageColorEvergreen(World world, int x, int y, int z) /** * All Rainfall related code */ - public static float getRainfall(World world, int x, int y, int z) + { + return getInstance()._getRainfall(world, x, y, z); + } + private float _getRainfall(World world, int x, int y, int z) { if (world.isRemote && TFC_Core.getCDM(world) != null) { @@ -407,21 +481,37 @@ public static float getRainfall(World world, int x, int y, int z) } public static int getTreeLayer(World world,int x, int y, int z, int index) + { + return getInstance()._getTreeLayer(world, x, y, z, index); + } + private int _getTreeLayer(World world,int x, int y, int z, int index) { return getCacheManager(world).getTreeLayerAt(x, z, index).data1; } public static DataLayer getRockLayer(World world,int x, int y, int z, int index) + { + return getInstance()._getRockLayer(world, x, y, z, index); + } + private DataLayer _getRockLayer(World world,int x, int y, int z, int index) { return getCacheManager(world).getRockLayerAt(x, z, index); } public static int getMaxZPos() + { + return getInstance()._getMaxZPos(); + } + private int _getMaxZPos() { return 30000; } public static boolean isSwamp(World world, int x, int y, int z) + { + return getInstance()._isSwamp(world, x, y, z); + } + private boolean _isSwamp(World world, int x, int y, int z) { float rain = getRainfall(world, x, y, z); float evt = getCacheManager(world).getEVTLayerAt(x, z).floatdata1; @@ -429,6 +519,10 @@ public static boolean isSwamp(World world, int x, int y, int z) } public static int getStability(World world, int x, int z) + { + return getInstance()._getStability(world, x, z); + } + private int _getStability(World world, int x, int z) { if (getCacheManager(world) != null) return getCacheManager(world).getStabilityLayerAt(x, z).data1; @@ -437,11 +531,19 @@ public static int getStability(World world, int x, int z) } public static WorldCacheManager getCacheManager(World world) + { + return getInstance()._getCacheManager(world); + } + private WorldCacheManager _getCacheManager(World world) { return worldPair.get(world); } public static void removeCacheManager(World world) + { + getInstance()._removeCacheManager(world);; + } + private void _removeCacheManager(World world) { if(worldPair.containsKey(world)) worldPair.remove(world); From f617cd309707a9d123c1b6af6a816f3aa865ce0e Mon Sep 17 00:00:00 2001 From: Steffen Temme Date: Fri, 2 Dec 2016 17:28:46 +0100 Subject: [PATCH 2/3] Changed Constructor to be protected instead of private as it would have hindered extending classes to call the implicite constructor. --- src/Common/com/bioxx/tfc/Core/TFC_Climate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/com/bioxx/tfc/Core/TFC_Climate.java b/src/Common/com/bioxx/tfc/Core/TFC_Climate.java index fb5e15190..fa9ccee26 100644 --- a/src/Common/com/bioxx/tfc/Core/TFC_Climate.java +++ b/src/Common/com/bioxx/tfc/Core/TFC_Climate.java @@ -28,7 +28,7 @@ public class TFC_Climate //private static int[][] insolationMap; //it is not possible to create an instance ecept for the class itself - private TFC_Climate() + protected TFC_Climate() { } From 4b4b6889d308a752d40859a86f0e281d56354229 Mon Sep 17 00:00:00 2001 From: Steffen Temme Date: Fri, 2 Dec 2016 18:13:41 +0100 Subject: [PATCH 3/3] Changed the formerly private dummy methods to protected to make them overrideable. --- .../com/bioxx/tfc/Core/TFC_Climate.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Common/com/bioxx/tfc/Core/TFC_Climate.java b/src/Common/com/bioxx/tfc/Core/TFC_Climate.java index fa9ccee26..7c7f91f3a 100644 --- a/src/Common/com/bioxx/tfc/Core/TFC_Climate.java +++ b/src/Common/com/bioxx/tfc/Core/TFC_Climate.java @@ -56,7 +56,7 @@ public static void initCache() getInstance()._initCache(); } //the private functions contain the original code - private void _initCache(){ + protected void _initCache(){ //internationally accepted average lapse time is 6.49 K / 1000 m, for the first 11 km of the atmosphere. I suggest graphing our temperature //across the 110 m against 2750 m, so that gives us a change of 1.6225 / 10 blocks, which isn't /terrible/ //Now going to attemp exonential growth. calculations but change in temperature at 17.8475 for our system, so that should be the drop at 255. @@ -247,7 +247,7 @@ public static float getHeightAdjustedTemp(World world, int x, int y, int z) { return getInstance()._getHeightAdjustedTemp(world, x, y, z); } - private float _getHeightAdjustedTemp(World world, int x, int y, int z) + protected float _getHeightAdjustedTemp(World world, int x, int y, int z) { float temp = getTemp(world, x, z); temp += getTemp(world, x+1, z); @@ -283,7 +283,7 @@ public static float adjustHeightToTemp(int y, float temp) { return getInstance()._adjustHeightToTemp(y, temp); } - private float _adjustHeightToTemp(int y, float temp) + protected float _adjustHeightToTemp(int y, float temp) { //internationally accepted average lapse time is 6.49 K / 1000 m, for the first 11 km of the atmosphere. I suggest graphing our temperature //across the 110 m against 2750 m, so that gives us a change of 1.6225 / 10 blocks, which isn't /terrible/ @@ -309,7 +309,7 @@ public static float getHeightAdjustedTempSpecificDay(World world,int day, int x, { return getInstance()._getHeightAdjustedTempSpecificDay(world, day, x, y, z); } - private float _getHeightAdjustedTempSpecificDay(World world,int day, int x, int y, int z) + protected float _getHeightAdjustedTempSpecificDay(World world,int day, int x, int y, int z) { float temp = getTempSpecificDay(world, day, x, z); temp = adjustHeightToTemp(y,temp); @@ -320,7 +320,7 @@ public static float getHeightAdjustedTempSpecificDay(World world,int day, int ho { return getInstance()._getHeightAdjustedTempSpecificDay(world, day, hour, x, y, z); } - private float _getHeightAdjustedTempSpecificDay(World world,int day, int hour, int x, int y, int z) + protected float _getHeightAdjustedTempSpecificDay(World world,int day, int hour, int x, int y, int z) { float temp = getTemp(world, day, hour, x, z); temp = adjustHeightToTemp(y,temp); @@ -331,7 +331,7 @@ public static float getHeightAdjustedBioTemp(World world,int day, int x, int y, { return getInstance()._getHeightAdjustedBioTemp(world, day, x, y, z); } - private float _getHeightAdjustedBioTemp(World world,int day, int x, int y, int z) + protected float _getHeightAdjustedBioTemp(World world,int day, int x, int y, int z) { float temp = getBioTemp(world, day, x, z); temp = adjustHeightToTemp(y,temp); @@ -342,7 +342,7 @@ public static float getMaxTemperature() { return getInstance()._getMaxTemperature(); } - private float _getMaxTemperature() + protected float _getMaxTemperature() { return 52; } @@ -351,7 +351,7 @@ public static float getBioTemperatureHeight(World world,int x, int y, int z) { return getInstance()._getBioTemperatureHeight(world, x, y, z); } - private float _getBioTemperatureHeight(World world,int x, int y, int z) + protected float _getBioTemperatureHeight(World world,int x, int y, int z) { float temp = 0; for(int i = 0; i < 12; i++) @@ -368,7 +368,7 @@ public static float getBioTemperature(World world,int x, int z) { return getInstance()._getBioTemperature(world, x, z); } - private float _getBioTemperature(World world,int x, int z) + protected float _getBioTemperature(World world,int x, int z) { float temp = 0; for(int i = 0; i < 24; i++) @@ -389,7 +389,7 @@ public static int getGrassColor(World world, int x, int y, int z) { return getInstance()._getGrassColor(world, x, y, z); } - private int _getGrassColor(World world, int x, int y, int z) + protected int _getGrassColor(World world, int x, int y, int z) { float temp = (getTemp(world, x, z) + getMaxTemperature()) / (getMaxTemperature() * 2); @@ -409,7 +409,7 @@ public static int getFoliageColor(World world, int x, int y, int z) { return getInstance()._getFoliageColor(world, x, y, z); } - private int _getFoliageColor(World world, int x, int y, int z) + protected int _getFoliageColor(World world, int x, int y, int z) { float temperature = getHeightAdjustedTempSpecificDay(world, TFC_Time.getDayOfYear(), x, y, z); float rainfall = getRainfall(world, x, y, z); @@ -436,7 +436,7 @@ public static int getFoliageColorEvergreen(World world, int x, int y, int z) { return getInstance()._getFoliageColorEvergreen(world, x, y, z); } - private int _getFoliageColorEvergreen(World world, int x, int y, int z) + protected int _getFoliageColorEvergreen(World world, int x, int y, int z) { //int month = TFC_Time.getSeasonAdjustedMonth(z); float rainfall = getRainfall(world, x, y, z); @@ -462,7 +462,7 @@ public static float getRainfall(World world, int x, int y, int z) { return getInstance()._getRainfall(world, x, y, z); } - private float _getRainfall(World world, int x, int y, int z) + protected float _getRainfall(World world, int x, int y, int z) { if (world.isRemote && TFC_Core.getCDM(world) != null) { @@ -484,7 +484,7 @@ public static int getTreeLayer(World world,int x, int y, int z, int index) { return getInstance()._getTreeLayer(world, x, y, z, index); } - private int _getTreeLayer(World world,int x, int y, int z, int index) + protected int _getTreeLayer(World world,int x, int y, int z, int index) { return getCacheManager(world).getTreeLayerAt(x, z, index).data1; } @@ -493,7 +493,7 @@ public static DataLayer getRockLayer(World world,int x, int y, int z, int index) { return getInstance()._getRockLayer(world, x, y, z, index); } - private DataLayer _getRockLayer(World world,int x, int y, int z, int index) + protected DataLayer _getRockLayer(World world,int x, int y, int z, int index) { return getCacheManager(world).getRockLayerAt(x, z, index); } @@ -502,7 +502,7 @@ public static int getMaxZPos() { return getInstance()._getMaxZPos(); } - private int _getMaxZPos() + protected int _getMaxZPos() { return 30000; } @@ -511,7 +511,7 @@ public static boolean isSwamp(World world, int x, int y, int z) { return getInstance()._isSwamp(world, x, y, z); } - private boolean _isSwamp(World world, int x, int y, int z) + protected boolean _isSwamp(World world, int x, int y, int z) { float rain = getRainfall(world, x, y, z); float evt = getCacheManager(world).getEVTLayerAt(x, z).floatdata1; @@ -522,7 +522,7 @@ public static int getStability(World world, int x, int z) { return getInstance()._getStability(world, x, z); } - private int _getStability(World world, int x, int z) + protected int _getStability(World world, int x, int z) { if (getCacheManager(world) != null) return getCacheManager(world).getStabilityLayerAt(x, z).data1; @@ -534,7 +534,7 @@ public static WorldCacheManager getCacheManager(World world) { return getInstance()._getCacheManager(world); } - private WorldCacheManager _getCacheManager(World world) + protected WorldCacheManager _getCacheManager(World world) { return worldPair.get(world); } @@ -543,7 +543,7 @@ public static void removeCacheManager(World world) { getInstance()._removeCacheManager(world);; } - private void _removeCacheManager(World world) + protected void _removeCacheManager(World world) { if(worldPair.containsKey(world)) worldPair.remove(world);