diff --git a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/VillagerController.java b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/VillagerController.java index e8b6c6351..33a69c32e 100644 --- a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/VillagerController.java +++ b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/VillagerController.java @@ -36,6 +36,7 @@ public class VillagerController extends MobEntityController { } public static class EntityVillagerNPC extends EntityVillager implements NPCHolder { + private boolean blockingATrade; private boolean blockTrades = true; private final CitizensNPC npc; @@ -71,7 +72,10 @@ public class VillagerController extends MobEntityController { @Override public boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) { - return npc == null || !blockTrades ? super.a(entityhuman) : false; // block trades + if (npc != null && blockTrades) { + blockingATrade = true; + } + return super.a(entityhuman, enumhand, itemstack); } @Override @@ -99,6 +103,15 @@ public class VillagerController extends MobEntityController { return npc == null ? super.d(save) : false; } + @Override + public boolean dh() { + if (blockingATrade) { + blockingATrade = false; + return true; + } + return super.dh(); + } + @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) {