More final and static cleanups.
This commit is contained in:
		| @@ -273,7 +273,7 @@ public class Alarm extends AbstractNpcAI | ||||
| 	 * @param questId the quest ID | ||||
| 	 * @param memoState the memo state | ||||
| 	 */ | ||||
| 	private static void setMemoState(PlayerInstance player, int questId, int memoState) | ||||
| 	private void setMemoState(PlayerInstance player, int questId, int memoState) | ||||
| 	{ | ||||
| 		QuestState qs = null; | ||||
| 		switch (questId) | ||||
| @@ -328,7 +328,7 @@ public class Alarm extends AbstractNpcAI | ||||
| 	 * @param slot the slot | ||||
| 	 * @param memoStateEx the memo state ex | ||||
| 	 */ | ||||
| 	private static void setMemoStateEx(PlayerInstance player, int questId, int slot, int memoStateEx) | ||||
| 	private void setMemoStateEx(PlayerInstance player, int questId, int slot, int memoStateEx) | ||||
| 	{ | ||||
| 		QuestState qs = null; | ||||
| 		switch (questId) | ||||
|   | ||||
| @@ -139,7 +139,7 @@ public class QuarryRebel extends AbstractNpcAI | ||||
| 		return super.onKill(npc, killer, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	private static void spawnNextMob(int npcId, Creature killer, Location loc) | ||||
| 	private void spawnNextMob(int npcId, Creature killer, Location loc) | ||||
| 	{ | ||||
| 		final Npc npc = addSpawn(npcId, loc.getX(), loc.getY(), loc.getZ(), killer.getHeading() + 32500, false, 300000); | ||||
| 		npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, killer, 1000); | ||||
|   | ||||
| @@ -246,7 +246,7 @@ public class StakatoNest extends AbstractNpcAI | ||||
| 		return null; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void giveCocoon(PlayerInstance player, Npc npc) | ||||
| 	private void giveCocoon(PlayerInstance player, Npc npc) | ||||
| 	{ | ||||
| 		player.addItem("StakatoCocoon", ((getRandom(100) > 80) ? LARGE_COCOON : SMALL_COCOON), 1, npc, true); | ||||
| 	} | ||||
|   | ||||
| @@ -223,7 +223,7 @@ public class Elpies extends Event | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	private static void dropItem(Npc mob, PlayerInstance player, int[][] droplist) | ||||
| 	private void dropItem(Npc mob, PlayerInstance player, int[][] droplist) | ||||
| 	{ | ||||
| 		final int chance = getRandom(100); | ||||
| 		 | ||||
|   | ||||
| @@ -240,7 +240,7 @@ public class Rabbits extends Event | ||||
| 		return super.onAttack(npc, attacker, damage, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	private static void dropItem(Npc npc, PlayerInstance player, int[][] droplist) | ||||
| 	private void dropItem(Npc npc, PlayerInstance player, int[][] droplist) | ||||
| 	{ | ||||
| 		final int chance = getRandom(100); | ||||
| 		for (int[] drop : droplist) | ||||
| @@ -253,7 +253,7 @@ public class Rabbits extends Event | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	private static void recordSpawn(List<Npc> npcs, int npcId, int x, int y, int z, int heading, boolean randomOffSet, long despawnDelay) | ||||
| 	private void recordSpawn(List<Npc> npcs, int npcId, int x, int y, int z, int heading, boolean randomOffSet, long despawnDelay) | ||||
| 	{ | ||||
| 		final Npc npc = addSpawn(npcId, x, y, z, heading, randomOffSet, despawnDelay); | ||||
| 		if (npc.getId() == CHEST) | ||||
|   | ||||
| @@ -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}. | ||||
| 	 */ | ||||
| 	private static void switchSkills(PlayerInstance gmchar, boolean toAuraSkills) | ||||
| 	private void switchSkills(PlayerInstance 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; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void showBuffs(PlayerInstance activeChar, Creature target, int page, boolean passive) | ||||
| 	private void showBuffs(PlayerInstance activeChar, Creature target, int page, boolean passive) | ||||
| 	{ | ||||
| 		final List<BuffInfo> effects = new ArrayList<>(); | ||||
| 		if (!passive) | ||||
| @@ -353,7 +353,7 @@ public class AdminBuffs implements IAdminCommandHandler | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	private static void removeBuff(PlayerInstance activeChar, int objId, int skillId) | ||||
| 	private void removeBuff(PlayerInstance activeChar, int objId, int skillId) | ||||
| 	{ | ||||
| 		Creature target = null; | ||||
| 		try | ||||
| @@ -380,7 +380,7 @@ public class AdminBuffs implements IAdminCommandHandler | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	private static void removeAllBuffs(PlayerInstance activeChar, int objId) | ||||
| 	private void removeAllBuffs(PlayerInstance activeChar, int objId) | ||||
| 	{ | ||||
| 		Creature target = null; | ||||
| 		try | ||||
| @@ -403,7 +403,7 @@ public class AdminBuffs implements IAdminCommandHandler | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	private static void viewBlockedEffects(PlayerInstance activeChar, int objId) | ||||
| 	private void viewBlockedEffects(PlayerInstance activeChar, int objId) | ||||
| 	{ | ||||
| 		Creature target = null; | ||||
| 		try | ||||
|   | ||||
| @@ -113,7 +113,7 @@ public class AdminChangeAccessLevel implements IAdminCommandHandler | ||||
| 	 * @param player the online target | ||||
| 	 * @param lvl the access level | ||||
| 	 */ | ||||
| 	private static void onlineChange(PlayerInstance activeChar, PlayerInstance player, int lvl) | ||||
| 	private void onlineChange(PlayerInstance activeChar, PlayerInstance player, int lvl) | ||||
| 	{ | ||||
| 		if (lvl >= 0) | ||||
| 		{ | ||||
|   | ||||
| @@ -174,7 +174,7 @@ public class AdminFence implements IAdminCommandHandler | ||||
| 		return ADMIN_COMMANDS; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void sendHtml(PlayerInstance activeChar, int page) | ||||
| 	private void sendHtml(PlayerInstance activeChar, int page) | ||||
| 	{ | ||||
| 		final PageResult result = PageBuilder.newBuilder(FenceData.getInstance().getFences().values(), 10, "bypass -h admin_listfence").currentPage(page).style(ButtonsStyle.INSTANCE).bodyHandler((pages, fence, sb) -> | ||||
| 		{ | ||||
|   | ||||
| @@ -153,7 +153,7 @@ public class AdminShowQuests implements IAdminCommandHandler | ||||
| 		return true; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void showFirstQuestMenu(PlayerInstance target, PlayerInstance actor) | ||||
| 	private void showFirstQuestMenu(PlayerInstance target, PlayerInstance actor) | ||||
| 	{ | ||||
| 		final StringBuilder replyMSG = new StringBuilder("<html><body><table width=270><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Player: " + target.getName() + "</center></td><td width=45><button value=\"Back\" action=\"bypass -h admin_admin6\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table>"); | ||||
| 		final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1); | ||||
| @@ -171,7 +171,7 @@ public class AdminShowQuests implements IAdminCommandHandler | ||||
| 		actor.sendPacket(adminReply); | ||||
| 	} | ||||
| 	 | ||||
| 	private static void showQuestMenu(PlayerInstance target, PlayerInstance actor, String[] val) | ||||
| 	private void showQuestMenu(PlayerInstance target, PlayerInstance actor, String[] val) | ||||
| 	{ | ||||
| 		try (Connection con = DatabaseFactory.getConnection()) | ||||
| 		{ | ||||
| @@ -317,7 +317,7 @@ public class AdminShowQuests implements IAdminCommandHandler | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	private static void setQuestVar(PlayerInstance target, PlayerInstance actor, String[] val) | ||||
| 	private void setQuestVar(PlayerInstance target, PlayerInstance actor, String[] val) | ||||
| 	{ | ||||
| 		QuestState qs = target.getQuestState(val[0]); | ||||
| 		final String[] outval = new String[3]; | ||||
|   | ||||
| @@ -111,7 +111,7 @@ public class AdminZone implements IAdminCommandHandler | ||||
| 		return true; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void showHtml(PlayerInstance activeChar) | ||||
| 	private void showHtml(PlayerInstance activeChar) | ||||
| 	{ | ||||
| 		final String htmContent = HtmCache.getInstance().getHtm(activeChar, "data/html/admin/zone.htm"); | ||||
| 		final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1); | ||||
| @@ -163,7 +163,7 @@ public class AdminZone implements IAdminCommandHandler | ||||
| 		activeChar.sendPacket(adminReply); | ||||
| 	} | ||||
| 	 | ||||
| 	private static void getGeoRegionXY(PlayerInstance activeChar) | ||||
| 	private void getGeoRegionXY(PlayerInstance activeChar) | ||||
| 	{ | ||||
| 		final int worldX = activeChar.getX(); | ||||
| 		final int worldY = activeChar.getY(); | ||||
|   | ||||
| @@ -271,7 +271,7 @@ public class NpcViewMod implements IBypassHandler | ||||
| 		player.sendPacket(html); | ||||
| 	} | ||||
| 	 | ||||
| 	private static void sendNpcSkillView(PlayerInstance player, Npc npc) | ||||
| 	private void sendNpcSkillView(PlayerInstance player, Npc npc) | ||||
| 	{ | ||||
| 		final NpcHtmlMessage html = new NpcHtmlMessage(); | ||||
| 		html.setFile(player, "data/html/mods/NpcView/Skills.htm"); | ||||
| @@ -303,7 +303,7 @@ public class NpcViewMod implements IBypassHandler | ||||
| 		player.sendPacket(html); | ||||
| 	} | ||||
| 	 | ||||
| 	private static void sendAggroListView(PlayerInstance player, Npc npc) | ||||
| 	private void sendAggroListView(PlayerInstance player, Npc npc) | ||||
| 	{ | ||||
| 		final NpcHtmlMessage html = new NpcHtmlMessage(); | ||||
| 		html.setFile(player, "data/html/mods/NpcView/AggroList.htm"); | ||||
| @@ -358,7 +358,7 @@ public class NpcViewMod implements IBypassHandler | ||||
| 		return sb.toString(); | ||||
| 	} | ||||
| 	 | ||||
| 	private static void sendNpcDropList(PlayerInstance player, Npc npc, DropType dropType, int page) | ||||
| 	private void sendNpcDropList(PlayerInstance player, Npc npc, DropType dropType, int page) | ||||
| 	{ | ||||
| 		final List<DropHolder> dropList = npc.getTemplate().getDropList(dropType); | ||||
| 		if (dropList == null) | ||||
|   | ||||
| @@ -154,7 +154,7 @@ public class Observation implements IBypassHandler | ||||
| 		return false; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void doObserve(PlayerInstance player, Npc npc, Location pos, long cost) | ||||
| 	private void doObserve(PlayerInstance player, Npc npc, Location pos, long cost) | ||||
| 	{ | ||||
| 		if (player.reduceAdena("Broadcast", cost, npc, true)) | ||||
| 		{ | ||||
|   | ||||
| @@ -78,7 +78,7 @@ public class PrivateWarehouse implements IBypassHandler | ||||
| 		return false; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void showWithdrawWindow(PlayerInstance player) | ||||
| 	private void showWithdrawWindow(PlayerInstance player) | ||||
| 	{ | ||||
| 		player.sendPacket(ActionFailed.STATIC_PACKET); | ||||
| 		player.setActiveWarehouse(player.getWarehouse()); | ||||
|   | ||||
| @@ -84,7 +84,7 @@ public class QuestLink implements IBypassHandler | ||||
| 	 * @param npc The table containing quests of the NpcInstance | ||||
| 	 * @param quests | ||||
| 	 */ | ||||
| 	private static void showQuestChooseWindow(PlayerInstance player, Npc npc, Collection<Quest> quests) | ||||
| 	private void showQuestChooseWindow(PlayerInstance player, Npc npc, Collection<Quest> quests) | ||||
| 	{ | ||||
| 		final StringBuilder sbStarted = new StringBuilder(128); | ||||
| 		final StringBuilder sbCanStart = new StringBuilder(128); | ||||
| @@ -241,7 +241,7 @@ public class QuestLink implements IBypassHandler | ||||
| 	 * @param npc the NpcInstance that chats with the {@code player} | ||||
| 	 * @param questId the Id of the quest to display the message | ||||
| 	 */ | ||||
| 	private static void showQuestWindow(PlayerInstance player, Npc npc, String questId) | ||||
| 	private void showQuestWindow(PlayerInstance player, Npc npc, String questId) | ||||
| 	{ | ||||
| 		String content = null; | ||||
| 		 | ||||
| @@ -296,7 +296,7 @@ public class QuestLink implements IBypassHandler | ||||
| 	 * @param player the PlayerInstance that talk with the {@code npc}. | ||||
| 	 * @param npc the NpcInstance that chats with the {@code player}. | ||||
| 	 */ | ||||
| 	private static void showQuestWindow(PlayerInstance player, Npc npc) | ||||
| 	private void showQuestWindow(PlayerInstance player, Npc npc) | ||||
| 	{ | ||||
| 		//@formatter:off | ||||
| 		final Set<Quest> quests = npc.getListeners(EventType.ON_NPC_TALK).stream() | ||||
|   | ||||
| @@ -68,7 +68,7 @@ public class Wear implements IBypassHandler | ||||
| 		return false; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void showWearWindow(PlayerInstance player, int val) | ||||
| 	private void showWearWindow(PlayerInstance player, int val) | ||||
| 	{ | ||||
| 		final ProductList buyList = BuyListData.getInstance().getBuyList(val); | ||||
| 		if (buyList == null) | ||||
|   | ||||
| @@ -89,7 +89,7 @@ public class BanHandler implements IPunishmentHandler | ||||
| 	 * Applies all punishment effects from the player. | ||||
| 	 * @param player | ||||
| 	 */ | ||||
| 	private static void applyToPlayer(PlayerInstance player) | ||||
| 	private void applyToPlayer(PlayerInstance player) | ||||
| 	{ | ||||
| 		Disconnection.of(player).defaultSequence(false); | ||||
| 	} | ||||
|   | ||||
| @@ -124,7 +124,7 @@ public class ChatBanHandler implements IPunishmentHandler | ||||
| 	 * @param task | ||||
| 	 * @param player | ||||
| 	 */ | ||||
| 	private static void applyToPlayer(PunishmentTask task, PlayerInstance player) | ||||
| 	private void applyToPlayer(PunishmentTask task, PlayerInstance player) | ||||
| 	{ | ||||
| 		final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000); | ||||
| 		if (delay > 0) | ||||
| @@ -142,7 +142,7 @@ public class ChatBanHandler implements IPunishmentHandler | ||||
| 	 * Removes any punishment effects from the player. | ||||
| 	 * @param player | ||||
| 	 */ | ||||
| 	private static void removeFromPlayer(PlayerInstance player) | ||||
| 	private void removeFromPlayer(PlayerInstance player) | ||||
| 	{ | ||||
| 		player.sendMessage("Your Chat ban has been lifted"); | ||||
| 		player.sendPacket(new EtcStatusUpdate(player)); | ||||
|   | ||||
| @@ -153,7 +153,7 @@ public class JailHandler implements IPunishmentHandler | ||||
| 	 * @param task | ||||
| 	 * @param player | ||||
| 	 */ | ||||
| 	private static void applyToPlayer(PunishmentTask task, PlayerInstance player) | ||||
| 	private void applyToPlayer(PunishmentTask task, PlayerInstance player) | ||||
| 	{ | ||||
| 		player.setInstance(null); | ||||
| 		 | ||||
| @@ -196,7 +196,7 @@ public class JailHandler implements IPunishmentHandler | ||||
| 	 * Removes any punishment effects from the player. | ||||
| 	 * @param player | ||||
| 	 */ | ||||
| 	private static void removeFromPlayer(PlayerInstance player) | ||||
| 	private void removeFromPlayer(PlayerInstance player) | ||||
| 	{ | ||||
| 		ThreadPool.schedule(new TeleportTask(player, JailZone.getLocationOut()), 2000); | ||||
| 		 | ||||
|   | ||||
| @@ -487,7 +487,7 @@ public class Kamaloka extends AbstractInstance | ||||
| 	 * Removing all buffs from player and pet except BUFFS_WHITELIST | ||||
| 	 * @param ch player | ||||
| 	 */ | ||||
| 	private static final void removeBuffs(Creature ch) | ||||
| 	private void removeBuffs(Creature ch) | ||||
| 	{ | ||||
| 		// Stop all buffs. | ||||
| 		ch.getEffectList().stopEffects(info -> (info != null) && !info.getSkill().isStayAfterDeath() && (Arrays.binarySearch(BUFFS_WHITELIST, info.getSkill().getId()) < 0), true, true); | ||||
|   | ||||
| @@ -444,7 +444,7 @@ public class Q00270_TheOneWhoEndsSilence extends Quest | ||||
| 	 * @param chance the reward chance | ||||
| 	 * @param atLeastOne if {@code true} it will reward two items if the chance is meet and one if the chance is not meet, if {@code false} if the chance is not meet doesn't reward, otherwise reward one item | ||||
| 	 */ | ||||
| 	private static void giveItem(PlayerInstance player, Npc npc, int chance, boolean atLeastOne) | ||||
| 	private void giveItem(PlayerInstance player, Npc npc, int chance, boolean atLeastOne) | ||||
| 	{ | ||||
| 		if ((player != null) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, npc, player, false)) | ||||
| 		{ | ||||
|   | ||||
| @@ -840,7 +840,7 @@ public class Q00420_LittleWing extends Quest | ||||
| 	 * Gives the reward to the player. | ||||
| 	 * @param player the player | ||||
| 	 */ | ||||
| 	private static void giveReward(PlayerInstance player) | ||||
| 	private void giveReward(PlayerInstance player) | ||||
| 	{ | ||||
| 		final int random = getRandom(100); | ||||
| 		for (int i : EGGS) | ||||
|   | ||||
| @@ -363,7 +363,7 @@ public class Q00453_NotStrongEnoughAlone extends Quest | ||||
| 		return htmltext; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void checkProgress(QuestState qs, int count, int... mobs) | ||||
| 	private void checkProgress(QuestState qs, int count, int... mobs) | ||||
| 	{ | ||||
| 		for (int mob : mobs) | ||||
| 		{ | ||||
|   | ||||
| @@ -782,7 +782,7 @@ public class Q00454_CompletelyLost extends Quest | ||||
| 	 * @param player the player | ||||
| 	 * @param stringId the NPC String | ||||
| 	 */ | ||||
| 	private static void whisper(Npc npc, PlayerInstance player, NpcStringId stringId) | ||||
| 	private void whisper(Npc npc, PlayerInstance player, NpcStringId stringId) | ||||
| 	{ | ||||
| 		player.sendPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), stringId)); | ||||
| 	} | ||||
|   | ||||
| @@ -193,7 +193,7 @@ public class Q00455_WingsOfSand extends Quest | ||||
| 	 * Reward the player. | ||||
| 	 * @param qs the quest state of the player to reward | ||||
| 	 */ | ||||
| 	private static void giveItems(QuestState qs) | ||||
| 	private void giveItems(QuestState qs) | ||||
| 	{ | ||||
| 		final PlayerInstance player = qs.getPlayer(); | ||||
| 		int chance; | ||||
|   | ||||
| @@ -319,7 +319,7 @@ public class Q00456_DontKnowDontCare extends Quest | ||||
| 		return super.onKill(npc, killer, isSummon); | ||||
| 	} | ||||
| 	 | ||||
| 	private static void rewardPlayer(PlayerInstance player, Npc npc) | ||||
| 	private void rewardPlayer(PlayerInstance player, Npc npc) | ||||
| 	{ | ||||
| 		final int chance = getRandom(10000); | ||||
| 		final int reward; | ||||
|   | ||||
| @@ -201,7 +201,7 @@ public class Q00901_HowLavasaurusesAreMade extends Quest | ||||
| 		return htmltext; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void giveQuestItems(QuestState qs, int itemId) | ||||
| 	private void giveQuestItems(QuestState qs, int itemId) | ||||
| 	{ | ||||
| 		final PlayerInstance player = qs.getPlayer(); | ||||
| 		if (getQuestItemsCount(player, itemId) < 10) | ||||
|   | ||||
| @@ -324,7 +324,7 @@ public class Q10289_FadeToBlack extends Quest | ||||
| 		return htmltext; | ||||
| 	} | ||||
| 	 | ||||
| 	private static void rewardPlayer(QuestState qs, boolean isLucky) | ||||
| 	private void rewardPlayer(QuestState qs, boolean isLucky) | ||||
| 	{ | ||||
| 		if ((qs != null) && qs.isCond(1)) | ||||
| 		{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment