Schemnodes Schematic System #93
@ -32,10 +32,12 @@ import org.bukkit.event.inventory.ClickType;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static de.steamwar.schematicsystem.commands.SchematicCommandUtils.getUser;
|
||||||
|
|
||||||
public class GUI {
|
public class GUI {
|
||||||
|
|
||||||
public static void open(Player player) {
|
public static void open(Player player) {
|
||||||
list(player, SchematicNode.getSchematicsAccessibleByUser(SteamwarUser.get(player.getUniqueId()).getId(), null), false, "/");
|
list(player, SchematicNode.getSchematicsAccessibleByUser(getUser(player).getId(), null), false, "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void list(Player player, List<SchematicNode> schems, boolean publics, String path) {
|
private static void list(Player player, List<SchematicNode> schems, boolean publics, String path) {
|
||||||
@ -48,7 +50,8 @@ public class GUI {
|
|||||||
else
|
else
|
||||||
m = SWItem.getMaterial(schem.getItem());
|
m = SWItem.getMaterial(schem.getItem());
|
||||||
|
|
||||||
SWItem item = new SWItem(m, "§e" + schem.getName(), Collections.singletonList(schem.isDir()?"§9Ordner":"§7" + schem.getSchemtype().name()), schem.isDir()?false:!schem.getSchemtype().writeable(), click -> {});
|
SWItem item = new SWItem(m, "§e" + schem.getName(), Collections.singletonList(schem.isDir() ? "§9Ordner" : "§7" + schem.getSchemtype().name()), !schem.isDir() && !schem.getSchemtype().writeable(), click -> {
|
||||||
|
});
|
||||||
if(!schem.isDir()) {
|
if(!schem.isDir()) {
|
||||||
if(schem.getRank() > 0)
|
if(schem.getRank() > 0)
|
||||||
item.setLore(Lists.newArrayList("§7" + schem.getSchemtype().name(), "§8Rang " + schem.getRank()));
|
item.setLore(Lists.newArrayList("§7" + schem.getSchemtype().name(), "§8Rang " + schem.getRank()));
|
||||||
@ -66,7 +69,7 @@ public class GUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void info(Player player, SchematicNode node) {
|
private static void info(Player player, SchematicNode node) {
|
||||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
SteamwarUser user = getUser(player);
|
||||||
if(node.isDir()) {
|
if(node.isDir()) {
|
||||||
list(player, SchematicNode.getSchematicNodeInNode(node), node.getOwner() == 0, node.generateBreadcrumbs(user));
|
list(player, SchematicNode.getSchematicNodeInNode(node), node.getOwner() == 0, node.generateBreadcrumbs(user));
|
||||||
} else {
|
} else {
|
||||||
@ -156,7 +159,7 @@ public class GUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void deleteOwn(Player p, SchematicNode schem){
|
private static void deleteOwn(Player p, SchematicNode schem){
|
||||||
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
|
SteamwarUser user = getUser(p);
|
||||||
SWInventory inv = new SWInventory(p, 9, schem.generateBreadcrumbs(user) + " löschen");
|
SWInventory inv = new SWInventory(p, 9, schem.generateBreadcrumbs(user) + " löschen");
|
||||||
inv.setItem(0, SWItem.getDye(1), (byte) 1, "§eLöschen", click -> {
|
inv.setItem(0, SWItem.getDye(1), (byte) 1, "§eLöschen", click -> {
|
||||||
schem.delete();
|
schem.delete();
|
||||||
@ -174,7 +177,7 @@ public class GUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void deleteMembership(Player p, SchematicNode schem){
|
private static void deleteMembership(Player p, SchematicNode schem){
|
||||||
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
|
SteamwarUser user = getUser(p);
|
||||||
SWInventory inv = new SWInventory(p, 9, schem.generateBreadcrumbs(user) + " entfernen");
|
SWInventory inv = new SWInventory(p, 9, schem.generateBreadcrumbs(user) + " entfernen");
|
||||||
inv.setItem(0, SWItem.getDye(1), (byte) 1, "§eZugriff entfernen", click -> {
|
inv.setItem(0, SWItem.getDye(1), (byte) 1, "§eZugriff entfernen", click -> {
|
||||||
NodeMember member = NodeMember.getNodeMember(schem.getId(), user.getId());
|
NodeMember member = NodeMember.getNodeMember(schem.getId(), user.getId());
|
||||||
@ -232,7 +235,7 @@ public class GUI {
|
|||||||
SWAnvilInv inv = new SWAnvilInv(player, "Schematics suchen");
|
SWAnvilInv inv = new SWAnvilInv(player, "Schematics suchen");
|
||||||
inv.setItem(SWItem.getMaterial("CAULDRON_ITEM"));
|
inv.setItem(SWItem.getMaterial("CAULDRON_ITEM"));
|
||||||
inv.setCallback(s -> {
|
inv.setCallback(s -> {
|
||||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
SteamwarUser user = getUser(player);
|
||||||
list(player, SchematicNode.filterSchems(publics?0:user.getId(), node -> node.getName().contains(s)), publics, "/");
|
list(player, SchematicNode.filterSchems(publics?0:user.getId(), node -> node.getName().contains(s)), publics, "/");
|
||||||
});
|
});
|
||||||
inv.open();
|
inv.open();
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren