Allow /player spawn spawn offline-mode player in online server; Code clean-up in /player spawn command (#872)

* Clean up code in PlayerCommand.spawn and EntityPlayerMPFake.createFake.

* Update src/main/java/carpet/CarpetSettings.java

* Update src/main/java/carpet/commands/PlayerCommand.java

* Update src/main/java/carpet/patches/EntityPlayerMPFake.java

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
This commit is contained in:
Keuinandgnembon authored and GitHub committed 2021-05-25 13:21:59 -03:00
1 parent c3fe5d685b
commit 0cb20e0795
3 files changed
+21 -5

No files matched your search

@@ -192,9 +192,14 @@ public class PlayerCommand
GameProfile profile = server.getUserCache().findByName(playerName);
if (profile == null)
{
Messenger.m(context.getSource(), "r Player "+playerName+" is either banned by Mojang, or auth servers are down. " +
"Banned players can only be summoned in Singleplayer and in servers in off-line mode.");
return true;
if (!CarpetSettings.allowSpawningOfflinePlayers)
{
Messenger.m(context.getSource(), "r Player "+playerName+" is either banned by Mojang, or auth servers are down. " +
"Banned players can only be summoned in Singleplayer and in servers in off-line mode.");
return true;
} else {
profile = new GameProfile(PlayerEntity.getOfflinePlayerUuid(playerName), playerName);
}
}
if (manager.getUserBanList().contains(profile))
{