Fix up client. (#815)
* Aoe Warnings Fix-Up * Freeze Timers NPE Fix * Slayer Chat Lookup NPE && Fixing up Access levels. * Raids Thieving NPE Fix && Fixing up Access levels. * Revert "Fix copy paste error" This reverts commit 26c88101b682eb76b98a8a0d88fc8a47c9f104d3. * Revert "Fix checkstyle" This reverts commit abf7fec004148897585bc0389bb5e0420e3d03cb. * Revert "Convert game thread events to singletons" This reverts commit b33048d7ee0481b17c5849d2d862e75c91e5a36c. * Various Fixes
This commit is contained in:
@@ -87,6 +87,9 @@ public class Hooks implements Callbacks
|
||||
private static final OverlayRenderer renderer = injector.getInstance(OverlayRenderer.class);
|
||||
private static final OverlayManager overlayManager = injector.getInstance(OverlayManager.class);
|
||||
|
||||
private static final GameTick GAME_TICK = new GameTick();
|
||||
private static final BeforeRender BEFORE_RENDER = new BeforeRender();
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@@ -148,13 +151,13 @@ public class Hooks implements Callbacks
|
||||
|
||||
deferredEventBus.replay();
|
||||
|
||||
eventBus.post(GameTick.INSTANCE);
|
||||
eventBus.post(GAME_TICK);
|
||||
|
||||
int tick = client.getTickCount();
|
||||
client.setTickCount(tick + 1);
|
||||
}
|
||||
|
||||
eventBus.post(BeforeRender.INSTANCE);
|
||||
eventBus.post(BEFORE_RENDER);
|
||||
|
||||
clientThread.invoke();
|
||||
|
||||
@@ -508,7 +511,7 @@ public class Hooks implements Callbacks
|
||||
|
||||
public static boolean drawMenu()
|
||||
{
|
||||
BeforeMenuRender event = BeforeMenuRender.INSTANCE;
|
||||
BeforeMenuRender event = new BeforeMenuRender();
|
||||
client.getCallbacks().post(event);
|
||||
return event.isConsumed();
|
||||
}
|
||||
|
||||
@@ -114,9 +114,7 @@ public class CommandManager
|
||||
String command = split[0];
|
||||
String[] args = Arrays.copyOfRange(split, 1, split.length);
|
||||
|
||||
CommandExecuted commandExecuted = CommandExecuted.INSTANCE;
|
||||
commandExecuted.setCommand(command);
|
||||
commandExecuted.setArguments(args);
|
||||
CommandExecuted commandExecuted = new CommandExecuted(command, args);
|
||||
eventBus.post(commandExecuted);
|
||||
}
|
||||
|
||||
|
||||
@@ -429,7 +429,7 @@ public class MenuManager
|
||||
if (curMenuOption.getMenuTarget().equals(event.getTarget())
|
||||
&& curMenuOption.getMenuOption().equals(event.getOption()))
|
||||
{
|
||||
WidgetMenuOptionClicked customMenu = WidgetMenuOptionClicked.INSTANCE;
|
||||
WidgetMenuOptionClicked customMenu = new WidgetMenuOptionClicked();
|
||||
customMenu.setMenuOption(event.getOption());
|
||||
customMenu.setMenuTarget(event.getTarget());
|
||||
customMenu.setWidget(curMenuOption.getWidget());
|
||||
@@ -444,7 +444,7 @@ public class MenuManager
|
||||
// <col=ffffff>username<col=40ff00> (level-42) or <col=ffffff><img=2>username</col>
|
||||
String username = Text.removeTags(target).split("[(]")[0].trim();
|
||||
|
||||
PlayerMenuOptionClicked playerMenuOptionClicked = PlayerMenuOptionClicked.INSTANCE;
|
||||
PlayerMenuOptionClicked playerMenuOptionClicked = new PlayerMenuOptionClicked();
|
||||
playerMenuOptionClicked.setMenuOption(event.getOption());
|
||||
playerMenuOptionClicked.setMenuTarget(username);
|
||||
|
||||
|
||||
@@ -27,10 +27,8 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.aoewarnings;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Rectangle;
|
||||
@@ -38,13 +36,11 @@ import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Projectile;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
@@ -62,7 +58,7 @@ public class AoeWarningOverlay extends Overlay
|
||||
private final AoeWarningConfig config;
|
||||
|
||||
@Inject
|
||||
public AoeWarningOverlay(@Nullable Client client, AoeWarningPlugin plugin, AoeWarningConfig config)
|
||||
public AoeWarningOverlay(Client client, AoeWarningPlugin plugin, AoeWarningConfig config)
|
||||
{
|
||||
setPosition(OverlayPosition.DYNAMIC);
|
||||
setLayer(OverlayLayer.UNDER_WIDGETS);
|
||||
@@ -74,24 +70,25 @@ public class AoeWarningOverlay extends Overlay
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
WorldPoint lp = client.getLocalPlayer().getWorldLocation();
|
||||
for (WorldPoint point : plugin.getLightningTrail())
|
||||
{
|
||||
drawTile(graphics, point, new Color(0, 150, 200), 2, 150, 50);
|
||||
OverlayUtil.drawTile(graphics, client, point, lp, new Color(0, 150, 200), 2, 150, 50);
|
||||
}
|
||||
|
||||
for (WorldPoint point : plugin.getAcidTrail())
|
||||
{
|
||||
drawTile(graphics, point, new Color(69, 241, 44), 2, 150, 50);
|
||||
OverlayUtil.drawTile(graphics, client, point, lp, new Color(69, 241, 44), 2, 150, 50);
|
||||
}
|
||||
|
||||
for (WorldPoint point : plugin.getCrystalSpike())
|
||||
{
|
||||
drawTile(graphics, point, new Color(255, 0, 84), 2, 150, 50);
|
||||
OverlayUtil.drawTile(graphics, client, point, lp, new Color(255, 0, 84), 2, 150, 50);
|
||||
}
|
||||
|
||||
for (WorldPoint point : plugin.getWintertodtSnowFall())
|
||||
{
|
||||
drawTile(graphics, point, new Color(255, 0, 84), 2, 150, 50);
|
||||
OverlayUtil.drawTile(graphics, client, point, lp, new Color(255, 0, 84), 2, 150, 50);
|
||||
}
|
||||
|
||||
Instant now = Instant.now();
|
||||
@@ -164,7 +161,8 @@ public class AoeWarningOverlay extends Overlay
|
||||
{
|
||||
if (tickProgress >= 0)
|
||||
{
|
||||
renderTextLocation(graphics, Integer.toString(tickProgress), config.textSize(), config.fontStyle().getFont(), color, centerPoint(tilePoly.getBounds()));
|
||||
OverlayUtil.renderTextLocation(graphics, Integer.toString(tickProgress), plugin.getTextSize(),
|
||||
plugin.getFontStyle(), color, centerPoint(tilePoly.getBounds()), plugin.isShadows(), 0);
|
||||
}
|
||||
}
|
||||
graphics.setColor(new Color(setAlphaComponent(config.overlayColor().getRGB(), fillAlpha), true));
|
||||
@@ -173,50 +171,6 @@ public class AoeWarningOverlay extends Overlay
|
||||
return null;
|
||||
}
|
||||
|
||||
private void drawTile(Graphics2D graphics, WorldPoint point, Color color, int strokeWidth, int outlineAlpha, int fillAlpha)
|
||||
{
|
||||
WorldPoint playerLocation = client.getLocalPlayer().getWorldLocation();
|
||||
if (point.distanceTo(playerLocation) >= 32)
|
||||
{
|
||||
return;
|
||||
}
|
||||
LocalPoint lp = LocalPoint.fromWorld(client, point);
|
||||
if (lp == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Polygon poly = Perspective.getCanvasTilePoly(client, lp);
|
||||
if (poly == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), outlineAlpha));
|
||||
graphics.setStroke(new BasicStroke(strokeWidth));
|
||||
graphics.draw(poly);
|
||||
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), fillAlpha));
|
||||
graphics.fill(poly);
|
||||
}
|
||||
|
||||
private void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint)
|
||||
{
|
||||
graphics.setFont(new Font("Arial", fontStyle, fontSize));
|
||||
if (canvasPoint != null)
|
||||
{
|
||||
final Point canvasCenterPoint = new Point(
|
||||
canvasPoint.getX(),
|
||||
canvasPoint.getY());
|
||||
final Point canvasCenterPoint_shadow = new Point(
|
||||
canvasPoint.getX() + 1,
|
||||
canvasPoint.getY() + 1);
|
||||
if (config.shadows())
|
||||
{
|
||||
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint_shadow, txtString, Color.BLACK);
|
||||
}
|
||||
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint, txtString, fontColor);
|
||||
}
|
||||
}
|
||||
|
||||
private Point centerPoint(Rectangle rect)
|
||||
{
|
||||
int x = (int) (rect.getX() + rect.getWidth() / 2);
|
||||
|
||||
@@ -41,6 +41,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameObject;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.GraphicID;
|
||||
import net.runelite.api.GraphicsObject;
|
||||
import net.runelite.api.NullObjectID;
|
||||
import net.runelite.api.ObjectID;
|
||||
@@ -48,6 +49,7 @@ import net.runelite.api.Projectile;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameObjectDespawned;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
@@ -72,40 +74,35 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@Slf4j
|
||||
public class AoeWarningPlugin extends Plugin
|
||||
{
|
||||
|
||||
@Getter
|
||||
private final Map<WorldPoint, CrystalBomb> bombs = new HashMap<>();
|
||||
private final Map<Projectile, AoeProjectile> projectiles = new HashMap<>();
|
||||
|
||||
@Inject
|
||||
public AoeWarningConfig config;
|
||||
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private AoeWarningOverlay coreOverlay;
|
||||
|
||||
@Inject
|
||||
private BombOverlay bombOverlay;
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private List<WorldPoint> LightningTrail = new ArrayList<>();
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private List<WorldPoint> AcidTrail = new ArrayList<>();
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private List<WorldPoint> CrystalSpike = new ArrayList<>();
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private List<WorldPoint> WintertodtSnowFall = new ArrayList<>();
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean shadows;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int textSize;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int fontStyle;
|
||||
|
||||
@Provides
|
||||
AoeWarningConfig getConfig(ConfigManager configManager)
|
||||
@@ -123,10 +120,7 @@ public class AoeWarningPlugin extends Plugin
|
||||
{
|
||||
overlayManager.add(coreOverlay);
|
||||
overlayManager.add(bombOverlay);
|
||||
LightningTrail.clear();
|
||||
AcidTrail.clear();
|
||||
CrystalSpike.clear();
|
||||
WintertodtSnowFall.clear();
|
||||
reset(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,10 +128,29 @@ public class AoeWarningPlugin extends Plugin
|
||||
{
|
||||
overlayManager.remove(coreOverlay);
|
||||
overlayManager.remove(bombOverlay);
|
||||
LightningTrail.clear();
|
||||
AcidTrail.clear();
|
||||
CrystalSpike.clear();
|
||||
WintertodtSnowFall.clear();
|
||||
reset(false);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("aoe"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (event.getKey())
|
||||
{
|
||||
case "fontStyle":
|
||||
fontStyle = config.fontStyle().getFont();
|
||||
break;
|
||||
case "textSize":
|
||||
textSize = config.textSize();
|
||||
break;
|
||||
case "shadows":
|
||||
shadows = config.shadows();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -172,12 +185,12 @@ public class AoeWarningPlugin extends Plugin
|
||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||
{
|
||||
final GameObject gameObject = event.getGameObject();
|
||||
final WorldPoint bombLocation = gameObject.getWorldLocation();
|
||||
final WorldPoint wp = gameObject.getWorldLocation();
|
||||
|
||||
switch (gameObject.getId())
|
||||
{
|
||||
case ObjectID.CRYSTAL_BOMB:
|
||||
bombs.put(bombLocation, new CrystalBomb(gameObject, client.getTickCount()));
|
||||
bombs.put(wp, new CrystalBomb(gameObject, client.getTickCount()));
|
||||
|
||||
if (config.aoeNotifyAll() || config.bombDisplayNotifyEnabled())
|
||||
{
|
||||
@@ -185,17 +198,16 @@ public class AoeWarningPlugin extends Plugin
|
||||
}
|
||||
break;
|
||||
case ObjectID.ACID_POOL:
|
||||
AcidTrail.add(bombLocation);
|
||||
AcidTrail.add(wp);
|
||||
break;
|
||||
case ObjectID.SMALL_CRYSTALS:
|
||||
//todo
|
||||
CrystalSpike.add(bombLocation);
|
||||
CrystalSpike.add(wp);
|
||||
break;
|
||||
case NullObjectID.NULL_26690:
|
||||
//Wintertodt Snowfall
|
||||
if (config.isWintertodtEnabled())
|
||||
{
|
||||
WintertodtSnowFall.add(bombLocation);
|
||||
WintertodtSnowFall.add(wp);
|
||||
|
||||
if (config.aoeNotifyAll() || config.isWintertodtNotifyEnabled())
|
||||
{
|
||||
@@ -210,25 +222,23 @@ public class AoeWarningPlugin extends Plugin
|
||||
public void onGameObjectDespawned(GameObjectDespawned event)
|
||||
{
|
||||
GameObject gameObject = event.getGameObject();
|
||||
WorldPoint bombLocation = gameObject.getWorldLocation();
|
||||
WorldPoint wp = gameObject.getWorldLocation();
|
||||
switch (gameObject.getId())
|
||||
{
|
||||
case ObjectID.CRYSTAL_BOMB:
|
||||
//might as well check the ObjectID to save some time.
|
||||
purgeBombs(bombs);
|
||||
break;
|
||||
case ObjectID.ACID_POOL:
|
||||
AcidTrail.remove(bombLocation);
|
||||
AcidTrail.remove(wp);
|
||||
break;
|
||||
case ObjectID.SMALL_CRYSTALS:
|
||||
//todo
|
||||
CrystalSpike.remove(bombLocation);
|
||||
CrystalSpike.remove(wp);
|
||||
break;
|
||||
case NullObjectID.NULL_26690:
|
||||
//Wintertodt Snowfall
|
||||
if (config.isWintertodtEnabled())
|
||||
{
|
||||
WintertodtSnowFall.remove(bombLocation);
|
||||
WintertodtSnowFall.remove(wp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -251,7 +261,7 @@ public class AoeWarningPlugin extends Plugin
|
||||
LightningTrail.clear();
|
||||
for (GraphicsObject o : client.getGraphicsObjects())
|
||||
{
|
||||
if (o.getId() == 1356)
|
||||
if (o.getId() == GraphicID.OLM_LIGHTNING)
|
||||
{
|
||||
LightningTrail.add(WorldPoint.fromLocal(client, o.getLocation()));
|
||||
|
||||
@@ -281,6 +291,12 @@ public class AoeWarningPlugin extends Plugin
|
||||
Map.Entry<WorldPoint, CrystalBomb> entry = it.next();
|
||||
WorldPoint world = entry.getKey();
|
||||
LocalPoint local = LocalPoint.fromWorld(client, world);
|
||||
|
||||
if (local == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Tile tile = tiles[world.getPlane()][local.getSceneX()][local.getSceneY()];
|
||||
GameObject[] objects = tile.getGameObjects();
|
||||
boolean containsObjects = false;
|
||||
@@ -391,4 +407,20 @@ public class AoeWarningPlugin extends Plugin
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void reset(boolean setConfig)
|
||||
{
|
||||
LightningTrail.clear();
|
||||
AcidTrail.clear();
|
||||
CrystalSpike.clear();
|
||||
WintertodtSnowFall.clear();
|
||||
bombs.clear();
|
||||
projectiles.clear();
|
||||
if (setConfig)
|
||||
{
|
||||
fontStyle = config.fontStyle().getFont();
|
||||
textSize = config.textSize();
|
||||
shadows = config.shadows();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,6 +121,10 @@ public class BombOverlay extends Overlay
|
||||
{
|
||||
final Player localPlayer = client.getLocalPlayer();
|
||||
LocalPoint localLoc = LocalPoint.fromWorld(client, bomb.getWorldLocation());
|
||||
if (localLoc == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
double distance_x = Math.abs(bomb.getWorldLocation().getX() - localPlayer.getWorldLocation().getX());
|
||||
double distance_y = Math.abs(bomb.getWorldLocation().getY() - localPlayer.getWorldLocation().getY());
|
||||
Color color_code = Color.decode(SAFE);
|
||||
@@ -142,7 +146,7 @@ public class BombOverlay extends Overlay
|
||||
{
|
||||
color_code = Color.decode(CAUTION);
|
||||
}
|
||||
LocalPoint CenterPoint = new LocalPoint(localLoc.getX() + 0, localLoc.getY() + 0);
|
||||
LocalPoint CenterPoint = new LocalPoint(localLoc.getX(), localLoc.getY());
|
||||
Polygon poly = Perspective.getCanvasTileAreaPoly(client, CenterPoint, BOMB_AOE);
|
||||
|
||||
if (poly != null)
|
||||
|
||||
@@ -258,7 +258,7 @@ public class DevToolsPlugin extends Plugin
|
||||
int value = Integer.parseInt(args[1]);
|
||||
client.setVarpValue(client.getVarps(), varp, value);
|
||||
client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", "Set VarPlayer " + varp + " to " + value, null);
|
||||
VarbitChanged varbitChanged = VarbitChanged.INSTANCE;
|
||||
VarbitChanged varbitChanged = new VarbitChanged();
|
||||
varbitChanged.setIndex(varp);
|
||||
eventBus.post(varbitChanged); // fake event
|
||||
break;
|
||||
@@ -276,7 +276,7 @@ public class DevToolsPlugin extends Plugin
|
||||
int value = Integer.parseInt(args[1]);
|
||||
client.setVarbitValue(client.getVarps(), varbit, value);
|
||||
client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", "Set varbit " + varbit + " to " + value, null);
|
||||
eventBus.post(VarbitChanged.INSTANCE); // fake event
|
||||
eventBus.post(new VarbitChanged()); // fake event
|
||||
break;
|
||||
}
|
||||
case "addxp":
|
||||
@@ -293,7 +293,7 @@ public class DevToolsPlugin extends Plugin
|
||||
|
||||
client.queueChangedSkill(skill);
|
||||
|
||||
ExperienceChanged experienceChanged = ExperienceChanged.INSTANCE;
|
||||
ExperienceChanged experienceChanged = new ExperienceChanged();
|
||||
experienceChanged.setSkill(skill);
|
||||
eventBus.post(experienceChanged);
|
||||
break;
|
||||
@@ -312,11 +312,11 @@ public class DevToolsPlugin extends Plugin
|
||||
|
||||
client.queueChangedSkill(skill);
|
||||
|
||||
ExperienceChanged experienceChanged = ExperienceChanged.INSTANCE;
|
||||
ExperienceChanged experienceChanged = new ExperienceChanged();
|
||||
experienceChanged.setSkill(skill);
|
||||
eventBus.post(experienceChanged);
|
||||
|
||||
BoostedLevelChanged boostedLevelChanged = BoostedLevelChanged.INSTANCE;
|
||||
BoostedLevelChanged boostedLevelChanged = new BoostedLevelChanged();
|
||||
boostedLevelChanged.setSkill(skill);
|
||||
eventBus.post(boostedLevelChanged);
|
||||
break;
|
||||
|
||||
@@ -54,17 +54,17 @@ public class FreezeTimersOverlay extends Overlay
|
||||
private final BufferedImage FREEZE_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "freeze.png");
|
||||
private final BufferedImage TB_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "teleblock.png");
|
||||
private final BufferedImage VENG_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "veng.png");
|
||||
@Inject
|
||||
private Timers timers;
|
||||
private boolean lock;
|
||||
private long finishedAtTest;
|
||||
|
||||
|
||||
@Inject
|
||||
public FreezeTimersOverlay(FreezeTimersConfig config, Client client)
|
||||
public FreezeTimersOverlay(FreezeTimersConfig config, Client client, Timers timers)
|
||||
{
|
||||
this.config = config;
|
||||
this.client = client;
|
||||
this.timers = timers;
|
||||
setPriority(OverlayPriority.HIGHEST);
|
||||
setPosition(OverlayPosition.DYNAMIC);
|
||||
setLayer(OverlayLayer.UNDER_WIDGETS);
|
||||
@@ -119,24 +119,23 @@ public class FreezeTimersOverlay extends Overlay
|
||||
String text = processTickCounter(finishedAt);
|
||||
int test = Integer.parseInt(text);
|
||||
Point poi = actor.getCanvasTextLocation(g, text, 0);
|
||||
|
||||
if (poi == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int xpoi = poi.getX();
|
||||
int ypoi = poi.getY();
|
||||
Point FixedPoint = new Point(xpoi, ypoi);
|
||||
Point FixedPoint = new Point(poi.getX(), poi.getY());
|
||||
|
||||
if (config.noImage())
|
||||
{
|
||||
if (test > 3)
|
||||
{
|
||||
renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.WHITE, FixedPoint);
|
||||
OverlayUtil.renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.WHITE, FixedPoint, false, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.YELLOW, FixedPoint);
|
||||
OverlayUtil.renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.YELLOW, FixedPoint, false, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -161,23 +160,26 @@ public class FreezeTimersOverlay extends Overlay
|
||||
|
||||
String text = processTickCounter(finishedAt);
|
||||
Point poi = actor.getCanvasTextLocation(g, text, 0);
|
||||
int xpoi = poi.getX() + 20;
|
||||
int ypoi = poi.getY();
|
||||
Point FixedPoint = new Point(xpoi, ypoi);
|
||||
|
||||
if (poi == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Point FixedPoint = new Point(poi.getX() + 20, poi.getY());
|
||||
if (config.noImage())
|
||||
{
|
||||
if (timers.getTimerEnd(actor, TimerType.FREEZE) <= currentTick)
|
||||
{
|
||||
renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, poi);
|
||||
OverlayUtil.renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, poi, false, 0);
|
||||
}
|
||||
if (timers.getTimerEnd(actor, TimerType.FREEZE) >= currentTick)
|
||||
{
|
||||
renderTextLocation(g, " | " + text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, FixedPoint);
|
||||
OverlayUtil.renderTextLocation(g, " | " + text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, FixedPoint, false, 0);
|
||||
}
|
||||
if (timers.getTimerEnd(actor, TimerType.VENG) >= currentTick)
|
||||
{
|
||||
renderTextLocation(g, " | " + text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, FixedPoint);
|
||||
OverlayUtil.renderTextLocation(g, " | " + text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, FixedPoint, false, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -202,22 +204,26 @@ public class FreezeTimersOverlay extends Overlay
|
||||
|
||||
String text = processTickCounter(finishedAt);
|
||||
Point poi = actor.getCanvasTextLocation(g, text, 0);
|
||||
int xpoi = poi.getX() - 20;
|
||||
int ypoi = poi.getY();
|
||||
Point FixedPoint = new Point(xpoi, ypoi);
|
||||
|
||||
if (poi == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Point FixedPoint = new Point(poi.getX() - 20, poi.getY());
|
||||
if (config.noImage())
|
||||
{
|
||||
if (timers.getTimerEnd(actor, TimerType.FREEZE) <= currentTick)
|
||||
{
|
||||
renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.RED, poi);
|
||||
OverlayUtil.renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.RED, poi, false, 0);
|
||||
}
|
||||
if (timers.getTimerEnd(actor, TimerType.FREEZE) >= currentTick)
|
||||
{
|
||||
renderTextLocation(g, text + " | ", config.textSize(), config.fontStyle().getFont(), Color.RED, FixedPoint);
|
||||
OverlayUtil.renderTextLocation(g, text + " | ", config.textSize(), config.fontStyle().getFont(), Color.RED, FixedPoint, false, 0);
|
||||
}
|
||||
if (timers.getTimerEnd(actor, TimerType.TELEBLOCK) >= currentTick)
|
||||
{
|
||||
renderTextLocation(g, text + " | ", config.textSize(), config.fontStyle().getFont(), Color.RED, FixedPoint);
|
||||
OverlayUtil.renderTextLocation(g, text + " | ", config.textSize(), config.fontStyle().getFont(), Color.RED, FixedPoint, false, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -229,10 +235,13 @@ public class FreezeTimersOverlay extends Overlay
|
||||
|
||||
g.setColor(RED);
|
||||
Polygon poly = actor.getCanvasTilePoly();
|
||||
if (poly != null)
|
||||
|
||||
if (poly == null)
|
||||
{
|
||||
OverlayUtil.renderPolygon(g, poly, RED);
|
||||
return false;
|
||||
}
|
||||
|
||||
OverlayUtil.renderPolygon(g, poly, RED);
|
||||
OverlayUtil.renderTextLocation(g, new Point((int) poly.getBounds2D().getCenterX(),
|
||||
(int) poly.getBounds2D().getCenterY()), actor.getName(), RED);
|
||||
}
|
||||
@@ -249,22 +258,6 @@ public class FreezeTimersOverlay extends Overlay
|
||||
xOffset);
|
||||
}
|
||||
|
||||
private void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint)
|
||||
{
|
||||
graphics.setFont(new Font("Arial", fontStyle, fontSize));
|
||||
if (canvasPoint != null)
|
||||
{
|
||||
final Point canvasCenterPoint = new Point(
|
||||
canvasPoint.getX(),
|
||||
canvasPoint.getY());
|
||||
final Point canvasCenterPoint_shadow = new Point(
|
||||
canvasPoint.getX() + 1,
|
||||
canvasPoint.getY() + 1);
|
||||
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint_shadow, txtString, Color.BLACK);
|
||||
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint, txtString, fontColor);
|
||||
}
|
||||
}
|
||||
|
||||
public void renderImageLocation(Graphics2D graphics, Point imgLoc, BufferedImage image)
|
||||
{
|
||||
int x = imgLoc.getX();
|
||||
@@ -273,12 +266,9 @@ public class FreezeTimersOverlay extends Overlay
|
||||
graphics.drawImage(image, x, y, null);
|
||||
}
|
||||
|
||||
public void renderActorTextAndImage(Graphics2D graphics, Actor actor, String text, Color color,
|
||||
BufferedImage image, int yOffset, int xOffset)
|
||||
private void renderActorTextAndImage(Graphics2D graphics, Actor actor, String text, Color color, BufferedImage image, int yOffset, int xOffset)
|
||||
{
|
||||
Point textLocation = new Point(actor.getCanvasImageLocation(image, 0).getX() + xOffset,
|
||||
actor.getCanvasImageLocation(image, 0).getY() + yOffset);
|
||||
|
||||
Point textLocation = new Point(actor.getCanvasImageLocation(image, 0).getX() + xOffset, actor.getCanvasImageLocation(image, 0).getY() + yOffset);
|
||||
renderImageLocation(graphics, textLocation, image);
|
||||
xOffset = image.getWidth() + 1;
|
||||
yOffset = (image.getHeight() - (int) graphics.getFontMetrics().getStringBounds(text, graphics).getHeight());
|
||||
|
||||
@@ -121,7 +121,7 @@ public class FreezeTimersPlugin extends Plugin
|
||||
{
|
||||
if (prayerTracker.getSpotanimLastTick(actor) != actor.getSpotAnimation())
|
||||
{
|
||||
SpotAnimationChanged callback = SpotAnimationChanged.INSTANCE;
|
||||
SpotAnimationChanged callback = new SpotAnimationChanged();
|
||||
callback.setActor(actor);
|
||||
client.getCallbacks().post(callback);
|
||||
}
|
||||
|
||||
@@ -30,14 +30,13 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import javax.inject.Inject;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
@@ -119,6 +118,11 @@ public class ImplingsPlugin extends Plugin
|
||||
{
|
||||
Impling impling = Impling.findImpling(npc.getId());
|
||||
|
||||
if (impling == null || impling.getImplingType() == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ImplingType type = impling.getImplingType();
|
||||
if (implingCounterMap.containsKey(type))
|
||||
{
|
||||
|
||||
@@ -106,7 +106,7 @@ public class BatSolver
|
||||
}
|
||||
|
||||
|
||||
public void calculateChanceOfPoison()
|
||||
private void calculateChanceOfPoison()
|
||||
{
|
||||
if (getType() == null)
|
||||
{
|
||||
|
||||
@@ -35,9 +35,9 @@ import lombok.Getter;
|
||||
// e.g. if there is an empty chest in L room chest 1, the other empty chests could be 16, 17, 38, 54, 55
|
||||
// See https://dikkenoob.github.io/ for more information
|
||||
|
||||
public class SolutionSet
|
||||
class SolutionSet
|
||||
{
|
||||
public static final SolutionSet[] SOLUTION_SETS =
|
||||
static final SolutionSet[] SOLUTION_SETS =
|
||||
{
|
||||
new SolutionSet(ThievingRoomType.LEFT_TURN, 1, 16, 17, 55),
|
||||
new SolutionSet(ThievingRoomType.LEFT_TURN, 1, 17, 38, 54),
|
||||
@@ -147,12 +147,12 @@ public class SolutionSet
|
||||
this.emptyChests = new HashSet<>(Arrays.asList(emptyChests));
|
||||
}
|
||||
|
||||
public void addEmptyChest(int chestId)
|
||||
void addEmptyChest(int chestId)
|
||||
{
|
||||
emptyChests.add(chestId);
|
||||
}
|
||||
|
||||
public boolean containsChest(int chestId)
|
||||
boolean containsChest(int chestId)
|
||||
{
|
||||
return emptyChests.contains(chestId);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class InstancePoint
|
||||
private static final int CHUNK_SIZE = 8;
|
||||
private static final double CHUNK_OFFSET = 3.5;
|
||||
|
||||
public InstancePoint(int x, int y, int rot)
|
||||
private InstancePoint(int x, int y, int rot)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
@@ -29,7 +29,7 @@ public class InstancePoint
|
||||
this.rot = 0;
|
||||
}
|
||||
|
||||
public static InstancePoint buildFromPoint(WorldPoint worldPoint, Client client)
|
||||
static InstancePoint buildFromPoint(WorldPoint worldPoint, Client client)
|
||||
{
|
||||
Point point = new Point(worldPoint.getX(), worldPoint.getY());
|
||||
Point base = new Point(client.getBaseX(), client.getBaseY());
|
||||
@@ -48,7 +48,7 @@ public class InstancePoint
|
||||
return buildFromTile(base, point, rotation, new Point(x, y));
|
||||
}
|
||||
|
||||
public static InstancePoint buildFromTile(Point base, Point tile, int rot, Point chunkOrigin)
|
||||
private static InstancePoint buildFromTile(Point base, Point tile, int rot, Point chunkOrigin)
|
||||
{
|
||||
int deltaX = tile.getX() - base.getX();
|
||||
int deltaY = tile.getY() - base.getY();
|
||||
|
||||
@@ -26,10 +26,10 @@ package net.runelite.client.plugins.raidsthieving;
|
||||
|
||||
public class RaidsThievingConstants
|
||||
{
|
||||
public static final int CLOSED_CHEST_ID = 29742;
|
||||
public static final int OPEN_EMPTY_CHEST = 29743;
|
||||
public static final int OPEN_FULL_CHEST_1 = 29744;
|
||||
public static final int OPEN_FULL_CHEST_2 = 29745;
|
||||
public static final int EMPTY_TROUGH = 29746;
|
||||
static final int CLOSED_CHEST_ID = 29742;
|
||||
static final int OPEN_EMPTY_CHEST = 29743;
|
||||
static final int OPEN_FULL_CHEST_1 = 29744;
|
||||
static final int OPEN_FULL_CHEST_2 = 29745;
|
||||
static final int EMPTY_TROUGH = 29746;
|
||||
public static final int[] STORAGE = {29769, 29770, 29771, 29772};
|
||||
}
|
||||
|
||||
@@ -201,6 +201,12 @@ public class RaidsThievingPlugin extends Plugin
|
||||
{
|
||||
log.debug("Found poison splat");
|
||||
WorldPoint loc = WorldPoint.fromLocal(client, obj.getLocation());
|
||||
|
||||
if (chests.get(loc) == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
chests.get(loc).setPoison(true);
|
||||
}
|
||||
}
|
||||
@@ -235,7 +241,7 @@ public class RaidsThievingPlugin extends Plugin
|
||||
mapper = null;
|
||||
}
|
||||
|
||||
public int numberOfEmptyChestsFound()
|
||||
int numberOfEmptyChestsFound()
|
||||
{
|
||||
int total = 0;
|
||||
for (ThievingChest chest : chests.values())
|
||||
@@ -248,7 +254,6 @@ public class RaidsThievingPlugin extends Plugin
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
private boolean checkForBats()
|
||||
{
|
||||
for (ThievingChest chest : chests.values())
|
||||
@@ -266,7 +271,7 @@ public class RaidsThievingPlugin extends Plugin
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getChestId(WorldPoint worldPoint)
|
||||
int getChestId(WorldPoint worldPoint)
|
||||
{
|
||||
return chests.get(worldPoint).getChestId();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ package net.runelite.client.plugins.slayer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KnapsackSolver
|
||||
class KnapsackSolver
|
||||
{
|
||||
|
||||
private List<Integer> reconstructItemsInSack(int[][] sackMatrix, List<Integer> items, int i, int w)
|
||||
@@ -49,7 +49,7 @@ public class KnapsackSolver
|
||||
}
|
||||
}
|
||||
|
||||
public int howMuchFitsInSack(List<Integer> items, int maxWeight)
|
||||
int howMuchFitsInSack(List<Integer> items, int maxWeight)
|
||||
{
|
||||
int itemCount = items.size();
|
||||
|
||||
|
||||
@@ -29,17 +29,17 @@ public class NPCPresence
|
||||
return name + "[" + combatLevel + "]";
|
||||
}
|
||||
|
||||
public boolean shouldExist()
|
||||
boolean shouldExist()
|
||||
{
|
||||
return fadeTimer > 0;
|
||||
}
|
||||
|
||||
public void tickExistence()
|
||||
void tickExistence()
|
||||
{
|
||||
fadeTimer--;
|
||||
}
|
||||
|
||||
public static NPCPresence buildPresence(NPC npc)
|
||||
static NPCPresence buildPresence(NPC npc)
|
||||
{
|
||||
return new NPCPresence(npc.getName(), npc.getCombatLevel());
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ public class SlayerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
int estimateKillCount(List<NPCPresence> potentialKills, int gains)
|
||||
private int estimateKillCount(List<NPCPresence> potentialKills, int gains)
|
||||
{
|
||||
// failsafe to avoid calculating kill count if there were no slayer monsters around that could be killed on task
|
||||
// this failsafe *WILL FAIL* if someone decides to lamp their slayer in the middle of a task next to on task creatures
|
||||
@@ -751,7 +751,7 @@ public class SlayerPlugin extends Plugin
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void killedOne()
|
||||
private void killedOne()
|
||||
{
|
||||
if (currentTask.getAmount() == 0)
|
||||
{
|
||||
@@ -788,7 +788,7 @@ public class SlayerPlugin extends Plugin
|
||||
}
|
||||
|
||||
// checks if any contiguous subsequence of seq0 exactly matches the String toMatch
|
||||
boolean contiguousSubsequenceMatches(String[] seq0, String toMatch)
|
||||
private boolean contiguousSubsequenceMatches(String[] seq0, String toMatch)
|
||||
{
|
||||
for (int i = 0; i < seq0.length; i++)
|
||||
{
|
||||
@@ -962,7 +962,7 @@ public class SlayerPlugin extends Plugin
|
||||
rebuildTargetList();
|
||||
}
|
||||
|
||||
public AsyncBufferedImage getImageForTask(Task task)
|
||||
AsyncBufferedImage getImageForTask(Task task)
|
||||
{
|
||||
int itemSpriteId = ItemID.ENCHANTED_GEM;
|
||||
if (task != null)
|
||||
@@ -1048,6 +1048,11 @@ public class SlayerPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
if (task == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (TASK_STRING_VALIDATION.matcher(task.getTask()).find() || task.getTask().length() > TASK_STRING_MAX_LENGTH ||
|
||||
TASK_STRING_VALIDATION.matcher(task.getLocation()).find() || task.getLocation().length() > TASK_STRING_MAX_LENGTH)
|
||||
{
|
||||
|
||||
@@ -343,7 +343,7 @@ public class SlayerTaskPanel extends PluginPanel
|
||||
changePauseState(paused);
|
||||
}
|
||||
|
||||
static String htmlLabel(String key, long timeMillis)
|
||||
private static String htmlLabel(String key, long timeMillis)
|
||||
{
|
||||
if (timeMillis == Long.MAX_VALUE)
|
||||
{
|
||||
@@ -363,7 +363,7 @@ public class SlayerTaskPanel extends PluginPanel
|
||||
}
|
||||
}
|
||||
|
||||
static String htmlLabel(String key, int value)
|
||||
private static String htmlLabel(String key, int value)
|
||||
{
|
||||
String valueStr = StackFormatter.quantityToRSDecimalStack(value);
|
||||
return String.format(HTML_LABEL_TEMPLATE, ColorUtil.toHexColor(ColorScheme.LIGHT_GRAY_COLOR),
|
||||
|
||||
@@ -31,14 +31,14 @@ import java.io.InputStreamReader;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SlayerXpDropLookup
|
||||
class SlayerXpDropLookup
|
||||
{
|
||||
private Map<String, List<Double>> xpMap;
|
||||
|
||||
// floating point math equality
|
||||
private static final double EPSILON = 1e-6;
|
||||
|
||||
void loadXpJson()
|
||||
private void loadXpJson()
|
||||
{
|
||||
final InputStream xpFile = getClass().getResourceAsStream("/slayer_xp.json");
|
||||
Gson gson = new Gson();
|
||||
@@ -76,7 +76,7 @@ public class SlayerXpDropLookup
|
||||
* @param npc the npc we are estimating slayer xp for
|
||||
* @return our best guess for the slayer xp for this npc
|
||||
*/
|
||||
public double findXpForNpc(NPCPresence npc)
|
||||
double findXpForNpc(NPCPresence npc)
|
||||
{
|
||||
List<Double> xpCombatLevel = xpMap.get(npc.getName());
|
||||
if (xpCombatLevel == null)
|
||||
@@ -127,7 +127,7 @@ public class SlayerXpDropLookup
|
||||
return -1;
|
||||
}
|
||||
|
||||
public SlayerXpDropLookup()
|
||||
SlayerXpDropLookup()
|
||||
{
|
||||
loadXpJson();
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
@@ -102,6 +103,7 @@ class NyloOverlay extends Overlay
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
int nyloCount = (hagios + toxobolos + ischyros);
|
||||
if (nylohandler.getWave() < 21)
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
public class XarpusCounter extends Overlay
|
||||
@@ -60,6 +61,7 @@ public class XarpusCounter extends Overlay
|
||||
));
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
tableComponent.addRow("Exhumes", String.valueOf(xarpusHandler.getExhumesCount()));
|
||||
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
|
||||
@@ -118,9 +118,7 @@ public class GameEventManager
|
||||
|
||||
if (itemContainer != null)
|
||||
{
|
||||
ItemContainerChanged event = ItemContainerChanged.INSTANCE;
|
||||
event.setItemContainer(itemContainer);
|
||||
eventBus.post(event);
|
||||
eventBus.post(new ItemContainerChanged(itemContainer));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,8 +126,7 @@ public class GameEventManager
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
final NpcSpawned npcSpawned = NpcSpawned.INSTANCE;
|
||||
npcSpawned.setNpc(npc);
|
||||
final NpcSpawned npcSpawned = new NpcSpawned(npc);
|
||||
eventBus.post(npcSpawned);
|
||||
}
|
||||
}
|
||||
@@ -138,8 +135,7 @@ public class GameEventManager
|
||||
{
|
||||
if (player != null)
|
||||
{
|
||||
final PlayerSpawned playerSpawned = PlayerSpawned.INSTANCE;
|
||||
playerSpawned.setPlayer(player);
|
||||
final PlayerSpawned playerSpawned = new PlayerSpawned(player);
|
||||
eventBus.post(playerSpawned);
|
||||
}
|
||||
}
|
||||
@@ -148,7 +144,7 @@ public class GameEventManager
|
||||
{
|
||||
Optional.ofNullable(tile.getWallObject()).ifPresent(object ->
|
||||
{
|
||||
final WallObjectSpawned objectSpawned = WallObjectSpawned.INSTANCE;
|
||||
final WallObjectSpawned objectSpawned = new WallObjectSpawned();
|
||||
objectSpawned.setTile(tile);
|
||||
objectSpawned.setWallObject(object);
|
||||
eventBus.post(objectSpawned);
|
||||
@@ -156,7 +152,7 @@ public class GameEventManager
|
||||
|
||||
Optional.ofNullable(tile.getDecorativeObject()).ifPresent(object ->
|
||||
{
|
||||
final DecorativeObjectSpawned objectSpawned = DecorativeObjectSpawned.INSTANCE;
|
||||
final DecorativeObjectSpawned objectSpawned = new DecorativeObjectSpawned();
|
||||
objectSpawned.setTile(tile);
|
||||
objectSpawned.setDecorativeObject(object);
|
||||
eventBus.post(objectSpawned);
|
||||
@@ -164,7 +160,7 @@ public class GameEventManager
|
||||
|
||||
Optional.ofNullable(tile.getGroundObject()).ifPresent(object ->
|
||||
{
|
||||
final GroundObjectSpawned objectSpawned = GroundObjectSpawned.INSTANCE;
|
||||
final GroundObjectSpawned objectSpawned = new GroundObjectSpawned();
|
||||
objectSpawned.setTile(tile);
|
||||
objectSpawned.setGroundObject(object);
|
||||
eventBus.post(objectSpawned);
|
||||
@@ -174,7 +170,7 @@ public class GameEventManager
|
||||
.filter(Objects::nonNull)
|
||||
.forEach(object ->
|
||||
{
|
||||
final GameObjectSpawned objectSpawned = GameObjectSpawned.INSTANCE;
|
||||
final GameObjectSpawned objectSpawned = new GameObjectSpawned();
|
||||
objectSpawned.setTile(tile);
|
||||
objectSpawned.setGameObject(object);
|
||||
eventBus.post(objectSpawned);
|
||||
@@ -190,9 +186,7 @@ public class GameEventManager
|
||||
|
||||
current = current.getNext();
|
||||
|
||||
final ItemSpawned itemSpawned = ItemSpawned.INSTANCE;
|
||||
itemSpawned.setItem(item);
|
||||
itemSpawned.setTile(tile);
|
||||
final ItemSpawned itemSpawned = new ItemSpawned(tile, item);
|
||||
eventBus.post(itemSpawned);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user