Skip to content

Commit

Permalink
Stop allay picking up loot if protected
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jun 17, 2022
1 parent a64ad43 commit 552d254
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -61,6 +61,13 @@ public EntityAllayNPC(EntityType<? extends Allay> types, Level level, NPC npc) {
}
}

@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)) {
Expand Down
Expand Up @@ -92,7 +92,6 @@ public EntityHumanNPC(MinecraftServer minecraftServer, ServerLevel world, GamePr
ProfilePublicKey ppk, NPC npc) {
super(minecraftServer, world, gameProfile, ppk);
this.npc = (CitizensNPC) npc;

if (npc != null) {
skinTracker = new SkinPacketTracker(this);
try {
Expand Down

0 comments on commit 552d254

Please sign in to comment.