mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Fixed #3087
This commit is contained in:
parent
ab2049d1d2
commit
cf362f7c7a
@ -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
|
||||
|
@ -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<ItemStack> 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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user