From 359d13035ba3b2dea0215aef69e5210fd54e7d48 Mon Sep 17 00:00:00 2001 From: Zach Date: Fri, 6 Dec 2013 19:54:13 -0500 Subject: [PATCH] Delete WeaponRegistry.java class not used --- .../api/weapons/WeaponRegistry.java | 98 ------------------- 1 file changed, 98 deletions(-) delete mode 100644 src/mods/battlegear2/api/weapons/WeaponRegistry.java diff --git a/src/mods/battlegear2/api/weapons/WeaponRegistry.java b/src/mods/battlegear2/api/weapons/WeaponRegistry.java deleted file mode 100644 index 41143930..00000000 --- a/src/mods/battlegear2/api/weapons/WeaponRegistry.java +++ /dev/null @@ -1,98 +0,0 @@ -package mods.battlegear2.api.weapons; - -import java.util.HashSet; -import java.util.Set; - -import mods.battlegear2.utils.BattlegearUtils; -import net.minecraft.item.ItemStack; -/** - * Registry for stacks which will be allowed in battle inventory, - * accessible through {@link #FMLInterModComms} messages. - * Use only if your item is not recognized by default. - * Use of {@link #IBattlegearWeapon} is preferred over this method. - * {@link #NBTTagCompound} are supported. - * @author GotoLink - * - */ -public class WeaponRegistry { - private static Set weapons = new HashSet(); - private static Set mainHand = new HashSet(); - private static Set offHand = new HashSet(); - /** - * Called by a {@link #IMCMessage} with "Dual" as key, and the {@link #ItemStack} as value - * @param stack registered as dual wieldable - */ - public static void addDualWeapon(ItemStack stack) { - if(!BattlegearUtils.checkForRightClickFunction(stack.getItem())){ - weapons.add(new StackHolder(stack)); - mainHand.add(new StackHolder(stack)); - offHand.add(new StackHolder(stack)); - } - } - - /** - * Called by a {@link #IMCMessage} with "MainHand" as key, and the {@link #ItemStack} as value - * @param stack registered as wieldable only in main hand - */ - public static void addTwoHanded(ItemStack stack) { - if(!BattlegearUtils.checkForRightClickFunction(stack.getItem())){ - weapons.add(new StackHolder(stack)); - mainHand.add(new StackHolder(stack)); - } - } - - /** - * Called by a {@link #IMCMessage} with "OffHand" as key, and the {@link #ItemStack} as value - * @param stack registered as wieldable only in main hand - */ - public static void addOffhandWeapon(ItemStack stack) { - if(!BattlegearUtils.checkForRightClickFunction(stack.getItem())){ - weapons.add(new StackHolder(stack)); - offHand.add(new StackHolder(stack)); - } - } - - public static boolean isWeapon(ItemStack stack) { - return weapons.contains(new StackHolder(stack)); - } - - public static boolean isMainHand(ItemStack stack) { - return mainHand.contains(new StackHolder(stack)); - } - - public static boolean isOffHand(ItemStack stack) { - return offHand.contains(new StackHolder(stack)); - } - - static class StackHolder{ - private ItemStack stack; - - public StackHolder(ItemStack stack){ - this.stack = stack; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = prime + (stack == null ? 0 : stack.itemID ^ stack.stackSize + (stack.hasTagCompound() ? prime*prime ^ stack.getTagCompound().hashCode():0)); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (!(obj instanceof StackHolder)) { - return false; - } - if (!ItemStack.areItemStacksEqual(stack, ((StackHolder) obj).stack)) { - return false; - } - return true; - } - } -}