use of gg.projecteden.nexus.features.resourcepack.models.files.CustomModelFolder in project Nexus by ProjectEdenGG.
the class CustomModelMenu method addFolder.
private static void addFolder(String walk, String folder, String parent) {
CustomModelFolder existing = ResourcePack.getRootFolder().getFolder(walk);
if (existing == null)
if (parent.isEmpty())
ResourcePack.getRootFolder().addFolder(folder);
else
ResourcePack.getRootFolder().getFolder(parent).addFolder(folder);
}
use of gg.projecteden.nexus.features.resourcepack.models.files.CustomModelFolder in project Nexus by ProjectEdenGG.
the class CustomModelMenu method init.
@Override
public void init() {
if (previousMenu == null)
addCloseItem();
else
addBackItem(e -> previousMenu.open(player));
List<ClickableItem> items = new ArrayList<>();
for (CustomModelFolder folder : folder.getFolders()) {
CustomModel firstModel = folder.getIcon();
ItemStack item = new ItemStack(Material.BARRIER);
if (firstModel != null)
item = firstModel.getDisplayItem();
ItemBuilder builder = new ItemBuilder(item).name(folder.getDisplayPath()).glow();
items.add(ClickableItem.of(builder.build(), e -> new CustomModelMenu(folder, this).open(player)));
}
if (!items.isEmpty()) {
while (items.size() % 9 != 0) items.add(ClickableItem.NONE);
for (int i = 0; i < 9; i++) items.add(ClickableItem.NONE);
}
for (CustomModel model : folder.getModels()) {
if (model.getFileName().equals("icon"))
continue;
ItemBuilder item = new ItemBuilder(model.getDisplayItem()).lore("").lore("&7Click to obtain item").lore("&7Shift+Click to obtain item with name");
items.add(ClickableItem.of(item.build(), e -> PlayerUtils.giveItem(player, e.isShiftClick() ? model.getDisplayItem() : model.getItem())));
}
paginator().items(items).build();
}
use of gg.projecteden.nexus.features.resourcepack.models.files.CustomModelFolder in project Nexus by ProjectEdenGG.
the class ResourcePack method setup.
private static void setup() {
modelGroups = new ArrayList<>();
folders = new ArrayList<>();
models = new HashMap<>();
rootFolder = new CustomModelFolder("/");
}
Aggregations