Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
7cf65a204d
Commit
3fa36c3442
@ -1053,6 +1053,9 @@ PANZERN_PROGRESS = §e{0} §7Blöcke übrig, §e{1} §7Blöcke pro Sekunde, §e{
|
|||||||
PANZERN_DONE = §aZuende gepanzert
|
PANZERN_DONE = §aZuende gepanzert
|
||||||
|
|
||||||
# UTILS
|
# UTILS
|
||||||
|
SKULL_HELP = §8/§eskull §8[§eSpieler§8] §8-§7 Gibt einen SpielerKopf
|
||||||
|
SKULL_ITEM = §e{0}§8s Kopf
|
||||||
|
|
||||||
SPEED_HELP = §8/§espeed §8[§71§8-§710§8|§edefault§8] §8-§7 Setzte deine Flug- und Laufgeschindigkeit.
|
SPEED_HELP = §8/§espeed §8[§71§8-§710§8|§edefault§8] §8-§7 Setzte deine Flug- und Laufgeschindigkeit.
|
||||||
SPEED_CURRENT = §7Aktuelle geschwindigkeit§8: §e{0}
|
SPEED_CURRENT = §7Aktuelle geschwindigkeit§8: §e{0}
|
||||||
SPEED_TOO_SMALL = §c{0} ist zu klein
|
SPEED_TOO_SMALL = §c{0} ist zu klein
|
||||||
|
@ -19,16 +19,22 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.util;
|
package de.steamwar.bausystem.features.util;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
import de.steamwar.bausystem.config.ColorConfig;
|
|
||||||
import de.steamwar.bausystem.linkage.LinkageType;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
|
import de.steamwar.command.TypeMapper;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.SkullMeta;
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Linked(LinkageType.COMMAND)
|
@Linked(LinkageType.COMMAND)
|
||||||
public class SkullCommand extends SWCommand {
|
public class SkullCommand extends SWCommand {
|
||||||
|
|
||||||
@ -36,18 +42,28 @@ public class SkullCommand extends SWCommand {
|
|||||||
super("skull", "head");
|
super("skull", "head");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(help = true)
|
@Register(description = "SKULL_HELP")
|
||||||
public void genericHelp(Player p, String... args) {
|
public void giveCommand(Player p, @Mapper("player") String skull) {
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "skull " + ColorConfig.OTHER + "[" + ColorConfig.HIGHLIGHT + "Spieler" + ColorConfig.OTHER + "] - " + ColorConfig.BASE + "Gibt einen SpielerKopf");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register
|
|
||||||
public void giveCommand(Player p, String skull) {
|
|
||||||
ItemStack is = SWItem.getPlayerSkull(skull).getItemStack();
|
ItemStack is = SWItem.getPlayerSkull(skull).getItemStack();
|
||||||
SkullMeta sm = (SkullMeta) is.getItemMeta();
|
SkullMeta sm = (SkullMeta) is.getItemMeta();
|
||||||
assert sm != null;
|
assert sm != null;
|
||||||
sm.setDisplayName(ColorConfig.HIGHLIGHT + skull + ColorConfig.OTHER + "s Kopf");
|
sm.setDisplayName(BauSystem.MESSAGE.parse("SKULL_ITEM", p, skull));
|
||||||
is.setItemMeta(sm);
|
is.setItemMeta(sm);
|
||||||
SWUtils.giveItemToPlayer(p, is);
|
SWUtils.giveItemToPlayer(p, is);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Mapper(value = "player", local = true)
|
||||||
|
public TypeMapper<String> typeMapper() {
|
||||||
|
return new TypeMapper<String>() {
|
||||||
|
@Override
|
||||||
|
public String map(CommandSender commandSender, String[] previousArguments, String s) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> tabCompletes(CommandSender commandSender, String[] strings, String s) {
|
||||||
|
return Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren