aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/WorldgenGTOreSmallPieces.java
diff options
context:
space:
mode:
authorSpacebuilder2020 <spacebuilder2020@users.noreply.github.com>2024-11-13 23:17:59 -0700
committerGitHub <noreply@github.com>2024-11-14 07:17:59 +0100
commit82ae85b87631c23f01df61905359c222e2524cb4 (patch)
treeaf545984cef883a0f50a4de827d8e32eeeb57f08 /src/main/java/gregtech/common/WorldgenGTOreSmallPieces.java
parentdf50073f364f4db88aadb70022ae7d30367f33cd (diff)
downloadGT5-Unofficial-82ae85b87631c23f01df61905359c222e2524cb4.tar.gz
GT5-Unofficial-82ae85b87631c23f01df61905359c222e2524cb4.tar.bz2
GT5-Unofficial-82ae85b87631c23f01df61905359c222e2524cb4.zip
Adds a blacklist to prevent certain dims like Twilight Forest from generating overworld ores (#3438)
Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: chochem <40274384+chochem@users.noreply.github.com> Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/common/WorldgenGTOreSmallPieces.java')
-rw-r--r--src/main/java/gregtech/common/WorldgenGTOreSmallPieces.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/WorldgenGTOreSmallPieces.java b/src/main/java/gregtech/common/WorldgenGTOreSmallPieces.java
index 4eb4eb4cce..e3be59a628 100644
--- a/src/main/java/gregtech/common/WorldgenGTOreSmallPieces.java
+++ b/src/main/java/gregtech/common/WorldgenGTOreSmallPieces.java
@@ -31,6 +31,14 @@ public class WorldgenGTOreSmallPieces extends GTWorldgen {
public static ArrayList<WorldgenGTOreSmallPieces> sList = new ArrayList<>();
public Class[] mAllowedProviders;
+ public String[] blackListedProviders;
+ public static Class tfProviderClass;
+
+ static {
+ try {
+ tfProviderClass = Class.forName("twilightforest.world.WorldProviderTwilightForest");
+ } catch (ClassNotFoundException ignored) {}
+ }
public WorldgenGTOreSmallPieces(SmallOreBuilder ore) {
super(ore.smallOreName, GregTechAPI.sWorldgenList, ore.enabledByDefault);
@@ -54,6 +62,13 @@ public class WorldgenGTOreSmallPieces extends GTWorldgen {
if (this.mOverworld) {
allowedProviders.add(WorldProviderSurface.class);
+ if (!this.twilightForest) {
+ blackListedProviders = new String[] { "twilightforest.world.WorldProviderTwilightForest" };
+ }
+ }
+
+ if (tfProviderClass != null && this.twilightForest) {
+ allowedProviders.add(tfProviderClass);
}
if (this.mEnd) {