Rework rx eventbus implementation
This commit is contained in:
@@ -188,7 +188,7 @@ public abstract class RSActorMixin implements RSActor
|
||||
{
|
||||
AnimationChanged animationChange = new AnimationChanged();
|
||||
animationChange.setActor(this);
|
||||
client.getCallbacks().post(animationChange);
|
||||
client.getCallbacks().post(AnimationChanged.class, animationChange);
|
||||
}
|
||||
|
||||
@FieldHook("spotAnimation")
|
||||
@@ -197,7 +197,7 @@ public abstract class RSActorMixin implements RSActor
|
||||
{
|
||||
SpotAnimationChanged spotAnimationChanged = new SpotAnimationChanged();
|
||||
spotAnimationChanged.setActor(this);
|
||||
client.getCallbacks().post(spotAnimationChanged);
|
||||
client.getCallbacks().post(SpotAnimationChanged.class, spotAnimationChanged);
|
||||
}
|
||||
|
||||
@FieldHook("targetIndex")
|
||||
@@ -205,7 +205,7 @@ public abstract class RSActorMixin implements RSActor
|
||||
public void interactingChanged(int idx)
|
||||
{
|
||||
InteractingChanged interactingChanged = new InteractingChanged(this, getInteracting());
|
||||
client.getCallbacks().post(interactingChanged);
|
||||
client.getCallbacks().post(InteractingChanged.class, interactingChanged);
|
||||
}
|
||||
|
||||
@FieldHook("overheadText")
|
||||
@@ -216,7 +216,7 @@ public abstract class RSActorMixin implements RSActor
|
||||
if (overheadText != null)
|
||||
{
|
||||
OverheadTextChanged overheadTextChanged = new OverheadTextChanged(this, overheadText);
|
||||
client.getCallbacks().post(overheadTextChanged);
|
||||
client.getCallbacks().post(OverheadTextChanged.class, overheadTextChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ public abstract class RSActorMixin implements RSActor
|
||||
client.getLogger().debug("You died!");
|
||||
|
||||
LocalPlayerDeath event = LocalPlayerDeath.INSTANCE;
|
||||
client.getCallbacks().post(event);
|
||||
client.getCallbacks().post(LocalPlayerDeath.class, event);
|
||||
}
|
||||
else if (this instanceof RSNPC)
|
||||
{
|
||||
@@ -281,6 +281,6 @@ public abstract class RSActorMixin implements RSActor
|
||||
final HitsplatApplied event = new HitsplatApplied();
|
||||
event.setActor(this);
|
||||
event.setHitsplat(hitsplat);
|
||||
client.getCallbacks().post(event);
|
||||
client.getCallbacks().post(HitsplatApplied.class, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public abstract class RSClanChatMixin implements RSClanChat
|
||||
}
|
||||
|
||||
ClanMemberJoined event = new ClanMemberJoined(member);
|
||||
client.getCallbacks().postDeferred(event);
|
||||
client.getCallbacks().postDeferred(ClanMemberJoined.class, event);
|
||||
}
|
||||
|
||||
@Inject
|
||||
@@ -42,6 +42,6 @@ public abstract class RSClanChatMixin implements RSClanChat
|
||||
}
|
||||
|
||||
ClanMemberLeft event = new ClanMemberLeft(member);
|
||||
client.getCallbacks().postDeferred(event);
|
||||
client.getCallbacks().postDeferred(ClanMemberLeft.class, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -698,7 +698,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
)
|
||||
);
|
||||
|
||||
client.getCallbacks().post(event);
|
||||
client.getCallbacks().post(MenuEntryAdded.class, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -909,7 +909,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
DraggingWidgetChanged draggingWidgetChanged = new DraggingWidgetChanged();
|
||||
draggingWidgetChanged.setDraggingWidget(client.isDraggingWidget());
|
||||
client.getCallbacks().post(draggingWidgetChanged);
|
||||
client.getCallbacks().post(DraggingWidgetChanged.class, draggingWidgetChanged);
|
||||
}
|
||||
|
||||
@Inject
|
||||
@@ -947,7 +947,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
WidgetLoaded event = new WidgetLoaded();
|
||||
event.setGroupId(groupId);
|
||||
client.getCallbacks().post(event);
|
||||
client.getCallbacks().post(WidgetLoaded.class, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -985,7 +985,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
Skill updatedSkill = possibleSkills[idx];
|
||||
experienceChanged.setSkill(updatedSkill);
|
||||
client.getCallbacks().post(experienceChanged);
|
||||
client.getCallbacks().post(ExperienceChanged.class, experienceChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1000,7 +1000,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
Skill updatedSkill = skills[idx];
|
||||
BoostedLevelChanged boostedLevelChanged = new BoostedLevelChanged();
|
||||
boostedLevelChanged.setSkill(updatedSkill);
|
||||
client.getCallbacks().post(boostedLevelChanged);
|
||||
client.getCallbacks().post(BoostedLevelChanged.class, boostedLevelChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1019,7 +1019,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
|
||||
PlayerMenuOptionsChanged optionsChanged = new PlayerMenuOptionsChanged();
|
||||
optionsChanged.setIndex(idx);
|
||||
client.getCallbacks().post(optionsChanged);
|
||||
client.getCallbacks().post(PlayerMenuOptionsChanged.class, optionsChanged);
|
||||
}
|
||||
|
||||
@FieldHook("gameState")
|
||||
@@ -1028,7 +1028,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
GameStateChanged gameStateChange = new GameStateChanged();
|
||||
gameStateChange.setGameState(client.getGameState());
|
||||
client.getCallbacks().post(gameStateChange);
|
||||
client.getCallbacks().post(GameStateChanged.class, gameStateChange);
|
||||
}
|
||||
|
||||
|
||||
@@ -1047,7 +1047,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
npc.setIndex(idx);
|
||||
|
||||
client.getCallbacks().postDeferred(new NpcSpawned(npc));
|
||||
client.getCallbacks().postDeferred(NpcSpawned.class, new NpcSpawned(npc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1067,11 +1067,11 @@ public abstract class RSClientMixin implements RSClient
|
||||
|
||||
if (oldPlayer != null)
|
||||
{
|
||||
client.getCallbacks().post(new PlayerDespawned(oldPlayer));
|
||||
client.getCallbacks().post(PlayerDespawned.class, new PlayerDespawned(oldPlayer));
|
||||
}
|
||||
if (player != null)
|
||||
{
|
||||
client.getCallbacks().postDeferred(new PlayerSpawned(player));
|
||||
client.getCallbacks().postDeferred(PlayerSpawned.class, new PlayerSpawned(player));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1094,7 +1094,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
GrandExchangeOfferChanged offerChangedEvent = new GrandExchangeOfferChanged();
|
||||
offerChangedEvent.setOffer(internalOffer);
|
||||
offerChangedEvent.setSlot(idx);
|
||||
client.getCallbacks().post(offerChangedEvent);
|
||||
client.getCallbacks().post(GrandExchangeOfferChanged.class, offerChangedEvent);
|
||||
}
|
||||
|
||||
@FieldHook("Varps_main")
|
||||
@@ -1103,7 +1103,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
VarbitChanged varbitChanged = new VarbitChanged();
|
||||
varbitChanged.setIndex(idx);
|
||||
client.getCallbacks().post(varbitChanged);
|
||||
client.getCallbacks().post(VarbitChanged.class, varbitChanged);
|
||||
}
|
||||
|
||||
@FieldHook("isResizable")
|
||||
@@ -1117,7 +1117,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
ResizeableChanged resizeableChanged = new ResizeableChanged();
|
||||
resizeableChanged.setResized(isResized);
|
||||
client.getCallbacks().post(resizeableChanged);
|
||||
client.getCallbacks().post(ResizeableChanged.class, resizeableChanged);
|
||||
|
||||
oldIsResized = isResized;
|
||||
}
|
||||
@@ -1127,21 +1127,21 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Inject
|
||||
public static void clanMemberManagerChanged(int idx)
|
||||
{
|
||||
client.getCallbacks().post(new ClanChanged(client.getClanMemberManager() != null));
|
||||
client.getCallbacks().post(ClanChanged.class, new ClanChanged(client.getClanMemberManager() != null));
|
||||
}
|
||||
|
||||
@FieldHook("canvasWidth")
|
||||
@Inject
|
||||
public static void canvasWidthChanged(int idx)
|
||||
{
|
||||
client.getCallbacks().post(CanvasSizeChanged.INSTANCE);
|
||||
client.getCallbacks().post(CanvasSizeChanged.class, CanvasSizeChanged.INSTANCE);
|
||||
}
|
||||
|
||||
@FieldHook("canvasHeight")
|
||||
@Inject
|
||||
public static void canvasHeightChanged(int idx)
|
||||
{
|
||||
client.getCallbacks().post(CanvasSizeChanged.INSTANCE);
|
||||
client.getCallbacks().post(CanvasSizeChanged.class, CanvasSizeChanged.INSTANCE);
|
||||
}
|
||||
|
||||
@Inject
|
||||
@@ -1305,7 +1305,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
authentic
|
||||
);
|
||||
|
||||
client.getCallbacks().post(menuOptionClicked);
|
||||
client.getCallbacks().post(MenuOptionClicked.class, menuOptionClicked);
|
||||
|
||||
if (menuOptionClicked.isConsumed())
|
||||
{
|
||||
@@ -1329,7 +1329,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
if (client.getTempMenuAction() != null)
|
||||
{
|
||||
client.getCallbacks().post(WidgetPressed.INSTANCE);
|
||||
client.getCallbacks().post(WidgetPressed.class, WidgetPressed.INSTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1337,7 +1337,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Inject
|
||||
public static void onUsernameChanged(int idx)
|
||||
{
|
||||
client.getCallbacks().post(UsernameChanged.INSTANCE);
|
||||
client.getCallbacks().post(UsernameChanged.class, UsernameChanged.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1368,7 +1368,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
final MenuOpened event = new MenuOpened();
|
||||
event.setMenuEntries(getMenuEntries());
|
||||
callbacks.post(event);
|
||||
callbacks.post(MenuOpened.class, event);
|
||||
}
|
||||
|
||||
@Inject
|
||||
@@ -1395,7 +1395,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
|
||||
final ChatMessageType chatMessageType = ChatMessageType.of(type);
|
||||
final ChatMessage chatMessage = new ChatMessage(messageNode, chatMessageType, name, message, sender, messageNode.getTimestamp());
|
||||
client.getCallbacks().post(chatMessage);
|
||||
client.getCallbacks().post(ChatMessage.class, chatMessage);
|
||||
}
|
||||
|
||||
@Inject
|
||||
@@ -1579,7 +1579,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
@FieldHook("cycleCntr")
|
||||
public static void onCycleCntrChanged(int idx)
|
||||
{
|
||||
client.getCallbacks().post(ClientTick.INSTANCE);
|
||||
client.getCallbacks().post(ClientTick.class, ClientTick.INSTANCE);
|
||||
}
|
||||
|
||||
@Copy("shouldLeftClickOpenMenu")
|
||||
@@ -1597,7 +1597,7 @@ public abstract class RSClientMixin implements RSClient
|
||||
}
|
||||
|
||||
MenuShouldLeftClick menuShouldLeftClick = new MenuShouldLeftClick();
|
||||
client.getCallbacks().post(menuShouldLeftClick);
|
||||
client.getCallbacks().post(MenuShouldLeftClick.class, menuShouldLeftClick);
|
||||
|
||||
if (menuShouldLeftClick.isForceRightClick())
|
||||
{
|
||||
|
||||
@@ -96,7 +96,7 @@ public abstract class RSDynamicObjectMixin implements RSDynamicObject
|
||||
DynamicObjectAnimationChanged dynamicObjectAnimationChanged = new DynamicObjectAnimationChanged();
|
||||
dynamicObjectAnimationChanged.setObject(id);
|
||||
dynamicObjectAnimationChanged.setAnimation(animationID);
|
||||
client.getCallbacks().post(dynamicObjectAnimationChanged);
|
||||
client.getCallbacks().post(DynamicObjectAnimationChanged.class, dynamicObjectAnimationChanged);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public abstract class RSFriendSystemMixin implements RSFriendSystem
|
||||
public void rl$removeFriend(String friendName)
|
||||
{
|
||||
FriendRemoved friendRemoved = new FriendRemoved(friendName);
|
||||
client.getCallbacks().post(friendRemoved);
|
||||
client.getCallbacks().post(FriendRemoved.class, friendRemoved);
|
||||
}
|
||||
|
||||
@MethodHook("addFriend")
|
||||
@@ -28,6 +28,6 @@ public abstract class RSFriendSystemMixin implements RSFriendSystem
|
||||
public void rl$addFriend(String friendName)
|
||||
{
|
||||
FriendAdded friendAdded = new FriendAdded(friendName);
|
||||
client.getCallbacks().post(friendAdded);
|
||||
client.getCallbacks().post(FriendAdded.class, friendAdded);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public abstract class RSGameShellMixin implements RSGameShell
|
||||
{
|
||||
final FocusChanged focusChanged = new FocusChanged();
|
||||
focusChanged.setFocused(true);
|
||||
client.getCallbacks().post(focusChanged);
|
||||
client.getCallbacks().post(FocusChanged.class, focusChanged);
|
||||
}
|
||||
|
||||
@Inject
|
||||
|
||||
@@ -18,7 +18,7 @@ public abstract class RSGraphicsObjectMixin implements RSGraphicsObject
|
||||
RSGraphicsObjectMixin()
|
||||
{
|
||||
final GraphicsObjectCreated event = new GraphicsObjectCreated(this);
|
||||
client.getCallbacks().post(event);
|
||||
client.getCallbacks().post(GraphicsObjectCreated.class, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -67,7 +67,7 @@ public abstract class RSGroundItemMixin implements RSGroundItem
|
||||
client.getLogger().debug("Item quantity changed: {} ({} -> {})", getId(), getQuantity(), quantity);
|
||||
|
||||
ItemQuantityChanged itemQuantityChanged = new ItemQuantityChanged(this, getTile(), getQuantity(), quantity);
|
||||
client.getCallbacks().post(itemQuantityChanged);
|
||||
client.getCallbacks().post(ItemQuantityChanged.class, itemQuantityChanged);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,6 @@ public abstract class RSHealthBarDefinitionMixin implements RSHealthBarDefinitio
|
||||
{
|
||||
PostHealthBar postHealthBar = new PostHealthBar();
|
||||
postHealthBar.setHealthBar(this);
|
||||
client.getCallbacks().post(postHealthBar);
|
||||
client.getCallbacks().post(PostHealthBar.class, postHealthBar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +97,6 @@ public abstract class RSItemContainerMixin implements RSItemContainer
|
||||
rl$lastContainer = itemContainerId;
|
||||
|
||||
ItemContainerChanged event = new ItemContainerChanged(itemContainerId, client.getItemContainer(container));
|
||||
client.getCallbacks().postDeferred(event);
|
||||
client.getCallbacks().postDeferred(ItemContainerChanged.class, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,6 @@ public abstract class RSItemDefinitionMixin implements RSItemDefinition
|
||||
{
|
||||
final PostItemDefinition event = new PostItemDefinition();
|
||||
event.setItemDefinition(this);
|
||||
client.getCallbacks().post(event);
|
||||
client.getCallbacks().post(PostItemDefinition.class, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,6 @@ public abstract class RSKeyHandlerMixin implements RSKeyHandler
|
||||
{
|
||||
final FocusChanged focusChanged = new FocusChanged();
|
||||
focusChanged.setFocused(false);
|
||||
client.getCallbacks().post(focusChanged);
|
||||
client.getCallbacks().post(FocusChanged.class, focusChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,6 @@ public abstract class RSNPCDefinitionMixin implements RSNPCDefinition
|
||||
NpcActionChanged npcActionChanged = new NpcActionChanged();
|
||||
npcActionChanged.setNpcDefinition(this);
|
||||
npcActionChanged.setIdx(idx);
|
||||
client.getCallbacks().post(npcActionChanged);
|
||||
client.getCallbacks().post(NpcActionChanged.class, npcActionChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,11 +110,11 @@ public abstract class RSNPCMixin implements RSNPC
|
||||
{
|
||||
if (composition == null)
|
||||
{
|
||||
client.getCallbacks().post(new NpcDespawned(this));
|
||||
client.getCallbacks().post(NpcDespawned.class, new NpcDespawned(this));
|
||||
}
|
||||
else if (this.getId() != -1)
|
||||
{
|
||||
client.getCallbacks().post(new NpcDefinitionChanged(this));
|
||||
client.getCallbacks().post(NpcDefinitionChanged.class, new NpcDefinitionChanged(this));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class RSProjectileMixin implements RSProjectile
|
||||
{
|
||||
final ProjectileSpawned projectileSpawned = new ProjectileSpawned();
|
||||
projectileSpawned.setProjectile(this);
|
||||
client.getCallbacks().post(projectileSpawned);
|
||||
client.getCallbacks().post(ProjectileSpawned.class, projectileSpawned);
|
||||
}
|
||||
|
||||
@Inject
|
||||
@@ -109,6 +109,6 @@ public abstract class RSProjectileMixin implements RSProjectile
|
||||
projectileMoved.setProjectile(this);
|
||||
projectileMoved.setPosition(position);
|
||||
projectileMoved.setZ(targetZ);
|
||||
client.getCallbacks().post(projectileMoved);
|
||||
client.getCallbacks().post(ProjectileMoved.class, projectileMoved);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,14 +129,14 @@ public abstract class RSTileMixin implements RSTile
|
||||
WallObjectDespawned wallObjectDespawned = new WallObjectDespawned();
|
||||
wallObjectDespawned.setTile(this);
|
||||
wallObjectDespawned.setWallObject(previous);
|
||||
client.getCallbacks().post(wallObjectDespawned);
|
||||
client.getCallbacks().post(WallObjectDespawned.class, wallObjectDespawned);
|
||||
}
|
||||
else if (current != null && previous == null)
|
||||
{
|
||||
WallObjectSpawned wallObjectSpawned = new WallObjectSpawned();
|
||||
wallObjectSpawned.setTile(this);
|
||||
wallObjectSpawned.setWallObject(current);
|
||||
client.getCallbacks().post(wallObjectSpawned);
|
||||
client.getCallbacks().post(WallObjectSpawned.class, wallObjectSpawned);
|
||||
}
|
||||
else if (current != null)
|
||||
{
|
||||
@@ -144,7 +144,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
wallObjectChanged.setTile(this);
|
||||
wallObjectChanged.setPrevious(previous);
|
||||
wallObjectChanged.setWallObject(current);
|
||||
client.getCallbacks().post(wallObjectChanged);
|
||||
client.getCallbacks().post(WallObjectChanged.class, wallObjectChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,14 +162,14 @@ public abstract class RSTileMixin implements RSTile
|
||||
DecorativeObjectDespawned decorativeObjectDespawned = new DecorativeObjectDespawned();
|
||||
decorativeObjectDespawned.setTile(this);
|
||||
decorativeObjectDespawned.setDecorativeObject(previous);
|
||||
client.getCallbacks().post(decorativeObjectDespawned);
|
||||
client.getCallbacks().post(DecorativeObjectDespawned.class, decorativeObjectDespawned);
|
||||
}
|
||||
else if (current != null && previous == null)
|
||||
{
|
||||
DecorativeObjectSpawned decorativeObjectSpawned = new DecorativeObjectSpawned();
|
||||
decorativeObjectSpawned.setTile(this);
|
||||
decorativeObjectSpawned.setDecorativeObject(current);
|
||||
client.getCallbacks().post(decorativeObjectSpawned);
|
||||
client.getCallbacks().post(DecorativeObjectSpawned.class, decorativeObjectSpawned);
|
||||
}
|
||||
else if (current != null)
|
||||
{
|
||||
@@ -177,7 +177,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
decorativeObjectChanged.setTile(this);
|
||||
decorativeObjectChanged.setPrevious(previous);
|
||||
decorativeObjectChanged.setDecorativeObject(current);
|
||||
client.getCallbacks().post(decorativeObjectChanged);
|
||||
client.getCallbacks().post(DecorativeObjectChanged.class, decorativeObjectChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,14 +195,14 @@ public abstract class RSTileMixin implements RSTile
|
||||
GroundObjectDespawned groundObjectDespawned = new GroundObjectDespawned();
|
||||
groundObjectDespawned.setTile(this);
|
||||
groundObjectDespawned.setGroundObject(previous);
|
||||
client.getCallbacks().post(groundObjectDespawned);
|
||||
client.getCallbacks().post(GroundObjectDespawned.class, groundObjectDespawned);
|
||||
}
|
||||
else if (current != null && previous == null)
|
||||
{
|
||||
GroundObjectSpawned groundObjectSpawned = new GroundObjectSpawned();
|
||||
groundObjectSpawned.setTile(this);
|
||||
groundObjectSpawned.setGroundObject(current);
|
||||
client.getCallbacks().post(groundObjectSpawned);
|
||||
client.getCallbacks().post(GroundObjectSpawned.class, groundObjectSpawned);
|
||||
}
|
||||
else if (current != null)
|
||||
{
|
||||
@@ -210,7 +210,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
groundObjectChanged.setTile(this);
|
||||
groundObjectChanged.setPrevious(previous);
|
||||
groundObjectChanged.setGroundObject(current);
|
||||
client.getCallbacks().post(groundObjectChanged);
|
||||
client.getCallbacks().post(GroundObjectChanged.class, groundObjectChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
GameObjectDespawned gameObjectDespawned = new GameObjectDespawned();
|
||||
gameObjectDespawned.setTile(this);
|
||||
gameObjectDespawned.setGameObject(previous);
|
||||
client.getCallbacks().post(gameObjectDespawned);
|
||||
client.getCallbacks().post(GameObjectDespawned.class, gameObjectDespawned);
|
||||
}
|
||||
else if (previous == null)
|
||||
{
|
||||
@@ -299,7 +299,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
GameObjectSpawned gameObjectSpawned = new GameObjectSpawned();
|
||||
gameObjectSpawned.setTile(this);
|
||||
gameObjectSpawned.setGameObject(current);
|
||||
client.getCallbacks().post(gameObjectSpawned);
|
||||
client.getCallbacks().post(GameObjectSpawned.class, gameObjectSpawned);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -314,7 +314,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
gameObjectsChanged.setTile(this);
|
||||
gameObjectsChanged.setPrevious(previous);
|
||||
gameObjectsChanged.setGameObject(current);
|
||||
client.getCallbacks().post(gameObjectsChanged);
|
||||
client.getCallbacks().post(GameObjectChanged.class, gameObjectsChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
{
|
||||
RSGroundItem item = (RSGroundItem) cur;
|
||||
ItemDespawned itemDespawned = new ItemDespawned(this, item);
|
||||
client.getCallbacks().post(itemDespawned);
|
||||
client.getCallbacks().post(ItemDespawned.class, itemDespawned);
|
||||
}
|
||||
}
|
||||
lastGroundItems[z][x][y] = newQueue;
|
||||
@@ -358,7 +358,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
if (lastUnlink != null)
|
||||
{
|
||||
ItemDespawned itemDespawned = new ItemDespawned(this, lastUnlink);
|
||||
client.getCallbacks().post(itemDespawned);
|
||||
client.getCallbacks().post(ItemDespawned.class, itemDespawned);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -370,7 +370,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
if (lastUnlink != null)
|
||||
{
|
||||
ItemDespawned itemDespawned = new ItemDespawned(this, lastUnlink);
|
||||
client.getCallbacks().post(itemDespawned);
|
||||
client.getCallbacks().post(ItemDespawned.class, itemDespawned);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -403,7 +403,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
if (lastUnlink != null && lastUnlink != previous && lastUnlink != next)
|
||||
{
|
||||
ItemDespawned itemDespawned = new ItemDespawned(this, lastUnlink);
|
||||
client.getCallbacks().post(itemDespawned);
|
||||
client.getCallbacks().post(ItemDespawned.class, itemDespawned);
|
||||
}
|
||||
|
||||
if (current == null)
|
||||
@@ -418,7 +418,7 @@ public abstract class RSTileMixin implements RSTile
|
||||
item.setY(y);
|
||||
|
||||
ItemSpawned itemSpawned = new ItemSpawned(this, item);
|
||||
client.getCallbacks().post(itemSpawned);
|
||||
client.getCallbacks().post(ItemSpawned.class, itemSpawned);
|
||||
|
||||
current = forward ? current.getNext() : current.getPrevious();
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ public abstract class RSVarcsMixin implements RSVarcs
|
||||
@Inject
|
||||
public void onVarCIntChanged(int id, int value)
|
||||
{
|
||||
client.getCallbacks().post(new VarClientIntChanged(id));
|
||||
client.getCallbacks().post(VarClientIntChanged.class, new VarClientIntChanged(id));
|
||||
}
|
||||
|
||||
@MethodHook(value = "setString", end = true)
|
||||
@Inject
|
||||
public void onVarCStrChanged(int id, String value)
|
||||
{
|
||||
client.getCallbacks().post(new VarClientStrChanged(id));
|
||||
client.getCallbacks().post(VarClientStrChanged.class, new VarClientStrChanged(id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
||||
event.setWidget(this);
|
||||
event.setHidden(hidden);
|
||||
|
||||
client.getCallbacks().post(event);
|
||||
client.getCallbacks().post(WidgetHiddenChanged.class, event);
|
||||
|
||||
RSWidget[] children = getChildren();
|
||||
|
||||
@@ -502,7 +502,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
||||
client.getLogger().trace("Posting widget position changed");
|
||||
|
||||
WidgetPositioned widgetPositioned = WidgetPositioned.INSTANCE;
|
||||
client.getCallbacks().postDeferred(widgetPositioned);
|
||||
client.getCallbacks().postDeferred(WidgetPositioned.class, widgetPositioned);
|
||||
}
|
||||
|
||||
@Inject
|
||||
|
||||
@@ -63,7 +63,7 @@ public abstract class RSWorldMixin implements RSWorld
|
||||
{
|
||||
// this is the last world in the list.
|
||||
WorldListLoad worldLoad = new WorldListLoad(worlds);
|
||||
client.getCallbacks().post(worldLoad);
|
||||
client.getCallbacks().post(WorldListLoad.class, worldLoad);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public abstract class ScriptVMMixin implements RSClient
|
||||
ScriptCallbackEvent event = new ScriptCallbackEvent();
|
||||
event.setScript(currentScript);
|
||||
event.setEventName(stringOp);
|
||||
client.getCallbacks().post(event);
|
||||
client.getCallbacks().post(ScriptCallbackEvent.class, event);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -123,7 +123,7 @@ public abstract class SoundEffectMixin implements RSClient
|
||||
SoundEffectPlayed event = new SoundEffectPlayed();
|
||||
event.setSoundId(client.getQueuedSoundEffectIDs()[soundIndex]);
|
||||
event.setDelay(client.getQueuedSoundEffectDelays()[soundIndex]);
|
||||
client.getCallbacks().post(event);
|
||||
client.getCallbacks().post(SoundEffectPlayed.class, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -139,7 +139,7 @@ public abstract class SoundEffectMixin implements RSClient
|
||||
event.setSceneY(y);
|
||||
event.setRange(range);
|
||||
event.setDelay(client.getQueuedSoundEffectDelays()[soundIndex]);
|
||||
client.getCallbacks().post(event);
|
||||
client.getCallbacks().post(AreaSoundEffectPlayed.class, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user