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:
Luis C.M. committed 2024-07-20 16:19:58 -05:00
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);
}