itemcharges: Merge nested if statements

This commit is contained in:
sdburns1998
2019-07-07 15:01:07 +02:00
parent 40c52fa589
commit fbf1f53892
2 changed files with 11 additions and 16 deletions

View File

@@ -567,15 +567,12 @@ public class ItemChargePlugin extends Plugin
@Subscribe @Subscribe
public void onSpotAnimationChanged(SpotAnimationChanged event) public void onSpotAnimationChanged(SpotAnimationChanged event)
{ {
if (event.getActor() == client.getLocalPlayer()) if (event.getActor() == client.getLocalPlayer() && client.getLocalPlayer().getSpotAnimation() == GraphicID.XERIC_TELEPORT)
{
if (client.getLocalPlayer().getSpotAnimation() == GraphicID.XERIC_TELEPORT)
{ {
final int xericCharges = Math.max(this.xericTalisman - 1, 0); final int xericCharges = Math.max(this.xericTalisman - 1, 0);
updateXericCharges(xericCharges); updateXericCharges(xericCharges);
} }
} }
}
@Subscribe @Subscribe
private void onScriptCallbackEvent(ScriptCallbackEvent event) private void onScriptCallbackEvent(ScriptCallbackEvent event)

View File

@@ -60,9 +60,7 @@ class ItemRecoilOverlay extends Overlay
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT); tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
this.imagePanelComponent.getChildren().clear(); this.imagePanelComponent.getChildren().clear();
if (plugin.isShowrecoil()) if (plugin.isShowrecoil() && plugin.isRingOfRecoilAvailable())
{
if (plugin.isRingOfRecoilAvailable())
{ {
BufferedImage recoilImage = plugin.getRecoilRingImage(); BufferedImage recoilImage = plugin.getRecoilRingImage();
imagePanelComponent.setBackgroundColor(plugin imagePanelComponent.setBackgroundColor(plugin
@@ -72,7 +70,7 @@ class ItemRecoilOverlay extends Overlay
imagePanelComponent.getChildren().add(tableComponent); imagePanelComponent.getChildren().add(tableComponent);
return imagePanelComponent.render(graphics); return imagePanelComponent.render(graphics);
} }
}
return null; return null;
} }
} }