[Dynmap] Connect to MarkerAPI

Discussion in 'Plugin Development' started by TheA13X, Sep 20, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    TheA13X

    Hello People.
    I have a pretty special question today.
    I have a Zoneplugin to be connected to the well-known Dynmap.
    It should make an area mark, when a zone is created, but Dynmap says

    .
    1. The Configuration for the API IS uncommented
    Code:
    # Note: this component is needed for the dmarker commands, and for the Marker API to be available to other plugins
      - class: org.dynmap.MarkersComponent
        type: markers
        # If set, shows labels all the time (default is only on hover)
        showlabel: true
        # If set, enables support for using signs for markers
        enablesigns: true
        # If set, show spawn points on each world
        showspawn: true
        # Marker used for spawn point
        spawnicon: world
        # Label for spawn points
        spawnlabel: "Spawn"
     
        # (optional) layer for showing offline player's positions
        showofflineplayers: true
        offlinelabel: "Offline"
        offlineicon: offlineuser
        offlinehidebydefault: true
        offlineminzoom: 0
        # (optional) layer for showing player's spawn beds
        showspawnbeds: true
        spawnbedlabel: "Spawn Beds"
        spawnbedicon: bed
        spawnbedhidebydefault: true
        spawnbedminzoom: 0
        spawnbedformat: "%name%'s bed"
    2. It works, if I make an areamark via the commandline but I can't set things like Description then.
    3. It also doesn't have any problems with creating markersets. Only if I create a Marker[absolutely wrong] There is this

    Code when creating set:
    Code:java
    1. if(api.getMarkerAPI().getMarkerSet("zones")==null){
    2. api.getMarkerAPI().createMarkerSet("zones", "zones", null, true).setLabelShow(true);
    3. api.getMarkerAPI().getMarkerSet("zones").setHideByDefault(false);
    4. }
    5. if(api.getMarkerAPI().getMarkerSet("serverzones")==null){
    6. api.getMarkerAPI().createMarkerSet("serverzones", "serverzones", null, true).setLabelShow(true);
    7. api.getMarkerAPI().getMarkerSet("serverzones").setHideByDefault(false);
    8. }

    Code when creating the actual marker:
    Code:java
    1. public static boolean createZoneMarker(String owner,String name,Location l1,Location l2){
    2. String set="zones";
    3. String color="CC0000";
    4. double[] xs={l1.getX(),l2.getX()};
    5. double[] zs={l1.getZ(),l2.getZ()};
    6. if(owner.equalsIgnoreCase("Server")){
    7. set="serverzones";
    8. color="0000CC";
    9. }
    10. api.getMarkerAPI().getMarkerSet(set).createAreaMarker(name, name, true, l1.getWorld().getName(), xs, zs, true);
    11. api.getMarkerAPI().getMarkerSet(set).findAreaMarker(name).setLabel(name);
    12. api.getMarkerAPI().getMarkerSet(set).findAreaMarker(name).setLineStyle(0,1,Integer.parseInt(color, 16));
    13. api.getMarkerAPI().getMarkerSet(set).findAreaMarker(name).setFillStyle(0,Integer.parseInt("DDDDDD", 16));
    14. api.getMarkerAPI().getMarkerSet(set).findAreaMarker(name).setRangeY(Math.min(l1.getY(), l2.getY()), Math.max(l1.getY(), l2.getY()));
    15. api.getMarkerAPI().getMarkerSet(set).findAreaMarker(name).setDescription("Name: "+name+"\nBesitzer: "+owner+"\nTyp:"+set.substring(0,set.length()-2)+"\nGröße: "+Math.abs(xs[0]-xs[1])+"x"+Math.abs(zs[0]-zs[1]));
    16. return true;
    17. }


    I should report it as a bug, huh?
     
  2. Offline

    TheA13X

    Okay. I'll report is as a bug, But I'll let the thread here. Just for the case...
     
Thread Status:
Not open for further replies.

Share This Page