diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a6aa7d67..572887e5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,11 +25,11 @@ ## Release Candidate 22 (TBD) #### Additions -* Added Vanilla Auto Crafter -* Added Enhanced Auto Crafter +* Added Vanilla Auto-Crafter +* Added Enhanced Auto-Crafter * Added "Smart-Filling" mode to Cargo Input nodes * Added "Netherite Ingot -> Netherite Block" recipe to Electric Press -* Added Armor Forge Auto Crafter +* Added Armor Forge Auto-Crafter * Auto-Crafters can now be turned on and off * Added Produce Collector to automate Milk and Mushroom Stew * Block Placers can now place down cake @@ -50,7 +50,8 @@ * Fixed #2903 * Fixed #2913 * Fixed #2914 -* Fixed Auto Crafters swallowing buckets when crafting cake +* Fixed Auto-Crafters swallowing buckets when crafting cake +* Fixed Multimeter not working on Auto-Crafters ## Release Candidate 21 (14 Mar 2021) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#21 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AutoCrafterListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AutoCrafterListener.java index 66be4a351..130f0b18d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AutoCrafterListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AutoCrafterListener.java @@ -14,6 +14,7 @@ import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.items.autocrafters.AbstractAutoCrafter; import io.github.thebusybiscuit.slimefun4.implementation.items.autocrafters.EnhancedAutoCrafter; +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets.Multimeter; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; /** @@ -50,6 +51,13 @@ public class AutoCrafterListener implements Listener { SlimefunItem block = slimefunBlock.get(); if (block instanceof AbstractAutoCrafter) { + Optional slimefunItem = e.getSlimefunItem(); + + if (!e.getPlayer().isSneaking() && slimefunItem.isPresent() && slimefunItem.get() instanceof Multimeter) { + // Allow Multimeters to pass through and do their job + return; + } + // Prevent blocks from being placed, food from being eaten, etc... e.cancel();