Ensure createItemSprite is called on the game thread
This commit is contained in:
@@ -52,6 +52,7 @@ import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
import net.runelite.api.events.ProjectileMoved;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -106,6 +107,9 @@ public class CannonPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Provides
|
||||
CannonConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -140,7 +144,7 @@ public class CannonPlugin extends Plugin
|
||||
{
|
||||
if (cannonPlaced)
|
||||
{
|
||||
addCounter();
|
||||
clientThread.invokeLater(this::addCounter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ public class RunepouchOverlay extends Overlay
|
||||
{
|
||||
OverlayUtil.renderImageLocation(graphics,
|
||||
new Point(location.getX(), location.getY() + graphics.getFontMetrics().getHeight() * i),
|
||||
getRuneImage(rune));
|
||||
image);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -96,6 +97,9 @@ public class SlayerPlugin extends Plugin
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
private String taskName;
|
||||
private int amount;
|
||||
private TaskCounter counter;
|
||||
@@ -112,7 +116,7 @@ public class SlayerPlugin extends Plugin
|
||||
&& config.amount() != -1
|
||||
&& !config.taskName().isEmpty())
|
||||
{
|
||||
setTask(config.taskName(), config.amount());
|
||||
clientThread.invokeLater(() -> setTask(config.taskName(), config.amount()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,7 +311,7 @@ public class SlayerPlugin extends Plugin
|
||||
|
||||
if (config.showInfobox())
|
||||
{
|
||||
addCounter();
|
||||
clientThread.invokeLater(this::addCounter);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -480,6 +480,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Override
|
||||
public SpritePixels createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale)
|
||||
{
|
||||
assert isClientThread();
|
||||
int zoom = get3dZoom();
|
||||
set3dZoom(scale);
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user