aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/items/armor
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common/items/armor')
-rw-r--r--src/main/java/gregtech/common/items/armor/ModularArmor_Item.java7
-rw-r--r--src/main/java/gregtech/common/items/armor/gui/InventoryArmor.java4
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());
}
}