NeumimTo / Pl3xMap

Pl3xMap is a minimalistic and lightweight world map viewer for Paper servers using the vanilla Minecraft rendering style
MIT License
68 stars 7 forks source link

Marker Options #8

Closed Naphho closed 2 years ago

Naphho commented 2 years ago

image

NeumimTo commented 2 years ago

This is either outdated or complete miss understanding how the map works.

Marker is re-rendered when its marker options change. There are no equals check between current and previous state. Previous state is thrown away every map update

    Circle circle = Marker.circle(Point.of(0, 0), 100);
    circle.markerOptions(MarkerOptions.builder().fill(false).build());;
    Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> {
        circle.markerOptions(circle.markerOptions().asBuilder().fill(!circle.markerOptions().fill()).build());
    }, 10, 100);
    SimpleLayerProvider test = SimpleLayerProvider.builder("test").build();
    test.addMarker(Key.of("test"), circle);
    Pl3xMapProvider.get().getWorldIfEnabled(Bukkit.getWorld("world").getUID())
            .get().layerRegistry().register(Key.of("test"), test);

will result in map toggling on a off marker fill color