ranks gui
This commit is contained in:
@@ -33,6 +33,7 @@ import sh.okx.rankup.prestige.Prestiges;
|
||||
import sh.okx.rankup.ranks.Rank;
|
||||
import sh.okx.rankup.ranks.RankList;
|
||||
import sh.okx.rankup.ranks.Rankups;
|
||||
import sh.okx.rankup.ranksgui.RanksGuiManager;
|
||||
import sh.okx.rankup.requirements.Requirement;
|
||||
import sh.okx.rankup.requirements.RequirementRegistry;
|
||||
import sh.okx.rankup.requirements.requirement.XpLevelDeductibleRequirement;
|
||||
@@ -87,6 +88,8 @@ public class RankupPlugin extends JavaPlugin {
|
||||
private PermissionManager permissionManager = new VaultPermissionManager(this);
|
||||
private EconomyProvider economyProvider = new VaultEconomyProvider();
|
||||
|
||||
private RanksGuiManager ranksGuiManager = new RanksGuiManager(this);
|
||||
|
||||
public RankupPlugin() {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -164,7 +164,6 @@ public class InfoCommand implements TabExecutor {
|
||||
}
|
||||
|
||||
String[] placeholders = new String[] {
|
||||
"prestige_money",
|
||||
"prestige_money_formatted",
|
||||
"prestige_percent_left_formatted",
|
||||
"prestige_percent_done_formatted",
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package sh.okx.rankup.ranksgui;
|
||||
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
public class RanksGui {
|
||||
public Inventory getInventory() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package sh.okx.rankup.ranksgui;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class RanksGuiCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
Player player = (Player) sender;
|
||||
|
||||
player.openInventory(Bukkit.createInventory())
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package sh.okx.rankup.ranksgui;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
|
||||
public class RanksGuiHolder implements Listener {
|
||||
private final Map<Player, RanksGui> guiMap = new HashMap<>();
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void on(InventoryCloseEvent event) {
|
||||
if (!(event.getPlayer() instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
Player player = (Player) event.getPlayer();
|
||||
if (guiMap.containsKey(player)) {
|
||||
RanksGui ranksGui = guiMap.get(player);
|
||||
if (ranksGui.getInventory() == event.getInventory()) {
|
||||
guiMap.remove(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package sh.okx.rankup.ranksgui;
|
||||
|
||||
import sh.okx.rankup.RankupPlugin;
|
||||
|
||||
public class RanksGuiManager {
|
||||
private final RankupPlugin plugin;
|
||||
|
||||
public RanksGuiManager(RankupPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void enable() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user