SteamWar/SpigotCore
Archiviert
13
0

Enum in a class in a class
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed

Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Chaoscaot 2021-11-23 19:04:15 +01:00
Ursprung 74a4dba9f3
Commit 256e76f9bb

Datei anzeigen

@ -234,7 +234,7 @@ public class SchematicSelector {
inv.setItem(1, item);
}
if(target.target != SelectorTarget.Target.SCHEMATIC_TYPE) {
if(target.target != Target.SCHEMATIC_TYPE) {
InvCallback schemTypeCallback = clickType -> {
if(clickType.isRightClick()) {
filter.setType(null);
@ -271,7 +271,7 @@ public class SchematicSelector {
}
};
final int iSlot = target.target== SelectorTarget.Target.SCHEMATIC_TYPE?2:3;
final int iSlot = target.target == Target.SCHEMATIC_TYPE?2:3;
if(filter.getItem() == null) {
inv.setItem(iSlot, Material.STONE, Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_MAT", player), materialCallback);
@ -306,10 +306,10 @@ public class SchematicSelector {
}
return !filter.matches(node);
});
if(target.target == SelectorTarget.Target.DIRECTORY) {
if(target.target == Target.DIRECTORY) {
nodes.removeIf(node -> !node.isDir());
}
if(target.target == SelectorTarget.Target.SCHEMATIC_TYPE) {
if(target.target == Target.SCHEMATIC_TYPE) {
nodes.removeIf(node -> node.isDir() || !node.getType().equals(target.type.toDB()));
}
return nodes;
@ -351,23 +351,23 @@ public class SchematicSelector {
}
public static SelectorTarget selectSchematic() {
return new SelectorTarget(SelectorTarget.Target.SCHEMATIC, null, -1);
return new SelectorTarget(Target.SCHEMATIC, null, -1);
}
public static SelectorTarget selectDirectory() {
return new SelectorTarget(SelectorTarget.Target.DIRECTORY, null, -1);
return new SelectorTarget(Target.DIRECTORY, null, -1);
}
public static SelectorTarget selectSchematicNode() {
return new SelectorTarget(SelectorTarget.Target.SCHEMATIC_NODE, null, -1);
return new SelectorTarget(Target.SCHEMATIC_NODE, null, -1);
}
public static SelectorTarget selectSchematicType(SchematicType type) {
return new SelectorTarget(SelectorTarget.Target.SCHEMATIC_TYPE, type, -1);
return new SelectorTarget(Target.SCHEMATIC_TYPE, type, -1);
}
public static SelectorTarget selectSchematicTypeWithRank(SchematicType type, int rank) {
return new SelectorTarget(SelectorTarget.Target.SCHEMATIC_TYPE, type, rank);
return new SelectorTarget(Target.SCHEMATIC_TYPE, type, rank);
}
public static class SelectorTarget {
@ -381,22 +381,22 @@ public class SchematicSelector {
this.type = type;
this.rank = rank;
}
}
@AllArgsConstructor
private enum Target {
SCHEMATIC("SCHEM_SELECTOR_SCHEMATIC", false),
DIRECTORY("SCHEM_SELECTOR_DIRECTORY", true),
SCHEMATIC_NODE("SCHEM_SELECTOR_SCHEMATIC_NODE", true),
SCHEMATIC_TYPE("SCHEM_SELECTOR_SCHEMATIC", false);
@AllArgsConstructor
private enum Target {
SCHEMATIC("SCHEM_SELECTOR_SCHEMATIC", false),
DIRECTORY("SCHEM_SELECTOR_DIRECTORY", true),
SCHEMATIC_NODE("SCHEM_SELECTOR_SCHEMATIC_NODE", true),
SCHEMATIC_TYPE("SCHEM_SELECTOR_SCHEMATIC", false);
@Getter
private String rawName;
@Getter
private boolean dirs;
@Getter
private String rawName;
@Getter
private boolean dirs;
public String getName(Player player) {
return Core.MESSAGE.parse(rawName, player);
}
public String getName(Player player) {
return Core.MESSAGE.parse(rawName, player);
}
}