mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Player Logs
This commit is contained in:
1 parent
bfb446b0de
commit
ead63d8e30
2 files changed
+27
No files matched your search
@@ -196,6 +196,9 @@ 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());
|
||||
@@ -368,6 +371,9 @@ 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);
|
||||
}
|
||||
@@ -403,6 +409,9 @@ 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){
|
||||
@@ -429,12 +438,18 @@ 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);
|
||||
@@ -862,6 +877,9 @@ 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();
|
||||
|
||||
Reference in new issue
Block a user