diff options
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity')
7 files changed, 71 insertions, 80 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 99bcc0bf03..686286d7d8 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity; +import cpw.mods.fml.common.FMLLog; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -158,13 +159,11 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) { GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!"); } else { - if (aID != 0) { - if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null); - GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this); - mTickTimer = 0; - mID = aID; - return true; - } + if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null); + GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this); + mTickTimer = 0; + mID = aID; + return true; } return false; } @@ -179,8 +178,9 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE } long tTime = System.currentTimeMillis(); + int tCode = 0; - try { for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { + try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { switch (tCode) { case 0: tCode++; @@ -283,11 +283,11 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE } default: tCode = -1; - break; } - }} catch (Throwable e) { - //GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); - e.printStackTrace(GT_Log.err); + } + } catch (Throwable e) { + gregtech.api.util.GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(gregtech.api.util.GT_Log.err); } if (isServerSide() && hasValidMetaTileEntity()) { @@ -295,7 +295,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime; if (tTime > 0 && tTime > GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10) - System.out.println("WARNING: Possible Lag Source at [" + xCoord + ", " + yCoord + ", " + zCoord + "] in Dimension " + worldObj.provider.dimensionId + " with " + tTime + "ms caused by an instance of " + getMetaTileEntity().getClass()); + FMLLog.warning("WARNING: Possible Lag Source at [%s,%s,%s] in Dimension %s with %s ms caused by an instance of %s", xCoord, yCoord, zCoord, worldObj.provider.dimensionId, tTime, getMetaTileEntity().getClass()); } mWorkUpdate = mInventoryChanged = false; @@ -309,7 +309,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { issueTextureUpdate(); - if (mID != aID && aID > 0) { + if (aID > 0 && mID != aID) { mID = aID; createNewMetatileEntity(mID); } @@ -355,13 +355,13 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE if (aValue > 16 || aValue < 0) aValue = 0; mColor = (byte) aValue; break; - case 3: - mSidedRedstone[0] = (byte) ((aValue & 1) > 0 ? 15 : 0); - mSidedRedstone[1] = (byte) ((aValue & 2) > 0 ? 15 : 0); - mSidedRedstone[2] = (byte) ((aValue & 4) > 0 ? 15 : 0); - mSidedRedstone[3] = (byte) ((aValue & 8) > 0 ? 15 : 0); - mSidedRedstone[4] = (byte) ((aValue & 16) > 0 ? 15 : 0); - mSidedRedstone[5] = (byte) ((aValue & 32) > 0 ? 15 : 0); + case 3: //int X & Y = 0 or Y; Y -> {1,2,4,8,16,32}; byte type analogy + mSidedRedstone[0] = (byte) ((aValue & 1) == 1 ? 15 : 0); + mSidedRedstone[1] = (byte) ((aValue & 2) == 2 ? 15 : 0); + mSidedRedstone[2] = (byte) ((aValue & 4) == 4 ? 15 : 0); + mSidedRedstone[3] = (byte) ((aValue & 8) == 8 ? 15 : 0); + mSidedRedstone[4] = (byte) ((aValue & 16) == 16 ? 15 : 0); + mSidedRedstone[5] = (byte) ((aValue & 32) == 32 ? 15 : 0); break; case 4: if (hasValidMetaTileEntity() && mTickTimer > 20) @@ -704,7 +704,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE } @Override - public ITexture[] getTexture(Block block, byte aSide) { + public ITexture[] getTexture(Block aBlock, byte aSide) { ITexture rIcon = getCoverTexture(aSide); if (rIcon != null) return new ITexture[]{rIcon}; return getTextureUncovered(aSide); @@ -729,7 +729,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE } protected boolean canAccessData() { - return !isDead && hasValidMetaTileEntity(); + return hasValidMetaTileEntity() && !isDead; } @Override diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 08240d1d1c..bc18ff6909 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -206,13 +206,11 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) { GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!"); } else { - if (aID != 0) { - if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null); - GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this); - mTickTimer = 0; - mID = aID; - return true; - } + if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null); + GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this); + mTickTimer = 0; + mID = aID; + return true; } return false; } @@ -250,8 +248,11 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE mRunningThroughTick = true; long tTime = System.currentTimeMillis(); + int tCode = 0; + boolean sidetypeS = isServerSide() ? true : false; + boolean sidetypeC = isClientSide() ? true : false; - try { for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { + try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { switch (tCode) { case 0: tCode++; @@ -259,13 +260,11 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE oX = xCoord; oY = yCoord; oZ = zCoord; - if (isServerSide()) for (byte i = 0; i < 6; i++) + if (sidetypeS) for (byte i = 0; i < 6; i++) if (getCoverIDAtSide(i) != 0) if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i)))) dropCover(i, i, true); - worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this); - mMetaTileEntity.onFirstTick(this); if (!hasValidMetaTileEntity()) { mRunningThroughTick = false; @@ -305,7 +304,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE case 5: case 6: case 7: - if (isServerSide() && mTickTimer > 10) { + if (sidetypeS && mTickTimer > 10) { for (byte i = (byte) (tCode - 2); i < 6; i++) if (getCoverIDAtSide(i) != 0) { tCode++; @@ -323,7 +322,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } case 8: tCode = 9; - if (isServerSide()) { + if (sidetypeS) { if (++mAverageEUInputIndex >= mAverageEUInput.length) mAverageEUInputIndex = 0; if (++mAverageEUOutputIndex >= mAverageEUOutput.length) mAverageEUOutputIndex = 0; @@ -339,7 +338,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } case 10: tCode++; - if (isServerSide()) { + if (sidetypeS) { if (mRedstone != oRedstone || mTickTimer == 10) { for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); @@ -412,10 +411,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE || (getCoverIDAtSide((byte) 5) == 0 && worldObj.getPrecipitationHeight(xCoord + 1, zCoord) - 1 < yCoord)) { if (GregTech_API.sMachineRainExplosions && worldObj.isRaining() && getBiome().rainfall > 0) { if (getRandomNumber(10) == 0) { - try { - GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather"); - } catch (Exception e) { - } + GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather"); doEnergyExplosion(); } else setOnFire(); } @@ -424,10 +420,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE return; } if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() && getBiome().rainfall > 0 && getRandomNumber(3) == 0) { - try { - GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather"); - } catch (Exception e) { - } + GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather"); doEnergyExplosion(); } } @@ -442,7 +435,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } case 11: tCode++; - if (isServerSide()) { + if (sidetypeS) { if (mMetaTileEntity.dechargerSlotCount() > 0 && getStoredEU() < getEUCapacity()) { for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { if (mMetaTileEntity.mInventory[i] != null && getStoredEU() < getEUCapacity()) { @@ -456,7 +449,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } case 12: tCode++; - if (isServerSide()) { + if (sidetypeS) { if (mMetaTileEntity.rechargerSlotCount() > 0 && getStoredEU() > 0) { for (int i = mMetaTileEntity.rechargerSlotStartIndex(), k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { if (getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) { @@ -484,7 +477,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } case 15: tCode++; - if (isServerSide()) { + if (sidetypeS) { if (mTickTimer % 10 == 0) { if (mSendClientData) { NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_TileEntity(xCoord, (short) yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], oTextureData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) | (mRedstone ? 16 : 0) | (mLockUpgrade ? 32 : 0)), oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0)), oColor = mColor), xCoord, zCoord); @@ -521,14 +514,14 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } default: tCode = -1; - break; - }} + } + } } catch (Throwable e) { - //gregtech.api.util.GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); - e.printStackTrace(GT_Log.err); + gregtech.api.util.GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(gregtech.api.util.GT_Log.err); } - if (isServerSide() && hasValidMetaTileEntity()) { + if (sidetypeS && hasValidMetaTileEntity()) { tTime = System.currentTimeMillis() - tTime; if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime; @@ -587,7 +580,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE mFacing = (byte) (aValue & 7); mActive = ((aValue & 8) != 0); mRedstone = ((aValue & 16) != 0); -// mLockUpgrade = ((aValue&32) != 0); + //mLockUpgrade = ((aValue&32) != 0); break; case 1: if (hasValidMetaTileEntity()) mMetaTileEntity.onValueUpdate((byte) aValue); @@ -596,13 +589,13 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (aValue > 16 || aValue < 0) aValue = 0; mColor = (byte) aValue; break; - case 3: - mSidedRedstone[0] = (byte) ((aValue & 1) > 0 ? 15 : 0); - mSidedRedstone[1] = (byte) ((aValue & 2) > 0 ? 15 : 0); - mSidedRedstone[2] = (byte) ((aValue & 4) > 0 ? 15 : 0); - mSidedRedstone[3] = (byte) ((aValue & 8) > 0 ? 15 : 0); - mSidedRedstone[4] = (byte) ((aValue & 16) > 0 ? 15 : 0); - mSidedRedstone[5] = (byte) ((aValue & 32) > 0 ? 15 : 0); + case 3: //int X & Y = 0 or Y; Y -> {1,2,4,8,16,32}; byte type analogy + mSidedRedstone[0] = (byte) ((aValue & 1) == 1 ? 15 : 0); + mSidedRedstone[1] = (byte) ((aValue & 2) == 2 ? 15 : 0); + mSidedRedstone[2] = (byte) ((aValue & 4) == 4 ? 15 : 0); + mSidedRedstone[3] = (byte) ((aValue & 8) == 8 ? 15 : 0); + mSidedRedstone[4] = (byte) ((aValue & 16) == 16 ? 15 : 0); + mSidedRedstone[5] = (byte) ((aValue & 32) == 32 ? 15 : 0); break; case 4: if (hasValidMetaTileEntity() && mTickTimer > 20) @@ -1075,8 +1068,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE public boolean playerOwnsThis(EntityPlayer aPlayer, boolean aCheckPrecicely) { if (!canAccessData()) return false; - if (aCheckPrecicely || privateAccess() || mOwnerName.equals("")) - if (mOwnerName.equals("") && isServerSide()) setOwnerName(aPlayer.getDisplayName()); + if (aCheckPrecicely || privateAccess() || (mOwnerName.length() == 0)) + if ((mOwnerName.length() == 0) && isServerSide()) setOwnerName(aPlayer.getDisplayName()); else if (privateAccess() && !aPlayer.getDisplayName().equals("Player") && !mOwnerName.equals("Player") && !mOwnerName.equals(aPlayer.getDisplayName())) return false; return true; @@ -1102,7 +1095,10 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE try { mReleaseEnergy = true; IEnergyConnected.Util.emitEnergyToNetwork(V[5], Math.max(1, getStoredEU() / V[5]), this); - } catch (Exception e) {/* Fun Fact: all these "do nothing" Comments you see in my Code, are just there to let Eclipse shut up about the intended empty Brackets, but I need eclipse to yell at me in some of the regular Cases where I forget to add Code */} + } catch (Exception e) { + /* Fun Fact: all these "do nothing" Comments you see in my Code, are just there to let Eclipse shut up about the intended empty Brackets, but I need eclipse to yell at me in some of the regular Cases where I forget to add Code */ + GT_Log.out.println("mReleaseEnergy = true;\nIEnergyConnected.Util.emitEnergyToNetwork(V[5], Math.max(1, getStoredEU() / V[5]), this);"); + } } mReleaseEnergy = false; // Normal Explosion Code diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index ac3da1a60a..b34483c31b 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -30,6 +30,7 @@ import net.minecraftforge.fluids.FluidTankInfo; import java.io.File; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import static gregtech.api.enums.GT_Values.GT; import static gregtech.api.enums.GT_Values.V; @@ -83,7 +84,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity { } else { throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!"); } - mName = aBasicName.replaceAll(" ", "_").toLowerCase(); + mName = aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH); setBaseMetaTileEntity(new BaseMetaPipeEntity()); getBaseMetaTileEntity().setMetaTileID((short) aID); GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index e410c3cf12..662dc59d80 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -30,6 +30,7 @@ import net.minecraftforge.fluids.FluidTankInfo; import java.io.File; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import static gregtech.api.enums.GT_Values.GT; import static gregtech.api.enums.GT_Values.V; @@ -79,7 +80,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity { } else { throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!"); } - mName = aBasicName.replaceAll(" ", "_").toLowerCase(); + mName = aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH); setBaseMetaTileEntity(GregTech_API.constructBaseMetaTileEntity()); getBaseMetaTileEntity().setMetaTileID((short) aID); GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); 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 fb863ef37a..9b0e386df4 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,7 +1,5 @@ package gregtech.api.metatileentity.implementations; -import java.util.Random; - import gregtech.api.enums.*; import gregtech.api.gui.GT_Container_BasicMachine; import gregtech.api.gui.GT_GUIContainer_BasicMachine; @@ -19,6 +17,9 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.util.Locale; +import java.util.Random; + import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.GT_Values.W; @@ -35,7 +36,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ 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() + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM"))}); + 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; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java index ee45c536b5..552d98f50b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java @@ -112,10 +112,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch } if (mSolderingTool && aPlayer instanceof EntityPlayerMP) { EntityPlayerMP tPlayer = (EntityPlayerMP) aPlayer; - try { - GT_Mod.instance.achievements.issueAchievement(tPlayer, "maintainance"); - } catch (Exception e) { - } + GT_Mod.instance.achievements.issueAchievement(tPlayer, "maintainance"); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index ab24de0ba7..7e45afdd2d 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -25,8 +25,6 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import org.apache.commons.lang3.ArrayUtils; - import static gregtech.api.enums.GT_Values.V; public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { @@ -240,10 +238,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) { if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) { - try { - GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack); - } catch (Exception e) { - } + GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack); addOutput(tStack); } if (mOutputFluids != null && mOutputFluids.length == 1) { @@ -416,7 +411,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { if (mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { NBTTagCompound tNBT = mInventory[1].getTagCompound(); if (tNBT != null) { - NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents"); + NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents");//tNBT2 dont use out if if (!tNBT.getBoolean("mDis")) { tNBT2 = new NBTTagCompound(); Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[1]); |