mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 06:07:27 +00:00
Fixed non-scripter players being able to run scripts using the cloner, and fixed the way the ScriptOpsOnly config works.
This commit is contained in:
1 parent
f67e1ef808
commit
127769ec77
2 files changed
+17
-8
No files matched your search
@@ -1256,6 +1256,12 @@ public class PacketHandlerServer{
|
||||
player.addChatMessage(new ChatComponentText("Failed to create an entity out of your clone"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity instanceof EntityNPCInterface && !ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT)) {
|
||||
EntityNPCInterface npc = (EntityNPCInterface) entity;
|
||||
npc.script.setEnabled(false);
|
||||
}
|
||||
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s SPAWNED ENTITY %s", "CLONER", player.getCommandSenderName(), entity));
|
||||
}
|
||||
@@ -1270,6 +1276,11 @@ public class PacketHandlerServer{
|
||||
compound = ServerCloneController.Instance.getCloneData(player, Server.readString(buffer), buffer.readInt());
|
||||
else
|
||||
compound = Server.readNBT(buffer);
|
||||
|
||||
if (!ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(compound != null)
|
||||
NoppesUtilServer.createMobSpawner(x, y, z, compound, player);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user