diff options
author | HoleFish <48403212+HoleFish@users.noreply.github.com> | 2024-05-18 04:43:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-17 22:43:26 +0200 |
commit | 380d9a3970199a5efc8e05e2c9b03a42d1ddb7e9 (patch) | |
tree | 5f43b27886af385888e657e9dc0b2f83a942b6e7 /src/main | |
parent | c3eb8081589b53356f7db89fcdc29dc386e999c3 (diff) | |
download | GT5-Unofficial-380d9a3970199a5efc8e05e2c9b03a42d1ddb7e9.tar.gz GT5-Unofficial-380d9a3970199a5efc8e05e2c9b03a42d1ddb7e9.tar.bz2 GT5-Unofficial-380d9a3970199a5efc8e05e2c9b03a42d1ddb7e9.zip |
Make worldgen predicate more flexible (#2600)
add method
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/gregtech/api/world/GT_Worldgen.java | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/main/java/gregtech/api/world/GT_Worldgen.java b/src/main/java/gregtech/api/world/GT_Worldgen.java index 4e1d5c7a73..4e9ed6229b 100644 --- a/src/main/java/gregtech/api/world/GT_Worldgen.java +++ b/src/main/java/gregtech/api/world/GT_Worldgen.java @@ -65,20 +65,23 @@ public abstract class GT_Worldgen { * Overworld, Twilight Forest and Deep Dark) */ public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { + return isGenerationAllowed(aWorld.provider.getDimensionName(), aDimensionType, aAllowedDimensionType); + } - if (!((aWorld.provider.getDimensionName() - .equalsIgnoreCase("Overworld")) - || (aWorld.provider.getDimensionName() - .equalsIgnoreCase("Nether")) - || (aWorld.provider.getDimensionName() - .equalsIgnoreCase("The End")) - || (aWorld.provider.getDimensionName() - .equalsIgnoreCase("Twilight Forest")) - || (aWorld.provider.getDimensionName() - .equalsIgnoreCase("Underdark")))) - return false; + /** + * + * @param aDimName The Dimension Name + * @param aDimensionType The Type of Worldgeneration to add. -1 = Nether, 0 = Overworld, +1 = End + * @param aAllowedDimensionType The Type 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(String aDimName, int aDimensionType, int aAllowedDimensionType) { + if (!(aDimName.equalsIgnoreCase("Overworld") || aDimName.equalsIgnoreCase("Nether") + || aDimName.equalsIgnoreCase("The End") + || aDimName.equalsIgnoreCase("Twilight Forest") + || aDimName.equalsIgnoreCase("Underdark"))) return false; - String aDimName = aWorld.provider.getDimensionName(); Boolean tAllowed = mDimensionMap.get(aDimName); if (tAllowed == null) { boolean tValue = GregTech_API.sWorldgenFile |