mixins: these are still broken lol
This commit is contained in:
@@ -287,9 +287,9 @@ public class RuneLite
|
||||
|
||||
PROFILES_DIR.mkdirs();
|
||||
|
||||
log.info("OpenOSRS {} (launcher version {}) starting up, args: {}",
|
||||
RuneLiteProperties.getVersion(), RuneLiteProperties.getLauncherVersion() == null ? "unknown" : RuneLiteProperties.getLauncherVersion(),
|
||||
args.length == 0 ? "none" : String.join(" ", args));
|
||||
log.info("OpenOSRS {} (RuneLite version {}, launcher version {}) starting up, args: {}",
|
||||
OpenOSRS.SYSTEM_VERSION, RuneLiteProperties.getVersion() == null ? "unknown" : RuneLiteProperties.getVersion(),
|
||||
RuneLiteProperties.getLauncherVersion(), args.length == 0 ? "none" : String.join(" ", args));
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
@@ -530,6 +530,7 @@ public class RuneLite
|
||||
//Fixes win10 scaling when not 100% while using Anti-Aliasing with GPU
|
||||
System.setProperty("sun.java2d.uiScale", "1.0");
|
||||
|
||||
System.setProperty("runelite.launcher.version", "" + RuneLiteAPI.getVersion());
|
||||
String launcherVersion = System.getProperty("launcher.version");
|
||||
System.setProperty("runelite.launcher.version", launcherVersion == null ? "unknown" : launcherVersion);
|
||||
}
|
||||
}
|
||||
@@ -33,9 +33,9 @@ import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.api.mixins.Shadow;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSRenderable;
|
||||
import net.runelite.rs.api.RSGameObject;
|
||||
import net.runelite.rs.api.RSModel;
|
||||
import net.runelite.rs.api.RSRenderable;
|
||||
|
||||
@Mixin(RSGameObject.class)
|
||||
public abstract class RSGameObjectMixin implements RSGameObject
|
||||
@@ -43,6 +43,23 @@ public abstract class RSGameObjectMixin implements RSGameObject
|
||||
@Shadow("client")
|
||||
private static RSClient client;
|
||||
|
||||
@Inject
|
||||
private int gameObjectPlane;
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public int getPlane()
|
||||
{
|
||||
return gameObjectPlane;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setPlane(int plane)
|
||||
{
|
||||
this.gameObjectPlane = plane;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public Point getSceneMinLocation()
|
||||
|
||||
@@ -60,7 +60,9 @@ import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.api.mixins.Shadow;
|
||||
import net.runelite.rs.api.RSActor;
|
||||
import net.runelite.rs.api.RSBoundaryObject;
|
||||
import net.runelite.rs.api.RSClient;
|
||||
import net.runelite.rs.api.RSFloorDecoration;
|
||||
import net.runelite.rs.api.RSRenderable;
|
||||
import net.runelite.rs.api.RSGameObject;
|
||||
import net.runelite.rs.api.RSGraphicsObject;
|
||||
@@ -70,6 +72,7 @@ import net.runelite.rs.api.RSNodeDeque;
|
||||
import net.runelite.rs.api.RSProjectile;
|
||||
import net.runelite.rs.api.RSTile;
|
||||
import net.runelite.rs.api.RSTileItem;
|
||||
import net.runelite.rs.api.RSWallDecoration;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@Mixin(RSTile.class)
|
||||
@@ -261,10 +264,18 @@ public abstract class RSTileMixin implements RSTile
|
||||
public void wallObjectChanged(int idx)
|
||||
{
|
||||
WallObject previous = previousWallObject;
|
||||
WallObject current = getWallObject();
|
||||
RSBoundaryObject current = (RSBoundaryObject) getWallObject();
|
||||
|
||||
previousWallObject = current;
|
||||
|
||||
if (current != null)
|
||||
{
|
||||
if ((client.getTileSettings()[1][getX()][getY()] & 2) == 2)
|
||||
{
|
||||
current.setPlane(getRenderLevel() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (current == null && previous != null)
|
||||
{
|
||||
WallObjectDespawned wallObjectDespawned = new WallObjectDespawned();
|
||||
@@ -294,10 +305,18 @@ public abstract class RSTileMixin implements RSTile
|
||||
public void decorativeObjectChanged(int idx)
|
||||
{
|
||||
DecorativeObject previous = previousDecorativeObject;
|
||||
DecorativeObject current = getDecorativeObject();
|
||||
RSWallDecoration current = (RSWallDecoration) getDecorativeObject();
|
||||
|
||||
previousDecorativeObject = current;
|
||||
|
||||
if (current != null)
|
||||
{
|
||||
if ((client.getTileSettings()[1][getX()][getY()] & 2) == 2)
|
||||
{
|
||||
current.setPlane(getRenderLevel() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (current == null && previous != null)
|
||||
{
|
||||
DecorativeObjectDespawned decorativeObjectDespawned = new DecorativeObjectDespawned();
|
||||
@@ -327,10 +346,18 @@ public abstract class RSTileMixin implements RSTile
|
||||
public void groundObjectChanged(int idx)
|
||||
{
|
||||
GroundObject previous = previousGroundObject;
|
||||
GroundObject current = getGroundObject();
|
||||
RSFloorDecoration current = (RSFloorDecoration) getGroundObject();
|
||||
|
||||
previousGroundObject = current;
|
||||
|
||||
if (current != null)
|
||||
{
|
||||
if ((client.getTileSettings()[1][getX()][getY()] & 2) == 2)
|
||||
{
|
||||
current.setPlane(getRenderLevel() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (current == null && previous != null)
|
||||
{
|
||||
GroundObjectDespawned groundObjectDespawned = new GroundObjectDespawned();
|
||||
@@ -378,11 +405,13 @@ public abstract class RSTileMixin implements RSTile
|
||||
// Update previous object to current
|
||||
previousGameObjects[idx] = current;
|
||||
|
||||
// Last game object
|
||||
RSGameObject last = lastGameObject;
|
||||
|
||||
// Update last game object
|
||||
lastGameObject = current;
|
||||
if (current != null)
|
||||
{
|
||||
if ((client.getTileSettings()[1][getX()][getY()] & 2) == 2)
|
||||
{
|
||||
current.setPlane(getRenderLevel() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Duplicate event, return
|
||||
if (current == previous)
|
||||
@@ -390,14 +419,6 @@ public abstract class RSTileMixin implements RSTile
|
||||
return;
|
||||
}
|
||||
|
||||
if (current != null && current == last)
|
||||
{
|
||||
// When >1 tile objects are added to the scene, the same GameObject is added to
|
||||
// multiple tiles. We keep lastGameObject to prevent duplicate spawn events from
|
||||
// firing for these objects.
|
||||
return;
|
||||
}
|
||||
|
||||
// actors, projectiles, and graphics objects are added and removed from the scene each frame as GameObjects,
|
||||
// so ignore them.
|
||||
boolean currentInvalid = false, prevInvalid = false;
|
||||
@@ -405,12 +426,14 @@ public abstract class RSTileMixin implements RSTile
|
||||
{
|
||||
RSRenderable renderable = current.getRenderable();
|
||||
currentInvalid = renderable instanceof RSActor || renderable instanceof RSProjectile || renderable instanceof RSGraphicsObject;
|
||||
currentInvalid |= current.getStartX() != this.getX() || current.getStartY() != this.getY();
|
||||
}
|
||||
|
||||
if (previous != null)
|
||||
{
|
||||
RSRenderable renderable = previous.getRenderable();
|
||||
prevInvalid = renderable instanceof RSActor || renderable instanceof RSProjectile || renderable instanceof RSGraphicsObject;
|
||||
prevInvalid |= previous.getStartX() != this.getX() || previous.getStartY() != this.getY();
|
||||
}
|
||||
|
||||
Logger logger = client.getLogger();
|
||||
|
||||
@@ -8,9 +8,6 @@ public interface RSGameObject extends GameObject
|
||||
@Import("renderable")
|
||||
RSRenderable getRenderable();
|
||||
|
||||
@Import("plane")
|
||||
int getPlane();
|
||||
|
||||
@Import("startX")
|
||||
int getStartX();
|
||||
|
||||
@@ -45,4 +42,8 @@ public interface RSGameObject extends GameObject
|
||||
@Import("flags")
|
||||
@Override
|
||||
int getFlags();
|
||||
|
||||
int getPlane();
|
||||
|
||||
void setPlane(int plane);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user