Merge remote-tracking branch 'upstream/master' into 2310-merge

This commit is contained in:
Owain van Brakel
2019-10-28 09:44:51 +01:00
108 changed files with 5789 additions and 2073 deletions

View File

@@ -1,14 +0,0 @@
description = 'RuneLite API'
dependencies {
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok
compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: findbugs
implementation group: 'com.google.guava', name: 'guava', version: guava
implementation group: 'org.apache.commons', name: 'commons-text', version: apacheCommonsText
implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j
testImplementation group: 'junit', name: 'junit', version: junit
}

View File

@@ -0,0 +1,39 @@
/*
* Copyright (c) 2019 Owain van Brakel <https://github.com/Owain94>
* 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.
*/
description = "RuneLite API"
dependencies {
annotationProcessor(Libraries.lombok)
compileOnly(Libraries.lombok)
implementation(Libraries.findbugs)
implementation(Libraries.guava)
implementation(Libraries.apacheCommonsText)
implementation(Libraries.slf4jApi)
testImplementation(Libraries.junit)
}

View File

@@ -64,8 +64,11 @@ public interface Actor extends Entity, Locatable
* </ul>
*
* @return the actor, null if no interaction is occurring
*
* (getRSInteracting returns the npc/player index, useful for menus)
*/
Actor getInteracting();
int getRSInteracting();
/**
* Gets the health ratio of the actor.

View File

@@ -98,6 +98,15 @@ public final class AnimationID
public static final int FISHING_DRAGON_HARPOON = 7401;
public static final int FISHING_INFERNAL_HARPOON = 7402;
public static final int FISHING_CRYSTAL_HARPOON = 8336;
public static final int CRYSTALLINE_RAT_DEATH = 8334;
public static final int CRYSTALLINE_BAT_DEATH = 4917;
public static final int CRYSTALLINE_WOLF_DEATH = 8335;
public static final int CRYSTALLINE_SPIDER_DEATH = 8338;
public static final int CRYSTALLINE_UNICORN_DEATH = 6377;
public static final int CRYSTALLINE_DRAGON_DEATH = 92;
public static final int CRYSTALLINE_BEAR_DEATH = 4929;
public static final int CRYSTALLINE_DARK_BEAST_DEATH = 2733;
public static final int CORRUPTED_SCORPION_DEATH = 6256;
public static final int FISHING_OILY_ROD = 622;
public static final int FISHING_KARAMBWAN = 1193;
public static final int FISHING_CRUSHING_INFERNAL_EELS = 7553;
@@ -273,6 +282,7 @@ public final class AnimationID
// INFERNO animations
public static final int JAL_NIB = 7574;
public static final int JAL_MEJRAH = 7578;
public static final int JAL_MEJRAH_STAND = 7577;
public static final int JAL_AK_RANGE_ATTACK = 7581;
public static final int JAL_AK_MELEE_ATTACK = 7582;
public static final int JAL_AK_MAGIC_ATTACK = 7583;

View File

@@ -341,9 +341,12 @@ public interface Client extends GameShell
* Gets the logged in player instance.
*
* @return the logged in player
*
* (getLocalPlayerIndex returns the local index, useful for menus/interacting)
*/
@Nullable
Player getLocalPlayer();
int getLocalPlayerIndex();
/**
* Gets the item composition corresponding to an items ID.

View File

@@ -12,6 +12,11 @@ public interface ItemDefinition
*/
String getName();
/**
* Sets the items name.
*/
void setName(String name);
/**
* Gets the items ID.
*
@@ -86,6 +91,7 @@ public interface ItemDefinition
* Returns whether or not the item can be sold on the grand exchange.
*/
boolean isTradeable();
void setTradeable(boolean yes);
/**
* Gets an array of possible right-click menu actions the item
@@ -114,4 +120,11 @@ public interface ItemDefinition
* default value.
*/
void resetShiftClickActionIndex();
/**
* With this you can make certain (ground) items look like different ones.
*
* @param id The itemID of the item with desired model
*/
void setModelOverride(int id);
}

View File

@@ -24,6 +24,8 @@
*/
package net.runelite.api;
import net.runelite.api.coords.WorldPoint;
/**
* Represents the entire 3D scene
*/
@@ -36,6 +38,16 @@ public interface Scene
*/
Tile[][][] getTiles();
/**
* Adds an item to the scene
*/
void addItem(int id, int quantity, WorldPoint point);
/**
* Removes an item from the scene
*/
void removeItem(int id, int quantity, WorldPoint point);
int getDrawDistance();
void setDrawDistance(int drawDistance);
}

View File

@@ -24,6 +24,7 @@
*/
package net.runelite.api.events;
import java.util.Iterator;
import lombok.AccessLevel;
import lombok.Setter;
import net.runelite.api.MenuEntry;
@@ -33,7 +34,7 @@ import lombok.Data;
* An event where a menu has been opened.
*/
@Data
public class MenuOpened implements Event
public class MenuOpened implements Event, Iterable<MenuEntry>
{
/**
* This should be set to true if anything about the menu
@@ -70,4 +71,25 @@ public class MenuOpened implements Event
{
this.modified = true;
}
@Override
public Iterator<MenuEntry> iterator()
{
return new Iterator<MenuEntry>()
{
int index = 0;
@Override
public boolean hasNext()
{
return index < menuEntries.length;
}
@Override
public MenuEntry next()
{
return menuEntries[index++];
}
};
}
}