From 3702b019cdb9bfbb7b31643b94796a3abb8bd48b Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 11 Jun 2023 17:06:22 +0800 Subject: [PATCH] Make some create flags require admin --- main/src/main/java/net/citizensnpcs/commands/NPCCommands.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java index a2b6d7702..f27ad4131 100644 --- a/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -680,6 +680,10 @@ public class NPCCommands { if (!sender.hasPermission("citizens.npc.create.*") && !sender.hasPermission("citizens.npc.createall") && !sender.hasPermission("citizens.npc.create." + type.name().toLowerCase().replace("_", ""))) throw new NoPermissionsException(); + + if ((at != null || registryName != null || traits != null || templateName != null) + && !sender.hasPermission("citizens.npc.admin")) + throw new NoPermissionsException(); NPCRegistry registry = CitizensAPI.getNPCRegistry(); if (registryName != null) {