Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class AbstractFurnaceBlockEntityMixin extends LockableContainerBlockEntity implements SidedInventory, RecipeUnlocker, RecipeInputProvider, Tickable {
- @Shadow protected @Final RecipeType<? extends AbstractCookingRecipe> recipeType;
- protected AbstractFurnaceBlockEntityMixin(BlockEntityType<?> blockEntityType) {
- super(blockEntityType);
- throw new IllegalStateException("AbstractFurnaceBlockEntityMixin's dummy constructor called! ");
- }
- @Inject(method = "isValid", at = @At("RETURN"), cancellable = true)
- void onIsValidReturn(int slot, ItemStack stack, CallbackInfoReturnable<Boolean> cir) {
- if (cir.getReturnValue() || slot == 0) return;
- if (this.world != null &&
- !this.world.getRecipeManager().getFirstMatch(recipeType, new SimpleInventory(stack), this.world).isPresent())
- cir.setReturnValue(false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement