Solved MapCanvas removeCursor not working

Discussion in 'Spigot Plugin Development' started by KarmaConfigs, Mar 31, 2020.

  1. I need help, I want to remove all map cursors (including player one), but the player cursor isn't getting removed from map

    Code (Text):
    @Override
        public void render(MapView mapView, MapCanvas mapCanvas, Player player) {
            for (int i = 0; i < mapCanvas.getCursors().size(); i++) {
                MapCursor cursor = mapCanvas.getCursors().getCursor(i);
                mapCanvas.getCursors().removeCursor(cursor);
            }
            try {
                Dimension dim = new Dimension(128, 128);
                BufferedImage resized = resize(new URL("https://karmaconfigs.ml/img/steve.png"), dim);
                mapCanvas.drawImage(0, 0, resized);
            } catch (IOException e) {
                player.sendMessage(ChatColor.RED + "Error while getting the IMG.");
            }
        }
     
    #1 KarmaConfigs, Mar 31, 2020
    Last edited: Mar 31, 2020
  2. Fxied by doing

    Code (Java):
    mapView.setCenterX((int) (player.getLocation().getX() + 1000000000));
            mapView.setCenterZ((int) (player.getLocation().getZ() + 1000000000));