diff options
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r-- | src/main/java/gregtech/api/world/GTWorldgen.java | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/main/java/gregtech/api/world/GTWorldgen.java b/src/main/java/gregtech/api/world/GTWorldgen.java index 19c3c24245..07c76e0e3a 100644 --- a/src/main/java/gregtech/api/world/GTWorldgen.java +++ b/src/main/java/gregtech/api/world/GTWorldgen.java @@ -9,9 +9,6 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraftforge.common.DimensionManager; -import gregtech.common.WorldgenGTOreLayer; -import gregtech.common.WorldgenGTOreSmallPieces; - public abstract class GTWorldgen { public final String mWorldGenName; @@ -85,6 +82,18 @@ public abstract class GTWorldgen { * Overworld, Twilight Forest and Deep Dark) */ public boolean isGenerationAllowed(World aWorld, Class... aAllowedDimensionTypes) { + return isGenerationAllowed(aWorld, null, aAllowedDimensionTypes); + } + + /** + * + * @param aWorld The World Object + * @param blackListedProviders List of blacklisted Worldgeneration classes + * @param aAllowedDimensionTypes The Types of allowed Worldgeneration + * @return if generation for this world is allowed for MoronTech (tm) OreGen (ATM (2.0.3.1Dev) only End, Nether, + * Overworld, Twilight Forest and Deep Dark) + */ + public boolean isGenerationAllowed(World aWorld, String[] blackListedProviders, Class... aAllowedDimensionTypes) { String aDimName = aWorld.provider.getDimensionName(); if (aDimName.equalsIgnoreCase("Underdark")) { return false; @@ -95,6 +104,15 @@ public abstract class GTWorldgen { Boolean tAllowed = mDimensionMap.get(aDimName); if (tAllowed == null) { + if (blackListedProviders != null) { + for (String dimClass : blackListedProviders) { + if (dimClass.equals( + aWorld.provider.getClass() + .getName())) { + return false; + } + } + } boolean value = false; for (Class aAllowedDimensionType : aAllowedDimensionTypes) { if (aAllowedDimensionType.isInstance(aWorld.provider)) { @@ -103,19 +121,6 @@ public abstract class GTWorldgen { } } - // ugly, but idk how to do it better without hard depping on tf provider in ore constructors - if (this instanceof WorldgenGTOreSmallPieces ore) { - if (ore.twilightForest && aWorld.provider.dimensionId == 7) { - value = true; - } - } - - if (this instanceof WorldgenGTOreLayer ore) { - if (ore.twilightForest && aWorld.provider.dimensionId == 7) { - value = true; - } - } - mDimensionMap.put(aDimName, value); return value; } |