Various unnecessary code changes.

This commit is contained in:
MobiusDev
2018-06-26 15:00:56 +00:00
parent c9b04d53f4
commit 315a4e773c
869 changed files with 2683 additions and 12904 deletions

View File

@@ -18,14 +18,11 @@ package ai;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.holders.MinionHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.util.Broadcast;
/**
* Abstract NPC AI class for datapack based AIs.
@@ -73,27 +70,6 @@ public abstract class AbstractNpcAI extends Quest
addFactionCallId(mobs);
}
/**
* Broadcasts SocialAction packet to self and known players.
* @param character
* @param actionId
*/
protected void broadcastSocialAction(L2Character character, int actionId)
{
Broadcast.toSelfAndKnownPlayers(character, new SocialAction(character.getObjectId(), actionId));
}
/**
* Broadcasts SocialAction packet to self and known players in specific radius.
* @param character
* @param actionId
* @param radius
*/
protected void broadcastSocialAction(L2Character character, int actionId, int radius)
{
Broadcast.toSelfAndKnownPlayersInRadius(character, new SocialAction(character.getObjectId(), actionId), radius);
}
public void spawnMinions(L2Npc npc, String spawnName)
{
for (MinionHolder is : npc.getParameters().getMinionList(spawnName))

View File

@@ -276,7 +276,7 @@ public class AdminBuffs implements IAdminCommandHandler
* @param gmchar the player to switch the Game Master skills.
* @param toAuraSkills if {@code true} it will remove "GM Aura" skills and add "GM regular" skills, vice versa if {@code false}.
*/
public static void switchSkills(L2PcInstance gmchar, boolean toAuraSkills)
private static void switchSkills(L2PcInstance gmchar, boolean toAuraSkills)
{
final Collection<Skill> skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree() : SkillTreesData.getInstance().getGMAuraSkillTree();
for (Skill skill : skills)
@@ -292,7 +292,7 @@ public class AdminBuffs implements IAdminCommandHandler
return ADMIN_COMMANDS;
}
public static void showBuffs(L2PcInstance activeChar, L2Character target, int page, boolean passive)
private static void showBuffs(L2PcInstance activeChar, L2Character target, int page, boolean passive)
{
final List<BuffInfo> effects = new ArrayList<>();
if (!passive)

View File

@@ -464,7 +464,7 @@ public class AdminEventEngine implements IAdminCommandHandler
return note + result;
}
public void showMainPage(L2PcInstance activeChar)
private void showMainPage(L2PcInstance activeChar)
{
final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
@@ -473,7 +473,7 @@ public class AdminEventEngine implements IAdminCommandHandler
activeChar.sendPacket(adminReply);
}
public void showNewEventPage(L2PcInstance activeChar)
private void showNewEventPage(L2PcInstance activeChar)
{
final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
@@ -515,7 +515,7 @@ public class AdminEventEngine implements IAdminCommandHandler
activeChar.sendPacket(adminReply);
}
public void showEventParameters(L2PcInstance activeChar, int teamnumbers)
private void showEventParameters(L2PcInstance activeChar, int teamnumbers)
{
final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
final StringBuilder sb = new StringBuilder();

View File

@@ -77,7 +77,7 @@ public class AdminHtml implements IAdminCommandHandler
* @param activeChar activeChar where html is shown
* @param path relative path from directory data/html/admin/ to html
*/
public static void showAdminHtml(L2PcInstance activeChar, String path)
static void showAdminHtml(L2PcInstance activeChar, String path)
{
showHtml(activeChar, "data/html/admin/" + path, false);
}
@@ -88,7 +88,7 @@ public class AdminHtml implements IAdminCommandHandler
* @param path relative path from Config.DATAPACK_ROOT to html.
* @param reload {@code true} will reload html and show it {@code false} will show it from cache.
*/
public static void showHtml(L2PcInstance activeChar, String path, boolean reload)
private static void showHtml(L2PcInstance activeChar, String path, boolean reload)
{
String content = null;
if (!reload)

View File

@@ -42,7 +42,7 @@ import com.l2jmobius.gameserver.util.Util;
public class AdminQuest implements IAdminCommandHandler
{
public static final Logger LOGGER = Logger.getLogger(AdminQuest.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminQuest.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@@ -26,7 +26,7 @@ import com.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminSummon implements IAdminCommandHandler
{
public static final String[] ADMIN_COMMANDS =
private static final String[] ADMIN_COMMANDS =
{
"admin_summon"
};

View File

@@ -29,7 +29,7 @@ import com.l2jmobius.gameserver.model.skills.Skill;
*/
public final class AdminSuperHaste implements IAdminCommandHandler
{
public static final String[] ADMIN_COMMANDS =
static final String[] ADMIN_COMMANDS =
{
"admin_superhaste",
"admin_superhaste_menu",

View File

@@ -18,6 +18,7 @@ package handlers.bypasshandlers;
import java.util.logging.Level;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.handler.IBypassHandler;
import com.l2jmobius.gameserver.model.ClanPrivilege;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -41,6 +42,11 @@ public class ClanWarehouse implements IBypassHandler
@Override
public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
{
if (!Config.ALLOW_WAREHOUSE)
{
return false;
}
if (!target.isNpc())
{
return false;

View File

@@ -271,7 +271,7 @@ public class NpcViewMod implements IBypassHandler
activeChar.sendPacket(html);
}
public static void sendNpcSkillView(L2PcInstance activeChar, L2Npc npc)
private static void sendNpcSkillView(L2PcInstance activeChar, L2Npc npc)
{
final NpcHtmlMessage html = new NpcHtmlMessage();
html.setFile(activeChar, "data/html/mods/NpcView/Skills.htm");
@@ -303,7 +303,7 @@ public class NpcViewMod implements IBypassHandler
activeChar.sendPacket(html);
}
public static void sendAggroListView(L2PcInstance activeChar, L2Npc npc)
private static void sendAggroListView(L2PcInstance activeChar, L2Npc npc)
{
final NpcHtmlMessage html = new NpcHtmlMessage();
html.setFile(activeChar, "data/html/mods/NpcView/AggroList.htm");

View File

@@ -18,6 +18,7 @@ package handlers.bypasshandlers;
import java.util.logging.Level;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.handler.IBypassHandler;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -37,6 +38,11 @@ public class PrivateWarehouse implements IBypassHandler
@Override
public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
{
if (!Config.ALLOW_WAREHOUSE)
{
return false;
}
if (!target.isNpc())
{
return false;

View File

@@ -81,7 +81,7 @@ public class QuestLink implements IBypassHandler
* @param npc The table containing quests of the L2NpcInstance
* @param quests
*/
public static void showQuestChooseWindow(L2PcInstance player, L2Npc npc, Collection<Quest> quests)
private static void showQuestChooseWindow(L2PcInstance player, L2Npc npc, Collection<Quest> quests)
{
final StringBuilder sbStarted = new StringBuilder(128);
final StringBuilder sbCanStart = new StringBuilder(128);
@@ -186,7 +186,7 @@ public class QuestLink implements IBypassHandler
* @param npc the L2NpcInstance that chats with the {@code player}
* @param questId the Id of the quest to display the message
*/
public static void showQuestWindow(L2PcInstance player, L2Npc npc, String questId)
private static void showQuestWindow(L2PcInstance player, L2Npc npc, String questId)
{
String content = null;

View File

@@ -55,16 +55,16 @@ public class DropSearchBoard implements IParseBoardHandler
"_bbs_npc_trace"
};
class CBDropHolder
private class CBDropHolder
{
int itemId;
int npcId;
byte npcLevel;
long min;
long max;
double chance;
boolean isSpoil;
boolean isRaid;
final int itemId;
final int npcId;
final byte npcLevel;
final long min;
final long max;
final double chance;
final boolean isSpoil;
final boolean isRaid;
public CBDropHolder(L2NpcTemplate npcTemplate, DropHolder dropHolder)
{

View File

@@ -77,7 +77,7 @@ public final class HomeBoard implements IParseBoardHandler
Config.COMMUNITYBOARD_ENABLE_HEAL ? "_bbsheal" : null
};
public static final BiPredicate<String, L2PcInstance> COMBAT_CHECK = (command, activeChar) ->
private static final BiPredicate<String, L2PcInstance> COMBAT_CHECK = (command, activeChar) ->
{
boolean commandCheck = false;
for (String c : CUSTOM_COMMANDS)
@@ -92,7 +92,7 @@ public final class HomeBoard implements IParseBoardHandler
return commandCheck && (activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isInDuel() || activeChar.isInOlympiadMode() || activeChar.isInsideZone(ZoneId.SIEGE) || activeChar.isInsideZone(ZoneId.PVP));
};
public static final Predicate<L2PcInstance> KARMA_CHECK = player -> Config.COMMUNITYBOARD_KARMA_DISABLED && (player.getReputation() < 0);
private static final Predicate<L2PcInstance> KARMA_CHECK = player -> Config.COMMUNITYBOARD_KARMA_DISABLED && (player.getReputation() < 0);
@Override
public String[] getCommunityBoardCommands()

View File

@@ -24,7 +24,7 @@ import com.l2jmobius.gameserver.model.stats.Stats;
/**
* @author UnAfraid
*/
public abstract class AbstractConditionalHpEffect extends AbstractStatEffect
abstract class AbstractConditionalHpEffect extends AbstractStatEffect
{
private final int _hpPercent;

View File

@@ -39,7 +39,7 @@ public final class BlockSkill extends AbstractEffect
_magicTypes = params.getIntArray("magicTypes", ";");
}
public TerminateReturn onSkillUseEvent(OnCreatureSkillUse event)
private TerminateReturn onSkillUseEvent(OnCreatureSkillUse event)
{
if (CommonUtil.contains(_magicTypes, event.getSkill().getMagicType()))
{
@@ -65,5 +65,4 @@ public final class BlockSkill extends AbstractEffect
{
effected.removeListenerIf(EventType.ON_CREATURE_SKILL_USE, listener -> listener.getOwner() == this);
}
}

View File

@@ -29,8 +29,8 @@ import com.l2jmobius.gameserver.util.MathUtil;
*/
public class CriticalDamagePosition extends AbstractEffect
{
protected final double _amount;
protected final Position _position;
private final double _amount;
private final Position _position;
public CriticalDamagePosition(StatsSet params)
{

View File

@@ -29,8 +29,8 @@ import com.l2jmobius.gameserver.util.MathUtil;
*/
public class CriticalRatePositionBonus extends AbstractEffect
{
protected final double _amount;
protected final Position _position;
private final double _amount;
private final Position _position;
public CriticalRatePositionBonus(StatsSet params)
{

View File

@@ -36,7 +36,7 @@ import com.l2jmobius.gameserver.util.Util;
*/
public final class Fear extends AbstractEffect
{
public static final int FEAR_RANGE = 500;
private static final int FEAR_RANGE = 500;
public Fear(StatsSet params)
{

View File

@@ -31,7 +31,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class GetMomentum extends AbstractEffect
{
public static int _ticks;
private static int _ticks;
public GetMomentum(StatsSet params)
{

View File

@@ -100,7 +100,7 @@ public final class KnockBack extends AbstractEffect
}
}
public void knockBack(L2Character effector, L2Character effected)
private void knockBack(L2Character effector, L2Character effected)
{
final double radians = Math.toRadians(Util.calculateAngleFrom(effector, effected));
final int x = (int) (effected.getX() + (_distance * Math.cos(radians)));

View File

@@ -30,7 +30,7 @@ import com.l2jmobius.gameserver.model.skills.Skill;
public final class ModifyVital extends AbstractEffect
{
// Modify types
enum ModifyType
private enum ModifyType
{
DIFF,
SET,

View File

@@ -45,7 +45,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public final class RestorationRandom extends AbstractEffect
{
final List<L2ExtractableProductItem> _products = new ArrayList<>();
private final List<L2ExtractableProductItem> _products = new ArrayList<>();
public RestorationRandom(StatsSet params)
{

View File

@@ -69,7 +69,7 @@ public final class SoulEating extends AbstractEffect
effected.getStat().mergeAdd(Stats.MAX_SOULS, _maxSouls);
}
public void onExperienceReceived(L2Playable playable, long exp)
private void onExperienceReceived(L2Playable playable, long exp)
{
// TODO: Verify logic.
if (playable.isPlayer() && (exp >= _expNeeded))

View File

@@ -34,7 +34,7 @@ import com.l2jmobius.gameserver.model.stats.Stats;
public class StatBonusSkillCritical extends AbstractEffect
{
private final BaseStats _stat;
protected final Condition _armorTypeCondition;
private final Condition _armorTypeCondition;
public StatBonusSkillCritical(StatsSet params)
{

View File

@@ -34,7 +34,7 @@ import com.l2jmobius.gameserver.model.stats.Stats;
public class StatBonusSpeed extends AbstractEffect
{
private final BaseStats _stat;
protected final Condition _armorTypeCondition;
private final Condition _armorTypeCondition;
public StatBonusSpeed(StatsSet params)
{

View File

@@ -85,7 +85,7 @@ public final class TriggerSkillByAttack extends AbstractEffect
}
}
public void onAttackEvent(OnCreatureDamageDealt event)
private void onAttackEvent(OnCreatureDamageDealt event)
{
if (event.isDamageOverTime() || (_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLevel() == 0)) || (!_allowNormalAttack && !_allowSkillAttack))
{

View File

@@ -46,7 +46,6 @@ public final class TriggerSkillByAvoid extends AbstractEffect
/**
* @param params
*/
public TriggerSkillByAvoid(StatsSet params)
{
_chance = params.getInt("chance", 100);
@@ -54,7 +53,7 @@ public final class TriggerSkillByAvoid extends AbstractEffect
_targetType = params.getEnum("targetType", TargetType.class, TargetType.TARGET);
}
public void onAvoidEvent(OnCreatureAttackAvoid event)
private void onAvoidEvent(OnCreatureAttackAvoid event)
{
if (event.isDamageOverTime() || (_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLevel() == 0)))
{

View File

@@ -58,7 +58,7 @@ public final class TriggerSkillByDamage extends AbstractEffect
_attackerType = params.getEnum("attackerType", InstanceType.class, InstanceType.L2Character);
}
public void onDamageReceivedEvent(OnCreatureDamageReceived event)
private void onDamageReceivedEvent(OnCreatureDamageReceived event)
{
if (event.isDamageOverTime() || (_chance == 0) || (_skill.getSkillLevel() == 0))
{

View File

@@ -56,7 +56,7 @@ public final class TriggerSkillByDeathBlow extends AbstractEffect
_attackerType = params.getEnum("attackerType", InstanceType.class, InstanceType.L2Character);
}
public void onDamageReceivedEvent(OnCreatureDamageReceived event)
private void onDamageReceivedEvent(OnCreatureDamageReceived event)
{
if (event.getDamage() < event.getTarget().getCurrentHp())
{

View File

@@ -42,7 +42,7 @@ public final class TriggerSkillByKill extends AbstractEffect
_skill = new SkillHolder(params.getInt("skillId", 0), params.getInt("skillLevel", 0));
}
public void onCreatureKilled(OnCreatureKilled event, L2Character target)
private void onCreatureKilled(OnCreatureKilled event, L2Character target)
{
if ((_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLevel() == 0)))
{

View File

@@ -60,7 +60,7 @@ public final class TriggerSkillByMagicType extends AbstractEffect
_targetType = params.getEnum("targetType", TargetType.class, TargetType.TARGET);
}
public void onSkillUseEvent(OnCreatureSkillFinishCast event)
private void onSkillUseEvent(OnCreatureSkillFinishCast event)
{
if (!event.getTarget().isCharacter())
{

View File

@@ -36,11 +36,11 @@ public class TwoHandedBluntBonus extends AbstractEffect
private static final Condition _weaponTypeCondition = new ConditionUsingItemType(WeaponType.BLUNT.mask());
private static final Condition _slotCondition = new ConditionUsingSlotType(L2Item.SLOT_LR_HAND);
protected final double _pAtkAmount;
protected final StatModifierType _pAtkmode;
private final double _pAtkAmount;
private final StatModifierType _pAtkmode;
protected final double _accuracyAmount;
protected final StatModifierType _accuracyMode;
private final double _accuracyAmount;
private final StatModifierType _accuracyMode;
public TwoHandedBluntBonus(StatsSet params)
{

View File

@@ -36,11 +36,11 @@ public class TwoHandedSwordBonus extends AbstractEffect
private static final Condition _weaponTypeCondition = new ConditionUsingItemType(WeaponType.SWORD.mask());
private static final Condition _slotCondition = new ConditionUsingSlotType(L2Item.SLOT_LR_HAND);
protected final double _pAtkAmount;
protected final StatModifierType _pAtkmode;
private final double _pAtkAmount;
private final StatModifierType _pAtkmode;
protected final double _accuracyAmount;
protected final StatModifierType _accuracyMode;
private final double _accuracyAmount;
private final StatModifierType _accuracyMode;
public TwoHandedSwordBonus(StatsSet params)
{

View File

@@ -54,7 +54,7 @@ public class PetFood implements IItemHandler
return true;
}
public boolean useFood(L2Playable activeChar, int skillId, int skillLevel, L2ItemInstance item)
private boolean useFood(L2Playable activeChar, int skillId, int skillLevel, L2ItemInstance item)
{
final Skill skill = SkillData.getInstance().getSkill(skillId, skillLevel);
if (skill != null)

View File

@@ -58,7 +58,7 @@ public final class SitStand implements IPlayerActionHandler
* @param target the target to sit, throne, bench or chair
* @return {@code true} if the player can sit, {@code false} otherwise
*/
protected boolean useSit(L2PcInstance activeChar, L2Object target)
private boolean useSit(L2PcInstance activeChar, L2Object target)
{
if (activeChar.getMountType() != MountType.NONE)
{

View File

@@ -47,7 +47,7 @@ public class JailHandler implements IPunishmentHandler
Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_LOGIN, (OnPlayerLogin event) -> onPlayerLogin(event), this));
}
public void onPlayerLogin(OnPlayerLogin event)
private void onPlayerLogin(OnPlayerLogin event)
{
final L2PcInstance activeChar = event.getActiveChar();
if (activeChar.isJailed() && !activeChar.isInsideZone(ZoneId.JAIL))

View File

@@ -27,7 +27,7 @@ import com.l2jmobius.gameserver.model.skills.Skill;
*/
public class OpSkillAcquireSkillCondition implements ISkillCondition
{
final int _skillId;
private final int _skillId;
private final boolean _hasLearned;
public OpSkillAcquireSkillCondition(StatsSet params)

View File

@@ -28,7 +28,7 @@ import com.l2jmobius.gameserver.model.skills.Skill;
*/
public class TargetMyPartySkillCondition implements ISkillCondition
{
final boolean _includeMe;
private final boolean _includeMe;
public TargetMyPartySkillCondition(StatsSet params)
{

View File

@@ -251,7 +251,7 @@ public class Debug implements ITelnetCommand
throw new IllegalStateException("Deadlocked Thread not found");
}
public static String getServerStatus()
static String getServerStatus()
{
int playerCount = 0, objectCount = 0;
final int max = LoginServerThread.getInstance().getMaxPlayer();

View File

@@ -44,11 +44,6 @@ public class AutoPotion implements IVoicedCommandHandler
"apoff"
};
public static AutoPotion getInstance()
{
return null;
}
@Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{