mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-12 09:30:19 -07:00
even more default capacities
This commit is contained in:
parent
78a9b8c88e
commit
19e20d9dc9
109 changed files with 144 additions and 144 deletions
|
|
@ -45,7 +45,7 @@ public class IoSession {
|
||||||
/**
|
/**
|
||||||
* The currently queued writing data.
|
* The currently queued writing data.
|
||||||
*/
|
*/
|
||||||
private List<ByteBuffer> writingQueue = new ArrayList<>();
|
private List<ByteBuffer> writingQueue = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The currently queued reading data.
|
* The currently queued reading data.
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public final class CommunicationInfo {
|
||||||
/**
|
/**
|
||||||
* The list of blocked players.
|
* The list of blocked players.
|
||||||
*/
|
*/
|
||||||
private final List<String> blocked = new ArrayList<>();
|
private final List<String> blocked = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The player's clan name.
|
* The player's clan name.
|
||||||
|
|
@ -105,7 +105,7 @@ public final class CommunicationInfo {
|
||||||
if (privateChatSetting != 2) {
|
if (privateChatSetting != 2) {
|
||||||
for (GameServer server : WorldDatabase.getWorlds()) {
|
for (GameServer server : WorldDatabase.getWorlds()) {
|
||||||
if (server != null && server.isActive()) {
|
if (server != null && server.isActive()) {
|
||||||
List<String> names = new ArrayList<>();
|
List<String> names = new ArrayList<>(20);
|
||||||
for (PlayerSession p : server.getPlayers().values()) {
|
for (PlayerSession p : server.getPlayers().values()) {
|
||||||
if (p.isActive() && p.getCommunication().contacts.containsKey(player.getUsername())) {
|
if (p.isActive() && p.getCommunication().contacts.containsKey(player.getUsername())) {
|
||||||
if (privateChatSetting == 0 || contacts.containsKey(p.getUsername())) {
|
if (privateChatSetting == 0 || contacts.containsKey(p.getUsername())) {
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public final class SQLTable {
|
||||||
* @return The columns.
|
* @return The columns.
|
||||||
*/
|
*/
|
||||||
public List<SQLColumn> getChanged() {
|
public List<SQLColumn> getChanged() {
|
||||||
List<SQLColumn> updated = new ArrayList<>();
|
List<SQLColumn> updated = new ArrayList<>(20);
|
||||||
for (int i = 0; i < columns.length; i++) {
|
for (int i = 0; i < columns.length; i++) {
|
||||||
SQLColumn column = columns[i];
|
SQLColumn column = columns[i];
|
||||||
if (column.isChanged()) {
|
if (column.isChanged()) {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import java.util.ArrayList;
|
||||||
@ScriptManifest(name = "Fetch data10", author = "b4", version = 2, logo = "", info = "info")
|
@ScriptManifest(name = "Fetch data10", author = "b4", version = 2, logo = "", info = "info")
|
||||||
public class Reader extends Script {
|
public class Reader extends Script {
|
||||||
|
|
||||||
private ArrayList<String> names = new ArrayList<>();
|
private ArrayList<String> names = new ArrayList<>(20);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int onLoop() {
|
public int onLoop() {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public class Container {
|
||||||
/**
|
/**
|
||||||
* The container listeners.
|
* The container listeners.
|
||||||
*/
|
*/
|
||||||
private final List<ContainerListener> listeners = new ArrayList<>();
|
private final List<ContainerListener> listeners = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@code Container} {@code Object}.
|
* Constructs a new {@code Container} {@code Object}.
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ public final class BarrowsPuzzle extends ComponentPlugin {
|
||||||
*/
|
*/
|
||||||
public BarrowsPuzzle create() {
|
public BarrowsPuzzle create() {
|
||||||
int[] answers = Arrays.copyOf(answerModels, answerModels.length);
|
int[] answers = Arrays.copyOf(answerModels, answerModels.length);
|
||||||
List<Integer> list = new ArrayList<>();
|
List<Integer> list = new ArrayList<>(20);
|
||||||
for (int answer : answers) {
|
for (int answer : answers) {
|
||||||
list.add(answer);
|
list.add(answer);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ public final class BountyHunterActivity extends ActivityPlugin {
|
||||||
/**
|
/**
|
||||||
* The waiting room.
|
* The waiting room.
|
||||||
*/
|
*/
|
||||||
private final List<Player> waitingRoom = new ArrayList<>();
|
private final List<Player> waitingRoom = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The crater type.
|
* The crater type.
|
||||||
|
|
|
||||||
|
|
@ -54,17 +54,17 @@ public final class ClanWarsActivityPlugin extends ActivityPlugin {
|
||||||
/**
|
/**
|
||||||
* The first clan's players.
|
* The first clan's players.
|
||||||
*/
|
*/
|
||||||
private List<Player> firstClanPlayers = new ArrayList<>();
|
private List<Player> firstClanPlayers = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The second clan's players.
|
* The second clan's players.
|
||||||
*/
|
*/
|
||||||
private List<Player> secondClanPlayers = new ArrayList<>();
|
private List<Player> secondClanPlayers = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The list of viewing players.
|
* The list of viewing players.
|
||||||
*/
|
*/
|
||||||
private List<Player> viewingPlayers = new ArrayList<>();
|
private List<Player> viewingPlayers = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The amount of ticks.
|
* The amount of ticks.
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ public final class DuelArenaActivity extends ActivityPlugin {
|
||||||
* @return {@code DuelArea} the area.
|
* @return {@code DuelArea} the area.
|
||||||
*/
|
*/
|
||||||
public static DuelArea getDuelArea(boolean obstacles) {
|
public static DuelArea getDuelArea(boolean obstacles) {
|
||||||
List<DuelArea> options = new ArrayList<>();
|
List<DuelArea> options = new ArrayList<>(20);
|
||||||
for (DuelArea area : DUEL_AREAS) {
|
for (DuelArea area : DUEL_AREAS) {
|
||||||
if (!obstacles && area.isObstacles() || obstacles && !area.isObstacles()) {
|
if (!obstacles && area.isObstacles() || obstacles && !area.isObstacles()) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ public final class GWDGraardorSwingHandler extends CombatSwingHandler {
|
||||||
} else {
|
} else {
|
||||||
ticks += (int) Math.ceil(entity.getLocation().getDistance(victim.getLocation()) * 0.3);
|
ticks += (int) Math.ceil(entity.getLocation().getDistance(victim.getLocation()) * 0.3);
|
||||||
NPC npc = (NPC) entity;
|
NPC npc = (NPC) entity;
|
||||||
List<BattleState> list = new ArrayList<>();
|
List<BattleState> list = new ArrayList<>(20);
|
||||||
for (Entity t : RegionManager.getLocalPlayers(npc, 28)) {
|
for (Entity t : RegionManager.getLocalPlayers(npc, 28)) {
|
||||||
if (!CHAMBER.insideBorder(t.getLocation())) {
|
if (!CHAMBER.insideBorder(t.getLocation())) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
|
||||||
} else {
|
} else {
|
||||||
ticks += (int) Math.ceil(entity.getLocation().getDistance(victim.getLocation()) * 0.3);
|
ticks += (int) Math.ceil(entity.getLocation().getDistance(victim.getLocation()) * 0.3);
|
||||||
NPC npc = (NPC) entity;
|
NPC npc = (NPC) entity;
|
||||||
List<BattleState> list = new ArrayList<>();
|
List<BattleState> list = new ArrayList<>(20);
|
||||||
for (Entity t : RegionManager.getLocalPlayers(npc, 28)) {
|
for (Entity t : RegionManager.getLocalPlayers(npc, 28)) {
|
||||||
if (!CHAMBER.insideBorder(t.getLocation())) {
|
if (!CHAMBER.insideBorder(t.getLocation())) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
|
||||||
state.setStyle(CombatStyle.MELEE);
|
state.setStyle(CombatStyle.MELEE);
|
||||||
} else {
|
} else {
|
||||||
NPC npc = (NPC) entity;
|
NPC npc = (NPC) entity;
|
||||||
List<BattleState> list = new ArrayList<>();
|
List<BattleState> list = new ArrayList<>(20);
|
||||||
for (Entity t : RegionManager.getLocalPlayers(npc.getCenterLocation(), (npc.size() >> 1) + 2)) {
|
for (Entity t : RegionManager.getLocalPlayers(npc.getCenterLocation(), (npc.size() >> 1) + 2)) {
|
||||||
if (t.getLocation().getX() < 2908 && t.isAttackable(npc, CombatStyle.MAGIC)) {
|
if (t.getLocation().getX() < 2908 && t.isAttackable(npc, CombatStyle.MAGIC)) {
|
||||||
list.add(new BattleState(entity, t));
|
list.add(new BattleState(entity, t));
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public final class GodWarsNPC extends AbstractNPC {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Entity> getPossibleTargets(Entity entity, int radius) {
|
public List<Entity> getPossibleTargets(Entity entity, int radius) {
|
||||||
List<Entity> targets = new ArrayList<>();
|
List<Entity> targets = new ArrayList<>(20);
|
||||||
for (Player player : RegionManager.getLocalPlayers(entity, radius)) {
|
for (Player player : RegionManager.getLocalPlayers(entity, radius)) {
|
||||||
if (canSelectTarget(entity, player)) {
|
if (canSelectTarget(entity, player)) {
|
||||||
targets.add(player);
|
targets.add(player);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public class AlchemistZone extends MTAZone {
|
||||||
/**
|
/**
|
||||||
* The players in the zone.
|
* The players in the zone.
|
||||||
*/
|
*/
|
||||||
private static final List<Player> PLAYERS = new ArrayList<>();
|
private static final List<Player> PLAYERS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The guardian.
|
* The guardian.
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class EnchantingZone extends MTAZone {
|
||||||
/**
|
/**
|
||||||
* The players in the zone.
|
* The players in the zone.
|
||||||
*/
|
*/
|
||||||
private static final List<Player> PLAYERS = new ArrayList<>();
|
private static final List<Player> PLAYERS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The guardian.
|
* The guardian.
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public class GraveyardZone extends MTAZone {
|
||||||
/**
|
/**
|
||||||
* The players in the zone.
|
* The players in the zone.
|
||||||
*/
|
*/
|
||||||
private static final List<Player> PLAYERS = new ArrayList<>();
|
private static final List<Player> PLAYERS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The runes rewarded by a chance.
|
* The runes rewarded by a chance.
|
||||||
|
|
@ -69,7 +69,7 @@ public class GraveyardZone extends MTAZone {
|
||||||
if (PLAYERS.isEmpty()) {
|
if (PLAYERS.isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
List<Location> locs = new ArrayList<>();
|
List<Location> locs = new ArrayList<>(20);
|
||||||
for (Location l : GFX_POS) {
|
for (Location l : GFX_POS) {
|
||||||
if (RandomFunction.random(12) >= 8) {
|
if (RandomFunction.random(12) >= 8) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public class TelekineticZone extends MTAZone {
|
||||||
/**
|
/**
|
||||||
* The mazes to choose from.
|
* The mazes to choose from.
|
||||||
*/
|
*/
|
||||||
private final List<Maze> mazes = new ArrayList<>();
|
private final List<Maze> mazes = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The dynamic region.
|
* The dynamic region.
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public final class BalloonManager extends OptionHandler {
|
||||||
/**
|
/**
|
||||||
* The list of dropped balloons.
|
* The list of dropped balloons.
|
||||||
*/
|
*/
|
||||||
private static final List<GameObject> balloons = new ArrayList<>();
|
private static final List<GameObject> balloons = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The count down time until droping.
|
* The count down time until droping.
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public final class PCObjectHandler extends OptionHandler {
|
||||||
//public boolean pcbotsSpawned = false;
|
//public boolean pcbotsSpawned = false;
|
||||||
public boolean PCnBotsSpawned = false;
|
public boolean PCnBotsSpawned = false;
|
||||||
public boolean PCiBotsSpawned = false;
|
public boolean PCiBotsSpawned = false;
|
||||||
public ArrayList<String> playersJoined = new ArrayList<>();
|
public ArrayList<String> playersJoined = new ArrayList<>(20);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||||
|
|
|
||||||
|
|
@ -60,12 +60,12 @@ public final class PestControlActivityPlugin extends ActivityPlugin {
|
||||||
/**
|
/**
|
||||||
* The waiting players.
|
* The waiting players.
|
||||||
*/
|
*/
|
||||||
private final List<Player> waitingPlayers = new ArrayList<>();
|
private final List<Player> waitingPlayers = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The active game sessions.
|
* The active game sessions.
|
||||||
*/
|
*/
|
||||||
private final List<PestControlSession> sessions = new ArrayList<>();
|
private final List<PestControlSession> sessions = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The game updating pulse.
|
* The game updating pulse.
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public final class PestControlSession {
|
||||||
/**
|
/**
|
||||||
* The barricade & gate objects.
|
* The barricade & gate objects.
|
||||||
*/
|
*/
|
||||||
private final List<GameObject> barricades = new ArrayList<>();
|
private final List<GameObject> barricades = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The amount of ticks.
|
* The amount of ticks.
|
||||||
|
|
@ -66,7 +66,7 @@ public final class PestControlSession {
|
||||||
/**
|
/**
|
||||||
* List of attackable portals
|
* List of attackable portals
|
||||||
*/
|
*/
|
||||||
private final List<NPC> aportals = new ArrayList<>();
|
private final List<NPC> aportals = new ArrayList<>(20);
|
||||||
/**
|
/**
|
||||||
* The portals.
|
* The portals.
|
||||||
*/
|
*/
|
||||||
|
|
@ -215,7 +215,7 @@ public final class PestControlSession {
|
||||||
public void startGame(List<Player> waitingPlayers) {
|
public void startGame(List<Player> waitingPlayers) {
|
||||||
region.flagActive();
|
region.flagActive();
|
||||||
initBarricadesList();
|
initBarricadesList();
|
||||||
List<Integer> list = new ArrayList<>();
|
List<Integer> list = new ArrayList<>(20);
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
list.add(i);
|
list.add(i);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ public final class PCShifterNPC extends AbstractNPC {
|
||||||
* @return The destination.
|
* @return The destination.
|
||||||
*/
|
*/
|
||||||
private Location getDestination(Entity victim) {
|
private Location getDestination(Entity victim) {
|
||||||
List<Location> locations = new ArrayList<>();
|
List<Location> locations = new ArrayList<>(20);
|
||||||
int radius = 2;
|
int radius = 2;
|
||||||
for (int x = -radius; x < radius + 1; x++) {
|
for (int x = -radius; x < radius + 1; x++) {
|
||||||
for (int y = -radius; y < radius + 1; y++) {
|
for (int y = -radius; y < radius + 1; y++) {
|
||||||
|
|
|
||||||
|
|
@ -671,7 +671,7 @@ public final class PCRewardInterface extends ComponentPlugin {
|
||||||
public Item[] constructPack() {
|
public Item[] constructPack() {
|
||||||
final int build = this == SEED_PACK || this == HERB_PACK ? RandomFunction.random(MIN_BUILD, MAX_BUILD) : RandomFunction.random(38, 43);
|
final int build = this == SEED_PACK || this == HERB_PACK ? RandomFunction.random(MIN_BUILD, MAX_BUILD) : RandomFunction.random(38, 43);
|
||||||
int left = build;
|
int left = build;
|
||||||
List<Item> pack = new ArrayList<>();
|
List<Item> pack = new ArrayList<>(20);
|
||||||
int amt = 0;
|
int amt = 0;
|
||||||
for (Item i : getReward()) {
|
for (Item i : getReward()) {
|
||||||
amt = this == SEED_PACK || this == HERB_PACK ? RandomFunction.random(1, 5) : RandomFunction.random(16, 25);
|
amt = this == SEED_PACK || this == HERB_PACK ? RandomFunction.random(1, 5) : RandomFunction.random(16, 25);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
|
||||||
/**
|
/**
|
||||||
* The moving wheat.
|
* The moving wheat.
|
||||||
*/
|
*/
|
||||||
private static final List<WheatSet> WHEAT = new ArrayList<>();
|
private static final List<WheatSet> WHEAT = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pulse.
|
* The pulse.
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin {
|
||||||
/**
|
/**
|
||||||
* The currently active NPCs.
|
* The currently active NPCs.
|
||||||
*/
|
*/
|
||||||
public List<NPC> activeNPCs = new ArrayList<>();
|
public List<NPC> activeNPCs = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@code TzhaarFightCavesPlugin} {@code Object}.
|
* Constructs a new {@code TzhaarFightCavesPlugin} {@code Object}.
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,12 @@ public final class TzhaarFightPitsPlugin extends ActivityPlugin {
|
||||||
/**
|
/**
|
||||||
* The lobby list.
|
* The lobby list.
|
||||||
*/
|
*/
|
||||||
private static final List<Player> LOBBY_PLAYERS = new ArrayList<>();
|
private static final List<Player> LOBBY_PLAYERS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The players in battle list.
|
* The players in battle list.
|
||||||
*/
|
*/
|
||||||
private static final List<Player> WAR_PLAYERS = new ArrayList<>();
|
private static final List<Player> WAR_PLAYERS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The interface id.
|
* The interface id.
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public final class BarrelRoom extends MapZone implements Plugin<Object> {
|
||||||
/**
|
/**
|
||||||
* The players list.
|
* The players list.
|
||||||
*/
|
*/
|
||||||
private static List<Player> players = new ArrayList<>();
|
private static List<Player> players = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pulse.
|
* The pulse.
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ public final class CatapultRoom extends MapZone implements Plugin<Object> {
|
||||||
/**
|
/**
|
||||||
* The players in the catapult room.
|
* The players in the catapult room.
|
||||||
*/
|
*/
|
||||||
private static List<Player> players = new ArrayList<>();
|
private static List<Player> players = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current attack.
|
* The current attack.
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public final class CyclopesRoom extends MapZone implements Plugin<Object> {
|
||||||
/**
|
/**
|
||||||
* The players in the room.
|
* The players in the room.
|
||||||
*/
|
*/
|
||||||
private static final List<Player> PLAYERS = new ArrayList<>();
|
private static final List<Player> PLAYERS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pulse.
|
* The pulse.
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ public final class QuizMasterDialogue extends DialoguePlugin {
|
||||||
private void display(QuizSet[] quiz) {
|
private void display(QuizSet[] quiz) {
|
||||||
QuizSet correct = quiz[0];
|
QuizSet correct = quiz[0];
|
||||||
QuizSet wrong = quiz[1];
|
QuizSet wrong = quiz[1];
|
||||||
List<Integer> childs = new ArrayList<>();
|
List<Integer> childs = new ArrayList<>(20);
|
||||||
childs.add(1);
|
childs.add(1);
|
||||||
childs.add(2);
|
childs.add(2);
|
||||||
childs.add(3);
|
childs.add(3);
|
||||||
|
|
@ -231,7 +231,7 @@ public final class QuizMasterDialogue extends DialoguePlugin {
|
||||||
* @return the set.
|
* @return the set.
|
||||||
*/
|
*/
|
||||||
public static QuizSet[] getQuizSet() {
|
public static QuizSet[] getQuizSet() {
|
||||||
List<QuizSet> sets = new ArrayList<>();
|
List<QuizSet> sets = new ArrayList<>(20);
|
||||||
for (QuizSet s : values()) {
|
for (QuizSet s : values()) {
|
||||||
sets.add(s);
|
sets.add(s);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ public enum Bones {
|
||||||
* @return the ids.
|
* @return the ids.
|
||||||
*/
|
*/
|
||||||
public static int[] getArray() {
|
public static int[] getArray() {
|
||||||
List<Integer> list = new ArrayList<>();
|
List<Integer> list = new ArrayList<>(20);
|
||||||
for (int i : bones.keySet()) {
|
for (int i : bones.keySet()) {
|
||||||
list.add(i);
|
list.add(i);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ public class Shop {
|
||||||
/**
|
/**
|
||||||
* Represents the list of shop viewers.
|
* Represents the list of shop viewers.
|
||||||
*/
|
*/
|
||||||
private final List<ShopViewer> viewers = new ArrayList<>();
|
private final List<ShopViewer> viewers = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the title of the shop.
|
* Represents the title of the shop.
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ public final class ShipCharter {
|
||||||
*/
|
*/
|
||||||
Destination.OO_GLOG, Destination.SHIPYARD, /* Destination.PORT_TYRAS, */
|
Destination.OO_GLOG, Destination.SHIPYARD, /* Destination.PORT_TYRAS, */
|
||||||
Destination.CRANDOR };
|
Destination.CRANDOR };
|
||||||
List<Integer> childs = new ArrayList<>();
|
List<Integer> childs = new ArrayList<>(20);
|
||||||
for (Destination destination : restrictions) {
|
for (Destination destination : restrictions) {
|
||||||
childs.add(destination.getXChild());
|
childs.add(destination.getXChild());
|
||||||
childs.add(destination.getNameChild());
|
childs.add(destination.getNameChild());
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ScoreboardManager {
|
public class ScoreboardManager {
|
||||||
public static List<ScoreboardEntry> entries = new ArrayList<>();
|
public static List<ScoreboardEntry> entries = new ArrayList<>(20);
|
||||||
|
|
||||||
public static void submit(Player player){
|
public static void submit(Player player){
|
||||||
if(entries.size() == 5){
|
if(entries.size() == 5){
|
||||||
|
|
|
||||||
|
|
@ -884,7 +884,7 @@ public class DeathMansionEvent extends HolidayEvent {
|
||||||
public static List<GrimItem> getGrimItems(Player player) {
|
public static List<GrimItem> getGrimItems(Player player) {
|
||||||
List<GrimItem> items = player.getAttribute("grim-items", null);
|
List<GrimItem> items = player.getAttribute("grim-items", null);
|
||||||
if (items == null) {
|
if (items == null) {
|
||||||
items = new ArrayList<>();
|
items = new ArrayList<>(20);
|
||||||
}
|
}
|
||||||
player.setAttribute("grim-items", items);
|
player.setAttribute("grim-items", items);
|
||||||
return items;
|
return items;
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ public class DemonSlayer extends Quest {
|
||||||
* @return the incantation.
|
* @return the incantation.
|
||||||
*/
|
*/
|
||||||
private final static String generateIncantation() {
|
private final static String generateIncantation() {
|
||||||
List<String> incantations = new ArrayList<>();
|
List<String> incantations = new ArrayList<>(20);
|
||||||
for (String s : INCANTATIONS) {
|
for (String s : INCANTATIONS) {
|
||||||
incantations.add(s);
|
incantations.add(s);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ public final class DragonSlayerCutscene extends CutscenePlugin {
|
||||||
/**
|
/**
|
||||||
* Represents the active fires.
|
* Represents the active fires.
|
||||||
*/
|
*/
|
||||||
private List<Location> fires = new ArrayList<>();
|
private List<Location> fires = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents if the fires are done burning.
|
* Represents if the fires are done burning.
|
||||||
|
|
|
||||||
|
|
@ -741,7 +741,7 @@ public final class AvaDialogue extends DialoguePlugin {
|
||||||
* @param remove the remove item.
|
* @param remove the remove item.
|
||||||
*/
|
*/
|
||||||
private void removeAll(Player player, Item add, Item remove) {
|
private void removeAll(Player player, Item add, Item remove) {
|
||||||
List<Container> containers = new ArrayList<>();
|
List<Container> containers = new ArrayList<>(20);
|
||||||
containers.add(player.getInventory());
|
containers.add(player.getInventory());
|
||||||
containers.add(player.getEquipment());
|
containers.add(player.getEquipment());
|
||||||
containers.add(player.getBank());
|
containers.add(player.getBank());
|
||||||
|
|
|
||||||
|
|
@ -92,12 +92,12 @@ public final class WaterfallPlugin extends OptionHandler {
|
||||||
/**
|
/**
|
||||||
* The swimmer swimming.
|
* The swimmer swimming.
|
||||||
*/
|
*/
|
||||||
private static final List<Player> SWIMMERS = new ArrayList<>();
|
private static final List<Player> SWIMMERS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ropes.
|
* The ropes.
|
||||||
*/
|
*/
|
||||||
private static final List<GameObject> ROPES = new ArrayList<>();
|
private static final List<GameObject> ROPES = new ArrayList<>(20);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||||
|
|
|
||||||
|
|
@ -552,11 +552,11 @@ public enum ClueLevel {
|
||||||
* @return the rewar
|
* @return the rewar
|
||||||
*/
|
*/
|
||||||
public List<Item> getLoot(Player player) {
|
public List<Item> getLoot(Player player) {
|
||||||
List<ChanceItem> items = new ArrayList<>();
|
List<ChanceItem> items = new ArrayList<>(20);
|
||||||
List<Integer> ids = new ArrayList<>();
|
List<Integer> ids = new ArrayList<>(20);
|
||||||
items.addAll(Arrays.asList(DEFAULT_REWARDS));
|
items.addAll(Arrays.asList(DEFAULT_REWARDS));
|
||||||
items.addAll(Arrays.asList(this.getRewards()));
|
items.addAll(Arrays.asList(this.getRewards()));
|
||||||
List<Item> rewards = new ArrayList<>();
|
List<Item> rewards = new ArrayList<>(20);
|
||||||
int size = RandomFunction.random(1, 6);
|
int size = RandomFunction.random(1, 6);
|
||||||
if (this == HARD) {
|
if (this == HARD) {
|
||||||
size = RandomFunction.random(4, 6);
|
size = RandomFunction.random(4, 6);
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ public abstract class ClueScrollPlugin extends MapZone implements Plugin<Object>
|
||||||
}
|
}
|
||||||
List<ClueScrollPlugin> organized = (List<ClueScrollPlugin>) ORGANIZED.get(clue.getLevel());
|
List<ClueScrollPlugin> organized = (List<ClueScrollPlugin>) ORGANIZED.get(clue.getLevel());
|
||||||
if (organized == null) {
|
if (organized == null) {
|
||||||
organized = new ArrayList<>();
|
organized = new ArrayList<>(20);
|
||||||
}
|
}
|
||||||
organized.add(clue);
|
organized.add(clue);
|
||||||
ZoneBuilder.configure(clue);
|
ZoneBuilder.configure(clue);
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public final class DesertZone extends MapZone implements Plugin<Object> {
|
||||||
/**
|
/**
|
||||||
* The players list.
|
* The players list.
|
||||||
*/
|
*/
|
||||||
private static final List<Player> PLAYERS = new ArrayList<>();
|
private static final List<Player> PLAYERS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The water draining pulse.
|
* The water draining pulse.
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public class WildernessAreaZone extends MapZone implements Plugin<Object> {
|
||||||
/**
|
/**
|
||||||
* The list of players in the arena.
|
* The list of players in the arena.
|
||||||
*/
|
*/
|
||||||
private final List<Player> players = new ArrayList<>();
|
private final List<Player> players = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@code WildernessAreaZone} {@code Object}
|
* Constructs a new {@code WildernessAreaZone} {@code Object}
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ public final class WaterBirthDungeonZone extends MapZone implements Plugin<Objec
|
||||||
if (e instanceof Player) {
|
if (e instanceof Player) {
|
||||||
final Player p = (e.asPlayer());
|
final Player p = (e.asPlayer());
|
||||||
if (p.getLocation().equals(new Location(2545, 10144, 0)) || p.getLocation().equals(new Location(2545, 10142, 0))) {
|
if (p.getLocation().equals(new Location(2545, 10144, 0)) || p.getLocation().equals(new Location(2545, 10142, 0))) {
|
||||||
final List<NPC> eggs = new ArrayList<>();
|
final List<NPC> eggs = new ArrayList<>(20);
|
||||||
NPC n = Repository.findNPC(new Location(2546, 10142, 0));
|
NPC n = Repository.findNPC(new Location(2546, 10142, 0));
|
||||||
if (n != null && n.getId() == 2449) {
|
if (n != null && n.getId() == 2449) {
|
||||||
eggs.add(n);
|
eggs.add(n);
|
||||||
|
|
@ -113,7 +113,7 @@ public final class WaterBirthDungeonZone extends MapZone implements Plugin<Objec
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
final List<NPC> spawns = new ArrayList<>();
|
final List<NPC> spawns = new ArrayList<>(20);
|
||||||
for (NPC n : eggs) {
|
for (NPC n : eggs) {
|
||||||
n.transform(n.getId() + 1);
|
n.transform(n.getId() + 1);
|
||||||
NPC spawn = NPC.create(2454, n.getLocation().transform(-1, 0, 0));
|
NPC spawn = NPC.create(2454, n.getLocation().transform(-1, 0, 0));
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public abstract class OptionHandler implements Plugin<Object> {
|
||||||
*/
|
*/
|
||||||
public int[] getValidChildren(int wrapper) {
|
public int[] getValidChildren(int wrapper) {
|
||||||
final ObjectDefinition definition = ObjectDefinition.forId(wrapper);
|
final ObjectDefinition definition = ObjectDefinition.forId(wrapper);
|
||||||
final List<Integer> list = new ArrayList<>();
|
final List<Integer> list = new ArrayList<>(20);
|
||||||
if (definition.getChildrenIds() == null) {
|
if (definition.getChildrenIds() == null) {
|
||||||
SystemLogger.logErr("Null child wrapper in option handler wrapperId=" + wrapper);
|
SystemLogger.logErr("Null child wrapper in option handler wrapperId=" + wrapper);
|
||||||
return new int[] { wrapper };
|
return new int[] { wrapper };
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public abstract class UseWithHandler implements Plugin<Object> {
|
||||||
int key = id | type << 16;
|
int key = id | type << 16;
|
||||||
List<UseWithHandler> handlers = HANDLERS.get(key);
|
List<UseWithHandler> handlers = HANDLERS.get(key);
|
||||||
if (handlers == null) {
|
if (handlers == null) {
|
||||||
HANDLERS.put(key, handlers = new ArrayList<>());
|
HANDLERS.put(key, handlers = new ArrayList<>(20));
|
||||||
}
|
}
|
||||||
if (type == PLAYER_TYPE) {
|
if (type == PLAYER_TYPE) {
|
||||||
if (handler.allowedNodes == null) {
|
if (handler.allowedNodes == null) {
|
||||||
|
|
@ -204,7 +204,7 @@ public abstract class UseWithHandler implements Plugin<Object> {
|
||||||
*/
|
*/
|
||||||
public int[] getValidChildren(int wrapper) {
|
public int[] getValidChildren(int wrapper) {
|
||||||
final ObjectDefinition definition = ObjectDefinition.forId(wrapper);
|
final ObjectDefinition definition = ObjectDefinition.forId(wrapper);
|
||||||
final List<Integer> list = new ArrayList<>();
|
final List<Integer> list = new ArrayList<>(20);
|
||||||
if (definition.getChildrenIds() == null) {
|
if (definition.getChildrenIds() == null) {
|
||||||
SystemLogger.logErr("Null child wrapper in option handler wrapperId=" + wrapper);
|
SystemLogger.logErr("Null child wrapper in option handler wrapperId=" + wrapper);
|
||||||
return new int[]{wrapper};
|
return new int[]{wrapper};
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public final class CasketPlugin extends OptionHandler {
|
||||||
*/
|
*/
|
||||||
private ChanceItem getChanceItem(ChanceItem[] items) {
|
private ChanceItem getChanceItem(ChanceItem[] items) {
|
||||||
final int chance = RandomFunction.random(100);
|
final int chance = RandomFunction.random(100);
|
||||||
final List<ChanceItem> chances = new ArrayList<>();
|
final List<ChanceItem> chances = new ArrayList<>(20);
|
||||||
for (ChanceItem c : items) {
|
for (ChanceItem c : items) {
|
||||||
if (chance > c.getChanceRate()) {
|
if (chance > c.getChanceRate()) {
|
||||||
chances.add(c);
|
chances.add(c);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import java.util.Objects;
|
||||||
@Initializable
|
@Initializable
|
||||||
public class DiangoReclaimInterface extends ComponentPlugin {
|
public class DiangoReclaimInterface extends ComponentPlugin {
|
||||||
private static final int COMPONENT_ID = 468;
|
private static final int COMPONENT_ID = 468;
|
||||||
public static final List<Item> ITEMS = new ArrayList<>();
|
public static final List<Item> ITEMS = new ArrayList<>(20);
|
||||||
public static final Item[] HOLIDAY_ITEMS = {YoyoPlugin.YOYO, ReindeerHatPlugin.ReindeerHat, BasketofEggsEvent.RUBBER_CHICKEN,ZombieHeadPlugin.ZOMBIE_HEAD, new Item(6857), new Item(6856), new Item(6858), new Item(6859), new Item(6860), new Item(6861), new Item(6862), new Item(6863), new Item(9920), new Item(9921),new Item(9922), new Item(9923), new Item(9924), new Item(9925), new Item(11019), new Item(11020), new Item(11021), new Item(11022), new Item(11789), new Item(11949), new Item(12634), new Item(14076), new Item(14077), new Item(14081),new Item(14595), new Item(14602), new Item(14603), new Item(14605)};
|
public static final Item[] HOLIDAY_ITEMS = {YoyoPlugin.YOYO, ReindeerHatPlugin.ReindeerHat, BasketofEggsEvent.RUBBER_CHICKEN,ZombieHeadPlugin.ZOMBIE_HEAD, new Item(6857), new Item(6856), new Item(6858), new Item(6859), new Item(6860), new Item(6861), new Item(6862), new Item(6863), new Item(9920), new Item(9921),new Item(9922), new Item(9923), new Item(9924), new Item(9925), new Item(11019), new Item(11020), new Item(11021), new Item(11022), new Item(11789), new Item(11949), new Item(12634), new Item(14076), new Item(14077), new Item(14081),new Item(14595), new Item(14602), new Item(14603), new Item(14605)};
|
||||||
|
|
||||||
//initialize the plugin, add lists of items to the ITEMS list...
|
//initialize the plugin, add lists of items to the ITEMS list...
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ public abstract class CombatSpell extends MagicSpell {
|
||||||
* @return The list of targets.
|
* @return The list of targets.
|
||||||
*/
|
*/
|
||||||
public List<Entity> getMultihitTargets(Entity entity, Entity target, int max) {
|
public List<Entity> getMultihitTargets(Entity entity, Entity target, int max) {
|
||||||
List<Entity> list = new ArrayList<>();
|
List<Entity> list = new ArrayList<>(20);
|
||||||
list.add(target);
|
list.add(target);
|
||||||
boolean npc = target instanceof NPC;
|
boolean npc = target instanceof NPC;
|
||||||
for (Entity e : npc ? RegionManager.getLocalNpcs(target, 1) : RegionManager.getLocalPlayers(target, 1)) {
|
for (Entity e : npc ? RegionManager.getLocalNpcs(target, 1) : RegionManager.getLocalPlayers(target, 1)) {
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ public abstract class DegradableEquipment implements Plugin<Object> {
|
||||||
public DegradableEquipment newInstance(Object arg) {
|
public DegradableEquipment newInstance(Object arg) {
|
||||||
List<DegradableEquipment> equipment = EQUIPMENT[slot];
|
List<DegradableEquipment> equipment = EQUIPMENT[slot];
|
||||||
if (equipment == null) {
|
if (equipment == null) {
|
||||||
equipment = EQUIPMENT[slot] = new ArrayList<>();
|
equipment = EQUIPMENT[slot] = new ArrayList<>(20);
|
||||||
}
|
}
|
||||||
equipment.add(this);
|
equipment.add(this);
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ public final class SweepSpecialHandler extends MeleeSwingHandler implements Plug
|
||||||
int x = vl.getX();
|
int x = vl.getX();
|
||||||
int y = vl.getY();
|
int y = vl.getY();
|
||||||
Direction dir = Direction.getDirection(x - entity.getLocation().getX(), y - entity.getLocation().getY());
|
Direction dir = Direction.getDirection(x - entity.getLocation().getX(), y - entity.getLocation().getY());
|
||||||
List<BattleState> l = new ArrayList<>();
|
List<BattleState> l = new ArrayList<>(20);
|
||||||
l.add(new BattleState(entity, victim));
|
l.add(new BattleState(entity, victim));
|
||||||
for (Entity n : victim instanceof NPC ? RegionManager.getSurroundingNPCs(victim, 9, entity, victim) : RegionManager.getSurroundingPlayers(victim, 9, entity, victim)) {
|
for (Entity n : victim instanceof NPC ? RegionManager.getSurroundingNPCs(victim, 9, entity, victim) : RegionManager.getSurroundingPlayers(victim, 9, entity, victim)) {
|
||||||
if (n instanceof Familiar) {
|
if (n instanceof Familiar) {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ public class SpellBlocks {
|
||||||
if(blocks.get(spellId) != null){
|
if(blocks.get(spellId) != null){
|
||||||
blocks.get(spellId).add(toBlock);
|
blocks.get(spellId).add(toBlock);
|
||||||
} else {
|
} else {
|
||||||
List<Node> blockslist = new ArrayList<>();
|
List<Node> blockslist = new ArrayList<>(20);
|
||||||
blockslist.add(toBlock);
|
blockslist.add(toBlock);
|
||||||
blocks.put(spellId,blockslist);
|
blocks.put(spellId,blockslist);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ public class AggressiveBehavior {
|
||||||
* @return The list of possible targets.
|
* @return The list of possible targets.
|
||||||
*/
|
*/
|
||||||
public List<Entity> getPossibleTargets(Entity entity, int radius) {
|
public List<Entity> getPossibleTargets(Entity entity, int radius) {
|
||||||
List<Entity> targets = new ArrayList<>();
|
List<Entity> targets = new ArrayList<>(20);
|
||||||
for (Player player : RegionManager.getLocalPlayers(entity, radius)) {
|
for (Player player : RegionManager.getLocalPlayers(entity, radius)) {
|
||||||
if (canSelectTarget(entity, player)) {
|
if (canSelectTarget(entity, player)) {
|
||||||
targets.add(player);
|
targets.add(player);
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ public final class KalphiteQueenNPC extends AbstractNPC {
|
||||||
* @return The targets array.
|
* @return The targets array.
|
||||||
*/
|
*/
|
||||||
private BattleState[] getRangeTargets(Entity e, Entity victim) {
|
private BattleState[] getRangeTargets(Entity e, Entity victim) {
|
||||||
List<BattleState> list = new ArrayList<>();
|
List<BattleState> list = new ArrayList<>(20);
|
||||||
for (Entity t : RegionManager.getLocalPlayers(victim, -1 + (int) e.getCenterLocation().getDistance(victim.getLocation()))) {
|
for (Entity t : RegionManager.getLocalPlayers(victim, -1 + (int) e.getCenterLocation().getDistance(victim.getLocation()))) {
|
||||||
if (t.isAttackable(e, CombatStyle.RANGE)) {
|
if (t.isAttackable(e, CombatStyle.RANGE)) {
|
||||||
list.add(new BattleState(e, t));
|
list.add(new BattleState(e, t));
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ public final class CorporealBeastNPC extends AbstractNPC {
|
||||||
Location p = player.getLocation();
|
Location p = player.getLocation();
|
||||||
if (p.getX() >= l.getX() && p.getY() >= l.getY() && p.getX() < l.getX() + entity.size() && p.getY() < l.getY() + entity.size()) {
|
if (p.getX() >= l.getX() && p.getY() >= l.getY() && p.getX() < l.getX() + entity.size() && p.getY() < l.getY() + entity.size()) {
|
||||||
if (stompTargets == null) {
|
if (stompTargets == null) {
|
||||||
stompTargets = new ArrayList<>();
|
stompTargets = new ArrayList<>(20);
|
||||||
}
|
}
|
||||||
stompTargets.add(player);
|
stompTargets.add(player);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,17 +40,17 @@ public final class NPCDropTables {
|
||||||
/**
|
/**
|
||||||
* The default drop table (holding the 100% drops).
|
* The default drop table (holding the 100% drops).
|
||||||
*/
|
*/
|
||||||
private final List<WeightedChanceItem> defaultTable = new ArrayList<>();
|
private final List<WeightedChanceItem> defaultTable = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The charms drop table (holding the charm drops).
|
* The charms drop table (holding the charm drops).
|
||||||
*/
|
*/
|
||||||
private final List<WeightedChanceItem> charmTable = new ArrayList<>();
|
private final List<WeightedChanceItem> charmTable = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The main drop table (holding the main drops).
|
* The main drop table (holding the main drops).
|
||||||
*/
|
*/
|
||||||
private final List<WeightedChanceItem> mainTable = new ArrayList<>();
|
private final List<WeightedChanceItem> mainTable = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The NPC definitions.
|
* The NPC definitions.
|
||||||
|
|
@ -175,7 +175,7 @@ public final class NPCDropTables {
|
||||||
if (player != null && npc.getProperties().isMultiZone() && (GrandExchangeDatabase.getDatabase().get(itemId) != null || item.getName().endsWith("charm")) && player.getCommunication().getClan() != null && player.getCommunication().isLootShare() && player.getCommunication().getLootRequirement().ordinal() >= player.getCommunication().getClan().getLootRequirement().ordinal() && !player.getIronmanManager().isIronman()) {
|
if (player != null && npc.getProperties().isMultiZone() && (GrandExchangeDatabase.getDatabase().get(itemId) != null || item.getName().endsWith("charm")) && player.getCommunication().getClan() != null && player.getCommunication().isLootShare() && player.getCommunication().getLootRequirement().ordinal() >= player.getCommunication().getClan().getLootRequirement().ordinal() && !player.getIronmanManager().isIronman()) {
|
||||||
Player looter = player;
|
Player looter = player;
|
||||||
List<Player> players = RegionManager.getLocalPlayers(npc, 16);
|
List<Player> players = RegionManager.getLocalPlayers(npc, 16);
|
||||||
List<Player> looters = new ArrayList<>();
|
List<Player> looters = new ArrayList<>(20);
|
||||||
for (Player p : players) {
|
for (Player p : players) {
|
||||||
if (p != null && p.getCommunication().getClan() != null && p.getCommunication().getClan() == player.getCommunication().getClan() && p.getCommunication().isLootShare() && p.getCommunication().getLootRequirement().ordinal() >= p.getCommunication().getClan().getLootRequirement().ordinal() && npc.getImpactHandler().getImpactLog().containsKey(p)) {
|
if (p != null && p.getCommunication().getClan() != null && p.getCommunication().getClan() == player.getCommunication().getClan() && p.getCommunication().isLootShare() && p.getCommunication().getLootRequirement().ordinal() >= p.getCommunication().getClan().getLootRequirement().ordinal() && npc.getImpactHandler().getImpactLog().containsKey(p)) {
|
||||||
looters.add(p);
|
looters.add(p);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ public final class RareDropTable {
|
||||||
/**
|
/**
|
||||||
* The rare drop table.
|
* The rare drop table.
|
||||||
*/
|
*/
|
||||||
private static final List<WeightedChanceItem> TABLE = new ArrayList<>();
|
private static final List<WeightedChanceItem> TABLE = new ArrayList<>(20);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ public final class DesertWyrmNPC extends Forager {
|
||||||
* @return the object.
|
* @return the object.
|
||||||
*/
|
*/
|
||||||
public GameObject getClosestRock(Player player) {
|
public GameObject getClosestRock(Player player) {
|
||||||
List<GameObject> rocks = new ArrayList<>();
|
List<GameObject> rocks = new ArrayList<>(20);
|
||||||
for (int k = 0; k < 7; k++) {
|
for (int k = 0; k < 7; k++) {
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
Direction dir = Direction.get(i);
|
Direction dir = Direction.get(i);
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public class BorkNPC extends AbstractNPC {
|
||||||
/**
|
/**
|
||||||
* The list of the legion npc.
|
* The list of the legion npc.
|
||||||
*/
|
*/
|
||||||
private final List<NPC> legions = new ArrayList<>();
|
private final List<NPC> legions = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the legion is spawned.
|
* If the legion is spawned.
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class StrayDogNPC extends AbstractNPC {
|
||||||
/**
|
/**
|
||||||
* Represents the array list of players.
|
* Represents the array list of players.
|
||||||
*/
|
*/
|
||||||
private List<Player> players = new ArrayList<>();
|
private List<Player> players = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@code AlKharidWarriorPlugin} {@code Object}.
|
* Constructs a new {@code AlKharidWarriorPlugin} {@code Object}.
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ public class RevenantPlugin implements Plugin<Object> {
|
||||||
/**
|
/**
|
||||||
* The revenants npc.
|
* The revenants npc.
|
||||||
*/
|
*/
|
||||||
private static final List<NPC> REVENANTS = new ArrayList<>();
|
private static final List<NPC> REVENANTS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The spawning locations.
|
* The spawning locations.
|
||||||
|
|
@ -47,7 +47,7 @@ public class RevenantPlugin implements Plugin<Object> {
|
||||||
public static void spawn() {
|
public static void spawn() {
|
||||||
int size = REVENANTS.size();
|
int size = REVENANTS.size();
|
||||||
int left = MAX - size;
|
int left = MAX - size;
|
||||||
List<Location> taken = new ArrayList<>();
|
List<Location> taken = new ArrayList<>(20);
|
||||||
for (NPC n : REVENANTS) {
|
for (NPC n : REVENANTS) {
|
||||||
taken.add(n.getProperties().getSpawnLocation());
|
taken.add(n.getProperties().getSpawnLocation());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -604,7 +604,7 @@ public class Player extends Entity {
|
||||||
boolean gravestone = graveManager.generateable() && getIronmanManager().getMode() != IronmanMode.ULTIMATE;
|
boolean gravestone = graveManager.generateable() && getIronmanManager().getMode() != IronmanMode.ULTIMATE;
|
||||||
int seconds = graveManager.getType().getDecay() * 60;
|
int seconds = graveManager.getType().getDecay() * 60;
|
||||||
int ticks = (1000 * seconds) / 600;
|
int ticks = (1000 * seconds) / 600;
|
||||||
List<GroundItem> items = new ArrayList<>();
|
List<GroundItem> items = new ArrayList<>(20);
|
||||||
for (Item item : c[1].toArray()) {
|
for (Item item : c[1].toArray()) {
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
GroundItem ground;
|
GroundItem ground;
|
||||||
|
|
@ -1234,7 +1234,7 @@ public class Player extends Entity {
|
||||||
*/
|
*/
|
||||||
public List<Plugin<Player>> getLogoutPlugins() {
|
public List<Plugin<Player>> getLogoutPlugins() {
|
||||||
if (logoutPlugins == null) {
|
if (logoutPlugins == null) {
|
||||||
logoutPlugins = new ArrayList<>();
|
logoutPlugins = new ArrayList<>(20);
|
||||||
}
|
}
|
||||||
return logoutPlugins;
|
return logoutPlugins;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ public final class LoginConfiguration {
|
||||||
/**
|
/**
|
||||||
* The login plugins.
|
* The login plugins.
|
||||||
*/
|
*/
|
||||||
private static final List<Plugin<Object>> LOGIN_PLUGINS = new ArrayList<>();
|
private static final List<Plugin<Object>> LOGIN_PLUGINS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The lobby pane component.
|
* The lobby pane component.
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public class BankPinManager {
|
||||||
/**
|
/**
|
||||||
* The digits.
|
* The digits.
|
||||||
*/
|
*/
|
||||||
private final List<Integer> digits = new ArrayList<>();
|
private final List<Integer> digits = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The bank pin.
|
* The bank pin.
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ public final class WarningMessages {
|
||||||
/**
|
/**
|
||||||
* Represents the warning messages.
|
* Represents the warning messages.
|
||||||
*/
|
*/
|
||||||
private final List<WarningMessage> messages = new ArrayList<>();
|
private final List<WarningMessage> messages = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method used to open the warning messages.
|
* Method used to open the warning messages.
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public class EmoteManager {
|
||||||
/**
|
/**
|
||||||
* The list of unlocked emotes.
|
* The list of unlocked emotes.
|
||||||
*/
|
*/
|
||||||
private final List<Emotes> emotes = new ArrayList<>();
|
private final List<Emotes> emotes = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The player.
|
* The player.
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public final class Prayer {
|
||||||
/**
|
/**
|
||||||
* Represents the list of active prayers.
|
* Represents the list of active prayers.
|
||||||
*/
|
*/
|
||||||
private final List<PrayerType> active = new ArrayList<>();
|
private final List<PrayerType> active = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the current draining task.
|
* Represents the current draining task.
|
||||||
|
|
|
||||||
|
|
@ -443,7 +443,7 @@ public final class TradeModule implements RequestModule {
|
||||||
* @return the split item array.
|
* @return the split item array.
|
||||||
*/
|
*/
|
||||||
private Item[] splitList(Item[] items, int min, int max) {
|
private Item[] splitList(Item[] items, int min, int max) {
|
||||||
List<Item> list = new ArrayList<>();
|
List<Item> list = new ArrayList<>(20);
|
||||||
for (int i = min; i < max; i++) {
|
for (int i = min; i < max; i++) {
|
||||||
if (items[i] == null) {
|
if (items[i] == null) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ public enum PKTitle {
|
||||||
*/
|
*/
|
||||||
public static PKTitle[] getTitles(Player player) {
|
public static PKTitle[] getTitles(Player player) {
|
||||||
int kills = player.getSavedData().getSpawnData().getKills();
|
int kills = player.getSavedData().getSpawnData().getKills();
|
||||||
List<PKTitle> titles = new ArrayList<>();
|
List<PKTitle> titles = new ArrayList<>(20);
|
||||||
for (PKTitle t : values()) {
|
for (PKTitle t : values()) {
|
||||||
if (kills >= t.getKills()) {
|
if (kills >= t.getKills()) {
|
||||||
titles.add(t);
|
titles.add(t);
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ public final class BuildRoomDialogue extends DialoguePlugin {
|
||||||
/**
|
/**
|
||||||
* The boundaries of the room to build.
|
* The boundaries of the room to build.
|
||||||
*/
|
*/
|
||||||
private List<GameObject> boundaries = new ArrayList<>();
|
private List<GameObject> boundaries = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The room we're building.
|
* The room we're building.
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,7 @@ public final class GatheringSkillPulse extends SkillPulse<GameObject> {
|
||||||
// Calculate a random gem for the player
|
// Calculate a random gem for the player
|
||||||
else if (isMiningGems) {
|
else if (isMiningGems) {
|
||||||
int random = RandomFunction.random(100);
|
int random = RandomFunction.random(100);
|
||||||
List<Integer> gems = new ArrayList<>();
|
List<Integer> gems = new ArrayList<>(20);
|
||||||
if (random < 2) {
|
if (random < 2) {
|
||||||
gems.add(1617);
|
gems.add(1617);
|
||||||
} else if (random < 25) {
|
} else if (random < 25) {
|
||||||
|
|
|
||||||
|
|
@ -437,7 +437,7 @@ public enum MiningNode{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static List<WeightedChanceItem> gemRockGems = new ArrayList<>();
|
public static List<WeightedChanceItem> gemRockGems = new ArrayList<>(20);
|
||||||
static {
|
static {
|
||||||
gemRockGems.add(new WeightedChanceItem(1625, 1, 60)); //uncut Opal
|
gemRockGems.add(new WeightedChanceItem(1625, 1, 60)); //uncut Opal
|
||||||
gemRockGems.add(new WeightedChanceItem(1627, 1, 30)); //uncut Jade
|
gemRockGems.add(new WeightedChanceItem(1627, 1, 30)); //uncut Jade
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ public final class DeadfallSetting extends TrapSetting {
|
||||||
* @return the locations.
|
* @return the locations.
|
||||||
*/
|
*/
|
||||||
private List<Location> getLocations(GameObject object) {
|
private List<Location> getLocations(GameObject object) {
|
||||||
List<Location> locs = new ArrayList<>();
|
List<Location> locs = new ArrayList<>(20);
|
||||||
if (object.getDirection() == Direction.NORTH) {
|
if (object.getDirection() == Direction.NORTH) {
|
||||||
locs.add(object.getLocation().transform(1, -1, 0));
|
locs.add(object.getLocation().transform(1, -1, 0));
|
||||||
locs.add(object.getLocation().transform(1, 1, 0));
|
locs.add(object.getLocation().transform(1, 1, 0));
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ public final class HunterManager {
|
||||||
/**
|
/**
|
||||||
* The list of active traps.
|
* The list of active traps.
|
||||||
*/
|
*/
|
||||||
private final List<TrapWrapper> traps = new ArrayList<>();
|
private final List<TrapWrapper> traps = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The player instance.
|
* The player instance.
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public enum BNetTypes {
|
||||||
/**
|
/**
|
||||||
* The implings.
|
* The implings.
|
||||||
*/
|
*/
|
||||||
private static final List<ImplingNode> IMPLINGS = new ArrayList<>();
|
private static final List<ImplingNode> IMPLINGS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The node.
|
* The node.
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ public enum CombinationRune {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<CombinationRune> eligibleFor(Runes rune){
|
public static List<CombinationRune> eligibleFor(Runes rune){
|
||||||
List<CombinationRune> runes = new ArrayList<>();
|
List<CombinationRune> runes = new ArrayList<>(20);
|
||||||
for(CombinationRune r : CombinationRune.values()){
|
for(CombinationRune r : CombinationRune.values()){
|
||||||
for(Runes ru : r.types){
|
for(Runes ru : r.types){
|
||||||
if(ru == rune){
|
if(ru == rune){
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ public abstract class MagicSpell implements Plugin<SpellType> {
|
||||||
if (runes == null) {
|
if (runes == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
List<Item> toRemove = new ArrayList<>();
|
List<Item> toRemove = new ArrayList<>(20);
|
||||||
for (Item item : runes) {
|
for (Item item : runes) {
|
||||||
if (!hasRune(p, item, toRemove, message)) {
|
if (!hasRune(p, item, toRemove, message)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public final class SmokeDungeon extends MapZone implements Plugin<Object> {
|
||||||
/**
|
/**
|
||||||
* The players list.
|
* The players list.
|
||||||
*/
|
*/
|
||||||
private static final List<Player> PLAYERS = new ArrayList<>();
|
private static final List<Player> PLAYERS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The tick delay until the next effect.
|
* The tick delay until the next effect.
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ public abstract class Familiar extends NPC implements Plugin<Object> {
|
||||||
/**
|
/**
|
||||||
* The invisible familiar boosts.
|
* The invisible familiar boosts.
|
||||||
*/
|
*/
|
||||||
protected List<SkillBonus> boosts = new ArrayList<>();
|
protected List<SkillBonus> boosts = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attack style.
|
* The attack style.
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ public final class FamiliarManager {
|
||||||
/**
|
/**
|
||||||
* The list of insured pets.
|
* The list of insured pets.
|
||||||
*/
|
*/
|
||||||
private List<Pets> insuredPets = new ArrayList<>();
|
private List<Pets> insuredPets = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@code FamiliarManager} {@code Object}.
|
* Constructs a new {@code FamiliarManager} {@code Object}.
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ public class PickableDoorHandler extends OptionHandler {
|
||||||
*/
|
*/
|
||||||
private static final Item LOCK_PICK = new Item(1523);
|
private static final Item LOCK_PICK = new Item(1523);
|
||||||
|
|
||||||
private static final List<PickableDoor> pickableDoors = new ArrayList<>();
|
private static final List<PickableDoor> pickableDoors = new ArrayList<>(20);
|
||||||
|
|
||||||
private static final int[] DOORS = new int[]{42028, 2550, 2551, 2554, 2555, 2556, 2557, 2558, 2559, 5501, 7246, 9565, 13314, 13317, 13320, 13323, 13326, 13344, 13345, 13346, 13347, 13348, 13349, 15759, 34005, 34805, 34806, 34812};
|
private static final int[] DOORS = new int[]{42028, 2550, 2551, 2554, 2555, 2556, 2557, 2558, 2559, 5501, 7246, 9565, 13314, 13317, 13320, 13323, 13326, 13344, 13345, 13346, 13347, 13348, 13349, 15759, 34005, 34805, 34806, 34812};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ public final class GroundItemManager {
|
||||||
/**
|
/**
|
||||||
* The list of ground items.
|
* The list of ground items.
|
||||||
*/
|
*/
|
||||||
private static final List<GroundItem> GROUND_ITEMS = new ArrayList<>();
|
private static final List<GroundItem> GROUND_ITEMS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a ground item.
|
* Creates a ground item.
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ public class SystemConfig {
|
||||||
/**
|
/**
|
||||||
* The list of beta user names.
|
* The list of beta user names.
|
||||||
*/
|
*/
|
||||||
private final List<String> betaUsers = new ArrayList<>();
|
private final List<String> betaUsers = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@Code SystemConfig} {@Code Object}
|
* Constructs a new {@Code SystemConfig} {@Code Object}
|
||||||
|
|
@ -102,11 +102,11 @@ public class SystemConfig {
|
||||||
*/
|
*/
|
||||||
public List<String> split(String data, String regex) {
|
public List<String> split(String data, String regex) {
|
||||||
if (!data.contains(regex)) {
|
if (!data.contains(regex)) {
|
||||||
List<String> split = new ArrayList<>();
|
List<String> split = new ArrayList<>(20);
|
||||||
split.add(data);
|
split.add(data);
|
||||||
return split;
|
return split;
|
||||||
}
|
}
|
||||||
List<String> split = new ArrayList<>();
|
List<String> split = new ArrayList<>(20);
|
||||||
String[] tokens = data.trim().split(regex);
|
String[] tokens = data.trim().split(regex);
|
||||||
for (String s : tokens) {
|
for (String s : tokens) {
|
||||||
split.add(s);
|
split.add(s);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public enum CommandSet {
|
||||||
/**
|
/**
|
||||||
* Represents the list of linked plugins with this command set.
|
* Represents the list of linked plugins with this command set.
|
||||||
*/
|
*/
|
||||||
private final List<CommandPlugin> plugins = new ArrayList<>();
|
private final List<CommandPlugin> plugins = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@code CommandSet} {@code Object}.
|
* Constructs a new {@code CommandSet} {@code Object}.
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public final class CommunicationInfo {
|
||||||
/**
|
/**
|
||||||
* The list of blocked players.
|
* The list of blocked players.
|
||||||
*/
|
*/
|
||||||
private final List<String> blocked = new ArrayList<>();
|
private final List<String> blocked = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The player's clan name.
|
* The player's clan name.
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ public class MessageLog {
|
||||||
*/
|
*/
|
||||||
public MessageLog(int capacity, boolean uniqueLogging) {
|
public MessageLog(int capacity, boolean uniqueLogging) {
|
||||||
this.capacity = capacity;
|
this.capacity = capacity;
|
||||||
this.messages = new ArrayList<>();
|
this.messages = new ArrayList<>(20);
|
||||||
this.uniqueLogging = uniqueLogging;
|
this.uniqueLogging = uniqueLogging;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ public final class SQLTable {
|
||||||
* @return The columns.
|
* @return The columns.
|
||||||
*/
|
*/
|
||||||
public List<SQLColumn> getChanged() {
|
public List<SQLColumn> getChanged() {
|
||||||
List<SQLColumn> updated = new ArrayList<>();
|
List<SQLColumn> updated = new ArrayList<>(20);
|
||||||
for (int i = 0; i < columns.length; i++) {
|
for (int i = 0; i < columns.length; i++) {
|
||||||
SQLColumn column = columns[i];
|
SQLColumn column = columns[i];
|
||||||
if (column.isChanged()) {
|
if (column.isChanged()) {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public class PlayerLogSQLHandler extends SQLEntryHandler<PlayerMonitor> {
|
||||||
if (connection.prepareStatement("SELECT * FROM " + table + " WHERE username='" + value + "' LIMIT 1").executeQuery().next()) {
|
if (connection.prepareStatement("SELECT * FROM " + table + " WHERE username='" + value + "' LIMIT 1").executeQuery().next()) {
|
||||||
String b = "SET ";
|
String b = "SET ";
|
||||||
int size = 0;
|
int size = 0;
|
||||||
List<Integer> columns = new ArrayList<>();
|
List<Integer> columns = new ArrayList<>(20);
|
||||||
for (int i = 0; i < MESSAGE_COLUMNS.length; i++) {
|
for (int i = 0; i < MESSAGE_COLUMNS.length; i++) {
|
||||||
if (!entry.getLogs()[i].getMessages().isEmpty()) {
|
if (!entry.getLogs()[i].getMessages().isEmpty()) {
|
||||||
b += MESSAGE_COLUMNS[i] + " = CONCAT(" + MESSAGE_COLUMNS[i] + ", ?)" + (i == MESSAGE_COLUMNS.length - 1 ? "" : ",");
|
b += MESSAGE_COLUMNS[i] + " = CONCAT(" + MESSAGE_COLUMNS[i] + ", ?)" + (i == MESSAGE_COLUMNS.length - 1 ? "" : ",");
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,12 @@ public class Region {
|
||||||
/**
|
/**
|
||||||
* The region zones lying in this region.
|
* The region zones lying in this region.
|
||||||
*/
|
*/
|
||||||
private final List<RegionZone> regionZones = new ArrayList<>();
|
private final List<RegionZone> regionZones = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The music zones lying in this region.
|
* The music zones lying in this region.
|
||||||
*/
|
*/
|
||||||
private final List<MusicZone> musicZones = new ArrayList<>();
|
private final List<MusicZone> musicZones = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the region is active.
|
* If the region is active.
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ public class RegionChunk {
|
||||||
/**
|
/**
|
||||||
* The update flags.
|
* The update flags.
|
||||||
*/
|
*/
|
||||||
private List<UpdateFlag<?>> flags = new ArrayList<>();
|
private List<UpdateFlag<?>> flags = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@code RegionChunk} {@code Object}.
|
* Constructs a new {@code RegionChunk} {@code Object}.
|
||||||
|
|
|
||||||
|
|
@ -412,7 +412,7 @@ public final class RegionManager {
|
||||||
* @return the list.
|
* @return the list.
|
||||||
*/
|
*/
|
||||||
public static List<Entity> getLocalEntitys(Location location, int distance){
|
public static List<Entity> getLocalEntitys(Location location, int distance){
|
||||||
List<Entity> entitys = new ArrayList<>();
|
List<Entity> entitys = new ArrayList<>(20);
|
||||||
entitys.addAll(getLocalNpcs(location, distance));
|
entitys.addAll(getLocalNpcs(location, distance));
|
||||||
entitys.addAll(getLocalPlayers(location, distance));
|
entitys.addAll(getLocalPlayers(location, distance));
|
||||||
return entitys;
|
return entitys;
|
||||||
|
|
@ -626,7 +626,7 @@ public final class RegionManager {
|
||||||
*/
|
*/
|
||||||
public static List<Player> getRegionPlayers(int regionId) {
|
public static List<Player> getRegionPlayers(int regionId) {
|
||||||
Region r = forId(regionId);
|
Region r = forId(regionId);
|
||||||
List<Player> players = new ArrayList<>();
|
List<Player> players = new ArrayList<>(20);
|
||||||
for (RegionPlane plane : r.getPlanes()) {
|
for (RegionPlane plane : r.getPlanes()) {
|
||||||
players.addAll(plane.getPlayers());
|
players.addAll(plane.getPlayers());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ public final class DynamicRegion extends Region {
|
||||||
/**
|
/**
|
||||||
* The reserved areas.
|
* The reserved areas.
|
||||||
*/
|
*/
|
||||||
private static final List<ZoneBorders> RESERVED_AREAS = new ArrayList<>();
|
private static final List<ZoneBorders> RESERVED_AREAS = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The region id of the copied region.
|
* The region id of the copied region.
|
||||||
|
|
@ -113,7 +113,7 @@ public final class DynamicRegion extends Region {
|
||||||
ZoneBorders border = findZoneBorders((copy.getNorthEastX() - copy.getSouthWestX()) >> 3, (copy.getNorthEastY() - copy.getSouthWestY()) >> 3);
|
ZoneBorders border = findZoneBorders((copy.getNorthEastX() - copy.getSouthWestX()) >> 3, (copy.getNorthEastY() - copy.getSouthWestY()) >> 3);
|
||||||
RESERVED_AREAS.add(border);
|
RESERVED_AREAS.add(border);
|
||||||
Location l = Location.create(border.getSouthWestX(), border.getSouthWestY(), 0);
|
Location l = Location.create(border.getSouthWestX(), border.getSouthWestY(), 0);
|
||||||
List<DynamicRegion> regions = new ArrayList<>();
|
List<DynamicRegion> regions = new ArrayList<>(20);
|
||||||
for (int x = copy.getSouthWestX() >> 6; x < copy.getNorthEastX() >> 6; x++) {
|
for (int x = copy.getSouthWestX() >> 6; x < copy.getNorthEastX() >> 6; x++) {
|
||||||
for (int y = copy.getSouthWestY() >> 6; y < copy.getNorthEastY() >> 6; y++) {
|
for (int y = copy.getSouthWestY() >> 6; y < copy.getNorthEastY() >> 6; y++) {
|
||||||
int regionId = x << 8 | y;
|
int regionId = x << 8 | y;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ public final class DumbPathfinder extends Pathfinder {
|
||||||
z = start.getZ();
|
z = start.getZ();
|
||||||
x = start.getX();
|
x = start.getX();
|
||||||
y = start.getY();
|
y = start.getY();
|
||||||
List<Point> points = new ArrayList<>();
|
List<Point> points = new ArrayList<>(20);
|
||||||
path.setSuccesful(true);
|
path.setSuccesful(true);
|
||||||
while (x != end.getX() || y != end.getY()) {
|
while (x != end.getX() || y != end.getY()) {
|
||||||
Direction[] directions = getDirection(x, y, end);
|
Direction[] directions = getDirection(x, y, end);
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public final class ProjectilePathfinder extends Pathfinder {
|
||||||
z = start.getZ();
|
z = start.getZ();
|
||||||
x = start.getX();
|
x = start.getX();
|
||||||
y = start.getY();
|
y = start.getY();
|
||||||
List<Point> points = new ArrayList<>();
|
List<Point> points = new ArrayList<>(20);
|
||||||
path.setSuccesful(true);
|
path.setSuccesful(true);
|
||||||
while (x != end.getX() || y != end.getY()) {
|
while (x != end.getX() || y != end.getY()) {
|
||||||
Direction[] directions = getDirection(x, y, end);
|
Direction[] directions = getDirection(x, y, end);
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ public final class ZoneBorders {
|
||||||
* @return The region ids.
|
* @return The region ids.
|
||||||
*/
|
*/
|
||||||
public List<Integer> getRegionIds() {
|
public List<Integer> getRegionIds() {
|
||||||
List<Integer> regionIds = new ArrayList<>();
|
List<Integer> regionIds = new ArrayList<>(20);
|
||||||
int neX = (northEastX >> 6) + 1;
|
int neX = (northEastX >> 6) + 1;
|
||||||
int neY = (northEastY >> 6) + 1;
|
int neY = (northEastY >> 6) + 1;
|
||||||
for (int x = southWestX >> 6; x < neX; x++) {
|
for (int x = southWestX >> 6; x < neX; x++) {
|
||||||
|
|
@ -239,7 +239,7 @@ public final class ZoneBorders {
|
||||||
*/
|
*/
|
||||||
public void addException(ZoneBorders exception) {
|
public void addException(ZoneBorders exception) {
|
||||||
if (exceptions == null) {
|
if (exceptions == null) {
|
||||||
this.exceptions = new ArrayList<>();
|
this.exceptions = new ArrayList<>(20);
|
||||||
}
|
}
|
||||||
exceptions.add(exception);
|
exceptions.add(exception);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,12 @@ public final class ZoneMonitor {
|
||||||
/**
|
/**
|
||||||
* The currently entered zones.
|
* The currently entered zones.
|
||||||
*/
|
*/
|
||||||
private final List<RegionZone> zones = new ArrayList<>();
|
private final List<RegionZone> zones = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The currently entered music zones.
|
* The currently entered music zones.
|
||||||
*/
|
*/
|
||||||
private final List<MusicZone> musicZones = new ArrayList<>();
|
private final List<MusicZone> musicZones = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@code ZoneMonitor} {@code Object}.
|
* Constructs a new {@code ZoneMonitor} {@code Object}.
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ public final class WildernessZone extends MapZone {
|
||||||
boolean gravestone = player.getGraveManager().generateable() && player.getIronmanManager().getMode() != IronmanMode.ULTIMATE && !(killer instanceof Player);
|
boolean gravestone = player.getGraveManager().generateable() && player.getIronmanManager().getMode() != IronmanMode.ULTIMATE && !(killer instanceof Player);
|
||||||
int seconds = player.getGraveManager().getType().getDecay() * 60;
|
int seconds = player.getGraveManager().getType().getDecay() * 60;
|
||||||
int ticks = (1000 * seconds) / 600;
|
int ticks = (1000 * seconds) / 600;
|
||||||
List<GroundItem> items = new ArrayList<>();
|
List<GroundItem> items = new ArrayList<>(20);
|
||||||
for (Item item : c[1].toArray()) {
|
for (Item item : c[1].toArray()) {
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
GroundItem ground;
|
GroundItem ground;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public class PlayerTab extends ConsoleTab {
|
||||||
/**
|
/**
|
||||||
* The list of player names to search through.
|
* The list of player names to search through.
|
||||||
*/
|
*/
|
||||||
private final List<String> playerNames = new ArrayList<>();
|
private final List<String> playerNames = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The player name text field.
|
* The player name text field.
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public final class UtilityTab extends ConsoleTab {
|
||||||
/**
|
/**
|
||||||
* The list of players.
|
* The list of players.
|
||||||
*/
|
*/
|
||||||
private final List<Player> players = new ArrayList<>();
|
private final List<Player> players = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of ips & their users.
|
* The mapping of ips & their users.
|
||||||
|
|
@ -280,7 +280,7 @@ public final class UtilityTab extends ConsoleTab {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<String> formats = new ArrayList<>();
|
List<String> formats = new ArrayList<>(20);
|
||||||
for (int i = mostWealthy.length - 1; i >= 0; i--) {
|
for (int i = mostWealthy.length - 1; i >= 0; i--) {
|
||||||
Object[] info = mostWealthy[i];
|
Object[] info = mostWealthy[i];
|
||||||
if (info != null && info[0] != null) {
|
if (info != null && info[0] != null) {
|
||||||
|
|
@ -331,7 +331,7 @@ public final class UtilityTab extends ConsoleTab {
|
||||||
Map<String, Integer> map = new HashMap<>();
|
Map<String, Integer> map = new HashMap<>();
|
||||||
for (Player p : players) {
|
for (Player p : players) {
|
||||||
p.getAnimator();
|
p.getAnimator();
|
||||||
List<core.game.container.Container> containers = new ArrayList<>();
|
List<core.game.container.Container> containers = new ArrayList<>(20);
|
||||||
containers.add(p.getInventory());
|
containers.add(p.getInventory());
|
||||||
containers.add(p.getBank());
|
containers.add(p.getBank());
|
||||||
containers.add(p.getEquipment());
|
containers.add(p.getEquipment());
|
||||||
|
|
@ -346,7 +346,7 @@ public final class UtilityTab extends ConsoleTab {
|
||||||
map.put(p.getName(), amount);
|
map.put(p.getName(), amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<String> formats = new ArrayList<>();
|
List<String> formats = new ArrayList<>(20);
|
||||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||||
formats.add("Player name=" + entry.getKey() + ", contained a total of " + entry.getValue() + " " + item.getName() + ".");
|
formats.add("Player name=" + entry.getKey() + ", contained a total of " + entry.getValue() + " " + item.getName() + ".");
|
||||||
}
|
}
|
||||||
|
|
@ -443,7 +443,7 @@ public final class UtilityTab extends ConsoleTab {
|
||||||
* Checks the staff.
|
* Checks the staff.
|
||||||
*/
|
*/
|
||||||
public void staffScanner() {
|
public void staffScanner() {
|
||||||
List<String> staff = new ArrayList<>();
|
List<String> staff = new ArrayList<>(20);
|
||||||
for (Player player : players) {
|
for (Player player : players) {
|
||||||
if (player.getDetails().getRights() != Rights.REGULAR_PLAYER) {
|
if (player.getDetails().getRights() != Rights.REGULAR_PLAYER) {
|
||||||
staff.add(player.getName() + " - " + StringUtils.formatDisplayName(player.getDetails().getRights().toString()));
|
staff.add(player.getName() + " - " + StringUtils.formatDisplayName(player.getDetails().getRights().toString()));
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public class IoSession {
|
||||||
/**
|
/**
|
||||||
* The currently queued writing data.
|
* The currently queued writing data.
|
||||||
*/
|
*/
|
||||||
private List<ByteBuffer> writingQueue = new ArrayList<>();
|
private List<ByteBuffer> writingQueue = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The currently queued reading data.
|
* The currently queued reading data.
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue