diff options
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/implementations')
7 files changed, 293 insertions, 206 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java index 267287c430..c55e346546 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java @@ -156,34 +156,6 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile return (int) mAmperage * 64;
}
- private void pullFromIc2EnergySources(IGregTechTileEntity aBaseMetaTileEntity) {
- if(!GT_Mod.gregtechproxy.ic2EnergySourceCompat) return;
-
- for( byte aSide = 0 ; aSide < 6 ; aSide++) if(isConnectedAtSide(aSide)) {
- final TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(aSide);
- final TileEntity tEmitter;
- if (tTileEntity instanceof IReactorChamber)
- tEmitter = (TileEntity) ((IReactorChamber) tTileEntity).getReactor();
- else tEmitter = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) ? tTileEntity :
- EnergyNet.instance.getTileEntity(tTileEntity.getWorldObj(), tTileEntity.xCoord, tTileEntity.yCoord, tTileEntity.zCoord);
-
- if (tEmitter instanceof IEnergySource) {
- final GT_CoverBehavior coverBehavior = aBaseMetaTileEntity.getCoverBehaviorAtSide(aSide);
- final int coverId = aBaseMetaTileEntity.getCoverIDAtSide(aSide),
- coverData = aBaseMetaTileEntity.getCoverDataAtSide(aSide);
- final ForgeDirection tDirection = ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide));
-
- if (((IEnergySource) tEmitter).emitsEnergyTo((TileEntity) aBaseMetaTileEntity, tDirection) &&
- coverBehavior.letsEnergyIn(aSide, coverId, coverData, aBaseMetaTileEntity)) {
- final long tEU = (long) ((IEnergySource) tEmitter).getOfferedEnergy();
-
- if (transferElectricity(aSide, tEU, 1, Sets.newHashSet((TileEntity) aBaseMetaTileEntity)) > 0)
- ((IEnergySource) tEmitter).drawEnergy(tEU);
- }
- }
- }
- }
-
@Override
public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
if (!isConnectedAtSide(aSide) && aSide != 6)
@@ -205,9 +177,10 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile long rUsedAmperes = 0;
final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
-
+ byte i = (byte)((((aSide/2)*2)+2)%6); //this bit of trickery makes sure a direction goes to the next cardinal pair. IE, NS goes to E, EW goes to U, UD goes to N. It's a lame way to make sure locally connected machines on a wire get EU first.
aVoltage -= mCableLossPerMeter;
- if (aVoltage > 0) for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++)
+
+ if (aVoltage > 0) for (byte j = 0; j < 6 && aAmperage > rUsedAmperes; j++, i=(byte)((i+1)%6) )
if (i != aSide && isConnectedAtSide(i) && baseMetaTile.getCoverBehaviorAtSide(i).letsEnergyOut(i, baseMetaTile.getCoverIDAtSide(i), baseMetaTile.getCoverDataAtSide(i), baseMetaTile)) {
final TileEntity tTileEntity = baseMetaTile.getTileEntityAtSide(i);
@@ -323,8 +296,6 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
- if (GT_Mod.gregtechproxy.ic2EnergySourceCompat) pullFromIc2EnergySources(aBaseMetaTileEntity);
-
{ //amp handler
long worldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime();
@@ -603,4 +574,23 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
}
}
+
+ @Override
+ public boolean shouldJoinIc2Enet() {
+ if (!GT_Mod.gregtechproxy.ic2EnergySourceCompat) return false;
+
+ if (mConnections != 0) {
+ final IGregTechTileEntity baseMeta = getBaseMetaTileEntity();
+ for( byte aSide = 0 ; aSide < 6 ; aSide++) if(isConnectedAtSide(aSide)) {
+ final TileEntity tTileEntity = baseMeta.getTileEntityAtSide(aSide);
+ final TileEntity tEmitter = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) ? tTileEntity :
+ EnergyNet.instance.getTileEntity(tTileEntity.getWorldObj(), tTileEntity.xCoord, tTileEntity.yCoord, tTileEntity.zCoord);
+
+ if (tEmitter instanceof IEnergyEmitter)
+ return true;
+
+ }
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java index 5835a6c9ab..1a81e4d570 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java @@ -240,6 +240,7 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier mChargeableCount++; } } + count++; } @Override @@ -309,11 +310,11 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier @Override public String[] getInfoData() { - count++; - if (mMax == 0 || count % 20 == 0) { + if (mMax == 0 || (count > 20)) { long[] tmp = getStoredEnergy(); mStored = tmp[0]; mMax = tmp[1]; + count = 0; } return new String[]{ diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java index 72105f2074..353a62c319 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity.implementations; +import cpw.mods.fml.common.Loader; import gregtech.api.enums.*; import gregtech.api.gui.GT_Container_BasicMachine; import gregtech.api.gui.GT_GUIContainer_BasicMachine; @@ -9,9 +10,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_ModHandler.RecipeBits; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import ic2.core.Ic2Items; import net.minecraft.entity.player.InventoryPlayer; @@ -23,9 +22,7 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.Locale; import java.util.Random; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.W; -import static gregtech.api.enums.GT_Values.ticksBetweenSounds; +import static gregtech.api.enums.GT_Values.*; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -34,70 +31,78 @@ import static gregtech.api.enums.GT_Values.ticksBetweenSounds; * Extend this class to make a simple Machine */ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_BasicMachine { - private final GT_Recipe_Map mRecipes; + private final GT_Recipe.GT_Recipe_Map mRecipes; private final int mTankCapacity, mSpecialEffect; private final String mSound; private final boolean mSharedTank, mRequiresFluidForFiltering; private final byte mGUIParameterA, mGUIParameterB; - public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { - super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM"))}); - mSharedTank = aSharedTank; - mTankCapacity = aTankCapacity; - mSpecialEffect = aSpecialEffect; - mRequiresFluidForFiltering = aRequiresFluidForFiltering; - mRecipes = aRecipes; - mSound = aSound; - mGUIParameterA = (byte) aGUIParameterA; - mGUIParameterB = (byte) aGUIParameterB; + public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { + super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM"))); + this.mSharedTank = aSharedTank; + this.mTankCapacity = aTankCapacity; + this.mSpecialEffect = aSpecialEffect; + this.mRequiresFluidForFiltering = aRequiresFluidForFiltering; + this.mRecipes = aRecipes; + this.mSound = aSound; + this.mGUIParameterA = (byte) aGUIParameterA; + this.mGUIParameterB = (byte) aGUIParameterB; //TODO: CHECK if (aRecipe != null) { for (int i = 3; i < aRecipe.length; i++) { - if (aRecipe[i] == X.CIRCUIT) { - aRecipe[i] = Tier.ELECTRIC[mTier].mManagingObject; + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT) { + aRecipe[i] = Tier.ELECTRIC[this.mTier].mManagingObject; continue; } - if (aRecipe[i] == X.BETTER_CIRCUIT) { - aRecipe[i] = Tier.ELECTRIC[mTier].mBetterManagingObject; + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.BETTER_CIRCUIT) { + aRecipe[i] = Tier.ELECTRIC[this.mTier].mBetterManagingObject; continue; } - if (aRecipe[i] == X.HULL) { - aRecipe[i] = Tier.ELECTRIC[mTier].mHullObject; + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL) { + aRecipe[i] = Tier.ELECTRIC[this.mTier].mHullObject; continue; } - if (aRecipe[i] == X.WIRE) { - aRecipe[i] = Tier.ELECTRIC[mTier].mConductingObject; + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE) { + aRecipe[i] = Tier.ELECTRIC[this.mTier].mConductingObject; continue; } - if (aRecipe[i] == X.WIRE4) { - aRecipe[i] = Tier.ELECTRIC[mTier].mLargerConductingObject; + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4) { + aRecipe[i] = Tier.ELECTRIC[this.mTier].mLargerConductingObject; continue; } - if (aRecipe[i] == X.GLASS) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS) { + switch (this.mTier) { + case 0: + case 1: + case 2: + case 3: + aRecipe[i] = new ItemStack(Blocks.glass, 1, W); + break; + case 4: + case 5: case 6: case 7: case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - aRecipe[i] = Ic2Items.reinforcedGlass; - break; + if (Loader.isModLoaded("bartworks")) { + aRecipe[i] = "blockGlass"+VN[aTier]; + break; + } default: - aRecipe[i] = new ItemStack(Blocks.glass, 1, W); - break; + if (Loader.isModLoaded("bartworks")) { + aRecipe[i] = "blockGlass"+VN[8]; + break; + } else { + aRecipe[i] = Ic2Items.reinforcedGlass; + break; + } } continue; } - if (aRecipe[i] == X.PLATE) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.plate.get(Materials.Steel); @@ -120,9 +125,6 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = OrePrefixes.plate.get(Materials.HSSE); break; - case 8: - aRecipe[i] = OrePrefixes.plate.get(Materials.Neutronium); - break; default: aRecipe[i] = OrePrefixes.plate.get(Materials.Neutronium); break; @@ -130,8 +132,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.PIPE) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PIPE) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Bronze); @@ -158,14 +160,14 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ aRecipe[i] = OrePrefixes.pipeLarge.get(Materials.Ultimate); break; default: - aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Ultimate); + aRecipe[i] = OrePrefixes.pipeHuge.get(Materials.Ultimate); break; } continue; } - if (aRecipe[i] == X.COIL_HEATING) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.COIL_HEATING) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.AnyCopper); @@ -191,6 +193,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 8: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.NaquadahAlloy); break; + case 9: + aRecipe[i] = OrePrefixes.wireGt04.get(Materials.NaquadahAlloy); + break; default: aRecipe[i] = OrePrefixes.wireGt08.get(Materials.NaquadahAlloy); break; @@ -198,8 +203,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.COIL_HEATING_DOUBLE) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.COIL_HEATING_DOUBLE) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.AnyCopper); @@ -225,6 +230,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 8: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.NaquadahAlloy); break; + case 9: + aRecipe[i] = OrePrefixes.wireGt08.get(Materials.NaquadahAlloy); + break; default: aRecipe[i] = OrePrefixes.wireGt16.get(Materials.NaquadahAlloy); break; @@ -232,8 +240,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.STICK_DISTILLATION) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.STICK_DISTILLATION) { + switch (this.mTier) { default: aRecipe[i] = OrePrefixes.stick.get(Materials.Blaze); break; @@ -241,8 +249,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.STICK_MAGNETIC) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.STICK_MAGNETIC) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.stick.get(Materials.IronMagnetic); @@ -266,8 +274,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.STICK_ELECTROMAGNETIC) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.STICK_ELECTROMAGNETIC) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.stick.get(Materials.AnyIron); @@ -286,10 +294,10 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.COIL_ELECTRIC) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.COIL_ELECTRIC) { + switch (this.mTier) { case 0: - aRecipe[i] = OrePrefixes.wireGt01.get(Materials.Tin); + aRecipe[i] = OrePrefixes.wireGt01.get(Materials.Lead); break; case 1: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Tin); @@ -304,23 +312,23 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ aRecipe[i] = OrePrefixes.wireGt08.get(Materials.AnnealedCopper); break; case 5: - aRecipe[i] = OrePrefixes.wireGt08.get(Materials.AnnealedCopper); + aRecipe[i] = OrePrefixes.wireGt16.get(Materials.AnnealedCopper); break; case 6: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.YttriumBariumCuprate); break; case 7: - aRecipe[i] = OrePrefixes.wireGt08.get(Materials.SuperconductorUHV); + aRecipe[i] = OrePrefixes.wireGt08.get(Materials.Iridium); break; default: - aRecipe[i] = OrePrefixes.wireGt16.get(Materials.SuperconductorUHV); + aRecipe[i] = OrePrefixes.wireGt16.get(Materials.Osmium); break; } continue; } - if (aRecipe[i] == X.ROBOT_ARM) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Robot_Arm_LV; @@ -343,15 +351,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Robot_Arm_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Robot_Arm_UV; break; + case 9: + aRecipe[i] = ItemList.Robot_Arm_UHV; + break; + default: + aRecipe[i] = ItemList.Robot_Arm_UEV; + break; } continue; } - if (aRecipe[i] == X.PUMP) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Electric_Pump_LV; @@ -374,15 +388,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Electric_Pump_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Electric_Pump_UV; break; + case 9: + aRecipe[i] = ItemList.Electric_Pump_UHV; + break; + default: + aRecipe[i] = ItemList.Electric_Pump_UEV; + break; } continue; } - if (aRecipe[i] == X.ROTOR) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROTOR) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.rotor.get(Materials.Tin); @@ -412,8 +432,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.MOTOR) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Electric_Motor_LV; @@ -436,15 +456,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Electric_Motor_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Electric_Motor_UV; break; + case 9: + aRecipe[i] = ItemList.Electric_Motor_UHV; + break; + default: + aRecipe[i] = ItemList.Electric_Motor_UEV; + break; } continue; } - if (aRecipe[i] == X.PISTON) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Electric_Piston_LV; @@ -467,15 +493,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Electric_Piston_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Electric_Piston_UV; break; + case 9: + aRecipe[i] = ItemList.Electric_Piston_UHV; + break; + default: + aRecipe[i] = ItemList.Electric_Piston_UEV; + break; } continue; } - if (aRecipe[i] == X.CONVEYOR) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CONVEYOR) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Conveyor_Module_LV; @@ -498,15 +530,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Conveyor_Module_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Conveyor_Module_UV; break; + case 9: + aRecipe[i] = ItemList.Conveyor_Module_UHV; + break; + default: + aRecipe[i] = ItemList.Conveyor_Module_UEV; + break; } continue; } - if (aRecipe[i] == X.EMITTER) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.EMITTER) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Emitter_LV; @@ -529,15 +567,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Emitter_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Emitter_UV; break; + case 9: + aRecipe[i] = ItemList.Emitter_UHV; + break; + default: + aRecipe[i] = ItemList.Emitter_UEV; + break; } continue; } - if (aRecipe[i] == X.SENSOR) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.SENSOR) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Sensor_LV; @@ -560,15 +604,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Sensor_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Sensor_UV; break; + case 9: + aRecipe[i] = ItemList.Sensor_UHV; + break; + default: + aRecipe[i] = ItemList.Sensor_UEV; + break; } continue; } - if (aRecipe[i] == X.FIELD_GENERATOR) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.FIELD_GENERATOR) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Field_Generator_LV; @@ -591,50 +641,56 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Field_Generator_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Field_Generator_UV; break; + case 9: + aRecipe[i] = ItemList.Field_Generator_UHV; + break; + default: + aRecipe[i] = ItemList.Field_Generator_UEV; + break; } continue; } - if (aRecipe[i] instanceof X) + if (aRecipe[i] instanceof GT_MetaTileEntity_BasicMachine_GT_Recipe.X) throw new IllegalArgumentException("MISSING TIER MAPPING FOR: " + aRecipe[i] + " AT TIER " + mTier); } - if (!GT_ModHandler.addCraftingRecipe(getStackForm(1), RecipeBits.DISMANTLEABLE | RecipeBits.BUFFERED | RecipeBits.NOT_REMOVABLE | RecipeBits.REVERSIBLE, aRecipe)) { + if (!GT_ModHandler.addCraftingRecipe(getStackForm(1), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, aRecipe)) { throw new IllegalArgumentException("INVALID CRAFTING RECIPE FOR: " + getStackForm(1).getDisplayName()); } } } - public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { + public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName); - mSharedTank = aSharedTank; - mTankCapacity = aTankCapacity; - mSpecialEffect = aSpecialEffect; - mRequiresFluidForFiltering = aRequiresFluidForFiltering; - mRecipes = aRecipes; - mSound = aSound; - mGUIParameterA = (byte) aGUIParameterA; - mGUIParameterB = (byte) aGUIParameterB; + this.mSharedTank = aSharedTank; + this.mTankCapacity = aTankCapacity; + this.mSpecialEffect = aSpecialEffect; + this.mRequiresFluidForFiltering = aRequiresFluidForFiltering; + this.mRecipes = aRecipes; + this.mSound = aSound; + this.mGUIParameterA = (byte) aGUIParameterA; + this.mGUIParameterB = (byte) aGUIParameterB; } - public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String[] aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { + public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String[] aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName); - mSharedTank = aSharedTank; - mTankCapacity = aTankCapacity; - mSpecialEffect = aSpecialEffect; - mRequiresFluidForFiltering = aRequiresFluidForFiltering; - mRecipes = aRecipes; - mSound = aSound; - mGUIParameterA = (byte) aGUIParameterA; - mGUIParameterB = (byte) aGUIParameterB; + this.mSharedTank = aSharedTank; + this.mTankCapacity = aTankCapacity; + this.mSpecialEffect = aSpecialEffect; + this.mRequiresFluidForFiltering = aRequiresFluidForFiltering; + this.mRecipes = aRecipes; + this.mSound = aSound; + this.mGUIParameterA = (byte) aGUIParameterA; + this.mGUIParameterB = (byte) aGUIParameterB; } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BasicMachine_GT_Recipe(mName, mTier, mDescriptionArray, mRecipes, mInputSlotCount, mOutputItems == null ? 0 : mOutputItems.length, mTankCapacity, mAmperage, mGUIParameterA, mGUIParameterB, mTextures, mGUIName, mNEIName, mSound, mSharedTank, mRequiresFluidForFiltering, mSpecialEffect); + return new GT_MetaTileEntity_BasicMachine_GT_Recipe(this.mName, this.mTier, this.mDescriptionArray, this.mRecipes, this.mInputSlotCount, this.mOutputItems == null ? 0 : this.mOutputItems.length, this.mTankCapacity, this.mAmperage, this.mGUIParameterA, this.mGUIParameterB, this.mTextures, this.mGUIName, this.mNEIName, this.mSound, this.mSharedTank, this.mRequiresFluidForFiltering, this.mSpecialEffect); } @Override @@ -644,22 +700,22 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "", mGUIParameterA, mGUIParameterB); + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), this.mGUIName, GT_Utility.isStringValid(this.mNEIName) ? this.mNEIName : this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : "", this.mGUIParameterA, this.mGUIParameterB); |
