From 51197d20341b5b3caf3d27e113c595e2f3f2cc96 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 15 Feb 2022 05:17:31 +0200 Subject: [PATCH] Fix mechanical mixer not working for all non shaped recipes. Fixes #1424 --- .../components/mixer/MechanicalMixerTileEntity.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java index 53587571f..97c67f55c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java @@ -32,6 +32,7 @@ import net.minecraft.sounds.SoundSource; import net.minecraft.util.Mth; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.CraftingRecipe; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.block.entity.BlockEntityType; @@ -40,6 +41,7 @@ import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.common.crafting.IShapedRecipe; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; @@ -237,10 +239,10 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { @Override protected boolean matchStaticFilters(Recipe r) { - return ((r.getSerializer() == RecipeSerializer.SHAPELESS_RECIPE - && AllConfigs.SERVER.recipes.allowShapelessInMixer.get() && r.getIngredients() + return ((r instanceof CraftingRecipe && !(r instanceof IShapedRecipe) + && AllConfigs.SERVER.recipes.allowShapelessInMixer.get() && r.getIngredients() .size() > 1 - && !MechanicalPressTileEntity.canCompress(r)) && !AllRecipeTypes.isManualRecipe(r) + && !MechanicalPressTileEntity.canCompress(r)) && !AllRecipeTypes.isManualRecipe(r) || r.getType() == AllRecipeTypes.MIXING.getType()); } @@ -289,9 +291,9 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { // SoundEvents.BLOCK_STONE_BREAK boolean slow = Math.abs(getSpeed()) < 65; - if (slow && AnimationTickHolder.getTicks() % 2 == 0) + if (slow && AnimationTickHolder.getTicks() % 2 == 0) return; - if (runningTicks == 20) + if (runningTicks == 20) AllSoundEvents.MIXING.playAt(level, worldPosition, .75f, 1, true); }