Code improvements.
This commit is contained in:
@@ -36,26 +36,16 @@ public class ChannelDelete implements IUserCommandHandler
|
||||
@Override
|
||||
public boolean useUserCommand(int id, L2PcInstance activeChar)
|
||||
{
|
||||
if (id != COMMAND_IDS[0])
|
||||
if ((id != COMMAND_IDS[0]) || !activeChar.isInParty() || !activeChar.getParty().isLeader(activeChar) || !activeChar.getParty().isInCommandChannel() || !activeChar.getParty().getCommandChannel().getLeader().equals(activeChar))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (activeChar.isInParty())
|
||||
{
|
||||
if (activeChar.getParty().isLeader(activeChar) && activeChar.getParty().isInCommandChannel() && activeChar.getParty().getCommandChannel().getLeader().equals(activeChar))
|
||||
{
|
||||
final L2CommandChannel channel = activeChar.getParty().getCommandChannel();
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_COMMAND_CHANNEL_HAS_BEEN_DISBANDED);
|
||||
channel.broadcastPacket(sm);
|
||||
|
||||
channel.disbandChannel();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
final L2CommandChannel channel = activeChar.getParty().getCommandChannel();
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_COMMAND_CHANNEL_HAS_BEEN_DISBANDED);
|
||||
channel.broadcastPacket(sm);
|
||||
channel.disbandChannel();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -35,12 +35,7 @@ public class ChannelInfo implements IUserCommandHandler
|
||||
@Override
|
||||
public boolean useUserCommand(int id, L2PcInstance activeChar)
|
||||
{
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((activeChar.getParty() == null) || (activeChar.getParty().getCommandChannel() == null))
|
||||
if ((id != COMMAND_IDS[0]) || (activeChar.getParty() == null) || (activeChar.getParty().getCommandChannel() == null))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -33,11 +33,7 @@ public class Mount implements IUserCommandHandler
|
||||
@Override
|
||||
public synchronized boolean useUserCommand(int id, L2PcInstance activeChar)
|
||||
{
|
||||
if (id != COMMAND_IDS[0])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return activeChar.mountPlayer(activeChar.getPet());
|
||||
return (id == COMMAND_IDS[0]) && activeChar.mountPlayer(activeChar.getPet());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -96,5 +96,4 @@ public class SiegeStatus implements IUserCommandHandler
|
||||
{
|
||||
return COMMAND_IDS;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -62,15 +62,13 @@ public class Time implements IUserCommandHandler
|
||||
if (GameTimeController.getInstance().isNight())
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_CURRENT_TIME_IS_S1_S22);
|
||||
sm.addString(h);
|
||||
sm.addString(m);
|
||||
}
|
||||
else
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_CURRENT_TIME_IS_S1_S2);
|
||||
sm.addString(h);
|
||||
sm.addString(m);
|
||||
}
|
||||
sm.addString(h);
|
||||
sm.addString(m);
|
||||
activeChar.sendPacket(sm);
|
||||
if (Config.L2JMOD_DISPLAY_SERVER_TIME)
|
||||
{
|
||||
|
@@ -45,13 +45,12 @@ public class Unstuck implements IUserCommandHandler
|
||||
@Override
|
||||
public boolean useUserCommand(int id, L2PcInstance activeChar)
|
||||
{
|
||||
// Thanks nbd
|
||||
if (!TvTEvent.onEscapeUse(activeChar.getObjectId()))
|
||||
{
|
||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
}
|
||||
else if (activeChar.isJailed())
|
||||
if (activeChar.isJailed())
|
||||
{
|
||||
activeChar.sendMessage("You cannot use this function while you are jailed.");
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user