mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-03-27 01:53:16 +01:00
[WIP] Command Targeting overhaul
This commit is contained in:
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
public final class ClearCommand implements CommandHandler {
|
||||
|
||||
@Override
|
||||
public void execute(Player sender, List<String> args) {
|
||||
public void execute(Player sender, Player targetPlayer, List<String> args) {
|
||||
int target;
|
||||
String cmdSwitch = "";
|
||||
if (sender == null) {
|
||||
@@ -32,7 +32,6 @@ public final class ClearCommand implements CommandHandler {
|
||||
cmdSwitch = args.get(1);
|
||||
target = Integer.parseInt(args.get(0));
|
||||
}
|
||||
Player targetPlayer = Grasscutter.getGameServer().getPlayerByUid(target);
|
||||
switch (cmdSwitch) {
|
||||
case "wp" -> {
|
||||
playerInventory.getItems().values().stream()
|
||||
@@ -99,7 +98,6 @@ public final class ClearCommand implements CommandHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
Player targetPlayer = Grasscutter.getGameServer().getPlayerByUid(target);
|
||||
if (targetPlayer == null) {
|
||||
CommandHandler.sendMessage(sender, Grasscutter.getLanguage().Player_not_found);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user