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
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);
this.imagePanelComponent.getChildren().clear();
if (plugin.isShowrecoil())
if (plugin.isShowrecoil() && plugin.isRingOfRecoilAvailable())
{
if (plugin.isRingOfRecoilAvailable())
{
BufferedImage recoilImage = plugin.getRecoilRingImage();
imagePanelComponent.setBackgroundColor(plugin
.isRingOfRecoilEquipped() ? ACTIVATED_BACKGROUND_COLOR : NOT_ACTIVATED_BACKGROUND_COLOR);
imagePanelComponent.getChildren().add(new ImageComponent(recoilImage));
BufferedImage recoilImage = plugin.getRecoilRingImage();
imagePanelComponent.setBackgroundColor(plugin
.isRingOfRecoilEquipped() ? ACTIVATED_BACKGROUND_COLOR : NOT_ACTIVATED_BACKGROUND_COLOR);
imagePanelComponent.getChildren().add(new ImageComponent(recoilImage));
imagePanelComponent.getChildren().add(tableComponent);
return imagePanelComponent.render(graphics);
}
imagePanelComponent.getChildren().add(tableComponent);
return imagePanelComponent.render(graphics);
}
return null;
}
}