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

@@ -71,7 +71,7 @@ import com.l2jmobius.gameserver.util.Util;
*/
public final class Config
{
protected static final Logger LOGGER = Logger.getLogger(Config.class.getName());
private static final Logger LOGGER = Logger.getLogger(Config.class.getName());
// --------------------------------------------------
// Constants
@@ -81,61 +81,60 @@ public final class Config
// --------------------------------------------------
// Config File Definitions
// --------------------------------------------------
public static final String ATTENDANCE_CONFIG_FILE = "./config/AttendanceRewards.ini";
public static final String CHARACTER_CONFIG_FILE = "./config/Character.ini";
public static final String CH_SIEGE_CONFIG_FILE = "./config/ConquerableHallSiege.ini";
public static final String FEATURE_CONFIG_FILE = "./config/Feature.ini";
public static final String FLOOD_PROTECTOR_CONFIG_FILE = "./config/FloodProtector.ini";
public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini";
public static final String GENERAL_CONFIG_FILE = "./config/General.ini";
public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini";
public static final String GRACIASEEDS_CONFIG_FILE = "./config/GraciaSeeds.ini";
public static final String GRANDBOSS_CONFIG_FILE = "./config/GrandBoss.ini";
public static final String IDFACTORY_CONFIG_FILE = "./config/IdFactory.ini";
public static final String LOGIN_CONFIG_FILE = "./config/LoginServer.ini";
public static final String NPC_CONFIG_FILE = "./config/NPC.ini";
public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini";
public static final String PVP_CONFIG_FILE = "./config/PVP.ini";
public static final String RATES_CONFIG_FILE = "./config/Rates.ini";
public static final String SERVER_CONFIG_FILE = "./config/Server.ini";
public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini";
public static final String TELNET_CONFIG_FILE = "./config/Telnet.ini";
public static final String TRAINING_CAMP_CONFIG_FILE = "./config/TrainingCamp.ini";
public static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
public static final String HEXID_FILE = "./config/hexid.txt";
public static final String IPCONFIG_FILE = "./config/ipconfig.xml";
public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini";
private static final String ATTENDANCE_CONFIG_FILE = "./config/AttendanceRewards.ini";
private static final String CHARACTER_CONFIG_FILE = "./config/Character.ini";
private static final String FEATURE_CONFIG_FILE = "./config/Feature.ini";
private static final String FLOOD_PROTECTOR_CONFIG_FILE = "./config/FloodProtector.ini";
private static final String GENERAL_CONFIG_FILE = "./config/General.ini";
private static final String GRACIASEEDS_CONFIG_FILE = "./config/GraciaSeeds.ini";
private static final String GRANDBOSS_CONFIG_FILE = "./config/GrandBoss.ini";
private static final String IDFACTORY_CONFIG_FILE = "./config/IdFactory.ini";
private static final String LOGIN_CONFIG_FILE = "./config/LoginServer.ini";
private static final String NPC_CONFIG_FILE = "./config/NPC.ini";
private static final String PVP_CONFIG_FILE = "./config/PVP.ini";
private static final String RATES_CONFIG_FILE = "./config/Rates.ini";
private static final String SERVER_CONFIG_FILE = "./config/Server.ini";
private static final String TELNET_CONFIG_FILE = "./config/Telnet.ini";
private static final String TRAINING_CAMP_CONFIG_FILE = "./config/TrainingCamp.ini";
private static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
private static final String HEXID_FILE = "./config/hexid.txt";
private static final String IPCONFIG_FILE = "./config/ipconfig.xml";
// --------------------------------------------------
// Custom Config File Definitions
// --------------------------------------------------
public static final String CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE = "./config/Custom/AllowedPlayerRaces.ini";
public static final String CUSTOM_AUTO_POTIONS_CONFIG_FILE = "./config/Custom/AutoPotions.ini";
public static final String CUSTOM_BANKING_CONFIG_FILE = "./config/Custom/Banking.ini";
public static final String CUSTOM_CHAMPION_MONSTERS_CONFIG_FILE = "./config/Custom/ChampionMonsters.ini";
public static final String CUSTOM_CHAT_MODERATION_CONFIG_FILE = "./config/Custom/ChatModeration.ini";
public static final String CUSTOM_COMMUNITY_BOARD_CONFIG_FILE = "./config/Custom/CommunityBoard.ini";
public static final String CUSTOM_DUALBOX_CHECK_CONFIG_FILE = "./config/Custom/DualboxCheck.ini";
public static final String CUSTOM_FACTION_SYSTEM_CONFIG_FILE = "./config/Custom/FactionSystem.ini";
public static final String CUSTOM_FAKE_PLAYERS_CONFIG_FILE = "./config/Custom/FakePlayers.ini";
public static final String CUSTOM_FIND_PVP_CONFIG_FILE = "./config/Custom/FindPvP.ini";
public static final String CUSTOM_MULTILANGUAL_SUPPORT_CONFIG_FILE = "./config/Custom/MultilingualSupport.ini";
public static final String CUSTOM_NPC_STAT_MULTIPIERS_CONFIG_FILE = "./config/Custom/NpcStatMultipliers.ini";
public static final String CUSTOM_OFFLINE_TRADE_CONFIG_FILE = "./config/Custom/OfflineTrade.ini";
public static final String CUSTOM_PASSWORD_CHANGE_CONFIG_FILE = "./config/Custom/PasswordChange.ini";
public static final String CUSTOM_PC_CAFE_CONFIG_FILE = "./config/Custom/PcCafe.ini";
public static final String CUSTOM_PREMIUM_SYSTEM_CONFIG_FILE = "./config/Custom/PremiumSystem.ini";
public static final String CUSTOM_PRIVATE_STORE_RANGE_CONFIG_FILE = "./config/Custom/PrivateStoreRange.ini";
public static final String CUSTOM_PVP_ANNOUNCE_CONFIG_FILE = "./config/Custom/PvpAnnounce.ini";
public static final String CUSTOM_PVP_REWARD_ITEM_CONFIG_FILE = "./config/Custom/PvpRewardItem.ini";
public static final String CUSTOM_PVP_TITLE_CONFIG_FILE = "./config/Custom/PvpTitleColor.ini";
public static final String CUSTOM_RANDOM_SPAWNS_CONFIG_FILE = "./config/Custom/RandomSpawns.ini";
public static final String CUSTOM_SAYUNE_FOR_ALL_CONFIG_FILE = "./config/Custom/SayuneForAll.ini";
public static final String CUSTOM_SCREEN_WELCOME_MESSAGE_CONFIG_FILE = "./config/Custom/ScreenWelcomeMessage.ini";
public static final String CUSTOM_SELL_BUFFS_CONFIG_FILE = "./config/Custom/SellBuffs.ini";
public static final String CUSTOM_SERVER_TIME_CONFIG_FILE = "./config/Custom/ServerTime.ini";
public static final String CUSTOM_STARTING_LOCATION_CONFIG_FILE = "./config/Custom/StartingLocation.ini";
public static final String CUSTOM_VOTE_REWARD_CONFIG_FILE = "./config/Custom/VoteReward.ini";
public static final String CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE = "./config/Custom/WalkerBotProtection.ini";
private static final String CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE = "./config/Custom/AllowedPlayerRaces.ini";
private static final String CUSTOM_AUTO_POTIONS_CONFIG_FILE = "./config/Custom/AutoPotions.ini";
private static final String CUSTOM_BANKING_CONFIG_FILE = "./config/Custom/Banking.ini";
private static final String CUSTOM_CHAMPION_MONSTERS_CONFIG_FILE = "./config/Custom/ChampionMonsters.ini";
private static final String CUSTOM_CHAT_MODERATION_CONFIG_FILE = "./config/Custom/ChatModeration.ini";
private static final String CUSTOM_COMMUNITY_BOARD_CONFIG_FILE = "./config/Custom/CommunityBoard.ini";
private static final String CUSTOM_DUALBOX_CHECK_CONFIG_FILE = "./config/Custom/DualboxCheck.ini";
private static final String CUSTOM_FACTION_SYSTEM_CONFIG_FILE = "./config/Custom/FactionSystem.ini";
private static final String CUSTOM_FAKE_PLAYERS_CONFIG_FILE = "./config/Custom/FakePlayers.ini";
private static final String CUSTOM_FIND_PVP_CONFIG_FILE = "./config/Custom/FindPvP.ini";
private static final String CUSTOM_MULTILANGUAL_SUPPORT_CONFIG_FILE = "./config/Custom/MultilingualSupport.ini";
private static final String CUSTOM_NPC_STAT_MULTIPIERS_CONFIG_FILE = "./config/Custom/NpcStatMultipliers.ini";
private static final String CUSTOM_OFFLINE_TRADE_CONFIG_FILE = "./config/Custom/OfflineTrade.ini";
private static final String CUSTOM_PASSWORD_CHANGE_CONFIG_FILE = "./config/Custom/PasswordChange.ini";
private static final String CUSTOM_PC_CAFE_CONFIG_FILE = "./config/Custom/PcCafe.ini";
private static final String CUSTOM_PREMIUM_SYSTEM_CONFIG_FILE = "./config/Custom/PremiumSystem.ini";
private static final String CUSTOM_PRIVATE_STORE_RANGE_CONFIG_FILE = "./config/Custom/PrivateStoreRange.ini";
private static final String CUSTOM_PVP_ANNOUNCE_CONFIG_FILE = "./config/Custom/PvpAnnounce.ini";
private static final String CUSTOM_PVP_REWARD_ITEM_CONFIG_FILE = "./config/Custom/PvpRewardItem.ini";
private static final String CUSTOM_PVP_TITLE_CONFIG_FILE = "./config/Custom/PvpTitleColor.ini";
private static final String CUSTOM_RANDOM_SPAWNS_CONFIG_FILE = "./config/Custom/RandomSpawns.ini";
private static final String CUSTOM_SAYUNE_FOR_ALL_CONFIG_FILE = "./config/Custom/SayuneForAll.ini";
private static final String CUSTOM_SCREEN_WELCOME_MESSAGE_CONFIG_FILE = "./config/Custom/ScreenWelcomeMessage.ini";
private static final String CUSTOM_SELL_BUFFS_CONFIG_FILE = "./config/Custom/SellBuffs.ini";
private static final String CUSTOM_SERVER_TIME_CONFIG_FILE = "./config/Custom/ServerTime.ini";
private static final String CUSTOM_STARTING_LOCATION_CONFIG_FILE = "./config/Custom/StartingLocation.ini";
private static final String CUSTOM_VOTE_REWARD_CONFIG_FILE = "./config/Custom/VoteReward.ini";
private static final String CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE = "./config/Custom/WalkerBotProtection.ini";
// --------------------------------------------------
// Variable Definitions
@@ -178,7 +177,6 @@ public final class Config
public static long EFFECT_TICK_RATIO;
public static boolean ENABLE_ALTER_SKILLS;
public static boolean LIFE_CRYSTAL_NEEDED;
public static boolean ES_SP_BOOK_NEEDED;
public static boolean DIVINE_SP_BOOK_NEEDED;
public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
public static boolean ALT_GAME_DUALCLASS_WITHOUT_QUEST;
@@ -410,7 +408,6 @@ public final class Config
public static boolean GM_TRADE_RESTRICTED_ITEMS;
public static boolean GM_RESTART_FIGHTING;
public static boolean GM_ANNOUNCER_NAME;
public static boolean GM_CRITANNOUNCER_NAME;
public static boolean GM_GIVE_SPECIAL_SKILLS;
public static boolean GM_GIVE_SPECIAL_AURA_SKILLS;
public static boolean GM_DEBUG_HTML_PATHS;
@@ -426,9 +423,7 @@ public final class Config
public static boolean SKILL_CHECK_REMOVE;
public static boolean SKILL_CHECK_GM;
public static boolean HTML_ACTION_CACHE_DEBUG;
public static boolean PACKET_HANDLER_DEBUG;
public static boolean DEVELOPER;
public static boolean ALT_DEV_NO_HANDLERS;
public static boolean ALT_DEV_NO_QUESTS;
public static boolean ALT_DEV_NO_SPAWNS;
public static boolean ALT_DEV_SHOW_QUESTS_LOAD_IN_LOGS;
@@ -491,7 +486,6 @@ public final class Config
public static int EJECT_DEAD_PLAYER_TIME;
public static boolean ALLOW_RACE;
public static boolean ALLOW_WATER;
public static boolean ALLOW_RENTPET;
public static boolean ALLOW_FISHING;
public static boolean ALLOW_BOAT;
public static int BOAT_BROADCAST_RADIUS;
@@ -556,18 +550,6 @@ public final class Config
public static boolean ALT_ITEM_AUCTION_ENABLED;
public static int ALT_ITEM_AUCTION_EXPIRED_AFTER;
public static long ALT_ITEM_AUCTION_TIME_EXTENDS_ON_BID;
public static int RIFT_MIN_PARTY_SIZE;
public static int RIFT_SPAWN_DELAY;
public static int RIFT_MAX_JUMPS;
public static int RIFT_AUTO_JUMPS_TIME_MIN;
public static int RIFT_AUTO_JUMPS_TIME_MAX;
public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
public static int RIFT_ENTER_COST_RECRUIT;
public static int RIFT_ENTER_COST_SOLDIER;
public static int RIFT_ENTER_COST_OFFICER;
public static int RIFT_ENTER_COST_CAPTAIN;
public static int RIFT_ENTER_COST_COMMANDER;
public static int RIFT_ENTER_COST_HERO;
public static IllegalActionPunishmentType DEFAULT_PUNISH;
public static int DEFAULT_PUNISH_PARAM;
public static boolean ONLY_GM_ITEMS_FREE;
@@ -589,8 +571,6 @@ public final class Config
public static int PLAYER_MOVEMENT_BLOCK_TIME;
public static int ABILITY_MAX_POINTS;
public static long ABILITY_POINTS_RESET_ADENA;
public static int NORMAL_ENCHANT_COST_MULTIPLIER;
public static int SAFE_ENCHANT_COST_MULTIPLIER;
public static boolean BOTREPORT_ENABLE;
public static String[] BOTREPORT_RESETPOINT_HOUR;
public static long BOTREPORT_REPORT_DELAY;
@@ -633,12 +613,10 @@ public final class Config
public static Map<Integer, Float> NPC_SKILL_DMG_PENALTY;
public static int MIN_NPC_LVL_MAGIC_PENALTY;
public static Map<Integer, Float> NPC_SKILL_CHANCE_PENALTY;
public static int DECAY_TIME_TASK;
public static int DEFAULT_CORPSE_TIME;
public static int SPOILED_CORPSE_EXTEND_TIME;
public static int CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY;
public static boolean GUARD_ATTACK_AGGRO_MOB;
public static boolean ALLOW_WYVERN_UPGRADER;
public static double RAID_HP_REGEN_MULTIPLIER;
public static double RAID_MP_REGEN_MULTIPLIER;
public static double RAID_PDEFENCE_MULTIPLIER;
@@ -664,7 +642,6 @@ public final class Config
// PvP Settings
// --------------------------------------------------
public static boolean KARMA_DROP_GM;
public static boolean KARMA_AWARD_PK_KILL;
public static int KARMA_PK_LIMIT;
public static String KARMA_NONDROPPABLE_PET_ITEMS;
public static String KARMA_NONDROPPABLE_ITEMS;
@@ -721,10 +698,6 @@ public final class Config
public static float RATE_KARMA_LOST;
public static float RATE_KARMA_EXP_LOST;
public static float RATE_SIEGE_GUARDS_PRICE;
public static float RATE_DROP_COMMON_HERBS;
public static float RATE_DROP_HP_HERBS;
public static float RATE_DROP_MP_HERBS;
public static float RATE_DROP_SPECIAL_HERBS;
public static int PLAYER_DROP_LIMIT;
public static int PLAYER_RATE_DROP;
public static int PLAYER_RATE_DROP_ITEM;
@@ -780,15 +753,6 @@ public final class Config
public static int SERVER_RESTART_SCHEDULE_COUNTDOWN;
public static String[] SERVER_RESTART_SCHEDULE;
// --------------------------------------------------
// MMO Settings
// --------------------------------------------------
public static int MMO_SELECTOR_SLEEP_TIME;
public static int MMO_MAX_SEND_PER_PASS;
public static int MMO_MAX_READ_PER_PASS;
public static int MMO_HELPER_BUFFER_COUNT;
public static boolean MMO_TCP_NODELAY;
// --------------------------------------------------
// Hardin (Agent of Chaos)
// --------------------------------------------------
@@ -807,7 +771,6 @@ public final class Config
public static boolean RAIDBOSS_USE_VITALITY;
public static float RATE_VITALITY_EXP_MULTIPLIER;
public static int VITALITY_MAX_ITEMS_ALLOWED;
public static float RATE_DROP_VITALITY_HERBS;
public static float RATE_VITALITY_LOST;
public static float RATE_VITALITY_GAIN;
@@ -840,22 +803,6 @@ public final class Config
public static double ENCHANT_CHANCE_ELEMENT_ENERGY;
public static int[] ENCHANT_BLACKLIST;
public static boolean DISABLE_OVER_ENCHANTING;
public static int AUGMENTATION_NG_SKILL_CHANCE;
public static int AUGMENTATION_NG_GLOW_CHANCE;
public static int AUGMENTATION_MID_SKILL_CHANCE;
public static int AUGMENTATION_MID_GLOW_CHANCE;
public static int AUGMENTATION_HIGH_SKILL_CHANCE;
public static int AUGMENTATION_HIGH_GLOW_CHANCE;
public static int AUGMENTATION_TOP_SKILL_CHANCE;
public static int AUGMENTATION_TOP_GLOW_CHANCE;
public static int AUGMENTATION_BASESTAT_CHANCE;
public static int AUGMENTATION_ACC_SKILL_CHANCE;
public static boolean RETAIL_LIKE_AUGMENTATION;
public static int[] RETAIL_LIKE_AUGMENTATION_NG_CHANCE;
public static int[] RETAIL_LIKE_AUGMENTATION_MID_CHANCE;
public static int[] RETAIL_LIKE_AUGMENTATION_HIGH_CHANCE;
public static int[] RETAIL_LIKE_AUGMENTATION_TOP_CHANCE;
public static boolean RETAIL_LIKE_AUGMENTATION_ACCESSORY;
public static int[] AUGMENTATION_BLACKLIST;
public static boolean ALT_ALLOW_AUGMENT_PVP_ITEMS;
public static double HP_REGEN_MULTIPLIER;
@@ -944,16 +891,12 @@ public final class Config
// Anakim
public static int ANAKIM_MIN_PLAYERS;
public static int ANAKIM_MAX_PLAYERS;
public static int ANAKIM_SPAWN_INTERVAL;
public static int ANAKIM_SPAWN_RANDOM;
public static int ANAKIM_MIN_PLAYER_LVL;
public static int ANAKIM_MAX_PLAYER_LVL;
// Lilith
public static int LILITH_MIN_PLAYERS;
public static int LILITH_MAX_PLAYERS;
public static int LILITH_SPAWN_INTERVAL;
public static int LILITH_SPAWN_RANDOM;
public static int LILITH_MIN_PLAYER_LVL;
public static int LILITH_MAX_PLAYER_LVL;
@@ -964,14 +907,6 @@ public final class Config
// chatfilter
public static List<String> FILTER_LIST;
// Conquerable Halls Settings
public static int CHS_CLAN_MINLEVEL;
public static int CHS_MAX_ATTACKERS;
public static int CHS_MAX_FLAGS_PER_CLAN;
public static boolean CHS_ENABLE_FAME;
public static int CHS_FAME_AMOUNT;
public static int CHS_FAME_FREQUENCY;
// --------------------------------------------------
// GeoEngine
// --------------------------------------------------
@@ -1149,7 +1084,6 @@ public final class Config
public static int COMMUNITYBOARD_TELEPORT_PRICE;
public static int COMMUNITYBOARD_BUFF_PRICE;
public static int COMMUNITYBOARD_HEAL_PRICE;
public static boolean COMMUNITYBOARD_COMBAT_DISABLED;
public static boolean COMMUNITYBOARD_KARMA_DISABLED;
public static boolean COMMUNITYBOARD_CAST_ANIMATIONS;
public static boolean COMMUNITY_PREMIUM_SYSTEM_ENABLED;
@@ -1557,7 +1491,6 @@ public final class Config
EFFECT_TICK_RATIO = Character.getLong("EffectTickRatio", 666);
ENABLE_ALTER_SKILLS = Character.getBoolean("EnableAlterSkills", true);
LIFE_CRYSTAL_NEEDED = Character.getBoolean("LifeCrystalNeeded", true);
ES_SP_BOOK_NEEDED = Character.getBoolean("EnchantSkillSpBookNeeded", true);
DIVINE_SP_BOOK_NEEDED = Character.getBoolean("DivineInspirationSpBookNeeded", true);
ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Character.getBoolean("AltSubClassWithoutQuests", false);
ALT_GAME_DUALCLASS_WITHOUT_QUEST = Character.getBoolean("AltDualClassWithoutQuest", false);
@@ -1623,45 +1556,7 @@ public final class Config
}
Arrays.sort(ENCHANT_BLACKLIST);
DISABLE_OVER_ENCHANTING = Character.getBoolean("DisableOverEnchanting", true);
AUGMENTATION_NG_SKILL_CHANCE = Character.getInt("AugmentationNGSkillChance", 15);
AUGMENTATION_NG_GLOW_CHANCE = Character.getInt("AugmentationNGGlowChance", 0);
AUGMENTATION_MID_SKILL_CHANCE = Character.getInt("AugmentationMidSkillChance", 30);
AUGMENTATION_MID_GLOW_CHANCE = Character.getInt("AugmentationMidGlowChance", 40);
AUGMENTATION_HIGH_SKILL_CHANCE = Character.getInt("AugmentationHighSkillChance", 45);
AUGMENTATION_HIGH_GLOW_CHANCE = Character.getInt("AugmentationHighGlowChance", 70);
AUGMENTATION_TOP_SKILL_CHANCE = Character.getInt("AugmentationTopSkillChance", 60);
AUGMENTATION_TOP_GLOW_CHANCE = Character.getInt("AugmentationTopGlowChance", 100);
AUGMENTATION_BASESTAT_CHANCE = Character.getInt("AugmentationBaseStatChance", 1);
AUGMENTATION_ACC_SKILL_CHANCE = Character.getInt("AugmentationAccSkillChance", 0);
RETAIL_LIKE_AUGMENTATION = Character.getBoolean("RetailLikeAugmentation", true);
String[] array = Character.getString("RetailLikeAugmentationNoGradeChance", "55,35,7,3").split(",");
RETAIL_LIKE_AUGMENTATION_NG_CHANCE = new int[array.length];
for (int i = 0; i < 4; i++)
{
RETAIL_LIKE_AUGMENTATION_NG_CHANCE[i] = Integer.parseInt(array[i]);
}
array = Character.getString("RetailLikeAugmentationMidGradeChance", "55,35,7,3").split(",");
RETAIL_LIKE_AUGMENTATION_MID_CHANCE = new int[array.length];
for (int i = 0; i < 4; i++)
{
RETAIL_LIKE_AUGMENTATION_MID_CHANCE[i] = Integer.parseInt(array[i]);
}
array = Character.getString("RetailLikeAugmentationHighGradeChance", "55,35,7,3").split(",");
RETAIL_LIKE_AUGMENTATION_HIGH_CHANCE = new int[array.length];
for (int i = 0; i < 4; i++)
{
RETAIL_LIKE_AUGMENTATION_HIGH_CHANCE[i] = Integer.parseInt(array[i]);
}
array = Character.getString("RetailLikeAugmentationTopGradeChance", "55,35,7,3").split(",");
RETAIL_LIKE_AUGMENTATION_TOP_CHANCE = new int[array.length];
for (int i = 0; i < 4; i++)
{
RETAIL_LIKE_AUGMENTATION_TOP_CHANCE[i] = Integer.parseInt(array[i]);
}
RETAIL_LIKE_AUGMENTATION_ACCESSORY = Character.getBoolean("RetailLikeAugmentationAccessory", true);
array = Character.getString("AugmentationBlackList", "6656,6657,6658,6659,6660,6661,6662,8191,10170,10314,13740,13741,13742,13743,13744,13745,13746,13747,13748,14592,14593,14594,14595,14596,14597,14598,14599,14600,14664,14665,14666,14667,14668,14669,14670,14671,14672,14801,14802,14803,14804,14805,14806,14807,14808,14809,15282,15283,15284,15285,15286,15287,15288,15289,15290,15291,15292,15293,15294,15295,15296,15297,15298,15299,16025,16026,21712,22173,22174,22175").split(",");
String[] array = Character.getString("AugmentationBlackList", "6656,6657,6658,6659,6660,6661,6662,8191,10170,10314,13740,13741,13742,13743,13744,13745,13746,13747,13748,14592,14593,14594,14595,14596,14597,14598,14599,14600,14664,14665,14666,14667,14668,14669,14670,14671,14672,14801,14802,14803,14804,14805,14806,14807,14808,14809,15282,15283,15284,15285,15286,15287,15288,15289,15290,15291,15292,15293,15294,15295,15296,15297,15298,15299,16025,16026,21712,22173,22174,22175").split(",");
AUGMENTATION_BLACKLIST = new int[array.length];
for (int i = 0; i < array.length; i++)
@@ -1782,7 +1677,7 @@ public final class Config
SHOW_GOD_VIDEO_INTRO = Character.getBoolean("GoDVideoIntro", true);
PLAYER_MOVEMENT_BLOCK_TIME = Character.getInt("NpcTalkBlockingTime", 0) * 1000;
ABILITY_MAX_POINTS = Character.getInt("AbilityMaxPoints", 16);
ABILITY_POINTS_RESET_ADENA = Character.getLong("AbilityPointsResetAdena", 10_000_000);
ABILITY_POINTS_RESET_ADENA = Character.getLong("AbilityPointsResetAdena", 10000000);
// Load Telnet config file (if exists)
final PropertiesParser telnetSettings = new PropertiesParser(TELNET_CONFIG_FILE);
@@ -1826,7 +1721,6 @@ public final class Config
GM_TRADE_RESTRICTED_ITEMS = General.getBoolean("GMTradeRestrictedItems", false);
GM_RESTART_FIGHTING = General.getBoolean("GMRestartFighting", true);
GM_ANNOUNCER_NAME = General.getBoolean("GMShowAnnouncerName", false);
GM_CRITANNOUNCER_NAME = General.getBoolean("GMShowCritAnnouncerName", false);
GM_GIVE_SPECIAL_SKILLS = General.getBoolean("GMGiveSpecialSkills", false);
GM_GIVE_SPECIAL_AURA_SKILLS = General.getBoolean("GMGiveSpecialAuraSkills", false);
GM_DEBUG_HTML_PATHS = General.getBoolean("GMDebugHtmlPaths", true);
@@ -1842,9 +1736,7 @@ public final class Config
SKILL_CHECK_REMOVE = General.getBoolean("SkillCheckRemove", false);
SKILL_CHECK_GM = General.getBoolean("SkillCheckGM", true);
HTML_ACTION_CACHE_DEBUG = General.getBoolean("HtmlActionCacheDebug", false);
PACKET_HANDLER_DEBUG = General.getBoolean("PacketHandlerDebug", false);
DEVELOPER = General.getBoolean("Developer", false);
ALT_DEV_NO_HANDLERS = General.getBoolean("AltDevNoHandlers", false) || Boolean.getBoolean("nohandlers");
ALT_DEV_NO_QUESTS = General.getBoolean("AltDevNoQuests", false) || Boolean.getBoolean("noquests");
ALT_DEV_NO_SPAWNS = General.getBoolean("AltDevNoSpawns", false) || Boolean.getBoolean("nospawns");
ALT_DEV_SHOW_QUESTS_LOAD_IN_LOGS = General.getBoolean("AltDevShowQuestsLoadInLogs", false);
@@ -1903,7 +1795,6 @@ public final class Config
EJECT_DEAD_PLAYER_TIME = General.getInt("EjectDeadPlayerTime", 1);
ALLOW_RACE = General.getBoolean("AllowRace", true);
ALLOW_WATER = General.getBoolean("AllowWater", true);
ALLOW_RENTPET = General.getBoolean("AllowRentPet", false);
ALLOW_FISHING = General.getBoolean("AllowFishing", true);
ALLOW_MANOR = General.getBoolean("AllowManor", true);
ALLOW_BOAT = General.getBoolean("AllowBoat", true);
@@ -1940,18 +1831,6 @@ public final class Config
ALT_ITEM_AUCTION_ENABLED = General.getBoolean("AltItemAuctionEnabled", true);
ALT_ITEM_AUCTION_EXPIRED_AFTER = General.getInt("AltItemAuctionExpiredAfter", 14);
ALT_ITEM_AUCTION_TIME_EXTENDS_ON_BID = General.getInt("AltItemAuctionTimeExtendsOnBid", 0) * 1000;
RIFT_MIN_PARTY_SIZE = General.getInt("RiftMinPartySize", 5);
RIFT_MAX_JUMPS = General.getInt("MaxRiftJumps", 4);
RIFT_SPAWN_DELAY = General.getInt("RiftSpawnDelay", 10000);
RIFT_AUTO_JUMPS_TIME_MIN = General.getInt("AutoJumpsDelayMin", 480);
RIFT_AUTO_JUMPS_TIME_MAX = General.getInt("AutoJumpsDelayMax", 600);
RIFT_BOSS_ROOM_TIME_MUTIPLY = General.getFloat("BossRoomTimeMultiply", 1.5f);
RIFT_ENTER_COST_RECRUIT = General.getInt("RecruitCost", 18);
RIFT_ENTER_COST_SOLDIER = General.getInt("SoldierCost", 21);
RIFT_ENTER_COST_OFFICER = General.getInt("OfficerCost", 24);
RIFT_ENTER_COST_CAPTAIN = General.getInt("CaptainCost", 27);
RIFT_ENTER_COST_COMMANDER = General.getInt("CommanderCost", 30);
RIFT_ENTER_COST_HERO = General.getInt("HeroCost", 33);
DEFAULT_PUNISH = IllegalActionPunishmentType.findByName(General.getString("DefaultPunish", "KICK"));
DEFAULT_PUNISH_PARAM = General.getInt("DefaultPunishParam", 0);
ONLY_GM_ITEMS_FREE = General.getBoolean("OnlyGMItemsFree", true);
@@ -1979,9 +1858,6 @@ public final class Config
}
HBCE_FAIR_PLAY = General.getBoolean("HBCEFairPlay", false);
NORMAL_ENCHANT_COST_MULTIPLIER = General.getInt("NormalEnchantCostMultipiler", 1);
SAFE_ENCHANT_COST_MULTIPLIER = General.getInt("SafeEnchantCostMultipiler", 5);
BOTREPORT_ENABLE = General.getBoolean("EnableBotReportButton", false);
BOTREPORT_RESETPOINT_HOUR = General.getString("BotReportPointsResetHour", "00:00").split(":");
BOTREPORT_REPORT_DELAY = General.getInt("BotReportDelay", 30) * 60000;
@@ -2010,12 +1886,10 @@ public final class Config
NPC_SKILL_DMG_PENALTY = parseConfigLine(NPC.getString("SkillDmgPenaltyForLvLDifferences", "0.8, 0.7, 0.65, 0.62"));
MIN_NPC_LVL_MAGIC_PENALTY = NPC.getInt("MinNPCLevelForMagicPenalty", 78);
NPC_SKILL_CHANCE_PENALTY = parseConfigLine(NPC.getString("SkillChancePenaltyForLvLDifferences", "2.5, 3.0, 3.25, 3.5"));
DECAY_TIME_TASK = NPC.getInt("DecayTimeTask", 5000);
DEFAULT_CORPSE_TIME = NPC.getInt("DefaultCorpseTime", 7);
SPOILED_CORPSE_EXTEND_TIME = NPC.getInt("SpoiledCorpseExtendTime", 10);
CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY = NPC.getInt("CorpseConsumeSkillAllowedTimeBeforeDecay", 2000);
GUARD_ATTACK_AGGRO_MOB = NPC.getBoolean("GuardAttackAggroMob", false);
ALLOW_WYVERN_UPGRADER = NPC.getBoolean("AllowWyvernUpgrader", false);
RAID_HP_REGEN_MULTIPLIER = NPC.getDouble("RaidHpRegenMultiplier", 100) / 100;
RAID_MP_REGEN_MULTIPLIER = NPC.getDouble("RaidMpRegenMultiplier", 100) / 100;
RAID_PDEFENCE_MULTIPLIER = NPC.getDouble("RaidPDefenceMultiplier", 100) / 100;
@@ -2207,7 +2081,6 @@ public final class Config
final PropertiesParser PVPSettings = new PropertiesParser(PVP_CONFIG_FILE);
KARMA_DROP_GM = PVPSettings.getBoolean("CanGMDropEquipment", false);
KARMA_AWARD_PK_KILL = PVPSettings.getBoolean("AwardPKKillPVPPoint", false);
KARMA_PK_LIMIT = PVPSettings.getInt("MinimumPKRequiredToDrop", 5);
KARMA_NONDROPPABLE_PET_ITEMS = PVPSettings.getString("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
KARMA_NONDROPPABLE_ITEMS = PVPSettings.getString("ListOfNonDroppableItems", "57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,7694,8181,5575,7694,9388,9389,9390");
@@ -2357,22 +2230,20 @@ public final class Config
ANAKIM_MIN_PLAYERS = GrandBossSettings.getInt("AnakimMinPlayers", 98);
ANAKIM_MAX_PLAYERS = GrandBossSettings.getInt("AnakimMaxPlayers", 120);
ANAKIM_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfAnakimSpawn", 192);
ANAKIM_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfAnakimSpawn", 148);
ANAKIM_MIN_PLAYER_LVL = GrandBossSettings.getInt("AnakimMinPlayerLvl", 90);
ANAKIM_MAX_PLAYER_LVL = GrandBossSettings.getInt("AnakimMaxPlayerLvl", 94);
LILITH_MIN_PLAYERS = GrandBossSettings.getInt("LilithMinPlayers", 98);
LILITH_MAX_PLAYERS = GrandBossSettings.getInt("LilithMaxPlayers", 120);
LILITH_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfLilithSpawn", 192);
LILITH_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfLilithSpawn", 148);
LILITH_MIN_PLAYER_LVL = GrandBossSettings.getInt("LilithMinPlayerLvl", 85);
LILITH_MAX_PLAYER_LVL = GrandBossSettings.getInt("LilithMaxPlayerLvl", 89);
TRASKEN_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfTraskenSpawn", 264);
TRASKEN_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfTraskenSpawn", 72);
TRASKEN_MIN_PLAYERS = GrandBossSettings.getInt("TraskenMinPlayers", 49);
TRASKEN_MAX_PLAYERS = GrandBossSettings.getInt("TraskenMaxPlayers", 112);
TRASKEN_MIN_PLAYER_LVL = GrandBossSettings.getInt("TraskenMinPlayerLvl", 85);
LINDVIOR_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfLindviorSpawn", 264);
LINDVIOR_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfLindviorSpawn", 72);
LINDVIOR_MIN_PLAYERS = GrandBossSettings.getInt("LindviorMinPlayers", 49);
@@ -2401,15 +2272,6 @@ public final class Config
LOGGER.log(Level.WARNING, "Error while loading chat filter words!", e);
}
final PropertiesParser ClanHallSiege = new PropertiesParser(CH_SIEGE_CONFIG_FILE);
CHS_MAX_ATTACKERS = ClanHallSiege.getInt("MaxAttackers", 500);
CHS_CLAN_MINLEVEL = ClanHallSiege.getInt("MinClanLevel", 4);
CHS_MAX_FLAGS_PER_CLAN = ClanHallSiege.getInt("MaxFlagsPerClan", 1);
CHS_ENABLE_FAME = ClanHallSiege.getBoolean("EnableFame", false);
CHS_FAME_AMOUNT = ClanHallSiege.getInt("FameAmount", 0);
CHS_FAME_FREQUENCY = ClanHallSiege.getInt("FameFrequency", 0);
final PropertiesParser geoData = new PropertiesParser(GEOENGINE_CONFIG_FILE);
GEODATA_PATH = geoData.getString("GeoDataPath", "./data/geodata/");
@@ -2552,7 +2414,6 @@ public final class Config
COMMUNITYBOARD_TELEPORT_PRICE = CommunityBoard.getInt("CommunityTeleportPrice", 0);
COMMUNITYBOARD_BUFF_PRICE = CommunityBoard.getInt("CommunityBuffPrice", 0);
COMMUNITYBOARD_HEAL_PRICE = CommunityBoard.getInt("CommunityHealPrice", 0);
COMMUNITYBOARD_COMBAT_DISABLED = CommunityBoard.getBoolean("CommunityCombatDisabled", true);
COMMUNITYBOARD_KARMA_DISABLED = CommunityBoard.getBoolean("CommunityKarmaDisabled", true);
COMMUNITYBOARD_CAST_ANIMATIONS = CommunityBoard.getBoolean("CommunityCastAnimations", false);
COMMUNITY_PREMIUM_SYSTEM_ENABLED = CommunityBoard.getBoolean("CommunityPremiumSystem", false);
@@ -3009,7 +2870,7 @@ public final class Config
* @param hexId the hexadecimal ID to store
* @param fileName name of the config file
*/
public static void saveHexid(int serverId, String hexId, String fileName)
private static void saveHexid(int serverId, String hexId, String fileName)
{
try
{

View File

@@ -37,10 +37,10 @@ import com.l2jmobius.Config;
*/
public final class ThreadPool
{
protected static final Logger LOGGER = Logger.getLogger(ThreadPool.class.getName());
private static final Logger LOGGER = Logger.getLogger(ThreadPool.class.getName());
protected static ScheduledThreadPoolExecutor[] SCHEDULED_POOLS;
protected static ThreadPoolExecutor[] INSTANT_POOLS;
private static ScheduledThreadPoolExecutor[] SCHEDULED_POOLS;
private static ThreadPoolExecutor[] INSTANT_POOLS;
private static int THREAD_POOL_RANDOMIZER;
/**

View File

@@ -21,9 +21,9 @@ import java.net.UnknownHostException;
public class IPSubnet
{
final byte[] _addr;
final byte[] _mask;
final boolean _isIPv4;
private final byte[] _addr;
private final byte[] _mask;
private final boolean _isIPv4;
public IPSubnet(String input) throws UnknownHostException, NumberFormatException, ArrayIndexOutOfBoundsException
{
@@ -47,23 +47,12 @@ public class IPSubnet
}
}
public IPSubnet(InetAddress addr, int mask) throws UnknownHostException
{
_addr = addr.getAddress();
_isIPv4 = _addr.length == 4;
_mask = getMask(mask, _addr.length);
if (!applyMask(_addr))
{
throw new UnknownHostException(addr + "/" + mask);
}
}
public byte[] getAddress()
{
return _addr;
}
public boolean applyMask(byte[] addr)
private boolean applyMask(byte[] addr)
{
// V4 vs V4 or V6 vs V6 checks
if (_isIPv4 == (addr.length == 4))

View File

@@ -24,7 +24,7 @@ import java.time.temporal.ChronoUnit;
*/
public class TimeUtil
{
public static int findIndexOfNonDigit(CharSequence text)
private static int findIndexOfNonDigit(CharSequence text)
{
for (int i = 0; i < text.length(); i++)
{

View File

@@ -25,8 +25,8 @@ import java.util.logging.Logger;
public class ScrambledKeyPair
{
private static Logger LOGGER = Logger.getLogger(ScrambledKeyPair.class.getName());
public KeyPair _pair;
public byte[] _scrambledModulus;
private final KeyPair _pair;
private final byte[] _scrambledModulus;
public ScrambledKeyPair(KeyPair pPair)
{

View File

@@ -30,7 +30,7 @@ import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
*/
public class FortUpdater implements Runnable
{
protected static Logger LOGGER = Logger.getLogger(FortUpdater.class.getName());
private static Logger LOGGER = Logger.getLogger(FortUpdater.class.getName());
private final L2Clan _clan;
private final Fort _fort;
private int _runCount;

View File

@@ -488,7 +488,7 @@ public class GameServer
INSTANCE = new GameServer();
}
public static void printSection(String s)
private static void printSection(String s)
{
s = "=[ " + s + " ]";
while (s.length() < 61)

View File

@@ -39,9 +39,7 @@ public final class GameTimeController extends Thread
public static final int IG_DAYS_PER_DAY = 6;
public static final int MILLIS_PER_IG_DAY = (3600000 * 24) / IG_DAYS_PER_DAY;
public static final int SECONDS_PER_IG_DAY = MILLIS_PER_IG_DAY / 1000;
public static final int MINUTES_PER_IG_DAY = SECONDS_PER_IG_DAY / 60;
public static final int TICKS_PER_IG_DAY = SECONDS_PER_IG_DAY * TICKS_PER_SECOND;
public static final int TICKS_SUN_STATE_CHANGE = TICKS_PER_IG_DAY / 4;
private static GameTimeController _instance;

View File

@@ -46,7 +46,7 @@ public final class ItemsAutoDestroy
_items.add(item);
}
public synchronized void removeItems()
private synchronized void removeItems()
{
if (_items.isEmpty())
{

View File

@@ -60,10 +60,10 @@ public class Shutdown extends Thread
private int _secondsShut;
private int _shutdownMode;
public static final int SIGTERM = 0;
public static final int GM_SHUTDOWN = 1;
public static final int GM_RESTART = 2;
public static final int ABORT = 3;
private static final int SIGTERM = 0;
private static final int GM_SHUTDOWN = 1;
private static final int GM_RESTART = 2;
private static final int ABORT = 3;
private static final String[] MODE_TEXT =
{
"SIGTERM",

View File

@@ -81,7 +81,7 @@ public abstract class AbstractAI implements Ctrl
/** Flags about client's state, in order to know which messages to send */
protected volatile boolean _clientMoving;
/** Flags about client's state, in order to know which messages to send */
protected volatile boolean _clientAutoAttacking;
private volatile boolean _clientAutoAttacking;
/** Flags about client's state, in order to know which messages to send */
protected int _clientMovingToPawnOffset;
@@ -97,7 +97,7 @@ public abstract class AbstractAI implements Ctrl
/** Different internal state flags */
protected int _moveToPawnTimeout;
protected Future<?> _followTask = null;
private Future<?> _followTask = null;
private static final int FOLLOW_INTERVAL = 1000;
private static final int ATTACK_FOLLOW_INTERVAL = 500;
@@ -630,7 +630,7 @@ public abstract class AbstractAI implements Ctrl
* Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop <I>(broadcast)</I>.<br>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : Low level function, used by AI subclasses</B></FONT>
*/
public void clientStopAutoAttack()
void clientStopAutoAttack()
{
if (_actor.isSummon())
{

View File

@@ -36,14 +36,14 @@ public class L2PlayerAI extends L2PlayableAI
{
private boolean _thinking; // to prevent recursive thinking
IntentionCommand _nextIntention = null;
private IntentionCommand _nextIntention = null;
public L2PlayerAI(L2PcInstance player)
{
super(player);
}
void saveNextIntention(CtrlIntention intention, Object arg0, Object arg1)
private void saveNextIntention(CtrlIntention intention, Object arg0, Object arg1)
{
_nextIntention = new IntentionCommand(intention, arg0, arg1);
}

View File

@@ -28,8 +28,8 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
*/
public class WarehouseCacheManager
{
protected final Map<L2PcInstance, Long> _cachedWh = new ConcurrentHashMap<>();
protected final long _cacheTime = Config.WAREHOUSE_CACHE_TIME * 60000;
final Map<L2PcInstance, Long> _cachedWh = new ConcurrentHashMap<>();
final long _cacheTime = Config.WAREHOUSE_CACHE_TIME * 60000;
protected WarehouseCacheManager()
{
@@ -46,8 +46,12 @@ public class WarehouseCacheManager
_cachedWh.remove(pc);
}
public class CacheScheduler implements Runnable
private class CacheScheduler implements Runnable
{
public CacheScheduler()
{
}
@Override
public void run()
{

View File

@@ -70,7 +70,7 @@ public class Post
insertindb(cp);
}
public void insertindb(CPost cp)
private void insertindb(CPost cp)
{
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO posts (post_id,post_owner_name,post_ownerid,post_date,post_topic_id,post_forum_id,post_txt) values (?,?,?,?,?,?,?)"))

View File

@@ -69,7 +69,7 @@ public class Topic
}
}
public void insertindb()
private void insertindb()
{
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO topic (topic_id,topic_forum_id,topic_name,topic_date,topic_ownername,topic_ownerid,topic_type,topic_reply) values (?,?,?,?,?,?,?,?)"))

View File

@@ -104,7 +104,7 @@ public final class AnnouncementsTable
* @param player
* @param type
*/
public void sendAnnouncements(L2PcInstance player, AnnouncementType type)
private void sendAnnouncements(L2PcInstance player, AnnouncementType type)
{
for (IAnnouncement announce : _announcements.values())
{

View File

@@ -60,8 +60,8 @@ public class SummonEffectsTable
public static class SummonEffect
{
Skill _skill;
int _effectCurTime;
private final Skill _skill;
private final int _effectCurTime;
public SummonEffect(Skill skill, int effectCurTime)
{

View File

@@ -35,8 +35,7 @@ import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
public class LuckyGameData implements IGameXmlReader
{
private final Map<Integer, LuckyGameDataHolder> _luckyGame = new HashMap<>();
final AtomicInteger _serverPlay = new AtomicInteger();
private final AtomicInteger _serverPlay = new AtomicInteger();
protected LuckyGameData()
{

View File

@@ -1215,7 +1215,7 @@ public final class SkillTreesData implements IGameXmlReader
* @param lvl the transformation skill level
* @return the transform skill from the Transform Skill Tree for a given {@code id} and {@code lvl}
*/
public L2SkillLearn getTransformSkill(int id, int lvl)
private L2SkillLearn getTransformSkill(int id, int lvl)
{
return _transformSkillTree.get(SkillData.getSkillHashCode(id, lvl));
}
@@ -1237,7 +1237,7 @@ public final class SkillTreesData implements IGameXmlReader
* @param lvl the alchemy skill level
* @return the alchemy skill from the Alchemy Skill Tree for a given {@code id} and {@code lvl}
*/
public L2SkillLearn getAlchemySkill(int id, int lvl)
private L2SkillLearn getAlchemySkill(int id, int lvl)
{
return _alchemySkillTree.get(SkillData.getSkillHashCode(id, lvl));
}
@@ -1260,7 +1260,7 @@ public final class SkillTreesData implements IGameXmlReader
* @param lvl the fishing skill level
* @return Fishing skill from the Fishing Skill Tree for a given {@code id} and {@code lvl}
*/
public L2SkillLearn getFishingSkill(int id, int lvl)
private L2SkillLearn getFishingSkill(int id, int lvl)
{
return _fishingSkillTree.get(SkillData.getSkillHashCode(id, lvl));
}
@@ -1271,7 +1271,7 @@ public final class SkillTreesData implements IGameXmlReader
* @param lvl the pledge skill level
* @return the pledge skill from the Pledge Skill Tree for a given {@code id} and {@code lvl}
*/
public L2SkillLearn getPledgeSkill(int id, int lvl)
private L2SkillLearn getPledgeSkill(int id, int lvl)
{
return _pledgeSkillTree.get(SkillData.getSkillHashCode(id, lvl));
}
@@ -1282,7 +1282,7 @@ public final class SkillTreesData implements IGameXmlReader
* @param lvl the sub-pledge skill level
* @return the sub-pledge skill from the Sub-Pledge Skill Tree for a given {@code id} and {@code lvl}
*/
public L2SkillLearn getSubPledgeSkill(int id, int lvl)
private L2SkillLearn getSubPledgeSkill(int id, int lvl)
{
return _subPledgeSkillTree.get(SkillData.getSkillHashCode(id, lvl));
}
@@ -1294,7 +1294,7 @@ public final class SkillTreesData implements IGameXmlReader
* @param classId the transfer skill tree Id
* @return the transfer skill from the Transfer Skill Trees for a given {@code classId}, {@code id} and {@code lvl}
*/
public L2SkillLearn getTransferSkill(int id, int lvl, ClassId classId)
private L2SkillLearn getTransferSkill(int id, int lvl, ClassId classId)
{
if (_transferSkillTrees.get(classId) != null)
{
@@ -1310,7 +1310,7 @@ public final class SkillTreesData implements IGameXmlReader
* @param race the race skill tree Id
* @return the transfer skill from the Race Skill Trees for a given {@code race}, {@code id} and {@code lvl}
*/
public L2SkillLearn getRaceSkill(int id, int lvl, Race race)
private L2SkillLearn getRaceSkill(int id, int lvl, Race race)
{
for (L2SkillLearn skill : getRaceSkillTree(race))
{
@@ -1328,7 +1328,7 @@ public final class SkillTreesData implements IGameXmlReader
* @param lvl the sub-class skill level
* @return the sub-class skill from the Sub-Class Skill Tree for a given {@code id} and {@code lvl}
*/
public L2SkillLearn getSubClassSkill(int id, int lvl)
private L2SkillLearn getSubClassSkill(int id, int lvl)
{
return _subClassSkillTree.get(SkillData.getSkillHashCode(id, lvl));
}

View File

@@ -595,25 +595,28 @@ public final class BotReportTable
}
}
class PunishHolder
private class PunishHolder
{
final Skill _punish;
final int _systemMessageId;
PunishHolder(Skill sk, int sysMsg)
public PunishHolder(Skill sk, int sysMsg)
{
_punish = sk;
_systemMessageId = sysMsg;
}
}
class ResetPointTask implements Runnable
private class ResetPointTask implements Runnable
{
public ResetPointTask()
{
}
@Override
public void run()
{
resetPointsAndSchedule();
}
}

View File

@@ -21,10 +21,10 @@ import com.l2jmobius.gameserver.model.items.L2Item;
public class Item
{
public int id;
public String type;
public String name;
public StatsSet set;
public int currentLevel;
public L2Item item;
int id;
String type;
String name;
StatsSet set;
int currentLevel;
L2Item item;
}

View File

@@ -29,15 +29,12 @@ import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.data.xml.impl.FenceData;
import com.l2jmobius.gameserver.geoengine.geodata.ABlock;
import com.l2jmobius.gameserver.geoengine.geodata.BlockComplex;
import com.l2jmobius.gameserver.geoengine.geodata.BlockComplexDynamic;
import com.l2jmobius.gameserver.geoengine.geodata.BlockFlat;
import com.l2jmobius.gameserver.geoengine.geodata.BlockMultilayer;
import com.l2jmobius.gameserver.geoengine.geodata.BlockMultilayerDynamic;
import com.l2jmobius.gameserver.geoengine.geodata.BlockNull;
import com.l2jmobius.gameserver.geoengine.geodata.GeoFormat;
import com.l2jmobius.gameserver.geoengine.geodata.GeoLocation;
import com.l2jmobius.gameserver.geoengine.geodata.GeoStructure;
import com.l2jmobius.gameserver.geoengine.geodata.IBlockDynamic;
import com.l2jmobius.gameserver.geoengine.geodata.IGeoObject;
import com.l2jmobius.gameserver.instancemanager.WarpedSpaceManager;
import com.l2jmobius.gameserver.model.L2Object;
@@ -276,7 +273,7 @@ public class GeoEngine
* @param geoY : Geodata Y
* @return {@link ABlock} : Block of geodata.
*/
public final ABlock getBlock(int geoX, int geoY)
private final ABlock getBlock(int geoX, int geoY)
{
final int x = geoX / GeoStructure.BLOCK_CELLS_X;
final int y = geoY / GeoStructure.BLOCK_CELLS_Y;
@@ -328,7 +325,7 @@ public class GeoEngine
* @param worldZ : Cell world Z coordinate.
* @return short : Cell geodata Z coordinate, closest to given coordinates.
*/
public final short getHeightNearestOriginal(int geoX, int geoY, int worldZ)
private final short getHeightNearestOriginal(int geoX, int geoY, int worldZ)
{
final ABlock block = getBlock(geoX, geoY);
return block != null ? block.getHeightNearestOriginal(geoX, geoY, worldZ) : (short) worldZ;
@@ -355,7 +352,7 @@ public class GeoEngine
* @param worldZ : Cell world Z coordinate.
* @return short : Cell NSWE flag byte coordinate, closest to given coordinates.
*/
public final byte getNsweNearestOriginal(int geoX, int geoY, int worldZ)
private final byte getNsweNearestOriginal(int geoX, int geoY, int worldZ)
{
final ABlock block = getBlock(geoX, geoY);
return block != null ? block.getNsweNearestOriginal(geoX, geoY, worldZ) : (byte) 0xFF;
@@ -384,200 +381,6 @@ public class GeoEngine
return getHeightNearest(getGeoX(worldX), getGeoY(worldY), worldZ);
}
// GEODATA - DYNAMIC
/**
* Returns calculated NSWE flag byte as a description of {@link IGeoObject}.<br>
* The {@link IGeoObject} is defined by boolean 2D array, saying if the object is present on given cell or not.
* @param inside : 2D description of {@link IGeoObject}
* @return byte[][] : Returns NSWE flags of {@link IGeoObject}.
*/
public static byte[][] calculateGeoObject(boolean inside[][])
{
// get dimensions
final int width = inside.length;
final int height = inside[0].length;
// create object flags for geodata, according to the geo object 2D description
final byte[][] result = new byte[width][height];
// loop over each cell of the geo object
for (int ix = 0; ix < width; ix++)
{
for (int iy = 0; iy < height; iy++)
{
if (inside[ix][iy])
{
// cell is inside geo object, block whole movement (nswe = 0)
result[ix][iy] = 0;
}
else
{
// cell is outside of geo object, block only movement leading inside geo object
// set initial value -> no geodata change
byte nswe = (byte) 0xFF;
// perform axial and diagonal checks
if (iy < (height - 1))
{
if (inside[ix][iy + 1])
{
nswe &= ~GeoStructure.CELL_FLAG_S;
}
}
if (iy > 0)
{
if (inside[ix][iy - 1])
{
nswe &= ~GeoStructure.CELL_FLAG_N;
}
}
if (ix < (width - 1))
{
if (inside[ix + 1][iy])
{
nswe &= ~GeoStructure.CELL_FLAG_E;
}
}
if (ix > 0)
{
if (inside[ix - 1][iy])
{
nswe &= ~GeoStructure.CELL_FLAG_W;
}
}
if ((ix < (width - 1)) && (iy < (height - 1)))
{
if (inside[ix + 1][iy + 1] || inside[ix][iy + 1] || inside[ix + 1][iy])
{
nswe &= ~GeoStructure.CELL_FLAG_SE;
}
}
if ((ix < (width - 1)) && (iy > 0))
{
if (inside[ix + 1][iy - 1] || inside[ix][iy - 1] || inside[ix + 1][iy])
{
nswe &= ~GeoStructure.CELL_FLAG_NE;
}
}
if ((ix > 0) && (iy < (height - 1)))
{
if (inside[ix - 1][iy + 1] || inside[ix][iy + 1] || inside[ix - 1][iy])
{
nswe &= ~GeoStructure.CELL_FLAG_SW;
}
}
if ((ix > 0) && (iy > 0))
{
if (inside[ix - 1][iy - 1] || inside[ix][iy - 1] || inside[ix - 1][iy])
{
nswe &= ~GeoStructure.CELL_FLAG_NW;
}
}
result[ix][iy] = nswe;
}
}
}
return result;
}
/**
* Add {@link IGeoObject} to the geodata.
* @param object : An object using {@link IGeoObject} interface.
*/
public final void addGeoObject(IGeoObject object)
{
toggleGeoObject(object, true);
}
/**
* Remove {@link IGeoObject} from the geodata.
* @param object : An object using {@link IGeoObject} interface.
*/
public final void removeGeoObject(IGeoObject object)
{
toggleGeoObject(object, false);
}
/**
* Toggles an {@link IGeoObject} in the geodata.
* @param object : An object using {@link IGeoObject} interface.
* @param add : Add/remove object.
*/
private final void toggleGeoObject(IGeoObject object, boolean add)
{
// get object geo coordinates and data
final int minGX = object.getGeoX();
final int minGY = object.getGeoY();
final byte[][] geoData = object.getObjectGeoData();
// get min/max block coordinates
int minBX = minGX / GeoStructure.BLOCK_CELLS_X;
int maxBX = ((minGX + geoData.length) - 1) / GeoStructure.BLOCK_CELLS_X;
int minBY = minGY / GeoStructure.BLOCK_CELLS_Y;
int maxBY = ((minGY + geoData[0].length) - 1) / GeoStructure.BLOCK_CELLS_Y;
// loop over affected blocks in X direction
for (int bx = minBX; bx <= maxBX; bx++)
{
// loop over affected blocks in Y direction
for (int by = minBY; by <= maxBY; by++)
{
ABlock block;
// conversion to dynamic block must be synchronized to prevent 2 independent threads converting same block
synchronized (_blocks)
{
// get related block
block = _blocks[bx][by];
// check for dynamic block
if (!(block instanceof IBlockDynamic))
{
// null block means no geodata (particular region file is not loaded), no geodata means no geobjects
if (block instanceof BlockNull)
{
continue;
}
// not a dynamic block, convert it
if (block instanceof BlockFlat)
{
// convert flat block to the dynamic complex block
block = new BlockComplexDynamic(bx, by, (BlockFlat) block);
_blocks[bx][by] = block;
}
else if (block instanceof BlockComplex)
{
// convert complex block to the dynamic complex block
block = new BlockComplexDynamic(bx, by, (BlockComplex) block);
_blocks[bx][by] = block;
}
else if (block instanceof BlockMultilayer)
{
// convert multilayer block to the dynamic multilayer block
block = new BlockMultilayerDynamic(bx, by, (BlockMultilayer) block);
_blocks[bx][by] = block;
}
}
}
// add/remove geo object to/from dynamic block
if (add)
{
((IBlockDynamic) block).addGeoObject(object);
}
else
{
((IBlockDynamic) block).removeGeoObject(object);
}
}
}
}
// PATHFINDING
/**
@@ -732,7 +535,7 @@ public class GeoEngine
* @param instance
* @return {@code boolean} : True, when target can be seen.
*/
protected final boolean checkSee(int gox, int goy, int goz, double oheight, int gtx, int gty, int gtz, double theight, Instance instance)
private final boolean checkSee(int gox, int goy, int goz, double oheight, int gtx, int gty, int gtz, double theight, Instance instance)
{
// get line of sight Z coordinates
double losoz = goz + ((oheight * Config.PART_OF_CHARACTER_HEIGHT) / 100);
@@ -915,7 +718,7 @@ public class GeoEngine
* @param instance
* @return {@code boolean} : True, when target can be seen.
*/
protected final boolean checkSeeOriginal(int gox, int goy, int goz, double oheight, int gtx, int gty, int gtz, double theight, Instance instance)
private final boolean checkSeeOriginal(int gox, int goy, int goz, double oheight, int gtx, int gty, int gtz, double theight, Instance instance)
{
// get line of sight Z coordinates
double losoz = goz + ((oheight * Config.PART_OF_CHARACTER_HEIGHT) / 100);

View File

@@ -1,255 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.geoengine.geodata;
import java.util.LinkedList;
import java.util.List;
/**
* @author Hasha
*/
public final class BlockComplexDynamic extends BlockComplex implements IBlockDynamic
{
private final int _bx;
private final int _by;
private final byte[] _original;
private final List<IGeoObject> _objects;
/**
* Creates {@link BlockComplexDynamic}.
* @param bx : Block X coordinate.
* @param by : Block Y coordinate.
* @param block : The original FlatBlock to create a dynamic version from.
*/
public BlockComplexDynamic(int bx, int by, BlockFlat block)
{
// load data
final byte nswe = block._nswe;
final byte heightLow = (byte) (block._height & 0x00FF);
final byte heightHigh = (byte) (block._height >> 8);
// initialize buffer
_buffer = new byte[GeoStructure.BLOCK_CELLS * 3];
// save data
for (int i = 0; i < GeoStructure.BLOCK_CELLS; i++)
{
// set nswe
_buffer[i * 3] = nswe;
// set height
_buffer[(i * 3) + 1] = heightLow;
_buffer[(i * 3) + 2] = heightHigh;
}
// get block coordinates
_bx = bx;
_by = by;
// create copy for dynamic implementation
_original = new byte[GeoStructure.BLOCK_CELLS * 3];
System.arraycopy(_buffer, 0, _original, 0, GeoStructure.BLOCK_CELLS * 3);
// create list for geo objects
_objects = new LinkedList<>();
}
/**
* Creates {@link BlockComplexDynamic}.
* @param bx : Block X coordinate.
* @param by : Block Y coordinate.
* @param block : The original ComplexBlock to create a dynamic version from.
*/
public BlockComplexDynamic(int bx, int by, BlockComplex block)
{
// move buffer from BlockComplex object to this object
_buffer = block._buffer;
block._buffer = null;
// get block coordinates
_bx = bx;
_by = by;
// create copy for dynamic implementation
_original = new byte[GeoStructure.BLOCK_CELLS * 3];
System.arraycopy(_buffer, 0, _original, 0, GeoStructure.BLOCK_CELLS * 3);
// create list for geo objects
_objects = new LinkedList<>();
}
@Override
public final short getHeightNearestOriginal(int geoX, int geoY, int worldZ)
{
// get cell index
final int index = (((geoX % GeoStructure.BLOCK_CELLS_X) * GeoStructure.BLOCK_CELLS_Y) + (geoY % GeoStructure.BLOCK_CELLS_Y)) * 3;
// get height
return (short) ((_original[index + 1] & 0x00FF) | (_original[index + 2] << 8));
}
@Override
public final byte getNsweNearestOriginal(int geoX, int geoY, int worldZ)
{
// get cell index
final int index = (((geoX % GeoStructure.BLOCK_CELLS_X) * GeoStructure.BLOCK_CELLS_Y) + (geoY % GeoStructure.BLOCK_CELLS_Y)) * 3;
// get nswe
return _original[index];
}
@Override
public final int getIndexAboveOriginal(int geoX, int geoY, int worldZ)
{
// get cell index
final int index = (((geoX % GeoStructure.BLOCK_CELLS_X) * GeoStructure.BLOCK_CELLS_Y) + (geoY % GeoStructure.BLOCK_CELLS_Y)) * 3;
// get height
final int height = (_original[index + 1] & 0x00FF) | (_original[index + 2] << 8);
// check height and return nswe
return height > worldZ ? index : -1;
}
@Override
public final int getIndexBelowOriginal(int geoX, int geoY, int worldZ)
{
// get cell index
final int index = (((geoX % GeoStructure.BLOCK_CELLS_X) * GeoStructure.BLOCK_CELLS_Y) + (geoY % GeoStructure.BLOCK_CELLS_Y)) * 3;
// get height
final int height = (_original[index + 1] & 0x00FF) | (_original[index + 2] << 8);
// check height and return nswe
return height < worldZ ? index : -1;
}
@Override
public final short getHeightOriginal(int index)
{
return (short) ((_original[index + 1] & 0x00FF) | (_original[index + 2] << 8));
}
@Override
public final byte getNsweOriginal(int index)
{
return _original[index];
}
@Override
public final synchronized void addGeoObject(IGeoObject object)
{
// add geo object, update block geodata when added
if (_objects.add(object))
{
update();
}
}
@Override
public final synchronized void removeGeoObject(IGeoObject object)
{
// remove geo object, update block geodata when removed
if (_objects.remove(object))
{
update();
}
}
private final void update()
{
// copy original geodata, than apply changes
System.arraycopy(_original, 0, _buffer, 0, GeoStructure.BLOCK_CELLS * 3);
// get block geo coordinates
final int minBX = _bx * GeoStructure.BLOCK_CELLS_X;
final int minBY = _by * GeoStructure.BLOCK_CELLS_Y;
final int maxBX = minBX + GeoStructure.BLOCK_CELLS_X;
final int maxBY = minBY + GeoStructure.BLOCK_CELLS_Y;
// for all objects
for (IGeoObject object : _objects)
{
// get object geo coordinates and other object variables
final int minOX = object.getGeoX();
final int minOY = object.getGeoY();
final int minOZ = object.getGeoZ();
final int maxOZ = minOZ + object.getHeight();
final byte[][] geoData = object.getObjectGeoData();
// calculate min/max geo coordinates for iteration (intersection of block and object)
final int minGX = Math.max(minBX, minOX);
final int minGY = Math.max(minBY, minOY);
final int maxGX = Math.min(maxBX, minOX + geoData.length);
final int maxGY = Math.min(maxBY, minOY + geoData[0].length);
// iterate over intersection of block and object
for (int gx = minGX; gx < maxGX; gx++)
{
for (int gy = minGY; gy < maxGY; gy++)
{
// get object nswe
final byte objNswe = geoData[gx - minOX][gy - minOY];
// object contains no change of data in this cell, continue to next cell
if (objNswe == 0xFF)
{
continue;
}
// get block index of this cell
final int ib = (((gx - minBX) * GeoStructure.BLOCK_CELLS_Y) + (gy - minBY)) * 3;
// compare block data and original data, when height differs -> height was affected by other geo object
// -> cell is inside an object -> no need to check/change it anymore (Z is lifted, nswe is 0)
// compare is done in raw format (2 bytes) instead of conversion to short
if ((_buffer[ib + 1] != _original[ib + 1]) || (_buffer[ib + 2] != _original[ib + 2]))
{
continue;
}
// so far cell is not inside of any object
if (objNswe == 0)
{
// cell is inside of this object -> set nswe to 0 and lift Z up
// set block nswe
_buffer[ib] = 0;
// set block Z to object height
_buffer[ib + 1] = (byte) (maxOZ & 0x00FF);
_buffer[ib + 2] = (byte) (maxOZ >> 8);
}
else
{
// cell is outside of this object -> update nswe
// height different is too high (trying to update another layer), skip
short z = getHeight(ib);
if (Math.abs(z - minOZ) > GeoStructure.CELL_IGNORE_HEIGHT)
{
continue;
}
// adjust block nswe according to the object nswe
_buffer[ib] &= objNswe;
}
}
}
}
}
}

View File

@@ -1,312 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.geoengine.geodata;
import java.util.LinkedList;
import java.util.List;
/**
* @author Hasha
*/
public final class BlockMultilayerDynamic extends BlockMultilayer implements IBlockDynamic
{
private final int _bx;
private final int _by;
private final byte[] _original;
private final List<IGeoObject> _objects;
/**
* Creates {@link BlockMultilayerDynamic}.
* @param bx : Block X coordinate.
* @param by : Block Y coordinate.
* @param block : The original MultilayerBlock to create a dynamic version from.
*/
public BlockMultilayerDynamic(int bx, int by, BlockMultilayer block)
{
// move buffer from ComplexBlock object to this object
_buffer = block._buffer;
block._buffer = null;
// get block coordinates
_bx = bx;
_by = by;
// create copy for dynamic implementation
_original = new byte[_buffer.length];
System.arraycopy(_buffer, 0, _original, 0, _buffer.length);
// create list for geo objects
_objects = new LinkedList<>();
}
@Override
public short getHeightNearestOriginal(int geoX, int geoY, int worldZ)
{
// get cell index
final int index = getIndexNearestOriginal(geoX, geoY, worldZ);
// get height
return (short) ((_original[index + 1] & 0x00FF) | (_original[index + 2] << 8));
}
@Override
public byte getNsweNearestOriginal(int geoX, int geoY, int worldZ)
{
// get cell index
final int index = getIndexNearestOriginal(geoX, geoY, worldZ);
// get nswe
return _original[index];
}
private final int getIndexNearestOriginal(int geoX, int geoY, int worldZ)
{
// move index to the cell given by coordinates
int index = 0;
for (int i = 0; i < (((geoX % GeoStructure.BLOCK_CELLS_X) * GeoStructure.BLOCK_CELLS_Y) + (geoY % GeoStructure.BLOCK_CELLS_Y)); i++)
{
// move index by amount of layers for this cell
index += (_original[index] * 3) + 1;
}
// get layers count and shift to first layer data (first from bottom)
byte layers = _original[index++];
// loop though all cell layers, find closest layer
int limit = Integer.MAX_VALUE;
while (layers-- > 0)
{
// get layer height
final int height = (_original[index + 1] & 0x00FF) | (_original[index + 2] << 8);
// get Z distance and compare with limit
// note: When 2 layers have same distance to worldZ (worldZ is in the middle of them):
// > returns bottom layer
// >= returns upper layer
final int distance = Math.abs(height - worldZ);
if (distance > limit)
{
break;
}
// update limit and move to next layer
limit = distance;
index += 3;
}
// return layer index
return index - 3;
}
@Override
public final int getIndexAboveOriginal(int geoX, int geoY, int worldZ)
{
// move index to the cell given by coordinates
int index = 0;
for (int i = 0; i < (((geoX % GeoStructure.BLOCK_CELLS_X) * GeoStructure.BLOCK_CELLS_Y) + (geoY % GeoStructure.BLOCK_CELLS_Y)); i++)
{
// move index by amount of layers for this cell
index += (_original[index] * 3) + 1;
}
// get layers count and shift to last layer data (first from bottom)
byte layers = _original[index++];
index += (layers - 1) * 3;
// loop though all layers, find first layer above worldZ
while (layers-- > 0)
{
// get layer height
final int height = (_original[index + 1] & 0x00FF) | (_original[index + 2] << 8);
// layer height is higher than worldZ, return layer index
if (height > worldZ)
{
return index;
}
// move index to next layer
index -= 3;
}
// none layer found
return -1;
}
@Override
public final int getIndexBelowOriginal(int geoX, int geoY, int worldZ)
{
// move index to the cell given by coordinates
int index = 0;
for (int i = 0; i < (((geoX % GeoStructure.BLOCK_CELLS_X) * GeoStructure.BLOCK_CELLS_Y) + (geoY % GeoStructure.BLOCK_CELLS_Y)); i++)
{
// move index by amount of layers for this cell
index += (_original[index] * 3) + 1;
}
// get layers count and shift to first layer data (first from top)
byte layers = _original[index++];
// loop though all layers, find first layer below worldZ
while (layers-- > 0)
{
// get layer height
final int height = (_original[index + 1] & 0x00FF) | (_original[index + 2] << 8);
// layer height is lower than worldZ, return layer index
if (height < worldZ)
{
return index;
}
// move index to next layer
index += 3;
}
// none layer found
return -1;
}
@Override
public short getHeightOriginal(int index)
{
// get height
return (short) ((_original[index + 1] & 0x00FF) | (_original[index + 2] << 8));
}
@Override
public byte getNsweOriginal(int index)
{
// get nswe
return _original[index];
}
@Override
public final synchronized void addGeoObject(IGeoObject object)
{
// add geo object, update block geodata when added
if (_objects.add(object))
{
update();
}
}
@Override
public final synchronized void removeGeoObject(IGeoObject object)
{
// remove geo object, update block geodata when removed
if (_objects.remove(object))
{
update();
}
}
private final void update()
{
// copy original geodata, than apply changes
System.arraycopy(_original, 0, _buffer, 0, _original.length);
// get block geo coordinates
final int minBX = _bx * GeoStructure.BLOCK_CELLS_X;
final int minBY = _by * GeoStructure.BLOCK_CELLS_Y;
final int maxBX = minBX + GeoStructure.BLOCK_CELLS_X;
final int maxBY = minBY + GeoStructure.BLOCK_CELLS_Y;
// for all objects
for (IGeoObject object : _objects)
{
// get object geo coordinates and other object variables
final int minOX = object.getGeoX();
final int minOY = object.getGeoY();
final int minOZ = object.getGeoZ();
final int maxOZ = minOZ + object.getHeight();
final byte[][] geoData = object.getObjectGeoData();
// calculate min/max geo coordinates for iteration (intersection of block and object)
final int minGX = Math.max(minBX, minOX);
final int minGY = Math.max(minBY, minOY);
final int maxGX = Math.min(maxBX, minOX + geoData.length);
final int maxGY = Math.min(maxBY, minOY + geoData[0].length);
// iterate over intersection of block and object
for (int gx = minGX; gx < maxGX; gx++)
{
for (int gy = minGY; gy < maxGY; gy++)
{
// get object nswe
final byte objNswe = geoData[gx - minOX][gy - minOY];
// object contains no change of data in this cell, continue to next cell
if (objNswe == 0xFF)
{
continue;
}
// get block index of this cell
int ib = getIndexNearest(gx, gy, minOZ);
// compare block data and original data, when height differs -> height was affected by other geo object
// -> cell is inside an object -> no need to check/change it anymore (Z is lifted, nswe is 0)
// compare is done in raw format (2 bytes) instead of conversion to short
if ((_buffer[ib + 1] != _original[ib + 1]) || (_buffer[ib + 2] != _original[ib + 2]))
{
continue;
}
// so far cell is not inside of any object
if (objNswe == 0)
{
// cell is inside of this object -> set nswe to 0 and lift Z up
// set block nswe
_buffer[ib] = 0;
// calculate object height, limit to next layer
int z = maxOZ;
int i = getIndexAbove(gx, gy, minOZ);
if (i != -1)
{
int az = getHeight(i);
if (az <= maxOZ)
{
z = az - GeoStructure.CELL_IGNORE_HEIGHT;
}
}
// set block Z to object height
_buffer[ib + 1] = (byte) (z & 0x00FF);
_buffer[ib + 2] = (byte) (z >> 8);
}
else
{
// cell is outside of this object -> update nswe
// height different is too high (trying to update another layer), skip
short z = getHeight(ib);
if (Math.abs(z - minOZ) > GeoStructure.CELL_IGNORE_HEIGHT)
{
continue;
}
// adjust block nswe according to the object nswe
_buffer[ib] &= objNswe;
}
}
}
}
}
}

View File

@@ -32,12 +32,7 @@ public final class GeoStructure
public static final byte CELL_FLAG_SW = 1 << 5;
public static final byte CELL_FLAG_NE = 1 << 6;
public static final byte CELL_FLAG_NW = (byte) (1 << 7);
public static final byte CELL_FLAG_S_AND_E = CELL_FLAG_S | CELL_FLAG_E;
public static final byte CELL_FLAG_S_AND_W = CELL_FLAG_S | CELL_FLAG_W;
public static final byte CELL_FLAG_N_AND_E = CELL_FLAG_N | CELL_FLAG_E;
public static final byte CELL_FLAG_N_AND_W = CELL_FLAG_N | CELL_FLAG_W;
public static final int CELL_SIZE = 16;
public static final int CELL_HEIGHT = 8;
public static final int CELL_IGNORE_HEIGHT = CELL_HEIGHT * 6;
@@ -64,8 +59,8 @@ public final class GeoStructure
public static final int REGION_CELLS_Y = REGION_BLOCKS_Y * BLOCK_CELLS_Y;
// global geodata
public static final int GEO_REGIONS_X = ((L2World.TILE_X_MAX - L2World.TILE_X_MIN) + 1);
public static final int GEO_REGIONS_Y = ((L2World.TILE_Y_MAX - L2World.TILE_Y_MIN) + 1);
private static final int GEO_REGIONS_X = ((L2World.TILE_X_MAX - L2World.TILE_X_MIN) + 1);
private static final int GEO_REGIONS_Y = ((L2World.TILE_Y_MAX - L2World.TILE_Y_MIN) + 1);
public static final int GEO_BLOCKS_X = GEO_REGIONS_X * REGION_BLOCKS_X;
public static final int GEO_BLOCKS_Y = GEO_REGIONS_Y * REGION_BLOCKS_Y;

View File

@@ -1,35 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.geoengine.geodata;
/**
* @author Hasha
*/
public interface IBlockDynamic
{
/**
* Adds {@link IGeoObject} to the {@link ABlock}. The block will update geodata according the object.
* @param object : {@link IGeoObject} to be added.
*/
void addGeoObject(IGeoObject object);
/**
* Removes {@link IGeoObject} from the {@link ABlock}. The block will update geodata according the object.
* @param object : {@link IGeoObject} to be removed.
*/
void removeGeoObject(IGeoObject object);
}

View File

@@ -253,7 +253,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
});
}
public void resetTrainingCamp()
private void resetTrainingCamp()
{
if (Config.TRAINING_CAMP_ENABLE)
{

View File

@@ -33,7 +33,7 @@ import com.l2jmobius.gameserver.model.entity.Fort;
public final class FortManager implements InstanceListManager
{
protected static final Logger LOGGER = Logger.getLogger(FortManager.class.getName());
private static final Logger LOGGER = Logger.getLogger(FortManager.class.getName());
private final Map<Integer, Fort> _forts = new ConcurrentSkipListMap<>();

View File

@@ -32,7 +32,7 @@ import com.l2jmobius.gameserver.scripting.ScriptEngineManager;
*/
public final class QuestManager
{
protected static final Logger LOGGER = Logger.getLogger(QuestManager.class.getName());
private static final Logger LOGGER = Logger.getLogger(QuestManager.class.getName());
/** Map containing all the quests. */
private final Map<String, Quest> _quests = new ConcurrentHashMap<>();

View File

@@ -47,7 +47,6 @@ import com.l2jmobius.gameserver.model.zone.ZoneRegion;
import com.l2jmobius.gameserver.model.zone.form.ZoneCuboid;
import com.l2jmobius.gameserver.model.zone.form.ZoneCylinder;
import com.l2jmobius.gameserver.model.zone.form.ZoneNPoly;
import com.l2jmobius.gameserver.model.zone.type.L2ArenaZone;
import com.l2jmobius.gameserver.model.zone.type.L2OlympiadStadiumZone;
import com.l2jmobius.gameserver.model.zone.type.L2RespawnZone;
import com.l2jmobius.gameserver.model.zone.type.L2SpawnTerritory;
@@ -62,9 +61,9 @@ public final class ZoneManager implements IGameXmlReader
private static final Map<String, AbstractZoneSettings> SETTINGS = new HashMap<>();
public static final int SHIFT_BY = 15;
public static final int OFFSET_X = Math.abs(L2World.MAP_MIN_X >> SHIFT_BY);
public static final int OFFSET_Y = Math.abs(L2World.MAP_MIN_Y >> SHIFT_BY);
private static final int SHIFT_BY = 15;
private static final int OFFSET_X = Math.abs(L2World.MAP_MIN_X >> SHIFT_BY);
private static final int OFFSET_Y = Math.abs(L2World.MAP_MIN_Y >> SHIFT_BY);
private final Map<Class<? extends L2ZoneType>, Map<Integer, ? extends L2ZoneType>> _classZones = new HashMap<>();
private final Map<String, L2SpawnTerritory> _spawnTerritories = new HashMap<>();
@@ -424,7 +423,7 @@ public final class ZoneManager implements IGameXmlReader
* @param id the id
* @return true, if successful
*/
public boolean checkId(int id)
private boolean checkId(int id)
{
for (Map<Integer, ? extends L2ZoneType> map : _classZones.values())
{
@@ -443,7 +442,7 @@ public final class ZoneManager implements IGameXmlReader
* @param zone the zone
*/
@SuppressWarnings("unchecked")
public <T extends L2ZoneType> void addZone(Integer id, T zone)
private <T extends L2ZoneType> void addZone(Integer id, T zone)
{
Map<Integer, T> map = (Map<Integer, T>) _classZones.get(zone.getClass());
if (map == null)
@@ -612,7 +611,7 @@ public final class ZoneManager implements IGameXmlReader
* @return zone from given coordinates
*/
@SuppressWarnings("unchecked")
public <T extends L2ZoneType> T getZone(int x, int y, int z, Class<T> type)
private <T extends L2ZoneType> T getZone(int x, int y, int z, Class<T> type)
{
for (L2ZoneType zone : getRegion(x, y).getZones().values())
{
@@ -653,29 +652,6 @@ public final class ZoneManager implements IGameXmlReader
return temp;
}
/**
* Gets the arena.
* @param character the character
* @return the arena
*/
public final L2ArenaZone getArena(L2Character character)
{
if (character == null)
{
return null;
}
for (L2ZoneType temp : getInstance().getZones(character.getX(), character.getY(), character.getZ()))
{
if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character))
{
return (L2ArenaZone) temp;
}
}
return null;
}
/**
* Gets the olympiad stadium.
* @param character the character
@@ -698,33 +674,6 @@ public final class ZoneManager implements IGameXmlReader
return null;
}
/**
* For testing purposes only.
* @param <T> the generic type
* @param obj the obj
* @param type the type
* @return the closest zone
*/
@SuppressWarnings("unchecked")
public <T extends L2ZoneType> T getClosestZone(L2Object obj, Class<T> type)
{
T zone = getZone(obj, type);
if (zone == null)
{
double closestdis = Double.MAX_VALUE;
for (T temp : (Collection<T>) _classZones.get(type).values())
{
final double distance = temp.getDistanceToZone(obj);
if (distance < closestdis)
{
closestdis = distance;
zone = temp;
}
}
}
return zone;
}
/**
* General storage for debug items used for visualizing zones.
* @return list of items

View File

@@ -155,26 +155,6 @@ public class TradeList
return new TradeItem(item, item.getCount(), item.getReferencePrice());
}
/**
* Adjust ItemRequest by corresponding item in this list using its <b>ObjectId</b>
* @param item : ItemRequest to be adjusted
*/
public void adjustItemRequest(ItemRequest item)
{
for (TradeItem filtItem : _items)
{
if (filtItem.getObjectId() == item.getObjectId())
{
if (filtItem.getCount() < item.getCount())
{
item.setCount(filtItem.getCount());
}
return;
}
}
item.setCount(0);
}
/**
* Add simplified item to TradeList
* @param objectId : int
@@ -310,7 +290,7 @@ public class TradeList
* @param count : int
* @return
*/
public synchronized TradeItem removeItem(int objectId, int itemId, long count)
private synchronized TradeItem removeItem(int objectId, int itemId, long count)
{
if (_locked)
{
@@ -460,7 +440,7 @@ public class TradeList
/**
* Cancels TradeList confirmation
*/
public void invalidateConfirmation()
private void invalidateConfirmation()
{
_confirmed = false;
}
@@ -546,7 +526,7 @@ public class TradeList
* @param partner
* @return items slots count
*/
public int countItemsSlots(L2PcInstance partner)
private int countItemsSlots(L2PcInstance partner)
{
int slots = 0;
@@ -577,7 +557,7 @@ public class TradeList
/**
* @return the weight of items in tradeList
*/
public int calcItemsWeight()
private int calcItemsWeight()
{
long weight = 0;

View File

@@ -122,7 +122,7 @@ public final class Transform implements IIdentifiable
return _title;
}
public TransformTemplate getTemplate(L2Character creature)
private TransformTemplate getTemplate(L2Character creature)
{
if (creature.isPlayer())
{

View File

@@ -36,8 +36,8 @@ public final class SubClass
private int _vitalityPoints = 0;
private boolean _dualClass = false;
public static final int MAX_VITALITY_POINTS = 140000;
public static final int MIN_VITALITY_POINTS = 0;
private static final int MAX_VITALITY_POINTS = 140000;
private static final int MIN_VITALITY_POINTS = 0;
public SubClass()
{
@@ -137,26 +137,4 @@ public final class SubClass
_level = levelValue;
}
public void incLevel()
{
if (!_dualClass && (_level == _maxLevel))
{
return;
}
_level++;
setExp(ExperienceData.getInstance().getExpForLevel(getLevel()));
}
public void decLevel()
{
if (_level == Config.BASE_SUBCLASS_LEVEL)
{
return;
}
_level--;
setExp(ExperienceData.getInstance().getExpForLevel(getLevel()));
}
}

View File

@@ -52,7 +52,7 @@ public final class TimerExecutor<T>
* @param holder
* @return {@code true} if timer were successfully added, {@code false} in case it exists already
*/
public boolean addTimer(TimerHolder<T> holder)
private boolean addTimer(TimerHolder<T> holder)
{
final Set<TimerHolder<T>> timers = _timers.computeIfAbsent(holder.getEvent(), key -> ConcurrentHashMap.newKeySet());
removeAndCancelTimers(timers, holder::isEqual);
@@ -123,25 +123,11 @@ public final class TimerExecutor<T>
* @param eventTimer
* @return {@code true} if timer were successfully added, {@code false} in case it exists already
*/
public boolean addRepeatingTimer(T event, StatsSet params, long time, L2Npc npc, L2PcInstance player, IEventTimerEvent<T> eventTimer)
private boolean addRepeatingTimer(T event, StatsSet params, long time, L2Npc npc, L2PcInstance player, IEventTimerEvent<T> eventTimer)
{
return addTimer(new TimerHolder<>(event, params, time, npc, player, true, eventTimer, _cancelListener, this));
}
/**
* Adds repeating timer
* @param event
* @param params
* @param time
* @param npc
* @param player
* @return {@code true} if timer were successfully added, {@code false} in case it exists already
*/
public boolean addRepeatingTimer(T event, StatsSet params, long time, L2Npc npc, L2PcInstance player)
{
return addRepeatingTimer(event, params, time, npc, player, _eventListener);
}
/**
* Adds repeating timer
* @param event
@@ -181,22 +167,6 @@ public final class TimerExecutor<T>
}
}
/**
* @param timer
*/
public void onTimerCancel(TimerHolder<T> timer)
{
final Set<TimerHolder<T>> timers = _timers.get(timer.getEvent());
if ((timers != null) && timers.remove(timer))
{
_eventListener.onTimerEvent(timer);
if (timers.isEmpty())
{
_timers.remove(timer.getEvent());
}
}
}
/**
* Cancels and removes all timers from the _timers map
*/
@@ -223,15 +193,6 @@ public final class TimerExecutor<T>
return timers.stream().anyMatch(holder -> holder.isEqual(event, npc, player));
}
/**
* @param event
* @return {@code true} if there is at least one timer with the given event, {@code false} otherwise
*/
public boolean hasTimers(T event)
{
return _timers.containsKey(event);
}
/**
* @param event
* @return {@code true} if at least one timer for the given event were stopped, {@code false} otherwise
@@ -305,32 +266,4 @@ public final class TimerExecutor<T>
}
}
}
/**
* @param event
* @param npc
* @param player
* @return the remaining time of the timer, or -1 in case it doesn't exists
*/
public long getRemainingTime(T event, L2Npc npc, L2PcInstance player)
{
final Set<TimerHolder<T>> timers = _timers.get(event);
if ((timers == null) || timers.isEmpty())
{
return -1;
}
final Iterator<TimerHolder<T>> holders = timers.iterator();
while (holders.hasNext())
{
final TimerHolder<T> holder = holders.next();
if (holder.isEqual(event, npc, player))
{
holders.remove();
return holder.getRemainingTime();
}
}
return -1;
}
}

View File

@@ -93,11 +93,6 @@ public class TrainingHolder implements Serializable
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime());
}
public long getRemainingTime(long time)
{
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - time);
}
public long getTrainingTime(TimeUnit unit)
{
return Math.min(unit.convert(Config.TRAINING_CAMP_MAX_DURATION, TimeUnit.SECONDS), unit.convert(_endTime - _startTime, TimeUnit.MILLISECONDS));

View File

@@ -18,6 +18,7 @@ package com.l2jmobius.gameserver.model.stats.finalizers;
import java.util.Optional;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.stats.BaseStats;
@@ -37,12 +38,12 @@ public class MCritRateFinalizer implements IStatsFunction
double baseValue = calcWeaponPlusBaseValue(creature, stat);
if (creature.isPlayer())
{
// Enchanted legs bonus
baseValue += calcEnchantBodyPart(creature, L2Item.SLOT_LEGS);
}
final double witBonus = creature.getWIT() > 0 ? BaseStats.WIT.calcBonus(creature) : 1.;
baseValue *= witBonus * 10;
return Stats.defaultValue(creature, stat, baseValue);
return validateValue(creature, Stats.defaultValue(creature, stat, baseValue * witBonus * 10), 0, Config.MAX_MCRIT_RATE);
}
@Override

View File

@@ -18,6 +18,7 @@ package com.l2jmobius.gameserver.model.stats.finalizers;
import java.util.Optional;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.stats.BaseStats;
@@ -39,7 +40,7 @@ public class RegenCPFinalizer implements IStatsFunction
}
final L2PcInstance player = creature.getActingPlayer();
double baseValue = player.getTemplate().getBaseCpRegen(creature.getLevel()) * creature.getLevelMod() * BaseStats.CON.calcBonus(creature);
double baseValue = player.getTemplate().getBaseCpRegen(creature.getLevel()) * creature.getLevelMod() * BaseStats.CON.calcBonus(creature) * Config.CP_REGEN_MULTIPLIER;
if (player.isSitting())
{
baseValue *= 1.5; // Sitting

View File

@@ -40,12 +40,11 @@ public abstract class VoteSystem implements Runnable
private static List<VoteSystem> voteSystems = new ArrayList<>();
protected int votesDiff;
protected boolean allowReport;
protected int boxes;
protected Map<Integer, Integer> rewards;
protected int checkMins;
protected int lastVotes = 0;
private final int votesDiff;
private final boolean allowReport;
private final int boxes;
private final Map<Integer, Integer> rewards;
private int lastVotes = 0;
private final Map<String, Integer> playerIps = new HashMap<>();
public static void initialize()
@@ -87,26 +86,12 @@ public abstract class VoteSystem implements Runnable
}
}
public static VoteSystem getVoteSystem(String name)
{
for (VoteSystem vs : voteSystems)
{
if (vs.getSiteName().equals(name))
{
return vs;
}
}
return null;
}
public VoteSystem(int votesDiff, boolean allowReport, int boxes, Map<Integer, Integer> rewards, int checkMins)
{
this.votesDiff = votesDiff;
this.allowReport = allowReport;
this.boxes = boxes;
this.rewards = rewards;
this.checkMins = checkMins;
ThreadPool.scheduleAtFixedRate(this, checkMins * 1000 * 60, checkMins * 1000 * 60);
}

View File

@@ -31,7 +31,7 @@ import com.l2jmobius.gameserver.model.zone.L2ZoneForm;
public class ZoneCuboid extends L2ZoneForm
{
private final int _z1, _z2;
Rectangle _r;
private final Rectangle _r;
public ZoneCuboid(int x1, int x2, int y1, int y2, int z1, int z2)
{

View File

@@ -15664,18 +15664,6 @@ public final class SystemMessageId
return VALUES.get(id);
}
public static SystemMessageId getSystemMessageId(String name)
{
try
{
return (SystemMessageId) SystemMessageId.class.getField(name).get(null);
}
catch (Exception e)
{
return null;
}
}
private final int _id;
private String _name;
private byte _params;

View File

@@ -23,26 +23,21 @@ import com.l2jmobius.commons.network.BaseSendablePacket;
*/
public class TempBan extends BaseSendablePacket
{
public TempBan(String accountName, String ip, long time, String reason)
public TempBan(String accountName, String ip, long time)
{
writeC(0x0A);
writeS(accountName);
writeS(ip);
writeQ(System.currentTimeMillis() + (time * 60000));
if (reason != null)
{
writeC(0x01);
writeS(reason);
}
else
{
writeC(0x00);
}
}
public TempBan(String accountName, String ip, long time)
{
this(accountName, ip, time, null);
// if (reason != null)
// {
// writeC(0x01);
// writeS(reason);
// }
// else
// {
writeC(0x00);
// }
}
@Override

View File

@@ -38,18 +38,6 @@ public final class TutorialShowHtml extends AbstractHtmlPacket
_type = NORMAL_WINDOW;
}
/**
* This constructor is just here to be able to show a tutorial html<br>
* window bound to an npc.
* @param npcObjId
* @param html
*/
public TutorialShowHtml(int npcObjId, String html)
{
super(npcObjId, html);
_type = NORMAL_WINDOW;
}
public TutorialShowHtml(int npcObjId, String html, int type)
{
super(npcObjId, html);

View File

@@ -52,7 +52,7 @@ public class TelnetServer
}
}
public void init()
private void init()
{
addHandler(new ITelnetCommand()
{

View File

@@ -47,12 +47,12 @@ import com.l2jmobius.gameserver.taskmanager.tasks.TaskShutdown;
*/
public final class TaskManager
{
protected static final Logger LOGGER = Logger.getLogger(TaskManager.class.getName());
static final Logger LOGGER = Logger.getLogger(TaskManager.class.getName());
private final Map<Integer, Task> _tasks = new ConcurrentHashMap<>();
protected final List<ExecutedTask> _currentTasks = new CopyOnWriteArrayList<>();
final List<ExecutedTask> _currentTasks = new CopyOnWriteArrayList<>();
protected static final String[] SQL_STATEMENTS =
static final String[] SQL_STATEMENTS =
{
"SELECT id,task,type,last_activation,param1,param2,param3 FROM global_tasks",
"UPDATE global_tasks SET last_activation=? WHERE id=?",
@@ -70,13 +70,13 @@ public final class TaskManager
public class ExecutedTask implements Runnable
{
int id;
long lastActivation;
Task task;
TaskTypes type;
String[] params;
private long lastActivation;
private final Task task;
private final TaskTypes type;
private final String[] params;
ScheduledFuture<?> scheduled;
public ExecutedTask(Task ptask, TaskTypes ptype, ResultSet rset) throws SQLException
ExecutedTask(Task ptask, TaskTypes ptype, ResultSet rset) throws SQLException
{
task = ptask;
type = ptype;
@@ -150,7 +150,7 @@ public final class TaskManager
return lastActivation;
}
public void stopTask()
private void stopTask()
{
task.onDestroy();
@@ -171,7 +171,7 @@ public final class TaskManager
registerTask(new TaskShutdown());
}
public void registerTask(Task task)
private void registerTask(Task task)
{
_tasks.computeIfAbsent(task.getName().hashCode(), k ->
{
@@ -312,7 +312,7 @@ public final class TaskManager
return addUniqueTask(task, type, param1, param2, param3, 0);
}
public static boolean addUniqueTask(String task, TaskTypes type, String param1, String param2, String param3, long lastActivation)
private static boolean addUniqueTask(String task, TaskTypes type, String param1, String param2, String param3, long lastActivation)
{
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps1 = con.prepareStatement(SQL_STATEMENTS[2]))
@@ -348,7 +348,7 @@ public final class TaskManager
return addTask(task, type, param1, param2, param3, 0);
}
public static boolean addTask(String task, TaskTypes type, String param1, String param2, String param3, long lastActivation)
private static boolean addTask(String task, TaskTypes type, String param1, String param2, String param3, long lastActivation)
{
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement(SQL_STATEMENTS[3]))

View File

@@ -24,7 +24,7 @@ import com.l2jmobius.gameserver.taskmanager.TaskManager.ExecutedTask;
*/
public final class TaskCleanUp extends Task
{
public static final String NAME = "clean_up";
private static final String NAME = "clean_up";
@Override
public String getName()

View File

@@ -25,7 +25,7 @@ import com.l2jmobius.gameserver.taskmanager.TaskManager.ExecutedTask;
*/
public final class TaskRestart extends Task
{
public static final String NAME = "restart";
private static final String NAME = "restart";
@Override
public String getName()

View File

@@ -25,7 +25,7 @@ import com.l2jmobius.gameserver.taskmanager.TaskManager.ExecutedTask;
*/
public class TaskShutdown extends Task
{
public static final String NAME = "shutdown";
private static final String NAME = "shutdown";
@Override
public String getName()

View File

@@ -39,8 +39,8 @@ import com.l2jmobius.Config;
public class frmAbout
{
private JFrame frmAbout;
static final String URL = "www.l2jmobius.com";
URI uri;
private static final String URL = "www.l2jmobius.com";
final URI uri;
public frmAbout()
{
@@ -129,7 +129,7 @@ public class frmAbout
frmAbout.setLocationRelativeTo(null);
}
public static URI createURI(String str)
private static URI createURI(String str)
{
try
{

View File

@@ -13,7 +13,6 @@ package com.l2jmobius.gameserver.util;
import static java.util.concurrent.TimeUnit.DAYS;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.NANOSECONDS;
import java.io.IOException;
import java.util.Locale;
@@ -32,16 +31,6 @@ public class TimeAmountInterpreter
// utility class
}
/**
* Calls {@link #consolidate(long, TimeUnit)} with {@link TimeUnit#NANOSECONDS}.
* @param timeAmountInNanos amount of time in nanoseconds
* @return an user-friendly description of the given time amount
*/
public static String consolidateNanos(long timeAmountInNanos)
{
return consolidate(timeAmountInNanos, NANOSECONDS);
}
/**
* Calls {@link #consolidate(long, TimeUnit)} with {@link TimeUnit#MILLISECONDS}.
* @param timeAmountInMillis amount of time in milliseconds
@@ -58,7 +47,7 @@ public class TimeAmountInterpreter
* @param timeUnit unit of the given amount
* @return an user-friendly description of the given time amount
*/
public static String consolidate(long timeAmount, TimeUnit timeUnit)
private static String consolidate(long timeAmount, TimeUnit timeUnit)
{
return consolidate(timeAmount, timeUnit, timeUnit, DAYS, "0 " + timeUnit.name().toLowerCase(Locale.ENGLISH));
}
@@ -92,7 +81,7 @@ public class TimeAmountInterpreter
* @throws RuntimeException if {@code textBuilder} throws an {@link IOException}
*/
@SuppressWarnings("unchecked")
public static <T extends Appendable & CharSequence> T appendConsolidated(T textBuilder, long timeAmount, TimeUnit timeUnit, TimeUnit minConsolidationUnit, TimeUnit maxConsolidationUnit, String noTimeUsedIndicator) throws RuntimeException
private static <T extends Appendable & CharSequence> T appendConsolidated(T textBuilder, long timeAmount, TimeUnit timeUnit, TimeUnit minConsolidationUnit, TimeUnit maxConsolidationUnit, String noTimeUsedIndicator) throws RuntimeException
{
try
{

View File

@@ -40,7 +40,6 @@ import java.util.stream.Collectors;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.commons.util.file.filter.ExtFilter;
import com.l2jmobius.gameserver.enums.HtmlActionScope;
import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import com.l2jmobius.gameserver.model.L2Object;
@@ -51,7 +50,6 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.tasks.player.IllegalPlayerActionTask;
import com.l2jmobius.gameserver.model.interfaces.ILocational;
import com.l2jmobius.gameserver.network.serverpackets.AbstractHtmlPacket;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.ShowBoard;
/**
@@ -119,15 +117,6 @@ public final class Util
return degree;
}
public static int convertDegreeToClientHeading(double degree)
{
if (degree < 0)
{
degree = 360 + degree;
}
return (int) (degree * 182.044444444);
}
public static int calculateHeadingFrom(ILocational from, ILocational to)
{
return calculateHeadingFrom(from.getX(), from.getY(), to.getX(), to.getY());
@@ -447,16 +436,6 @@ public final class Util
return dateFormat.format(date);
}
public static File[] getDatapackFiles(String dirname, String extention)
{
final File dir = new File(Config.DATAPACK_ROOT, "data/" + dirname);
if (!dir.exists())
{
return null;
}
return dir.listFiles(new ExtFilter(extention));
}
public static String getDateString(Date date)
{
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
@@ -567,18 +546,6 @@ public final class Util
buildHtmlLinkCache(player, scope, html);
}
/**
* Helper method to send a NpcHtmlMessage to the specified player.
* @param activeChar the player to send the html content to
* @param html the html content
*/
public static void sendHtml(L2PcInstance activeChar, String html)
{
final NpcHtmlMessage npcHtml = new NpcHtmlMessage();
npcHtml.setHtml(html);
activeChar.sendPacket(npcHtml);
}
/**
* Helper method to send a community board html to the specified player.<br>
* HtmlActionCache will be build with npc origin 0 which means the<br>

View File

@@ -257,7 +257,7 @@ public class TaskExecutor
/**
* Resumes the execution after it has been paused.
*/
public void resume()
private void resume()
{
synchronized (lock)
{

View File

@@ -28,7 +28,7 @@ public abstract class Token
public static final short TOKEN_VARIABLE = 6;
public static final short TOKEN_SEPARATOR = 7;
protected final int type;
private final int type;
Token(int type)
{
@@ -39,5 +39,4 @@ public abstract class Token
{
return type;
}
}

View File

@@ -312,12 +312,12 @@ public class Tokenizer
return Character.isDigit(ch) || (ch == '.') || (ch == 'e') || (ch == 'E') || (lastCharE && ((ch == '-') || (ch == '+')));
}
public static boolean isAlphabetic(int codePoint)
private static boolean isAlphabetic(int codePoint)
{
return Character.isLetter(codePoint);
}
public static boolean isVariableOrFunctionCharacter(int codePoint)
private static boolean isVariableOrFunctionCharacter(int codePoint)
{
return isAlphabetic(codePoint) || Character.isDigit(codePoint) || (codePoint == '_') || (codePoint == '.');
}

View File

@@ -37,8 +37,8 @@ import javax.swing.WindowConstants;
public class frmAbout
{
private JFrame frmAbout;
static final String URL = "www.l2jmobius.com";
URI uri;
private static final String URL = "www.l2jmobius.com";
final URI uri;
public frmAbout()
{
@@ -101,7 +101,7 @@ public class frmAbout
frmAbout.setLocationRelativeTo(null);
}
public static URI createURI(String str)
private static URI createURI(String str)
{
try
{