Fix loading of existing gate icon.

This commit is contained in:
Tobias Ottenweller 2014-01-26 14:00:17 +01:00
parent 09baea5208
commit 724c3ff426

View File

@ -93,6 +93,9 @@ public class Plugin extends JavaPlugin
private void loadIcons() private void loadIcons()
{ {
this.gateIcon = this.markerAPI.getMarkerIcon(markerSetID);
if (this.gateIcon == null) {
InputStream inputStream = this.getClass().getResourceAsStream("/gate.png"); InputStream inputStream = this.getClass().getResourceAsStream("/gate.png");
if (inputStream == null) { if (inputStream == null) {
@ -106,6 +109,7 @@ public class Plugin extends JavaPlugin
log(Level.SEVERE, "Cannot load gate icon"); log(Level.SEVERE, "Cannot load gate icon");
} }
} }
}
@ -124,6 +128,11 @@ public class Plugin extends JavaPlugin
List<Gate> allGates = this.gatesPlugin.getGatesManager().allGates(); List<Gate> allGates = this.gatesPlugin.getGatesManager().allGates();
for (Gate g : allGates) { for (Gate g : allGates) {
if (g.getLocation() == null) {
continue;
}
String id = g.getId(); String id = g.getId();
String label = g.getId(); String label = g.getId();
boolean markup = false; boolean markup = false;