Some code formatting.

This commit is contained in:
MobiusDev
2016-03-19 08:47:52 +00:00
parent 9a9a5dd414
commit 345b88ad95
106 changed files with 308 additions and 308 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ public abstract class AbstractNpcAI extends Quest
Broadcast.toKnownPlayersInRadius(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId), radius); Broadcast.toKnownPlayersInRadius(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId), radius);
} }
public void spawnMinions(final L2Npc npc, final String spawnName) public void spawnMinions(L2Npc npc, String spawnName)
{ {
for (MinionHolder is : npc.getTemplate().getParameters().getMinionList(spawnName)) for (MinionHolder is : npc.getTemplate().getParameters().getMinionList(spawnName))
{ {
@@ -148,7 +148,7 @@ final class CastleChamberlain extends AbstractNpcAI
return packet; return packet;
} }
private final String funcConfirmHtml(final L2PcInstance player, final L2Npc npc, final Castle castle, final int func, final int level) private final String funcConfirmHtml(L2PcInstance player, L2Npc npc, Castle castle, int func, int level)
{ {
if (isOwner(player, npc) && player.hasClanPrivilege(ClanPrivilege.CS_SET_FUNCTIONS)) if (isOwner(player, npc) && player.hasClanPrivilege(ClanPrivilege.CS_SET_FUNCTIONS))
{ {
@@ -177,7 +177,7 @@ final class CastleChamberlain extends AbstractNpcAI
return "chamberlain-21.html"; return "chamberlain-21.html";
} }
private final void funcReplace(final Castle castle, final NpcHtmlMessage html, final int func, final String str) private final void funcReplace(Castle castle, NpcHtmlMessage html, int func, String str)
{ {
final CastleFunction function = castle.getFunction(func); final CastleFunction function = castle.getFunction(func);
if (function == null) if (function == null)
@@ -199,7 +199,7 @@ final class CastleChamberlain extends AbstractNpcAI
} }
} }
private final int getFunctionFee(final int func, final int level) private final int getFunctionFee(int func, int level)
{ {
int fee = 0; int fee = 0;
switch (func) switch (func)
@@ -233,7 +233,7 @@ final class CastleChamberlain extends AbstractNpcAI
return fee; return fee;
} }
private final long getFunctionRatio(final int func) private final long getFunctionRatio(int func)
{ {
long ratio = 0; long ratio = 0;
switch (func) switch (func)
@@ -267,7 +267,7 @@ final class CastleChamberlain extends AbstractNpcAI
return ratio; return ratio;
} }
private final int getDoorUpgradePrice(final int type, final int level) private final int getDoorUpgradePrice(int type, int level)
{ {
int price = 0; int price = 0;
switch (type) switch (type)
@@ -342,7 +342,7 @@ final class CastleChamberlain extends AbstractNpcAI
return price; return price;
} }
private final int getTrapUpgradePrice(final int level) private final int getTrapUpgradePrice(int level)
{ {
int price = 0; int price = 0;
switch (level) switch (level)
@@ -371,7 +371,7 @@ final class CastleChamberlain extends AbstractNpcAI
return price; return price;
} }
private final boolean isDomainFortressInContractStatus(final int castleId) private final boolean isDomainFortressInContractStatus(int castleId)
{ {
final int numFort = ((castleId == 1) || (castleId == 5)) ? 2 : 1; final int numFort = ((castleId == 1) || (castleId == 5)) ? 2 : 1;
final List<Integer> fortList = FORTRESS.get(castleId); final List<Integer> fortList = FORTRESS.get(castleId);
@@ -386,7 +386,7 @@ final class CastleChamberlain extends AbstractNpcAI
return false; return false;
} }
private final boolean isOwner(final L2PcInstance player, final L2Npc npc) private final boolean isOwner(L2PcInstance player, L2Npc npc)
{ {
return player.canOverrideCond(PcCondOverride.CASTLE_CONDITIONS) || ((player.getClan() != null) && (player.getClanId() == npc.getCastle().getOwnerId())); return player.canOverrideCond(PcCondOverride.CASTLE_CONDITIONS) || ((player.getClan() != null) && (player.getClanId() == npc.getCastle().getOwnerId()));
} }
@@ -577,7 +577,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
} }
@Override @Override
public final Location getInnerSpawnLoc(final L2PcInstance player) public final Location getInnerSpawnLoc(L2PcInstance player)
{ {
Location loc = null; Location loc = null;
if (player.getClanId() == _hall.getOwnerId()) if (player.getClanId() == _hall.getOwnerId())
@@ -29,7 +29,7 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
public class L2StaticObjectInstanceAction implements IActionHandler public class L2StaticObjectInstanceAction implements IActionHandler
{ {
@Override @Override
public boolean action(final L2PcInstance activeChar, final L2Object target, final boolean interact) public boolean action(L2PcInstance activeChar, final L2Object target, final boolean interact)
{ {
final L2StaticObjectInstance staticObject = (L2StaticObjectInstance) target; final L2StaticObjectInstance staticObject = (L2StaticObjectInstance) target;
if (staticObject.getType() < 0) if (staticObject.getType() < 0)
@@ -393,7 +393,7 @@ public class NpcViewMod implements IBypassHandler
* @param sb * @param sb
* @param dropItem * @param dropItem
*/ */
private static void addGeneralDropItem(L2PcInstance activeChar, L2Npc npc, final DecimalFormat amountFormat, final DecimalFormat chanceFormat, final StringBuilder sb, final GeneralDropItem dropItem) private static void addGeneralDropItem(L2PcInstance activeChar, L2Npc npc, DecimalFormat amountFormat, DecimalFormat chanceFormat, StringBuilder sb, GeneralDropItem dropItem)
{ {
final L2Item item = ItemTable.getInstance().getTemplate(dropItem.getItemId()); final L2Item item = ItemTable.getInstance().getTemplate(dropItem.getItemId());
sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">"); sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");
@@ -155,7 +155,7 @@ public class Observation implements IBypassHandler
return false; return false;
} }
private static final void doObserve(final L2PcInstance player, final L2Npc npc, final Location pos, final long cost) private static final void doObserve(L2PcInstance player, L2Npc npc, Location pos, long cost)
{ {
if (player.reduceAdena("Broadcast", cost, npc, true)) if (player.reduceAdena("Broadcast", cost, npc, true))
{ {
@@ -256,7 +256,7 @@ public class QuestLink implements IBypassHandler
* @param player the L2PcInstance that talk with the {@code npc}. * @param player the L2PcInstance that talk with the {@code npc}.
* @param npc the L2NpcInstance that chats with the {@code player}. * @param npc the L2NpcInstance that chats with the {@code player}.
*/ */
private static void showQuestWindow(final L2PcInstance player, L2Npc npc) private static void showQuestWindow(L2PcInstance player, L2Npc npc)
{ {
//@formatter:off //@formatter:off
final Set<Quest> quests = npc.getListeners(EventType.ON_NPC_TALK).stream() final Set<Quest> quests = npc.getListeners(EventType.ON_NPC_TALK).stream()
@@ -228,7 +228,7 @@ public final class Fishing extends AbstractEffect
* @param waterZone the water zone * @param waterZone the water zone
* @return the bait z or {@link Integer#MIN_VALUE} when you cannot fish here * @return the bait z or {@link Integer#MIN_VALUE} when you cannot fish here
*/ */
private static int computeBaitZ(final L2PcInstance player, final int baitX, final int baitY, final L2FishingZone fishingZone, final L2WaterZone waterZone) private static int computeBaitZ(L2PcInstance player, int baitX, int baitY, L2FishingZone fishingZone, L2WaterZone waterZone)
{ {
if ((fishingZone == null)) if ((fishingZone == null))
{ {
@@ -67,7 +67,7 @@ public final class MarkRetriever extends AbstractEffect
double damage = Formulas.calcMagicDam(activeChar, effected, info.getSkill(), shld, sps, bss, mcrit); double damage = Formulas.calcMagicDam(activeChar, effected, info.getSkill(), shld, sps, bss, mcrit);
int count = 0; int count = 0;
List<BuffInfo> effects = effected.getEffectList().getEffects(); final List<BuffInfo> effects = effected.getEffectList().getEffects();
for (BuffInfo buff : effects) for (BuffInfo buff : effects)
{ {
if ((buff.getSkill().getId() == 11259) || (buff.getSkill().getId() == 11261) || (buff.getSkill().getId() == 11262)) if ((buff.getSkill().getId() == 11259) || (buff.getSkill().getId() == 11261) || (buff.getSkill().getId() == 11262))
@@ -63,7 +63,7 @@ public class EventItem implements IItemHandler
return used; return used;
} }
private final boolean useBlockCheckerItem(final L2PcInstance castor, L2ItemInstance item) private final boolean useBlockCheckerItem(L2PcInstance castor, L2ItemInstance item)
{ {
final int blockCheckerArena = castor.getBlockCheckerArena(); final int blockCheckerArena = castor.getBlockCheckerArena();
if (blockCheckerArena == -1) if (blockCheckerArena == -1)
@@ -120,7 +120,7 @@ public class AreaFriendly implements ITargetTypeHandler
if (target.isPlayable()) if (target.isPlayable())
{ {
L2PcInstance targetPlayer = target.getActingPlayer(); final L2PcInstance targetPlayer = target.getActingPlayer();
if (activeChar == targetPlayer) if (activeChar == targetPlayer)
{ {
@@ -523,7 +523,7 @@ abstract class Chamber extends AbstractInstance
} }
@Override @Override
public String onAttack(final L2Npc npc, final L2PcInstance attacker, final int damage, final boolean isPet, final Skill skill) public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet, Skill skill)
{ {
if (!npc.isBusy() && (npc.getCurrentHp() < (npc.getMaxHp() / 10))) if (!npc.isBusy() && (npc.getCurrentHp() < (npc.getMaxHp() / 10)))
{ {
@@ -119,7 +119,7 @@ public class Q00015_SweetWhispers extends Quest
} }
case M_NECROMANCER: case M_NECROMANCER:
{ {
int cond = qs.getCond(); final int cond = qs.getCond();
if (cond == 1) if (cond == 1)
{ {
htmltext = "31518-00.html"; htmltext = "31518-00.html";
@@ -54,7 +54,7 @@ public class Q00180_InfernalFlamesBurningInCrystalPrison extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
@@ -55,7 +55,7 @@ public class Q00181_DevilsStrikeBackAdventOfBalok extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
@@ -51,7 +51,7 @@ public class Q00471_BreakingThroughTheEmeraldSquare extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
@@ -51,7 +51,7 @@ public class Q00472_ChallengeSteamCorridor extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
@@ -51,7 +51,7 @@ public class Q00473_InTheCoralGarden extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
@@ -69,7 +69,7 @@ public class Q00755_InNeedOfPetras extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
@@ -50,7 +50,7 @@ public class Q00756_TopQualityPetra extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
switch (event) switch (event)
@@ -76,7 +76,7 @@ public class Q00943_FillingTheEnergyOfDestruction extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
@@ -142,7 +142,7 @@ public class Q10325_SearchingForNewPower extends Quest
} }
case State.STARTED: case State.STARTED:
{ {
int cond = qs.getCond(); final int cond = qs.getCond();
switch (npc.getId()) switch (npc.getId())
{ {
case GALLINT: case GALLINT:
@@ -270,11 +270,11 @@ public class Q10363_RequestOfTheSeeker extends Quest
else else
{ {
showOnScreenMsg(caster, NpcStringId.DON_T_TOY_WITH_THE_DEAD, ExShowScreenMessage.TOP_CENTER, 10000); showOnScreenMsg(caster, NpcStringId.DON_T_TOY_WITH_THE_DEAD, ExShowScreenMessage.TOP_CENTER, 10000);
L2Npc Spirit1 = addSpawn(RESURRECTED_VENGEFUL_SPIRIT1, new Location(caster.getX() - getRandom(100), caster.getY() - getRandom(100), caster.getZ(), 0)); final L2Npc Spirit1 = addSpawn(RESURRECTED_VENGEFUL_SPIRIT1, new Location(caster.getX() - getRandom(100), caster.getY() - getRandom(100), caster.getZ(), 0));
Spirit1.setCurrentHp(Spirit1.getMaxHp() / 2); Spirit1.setCurrentHp(Spirit1.getMaxHp() / 2);
addAttackDesire(Spirit1, caster); addAttackDesire(Spirit1, caster);
startQuestTimer("life_over", 20000, Spirit1, caster); startQuestTimer("life_over", 20000, Spirit1, caster);
L2Npc Spirit2 = addSpawn(RESURRECTED_VENGEFUL_SPIRIT2, new Location(caster.getX() - getRandom(100), caster.getY() - getRandom(100), caster.getZ(), 0)); final L2Npc Spirit2 = addSpawn(RESURRECTED_VENGEFUL_SPIRIT2, new Location(caster.getX() - getRandom(100), caster.getY() - getRandom(100), caster.getZ(), 0));
Spirit2.setCurrentHp(Spirit2.getMaxHp() / 2); Spirit2.setCurrentHp(Spirit2.getMaxHp() / 2);
addAttackDesire(Spirit2, caster); addAttackDesire(Spirit2, caster);
startQuestTimer("life_over", 20000, Spirit2, caster); startQuestTimer("life_over", 20000, Spirit2, caster);
@@ -48,7 +48,7 @@ public class Q10381_ToTheSeedOfHellfire extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
@@ -51,7 +51,7 @@ public class Q10382_DayOfLiberation extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
@@ -63,7 +63,7 @@ public class Q10383_FergasonsOffer extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
@@ -55,7 +55,7 @@ public class Q10384_AnAudienceWithTauti extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
@@ -47,7 +47,7 @@ public class Q10386_MysteriousJourney extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
@@ -45,7 +45,7 @@ public class Q10388_ConspiracyBehindDoor extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
@@ -48,7 +48,7 @@ public class Q10453_StoppingTheWindDragon extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; final String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
+2 -2
View File
@@ -3004,7 +3004,7 @@ public final class Config
* Loads flood protector configurations. * Loads flood protector configurations.
* @param properties the properties object containing the actual values of the flood protector configs * @param properties the properties object containing the actual values of the flood protector configs
*/ */
private static void loadFloodProtectorConfigs(final PropertiesParser properties) private static void loadFloodProtectorConfigs(PropertiesParser properties)
{ {
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", 4); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", 4);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", 42); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", 42);
@@ -3031,7 +3031,7 @@ public final class Config
* @param configString flood protector configuration string that determines for which flood protector configuration should be read * @param configString flood protector configuration string that determines for which flood protector configuration should be read
* @param defaultInterval default flood protector interval * @param defaultInterval default flood protector interval
*/ */
private static void loadFloodProtectorConfig(final PropertiesParser properties, final FloodProtectorConfig config, final String configString, final int defaultInterval) private static void loadFloodProtectorConfig(PropertiesParser properties, FloodProtectorConfig config, String configString, int defaultInterval)
{ {
config.FLOOD_PROTECTION_INTERVAL = properties.getInt(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval); config.FLOOD_PROTECTION_INTERVAL = properties.getInt(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval);
config.LOG_FLOODING = properties.getBoolean(StringUtil.concat("FloodProtector", configString, "LogFlooding"), false); config.LOG_FLOODING = properties.getBoolean(StringUtil.concat("FloodProtector", configString, "LogFlooding"), false);
@@ -22,5 +22,5 @@ package com.l2jmobius.commons.mmocore;
*/ */
public interface IClientFactory<T extends MMOClient<?>> public interface IClientFactory<T extends MMOClient<?>>
{ {
public T create(final MMOConnection<T> con); public T create(MMOConnection<T> con);
} }
@@ -26,7 +26,7 @@ public abstract class MMOClient<T extends MMOConnection<?>>
{ {
private final T _con; private final T _con;
public MMOClient(final T con) public MMOClient(T con)
{ {
_con = con; _con = con;
} }
@@ -36,9 +36,9 @@ public abstract class MMOClient<T extends MMOConnection<?>>
return _con; return _con;
} }
public abstract boolean decrypt(final ByteBuffer buf, final int size); public abstract boolean decrypt(ByteBuffer buf, int size);
public abstract boolean encrypt(final ByteBuffer buf, final int size); public abstract boolean encrypt(ByteBuffer buf, int size);
protected abstract void onDisconnection(); protected abstract void onDisconnection();
@@ -58,7 +58,7 @@ public class MMOConnection<T extends MMOClient<?>>
private T _client; private T _client;
public MMOConnection(final SelectorThread<T> selectorThread, final Socket socket, final SelectionKey key, boolean tcpNoDelay) public MMOConnection(SelectorThread<T> selectorThread, Socket socket, SelectionKey key, boolean tcpNoDelay)
{ {
_selectorThread = selectorThread; _selectorThread = selectorThread;
_socket = socket; _socket = socket;
@@ -80,7 +80,7 @@ public class MMOConnection<T extends MMOClient<?>>
} }
} }
final void setClient(final T client) final void setClient(T client)
{ {
_client = client; _client = client;
} }
@@ -90,7 +90,7 @@ public class MMOConnection<T extends MMOClient<?>>
return _client; return _client;
} }
public final void sendPacket(final SendablePacket<T> sp) public final void sendPacket(SendablePacket<T> sp)
{ {
sp._client = _client; sp._client = _client;
@@ -137,17 +137,17 @@ public class MMOConnection<T extends MMOClient<?>>
_socket.close(); _socket.close();
} }
final int read(final ByteBuffer buf) throws IOException final int read(ByteBuffer buf) throws IOException
{ {
return _readableByteChannel.read(buf); return _readableByteChannel.read(buf);
} }
final int write(final ByteBuffer buf) throws IOException final int write(ByteBuffer buf) throws IOException
{ {
return _writableByteChannel.write(buf); return _writableByteChannel.write(buf);
} }
final void createWriteBuffer(final ByteBuffer buf) final void createWriteBuffer(ByteBuffer buf)
{ {
if (_primaryWriteBuffer == null) if (_primaryWriteBuffer == null)
{ {
@@ -186,7 +186,7 @@ public class MMOConnection<T extends MMOClient<?>>
return _primaryWriteBuffer != null; return _primaryWriteBuffer != null;
} }
final void movePendingWriteBufferTo(final ByteBuffer dest) final void movePendingWriteBufferTo(ByteBuffer dest)
{ {
_primaryWriteBuffer.flip(); _primaryWriteBuffer.flip();
dest.put(_primaryWriteBuffer); dest.put(_primaryWriteBuffer);
@@ -195,7 +195,7 @@ public class MMOConnection<T extends MMOClient<?>>
_secondaryWriteBuffer = null; _secondaryWriteBuffer = null;
} }
final void setReadBuffer(final ByteBuffer buf) final void setReadBuffer(ByteBuffer buf)
{ {
_readBuffer = buf; _readBuffer = buf;
} }
@@ -220,7 +220,7 @@ public class MMOConnection<T extends MMOClient<?>>
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public final void close(final SendablePacket<T> sp) public final void close(SendablePacket<T> sp)
{ {
close(new SendablePacket[] close(new SendablePacket[]
{ {
@@ -228,7 +228,7 @@ public class MMOConnection<T extends MMOClient<?>>
}); });
} }
public final void close(final SendablePacket<T>[] closeList) public final void close(SendablePacket<T>[] closeList)
{ {
if (_pendingClose) if (_pendingClose)
{ {
@@ -33,7 +33,7 @@ public final class NioNetStackList<E>
clear(); clear();
} }
public final void addLast(final E elem) public final void addLast(E elem)
{ {
final NioNetStackNode newEndNode = _buf.removeFirst(); final NioNetStackNode newEndNode = _buf.removeFirst();
_end._value = elem; _end._value = elem;
@@ -78,7 +78,7 @@ public final class NioNetStackList<E>
_start._next = _end; _start._next = _end;
} }
final void addLast(final NioNetStackNode node) final void addLast(NioNetStackNode node)
{ {
node._next = null; node._next = null;
node._value = null; node._value = null;
@@ -29,7 +29,7 @@ public final class NioNetStringBuffer
private int _len; private int _len;
public NioNetStringBuffer(final int size) public NioNetStringBuffer(int size)
{ {
_buf = new char[size]; _buf = new char[size];
_size = size; _size = size;
@@ -41,7 +41,7 @@ public final class NioNetStringBuffer
_len = 0; _len = 0;
} }
public final void append(final char c) public final void append(char c)
{ {
if (_len < _size) if (_len < _size)
{ {
@@ -40,7 +40,7 @@ public abstract class ReceivablePacket<T extends MMOClient<?>>extends AbstractPa
* Reads as many bytes as the length of the array. * Reads as many bytes as the length of the array.
* @param dst : the byte array which will be filled with the data. * @param dst : the byte array which will be filled with the data.
*/ */
protected final void readB(final byte[] dst) protected final void readB(byte[] dst)
{ {
_buf.get(dst); _buf.get(dst);
} }
@@ -52,7 +52,7 @@ public abstract class ReceivablePacket<T extends MMOClient<?>>extends AbstractPa
* @param offset : starts to fill the byte array from the given offset. * @param offset : starts to fill the byte array from the given offset.
* @param len : the given length of bytes to be read. * @param len : the given length of bytes to be read.
*/ */
protected final void readB(final byte[] dst, final int offset, final int len) protected final void readB(byte[] dst, int offset, int len)
{ {
_buf.get(dst, offset, len); _buf.get(dst, offset, len);
} }
@@ -67,7 +67,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
private boolean _shutdown; private boolean _shutdown;
public SelectorThread(final SelectorConfig sc, final IMMOExecutor<T> executor, final IPacketHandler<T> packetHandler, final IClientFactory<T> clientFactory, final IAcceptFilter acceptFilter) throws IOException public SelectorThread(SelectorConfig sc, IMMOExecutor<T> executor, IPacketHandler<T> packetHandler, IClientFactory<T> clientFactory, IAcceptFilter acceptFilter) throws IOException
{ {
super.setName("SelectorThread-" + super.getId()); super.setName("SelectorThread-" + super.getId());
@@ -234,7 +234,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
closeSelectorThread(); closeSelectorThread();
} }
private final void finishConnection(final SelectionKey key, final MMOConnection<T> con) private final void finishConnection(SelectionKey key, MMOConnection<T> con)
{ {
try try
{ {
@@ -254,7 +254,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
} }
} }
private final void acceptConnection(final SelectionKey key, MMOConnection<T> con) private final void acceptConnection(SelectionKey key, MMOConnection<T> con)
{ {
final ServerSocketChannel ssc = (ServerSocketChannel) key.channel(); final ServerSocketChannel ssc = (ServerSocketChannel) key.channel();
SocketChannel sc; SocketChannel sc;
@@ -283,7 +283,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
} }
} }
private final void readPacket(final SelectionKey key, final MMOConnection<T> con) private final void readPacket(SelectionKey key, MMOConnection<T> con)
{ {
if (!con.isClosed()) if (!con.isClosed())
{ {
@@ -363,7 +363,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
} }
} }
private final boolean tryReadPacket(final SelectionKey key, final T client, final ByteBuffer buf, final MMOConnection<T> con) private final boolean tryReadPacket(SelectionKey key, T client, ByteBuffer buf, MMOConnection<T> con)
{ {
switch (buf.remaining()) switch (buf.remaining())
{ {
@@ -445,13 +445,13 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
} }
} }
private final void allocateReadBuffer(final MMOConnection<T> con) private final void allocateReadBuffer(MMOConnection<T> con)
{ {
con.setReadBuffer(getPooledBuffer().put(READ_BUFFER)); con.setReadBuffer(getPooledBuffer().put(READ_BUFFER));
READ_BUFFER.clear(); READ_BUFFER.clear();
} }
private final void parseClientPacket(final int pos, final ByteBuffer buf, final int dataSize, final T client) private final void parseClientPacket(int pos, ByteBuffer buf, int dataSize, T client)
{ {
final boolean ret = client.decrypt(buf, dataSize); final boolean ret = client.decrypt(buf, dataSize);
@@ -480,7 +480,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
} }
} }
private final void writeClosePacket(final MMOConnection<T> con) private final void writeClosePacket(MMOConnection<T> con)
{ {
SendablePacket<T> sp; SendablePacket<T> sp;
synchronized (con.getSendQueue()) synchronized (con.getSendQueue())
@@ -510,7 +510,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
} }
} }
protected final void writePacket(final SelectionKey key, final MMOConnection<T> con) protected final void writePacket(SelectionKey key, MMOConnection<T> con)
{ {
if (!prepareWriteBuffer(con)) if (!prepareWriteBuffer(con))
{ {
@@ -561,7 +561,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
} }
} }
private final boolean prepareWriteBuffer(final MMOConnection<T> con) private final boolean prepareWriteBuffer(MMOConnection<T> con)
{ {
boolean hasPending = false; boolean hasPending = false;
DIRECT_WRITE_BUFFER.clear(); DIRECT_WRITE_BUFFER.clear();
@@ -619,7 +619,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
return hasPending; return hasPending;
} }
private final void putPacketIntoWriteBuffer(final T client, final SendablePacket<T> sp) private final void putPacketIntoWriteBuffer(T client, SendablePacket<T> sp)
{ {
WRITE_BUFFER.clear(); WRITE_BUFFER.clear();
@@ -651,7 +651,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
WRITE_BUFFER.position(dataPos + dataSize); WRITE_BUFFER.position(dataPos + dataSize);
} }
final void closeConnection(final MMOConnection<T> con) final void closeConnection(MMOConnection<T> con)
{ {
synchronized (_pendingClose) synchronized (_pendingClose)
{ {
@@ -659,7 +659,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
} }
} }
private final void closeConnectionImpl(final SelectionKey key, final MMOConnection<T> con) private final void closeConnectionImpl(SelectionKey key, MMOConnection<T> con)
{ {
try try
{ {
@@ -22,17 +22,17 @@ package com.l2jmobius.commons.mmocore;
*/ */
public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPacket<T> public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPacket<T>
{ {
protected final void putInt(final int value) protected final void putInt(int value)
{ {
_buf.putInt(value); _buf.putInt(value);
} }
protected final void putDouble(final double value) protected final void putDouble(double value)
{ {
_buf.putDouble(value); _buf.putDouble(value);
} }
protected final void putFloat(final float value) protected final void putFloat(float value)
{ {
_buf.putFloat(value); _buf.putFloat(value);
} }
@@ -42,7 +42,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 8bit integer (00) * 8bit integer (00)
* @param data * @param data
*/ */
protected final void writeC(final boolean data) protected final void writeC(boolean data)
{ {
_buf.put((byte) (data ? 0x01 : 0x00)); _buf.put((byte) (data ? 0x01 : 0x00));
} }
@@ -52,7 +52,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 8bit integer (00) * 8bit integer (00)
* @param data * @param data
*/ */
protected final void writeC(final int data) protected final void writeC(int data)
{ {
_buf.put((byte) data); _buf.put((byte) data);
} }
@@ -62,7 +62,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 64bit double precision float (00 00 00 00 00 00 00 00) * 64bit double precision float (00 00 00 00 00 00 00 00)
* @param value * @param value
*/ */
protected final void writeF(final double value) protected final void writeF(double value)
{ {
_buf.putDouble(value); _buf.putDouble(value);
} }
@@ -72,7 +72,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 16bit integer (00 00) * 16bit integer (00 00)
* @param value * @param value
*/ */
protected final void writeH(final int value) protected final void writeH(int value)
{ {
_buf.putShort((short) value); _buf.putShort((short) value);
} }
@@ -82,7 +82,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 32bit integer (00 00 00 00) * 32bit integer (00 00 00 00)
* @param value * @param value
*/ */
protected final void writeD(final int value) protected final void writeD(int value)
{ {
_buf.putInt(value); _buf.putInt(value);
} }
@@ -92,7 +92,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 32bit integer (00 00 00 00) * 32bit integer (00 00 00 00)
* @param value * @param value
*/ */
protected final void writeD(final boolean value) protected final void writeD(boolean value)
{ {
_buf.putInt(value ? 0x01 : 0x00); _buf.putInt(value ? 0x01 : 0x00);
} }
@@ -102,7 +102,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 64bit integer (00 00 00 00 00 00 00 00) * 64bit integer (00 00 00 00 00 00 00 00)
* @param value * @param value
*/ */
protected final void writeQ(final long value) protected final void writeQ(long value)
{ {
_buf.putLong(value); _buf.putLong(value);
} }
@@ -112,7 +112,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 8bit integer array (00 ...) * 8bit integer array (00 ...)
* @param data * @param data
*/ */
protected final void writeB(final byte[] data) protected final void writeB(byte[] data)
{ {
_buf.put(data); _buf.put(data);
} }
@@ -121,7 +121,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* Write <B>String</B> to the buffer. * Write <B>String</B> to the buffer.
* @param text * @param text
*/ */
protected final void writeS(final String text) protected final void writeS(String text)
{ {
if (text != null) if (text != null)
{ {
@@ -101,7 +101,7 @@ public final class GameTimeController extends Thread
* Add a L2Character to movingObjects of GameTimeController. * Add a L2Character to movingObjects of GameTimeController.
* @param cha The L2Character to add to movingObjects of GameTimeController * @param cha The L2Character to add to movingObjects of GameTimeController
*/ */
public final void registerMovingObject(final L2Character cha) public final void registerMovingObject(L2Character cha)
{ {
if (cha == null) if (cha == null)
{ {
@@ -74,7 +74,7 @@ public class ThreadPoolManager
{ {
private final Runnable _r; private final Runnable _r;
public RunnableWrapper(final Runnable r) public RunnableWrapper(Runnable r)
{ {
_r = r; _r = r;
} }
@@ -352,7 +352,7 @@ public class ClanTable
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanDestroy(leaderMember, clan)); EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanDestroy(leaderMember, clan));
} }
public void scheduleRemoveClan(final int clanId) public void scheduleRemoveClan(int clanId)
{ {
ThreadPoolManager.getInstance().scheduleGeneral(() -> ThreadPoolManager.getInstance().scheduleGeneral(() ->
{ {
@@ -69,7 +69,7 @@ public final class PlayerXpPercentLostData implements IXmlReader
} }
} }
public double getXpPercent(final int level) public double getXpPercent(int level)
{ {
if (level > _maxlevel) if (level > _maxlevel)
{ {
@@ -338,7 +338,7 @@ public final class BotReportTable
* @param bot (L2PcInstance to be punished) * @param bot (L2PcInstance to be punished)
* @param rcd (RepotedCharData linked to this bot) * @param rcd (RepotedCharData linked to this bot)
*/ */
private void handleReport(L2PcInstance bot, final ReportedCharData rcd) private void handleReport(L2PcInstance bot, ReportedCharData rcd)
{ {
// Report count punishment // Report count punishment
punishBot(bot, _punishments.get(rcd.getReportCount())); punishBot(bot, _punishments.get(rcd.getReportCount()));
@@ -596,7 +596,7 @@ public final class BotReportTable
final Skill _punish; final Skill _punish;
final int _systemMessageId; final int _systemMessageId;
PunishHolder(final Skill sk, final int sysMsg) PunishHolder(Skill sk, int sysMsg)
{ {
_punish = sk; _punish = sk;
_systemMessageId = sysMsg; _systemMessageId = sysMsg;
@@ -197,7 +197,7 @@ public class MerchantPriceConfigTable implements InstanceListManager
private Castle _castle; private Castle _castle;
private final int _zoneId; private final int _zoneId;
public MerchantPriceConfig(final int id, final String name, final int baseTax, final int castleId, final int zoneId) public MerchantPriceConfig(int id, String name, int baseTax, int castleId, int zoneId)
{ {
_id = id; _id = id;
_name = name; _name = name;
@@ -90,7 +90,7 @@ public class DocumentEngine
return doc.getSkills(); return doc.getSkills();
} }
public void loadAllSkills(final Map<Integer, Skill> allSkills) public void loadAllSkills(Map<Integer, Skill> allSkills)
{ {
int count = 0; int count = 0;
for (File file : _skillFiles) for (File file : _skillFiles)
@@ -124,7 +124,7 @@ public final class ItemAuctionManager
} }
} }
public final ItemAuctionInstance getManagerInstance(final int instanceId) public final ItemAuctionInstance getManagerInstance(int instanceId)
{ {
return _managerInstances.get(instanceId); return _managerInstances.get(instanceId);
} }
@@ -134,7 +134,7 @@ public final class ItemAuctionManager
return _auctionIds.getAndIncrement(); return _auctionIds.getAndIncrement();
} }
public static final void deleteAuction(final int auctionId) public static final void deleteAuction(int auctionId)
{ {
try (Connection con = DatabaseFactory.getInstance().getConnection()) try (Connection con = DatabaseFactory.getInstance().getConnection())
{ {
@@ -30,7 +30,7 @@ public final class PcCafePointsManager
{ {
} }
public void givePcCafePoint(final L2PcInstance player, final long exp) public void givePcCafePoint(L2PcInstance player, long exp)
{ {
if (!Config.PC_BANG_ENABLED) if (!Config.PC_BANG_ENABLED)
{ {
@@ -254,7 +254,7 @@ public final class WalkingManager implements IXmlReader
* @param npc NPC to move * @param npc NPC to move
* @param routeName name of route to move by * @param routeName name of route to move by
*/ */
public void startMoving(final L2Npc npc, final String routeName) public void startMoving(L2Npc npc, String routeName)
{ {
if (_routes.containsKey(routeName) && (npc != null) && !npc.isDead()) // check, if these route and NPC present if (_routes.containsKey(routeName) && (npc != null) && !npc.isDead()) // check, if these route and NPC present
{ {
@@ -355,7 +355,7 @@ public final class WalkingManager implements IXmlReader
* Resumes previously stopped moving * Resumes previously stopped moving
* @param npc NPC to resume * @param npc NPC to resume
*/ */
public void resumeMoving(final L2Npc npc) public void resumeMoving(L2Npc npc)
{ {
final WalkInfo walk = _activeRoutes.get(npc.getObjectId()); final WalkInfo walk = _activeRoutes.get(npc.getObjectId());
if (walk != null) if (walk != null)
@@ -414,7 +414,7 @@ public final class WalkingManager implements IXmlReader
* Manage "node arriving"-related tasks: schedule move to next node; send ON_NODE_ARRIVED event to Quest script * Manage "node arriving"-related tasks: schedule move to next node; send ON_NODE_ARRIVED event to Quest script
* @param npc NPC to manage * @param npc NPC to manage
*/ */
public void onArrived(final L2Npc npc) public void onArrived(L2Npc npc)
{ {
if (_activeRoutes.containsKey(npc.getObjectId())) if (_activeRoutes.containsKey(npc.getObjectId()))
{ {
@@ -114,7 +114,7 @@ public abstract class AbstractPlayerGroup
* Broadcast a packet to every member of this group. * Broadcast a packet to every member of this group.
* @param packet the packet to broadcast * @param packet the packet to broadcast
*/ */
public void broadcastPacket(final L2GameServerPacket packet) public void broadcastPacket(L2GameServerPacket packet)
{ {
forEachMember(m -> forEachMember(m ->
{ {
@@ -144,7 +144,7 @@ public abstract class AbstractPlayerGroup
broadcastPacket(SystemMessage.sendString(text)); broadcastPacket(SystemMessage.sendString(text));
} }
public void broadcastCreatureSay(final CreatureSay msg, final L2PcInstance broadcaster) public void broadcastCreatureSay(CreatureSay msg, L2PcInstance broadcaster)
{ {
forEachMember(m -> forEachMember(m ->
{ {
@@ -25,7 +25,7 @@ public class ClanInfo
private final int _total; private final int _total;
private final int _online; private final int _online;
public ClanInfo(final L2Clan clan) public ClanInfo(L2Clan clan)
{ {
_clan = clan; _clan = clan;
_total = clan.getMembersCount(); _total = clan.getMembersCount();
@@ -122,7 +122,7 @@ public final class L2WorldRegion
return false; return false;
} }
public boolean checkEffectRangeInsidePeaceZone(Skill skill, final int x, final int y, final int z) public boolean checkEffectRangeInsidePeaceZone(Skill skill, int x, int y, int z)
{ {
final int range = skill.getEffectRange(); final int range = skill.getEffectRange();
final int up = y + range; final int up = y + range;
@@ -926,7 +926,7 @@ public class L2Attackable extends L2Npc
* @param target The L2Character whose hate level must be returned * @param target The L2Character whose hate level must be returned
* @return the hate level of the L2Attackable against this L2Character contained in _aggroList. * @return the hate level of the L2Attackable against this L2Character contained in _aggroList.
*/ */
public int getHating(final L2Character target) public int getHating(L2Character target)
{ {
if (_aggroList.isEmpty() || (target == null)) if (_aggroList.isEmpty() || (target == null))
{ {
@@ -462,7 +462,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* @param zone * @param zone
* @param state * @param state
*/ */
public final void setInsideZone(ZoneId zone, final boolean state) public final void setInsideZone(ZoneId zone, boolean state)
{ {
synchronized (_zones) synchronized (_zones)
{ {
@@ -5309,7 +5309,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* @param weapon * @param weapon
* @return the Reuse Time of Attack (used for bow delay) * @return the Reuse Time of Attack (used for bow delay)
*/ */
public int calculateReuseTime(final L2Weapon weapon) public int calculateReuseTime(L2Weapon weapon)
{ {
if (isTransformed()) if (isTransformed())
{ {
@@ -6655,7 +6655,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return; return;
} }
L2Object target = getTarget(); final L2Object target = getTarget();
if ((target != null) && target.isNpc()) if ((target != null) && target.isNpc())
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnNpcSocialActionSee((L2Npc) target, getActingPlayer(), id), (L2Npc) target); EventDispatcher.getInstance().notifyEventAsync(new OnNpcSocialActionSee((L2Npc) target, getActingPlayer(), id), (L2Npc) target);
@@ -6896,7 +6896,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* @param target * @param target
* @param isDot * @param isDot
*/ */
public void notifyAttackAvoid(final L2Character target, final boolean isDot) public void notifyAttackAvoid(L2Character target, boolean isDot)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureAttackAvoid(this, target, isDot), target); EventDispatcher.getInstance().notifyEventAsync(new OnCreatureAttackAvoid(this, target, isDot), target);
} }
@@ -1549,7 +1549,7 @@ public class L2Npc extends L2Character
* @param paramName the parameter name to check * @param paramName the parameter name to check
* @return given AI parameter value * @return given AI parameter value
*/ */
public int getAIValue(final String paramName) public int getAIValue(String paramName)
{ {
return hasAIValue(paramName) ? NpcPersonalAIData.getInstance().getAIValue(getSpawn().getName(), paramName) : -1; return hasAIValue(paramName) ? NpcPersonalAIData.getInstance().getAIValue(getSpawn().getName(), paramName) : -1;
} }
@@ -1558,7 +1558,7 @@ public class L2Npc extends L2Character
* @param paramName the parameter name to check * @param paramName the parameter name to check
* @return {@code true} if given parameter is set for NPC, {@code false} otherwise * @return {@code true} if given parameter is set for NPC, {@code false} otherwise
*/ */
public boolean hasAIValue(final String paramName) public boolean hasAIValue(String paramName)
{ {
return (getSpawn() != null) && (getSpawn().getName() != null) && NpcPersonalAIData.getInstance().hasAIValue(getSpawn().getName(), paramName); return (getSpawn() != null) && (getSpawn().getName() != null) && NpcPersonalAIData.getInstance().hasAIValue(getSpawn().getName(), paramName);
} }
@@ -4370,7 +4370,7 @@ public final class L2PcInstance extends L2Playable
public final void broadcastPacket(SocialAction sa) public final void broadcastPacket(SocialAction sa)
{ {
L2Object target = getTarget(); final L2Object target = getTarget();
if ((target != null) && target.isNpc()) if ((target != null) && target.isNpc())
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnNpcSocialActionSee((L2Npc) target, getActingPlayer(), sa.getId()), (L2Npc) target); EventDispatcher.getInstance().notifyEventAsync(new OnNpcSocialActionSee((L2Npc) target, getActingPlayer(), sa.getId()), (L2Npc) target);
@@ -14410,7 +14410,7 @@ public final class L2PcInstance extends L2Playable
return _pcBangPoints; return _pcBangPoints;
} }
public void setPcBangPoints(final int count) public void setPcBangPoints(int count)
{ {
if (count < 200000) if (count < 200000)
{ {
@@ -23,13 +23,13 @@ import java.util.ArrayList;
*/ */
public abstract class Builder public abstract class Builder
{ {
public abstract String toString(final Object param); public abstract String toString(Object param);
public abstract String toString(final Object... params); public abstract String toString(Object... params);
public abstract int getIndex(); public abstract int getIndex();
public static final Builder newBuilder(final String text) public static final Builder newBuilder(String text)
{ {
final ArrayList<Builder> builders = new ArrayList<>(); final ArrayList<Builder> builders = new ArrayList<>();
@@ -23,13 +23,13 @@ final class BuilderContainer extends Builder
{ {
private final Builder[] _builders; private final Builder[] _builders;
BuilderContainer(final Builder[] builders) BuilderContainer(Builder[] builders)
{ {
_builders = builders; _builders = builders;
} }
@Override @Override
public final String toString(final Object param) public final String toString(Object param)
{ {
return toString(new Object[] return toString(new Object[]
{ {
@@ -38,7 +38,7 @@ final class BuilderContainer extends Builder
} }
@Override @Override
public final String toString(final Object... params) public final String toString(Object... params)
{ {
final int buildersLength = _builders.length; final int buildersLength = _builders.length;
final int paramsLength = params.length; final int paramsLength = params.length;
@@ -23,7 +23,7 @@ final class BuilderObject extends Builder
{ {
private final int _index; private final int _index;
BuilderObject(final int id) BuilderObject(int id)
{ {
if ((id < 1) || (id > 9)) if ((id < 1) || (id > 9))
{ {
@@ -33,13 +33,13 @@ final class BuilderObject extends Builder
} }
@Override @Override
public final String toString(final Object param) public final String toString(Object param)
{ {
return param == null ? "null" : param.toString(); return param == null ? "null" : param.toString();
} }
@Override @Override
public final String toString(final Object... params) public final String toString(Object... params)
{ {
if ((params == null) || (params.length == 0)) if ((params == null) || (params.length == 0))
{ {
@@ -23,19 +23,19 @@ final class BuilderText extends Builder
{ {
private final String _text; private final String _text;
BuilderText(final String text) BuilderText(String text)
{ {
_text = text; _text = text;
} }
@Override @Override
public final String toString(final Object param) public final String toString(Object param)
{ {
return toString(); return toString();
} }
@Override @Override
public final String toString(final Object... params) public final String toString(Object... params)
{ {
return toString(); return toString();
} }
@@ -24,12 +24,12 @@ final class FastStringBuilder
private final char[] _array; private final char[] _array;
private int _len; private int _len;
public FastStringBuilder(final int capacity) public FastStringBuilder(int capacity)
{ {
_array = new char[capacity]; _array = new char[capacity];
} }
public final void append(final String text) public final void append(String text)
{ {
text.getChars(0, text.length(), _array, _len); text.getChars(0, text.length(), _array, _len);
_len += text.length(); _len += text.length();
@@ -31,7 +31,7 @@ public interface IAmountMultiplierStrategy
public static final IAmountMultiplierStrategy SPOIL = DEFAULT_STRATEGY(Config.RATE_CORPSE_DROP_AMOUNT_MULTIPLIER); public static final IAmountMultiplierStrategy SPOIL = DEFAULT_STRATEGY(Config.RATE_CORPSE_DROP_AMOUNT_MULTIPLIER);
public static final IAmountMultiplierStrategy STATIC = (item, victim) -> 1; public static final IAmountMultiplierStrategy STATIC = (item, victim) -> 1;
public static IAmountMultiplierStrategy DEFAULT_STRATEGY(final double defaultMultiplier) public static IAmountMultiplierStrategy DEFAULT_STRATEGY(double defaultMultiplier)
{ {
return (item, victim) -> return (item, victim) ->
{ {
@@ -46,7 +46,7 @@ public interface IChanceMultiplierStrategy
return (Config.L2JMOD_CHAMPION_ENABLE && (victim != null) && victim.isChampion()) ? (Config.RATE_QUEST_DROP * championmult) : Config.RATE_QUEST_DROP; return (Config.L2JMOD_CHAMPION_ENABLE && (victim != null) && victim.isChampion()) ? (Config.RATE_QUEST_DROP * championmult) : Config.RATE_QUEST_DROP;
}; };
public static IChanceMultiplierStrategy DEFAULT_STRATEGY(final double defaultMultiplier) public static IChanceMultiplierStrategy DEFAULT_STRATEGY(double defaultMultiplier)
{ {
return (item, victim) -> return (item, victim) ->
{ {
@@ -76,7 +76,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
public ScheduledFuture<?> _siegeTask; public ScheduledFuture<?> _siegeTask;
public boolean _missionAccomplished = false; public boolean _missionAccomplished = false;
public ClanHallSiegeEngine(String name, String descr, final int hallId) public ClanHallSiegeEngine(String name, String descr, int hallId)
{ {
super(-1, name, descr); super(-1, name, descr);
_log = Logger.getLogger(getClass().getName()); _log = Logger.getLogger(getClass().getName());
@@ -448,7 +448,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
return Config.CHS_FAME_FREQUENCY; return Config.CHS_FAME_FREQUENCY;
} }
public final void broadcastNpcSay(final L2Npc npc, final ChatType type, final NpcStringId messageId) public final void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId messageId)
{ {
final NpcSay npcSay = new NpcSay(npc.getObjectId(), type, npc.getId(), messageId); final NpcSay npcSay = new NpcSay(npc.getObjectId(), type, npc.getId(), messageId);
final int sourceRegion = MapRegionManager.getInstance().getMapRegionLocId(npc); final int sourceRegion = MapRegionManager.getInstance().getMapRegionLocId(npc);
@@ -144,7 +144,7 @@ public final class SiegableHall extends ClanHall
} }
} }
public final void setSiege(final ClanHallSiegeEngine siegable) public final void setSiege(ClanHallSiegeEngine siegable)
{ {
_siege = siegable; _siege = siegable;
_siegeZone.setSiegeInstance(siegable); _siegeZone.setSiegeInstance(siegable);
@@ -175,7 +175,7 @@ public final class SiegableHall extends ClanHall
_nextSiege.setTimeInMillis(date); _nextSiege.setTimeInMillis(date);
} }
public final void setNextSiegeDate(final Calendar c) public final void setNextSiegeDate(Calendar c)
{ {
_nextSiege = c; _nextSiege = c;
} }
@@ -193,7 +193,7 @@ public final class SiegableHall extends ClanHall
updateDb(); updateDb();
} }
public final void addAttacker(final L2Clan clan) public final void addAttacker(L2Clan clan)
{ {
if (getSiege() != null) if (getSiege() != null)
{ {
@@ -201,7 +201,7 @@ public final class SiegableHall extends ClanHall
} }
} }
public final void removeAttacker(final L2Clan clan) public final void removeAttacker(L2Clan clan)
{ {
if (getSiege() != null) if (getSiege() != null)
{ {
@@ -2680,7 +2680,7 @@ public abstract class AbstractScript implements INamable
* @param smartDrop true if to not calculate a drop, which can't be given to any player 'cause of limits * @param smartDrop true if to not calculate a drop, which can't be given to any player 'cause of limits
* @return the counts of each items given to each player * @return the counts of each items given to each player
*/ */
protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, final GroupedGeneralDropItem items, L2Character killer, L2Character victim, Function<Integer, Long> limit, boolean playSound, boolean smartDrop) protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, GroupedGeneralDropItem items, L2Character killer, L2Character victim, Function<Integer, Long> limit, boolean playSound, boolean smartDrop)
{ {
GroupedGeneralDropItem toDrop; GroupedGeneralDropItem toDrop;
if (smartDrop) if (smartDrop)
@@ -2723,7 +2723,7 @@ public abstract class AbstractScript implements INamable
* @param smartDrop true if to not calculate a drop, which can't be given to any player * @param smartDrop true if to not calculate a drop, which can't be given to any player
* @return the counts of each items given to each player * @return the counts of each items given to each player
*/ */
protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, final GroupedGeneralDropItem items, L2Character killer, L2Character victim, Map<Integer, Long> limit, boolean playSound, boolean smartDrop) protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, GroupedGeneralDropItem items, L2Character killer, L2Character victim, Map<Integer, Long> limit, boolean playSound, boolean smartDrop)
{ {
return distributeItems(players, items, killer, victim, Util.mapToFunction(limit), playSound, smartDrop); return distributeItems(players, items, killer, victim, Util.mapToFunction(limit), playSound, smartDrop);
} }
@@ -2739,7 +2739,7 @@ public abstract class AbstractScript implements INamable
* @param smartDrop true if to not calculate a drop, which can't be given to any player * @param smartDrop true if to not calculate a drop, which can't be given to any player
* @return the counts of each items given to each player * @return the counts of each items given to each player
*/ */
protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, final GroupedGeneralDropItem items, L2Character killer, L2Character victim, long limit, boolean playSound, boolean smartDrop) protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, GroupedGeneralDropItem items, L2Character killer, L2Character victim, long limit, boolean playSound, boolean smartDrop)
{ {
return distributeItems(players, items, killer, victim, t -> limit, playSound, smartDrop); return distributeItems(players, items, killer, victim, t -> limit, playSound, smartDrop);
} }
@@ -3058,7 +3058,7 @@ public abstract class AbstractScript implements INamable
* @param includeCommandChannel if {@code true}, {@link #actionForEachPlayer(L2PcInstance, L2Npc, boolean)} will be called with the player's command channel members * @param includeCommandChannel if {@code true}, {@link #actionForEachPlayer(L2PcInstance, L2Npc, boolean)} will be called with the player's command channel members
* @see #actionForEachPlayer(L2PcInstance, L2Npc, boolean) * @see #actionForEachPlayer(L2PcInstance, L2Npc, boolean)
*/ */
public final void executeForEachPlayer(L2PcInstance player, final L2Npc npc, final boolean isSummon, boolean includeParty, boolean includeCommandChannel) public final void executeForEachPlayer(L2PcInstance player, L2Npc npc, boolean isSummon, boolean includeParty, boolean includeCommandChannel)
{ {
if ((includeParty || includeCommandChannel) && player.isInParty()) if ((includeParty || includeCommandChannel) && player.isInParty())
{ {
@@ -36,7 +36,7 @@ public class MinionHolder implements IIdentifiable
* @param respawnTime the respawn time * @param respawnTime the respawn time
* @param weightPoint the weight point * @param weightPoint the weight point
*/ */
public MinionHolder(final int id, final int count, final long respawnTime, final int weightPoint) public MinionHolder(int id, int count, long respawnTime, int weightPoint)
{ {
_id = id; _id = id;
_count = count; _count = count;
@@ -40,7 +40,7 @@ public final class AuctionDateGenerator
private int _hour_of_day; private int _hour_of_day;
private int _minute_of_hour; private int _minute_of_hour;
public AuctionDateGenerator(final StatsSet config) throws IllegalArgumentException public AuctionDateGenerator(StatsSet config) throws IllegalArgumentException
{ {
_calendar = Calendar.getInstance(); _calendar = Calendar.getInstance();
_interval = config.getInt(FIELD_INTERVAL, -1); _interval = config.getInt(FIELD_INTERVAL, -1);
@@ -55,7 +55,7 @@ public final class AuctionDateGenerator
checkMinuteOfHour(0); checkMinuteOfHour(0);
} }
public synchronized final long nextDate(final long date) public synchronized final long nextDate(long date)
{ {
_calendar.setTimeInMillis(date); _calendar.setTimeInMillis(date);
_calendar.set(Calendar.MILLISECOND, 0); _calendar.set(Calendar.MILLISECOND, 0);
@@ -72,7 +72,7 @@ public final class AuctionDateGenerator
return calcDestTime(_calendar.getTimeInMillis(), date, TimeUnit.MILLISECONDS.convert(_interval, TimeUnit.DAYS)); return calcDestTime(_calendar.getTimeInMillis(), date, TimeUnit.MILLISECONDS.convert(_interval, TimeUnit.DAYS));
} }
private final long calcDestTime(long time, final long date, final long add) private final long calcDestTime(long time, long date, long add)
{ {
if (time < date) if (time < date)
{ {
@@ -85,7 +85,7 @@ public final class AuctionDateGenerator
return time; return time;
} }
private final void checkDayOfWeek(final int defaultValue) private final void checkDayOfWeek(int defaultValue)
{ {
if ((_day_of_week < 1) || (_day_of_week > 7)) if ((_day_of_week < 1) || (_day_of_week > 7))
{ {
@@ -101,7 +101,7 @@ public final class AuctionDateGenerator
} }
} }
private final void checkHourOfDay(final int defaultValue) private final void checkHourOfDay(int defaultValue)
{ {
if ((_hour_of_day < 0) || (_hour_of_day > 23)) if ((_hour_of_day < 0) || (_hour_of_day > 23))
{ {
@@ -113,7 +113,7 @@ public final class AuctionDateGenerator
} }
} }
private final void checkMinuteOfHour(final int defaultValue) private final void checkMinuteOfHour(int defaultValue)
{ {
if ((_minute_of_hour < 0) || (_minute_of_hour > 59)) if ((_minute_of_hour < 0) || (_minute_of_hour > 59))
{ {
@@ -35,7 +35,7 @@ public final class AuctionItem
private final long _itemCount; private final long _itemCount;
private final StatsSet _itemExtra; private final StatsSet _itemExtra;
public AuctionItem(final int auctionItemId, final int auctionLength, final long auctionInitBid, final int itemId, final long itemCount, final StatsSet itemExtra) public AuctionItem(int auctionItemId, int auctionLength, long auctionInitBid, int itemId, long itemCount, StatsSet itemExtra)
{ {
_auctionItemId = auctionItemId; _auctionItemId = auctionItemId;
_auctionLength = auctionLength; _auctionLength = auctionLength;
@@ -67,12 +67,12 @@ public final class ItemAuction
private static final String DELETE_ITEM_AUCTION_BID = "DELETE FROM item_auction_bid WHERE auctionId = ? AND playerObjId = ?"; private static final String DELETE_ITEM_AUCTION_BID = "DELETE FROM item_auction_bid WHERE auctionId = ? AND playerObjId = ?";
private static final String INSERT_ITEM_AUCTION_BID = "INSERT INTO item_auction_bid (auctionId, playerObjId, playerBid) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE playerBid = ?"; private static final String INSERT_ITEM_AUCTION_BID = "INSERT INTO item_auction_bid (auctionId, playerObjId, playerBid) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE playerBid = ?";
public ItemAuction(final int auctionId, final int instanceId, final long startingTime, final long endingTime, final AuctionItem auctionItem) public ItemAuction(int auctionId, int instanceId, long startingTime, long endingTime, AuctionItem auctionItem)
{ {
this(auctionId, instanceId, startingTime, endingTime, auctionItem, new ArrayList<>(), ItemAuctionState.CREATED); this(auctionId, instanceId, startingTime, endingTime, auctionItem, new ArrayList<>(), ItemAuctionState.CREATED);
} }
public ItemAuction(final int auctionId, final int instanceId, final long startingTime, final long endingTime, final AuctionItem auctionItem, final List<ItemAuctionBid> auctionBids, final ItemAuctionState auctionState) public ItemAuction(int auctionId, int instanceId, long startingTime, long endingTime, AuctionItem auctionItem, List<ItemAuctionBid> auctionBids, ItemAuctionState auctionState)
{ {
_auctionId = auctionId; _auctionId = auctionId;
_instanceId = instanceId; _instanceId = instanceId;
@@ -110,7 +110,7 @@ public final class ItemAuction
return auctionState; return auctionState;
} }
public final boolean setAuctionState(final ItemAuctionState expected, final ItemAuctionState wanted) public final boolean setAuctionState(ItemAuctionState expected, ItemAuctionState wanted)
{ {
synchronized (_auctionStateLock) synchronized (_auctionStateLock)
{ {
@@ -210,20 +210,20 @@ public final class ItemAuction
} }
} }
public final int getAndSetLastBidPlayerObjectId(final int playerObjId) public final int getAndSetLastBidPlayerObjectId(int playerObjId)
{ {
final int lastBid = _lastBidPlayerObjId; final int lastBid = _lastBidPlayerObjId;
_lastBidPlayerObjId = playerObjId; _lastBidPlayerObjId = playerObjId;
return lastBid; return lastBid;
} }
private final void updatePlayerBid(final ItemAuctionBid bid, final boolean delete) private final void updatePlayerBid(ItemAuctionBid bid, boolean delete)
{ {
// TODO nBd maybe move such stuff to you db updater :D // TODO nBd maybe move such stuff to you db updater :D
updatePlayerBidInternal(bid, delete); updatePlayerBidInternal(bid, delete);
} }
final void updatePlayerBidInternal(final ItemAuctionBid bid, final boolean delete) final void updatePlayerBidInternal(ItemAuctionBid bid, boolean delete)
{ {
final String query = delete ? DELETE_ITEM_AUCTION_BID : INSERT_ITEM_AUCTION_BID; final String query = delete ? DELETE_ITEM_AUCTION_BID : INSERT_ITEM_AUCTION_BID;
try (Connection con = DatabaseFactory.getInstance().getConnection(); try (Connection con = DatabaseFactory.getInstance().getConnection();
@@ -244,7 +244,7 @@ public final class ItemAuction
} }
} }
public final void registerBid(final L2PcInstance player, final long newBid) public final void registerBid(L2PcInstance player, long newBid)
{ {
if (player == null) if (player == null)
{ {
@@ -325,7 +325,7 @@ public final class ItemAuction
} }
} }
private final void onPlayerBid(final L2PcInstance player, final ItemAuctionBid bid) private final void onPlayerBid(L2PcInstance player, ItemAuctionBid bid)
{ {
if (_highestBid == null) if (_highestBid == null)
{ {
@@ -400,12 +400,12 @@ public final class ItemAuction
} }
} }
public final void broadcastToAllBidders(final L2GameServerPacket packet) public final void broadcastToAllBidders(L2GameServerPacket packet)
{ {
ThreadPoolManager.getInstance().executeGeneral(() -> broadcastToAllBiddersInternal(packet)); ThreadPoolManager.getInstance().executeGeneral(() -> broadcastToAllBiddersInternal(packet));
} }
public final void broadcastToAllBiddersInternal(final L2GameServerPacket packet) public final void broadcastToAllBiddersInternal(L2GameServerPacket packet)
{ {
for (int i = _auctionBids.size(); i-- > 0;) for (int i = _auctionBids.size(); i-- > 0;)
{ {
@@ -421,7 +421,7 @@ public final class ItemAuction
} }
} }
public final boolean cancelBid(final L2PcInstance player) public final boolean cancelBid(L2PcInstance player)
{ {
if (player == null) if (player == null)
{ {
@@ -508,7 +508,7 @@ public final class ItemAuction
} }
} }
private final boolean reduceItemCount(final L2PcInstance player, final long count) private final boolean reduceItemCount(L2PcInstance player, long count)
{ {
if (!player.reduceAdena("ItemAuction", count, player, true)) if (!player.reduceAdena("ItemAuction", count, player, true))
{ {
@@ -518,7 +518,7 @@ public final class ItemAuction
return true; return true;
} }
private final void increaseItemCount(final L2PcInstance player, final long count) private final void increaseItemCount(L2PcInstance player, long count)
{ {
player.addAdena("ItemAuction", count, player, true); player.addAdena("ItemAuction", count, player, true);
} }
@@ -528,19 +528,19 @@ public final class ItemAuction
* @param player The player that made the bid * @param player The player that made the bid
* @return The last bid the player made or -1 * @return The last bid the player made or -1
*/ */
public final long getLastBid(final L2PcInstance player) public final long getLastBid(L2PcInstance player)
{ {
final ItemAuctionBid bid = getBidFor(player.getObjectId()); final ItemAuctionBid bid = getBidFor(player.getObjectId());
return bid != null ? bid.getLastBid() : -1L; return bid != null ? bid.getLastBid() : -1L;
} }
public final ItemAuctionBid getBidFor(final int playerObjId) public final ItemAuctionBid getBidFor(int playerObjId)
{ {
final int index = getBidIndexFor(playerObjId); final int index = getBidIndexFor(playerObjId);
return index != -1 ? _auctionBids.get(index) : null; return index != -1 ? _auctionBids.get(index) : null;
} }
private final int getBidIndexFor(final int playerObjId) private final int getBidIndexFor(int playerObjId)
{ {
for (int i = _auctionBids.size(); i-- > 0;) for (int i = _auctionBids.size(); i-- > 0;)
{ {
@@ -27,7 +27,7 @@ public final class ItemAuctionBid
private final int _playerObjId; private final int _playerObjId;
private long _lastBid; private long _lastBid;
public ItemAuctionBid(final int playerObjId, final long lastBid) public ItemAuctionBid(int playerObjId, long lastBid)
{ {
_playerObjId = playerObjId; _playerObjId = playerObjId;
_lastBid = lastBid; _lastBid = lastBid;
@@ -43,7 +43,7 @@ public final class ItemAuctionBid
return _lastBid; return _lastBid;
} }
final void setLastBid(final long lastBid) final void setLastBid(long lastBid)
{ {
_lastBid = lastBid; _lastBid = lastBid;
} }
@@ -77,7 +77,7 @@ public final class ItemAuctionInstance
private ItemAuction _nextAuction; private ItemAuction _nextAuction;
private ScheduledFuture<?> _stateTask; private ScheduledFuture<?> _stateTask;
public ItemAuctionInstance(final int instanceId, final AtomicInteger auctionIds, final Node node) throws Exception public ItemAuctionInstance(int instanceId, AtomicInteger auctionIds, Node node) throws Exception
{ {
_instanceId = instanceId; _instanceId = instanceId;
_auctionIds = auctionIds; _auctionIds = auctionIds;
@@ -219,7 +219,7 @@ public final class ItemAuctionInstance
} }
} }
private final AuctionItem getAuctionItem(final int auctionItemId) private final AuctionItem getAuctionItem(int auctionItemId)
{ {
for (int i = _items.size(); i-- > 0;) for (int i = _items.size(); i-- > 0;)
{ {
@@ -344,12 +344,12 @@ public final class ItemAuctionInstance
} }
} }
public final ItemAuction getAuction(final int auctionId) public final ItemAuction getAuction(int auctionId)
{ {
return _auctions.get(auctionId); return _auctions.get(auctionId);
} }
public final ItemAuction[] getAuctionsByBidder(final int bidderObjId) public final ItemAuction[] getAuctionsByBidder(int bidderObjId)
{ {
final Collection<ItemAuction> auctions = getAuctions(); final Collection<ItemAuction> auctions = getAuctions();
final ArrayList<ItemAuction> stack = new ArrayList<>(auctions.size()); final ArrayList<ItemAuction> stack = new ArrayList<>(auctions.size());
@@ -383,7 +383,7 @@ public final class ItemAuctionInstance
{ {
private final ItemAuction _auction; private final ItemAuction _auction;
public ScheduleAuctionTask(final ItemAuction auction) public ScheduleAuctionTask(ItemAuction auction)
{ {
_auction = auction; _auction = auction;
} }
@@ -479,7 +479,7 @@ public final class ItemAuctionInstance
} }
} }
final void onAuctionFinished(final ItemAuction auction) final void onAuctionFinished(ItemAuction auction)
{ {
auction.broadcastToAllBiddersInternal(SystemMessage.getSystemMessage(SystemMessageId.S1_S_AUCTION_HAS_ENDED).addInt(auction.getAuctionId())); auction.broadcastToAllBiddersInternal(SystemMessage.getSystemMessage(SystemMessageId.S1_S_AUCTION_HAS_ENDED).addInt(auction.getAuctionId()));
@@ -514,7 +514,7 @@ public final class ItemAuctionInstance
} }
} }
final void setStateTask(final ScheduledFuture<?> future) final void setStateTask(ScheduledFuture<?> future)
{ {
final ScheduledFuture<?> stateTask = _stateTask; final ScheduledFuture<?> stateTask = _stateTask;
if (stateTask != null) if (stateTask != null)
@@ -525,7 +525,7 @@ public final class ItemAuctionInstance
_stateTask = future; _stateTask = future;
} }
private final ItemAuction createAuction(final long after) private final ItemAuction createAuction(long after)
{ {
final AuctionItem auctionItem = _items.get(Rnd.get(_items.size())); final AuctionItem auctionItem = _items.get(Rnd.get(_items.size()));
final long startingTime = _dateGenerator.nextDate(after); final long startingTime = _dateGenerator.nextDate(after);
@@ -535,7 +535,7 @@ public final class ItemAuctionInstance
return auction; return auction;
} }
private final ItemAuction loadAuction(final int auctionId) throws SQLException private final ItemAuction loadAuction(int auctionId) throws SQLException
{ {
try (Connection con = DatabaseFactory.getInstance().getConnection()) try (Connection con = DatabaseFactory.getInstance().getConnection())
{ {
@@ -27,7 +27,7 @@ public enum ItemAuctionState
private final byte _stateId; private final byte _stateId;
private ItemAuctionState(final byte stateId) private ItemAuctionState(byte stateId)
{ {
_stateId = stateId; _stateId = stateId;
} }
@@ -37,7 +37,7 @@ public enum ItemAuctionState
return _stateId; return _stateId;
} }
public static final ItemAuctionState stateForStateId(final byte stateId) public static final ItemAuctionState stateForStateId(byte stateId)
{ {
for (ItemAuctionState state : ItemAuctionState.values()) for (ItemAuctionState state : ItemAuctionState.values())
{ {
@@ -2469,7 +2469,7 @@ public final class L2ItemInstance extends L2Object
final int slot_id = rs.getInt("slot_id"); final int slot_id = rs.getInt("slot_id");
if (effect_id != 0) if (effect_id != 0)
{ {
SoulCrystalOption sco = SoulCrystalOptionsData.getInstance().getByEffectId(effect_id); final SoulCrystalOption sco = SoulCrystalOptionsData.getInstance().getByEffectId(effect_id);
sco.setSlot(slot_id); sco.setSlot(slot_id);
if (sco.isSpecial()) if (sco.isSpecial())
@@ -2495,7 +2495,7 @@ public final class L2ItemInstance extends L2Object
public void applySoulCrystalOptionEffect() public void applySoulCrystalOptionEffect()
{ {
L2PcInstance owner = getActingPlayer(); final L2PcInstance owner = getActingPlayer();
if ((owner == null) || (!isEquipped())) if ((owner == null) || (!isEquipped()))
{ {
return; return;
@@ -2519,7 +2519,7 @@ public final class L2ItemInstance extends L2Object
public void removeSoulCrystalOptionEffect() public void removeSoulCrystalOptionEffect()
{ {
L2PcInstance owner = getActingPlayer(); final L2PcInstance owner = getActingPlayer();
if ((owner == null) || (isEquipped())) if ((owner == null) || (isEquipped()))
{ {
return; return;
@@ -1030,7 +1030,7 @@ public final class Skill implements IIdentifiable
* @param player the player * @param player the player
* @return {@code true} if the player can use this skill, {@code false} otherwise * @return {@code true} if the player can use this skill, {@code false} otherwise
*/ */
public boolean canBeUseWhileRiding(final L2PcInstance player) public boolean canBeUseWhileRiding(L2PcInstance player)
{ {
return (_rideState == null) || _rideState.contains(player.getMountType()); return (_rideState == null) || _rideState.contains(player.getMountType());
} }
@@ -26,7 +26,7 @@ import com.l2jmobius.gameserver.model.zone.ZoneId;
*/ */
public class L2HqZone extends L2ZoneType public class L2HqZone extends L2ZoneType
{ {
public L2HqZone(final int id) public L2HqZone(int id)
{ {
super(id); super(id);
} }
@@ -57,7 +57,7 @@ public class L2HqZone extends L2ZoneType
} }
@Override @Override
protected void onEnter(final L2Character character) protected void onEnter(L2Character character)
{ {
if (character.isPlayer()) if (character.isPlayer())
{ {
@@ -66,7 +66,7 @@ public class L2HqZone extends L2ZoneType
} }
@Override @Override
protected void onExit(final L2Character character) protected void onExit(L2Character character)
{ {
if (character.isPlayer()) if (character.isPlayer())
{ {
@@ -26,13 +26,13 @@ import com.l2jmobius.gameserver.model.zone.ZoneId;
*/ */
public class L2NoStoreZone extends L2ZoneType public class L2NoStoreZone extends L2ZoneType
{ {
public L2NoStoreZone(final int id) public L2NoStoreZone(int id)
{ {
super(id); super(id);
} }
@Override @Override
protected void onEnter(final L2Character character) protected void onEnter(L2Character character)
{ {
if (character.isPlayer()) if (character.isPlayer())
{ {
@@ -41,7 +41,7 @@ public class L2NoStoreZone extends L2ZoneType
} }
@Override @Override
protected void onExit(final L2Character character) protected void onExit(L2Character character)
{ {
if (character.isPlayer()) if (character.isPlayer())
{ {
@@ -31,7 +31,7 @@ public class GameCrypt
System.arraycopy(key, 0, _outKey, 0, 16); System.arraycopy(key, 0, _outKey, 0, 16);
} }
public void decrypt(byte[] raw, final int offset, final int size) public void decrypt(byte[] raw, int offset, int size)
{ {
if (!_isEnabled) if (!_isEnabled)
{ {
@@ -59,7 +59,7 @@ public class GameCrypt
_inKey[11] = (byte) ((old >> 0x18) & 0xff); _inKey[11] = (byte) ((old >> 0x18) & 0xff);
} }
public void encrypt(byte[] raw, final int offset, final int size) public void encrypt(byte[] raw, int offset, int size)
{ {
if (!_isEnabled) if (!_isEnabled)
{ {
@@ -197,7 +197,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
} }
@Override @Override
public boolean encrypt(final ByteBuffer buf, final int size) public boolean encrypt(ByteBuffer buf, int size)
{ {
_crypt.encrypt(buf.array(), buf.position(), size); _crypt.encrypt(buf.array(), buf.position(), size);
buf.position(buf.position() + size); buf.position(buf.position() + size);
@@ -36264,7 +36264,7 @@ public final class NpcStringId
} }
} }
private static final int parseMessageParameters(final String name) private static final int parseMessageParameters(String name)
{ {
int paramCount = 0; int paramCount = 0;
char c1, c2; char c1, c2;
@@ -36284,23 +36284,23 @@ public final class NpcStringId
return paramCount; return paramCount;
} }
public static final NpcStringId getNpcStringId(final int id) public static final NpcStringId getNpcStringId(int id)
{ {
return getNpcStringIdOrDefault(id, new NpcStringId(id)); return getNpcStringIdOrDefault(id, new NpcStringId(id));
} }
public static final NpcStringId getNpcStringIdOrDefault(final int id, NpcStringId defaultValue) public static final NpcStringId getNpcStringIdOrDefault(int id, NpcStringId defaultValue)
{ {
final NpcStringId nsi = getNpcStringIdInternal(id); final NpcStringId nsi = getNpcStringIdInternal(id);
return nsi == null ? defaultValue : nsi; return nsi == null ? defaultValue : nsi;
} }
private static final NpcStringId getNpcStringIdInternal(final int id) private static final NpcStringId getNpcStringIdInternal(int id)
{ {
return VALUES.get(id); return VALUES.get(id);
} }
public static final NpcStringId getNpcStringId(final String name) public static final NpcStringId getNpcStringId(String name)
{ {
try try
{ {
@@ -36415,7 +36415,7 @@ public final class NpcStringId
private NSLocalisation[] _localisations; private NSLocalisation[] _localisations;
private ExShowScreenMessage _staticScreenMessage; private ExShowScreenMessage _staticScreenMessage;
protected NpcStringId(final int id) protected NpcStringId(int id)
{ {
_id = id; _id = id;
_localisations = EMPTY_NSL_ARRAY; _localisations = EMPTY_NSL_ARRAY;
@@ -36426,7 +36426,7 @@ public final class NpcStringId
return _id; return _id;
} }
private final void setName(final String name) private final void setName(String name)
{ {
_name = name; _name = name;
} }
@@ -36445,7 +36445,7 @@ public final class NpcStringId
* You better don`t touch this! * You better don`t touch this!
* @param params * @param params
*/ */
public final void setParamCount(final int params) public final void setParamCount(int params)
{ {
if (params < 0) if (params < 0)
{ {
@@ -36465,7 +36465,7 @@ public final class NpcStringId
_params = (byte) params; _params = (byte) params;
} }
public final NSLocalisation getLocalisation(final String lang) public final NSLocalisation getLocalisation(String lang)
{ {
NSLocalisation nsl; NSLocalisation nsl;
for (int i = _localisations.length; i-- > 0;) for (int i = _localisations.length; i-- > 0;)
@@ -36479,7 +36479,7 @@ public final class NpcStringId
return null; return null;
} }
public final void attachLocalizedText(final String lang, final String text) public final void attachLocalizedText(String lang, String text)
{ {
final int length = _localisations.length; final int length = _localisations.length;
final NSLocalisation[] localisations = Arrays.copyOf(_localisations, length + 1); final NSLocalisation[] localisations = Arrays.copyOf(_localisations, length + 1);
@@ -36497,7 +36497,7 @@ public final class NpcStringId
return _staticScreenMessage; return _staticScreenMessage;
} }
public final void setStaticSystemMessage(final ExShowScreenMessage ns) public final void setStaticSystemMessage(ExShowScreenMessage ns)
{ {
_staticScreenMessage = ns; _staticScreenMessage = ns;
} }
@@ -36513,7 +36513,7 @@ public final class NpcStringId
private final String _lang; private final String _lang;
private final Builder _builder; private final Builder _builder;
public NSLocalisation(final String lang, final String text) public NSLocalisation(String lang, String text)
{ {
_lang = lang; _lang = lang;
_builder = Builder.newBuilder(text); _builder = Builder.newBuilder(text);
@@ -36524,7 +36524,7 @@ public final class NpcStringId
return _lang; return _lang;
} }
public final String getLocalisation(final Object... params) public final String getLocalisation(Object... params)
{ {
return _builder.toString(params); return _builder.toString(params);
} }
@@ -15206,7 +15206,7 @@ public final class SystemMessageId
} }
} }
private static final int parseMessageParameters(final String name) private static final int parseMessageParameters(String name)
{ {
int paramCount = 0; int paramCount = 0;
char c1, c2; char c1, c2;
@@ -15226,18 +15226,18 @@ public final class SystemMessageId
return paramCount; return paramCount;
} }
public static final SystemMessageId getSystemMessageId(final int id) public static final SystemMessageId getSystemMessageId(int id)
{ {
final SystemMessageId smi = getSystemMessageIdInternal(id); final SystemMessageId smi = getSystemMessageIdInternal(id);
return smi == null ? new SystemMessageId(id) : smi; return smi == null ? new SystemMessageId(id) : smi;
} }
private static final SystemMessageId getSystemMessageIdInternal(final int id) private static final SystemMessageId getSystemMessageIdInternal(int id)
{ {
return VALUES.get(id); return VALUES.get(id);
} }
public static final SystemMessageId getSystemMessageId(final String name) public static final SystemMessageId getSystemMessageId(String name)
{ {
try try
{ {
@@ -15352,7 +15352,7 @@ public final class SystemMessageId
private SMLocalisation[] _localisations; private SMLocalisation[] _localisations;
private SystemMessage _staticSystemMessage; private SystemMessage _staticSystemMessage;
private SystemMessageId(final int id) private SystemMessageId(int id)
{ {
_id = id; _id = id;
_localisations = EMPTY_SML_ARRAY; _localisations = EMPTY_SML_ARRAY;
@@ -15363,7 +15363,7 @@ public final class SystemMessageId
return _id; return _id;
} }
private final void setName(final String name) private final void setName(String name)
{ {
_name = name; _name = name;
} }
@@ -15382,7 +15382,7 @@ public final class SystemMessageId
* You better don`t touch this! * You better don`t touch this!
* @param params * @param params
*/ */
public final void setParamCount(final int params) public final void setParamCount(int params)
{ {
if (params < 0) if (params < 0)
{ {
@@ -15402,7 +15402,7 @@ public final class SystemMessageId
_params = (byte) params; _params = (byte) params;
} }
public final SMLocalisation getLocalisation(final String lang) public final SMLocalisation getLocalisation(String lang)
{ {
SMLocalisation sml; SMLocalisation sml;
for (int i = _localisations.length; i-- > 0;) for (int i = _localisations.length; i-- > 0;)
@@ -15416,7 +15416,7 @@ public final class SystemMessageId
return null; return null;
} }
public final void attachLocalizedText(final String lang, final String text) public final void attachLocalizedText(String lang, String text)
{ {
final int length = _localisations.length; final int length = _localisations.length;
final SMLocalisation[] localisations = Arrays.copyOf(_localisations, length + 1); final SMLocalisation[] localisations = Arrays.copyOf(_localisations, length + 1);
@@ -15434,7 +15434,7 @@ public final class SystemMessageId
return _staticSystemMessage; return _staticSystemMessage;
} }
public final void setStaticSystemMessage(final SystemMessage sm) public final void setStaticSystemMessage(SystemMessage sm)
{ {
_staticSystemMessage = sm; _staticSystemMessage = sm;
} }
@@ -15450,7 +15450,7 @@ public final class SystemMessageId
private final String _lang; private final String _lang;
private final Builder _builder; private final Builder _builder;
public SMLocalisation(final String lang, final String text) public SMLocalisation(String lang, String text)
{ {
_lang = lang; _lang = lang;
_builder = Builder.newBuilder(text); _builder = Builder.newBuilder(text);
@@ -15461,7 +15461,7 @@ public final class SystemMessageId
return _lang; return _lang;
} }
public final String getLocalisation(final Object... params) public final String getLocalisation(Object... params)
{ {
return _builder.toString(params); return _builder.toString(params);
} }
@@ -1656,7 +1656,7 @@ public final class RequestActionUse extends L2GameClientPacket
* Perform a couple social action. * Perform a couple social action.
* @param id the couple social action Id * @param id the couple social action Id
*/ */
private void useCoupleSocial(final int id) private void useCoupleSocial(int id)
{ {
final L2PcInstance requester = getActiveChar(); final L2PcInstance requester = getActiveChar();
if (requester == null) if (requester == null)
@@ -281,7 +281,7 @@ public class RequestExEnchantItemAttribute extends L2GameClientPacket
player.sendPacket(iu); player.sendPacket(iu);
} }
private int addElement(final L2PcInstance player, final L2ItemInstance stone, final L2ItemInstance item, byte elementToAdd) private int addElement(L2PcInstance player, L2ItemInstance stone, L2ItemInstance item, byte elementToAdd)
{ {
final Elementals oldElement = item.getElemental(elementToAdd); final Elementals oldElement = item.getElemental(elementToAdd);
final int elementValue = oldElement == null ? 0 : oldElement.getValue(); final int elementValue = oldElement == null ? 0 : oldElement.getValue();
@@ -108,7 +108,7 @@ public final class RequestRestartPoint extends L2GameClientPacket
portPlayer(activeChar); portPlayer(activeChar);
} }
protected final void portPlayer(final L2PcInstance activeChar) protected final void portPlayer(L2PcInstance activeChar)
{ {
Location loc = null; Location loc = null;
Castle castle = null; Castle castle = null;
@@ -55,7 +55,7 @@ public class RequestItemEnsoul extends L2GameClientPacket
final int SCObjectId = readD(); // Soul Crystal objectId final int SCObjectId = readD(); // Soul Crystal objectId
final int effectId = readD(); // EffectId final int effectId = readD(); // EffectId
SoulCrystalOption sco = SoulCrystalOptionsData.getInstance().getByEffectId(effectId); final SoulCrystalOption sco = SoulCrystalOptionsData.getInstance().getByEffectId(effectId);
sco.setSoulCrystalObjectId(SCObjectId); sco.setSoulCrystalObjectId(SCObjectId);
sco.setSpecial(special); sco.setSpecial(special);
sco.setSlot(slot); sco.setSlot(slot);
@@ -57,7 +57,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
private final byte _type; private final byte _type;
private final Object _value; private final Object _value;
public SMParam(final byte type, final Object value) public SMParam(byte type, Object value)
{ {
_type = type; _type = type;
_value = value; _value = value;
@@ -148,7 +148,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
_params[_paramIndex++] = param; _params[_paramIndex++] = param;
} }
public final T addString(final String text) public final T addString(String text)
{ {
append(new SMParam(TYPE_TEXT, text)); append(new SMParam(TYPE_TEXT, text));
return (T) this; return (T) this;
@@ -173,25 +173,25 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
* @param number the conquerable entity * @param number the conquerable entity
* @return the system message with the proper parameter * @return the system message with the proper parameter
*/ */
public final T addCastleId(final int number) public final T addCastleId(int number)
{ {
append(new SMParam(TYPE_CASTLE_NAME, number)); append(new SMParam(TYPE_CASTLE_NAME, number));
return (T) this; return (T) this;
} }
public final T addInt(final int number) public final T addInt(int number)
{ {
append(new SMParam(TYPE_INT_NUMBER, number)); append(new SMParam(TYPE_INT_NUMBER, number));
return (T) this; return (T) this;
} }
public final T addLong(final long number) public final T addLong(long number)
{ {
append(new SMParam(TYPE_LONG_NUMBER, number)); append(new SMParam(TYPE_LONG_NUMBER, number));
return (T) this; return (T) this;
} }
public final T addCharName(final L2Character cha) public final T addCharName(L2Character cha)
{ {
if (cha.isNpc()) if (cha.isNpc())
{ {
@@ -223,7 +223,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return addString(cha.getName()); return addString(cha.getName());
} }
public final T addPcName(final L2PcInstance pc) public final T addPcName(L2PcInstance pc)
{ {
append(new SMParam(TYPE_PLAYER_NAME, pc.getAppearance().getVisibleName())); append(new SMParam(TYPE_PLAYER_NAME, pc.getAppearance().getVisibleName()));
return (T) this; return (T) this;
@@ -245,12 +245,12 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return addNpcName(npc.getTemplate()); return addNpcName(npc.getTemplate());
} }
public final T addNpcName(final L2Summon npc) public final T addNpcName(L2Summon npc)
{ {
return addNpcName(npc.getId()); return addNpcName(npc.getId());
} }
public final T addNpcName(final L2NpcTemplate template) public final T addNpcName(L2NpcTemplate template)
{ {
if (template.isUsingServerSideName()) if (template.isUsingServerSideName())
{ {
@@ -259,23 +259,23 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return addNpcName(template.getId()); return addNpcName(template.getId());
} }
public final T addNpcName(final int id) public final T addNpcName(int id)
{ {
append(new SMParam(TYPE_NPC_NAME, 1000000 + id)); append(new SMParam(TYPE_NPC_NAME, 1000000 + id));
return (T) this; return (T) this;
} }
public T addItemName(final L2ItemInstance item) public T addItemName(L2ItemInstance item)
{ {
return addItemName(item.getId()); return addItemName(item.getId());
} }
public T addItemName(final L2Item item) public T addItemName(L2Item item)
{ {
return addItemName(item.getId()); return addItemName(item.getId());
} }
public final T addItemName(final int id) public final T addItemName(int id)
{ {
final L2Item item = ItemTable.getInstance().getTemplate(id); final L2Item item = ItemTable.getInstance().getTemplate(id);
if (item.getDisplayId() != id) if (item.getDisplayId() != id)
@@ -287,7 +287,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return (T) this; return (T) this;
} }
public final T addZoneName(final int x, final int y, final int z) public final T addZoneName(int x, int y, int z)
{ {
append(new SMParam(TYPE_ZONE_NAME, new int[] append(new SMParam(TYPE_ZONE_NAME, new int[]
{ {
@@ -298,7 +298,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return (T) this; return (T) this;
} }
public final T addSkillName(final Skill skill) public final T addSkillName(Skill skill)
{ {
if (skill.getId() != skill.getDisplayId()) if (skill.getId() != skill.getDisplayId())
{ {
@@ -307,12 +307,12 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return addSkillName(skill.getId(), skill.getLevel()); return addSkillName(skill.getId(), skill.getLevel());
} }
public final T addSkillName(final int id) public final T addSkillName(int id)
{ {
return addSkillName(id, 1); return addSkillName(id, 1);
} }
public final T addSkillName(final int id, final int lvl) public final T addSkillName(int id, int lvl)
{ {
append(new SMParam(TYPE_SKILL_NAME, new int[] append(new SMParam(TYPE_SKILL_NAME, new int[]
{ {
@@ -327,7 +327,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
* @param type * @param type
* @return * @return
*/ */
public final T addElemental(final int type) public final T addElemental(int type)
{ {
append(new SMParam(TYPE_ELEMENT_NAME, type)); append(new SMParam(TYPE_ELEMENT_NAME, type));
return (T) this; return (T) this;
@@ -338,7 +338,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
* @param type * @param type
* @return * @return
*/ */
public final T addSystemString(final int type) public final T addSystemString(int type)
{ {
append(new SMParam(TYPE_SYSTEM_STRING, type)); append(new SMParam(TYPE_SYSTEM_STRING, type));
return (T) this; return (T) this;
@@ -349,7 +349,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
* @param type * @param type
* @return * @return
*/ */
public final T addClassId(final int type) public final T addClassId(int type)
{ {
append(new SMParam(TYPE_CLASS_ID, type)); append(new SMParam(TYPE_CLASS_ID, type));
return (T) this; return (T) this;
@@ -371,7 +371,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
* @param type id of instance * @param type id of instance
* @return * @return
*/ */
public final T addInstanceName(final int type) public final T addInstanceName(int type)
{ {
append(new SMParam(TYPE_INSTANCE_NAME, type)); append(new SMParam(TYPE_INSTANCE_NAME, type));
return (T) this; return (T) this;
@@ -530,7 +530,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
} }
} }
public final T getLocalizedMessage(final String lang) public final T getLocalizedMessage(String lang)
{ {
if (!Config.L2JMOD_MULTILANG_SM_ENABLE || (getSystemMessageId() == SystemMessageId.S13)) if (!Config.L2JMOD_MULTILANG_SM_ENABLE || (getSystemMessageId() == SystemMessageId.S13))
{ {
@@ -20,7 +20,7 @@ public final class CSShowComBoard extends L2GameServerPacket
{ {
private final byte[] _html; private final byte[] _html;
public CSShowComBoard(final byte[] html) public CSShowComBoard(byte[] html)
{ {
_html = html; _html = html;
} }
@@ -147,7 +147,7 @@ public final class ExBasicActionList extends L2GameServerPacket
private final int[] _actionIds; private final int[] _actionIds;
public ExBasicActionList(final int[] actionIds) public ExBasicActionList(int[] actionIds)
{ {
_actionIds = actionIds; _actionIds = actionIds;
} }
@@ -30,7 +30,7 @@ public final class ExItemAuctionInfoPacket extends AbstractItemPacket
private final ItemAuction _currentAuction; private final ItemAuction _currentAuction;
private final ItemAuction _nextAuction; private final ItemAuction _nextAuction;
public ExItemAuctionInfoPacket(final boolean refresh, final ItemAuction currentAuction, final ItemAuction nextAuction) public ExItemAuctionInfoPacket(boolean refresh, ItemAuction currentAuction, ItemAuction nextAuction)
{ {
if (currentAuction == null) if (currentAuction == null)
{ {
@@ -23,12 +23,12 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
*/ */
public final class SystemMessage extends AbstractMessagePacket<SystemMessage> public final class SystemMessage extends AbstractMessagePacket<SystemMessage>
{ {
private SystemMessage(final SystemMessageId smId) private SystemMessage(SystemMessageId smId)
{ {
super(smId); super(smId);
} }
public static final SystemMessage sendString(final String text) public static final SystemMessage sendString(String text)
{ {
if (text == null) if (text == null)
{ {
@@ -40,7 +40,7 @@ public final class SystemMessage extends AbstractMessagePacket<SystemMessage>
return sm; return sm;
} }
public static final SystemMessage getSystemMessage(final SystemMessageId smId) public static final SystemMessage getSystemMessage(SystemMessageId smId)
{ {
SystemMessage sm = smId.getStaticSystemMessage(); SystemMessage sm = smId.getStaticSystemMessage();
if (sm != null) if (sm != null)
@@ -73,7 +73,7 @@ public final class SystemMessage extends AbstractMessagePacket<SystemMessage>
* @deprecated * @deprecated
*/ */
@Deprecated @Deprecated
private SystemMessage(final int id) private SystemMessage(int id)
{ {
this(SystemMessageId.getSystemMessageId(id)); this(SystemMessageId.getSystemMessageId(id));
} }
@@ -57,7 +57,7 @@ public class ExBRBuyProduct extends L2GameServerPacket
private final int _reply; private final int _reply;
public ExBRBuyProduct(final ExBrProductReplyType type) public ExBRBuyProduct(ExBrProductReplyType type)
{ {
_reply = type.getId(); _reply = type.getId();
} }
@@ -27,7 +27,7 @@ public class ExBRGamePoint extends L2GameServerPacket
private final int _charId; private final int _charId;
private final int _charPoints; private final int _charPoints;
public ExBRGamePoint(final L2PcInstance player) public ExBRGamePoint(L2PcInstance player)
{ {
_charId = player.getObjectId(); _charId = player.getObjectId();
_charPoints = player.getPrimePoints(); _charPoints = player.getPrimePoints();
@@ -69,7 +69,7 @@ public final class FloodProtectorAction
* @param client the game client for which flood protection is being created * @param client the game client for which flood protection is being created
* @param config flood protector configuration * @param config flood protector configuration
*/ */
public FloodProtectorAction(final L2GameClient client, final FloodProtectorConfig config) public FloodProtectorAction(L2GameClient client, FloodProtectorConfig config)
{ {
super(); super();
_client = client; _client = client;
@@ -81,7 +81,7 @@ public final class FloodProtectorAction
* @param command command issued or short command description * @param command command issued or short command description
* @return true if action is allowed, otherwise false * @return true if action is allowed, otherwise false
*/ */
public boolean tryPerformAction(final String command) public boolean tryPerformAction(String command)
{ {
final int curTick = GameTimeController.getInstance().getGameTicks(); final int curTick = GameTimeController.getInstance().getGameTicks();
@@ -51,7 +51,7 @@ public final class FloodProtectorConfig
* Creates new instance of FloodProtectorConfig. * Creates new instance of FloodProtectorConfig.
* @param floodProtectorType {@link #FLOOD_PROTECTOR_TYPE} * @param floodProtectorType {@link #FLOOD_PROTECTOR_TYPE}
*/ */
public FloodProtectorConfig(final String floodProtectorType) public FloodProtectorConfig(String floodProtectorType)
{ {
super(); super();
FLOOD_PROTECTOR_TYPE = floodProtectorType; FLOOD_PROTECTOR_TYPE = floodProtectorType;
@@ -94,7 +94,7 @@ public final class FloodProtectors
* Creates new instance of FloodProtectors. * Creates new instance of FloodProtectors.
* @param client game client for which the collection of flood protectors is being created. * @param client game client for which the collection of flood protectors is being created.
*/ */
public FloodProtectors(final L2GameClient client) public FloodProtectors(L2GameClient client)
{ {
super(); super();
_useItem = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_USE_ITEM); _useItem = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_USE_ITEM);
@@ -71,7 +71,7 @@ public class MinionList
* <BR> * <BR>
* @param minions * @param minions
*/ */
public final void spawnMinions(final List<MinionHolder> minions) public final void spawnMinions(List<MinionHolder> minions)
{ {
if (_master.isAlikeDead()) if (_master.isAlikeDead())
{ {
@@ -28,7 +28,7 @@ public final class AccountInfo
private final int _accessLevel; private final int _accessLevel;
private final int _lastServer; private final int _lastServer;
public AccountInfo(final String login, final String passHash, final int accessLevel, final int lastServer) public AccountInfo(String login, String passHash, int accessLevel, int lastServer)
{ {
Objects.requireNonNull(login, "login"); Objects.requireNonNull(login, "login");
Objects.requireNonNull(passHash, "passHash"); Objects.requireNonNull(passHash, "passHash");
@@ -48,7 +48,7 @@ public final class AccountInfo
_lastServer = lastServer; _lastServer = lastServer;
} }
public boolean checkPassHash(final String passHash) public boolean checkPassHash(String passHash)
{ {
return _passHash.equals(passHash); return _passHash.equals(passHash);
} }
+8 -8
View File
@@ -51,7 +51,7 @@ public class HexUtils
* @param data byte to generate the hexadecimal character presentation from * @param data byte to generate the hexadecimal character presentation from
* @return a new char array with exactly 2 elements * @return a new char array with exactly 2 elements
*/ */
public static char[] b2HexChars(final byte data) public static char[] b2HexChars(byte data)
{ {
return b2HexChars(data, null, 0); return b2HexChars(data, null, 0);
} }
@@ -63,7 +63,7 @@ public class HexUtils
* @param dstOffset offset at which the hexadecimal character presentation is copied to dstHexChars * @param dstOffset offset at which the hexadecimal character presentation is copied to dstHexChars
* @return the char array the hexadecimal character presentation was copied to * @return the char array the hexadecimal character presentation was copied to
*/ */
public static char[] b2HexChars(final byte data, char[] dstHexChars, int dstOffset) public static char[] b2HexChars(byte data, char[] dstHexChars, int dstOffset)
{ {
if (dstHexChars == null) if (dstHexChars == null)
{ {
@@ -84,7 +84,7 @@ public class HexUtils
* @param data integer to generate the hexadecimal character presentation from * @param data integer to generate the hexadecimal character presentation from
* @return new char array with 8 elements * @return new char array with 8 elements
*/ */
public static char[] int2HexChars(final int data) public static char[] int2HexChars(int data)
{ {
return int2HexChars(data, new char[8], 0); return int2HexChars(data, new char[8], 0);
} }
@@ -96,7 +96,7 @@ public class HexUtils
* @param dstOffset offset at which the hexadecimal character presentation is copied to dstHexChars * @param dstOffset offset at which the hexadecimal character presentation is copied to dstHexChars
* @return the char array the hexadecimal character presentation was copied to * @return the char array the hexadecimal character presentation was copied to
*/ */
public static char[] int2HexChars(final int data, char[] dstHexChars, int dstOffset) public static char[] int2HexChars(int data, char[] dstHexChars, int dstOffset)
{ {
if (dstHexChars == null) if (dstHexChars == null)
{ {
@@ -119,7 +119,7 @@ public class HexUtils
* @param len number of bytes to generate the hexadecimal character presentation from * @param len number of bytes to generate the hexadecimal character presentation from
* @return a new char array with len*2 elements * @return a new char array with len*2 elements
*/ */
public static char[] bArr2HexChars(final byte[] data, final int offset, final int len) public static char[] bArr2HexChars(byte[] data, int offset, int len)
{ {
return bArr2HexChars(data, offset, len, null, 0); return bArr2HexChars(data, offset, len, null, 0);
} }
@@ -133,7 +133,7 @@ public class HexUtils
* @param dstOffset offset at which the hexadecimal character presentation is copied to dstHexChars * @param dstOffset offset at which the hexadecimal character presentation is copied to dstHexChars
* @return the char array the hexadecimal character presentation was copied to * @return the char array the hexadecimal character presentation was copied to
*/ */
public static char[] bArr2HexChars(final byte[] data, final int offset, final int len, char[] dstHexChars, int dstOffset) public static char[] bArr2HexChars(byte[] data, int offset, int len, char[] dstHexChars, int dstOffset)
{ {
if (dstHexChars == null) if (dstHexChars == null)
{ {
@@ -152,12 +152,12 @@ public class HexUtils
return dstHexChars; return dstHexChars;
} }
public static char[] bArr2AsciiChars(byte[] data, final int offset, final int len) public static char[] bArr2AsciiChars(byte[] data, int offset, int len)
{ {
return bArr2AsciiChars(data, offset, len, new char[len], 0); return bArr2AsciiChars(data, offset, len, new char[len], 0);
} }
public static char[] bArr2AsciiChars(byte[] data, final int offset, final int len, char[] dstAsciiChars, int dstOffset) public static char[] bArr2AsciiChars(byte[] data, int offset, int len, char[] dstAsciiChars, int dstOffset)
{ {
if (dstAsciiChars == null) if (dstAsciiChars == null)
{ {
+20 -20
View File
@@ -40,19 +40,19 @@ public final class Rnd
this(++SEED_UNIQUIFIER + System.nanoTime()); this(++SEED_UNIQUIFIER + System.nanoTime());
} }
public NonAtomicRandom(final long seed) public NonAtomicRandom(long seed)
{ {
setSeed(seed); setSeed(seed);
} }
@Override @Override
public final int next(final int bits) public final int next(int bits)
{ {
return (int) ((_seed = ((_seed * MULTIPLIER) + ADDEND) & MASK) >>> (48 - bits)); return (int) ((_seed = ((_seed * MULTIPLIER) + ADDEND) & MASK) >>> (48 - bits));
} }
@Override @Override
public final void setSeed(final long seed) public final void setSeed(long seed)
{ {
_seed = (seed ^ MULTIPLIER) & MASK; _seed = (seed ^ MULTIPLIER) & MASK;
} }
@@ -65,7 +65,7 @@ public final class Rnd
{ {
private final Random _random; private final Random _random;
protected RandomContainer(final Random random) protected RandomContainer(Random random)
{ {
_random = random; _random = random;
} }
@@ -90,7 +90,7 @@ public final class Rnd
* @param n The superior limit (exclusive) * @param n The superior limit (exclusive)
* @return A random integer number from 0 to n-1 * @return A random integer number from 0 to n-1
*/ */
public final int get(final int n) public final int get(int n)
{ {
return (int) (_random.nextDouble() * n); return (int) (_random.nextDouble() * n);
} }
@@ -101,7 +101,7 @@ public final class Rnd
* @param max The maximum value * @param max The maximum value
* @return A random integer number from min to max * @return A random integer number from min to max
*/ */
public final int get(final int min, final int max) public final int get(int min, int max)
{ {
return min + (int) (_random.nextDouble() * ((max - min) + 1)); return min + (int) (_random.nextDouble() * ((max - min) + 1));
} }
@@ -112,7 +112,7 @@ public final class Rnd
* @param max The maximum value * @param max The maximum value
* @return A random long number from min to max * @return A random long number from min to max
*/ */
public final long get(final long min, final long max) public final long get(long min, long max)
{ {
return min + (long) (_random.nextDouble() * ((max - min) + 1)); return min + (long) (_random.nextDouble() * ((max - min) + 1));
} }
@@ -132,7 +132,7 @@ public final class Rnd
* @param array The array to be filled with random byte numbers * @param array The array to be filled with random byte numbers
* @see java.util.Random#nextBytes(byte[] bytes) * @see java.util.Random#nextBytes(byte[] bytes)
*/ */
public final void nextBytes(final byte[] array) public final void nextBytes(byte[] array)
{ {
_random.nextBytes(array); _random.nextBytes(array);
} }
@@ -235,17 +235,17 @@ public final class Rnd
{ {
long _seed; long _seed;
Seed(final long seed) Seed(long seed)
{ {
setSeed(seed); setSeed(seed);
} }
final int next(final int bits) final int next(int bits)
{ {
return (int) ((_seed = ((_seed * MULTIPLIER) + ADDEND) & MASK) >>> (48 - bits)); return (int) ((_seed = ((_seed * MULTIPLIER) + ADDEND) & MASK) >>> (48 - bits));
} }
final void setSeed(final long seed) final void setSeed(long seed)
{ {
_seed = (seed ^ MULTIPLIER) & MASK; _seed = (seed ^ MULTIPLIER) & MASK;
} }
@@ -265,7 +265,7 @@ public final class Rnd
}; };
} }
public ThreadLocalRandom(final long seed) public ThreadLocalRandom(long seed)
{ {
_seedLocal = new ThreadLocal<Seed>() _seedLocal = new ThreadLocal<Seed>()
{ {
@@ -278,13 +278,13 @@ public final class Rnd
} }
@Override @Override
public final int next(final int bits) public final int next(int bits)
{ {
return _seedLocal.get().next(bits); return _seedLocal.get().next(bits);
} }
@Override @Override
public final void setSeed(final long seed) public final void setSeed(long seed)
{ {
if (_seedLocal != null) if (_seedLocal != null)
{ {
@@ -323,7 +323,7 @@ public final class Rnd
* @param n The superior limit (exclusive) * @param n The superior limit (exclusive)
* @return A random integer number from 0 to n-1 * @return A random integer number from 0 to n-1
*/ */
public static final int get(final int n) public static final int get(int n)
{ {
return rnd.get(n); return rnd.get(n);
} }
@@ -334,7 +334,7 @@ public final class Rnd
* @param max The maximum value * @param max The maximum value
* @return A random integer number from min to max * @return A random integer number from min to max
*/ */
public static final int get(final int min, final int max) public static final int get(int min, int max)
{ {
return rnd.get(min, max); return rnd.get(min, max);
} }
@@ -345,12 +345,12 @@ public final class Rnd
* @param max The maximum value * @param max The maximum value
* @return A random long number from min to max * @return A random long number from min to max
*/ */
public static final long get(final long min, final long max) public static final long get(long min, long max)
{ {
return rnd.get(min, max); return rnd.get(min, max);
} }
public static final RandomContainer newInstance(final RandomType type) public static final RandomContainer newInstance(RandomType type)
{ {
switch (type) switch (type)
{ {
@@ -390,7 +390,7 @@ public final class Rnd
* @param array The array to be filled with random byte numbers * @param array The array to be filled with random byte numbers
* @see java.util.Random#nextBytes(byte[] bytes) * @see java.util.Random#nextBytes(byte[] bytes)
*/ */
public static final void nextBytes(final byte[] array) public static final void nextBytes(byte[] array)
{ {
rnd.nextBytes(array); rnd.nextBytes(array);
} }
@@ -440,7 +440,7 @@ public final class Rnd
* @return * @return
* @see com.l2jmobius.util.Rnd#get(int n) * @see com.l2jmobius.util.Rnd#get(int n)
*/ */
public static final int nextInt(final int n) public static final int nextInt(int n)
{ {
return get(n); return get(n);
} }
@@ -197,7 +197,7 @@ public final class StringUtil
* @param strings strings to be concatenated * @param strings strings to be concatenated
* @return concatenated string * @return concatenated string
*/ */
public static String concat(final String... strings) public static String concat(String... strings)
{ {
final StringBuilder sbString = new StringBuilder(); final StringBuilder sbString = new StringBuilder();
for (String string : strings) for (String string : strings)
@@ -213,7 +213,7 @@ public final class StringUtil
* @param strings strings to be appended * @param strings strings to be appended
* @return created string builder * @return created string builder
*/ */
public static StringBuilder startAppend(final int sizeHint, final String... strings) public static StringBuilder startAppend(int sizeHint, String... strings)
{ {
final int length = getLength(strings); final int length = getLength(strings);
final StringBuilder sbString = new StringBuilder(sizeHint > length ? sizeHint : length); final StringBuilder sbString = new StringBuilder(sizeHint > length ? sizeHint : length);
@@ -229,7 +229,7 @@ public final class StringUtil
* @param sbString string builder * @param sbString string builder
* @param strings strings to be appended * @param strings strings to be appended
*/ */
public static void append(final StringBuilder sbString, final String... strings) public static void append(StringBuilder sbString, String... strings)
{ {
sbString.ensureCapacity(sbString.length() + getLength(strings)); sbString.ensureCapacity(sbString.length() + getLength(strings));
@@ -239,7 +239,7 @@ public final class StringUtil
} }
} }
public static int getLength(final Iterable<String> strings) public static int getLength(Iterable<String> strings)
{ {
int length = 0; int length = 0;
for (String string : strings) for (String string : strings)
@@ -254,7 +254,7 @@ public final class StringUtil
* @param strings array of strings * @param strings array of strings
* @return total length of all the strings * @return total length of all the strings
*/ */
public static int getLength(final String[] strings) public static int getLength(String[] strings)
{ {
int length = 0; int length = 0;
for (String string : strings) for (String string : strings)

Some files were not shown because too many files have changed in this diff Show More