aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1042-Add-experimental-improved-give-command.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/1042-Add-experimental-improved-give-command.patch')
-rw-r--r--patches/server/1042-Add-experimental-improved-give-command.patch12
1 files changed, 6 insertions, 6 deletions
diff --git a/patches/server/1042-Add-experimental-improved-give-command.patch b/patches/server/1042-Add-experimental-improved-give-command.patch
index b7a7ef41c0..aaadb56694 100644
--- a/patches/server/1042-Add-experimental-improved-give-command.patch
+++ b/patches/server/1042-Add-experimental-improved-give-command.patch
@@ -183,7 +183,7 @@ index 5347a96be3bfbbd2963747ba4b5f222215d80371..fa431de18de902c580855e9c44191255
default void visitSuggestions(Function<SuggestionsBuilder, CompletableFuture<Suggestions>> suggestor) {
}
diff --git a/src/main/java/net/minecraft/server/commands/GiveCommand.java b/src/main/java/net/minecraft/server/commands/GiveCommand.java
-index 0d9de4c61c7b26a6ff37c12fde629161fd0c3d5a..c738bbfa73888a0caed507e02f5c113f681e5cc2 100644
+index 0d9de4c61c7b26a6ff37c12fde629161fd0c3d5a..47355158e5e762540a10dc67b23092a0fc53bce3 100644
--- a/src/main/java/net/minecraft/server/commands/GiveCommand.java
+++ b/src/main/java/net/minecraft/server/commands/GiveCommand.java
@@ -34,6 +34,38 @@ public class GiveCommand {
@@ -192,13 +192,13 @@ index 0d9de4c61c7b26a6ff37c12fde629161fd0c3d5a..c738bbfa73888a0caed507e02f5c113f
})))));
+ // Paper start - support component removals with a custom pgive command
+ final com.mojang.brigadier.tree.CommandNode<net.minecraft.commands.CommandSourceStack> node = net.minecraft.commands.Commands
-+ .literal("pgive").requires((commandlistenerwrapper) -> commandlistenerwrapper.hasPermission(2))
++ .literal("pgive").requires((css) -> css.hasPermission(2))
+ .then(net.minecraft.commands.Commands.argument("targets", EntityArgument.players())
-+ .then(net.minecraft.commands.Commands.argument("item", new ItemArgument(commandRegistryAccess, true)).executes((commandcontext) -> {
-+ return GiveCommand.giveItem((CommandSourceStack) commandcontext.getSource(), ItemArgument.getItem(commandcontext, "item"), EntityArgument.getPlayers(commandcontext, "targets"), 1);
++ .then(net.minecraft.commands.Commands.argument("item", new ItemArgument(commandRegistryAccess, true)).executes((ctx) -> {
++ return GiveCommand.giveItem(ctx.getSource(), ItemArgument.getItem(ctx, "item"), EntityArgument.getPlayers(ctx, "targets"), 1);
+ })
-+ .then(net.minecraft.commands.Commands.argument("count", IntegerArgumentType.integer(1)).executes((commandcontext) -> {
-+ return GiveCommand.giveItem((CommandSourceStack) commandcontext.getSource(), ItemArgument.getItem(commandcontext, "item"), EntityArgument.getPlayers(commandcontext, "targets"), IntegerArgumentType.getInteger(commandcontext, "count"));
++ .then(net.minecraft.commands.Commands.argument("count", IntegerArgumentType.integer(1)).executes((ctx) -> {
++ return GiveCommand.giveItem(ctx.getSource(), ItemArgument.getItem(ctx, "item"), EntityArgument.getPlayers(ctx, "targets"), IntegerArgumentType.getInteger(ctx, "count"));
+ }))
+ )
+ ).build();