diff --git a/src/main/java/baubles/api/expanded/BaubleExpandedSlots.java b/src/main/java/baubles/api/expanded/BaubleExpandedSlots.java index ab35797..9a55644 100644 --- a/src/main/java/baubles/api/expanded/BaubleExpandedSlots.java +++ b/src/main/java/baubles/api/expanded/BaubleExpandedSlots.java @@ -11,7 +11,7 @@ public class BaubleExpandedSlots { public static final int slotLimit = 20; //Fallback for if a slot type cannot be found - public static final String unknown = "unknown"; + public static final String unknownType = "unknown"; //All "default" types will be registered automatically. public static final String ringType = "ring"; public static final String amuletType = "amulet"; @@ -19,25 +19,30 @@ public class BaubleExpandedSlots { public static final String headType = "head"; public static final String bodyType = "body"; public static final String charmType = "charm"; + public static final String shieldType = "shield"; public static final String gauntletType = "gauntlet"; public static final String capeType = "cape"; private static String[] slots = new String[slotLimit]; private static ArrayList registeredTypes = new ArrayList(); static { + registeredTypes.add(unknownType); registeredTypes.add(ringType); registeredTypes.add(amuletType); registeredTypes.add(beltType); registeredTypes.add(headType); registeredTypes.add(bodyType); registeredTypes.add(charmType); + registeredTypes.add(shieldType); registeredTypes.add(gauntletType); registeredTypes.add(capeType); } private static int newSlotsRemaining = slotLimit; //TODO: Sort slots, locked after post init + //TODO: Prevent items in the wrong slot from applying effects //TODO: Lock removing slots added during pre init + //TODO: Option to show all slots /** * Tries to add a new slot type if the loader state is currently @@ -59,7 +64,6 @@ public class BaubleExpandedSlots { return registeredTypes.indexOf(type); } - /** * Returns if the type is registered or not. * @@ -162,7 +166,7 @@ public class BaubleExpandedSlots { if (slot >= 0 & slot < slotLimit) { return slots[slot]; } else { - return unknown; + return unknownType; } } @@ -181,7 +185,7 @@ public class BaubleExpandedSlots { case BELT: return beltType; default: - return unknown; + return unknownType; } } diff --git a/src/main/java/baubles/common/ItemDebugger.java b/src/main/java/baubles/common/ItemDebugger.java index 1025f3b..5937bab 100644 --- a/src/main/java/baubles/common/ItemDebugger.java +++ b/src/main/java/baubles/common/ItemDebugger.java @@ -37,11 +37,9 @@ public class ItemDebugger extends Item implements IBaubleExpanded { @SideOnly(Side.CLIENT) @Override public void registerIcons(IIconRegister ir) { - icons = new IIcon[1 + BaubleExpandedSlots.getCurrentlyRegisteredTypes().size()]; - icons[0] = ir.registerIcon("baubles:empty_bauble_slot_unknown"); - - for(int i = 1; i < icons.length; i++) { - icons[i] = ir.registerIcon("baubles:empty_bauble_slot_" + BaubleExpandedSlots.getCurrentlyRegisteredTypes().get(i - 1)); + icons = new IIcon[BaubleExpandedSlots.getCurrentlyRegisteredTypes().size()]; + for(int i = 0; i < icons.length; i++) { + icons[i] = ir.registerIcon("baubles:empty_bauble_slot_" + BaubleExpandedSlots.getCurrentlyRegisteredTypes().get(i)); } } @@ -63,10 +61,10 @@ public class ItemDebugger extends Item implements IBaubleExpanded { public String[] getBaubleTypes(ItemStack itemStack) { String type; int meta = itemStack.getItemDamage(); - if(meta <= 0 || meta >= icons.length) { - type = BaubleExpandedSlots.unknown; + if(meta <= 0 || meta > icons.length) { + type = BaubleExpandedSlots.unknownType; } else { - type = BaubleExpandedSlots.getCurrentlyRegisteredTypes().get(meta - 1); + type = BaubleExpandedSlots.getCurrentlyRegisteredTypes().get(meta); } return new String[] {type}; } @@ -118,7 +116,7 @@ public class ItemDebugger extends Item implements IBaubleExpanded { @SideOnly(Side.CLIENT) public IIcon getBackgroundIconForSlotType(String type) { if(type != null && BaubleExpandedSlots.isTypeRegistered(type)) { - return icons[1 + BaubleExpandedSlots.indexOfTypeInRegisteredTypes(type)]; + return icons[BaubleExpandedSlots.indexOfTypeInRegisteredTypes(type)]; } else { return icons[0]; } diff --git a/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_cape.png b/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_cape.png index a9d28f8..b89b6ad 100644 Binary files a/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_cape.png and b/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_cape.png differ diff --git a/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_gauntlet.png b/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_gauntlet.png index b0b5323..61206dd 100644 Binary files a/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_gauntlet.png and b/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_gauntlet.png differ diff --git a/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_shield.png b/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_shield.png new file mode 100644 index 0000000..fa12e43 Binary files /dev/null and b/src/main/resources/assets/baubles/textures/items/empty_bauble_slot_shield.png differ