diff --git a/src/me/mrCookieSlime/Slimefun/Setup/SlimefunSetup.java b/src/me/mrCookieSlime/Slimefun/Setup/SlimefunSetup.java index d75a744dc..1109d99af 100644 --- a/src/me/mrCookieSlime/Slimefun/Setup/SlimefunSetup.java +++ b/src/me/mrCookieSlime/Slimefun/Setup/SlimefunSetup.java @@ -749,30 +749,30 @@ public class SlimefunSetup { p.getWorld().playEffect(b.getLocation(), Effect.MOBSPAWNER_FLAMES, 1); Block raw_disp = b.getRelative(BlockFace.DOWN); Hopper resf = null; + boolean isIgnitionChamberInstalled = false; - if(raw_disp.getRelative(BlockFace.EAST).getState().getBlock().getType().name() == "HOPPER") { + if(BlockStorage.check(raw_disp.getRelative(BlockFace.EAST).getState().getBlock(), "IGNITION_CHAMBER")) { resf = (Hopper) raw_disp.getRelative(BlockFace.EAST).getState(); - } else if (raw_disp.getRelative(BlockFace.WEST).getState().getBlock().getType().name() == "HOPPER") { + isIgnitionChamberInstalled = true; + } else if (BlockStorage.check(raw_disp.getRelative(BlockFace.WEST).getState().getBlock(), "IGNITION_CHAMBER")) { resf = (Hopper) raw_disp.getRelative(BlockFace.WEST).getState(); - } else if (raw_disp.getRelative(BlockFace.NORTH).getState().getBlock().getType().name() == "HOPPER") { + isIgnitionChamberInstalled = true; + } else if (BlockStorage.check(raw_disp.getRelative(BlockFace.NORTH).getState().getBlock(), "IGNITION_CHAMBER")) { resf = (Hopper) raw_disp.getRelative(BlockFace.NORTH).getState(); - } else if (raw_disp.getRelative(BlockFace.SOUTH).getState().getBlock().getType().name() == "HOPPER"){ + isIgnitionChamberInstalled = true; + } else if (BlockStorage.check(raw_disp.getRelative(BlockFace.SOUTH).getState().getBlock(), "IGNITION_CHAMBER")){ resf = (Hopper) raw_disp.getRelative(BlockFace.SOUTH).getState(); - } - boolean isIgniteChamberInstalled = false; - - if(resf != null) { - if(resf.getCustomName().equalsIgnoreCase(SlimefunItems.IGNITION_CHAMBER.getItemMeta().getDisplayName())) isIgniteChamberInstalled = true; + isIgnitionChamberInstalled = true; } if (SlimefunStartup.chance(100, (Integer) Slimefun.getItemValue("SMELTERY", "chance.fireBreak"))) { - if(isIgniteChamberInstalled) { + if(isIgnitionChamberInstalled) { if(resf.getInventory().contains(Material.FLINT_AND_STEEL)) { ItemStack item = resf.getInventory().getItem(resf.getInventory().first(Material.FLINT_AND_STEEL)); item.setDurability((short) (item.getDurability() + 1)); - if(item.getDurability() >= 64) { - item.setAmount(0); p.getWorld().playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1, 1); - item.setAmount(0); + if(item.getDurability() >= item.getType().getMaxDurability()) { + item.setAmount(0); + p.getWorld().playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1, 1); } p.getWorld().playSound(p.getLocation(), Sound.ITEM_FLINTANDSTEEL_USE, 1, 1); } else {