Code improvements.

This commit is contained in:
MobiusDev
2016-04-24 16:30:15 +00:00
parent 8bd51aba1c
commit 2dd14bef9b
860 changed files with 8865 additions and 17041 deletions

View File

@@ -65,10 +65,9 @@ public class ChatsHandler implements ITelnetHandler
final String name = st.nextToken();
final String message = val.substring(name.length() + 1);
final L2PcInstance reciever = L2World.getInstance().getPlayer(name);
final CreatureSay cs = new CreatureSay(0, ChatType.WHISPER, "Telnet Priv", message);
if (reciever != null)
{
reciever.sendPacket(cs);
reciever.sendPacket(new CreatureSay(0, ChatType.WHISPER, "Telnet Priv", message));
_print.println("Telnet Priv->" + name + ": " + message);
_print.println("Message Sent!");
}

View File

@@ -306,13 +306,7 @@ public class DebugHandler implements ITelnetHandler
private long[] findDeadlockedThreads(ThreadMXBean mbean)
{
// JDK 1.5 only supports the findMonitorDeadlockedThreads()
// method, so you need to comment out the following three lines
if (mbean.isSynchronizerUsageSupported())
{
return mbean.findDeadlockedThreads();
}
return mbean.findMonitorDeadlockedThreads();
return mbean.isSynchronizerUsageSupported() ? mbean.findDeadlockedThreads() : mbean.findMonitorDeadlockedThreads();
}
private Thread findMatchingThread(ThreadInfo inf)
@@ -354,12 +348,9 @@ public class DebugHandler implements ITelnetHandler
{
continue;
}
if (obj instanceof L2Character)
if ((obj instanceof L2Character) && ((L2Character) obj).hasAI())
{
if (((L2Character) obj).hasAI())
{
AICount++;
}
AICount++;
}
if (obj instanceof L2ItemInstance)
{

View File

@@ -142,12 +142,9 @@ public class StatusHandler implements ITelnetHandler
{
continue;
}
if (obj instanceof L2Character)
if ((obj instanceof L2Character) && ((L2Character) obj).hasAI())
{
if (((L2Character) obj).hasAI())
{
AICount++;
}
AICount++;
}
if (obj instanceof L2ItemInstance)
{