Fix Villager trades not being blocked

This commit is contained in:
fullwall 2016-03-01 18:00:33 +08:00
parent 60a99643cc
commit b48940f1e4
4 changed files with 9 additions and 4 deletions

View File

@ -196,8 +196,9 @@ public class EndermanController extends MobEntityController {
@Override
public void M() {
super.M();
if (npc != null)
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -174,8 +174,9 @@ public class IronGolemController extends MobEntityController {
@Override
public void M() {
super.M();
if (npc != null)
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -187,8 +187,9 @@ public class PigController extends MobEntityController {
@Override
public void M() {
super.M();
if (npc != null)
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -18,7 +18,9 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_9_R1.BlockPosition;
import net.minecraft.server.v1_9_R1.EntityHuman;
import net.minecraft.server.v1_9_R1.EntityVillager;
import net.minecraft.server.v1_9_R1.EnumHand;
import net.minecraft.server.v1_9_R1.IBlockData;
import net.minecraft.server.v1_9_R1.ItemStack;
import net.minecraft.server.v1_9_R1.MinecraftKey;
import net.minecraft.server.v1_9_R1.NBTTagCompound;
import net.minecraft.server.v1_9_R1.SoundEffect;
@ -69,7 +71,7 @@ public class VillagerController extends MobEntityController {
}
@Override
public boolean a(EntityHuman entityhuman) {
public boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) {
return npc == null || !blockTrades ? super.a(entityhuman) : false; // block
// trades
}