From 2d3310718a5ec386d2ba6bada824d0a96f12f6f4 Mon Sep 17 00:00:00 2001 From: Maxime Legkiy Date: Tue, 7 Feb 2017 04:44:35 +0300 Subject: [PATCH] Add Dimension BlackList Add Other Dimension Oil Generating Save Amount for Other Dimension --- src/main/java/gregtech/api/util/GT_Utility.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 9d9fada6..ba431532 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -1525,11 +1525,14 @@ public class GT_Utility { public static boolean getUndergroundOilSpawns(int aDimensionId) { - if (Math.abs(aDimensionId)==1) return false; //If Nether or End... + //Black list + if (DimensionManager.getProvider(aDimensionId).getClass().getName().contains("net.minecraft.world.WorldProviderHell")) return false; + if (DimensionManager.getProvider(aDimensionId).getClass().getName().contains("net.minecraft.world.WorldProviderEnd")) return false; + //Use settings if (GT_Mod.gregtechproxy.mUndergroundOilOverworld && aDimensionId==0) return true; //Overworld if (GT_Mod.gregtechproxy.mUndergroundOilInRealDimension && isRealDimension(aDimensionId)) return true; //Other real world - + return false; //If other planets... } @@ -1543,7 +1546,7 @@ public class GT_Utility { if (!getUndergroundOilSpawns(aWorld.provider.dimensionId)) return null; - Random tRandom = new Random((aWorld.getSeed() + (getScaleСoordinates(aX,96)) + (7 * (getScaleСoordinates(aZ,96))))); + Random tRandom = new Random((aWorld.getSeed() + aWorld.provider.dimensionId * 2 + (getScaleСoordinates(aX,96)) + (7 * (getScaleСoordinates(aZ,96))))); int oil = tRandom.nextInt(3); double amount = tRandom.nextInt(GT_Mod.gregtechproxy.mUndergroundOilMaxAmount) + tRandom.nextDouble(); oil = tRandom.nextInt(4); @@ -1567,7 +1570,7 @@ public class GT_Utility { tFluid = Materials.Oil.mFluid; } int tAmount = (int) (Math.pow(amount, 5) / 100); - ChunkPosition tPos = new ChunkPosition(getScaleСoordinates(aX,16), 1, getScaleСoordinates(aZ,16)); + ChunkPosition tPos = new ChunkPosition(getScaleСoordinates(aX,16), aWorld.provider.dimensionId+1, getScaleСoordinates(aZ,16)); int[] tInts = new int[2]; if(GT_Proxy.chunkData.containsKey(tPos)){ tInts = GT_Proxy.chunkData.get(tPos);