From 37242fe64afd40715a5a3d74f6d57c6b2cf8e4df Mon Sep 17 00:00:00 2001 From: svr333 Date: Tue, 6 Oct 2020 01:26:23 +0200 Subject: [PATCH] Throw out variables --- .../items/multiblocks/TableSaw.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/TableSaw.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/TableSaw.java index 191ce446f..f9adbecd7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/TableSaw.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/TableSaw.java @@ -82,19 +82,16 @@ public class TableSaw extends MultiBlockMachine { @Nullable private ItemStack getItemsToOutput(@Nonnull ItemStack item) { - boolean itemIsAPlank = Tag.PLANKS.isTagged(item.getType()); - boolean itemIsALog = Tag.LOGS.isTagged(item.getType()); - ItemStack output = null; - - if (itemIsALog) { + if (Tag.LOGS.isTagged(item.getType())) { Optional planks = MaterialConverter.getPlanksFromLog(item.getType()); - output = new ItemStack(planks.get(), 8); + return new ItemStack(planks.get(), 8); } - else if (itemIsAPlank){ - output = new ItemStack(Material.STICK, 4); + else if (Tag.PLANKS.isTagged(item.getType())) { + return new ItemStack(Material.STICK, 4); + } + else { + return null; } - - return output; } private void outputItems(@Nonnull Block b, @Nonnull ItemStack output) {