Fix processing for fireproof items with recipes

- Check for smelting and blasting recipes before checking for
fireproof-ness
This commit is contained in:
PepperBell 2021-05-26 20:54:17 -07:00
parent 462089b43a
commit bcb365baa9

View file

@ -94,8 +94,23 @@ public class InWorldProcessing {
} }
private static boolean canProcess(ItemStack stack, Type type, World world) { private static boolean canProcess(ItemStack stack, Type type, World world) {
if (type == Type.BLASTING) if (type == Type.BLASTING) {
WRAPPER.setInventorySlotContents(0, stack);
Optional<FurnaceRecipe> smeltingRecipe = world.getRecipeManager()
.getRecipe(IRecipeType.SMELTING, WRAPPER, world);
if (smeltingRecipe.isPresent())
return true;
WRAPPER.setInventorySlotContents(0, stack);
Optional<BlastingRecipe> blastingRecipe = world.getRecipeManager()
.getRecipe(IRecipeType.BLASTING, WRAPPER, world);
if (blastingRecipe.isPresent())
return true;
return !stack.getItem().isFireproof(); return !stack.getItem().isFireproof();
}
if (type == Type.SMOKING) { if (type == Type.SMOKING) {
WRAPPER.setInventorySlotContents(0, stack); WRAPPER.setInventorySlotContents(0, stack);
@ -178,11 +193,11 @@ public class InWorldProcessing {
.getRecipe(IRecipeType.SMOKING, WRAPPER, world); .getRecipe(IRecipeType.SMOKING, WRAPPER, world);
if (type == Type.BLASTING) { if (type == Type.BLASTING) {
if (!smokingRecipe.isPresent()) {
WRAPPER.setInventorySlotContents(0, stack); WRAPPER.setInventorySlotContents(0, stack);
Optional<FurnaceRecipe> smeltingRecipe = world.getRecipeManager() Optional<FurnaceRecipe> smeltingRecipe = world.getRecipeManager()
.getRecipe(IRecipeType.SMELTING, WRAPPER, world); .getRecipe(IRecipeType.SMELTING, WRAPPER, world);
if (!smokingRecipe.isPresent()) {
if (smeltingRecipe.isPresent()) if (smeltingRecipe.isPresent())
return applyRecipeOn(stack, smeltingRecipe.get()); return applyRecipeOn(stack, smeltingRecipe.get());