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,13 +567,10 @@ 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);
{ updateXericCharges(xericCharges);
final int xericCharges = Math.max(this.xericTalisman - 1, 0);
updateXericCharges(xericCharges);
}
} }
} }

View File

@@ -60,19 +60,17 @@ 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();
{ imagePanelComponent.setBackgroundColor(plugin
BufferedImage recoilImage = plugin.getRecoilRingImage(); .isRingOfRecoilEquipped() ? ACTIVATED_BACKGROUND_COLOR : NOT_ACTIVATED_BACKGROUND_COLOR);
imagePanelComponent.setBackgroundColor(plugin imagePanelComponent.getChildren().add(new ImageComponent(recoilImage));
.isRingOfRecoilEquipped() ? ACTIVATED_BACKGROUND_COLOR : NOT_ACTIVATED_BACKGROUND_COLOR);
imagePanelComponent.getChildren().add(new ImageComponent(recoilImage));
imagePanelComponent.getChildren().add(tableComponent); imagePanelComponent.getChildren().add(tableComponent);
return imagePanelComponent.render(graphics); return imagePanelComponent.render(graphics);
}
} }
return null; return null;
} }
} }