Versionssupport für 1.8, 1.9 und 1.10 #35
@ -126,7 +126,7 @@ class GUI {
|
||||
p.closeInventory();
|
||||
changeType(p, schem);
|
||||
});
|
||||
inv.setItem(5, SWItem.getMaterial(""), "§eDownload", click -> {
|
||||
inv.setItem(5, SWItem.getMaterial("MAGENTA_GLAZED_TERRACOTTA"), "§eDownload", click -> {
|
||||
p.closeInventory();
|
||||
SchematicCommand.download(p, schem);
|
||||
});
|
||||
|
@ -64,6 +64,9 @@ public class SchematicCommand implements CommandExecutor {
|
||||
case "delmember":
|
||||
delmember(player, args);
|
||||
break;
|
||||
case "download":
|
||||
download(player, args);
|
||||
break;
|
||||
default:
|
||||
help(player);
|
||||
}
|
||||
@ -281,6 +284,13 @@ public class SchematicCommand implements CommandExecutor {
|
||||
}
|
||||
player.spigot().sendMessage(type);
|
||||
|
||||
if(SteamwarUser.get(schematic.getSchemOwner()).getUUID().equals(player.getUniqueId())){
|
||||
TextComponent download = new TextComponent("§eDownload Schematic");
|
||||
download.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§eGeneriere Downloadlink")));
|
||||
download.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem download " + schematic.getSchemName()));
|
||||
player.spigot().sendMessage(type);
|
||||
}
|
||||
|
||||
List<CheckedSchematic> checkedSchematics = CheckedSchematic.getLastDeclined(player.getUniqueId());
|
||||
for(int i = checkedSchematics.size() -1; i >= 0; i--) {
|
||||
if(checkedSchematics.get(i).getSchemName().equals(schematic.getSchemName()) &&
|
||||
@ -308,6 +318,19 @@ public class SchematicCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
private void download(Player player, String[] args){
|
||||
if(args.length < 2){
|
||||
help(player);
|
||||
return;
|
||||
}
|
||||
|
||||
Schematic schematic = getSchem(player, args[1]);
|
||||
if(schematic == null)
|
||||
return;
|
||||
|
||||
download(player, schematic);
|
||||
}
|
||||
|
||||
static void download(Player player, Schematic schematic){
|
||||
if(schematic.getSchemOwner() != SteamwarUser.get(player.getUniqueId()).getId()){
|
||||
player.sendMessage("§cDu darfst nur deine eigenen Schematics herunterladen!");
|
||||
@ -409,6 +432,7 @@ public class SchematicCommand implements CommandExecutor {
|
||||
player.sendMessage("§8/§eschem changetype §8[§7Schematic§8] - §7Ändert die Art deiner Schematic");
|
||||
player.sendMessage("§8/§eschem delete §8[§7Schematic§8] - §7Löscht eine Schematic");
|
||||
player.sendMessage("§8/§eschem info §8[§7Schematic§8] - §7Zeigt dir Informationen zur Schematic");
|
||||
player.sendMessage("§8/§eschem download §8[§7Schematic§8] - §7Gibt dir einen Downloadlink (1 min gültig)");
|
||||
player.sendMessage("§8/§eschem addmember §8[§7Schematic§8] §8[§7Spieler§8] - §7Fügt einen Spieler zu einer Schematic hinzu");
|
||||
player.sendMessage("§8/§eschem delmember §8[§7Schematic§8] §8[§7Spieler§8] - §7Entfernt einen Spieler von einer Schematic");
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren