Merge pull request #1457 from xKylee/master

upstream: merge
This commit is contained in:
Ganom
2019-08-25 22:59:19 -04:00
committed by GitHub
11 changed files with 20 additions and 84 deletions

View File

@@ -1,67 +0,0 @@
/*
* Copyright (c) 2017, Devin French <https://github.com/devinfrench>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.api;
import java.util.function.Predicate;
/**
* A query to search the game for objects that match.
*
* @param <EntityType> the returned object type
* @param <QueryType> the query type
*/
public abstract class Query<EntityType, QueryType>
{
protected Predicate<EntityType> predicate = x -> true;
protected Query()
{
}
/**
* Executes the query and filters through possible objects, returning only
* those who evaluate true using {@link #predicate}.
*
* @param client the game client
* @return the matching objects
*/
public abstract EntityType[] result(Client client);
/**
* Constructs and returns a predicate that will evaluate {@link #predicate}
* and the passed value.
*
* @param other the passed predicate
* @return the combined predicate
*/
protected Predicate<EntityType> and(Predicate<EntityType> other)
{
if (predicate == null)
{
return other;
}
return predicate.and(other);
}
}

View File

@@ -725,7 +725,7 @@ public final class SpriteID
public static final int EMOTE_GOBLIN_SALUTE = 727;
public static final int EMOTE_SCARED = 728;
public static final int EMOTE_SLAP_HEAD = 729;
public static final int EMOTE_STOMP = 730;
public static final int EMOTE_STAMP = 730;
public static final int EMOTE_FLAP = 731;
public static final int EMOTE_IDEA = 732;
public static final int EMOTE_ZOMBIE_WALK = 733;
@@ -745,7 +745,7 @@ public final class SpriteID
public static final int EMOTE_GOBLIN_SALUTE_LOCKED = 747;
public static final int EMOTE_SCARED_LOCKED = 748;
public static final int EMOTE_SLAP_HEAD_LOCKED = 749;
public static final int EMOTE_STOMP_LOCKED = 750;
public static final int EMOTE_STAMP_LOCKED = 750;
public static final int EMOTE_FLAP_LOCKED = 751;
public static final int EMOTE_IDEA_LOCKED = 752;
public static final int EMOTE_ZOMBIE_WALK_LOCKED = 753;

View File

@@ -47,7 +47,7 @@ public class CommandManager
{
private static final String RUNELITE_COMMAND = "runeliteCommand";
private static final String CHATBOX_INPUT = "chatboxInput";
private static final String PRIVMATE_MESSAGE = "privateMessage";
private static final String PRIVATE_MESSAGE = "privateMessage";
private final Client client;
private final EventBus eventBus;
@@ -95,7 +95,7 @@ public class CommandManager
case CHATBOX_INPUT:
handleInput(event);
break;
case PRIVMATE_MESSAGE:
case PRIVATE_MESSAGE:
handlePrivateMessage(event);
break;
}

View File

@@ -35,7 +35,7 @@ public @interface ConfigGroup
{
/**
* The key name of the config group used for storing configuration within the config group.
* This should typically be a lowercased version of your plugin name, with all spaces removed.
* This should typically be a lowercase version of your plugin name, with all spaces removed.
* <p>
* For example, the {@code Grand Exchange} plugin uses the key name {@code grandexchange}.
*/

View File

@@ -47,7 +47,7 @@ public class Keybind
.put(InputEvent.META_DOWN_MASK, KeyEvent.VK_META)
.build();
// Bitmask of all supported modifers
// Bitmask of all supported modifiers
private static final int KEYBOARD_MODIFIER_MASK = MODIFIER_TO_KEY_CODE.keySet().stream()
.reduce((a, b) -> a | b).get();
@@ -65,7 +65,7 @@ public class Keybind
modifiers &= KEYBOARD_MODIFIER_MASK;
// If the keybind is just modifiers we don't want the keyCode to contain the modifier too,
// becasue this breaks if you do the keycode backwards
// because this breaks if you do the keycode backwards
Integer mf = getModifierForKeyCode(keyCode);
if (mf != null)
{

View File

@@ -225,7 +225,10 @@ public enum ItemMapping
ITEM_BLADE_OF_SAELDOR(BLADE_OF_SAELDOR_INACTIVE, BLADE_OF_SAELDOR),
ITEM_CRYSTAL_BOW(CRYSTAL_WEAPON_SEED, CRYSTAL_BOW, CRYSTAL_BOW_24123, CRYSTAL_BOW_INACTIVE),
ITEM_CRYSTAL_HALBERD(CRYSTAL_WEAPON_SEED, CRYSTAL_HALBERD, CRYSTAL_HALBERD_24125, CRYSTAL_HALBERD_INACTIVE),
ITEM_CRYSTAL_SHIELD(CRYSTAL_WEAPON_SEED, CRYSTAL_SHIELD, CRYSTAL_SHIELD_24127, CRYSTAL_SHIELD_INACTIVE);
ITEM_CRYSTAL_SHIELD(CRYSTAL_WEAPON_SEED, CRYSTAL_SHIELD, CRYSTAL_SHIELD_24127, CRYSTAL_SHIELD_INACTIVE),
// Bird nests
ITEM_BIRD_NEST(BIRD_NEST, BIRD_NEST_5071, BIRD_NEST_5072, BIRD_NEST_5073, BIRD_NEST_5074, BIRD_NEST_5075, BIRD_NEST_7413, BIRD_NEST_13653, BIRD_NEST_22798, BIRD_NEST_22800);
private static final Multimap<Integer, Integer> MAPPINGS = HashMultimap.create();
private final int tradeableItem;

View File

@@ -168,14 +168,14 @@ public class LootManager
final LocalPoint location = tile.getLocalLocation();
final int packed = location.getSceneX() << 8 | location.getSceneY();
itemSpawns.put(packed, new ItemStack(item.getId(), item.getQuantity(), location));
log.debug("Item spawn {} ({}) location {},{}", item.getId(), item.getQuantity(), location);
log.debug("Item spawn {} ({}) location {}", item.getId(), item.getQuantity(), location);
}
private void onItemDespawned(ItemDespawned itemDespawned)
{
final TileItem item = itemDespawned.getItem();
final LocalPoint location = itemDespawned.getTile().getLocalLocation();
log.debug("Item despawn {} ({}) location {},{}", item.getId(), item.getQuantity(), location);
log.debug("Item despawn {} ({}) location {}", item.getId(), item.getQuantity(), location);
}
private void onItemQuantityChanged(ItemQuantityChanged itemQuantityChanged)

View File

@@ -93,8 +93,8 @@ class Obstacles
STEPPING_STONE_11643, HURDLE, HURDLE_11639, HURDLE_11640, PIPE_11657, SKULL_SLOPE, ZIP_LINE,
ZIP_LINE_11645, ZIP_LINE_11646,
// Prifddinas
LADDER_36221, TIGHTROPE_36225, CHIMNEY_36227, ROOF_EDGE, DARK_HOLE_36229, LADDER_36231, ROPE_BRIDGE_36233,
TIGHTROPE_36234, ROPE_BRIDGE_36235, TIGHTROPE_36236, TIGHTROPE_36237, DARK_HOLE_36238,
LADDER_36221, TIGHTROPE_36225, CHIMNEY_36227, ROOF_EDGE, DARK_HOLE_36229, LADDER_36231, LADDER_36232,
ROPE_BRIDGE_36233, TIGHTROPE_36234, ROPE_BRIDGE_36235, TIGHTROPE_36236, TIGHTROPE_36237, DARK_HOLE_36238,
// Prifddinas portals
NULL_36241, NULL_36242, NULL_36243, NULL_36244, NULL_36245, NULL_36246
);

View File

@@ -156,7 +156,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
new EmoteClue("Spin in the Varrock Castle courtyard. Equip a black axe, a coif and a ruby ring.", "Varrock Castle", OUTSIDE_VARROCK_PALACE_COURTYARD, new WorldPoint(3213, 3463, 0), SPIN, item(BLACK_AXE), item(COIF), item(RUBY_RING)),
new EmoteClue("Spin in West Ardougne Church. Equip a dragon spear and red dragonhide chaps.", "Ardougne", CHAPEL_IN_WEST_ARDOUGNE, new WorldPoint(2530, 3290, 0), SPIN, item(DRAGON_SPEAR), item(RED_DHIDE_CHAPS)),
new EmoteClue("Spin on the bridge by the Barbarian Village. Salute before you talk to me. Equip purple gloves, a steel kiteshield and a mithril full helmet.", "Barbarian Village", EAST_OF_THE_BARBARIAN_VILLAGE_BRIDGE, new WorldPoint(3105, 3420, 0), SPIN, SALUTE, item(PURPLE_GLOVES), item(STEEL_KITESHIELD), item(MITHRIL_FULL_HELM)),
new EmoteClue("Stamp in the Enchanted valley west of the waterfall. Beware of double agents! Equip a dragon axe.", "Enchanted Valley", NORTHWESTERN_CORNER_OF_THE_ENCHANTED_VALLEY, new WorldPoint(3030, 4522, 0), STOMP, item(DRAGON_AXE)),
new EmoteClue("Stamp in the Enchanted valley west of the waterfall. Beware of double agents! Equip a dragon axe.", "Enchanted Valley", NORTHWESTERN_CORNER_OF_THE_ENCHANTED_VALLEY, new WorldPoint(3030, 4522, 0), STAMP, item(DRAGON_AXE)),
new EmoteClue("Think in middle of the wheat field by the Lumbridge mill. Equip a blue gnome robetop, a turquoise gnome robe bottom and an oak shortbow.", "Lumbridge mill", WHEAT_FIELD_NEAR_THE_LUMBRIDGE_WINDMILL, new WorldPoint(3159, 3298, 0), THINK, item(BLUE_ROBE_TOP), item(TURQUOISE_ROBE_BOTTOMS), item(OAK_SHORTBOW)),
new EmoteClue("Think in the centre of the Observatory. Spin before you talk to me. Equip a mithril chain body, green dragonhide chaps and a ruby amulet.", "Observatory", OBSERVATORY, new WorldPoint(2439, 3161, 0), THINK, SPIN, item(MITHRIL_CHAINBODY), item(GREEN_DHIDE_CHAPS), item(RUBY_AMULET)),
new EmoteClue("Wave along the south fence of the Lumber Yard. Equip a hard leather body, leather chaps and a bronze axe.", "Lumber Yard", NEAR_THE_SAWMILL_OPERATORS_BOOTH, new WorldPoint(3307, 3491, 0), WAVE, item(HARDLEATHER_BODY), item(LEATHER_CHAPS), item(BRONZE_AXE)),

View File

@@ -55,7 +55,7 @@ public enum Emote
BLOW_KISS("Blow Kiss", EMOTE_BLOW_KISS),
GOBLIN_SALUTE("Goblin Salute", EMOTE_GOBLIN_SALUTE),
SLAP_HEAD("Slap Head", EMOTE_SLAP_HEAD),
STOMP("Stomp", EMOTE_STOMP),
STAMP("Stamp", EMOTE_STAMP),
FLAP("Flap", EMOTE_FLAP),
PUSH_UP("Push up", EMOTE_PUSH_UP);

View File

@@ -74,10 +74,10 @@ public class ColorUtil
}
/**
* Converts a given color to it's hexidecimal equivalent.
* Converts a given color to it's hexadecimal equivalent.
*
* @param color Color to get hexidecimal string from.
* @return Hexidecimal string representing the given color, in the form "#abcdef".
* @param color Color to get hexadecimal string from.
* @return Hexadecimal string representing the given color, in the form "#abcdef".
*/
public static String toHexColor(final Color color)
{