Merge remote-tracking branch 'upstream/master' into master
This commit is contained in:
@@ -37,7 +37,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Named;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.EnumComposition;
|
||||
import net.runelite.api.Friend;
|
||||
@@ -144,6 +143,7 @@ import net.runelite.rs.api.RSUsername;
|
||||
import net.runelite.rs.api.RSWidget;
|
||||
import net.runelite.rs.api.RSWorld;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@Mixin(RSClient.class)
|
||||
public abstract class RSClientMixin implements RSClient
|
||||
@@ -151,6 +151,9 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Shadow("client")
|
||||
private static RSClient client;
|
||||
|
||||
@Inject
|
||||
public static Logger rl$logger = LoggerFactory.getLogger("injected-client");
|
||||
|
||||
@Inject
|
||||
@javax.inject.Inject
|
||||
private Callbacks callbacks;
|
||||
@@ -158,11 +161,6 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Inject
|
||||
private DrawCallbacks drawCallbacks;
|
||||
|
||||
@Inject
|
||||
@javax.inject.Inject
|
||||
@Named("Core Logger")
|
||||
private Logger logger;
|
||||
|
||||
@Inject
|
||||
private static int tickCount;
|
||||
|
||||
@@ -351,7 +349,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Override
|
||||
public Logger getLogger()
|
||||
{
|
||||
return logger;
|
||||
return rl$logger;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@@ -587,7 +585,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Override
|
||||
public void setGameState(GameState gameState)
|
||||
{
|
||||
assert this.isClientThread();
|
||||
assert this.isClientThread() : "setGameState must be called on client thread";
|
||||
setGameState(gameState.getState());
|
||||
}
|
||||
|
||||
@@ -714,7 +712,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
|
||||
if (skill == Skill.OVERALL)
|
||||
{
|
||||
logger.debug("getSkillExperience called for {}!", skill);
|
||||
rl$logger.debug("getSkillExperience called for {}!", skill);
|
||||
return (int) getOverallExperience();
|
||||
}
|
||||
|
||||
@@ -977,7 +975,8 @@ 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();
|
||||
assert isClientThread() : "createItemSprite must be called on client thread";
|
||||
|
||||
int zoom = get3dZoom();
|
||||
set3dZoom(scale);
|
||||
try
|
||||
@@ -1096,12 +1095,19 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Inject
|
||||
public static void gameStateChanged(int idx)
|
||||
{
|
||||
GameStateChanged gameStateChange = new GameStateChanged();
|
||||
GameState gameState = client.getGameState();
|
||||
client.getLogger().debug("Game state changed: {}", gameState);
|
||||
GameStateChanged gameStateChange = new GameStateChanged();
|
||||
gameStateChange.setGameState(gameState);
|
||||
client.getCallbacks().post(gameStateChange);
|
||||
|
||||
if (gameState == GameState.LOGGED_IN)
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int plane = client.getPlane();
|
||||
RSScene scene = client.getScene();
|
||||
RSTile[][][] tiles = scene.getTiles();
|
||||
@@ -1453,7 +1459,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Inject
|
||||
public void invokeMenuAction(String option, String target, int identifier, int opcode, int param0, int param1)
|
||||
{
|
||||
assert isClientThread();
|
||||
assert isClientThread() : "invokeMenuAction must be called on client thread";
|
||||
|
||||
client.sendMenuAction(param0, param1, opcode, identifier, option, target, 658, 384);
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
||||
@Override
|
||||
public int getParentId()
|
||||
{
|
||||
assert client.isClientThread();
|
||||
assert client.isClientThread() : "getParentId must be called on client thread";
|
||||
|
||||
int rsParentId = getRSParentId();
|
||||
if (rsParentId != -1)
|
||||
@@ -249,7 +249,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
||||
@Override
|
||||
public boolean isHidden()
|
||||
{
|
||||
assert client.isClientThread();
|
||||
assert client.isClientThread() : "isHidden must be called on client thread";
|
||||
|
||||
if (isSelfHidden())
|
||||
{
|
||||
@@ -415,7 +415,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
||||
@Override
|
||||
public Widget[] getNestedChildren()
|
||||
{
|
||||
assert client.isClientThread();
|
||||
assert client.isClientThread() : "getNestedChildren must be called on client thread";
|
||||
|
||||
if (getRSParentId() == getId())
|
||||
{
|
||||
@@ -480,7 +480,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
||||
@Override
|
||||
public Widget createChild(int index, int type)
|
||||
{
|
||||
assert client.isClientThread();
|
||||
assert client.isClientThread() : "createChild must be called on client thread";
|
||||
|
||||
RSWidget w = client.createWidget();
|
||||
w.setType(type);
|
||||
@@ -533,7 +533,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
||||
@Override
|
||||
public void revalidate()
|
||||
{
|
||||
assert client.isClientThread();
|
||||
assert client.isClientThread() : "revalidate must be called on client thread";
|
||||
|
||||
client.revalidateWidget(this);
|
||||
}
|
||||
@@ -542,7 +542,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
||||
@Override
|
||||
public void revalidateScroll()
|
||||
{
|
||||
assert client.isClientThread();
|
||||
assert client.isClientThread() : "revalidateScroll must be called on client thread";
|
||||
|
||||
client.revalidateWidget(this);
|
||||
client.revalidateWidgetScroll(client.getWidgets()[TO_GROUP(this.getId())], this, false);
|
||||
|
||||
@@ -77,7 +77,7 @@ public abstract class VarbitMixin implements RSClient
|
||||
@Override
|
||||
public int getVarbitValue(int[] varps, int varbitId)
|
||||
{
|
||||
assert client.isClientThread();
|
||||
assert client.isClientThread() : "getVarbitValue must be called on client thread";
|
||||
|
||||
RSVarbitComposition v = getVarbitComposition(varbitId);
|
||||
if (v == null)
|
||||
|
||||
Reference in New Issue
Block a user