Merge branch 'master' of https://github.com/runelite/runelite
Conflicts: cache-client/pom.xml cache-updater/pom.xml cache/pom.xml pom.xml runelite-api/pom.xml runelite-api/src/main/java/net/runelite/api/GraphicID.java runelite-client/pom.xml runelite-jshell/pom.xml runelite-script-assembler-plugin/pom.xml
This commit is contained in:
@@ -61,6 +61,8 @@ public final class GraphicID
|
|||||||
public static final int XERIC_TELEPORT = 1612;
|
public static final int XERIC_TELEPORT = 1612;
|
||||||
public static final int GRAPHICS_OBJECT_ROCKFALL = 1727;
|
public static final int GRAPHICS_OBJECT_ROCKFALL = 1727;
|
||||||
public static final int ZALCANO_PROJECTILE_FIREBALL = 1728;
|
public static final int ZALCANO_PROJECTILE_FIREBALL = 1728;
|
||||||
|
public static final int CANNONBALL_OR = 2018;
|
||||||
|
public static final int GRANITE_CANNONBALL_OR = 2019;
|
||||||
|
|
||||||
public static final int LIZARDMAN_SHAMAN_AOE = 1293;
|
public static final int LIZARDMAN_SHAMAN_AOE = 1293;
|
||||||
public static final int CRAZY_ARCHAEOLOGIST_AOE = 1260;
|
public static final int CRAZY_ARCHAEOLOGIST_AOE = 1260;
|
||||||
|
|||||||
@@ -60,11 +60,9 @@ public interface GraphicsObject extends Renderable
|
|||||||
int getLevel();
|
int getLevel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the height of the graphic.
|
* Gets the z coordinate
|
||||||
*
|
|
||||||
* @return the height
|
|
||||||
*/
|
*/
|
||||||
int getHeight();
|
int getZ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if this spotanim is done animating
|
* Checks if this spotanim is done animating
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import net.runelite.api.geometry.SimplePolygon;
|
|||||||
import net.runelite.api.model.Jarvis;
|
import net.runelite.api.model.Jarvis;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
|
import org.jetbrains.annotations.ApiStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A utility class containing methods to help with conversion between
|
* A utility class containing methods to help with conversion between
|
||||||
@@ -678,21 +679,19 @@ public class Perspective
|
|||||||
* @param client the game client
|
* @param client the game client
|
||||||
* @param model the model to calculate a clickbox for
|
* @param model the model to calculate a clickbox for
|
||||||
* @param orientation the orientation of the model (0-2048, where 0 is north)
|
* @param orientation the orientation of the model (0-2048, where 0 is north)
|
||||||
* @param point the coordinate of the tile
|
* @param x x coord in local space
|
||||||
|
* @param z y coord in local space
|
||||||
* @return the clickable area of the model
|
* @return the clickable area of the model
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public static Shape getClickbox(@Nonnull Client client, Model model, int orientation, LocalPoint point)
|
@ApiStatus.Internal
|
||||||
|
public static Shape getClickbox(@Nonnull Client client, Model model, int orientation, int x, int y, int z)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
int x = point.getX();
|
|
||||||
int y = point.getY();
|
|
||||||
int z = getTileHeight(client, point, client.getPlane());
|
|
||||||
|
|
||||||
SimplePolygon bounds = calculateAABB(client, model, orientation, x, y, z);
|
SimplePolygon bounds = calculateAABB(client, model, orientation, x, y, z);
|
||||||
|
|
||||||
if (bounds == null)
|
if (bounds == null)
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ public interface TileObject extends Locatable
|
|||||||
*/
|
*/
|
||||||
int getY();
|
int getY();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the vertical coordinate of this object
|
||||||
|
*/
|
||||||
|
int getZ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the plane of the tile that the object is on.
|
* Gets the plane of the tile that the object is on.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ import java.security.NoSuchAlgorithmException;
|
|||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -169,6 +170,10 @@ public class RuneLite
|
|||||||
@Nullable
|
@Nullable
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Nullable
|
||||||
|
private RuntimeConfig runtimeConfig;
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception
|
public static void main(String[] args) throws Exception
|
||||||
{
|
{
|
||||||
Locale.setDefault(Locale.ENGLISH);
|
Locale.setDefault(Locale.ENGLISH);
|
||||||
@@ -344,6 +349,8 @@ public class RuneLite
|
|||||||
injector.injectMembers(client);
|
injector.injectMembers(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setupSystemProps();
|
||||||
|
|
||||||
// Start the applet
|
// Start the applet
|
||||||
if (applet != null)
|
if (applet != null)
|
||||||
{
|
{
|
||||||
@@ -639,4 +646,19 @@ public class RuneLite
|
|||||||
log.warn("unable to copy jagexcache", e);
|
log.warn("unable to copy jagexcache", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupSystemProps()
|
||||||
|
{
|
||||||
|
if (runtimeConfig == null || runtimeConfig.getSysProps() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Map.Entry<String, String> entry : runtimeConfig.getSysProps().entrySet())
|
||||||
|
{
|
||||||
|
String key = entry.getKey(), value = entry.getValue();
|
||||||
|
log.debug("Setting property {}={}", key, value);
|
||||||
|
System.setProperty(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,4 +32,5 @@ import lombok.Data;
|
|||||||
public class RuntimeConfig
|
public class RuntimeConfig
|
||||||
{
|
{
|
||||||
private Map<String, ?> props = Collections.emptyMap();
|
private Map<String, ?> props = Collections.emptyMap();
|
||||||
|
private Map<String, String> sysProps = Collections.emptyMap();
|
||||||
}
|
}
|
||||||
@@ -105,6 +105,7 @@ public enum ItemMapping
|
|||||||
ITEM_RUNE_SCIMITAR_ORNAMENT_KIT_ZAMORAK(RUNE_SCIMITAR_ORNAMENT_KIT_ZAMORAK, RUNE_SCIMITAR_23334),
|
ITEM_RUNE_SCIMITAR_ORNAMENT_KIT_ZAMORAK(RUNE_SCIMITAR_ORNAMENT_KIT_ZAMORAK, RUNE_SCIMITAR_23334),
|
||||||
ITEM_RUNE_DEFENDER(RUNE_DEFENDER, RUNE_DEFENDER_T),
|
ITEM_RUNE_DEFENDER(RUNE_DEFENDER, RUNE_DEFENDER_T),
|
||||||
ITEM_RUNE_DEFENDER_ORNAMENT_KIT(RUNE_DEFENDER_ORNAMENT_KIT, RUNE_DEFENDER_T),
|
ITEM_RUNE_DEFENDER_ORNAMENT_KIT(RUNE_DEFENDER_ORNAMENT_KIT, RUNE_DEFENDER_T),
|
||||||
|
ITEM_RUNE_CROSSBOW(RUNE_CROSSBOW, RUNE_CROSSBOW_OR),
|
||||||
|
|
||||||
// Godsword ornament kits
|
// Godsword ornament kits
|
||||||
ITEM_ARMADYL_GODSWORD(ARMADYL_GODSWORD, ARMADYL_GODSWORD_OR),
|
ITEM_ARMADYL_GODSWORD(ARMADYL_GODSWORD, ARMADYL_GODSWORD_OR),
|
||||||
@@ -130,6 +131,21 @@ public enum ItemMapping
|
|||||||
ITEM_BERSERKER_NECKLACE(BERSERKER_NECKLACE, BERSERKER_NECKLACE_OR),
|
ITEM_BERSERKER_NECKLACE(BERSERKER_NECKLACE, BERSERKER_NECKLACE_OR),
|
||||||
ITEM_BERSERKER_NECKLACE_ORNAMENT_KIT(BERSERKER_NECKLACE_ORNAMENT_KIT, BERSERKER_NECKLACE_OR),
|
ITEM_BERSERKER_NECKLACE_ORNAMENT_KIT(BERSERKER_NECKLACE_ORNAMENT_KIT, BERSERKER_NECKLACE_OR),
|
||||||
|
|
||||||
|
// Other ornament kits
|
||||||
|
ITEM_SHATTERED_RELICS_VARIETY_ORNAMENT_KIT(SHATTERED_RELICS_VARIETY_ORNAMENT_KIT, RUNE_CROSSBOW_OR, ABYSSAL_TENTACLE_OR, ABYSSAL_WHIP_OR, BOOK_OF_BALANCE_OR, BOOK_OF_DARKNESS_OR, BOOK_OF_LAW_OR, BOOK_OF_WAR_OR, HOLY_BOOK_OR, UNHOLY_BOOK_OR),
|
||||||
|
ITEM_SHATTERED_RELICS_VOID_ORNAMENT_KIT(SHATTERED_RELICS_VOID_ORNAMENT_KIT, ELITE_VOID_TOP_OR, ELITE_VOID_ROBE_OR, VOID_KNIGHT_TOP_OR, VOID_KNIGHT_ROBE_OR, VOID_KNIGHT_GLOVES_OR, VOID_MAGE_HELM_OR, VOID_MELEE_HELM_OR, VOID_RANGER_HELM_OR),
|
||||||
|
ITEM_MYSTIC_BOOTS(MYSTIC_BOOTS, MYSTIC_BOOTS_OR),
|
||||||
|
ITEM_MYSTIC_GLOVES(MYSTIC_GLOVES, MYSTIC_GLOVES_OR),
|
||||||
|
ITEM_MYSTIC_HAT(MYSTIC_HAT, MYSTIC_HAT_OR),
|
||||||
|
ITEM_MYSTIC_ROBE_BOTTOM(MYSTIC_ROBE_BOTTOM, MYSTIC_ROBE_BOTTOM_OR),
|
||||||
|
ITEM_MYSTIC_ROBE_TOP(MYSTIC_ROBE_TOP, MYSTIC_ROBE_TOP_OR),
|
||||||
|
ITEM_SHATTERED_RELICS_MYSTIC_ORNAMENT_KIT(SHATTERED_RELICS_MYSTIC_ORNAMENT_KIT, MYSTIC_BOOTS_OR, MYSTIC_GLOVES_OR, MYSTIC_HAT_OR, MYSTIC_ROBE_BOTTOM_OR, MYSTIC_ROBE_TOP_OR),
|
||||||
|
ITEM_CANNON_BARRELS(CANNON_BARRELS, CANNON_BARRELS_OR),
|
||||||
|
ITEM_CANNON_BASE(CANNON_BASE, CANNON_BASE_OR),
|
||||||
|
ITEM_CANNON_FURNACE(CANNON_FURNACE, CANNON_FURNACE_OR),
|
||||||
|
ITEM_CANNON_STAND(CANNON_STAND, CANNON_STAND_OR),
|
||||||
|
ITEM_SHATTERED_CANNON_ORNAMENT_KIT(SHATTERED_CANNON_ORNAMENT_KIT, CANNON_BARRELS_OR, CANNON_BASE_OR, CANNON_FURNACE_OR, CANNON_STAND_OR),
|
||||||
|
|
||||||
// Ensouled heads
|
// Ensouled heads
|
||||||
ITEM_ENSOULED_GOBLIN_HEAD(ENSOULED_GOBLIN_HEAD_13448, ENSOULED_GOBLIN_HEAD),
|
ITEM_ENSOULED_GOBLIN_HEAD(ENSOULED_GOBLIN_HEAD_13448, ENSOULED_GOBLIN_HEAD),
|
||||||
ITEM_ENSOULED_MONKEY_HEAD(ENSOULED_MONKEY_HEAD_13451, ENSOULED_MONKEY_HEAD),
|
ITEM_ENSOULED_MONKEY_HEAD(ENSOULED_MONKEY_HEAD_13451, ENSOULED_MONKEY_HEAD),
|
||||||
@@ -181,8 +197,8 @@ public enum ItemMapping
|
|||||||
ITEM_GAMES_NECKLACE(GAMES_NECKLACE8, GAMES_NECKLACE1, GAMES_NECKLACE2, GAMES_NECKLACE3, GAMES_NECKLACE4, GAMES_NECKLACE5, GAMES_NECKLACE6, GAMES_NECKLACE7),
|
ITEM_GAMES_NECKLACE(GAMES_NECKLACE8, GAMES_NECKLACE1, GAMES_NECKLACE2, GAMES_NECKLACE3, GAMES_NECKLACE4, GAMES_NECKLACE5, GAMES_NECKLACE6, GAMES_NECKLACE7),
|
||||||
|
|
||||||
// Degradable/charged weaponry/armour
|
// Degradable/charged weaponry/armour
|
||||||
ITEM_ABYSSAL_WHIP(ABYSSAL_WHIP, VOLCANIC_ABYSSAL_WHIP, FROZEN_ABYSSAL_WHIP),
|
ITEM_ABYSSAL_WHIP(ABYSSAL_WHIP, VOLCANIC_ABYSSAL_WHIP, FROZEN_ABYSSAL_WHIP, ABYSSAL_WHIP_OR),
|
||||||
ITEM_KRAKEN_TENTACLE(KRAKEN_TENTACLE, ABYSSAL_TENTACLE),
|
ITEM_KRAKEN_TENTACLE(KRAKEN_TENTACLE, ABYSSAL_TENTACLE, ABYSSAL_TENTACLE_OR),
|
||||||
ITEM_TRIDENT_OF_THE_SEAS(UNCHARGED_TRIDENT, TRIDENT_OF_THE_SEAS),
|
ITEM_TRIDENT_OF_THE_SEAS(UNCHARGED_TRIDENT, TRIDENT_OF_THE_SEAS),
|
||||||
ITEM_TRIDENT_OF_THE_SEAS_E(UNCHARGED_TRIDENT_E, TRIDENT_OF_THE_SEAS_E),
|
ITEM_TRIDENT_OF_THE_SEAS_E(UNCHARGED_TRIDENT_E, TRIDENT_OF_THE_SEAS_E),
|
||||||
ITEM_TRIDENT_OF_THE_SWAMP(UNCHARGED_TOXIC_TRIDENT, TRIDENT_OF_THE_SWAMP),
|
ITEM_TRIDENT_OF_THE_SWAMP(UNCHARGED_TOXIC_TRIDENT, TRIDENT_OF_THE_SWAMP),
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import net.runelite.api.Perspective;
|
|||||||
import static net.runelite.api.Perspective.LOCAL_TILE_SIZE;
|
import static net.runelite.api.Perspective.LOCAL_TILE_SIZE;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||||
@@ -66,7 +67,9 @@ class CannonOverlay extends Overlay
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalPoint cannonPoint = LocalPoint.fromWorld(client, plugin.getCannonPosition());
|
// WorldAreas return the SW point, whereas we want the centre point
|
||||||
|
WorldPoint cannonLocation = plugin.getCannonPosition().toWorldPoint().dx(1).dy(1);
|
||||||
|
LocalPoint cannonPoint = LocalPoint.fromWorld(client, cannonLocation);
|
||||||
|
|
||||||
if (cannonPoint == null)
|
if (cannonPoint == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,10 +24,12 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.cannon;
|
package net.runelite.client.plugins.cannon;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -37,18 +39,17 @@ import net.runelite.api.ChatMessageType;
|
|||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameObject;
|
import net.runelite.api.GameObject;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import static net.runelite.api.GraphicID.CANNONBALL;
|
import net.runelite.api.GraphicID;
|
||||||
import static net.runelite.api.GraphicID.GRANITE_CANNONBALL;
|
|
||||||
import net.runelite.api.InventoryID;
|
import net.runelite.api.InventoryID;
|
||||||
import net.runelite.api.Item;
|
import net.runelite.api.Item;
|
||||||
import net.runelite.api.ItemContainer;
|
import net.runelite.api.ItemContainer;
|
||||||
import net.runelite.api.ItemID;
|
import net.runelite.api.ItemID;
|
||||||
import net.runelite.api.MenuAction;
|
import net.runelite.api.MenuAction;
|
||||||
import net.runelite.api.ObjectID;
|
import net.runelite.api.ObjectID;
|
||||||
import static net.runelite.api.ObjectID.CANNON_BASE;
|
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
import net.runelite.api.Projectile;
|
import net.runelite.api.Projectile;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
|
import net.runelite.api.coords.WorldArea;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
import net.runelite.api.events.GameObjectSpawned;
|
import net.runelite.api.events.GameObjectSpawned;
|
||||||
@@ -79,6 +80,11 @@ public class CannonPlugin extends Plugin
|
|||||||
static final int MAX_OVERLAY_DISTANCE = 4100;
|
static final int MAX_OVERLAY_DISTANCE = 4100;
|
||||||
static final int MAX_CBALLS = 30;
|
static final int MAX_CBALLS = 30;
|
||||||
|
|
||||||
|
private static final Set<Integer> CANNONBALL_PROJECTILE_IDS = ImmutableSet.of(
|
||||||
|
GraphicID.CANNONBALL, GraphicID.GRANITE_CANNONBALL,
|
||||||
|
GraphicID.CANNONBALL_OR, GraphicID.GRANITE_CANNONBALL_OR
|
||||||
|
);
|
||||||
|
|
||||||
private CannonCounter counter;
|
private CannonCounter counter;
|
||||||
private boolean skipProjectileCheckThisTick;
|
private boolean skipProjectileCheckThisTick;
|
||||||
private boolean cannonBallNotificationSent;
|
private boolean cannonBallNotificationSent;
|
||||||
@@ -92,7 +98,7 @@ public class CannonPlugin extends Plugin
|
|||||||
private boolean cannonPlaced;
|
private boolean cannonPlaced;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private WorldPoint cannonPosition;
|
private WorldArea cannonPosition;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private int cannonWorld = -1;
|
private int cannonWorld = -1;
|
||||||
@@ -185,15 +191,19 @@ public class CannonPlugin extends Plugin
|
|||||||
switch (item.getId())
|
switch (item.getId())
|
||||||
{
|
{
|
||||||
case ItemID.CANNON_BASE:
|
case ItemID.CANNON_BASE:
|
||||||
|
case ItemID.CANNON_BASE_OR:
|
||||||
hasBase = true;
|
hasBase = true;
|
||||||
break;
|
break;
|
||||||
case ItemID.CANNON_STAND:
|
case ItemID.CANNON_STAND:
|
||||||
|
case ItemID.CANNON_STAND_OR:
|
||||||
hasStand = true;
|
hasStand = true;
|
||||||
break;
|
break;
|
||||||
case ItemID.CANNON_BARRELS:
|
case ItemID.CANNON_BARRELS:
|
||||||
|
case ItemID.CANNON_BARRELS_OR:
|
||||||
hasBarrels = true;
|
hasBarrels = true;
|
||||||
break;
|
break;
|
||||||
case ItemID.CANNON_FURNACE:
|
case ItemID.CANNON_FURNACE:
|
||||||
|
case ItemID.CANNON_FURNACE_OR:
|
||||||
hasFurnace = true;
|
hasFurnace = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -253,12 +263,12 @@ public class CannonPlugin extends Plugin
|
|||||||
GameObject gameObject = event.getGameObject();
|
GameObject gameObject = event.getGameObject();
|
||||||
|
|
||||||
Player localPlayer = client.getLocalPlayer();
|
Player localPlayer = client.getLocalPlayer();
|
||||||
if (gameObject.getId() == CANNON_BASE && !cannonPlaced)
|
if ((gameObject.getId() == ObjectID.CANNON_BASE || gameObject.getId() == ObjectID.CANNON_BASE_43029) && !cannonPlaced)
|
||||||
{
|
{
|
||||||
if (localPlayer.getWorldLocation().distanceTo(gameObject.getWorldLocation()) <= 2
|
if (localPlayer.getWorldLocation().distanceTo(gameObject.getWorldLocation()) <= 2
|
||||||
&& localPlayer.getAnimation() == AnimationID.BURYING_BONES)
|
&& localPlayer.getAnimation() == AnimationID.BURYING_BONES)
|
||||||
{
|
{
|
||||||
cannonPosition = gameObject.getWorldLocation();
|
cannonPosition = buildCannonWorldArea(gameObject.getWorldLocation());
|
||||||
cannonWorld = client.getWorld();
|
cannonWorld = client.getWorld();
|
||||||
cannon = gameObject;
|
cannon = gameObject;
|
||||||
}
|
}
|
||||||
@@ -268,7 +278,7 @@ public class CannonPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||||
{
|
{
|
||||||
if (cannonPosition != null || event.getId() != ObjectID.DWARF_MULTICANNON)
|
if (cannonPosition != null || (event.getId() != ObjectID.DWARF_MULTICANNON && event.getId() != ObjectID.DWARF_MULTICANNON_43027))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -303,12 +313,12 @@ public class CannonPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
Projectile projectile = event.getProjectile();
|
Projectile projectile = event.getProjectile();
|
||||||
|
|
||||||
if ((projectile.getId() == CANNONBALL || projectile.getId() == GRANITE_CANNONBALL) && cannonPosition != null && cannonWorld == client.getWorld())
|
if (CANNONBALL_PROJECTILE_IDS.contains(projectile.getId()) && cannonPosition != null && cannonWorld == client.getWorld())
|
||||||
{
|
{
|
||||||
WorldPoint projectileLoc = WorldPoint.fromLocal(client, projectile.getX1(), projectile.getY1(), client.getPlane());
|
WorldPoint projectileLoc = WorldPoint.fromLocal(client, projectile.getX1(), projectile.getY1(), client.getPlane());
|
||||||
|
|
||||||
//Check to see if projectile x,y is 0 else it will continuously decrease while ball is flying.
|
//Check to see if projectile x,y is 0 else it will continuously decrease while ball is flying.
|
||||||
if (projectileLoc.equals(cannonPosition) && projectile.getX() == 0 && projectile.getY() == 0)
|
if (cannonPosition.contains(projectileLoc) && projectile.getX() == 0 && projectile.getY() == 0)
|
||||||
{
|
{
|
||||||
// When there's a chat message about cannon reloaded/unloaded/out of ammo,
|
// When there's a chat message about cannon reloaded/unloaded/out of ammo,
|
||||||
// the message event runs before the projectile event. However they run
|
// the message event runs before the projectile event. However they run
|
||||||
@@ -393,7 +403,7 @@ public class CannonPlugin extends Plugin
|
|||||||
cannonPlaced = true;
|
cannonPlaced = true;
|
||||||
cannonWorld = client.getWorld();
|
cannonWorld = client.getWorld();
|
||||||
cannon = objects[0];
|
cannon = objects[0];
|
||||||
cannonPosition = cannon.getWorldLocation();
|
cannonPosition = buildCannonWorldArea(cannon.getWorldLocation());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -514,4 +524,9 @@ public class CannonPlugin extends Plugin
|
|||||||
infoBoxManager.removeInfoBox(counter);
|
infoBoxManager.removeInfoBox(counter);
|
||||||
counter = null;
|
counter = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static WorldArea buildCannonWorldArea(WorldPoint worldPoint)
|
||||||
|
{
|
||||||
|
return new WorldArea(worldPoint.getX() - 1, worldPoint.getY() - 1, 3, 3, worldPoint.getPlane());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,11 @@ package net.runelite.client.plugins.gpu;
|
|||||||
|
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
import com.jogamp.nativewindow.AbstractGraphicsConfiguration;
|
||||||
|
import com.jogamp.nativewindow.NativeWindowFactory;
|
||||||
import com.jogamp.nativewindow.awt.AWTGraphicsConfiguration;
|
import com.jogamp.nativewindow.awt.AWTGraphicsConfiguration;
|
||||||
import com.jogamp.nativewindow.awt.JAWTWindow;
|
import com.jogamp.nativewindow.awt.JAWTWindow;
|
||||||
|
import com.jogamp.opengl.DebugGL4;
|
||||||
import com.jogamp.opengl.GL;
|
import com.jogamp.opengl.GL;
|
||||||
import static com.jogamp.opengl.GL.GL_ARRAY_BUFFER;
|
import static com.jogamp.opengl.GL.GL_ARRAY_BUFFER;
|
||||||
import static com.jogamp.opengl.GL.GL_DYNAMIC_DRAW;
|
import static com.jogamp.opengl.GL.GL_DYNAMIC_DRAW;
|
||||||
@@ -64,7 +67,6 @@ import javax.swing.SwingUtilities;
|
|||||||
import jogamp.nativewindow.SurfaceScaleUtils;
|
import jogamp.nativewindow.SurfaceScaleUtils;
|
||||||
import jogamp.nativewindow.jawt.x11.X11JAWTWindow;
|
import jogamp.nativewindow.jawt.x11.X11JAWTWindow;
|
||||||
import jogamp.nativewindow.macosx.OSXUtil;
|
import jogamp.nativewindow.macosx.OSXUtil;
|
||||||
import jogamp.newt.awt.NewtFactoryAWT;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.BufferProvider;
|
import net.runelite.api.BufferProvider;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -380,7 +382,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
GLCapabilities glCaps = new GLCapabilities(glProfile);
|
GLCapabilities glCaps = new GLCapabilities(glProfile);
|
||||||
AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(canvas.getGraphicsConfiguration(), glCaps, glCaps);
|
AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(canvas.getGraphicsConfiguration(), glCaps, glCaps);
|
||||||
|
|
||||||
jawtWindow = NewtFactoryAWT.getNativeWindow(canvas, config);
|
jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(canvas, config);
|
||||||
canvas.setFocusable(true);
|
canvas.setFocusable(true);
|
||||||
|
|
||||||
GLDrawableFactory glDrawableFactory = GLDrawableFactory.getFactory(glProfile);
|
GLDrawableFactory glDrawableFactory = GLDrawableFactory.getFactory(glProfile);
|
||||||
@@ -417,10 +419,17 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
|
|
||||||
this.gl = glContext.getGL().getGL4();
|
this.gl = glContext.getGL().getGL4();
|
||||||
|
|
||||||
setupSyncMode();
|
|
||||||
|
|
||||||
if (log.isDebugEnabled())
|
if (log.isDebugEnabled())
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
gl = new DebugGL4(gl);
|
||||||
|
}
|
||||||
|
catch (NoClassDefFoundError ex)
|
||||||
|
{
|
||||||
|
log.debug("Disabling DebugGL due to jogl-gldesktop-dbg not being present on the classpath");
|
||||||
|
}
|
||||||
|
|
||||||
gl.glEnable(gl.GL_DEBUG_OUTPUT);
|
gl.glEnable(gl.GL_DEBUG_OUTPUT);
|
||||||
|
|
||||||
// GLDebugEvent[ id 0x20071
|
// GLDebugEvent[ id 0x20071
|
||||||
@@ -440,6 +449,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
gl.GL_DONT_CARE, 1, new int[]{0x20052}, 0, false);
|
gl.GL_DONT_CARE, 1, new int[]{0x20052}, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setupSyncMode();
|
||||||
|
|
||||||
initVao();
|
initVao();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -547,7 +558,9 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
// we'll just leak the window...
|
// we'll just leak the window...
|
||||||
if (OSType.getOSType() != OSType.MacOS)
|
if (OSType.getOSType() != OSType.MacOS)
|
||||||
{
|
{
|
||||||
NewtFactoryAWT.destroyNativeWindow(jawtWindow);
|
final AbstractGraphicsConfiguration config = jawtWindow.getGraphicsConfiguration();
|
||||||
|
jawtWindow.destroy();
|
||||||
|
config.getScreen().getDevice().close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import java.util.Objects;
|
|||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import jogamp.opengl.GLContextImpl;
|
import jogamp.opengl.GLContextImpl;
|
||||||
import jogamp.opengl.GLDrawableImpl;
|
import jogamp.opengl.GLDrawableImpl;
|
||||||
import jogamp.opengl.egl.EGLContext;
|
|
||||||
import jogamp.opengl.macosx.cgl.CGL;
|
import jogamp.opengl.macosx.cgl.CGL;
|
||||||
import jogamp.opengl.windows.wgl.WindowsWGLContext;
|
import jogamp.opengl.windows.wgl.WindowsWGLContext;
|
||||||
import jogamp.opengl.x11.glx.X11GLXContext;
|
import jogamp.opengl.x11.glx.X11GLXContext;
|
||||||
@@ -306,12 +305,6 @@ class OpenCLManager
|
|||||||
contextProps.addProperty(CL_GL_CONTEXT_KHR, glContextHandle);
|
contextProps.addProperty(CL_GL_CONTEXT_KHR, glContextHandle);
|
||||||
contextProps.addProperty(CL_WGL_HDC_KHR, surfaceHandle);
|
contextProps.addProperty(CL_WGL_HDC_KHR, surfaceHandle);
|
||||||
}
|
}
|
||||||
else if (glContext instanceof EGLContext)
|
|
||||||
{
|
|
||||||
long displayHandle = nativeSurface.getDisplayHandle();
|
|
||||||
contextProps.addProperty(CL_GL_CONTEXT_KHR, glContextHandle);
|
|
||||||
contextProps.addProperty(CL_EGL_DISPLAY_KHR, displayHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
log.debug("Creating context with props: {}", contextProps);
|
log.debug("Creating context with props: {}", contextProps);
|
||||||
context = clCreateContext(contextProps, 1, new cl_device_id[]{device}, null, null, null);
|
context = clCreateContext(contextProps, 1, new cl_device_id[]{device}, null, null, null);
|
||||||
|
|||||||
@@ -1016,15 +1016,13 @@ public class ModelOutlineRenderer
|
|||||||
|
|
||||||
private void drawOutline(GameObject gameObject, int outlineWidth, Color color, int feather)
|
private void drawOutline(GameObject gameObject, int outlineWidth, Color color, int feather)
|
||||||
{
|
{
|
||||||
LocalPoint lp = gameObject.getLocalLocation();
|
|
||||||
Renderable renderable = gameObject.getRenderable();
|
Renderable renderable = gameObject.getRenderable();
|
||||||
if (renderable != null)
|
if (renderable != null)
|
||||||
{
|
{
|
||||||
Model model = renderable instanceof Model ? (Model) renderable : renderable.getModel();
|
Model model = renderable instanceof Model ? (Model) renderable : renderable.getModel();
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
drawModelOutline(model, lp.getX(), lp.getY(),
|
drawModelOutline(model, gameObject.getX(), gameObject.getY(), gameObject.getZ(),
|
||||||
Perspective.getTileHeight(client, lp, gameObject.getPlane()),
|
|
||||||
gameObject.getModelOrientation(), outlineWidth, color, feather);
|
gameObject.getModelOrientation(), outlineWidth, color, feather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1032,15 +1030,13 @@ public class ModelOutlineRenderer
|
|||||||
|
|
||||||
private void drawOutline(GroundObject groundObject, int outlineWidth, Color color, int feather)
|
private void drawOutline(GroundObject groundObject, int outlineWidth, Color color, int feather)
|
||||||
{
|
{
|
||||||
LocalPoint lp = groundObject.getLocalLocation();
|
|
||||||
Renderable renderable = groundObject.getRenderable();
|
Renderable renderable = groundObject.getRenderable();
|
||||||
if (renderable != null)
|
if (renderable != null)
|
||||||
{
|
{
|
||||||
Model model = renderable instanceof Model ? (Model) renderable : renderable.getModel();
|
Model model = renderable instanceof Model ? (Model) renderable : renderable.getModel();
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
drawModelOutline(model, lp.getX(), lp.getY(),
|
drawModelOutline(model, groundObject.getX(), groundObject.getY(), groundObject.getZ(),
|
||||||
Perspective.getTileHeight(client, lp, client.getPlane()),
|
|
||||||
0, outlineWidth, color, feather);
|
0, outlineWidth, color, feather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1048,16 +1044,13 @@ public class ModelOutlineRenderer
|
|||||||
|
|
||||||
private void drawOutline(ItemLayer itemLayer, int outlineWidth, Color color, int feather)
|
private void drawOutline(ItemLayer itemLayer, int outlineWidth, Color color, int feather)
|
||||||
{
|
{
|
||||||
LocalPoint lp = itemLayer.getLocalLocation();
|
|
||||||
|
|
||||||
Renderable bottomRenderable = itemLayer.getBottom();
|
Renderable bottomRenderable = itemLayer.getBottom();
|
||||||
if (bottomRenderable != null)
|
if (bottomRenderable != null)
|
||||||
{
|
{
|
||||||
Model model = bottomRenderable instanceof Model ? (Model) bottomRenderable : bottomRenderable.getModel();
|
Model model = bottomRenderable instanceof Model ? (Model) bottomRenderable : bottomRenderable.getModel();
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
drawModelOutline(model, lp.getX(), lp.getY(),
|
drawModelOutline(model, itemLayer.getX(), itemLayer.getY(), itemLayer.getZ() - itemLayer.getHeight(),
|
||||||
Perspective.getTileHeight(client, lp, itemLayer.getPlane()) - itemLayer.getHeight(),
|
|
||||||
0, outlineWidth, color, feather);
|
0, outlineWidth, color, feather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1068,8 +1061,7 @@ public class ModelOutlineRenderer
|
|||||||
Model model = middleRenderable instanceof Model ? (Model) middleRenderable : middleRenderable.getModel();
|
Model model = middleRenderable instanceof Model ? (Model) middleRenderable : middleRenderable.getModel();
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
drawModelOutline(model, lp.getX(), lp.getY(),
|
drawModelOutline(model, itemLayer.getX(), itemLayer.getY(), itemLayer.getZ() - itemLayer.getHeight(),
|
||||||
Perspective.getTileHeight(client, lp, itemLayer.getPlane()) - itemLayer.getHeight(),
|
|
||||||
0, outlineWidth, color, feather);
|
0, outlineWidth, color, feather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1080,8 +1072,7 @@ public class ModelOutlineRenderer
|
|||||||
Model model = topRenderable instanceof Model ? (Model) topRenderable : topRenderable.getModel();
|
Model model = topRenderable instanceof Model ? (Model) topRenderable : topRenderable.getModel();
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
drawModelOutline(model, lp.getX(), lp.getY(),
|
drawModelOutline(model, itemLayer.getX(), itemLayer.getY(), itemLayer.getZ() - itemLayer.getHeight(),
|
||||||
Perspective.getTileHeight(client, lp, itemLayer.getPlane()) - itemLayer.getHeight(),
|
|
||||||
0, outlineWidth, color, feather);
|
0, outlineWidth, color, feather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1089,8 +1080,6 @@ public class ModelOutlineRenderer
|
|||||||
|
|
||||||
private void drawOutline(DecorativeObject decorativeObject, int outlineWidth, Color color, int feather)
|
private void drawOutline(DecorativeObject decorativeObject, int outlineWidth, Color color, int feather)
|
||||||
{
|
{
|
||||||
LocalPoint lp = decorativeObject.getLocalLocation();
|
|
||||||
|
|
||||||
Renderable renderable1 = decorativeObject.getRenderable();
|
Renderable renderable1 = decorativeObject.getRenderable();
|
||||||
if (renderable1 != null)
|
if (renderable1 != null)
|
||||||
{
|
{
|
||||||
@@ -1098,9 +1087,9 @@ public class ModelOutlineRenderer
|
|||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
drawModelOutline(model,
|
drawModelOutline(model,
|
||||||
lp.getX() + decorativeObject.getXOffset(),
|
decorativeObject.getX() + decorativeObject.getXOffset(),
|
||||||
lp.getY() + decorativeObject.getYOffset(),
|
decorativeObject.getY() + decorativeObject.getYOffset(),
|
||||||
Perspective.getTileHeight(client, lp, decorativeObject.getPlane()),
|
decorativeObject.getZ(),
|
||||||
0, outlineWidth, color, feather);
|
0, outlineWidth, color, feather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1112,8 +1101,7 @@ public class ModelOutlineRenderer
|
|||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
// Offset is not used for the second model
|
// Offset is not used for the second model
|
||||||
drawModelOutline(model, lp.getX(), lp.getY(),
|
drawModelOutline(model, decorativeObject.getX(), decorativeObject.getY(), decorativeObject.getZ(),
|
||||||
Perspective.getTileHeight(client, lp, decorativeObject.getPlane()),
|
|
||||||
0, outlineWidth, color, feather);
|
0, outlineWidth, color, feather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1121,16 +1109,13 @@ public class ModelOutlineRenderer
|
|||||||
|
|
||||||
private void drawOutline(WallObject wallObject, int outlineWidth, Color color, int feather)
|
private void drawOutline(WallObject wallObject, int outlineWidth, Color color, int feather)
|
||||||
{
|
{
|
||||||
LocalPoint lp = wallObject.getLocalLocation();
|
|
||||||
|
|
||||||
Renderable renderable1 = wallObject.getRenderable1();
|
Renderable renderable1 = wallObject.getRenderable1();
|
||||||
if (renderable1 != null)
|
if (renderable1 != null)
|
||||||
{
|
{
|
||||||
Model model = renderable1 instanceof Model ? (Model) renderable1 : renderable1.getModel();
|
Model model = renderable1 instanceof Model ? (Model) renderable1 : renderable1.getModel();
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
drawModelOutline(model, lp.getX(), lp.getY(),
|
drawModelOutline(model, wallObject.getX(), wallObject.getY(), wallObject.getZ(),
|
||||||
Perspective.getTileHeight(client, lp, wallObject.getPlane()),
|
|
||||||
0, outlineWidth, color, feather);
|
0, outlineWidth, color, feather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1141,8 +1126,7 @@ public class ModelOutlineRenderer
|
|||||||
Model model = renderable2 instanceof Model ? (Model) renderable2 : renderable2.getModel();
|
Model model = renderable2 instanceof Model ? (Model) renderable2 : renderable2.getModel();
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
drawModelOutline(model, lp.getX(), lp.getY(),
|
drawModelOutline(model, wallObject.getX(), wallObject.getY(), wallObject.getZ(),
|
||||||
Perspective.getTileHeight(client, lp, wallObject.getPlane()),
|
|
||||||
0, outlineWidth, color, feather);
|
0, outlineWidth, color, feather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1180,7 +1164,7 @@ public class ModelOutlineRenderer
|
|||||||
Model model = graphicsObject.getModel();
|
Model model = graphicsObject.getModel();
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
drawModelOutline(model, lp.getX(), lp.getY(), graphicsObject.getHeight(),
|
drawModelOutline(model, lp.getX(), lp.getY(), graphicsObject.getZ(),
|
||||||
0, outlineWidth, color, feather);
|
0, outlineWidth, color, feather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3410,5 +3410,15 @@
|
|||||||
"z1": 1,
|
"z1": 1,
|
||||||
"z2": 1
|
"z2": 1
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"11830": [ // Goblin Village & mind altar
|
||||||
|
{ // Grim Tales tower
|
||||||
|
"rx1": 21,
|
||||||
|
"ry1": 10,
|
||||||
|
"rx2": 27,
|
||||||
|
"ry2": 15,
|
||||||
|
"z1": 2,
|
||||||
|
"z2": 2
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user