the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 59 lines 1.6 kB view raw
1#include "stdafx.h" 2#include "net.minecraft.commands.h" 3#include "..\Minecraft.Client\MinecraftServer.h" 4#include "..\Minecraft.Client\PlayerList.h" 5#include "net.minecraft.world.level.h" 6#include "ExperienceCommand.h" 7 8EGameCommand ExperienceCommand::getId() 9{ 10 return eGameCommand_Experience; 11} 12 13int ExperienceCommand::getPermissionLevel() 14{ 15 return LEVEL_GAMEMASTERS; 16} 17 18void ExperienceCommand::execute(shared_ptr<CommandSender> source, byteArray commandData) 19{ 20// if (args.length > 0) { 21// Player player; 22// String inputAmount = args[0]; 23// 24// boolean levels = inputAmount.endsWith("l") || inputAmount.endsWith("L"); 25// if (levels && inputAmount.length() > 1) inputAmount = inputAmount.substring(0, inputAmount.length() - 1); 26// 27// int amount = convertArgToInt(source, inputAmount); 28// boolean take = amount < 0; 29// 30// if (take) amount *= -1; 31// 32// if (args.length > 1) { 33// player = convertToPlayer(source, args[1]); 34// } else { 35// player = convertSourceToPlayer(source); 36// } 37// 38// if (levels) { 39// if (take) { 40// player.giveExperienceLevels(-amount); 41// logAdminAction(source, "commands.xp.success.negative.levels", amount, player.getAName()); 42// } else { 43// player.giveExperienceLevels(amount); 44// logAdminAction(source, "commands.xp.success.levels", amount, player.getAName()); 45// } 46// } else { 47// if (take) { 48// throw new UsageException("commands.xp.failure.widthdrawXp"); 49// } else { 50// player.increaseXp(amount); 51// logAdminAction(source, "commands.xp.success", amount, player.getAName()); 52// } 53// } 54// 55// return; 56// } 57// 58// throw new UsageException("commands.xp.usage"); 59}