mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 12:42:57 +00:00
Merge remote-tracking branch 'origin/master' into dev
This commit is contained in:
3 files changed
+47
-1
No files matched your search
@@ -34,6 +34,12 @@ public class DimensionBlacklist {
|
||||
}
|
||||
|
||||
public static boolean isDimInBlacklist(int dim) {
|
||||
if (PHConstruct.slimeIslUseWhiteList) {
|
||||
for (int whitelistedDim : PHConstruct.cfgDimWhiteList) {
|
||||
if (whitelistedDim == dim) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (dim < 0) return false;
|
||||
if (dim == 0) return PHConstruct.slimeIslGenDim0;
|
||||
if (PHConstruct.slimeIslGenDim0Only) {
|
||||
@@ -45,6 +51,16 @@ public class DimensionBlacklist {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isOreBushAllowedInDim(int dim) {
|
||||
if (PHConstruct.oreBushUseWhiteList) {
|
||||
for (int whitelistedDim : PHConstruct.cfgOreBushWhiteList) {
|
||||
if (whitelistedDim == dim) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isDimNoPool(int dim) {
|
||||
return noPoolDims.contains(dim);
|
||||
}
|
||||
|
||||
@@ -311,6 +311,30 @@ public class PHConstruct {
|
||||
.getBoolean(false);
|
||||
genOresFlat = config.get("DimBlacklist", "genOresFlat", false, "Generate ores in flat worlds")
|
||||
.getBoolean(false);
|
||||
slimeIslUseWhiteList = config.get(
|
||||
"DimBlacklist",
|
||||
"SlimeIslandUseWhitelist",
|
||||
false,
|
||||
"True: slime islands only generate in dimensions listed in SlimeIslandDimWhitelist; False: use blacklist behavior")
|
||||
.getBoolean(false);
|
||||
cfgDimWhiteList = config.get(
|
||||
"DimBlacklist",
|
||||
"SlimeIslandDimWhitelist",
|
||||
new int[] { 0 },
|
||||
"Dimension IDs where slime islands are allowed to generate (only used when SlimeIslandUseWhitelist=true)")
|
||||
.getIntList();
|
||||
oreBushUseWhiteList = config.get(
|
||||
"DimBlacklist",
|
||||
"OreBushUseWhitelist",
|
||||
false,
|
||||
"True: ore berry bushes only generate in dimensions listed in OreBushDimWhitelist; False: use isSurfaceWorld() check")
|
||||
.getBoolean(false);
|
||||
cfgOreBushWhiteList = config.get(
|
||||
"DimBlacklist",
|
||||
"OreBushDimWhitelist",
|
||||
new int[] { 0 },
|
||||
"Dimension IDs where ore berry bushes are allowed to generate (only used when OreBushUseWhitelist=true)")
|
||||
.getIntList();
|
||||
|
||||
// Experimental functionality
|
||||
coloredHeartRender = config
|
||||
@@ -552,6 +576,10 @@ public class PHConstruct {
|
||||
public static boolean slimeIslGenDim0;
|
||||
public static boolean genIslandsFlat;
|
||||
public static boolean genOresFlat;
|
||||
public static boolean slimeIslUseWhiteList;
|
||||
public static int[] cfgDimWhiteList;
|
||||
public static boolean oreBushUseWhiteList;
|
||||
public static int[] cfgOreBushWhiteList;
|
||||
|
||||
// Experimental functionality
|
||||
public static boolean coloredHeartRender;
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
import tconstruct.util.config.DimensionBlacklist;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
|
||||
@@ -39,7 +40,8 @@ public class TBaseWorldGenerator implements IWorldGenerator {
|
||||
generateNether(random, chunkX * 16, chunkZ * 16, world);
|
||||
} else if (world.provider.terrainType != WorldType.FLAT || PHConstruct.genOresFlat) {
|
||||
generateSurface(random, chunkX * 16, chunkZ * 16, world);
|
||||
if (world.provider.isSurfaceWorld()) generateOreBushes(random, chunkX * 16, chunkZ * 16, world);
|
||||
if (world.provider.isSurfaceWorld() && DimensionBlacklist.isOreBushAllowedInDim(world.provider.dimensionId))
|
||||
generateOreBushes(random, chunkX * 16, chunkZ * 16, world);
|
||||
}
|
||||
|
||||
if (PHConstruct.superfunWorld && world.provider.isSurfaceWorld()) {
|
||||
|
||||
Reference in new issue
Block a user