diff options
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Utility.java | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index e09901b03b..72b74c3f97 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -4411,86 +4411,6 @@ public class GT_Utility { } } - /** - * THIS IS BULLSHIT!!! WHY DO I HAVE TO DO THIS SHIT JUST TO HAVE ENCHANTS PROPERLY!?! - */ - public static class GT_EnchantmentHelper { - - private static final BullshitIteratorA mBullshitIteratorA = new BullshitIteratorA(); - private static final BullshitIteratorB mBullshitIteratorB = new BullshitIteratorB(); - - private static void applyBullshit(IBullshit aBullshitModifier, ItemStack aStack) { - if (aStack != null) { - NBTTagList nbttaglist = aStack.getEnchantmentTagList(); - if (nbttaglist != null) { - try { - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - short short1 = nbttaglist.getCompoundTagAt(i) - .getShort("id"); - short short2 = nbttaglist.getCompoundTagAt(i) - .getShort("lvl"); - if (Enchantment.enchantmentsList[short1] != null) - aBullshitModifier.calculateModifier(Enchantment.enchantmentsList[short1], short2); - } - } catch (Throwable e) { - /**/ - } - } - } - } - - private static void applyArrayOfBullshit(IBullshit aBullshitModifier, ItemStack[] aStacks) { - for (ItemStack itemstack : aStacks) { - applyBullshit(aBullshitModifier, itemstack); - } - } - - public static void applyBullshitA(EntityLivingBase aPlayer, Entity aEntity, ItemStack aStack) { - mBullshitIteratorA.mPlayer = aPlayer; - mBullshitIteratorA.mEntity = aEntity; - if (aPlayer != null) applyArrayOfBullshit(mBullshitIteratorA, aPlayer.getLastActiveItems()); - if (aStack != null) applyBullshit(mBullshitIteratorA, aStack); - } - - public static void applyBullshitB(EntityLivingBase aPlayer, Entity aEntity, ItemStack aStack) { - mBullshitIteratorB.mPlayer = aPlayer; - mBullshitIteratorB.mEntity = aEntity; - if (aPlayer != null) applyArrayOfBullshit(mBullshitIteratorB, aPlayer.getLastActiveItems()); - if (aStack != null) applyBullshit(mBullshitIteratorB, aStack); - } - - interface IBullshit { - - void calculateModifier(Enchantment aEnchantment, int aLevel); - } - - static final class BullshitIteratorA implements IBullshit { - - public EntityLivingBase mPlayer; - public Entity mEntity; - - BullshitIteratorA() {} - - @Override - public void calculateModifier(Enchantment aEnchantment, int aLevel) { - aEnchantment.func_151367_b(mPlayer, mEntity, aLevel); - } - } - - static final class BullshitIteratorB implements IBullshit { - - public EntityLivingBase mPlayer; - public Entity mEntity; - - BullshitIteratorB() {} - - @Override - public void calculateModifier(Enchantment aEnchantment, int aLevel) { - aEnchantment.func_151368_a(mPlayer, mEntity, aLevel); - } - } - } - public static String toSubscript(long no) { char[] chars = Long.toString(no) .toCharArray(); |