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:
parent
2fd2dae403
commit
ff0016ad0e
@ -97,29 +97,27 @@ 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");
|
||||||
Chunk chunk = b.getChunk();
|
Chunk chunk = b.getChunk();
|
||||||
int supplies = OreGenSystem.getSupplies(oil, chunk, false);
|
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});
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user