aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/GameModeCommand.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-04 03:56:03 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-04 03:56:03 -0600
commit42aec6dac53dffa6afe072560a7e1d4986112538 (patch)
tree0836426857391df1b6a83f6368a183f83ec9b104 /Minecraft.World/GameModeCommand.cpp
parentc9d58eeac7c72f0b3038e084667b4d89a6249fce (diff)
parentef9b6fd500dfabd9463267b0dd9e29577eea8a2b (diff)
Merge branch 'main' into pr/win64-world-saves
# Conflicts: # Minecraft.Client/MinecraftServer.cpp # README.md
Diffstat (limited to 'Minecraft.World/GameModeCommand.cpp')
-rw-r--r--Minecraft.World/GameModeCommand.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/Minecraft.World/GameModeCommand.cpp b/Minecraft.World/GameModeCommand.cpp
index 86d4c5a5..f8c1ffb6 100644
--- a/Minecraft.World/GameModeCommand.cpp
+++ b/Minecraft.World/GameModeCommand.cpp
@@ -7,23 +7,32 @@ EGameCommand GameModeCommand::getId()
return eGameCommand_GameMode;
}
+int GameModeCommand::getPermissionLevel()
+{
+ return LEVEL_GAMEMASTERS;
+}
+
void GameModeCommand::execute(shared_ptr<CommandSender> source, byteArray commandData)
{
- //if (args.length > 0)
- //{
+ //if (args.length > 0) {
// GameType newMode = getModeForString(source, args[0]);
- // Player player = args.length >= 2 ? getPlayer(args[1]) : convertSourceToPlayer(source);
+ // Player player = args.length >= 2 ? convertToPlayer(source, args[1]) : convertSourceToPlayer(source);
// player.setGameMode(newMode);
+ // player.fallDistance = 0; // reset falldistance so flying people do not die :P
- // String mode = I18n.get("gameMode." + newMode.getName());
+ // ChatMessageComponent mode = ChatMessageComponent.forTranslation("gameMode." + newMode.getName());
// if (player != source) {
// logAdminAction(source, AdminLogCommand.LOGTYPE_DONT_SHOW_TO_SELF, "commands.gamemode.success.other", player.getAName(), mode);
// } else {
// logAdminAction(source, AdminLogCommand.LOGTYPE_DONT_SHOW_TO_SELF, "commands.gamemode.success.self", mode);
// }
+
+ // return;
//}
+
+ //throw new UsageException("commands.gamemode.usage");
}
GameType *GameModeCommand::getModeForString(shared_ptr<CommandSender> source, const wstring &name)
@@ -38,16 +47,4 @@ GameType *GameModeCommand::getModeForString(shared_ptr<CommandSender> source, co
//} else {
// return LevelSettings.validateGameType(convertArgToInt(source, name, 0, GameType.values().length - 2));
//}
-}
-
-shared_ptr<Player> GameModeCommand::getPlayer(PlayerUID playerId)
-{
- return nullptr;
- //Player player = MinecraftServer.getInstance().getPlayers().getPlayer(name);
-
- //if (player == null) {
- // throw new PlayerNotFoundException();
- //} else {
- // return player;
- //}
} \ No newline at end of file