mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-08-28 08:25:56 +02:00
item config group config gui
This commit is contained in:
parent
4291e41eaa
commit
71568f8a0b
2 changed files with 25 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package xyz.alexcrea.cuanvil.gui.config.global;
|
package xyz.alexcrea.cuanvil.gui.config.global;
|
||||||
|
|
||||||
import com.github.stefvanschie.inventoryframework.gui.GuiItem;
|
import com.github.stefvanschie.inventoryframework.gui.GuiItem;
|
||||||
|
import com.github.stefvanschie.inventoryframework.gui.type.util.Gui;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.inventory.ItemFlag;
|
import org.bukkit.inventory.ItemFlag;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
@ -43,6 +44,10 @@ public class GroupConfigGui extends MappedGuiListConfigGui<IncludeGroup, MappedG
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GroupConfigGui(Gui parent) {
|
||||||
|
super("Group Config", parent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ItemStack createItemForGeneric(IncludeGroup group) {
|
protected ItemStack createItemForGeneric(IncludeGroup group) {
|
||||||
ItemStack item = new ItemStack(group.getRepresentativeMaterial());
|
ItemStack item = new ItemStack(group.getRepresentativeMaterial());
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ import java.util.Collections;
|
||||||
public class ItemConfigGui extends ChestGui {
|
public class ItemConfigGui extends ChestGui {
|
||||||
|
|
||||||
public EnchantConflictGui enchantConflictGui;
|
public EnchantConflictGui enchantConflictGui;
|
||||||
|
public GroupConfigGui groupConfigGui;
|
||||||
|
public UnitRepairConfigGui unitRepairConfigGui;
|
||||||
|
public CustomRecipeConfigGui customRecipeConfigGui;
|
||||||
|
|
||||||
public ItemConfigGui(Material display, NamespacedKey material) {
|
public ItemConfigGui(Material display, NamespacedKey material) {
|
||||||
super(3, material.getKey() + " Config", CustomAnvil.instance);
|
super(3, material.getKey() + " Config", CustomAnvil.instance);
|
||||||
|
|
@ -62,7 +64,7 @@ public class ItemConfigGui extends ChestGui {
|
||||||
groupMeta.setLore(Collections.singletonList("§7Click here to open item group menu"));
|
groupMeta.setLore(Collections.singletonList("§7Click here to open item group menu"));
|
||||||
groupItemstack.setItemMeta(groupMeta);
|
groupItemstack.setItemMeta(groupMeta);
|
||||||
|
|
||||||
GuiItem groupConfigItem = GuiGlobalItems.goToGuiItem(groupItemstack, GroupConfigGui.getInstance());
|
GuiItem groupConfigItem = GuiGlobalItems.goToGuiItem(groupItemstack, getGroupConfigGui(material));
|
||||||
|
|
||||||
pane.bindItem('6', groupConfigItem);
|
pane.bindItem('6', groupConfigItem);
|
||||||
|
|
||||||
|
|
@ -75,6 +77,7 @@ public class ItemConfigGui extends ChestGui {
|
||||||
unitRepairMeta.setLore(Collections.singletonList("§7Click here to open anvil unit repair menu"));
|
unitRepairMeta.setLore(Collections.singletonList("§7Click here to open anvil unit repair menu"));
|
||||||
unirRepairItemstack.setItemMeta(unitRepairMeta);
|
unirRepairItemstack.setItemMeta(unitRepairMeta);
|
||||||
|
|
||||||
|
//TODO
|
||||||
GuiItem unitRepairItem = GuiGlobalItems.goToGuiItem(unirRepairItemstack, UnitRepairConfigGui.getInstance());
|
GuiItem unitRepairItem = GuiGlobalItems.goToGuiItem(unirRepairItemstack, UnitRepairConfigGui.getInstance());
|
||||||
pane.bindItem('7', unitRepairItem);
|
pane.bindItem('7', unitRepairItem);
|
||||||
|
|
||||||
|
|
@ -87,12 +90,12 @@ public class ItemConfigGui extends ChestGui {
|
||||||
customRecipeMeta.setLore(Collections.singletonList("§7Click here to open anvil custom recipe menu"));
|
customRecipeMeta.setLore(Collections.singletonList("§7Click here to open anvil custom recipe menu"));
|
||||||
customRecipeItemstack.setItemMeta(customRecipeMeta);
|
customRecipeItemstack.setItemMeta(customRecipeMeta);
|
||||||
|
|
||||||
|
//TODO
|
||||||
GuiItem customRecipeItem = GuiGlobalItems.goToGuiItem(customRecipeItemstack, CustomRecipeConfigGui.getInstance());
|
GuiItem customRecipeItem = GuiGlobalItems.goToGuiItem(customRecipeItemstack, CustomRecipeConfigGui.getInstance());
|
||||||
pane.bindItem('8', customRecipeItem);
|
pane.bindItem('8', customRecipeItem);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Gui getEnchantConflictGui(NamespacedKey material) {
|
private EnchantConflictGui getEnchantConflictGui(NamespacedKey material) {
|
||||||
if (enchantConflictGui == null) {
|
if (enchantConflictGui == null) {
|
||||||
enchantConflictGui = new EnchantConflictGui(this);
|
enchantConflictGui = new EnchantConflictGui(this);
|
||||||
enchantConflictGui.setFilter(group ->
|
enchantConflictGui.setFilter(group ->
|
||||||
|
|
@ -103,4 +106,17 @@ public class ItemConfigGui extends ChestGui {
|
||||||
|
|
||||||
return enchantConflictGui;
|
return enchantConflictGui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private GroupConfigGui getGroupConfigGui(NamespacedKey material) {
|
||||||
|
if (groupConfigGui == null) {
|
||||||
|
groupConfigGui = new GroupConfigGui(this);
|
||||||
|
groupConfigGui.setFilter(group ->
|
||||||
|
group.contain(material)
|
||||||
|
);
|
||||||
|
groupConfigGui.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
return groupConfigGui;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue