mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 19:25:15 +01:00
Trap on bogus world names or player with bad current location
This commit is contained in:
parent
95cc3ae869
commit
dcdfb3da5d
@ -15,17 +15,17 @@ public class DynmapPlayerChatListener extends PlayerListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onPlayerChat(PlayerChatEvent event) {
|
public void onPlayerChat(PlayerChatEvent event) {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
plugin.mapManager.pushUpdate(new Client.ChatMessage("player", event.getPlayer().getDisplayName(), event.getMessage()));
|
plugin.mapManager.pushUpdate(new Client.ChatMessage("player", event.getPlayer().getName(), event.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
plugin.mapManager.pushUpdate(new Client.PlayerJoinMessage(event.getPlayer().getDisplayName()));
|
plugin.mapManager.pushUpdate(new Client.PlayerJoinMessage(event.getPlayer().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
plugin.mapManager.pushUpdate(new Client.PlayerQuitMessage(event.getPlayer().getDisplayName()));
|
plugin.mapManager.pushUpdate(new Client.PlayerQuitMessage(event.getPlayer().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -349,11 +349,14 @@ public class DynmapPlugin extends JavaPlugin {
|
|||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
for (int i = 1; i < args.length; i++) {
|
for (int i = 1; i < args.length; i++) {
|
||||||
World w = getServer().getWorld(args[i]);
|
World w = getServer().getWorld(args[i]);
|
||||||
|
if(w != null)
|
||||||
mapManager.renderFullWorld(new Location(w, 0, 0, 0));
|
mapManager.renderFullWorld(new Location(w, 0, 0, 0));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (player != null) {
|
} else if (player != null) {
|
||||||
mapManager.renderFullWorld(player.getLocation());
|
Location loc = player.getLocation();
|
||||||
|
if(loc != null)
|
||||||
|
mapManager.renderFullWorld(loc);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user