From cf362f7c7a6485f6c08b8ea02c0f0efd57bd9c78 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 29 May 2021 10:35:41 +0200 Subject: [PATCH] Fixed #3087 --- CHANGELOG.md | 1 + .../slimefun4/implementation/items/geo/OilPump.java | 8 +++++--- .../implementation/operations/MiningOperation.java | 9 +++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaa597fed..1c6369ff8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ * Fixed #3084 * Fixed #3085 * Fixed #3088 +* Fixed #3087 ## Release Candidate 23 (19 May 2021) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#23 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java index ccb2bb6d0..c7913d077 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java @@ -31,6 +31,8 @@ public class OilPump extends AContainer implements RecipeDisplayItem { private final GEOResource oil; + private final ItemStack emptyBucket = new ItemStack(Material.BUCKET); + @ParametersAreNonnullByDefault public OilPump(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); @@ -71,7 +73,7 @@ public class OilPump extends AContainer implements RecipeDisplayItem { @Override public List getDisplayRecipes() { - return Arrays.asList(new ItemStack(Material.BUCKET), SlimefunItems.OIL_BUCKET); + return Arrays.asList(emptyBucket, SlimefunItems.OIL_BUCKET); } @Override @@ -90,11 +92,11 @@ public class OilPump extends AContainer implements RecipeDisplayItem { Block b = inv.getBlock(); for (int slot : getInputSlots()) { - if (SlimefunUtils.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(Material.BUCKET), true, false)) { + if (SlimefunUtils.isItemSimilar(inv.getItemInSlot(slot), emptyBucket, true, false)) { OptionalInt supplies = SlimefunPlugin.getGPSNetwork().getResourceManager().getSupplies(oil, b.getWorld(), b.getX() >> 4, b.getZ() >> 4); if (supplies.isPresent() && supplies.getAsInt() > 0) { - MachineRecipe recipe = new MachineRecipe(26, new ItemStack[0], new ItemStack[] { SlimefunItems.OIL_BUCKET }); + MachineRecipe recipe = new MachineRecipe(26, new ItemStack[] { emptyBucket }, new ItemStack[] { SlimefunItems.OIL_BUCKET }); inv.consumeItem(slot); SlimefunPlugin.getGPSNetwork().getResourceManager().setSupplies(oil, b.getWorld(), b.getX() >> 4, b.getZ() >> 4, supplies.getAsInt() - 1); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/operations/MiningOperation.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/operations/MiningOperation.java index fca4dd8f2..2a1201855 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/operations/MiningOperation.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/operations/MiningOperation.java @@ -39,8 +39,13 @@ public class MiningOperation implements MachineOperation { currentTicks += num; } - @Nonnull - public ItemStack getResult() { + /** + * This returns the result of this operation, the {@link ItemStack} + * that will be returned in the end. + * + * @return The result of this operation + */ + public @Nonnull ItemStack getResult() { return result; }