aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-02-28 20:06:01 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-02-28 20:06:01 +0000
commit4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a (patch)
treef9707c4551b6134030374580cacfd1aec4b0c9d7 /src/Java/gtPlusPlus/xmod
parent1c20e21e7678f9a546fff9bf873c80c35a841cf8 (diff)
downloadGT5-Unofficial-4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a.tar.gz
GT5-Unofficial-4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a.tar.bz2
GT5-Unofficial-4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a.zip
+ Added a new debug tool.
+ Added support for Crops++. + Added Custom Crops & framework to support more in future. + Added basic support for all GT++ Materials within Tinkers Construct. [WIP] + Moderately bad attempt at generating custom Plasma Cooling recipes in the Adv. Vacuum Freezer. [WIP #424] % Reworked logic for Material.java handling Durability, Tool Quality & Harvest Level. % Adjusted frequency of structural checks on the Cyclotron, Now 100x less frequent. % Cleaned up ReflectionUtils.java and made all getters cache their results, for much faster access. % Attempted to adjust logic of FFPP, but I probably broke it. [WIP] % Moved static array of Element Names from IonParticles.java -> ELEMENT.java. $ Greatly improved reflective performance across the mod.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
-rw-r--r--src/Java/gtPlusPlus/xmod/bartcrops/HANDLER_CropsPlusPlus.java21
-rw-r--r--src/Java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java109
-rw-r--r--src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java37
-rw-r--r--src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java56
-rw-r--r--src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java69
-rw-r--r--src/Java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java56
-rw-r--r--src/Java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java46
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java18
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockLayer.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java125
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java9
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java67
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java17
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/HANDLER_Thaumcraft.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java200
-rw-r--r--src/Java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java66
-rw-r--r--src/Java/gtPlusPlus/xmod/witchery/WitchUtils.java21
37 files changed, 868 insertions, 163 deletions
diff --git a/src/Java/gtPlusPlus/xmod/bartcrops/HANDLER_CropsPlusPlus.java b/src/Java/gtPlusPlus/xmod/bartcrops/HANDLER_CropsPlusPlus.java
new file mode 100644
index 0000000000..ce7d919431
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/bartcrops/HANDLER_CropsPlusPlus.java
@@ -0,0 +1,21 @@
+package gtPlusPlus.xmod.bartcrops;
+
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+
+public class HANDLER_CropsPlusPlus {
+
+ public static void preInit(FMLPreInitializationEvent preinit) {
+ LoaderOfTheCrops.load(preinit);
+ }
+
+ public static void init(FMLInitializationEvent init) {
+ //registerItems();
+ }
+
+ public static void postInit(FMLPostInitializationEvent postinit) {
+ LoaderOfTheCrops.register();
+ LoaderOfTheCrops.registerBaseSeed();
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java b/src/Java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java
new file mode 100644
index 0000000000..48813310d2
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java
@@ -0,0 +1,109 @@
+package gtPlusPlus.xmod.bartcrops;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.bartcrops.crops.Crop_Hemp;
+import ic2.api.crops.CropCard;
+import ic2.api.crops.Crops;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+/**
+ * Mostly borrowed from the Crops++ Crop Loader.
+ * @author Alkalus
+ */
+
+public class LoaderOfTheCrops {
+
+ private static List<Boolean> mHasCropObj = new ArrayList<Boolean>();
+ private CropCard mCropObj;
+ private ItemStack mBaseSeed;
+ private static List<LoaderOfTheCrops> mCropList = cropLoader();
+
+ public LoaderOfTheCrops(CropCard cropObj) {
+ this.mCropObj = cropObj;
+ }
+
+ public LoaderOfTheCrops(CropCard cropObj, ItemStack baseseed) {
+ this.mCropObj = cropObj;
+ this.mBaseSeed = baseseed;
+ }
+
+ public static CropCard cropUnpackerCC(LoaderOfTheCrops inp) {
+ return inp.mCropObj;
+ }
+
+ private static ItemStack cropUnpackerCG(LoaderOfTheCrops inp) {
+ return inp.mBaseSeed;
+ }
+
+ private static LoaderOfTheCrops cropHelper(CropCard cropObj) {
+ return new LoaderOfTheCrops(cropObj, ItemUtils.getItemStackOfAmountFromOreDict("crop" + cropObj.name(), 0));
+ }
+
+ public static final List<LoaderOfTheCrops> cropLoader() {
+ List<LoaderOfTheCrops> p = new ArrayList<LoaderOfTheCrops>();
+
+ p.add(new LoaderOfTheCrops(new Crop_Hemp(), new ItemStack(Item.getItemById(111), 3)));
+
+ return p;
+ }
+
+ private static final List<CropCard> cropObjs() {
+ List<CropCard> p = new ArrayList<CropCard>();
+
+ for (int i = 0; i < mCropList.size(); ++i) {
+ p.add(cropUnpackerCC((LoaderOfTheCrops) mCropList.get(i)));
+ }
+
+ return p;
+ }
+
+ private static final List<ItemStack> setBaseSeed() {
+ List<ItemStack> p = new ArrayList<ItemStack>();
+
+ for (int i = 0; i < mCropList.size(); ++i) {
+ p.add(cropUnpackerCG((LoaderOfTheCrops) mCropList.get(i)));
+ }
+
+ return p;
+ }
+
+ private static final List<String> setnames() {
+ List<String> s = new ArrayList<String>();
+
+ for (int i = 0; i < mCropList.size(); ++i) {
+ s.add(((CropCard) cropObjs().get(i)).name());
+ }
+
+ return s;
+ }
+
+ public static void load(FMLPreInitializationEvent preinit) {
+ for (int i = 0; i < mCropList.size(); ++i) {
+ mHasCropObj.add(true);
+ }
+ }
+
+ public static void register() {
+ for (int i = 0; i < mCropList.size(); ++i) {
+ if ((Boolean) mHasCropObj.get(i) && cropObjs().get(i) != null) {
+ Crops.instance.registerCrop((CropCard) cropObjs().get(i));
+ }
+ }
+ }
+
+ public static void registerBaseSeed() {
+ List<ItemStack> baseseed = new ArrayList<ItemStack>(setBaseSeed());
+
+ for (int i = 0; i < mCropList.size(); ++i) {
+ if (baseseed.get(i) != null && cropObjs().get(i) != null) {
+ Crops.instance.registerBaseSeed((ItemStack) baseseed.get(i), (CropCard) cropObjs().get(i), 1, 1, 1, 1);
+ }
+ }
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java
new file mode 100644
index 0000000000..cddce7beb4
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java
@@ -0,0 +1,37 @@
+package gtPlusPlus.xmod.bartcrops.abstracts;
+
+import gtPlusPlus.core.lib.CORE;
+import ic2.api.crops.ICropTile;
+
+public abstract class BaseAestheticCrop extends BaseHarvestableCrop {
+
+ public int tier() {
+ return 1;
+ }
+
+ public int stat(int n) {
+ switch (n) {
+ case 0 :
+ return 0;
+ case 1 :
+ return 0;
+ case 2 :
+ return 0;
+ case 3 :
+ return 4;
+ case 4 :
+ return 0;
+ default :
+ return 0;
+ }
+ }
+
+ public int growthDuration(ICropTile crop) {
+ return CORE.DEBUG ? 1 : 225;
+ }
+
+ public byte getSizeAfterHarvest(ICropTile crop) {
+ return 1;
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java
new file mode 100644
index 0000000000..ca2a044564
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java
@@ -0,0 +1,56 @@
+package gtPlusPlus.xmod.bartcrops.abstracts;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import ic2.api.crops.CropCard;
+import ic2.api.crops.ICropTile;
+import java.util.ArrayList;
+import java.util.List;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import speiger.src.crops.api.ICropCardInfo;
+
+public abstract class BaseCrop extends CropCard implements ICropCardInfo {
+ @SideOnly(Side.CLIENT)
+ public void registerSprites(IIconRegister iconRegister) {
+ this.textures = new IIcon[this.maxSize()];
+
+ for (int i = 1; i <= this.textures.length; ++i) {
+ this.textures[i - 1] = iconRegister.registerIcon(CORE.MODID+":crop/blockCrop." + this.name() + "." + i);
+ }
+
+ }
+
+ public float dropGainChance() {
+ return (float) (Math.pow(0.95D, (double) ((float) this.tier())) * (double) 1f);
+ }
+
+ public boolean canCross(ICropTile crop) {
+ return crop.getSize() == this.maxSize();
+ }
+
+ public int getrootslength(ICropTile crop) {
+ return 3;
+ }
+
+ public String discoveredBy() {
+ return "Alkalus";
+ }
+
+ public String owner() {
+ return "Gtplusplus";
+ }
+
+ public List<String> getCropInformation() {
+ List<String> ret = new ArrayList<String>();
+ ret.add(this.attributes().toString());
+ return ret;
+ }
+
+ public ItemStack getDisplayItem(CropCard card) {
+ return ItemUtils.getItemStackOfAmountFromOreDict("crop" + this.name(), 0);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java
new file mode 100644
index 0000000000..fee6cf654c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java
@@ -0,0 +1,69 @@
+package gtPlusPlus.xmod.bartcrops.abstracts;
+
+import gtPlusPlus.core.lib.CORE;
+import ic2.api.crops.ICropTile;
+
+public abstract class BaseHarvestableCrop extends BaseCrop {
+
+ public int tier() {
+ return 2;
+ }
+
+ public int stat(int n) {
+ switch (n) {
+ case 0 :
+ return 0;
+ case 1 :
+ return 4;
+ case 2 :
+ return 0;
+ case 3 :
+ return 4;
+ case 4 :
+ return 0;
+ default :
+ return 0;
+ }
+ }
+
+ public boolean canGrow(ICropTile crop) {
+ return crop.getSize() < 3;
+ }
+
+ public int getOptimalHavestSize(ICropTile crop) {
+ return 3;
+ }
+
+ public boolean canBeHarvested(ICropTile crop) {
+ return crop.getSize() == 3;
+ }
+
+ public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) {
+ return (int) ((double) humidity * 1.2D + (double) nutrients * 0.9D + (double) air * 0.9D);
+ }
+
+ public int growthDuration(ICropTile crop) {
+ short r;
+ if (CORE.DEBUG) {
+ r = 1;
+ } else if (crop.getSize() == 2) {
+ r = 200;
+ } else {
+ r = 700;
+ }
+
+ return r;
+ }
+
+ public byte getSizeAfterHarvest(ICropTile crop) {
+ return 2;
+ }
+
+ public int maxSize() {
+ return 3;
+ }
+
+ public String discoveredBy() {
+ return "Alkalus";
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java b/src/Java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java
new file mode 100644
index 0000000000..a921182d66
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java
@@ -0,0 +1,56 @@
+package gtPlusPlus.xmod.bartcrops.crops;
+
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.bartcrops.abstracts.BaseAestheticCrop;
+import ic2.api.crops.ICropTile;
+import net.minecraft.item.ItemStack;
+
+public class Crop_Hemp extends BaseAestheticCrop {
+
+ public int tier() {
+ return 2;
+ }
+
+ public String name() {
+ return "Hemp";
+ }
+
+ public String discoveredBy() {
+ return "Alkalus";
+ }
+
+ public int growthDuration(ICropTile crop) {
+ int ret = 550;
+
+ /*if (crop.isBlockBelow(Blocks.dirt) || crop.isBlockBelow(Blocks.flowing_water)) {
+ ret = 225;
+ }*/
+
+ if (CORE.DEBUG) {
+ ret = 1;
+ }
+
+ return ret;
+ }
+
+ public String[] attributes() {
+ return new String[]{"Green", "Soil", "Orange"};
+ }
+
+ public ItemStack getGain(ICropTile crop) {
+
+ ItemStack ret = this.getDisplayItem();
+ if (MathUtils.randInt(0, 10) > 8) {
+ ret = ItemUtils.getSimpleStack(ModItems.itemRope, MathUtils.randInt(1, 3));
+ }
+
+ return ret;
+ }
+
+ public ItemStack getDisplayItem() {
+ return ItemUtils.getSimpleStack(ModItems.itemRope, 0);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java b/src/Java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java
index 6d50f64e6d..5b3210d58a 100644
--- a/src/Java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java
+++ b/src/Java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java
@@ -12,6 +12,7 @@ import gregtech.api.enums.Materials;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.eio.material.MaterialEIO;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
@@ -30,11 +31,10 @@ public class HandlerTooltip_EIO {
//If it is, reflect in.
if (mIngot == null){
try {
- oMainClass = Class.forName("crazypants.enderio.EnderIO");
- oIngotClass = Class.forName("crazypants.enderio.material.ItemAlloy");
+ oMainClass = ReflectionUtils.getClass("crazypants.enderio.EnderIO");
+ oIngotClass = ReflectionUtils.getClass("crazypants.enderio.material.ItemAlloy");
if (oMainClass != null && oIngotClass != null){
- Field oAlloyField = oMainClass.getDeclaredField("itemAlloy");
- oAlloyField.setAccessible(true);
+ Field oAlloyField = ReflectionUtils.getField(oMainClass, "itemAlloy");
Object oAlloy = oAlloyField.get(oMainClass);
if (oAlloy != null){
if (oIngotClass.isInstance(oAlloy) || Item.class.isInstance(oAlloy)){
diff --git a/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java b/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
index 1343bdc8af..05d00b06d9 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
@@ -45,14 +45,14 @@ public class HANDLER_FR {
if (LoadedMods.Forestry){
Class oClass;
try {
- oClass = Class.forName("forestry.core.proxy.ProxyCommon");
+ oClass = ReflectionUtils.getClass("forestry.core.proxy.ProxyCommon");
Object oProxy = ReflectionUtils.getField(oClass, "common");
- if (oProxy != null && oClass.isInstance(oProxy)){
- Method mParticles = oClass.getDeclaredMethod("addBlockDestroyEffects", World.class, int.class, int.class, int.class, Block.class, int.class);
+ if (oProxy != null && oClass.isInstance(oProxy)){
+ Method mParticles = ReflectionUtils.getMethod(oClass, "addBlockDestroyEffects", World.class, int.class, int.class, int.class, Block.class, int.class);
mParticles.invoke(oProxy, world, x, y, z, block, 0);
}
}
- catch (ClassNotFoundException | NoSuchFieldException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java
index d842c37fcd..b36508f6aa 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java
@@ -864,7 +864,7 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
Enum gtBeeEnumObject = Enum.valueOf(gtBeeTypes, name);
Field gtBeesField = FieldUtils.getDeclaredField(gtBeeTypes, "species", true);
gtBeesField.setAccessible(true);
- ReflectionUtils.makeAccessible(gtBeesField);
+ ReflectionUtils.makeFieldAccessible(gtBeesField);
Object beeType = gtBeesField.get(gtBeeEnumObject);
return (IAlleleBeeSpecies) beeType;
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
index 29ece40c3d..bb360d5a87 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
@@ -141,7 +141,7 @@ public class GTPP_Bees {
Class gtCombEnumClass = Class.forName("gregtech.common.items.CombType");
Field gtCombs = FieldUtils.getDeclaredField(gtBees, "combs", true);
gtCombs.setAccessible(true);
- ReflectionUtils.makeAccessible(gtCombs);
+ ReflectionUtils.makeFieldAccessible(gtCombs);
Enum gtCombTypeSlag = Enum.valueOf(gtCombEnumClass, "SLAG");
Enum gtCombTypeStone = Enum.valueOf(gtCombEnumClass, "STONE");
Object oCombObject = gtCombs.get(null);
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java b/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
index 9075666b8b..58331c4300 100644
--- a/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
@@ -8,6 +8,7 @@ import net.minecraft.item.Item;
import gtPlusPlus.core.item.chemistry.RocketFuels;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.preloader.asm.AsmConfig;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fluids.Fluid;
@@ -21,11 +22,11 @@ public class HandlerTooltip_GC {
@SubscribeEvent
public void onItemTooltip(ItemTooltipEvent event) {
- if (LoadedMods.GalacticraftCore) {
+ if (LoadedMods.GalacticraftCore && AsmConfig.enableGcFuelChanges) {
if (mBlock == null) {
try {
- Class<?> GCBlocks = Class.forName("micdoodle8.mods.galacticraft.core.blocks.GCBlocks");
+ Class<?> GCBlocks = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.blocks.GCBlocks");
if (GCBlocks != null) {
oMainClass = GCBlocks;
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java
index 3b9633b21d..aafa9ef9a1 100644
--- a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java
@@ -4,12 +4,11 @@ import java.util.List;
import com.google.common.collect.Lists;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import micdoodle8.mods.galacticraft.api.prefab.core.BlockMetaPair;
import micdoodle8.mods.galacticraft.api.prefab.world.gen.BiomeDecoratorSpace;
import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta;
-import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedCreeper;
-import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSkeleton;
-import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSpider;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
@@ -46,20 +45,37 @@ public abstract class ChunkProviderGalactic extends ChunkProviderGalaxyLakes {
}
protected SpawnListEntry[] getMonsters() {
- SpawnListEntry skele = new SpawnListEntry(EntityEvolvedSkeleton.class, 100, 4, 4);
- SpawnListEntry creeper = new SpawnListEntry(EntityEvolvedCreeper.class, 100, 4, 4);
- SpawnListEntry spider = new SpawnListEntry(EntityEvolvedSpider.class, 100, 4, 4);
+
+ Class aSkele = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSkeleton");
+ Class aCreeper = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.entities.EntityEvolvedCreeper");
+ Class aSpider = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSpider");
+ Class aEnderman = ReflectionUtils.getClass("galaxyspace.SolarSystem.planets.pluto.entities.EntityEvolvedEnderman");
+
+ SpawnListEntry skele;
+ SpawnListEntry creeper;
+ SpawnListEntry spider;
+ SpawnListEntry enderman;
- Class<?> aEnderman;
- try {
- aEnderman = Class.forName("galaxyspace.SolarSystem.planets.pluto.entities.EntityEvolvedEnderman");
- if (aEnderman != null) {
- SpawnListEntry enderman = new SpawnListEntry(aEnderman, 100, 4, 4);
- return new SpawnListEntry[] { skele, creeper, spider, enderman };
- }
- } catch (ClassNotFoundException e) {}
+ AutoMap<SpawnListEntry> aMobs = new AutoMap<SpawnListEntry>();
- return new SpawnListEntry[] { skele, creeper, spider };
+ if (aSkele != null) {
+ skele = new SpawnListEntry(aSkele, 100, 4, 4);
+ aMobs.put(skele);
+ }
+ if (aCreeper != null) {
+ creeper = new SpawnListEntry(aCreeper, 100, 4, 4);
+ aMobs.put(creeper);
+ }
+ if (aSpider != null) {
+ spider = new SpawnListEntry(aSpider, 100, 4, 4);
+ aMobs.put(spider);
+ }
+ if (aEnderman != null) {
+ enderman = new SpawnListEntry(aEnderman, 100, 4, 4);
+ aMobs.put(enderman);
+ }
+
+ return aMobs.toArray();
}
public void onPopulate(IChunkProvider arg0, int arg1, int arg2) {
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java b/src/Java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java
index 94dc2d0cc0..f237aed335 100644
--- a/src/Java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java
@@ -26,11 +26,11 @@ public class GalacticUtils {
Class<?> a1, a2, a3, a4, a5;
Method m1, m2, m3;
try {
- a1 = Class.forName("micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket");
- a2 = Class.forName("micdoodle8.mods.galacticraft.core.tile.TileEntityLandingPad");
- a3 = Class.forName("micdoodle8.mods.galacticraft.core.tile.TileEntityBuggyFueler");
- a4 = Class.forName("micdoodle8.mods.galacticraft.api.entity.IDockable");
- a5 = Class.forName("micdoodle8.mods.galacticraft.api.entity.IFuelable");
+ a1 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket");
+ a2 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.tile.TileEntityLandingPad");
+ a3 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.tile.TileEntityBuggyFueler");
+ a4 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.entity.IDockable");
+ a5 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.entity.IFuelable");
m1 = ReflectionUtils.getMethod(a1, "getRocketTier");
m2 = ReflectionUtils.getMethod(a2, "getDockedEntity");
m3 = ReflectionUtils.getMethod(a3, "getDockedEntity");
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
index 2b7f44be59..0d4d8b6cdd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
@@ -184,7 +184,7 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In
a2 = F2.getByte(this);
}
}
- catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException n) {}
+ catch (IllegalArgumentException | IllegalAccessException n) {}
int textureIndex = a1 | a2 << 7;
byte texturePointer = (byte) (a1 & 127);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java
index 30c1bc2b29..bed80d8d13 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java
@@ -50,11 +50,9 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Outp
//Get all Pl