Stop allay picking up loot if protected

This commit is contained in:
fullwall 2022-06-17 20:41:34 +08:00
parent a64ad43d11
commit 552d25494b
2 changed files with 7 additions and 1 deletions

View File

@ -61,6 +61,13 @@ public class AllayController extends MobEntityController {
}
}
@Override
public boolean canPickUpLoot() {
if (npc != null && npc.isProtected())
return false;
return super.canPickUpLoot();
}
@Override
protected boolean canRide(Entity entity) {
if (npc != null && (entity instanceof Boat || entity instanceof AbstractMinecart)) {

View File

@ -92,7 +92,6 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
ProfilePublicKey ppk, NPC npc) {
super(minecraftServer, world, gameProfile, ppk);
this.npc = (CitizensNPC) npc;
if (npc != null) {
skinTracker = new SkinPacketTracker(this);
try {