From 2bd06dc60e1db04bc9c672e0aa9769a12c289d8c Mon Sep 17 00:00:00 2001 From: Muramasa Date: Sun, 14 Aug 2016 04:58:51 +0100 Subject: Bugfixes 3 --- .../gregtech/common/render/GT_CapeRenderer.java | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/main/java/gregtech/common/render/GT_CapeRenderer.java') diff --git a/src/main/java/gregtech/common/render/GT_CapeRenderer.java b/src/main/java/gregtech/common/render/GT_CapeRenderer.java index 49ba9a72e8..26ffc282ca 100644 --- a/src/main/java/gregtech/common/render/GT_CapeRenderer.java +++ b/src/main/java/gregtech/common/render/GT_CapeRenderer.java @@ -19,6 +19,8 @@ public class GT_CapeRenderer extends RenderPlayer { private final ResourceLocation[] mCapes = {new ResourceLocation("gregtech:textures/BrainTechCape.png"), new ResourceLocation("gregtech:textures/GregTechCape.png"), new ResourceLocation("gregtech:textures/MrBrainCape.png"), new ResourceLocation("gregtech:textures/GregoriusCape.png")}; private final Collection mCapeList; + private static final float glf0 = 0.0F; + private static final float glf1 = 1.0F; public GT_CapeRenderer(Collection aCapeList) { this.mCapeList = aCapeList; @@ -55,13 +57,15 @@ public class GT_CapeRenderer if ((tResource != null) && (!aPlayer.getHideCape())) { bindTexture(tResource); GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 0.0F, 0.125F); - double d0 = aPlayer.field_71091_bM + (aPlayer.field_71094_bP - aPlayer.field_71091_bM) * aPartialTicks - (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks); - double d1 = aPlayer.field_71096_bN + (aPlayer.field_71095_bQ - aPlayer.field_71096_bN) * aPartialTicks - (aPlayer.prevPosY + (aPlayer.posY - aPlayer.prevPosY) * aPartialTicks); - double d2 = aPlayer.field_71097_bO + (aPlayer.field_71085_bR - aPlayer.field_71097_bO) * aPartialTicks - (aPlayer.prevPosZ + (aPlayer.posZ - aPlayer.prevPosZ) * aPartialTicks); + GL11.glTranslatef(glf0, glf0, 0.125F); + double var1f = (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks); + double d0 = aPlayer.field_71091_bM + var1f; + double d1 = aPlayer.field_71096_bN + var1f; + double d2 = aPlayer.field_71097_bO + var1f; float f6 = aPlayer.prevRenderYawOffset + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks; - double d3 = MathHelper.sin(f6 * 3.141593F / 180.0F); - double d4 = -MathHelper.cos(f6 * 3.141593F / 180.0F); + float var2f = f6 * 3.141593F / 180.0F; + double d3 = MathHelper.sin(var2f); + double d4 = -MathHelper.cos(var2f); float f7 = (float) d1 * 10.0F; float f8 = (float) (d0 * d3 + d2 * d4) * 100.0F; float f9 = (float) (d0 * d4 - d2 * d3) * 100.0F; @@ -71,18 +75,18 @@ public class GT_CapeRenderer if (f7 > 32.0F) { f7 = 32.0F; } - if (f8 < 0.0F) { - f8 = 0.0F; + if (f8 < glf0) { + f8 = glf0; } float f10 = aPlayer.prevCameraYaw + (aPlayer.cameraYaw - aPlayer.prevCameraYaw) * aPartialTicks; f7 += MathHelper.sin((aPlayer.prevDistanceWalkedModified + (aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified) * aPartialTicks) * 6.0F) * 32.0F * f10; if (aPlayer.isSneaking()) { f7 += 25.0F; } - GL11.glRotatef(6.0F + f8 / 2.0F + f7, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(f9 / 2.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-f9 / 2.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(6.0F + f8 / 2.0F + f7, glf1, glf0, glf0); + GL11.glRotatef(f9 / 2.0F, glf0, glf0, glf1); + GL11.glRotatef(-f9 / 2.0F, glf0, glf1, glf0); + GL11.glRotatef(180.0F, glf0, glf1, glf0); ((ModelBiped) this.mainModel).renderCloak(0.0625F); GL11.glPopMatrix(); } -- cgit From bfccecf87bce3487bc72699782488ac64bc5623f Mon Sep 17 00:00:00 2001 From: Muramasa Date: Sun, 14 Aug 2016 05:36:12 +0100 Subject: Bugfixes 5 --- .../gregtech/api/items/GT_MetaGenerated_Tool.java | 2 +- .../api/metatileentity/BaseMetaPipeEntity.java | 205 ++++---- .../api/metatileentity/BaseMetaTileEntity.java | 514 +++++++++++---------- src/main/java/gregtech/common/GT_Proxy.java | 2 +- .../gregtech/common/blocks/GT_Item_Machines.java | 4 +- .../gregtech/common/covers/GT_Cover_Conveyor.java | 2 +- .../java/gregtech/common/covers/GT_Cover_Pump.java | 4 +- .../common/gui/GT_GUIContainer_FusionReactor.java | 4 +- .../gregtech/common/render/GT_CapeRenderer.java | 20 +- .../machines/basic/GT_MetaTileEntity_Scanner.java | 7 +- .../GT_MetaTileEntity_AlloySmelter_Bronze.java | 6 +- .../GT_MetaTileEntity_AlloySmelter_Steel.java | 6 +- .../GT_MetaTileEntity_ForgeHammer_Bronze.java | 6 +- .../steam/GT_MetaTileEntity_ForgeHammer_Steel.java | 6 +- .../java/gregtech/common/tools/GT_Tool_Axe.java | 2 +- .../common/tools/GT_Tool_BranchCutter.java | 2 +- .../java/gregtech/common/tools/GT_Tool_File.java | 2 +- .../java/gregtech/common/tools/GT_Tool_Plow.java | 2 +- .../gregtech/common/tools/GT_Tool_Plunger.java | 2 +- .../java/gregtech/common/tools/GT_Tool_Sense.java | 2 +- .../gregtech/common/tools/GT_Tool_SoftHammer.java | 2 +- .../common/tools/GT_Tool_UniversalSpade.java | 2 +- 22 files changed, 410 insertions(+), 394 deletions(-) (limited to 'src/main/java/gregtech/common/render/GT_CapeRenderer.java') diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java index cfbf9deb7f..9dd688f70e 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java +++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java @@ -600,7 +600,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements @Override public boolean isItemStackUsable(ItemStack aStack) { IToolStats tStats = getToolStatsInternal(aStack); - if (aStack.getItemDamage() % 2 == 1 || tStats == null) { + if (aStack.getItemDamage() % 2 != 0 || tStats == null) { NBTTagCompound aNBT = aStack.getTagCompound(); if (aNBT != null) aNBT.removeTag("ench"); return false; diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 9feceade1c..e2765861bd 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -182,116 +182,123 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE long tTime = System.currentTimeMillis(); int tCode = 0; - for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { - try { - switch (tCode) { - case 0: - tCode++; - if (mTickTimer++ == 0) { - oX = xCoord; - oY = yCoord; - oZ = zCoord; - if (isServerSide()) 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()) return; - } - case 1: - tCode++; - if (isClientSide()) { - if (mColor != oColor) { - mMetaTileEntity.onColorChangeClient(oColor = mColor); - issueTextureUpdate(); - } + try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { + //replace switch in if + //switch (tCode) { + //case 0: + if (tCode == 0) { + tCode++; + if (mTickTimer++ == 0) { + oX = xCoord; + oY = yCoord; + oZ = zCoord; + if (isServerSide()) 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()) return; + }} + //case 1: + if (tCode == 1) { + tCode++; + if (isClientSide()) { + if (mColor != oColor) { + mMetaTileEntity.onColorChangeClient(oColor = mColor); + issueTextureUpdate(); + } - if (mNeedsUpdate) { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - //worldObj.func_147479_m(xCoord, yCoord, zCoord); - mNeedsUpdate = false; - } - } - case 2: + if (mNeedsUpdate) { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + //worldObj.func_147479_m(xCoord, yCoord, zCoord); + mNeedsUpdate = false; + } + }} + /*case 2: case 3: case 4: case 5: case 6: - case 7: - if (isServerSide() && mTickTimer > 10) { - for (byte i = (byte) (tCode - 2); i < 6; i++) - if (getCoverIDAtSide(i) != 0) { - tCode++; - GT_CoverBehavior tCover = getCoverBehaviorAtSide(i); - int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this); - if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) { - mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer); - if (!hasValidMetaTileEntity()) return; - } - } - mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~63)); - if ((mConnections & -64) == 64 && getRandomNumber(1000) == 0) { - mConnections = (byte) ((mConnections & ~64) | -128); + case 7:*/ + if (tCode >= 2 && tCode <= 7) { + if (isServerSide() && mTickTimer > 10) { + for (byte i = (byte) (tCode - 2); i < 6; i++) + if (getCoverIDAtSide(i) != 0) { + tCode++; + GT_CoverBehavior tCover = getCoverBehaviorAtSide(i); + int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this); + if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) { + mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer); + if (!hasValidMetaTileEntity()) return; } } - case 8: - tCode = 9; - mMetaTileEntity.onPreTick(this, mTickTimer); - if (!hasValidMetaTileEntity()) return; - case 9: - tCode++; - if (isServerSide()) { - if (mTickTimer == 10) { - for (byte i = 0; i < 6; i++) - mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); - issueBlockUpdate(); - } + mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~63)); + if ((mConnections & -64) == 64 && getRandomNumber(1000) == 0) { + mConnections = (byte) ((mConnections & ~64) | -128); + } + }} + //case 8: + if (tCode == 8) { + tCode = 9; + mMetaTileEntity.onPreTick(this, mTickTimer); + if (!hasValidMetaTileEntity()) return;} + //case 9: + if (tCode == 9) { + tCode++; + if (isServerSide()) { + if (mTickTimer == 10) { + for (byte i = 0; i < 6; i++) + mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + issueBlockUpdate(); + } - if (xCoord != oX || yCoord != oY || zCoord != oZ) { - oX = xCoord; - oY = yCoord; - oZ = zCoord; - issueClientUpdate(); - clearTileEntityBuffer(); - } + if (xCoord != oX || yCoord != oY || zCoord != oZ) { + oX = xCoord; + oY = yCoord; + oZ = zCoord; + issueClientUpdate(); + clearTileEntityBuffer(); + } + }} + //case 10: + if (tCode == 10) { + tCode++; + mMetaTileEntity.onPostTick(this, mTickTimer); + if (!hasValidMetaTileEntity()) return;} + //case 11: + if (tCode == 11) { + tCode++; + if (isServerSide()) { + 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 = mConnections, 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); + mSendClientData = false; } - case 10: - tCode++; - mMetaTileEntity.onPostTick(this, mTickTimer); - if (!hasValidMetaTileEntity()) return; - case 11: - tCode++; - if (isServerSide()) { - 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 = mConnections, 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); - mSendClientData = false; - } - } + } - if (mTickTimer > 10) { - if (mConnections != oTextureData) sendBlockEvent((byte) 0, oTextureData = mConnections); - byte tData = mMetaTileEntity.getUpdateData(); - if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData); - if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor); - tData = (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)); - if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData); - } + if (mTickTimer > 10) { + if (mConnections != oTextureData) sendBlockEvent((byte) 0, oTextureData = mConnections); + byte tData = mMetaTileEntity.getUpdateData(); + if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData); + if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor); + tData = (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)); + if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData); + } - if (mNeedsBlockUpdate) { - worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0)); - mNeedsBlockUpdate = false; - } - } - 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); - } + if (mNeedsBlockUpdate) { + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0)); + mNeedsBlockUpdate = false; + } + }} + //default: + if (tCode > 11) { + 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); } if (isServerSide() && hasValidMetaTileEntity()) { diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 15767bb40b..ea2daf1b31 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -250,290 +250,296 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE mRunningThroughTick = true; long tTime = System.currentTimeMillis(); + int tCode = 0; + + try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { + //replace switch in if + //switch (tCode) { + //case 0: + if (tCode == 0) { + tCode++; + if (mTickTimer++ == 0) { + oX = xCoord; + oY = yCoord; + oZ = zCoord; + if (isServerSide()) 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; + return; + } + }} + //case 1: + if (tCode == 1) { + tCode++; + if (isClientSide()) { + if (mColor != oColor) { + mMetaTileEntity.onColorChangeClient(oColor = mColor); + issueTextureUpdate(); + } - for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { - try { - switch (tCode) { - case 0: - tCode++; - if (mTickTimer++ == 0) { - oX = xCoord; - oY = yCoord; - oZ = zCoord; - if (isServerSide()) 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; - return; - } - } - case 1: - tCode++; - if (isClientSide()) { - if (mColor != oColor) { - mMetaTileEntity.onColorChangeClient(oColor = mColor); - issueTextureUpdate(); - } - - if (mLightValue != oLightValueClient) { - worldObj.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, mLightValue); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord + 1, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord - 1, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord + 1, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord - 1, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord + 1); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord - 1); - oLightValueClient = mLightValue; - issueTextureUpdate(); - } + if (mLightValue != oLightValueClient) { + worldObj.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, mLightValue); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord + 1, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord - 1, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord + 1, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord - 1, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord + 1); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord - 1); + oLightValueClient = mLightValue; + issueTextureUpdate(); + } - if (mNeedsUpdate) { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - //worldObj.func_147479_m(xCoord, yCoord, zCoord); - mNeedsUpdate = false; - } - } - case 2: + if (mNeedsUpdate) { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + //worldObj.func_147479_m(xCoord, yCoord, zCoord); + mNeedsUpdate = false; + } + }} + /*case 2: case 3: case 4: case 5: case 6: - case 7: - if (isServerSide() && mTickTimer > 10) { - for (byte i = (byte) (tCode - 2); i < 6; i++) - if (getCoverIDAtSide(i) != 0) { - tCode++; - GT_CoverBehavior tCover = getCoverBehaviorAtSide(i); - int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this); - if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) { - mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer); - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - return; - } - } + case 7:*/ + if (tCode >= 2 && tCode <= 7) { + if (isServerSide() && mTickTimer > 10) { + for (byte i = (byte) (tCode - 2); i < 6; i++) + if (getCoverIDAtSide(i) != 0) { + tCode++; + GT_CoverBehavior tCover = getCoverBehaviorAtSide(i); + int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this); + if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) { + mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; } - - } - case 8: - tCode = 9; - if (isServerSide()) { - if (++mAverageEUInputIndex >= mAverageEUInput.length) mAverageEUInputIndex = 0; - if (++mAverageEUOutputIndex >= mAverageEUOutput.length) mAverageEUOutputIndex = 0; - - mAverageEUInput[mAverageEUInputIndex] = 0; - mAverageEUOutput[mAverageEUOutputIndex] = 0; - } - case 9: - tCode++; - mMetaTileEntity.onPreTick(this, mTickTimer); - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - return; - } - case 10: - tCode++; - if (isServerSide()) { - if (mRedstone != oRedstone || mTickTimer == 10) { - for (byte i = 0; i < 6; i++) - mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); - oRedstone = mRedstone; - issueBlockUpdate(); } + } - if (xCoord != oX || yCoord != oY || zCoord != oZ) { - oX = xCoord; - oY = yCoord; - oZ = zCoord; - issueClientUpdate(); - clearTileEntityBuffer(); - } + }} + //case 8: + if (tCode == 8) { + tCode = 9; + if (isServerSide()) { + if (++mAverageEUInputIndex >= mAverageEUInput.length) mAverageEUInputIndex = 0; + if (++mAverageEUOutputIndex >= mAverageEUOutput.length) mAverageEUOutputIndex = 0; + + mAverageEUInput[mAverageEUInputIndex] = 0; + mAverageEUOutput[mAverageEUOutputIndex] = 0; + }} + //case 9: + if (tCode == 9) { + tCode++; + mMetaTileEntity.onPreTick(this, mTickTimer); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + }} + //case 10: + if (tCode == 10) { + tCode++; + if (isServerSide()) { + if (mRedstone != oRedstone || mTickTimer == 10) { + for (byte i = 0; i < 6; i++) + mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + oRedstone = mRedstone; + issueBlockUpdate(); + } - if (mFacing != oFacing) { - oFacing = mFacing; - for (byte i = 0; i < 6; i++) - if (getCoverIDAtSide(i) != 0) - if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i)))) - dropCover(i, i, true); - issueBlockUpdate(); - } + if (xCoord != oX || yCoord != oY || zCoord != oZ) { + oX = xCoord; + oY = yCoord; + oZ = zCoord; + issueClientUpdate(); + clearTileEntityBuffer(); + } - if (mTickTimer > 20 && mMetaTileEntity.isElectric()) { - mAcceptedAmperes = 0; + if (mFacing != oFacing) { + oFacing = mFacing; + for (byte i = 0; i < 6; i++) + if (getCoverIDAtSide(i) != 0) + if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i)))) + dropCover(i, i, true); + issueBlockUpdate(); + } - if (getOutputVoltage() != oOutput) { - oOutput = getOutputVoltage(); - } + if (mTickTimer > 20 && mMetaTileEntity.isElectric()) { + mAcceptedAmperes = 0; - if (mMetaTileEntity.isEnetOutput() || mMetaTileEntity.isEnetInput()) { - for (byte i = 0; i < 6; i++) { - boolean - temp = isEnergyInputSide(i); - if (temp != mActiveEUInputs[i]) { - mActiveEUInputs[i] = temp; - } - temp = isEnergyOutputSide(i); - if (temp != mActiveEUOutputs[i]) { - mActiveEUOutputs[i] = temp; - } - } - } + if (getOutputVoltage() != oOutput) { + oOutput = getOutputVoltage(); + } - if (mMetaTileEntity.isEnetOutput() && oOutput > 0) { - long tOutputVoltage = Math.max(oOutput, oOutput + (1 << GT_Utility.getTier(oOutput))), tUsableAmperage = Math.min(getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); - if (tUsableAmperage > 0) { - long tEU = tOutputVoltage * IEnergyConnected.Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this); - mAverageEUOutput[mAverageEUOutputIndex] += tEU; - decreaseStoredEU(tEU, true); - } + if (mMetaTileEntity.isEnetOutput() || mMetaTileEntity.isEnetInput()) { + for (byte i = 0; i < 6; i++) { + boolean + temp = isEnergyInputSide(i); + if (temp != mActiveEUInputs[i]) { + mActiveEUInputs[i] = temp; } - if (getEUCapacity() > 0) { - if (GregTech_API.sMachineFireExplosions && getRandomNumber(1000) == 0) { - Block tBlock = getBlockAtSide((byte) getRandomNumber(6)); - if (tBlock != null && tBlock instanceof BlockFire) doEnergyExplosion(); - } - - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - return; - } - - if (getRandomNumber(1000) == 0) { - if ((getCoverIDAtSide((byte) 1) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord) - 2 < yCoord) - || (getCoverIDAtSide((byte) 2) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord - 1) - 1 < yCoord) - || (getCoverIDAtSide((byte) 3) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord + 1) - 1 < yCoord) - || (getCoverIDAtSide((byte) 4) == 0 && worldObj.getPrecipitationHeight(xCoord - 1, zCoord) - 1 < yCoord) - || (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) { - //} - doEnergyExplosion(); - } else setOnFire(); - } - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - 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) { - } - doEnergyExplosion(); - } - } - } + temp = isEnergyOutputSide(i); + if (temp != mActiveEUOutputs[i]) { + mActiveEUOutputs[i] = temp; } } + } + + if (mMetaTileEntity.isEnetOutput() && oOutput > 0) { + long tOutputVoltage = Math.max(oOutput, oOutput + (1 << GT_Utility.getTier(oOutput))), tUsableAmperage = Math.min(getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); + if (tUsableAmperage > 0) { + long tEU = tOutputVoltage * IEnergyConnected.Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this); + mAverageEUOutput[mAverageEUOutputIndex] += tEU; + decreaseStoredEU(tEU, true); + } + } + if (getEUCapacity() > 0) { + if (GregTech_API.sMachineFireExplosions && getRandomNumber(1000) == 0) { + Block tBlock = getBlockAtSide((byte) getRandomNumber(6)); + if (tBlock instanceof BlockFire) doEnergyExplosion(); + } if (!hasValidMetaTileEntity()) { mRunningThroughTick = false; return; } - } - case 11: - tCode++; - if (isServerSide()) { - 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()) { - dischargeItem(mMetaTileEntity.mInventory[i]); - if(ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i])>0){ - if((getStoredEU() + ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i])) 0) { + if (getRandomNumber(10) == 0) { + //try { + GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather"); + //} catch (Exception e) { + //} + doEnergyExplosion(); + } else setOnFire(); + } + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + 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) { } - if (mMetaTileEntity.mInventory[i].stackSize <= 0) - mMetaTileEntity.mInventory[i] = null; - mInventoryChanged = true; + doEnergyExplosion(); } } } } - case 12: - tCode++; - if (isServerSide()) { - 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) { - chargeItem(mMetaTileEntity.mInventory[i]); - if (mMetaTileEntity.mInventory[i].stackSize <= 0) - mMetaTileEntity.mInventory[i] = null; - mInventoryChanged = true; - } + } + + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + } + //case 11: + if (tCode == 11) { + tCode++; + if (isServerSide()) { + 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()) { + dischargeItem(mMetaTileEntity.mInventory[i]); + if (mMetaTileEntity.mInventory[i].stackSize <= 0) + mMetaTileEntity.mInventory[i] = null; + mInventoryChanged = true; } } } - case 13: - tCode++; - updateStatus(); - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - return; - } - case 14: - tCode++; - mMetaTileEntity.onPostTick(this, mTickTimer); - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - return; - } - case 15: - tCode++; - if (isServerSide()) { - 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); - mSendClientData = false; + }} + //case 12: + if (tCode == 12) { + tCode++; + if (isServerSide()) { + 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) { + chargeItem(mMetaTileEntity.mInventory[i]); + if (mMetaTileEntity.mInventory[i].stackSize <= 0) + mMetaTileEntity.mInventory[i] = null; + mInventoryChanged = true; } } - - if (mTickTimer > 10) { - byte tData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) | (mRedstone ? 16 : 0) | (mLockUpgrade ? 32 : 0)); - if (tData != oTextureData) sendBlockEvent((byte) 0, oTextureData = tData); - tData = mMetaTileEntity.getUpdateData(); - if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData); - if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor); - tData = (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)); - if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData); - if (mLightValue != oLightValue) { - worldObj.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, mLightValue); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord + 1, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord - 1, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord + 1, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord - 1, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord + 1); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord - 1); - issueTextureUpdate(); - sendBlockEvent((byte) 7, oLightValue = mLightValue); - } + } + }} + //case 13: + if (tCode == 13) { + tCode++; + updateStatus(); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + }} + //case 14: + if (tCode == 14) { + tCode++; + mMetaTileEntity.onPostTick(this, mTickTimer); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + }} + //case 15: + if (tCode == 15) { + tCode++; + if (isServerSide()) { + 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); + mSendClientData = false; } + } - if (mNeedsBlockUpdate) { - worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0)); - mNeedsBlockUpdate = false; + if (mTickTimer > 10) { + byte tData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) | (mRedstone ? 16 : 0) | (mLockUpgrade ? 32 : 0)); + if (tData != oTextureData) sendBlockEvent((byte) 0, oTextureData = tData); + tData = mMetaTileEntity.getUpdateData(); + if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData); + if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor); + tData = (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)); + if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData); + if (mLightValue != oLightValue) { + worldObj.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, mLightValue); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord + 1, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord - 1, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord + 1, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord - 1, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord + 1); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord - 1); + issueTextureUpdate(); + sendBlockEvent((byte) 7, oLightValue = mLightValue); } } - 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); - } + + if (mNeedsBlockUpdate) { + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0)); + mNeedsBlockUpdate = false; + } + }} + //default: + if (tCode > 15) { + 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); } if (isServerSide() && hasValidMetaTileEntity()) { @@ -595,7 +601,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); @@ -1083,8 +1089,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; @@ -1110,7 +1116,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 @@ -1359,6 +1368,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE @Override public byte getOutputRedstoneSignal(byte aSide) { return getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) ? mSidedRedstone[aSide] : 0; +// return (byte)(getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) || (mRedstone && getCoverBehaviorAtSide(aSide).letsRedstoneGoOut(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))?mSidedRedstone[aSide]&15:0); } @Override diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index d45825155f..79061be22e 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -894,7 +894,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { if ((aEvent.entityPlayer == null) || (aEvent.entityPlayer.worldObj == null) || (aEvent.action == null) || (aEvent.world.provider == null)) { return; } - if ((!aEvent.entityPlayer.worldObj.isRemote) && (aEvent.action != null) && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR) + if ((!aEvent.entityPlayer.worldObj.isRemote) && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR) && (GT_Log.pal != null)) { this.mBufferedPlayerActivity.add(getDataAndTime() + ";" + aEvent.action.name() + ";" + aEvent.entityPlayer.getDisplayName() + ";DIM:" + aEvent.world.provider.dimensionId + ";" + aEvent.x + ";" + aEvent.y + ";" + aEvent.z + ";|;" + aEvent.x / 10 + ";" + aEvent.y / 10 + ";" diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index e03cabe783..35ac55e1b7 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -38,7 +38,7 @@ public class GT_Item_Machines aList.add("IF YOU GOT IT IN SURVIVAL THEN PLEASE REPORT IT"); } else { TileEntity temp = GregTech_API.sBlockMachines.createTileEntity(aPlayer == null ? GT_Values.DW : aPlayer.worldObj, GregTech_API.METATILEENTITIES[tDamage] == null ? 0 : GregTech_API.METATILEENTITIES[tDamage].getTileEntityBaseType()); - if (temp != null) { + //if (temp != null) { temp.setWorldObj(aPlayer == null ? GT_Values.DW : aPlayer.worldObj); temp.xCoord = 0; temp.yCoord = 0; @@ -67,7 +67,7 @@ public class GT_Item_Machines aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY); } } - } + //} } NBTTagCompound aNBT = aStack.getTagCompound(); if (aNBT != null) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java index 489381873e..0168228bc5 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -24,7 +24,7 @@ public class GT_Cover_Conveyor } TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide); //aTileEntity.decreaseStoredEnergyUnits(1L, true); - if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= 128L)) { + if (((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= 128L)) { if (aTileEntity.isUniversalEnergyStored(256L)) { aTileEntity.decreaseStoredEnergyUnits(4 * GT_Utility.moveOneItemStack(aCoverVariable % 2 == 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? GT_Utility.getOppositeSide(aSide) : aSide, aCoverVariable % 2 == 0 ? GT_Utility.getOppositeSide(aSide) : aSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1), true); } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java index 570d73e601..2bae554b76 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -35,7 +35,7 @@ public class GT_Cover_Pump tLiquid = tLiquid.copy(); tLiquid.amount = tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid, false); if (tLiquid.amount > 0) { - if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) { + if (((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) { if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) { aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true); tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true), true); @@ -51,7 +51,7 @@ public class GT_Cover_Pump tLiquid = tLiquid.copy(); tLiquid.amount = tTank1.fill(ForgeDirection.getOrientation(aSide), tLiquid, false); if (tLiquid.amount > 0) { - if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) { + if (((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) { if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) { aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true); tTank1.fill(ForgeDirection.getOrientation(aSide), tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid.amount, true), true); diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java index 6d5b1721d8..a39b7f35d2 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java @@ -34,9 +34,9 @@ public class GT_GUIContainer_FusionReactor extends GT_GUIContainerMetaTile_Machi fontRendererObj.drawString("Running perfectly.", 10, 170, 16448255); } } - if (this.mContainer != null) { + //if (this.mContainer != null) { fontRendererObj.drawString(GT_Utility.formatNumbers(this.mContainer.mEnergy) + " EU", 50, 155, 0x00ff0000); - } + //} } } diff --git a/src/main/java/gregtech/common/render/GT_CapeRenderer.java b/src/main/java/gregtech/common/render/GT_CapeRenderer.java index 26ffc282ca..cf72032c53 100644 --- a/src/main/java/gregtech/common/render/GT_CapeRenderer.java +++ b/src/main/java/gregtech/common/render/GT_CapeRenderer.java @@ -58,17 +58,17 @@ public class GT_CapeRenderer bindTexture(tResource); GL11.glPushMatrix(); GL11.glTranslatef(glf0, glf0, 0.125F); - double var1f = (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks); - double d0 = aPlayer.field_71091_bM + var1f; - double d1 = aPlayer.field_71096_bN + var1f; - double d2 = aPlayer.field_71097_bO + var1f; - float f6 = aPlayer.prevRenderYawOffset + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks; + float var1f = (float) (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks); + float d0 = (float) aPlayer.field_71091_bM + var1f; + float d1 = (float) aPlayer.field_71096_bN + var1f; + float d2 = (float) aPlayer.field_71097_bO + var1f; + float f6 = (float) (aPlayer.prevRenderYawOffset + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks); float var2f = f6 * 3.141593F / 180.0F; - double d3 = MathHelper.sin(var2f); - double d4 = -MathHelper.cos(var2f); - float f7 = (float) d1 * 10.0F; - float f8 = (float) (d0 * d3 + d2 * d4) * 100.0F; - float f9 = (float) (d0 * d4 - d2 * d3) * 100.0F; + float d3 = MathHelper.sin(var2f); + float d4 = -MathHelper.cos(var2f); + float f7 = /*(float) */d1 * 10.0F; + float f8 = /*(float) */(d0 * d3 + d2 * d4) * 100.0F; + float f9 = /*(float) */(d0 * d4 - d2 * d3) * 100.0F; if (f7 < -6.0F) { f7 = -6.0F; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 50e60f00b3..b791e58485 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -16,7 +16,6 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import gregtech.common.items.behaviors.Behaviour_DataStick; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -207,12 +206,12 @@ public class GT_MetaTileEntity_Scanner @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime >= (mMaxProgresstime - 1)) { - try { + //try { if (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707")) { GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); } - } catch (Exception e) { - } + //} catch (Exception e) { + //} } super.onPostTick(aBaseMetaTileEntity, aTick); } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java index c62b795adb..96030205e5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java @@ -34,13 +34,13 @@ public class GT_MetaTileEntity_AlloySmelter_Bronze GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { this.mOutputItems[0] = tRecipe.getOutput(0); - if (tRecipe.mEUt <= 16) { + //if (tRecipe.mEUt <= 16) { this.mEUt = tRecipe.mEUt; this.mMaxProgresstime = (tRecipe.mDuration * 2); - } else { + /*} else { this.mEUt = tRecipe.mEUt; this.mMaxProgresstime = (tRecipe.mDuration * 2); - } + }*/ return 2; } return 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java index fe32ca8bce..7ed2c86396 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java @@ -34,13 +34,13 @@ public class GT_MetaTileEntity_AlloySmelter_Steel GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { this.mOutputItems[0] = tRecipe.getOutput(0); - if (tRecipe.mEUt <= 16) { + //if (tRecipe.mEUt <= 16) { this.mEUt = (tRecipe.mEUt * 3); this.mMaxProgresstime = tRecipe.mDuration; - } else { + /*} else { this.mEUt = (tRecipe.mEUt * 3); this.mMaxProgresstime = tRecipe.mDuration; - } + }*/ return 2; } return 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java index 5b0877a3f1..f66cd809d4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java @@ -34,13 +34,13 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { this.mOutputItems[0] = tRecipe.getOutput(0); - if (tRecipe.mEUt <= 16) { + //if (tRecipe.mEUt <= 16) { this.mEUt = tRecipe.mEUt; this.mMaxProgresstime = (tRecipe.mDuration * 2); - } else { + /*} else { this.mEUt = tRecipe.mEUt; this.mMaxProgresstime = (tRecipe.mDuration * 2); - } + }*/ return 2; } return 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java index 6d2c7d48a8..49345506f2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java @@ -34,13 +34,13 @@ public class GT_MetaTileEntity_ForgeHammer_Steel GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { this.mOutputItems[0] = tRecipe.getOutput(0); - if (tRecipe.mEUt <= 16) { + //if (tRecipe.mEUt <= 16) { this.mEUt = (tRecipe.mEUt * 3); this.mMaxProgresstime = tRecipe.mDuration; - } else { + /*} else { this.mEUt = (tRecipe.mEUt * 3); this.mMaxProgresstime = tRecipe.mDuration; - } + }*/ return 2; } return 0; diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Axe.java b/src/main/java/gregtech/common/tools/GT_Tool_Axe.java index f74aeca505..ee409418fb 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Axe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Axe.java @@ -80,7 +80,7 @@ public class GT_Tool_Axe public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return ((tTool != null) && (tTool.equals("axe"))) || (aBlock.getMaterial() == Material.wood); + return (/*(tTool != null) && */(tTool.equals("axe"))) || (aBlock.getMaterial() == Material.wood); } public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java b/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java index 7cefcdfd8d..d60fec6ec6 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java @@ -60,7 +60,7 @@ public class GT_Tool_BranchCutter public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return ((tTool != null) && (tTool.equals("grafter"))) || (aBlock.getMaterial() == Material.leaves); + return (/*(tTool != null) && */(tTool.equals("grafter"))) || (aBlock.getMaterial() == Material.leaves); } public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_File.java b/src/main/java/gregtech/common/tools/GT_Tool_File.java index 5bb07c0614..61b84fd4f9 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_File.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_File.java @@ -75,7 +75,7 @@ public class GT_Tool_File public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (tTool != null) && (tTool.equals("file")); + return /*(tTool != null) && */(tTool.equals("file")); } public ItemStack getBrokenItem(ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plow.java b/src/main/java/gregtech/common/tools/GT_Tool_Plow.java index a7666d34c8..9a33882140 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plow.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plow.java @@ -31,7 +31,7 @@ public class GT_Tool_Plow public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return ((tTool != null) && (tTool.equals("plow"))) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.craftedSnow); + return (/*(tTool != null) && */(tTool.equals("plow"))) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.craftedSnow); } public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java index ba615a39a1..1e63187163 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java @@ -43,7 +43,7 @@ public class GT_Tool_Plunger public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (tTool != null) && (tTool.equals("plunger")); + return /*(tTool != null) && */(tTool.equals("plunger")); } public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Sense.java b/src/main/java/gregtech/common/tools/GT_Tool_Sense.java index 55fb257c66..b06ebd933f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Sense.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Sense.java @@ -31,7 +31,7 @@ public class GT_Tool_Sense public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return ((tTool != null) && ((tTool.equals("sense")) || (tTool.equals("scythe")))) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.leaves); + return (/*(tTool != null) && */((tTool.equals("sense")) || (tTool.equals("scythe")))) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.leaves); } public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java index 0b77a45ecd..15b7f020dc 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java @@ -84,7 +84,7 @@ public class GT_Tool_SoftHammer public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (tTool != null) && (tTool.equals("softhammer")); + return /*(tTool != null) && */(tTool.equals("softhammer")); } public ItemStack getBrokenItem(ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java b/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java index 03fd6a97a1..af9e5c62e1 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java @@ -79,7 +79,7 @@ public class GT_Tool_UniversalSpade public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return ((tTool != null) && ((tTool.equals("shovel")) || (tTool.equals("axe")) || (tTool.equals("saw")) || (tTool.equals("sword")) || (tTool.equals("crowbar")))) || (aBlock.getMaterial() == Material.sand) || (aBlock.getMaterial() == Material.grass) || (aBlock.getMaterial() == Material.ground) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.clay) || (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.wood) || (aBlock.getMaterial() == Material.cactus) || (aBlock.getMaterial() == Material.circuits) || (aBlock.getMaterial() == Material.gourd) || (aBlock.getMaterial() == Material.web) || (aBlock.getMaterial() == Material.cloth) || (aBlock.getMaterial() == Material.carpet) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.cake) || (aBlock.getMaterial() == Material.tnt) || (aBlock.getMaterial() == Material.sponge); + return (/*(tTool != null) && */((tTool.equals("shovel")) || (tTool.equals("axe")) || (tTool.equals("saw")) || (tTool.equals("sword")) || (tTool.equals("crowbar")))) || (aBlock.getMaterial() == Material.sand) || (aBlock.getMaterial() == Material.grass) || (aBlock.getMaterial() == Material.ground) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.clay) || (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.wood) || (aBlock.getMaterial() == Material.cactus) || (aBlock.getMaterial() == Material.circuits) || (aBlock.getMaterial() == Material.gourd) || (aBlock.getMaterial() == Material.web) || (aBlock.getMaterial() == Material.cloth) || (aBlock.getMaterial() == Material.carpet) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.cake) || (aBlock.getMaterial() == Material.tnt) || (aBlock.getMaterial() == Material.sponge); } public ItemStack getBrokenItem(ItemStack aStack) { -- cgit From e85097319b9cdaf765cfa86102a872922c52ef09 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Sun, 14 Aug 2016 07:19:03 +0100 Subject: Bugfixes 7 --- .../api/metatileentity/BaseMetaTileEntity.java | 481 ++++++++++----------- .../gregtech/api/util/GT_OreDictUnificator.java | 2 +- .../gregtech/api/util/GT_RecipeRegistrator.java | 4 +- src/main/java/gregtech/common/GT_Client.java | 7 - src/main/java/gregtech/common/GT_Proxy.java | 358 ++++++--------- .../covers/GT_Cover_RedstoneWirelessBase.java | 2 +- .../gregtech/common/gui/GT_Container_Boiler.java | 2 +- .../common/gui/GT_Container_Regulator.java | 4 +- .../gregtech/common/render/GT_CapeRenderer.java | 20 +- .../multi/GT_MetaTileEntity_FusionComputer.java | 42 +- .../loaders/oreprocessing/ProcessingOre.java | 26 +- 11 files changed, 400 insertions(+), 548 deletions(-) (limited to 'src/main/java/gregtech/common/render/GT_CapeRenderer.java') diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 1621a4a04f..10da0ac906 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -252,291 +252,282 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE long tTime = System.currentTimeMillis(); int tCode = 0; - try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { - //replace switch in if - //switch (tCode) { - //case 0: - if (tCode == 0) { - tCode++; - if (mTickTimer++ == 0) { - oX = xCoord; - oY = yCoord; - oZ = zCoord; - if (isServerSide()) 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; - return; - } - }} - //case 1: - if (tCode == 1) { - tCode++; - if (isClientSide()) { - if (mColor != oColor) { - mMetaTileEntity.onColorChangeClient(oColor = mColor); - issueTextureUpdate(); - } - - if (mLightValue != oLightValueClient) { - worldObj.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, mLightValue); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord + 1, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord - 1, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord + 1, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord - 1, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord + 1); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord - 1); - oLightValueClient = mLightValue; - issueTextureUpdate(); - } - - if (mNeedsUpdate) { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - //worldObj.func_147479_m(xCoord, yCoord, zCoord); - mNeedsUpdate = false; - } - }} - /*case 2: - case 3: - case 4: - case 5: - case 6: - case 7:*/ - if (tCode >= 2 && tCode <= 7) { - if (isServerSide() && mTickTimer > 10) { - for (byte i = (byte) (tCode - 2); i < 6; i++) - if (getCoverIDAtSide(i) != 0) { - tCode++; - GT_CoverBehavior tCover = getCoverBehaviorAtSide(i); - int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this); - if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) { - mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer); - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - return; - } - } - } - - }} - //case 8: - if (tCode == 8) { - tCode = 9; - if (isServerSide()) { - if (++mAverageEUInputIndex >= mAverageEUInput.length) mAverageEUInputIndex = 0; - if (++mAverageEUOutputIndex >= mAverageEUOutput.length) mAverageEUOutputIndex = 0; - - mAverageEUInput[mAverageEUInputIndex] = 0; - mAverageEUOutput[mAverageEUOutputIndex] = 0; - }} - //case 9: - if (tCode == 9) { - tCode++; - mMetaTileEntity.onPreTick(this, mTickTimer); - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - return; - }} - //case 10: - if (tCode == 10) { - tCode++; - if (isServerSide()) { - if (mRedstone != oRedstone || mTickTimer == 10) { - for (byte i = 0; i < 6; i++) - mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); - oRedstone = mRedstone; - issueBlockUpdate(); - } - - if (xCoord != oX || yCoord != oY || zCoord != oZ) { + try { + for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { + if (tCode == 0) { + tCode++; + if (mTickTimer++ == 0) { oX = xCoord; oY = yCoord; oZ = zCoord; - issueClientUpdate(); - clearTileEntityBuffer(); - } - - if (mFacing != oFacing) { - oFacing = mFacing; - for (byte i = 0; i < 6; i++) + if (isServerSide()) for (byte i = 0; i < 6; i++) if (getCoverIDAtSide(i) != 0) if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i)))) dropCover(i, i, true); - issueBlockUpdate(); - } - if (mTickTimer > 20 && mMetaTileEntity.isElectric()) { - mAcceptedAmperes = 0; + worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this); - if (getOutputVoltage() != oOutput) { - oOutput = getOutputVoltage(); + mMetaTileEntity.onFirstTick(this); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; } - - if (mMetaTileEntity.isEnetOutput() || mMetaTileEntity.isEnetInput()) { - for (byte i = 0; i < 6; i++) { - boolean - temp = isEnergyInputSide(i); - if (temp != mActiveEUInputs[i]) { - mActiveEUInputs[i] = temp; - } - temp = isEnergyOutputSide(i); - if (temp != mActiveEUOutputs[i]) { - mActiveEUOutputs[i] = temp; - } - } + } + } + if (tCode == 1) { + tCode++; + if (isClientSide()) { + if (mColor != oColor) { + mMetaTileEntity.onColorChangeClient(oColor = mColor); + issueTextureUpdate(); } - if (mMetaTileEntity.isEnetOutput() && oOutput > 0) { - long tOutputVoltage = Math.max(oOutput, oOutput + (1 << GT_Utility.getTier(oOutput))), tUsableAmperage = Math.min(getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); - if (tUsableAmperage > 0) { - long tEU = tOutputVoltage * IEnergyConnected.Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this); - mAverageEUOutput[mAverageEUOutputIndex] += tEU; - decreaseStoredEU(tEU, true); - } + if (mLightValue != oLightValueClient) { + worldObj.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, mLightValue); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord + 1, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord - 1, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord + 1, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord - 1, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord + 1); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord - 1); + oLightValueClient = mLightValue; + issueTextureUpdate(); } - if (getEUCapacity() > 0) { - if (GregTech_API.sMachineFireExplosions && getRandomNumber(1000) == 0) { - Block tBlock = getBlockAtSide((byte) getRandomNumber(6)); - if (tBlock instanceof BlockFire) doEnergyExplosion(); - } - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - return; - } - - if (getRandomNumber(1000) == 0) { - if ((getCoverIDAtSide((byte) 1) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord) - 2 < yCoord) - || (getCoverIDAtSide((byte) 2) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord - 1) - 1 < yCoord) - || (getCoverIDAtSide((byte) 3) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord + 1) - 1 < yCoord) - || (getCoverIDAtSide((byte) 4) == 0 && worldObj.getPrecipitationHeight(xCoord - 1, zCoord) - 1 < yCoord) - || (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) { - //} - doEnergyExplosion(); - } else setOnFire(); - } + if (mNeedsUpdate) { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + //worldObj.func_147479_m(xCoord, yCoord, zCoord); + mNeedsUpdate = false; + } + } + } + if (tCode >= 2 && tCode <= 7) { + if (isServerSide() && mTickTimer > 10) { + for (byte i = (byte) (tCode - 2); i < 6; i++) + if (getCoverIDAtSide(i) != 0) { + tCode++; + GT_CoverBehavior tCover = getCoverBehaviorAtSide(i); + int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this); + if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) { + mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer); if (!hasValidMetaTileEntity()) { mRunningThroughTick = false; 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) { - } - doEnergyExplosion(); - } } } - } + } + } + if (tCode == 8) { + tCode = 9; + if (isServerSide()) { + if (++mAverageEUInputIndex >= mAverageEUInput.length) mAverageEUInputIndex = 0; + if (++mAverageEUOutputIndex >= mAverageEUOutput.length) mAverageEUOutputIndex = 0; + mAverageEUInput[mAverageEUInputIndex] = 0; + mAverageEUOutput[mAverageEUOutputIndex] = 0; + } + } + if (tCode == 9) { + tCode++; + mMetaTileEntity.onPreTick(this, mTickTimer); if (!hasValidMetaTileEntity()) { mRunningThroughTick = false; return; } } - //case 11: - if (tCode == 11) { + if (tCode == 10) { tCode++; if (isServerSide()) { - 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()) { - dischargeItem(mMetaTileEntity.mInventory[i]); - if (mMetaTileEntity.mInventory[i].stackSize <= 0) - mMetaTileEntity.mInventory[i] = null; - mInventoryChanged = true; + if (mRedstone != oRedstone || mTickTimer == 10) { + for (byte i = 0; i < 6; i++) + mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + oRedstone = mRedstone; + issueBlockUpdate(); + } + + if (xCoord != oX || yCoord != oY || zCoord != oZ) { + oX = xCoord; + oY = yCoord; + oZ = zCoord; + issueClientUpdate(); + clearTileEntityBuffer(); + } + + if (mFacing != oFacing) { + oFacing = mFacing; + for (byte i = 0; i < 6; i++) + if (getCoverIDAtSide(i) != 0) + if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i)))) + dropCover(i, i, true); + issueBlockUpdate(); + } + + if (mTickTimer > 20 && mMetaTileEntity.isElectric()) { + mAcceptedAmperes = 0; + + if (getOutputVoltage() != oOutput) { + oOutput = getOutputVoltage(); + } + + if (mMetaTileEntity.isEnetOutput() || mMetaTileEntity.isEnetInput()) { + for (byte i = 0; i < 6; i++) { + boolean + temp = isEnergyInputSide(i); + if (temp != mActiveEUInputs[i]) { + mActiveEUInputs[i] = temp; + } + temp = isEnergyOutputSide(i); + if (temp != mActiveEUOutputs[i]) { + mActiveEUOutputs[i] = temp; + } + } + } + + if (mMetaTileEntity.isEnetOutput() && oOutput > 0) { + long tOutputVoltage = Math.max(oOutput, oOutput + (1 << GT_Utility.getTier(oOutput))), tUsableAmperage = Math.min(getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); + if (tUsableAmperage > 0) { + long tEU = tOutputVoltage * IEnergyConnected.Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this); + mAverageEUOutput[mAverageEUOutputIndex] += tEU; + decreaseStoredEU(tEU, true); + } + } + if (getEUCapacity() > 0) { + if (GregTech_API.sMachineFireExplosions && getRandomNumber(1000) == 0) { + Block tBlock = getBlockAtSide((byte) getRandomNumber(6)); + if (tBlock instanceof BlockFire) doEnergyExplosion(); + } + + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + + if (getRandomNumber(1000) == 0) { + if ((getCoverIDAtSide((byte) 1) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord) - 2 < yCoord) + || (getCoverIDAtSide((byte) 2) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord - 1) - 1 < yCoord) + || (getCoverIDAtSide((byte) 3) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord + 1) - 1 < yCoord) + || (getCoverIDAtSide((byte) 4) == 0 && worldObj.getPrecipitationHeight(xCoord - 1, zCoord) - 1 < yCoord) + || (getCoverIDAtSide((byte) 5) == 0 && worldObj.getPrecipitationHeight(xCoord + 1, zCoord) - 1 < yCoord)) { + if (GregTech_API.sMachineRainExplosions && worldObj.isRaining() && getBiome().rainfall > 0) { + if (getRandomNumber(10) == 0) { + GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather"); + doEnergyExplosion(); + } else setOnFire(); + } + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + 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) { + } + doEnergyExplosion(); + } + } } } } - }} - //case 12: - if (tCode == 12) { - tCode++; - if (isServerSide()) { - 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) { - chargeItem(mMetaTileEntity.mInventory[i]); - if (mMetaTileEntity.mInventory[i].stackSize <= 0) - mMetaTileEntity.mInventory[i] = null; - mInventoryChanged = true; + + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + } + if (tCode == 11) { + tCode++; + if (isServerSide()) { + 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()) { + dischargeItem(mMetaTileEntity.mInventory[i]); + if (mMetaTileEntity.mInventory[i].stackSize <= 0) + mMetaTileEntity.mInventory[i] = null; + mInventoryChanged = true; + } } } } - }} - //case 13: - if (tCode == 13) { - tCode++; - updateStatus(); - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - return; - }} - //case 14: - if (tCode == 14) { - tCode++; - mMetaTileEntity.onPostTick(this, mTickTimer); - if (!hasValidMetaTileEntity()) { - mRunningThroughTick = false; - return; - }} - //case 15: - if (tCode == 15) { - tCode++; - if (isServerSide()) { - 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); - mSendClientData = false; + } + if (tCode == 12) { + tCode++; + if (isServerSide()) { + 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) { + chargeItem(mMetaTileEntity.mInventory[i]); + if (mMetaTileEntity.mInventory[i].stackSize <= 0) + mMetaTileEntity.mInventory[i] = null; + mInventoryChanged = true; + } + } } } + } + if (tCode == 13) { + tCode++; + updateStatus(); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + } + if (tCode == 14) { + tCode++; + mMetaTileEntity.onPostTick(this, mTickTimer); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + } + if (tCode == 15) { + tCode++; + if (isServerSide()) { + 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); + mSendClientData = false; + } + } - if (mTickTimer > 10) { - byte tData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) | (mRedstone ? 16 : 0) | (mLockUpgrade ? 32 : 0)); - if (tData != oTextureData) sendBlockEvent((byte) 0, oTextureData = tData); - tData = mMetaTileEntity.getUpdateData(); - if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData); - if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor); - tData = (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)); - if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData); - if (mLightValue != oLightValue) { - worldObj.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, mLightValue); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord + 1, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord - 1, yCoord, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord + 1, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord - 1, zCoord); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord + 1); - worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord - 1); - issueTextureUpdate(); - sendBlockEvent((byte) 7, oLightValue = mLightValue); + if (mTickTimer > 10) { + byte tData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) | (mRedstone ? 16 : 0) | (mLockUpgrade ? 32 : 0)); + if (tData != oTextureData) sendBlockEvent((byte) 0, oTextureData = tData); + tData = mMetaTileEntity.getUpdateData(); + if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData); + if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor); + tData = (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)); + if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData); + if (mLightValue != oLightValue) { + worldObj.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, mLightValue); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord + 1, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord - 1, yCoord, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord + 1, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord - 1, zCoord); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord + 1); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord - 1); + issueTextureUpdate(); + sendBlockEvent((byte) 7, oLightValue = mLightValue); + } } - } - if (mNeedsBlockUpdate) { - worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0)); - mNeedsBlockUpdate = false; + if (mNeedsBlockUpdate) { + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0)); + mNeedsBlockUpdate = false; + } } - }} - //default: - if (tCode > 15) { - tCode = -1; - break;} - }} + } + if (tCode > 15) { + 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); diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java index 2679053ede..44ae527d28 100644 --- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java +++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java @@ -259,7 +259,7 @@ public class GT_OreDictUnificator { public static ItemStack getGem(Materials aMaterial, long aMaterialAmount) { ItemStack rStack = null; - if (((aMaterialAmount >= M)/* || aMaterialAmount >= M * 32*/)) + if (((aMaterialAmount >= M))) rStack = get(OrePrefixes.gem, aMaterial, aMaterialAmount / M); if (rStack == null) { if ((((aMaterialAmount * 2) % M == 0) || aMaterialAmount >= M * 16)) diff --git a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java index ba4677cf3c..5227959bae 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java +++ b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java @@ -176,7 +176,7 @@ public class GT_RecipeRegistrator { } public static void registerReverseArcSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03) { - registerReverseArcSmelting(aStack, new ItemData(/*aMaterial == null ? null : */new MaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03)); + registerReverseArcSmelting(aStack, new ItemData(new MaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03)); } public static void registerReverseArcSmelting(ItemStack aStack, ItemData aData) { @@ -234,7 +234,7 @@ public class GT_RecipeRegistrator { } public static void registerReverseMacerating(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03, boolean aAllowHammer) { - registerReverseMacerating(aStack, new ItemData(/*aMaterial == null ? null : */new MaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03), aAllowHammer); + registerReverseMacerating(aStack, new ItemData(new MaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03), aAllowHammer); } public static void registerReverseMacerating(ItemStack aStack, ItemData aData, boolean aAllowHammer) { diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 73a42fc6f7..769509ca67 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -325,13 +325,6 @@ public class GT_Client extends GT_Proxy } } - //dead event - /*@*//*SubscribeEvent*/ - /*@SubscribeEvent - public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) { - mCapeRenderer.receiveRenderSpecialsEvent(aEvent); - }*/ - @SubscribeEvent public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) { if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) { diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 79061be22e..61cc66790f 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -987,79 +987,64 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { GT_OreDictUnificator.addToBlacklist(aEvent.Ore); } this.mRegisteredOres.add(aEvent.Ore); - if ((aEvent.Name.startsWith("item")) && (this.mIgnoredItems.contains(aEvent.Name))) { - GT_Log.ore.println(tModToName); - if (aEvent.Name.equals("itemCopperWire")) { - GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore); - } - if (aEvent.Name.equals("itemRubber")) { - GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Rubber, aEvent.Ore); + if ((this.mIgnoredItems.contains(aEvent.Name))) { + if ((aEvent.Name.startsWith("item"))) { + GT_Log.ore.println(tModToName); + if (aEvent.Name.equals("itemCopperWire")) { + GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore); + } else if (aEvent.Name.equals("itemRubber")) { + GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Rubber, aEvent.Ore); + } + return; } - return; - } - if (this.mIgnoredNames.contains(aEvent.Name)) { GT_Log.ore.println(tModToName + " is getting ignored via hardcode."); return; - } - if (aEvent.Name.equals("stone")) { + } else if (aEvent.Name.equals("stone")) { GT_OreDictUnificator.registerOre("stoneSmooth", aEvent.Ore); return; - } - if (aEvent.Name.equals("cobblestone")) { + } else if (aEvent.Name.equals("cobblestone")) { GT_OreDictUnificator.registerOre("stoneCobble", aEvent.Ore); return; - } - if ((aEvent.Name.contains("|")) || (aEvent.Name.contains("*")) || (aEvent.Name.contains(":")) || (aEvent.Name.contains(".")) + } else if ((aEvent.Name.contains("|")) || (aEvent.Name.contains("*")) || (aEvent.Name.contains(":")) || (aEvent.Name.contains(".")) || (aEvent.Name.contains("$"))) { GT_Log.ore.println(tModToName + " is using a private Prefix and is therefor getting ignored properly."); return; - } - if (aEvent.Name.equals("copperWire")) { + } else if (aEvent.Name.equals("copperWire")) { GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore); - } - if (aEvent.Name.equals("oreHeeEndrium")) { + } else if (aEvent.Name.equals("oreHeeEndrium")) { GT_OreDictUnificator.registerOre(OrePrefixes.ore, Materials.Endium, aEvent.Ore); - } - if (aEvent.Name.equals("sheetPlastic")) { + } else if (aEvent.Name.equals("sheetPlastic")) { GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore); - } - if (aEvent.Name.equals("shardAir")) { - GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedAir, aEvent.Ore); - return; - } - if (aEvent.Name.equals("shardWater")) { - GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedWater, aEvent.Ore); - return; - } - if (aEvent.Name.equals("shardFire")) { - GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedFire, aEvent.Ore); - return; - } - if (aEvent.Name.equals("shardEarth")) { - GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEarth, aEvent.Ore); - return; - } - if (aEvent.Name.equals("shardOrder")) { - GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedOrder, aEvent.Ore); - return; - } - if (aEvent.Name.equals("shardEntropy")) { - GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEntropy, aEvent.Ore); - return; - } - if (aEvent.Name.equals("fieryIngot")) { + } else if (aEvent.Name.startsWith("shard")) { + if (aEvent.Name.equals("shardAir")) { + GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedAir, aEvent.Ore); + return; + } else if (aEvent.Name.equals("shardWater")) { + GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedWater, aEvent.Ore); + return; + } else if (aEvent.Name.equals("shardFire")) { + GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedFire, aEvent.Ore); + return; + } else if (aEvent.Name.equals("shardEarth")) { + GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEarth, aEvent.Ore); + return; + } else if (aEvent.Name.equals("shardOrder")) { + GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedOrder, aEvent.Ore); + return; + } else if (aEvent.Name.equals("shardEntropy")) { + GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEntropy, aEvent.Ore); + return; + } + } else if (aEvent.Name.equals("fieryIngot")) { GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.FierySteel, aEvent.Ore); return; - } - if (aEvent.Name.equals("ironwood")) { + } else if (aEvent.Name.equals("ironwood")) { GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.IronWood, aEvent.Ore); return; - } - if (aEvent.Name.equals("steeleaf")) { + } else if (aEvent.Name.equals("steeleaf")) { GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Steeleaf, aEvent.Ore); return; - } - if (aEvent.Name.equals("knightmetal")) { + } else if (aEvent.Name.equals("knightmetal")) { GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Knightmetal, aEvent.Ore); return; } @@ -1083,12 +1068,10 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { if (aEvent.Name.toLowerCase().equals(aEvent.Name)) { GT_Log.ore.println(tModToName + " is invalid due to being solely lowercased."); return; - } - if (aEvent.Name.toUpperCase().equals(aEvent.Name)) { + } else if (aEvent.Name.toUpperCase().equals(aEvent.Name)) { GT_Log.ore.println(tModToName + " is invalid due to being solely uppercased."); return; - } - if (Character.isUpperCase(aEvent.Name.charAt(0))) { + } else if (Character.isUpperCase(aEvent.Name.charAt(0))) { GT_Log.ore.println(tModToName + " is invalid due to the first character being uppercased."); } } else { @@ -1142,48 +1125,32 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } break; case gem: - switch (aMaterial) { - case Lapis: - case Sodalite: - GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore); - break; - case Lazurite: - GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore); - break; - case InfusedAir: - case InfusedWater: - case InfusedFire: - case InfusedEarth: - case InfusedOrder: - case InfusedEntropy: - GT_OreDictUnificator.registerOre(aMaterial.name().replaceFirst("Infused", "shard"), aEvent.Ore); - break; - case Chocolate: - GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore); - break; - case CertusQuartz: - case NetherQuartz: - GT_OreDictUnificator.registerOre(OrePrefixes.item.get(aMaterial), aEvent.Ore); - case Fluix: - case Quartz: - case Quartzite: - GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore); - GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore); - default: - break; + if (aMaterial == Materials.Lapis || aMaterial == Materials.Sodalite) { + GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore); + } else if (aMaterial == Materials.Lazurite) { + GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore); + } else if (aMaterial == Materials.InfusedAir || aMaterial == Materials.InfusedWater || aMaterial == Materials.InfusedFire || aMaterial == Materials.InfusedEarth || aMaterial == Materials.InfusedOrder || aMaterial == Materials.InfusedEntropy) { + GT_OreDictUnificator.registerOre(aMaterial.name().replaceFirst("Infused", "shard"), aEvent.Ore); + } else if (aMaterial == Materials.Chocolate) { + GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore); + } else if (aMaterial == Materials.CertusQuartz || aMaterial == Materials.NetherQuartz) { + GT_OreDictUnificator.registerOre(OrePrefixes.item.get(aMaterial), aEvent.Ore); + //Java (?) logic, redundant code + GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore); + GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore); + } else if (aMaterial == Materials.Fluix || aMaterial == Materials.Quartz || aMaterial == Materials.Quartzite) { + GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore); + GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore); } break; case cableGt01: if (aMaterial == Materials.Tin) { GT_OreDictUnificator.registerOre(OreDictNames.craftingWireTin, aEvent.Ore); - } - if (aMaterial == Materials.AnyCopper) { + } else if (aMaterial == Materials.AnyCopper) { GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore); - } - if (aMaterial == Materials.Gold) { + } else if (aMaterial == Materials.Gold) { GT_OreDictUnificator.registerOre(OreDictNames.craftingWireGold, aEvent.Ore); - } - if (aMaterial == Materials.AnyIron) { + } else if (aMaterial == Materials.AnyIron) { GT_OreDictUnificator.registerOre(OreDictNames.craftingWireIron, aEvent.Ore); } break; @@ -1195,11 +1162,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { case plate: if ((aMaterial == Materials.Plastic) || (aMaterial == Materials.Rubber)) { GT_OreDictUnificator.registerOre(OrePrefixes.sheet, aMaterial, aEvent.Ore); - } - if (aMaterial == Materials.Silicon) { + } else if (aMaterial == Materials.Silicon) { GT_OreDictUnificator.registerOre(OrePrefixes.item, aMaterial, aEvent.Ore); - } - if (aMaterial == Materials.Wood) { + } else if (aMaterial == Materials.Wood) { GT_OreDictUnificator.addToBlacklist(aEvent.Ore); GT_OreDictUnificator.registerOre(OrePrefixes.plank, aMaterial, aEvent.Ore); } @@ -1215,64 +1180,48 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { case stick: if (!GT_RecipeRegistrator.sRodMaterialList.contains(aMaterial)) { GT_RecipeRegistrator.sRodMaterialList.add(aMaterial); - } - if (aMaterial == Materials.Wood) { + } else if (aMaterial == Materials.Wood) { GT_OreDictUnificator.addToBlacklist(aEvent.Ore); - } - if ((aMaterial == Materials.Tin) || (aMaterial == Materials.Lead) || (aMaterial == Materials.SolderingAlloy)) { + } else if ((aMaterial == Materials.Tin) || (aMaterial == Materials.Lead) || (aMaterial == Materials.SolderingAlloy)) { GT_OreDictUnificator.registerOre(ToolDictNames.craftingToolSolderingMetal, aEvent.Ore); } break; case dust: if (aMaterial == Materials.Salt) { GT_OreDictUnificator.registerOre("itemSalt", aEvent.Ore); - } - if (aMaterial == Materials.Wood) { + } else if (aMaterial == Materials.Wood) { GT_OreDictUnificator.registerOre("pulpWood", aEvent.Ore); - } - if (aMaterial == Materials.Wheat) { + } else if (aMaterial == Materials.Wheat) { GT_OreDictUnificator.registerOre("foodFlour", aEvent.Ore); - } - if (aMaterial == Materials.Lapis) { + } else if (aMaterial == Materials.Lapis) { GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore); - } - if (aMaterial == Materials.Lazurite) { + } else if (aMaterial == Materials.Lazurite) { GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore); - } - if (aMaterial == Materials.Sodalite) { + } else if (aMaterial == Materials.Sodalite) { GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore); - } - if (aMaterial == Materials.Cocoa) { + } else if (aMaterial == Materials.Cocoa) { GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore); GT_OreDictUnificator.registerOre("foodCocoapowder", aEvent.Ore); - } - if (aMaterial == Materials.Coffee) { + } else if (aMaterial == Materials.Coffee) { GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore); - } - if (aMaterial == Materials.BrownLimonite) { + } else if (aMaterial == Materials.BrownLimonite) { GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore); - } - if (aMaterial == Materials.YellowLimonite) { + } else if (aMaterial == Materials.YellowLimonite) { GT_OreDictUnificator.registerOre(Dyes.dyeYellow, aEvent.Ore); } break; case ingot: if (aMaterial == Materials.Rubber) { GT_OreDictUnificator.registerOre("itemRubber", aEvent.Ore); - } - if (aMaterial == Materials.FierySteel) { + } else if (aMaterial == Materials.FierySteel) { GT_OreDictUnificator.registerOre("fieryIngot", aEvent.Ore); - } - if (aMaterial == Materials.IronWood) { + } else if (aMaterial == Materials.IronWood) { GT_OreDictUnificator.registerOre("ironwood", aEvent.Ore); - } - if (aMaterial == Materials.Steeleaf) { + } else if (aMaterial == Materials.Steeleaf) { GT_OreDictUnificator.registerOre("steeleaf", aEvent.Ore); - } - if (aMaterial == Materials.Knightmetal) { + } else if (aMaterial == Materials.Knightmetal) { GT_OreDictUnificator.registerOre("knightmetal", aEvent.Ore); - } - if ((aMaterial == Materials.Brass) && (aEvent.Ore.getItemDamage() == 2) + } else if ((aMaterial == Materials.Brass) && (aEvent.Ore.getItemDamage() == 2) && (aEvent.Ore.getUnlocalizedName().equals("item.ingotBrass")) && (new ItemStack(aEvent.Ore.getItem(), 1, 0).getUnlocalizedName().contains("red"))) { GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.RedAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 0)); @@ -1304,6 +1253,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } // System.out.println("Material Name: "+aEvent.Name+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me."); // GT_Log.ore.println(tModToName + " uses an unknown Material. Report this to GregTech."); + GT_Log.ore.println(tModToName + " uses an unknown Material."); return; } } else { @@ -1350,11 +1300,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { case crafting: if (tName.equals("ToolSolderingMetal")) { GregTech_API.registerSolderingMetal(aEvent.Ore); - } - if (tName.equals("IndustrialDiamond")) { + } else if (tName.equals("IndustrialDiamond")) { GT_OreDictUnificator.addToBlacklist(aEvent.Ore); - } - if (tName.equals("WireCopper")) { + } else if (tName.equals("WireCopper")) { GT_OreDictUnificator.registerOre(OrePrefixes.wire, Materials.Copper, aEvent.Ore); } break; @@ -1455,7 +1403,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @SubscribeEvent public void onPlayerTickEventServer(TickEvent.PlayerTickEvent aEvent) { - if ((!aEvent.player.isDead) && (aEvent.phase == TickEvent.Phase.END) && (aEvent.side.isServer())) { + if ((aEvent.side.isServer()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) { if ((aEvent.player.ticksExisted % 200 == 0) && (aEvent.player.capabilities.allowEdit) && (!aEvent.player.capabilities.isCreativeMode) && (this.mSurvivalIntoAdventure)) { aEvent.player.setGameType(GameType.ADVENTURE); @@ -1615,149 +1563,101 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemSodium")) { rFuelValue = (short) Math.max(rFuelValue, 4000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedSodium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedSodium")) { rFuelValue = (short) Math.max(rFuelValue, 4000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureSodium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureSodium")) { rFuelValue = (short) Math.max(rFuelValue, 4000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSodium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSodium")) { rFuelValue = (short) Math.max(rFuelValue, 4000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallSodium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallSodium")) { rFuelValue = (short) Math.max(rFuelValue, 1000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinySodium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinySodium")) { rFuelValue = (short) Math.max(rFuelValue, 444); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLithium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLithium")) { rFuelValue = (short) Math.max(rFuelValue, 6000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLithium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLithium")) { rFuelValue = (short) Math.max(rFuelValue, 6000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLithium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLithium")) { rFuelValue = (short) Math.max(rFuelValue, 6000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLithium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLithium")) { rFuelValue = (short) Math.max(rFuelValue, 6000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLithium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLithium")) { rFuelValue = (short) Math.max(rFuelValue, 2000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLithium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLithium")) { rFuelValue = (short) Math.max(rFuelValue, 888); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCaesium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCaesium")) { rFuelValue = (short) Math.max(rFuelValue, 6000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCaesium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCaesium")) { rFuelValue = (short) Math.max(rFuelValue, 6000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCaesium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCaesium")) { rFuelValue = (short) Math.max(rFuelValue, 6000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCaesium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCaesium")) { rFuelValue = (short) Math.max(rFuelValue, 6000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCaesium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCaesium")) { rFuelValue = (short) Math.max(rFuelValue, 2000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCaesium")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCaesium")) { rFuelValue = (short) Math.max(rFuelValue, 888); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLignite")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLignite")) { rFuelValue = (short) Math.max(rFuelValue, 1200); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLignite")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLignite")) { rFuelValue = (short) Math.max(rFuelValue, 1200); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLignite")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLignite")) { rFuelValue = (short) Math.max(rFuelValue, 1200); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLignite")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLignite")) { rFuelValue = (short) Math.max(rFuelValue, 1200); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLignite")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLignite")) { rFuelValue = (short) Math.max(rFuelValue, 375); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLignite")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLignite")) { rFuelValue = (short) Math.max(rFuelValue, 166); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCoal")) { rFuelValue = (short) Math.max(rFuelValue, 1600); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCoal")) { rFuelValue = (short) Math.max(rFuelValue, 1600); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCoal")) { rFuelValue = (short) Math.max(rFuelValue, 1600); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCoal")) { rFuelValue = (short) Math.max(rFuelValue, 1600); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCoal")) { rFuelValue = (short) Math.max(rFuelValue, 400); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCoal")) { rFuelValue = (short) Math.max(rFuelValue, 177); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCharcoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCharcoal")) { rFuelValue = (short) Math.max(rFuelValue, 1600); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCharcoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCharcoal")) { rFuelValue = (short) Math.max(rFuelValue, 1600); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCharcoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCharcoal")) { rFuelValue = (short) Math.max(rFuelValue, 1600); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCharcoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCharcoal")) { rFuelValue = (short) Math.max(rFuelValue, 1600); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCharcoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCharcoal")) { rFuelValue = (short) Math.max(rFuelValue, 400); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCharcoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCharcoal")) { rFuelValue = (short) Math.max(rFuelValue, 177); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustWood")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustWood")) { rFuelValue = (short) Math.max(rFuelValue, 100); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallWood")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallWood")) { rFuelValue = (short) Math.max(rFuelValue, 25); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyWood")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyWood")) { rFuelValue = (short) Math.max(rFuelValue, 11); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "plateWood")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "plateWood")) { rFuelValue = (short) Math.min(rFuelValue, 300); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "blockLignite")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "blockLignite")) { rFuelValue = (short) Math.max(rFuelValue, 12000); - } - if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "blockCharcoal")) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "blockCharcoal")) { rFuelValue = (short) Math.max(rFuelValue, 16000); - } - if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.wooden_button, 1))) { + } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.wooden_button, 1))) { rFuelValue = (short) Math.max(rFuelValue, 150); - } - if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.ladder, 1))) { + } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.ladder, 1))) { rFuelValue = (short) Math.max(rFuelValue, 100); - } - if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.sign, 1))) { + } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.sign, 1))) { rFuelValue = (short) Math.max(rFuelValue, 600); - } - if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.wooden_door, 1))) { + } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.wooden_door, 1))) { rFuelValue = (short) Math.max(rFuelValue, 600); - } - if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_MSSFUEL.get(1, new Object[0]))) { + } else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_MSSFUEL.get(1, new Object[0]))) { rFuelValue = Math.max(rFuelValue, 150000); - } - if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1, new Object[0]))) { + } else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1, new Object[0]))) { rFuelValue = Math.max(rFuelValue, 100000); } - return rFuelValue; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java index d9aef68506..b182ca733c 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java @@ -26,7 +26,7 @@ public abstract class GT_Cover_RedstoneWirelessBase } public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide <= 3) || (((aY > 0.375D) && (aY < 0.625D)) || ((aSide >= 2) || (((aZ <= 0.375D) || (aZ >= 0.625D)) && (aSide != 2) && (aSide != 3)))))) { + if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide <= 3) || (((aY > 0.375D) && (aY < 0.625D)) || ((((aZ <= 0.375D) || (aZ >= 0.625D)) && (aSide != 2) && (aSide != 3)))))) { GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte) 0)); float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + 2 * (byte) (int) (tCoords[1] * 2.0F))) { diff --git a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java index 4a74a43fca..758ccd8d83 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java @@ -13,7 +13,7 @@ import java.util.Iterator; public class GT_Container_Boiler extends GT_ContainerMetaTile_Machine { - private final int mSteamCapacity; + private int mSteamCapacity = 0;//FB: UR - UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR public int mWaterAmount = 0; public int mSteamAmount = 0; public int mProcessingEnergy = 0; diff --git a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java index b2aefe011b..212c32453c 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java @@ -77,7 +77,7 @@ public class GT_Container_Regulator } return null; } - if ((aSlotIndex >= 9) && (aSlotIndex < 18)) { + if ((aSlotIndex > 8) && (aSlotIndex < 18)) { ItemStack tStack = aPlayer.inventory.getItemStack(); if (tStack != null) { tSlot.putStack(GT_Utility.copy(new Object[]{tStack})); @@ -96,7 +96,7 @@ public class GT_Container_Regulator } return null; } - if ((aSlotIndex >= 18) && (aSlotIndex < 27)) { + if ((aSlotIndex > 17) && (aSlotIndex < 27)) { ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 18)] = Math.min(99, Math.max(0, ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 18)] + (aMouseclick == 0 ? -1 : 1) * (aShifthold == 0 ? 1 : 16))); return null; } diff --git a/src/main/java/gregtech/common/render/GT_CapeRenderer.java b/src/main/java/gregtech/common/render/GT_CapeRenderer.java index cf72032c53..68c95e9c4f 100644 --- a/src/main/java/gregtech/common/render/GT_CapeRenderer.java +++ b/src/main/java/gregtech/common/render/GT_CapeRenderer.java @@ -1,17 +1,8 @@ package gregtech.common.render; -import gregtech.api.enums.GT_Values; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Utility; -import net.minecraft.client.entity.AbstractClientPlayer; -import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; import java.util.Collection; @@ -27,7 +18,8 @@ public class GT_CapeRenderer setRenderManager(RenderManager.instance); } - public void receiveRenderSpecialsEvent(RenderPlayerEvent.Specials.Pre aEvent) { + //always off in BMPL + /*public void receiveRenderSpecialsEvent(RenderPlayerEvent.Specials.Pre aEvent) { AbstractClientPlayer aPlayer = (AbstractClientPlayer) aEvent.entityPlayer; if (GT_Utility.getFullInvisibility(aPlayer)) { aEvent.setCanceled(true); @@ -66,9 +58,9 @@ public class GT_CapeRenderer float var2f = f6 * 3.141593F / 180.0F; float d3 = MathHelper.sin(var2f); float d4 = -MathHelper.cos(var2f); - float f7 = /*(float) */d1 * 10.0F; - float f8 = /*(float) */(d0 * d3 + d2 * d4) * 100.0F; - float f9 = /*(float) */(d0 * d4 - d2 * d3) * 100.0F; + float f7 = d1 * 10.0F; + float f8 = (d0 * d3 + d2 * d4) * 100.0F; + float f9 = (d0 * d4 - d2 * d3) * 100.0F; if (f7 < -6.0F) { f7 = -6.0F; } @@ -95,5 +87,5 @@ public class GT_CapeRenderer e.printStackTrace(GT_Log.err); } } - } + }*/ } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java index 43faacfb42..550cea5237 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -103,23 +103,17 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity && (addIfInjector(xCenter - 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter - 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (this.mEnergyHatches.size() >= 1) && (this.mOutputHatches.size() >= 1) && (this.mInputHatches.size() >= 2)) { - if (this.mEnergyHatches != null) { - for (int i = 0; i < this.mEnergyHatches.size(); i++) { - if (this.mEnergyHatches.get(i).mTier < tier()) - return false; - } + for (int i = 0; i < this.mEnergyHatches.size(); i++) { + if (this.mEnergyHatches.get(i).mTier < tier()) + return false; } - if (this.mOutputHatches != null) { - for (int i = 0; i < this.mOutputHatches.size(); i++) { - if (this.mOutputHatches.get(i).mTier < tier()) - return false; - } + for (int i = 0; i < this.mOutputHatches.size(); i++) { + if (this.mOutputHatches.get(i).mTier < tier()) + return false; } - if (this.mInputHatches != null) { - for (int i = 0; i < this.mInputHatches.size(); i++) { - if (this.mInputHatches.get(i).mTier < tier()) - return false; - } + for (int i = 0; i < this.mInputHatches.size(); i++) { + if (this.mInputHatches.get(i).mTier < tier()) + return false; } mWrench = true; mScrewdriver = true; @@ -272,16 +266,14 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity this.mLastRecipe = null; return false; } - if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { - this.mLastRecipe = tRecipe; - this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue)); - this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue); - this.mEfficiencyIncrease = 10000; - this.mOutputFluids = this.mLastRecipe.mFluidOutputs; - turnCasingActive(true); - mRunningOnLoad = false; - return true; - } + this.mLastRecipe = tRecipe; + this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue)); + this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue); + this.mEfficiencyIncrease = 10000; + this.mOutputFluids = this.mLastRecipe.mFluidOutputs; + turnCasingActive(true); + mRunningOnLoad = false; + return true; } return false; } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java index aa263bbdc7..ffc35582db 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java @@ -47,9 +47,6 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra ItemStack tCleaned = GT_OreDictUnificator.get(OrePrefixes.crushedPurified, tMaterial, tDust, 1L); ItemStack tCrushed = GT_OreDictUnificator.get(OrePrefixes.crushed, tMaterial, aMaterial.mOreMultiplier * aMultiplier); ItemStack tPrimaryByProduct = null; - ItemStack tPrimaryByProductSmall = null; - ItemStack tSecondaryByProduct = null; - ItemStack tSecondaryByProductSmall = null; if (tCrushed == null) { tCrushed = GT_OreDictUnificator.get(OrePrefixes.dustImpure, tMaterial, GT_Utility.copyAmount(aMaterial.mOreMultiplier * aMultiplier, new Object[]{tCleaned, tDust, tGem}), aMaterial.mOreMultiplier * aMultiplier); @@ -63,17 +60,12 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra if (tPrimaryByProduct == null) { tPrimaryByMaterial = tMat; tPrimaryByProduct = GT_OreDictUnificator.get(OrePrefixes.dust, tMat, 1L); - tPrimaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L); - if (tPrimaryByProductSmall == null) - tPrimaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L); + if (GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L) == null) + GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L); } - if ((tSecondaryByProduct == null) || (tSecondaryByMaterial == tPrimaryByMaterial)) { - tSecondaryByMaterial = tMat; - tSecondaryByProduct = GT_OreDictUnificator.get(OrePrefixes.dust, tMat, 1L); - tSecondaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L); - if (tSecondaryByProductSmall == null) { - tSecondaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L); - } + GT_OreDictUnificator.get(OrePrefixes.dust, tMat, 1L); + if (GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L) == null) { + GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L); } } if ((!tByProductStacks.isEmpty()) && (!this.mAlreadyListedOres.contains(aMaterial))) { @@ -83,14 +75,6 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra if (tPrimaryByMaterial == null) tPrimaryByMaterial = tMaterial; if (tPrimaryByProduct == null) tPrimaryByProduct = tDust; - if (tPrimaryByProductSmall == null) { - tPrimaryByProductSmall = tSmall; - } - //if (tSecondaryByMaterial == null) tSecondaryByMaterial = tPrimaryByMaterial;//dead code? - //if (tSecondaryByProduct == null) tSecondaryByProduct = tPrimaryByProduct;//dead code? - //if (tSecondaryByProductSmall == null) { - //tSecondaryByProductSmall = tPrimaryByProductSmall;//dead code? - //} boolean tHasSmelting = false; if (tSmeltInto != null) { -- cgit