Created
March 3, 2019 05:12
-
-
Save Lomeli12/5342b12f44d14fa2e59472dd168fe863 to your computer and use it in GitHub Desktop.
What the hell did I just write?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void accept(CommandDispatcher<ServerCommandSource> commandDispatcher) { | |
commandDispatcher.register(ServerCommandManager.literal(getName()).requires( | |
(commandSource) -> commandSource.hasPermissionLevel(2)) | |
.then(ServerCommandManager.literal("all") | |
.executes((commandContext) -> removePlayersSlots(commandContext.getSource(), null, | |
InventoryUtils.MAX_SLOTS)) | |
.then(ServerCommandManager.argument("targets", GameProfileArgumentType.create()) | |
.executes((commandContext) -> removePlayersSlots(commandContext.getSource(), | |
GameProfileArgumentType.getProfilesArgument(commandContext, "targets"), | |
InventoryUtils.MAX_SLOTS)))) | |
.then(ServerCommandManager.argument("amount", IntegerArgumentType.integer(1, InventoryUtils.MAX_SLOTS)) | |
.executes((commandContext) -> removePlayersSlots(commandContext.getSource(), null, | |
IntegerArgumentType.getInteger(commandContext, "amount"))) | |
.then(ServerCommandManager.argument("targets", GameProfileArgumentType.create()) | |
.executes((commandContext) -> removePlayersSlots(commandContext.getSource(), | |
GameProfileArgumentType.getProfilesArgument(commandContext, "targets"), | |
IntegerArgumentType.getInteger(commandContext, "amount"))))) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment