Add SchematicSelector #132
@ -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) {
|
||||
Chaoscaot markierte diese Unterhaltung als gelöst
Veraltet
|
||||
return new SelectorTarget(SelectorTarget.Target.SCHEMATIC_TYPE, type, -1);
|
||||
return new SelectorTarget(Target.SCHEMATIC_TYPE, type, -1);
|
||||
}
|
||||
Chaoscaot markierte diese Unterhaltung als gelöst
Veraltet
Lixfel
hat
Multiling. Multiling.
|
||||
|
||||
public static SelectorTarget selectSchematicTypeWithRank(SchematicType type, int rank) {
|
||||
Chaoscaot markierte diese Unterhaltung als gelöst
Veraltet
Lixfel
hat
Dopplung von SCHEMATIC? Dopplung von SCHEMATIC?
|
||||
return new SelectorTarget(SelectorTarget.Target.SCHEMATIC_TYPE, type, rank);
|
||||
return new SelectorTarget(Target.SCHEMATIC_TYPE, type, rank);
|
||||
}
|
||||
|
||||
Chaoscaot markierte diese Unterhaltung als gelöst
Veraltet
Lixfel
hat
Nachdem alles private im Inneren ist, macht das keinerlei Sinn, das public zu stellen Nachdem alles private im Inneren ist, macht das keinerlei Sinn, das public zu stellen
|
||||
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;
|
||||
Chaoscaot markierte diese Unterhaltung als gelöst
Veraltet
Lixfel
hat
Die Klasse ist private. Wozu getter? Die Klasse ist private. Wozu getter?
|
||||
@Getter
|
||||
private boolean dirs;
|
||||
|
||||
Chaoscaot markierte diese Unterhaltung als gelöst
Veraltet
Lixfel
hat
Klasse private, wozu public? Klasse private, wozu public?
|
||||
public String getName(Player player) {
|
||||
return Core.MESSAGE.parse(rawName, player);
|
||||
}
|
||||
public String getName(Player player) {
|
||||
return Core.MESSAGE.parse(rawName, player);
|
||||
}
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Klasse in der Klasse der Klasse? :/