mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Merge pull request #619 from meiamsome/electric-dust-washer
Fix #617: Electric Dust Washer - Dust Choice.
This commit is contained in:
commit
ef51932e31
@ -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());
|
||||||
|
Loading…
Reference in New Issue
Block a user