13
0
Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Chaoscaot 2021-12-08 18:55:07 +01:00
Ursprung 7c12b38174
Commit cd3915bb89
2 geänderte Dateien mit 22 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -131,7 +131,7 @@ public class GUI {
SteamwarUser owneruser = SteamwarUser.get(node.getOwner());
SWItem skull = SWItem.getPlayerSkull(owneruser.getUserName());
skull.setName("§7von §e" + owneruser.getUserName());
inv.setItem(6, skull);
inv.setItem(6, skull.getItemStack(), clickType -> {});
inv.setItem(8, SWItem.getDye(1), (byte) 1, "§cZugriff entfernen", click -> {
player.closeInventory();

Datei anzeigen

@ -341,6 +341,11 @@ public class SchematicCommand extends SWCommand {
SchematicCommandUtils.changeType(player, node, type, extend);
}
@Register("move")
public void moveToNull(Player player, SchematicNode node) {
move(player, node, "/");
}
@Register("move")
public void move(Player player, SchematicNode node, @Mapper("dirStringMapper") String name) {
SteamwarUser user = getUser(player);
@ -350,7 +355,7 @@ public class SchematicCommand extends SWCommand {
}
if (name.equals("/")) {
node.setParent(0);
node.setParent(null);
} else {
if (name.startsWith("/")) name = name.substring(1);
if (name.endsWith("/")) name = name.substring(0, name.length() - 1);
@ -612,6 +617,21 @@ public class SchematicCommand extends SWCommand {
};
}
@ClassMapper(value = SchematicNode.class, local = true)
public TypeMapper<SchematicNode> nodeTypeMapper() {
return new TypeMapper<SchematicNode>() {
@Override
public List<String> tabCompletes(CommandSender commandSender, String[] strings, String s) {
return SchematicNode.getNodeTabcomplete(getUser((Player) commandSender), s);
}
@Override
public SchematicNode map(CommandSender commandSender, String[] previousArguments, String s) {
return SchematicNode.getNodeFromPath(getUser((Player) commandSender), s);
}
};
}
enum Extend {
AUSFAHREN,
NORMAL