diff options
| author | daoge <3523206925@qq.com> | 2026-03-03 03:04:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-03 03:04:10 +0800 |
| commit | b3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch) | |
| tree | 267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.World/ExperienceCommand.cpp | |
| parent | 84c31a2331f7a0ec85b9d438992e244f60e5020f (diff) | |
feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a43994725008e35fceb984d5549df9c8cea470.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.World/ExperienceCommand.cpp')
| -rw-r--r-- | Minecraft.World/ExperienceCommand.cpp | 68 |
1 files changed, 43 insertions, 25 deletions
diff --git a/Minecraft.World/ExperienceCommand.cpp b/Minecraft.World/ExperienceCommand.cpp index b8ac2efc..9a59d71a 100644 --- a/Minecraft.World/ExperienceCommand.cpp +++ b/Minecraft.World/ExperienceCommand.cpp @@ -2,6 +2,7 @@ #include "net.minecraft.commands.h" #include "..\Minecraft.Client\MinecraftServer.h" #include "..\Minecraft.Client\PlayerList.h" +#include "net.minecraft.world.level.h" #include "ExperienceCommand.h" EGameCommand ExperienceCommand::getId() @@ -9,33 +10,50 @@ EGameCommand ExperienceCommand::getId() return eGameCommand_Experience; } -void ExperienceCommand::execute(shared_ptr<CommandSender> source, byteArray commandData) +int ExperienceCommand::getPermissionLevel() { - //if (args.length > 0) - //{ - // Player player; - // int amount = convertArgToInt(source, args[0], 0, 5000); - - // if (args.length > 1) { - // player = getPlayer(args[1]); - // } else { - // player = convertSourceToPlayer(source); - // } - - // player.increaseXp(amount); - // logAdminAction(source, "commands.xp.success", amount, player.getAName()); - //} + return LEVEL_GAMEMASTERS; } -shared_ptr<Player> ExperienceCommand::getPlayer(PlayerUID playerId) +void ExperienceCommand::execute(shared_ptr<CommandSender> source, byteArray commandData) { - return nullptr; - //shared_ptr<Player> player = MinecraftServer::getInstance()->getPlayers()->getPlayer(playerId); - - //if (player == null) - //{ - // throw new PlayerNotFoundException(); - //} else { - // return player; - //} +// if (args.length > 0) { +// Player player; +// String inputAmount = args[0]; +// +// boolean levels = inputAmount.endsWith("l") || inputAmount.endsWith("L"); +// if (levels && inputAmount.length() > 1) inputAmount = inputAmount.substring(0, inputAmount.length() - 1); +// +// int amount = convertArgToInt(source, inputAmount); +// boolean take = amount < 0; +// +// if (take) amount *= -1; +// +// if (args.length > 1) { +// player = convertToPlayer(source, args[1]); +// } else { +// player = convertSourceToPlayer(source); +// } +// +// if (levels) { +// if (take) { +// player.giveExperienceLevels(-amount); +// logAdminAction(source, "commands.xp.success.negative.levels", amount, player.getAName()); +// } else { +// player.giveExperienceLevels(amount); +// logAdminAction(source, "commands.xp.success.levels", amount, player.getAName()); +// } +// } else { +// if (take) { +// throw new UsageException("commands.xp.failure.widthdrawXp"); +// } else { +// player.increaseXp(amount); +// logAdminAction(source, "commands.xp.success", amount, player.getAName()); +// } +// } +// +// return; +// } +// +// throw new UsageException("commands.xp.usage"); }
\ No newline at end of file |
