From 8c7cfa88e9dd5369a6a16db4c03ce6e98aec2253 Mon Sep 17 00:00:00 2001 From: fullwall Date: Thu, 2 Aug 2012 22:51:10 +0800 Subject: [PATCH] Fix player movement, block villager trading --- .../net/citizensnpcs/npc/entity/CitizensVillagerNPC.java | 8 ++++++++ .../java/net/citizensnpcs/npc/entity/EntityHumanNPC.java | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/citizensnpcs/npc/entity/CitizensVillagerNPC.java b/src/main/java/net/citizensnpcs/npc/entity/CitizensVillagerNPC.java index e7027b6e0..8c2a1ca97 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CitizensVillagerNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CitizensVillagerNPC.java @@ -6,6 +6,7 @@ import net.citizensnpcs.npc.CitizensMobNPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; +import net.minecraft.server.EntityHuman; import net.minecraft.server.EntityVillager; import net.minecraft.server.World; @@ -53,6 +54,13 @@ public class CitizensVillagerNPC extends CitizensMobNPC { Util.callCollisionEvent(npc, entity); } + @Override + public boolean c(EntityHuman entityhuman) { + if (npc == null) + return super.c(entityhuman); + return false; // block trades + } + @Override public void g(double x, double y, double z) { if (npc == null) { diff --git a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java index 6e9d6cff5..dc4419540 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java @@ -109,8 +109,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder { bE = 0; } - aX *= 0.98F; - a(aW, aX); + bs *= 0.98F; + e(br, bs); as = yaw; }