From 0af6ec13d667e6b0bc01af3943a062d2c55bc348 Mon Sep 17 00:00:00 2001 From: Bas Verhoeven Date: Thu, 30 May 2019 20:00:40 +0200 Subject: [PATCH] Do not allow more than 54 items in reactor/generator setup guide slots If we don't, opening the schematics for a Bio Reactor results in "IllegalArgumentException: Size for custom inventory must be a multiple of 9 between 9 and 54 slots" And the player is simply handed the Bio Reactor, which they can place and use. Once they do that, the Slimefun guide can't be used until they reconnect. For generators and reactors we show the fuels underneath the schematics or build instructions. When there are more fuels than available space to show them, we'll overflow, causing the custom inventory to not work and Slimefun throwing exceptions. --- src/me/mrCookieSlime/Slimefun/SlimefunGuide.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/me/mrCookieSlime/Slimefun/SlimefunGuide.java b/src/me/mrCookieSlime/Slimefun/SlimefunGuide.java index e248d4090..4ee1a0f45 100644 --- a/src/me/mrCookieSlime/Slimefun/SlimefunGuide.java +++ b/src/me/mrCookieSlime/Slimefun/SlimefunGuide.java @@ -1009,7 +1009,7 @@ public class SlimefunGuide { else if (sfItem instanceof AGenerator) { int slot = 27; for (MachineFuel fuel: ((AGenerator) sfItem).getFuelTypes()) { - if (slot > 54) break; + if (slot >= 54) break; ItemStack fItem = fuel.getInput().clone(); ItemMeta im = fItem.getItemMeta(); List lore = new ArrayList(); @@ -1028,7 +1028,7 @@ public class SlimefunGuide { else if (sfItem instanceof AReactor) { int slot = 27; for (MachineFuel fuel: ((AReactor) sfItem).getFuelTypes()) { - if (slot > 54) break; + if (slot >= 54) break; ItemStack fItem = fuel.getInput().clone(); ItemMeta im = fItem.getItemMeta(); List lore = new ArrayList();