Merge branch 'master' into runelite-master-1

This commit is contained in:
Tyler Bochard
2019-07-05 01:03:38 -04:00
committed by GitHub
995 changed files with 37347 additions and 32076 deletions

View File

@@ -24,6 +24,11 @@
*/
package net.runelite.api;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* An enumeration of game states the client is in.
*/
@@ -66,6 +71,10 @@ public enum GameState
*/
HOPPING(45);
private static final Map<Integer, GameState> stateValueMap =
Arrays.stream(GameState.values())
.collect(Collectors.toMap(gs -> gs.state, Function.identity()));
/**
* The raw state value.
*/
@@ -85,13 +94,6 @@ public enum GameState
*/
public static GameState of(int state)
{
for (GameState gs : GameState.values())
{
if (gs.state == state)
{
return gs;
}
}
return UNKNOWN;
return stateValueMap.getOrDefault(state, UNKNOWN);
}
}

View File

@@ -24,6 +24,7 @@
*/
package net.runelite.api;
import java.awt.geom.Path2D;
import static net.runelite.api.Constants.TILE_FLAG_BRIDGE;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
@@ -549,7 +550,7 @@ public class Perspective
)
{
int radius = 5;
Area geometry = new Area();
Path2D.Double geometry = new Path2D.Double();
final int tileHeight = getTileHeight(client, point, client.getPlane());
@@ -607,10 +608,10 @@ public class Perspective
continue;
}
geometry.add(new Area(clickableRect));
geometry.append(clickableRect, false);
}
return geometry;
return new Area(geometry);
}
private static Area getAABB(

View File

@@ -29,4 +29,10 @@ package net.runelite.api.events;
*/
public class BeforeRender
{
public static final BeforeRender INSTANCE = new BeforeRender();
private BeforeRender()
{
// noop
}
}

View File

@@ -29,4 +29,10 @@ package net.runelite.api.events;
*/
public class CannonballFired
{
public static final CannonballFired INSTANCE = new CannonballFired();
private CannonballFired()
{
// noop
}
}

View File

@@ -29,4 +29,10 @@ package net.runelite.api.events;
*/
public class CanvasSizeChanged
{
public static final CanvasSizeChanged INSTANCE = new CanvasSizeChanged();
private CanvasSizeChanged()
{
// noop
}
}

View File

@@ -29,4 +29,10 @@ package net.runelite.api.events;
*/
public class ClientTick
{
public static final ClientTick INSTANCE = new ClientTick();
private ClientTick()
{
// noop
}
}

View File

@@ -24,8 +24,6 @@
*/
package net.runelite.api.events;
import lombok.Data;
// The NPC update event seem to run every server tick,
// but having the game tick event after all packets
// have been processed is typically more useful.
@@ -43,7 +41,12 @@ import lombok.Data;
* Note that occurrences that take place purely on the client, such as right
* click menus, are independent of the game tick.
*/
@Data
public class GameTick
{
public static final GameTick INSTANCE = new GameTick();
private GameTick()
{
// noop
}
}

View File

@@ -29,4 +29,10 @@ package net.runelite.api.events;
*/
public class LocalPlayerDeath
{
public static final LocalPlayerDeath INSTANCE = new LocalPlayerDeath();
private LocalPlayerDeath()
{
// noop
}
}

View File

@@ -32,4 +32,10 @@ package net.runelite.api.events;
*/
public class UsernameChanged
{
public static final UsernameChanged INSTANCE = new UsernameChanged();
private UsernameChanged()
{
// noop
}
}

View File

@@ -24,13 +24,16 @@
*/
package net.runelite.api.events;
import lombok.Value;
/**
* An event where the position of a {@link net.runelite.api.widgets.Widget}
* relative to its parent has changed.
*/
@Value
public class WidgetPositioned
{
public static final WidgetPositioned INSTANCE = new WidgetPositioned();
private WidgetPositioned()
{
// noop
}
}