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) {
nodes.removeIf(node -> !node.isDir());
}
if(target.target == SelectorTarget.Target.SCHEMATIC_TYPE) {
nodes.removeIf(node -> node.isDir() || !node.getType().equals(target.type.toDB()));
}
} else {
switch (target.target) {
case DIRECTORY:
@ -242,27 +245,29 @@ public class SchematicSelector {
inv.setItem(1, item);
}
InvCallback schemTypeCallback = clickType -> {
if(clickType.isRightClick()) {
filter.setType(null);
openFilter(publics);
} else {
List<SWListInv.SWListEntry<SchematicType>> types = new ArrayList<>();
SchematicType.values().forEach(schematicType -> {
types.add(new SWListInv.SWListEntry<>(new SWItem(SWItem.getMaterial("STONE_BUTTON"), "§e" + schematicType.name(), Collections.emptyList(), schematicType.fightType(), n -> {}), schematicType));
});
SWListInv<SchematicType> listInv = new SWListInv<>(player, "Typ wählen...", types, (clickType1, schematicType) -> {
filter.setType(schematicType);
if(target.target == SelectorTarget.Target.SCHEMATIC_TYPE) {
InvCallback schemTypeCallback = clickType -> {
if(clickType.isRightClick()) {
filter.setType(null);
openFilter(publics);
});
listInv.open();
}
};
} else {
List<SWListInv.SWListEntry<SchematicType>> types = new ArrayList<>();
SchematicType.values().forEach(schematicType -> {
types.add(new SWListInv.SWListEntry<>(new SWItem(SWItem.getMaterial("STONE_BUTTON"), "§e" + schematicType.name(), Collections.emptyList(), schematicType.fightType(), n -> {}), schematicType));
});
SWListInv<SchematicType> listInv = new SWListInv<>(player, "Typ wählen...", types, (clickType1, schematicType) -> {
filter.setType(schematicType);
openFilter(publics);
});
listInv.open();
}
};
if(filter.getType() == null) {
inv.setItem(2, SWItem.getMaterial("STONE_BUTTON"), "§7Nach Typ Filtern...", schemTypeCallback);
} else {
inv.setItem(2, SWItem.getMaterial("STONE_BUTTON"), "§7Nach Typ Filtern...", Collections.singletonList("§7Typ: §e" + filter.getType().name()), true, schemTypeCallback);
if(filter.getType() == null) {
inv.setItem(2, SWItem.getMaterial("STONE_BUTTON"), "§7Nach Typ Filtern...", schemTypeCallback);
} else {
inv.setItem(2, SWItem.getMaterial("STONE_BUTTON"), "§7Nach Typ Filtern...", Collections.singletonList("§7Typ: §e" + filter.getType().name()), true, schemTypeCallback);
}
}
InvCallback materialCallback = clickType -> {
@ -277,10 +282,12 @@ public class SchematicSelector {
}
};
final int iSlot = target.target== SelectorTarget.Target.SCHEMATIC_TYPE?2:3;
if(filter.getItem() == null) {
inv.setItem(3, Material.STONE, "§7Nach Item Filtern...", materialCallback);
inv.setItem(iSlot, Material.STONE, "§7Nach Item Filtern...", materialCallback);
} 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 -> {