diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/PlayerSkin.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/PlayerSkin.java index 5201f8dc..a0b7bd99 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/PlayerSkin.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/PlayerSkin.java @@ -70,7 +70,7 @@ public void update(File storageFolder) { BufferedImage head = createHead(skin); ImageIO.write(head, "png", new File(storageFolder, uuid.toString() + ".png")); } catch (ExecutionException | TimeoutException e) { - Logger.global.logWarning("Failed to load player-skin from mojang-servers: " + e); + Logger.global.logDebug("Failed to load player-skin from mojang-servers: " + e); } catch (IOException e) { Logger.global.logError("Failed to write player-head image!", e); } catch (InterruptedException ignore) {} diff --git a/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarker.js b/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarker.js index 1129fa5b..544a8c84 100644 --- a/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarker.js +++ b/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarker.js @@ -2,6 +2,8 @@ import $ from 'jquery'; import Marker from "./Marker"; import {CSS2DObject} from "./CSS2DRenderer"; +import STEVE from "../../../assets/playerheads/steve.png"; + export default class PlayerMarker extends Marker { constructor(blueMap, markerSet, markerData, playerUuid, worldUuid) { @@ -21,7 +23,7 @@ export default class PlayerMarker extends Marker { this.blueMap.updateFrame = true; if (!this.renderObject){ - let iconElement = $(`
${this.label}
`); + let iconElement = $(`
${this.label}
`); iconElement.find("img").click(this.onClick); this.renderObject = new CSS2DObject(iconElement[0]); diff --git a/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js b/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js index 9668af24..073c9139 100644 --- a/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js +++ b/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js @@ -50,6 +50,7 @@ export default class PlayerMarkerSet { updateWith(liveData){ this.marker.forEach(marker => { marker.nowOnline = false; + marker.worldChanged = false; }); for(let i = 0; i < liveData.players.length; i++){ @@ -72,11 +73,15 @@ export default class PlayerMarkerSet { marker.nowOnline = true; marker.position = new Vector3(player.position.x, player.position.y + 1.5, player.position.z); + if (marker.world !== player.world) { + marker.world = player.world; + marker.worldChanged = true; + } marker.updatePosition(); } this.marker.forEach(marker => { - if (marker.nowOnline !== marker.online){ + if (marker.nowOnline !== marker.online || marker.worldChanged){ marker.online = marker.nowOnline; marker.setVisible(this.visible); } diff --git a/BlueMapForge/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/BlueMapForge/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index c025bcac..afe69222 100644 --- a/BlueMapForge/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/BlueMapForge/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -188,7 +188,8 @@ private File getFolderForWorld(ServerWorld world) throws IOException { public File getConfigFolder() { return new File("config/bluemap"); } - + + @SubscribeEvent public void onPlayerJoin(PlayerLoggedInEvent evt) { PlayerEntity playerInstance = evt.getPlayer(); if (!(playerInstance instanceof ServerPlayerEntity)) return; @@ -197,7 +198,8 @@ public void onPlayerJoin(PlayerLoggedInEvent evt) { onlinePlayerMap.put(player.getUuid(), player); onlinePlayerList.add(player); } - + + @SubscribeEvent public void onPlayerLeave(PlayerLoggedOutEvent evt) { PlayerEntity player = evt.getPlayer(); if (!(player instanceof ServerPlayerEntity)) return;