From 78a9b8c88e92500650d6113c6df0fff54a5be035 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Fri, 12 Mar 2021 21:22:15 -0600 Subject: [PATCH] Added default capacities to some arraylists --- .../game/content/activity/CutscenePlugin.java | 2 +- .../game/content/activity/duel/DuelArea.java | 16 +++++++------- .../game/content/activity/mta/MTAShop.java | 10 ++++----- .../content/dialogue/DialogueInterpreter.java | 2 +- .../game/content/dialogue/DialoguePlugin.java | 4 ++-- .../game/content/dialogue/JossikDialogue.java | 10 ++++----- .../dialogue/LumbridgeGuideDialogue.java | 12 +++++----- .../game/content/holiday/HolidayEvent.java | 2 +- .../game/interaction/item/HerbBoxPlugin.java | 10 ++++----- .../interaction/object/PyreSitePlugin.java | 22 +++++++++---------- .../object/ThievingGuidePlugin.java | 16 +++++++------- .../game/node/entity/impl/GameAttributes.java | 2 +- .../skill/cooking/CookingRecipePlugin.java | 2 +- .../node/entity/skill/hunter/HunterNPC.java | 2 +- .../entity/skill/hunter/HunterPlugin.java | 2 +- .../entity/skill/hunter/NetTrapSetting.java | 2 +- .../node/entity/skill/hunter/TrapWrapper.java | 2 +- .../game/node/entity/skill/hunter/Traps.java | 2 +- .../entity/skill/slayer/NechryaelNPC.java | 2 +- .../entity/skill/slayer/SlayerManager.java | 11 ++++------ .../skill/smithing/FurnaceOptionPlugin.java | 2 +- .../ai/general/scriptrepository/Adventurer.kt | 2 +- .../game/content/activity/mta/EnchantSpell.kt | 16 +++++++------- .../worldevents/shootingstar/ShootingStar.kt | 2 +- .../content/jobs/WorkForOptionListener.kt | 4 ++-- .../rs09/game/interaction/QCRepository.kt | 2 +- .../item/EnchantJewelleryTabOption.kt | 10 ++++----- .../entity/skill/farming/UseWithBinHandler.kt | 2 +- .../entity/skill/runecrafting/PouchManager.kt | 2 +- 29 files changed, 86 insertions(+), 89 deletions(-) diff --git a/Server/src/main/java/core/game/content/activity/CutscenePlugin.java b/Server/src/main/java/core/game/content/activity/CutscenePlugin.java index b483c10ef..4a999361f 100644 --- a/Server/src/main/java/core/game/content/activity/CutscenePlugin.java +++ b/Server/src/main/java/core/game/content/activity/CutscenePlugin.java @@ -33,7 +33,7 @@ public abstract class CutscenePlugin extends ActivityPlugin { /** * The npcs in our cutscene. */ - protected final List npcs = new ArrayList<>(); + protected final List npcs = new ArrayList<>(100); /** * The start pulse used for effect. diff --git a/Server/src/main/java/core/game/content/activity/duel/DuelArea.java b/Server/src/main/java/core/game/content/activity/duel/DuelArea.java index 7e09ff9f2..71abff60b 100644 --- a/Server/src/main/java/core/game/content/activity/duel/DuelArea.java +++ b/Server/src/main/java/core/game/content/activity/duel/DuelArea.java @@ -1,14 +1,9 @@ package core.game.content.activity.duel; -import java.util.ArrayList; -import java.util.List; - -import rs09.ServerConstants; import core.cache.def.impl.ObjectDefinition; import core.game.container.Container; import core.game.container.impl.EquipmentContainer; import core.game.content.dialogue.DialogueAction; -import core.game.node.entity.skill.summoning.familiar.Familiar; import core.game.interaction.Option; import core.game.interaction.OptionHandler; import core.game.node.Node; @@ -19,11 +14,11 @@ import core.game.node.entity.impl.PulseManager; import core.game.node.entity.player.Player; import core.game.node.entity.player.link.HintIconManager; import core.game.node.entity.player.link.prayer.PrayerType; +import core.game.node.entity.skill.summoning.familiar.Familiar; import core.game.node.item.GroundItem; import core.game.node.item.GroundItemManager; import core.game.node.item.Item; import core.game.system.task.Pulse; -import rs09.game.world.GameWorld; import core.game.world.map.Location; import core.game.world.map.RegionManager; import core.game.world.map.zone.MapZone; @@ -32,6 +27,11 @@ import core.game.world.map.zone.ZoneRestriction; import core.plugin.Plugin; import core.tools.RandomFunction; import core.tools.StringUtils; +import rs09.ServerConstants; +import rs09.game.world.GameWorld; + +import java.util.ArrayList; +import java.util.List; /** * Represents a dueling area. @@ -122,8 +122,8 @@ public class DuelArea extends MapZone { session.getOther().getInterfaceManager().restoreTabs(); session.getPlayer().setAttribute("duel:icon", HintIconManager.registerHintIcon(session.getPlayer(), session.getOther())); session.getOther().setAttribute("duel:icon", HintIconManager.registerHintIcon(session.getOther(), session.getPlayer())); - session.getPlayer().setAttribute("duel:ammo", new ArrayList()); - session.getOther().setAttribute("duel:ammo", new ArrayList()); + session.getPlayer().setAttribute("duel:ammo", new ArrayList(100)); + session.getOther().setAttribute("duel:ammo", new ArrayList(100)); session.getPlayer().setAttribute("vengeance", false); session.getOther().setAttribute("vengeance", false); GameWorld.getPulser().submit(new Pulse(4, session.getPlayer(), session.getOther()) { diff --git a/Server/src/main/java/core/game/content/activity/mta/MTAShop.java b/Server/src/main/java/core/game/content/activity/mta/MTAShop.java index 5f1a814f4..4bafd5efe 100644 --- a/Server/src/main/java/core/game/content/activity/mta/MTAShop.java +++ b/Server/src/main/java/core/game/content/activity/mta/MTAShop.java @@ -1,8 +1,5 @@ package core.game.content.activity.mta; -import java.util.ArrayList; -import java.util.List; - import core.game.component.CloseEvent; import core.game.component.Component; import core.game.component.ComponentPlugin; @@ -12,8 +9,11 @@ import core.game.container.access.InterfaceContainer; import core.game.node.entity.player.Player; import core.game.node.item.Item; import core.game.system.task.Pulse; -import rs09.game.world.GameWorld; import core.plugin.Plugin; +import rs09.game.world.GameWorld; + +import java.util.ArrayList; +import java.util.List; /** * Represents the mage training arena shop. @@ -44,7 +44,7 @@ public class MTAShop { /** * The viewers. */ - private final List viewers = new ArrayList<>(); + private final List viewers = new ArrayList<>(100); /** * The shop component. diff --git a/Server/src/main/java/core/game/content/dialogue/DialogueInterpreter.java b/Server/src/main/java/core/game/content/dialogue/DialogueInterpreter.java index f9595bdae..93250ec76 100644 --- a/Server/src/main/java/core/game/content/dialogue/DialogueInterpreter.java +++ b/Server/src/main/java/core/game/content/dialogue/DialogueInterpreter.java @@ -48,7 +48,7 @@ public final class DialogueInterpreter { /** * a List of dialogue actions. */ - private final List actions = new ArrayList<>(); + private final List actions = new ArrayList<>(10); /** * The currently opened dialogue. diff --git a/Server/src/main/java/core/game/content/dialogue/DialoguePlugin.java b/Server/src/main/java/core/game/content/dialogue/DialoguePlugin.java index e871c241b..119bf38b9 100644 --- a/Server/src/main/java/core/game/content/dialogue/DialoguePlugin.java +++ b/Server/src/main/java/core/game/content/dialogue/DialoguePlugin.java @@ -43,8 +43,8 @@ public abstract class DialoguePlugin implements Plugin { public DialogueFile file; - protected ArrayList optionNames = new ArrayList(); - protected ArrayList optionFiles = new ArrayList(); + protected ArrayList optionNames = new ArrayList(10); + protected ArrayList optionFiles = new ArrayList(10); /** * Two options interface. diff --git a/Server/src/main/java/core/game/content/dialogue/JossikDialogue.java b/Server/src/main/java/core/game/content/dialogue/JossikDialogue.java index 2d677105b..b58954d2d 100644 --- a/Server/src/main/java/core/game/content/dialogue/JossikDialogue.java +++ b/Server/src/main/java/core/game/content/dialogue/JossikDialogue.java @@ -1,13 +1,13 @@ package core.game.content.dialogue; -import java.util.ArrayList; -import java.util.List; - import core.game.content.global.GodBook; import core.game.node.entity.npc.NPC; import core.game.node.entity.player.Player; -import core.plugin.Initializable; import core.game.node.item.Item; +import core.plugin.Initializable; + +import java.util.ArrayList; +import java.util.List; /** * Handles the dialogue for jossik. @@ -86,7 +86,7 @@ public class JossikDialogue extends DialoguePlugin { stage = 23; return true; } - uncompleted = new ArrayList<>(); + uncompleted = new ArrayList<>(5); for (GodBook book : GodBook.values()) { if (!player.getSavedData().getGlobalData().hasCompletedGodBook(book)) { uncompleted.add(book); diff --git a/Server/src/main/java/core/game/content/dialogue/LumbridgeGuideDialogue.java b/Server/src/main/java/core/game/content/dialogue/LumbridgeGuideDialogue.java index 3a0275bc8..8bea22676 100644 --- a/Server/src/main/java/core/game/content/dialogue/LumbridgeGuideDialogue.java +++ b/Server/src/main/java/core/game/content/dialogue/LumbridgeGuideDialogue.java @@ -1,17 +1,17 @@ package core.game.content.dialogue; -import java.util.ArrayList; -import java.util.List; - import core.game.node.entity.npc.NPC; import core.game.node.entity.player.Player; import core.game.node.entity.player.info.Rights; import core.game.node.entity.player.link.IronmanMode; import core.game.node.entity.player.link.diary.DiaryType; -import rs09.game.world.GameWorld; import core.game.world.map.zone.impl.ModeratorZone; -import core.plugin.Initializable; import core.net.amsc.MSPacketRepository; +import core.plugin.Initializable; +import rs09.game.world.GameWorld; + +import java.util.ArrayList; +import java.util.List; /** * Represents the lumbridge guide dialogue plugin. @@ -65,7 +65,7 @@ public final class LumbridgeGuideDialogue extends DialoguePlugin { stage = 103; return true; } - options = new ArrayList<>(); + options = new ArrayList<>(5); options.add("Yes please."); if (player.getRights() == Rights.PLAYER_MODERATOR && ModeratorZone.isOpen() || player.isAdmin()) { options.add("I would like to access the P-Mod room."); diff --git a/Server/src/main/java/core/game/content/holiday/HolidayEvent.java b/Server/src/main/java/core/game/content/holiday/HolidayEvent.java index ed374a90f..b04f53ee2 100644 --- a/Server/src/main/java/core/game/content/holiday/HolidayEvent.java +++ b/Server/src/main/java/core/game/content/holiday/HolidayEvent.java @@ -21,7 +21,7 @@ public abstract class HolidayEvent extends MapZone implements Plugin { /** * The list of holiday events. */ - private static final List EVENTS = new ArrayList<>(); + private static final List EVENTS = new ArrayList<>(5); /** * The current holiday event. diff --git a/Server/src/main/java/core/game/interaction/item/HerbBoxPlugin.java b/Server/src/main/java/core/game/interaction/item/HerbBoxPlugin.java index e6d2ab39a..907b32e36 100644 --- a/Server/src/main/java/core/game/interaction/item/HerbBoxPlugin.java +++ b/Server/src/main/java/core/game/interaction/item/HerbBoxPlugin.java @@ -1,18 +1,18 @@ package core.game.interaction.item; -import java.util.ArrayList; -import java.util.List; - import core.cache.def.impl.ItemDefinition; import core.game.interaction.OptionHandler; import core.game.node.Node; import core.game.node.entity.player.Player; import core.game.node.item.ChanceItem; import core.game.node.item.Item; -import core.plugin.Plugin; import core.plugin.Initializable; +import core.plugin.Plugin; import core.tools.RandomFunction; +import java.util.ArrayList; +import java.util.List; + /** * Handles the herb box item. * @author Vexia @@ -49,7 +49,7 @@ public class HerbBoxPlugin extends OptionHandler { player.sendMessage("You don't have enough bank space to bank all those herbs."); break; } - List herbList = new ArrayList<>(); + List herbList = new ArrayList<>(5); for (int i = 0; i < herbs; i++) { herbList.add(RandomFunction.getChanceItem(HERBS)); } diff --git a/Server/src/main/java/core/game/interaction/object/PyreSitePlugin.java b/Server/src/main/java/core/game/interaction/object/PyreSitePlugin.java index 3c8ca4860..29c68ee0a 100644 --- a/Server/src/main/java/core/game/interaction/object/PyreSitePlugin.java +++ b/Server/src/main/java/core/game/interaction/object/PyreSitePlugin.java @@ -1,13 +1,6 @@ package core.game.interaction.object; -import java.util.ArrayList; -import java.util.List; - import core.cache.def.impl.ObjectDefinition; -import core.plugin.Initializable; -import core.game.node.entity.skill.Skills; -import core.game.node.entity.skill.firemaking.Log; -import core.game.node.entity.skill.gather.SkillingTool; import core.game.interaction.OptionHandler; import core.game.node.Node; import core.game.node.entity.Entity; @@ -16,18 +9,25 @@ import core.game.node.entity.npc.AbstractNPC; import core.game.node.entity.npc.NPC; import core.game.node.entity.npc.drop.DropFrequency; import core.game.node.entity.player.Player; +import core.game.node.entity.skill.Skills; +import core.game.node.entity.skill.firemaking.Log; +import core.game.node.entity.skill.gather.SkillingTool; import core.game.node.item.ChanceItem; import core.game.node.item.Item; import core.game.node.object.GameObject; import core.game.node.object.ObjectBuilder; import core.game.system.task.Pulse; -import rs09.game.world.GameWorld; import core.game.world.map.Location; -import rs09.game.world.repository.Repository; import core.game.world.update.flag.context.Animation; +import core.plugin.Initializable; import core.plugin.Plugin; -import rs09.plugin.PluginManager; import core.tools.RandomFunction; +import rs09.game.world.GameWorld; +import rs09.game.world.repository.Repository; +import rs09.plugin.PluginManager; + +import java.util.ArrayList; +import java.util.List; /** * Handles the pyre site plugin. @@ -59,7 +59,7 @@ public final class PyreSitePlugin extends OptionHandler { /** * The list of used pyre ship locations. */ - private static final List USED_LOCATIONS = new ArrayList<>(); + private static final List USED_LOCATIONS = new ArrayList<>(20); @Override public Plugin newInstance(Object arg) throws Throwable { diff --git a/Server/src/main/java/core/game/interaction/object/ThievingGuidePlugin.java b/Server/src/main/java/core/game/interaction/object/ThievingGuidePlugin.java index de5c48168..0219a99cd 100644 --- a/Server/src/main/java/core/game/interaction/object/ThievingGuidePlugin.java +++ b/Server/src/main/java/core/game/interaction/object/ThievingGuidePlugin.java @@ -1,26 +1,26 @@ package core.game.interaction.object; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import core.cache.def.impl.ObjectDefinition; -import core.plugin.Initializable; -import core.game.node.entity.skill.Skills; import core.game.interaction.OptionHandler; import core.game.node.Node; import core.game.node.entity.combat.ImpactHandler.HitsplatType; import core.game.node.entity.impl.Animator.Priority; import core.game.node.entity.player.Player; +import core.game.node.entity.skill.Skills; import core.game.node.item.ChanceItem; import core.game.node.item.Item; import core.game.node.object.GameObject; import core.game.node.object.ObjectBuilder; import core.game.system.task.Pulse; -import rs09.game.world.GameWorld; import core.game.world.update.flag.context.Animation; +import core.plugin.Initializable; import core.plugin.Plugin; import core.tools.RandomFunction; +import rs09.game.world.GameWorld; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; /** * Represents the thieving guide plugin. @@ -143,7 +143,7 @@ public class ThievingGuidePlugin extends OptionHandler { */ private void addItem(Player player) { ChanceItem[] l = RandomFunction.random(2) == 1 ? GEMS : COINS; - List chances = new ArrayList<>(); + List chances = new ArrayList<>(20); for (ChanceItem c : l) { chances.add(c); } diff --git a/Server/src/main/java/core/game/node/entity/impl/GameAttributes.java b/Server/src/main/java/core/game/node/entity/impl/GameAttributes.java index e97916f5f..bdf765a18 100644 --- a/Server/src/main/java/core/game/node/entity/impl/GameAttributes.java +++ b/Server/src/main/java/core/game/node/entity/impl/GameAttributes.java @@ -25,7 +25,7 @@ public final class GameAttributes { /** * The list of attributes to save. */ - private final List savedAttributes = new ArrayList<>(); + private final List savedAttributes = new ArrayList<>(250); /** * Constructs a new {@code GameAttributes} {@code Object}. diff --git a/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRecipePlugin.java b/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRecipePlugin.java index bde7a9264..ad823f822 100644 --- a/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRecipePlugin.java +++ b/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRecipePlugin.java @@ -80,7 +80,7 @@ public final class CookingRecipePlugin extends UseWithHandler { * @return the allowed nodes. */ private final static int[] getAllowedNodes() { - List bases = new ArrayList<>(); + List bases = new ArrayList<>(10); for (Recipe recipe : Recipe.RECIPES) { for (Item base : recipe.getParts()) { if (bases.contains(base.getId())) { diff --git a/Server/src/main/java/core/game/node/entity/skill/hunter/HunterNPC.java b/Server/src/main/java/core/game/node/entity/skill/hunter/HunterNPC.java index dc7d2173d..e47ef4733 100644 --- a/Server/src/main/java/core/game/node/entity/skill/hunter/HunterNPC.java +++ b/Server/src/main/java/core/game/node/entity/skill/hunter/HunterNPC.java @@ -84,7 +84,7 @@ public final class HunterNPC extends AbstractNPC { @Override public int[] getIds() { - List ids = new ArrayList<>(); + List ids = new ArrayList<>(10); for (Traps t : Traps.values()) { for (TrapNode node : t.getNodes()) { for (int id : node.getNpcIds()) { diff --git a/Server/src/main/java/core/game/node/entity/skill/hunter/HunterPlugin.java b/Server/src/main/java/core/game/node/entity/skill/hunter/HunterPlugin.java index 0ece66534..7074e8772 100644 --- a/Server/src/main/java/core/game/node/entity/skill/hunter/HunterPlugin.java +++ b/Server/src/main/java/core/game/node/entity/skill/hunter/HunterPlugin.java @@ -166,7 +166,7 @@ public final class HunterPlugin extends OptionHandler { * @return the ids. */ public static int[] getIds() { - List list = new ArrayList<>(); + List list = new ArrayList<>(10); for (Traps trap : Traps.values()) { for (int id : trap.getSettings().getBaitIds()) { list.add(id); diff --git a/Server/src/main/java/core/game/node/entity/skill/hunter/NetTrapSetting.java b/Server/src/main/java/core/game/node/entity/skill/hunter/NetTrapSetting.java index 31892abeb..55299b6d0 100644 --- a/Server/src/main/java/core/game/node/entity/skill/hunter/NetTrapSetting.java +++ b/Server/src/main/java/core/game/node/entity/skill/hunter/NetTrapSetting.java @@ -227,7 +227,7 @@ public final class NetTrapSetting extends TrapSetting { * @return the array. */ public static int[] getIds() { - List ids = new ArrayList<>(); + List ids = new ArrayList<>(10); for (NetTrap trap : NetTrap.values()) { ids.add(trap.getBent()); ids.add(trap.getCaught()); diff --git a/Server/src/main/java/core/game/node/entity/skill/hunter/TrapWrapper.java b/Server/src/main/java/core/game/node/entity/skill/hunter/TrapWrapper.java index 178a843f3..95d628bdf 100644 --- a/Server/src/main/java/core/game/node/entity/skill/hunter/TrapWrapper.java +++ b/Server/src/main/java/core/game/node/entity/skill/hunter/TrapWrapper.java @@ -21,7 +21,7 @@ public final class TrapWrapper { /** * The items to be recieved on trap clearing. */ - private final List items = new ArrayList<>(); + private final List items = new ArrayList<>(10); /** * The player instance. diff --git a/Server/src/main/java/core/game/node/entity/skill/hunter/Traps.java b/Server/src/main/java/core/game/node/entity/skill/hunter/Traps.java index 6599b72d7..9fd9aed0b 100644 --- a/Server/src/main/java/core/game/node/entity/skill/hunter/Traps.java +++ b/Server/src/main/java/core/game/node/entity/skill/hunter/Traps.java @@ -58,7 +58,7 @@ public enum Traps { /** * The location hooks for this node. */ - private final List hooks = new ArrayList<>(); + private final List hooks = new ArrayList<>(5); /** * The trap settings. diff --git a/Server/src/main/java/core/game/node/entity/skill/slayer/NechryaelNPC.java b/Server/src/main/java/core/game/node/entity/skill/slayer/NechryaelNPC.java index dcfee7128..1ce0c8546 100644 --- a/Server/src/main/java/core/game/node/entity/skill/slayer/NechryaelNPC.java +++ b/Server/src/main/java/core/game/node/entity/skill/slayer/NechryaelNPC.java @@ -29,7 +29,7 @@ public final class NechryaelNPC extends AbstractNPC { /** * The death spawn npcs. */ - private List spawns = new ArrayList<>(); + private List spawns = new ArrayList<>(10); /** * The next spawn time. diff --git a/Server/src/main/java/core/game/node/entity/skill/slayer/SlayerManager.java b/Server/src/main/java/core/game/node/entity/skill/slayer/SlayerManager.java index 4f1bad735..9fb1b24d0 100644 --- a/Server/src/main/java/core/game/node/entity/skill/slayer/SlayerManager.java +++ b/Server/src/main/java/core/game/node/entity/skill/slayer/SlayerManager.java @@ -1,17 +1,14 @@ package core.game.node.entity.skill.slayer; import core.cache.def.impl.NPCDefinition; -import rs09.game.system.SystemLogger; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import core.game.node.entity.skill.Skills; import core.game.node.entity.npc.NPC; import core.game.node.entity.player.Player; - import core.game.node.entity.player.link.diary.DiaryType; +import core.game.node.entity.skill.Skills; import core.tools.RandomFunction; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; -import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -165,7 +162,7 @@ public final class SlayerManager { * @param master the master to give the task. */ public void generate(Master master) { - final List tasks = new ArrayList<>(); + final List tasks = new ArrayList<>(10); final int[] taskWeightSum = {0}; master.tasks.stream().filter(task -> canBeAssigned(task.task) && task.task.combatCheck <= player.getProperties().getCurrentCombatLevel()).forEach(task -> { taskWeightSum[0] += task.weight; diff --git a/Server/src/main/java/core/game/node/entity/skill/smithing/FurnaceOptionPlugin.java b/Server/src/main/java/core/game/node/entity/skill/smithing/FurnaceOptionPlugin.java index 4497fb24f..9bc3613cf 100644 --- a/Server/src/main/java/core/game/node/entity/skill/smithing/FurnaceOptionPlugin.java +++ b/Server/src/main/java/core/game/node/entity/skill/smithing/FurnaceOptionPlugin.java @@ -150,7 +150,7 @@ public final class FurnaceOptionPlugin extends OptionHandler { * @return the ids. */ public static final int[] getIds() { - List ids = new ArrayList<>(); + List ids = new ArrayList<>(10); for (Bar bar : Bar.values()) { for (Item i : bar.getOres()) { ids.add(i.getId()); diff --git a/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/Adventurer.kt b/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/Adventurer.kt index 910f23090..467571249 100644 --- a/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/Adventurer.kt +++ b/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/Adventurer.kt @@ -692,7 +692,7 @@ class Adventurer(val style: CombatStyle): Script() { var citygroupA = listOf(falador, varrock, draynor, rimmington, lumbridge, edgeville) var citygroupB = listOf(yanille, ardougne, seers, catherby) - var bankMap = hashMapOf( + var bankMap = mapOf( falador to ZoneBorders(2950, 3374, 2943, 3368), varrock to ZoneBorders(3182, 3435, 3189, 3446), draynor to ZoneBorders(3092, 3240, 3095, 3246), diff --git a/Server/src/main/kotlin/rs09/game/content/activity/mta/EnchantSpell.kt b/Server/src/main/kotlin/rs09/game/content/activity/mta/EnchantSpell.kt index 8bb2626d9..bbb5f3351 100644 --- a/Server/src/main/kotlin/rs09/game/content/activity/mta/EnchantSpell.kt +++ b/Server/src/main/kotlin/rs09/game/content/activity/mta/EnchantSpell.kt @@ -25,7 +25,7 @@ class EnchantSpell : MagicSpell { /** * The enchantable jewellery array. */ - private val jewellery: HashMap? + private val jewellery: Map? /** * Constructs a new `EnchantSpell` `Object`. @@ -40,7 +40,7 @@ class EnchantSpell : MagicSpell { * @param jewellery The jewellery this spell is able to echant. * @param runes The runes required. */ - constructor(level: Int, experience: Double, jewellery: HashMap, runes: Array?) : super(SpellBook.MODERN, level, experience, ANIMATION, GRAPHIC, Audio(115, 1, 0), runes) { + constructor(level: Int, experience: Double, jewellery: Map, runes: Array?) : super(SpellBook.MODERN, level, experience, ANIMATION, GRAPHIC, Audio(115, 1, 0), runes) { this.jewellery = jewellery } @@ -109,7 +109,7 @@ class EnchantSpell : MagicSpell { * Enchant Sapphire Jewelry (Lvl-1 Enchant) */ SpellBook.MODERN.register(5, EnchantSpell(7, 17.5, - hashMapOf( + mapOf( //Begin Jewelry Enchantments Items.SAPPHIRE_RING_1637 to Item(Items.RING_OF_RECOIL_2550), Items.SAPPHIRE_NECKLACE_1656 to Item(Items.GAMES_NECKLACE8_3853), @@ -128,7 +128,7 @@ class EnchantSpell : MagicSpell { * Enchant Emerald Jewelry (Lvl-2 Enchant) */ SpellBook.MODERN.register(16, EnchantSpell(27, 37.0, - hashMapOf( + mapOf( //Begin Jewelry Enchantments Items.EMERALD_RING_1639 to Item(Items.RING_OF_DUELLING8_2552), Items.EMERALD_NECKLACE_1658 to Item(Items.BINDING_NECKLACE_5521), @@ -147,7 +147,7 @@ class EnchantSpell : MagicSpell { * Enchant Ruby Jewelry (Lvl-3 Enchant) */ SpellBook.MODERN.register(28, EnchantSpell(49, 59.0, - hashMapOf( + mapOf( //Begin Jewelry Enchantments Items.RUBY_RING_1641 to Item(Items.RING_OF_FORGING_2568), Items.RUBY_NECKLACE_1660 to Item(Items.DIGSITE_PENDANT_5_11194), @@ -166,7 +166,7 @@ class EnchantSpell : MagicSpell { * Enchant Diamond Jewelry (Lvl-4 Enchant) */ SpellBook.MODERN.register(36, EnchantSpell(57, 67.0, - hashMapOf( + mapOf( Items.DIAMOND_RING_1643 to Item(Items.RING_OF_LIFE_2570), Items.DIAMOND_NECKLACE_1662 to Item(Items.PHOENIX_NECKLACE_11090), Items.DIAMOND_AMULET_1700 to Item(Items.AMULET_OF_POWER_1731), @@ -184,7 +184,7 @@ class EnchantSpell : MagicSpell { * Enchant Dragonstone Jewelry (Lvl-5 Enchant) */ SpellBook.MODERN.register(51, EnchantSpell(68, 78.0, - hashMapOf( + mapOf( //Begin Jewelry Enchantment Items.DRAGONSTONE_RING_1645 to Item(14646), Items.DRAGON_NECKLACE_1664 to Item(Items.SKILLS_NECKLACE4_11105), @@ -203,7 +203,7 @@ class EnchantSpell : MagicSpell { * Enchant Onyx Jewelry (Lvl-6 Enchant) */ SpellBook.MODERN.register(61, EnchantSpell(87, 97.0, - hashMapOf( + mapOf( //Begin Jewelry Enchantments Items.ONYX_RING_6575 to Item(Items.RING_OF_STONE_6583), Items.ONYX_NECKLACE_6577 to Item(Items.BERSERKER_NECKLACE_11128), diff --git a/Server/src/main/kotlin/rs09/game/content/global/worldevents/shootingstar/ShootingStar.kt b/Server/src/main/kotlin/rs09/game/content/global/worldevents/shootingstar/ShootingStar.kt index 3acb0b19a..213020d97 100644 --- a/Server/src/main/kotlin/rs09/game/content/global/worldevents/shootingstar/ShootingStar.kt +++ b/Server/src/main/kotlin/rs09/game/content/global/worldevents/shootingstar/ShootingStar.kt @@ -12,7 +12,7 @@ import rs09.game.world.repository.Repository * @author Ceikry */ class ShootingStar(var level: ShootingStarType = ShootingStarType.values().random()){ - val crash_locations = hashMapOf( + val crash_locations = mapOf( "Canifis Bank" to Location.create(3504, 3487, 0), "Crafting Guild" to Location.create(2940, 3280, 0), "Falador East Bank" to Location.create(3030, 3349, 0), diff --git a/Server/src/main/kotlin/rs09/game/content/jobs/WorkForOptionListener.kt b/Server/src/main/kotlin/rs09/game/content/jobs/WorkForOptionListener.kt index c1828a792..655a0133e 100644 --- a/Server/src/main/kotlin/rs09/game/content/jobs/WorkForOptionListener.kt +++ b/Server/src/main/kotlin/rs09/game/content/jobs/WorkForOptionListener.kt @@ -22,7 +22,7 @@ class WorkForOptionListener : OptionListener() { Items.MITHRIL_WARHAMMER_1343 ) - val gatheringMap = hashMapOf>( + val gatheringMap = mapOf>( 0 to listOf(GatheringJobs.AIR_RUNE,GatheringJobs.COWHIDES,GatheringJobs.WATER_RUNE), 922 to listOf(GatheringJobs.ASHES,GatheringJobs.AIR_RUNE,GatheringJobs.WATER_RUNE), 3807 to listOf(GatheringJobs.COWHIDES), @@ -34,7 +34,7 @@ class WorkForOptionListener : OptionListener() { 4906 to listOf(GatheringJobs.LOG,GatheringJobs.OAK,GatheringJobs.WILLOW) ) - val typeMap = hashMapOf( + val typeMap = mapOf( 0 to 0, 705 to 1, 922 to 0, diff --git a/Server/src/main/kotlin/rs09/game/interaction/QCRepository.kt b/Server/src/main/kotlin/rs09/game/interaction/QCRepository.kt index f1a74b884..6bc7547d2 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/QCRepository.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/QCRepository.kt @@ -24,7 +24,7 @@ import java.nio.ByteBuffer //TODO: I've done the groundwork, Please someone else take up the task of rearranging these menus object QCRepository { - val skillIDs = hashMapOf( + val skillIDs = mapOf( 0 to "Agility", 1 to "Attack", 2 to "Construction", diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/EnchantJewelleryTabOption.kt b/Server/src/main/kotlin/rs09/game/interaction/item/EnchantJewelleryTabOption.kt index 6097e0166..b92bd0976 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/item/EnchantJewelleryTabOption.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/item/EnchantJewelleryTabOption.kt @@ -13,34 +13,34 @@ import kotlinx.coroutines.launch import org.rs09.consts.Items import rs09.game.system.SystemLogger -private val LVL_1_ENCHANT = hashMapOf( +private val LVL_1_ENCHANT = mapOf( Items.SAPPHIRE_RING_1637 to Item(Items.RING_OF_RECOIL_2550), Items.SAPPHIRE_NECKLACE_1656 to Item(Items.GAMES_NECKLACE8_3853), Items.SAPPHIRE_AMULET_1694 to Item(Items.AMULET_OF_MAGIC_1727), Items.SAPPHIRE_BRACELET_11072 to Item(Items.BRACELET_OF_CLAY_11074) ) -private val LVL_2_ENCHANT = hashMapOf( +private val LVL_2_ENCHANT = mapOf( Items.EMERALD_RING_1639 to Item(Items.RING_OF_DUELLING8_2552), Items.EMERALD_NECKLACE_1658 to Item(Items.BINDING_NECKLACE_5521), Items.EMERALD_AMULET_1696 to Item(Items.AMULET_OF_DEFENCE_1729), Items.EMERALD_BRACELET_11076 to Item(Items.CASTLEWAR_BRACE3_11079) ) -private val LVL_3_ENCHANT = hashMapOf( +private val LVL_3_ENCHANT = mapOf( Items.RUBY_RING_1641 to Item(Items.RING_OF_FORGING_2568), Items.RUBY_NECKLACE_1660 to Item(Items.DIGSITE_PENDANT_5_11194), Items.RUBY_AMULET_1698 to Item(Items.AMULET_OF_STRENGTH_1725), Items.RUBY_BRACELET_11085 to Item(Items.INOCULATION_BRACE_11088) ) -private val LVL_4_ENCHANT = hashMapOf( +private val LVL_4_ENCHANT = mapOf( Items.DIAMOND_RING_1643 to Item(Items.RING_OF_LIFE_2570), Items.DIAMOND_NECKLACE_1662 to Item(Items.PHOENIX_NECKLACE_11090), Items.DIAMOND_AMULET_1700 to Item(Items.AMULET_OF_POWER_1731), Items.DIAMOND_BRACELET_11092 to Item(Items.FORINTHRY_BRACE5_11095) ) -private val LVL_5_ENCHANT = hashMapOf( +private val LVL_5_ENCHANT = mapOf( Items.DRAGONSTONE_RING_1645 to Item(14646), Items.DRAGON_NECKLACE_1664 to Item(Items.SKILLS_NECKLACE4_11105), Items.DRAGONSTONE_AMMY_1702 to Item(Items.AMULET_OF_GLORY4_1712), diff --git a/Server/src/main/kotlin/rs09/game/node/entity/skill/farming/UseWithBinHandler.kt b/Server/src/main/kotlin/rs09/game/node/entity/skill/farming/UseWithBinHandler.kt index ad8eea868..c8c14777e 100644 --- a/Server/src/main/kotlin/rs09/game/node/entity/skill/farming/UseWithBinHandler.kt +++ b/Server/src/main/kotlin/rs09/game/node/entity/skill/farming/UseWithBinHandler.kt @@ -8,7 +8,7 @@ import org.rs09.consts.Items object UseWithBinHandler { @JvmField - val allowedNodes = ArrayList() + val allowedNodes = ArrayList(100) val fillAnim = Animation(832) val compostPotionAnimation = Animation(2259) val scoopAnimation = Animation(8905) diff --git a/Server/src/main/kotlin/rs09/game/node/entity/skill/runecrafting/PouchManager.kt b/Server/src/main/kotlin/rs09/game/node/entity/skill/runecrafting/PouchManager.kt index a74682523..150c4c25d 100644 --- a/Server/src/main/kotlin/rs09/game/node/entity/skill/runecrafting/PouchManager.kt +++ b/Server/src/main/kotlin/rs09/game/node/entity/skill/runecrafting/PouchManager.kt @@ -16,7 +16,7 @@ import rs09.tools.stringtools.colorize */ class PouchManager(val player: Player) { - val pouches = hashMapOf( + val pouches = mapOf( Items.SMALL_POUCH_5509 to RCPouch(3,1), Items.MEDIUM_POUCH_5510 to RCPouch(6,25), Items.LARGE_POUCH_5512 to RCPouch(9,50),