From aa98bd0ba2a56bfedc5fdf35bd1aeee3d62b735d Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 31 Dec 2020 17:08:50 +0100 Subject: [PATCH] Fixes #2664 --- CHANGELOG.md | 1 + .../items/androids/ProgrammableAndroid.java | 10 ++++++++-- .../listeners/ButcherAndroidListener.java | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60212f5b5..cd8918b81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ * Fixed ghost blocks to some extent (ghost blocks will now drop and be replaced) * Fixed #2636 (hotfix) * Fixed #2647 +* Fixed #2664 ## Release Candidate 18 (03 Dec 2020) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java index c741431f5..c4b1dde5f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java @@ -673,6 +673,7 @@ public class ProgrammableAndroid extends SlimefunItem implements InventoryBlock, } } + @ParametersAreNonnullByDefault private void executeInstruction(Instruction instruction, Block b, BlockMenu inv, Config data, int index) { if (getAndroidType().isType(instruction.getRequiredType())) { String rotationData = data.getString("rotation"); @@ -830,11 +831,16 @@ public class ProgrammableAndroid extends SlimefunItem implements InventoryBlock, preset.addItem(34, getFuelSource().getItem(), ChestMenuUtils.getEmptyClickHandler()); } + @ParametersAreNonnullByDefault public void addItems(Block b, ItemStack... items) { + Validate.notNull(b, "The Block cannot be null."); + BlockMenu inv = BlockStorage.getInventory(b); - for (ItemStack item : items) { - inv.pushItem(item, getOutputSlots()); + if (inv != null) { + for (ItemStack item : items) { + inv.pushItem(item, getOutputSlots()); + } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java index d2db858fc..0a3d4f693 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java @@ -68,7 +68,8 @@ public class ButcherAndroidListener implements Listener { } /** - * Some items are not dropped by default. Wither Skeleton Skulls but for some weird reason + * Some items are not dropped by default. + * Wither Skeleton Skulls but for some weird reason * even Blaze rods... * * @param drops