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,29 +97,27 @@ public abstract class OilPump extends AContainer {
}
}
else {
if (!inv.fits(SlimefunItems.BUCKET_OF_OIL, getOutputSlots())) {
return;
}
for (int slot : getInputSlots()) {
if (SlimefunManager.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(Material.BUCKET), true)) {
OreGenResource oil = OreGenSystem.getResource("Oil");
Chunk chunk = b.getChunk();
int supplies = OreGenSystem.getSupplies(oil, chunk, false);
if(supplies > 0){
if(supplies > 0) {
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));
processing.put(b, r);
progress.put(b, r.getTicks());
OreGenSystem.setSupplies(oil, chunk, supplies - 1);
break;
}else{
ItemStack item = BlockStorage.getInventory(b).getItemInSlot(slot);
ItemStack[] abucket = new ItemStack[1];
abucket[0]=item.clone();
}
else {
ItemStack item = BlockStorage.getInventory(b).getItemInSlot(slot).clone();
BlockStorage.getInventory(b).replaceExistingItem(slot, null);
pushItems(b, abucket);
pushItems(b, item);
}
}
}