mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Merge pull request #3853 from JustAHuman-xD/fix/actual-salt-automation
This commit is contained in:
commit
79e057d2aa
@ -1,5 +1,6 @@
|
|||||||
package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines;
|
package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -45,27 +46,30 @@ public class ElectricDustWasher extends AContainer {
|
|||||||
@Override
|
@Override
|
||||||
protected MachineRecipe findNextRecipe(BlockMenu menu) {
|
protected MachineRecipe findNextRecipe(BlockMenu menu) {
|
||||||
for (int slot : getInputSlots()) {
|
for (int slot : getInputSlots()) {
|
||||||
if (SlimefunUtils.isItemSimilar(menu.getItemInSlot(slot), SlimefunItems.SIFTED_ORE, true, false)) {
|
ItemStack input = menu.getItemInSlot(slot);
|
||||||
|
MachineRecipe recipe = null;
|
||||||
|
if (SlimefunUtils.isItemSimilar(input, SlimefunItems.SIFTED_ORE, true, false)) {
|
||||||
if (!legacyMode && !hasFreeSlot(menu)) {
|
if (!legacyMode && !hasFreeSlot(menu)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack dust = oreWasher.getRandomDust();
|
recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.SIFTED_ORE }, new ItemStack[] { oreWasher.getRandomDust() });
|
||||||
MachineRecipe recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.SIFTED_ORE }, new ItemStack[] { dust });
|
|
||||||
|
|
||||||
if (!legacyMode || menu.fits(recipe.getOutput()[0], getOutputSlots())) {
|
if (!legacyMode || menu.fits(recipe.getOutput()[0], getOutputSlots())) {
|
||||||
menu.consumeItem(slot);
|
menu.consumeItem(slot);
|
||||||
return recipe;
|
return recipe;
|
||||||
}
|
}
|
||||||
} else if (SlimefunUtils.isItemSimilar(menu.getItemInSlot(slot), SlimefunItems.PULVERIZED_ORE, true)) {
|
} else if (SlimefunUtils.isItemSimilar(input, SlimefunItems.PULVERIZED_ORE, true)) {
|
||||||
MachineRecipe recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.PULVERIZED_ORE }, new ItemStack[] { SlimefunItems.PURE_ORE_CLUSTER });
|
recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.PULVERIZED_ORE }, new ItemStack[] { SlimefunItems.PURE_ORE_CLUSTER });
|
||||||
|
} else if (SlimefunUtils.isItemSimilar(input, new ItemStack(Material.SAND), true)) {
|
||||||
|
recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { new ItemStack(Material.SAND) }, new ItemStack[] { SlimefunItems.SALT });
|
||||||
|
}
|
||||||
|
|
||||||
if (menu.fits(recipe.getOutput()[0], getOutputSlots())) {
|
if (recipe != null && menu.fits(recipe.getOutput()[0], getOutputSlots())) {
|
||||||
menu.consumeItem(slot);
|
menu.consumeItem(slot);
|
||||||
return recipe;
|
return recipe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -83,7 +87,7 @@ public class ElectricDustWasher extends AContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMachineIdentifier() {
|
public @Nonnull String getMachineIdentifier() {
|
||||||
return "ELECTRIC_DUST_WASHER";
|
return "ELECTRIC_DUST_WASHER";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user