diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d5b5b4cb..1645f32ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ * Fixed #2862 * Fixed #2887 * Fixed items getting deleted when breaking enhanced furnaces +* Fixed #2895 ## Release Candidate 21 (14 Mar 2021) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#21 diff --git a/pom.xml b/pom.xml index 39f9b3d19..8bd740f78 100644 --- a/pom.xml +++ b/pom.xml @@ -260,6 +260,10 @@ Slimefun4 - Implementations io.github.thebusybiscuit.slimefun4.implementation* + + Slimefun4 - Integrations with other plugins + io.github.thebusybiscuit.slimefun4.integrations* + Slimefun4 - Common utility packages io.github.thebusybiscuit.slimefun4.utils* diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/auto_crafters/AbstractAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/auto_crafters/AbstractAutoCrafter.java index 5c9f9eb1a..851c9b04c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/auto_crafters/AbstractAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/auto_crafters/AbstractAutoCrafter.java @@ -111,6 +111,7 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy // Prevent blocks from being placed, food from being eaten, etc... e.cancel(); + // Check if we have a valid chest below if (!isValidChest(b.getRelative(BlockFace.DOWN))) { SlimefunPlugin.getLocalization().sendMessage(p, "messages.auto-crafting.missing-chest"); } else if (SlimefunPlugin.getProtectionManager().hasPermission(p, b, ProtectableAction.INTERACT_BLOCK)) { @@ -128,6 +129,8 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy showRecipe(p, b, recipe); } } + } else { + SlimefunPlugin.getLocalization().sendMessage(p, "inventory.no-access"); } }); } @@ -373,7 +376,7 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy * @param capacity * The amount of energy this machine can store * - * @return This method will return the current instance of {@link AContainer}, so that can be chained. + * @return This method will return the current instance of {@link AContainer}, so that it can be chained. */ @Nonnull public final AbstractAutoCrafter setCapacity(int capacity) { @@ -393,7 +396,7 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy * @param energyConsumption * The energy consumed per tick * - * @return This method will return the current instance of {@link AContainer}, so that can be chained. + * @return This method will return the current instance of {@link AContainer}, so that it can be chained. */ @Nonnull public final AbstractAutoCrafter setEnergyConsumption(int energyConsumption) { @@ -407,6 +410,7 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy @Override public void register(@Nonnull SlimefunAddon addon) { + Validate.notNull(addon, "A SlimefunAddon cannot be null!"); this.addon = addon; if (getCapacity() <= 0) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/auto_crafters/package-info.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/auto_crafters/package-info.java index e93f63da9..d4c8442b3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/auto_crafters/package-info.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/auto_crafters/package-info.java @@ -1,4 +1,4 @@ /** - * This package contains any electric machines related to auomatic crafting tables. + * This package contains any electric machines related to automatic crafting tables. */ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.auto_crafters; \ No newline at end of file diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/InfusedHopper.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/InfusedHopper.java index c0e957daf..1f5d4d9f6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/InfusedHopper.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/InfusedHopper.java @@ -16,6 +16,7 @@ import org.bukkit.util.Vector; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; import io.github.thebusybiscuit.slimefun4.api.items.settings.DoubleRangeSetting; +import io.github.thebusybiscuit.slimefun4.implementation.handlers.VanillaInventoryDropHandler; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; @@ -33,6 +34,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; * * @author TheBusyBiscuit * @author Walshy + * * @see InfusedMagnet */ public class InfusedHopper extends SimpleSlimefunItem { @@ -46,6 +48,9 @@ public class InfusedHopper extends SimpleSlimefunItem { super(category, item, recipeType, recipe); addItemSetting(silent, radius, toggleable); + + // Fixes #2895 - Make sure we drop all inventory contents + addItemHandler(new VanillaInventoryDropHandler<>(org.bukkit.block.Hopper.class)); } @Override