Revert "ScriptLogIgnoreType & PlayerLogging"

This reverts commit ac39e0a6d0.
This commit is contained in:
KAMKEEL committed 2022-11-07 01:43:27 -05:00
1 parent 361d210d1a
commit fe4cc719d4
3 files changed
-64

No files matched your search

-37
View File
@@ -245,43 +245,6 @@ public class CustomNpcs {
if (ScriptIgnoreTime < 0)
ScriptIgnoreTime = 0;
try {
String[] ignoreTypes = ScriptLogIgnoreType.split(",");
for (String s : ignoreTypes) {
EnumScriptType type = EnumScriptType.valueOfIgnoreCase(s);
if(type != null){
switch (type){
case INIT:
InitIgnore = true;
case TICK:
TickIgnore = true;
case INTERACT:
InteractIgnore = true;
case DIALOG:
DialogIgnore = true;
case DAMAGED:
DamagedIgnore = true;
case KILLED:
KilledIgnore = true;
case ATTACK:
AttackIgnore = true;
case TARGET:
TargetIgnore = true;
case COLLIDE:
CollideIgnore = true;
case KILLS:
KillsIgnore = true;
case DIALOG_CLOSE:
DialogCloseIgnore = true;
case TIMER:
TimerIgnore = true;
default:
break;
}
}
}
} catch (Exception ignored) {}
EnchantInterface.load();
CustomItems.load();
@@ -196,9 +196,6 @@ public class PacketHandlerServer{
npc.script.readFromNBT(Server.readNBT(buffer));
npc.updateAI = true;
npc.script.hasInited = false;
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
LogWriter.script(String.format("[%s] %s SAVED NPC %s (%s, %s, %s) [%s]", "SCRIPTER", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)(npc).posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
}
}
else if(type == EnumPacketServer.ScriptDataGet){
NBTTagCompound compound = npc.script.writeToNBT(new NBTTagCompound());
@@ -371,9 +368,6 @@ public class PacketHandlerServer{
private void wandPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player, EntityNPCInterface npc) throws IOException{
if(type == EnumPacketServer.Delete){
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
LogWriter.script(String.format("[%s] %s DELETE NPC %s (%s, %s, %s) [%s]", "WAND", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)npc.posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
}
npc.delete();
NoppesUtilServer.deleteNpc(npc,player);
}
@@ -409,9 +403,6 @@ public class PacketHandlerServer{
npc.reset();
if(npc.linkedData != null)
LinkedNpcController.Instance.saveNpcData(npc);
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
LogWriter.script(String.format("[%s] %s CLOSE NPC %s (%s, %s, %s) [%s]", "WAND", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)npc.posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
}
NoppesUtilServer.setEditingNpc(player, null);
}
else if(type == EnumPacketServer.BanksGet){
@@ -438,18 +429,12 @@ public class PacketHandlerServer{
if(entity == null || !(entity instanceof EntityNPCInterface))
return;
NoppesUtilServer.sendOpenGui(player, EnumGuiType.MainMenuDisplay, (EntityNPCInterface) entity);
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
LogWriter.script(String.format("[%s] %s OPEN NPC %s (%s, %s, %s) [%s]", "WAND", player.getCommandSenderName(), ((EntityNPCInterface)entity).display.getName(), entity.posX, entity.posY, entity.posZ, entity.worldObj.getWorldInfo().getWorldName()));
}
}
else if(type == EnumPacketServer.RemoteDelete){
Entity entity = player.worldObj.getEntityByID(buffer.readInt());
if(entity == null || !(entity instanceof EntityNPCInterface))
return;
npc = (EntityNPCInterface) entity;
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
LogWriter.script(String.format("[%s] %s DELETE NPC %s (%s, %s, %s) [%s]", "WAND", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)npc.posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
}
npc.delete();
NoppesUtilServer.deleteNpc(npc,player);
NoppesUtilServer.sendNearbyNpcs(player);
@@ -877,9 +862,6 @@ public class PacketHandlerServer{
player.addChatMessage(new ChatComponentText("Failed to create an entity out of your clone"));
return;
}
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
LogWriter.script(String.format("[%s] %s SPAWNED ENTITY %s", "CLONER", player.getCommandSenderName(), entity));
}
}
else if(type == EnumPacketServer.MobSpawner){
boolean server = buffer.readBoolean();
@@ -83,9 +83,6 @@ public class ServerEventsHandler {
if(!isRemote && item.getItem() == CustomItems.soulstoneEmpty && event.target instanceof EntityLivingBase) {
((ItemSoulstoneEmpty)item.getItem()).store((EntityLivingBase)event.target, item, event.entityPlayer);
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
LogWriter.script(String.format("[%s] %s PICKED ENTITY %s", "SOULSTONE", event.entityPlayer.getCommandSenderName(), event.target));
}
}
if(item.getItem() == CustomItems.wand && npcInteracted && !isRemote){
@@ -94,9 +91,6 @@ public class ServerEventsHandler {
}
event.setCanceled(true);
NoppesUtilServer.sendOpenGui(event.entityPlayer, EnumGuiType.MainMenuDisplay, (EntityNPCInterface) event.target);
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
LogWriter.script(String.format("[%s] %s OPEN NPC %s (%s, %s, %s) [%s]", "WAND", event.entityPlayer.getCommandSenderName(), ((EntityNPCInterface)(event.target)).display.getName(), (int)(event.target).posX, (int)(event.target).posY, (int)(event.target).posZ, (event.target).worldObj.getWorldInfo().getWorldName()));
}
}
else if(item.getItem() == CustomItems.cloner && !isRemote && !(event.target instanceof EntityPlayer)){
NBTTagCompound compound = new NBTTagCompound();
@@ -115,9 +109,6 @@ public class ServerEventsHandler {
NoppesUtilServer.setEditingNpc(event.entityPlayer, (EntityNPCInterface)event.target);
event.setCanceled(true);
Server.sendData((EntityPlayerMP)event.entityPlayer, EnumPacketClient.GUI, EnumGuiType.Script.ordinal());
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
LogWriter.script(String.format("[%s] %s OPEN NPC %s (%s, %s, %s) [%s]", "SCRIPTER", event.entityPlayer.getCommandSenderName(), ((EntityNPCInterface)(event.target)).display.getName(), (int)(event.target).posX, (int)(event.target).posY, (int)(event.target).posZ, (event.target).worldObj.getWorldInfo().getWorldName()));
}
}
else if(item.getItem() == CustomItems.mount){
if(!CustomNpcsPermissions.Instance.hasPermission(event.entityPlayer, CustomNpcsPermissions.TOOL_MOUNTER))