diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index c24414d1..7b2d6e06 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -103,6 +103,7 @@ public class GT_Mod @Mod.EventHandler public void onPreLoad(FMLPreInitializationEvent aEvent) { + Locale.setDefault(Locale.ENGLISH); if (GregTech_API.sPreloadStarted) { return; } diff --git a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java index a921377a..4e580198 100644 --- a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java +++ b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java @@ -207,7 +207,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci if (tStats[3] == -2 && tCharge <= 0) { aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly." + EnumChatFormatting.GRAY); } else { - aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / " + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] + EnumChatFormatting.GRAY); + aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharfge) + " / " + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] + EnumChatFormatting.GRAY); } } } diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 9917ca62..9f3ca822 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -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/objects/ElementStack.java b/src/main/java/gregtech/api/objects/ElementStack.java index f3e15436..207d77f7 100644 --- a/src/main/java/gregtech/api/objects/ElementStack.java +++ b/src/main/java/gregtech/api/objects/ElementStack.java @@ -17,14 +17,16 @@ public class ElementStack implements Cloneable { @Override public ElementStack clone() { - return new ElementStack(mElement, mAmount); + try { Object cloneES = super.clone(); + //return new ElementStack(mElement, mAmount); + return (ElementStack) cloneES; } catch (Exception e) { return new ElementStack(mElement, mAmount); } } @Override public boolean equals(Object aObject) { if (aObject == this) return true; if (aObject == null) return false; - if (aObject instanceof Element) return aObject == mElement; + if (aObject instanceof Element) {return aObject == mElement;} if (aObject instanceof ElementStack) return ((ElementStack) aObject).mElement == mElement && (mAmount < 0 || ((ElementStack) aObject).mAmount < 0 || ((ElementStack) aObject).mAmount == mAmount); return false; diff --git a/src/main/java/gregtech/api/objects/MaterialStack.java b/src/main/java/gregtech/api/objects/MaterialStack.java index 5ddb8842..60808ab6 100644 --- a/src/main/java/gregtech/api/objects/MaterialStack.java +++ b/src/main/java/gregtech/api/objects/MaterialStack.java @@ -17,7 +17,9 @@ public class MaterialStack implements Cloneable { @Override public MaterialStack clone() { - return new MaterialStack(mMaterial, mAmount); + try { Object cloneMS = super.clone(); + //return new MaterialStack(mMaterial, mAmount); + return (MaterialStack) cloneMS;} catch (Exception e) { return new MaterialStack(mMaterial, mAmount); } } @Override diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java index b404299f..8fde8ab9 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)/* || aMaterialAmount >= M * 32*/)) rStack = get(OrePrefixes.gem, aMaterial, aMaterialAmount / M); if (rStack == null && (((aMaterialAmount * 2) % M == 0) || aMaterialAmount >= M * 16)) rStack = get(OrePrefixes.gemFlawed, aMaterial, (aMaterialAmount * 2) / M); diff --git a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java index 611c8d34..ba4677cf 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(/*aMaterial == null ? null : */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(/*aMaterial == null ? null : */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/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 29c5ab2c..118d72ea 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -1410,7 +1410,7 @@ public class GT_Utility { Collections.sort(tEntrySet, new Comparator>() { @Override public int compare(Entry aValue1, Entry aValue2) { - return -aValue1.getValue().compareTo(aValue2.getValue()); + return aValue2.getValue().compareTo(aValue1.getValue());//FB: RV - RV_NEGATING_RESULT_OF_COMPARETO } }); LinkedHashMap rMap = new LinkedHashMap(); diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 6e6864e7..73a42fc6 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -9,15 +9,12 @@ import codechicken.lib.vec.Rotation; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; -import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.ITurnable; import gregtech.api.metatileentity.BaseMetaPipeEntity; -import gregtech.api.objects.GT_FluidStack; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_PlayedSound; import gregtech.api.util.GT_Utility; @@ -31,12 +28,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; import org.lwjgl.opengl.GL11; -import java.net.URL; import java.util.*; // Referenced classes of package gregtech.common: @@ -231,45 +226,47 @@ public class GT_Client extends GT_Proxy } public void run() { + //skip - dead code, rly, txt files on server is now empty try { - GT_Log.out.println("GT_Mod: Downloading Cape List."); - @SuppressWarnings("resource") - Scanner tScanner = new Scanner(new URL("http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt").openStream()); - while (tScanner.hasNextLine()) { - String tName = tScanner.nextLine(); - if (!this.mCapeList.contains(tName.toLowerCase())) { - this.mCapeList.add(tName.toLowerCase()); - } - } + GT_Log.out.println("Skip: GT_Mod: Downloading Cape List."); + /*@*//*SuppressWarnings("resource")*/ + //Scanner tScanner = new Scanner(new URL("http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt").openStream()); + //while (tScanner.hasNextLine()) { + //String tName = tScanner.nextLine(); + //if (!this.mCapeList.contains(tName.toLowerCase())) { + //this.mCapeList.add(tName.toLowerCase()); + //} + //} } catch (Throwable e) { } try { - GT_Log.out.println("GT_Mod: Downloading News."); - @SuppressWarnings("resource") - Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/message.txt").openStream()); - while (tScanner.hasNextLine()) { - this.mMessage = (this.mMessage + tScanner.nextLine() + " "); - } + GT_Log.out.println("Skip: GT_Mod: Downloading News."); + /*@*//*SuppressWarnings("resource")*/ + //Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/message.txt").openStream()); + //while (tScanner.hasNextLine()) { + //this.mMessage = (this.mMessage + tScanner.nextLine() + " "); + //} } catch (Throwable e) { } } @SubscribeEvent public void onPlayerTickEventClient(TickEvent.PlayerTickEvent aEvent) { - if ((!aEvent.player.isDead) && (aEvent.phase == TickEvent.Phase.END) && (aEvent.side.isClient())) { + if ((aEvent.side.isClient()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) { ArrayList tList = new ArrayList(); for (Map.Entry tEntry : GT_Utility.sPlayedSoundMap.entrySet()) { - if (((Integer) tEntry.getValue()).intValue() < 0) { + if (tEntry.getValue().intValue() < 0) {//Integer -> Integer -> int? >_<, fix tList.add(tEntry.getKey()); } else { - tEntry.setValue(Integer.valueOf(((Integer) tEntry.getValue()).intValue() - 1)); + tEntry.setValue(Integer.valueOf(tEntry.getValue().intValue() - 1)); } } GT_PlayedSound tKey; for (Iterator i$ = tList.iterator(); i$.hasNext(); GT_Utility.sPlayedSoundMap.remove(tKey)) { tKey = (GT_PlayedSound) i$.next(); } - if ((this.isFirstClientPlayerTick) && (aEvent.player == GT_Values.GT.getThePlayer())) { + //wut, every tick? baaad, not need (and other) -> dead code + /*if ((this.isFirstClientPlayerTick) && (aEvent.player == GT_Values.GT.getThePlayer())) { this.isFirstClientPlayerTick = false; GT_FluidStack.fixAllThoseFuckingFluidIDs(); if ((this.mMessage.length() > 5) && (GregTech_API.sSpecialFile.get(ConfigCategories.news, this.mMessage, true))) { @@ -291,7 +288,7 @@ public class GT_Client extends GT_Proxy aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please get the recommended Version of IndustrialCraft here:")); aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/")); } - } + }*/ } } @@ -328,17 +325,19 @@ public class GT_Client extends GT_Proxy } } - @SubscribeEvent + //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) { mAnimationTick++; if (mAnimationTick % 50L == 0L) - mAnimationDirection = !mAnimationDirection; + {mAnimationDirection = !mAnimationDirection;} int tDirection = mAnimationDirection ? 1 : -1; for (Iterator i$ = mPosR.iterator(); i$.hasNext(); ) { Materials tMaterial = (Materials) i$.next(); 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 72dd43d0..43faacfb 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 @@ -132,6 +132,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity return false; } + //FindBugs + @Deprecated private boolean checkTier(byte tier, ArrayList list) { if (list != null) { for (int i = 0; i < list.size(); i++) { diff --git a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java index 545bfd83..35b71b24 100644 --- a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java @@ -289,8 +289,7 @@ public class GT_NEI_DefaultHandler } } - public class FixedPositionedStack - extends PositionedStack { + public static class FixedPositionedStack extends PositionedStack { public final int mChance; public boolean permutated = false;