Merge pull request #5756 from Abextm/varbit-thread-safe
Make sure varbit access happen on the client thread
This commit is contained in:
@@ -66,6 +66,7 @@ import net.runelite.api.events.WallObjectDespawned;
|
||||
import net.runelite.api.events.WallObjectSpawned;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -112,6 +113,9 @@ public class MotherlodePlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean inMlm;
|
||||
|
||||
@@ -148,7 +152,7 @@ public class MotherlodePlugin extends Plugin
|
||||
|
||||
if (inMlm)
|
||||
{
|
||||
refreshSackValues();
|
||||
clientThread.invokeLater(this::refreshSackValues);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.events.WidgetHiddenChanged;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
@@ -112,6 +113,9 @@ public class RaidsPlugin extends Plugin
|
||||
@Inject
|
||||
private SpriteManager spriteManager;
|
||||
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Getter
|
||||
private final ArrayList<String> roomWhitelist = new ArrayList<>();
|
||||
|
||||
@@ -150,7 +154,7 @@ public class RaidsPlugin extends Plugin
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(pointsOverlay);
|
||||
updateLists();
|
||||
checkRaidPresence(true);
|
||||
clientThread.invokeLater(() -> checkRaidPresence(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -72,6 +72,8 @@ public abstract class VarbitMixin implements RSClient
|
||||
@Override
|
||||
public int getVarbitValue(int[] varps, int varbitId)
|
||||
{
|
||||
assert client.isClientThread();
|
||||
|
||||
RSVarbit v = varbitCache.getIfPresent(varbitId);
|
||||
if (v == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user