project: Java 17 support, update deps, rework some stupid logic

This commit is contained in:
Owain van Brakel
2021-09-22 14:09:38 +02:00
parent 7644d5e2d1
commit 6df0372290
85 changed files with 894 additions and 1448 deletions

View File

@@ -65,7 +65,8 @@ public abstract class ScriptVMMixin implements RSClient
{
if (script != null)
{
ScriptPreFired event = new ScriptPreFired((int) script.getHash(), rootScriptEvent);
ScriptPreFired event = new ScriptPreFired((int) script.getHash());
event.setScriptEvent(rootScriptEvent);
client.getCallbacks().post(event);
}
@@ -127,7 +128,7 @@ public abstract class ScriptVMMixin implements RSClient
return true;
case INVOKE:
int scriptId = currentScript.getIntOperands()[currentScriptPC];
client.getCallbacks().post(new ScriptPreFired(scriptId, null));
client.getCallbacks().post(new ScriptPreFired(scriptId));
return false;
case RETURN:
client.getCallbacks().post(new ScriptPostFired((int) currentScript.getHash()));

View File

@@ -35,7 +35,6 @@ import net.runelite.api.mixins.Replace;
import net.runelite.api.mixins.Shadow;
import net.runelite.rs.api.RSActor;
import net.runelite.rs.api.RSClient;
import net.runelite.rs.api.RSNPC;
import net.runelite.rs.api.RSPcmStream;
import net.runelite.rs.api.RSRawPcmStream;
import net.runelite.rs.api.RSRawSound;
@@ -53,18 +52,11 @@ public abstract class SoundEffectMixin implements RSClient
@Inject
private static RSActor lastSoundEffectSourceActor;
@Inject
private static int lastSoundEffectSourceNPCid;
@Copy("updateActorSequence")
@Replace("updateActorSequence")
@SuppressWarnings("InfiniteRecursion")
public static void copy$updateActorSequence(RSActor actor, int size)
{
if (actor instanceof RSNPC)
{
lastSoundEffectSourceNPCid = ((RSNPC) actor).getId();
}
lastSoundEffectSourceActor = actor;
copy$updateActorSequence(actor, size);
@@ -87,8 +79,6 @@ public abstract class SoundEffectMixin implements RSClient
{
// Regular sound effect
SoundEffectPlayed event = new SoundEffectPlayed(lastSoundEffectSourceActor);
event.setNpcid(lastSoundEffectSourceNPCid);
lastSoundEffectSourceNPCid = -1;
event.setSoundId(client.getQueuedSoundEffectIDs()[soundIndex]);
event.setDelay(client.getQueuedSoundEffectDelays()[soundIndex]);
client.getCallbacks().post(event);