Initial commit
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ProjectCranked</artifactId>
|
||||
<groupId>net.crankedpvp</groupId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>Help</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>Utils</artifactId>
|
||||
<groupId>net.crankedpvp</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>Armor</artifactId>
|
||||
<groupId>net.crankedpvp</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>Pets</artifactId>
|
||||
<groupId>net.crankedpvp</groupId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.crankedpvp</groupId>
|
||||
<artifactId>AdminArmor</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>Enchants</artifactId>
|
||||
<groupId>net.crankedpvp</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>Bosses</artifactId>
|
||||
<groupId>net.crankedpvp</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>Masks</artifactId>
|
||||
<groupId>net.crankedpvp</groupId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.crankedpvp</groupId>
|
||||
<artifactId>AdminWeapons</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.crankedpvp</groupId>
|
||||
<artifactId>StarItems</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,27 @@
|
||||
package net.crankedpvp.help;
|
||||
|
||||
import lombok.Getter;
|
||||
import me.mattstudios.mf.base.CommandManager;
|
||||
import net.crankedpvp.help.commands.HelpCommand;
|
||||
import net.crankedpvp.help.struct.InventoryManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class HelpPlugin extends JavaPlugin {
|
||||
|
||||
@Getter
|
||||
private static HelpPlugin instance;
|
||||
|
||||
@Getter
|
||||
private InventoryManager inventoryManager;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
|
||||
CommandManager commandManager = new CommandManager(this);
|
||||
commandManager.register(new HelpCommand(this));
|
||||
|
||||
this.inventoryManager = new InventoryManager(this);
|
||||
this.inventoryManager.initializeInventories();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package net.crankedpvp.help.commands;
|
||||
|
||||
import me.mattstudios.mf.annotations.Alias;
|
||||
import me.mattstudios.mf.annotations.Command;
|
||||
import me.mattstudios.mf.annotations.Default;
|
||||
import me.mattstudios.mf.annotations.SubCommand;
|
||||
import me.mattstudios.mf.base.CommandBase;
|
||||
import net.crankedpvp.crankedmasks.inventory.MasksInventory;
|
||||
import net.crankedpvp.crankedpets.inventory.PetsInventory;
|
||||
import net.crankedpvp.crankedpets.inventory.PetsMainInventory;
|
||||
import net.crankedpvp.help.HelpPlugin;
|
||||
import net.crankedpvp.help.inventory.FactionsHelpInventory;
|
||||
import net.crankedpvp.help.inventory.HelpInventory;
|
||||
import net.crankedpvp.help.inventory.PvPHelpInventory;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@Command("help")
|
||||
@Alias("helpp")
|
||||
public class HelpCommand extends CommandBase {
|
||||
|
||||
private final HelpPlugin plugin;
|
||||
public HelpCommand(HelpPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Default
|
||||
public void defaultCommand(final Player player) {
|
||||
HelpInventory helpInventory = this.plugin.getInventoryManager().getHelpInventory();
|
||||
helpInventory.getHelpMenuInventory().open(player);
|
||||
player.playSound(player.getLocation(), Sound.CHEST_OPEN, 2.0F, 2.0F);
|
||||
}
|
||||
|
||||
@SubCommand("factions")
|
||||
@Alias("faction")
|
||||
public void factionsHelpCommand(final Player player) {
|
||||
FactionsHelpInventory factionsHelpInventory = this.plugin.getInventoryManager().getFactionsHelpInventory();
|
||||
factionsHelpInventory.getFactionsHelpInventory().open(player);
|
||||
player.playSound(player.getLocation(), Sound.CHEST_OPEN, 2.0F, 2.0F);
|
||||
}
|
||||
|
||||
@SubCommand("pvp")
|
||||
public void pvpHelpCommand(final Player player) {
|
||||
PvPHelpInventory pvPHelpInventory = this.plugin.getInventoryManager().getPvPHelpInventory();
|
||||
pvPHelpInventory.getPvpHelpMenu().open(player);
|
||||
player.playSound(player.getLocation(), Sound.CHEST_OPEN, 2.0F, 2.0F);
|
||||
}
|
||||
|
||||
@SubCommand("pet")
|
||||
@Alias("pets")
|
||||
public void petHelpCommand(final Player player) {
|
||||
PetsMainInventory petsInventory = this.plugin.getInventoryManager().getPetsInventory();
|
||||
petsInventory.getUI().open(player);
|
||||
player.playSound(player.getLocation(), Sound.CHEST_OPEN, 2.0F, 2.0F);
|
||||
}
|
||||
|
||||
@SubCommand("mask")
|
||||
@Alias("masks")
|
||||
public void maskHelpCommand(final Player player) {
|
||||
MasksInventory masksInventory = this.plugin.getInventoryManager().getMasksInventory();
|
||||
masksInventory.getUI().open(player);
|
||||
player.playSound(player.getLocation(), Sound.CHEST_OPEN, 2.0F, 2.0F);
|
||||
}
|
||||
|
||||
@SubCommand("underworld")
|
||||
@Alias({"uw", "uworld", "underw"})
|
||||
public void underworldHelpCommand(final Player player) {
|
||||
player.playSound(player.getLocation(), Sound.CHEST_OPEN, 2.0F, 2.0F);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package net.crankedpvp.help.inventory;
|
||||
|
||||
import dev.triumphteam.gui.guis.Gui;
|
||||
import dev.triumphteam.gui.guis.GuiItem;
|
||||
import lombok.Getter;
|
||||
import net.crankedpvp.crankedutils.utils.items.ItemBuilder;
|
||||
import net.crankedpvp.help.HelpPlugin;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class FactionsHelpInventory {
|
||||
|
||||
@Getter
|
||||
private final Gui factionsHelpInventory;
|
||||
|
||||
public FactionsHelpInventory() {
|
||||
this.factionsHelpInventory = new Gui(6, "Factions Help Menu");
|
||||
this.factionsHelpInventory.setDefaultClickAction(event -> event.setCancelled(true));
|
||||
this.factionsHelpInventory.getFiller().fillBorder(new GuiItem(setupFillerItem()));
|
||||
|
||||
this.setupInformationItem();
|
||||
this.setupGoBackButton();
|
||||
}
|
||||
|
||||
private void setupGoBackButton() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.REDSTONE, "&cGo Back", "&7Click here to return to",
|
||||
"&7the previous inventory");
|
||||
this.factionsHelpInventory.setItem(6, 1, new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
HelpInventory helpInventory = HelpPlugin.getInstance().getInventoryManager().getHelpInventory();
|
||||
helpInventory.getHelpMenuInventory().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private ItemStack setupFillerItem() {
|
||||
return new ItemBuilder(Material.STAINED_GLASS_PANE, 1, DyeColor.BLACK.getWoolData(), "&cCranked&fPvP")
|
||||
.colorize()
|
||||
.build();
|
||||
}
|
||||
|
||||
private void setupInformationItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.BOOK, "&6&lFactions Help Menu",
|
||||
"&7This inventory will guide you through",
|
||||
"&7the use of &f'Factions' &7on the server",
|
||||
"",
|
||||
"&7If you get stuck, or this menu does",
|
||||
"&7not give a sufficient amount of",
|
||||
"&7information, feel free to open a",
|
||||
"&7support ticket in the cranked discord",
|
||||
"",
|
||||
"&fDiscord: &7discord.gg/crankedpvp");
|
||||
this.factionsHelpInventory.setItem(1, 5, new GuiItem(itemBuilder.colorize().build()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package net.crankedpvp.help.inventory;
|
||||
|
||||
import dev.triumphteam.gui.guis.Gui;
|
||||
import dev.triumphteam.gui.guis.GuiItem;
|
||||
import lombok.Getter;
|
||||
import net.crankedpvp.crankedutils.utils.SoundUtils;
|
||||
import net.crankedpvp.crankedutils.utils.items.ItemBuilder;
|
||||
import net.crankedpvp.help.HelpPlugin;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
|
||||
public class HelpInventory {
|
||||
|
||||
@Getter
|
||||
private final Gui helpMenuInventory;
|
||||
|
||||
public HelpInventory() {
|
||||
this.helpMenuInventory = new Gui(1, "CrankedPvP Help Menu");
|
||||
this.helpMenuInventory.setDefaultClickAction(event -> event.setCancelled(true));
|
||||
setupInformationItem();
|
||||
setupPvPHelpItem();
|
||||
setupFactionsHelpItem();
|
||||
setupUnderworldHelpItem();
|
||||
setupStartingHelpItem();
|
||||
|
||||
}
|
||||
|
||||
private void setupStartingHelpItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.PAPER, "&a&lGetting Started",
|
||||
"&7This menu will show you the basics",
|
||||
"&7of the features on the server",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto get started"
|
||||
);
|
||||
this.helpMenuInventory.setItem(1, new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
StartHelpInventory startHelpInventory = HelpPlugin.getInstance().getInventoryManager().getStartHelpInventory();
|
||||
startHelpInventory.getStartingHelpInventory().open(event.getWhoClicked());
|
||||
SoundUtils.playSoundIfPlayer(event.getWhoClicked(), Sound.CHEST_OPEN);
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupPvPHelpItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.DIAMOND_SWORD, "&c&lPvP Help",
|
||||
"&7This menu will show you the pvp",
|
||||
"&7related features on this server",
|
||||
"",
|
||||
"&7PvP related features include, but",
|
||||
"&7are not limited to: enchants, armor",
|
||||
"&7sets, pets, bosses, masks",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view pvp help"
|
||||
);
|
||||
this.helpMenuInventory.setItem(3, new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
PvPHelpInventory pvPHelpInventory = HelpPlugin.getInstance().getInventoryManager().getPvPHelpInventory();
|
||||
pvPHelpInventory.getPvpHelpMenu().open(event.getWhoClicked());
|
||||
SoundUtils.playSoundIfPlayer(event.getWhoClicked(), Sound.CHEST_OPEN);
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupFactionsHelpItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.DIAMOND_SWORD, "&a&lFactions Help",
|
||||
"&7This menu will show you the factions",
|
||||
"&7related features on this server",
|
||||
"",
|
||||
"&7Faction related features include, but",
|
||||
"&7are not limited to: shields, spawners",
|
||||
"&7bases, grace period, logs and upgrades",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view factions help"
|
||||
);
|
||||
this.helpMenuInventory.setItem(2, new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
FactionsHelpInventory factionsHelpInventory = HelpPlugin.getInstance().getInventoryManager().getFactionsHelpInventory();
|
||||
factionsHelpInventory.getFactionsHelpInventory().open(event.getWhoClicked());
|
||||
SoundUtils.playSoundIfPlayer(event.getWhoClicked(), Sound.CHEST_OPEN);
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupUnderworldHelpItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.EYE_OF_ENDER, "&c&lUnderworld Help",
|
||||
"&7This menu will show you the underworld",
|
||||
"&7related features on this server",
|
||||
"",
|
||||
"&7The underworld is a PvE zone where",
|
||||
"&7players fight mobs & collect rewards",
|
||||
"&7scaling up based on their underworld tier",
|
||||
"",
|
||||
"&7The higher underworld tier you are, the",
|
||||
"&7better the rewards you will receive from",
|
||||
"&7both underworld mobs and underworld chests",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view underworld help"
|
||||
);
|
||||
this.helpMenuInventory.setItem(4, new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
SoundUtils.playSoundIfPlayer(event.getWhoClicked(), Sound.CHEST_OPEN);
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupInformationItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.BOOK, "&b&lHelp Menu",
|
||||
"&7This inventory will guide you through",
|
||||
"&7all of the features on the server",
|
||||
"",
|
||||
"&7If you get stuck, or this menu does",
|
||||
"&7not give a sufficient amount of",
|
||||
"&7information, feel free to open a",
|
||||
"&7support ticket in the cranked discord",
|
||||
"",
|
||||
"&fDiscord: &7discord.gg/crankedpvp");
|
||||
this.helpMenuInventory.setItem(0, new GuiItem(itemBuilder.colorize().build()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
package net.crankedpvp.help.inventory;
|
||||
|
||||
import dev.triumphteam.gui.guis.Gui;
|
||||
import dev.triumphteam.gui.guis.GuiItem;
|
||||
import lombok.Getter;
|
||||
import net.crankedpvp.adminarmor.inventory.AdminArmorInventory;
|
||||
import net.crankedpvp.adminweapons.inventory.AdminWeaponsInventory;
|
||||
import net.crankedpvp.bosses.inventory.BossesInventory;
|
||||
import net.crankedpvp.crankedarmor.inventory.ArmorSetsInventory;
|
||||
import net.crankedpvp.crankedenchants.inventories.MainEnchantsUI;
|
||||
import net.crankedpvp.crankedmasks.inventory.MasksInventory;
|
||||
import net.crankedpvp.crankedpets.inventory.PetsInventory;
|
||||
import net.crankedpvp.crankedpets.inventory.PetsMainInventory;
|
||||
import net.crankedpvp.crankedutils.utils.items.ItemBuilder;
|
||||
import net.crankedpvp.crankedutils.utils.items.SkullUtils;
|
||||
import net.crankedpvp.help.HelpPlugin;
|
||||
import net.crankedpvp.staritems.inventory.StarItemsInventory;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class PvPHelpInventory {
|
||||
|
||||
@Getter
|
||||
private final Gui pvpHelpMenu;
|
||||
|
||||
public PvPHelpInventory() {
|
||||
this.pvpHelpMenu = new Gui(6, "PvP Help Menu");
|
||||
this.pvpHelpMenu.setDefaultClickAction(event -> event.setCancelled(true));
|
||||
this.pvpHelpMenu.getFiller().fillBorder(new GuiItem(setupFillerItem()));
|
||||
|
||||
this.setupInformationItem();
|
||||
this.setupEnchantsItem();
|
||||
this.setupArmorSetsItem();
|
||||
this.setupMasksItem();
|
||||
this.setupBossesItem();
|
||||
this.setupPetsItem();
|
||||
this.setupStarItemsItem();
|
||||
this.setupAdminWeaponsItem();
|
||||
this.setupAdminArmorItem();
|
||||
this.setupGoBackButton();
|
||||
}
|
||||
|
||||
private void setupGoBackButton() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.REDSTONE, "&cGo Back", "&7Click here to return to",
|
||||
"&7the previous inventory");
|
||||
this.pvpHelpMenu.setItem(6, 1, new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
HelpInventory helpInventory = HelpPlugin.getInstance().getInventoryManager().getHelpInventory();
|
||||
helpInventory.getHelpMenuInventory().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupPetsItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(SkullUtils.getSkull("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2U4OTI4NjY5MjZiNGQzYjk4NmRhNzk3YTUxYWUxOGU3NjJlNmQ4YTZjNzg5N2Q4YmQ5MDc3MzY1Y2I4ZTBmYSJ9fX0="));
|
||||
itemBuilder.setName("&b&lPets");
|
||||
itemBuilder.setLore(
|
||||
"&7Pets are &fphysical &7items which",
|
||||
"&7players can use to gain a buff",
|
||||
"",
|
||||
"&7Each pet has an individual &ccooldown&7,",
|
||||
"&7and also a &elevel&7. Pets cannot be used",
|
||||
"&7while on cooldown. Once used, they gain",
|
||||
"&7pet &fexperience&7. Once a pet has enough",
|
||||
"&7experience, it levels up. Enhancing it's",
|
||||
"&7pet &eabilities&7.",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view ALL pets");
|
||||
this.pvpHelpMenu.addItem(new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
PetsMainInventory petsInventory = HelpPlugin.getInstance().getInventoryManager().getPetsInventory();
|
||||
petsInventory.getUI().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupEnchantsItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.BOOK, "&d&lEnchantments",
|
||||
"&7Enchantments are items which can be",
|
||||
"&7applied to &farmor/weapons/tools&7, each",
|
||||
"&7enchantment useful for something &aunique",
|
||||
"",
|
||||
"&7Enchantments are usually used to create",
|
||||
"&7a &f'God Set' &7which is an armor set that",
|
||||
"&7has the best enchants on and can be used",
|
||||
"&7to fight other players.",
|
||||
"",
|
||||
"&7There is a &climit &7on how many enchantments",
|
||||
"&7you can put on an item, so make sure you",
|
||||
"&7choose the &abest &7ones. The default limit",
|
||||
"&7is &n9&r&7 enchants, however &f'Enchantment Orbs'",
|
||||
"&7can allow you to apply &fmore enchantments.",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view ALL enchantments");
|
||||
this.pvpHelpMenu.addItem(new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
MainEnchantsUI enchantsUI = HelpPlugin.getInstance().getInventoryManager().getEnchantsInventory();
|
||||
enchantsUI.getEnchantsGUI().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupArmorSetsItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.DIAMOND_CHESTPLATE, "&e&lArmor Sets",
|
||||
"&7Armor Sets are special sets that",
|
||||
"&7players can &fequip &7to give them",
|
||||
"&7special &fbuffs.",
|
||||
"",
|
||||
"&7In order for the &fspecial set &7to",
|
||||
"&7work, you must wear &f&nALL&r &ffour pieces",
|
||||
"&7of the armor set at the &fsame time",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view ALL sets");
|
||||
this.pvpHelpMenu.addItem(new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
ArmorSetsInventory armorSetsInventory = new ArmorSetsInventory(((Player) event.getWhoClicked()));
|
||||
armorSetsInventory.getUI().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupMasksItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(SkullUtils.getSkull("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjM4YzUzZTY2ZjI4Y2YyYzdmYjE1MjNjOWU1ZGUxYWUwY2Y0ZDdhMWZhZjU1M2U3NTI0OTRhOGQ2ZDJlMzIifX19"));
|
||||
itemBuilder.setName("&a&lMasks");
|
||||
itemBuilder.setLore(
|
||||
"&7Masks are items that can be",
|
||||
"&7applied onto any &fhelmet &7to give",
|
||||
"&7it a &fvisual override",
|
||||
"",
|
||||
"&7There are different types of",
|
||||
"&7masks, each with it's own",
|
||||
"&eabilities &7and &fvisual overrides",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view ALL masks");
|
||||
this.pvpHelpMenu.addItem(new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
MasksInventory masksInventory = HelpPlugin.getInstance().getInventoryManager().getMasksInventory();
|
||||
masksInventory.getUI().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupStarItemsItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.SPONGE, 1, (short) 1);
|
||||
itemBuilder.setName("&d&lStar Items");
|
||||
itemBuilder.setLore(
|
||||
"&7Star items are items that can be",
|
||||
"&7applied onto any &fhelmet &7to give",
|
||||
"&7it a &fvisual override",
|
||||
"",
|
||||
"&7There are different types of",
|
||||
"&7star items, each with it's own",
|
||||
"&eabilities &7and &fvisual overrides",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view ALL star items");
|
||||
this.pvpHelpMenu.addItem(new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
StarItemsInventory starItemsInventory = HelpPlugin.getInstance().getInventoryManager().getStarItemsInventory();
|
||||
starItemsInventory.getUI().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupAdminWeaponsItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.DIAMOND_SWORD);
|
||||
itemBuilder.setName("&c&lAdmin Weapons");
|
||||
itemBuilder.setLore(
|
||||
"&7Admin weapons are special weapons",
|
||||
"&7that have individual abilities",
|
||||
"",
|
||||
"&7These admin weapons can be used with",
|
||||
"&7any set type.",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view ALL admin weapons");
|
||||
this.pvpHelpMenu.addItem(new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
AdminWeaponsInventory adminWeaponsInventory = HelpPlugin.getInstance().getInventoryManager().getAdminWeaponsInventory();
|
||||
adminWeaponsInventory.getUI().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupAdminArmorItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.DIAMOND_CHESTPLATE);
|
||||
itemBuilder.setName("&c&lAdmin Armor");
|
||||
itemBuilder.setLore(
|
||||
"&7Admin armor are special armor",
|
||||
"&7with intensified protection and",
|
||||
"&7a range of impressive enchantments",
|
||||
"",
|
||||
"&7These pieces of admin armor can only",
|
||||
"&7be used with the specified armor set type.",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view ALL admin armor");
|
||||
this.pvpHelpMenu.addItem(new GuiItem(itemBuilder.setGlowing().colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
AdminArmorInventory adminArmorInventory = HelpPlugin.getInstance().getInventoryManager().getAdminArmorInventory();
|
||||
adminArmorInventory.getUI().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupBossesItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.MONSTER_EGG, 1, (short) 51);
|
||||
itemBuilder.setName("&6&lBosses");
|
||||
itemBuilder.setLore(
|
||||
"&7Bosses are &cpowerful &7ai &7that",
|
||||
"&cattack &7players and drop &fhigh tier",
|
||||
"&7loot when they die.",
|
||||
"",
|
||||
"&7There are different &ftiers &7of bosses,",
|
||||
"&7each having different &chealth&7, abilities",
|
||||
"&7and loot drops.",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view ALL bosses");
|
||||
this.pvpHelpMenu.addItem(new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
BossesInventory bossesInventory = HelpPlugin.getInstance().getInventoryManager().getBossesInventory();
|
||||
bossesInventory.getUI().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private ItemStack setupFillerItem() {
|
||||
return new ItemBuilder(Material.STAINED_GLASS_PANE, 1, DyeColor.BLACK.getWoolData(), "&cCranked&fPvP")
|
||||
.colorize()
|
||||
.build();
|
||||
}
|
||||
|
||||
private void setupInformationItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.BOOK, "&c&lPvP Help Menu",
|
||||
"&7This inventory will guide you through",
|
||||
"&7the pvp related features on the server",
|
||||
"",
|
||||
"&7If you get stuck, or this menu does",
|
||||
"&7not give a sufficient amount of",
|
||||
"&7information, feel free to open a",
|
||||
"&7support ticket in the cranked discord",
|
||||
"",
|
||||
"&fDiscord: &7discord.gg/crankedpvp");
|
||||
this.pvpHelpMenu.setItem(1, 5, new GuiItem(itemBuilder.colorize().build()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package net.crankedpvp.help.inventory;
|
||||
|
||||
import dev.triumphteam.gui.guis.Gui;
|
||||
import dev.triumphteam.gui.guis.GuiItem;
|
||||
import lombok.Getter;
|
||||
import net.crankedpvp.crankedutils.utils.items.ItemBuilder;
|
||||
import net.crankedpvp.help.HelpPlugin;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class StartHelpInventory {
|
||||
|
||||
@Getter
|
||||
private final Gui startingHelpInventory;
|
||||
|
||||
public StartHelpInventory() {
|
||||
this.startingHelpInventory = new Gui(6, "PvP Help Menu");
|
||||
this.startingHelpInventory.setDefaultClickAction(event -> event.setCancelled(true));
|
||||
this.startingHelpInventory.getFiller().fillBorder(new GuiItem(setupFillerItem()));
|
||||
|
||||
this.setupInformationItem();
|
||||
this.setupGoBackButton();
|
||||
|
||||
this.setupKitsButton();
|
||||
this.setupGKitsButton();
|
||||
|
||||
this.setupGrindingButton();
|
||||
}
|
||||
|
||||
private void setupGrindingButton() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.BLAZE_ROD, "&6&lBlaze Grinding",
|
||||
"&7Blaze grinding is where you kill",
|
||||
"&7blazes and receive keys, money, and",
|
||||
"&7exp in return.",
|
||||
"",
|
||||
"&7To get started, do the following;",
|
||||
"&7- Open your starter bundle",
|
||||
"&7- Execute /wild (or fly to an open space)",
|
||||
"&7- Place a chunk buster down",
|
||||
"&7- Place your blaze spawners down",
|
||||
"&7- Kill blazes repetitively",
|
||||
"&7- More kills -> more loot");
|
||||
this.startingHelpInventory.addItem(new GuiItem(itemBuilder.colorize().build()));
|
||||
}
|
||||
|
||||
private void setupKitsButton() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.DIAMOND_CHESTPLATE, "&b&lKits",
|
||||
"&7Kits are small &fsets of items &7that you",
|
||||
"&7can claim through a &erank &7or permission",
|
||||
"",
|
||||
"&7When you first join the server, you will be",
|
||||
"&7able to access and claim the default kit. This",
|
||||
"&7is not a powerful kit however it will give you",
|
||||
"&7basic items which allow you to progress quickly",
|
||||
"",
|
||||
"&7The most common kits are &e'Rank Kits'.",
|
||||
"&7These kits give you very simple starting",
|
||||
"&7items based on the rank you currently have",
|
||||
"&7on the server",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view ALL kits");
|
||||
this.startingHelpInventory.addItem(new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
((Player) event.getWhoClicked()).performCommand("kit");
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupGKitsButton() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.GOLD_HELMET, "&c&lGodly Kits",
|
||||
"&7Godly Kits, or more commonly known as 'gkits',",
|
||||
"&7are better sets of items which increase efficiency",
|
||||
"",
|
||||
"&7An example of a godly kit is an enchanted set of armor,",
|
||||
"&7exceptionally fast tools and alchemist styled items",
|
||||
"",
|
||||
"&a&l(!) &f&nClick&r &fto view ALL gkits");
|
||||
this.startingHelpInventory.addItem(new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
((Player) event.getWhoClicked()).performCommand("gkit");
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupGoBackButton() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.REDSTONE, "&cGo Back", "&7Click here to return to",
|
||||
"&7the previous inventory");
|
||||
this.startingHelpInventory.setItem(6, 1, new GuiItem(itemBuilder.colorize().build(), event -> {
|
||||
event.getWhoClicked().closeInventory();
|
||||
HelpInventory helpInventory = HelpPlugin.getInstance().getInventoryManager().getHelpInventory();
|
||||
helpInventory.getHelpMenuInventory().open(event.getWhoClicked());
|
||||
}));
|
||||
}
|
||||
|
||||
private ItemStack setupFillerItem() {
|
||||
return new ItemBuilder(Material.STAINED_GLASS_PANE, 1, DyeColor.BLACK.getWoolData(), "&cCranked&fPvP")
|
||||
.colorize()
|
||||
.build();
|
||||
}
|
||||
|
||||
private void setupInformationItem() {
|
||||
ItemBuilder itemBuilder = new ItemBuilder(Material.BOOK, "&a&lStarting Help Menu",
|
||||
"&7This inventory will guide you through",
|
||||
"&7the starting features on the server",
|
||||
"",
|
||||
"&7If you get stuck, or this menu does",
|
||||
"&7not give a sufficient amount of",
|
||||
"&7information, feel free to open a",
|
||||
"&7support ticket in the cranked discord",
|
||||
"",
|
||||
"&fDiscord: &7discord.gg/crankedpvp");
|
||||
this.startingHelpInventory.setItem(1, 5, new GuiItem(itemBuilder.colorize().build()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package net.crankedpvp.help.inventory;
|
||||
|
||||
public class UnderworldHelpInventory {
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package net.crankedpvp.help.struct;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.crankedpvp.adminarmor.inventory.AdminArmorInventory;
|
||||
import net.crankedpvp.adminweapons.inventory.AdminWeaponsInventory;
|
||||
import net.crankedpvp.bosses.inventory.BossesInventory;
|
||||
import net.crankedpvp.crankedenchants.inventories.MainEnchantsUI;
|
||||
import net.crankedpvp.crankedmasks.inventory.MasksInventory;
|
||||
import net.crankedpvp.crankedpets.inventory.PetsInventory;
|
||||
import net.crankedpvp.crankedpets.inventory.PetsMainInventory;
|
||||
import net.crankedpvp.help.HelpPlugin;
|
||||
import net.crankedpvp.help.inventory.*;
|
||||
import net.crankedpvp.staritems.StarItemsAPI;
|
||||
import net.crankedpvp.staritems.inventory.StarItemsInventory;
|
||||
|
||||
@Getter
|
||||
public class InventoryManager {
|
||||
|
||||
|
||||
private final HelpPlugin plugin;
|
||||
public InventoryManager(HelpPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
private FactionsHelpInventory factionsHelpInventory;
|
||||
private HelpInventory helpInventory;
|
||||
private PvPHelpInventory pvPHelpInventory;
|
||||
private StartHelpInventory startHelpInventory;
|
||||
private BossesInventory bossesInventory;
|
||||
private AdminArmorInventory adminArmorInventory;
|
||||
private AdminWeaponsInventory adminWeaponsInventory;
|
||||
private PetsMainInventory petsInventory;
|
||||
private MasksInventory masksInventory;
|
||||
private StarItemsInventory starItemsInventory;
|
||||
private MainEnchantsUI enchantsInventory;
|
||||
private UnderworldHelpInventory underworldHelpInventory;
|
||||
|
||||
public void initializeInventories() {
|
||||
this.factionsHelpInventory = new FactionsHelpInventory();
|
||||
this.helpInventory = new HelpInventory();
|
||||
this.pvPHelpInventory = new PvPHelpInventory();
|
||||
this.startHelpInventory = new StartHelpInventory();
|
||||
this.bossesInventory = new BossesInventory();
|
||||
this.adminArmorInventory = new AdminArmorInventory();
|
||||
this.adminWeaponsInventory = new AdminWeaponsInventory();
|
||||
this.petsInventory = new PetsMainInventory();
|
||||
this.masksInventory = new MasksInventory();
|
||||
this.starItemsInventory = StarItemsAPI.getStarItemsUI();
|
||||
this.enchantsInventory = new MainEnchantsUI();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
name: CrankedHelp
|
||||
main: net.crankedpvp.help.HelpPlugin
|
||||
version: ${git.total.commit.count}.0
|
||||
description: "§fCommit ID: §a${git.commit.id.abbrev}"
|
||||
website: https://crankedpvp.net/
|
||||
depend:
|
||||
- CrankedUtils
|
||||
- CrankedArmor
|
||||
- CrankedEnchants
|
||||
- CrankedBosses
|
||||
- CrankedPets
|
||||
- CrankedMasks
|
||||
- CrankedAdminWeapons
|
||||
- CrankedAdminArmor
|
||||
Reference in New Issue
Block a user