Add marker update/delete events for client
This commit is contained in:
parent
c486c42de8
commit
dd8a84165b
3 changed files with 126 additions and 8 deletions
|
|
@ -4,6 +4,8 @@ import java.io.IOException;
|
|||
import java.io.Writer;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.dynmap.markers.Marker;
|
||||
import org.dynmap.markers.MarkerSet;
|
||||
import org.json.simple.JSONAware;
|
||||
import org.json.simple.JSONStreamAware;
|
||||
|
||||
|
|
@ -77,4 +79,35 @@ public class Client {
|
|||
}
|
||||
}
|
||||
|
||||
public static class MarkerUpdate extends Update {
|
||||
public String type = "marker";
|
||||
public int x, y, z;
|
||||
public String id;
|
||||
public String label;
|
||||
public String icon;
|
||||
public String set;
|
||||
|
||||
public MarkerUpdate(Marker m, boolean deleted) {
|
||||
this.id = m.getMarkerID();
|
||||
this.label = m.getLabel();
|
||||
this.x = m.getX();
|
||||
this.y = m.getY();
|
||||
this.z = m.getZ();
|
||||
this.set = m.getMarkerSet().getMarkerSetID();
|
||||
this.icon = m.getMarkerIcon().getMarkerIconID();
|
||||
if(deleted) type = "markerdeleted";
|
||||
}
|
||||
}
|
||||
|
||||
public static class MarkerSetUpdate extends Update {
|
||||
public String type = "markerset";
|
||||
public String id;
|
||||
public String label;
|
||||
|
||||
public MarkerSetUpdate(MarkerSet markerset, boolean deleted) {
|
||||
this.id = markerset.getMarkerSetID();
|
||||
this.label = markerset.getMarkerSetLabel();
|
||||
if(deleted) type = "markersetdeleted";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue