diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java index 3fe74662..4441d57c 100644 --- a/src/main/java/gregtech/api/GregTech_API.java +++ b/src/main/java/gregtech/api/GregTech_API.java @@ -190,6 +190,7 @@ public class GregTech_API { public static int mRFtoEU = 20; public static boolean mRFExplosions = true; public static boolean mServerStarted = false; + private static final String aTextIC2Lower = MOD_ID_IC2.toLowerCase(); /** * Getting assigned by the Mod loading */ @@ -215,29 +216,29 @@ public class GregTech_API { sSoundList.put(5, "random.explode"); sSoundList.put(6, "fire.ignite"); - sSoundList.put(100, MOD_ID_IC2.toLowerCase() + ":" + "tools.Wrench"); - sSoundList.put(101, MOD_ID_IC2.toLowerCase() + ":" + "tools.RubberTrampoline"); - sSoundList.put(102, MOD_ID_IC2.toLowerCase() + ":" + "tools.Painter"); - sSoundList.put(103, MOD_ID_IC2.toLowerCase() + ":" + "tools.BatteryUse"); - sSoundList.put(104, MOD_ID_IC2.toLowerCase() + ":" + "tools.chainsaw.ChainsawUseOne"); - sSoundList.put(105, MOD_ID_IC2.toLowerCase() + ":" + "tools.chainsaw.ChainsawUseTwo"); - sSoundList.put(106, MOD_ID_IC2.toLowerCase() + ":" + "tools.drill.DrillSoft"); - sSoundList.put(107, MOD_ID_IC2.toLowerCase() + ":" + "tools.drill.DrillHard"); - sSoundList.put(108, MOD_ID_IC2.toLowerCase() + ":" + "tools.ODScanner"); + sSoundList.put(100, aTextIC2Lower + ":" + "tools.Wrench"); + sSoundList.put(101, aTextIC2Lower + ":" + "tools.RubberTrampoline"); + sSoundList.put(102, aTextIC2Lower + ":" + "tools.Painter"); + sSoundList.put(103, aTextIC2Lower + ":" + "tools.BatteryUse"); + sSoundList.put(104, aTextIC2Lower + ":" + "tools.chainsaw.ChainsawUseOne"); + sSoundList.put(105, aTextIC2Lower + ":" + "tools.chainsaw.ChainsawUseTwo"); + sSoundList.put(106, aTextIC2Lower + ":" + "tools.drill.DrillSoft"); + sSoundList.put(107, aTextIC2Lower + ":" + "tools.drill.DrillHard"); + sSoundList.put(108, aTextIC2Lower + ":" + "tools.ODScanner"); - sSoundList.put(200, MOD_ID_IC2.toLowerCase() + ":" + "machines.ExtractorOp"); - sSoundList.put(201, MOD_ID_IC2.toLowerCase() + ":" + "machines.MaceratorOp"); - sSoundList.put(202, MOD_ID_IC2.toLowerCase() + ":" + "machines.InductionLoop"); - sSoundList.put(203, MOD_ID_IC2.toLowerCase() + ":" + "machines.CompressorOp"); - sSoundList.put(204, MOD_ID_IC2.toLowerCase() + ":" + "machines.RecyclerOp"); - sSoundList.put(205, MOD_ID_IC2.toLowerCase() + ":" + "machines.MinerOp"); - sSoundList.put(206, MOD_ID_IC2.toLowerCase() + ":" + "machines.PumpOp"); - sSoundList.put(207, MOD_ID_IC2.toLowerCase() + ":" + "machines.ElectroFurnaceLoop"); - sSoundList.put(208, MOD_ID_IC2.toLowerCase() + ":" + "machines.InductionLoop"); - sSoundList.put(209, MOD_ID_IC2.toLowerCase() + ":" + "machines.MachineOverload"); - sSoundList.put(210, MOD_ID_IC2.toLowerCase() + ":" + "machines.InterruptOne"); - sSoundList.put(211, MOD_ID_IC2.toLowerCase() + ":" + "machines.KaChing"); - sSoundList.put(212, MOD_ID_IC2.toLowerCase() + ":" + "machines.MagnetizerLoop"); + sSoundList.put(200, aTextIC2Lower + ":" + "machines.ExtractorOp"); + sSoundList.put(201, aTextIC2Lower + ":" + "machines.MaceratorOp"); + sSoundList.put(202, aTextIC2Lower + ":" + "machines.InductionLoop"); + sSoundList.put(203, aTextIC2Lower + ":" + "machines.CompressorOp"); + sSoundList.put(204, aTextIC2Lower + ":" + "machines.RecyclerOp"); + sSoundList.put(205, aTextIC2Lower + ":" + "machines.MinerOp"); + sSoundList.put(206, aTextIC2Lower + ":" + "machines.PumpOp"); + sSoundList.put(207, aTextIC2Lower + ":" + "machines.ElectroFurnaceLoop"); + sSoundList.put(208, aTextIC2Lower + ":" + "machines.InductionLoop"); + sSoundList.put(209, aTextIC2Lower + ":" + "machines.MachineOverload"); + sSoundList.put(210, aTextIC2Lower + ":" + "machines.InterruptOne"); + sSoundList.put(211, aTextIC2Lower + ":" + "machines.KaChing"); + sSoundList.put(212, aTextIC2Lower + ":" + "machines.MagnetizerLoop"); } /** diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 91201a2a..eb464b14 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity; +import cpw.mods.fml.common.FMLLog; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -179,8 +180,9 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE } long tTime = System.currentTimeMillis(); + int tCode = 0; - for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { + for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { try { switch (tCode) { case 0: @@ -297,7 +299,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime; if (tTime > 0 && tTime > GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10) - System.out.println("WARNING: Possible Lag Source at [" + xCoord + ", " + yCoord + ", " + zCoord + "] in Dimension " + worldObj.provider.dimensionId + " with " + tTime + "ms caused by an instance of " + getMetaTileEntity().getClass()); + FMLLog.warning("WARNING: Possible Lag Source at [%s,%s,%s] in Dimension %s with %s ms caused by an instance of %s", xCoord, yCoord, zCoord, worldObj.provider.dimensionId, tTime, getMetaTileEntity().getClass()); } mWorkUpdate = mInventoryChanged = false; diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 9f3ca822..8e60733b 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -413,10 +413,10 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE || (getCoverIDAtSide((byte) 5) == 0 && worldObj.getPrecipitationHeight(xCoord + 1, zCoord) - 1 < yCoord)) { if (GregTech_API.sMachineRainExplosions && worldObj.isRaining() && getBiome().rainfall > 0) { if (getRandomNumber(10) == 0) { - try { + //try { GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather"); - } catch (Exception e) { - } + //} catch (Exception e) { + //} doEnergyExplosion(); } else setOnFire(); } @@ -425,10 +425,10 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE return; } if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() && getBiome().rainfall > 0 && getRandomNumber(3) == 0) { - //try { + try { GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather"); - //} catch (Exception e) { - //} + } catch (Exception e) { + } doEnergyExplosion(); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java index ee45c536..e7acfb85 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java @@ -112,10 +112,10 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch } if (mSolderingTool && aPlayer instanceof EntityPlayerMP) { EntityPlayerMP tPlayer = (EntityPlayerMP) aPlayer; - try { + //try { GT_Mod.instance.achievements.issueAchievement(tPlayer, "maintainance"); - } catch (Exception e) { - } + //} catch (Exception e) { + //} } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 9003e441..8cf320b8 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -25,8 +25,6 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import org.apache.commons.lang3.ArrayUtils; - import static gregtech.api.enums.GT_Values.V; public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { @@ -240,10 +238,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) { if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) { - try { + //try { GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack); - } catch (Exception e) { - } + //} catch (Exception e) { + //} addOutput(tStack); } if (mOutputFluids != null && mOutputFluids.length == 1) { diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 118d72ea..833922cd 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -921,7 +921,7 @@ public class GT_Utility { } public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX, double aY, double aZ) { - return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 0.9F + new Random().nextFloat() * 0.2F, aX, aY, aZ); + return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 1.01818028F, aX, aY, aZ); } public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) { diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index ffe2a39a..d4582515 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -838,7 +838,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } aEvent.bow.damageItem(1, aEvent.entityPlayer); aEvent.bow.getItem(); - aEvent.entityPlayer.worldObj.playSoundAtEntity(aEvent.entityPlayer, "random.bow", 1.0F, 1.0F / (new Random().nextFloat() * 0.4F + 1.2F) + tSpeed + aEvent.entityPlayer.worldObj.playSoundAtEntity(aEvent.entityPlayer, "random.bow", 1.0F, 0.64893958288F + tSpeed * 0.5F); tArrowEntity.canBePickedUp = 1; @@ -931,14 +931,16 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aEvent.z, (byte) aEvent.blockMetadata, aEvent.fortuneLevel, aEvent.isSilkTouching, aEvent); } if (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, aStack) > 2) { - for (ItemStack tDrop : aEvent.drops) { - ItemStack tSmeltingOutput = GT_ModHandler.getSmeltingOutput(tDrop, false, null); - if (tSmeltingOutput != null) { - tDrop.stackSize *= tSmeltingOutput.stackSize; - tSmeltingOutput.stackSize = tDrop.stackSize; - GT_Utility.setStack(tDrop, tSmeltingOutput); + try { + for (ItemStack tDrop : aEvent.drops) { + ItemStack tSmeltingOutput = GT_ModHandler.getSmeltingOutput(tDrop, false, null); + if (tSmeltingOutput != null) { + tDrop.stackSize *= tSmeltingOutput.stackSize; + tSmeltingOutput.stackSize = tDrop.stackSize; + GT_Utility.setStack(tDrop, tSmeltingOutput); + } } - } + } catch (Throwable e) {e.printStackTrace(GT_Log.err);} } } } diff --git a/src/main/java/gregtech/common/render/GT_CapeRenderer.java b/src/main/java/gregtech/common/render/GT_CapeRenderer.java index 49ba9a72..26ffc282 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(); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index dc7904a0..281d6cc4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -201,10 +201,10 @@ public class GT_MetaTileEntity_BronzeBlastFurnace this.mOutputItem2 = null; this.mProgresstime = 0; this.mMaxProgresstime = 0; - try { + //try { GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel"); - } catch (Exception e) { - } + //} catch (Exception e) { + //} } } else if (aBaseMetaTileEntity.isAllowedToWork()) { checkRecipe(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 30a6dd14..02a6d615 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -151,10 +151,10 @@ public abstract class GT_MetaTileEntity_LargeBoiler public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime > 0 && firstRun) { firstRun = false; - try { + //try { GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "extremepressure"); - } catch (Exception e) { - } + //} catch (Exception e) { + //} } super.onPostTick(aBaseMetaTileEntity, aTick); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index aa1f46af..d05c5118 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -86,10 +86,10 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La remainingFlow -= flow; // track amount we're allowed to keep depleting from hatches totalFlow += flow; // track total used if (!achievement) { - try { + //try { GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam"); - } catch (Exception e) { - } + //} catch (Exception e) { + //} achievement = true; } }else if(fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")){ diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index 1023235c..21c66c82 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -95,10 +95,10 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used if (!achievement) { - try { + //try { GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam"); - } catch (Exception e) { - } + //} catch (Exception e) { + //} achievement = true; } }