aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2017-09-09 21:38:22 +1000
committerAlkalus <draknyte1@hotmail.com>2017-09-09 21:38:22 +1000
commit6aafa5e038bb61d05ee915452a9aa7ae95b55029 (patch)
treeb80aff9a4958c5ce6f01a64f10e492d0b4bb5d00 /src/Java/gtPlusPlus/xmod
parent3b15de7e6090b0b60dd77311d8e599c7dccd9326 (diff)
downloadGT5-Unofficial-6aafa5e038bb61d05ee915452a9aa7ae95b55029.tar.gz
GT5-Unofficial-6aafa5e038bb61d05ee915452a9aa7ae95b55029.tar.bz2
GT5-Unofficial-6aafa5e038bb61d05ee915452a9aa7ae95b55029.zip
$ GT5.08.33 compliance fixes.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java9
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java222
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java26
3 files changed, 158 insertions, 99 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index f6db32fd5b..3b9e39208d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -5,6 +5,7 @@ import static gregtech.api.enums.GT_Values.W;
import gregtech.api.util.*;
import gtPlusPlus.xmod.gregtech.api.interfaces.GregtechItemContainer;
import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
@@ -285,7 +286,7 @@ public enum GregtechItemList implements GregtechItemContainer {
if (this.mHasNotBeenSet) {
throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
}
- return GT_Utility.getBlockFromStack(this.getItem());
+ return getBlockFromStack(this.getItem());
}
@Override
@@ -305,6 +306,12 @@ public enum GregtechItemList implements GregtechItemContainer {
}
return GT_Utility.areUnificationsEqual((ItemStack)aStack, aWildcard?this.getWildcard(1):this.get(1), aIgnoreNBT);
}
+
+ public static Block getBlockFromStack(Object aStack) {
+ if (GT_Utility.isStackInvalid(aStack))
+ return Blocks.air;
+ return Block.getBlockFromItem(((ItemStack) aStack).getItem());
+ }
@Override
public ItemStack get(final long aAmount, final Object... aReplacements) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java
index eb91919686..82048b17f7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java
@@ -2,126 +2,158 @@ package gtPlusPlus.xmod.gregtech.api.world;
import static gtPlusPlus.xmod.gregtech.HANDLER_GT.sCustomWorldgenFile;
-import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
-import gregtech.api.world.GT_Worldgen;
import gregtech.common.blocks.GT_TileEntity_Ores;
import gregtech.loaders.misc.GT_Achievements;
+import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Random;
public class GTPP_Worldgen_GT_Ore_Layer
- extends GTPP_Worldgen {
- public static ArrayList<GTPP_Worldgen_GT_Ore_Layer> sList = new ArrayList<GTPP_Worldgen_GT_Ore_Layer>();
- public static int sWeight = 0;
- public final short mMinY;
- public final short mMaxY;
- public final short mWeight;
- public final short mDensity;
- public final short mSize;
- public short mPrimaryMeta;
- public short mSecondaryMeta;
- public short mBetweenMeta;
- public short mSporadicMeta;
- public final String mRestrictBiome;
- public final boolean mDarkWorld;
- public final String aTextWorldgen = "worldgen.gtpp.";
+extends GTPP_Worldgen {
+ public static ArrayList<GTPP_Worldgen_GT_Ore_Layer> sList = new ArrayList<GTPP_Worldgen_GT_Ore_Layer>();
+ public static int sWeight = 0;
+ public final short mMinY;
+ public final short mMaxY;
+ public final short mWeight;
+ public final short mDensity;
+ public final short mSize;
+ public short mPrimaryMeta;
+ public short mSecondaryMeta;
+ public short mBetweenMeta;
+ public short mSporadicMeta;
+ public final String mRestrictBiome;
+ public final boolean mDarkWorld;
+ public final String aTextWorldgen = "worldgen.gtpp.";
- public GTPP_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) {
- super(aName, sList, aDefault);
- this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
- this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY));
- this.mMaxY = ((short) Math.max(this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)));
- this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
- this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
- this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
- this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID));
- this.mSecondaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID));
- this.mBetweenMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID));
- this.mSporadicMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID));
- this.mRestrictBiome = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
+ public GTPP_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) {
+ super(aName, sList, aDefault);
+ this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
+ this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY));
+ this.mMaxY = ((short) Math.max(this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)));
+ this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
+ this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
+ this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
+ this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID));
+ this.mSecondaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID));
+ this.mBetweenMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID));
+ this.mSporadicMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID));
+ this.mRestrictBiome = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
- if (this.mEnabled) {
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- sWeight += this.mWeight;
- }
- }
+ if (this.mEnabled) {
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ sWeight += this.mWeight;
+ }
+ }
- public GTPP_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity,
+ public GTPP_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity,
int aSize, Material aPrimary, Material aSecondary, Material aBetween,
Material aSporadic) {
- super(aName, sList, aDefault);
- this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Darkworld", true);
- this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY));
- this.mMaxY = ((short) Math.max(this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)));
- this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
- this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
- this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
- /* this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID));
+ super(aName, sList, aDefault);
+ this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Darkworld", true);
+ this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY));
+ this.mMaxY = ((short) Math.max(this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)));
+ this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
+ this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
+ this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
+ /* this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID));
this.mSecondaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID));
this.mBetweenMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID));
this.mSporadicMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID));
- */this.mRestrictBiome = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
+ */this.mRestrictBiome = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
- if (this.mEnabled) {
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- sWeight += this.mWeight;
- }
+ if (this.mEnabled) {
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ sWeight += this.mWeight;
+ }
}
public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
- if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) {
- return false; //Not the correct biome for ore mix
- }
- if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (false)) || ((aDimensionType == 0) && (this.mDarkWorld)) || ((aDimensionType == 1) && (false)) || ((aWorld.provider.getDimensionName().equals("Moon")) && (false)) || ((aWorld.provider.getDimensionName().equals("Mars")) && (false)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) {
- return false;
- }
- int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5);
+ if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) {
+ return false; //Not the correct biome for ore mix
+ }
+ if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (false)) || ((aDimensionType == 0) && (this.mDarkWorld)) || ((aDimensionType == 1) && (false)) || ((aWorld.provider.getDimensionName().equals("Moon")) && (false)) || ((aWorld.provider.getDimensionName().equals("Mars")) && (false)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) {
+ return false;
+ }
+ int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5);
+
+ int cX = aChunkX - aRandom.nextInt(this.mSize);
+ int eX = aChunkX + 16 + aRandom.nextInt(this.mSize);
+ for (int tX = cX; tX <= eX; tX++) {
+ int cZ = aChunkZ - aRandom.nextInt(this.mSize);
+ int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize);
+ for (int tZ = cZ; tZ <= eZ; tZ++) {
+ if (this.mSecondaryMeta > 0) {
+ for (int i = tMinY - 1; i < tMinY + 2; i++) {
+ if ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) {
+ setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false);
+ }
+ }
+ }
+ if ((this.mBetweenMeta > 0) && ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0))) {
+ setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false);
+ }
+ if (this.mPrimaryMeta > 0) {
+ for (int i = tMinY + 3; i < tMinY + 6; i++) {
+ if ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) {
+ setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false);
+ }
+ }
+ }
+ if ((this.mSporadicMeta > 0) && ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0))) {
+ setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false);
+ }
+ }
+ }
+ if (GT_Values.D1) {
+ System.out.println("Generated Orevein: " + this.mWorldGenName+" "+aChunkX +" "+ aChunkZ);
+ }
+ return true;
+ }
+ private Method mSetOre = null;
+ private boolean setOreBlock(World world, int x, int y, int z, int secondarymeta, boolean bool){
- int cX = aChunkX - aRandom.nextInt(this.mSize);
- int eX = aChunkX + 16 + aRandom.nextInt(this.mSize);
- for (int tX = cX; tX <= eX; tX++) {
- int cZ = aChunkZ - aRandom.nextInt(this.mSize);
- int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize);
- for (int tZ = cZ; tZ <= eZ; tZ++) {
- if (this.mSecondaryMeta > 0) {
- for (int i = tMinY - 1; i < tMinY + 2; i++) {
- if ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) {
- GT_TileEntity_Ores.setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false);
- }
- }
- }
- if ((this.mBetweenMeta > 0) && ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0))) {
- GT_TileEntity_Ores.setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false);
- }
- if (this.mPrimaryMeta > 0) {
- for (int i = tMinY + 3; i < tMinY + 6; i++) {
- if ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) {
- GT_TileEntity_Ores.setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false);
- }
- }
- }
- if ((this.mSporadicMeta > 0) && ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0))) {
- GT_TileEntity_Ores.setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false);
- }
- }
- }
- if (GT_Values.D1) {
- System.out.println("Generated Orevein: " + this.mWorldGenName+" "+aChunkX +" "+ aChunkZ);
- }
- return true;
- }
+ if (mSetOre == null){
+ try {
+ mSetOre = GT_TileEntity_Ores.class.getMethod("setOreBlock", World.class, int.class, int.class, int.class, int.class, boolean.class);
+ }
+ catch (SecurityException | NoSuchMethodException e) {
+ try {
+ mSetOre = GT_TileEntity_Ores.class.getMethod("setOreBlock", World.class, int.class, int.class, int.class, int.class);
+ }
+ catch (SecurityException | NoSuchMethodException r) {}
+ }
+ }
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ try {
+ return (boolean) mSetOre.invoke(world, x, y, z, secondarymeta, bool);
+ }
+ catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException t) {
+ return false;
+ }
+ }
+ else {
+ try {
+ return (boolean) mSetOre.invoke(world, x, y, z, secondarymeta);
+ }
+ catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException t) {
+ return false;}
+ }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java
index 47cd725a10..1c46f6c122 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java
@@ -6,6 +6,7 @@ import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTransformerHiAmp;
+import net.minecraft.item.ItemStack;
public class GregtechHiAmpTransformer {
@@ -35,6 +36,25 @@ public class GregtechHiAmpTransformer {
GregtechItemList.Transformer_HA_MAX_UV.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.08",
"UV Hi-Amp Transformer", 8, "Any Voltage -> UV (Use Soft Hammer to invert)").getStackForm(1L));
+ ItemStack mItem_1;
+ ItemStack mItem_2;
+ ItemStack mItem_3;
+ try {
+ mItem_1 = ItemList.valueOf("Casing_Coil_TungstenSteel").get(1);
+ } catch (Throwable t){
+ mItem_1 = ItemList.Circuit_Elite.get(1);
+ }
+ try {
+ mItem_2 = ItemList.valueOf("Casing_Coil_Naquadah").get(1);
+ } catch (Throwable t){
+ mItem_2 = ItemList.Circuit_Master.get(1);
+ }
+ try {
+ mItem_3 = ItemList.valueOf("Casing_Coil_NaquadahAlloy").get(1);
+ } catch (Throwable t){
+ mItem_3 = ItemList.Circuit_Ultimate.get(1);
+ }
+
GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_LV_ULV.get(1L, new Object[0]), bitsd,
new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('C'),
OrePrefixes.wireGt16.get(Materials.Tin), Character.valueOf('B'),
@@ -66,17 +86,17 @@ public class GregtechHiAmpTransformer {
new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('C'),
OrePrefixes.wireGt16.get(Materials.Naquadah), Character.valueOf('B'),
OrePrefixes.wireGt16.get(Materials.VanadiumGallium), Character.valueOf('K'),
- ItemList.Casing_Coil_TungstenSteel });
+ mItem_1 });
GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_UV_ZPM.get(1L, new Object[0]), bitsd,
new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('C'),
OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), Character.valueOf('B'),
OrePrefixes.wireGt16.get(Materials.Naquadah), Character.valueOf('K'),
- ItemList.Casing_Coil_Naquadah });
+ mItem_2 });
GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_MAX_UV.get(1L, new Object[0]), bitsd,
new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('C'),
OrePrefixes.wireGt01.get(Materials.Superconductor), Character.valueOf('B'),
OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), Character.valueOf('K'),
- ItemList.Casing_Coil_NaquadahAlloy });
+ mItem_3 });
}
}