forked from SteamWar/SteamWar
Remove even more useless stuff
This commit is contained in:
+15
-15
@@ -94,7 +94,7 @@ public class GUI {
|
||||
SteamwarUser user = getUser(player);
|
||||
SWInventory inv = new SWInventory(player, 9 * 2, node.generateBreadcrumbs(user));
|
||||
if(!node.isDir()) {
|
||||
inv.setItem(0, SWItem.getMaterial("WOOD_AXE"), SchematicSystem.MESSAGE.parse("GUI_INFO_LOAD", player), Arrays.asList(
|
||||
inv.setItem(0, Material.WOODEN_AXE, SchematicSystem.MESSAGE.parse("GUI_INFO_LOAD", player), Arrays.asList(
|
||||
SchematicSystem.MESSAGE.parse("GUI_LOAD_LATEST", player),
|
||||
SchematicSystem.MESSAGE.parse("GUI_LOAD_REVISION", player)
|
||||
), false, click -> {
|
||||
@@ -119,14 +119,14 @@ public class GUI {
|
||||
});
|
||||
}
|
||||
|
||||
inv.setItem(9, new SWItem(SWItem.getMaterial("LEASH"), SchematicSystem.MESSAGE.parse("GUI_INFO_BACK", player), clickType -> {
|
||||
inv.setItem(9, new SWItem(Material.LEAD, SchematicSystem.MESSAGE.parse("GUI_INFO_BACK", player), clickType -> {
|
||||
back.reOpen();
|
||||
}).setCustomModelData(CMDs.Schematic.BACK));
|
||||
|
||||
if(node.getOwner() == user.getId()){
|
||||
if(!node.isDir() && node.getSchemtype().writeable()){
|
||||
CheckedSchematic.getLastDeclinedOfNode(node.getId()).stream().findFirst().ifPresent(checkedSchematic ->
|
||||
inv.setItem(1, SWItem.getDye(10), (byte) 10, SchematicSystem.MESSAGE.parse("GUI_INFO_STATUS", player, node.getSchemtype().name()), Collections.singletonList(SchematicSystem.MESSAGE.parse("GUI_INFO_STATUS_LORE", player, checkedSchematic.getDeclineReason().replaceAll("&", "§"))), false, click -> {}));
|
||||
inv.setItem(1, Material.LIME_DYE, (byte) 10, SchematicSystem.MESSAGE.parse("GUI_INFO_STATUS", player, node.getSchemtype().name()), Collections.singletonList(SchematicSystem.MESSAGE.parse("GUI_INFO_STATUS_LORE", player, checkedSchematic.getDeclineReason().replaceAll("&", "§"))), false, click -> {}));
|
||||
}
|
||||
Material mat = SWItem.getMaterial(node.getItem());
|
||||
|
||||
@@ -142,23 +142,23 @@ public class GUI {
|
||||
inv.setItem(6, SWItem.getMaterial(node.getSchemtype().getMaterial()), SchematicSystem.MESSAGE.parse("GUI_INFO_TYPE", player, node.getSchemtype().name()), Arrays.asList(SchematicSystem.MESSAGE.parse("CHANGE", player), SchematicSystem.MESSAGE.parse("CLICK", player)), node.getSchemtype().fightType(), click -> {
|
||||
changeType(player, node);
|
||||
});
|
||||
inv.setItem(7, SWItem.getMaterial("MAGENTA_GLAZED_TERRACOTTA"), SchematicSystem.MESSAGE.parse("GUI_INFO_DOWNLOAD", player), click -> {
|
||||
inv.setItem(7, Material.MAGENTA_GLAZED_TERRACOTTA, SchematicSystem.MESSAGE.parse("GUI_INFO_DOWNLOAD", player), click -> {
|
||||
player.closeInventory();
|
||||
SchematicCommandUtils.download(player, node);
|
||||
});
|
||||
if(node.getSchemtype().fightType()) {
|
||||
inv.setItem(14, SWItem.getMaterial(node.replaceColor() ? "PINK_WOOL" : "LIGHT_GRAY_WOOL"), SchematicSystem.MESSAGE.parse("GUI_INFO_COLOR", player), Arrays.asList(SchematicSystem.MESSAGE.parse("CURRENT", player, SchematicSystem.MESSAGE.parse(node.replaceColor()?"ON":"OFF", player)), SchematicSystem.MESSAGE.parse("CHANGE", player), SchematicSystem.MESSAGE.parse("CLICK", player)), false, clickType -> {
|
||||
inv.setItem(14, node.replaceColor() ? Material.PINK_WOOL : Material.LIGHT_GRAY_WOOL, SchematicSystem.MESSAGE.parse("GUI_INFO_COLOR", player), Arrays.asList(SchematicSystem.MESSAGE.parse("CURRENT", player, SchematicSystem.MESSAGE.parse(node.replaceColor()?"ON":"OFF", player)), SchematicSystem.MESSAGE.parse("CHANGE", player), SchematicSystem.MESSAGE.parse("CLICK", player)), false, clickType -> {
|
||||
node.setReplaceColor(!node.replaceColor());
|
||||
info(player, node, back);
|
||||
});
|
||||
inv.setItem(13, SWItem.getMaterial(node.allowReplay() ? "EYE_OF_ENDER" : "ENDER_PEARL"), SchematicSystem.MESSAGE.parse("GUI_INFO_REPLAY", player), Arrays.asList(SchematicSystem.MESSAGE.parse("CURRENT", player, SchematicSystem.MESSAGE.parse(node.allowReplay()?"ON":"OFF", player)), SchematicSystem.MESSAGE.parse("GUI_INFO_REPLAY_OFF", player), SchematicSystem.MESSAGE.parse("CLICK", player)), false, clickType -> {
|
||||
inv.setItem(13, node.allowReplay() ? Material.ENDER_EYE : Material.ENDER_PEARL, SchematicSystem.MESSAGE.parse("GUI_INFO_REPLAY", player), Arrays.asList(SchematicSystem.MESSAGE.parse("CURRENT", player, SchematicSystem.MESSAGE.parse(node.allowReplay()?"ON":"OFF", player)), SchematicSystem.MESSAGE.parse("GUI_INFO_REPLAY_OFF", player), SchematicSystem.MESSAGE.parse("CLICK", player)), false, clickType -> {
|
||||
if(node.allowReplay()) {
|
||||
SWInventory confInv = new SWInventory(player, 9, SchematicSystem.MESSAGE.parse("GUI_INFO_REPLAY_TITLE", player));
|
||||
confInv.setItem(0, SWItem.getDye(10), (byte) 10, SchematicSystem.MESSAGE.parse("CONFIRM", player), type -> {
|
||||
confInv.setItem(0, Material.LIME_DYE, (byte) 10, SchematicSystem.MESSAGE.parse("CONFIRM", player), type -> {
|
||||
node.setAllowReplay(false);
|
||||
info(player, node, back);
|
||||
});
|
||||
confInv.setItem(8, SWItem.getDye(1), (byte) 1, SchematicSystem.MESSAGE.parse("CANCEL", player), type -> {
|
||||
confInv.setItem(8, Material.RED_DYE, (byte) 1, SchematicSystem.MESSAGE.parse("CANCEL", player), type -> {
|
||||
info(player, node, back);
|
||||
});
|
||||
confInv.open();
|
||||
@@ -188,13 +188,13 @@ public class GUI {
|
||||
anvilInv.open();
|
||||
});
|
||||
if(node.getOwner() != 0) {
|
||||
inv.setItem(17, SWItem.getDye(1), (byte) 1, SchematicSystem.MESSAGE.parse("GUI_INFO_DELETE", player), click -> {
|
||||
inv.setItem(17, Material.RED_DYE, (byte) 1, SchematicSystem.MESSAGE.parse("GUI_INFO_DELETE", player), click -> {
|
||||
delete(player, node, back);
|
||||
});
|
||||
}
|
||||
}else{
|
||||
if(!node.isDir()) {
|
||||
inv.setItem(4, SWItem.getMaterial("CAULDRON_ITEM"), SchematicSystem.MESSAGE.parse("GUI_INFO_TYPE", player, node.getSchemtype().name()), Collections.emptyList(), node.getSchemtype().fightType(), click -> {});
|
||||
inv.setItem(4, Material.CAULDRON, SchematicSystem.MESSAGE.parse("GUI_INFO_TYPE", player, node.getSchemtype().name()), Collections.emptyList(), node.getSchemtype().fightType(), click -> {});
|
||||
}
|
||||
|
||||
SteamwarUser owneruser = SteamwarUser.byId(node.getOwner());
|
||||
@@ -203,7 +203,7 @@ public class GUI {
|
||||
inv.setItem(8, skull.getItemStack(), clickType -> {});
|
||||
|
||||
if(NodeMember.getNodeMember(node.getId(), user.getId()) != null) {
|
||||
inv.setItem(17, SWItem.getDye(1), (byte) 1, SchematicSystem.MESSAGE.parse("GUI_INFO_MEMBER_REMOVE", player), click -> {
|
||||
inv.setItem(17, Material.RED_DYE, (byte) 1, SchematicSystem.MESSAGE.parse("GUI_INFO_MEMBER_REMOVE", player), click -> {
|
||||
delete(player, node, back);
|
||||
});
|
||||
}
|
||||
@@ -269,7 +269,7 @@ public class GUI {
|
||||
private static void deleteOwn(Player p, SchematicNode schem, SchematicSelector back){
|
||||
SteamwarUser user = getUser(p);
|
||||
SWInventory inv = new SWInventory(p, 9, SchematicSystem.MESSAGE.parse("GUI_DELETE_OWN_TITLE", p, schem.generateBreadcrumbs(user)));
|
||||
inv.setItem(0, SWItem.getDye(1), (byte) 1, SchematicSystem.MESSAGE.parse("CONFIRM", p), click -> {
|
||||
inv.setItem(0, Material.RED_DYE, (byte) 1, SchematicSystem.MESSAGE.parse("CONFIRM", p), click -> {
|
||||
p.performCommand("schematic delete " + schem.generateBreadcrumbs(user));
|
||||
|
||||
if(back != null) {
|
||||
@@ -280,7 +280,7 @@ public class GUI {
|
||||
}
|
||||
}
|
||||
});
|
||||
inv.setItem(8, SWItem.getDye(14), (byte) 14, SchematicSystem.MESSAGE.parse("CANCEL", p), click -> p.closeInventory());
|
||||
inv.setItem(8, Material.ORANGE_DYE, (byte) 14, SchematicSystem.MESSAGE.parse("CANCEL", p), click -> p.closeInventory());
|
||||
inv.setCallback(-999, click -> p.closeInventory());
|
||||
inv.open();
|
||||
}
|
||||
@@ -288,7 +288,7 @@ public class GUI {
|
||||
private static void deleteMembership(Player p, SchematicNode schem, SchematicSelector back){
|
||||
SteamwarUser user = getUser(p);
|
||||
SWInventory inv = new SWInventory(p, 9, SchematicSystem.MESSAGE.parse("GUI_DELETE_MEMBER_TITLE", p, schem.generateBreadcrumbs(user)));
|
||||
inv.setItem(0, SWItem.getDye(1), (byte) 1, SchematicSystem.MESSAGE.parse("CONFIRM", p), click -> {
|
||||
inv.setItem(0, Material.RED_DYE, (byte) 1, SchematicSystem.MESSAGE.parse("CONFIRM", p), click -> {
|
||||
NodeMember member = NodeMember.getNodeMember(schem.getId(), user.getId());
|
||||
if(member != null)
|
||||
member.delete();
|
||||
@@ -301,7 +301,7 @@ public class GUI {
|
||||
}
|
||||
}
|
||||
});
|
||||
inv.setItem(8, SWItem.getDye(14), (byte) 14, SchematicSystem.MESSAGE.parse("CANCEL", p), click -> p.closeInventory());
|
||||
inv.setItem(8, Material.ORANGE_DYE, (byte) 14, SchematicSystem.MESSAGE.parse("CANCEL", p), click -> p.closeInventory());
|
||||
inv.setCallback(-999, click -> p.closeInventory());
|
||||
inv.open();
|
||||
}
|
||||
|
||||
+4
-4
@@ -487,20 +487,20 @@ public class SchematicCommandUtils {
|
||||
|
||||
private static void submitSchemGUI(Player player, SchematicNode node, SchematicType type) {
|
||||
SWInventory inv = new SWInventory(player, 9, SchematicSystem.MESSAGE.parse("UTIL_SUBMIT_TITLE", player));
|
||||
inv.setItem(0, SWItem.getMaterial("SIGN"), SchematicSystem.MESSAGE.parse(node.allowReplay()?"UTIL_SUBMIT_REPLAY_ON":"UTIL_SUBMIT_REPLAY_OFF", player), click -> {
|
||||
inv.setItem(0, Material.OAK_SIGN, SchematicSystem.MESSAGE.parse(node.allowReplay()?"UTIL_SUBMIT_REPLAY_ON":"UTIL_SUBMIT_REPLAY_OFF", player), click -> {
|
||||
node.setAllowReplay(!node.allowReplay());
|
||||
submitSchemGUI(player, node, type);
|
||||
});
|
||||
inv.setItem(1, SWItem.getMaterial(node.replaceColor() ? "PINK_WOOL" : "LIGHT_GRAY_WOOL"), SchematicSystem.MESSAGE.parse(node.replaceColor()?"UTIL_SUBMIT_COLOR_ON":"UTIL_SUBMIT_COLOR_OFF", player), click -> {
|
||||
inv.setItem(1, node.replaceColor() ? Material.PINK_WOOL : Material.LIGHT_GRAY_WOOL, SchematicSystem.MESSAGE.parse(node.replaceColor()?"UTIL_SUBMIT_COLOR_ON":"UTIL_SUBMIT_COLOR_OFF", player), click -> {
|
||||
node.setReplaceColor(!node.replaceColor());
|
||||
submitSchemGUI(player, node, type);
|
||||
});
|
||||
inv.setItem(7, SWItem.getDye(7), (byte) 7, SchematicSystem.MESSAGE.parse("UTIL_SUBMIT_DIRECT", player), click -> {
|
||||
inv.setItem(7, Material.LIGHT_GRAY_DYE, (byte) 7, SchematicSystem.MESSAGE.parse("UTIL_SUBMIT_DIRECT", player), click -> {
|
||||
node.setSchemtype(type.checkType());
|
||||
SchematicSystem.MESSAGE.send(type.getManualCheck() ? "UTIL_SUBMIT_DIRECT_DONE" : "UTIL_SUBMIT_DIRECT_PLAYABLE", player);
|
||||
player.closeInventory();
|
||||
});
|
||||
inv.setItem(8, SWItem.getDye(10), (byte) 10, SchematicSystem.MESSAGE.parse("UTIL_SUBMIT_EXTEND", player), click -> {
|
||||
inv.setItem(8, Material.LIME_DYE, (byte) 10, SchematicSystem.MESSAGE.parse("UTIL_SUBMIT_EXTEND", player), click -> {
|
||||
NetworkSender.send(new PrepareSchemPacket(SteamwarUser.get(player.getUniqueId()).getId(), node.getId(), type.toDB()));
|
||||
SchematicSystem.MESSAGE.send("UTIL_SUBMIT_EXTEND_DONE", player);
|
||||
player.closeInventory();
|
||||
|
||||
Reference in New Issue
Block a user