diff options
author | Technus <daniel112092@gmail.com> | 2017-10-01 15:19:28 +0200 |
---|---|---|
committer | Technus <daniel112092@gmail.com> | 2017-10-01 15:19:28 +0200 |
commit | ff9f58d39a282aee81cc9ae72e7463e470dc596b (patch) | |
tree | ba23411d087d8e7d4126d467086901e9cd208fb3 /src/main/java/gregtech/common/items/armor | |
parent | 4ec739c927cb1b338383df2f49bb08e33737eb61 (diff) | |
download | GT5-Unofficial-ff9f58d39a282aee81cc9ae72e7463e470dc596b.tar.gz GT5-Unofficial-ff9f58d39a282aee81cc9ae72e7463e470dc596b.tar.bz2 GT5-Unofficial-ff9f58d39a282aee81cc9ae72e7463e470dc596b.zip |
Optimize imports, optimize random number generation, make turbines loose 0.75 or normal durability in loose fitting mode.
Diffstat (limited to 'src/main/java/gregtech/common/items/armor')
-rw-r--r-- | src/main/java/gregtech/common/items/armor/ModularArmor_Item.java | 7 | ||||
-rw-r--r-- | src/main/java/gregtech/common/items/armor/gui/InventoryArmor.java | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java b/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java index 745a63fbf1..be0596fc92 100644 --- a/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java +++ b/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java @@ -37,7 +37,8 @@ import thaumcraft.api.nodes.IRevealer; import java.util.LinkedList; import java.util.List; -import java.util.Random; + +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; @Optional.InterfaceList(value = { @Optional.Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft", striprefs = true), @Optional.Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft", striprefs = true) }) @@ -156,8 +157,8 @@ public class ModularArmor_Item extends ItemArmor implements ISpecialArmor, IGogg } stack.damageItem(damage, entity); ContainerModularArmor tmp = new ContainerBasicArmor((EntityPlayer) entity, new InventoryArmor(ModularArmor_Item.class, stack)); - if (stack.getItemDamage() > stack.getMaxDamage() / 2 && new Random().nextInt(100) < 5) { - tmp.getSlot(new Random().nextInt(tmp.getSlotCount())).decrStackSize(1); + if (stack.getItemDamage() > stack.getMaxDamage() / 2 && XSTR_INSTANCE.nextInt(100) < 5) { + tmp.getSlot(XSTR_INSTANCE.nextInt(tmp.getSlotCount())).decrStackSize(1); tmp.mInvArmor.onGuiSaved((EntityPlayer) entity); /*public void eject(ItemStack drop) diff --git a/src/main/java/gregtech/common/items/armor/gui/InventoryArmor.java b/src/main/java/gregtech/common/items/armor/gui/InventoryArmor.java index 2a4ca46f4a..4615f29de5 100644 --- a/src/main/java/gregtech/common/items/armor/gui/InventoryArmor.java +++ b/src/main/java/gregtech/common/items/armor/gui/InventoryArmor.java @@ -9,7 +9,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraftforge.oredict.OreDictionary; -import java.util.Random; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; public class InventoryArmor implements IInventory { @@ -206,7 +206,7 @@ public class InventoryArmor implements IInventory { } NBTTagCompound nbt = parent.getTagCompound(); if (override || !nbt.hasKey("UID")) { - nbt.setInteger("UID", new Random().nextInt()); + nbt.setInteger("UID", XSTR_INSTANCE.nextInt()); } } |