13
0

Add Copyright and Some Injectable Adjustments

Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Chaoscaot 2021-11-20 11:10:36 +01:00
Ursprung 41ea0beaa4
Commit e28d01ca05

Datei anzeigen

@ -95,6 +95,9 @@ public class SchematicSelector {
if(target.target == SelectorTarget.Target.DIRECTORY) { if(target.target == SelectorTarget.Target.DIRECTORY) {
nodes.removeIf(node -> !node.isDir()); nodes.removeIf(node -> !node.isDir());
} }
if(target.target == SelectorTarget.Target.SCHEMATIC_TYPE) {
nodes.removeIf(node -> node.isDir() || !node.getType().equals(target.type.toDB()));
}
} else { } else {
switch (target.target) { switch (target.target) {
case DIRECTORY: case DIRECTORY:
@ -242,6 +245,7 @@ public class SchematicSelector {
inv.setItem(1, item); inv.setItem(1, item);
} }
if(target.target == SelectorTarget.Target.SCHEMATIC_TYPE) {
InvCallback schemTypeCallback = clickType -> { InvCallback schemTypeCallback = clickType -> {
if(clickType.isRightClick()) { if(clickType.isRightClick()) {
filter.setType(null); filter.setType(null);
@ -264,6 +268,7 @@ public class SchematicSelector {
} else { } else {
inv.setItem(2, SWItem.getMaterial("STONE_BUTTON"), "§7Nach Typ Filtern...", Collections.singletonList("§7Typ: §e" + filter.getType().name()), true, schemTypeCallback); inv.setItem(2, SWItem.getMaterial("STONE_BUTTON"), "§7Nach Typ Filtern...", Collections.singletonList("§7Typ: §e" + filter.getType().name()), true, schemTypeCallback);
} }
}
InvCallback materialCallback = clickType -> { InvCallback materialCallback = clickType -> {
if(clickType.isRightClick()) { if(clickType.isRightClick()) {
@ -277,10 +282,12 @@ public class SchematicSelector {
} }
}; };
final int iSlot = target.target== SelectorTarget.Target.SCHEMATIC_TYPE?2:3;
if(filter.getItem() == null) { if(filter.getItem() == null) {
inv.setItem(3, Material.STONE, "§7Nach Item Filtern...", materialCallback); inv.setItem(iSlot, Material.STONE, "§7Nach Item Filtern...", materialCallback);
} else { } else {
inv.setItem(3, filter.getItem(), "§7Nach Item Filtern...", Collections.singletonList("§7Item: §e" + filter.getItem().name()), true, materialCallback); inv.setItem(iSlot, filter.getItem(), "§7Nach Item Filtern...", Collections.singletonList("§7Item: §e" + filter.getItem().name()), true, materialCallback);
} }
inv.setItem(7, SWItem.getDye(1), "§eAbbrechen", clickType -> { inv.setItem(7, SWItem.getDye(1), "§eAbbrechen", clickType -> {