diff --git a/src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AReactor.java b/src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AReactor.java index ec5c7ad3e..7621e48de 100644 --- a/src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AReactor.java +++ b/src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AReactor.java @@ -46,14 +46,14 @@ public abstract class AReactor extends SlimefunItem { private static final BlockFace[] cooling = { - BlockFace.NORTH, - BlockFace.NORTH_EAST, - BlockFace.EAST, - BlockFace.SOUTH_EAST, - BlockFace.SOUTH, - BlockFace.SOUTH_WEST, - BlockFace.WEST, - BlockFace.NORTH_WEST + BlockFace.NORTH, + BlockFace.NORTH_EAST, + BlockFace.EAST, + BlockFace.SOUTH_EAST, + BlockFace.SOUTH, + BlockFace.SOUTH_WEST, + BlockFace.WEST, + BlockFace.NORTH_WEST }; private Set recipes = new HashSet(); @@ -101,9 +101,9 @@ public abstract class AReactor extends SlimefunItem { if(ap != null) { menu.replaceExistingItem(infoSlot, new CustomItem(new ItemStack(Material.GREEN_WOOL), "&7Access Port", "", "&6Detected", "", "&7> Click to view Access Port")); menu.addMenuClickHandler(infoSlot, (p, slot, item, action) -> { - ap.open(p); - newInstance(menu, b); - + ap.open(p); + newInstance(menu, b); + return false; }); } else { @@ -114,12 +114,12 @@ public abstract class AReactor extends SlimefunItem { return false; }); } - + } catch(Exception x) { } } - + @Override public boolean canOpen(Block b, Player p) { return p.hasPermission("slimefun.inventory.bypass") || CSCoreLib.getLib().getProtectionManager().canAccessChest(p.getUniqueId(), b, true); @@ -173,34 +173,34 @@ public abstract class AReactor extends SlimefunItem { private void constructMenu(BlockMenuPreset preset) { for (int i : border) { preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "), - (p, slot, item, action) -> false - ); + (p, slot, item, action) -> false + ); } for (int i : border_1) { preset.addItem(i, new CustomItem(new ItemStack(Material.LIME_STAINED_GLASS_PANE), " "), - (p, slot, item, action) -> false - ); + (p, slot, item, action) -> false + ); } for (int i : border_3) { preset.addItem(i, new CustomItem(new ItemStack(Material.GREEN_STAINED_GLASS_PANE), " "), - (p, slot, item, action) -> false - ); + (p, slot, item, action) -> false + ); } preset.addItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "), - (p, slot, item, action) -> false - ); + (p, slot, item, action) -> false + ); preset.addItem(1, new CustomItem(SlimefunItems.URANIUM, "&7Fuel Slot", "", "&rThis Slot accepts radioactive Fuel such as:", "&2Uranium &ror &aNeptunium"), - (p, slot, item, action) -> false - ); + (p, slot, item, action) -> false + ); for (int i : border_2) { preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "), - (p, slot, item, action) -> false - ); + (p, slot, item, action) -> false + ); } if (needsCooling()) { @@ -211,8 +211,8 @@ public abstract class AReactor extends SlimefunItem { for (int i : border_4) { preset.addItem(i, new CustomItem(new ItemStack(Material.BARRIER), "&cNo Coolant Required"), - (p, slot, item, action) -> false - ); + (p, slot, item, action) -> false + ); } } } @@ -369,15 +369,15 @@ public abstract class AReactor extends SlimefunItem { } outer: - for (MachineFuel recipe: recipes) { - for (int slot: getFuelSlots()) { - if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(l).getItemInSlot(slot), recipe.getInput(), true)) { - found.put(slot, recipe.getInput().getAmount()); - r = recipe; - break outer; + for (MachineFuel recipe: recipes) { + for (int slot: getFuelSlots()) { + if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(l).getItemInSlot(slot), recipe.getInput(), true)) { + found.put(slot, recipe.getInput().getAmount()); + r = recipe; + break outer; + } } } - } if (r != null) { for (Map.Entry entry: found.entrySet()) { @@ -395,11 +395,11 @@ public abstract class AReactor extends SlimefunItem { final boolean explosion = explode.contains(l); if (explosion) { BlockStorage.getInventory(l).close(); - + Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> { ReactorHologram.remove(l); }, 0); - + explode.remove(l); processing.remove(l); progress.remove(l); @@ -467,7 +467,7 @@ public abstract class AReactor extends SlimefunItem { public BlockMenu getAccessPort(Location l) { Location portL = new Location(l.getWorld(), l.getX(), l.getY() + 3, l.getZ()); - + if (BlockStorage.check(portL, "REACTOR_ACCESS_PORT")) return BlockStorage.getInventory(portL); return null; } diff --git a/src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/machines/ReactorAccessPort.java b/src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/machines/ReactorAccessPort.java index f7be9efcb..05520775e 100644 --- a/src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/machines/ReactorAccessPort.java +++ b/src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/machines/ReactorAccessPort.java @@ -193,6 +193,7 @@ public class ReactorAccessPort extends SlimefunItem { public AReactor getReactor(Location l) { Location reactorL = new Location(l.getWorld(), l.getX(), l.getY() - 3, l.getZ()); + SlimefunItem item = BlockStorage.check(reactorL.getBlock()); if(item instanceof AReactor) return (AReactor) item; @@ -203,9 +204,7 @@ public class ReactorAccessPort extends SlimefunItem { public BlockMenu getReactorMenu(Location l) { Location reactorL = new Location(l.getWorld(), l.getX(), l.getY() - 3, l.getZ()); - SlimefunItem item = BlockStorage.check(reactorL); - - if(item != null && (item.getID().equals("NUCLEAR_REACTOR") || item.getID().equals("NETHERSTAR_REACTOR"))) + if(BlockStorage.checkID(reactorL).equals("NUCLEAR_REACTOR") || BlockStorage.checkID(reactorL).equals("NETHERSTAR_REACTOR")) return BlockStorage.getInventory(reactorL); return null;