Agility plugin small code cleanup

- Do not use 1 line ifs
- Mark fields final properly
- Remove confusing comments

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-04-26 14:55:54 +02:00
parent 4f984d8760
commit 70f8c6f925

View File

@@ -165,11 +165,13 @@ public class AgilityPlugin extends Plugin
public void onItemLayerChanged(ItemLayerChanged event)
{
if (obstacles.isEmpty())
{
return;
}
Tile tile = event.getTile();
ItemLayer itemLayer = tile.getItemLayer();
boolean hasMark = tileHasMark(itemLayer);
final Tile tile = event.getTile();
final ItemLayer itemLayer = tile.getItemLayer();
final boolean hasMark = tileHasMark(itemLayer);
if (markOfGrace != null && tile.getWorldLocation().equals(markOfGrace.getWorldLocation()) && !hasMark)
{
@@ -203,8 +205,6 @@ public class AgilityPlugin extends Plugin
return false;
}
// This code, brought to you, in part, by the letters C and V
// ... and the words "search" and "replace"
@Subscribe
public void onGameObjectSpawned(GameObjectSpawned event)
{