Stop default AI for players mounted on pigs

This commit is contained in:
fullwall 2018-03-09 19:44:10 +08:00
parent 30ef5de8e0
commit 407430daa5
3 changed files with 13 additions and 2 deletions

View File

@ -13,7 +13,6 @@ import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.trait.Controllable;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityLightning;
@ -91,7 +90,7 @@ public class PigController extends MobEntityController {
if (npc == null) {
return super.cP();
}
return npc.hasTrait(Controllable.class) && npc.getTrait(Controllable.class).isEnabled();
return false;
}
@Override

View File

@ -85,6 +85,12 @@ public class PigController extends MobEntityController {
}
}
@Override
public boolean cR() {
// block carrot-on-a-stick behaviour
return npc == null ? super.cR() : false;
}
@Override
public boolean d(NBTTagCompound save) {
return npc == null ? super.d(save) : false;

View File

@ -90,6 +90,12 @@ public class PigController extends MobEntityController {
}
}
@Override
public boolean cV() {
// block carrot-on-a-stick behaviour
return npc == null ? super.cV() : false;
}
@Override
protected SoundEffect d(DamageSource damagesource) {
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);