Schematicdownload! #32
@ -126,6 +126,10 @@ class GUI {
|
|||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
changeType(p, schem);
|
changeType(p, schem);
|
||||||
});
|
});
|
||||||
|
inv.setItem(5, SWItem.getMaterial("MAGENTA_GLAZED_TERRACOTTA"), "§eDownload", click -> {
|
||||||
|
p.closeInventory();
|
||||||
|
SchematicCommand.download(p, schem);
|
||||||
|
});
|
||||||
inv.setItem(6, SWItem.getMaterial("SKULL_ITEM"), "§eMitglieder", click -> {
|
inv.setItem(6, SWItem.getMaterial("SKULL_ITEM"), "§eMitglieder", click -> {
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
delmembers(p, schem);
|
delmembers(p, schem);
|
||||||
|
@ -64,6 +64,9 @@ public class SchematicCommand implements CommandExecutor {
|
|||||||
case "delmember":
|
case "delmember":
|
||||||
delmember(player, args);
|
delmember(player, args);
|
||||||
break;
|
break;
|
||||||
|
case "download":
|
||||||
|
download(player, args);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
help(player);
|
help(player);
|
||||||
}
|
}
|
||||||
@ -281,6 +284,13 @@ public class SchematicCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
player.spigot().sendMessage(type);
|
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(download);
|
||||||
|
}
|
||||||
|
|
||||||
List<CheckedSchematic> checkedSchematics = CheckedSchematic.getLastDeclined(player.getUniqueId());
|
List<CheckedSchematic> checkedSchematics = CheckedSchematic.getLastDeclined(player.getUniqueId());
|
||||||
for(int i = checkedSchematics.size() -1; i >= 0; i--) {
|
for(int i = checkedSchematics.size() -1; i >= 0; i--) {
|
||||||
if(checkedSchematics.get(i).getSchemName().equals(schematic.getSchemName()) &&
|
if(checkedSchematics.get(i).getSchemName().equals(schematic.getSchemName()) &&
|
||||||
@ -308,6 +318,28 @@ 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!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendMessage(DownloadSchematic.getLink(schematic));
|
||||||
|
}
|
||||||
|
|
||||||
private void addmember(Player player, String[] args){
|
private void addmember(Player player, String[] args){
|
||||||
if(args.length < 3){
|
if(args.length < 3){
|
||||||
help(player);
|
help(player);
|
||||||
@ -400,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 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 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 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 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");
|
player.sendMessage("§8/§eschem delmember §8[§7Schematic§8] §8[§7Spieler§8] - §7Entfernt einen Spieler von einer Schematic");
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren