Skip to content

Commit

Permalink
Ajout de vérification ne pas tuer des PNJ
Browse files Browse the repository at this point in the history
  • Loading branch information
Euphillya committed Jan 29, 2024
1 parent 5463af8 commit 2b21d61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public enum PermissionsIsland implements Permissions {
USE_END_PORTAL(1_024),
INTERACT_ENTITIES(2_048),
KILL_UNKNOWN_ENTITY(4_096),
KILL_NPC(8_192),
;

private final long permissionValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import fr.euphyllia.skyllia.listeners.ListenersUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Player;
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -39,6 +37,8 @@ public void onPlayerDamageEntity(final EntityDamageByEntityEvent event) {
ListenersUtils.checkPermission(event.getEntity().getChunk(), damager, PermissionsIsland.KILL_MONSTER, event);
} else if (event.getEntity() instanceof Animals) {
ListenersUtils.checkPermission(event.getEntity().getChunk(), damager, PermissionsIsland.KILL_ANIMAL, event);
} else if (event.getEntity() instanceof NPC) {
ListenersUtils.checkPermission(event.getEntity().getChunk(), damager, PermissionsIsland.KILL_NPC, event);
} else {
ListenersUtils.checkPermission(event.getEntity().getChunk(), damager, PermissionsIsland.KILL_UNKNOWN_ENTITY, event);
}
Expand Down

0 comments on commit 2b21d61

Please sign in to comment.