From 95c147c6a1455e062b175a90173a622fdc63a193 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 18 Sep 2020 18:30:17 +0100 Subject: [PATCH] Fix crash in prod --- .../fabric/mixin/object/builder/TypeAwareTradeMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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