Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Don't show a player on map if they're vanished. Fixes BUKKIT-1882
Dieser Commit ist enthalten in:
Ursprung
2d832bf148
Commit
20c074ec6c
@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.map;
|
|||||||
import net.minecraft.server.WorldMap;
|
import net.minecraft.server.WorldMap;
|
||||||
import net.minecraft.server.WorldMapDecoration;
|
import net.minecraft.server.WorldMapDecoration;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.map.MapCanvas;
|
import org.bukkit.map.MapCanvas;
|
||||||
import org.bukkit.map.MapCursorCollection;
|
import org.bukkit.map.MapCursorCollection;
|
||||||
@ -32,8 +33,15 @@ public class CraftMapRenderer extends MapRenderer {
|
|||||||
while (cursors.size() > 0) {
|
while (cursors.size() > 0) {
|
||||||
cursors.removeCursor(cursors.getCursor(0));
|
cursors.removeCursor(cursors.getCursor(0));
|
||||||
}
|
}
|
||||||
for (Object object : worldMap.g.values()) {
|
|
||||||
WorldMapDecoration decoration = (WorldMapDecoration) object;
|
for (Object key : worldMap.g.keySet()) {
|
||||||
|
// If this cursor is for a player check visibility with vanish system
|
||||||
|
Player other = Bukkit.getPlayerExact((String) key);
|
||||||
|
if (other != null && !player.canSee(other)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldMapDecoration decoration = (WorldMapDecoration) worldMap.g.get(key);
|
||||||
cursors.addCursor(decoration.locX, decoration.locY, (byte) (decoration.rotation & 15), (byte) (decoration.type));
|
cursors.addCursor(decoration.locX, decoration.locY, (byte) (decoration.rotation & 15), (byte) (decoration.type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren