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

Fix #617: Electric Dust Washer - Dust Choice.

This commit is contained in:
Oliver Wright 2018-03-02 20:17:44 +00:00
parent 9e0262d8b5
commit 7278f80c6f
No known key found for this signature in database
GPG Key ID: 74EA9FD649807D37

View File

@ -82,7 +82,14 @@ public abstract class ElectricDustWasher extends AContainer {
else { else {
for (int slot: getInputSlots()) { for (int slot: getInputSlots()) {
if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.SIFTED_ORE, true)) { if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.SIFTED_ORE, true)) {
boolean empty_slot = false;
for (int output_slot: getOutputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(output_slot) == null) {
empty_slot = true;
break;
}
}
if (!empty_slot) return;
ItemStack adding = SlimefunItems.IRON_DUST; ItemStack adding = SlimefunItems.IRON_DUST;
if (SlimefunStartup.chance(100, 25)) adding = SlimefunItems.GOLD_DUST; if (SlimefunStartup.chance(100, 25)) adding = SlimefunItems.GOLD_DUST;
else if (SlimefunStartup.chance(100, 25)) adding = SlimefunItems.ALUMINUM_DUST; else if (SlimefunStartup.chance(100, 25)) adding = SlimefunItems.ALUMINUM_DUST;
@ -94,7 +101,6 @@ public abstract class ElectricDustWasher extends AContainer {
else if (SlimefunStartup.chance(100, 25)) adding = SlimefunItems.SILVER_DUST; else if (SlimefunStartup.chance(100, 25)) adding = SlimefunItems.SILVER_DUST;
MachineRecipe r = new MachineRecipe(4 / getSpeed(), new ItemStack[0], new ItemStack[] {adding}); MachineRecipe r = new MachineRecipe(4 / getSpeed(), new ItemStack[0], new ItemStack[] {adding});
if (!fits(b, r.getOutput())) return;
BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1)); BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
processing.put(b, r); processing.put(b, r);
progress.put(b, r.getTicks()); progress.put(b, r.getTicks());