diff --git a/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java b/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java index 252c7d1e..0a97b59c 100644 --- a/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java +++ b/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java @@ -59,8 +59,8 @@ public class WarpDriveConfig { public static Method forgeMultipart_helper_sendDescPacket = null; public static Method forgeMultipart_tileMultipart_onChunkLoad = null; - public static ItemStack IC2_air; - public static ItemStack IC2_empty; + public static ItemStack IC2_compressedAir; + public static ItemStack IC2_emptyCell; public static Block IC2_rubberWood; public static ItemStack IC2_Resin; public static Block CC_Computer, CC_peripheral, CCT_Turtle, CCT_Expanded, CCT_Advanced; @@ -590,6 +590,7 @@ public class WarpDriveConfig { config.get("item_tags", "GraviSuite:advNanoChestPlate" , "FlyInSpace NoFallDamage" ).getString(); config.get("item_tags", "GraviSuite:graviChestPlate" , "FlyInSpace NoFallDamage" ).getString(); + config.get("item_tags", "IC2:itemArmorRubBoots" , "NoFallDamage" ).getString(); config.get("item_tags", "IC2:itemArmorQuantumBoots" , "NoFallDamage" ).getString(); taggedItemsName = categoryItemTags.getValues().keySet().toArray(new String[0]); } @@ -835,12 +836,12 @@ public class WarpDriveConfig { FillerManager.loadOres(configDirectory); StructureManager.loadStructures(configDirectory); - loadBlockDictionnary(); + loadDictionnary(); FillerManager.finishLoading(); } - private static void loadBlockDictionnary() { + private static void loadDictionnary() { // get default settings from parsing ore dictionary BLOCKS_ORES = new HashSet(); BLOCKS_LOGS = new HashSet(); @@ -947,7 +948,7 @@ public class WarpDriveConfig { for (Entry taggedItem : taggedItems.entrySet()) { String itemId = taggedItem.getKey(); Item item = GameData.getItemRegistry().getObject(itemId); - if (item != null) { + if (item == null) { WarpDrive.logger.info("Ignoring missing item " + itemId); continue; } @@ -1010,8 +1011,8 @@ public class WarpDriveConfig { private static void loadIC2() { try { - IC2_empty = getModItemStack("IC2", "itemCellEmpty", -1); - IC2_air = getModItemStack("IC2", "itemCellEmpty", 5); + IC2_emptyCell = getModItemStack("IC2", "itemCellEmpty", -1); + IC2_compressedAir = getModItemStack("IC2", "itemCellEmpty", 5); IC2_rubberWood = getModBlock("IC2", "blockRubWood"); IC2_Resin = getModItemStack("IC2", "itemHarz", -1); diff --git a/src/main/java/cr0s/warpdrive/event/LivingHandler.java b/src/main/java/cr0s/warpdrive/event/LivingHandler.java index dceffcc5..e823b795 100644 --- a/src/main/java/cr0s/warpdrive/event/LivingHandler.java +++ b/src/main/java/cr0s/warpdrive/event/LivingHandler.java @@ -143,7 +143,7 @@ public class LivingHandler { if (air == null) {// new player in space => grace period player_airTank.put(playerName, AIR_TANK_TICKS); } else if (air <= 1) { - if (consumeO2(player.inventory.mainInventory, player)) { + if (consumeCompressedAir(player.inventory.mainInventory, player)) { player_airTank.put(playerName, AIR_TANK_TICKS); } else { player_airTank.put(playerName, AIR_DROWN_TICKS); @@ -204,17 +204,16 @@ public class LivingHandler { } } - private static boolean consumeO2(ItemStack[] inventory, EntityPlayerMP entityPlayer) { + private static boolean consumeCompressedAir(ItemStack[] inventory, EntityPlayerMP entityPlayer) { for (int j = 0; j < inventory.length; ++j) { - if (inventory[j] != null && inventory[j] == WarpDriveConfig.IC2_air) { + if (inventory[j] != null && inventory[j].isItemEqual(WarpDriveConfig.IC2_compressedAir)) { inventory[j].stackSize--; if (inventory[j].stackSize <= 0) { inventory[j] = null; } - if (WarpDriveConfig.IC2_empty != null) { - // WarpDrive.debugPrint("giveEmptyCell"); - ItemStack emptyCell = new ItemStack(WarpDriveConfig.IC2_empty.getItem(), 1, 0); + if (WarpDriveConfig.IC2_emptyCell != null) { + ItemStack emptyCell = new ItemStack(WarpDriveConfig.IC2_emptyCell.getItem(), 1, 0); if (!entityPlayer.inventory.addItemStackToInventory(emptyCell)) { World world = entityPlayer.worldObj; EntityItem itemEnt = new EntityItem(world, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, emptyCell);