diff --git a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/TypeAwareTradeMixin.java b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/TypeAwareTradeMixin.java index 6c58e3d6a..16ae21f8c 100644 --- a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/TypeAwareTradeMixin.java +++ b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/TypeAwareTradeMixin.java @@ -47,7 +47,7 @@ public abstract class TypeAwareTradeMixin { /** * To prevent "item" -> "air" trades, if the result of a type aware trade is air, make sure no offer is created. */ - @Inject(method = "create", at = @At(value = "NEW", target = "net/minecraft/village/TradeOffer"), locals = LocalCapture.CAPTURE_FAILEXCEPTION, cancellable = true) + @Inject(method = "create(Lnet/minecraft/entity/Entity;Ljava/util/Random;)Lnet/minecraft/village/TradeOffer;", at = @At(value = "NEW", target = "net/minecraft/village/TradeOffer"), locals = LocalCapture.CAPTURE_FAILEXCEPTION, cancellable = true) private void failOnNullItem(Entity entity, Random random, CallbackInfoReturnable cir, ItemStack buyingItem) { if (buyingItem.isEmpty()) { // Will return true for an "empty" item stack that had null passed in the ctor cir.setReturnValue(null); // Return null to prevent creation of empty trades