mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-27 20:58:40 +01:00
Merge pull request #2365 from haffmans/v3.0
Fix loading profiles to solve 500 errors on login
This commit is contained in:
commit
d227d48ffb
@ -43,6 +43,7 @@ import net.minecraft.network.NetworkManager;
|
|||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.management.UserListBans;
|
import net.minecraft.server.management.UserListBans;
|
||||||
import net.minecraft.server.management.UserListIPBans;
|
import net.minecraft.server.management.UserListIPBans;
|
||||||
|
import net.minecraft.server.management.PlayerProfileCache;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.SoundCategory;
|
import net.minecraft.util.SoundCategory;
|
||||||
import net.minecraft.util.SoundEvent;
|
import net.minecraft.util.SoundEvent;
|
||||||
@ -486,6 +487,11 @@ public class DynmapPlugin
|
|||||||
|
|
||||||
public ForgeServer() {
|
public ForgeServer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private GameProfile getProfileByName(String player) {
|
||||||
|
PlayerProfileCache cache = server.getPlayerProfileCache();
|
||||||
|
return cache.getGameProfileForUsername(player);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBlockIDAt(String wname, int x, int y, int z) {
|
public int getBlockIDAt(String wname, int x, int y, int z) {
|
||||||
@ -601,7 +607,7 @@ public class DynmapPlugin
|
|||||||
public boolean isPlayerBanned(String pid)
|
public boolean isPlayerBanned(String pid)
|
||||||
{
|
{
|
||||||
UserListBans bl = server.getPlayerList().getBannedPlayers();
|
UserListBans bl = server.getPlayerList().getBannedPlayers();
|
||||||
return bl.isBanned(new GameProfile(null, pid));
|
return bl.isBanned(getProfileByName(pid));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -765,7 +771,7 @@ public class DynmapPlugin
|
|||||||
if (scm == null) return Collections.emptySet();
|
if (scm == null) return Collections.emptySet();
|
||||||
UserListBans bl = scm.getBannedPlayers();
|
UserListBans bl = scm.getBannedPlayers();
|
||||||
if (bl == null) return Collections.emptySet();
|
if (bl == null) return Collections.emptySet();
|
||||||
if(bl.isBanned(new GameProfile(null, player))) {
|
if(bl.isBanned(getProfileByName(player))) {
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
Set<String> rslt = hasOfflinePermissions(player, perms);
|
Set<String> rslt = hasOfflinePermissions(player, perms);
|
||||||
@ -784,7 +790,7 @@ public class DynmapPlugin
|
|||||||
if (scm == null) return false;
|
if (scm == null) return false;
|
||||||
UserListBans bl = scm.getBannedPlayers();
|
UserListBans bl = scm.getBannedPlayers();
|
||||||
if (bl == null) return false;
|
if (bl == null) return false;
|
||||||
if(bl.isBanned(new GameProfile(null, player))) {
|
if(bl.isBanned(getProfileByName(player))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return hasOfflinePermission(player, perm);
|
return hasOfflinePermission(player, perm);
|
||||||
|
Loading…
Reference in New Issue
Block a user