Skip to content

Commit

Permalink
Stop default AI for players mounted on pigs
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Mar 9, 2018
1 parent 30ef5de commit 407430d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
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;
Expand Down Expand Up @@ -91,7 +90,7 @@ public boolean cP() {
if (npc == null) {
return super.cP();
}
return npc.hasTrait(Controllable.class) && npc.getTrait(Controllable.class).isEnabled();
return false;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public void collide(net.minecraft.server.v1_11_R1.Entity entity) {
}
}

@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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public void collide(net.minecraft.server.v1_12_R1.Entity entity) {
}
}

@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);
Expand Down

0 comments on commit 407430d

Please sign in to comment.