mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-15 23:55:53 +01:00
Fix processing for fireproof items with recipes
- Check for smelting and blasting recipes before checking for fireproof-ness
This commit is contained in:
parent
462089b43a
commit
bcb365baa9
1 changed files with 20 additions and 5 deletions
|
@ -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());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue