|
33 | 33 | import org.teacon.areacontrol.impl.command.arguments.AreaPropertyArgument; |
34 | 34 | import org.teacon.areacontrol.impl.command.arguments.DirectionArgument; |
35 | 35 | import org.teacon.areacontrol.impl.command.arguments.GroupArgument; |
| 36 | +import org.teacon.areacontrol.impl.seizer.AreaControlBorderControl; |
36 | 37 | import org.teacon.areacontrol.impl.seizer.ConfiscationInvMenuProvider; |
37 | 38 | import org.teacon.areacontrol.mixin.CommandSourceStackAccessor; |
38 | 39 | import org.teacon.areacontrol.network.ACNetworking; |
@@ -162,12 +163,21 @@ public AreaControlCommand(CommandDispatcher<CommandSourceStack> dispatcher) { |
162 | 163 | .then(Commands.literal("mark").requires(OWNER_OR_ADMIN).then( |
163 | 164 | Commands.argument("pos", Vec3Argument.vec3()).executes(AreaControlCommand::mark))) |
164 | 165 | .then(Commands.literal("unclaim").requires(OWNER_OR_ADMIN).executes(AreaControlCommand::unclaim)) |
165 | | - .then(Commands.literal("safe").executes(AreaControlCommand::openConfiscatedItemInv)) |
| 166 | + .then(Commands.literal("safe") |
| 167 | + .then(Commands.literal("clear").executes(AreaControlCommand::clearConfiscatedItemInv) |
| 168 | + ) |
| 169 | + .executes(AreaControlCommand::openConfiscatedItemInv)) |
166 | 170 | ) |
167 | 171 | ) |
168 | 172 | ); |
169 | 173 | } |
170 | 174 |
|
| 175 | + private static int clearConfiscatedItemInv(CommandContext<CommandSourceStack> context) throws CommandSyntaxException{ |
| 176 | + var player = context.getSource().getPlayerOrException(); |
| 177 | + player.getData(AreaControlBorderControl.CONFISCATION_INV.get()).clear(); |
| 178 | + return Command.SINGLE_SUCCESS; |
| 179 | + } |
| 180 | + |
171 | 181 | private static int openConfiscatedItemInv(CommandContext<CommandSourceStack> context) throws CommandSyntaxException{ |
172 | 182 | var player = context.getSource().getPlayerOrException(); |
173 | 183 | player.openMenu(new ConfiscationInvMenuProvider()); |
|
0 commit comments