1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Update OilPump.java

This commit is contained in:
coco0325 2019-12-22 01:32:20 +08:00
parent 2fd2dae403
commit ff0016ad0e

View File

@ -97,6 +97,9 @@ public abstract class OilPump extends AContainer {
} }
} }
else { else {
if (!inv.fits(SlimefunItems.BUCKET_OF_OIL, getOutputSlots())) {
return;
}
for (int slot : getInputSlots()) { for (int slot : getInputSlots()) {
if (SlimefunManager.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(Material.BUCKET), true)) { if (SlimefunManager.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(Material.BUCKET), true)) {
OreGenResource oil = OreGenSystem.getResource("Oil"); OreGenResource oil = OreGenSystem.getResource("Oil");
@ -105,21 +108,16 @@ public abstract class OilPump extends AContainer {
if(supplies > 0) { if(supplies > 0) {
MachineRecipe r = new MachineRecipe(26, new ItemStack[0], new ItemStack[] {SlimefunItems.BUCKET_OF_OIL}); MachineRecipe r = new MachineRecipe(26, new ItemStack[0], new ItemStack[] {SlimefunItems.BUCKET_OF_OIL});
if (!inv.fits(SlimefunItems.BUCKET_OF_OIL, getOutputSlots())) {
return;
}
inv.replaceExistingItem(slot, InvUtils.decreaseItem(inv.getItemInSlot(slot), 1)); inv.replaceExistingItem(slot, InvUtils.decreaseItem(inv.getItemInSlot(slot), 1));
processing.put(b, r); processing.put(b, r);
progress.put(b, r.getTicks()); progress.put(b, r.getTicks());
OreGenSystem.setSupplies(oil, chunk, supplies - 1); OreGenSystem.setSupplies(oil, chunk, supplies - 1);
break; break;
}else{ }
ItemStack item = BlockStorage.getInventory(b).getItemInSlot(slot); else {
ItemStack[] abucket = new ItemStack[1]; ItemStack item = BlockStorage.getInventory(b).getItemInSlot(slot).clone();
abucket[0]=item.clone();
BlockStorage.getInventory(b).replaceExistingItem(slot, null); BlockStorage.getInventory(b).replaceExistingItem(slot, null);
pushItems(b, abucket); pushItems(b, item);
} }
} }
} }