aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/sc2/modules
diff options
context:
space:
mode:
authorboubou19 <miisterunknown@gmail.com>2023-04-09 01:08:26 +0200
committerGitHub <noreply@github.com>2023-04-09 01:08:26 +0200
commit26caa265b7eae49767947e1ff4e6cfc8166b07f5 (patch)
tree0fc0332da7a843cf153bf75fcc2e20601bbf18ee /src/main/java/gtPlusPlus/xmod/sc2/modules
parentc33b3ba66194c7441fbd437530d21a51aa4395d5 (diff)
downloadGT5-Unofficial-26caa265b7eae49767947e1ff4e6cfc8166b07f5.tar.gz
GT5-Unofficial-26caa265b7eae49767947e1ff4e6cfc8166b07f5.tar.bz2
GT5-Unofficial-26caa265b7eae49767947e1ff4e6cfc8166b07f5.zip
clean up GT++ code (#589)
* yeet big reactor support * yeet IC2 classic support * yeet pneumaticraft support * yeet More Planets support * yeet Immersive Engineering support * yeet Psychedilicraft support * yeet Beyond Reality Core support * sort mods to see what must be purged * yeet simply jetpacks * yeet RFTools * yeet xReliquary * yeet RedTech * yeet Mekanism * yeet GrowthCraft * yeet ihl * leftover cleaning * yeet thermal fondation support * yeet compact windmills support * spotless * remove constants from LoadedMods (part 1 / 2) * spotless * remove constants from LoadedMods (part 2 / 2) * use mod id enum instead of strings + optimize imports * Loaded.isModLoaded -> enum * restore RA init * missing ! * start organizing recipes stuff * fix crash on world load in dev * remove unused class * remove HazmatUtils.java * move all the removals * remove enableHarderRecipesForHighTierCasings and usages(disabled in the pack) * move some pyrolyse oven recipes to its own file * sa * bump GT version * bump GT5U version * spotless apply * use Everglades entry from the mod enum --------- Co-authored-by: miozune <miozune@gmail.com> Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/sc2/modules')
-rw-r--r--src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java51
1 files changed, 26 insertions, 25 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java b/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java
index ba4f76ae34..cb099d37f8 100644
--- a/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java
+++ b/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java
@@ -1,5 +1,6 @@
package gtPlusPlus.xmod.sc2.modules;
+import static gregtech.api.enums.Mods.Forestry;
import static net.minecraft.init.Blocks.farmland;
import java.lang.reflect.Field;
@@ -14,7 +15,6 @@ import net.minecraft.world.World;
import vswe.stevescarts.Carts.MinecartModular;
import vswe.stevescarts.Modules.Addons.ModuleAddon;
import vswe.stevescarts.Modules.ICropModule;
-import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
public class ModuleExoticSeeds extends ModuleAddon implements ICropModule {
@@ -56,8 +56,8 @@ public class ModuleExoticSeeds extends ModuleAddon implements ICropModule {
// If Forestry is loaded, let's make this upgrade convert farmland to Humus.
/*
- * if (LoadedMods.Forestry) { Block mFarmLand = world.getBlock(x, y-1, z); if (mFarmLand == farmland) { Block h
- * = tryGetHumus(); if (h != farmland) { world.setBlock(x, y-1, z, h); } } }
+ * if (Forestry.isModLoaded()) { Block mFarmLand = world.getBlock(x, y-1, z); if (mFarmLand == farmland) { Block
+ * h = tryGetHumus(); if (h != farmland) { world.setBlock(x, y-1, z, h); } } }
*/
return b instanceof BlockCrops && m == 7;
@@ -73,35 +73,36 @@ public class ModuleExoticSeeds extends ModuleAddon implements ICropModule {
private static Block mForestryHumusBlock;
private synchronized Block tryGetHumus() {
- if (!LoadedMods.Forestry) {
+ if (!Forestry.isModLoaded()) {
return farmland;
- } else {
- if (mForestryHumusBlockClass == null || mForestryHumusBlock == null) {
- try {
- mForestryHumusBlockClass = ReflectionUtils.getClass("forestry.plugins.PluginCore");
- Field blocks = ReflectionUtils.getField(mForestryHumusBlockClass, "blocks");
- if (blocks != null) {
- Object blockRegistryCoreObject = blocks.get(null);
- mForestryBlockRegistryCoreClass = ReflectionUtils
- .getClass("forestry.core.blocks.BlockRegistryCore");
- if (mForestryBlockRegistryCoreClass != null && blockRegistryCoreObject != null) {
- Field soil = ReflectionUtils.getField(mForestryBlockRegistryCoreClass, "soil");
- if (soil != null) {
- Block testHumus = (Block) soil.get(blockRegistryCoreObject);
- if (testHumus != null) {
- mForestryHumusBlock = testHumus;
- }
+ }
+
+ if (mForestryHumusBlockClass == null || mForestryHumusBlock == null) {
+ try {
+ mForestryHumusBlockClass = ReflectionUtils.getClass("forestry.plugins.PluginCore");
+ Field blocks = ReflectionUtils.getField(mForestryHumusBlockClass, "blocks");
+ if (blocks != null) {
+ Object blockRegistryCoreObject = blocks.get(null);
+ mForestryBlockRegistryCoreClass = ReflectionUtils
+ .getClass("forestry.core.blocks.BlockRegistryCore");
+ if (mForestryBlockRegistryCoreClass != null && blockRegistryCoreObject != null) {
+ Field soil = ReflectionUtils.getField(mForestryBlockRegistryCoreClass, "soil");
+ if (soil != null) {
+ Block testHumus = (Block) soil.get(blockRegistryCoreObject);
+ if (testHumus != null) {
+ mForestryHumusBlock = testHumus;
}
}
}
- } catch (Throwable t) {
- t.printStackTrace();
}
- }
- if (mForestryHumusBlock != null) {
- return mForestryHumusBlock;
+ } catch (Throwable t) {
+ t.printStackTrace();
}
}
+ if (mForestryHumusBlock != null) {
+ return mForestryHumusBlock;
+ }
+
return farmland;
}
}