use of me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler in project FluffyMachines by NCBPFluffyBear.
the class AutoAncientAltar method constructMenu.
protected void constructMenu(BlockMenuPreset preset) {
borders(preset, border, inputBorder, outputBorder);
for (int i : getOutputSlots()) {
preset.addMenuClickHandler(i, new AdvancedMenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack cursor, ClickAction action) {
return false;
}
@Override
public boolean onClick(InventoryClickEvent e, Player p, int slot, ItemStack cursor, ClickAction action) {
if (cursor == null)
return true;
return cursor.getType() == Material.AIR;
}
});
}
preset.addItem(2, new CustomItemStack(new ItemStack(Material.ENCHANTING_TABLE), "&eRecipe", "", "&bPut in the Recipe you want to craft", "&4Ancient Altar Recipes ONLY"), (p, slot, item, action) -> false);
}
use of me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler in project Slimefun4 by Slimefun.
the class ProgrammableAndroid method constructMenu.
private void constructMenu(@Nonnull BlockMenuPreset preset) {
preset.drawBackground(BORDER);
preset.drawBackground(ChestMenuUtils.getOutputSlotTexture(), OUTPUT_BORDER);
for (int i : getOutputSlots()) {
preset.addMenuClickHandler(i, new AdvancedMenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack cursor, ClickAction action) {
return false;
}
@Override
public boolean onClick(InventoryClickEvent e, Player p, int slot, ItemStack cursor, ClickAction action) {
return cursor == null || cursor.getType() == null || cursor.getType() == Material.AIR;
}
});
}
preset.addItem(34, getFuelSource().getItem(), ChestMenuUtils.getEmptyClickHandler());
}
use of me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler in project FluffyMachines by NCBPFluffyBear.
the class AutoCraftingTable method constructMenu.
protected void constructMenu(BlockMenuPreset preset) {
AutoAncientAltar.borders(preset, border, inputBorder, outputBorder);
for (int i : keyBorder) {
preset.addItem(i, new CustomItemStack(new ItemStack(Material.YELLOW_STAINED_GLASS_PANE), "&e&lKey Item Slot"), (p, slot, item, action) -> false);
}
preset.addItem(statusSlot, new CustomItemStack(new ItemStack(Material.YELLOW_STAINED_GLASS_PANE), "&e&lIdle"), (p, slot, item, action) -> false);
for (int i : getOutputSlots()) {
preset.addMenuClickHandler(i, new AdvancedMenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack cursor, ClickAction action) {
return false;
}
@Override
public boolean onClick(InventoryClickEvent e, Player p, int slot, ItemStack cursor, ClickAction action) {
if (cursor == null)
return true;
return cursor.getType() == Material.AIR;
}
});
}
preset.addItem(2, new CustomItemStack(new ItemStack(Material.CRAFTING_TABLE), "&eRecipe", "", "&bPut in the Recipe you want to craft", "&ePut in the item you want crafted", "&4Vanilla Crafting Table Recipes ONLY"), (p, slot, item, action) -> false);
}
use of me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler in project DynaTech by ProfElements.
the class AMachineGenerator method constructMenu.
protected void constructMenu(BlockMenuPreset preset) {
for (int i : getBorders().get(0)) {
preset.addItem(i, ChestMenuUtils.getBackground());
preset.addMenuClickHandler(i, ChestMenuUtils.getEmptyClickHandler());
}
for (int i : getBorders().get(1)) {
preset.addItem(i, ChestMenuUtils.getInputSlotTexture());
preset.addMenuClickHandler(i, ChestMenuUtils.getEmptyClickHandler());
}
for (int i : getBorders().get(2)) {
preset.addItem(i, ChestMenuUtils.getOutputSlotTexture());
preset.addMenuClickHandler(i, ChestMenuUtils.getEmptyClickHandler());
}
preset.addItem(getProgressBarSlot(), new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " "));
preset.addMenuClickHandler(getProgressBarSlot(), ChestMenuUtils.getEmptyClickHandler());
for (int i : getOutputSlots()) {
preset.addMenuClickHandler(i, new AdvancedMenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack cursor, ClickAction action) {
return false;
}
@Override
public boolean onClick(InventoryClickEvent e, Player p, int slot, ItemStack cursor, ClickAction action) {
return cursor == null || cursor.getType() == Material.AIR;
}
});
}
}
Aggregations