Updates (Event Management Menu)
This commit is contained in:
parent
b36cf49ddb
commit
359672f599
@ -20,7 +20,10 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Getter
|
||||
@ -72,13 +75,15 @@ public class EventCore extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
List<UUID> playersInStaffMode = new ArrayList<UUID>(this.staffManager.getPlayersInStaffMode());
|
||||
|
||||
for (Player player : this.getServer().getOnlinePlayers()) {
|
||||
PlayerData playerData = this.playerDataManager.getPlayerData(player.getUniqueId());
|
||||
|
||||
this.playerDataManager.savePlayerData(playerData);
|
||||
}
|
||||
|
||||
for (UUID playerInStaffModeUUID : this.staffManager.getPlayersInStaffMode()) {
|
||||
for (UUID playerInStaffModeUUID : playersInStaffMode) {
|
||||
Player playerInStaffMode = this.getServer().getPlayer(playerInStaffModeUUID);
|
||||
|
||||
if (playerInStaffMode == null) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.loganmagnan.eventcore.commands;
|
||||
|
||||
import com.loganmagnan.eventcore.EventCore;
|
||||
import com.loganmagnan.eventcore.menusystem.menus.ChatManagementMenu;
|
||||
import com.loganmagnan.eventcore.menusystem.menus.ChatManageMenu;
|
||||
import com.loganmagnan.eventcore.utils.ColorUtils;
|
||||
import com.loganmagnan.eventcore.utils.Constants;
|
||||
import com.loganmagnan.eventcore.utils.Utils;
|
||||
@ -28,7 +28,7 @@ public class ChatCommand extends BaseCommand {
|
||||
} else {
|
||||
switch (args[0]) {
|
||||
case "manage":
|
||||
new ChatManagementMenu(this.main.getPlayerMenuUtil(player), this.main.getChatManager().getDelayAmount()).open(player);
|
||||
new ChatManageMenu(this.main.getPlayerMenuUtil(player), this.main.getChatManager().getDelayAmount()).open(player);
|
||||
|
||||
break;
|
||||
case "toggle":
|
||||
|
@ -0,0 +1,45 @@
|
||||
package com.loganmagnan.eventcore.commands;
|
||||
|
||||
import com.loganmagnan.eventcore.EventCore;
|
||||
import com.loganmagnan.eventcore.menusystem.menus.EventManageMenu;
|
||||
import com.loganmagnan.eventcore.utils.ColorUtils;
|
||||
import com.loganmagnan.eventcore.utils.Constants;
|
||||
import com.loganmagnan.eventcore.utils.Utils;
|
||||
import com.loganmagnan.eventcore.utils.command.BaseCommand;
|
||||
import com.loganmagnan.eventcore.utils.command.Command;
|
||||
import com.loganmagnan.eventcore.utils.command.CommandArguments;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class EventCommand extends BaseCommand {
|
||||
|
||||
private EventCore main = EventCore.getInstance();
|
||||
|
||||
@Command(name = "event", permission = "eventcore.command.event")
|
||||
@Override
|
||||
public void executeAs(CommandArguments command) {
|
||||
Player player = command.getPlayer();
|
||||
|
||||
String[] args = command.getArgs();
|
||||
|
||||
if (args.length == 0) {
|
||||
for (String string : Constants.COMMAND_MESSAGES.get("event.help")) {
|
||||
player.sendMessage(ColorUtils.getMessageType(string.replace("%line%", Utils.chatBar)));
|
||||
}
|
||||
} else {
|
||||
switch (args[0]) {
|
||||
case "start":
|
||||
// To Do: Setup Event Starting System
|
||||
|
||||
break;
|
||||
case "stop":
|
||||
// To Do: Setup Event Stopping System
|
||||
|
||||
break;
|
||||
case "manage":
|
||||
new EventManageMenu(this.main.getPlayerMenuUtil(player)).open(player);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -15,22 +15,29 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
public class Event {
|
||||
|
||||
// General Information
|
||||
private String name;
|
||||
|
||||
private CustomLocation spawnPoint;
|
||||
|
||||
private List<Team> teams;
|
||||
|
||||
private int amountOfTeams;
|
||||
private int amountPerTeam;
|
||||
|
||||
private List<CustomLocation> teamSpawnPoints;
|
||||
|
||||
private String duration;
|
||||
|
||||
// Teams Information
|
||||
private List<Team> teams;
|
||||
private int amountOfTeams;
|
||||
private int amountPerTeam;
|
||||
private List<CustomLocation> teamSpawnPoints;
|
||||
|
||||
// Toggleable Settings
|
||||
private boolean scoreboardEnabled;
|
||||
private boolean timerEnabled;
|
||||
private boolean blockPlaceEventCancelled;
|
||||
private boolean blockBreakEventCancelled;
|
||||
private boolean eventsEnabled;
|
||||
|
||||
// Events
|
||||
// BlockPlaceEvent
|
||||
private boolean blockPlaceEventEnabled;
|
||||
|
||||
// BlockBreakEvent
|
||||
private boolean blockBreakEventEnabled;
|
||||
|
||||
// Other
|
||||
private boolean started;
|
||||
}
|
||||
|
@ -68,15 +68,16 @@ public class EventManager {
|
||||
this.event = new Event(
|
||||
this.config.getString("EVENT.NAME"),
|
||||
CustomLocation.stringToLocation(this.config.getString("EVENT.SPAWN-POINT")),
|
||||
this.config.getString("EVENT.DURATION"),
|
||||
teams,
|
||||
this.config.getInt("EVENT.AMOUNT-OF-TEAMS"),
|
||||
this.config.getInt("EVENT.AMOUNT-PER-TEAM"),
|
||||
teamSpawnPoints,
|
||||
this.config.getString("EVENT.DURATION"),
|
||||
this.config.getBoolean("EVENT.TOGGLEABLE-OPTIONS.SCOREBOARD-ENABLED"),
|
||||
this.config.getBoolean("EVENT.TOGGLEABLE-OPTIONS.TIMER-ENABLED"),
|
||||
this.config.getBoolean("EVENT.TOGGLEABLE-OPTIONS.EVENTS.BLOCK-PLACE.CANCELLED"),
|
||||
this.config.getBoolean("EVENT.TOGGLEABLE-OPTIONS.EVENTS.BLOCK-BREAK.CANCELLED"),
|
||||
this.config.getBoolean("EVENT.TOGGLEABLE-OPTIONS.EVENTS.ENABLED"),
|
||||
this.config.getBoolean("EVENT.TOGGLEABLE-OPTIONS.EVENTS.BLOCK-PLACE.ENABLED"),
|
||||
this.config.getBoolean("EVENT.TOGGLEABLE-OPTIONS.EVENTS.BLOCK-BREAK.ENABLED"),
|
||||
this.config.getBoolean("EVENT.STARTED")
|
||||
);
|
||||
} catch (NullPointerException exception) {
|
||||
@ -86,15 +87,16 @@ public class EventManager {
|
||||
this.event = new Event(
|
||||
"Event",
|
||||
this.main.getSpawnManager().getSpawnLocation(),
|
||||
"10m",
|
||||
new ArrayList<Team>(),
|
||||
2,
|
||||
10,
|
||||
new ArrayList<CustomLocation>(),
|
||||
"10m",
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
}
|
||||
@ -134,14 +136,15 @@ public class EventManager {
|
||||
|
||||
this.config.set("EVENT.NAME", this.event.getName());
|
||||
this.config.set("EVENT.SPAWN-POINT", CustomLocation.locationToString(this.event.getSpawnPoint()));
|
||||
this.config.set("EVENT.DURATION", this.event.getDuration());
|
||||
this.config.set("EVENT.AMOUNT-OF-TEAMS", this.event.getAmountOfTeams());
|
||||
this.config.set("EVENT.AMOUNT-PER-TEAM", this.event.getAmountPerTeam());
|
||||
this.config.set("EVENT.TEAM-SPAWN-POINTS", teamSpawnPoints);
|
||||
this.config.set("EVENT.DURATION", this.event.getDuration());
|
||||
this.config.set("EVENT.TOGGLEABLE-OPTIONS.SCOREBOARD-ENABLED", this.event.isScoreboardEnabled());
|
||||
this.config.set("EVENT.TOGGLEABLE-OPTIONS.TIMER-ENABLED", this.event.isTimerEnabled());
|
||||
this.config.set("EVENT.TOGGLEABLE-OPTIONS.EVENTS.BLOCK-PLACE.CANCELLED", this.event.isBlockPlaceEventCancelled());
|
||||
this.config.set("EVENT.TOGGLEABLE-OPTIONS.EVENTS.BLOCK-BREAK.CANCELLED", this.event.isBlockBreakEventCancelled());
|
||||
this.config.set("EVENT.TOGGLEABLE-SETTINGS.SCOREBOARD-ENABLED", this.event.isScoreboardEnabled());
|
||||
this.config.set("EVENT.TOGGLEABLE-SETTINGS.TIMER-ENABLED", this.event.isTimerEnabled());
|
||||
this.config.set("EVENT.TOGGLEABLE-SETTINGS.EVENTS.ENABLED", this.event.isEventsEnabled());
|
||||
this.config.set("EVENT.TOGGLEABLE-SETTINGS.EVENTS.BLOCK-PLACE.ENABLED", this.event.isBlockPlaceEventEnabled());
|
||||
this.config.set("EVENT.TOGGLEABLE-SETTINGS.EVENTS.BLOCK-BREAK.ENABLED", this.event.isBlockBreakEventEnabled());
|
||||
this.config.set("EVENT.STARTED", this.event.isStarted());
|
||||
this.main.getMainConfig().save();
|
||||
}
|
||||
|
@ -12,13 +12,13 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ChatManagementMenu extends Menu {
|
||||
public class ChatManageMenu extends Menu {
|
||||
|
||||
private EventCore main = EventCore.getInstance();
|
||||
|
||||
private int delayAmount = 0;
|
||||
|
||||
public ChatManagementMenu(PlayerMenuUtil playerMenuUtil, int delayAmount) {
|
||||
public ChatManageMenu(PlayerMenuUtil playerMenuUtil, int delayAmount) {
|
||||
super(playerMenuUtil);
|
||||
|
||||
this.delayAmount = delayAmount;
|
||||
@ -26,7 +26,7 @@ public class ChatManagementMenu extends Menu {
|
||||
|
||||
@Override
|
||||
public String getMenuName() {
|
||||
return ColorUtils.getMessageType("&bChat Management");
|
||||
return ColorUtils.getMessageType("&b&lChat Management");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -38,7 +38,7 @@ public class ChatManagementMenu extends Menu {
|
||||
public void handleMenu(InventoryClickEvent event) {
|
||||
Player player = (Player) event.getWhoClicked();
|
||||
|
||||
if (event.getView().getTitle().equalsIgnoreCase(ColorUtils.getMessageType("&bChat Management"))) {
|
||||
if (event.getView().getTitle().equalsIgnoreCase(ColorUtils.getMessageType("&b&lChat Management"))) {
|
||||
switch (event.getCurrentItem().getType()) {
|
||||
case DIAMOND_SWORD:
|
||||
this.main.getChatManager().toggleChat(player);
|
||||
@ -64,19 +64,19 @@ public class ChatManagementMenu extends Menu {
|
||||
break;
|
||||
}
|
||||
|
||||
new ChatManagementMenu(this.playerMenuUtil, this.delayAmount).open(player);
|
||||
new ChatManageMenu(this.playerMenuUtil, this.delayAmount).open(player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMenuItems(Player player) {
|
||||
ItemStackButton muteChatItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType("&bToggle Chat"),
|
||||
ColorUtils.getMessageType("&b&lToggle Chat"),
|
||||
ColorUtils.getMessageType(
|
||||
Arrays.asList(
|
||||
"&fMuted: " + (this.main.getChatManager().isMuted() ? "&aYes" : "&cNo"),
|
||||
"&fToggled By: &b" + (this.main.getChatManager().getToggledBy() == null ? "None" : this.main.getServer().getOfflinePlayer(this.main.getChatManager().getToggledBy()).getName()),
|
||||
"&fLast Toggled: &b" + (this.main.getChatManager().getLastToggledTime() == 0 ? "Never" : Utils.getTimeAsAString(this.main.getChatManager().getLastToggledTime())),
|
||||
"&fToggled By: &3" + (this.main.getChatManager().getToggledBy() == null ? "None" : this.main.getServer().getOfflinePlayer(this.main.getChatManager().getToggledBy()).getName()),
|
||||
"&fLast Toggled: &3" + (this.main.getChatManager().getLastToggledTime() == 0 ? "Never" : Utils.getTimeAsAString(this.main.getChatManager().getLastToggledTime())),
|
||||
"",
|
||||
"&bClick to mute the chat"
|
||||
)
|
||||
@ -87,17 +87,17 @@ public class ChatManagementMenu extends Menu {
|
||||
);
|
||||
|
||||
ItemStackButton slowChatItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType("&bSlow Chat"),
|
||||
ColorUtils.getMessageType("&b&lSlow Chat"),
|
||||
ColorUtils.getMessageType(
|
||||
Arrays.asList(
|
||||
"&fDelay Amount: &b" + this.main.getChatManager().getDelayAmount(),
|
||||
"&fSlowed By: &b" + (this.main.getChatManager().getSlowedBy() == null ? "None" : this.main.getServer().getOfflinePlayer(this.main.getChatManager().getSlowedBy()).getName()),
|
||||
"&fLast Slowed: &b" + (this.main.getChatManager().getLastSlowedTime() == 0 ? "Never" : Utils.getTimeAsAString(this.main.getChatManager().getLastSlowedTime())),
|
||||
"&fDelay Amount: &3" + this.main.getChatManager().getDelayAmount(),
|
||||
"&fSlowed By: &3" + (this.main.getChatManager().getSlowedBy() == null ? "None" : this.main.getServer().getOfflinePlayer(this.main.getChatManager().getSlowedBy()).getName()),
|
||||
"&fLast Slowed: &3" + (this.main.getChatManager().getLastSlowedTime() == 0 ? "Never" : Utils.getTimeAsAString(this.main.getChatManager().getLastSlowedTime())),
|
||||
"",
|
||||
"&bShift click to slow the chat for &3" + (this.delayAmount + " &bsecond" + (this.delayAmount > 1 ? "s" : "")),
|
||||
"&bShift click to slow the chat for &3" + (this.delayAmount + " &3second" + (this.delayAmount > 1 ? "s" : "")),
|
||||
"",
|
||||
"&fLeft Click: &b+1",
|
||||
"&fRight Click: &b-1"
|
||||
"&fLeft Click: &3+1",
|
||||
"&fRight Click: &3-1"
|
||||
)
|
||||
),
|
||||
Material.SOUL_SAND,
|
||||
@ -106,11 +106,11 @@ public class ChatManagementMenu extends Menu {
|
||||
);
|
||||
|
||||
ItemStackButton clearChatItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType("&bClear Chat"),
|
||||
ColorUtils.getMessageType("&b&lClear Chat"),
|
||||
ColorUtils.getMessageType(
|
||||
Arrays.asList(
|
||||
"&fCleared By: &b" + (this.main.getChatManager().getClearedBy() == null ? "None" : this.main.getServer().getOfflinePlayer(this.main.getChatManager().getClearedBy()).getName()),
|
||||
"&fLast Cleared: &b" + (this.main.getChatManager().getLastClearedTime() == 0 ? "Never" : Utils.getTimeAsAString(this.main.getChatManager().getLastClearedTime())),
|
||||
"&fCleared By: &3" + (this.main.getChatManager().getClearedBy() == null ? "None" : this.main.getServer().getOfflinePlayer(this.main.getChatManager().getClearedBy()).getName()),
|
||||
"&fLast Cleared: &3" + (this.main.getChatManager().getLastClearedTime() == 0 ? "Never" : Utils.getTimeAsAString(this.main.getChatManager().getLastClearedTime())),
|
||||
"",
|
||||
"&bClick to clear the chat"
|
||||
)
|
@ -0,0 +1,272 @@
|
||||
package com.loganmagnan.eventcore.menusystem.menus;
|
||||
|
||||
import com.loganmagnan.eventcore.EventCore;
|
||||
import com.loganmagnan.eventcore.managers.event.teams.Team;
|
||||
import com.loganmagnan.eventcore.menusystem.ItemStackButton;
|
||||
import com.loganmagnan.eventcore.menusystem.Menu;
|
||||
import com.loganmagnan.eventcore.menusystem.PlayerMenuUtil;
|
||||
import com.loganmagnan.eventcore.utils.ColorUtils;
|
||||
import com.loganmagnan.eventcore.utils.CustomLocation;
|
||||
import com.loganmagnan.eventcore.utils.Utils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class EventManageMenu extends Menu {
|
||||
|
||||
private EventCore main = EventCore.getInstance();
|
||||
|
||||
public EventManageMenu(PlayerMenuUtil playerMenuUtil) {
|
||||
super(playerMenuUtil);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMenuName() {
|
||||
return ColorUtils.getMessageType("&b&lEvent Management");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlots() {
|
||||
return 54;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMenu(InventoryClickEvent event) {
|
||||
Player player = (Player) event.getWhoClicked();
|
||||
|
||||
if (event.getView().getTitle().equalsIgnoreCase(ColorUtils.getMessageType("&b&lEvent Management"))) {
|
||||
switch (event.getCurrentItem().getType()) {
|
||||
|
||||
}
|
||||
|
||||
new EventManageMenu(this.playerMenuUtil).open(player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMenuItems(Player player) {
|
||||
List<String> teamSpawnPoints = new ArrayList<String>();
|
||||
List<String> teamSpawnPointsLore = new ArrayList<String>();
|
||||
|
||||
Material material = Material.RED_STAINED_GLASS_PANE;
|
||||
|
||||
for (CustomLocation teamSpawnPoint : this.main.getEventManager().getEvent().getTeamSpawnPoints()) {
|
||||
teamSpawnPoints.add("&3" + Math.floor(teamSpawnPoint.toBukkitLocation().getX()) + "&7, &3" + Math.floor(teamSpawnPoint.toBukkitLocation().getY()) + "&7, &3" + Math.floor(teamSpawnPoint.toBukkitLocation().getZ()) + " &7(&f" + teamSpawnPoint.toBukkitLocation().getWorld().getName() + "&7)");
|
||||
}
|
||||
|
||||
if (teamSpawnPoints.size() == 0) {
|
||||
teamSpawnPointsLore.add("&7» &3None");
|
||||
} else {
|
||||
for (String teamSpawnPoint : teamSpawnPoints) {
|
||||
teamSpawnPointsLore.add("&7» " + teamSpawnPoint);
|
||||
}
|
||||
}
|
||||
|
||||
teamSpawnPointsLore.add("");
|
||||
teamSpawnPointsLore.add("&bClick to change");
|
||||
|
||||
ItemStackButton nameItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&c&lAccess Denied" : "&b&lName"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? new ArrayList<String>() :
|
||||
Arrays.asList(
|
||||
"&7» &3" + this.main.getEventManager().getEvent().getName(),
|
||||
"",
|
||||
"&bClick to change"
|
||||
)
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? material : Material.NAME_TAG,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton spawnPointItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&c&lAccess Denied" : "&b&lSpawn Point"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? new ArrayList<String>() :
|
||||
Arrays.asList(
|
||||
"&7» &3" + Math.floor(this.main.getEventManager().getEvent().getSpawnPoint().toBukkitLocation().getX()) + "&7, &3" + Math.floor(this.main.getEventManager().getEvent().getSpawnPoint().toBukkitLocation().getY()) + "&7, &3" + Math.floor(this.main.getEventManager().getEvent().getSpawnPoint().toBukkitLocation().getZ()) + " &7(&f" + this.main.getEventManager().getEvent().getSpawnPoint().toBukkitLocation().getWorld().getName() + "&7)",
|
||||
"",
|
||||
"&fLeft Click: &3Teleport",
|
||||
"&fRight Click: &3Change"
|
||||
)
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? material : Material.COMPASS,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton durationItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&c&lAccess Denied" : "&b&lDuration"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? new ArrayList<String>() :
|
||||
Arrays.asList(
|
||||
"&7» &3" + Utils.makeTimeReadable(Utils.parseTime(this.main.getEventManager().getEvent().getDuration())),
|
||||
"",
|
||||
"&bClick to change"
|
||||
)
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? material : Material.CLOCK,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton amountOfTeamsItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&c&lAccess Denied" : "&b&lAmount of Teams"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? new ArrayList<String>() :
|
||||
Arrays.asList(
|
||||
"&7» &3" + this.main.getEventManager().getEvent().getAmountOfTeams(),
|
||||
"",
|
||||
"&bClick to change"
|
||||
)
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? material : Material.BOOK,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton amountPerTeamItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&c&lAccess Denied" : "&b&lAmount Per Team"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? new ArrayList<String>() :
|
||||
Arrays.asList(
|
||||
"&7» &3" + this.main.getEventManager().getEvent().getAmountPerTeam(),
|
||||
"",
|
||||
"&bClick to change"
|
||||
)
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? material : Material.PAPER,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton teamSpawnPointsItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&c&lAccess Denied" : "&b&lTeam Spawn Points"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? new ArrayList<String>() :
|
||||
teamSpawnPointsLore
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? material : Material.ENDER_EYE,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton scoreboardEnabledItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&c&lAccess Denied" : "&b&lScoreboard Enabled"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? new ArrayList<String>() :
|
||||
Arrays.asList(
|
||||
"&7» " + (this.main.getEventManager().getEvent().isScoreboardEnabled() ? "&aYes" : "&cNo"),
|
||||
"",
|
||||
"&bClick to change"
|
||||
)
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? material : Material.PAINTING,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton timerEnabledItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&c&lAccess Denied" : "&b&lTimer Enabled"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? new ArrayList<String>() :
|
||||
Arrays.asList(
|
||||
"&7» " + (this.main.getEventManager().getEvent().isTimerEnabled() ? "&aYes" : "&cNo"),
|
||||
"",
|
||||
"&bClick to change"
|
||||
)
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? material : Material.ANVIL,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton eventsEnabledItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&c&lAccess Denied" : "&b&lEvents Enabled"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? new ArrayList<String>() :
|
||||
Arrays.asList(
|
||||
"&7» " + (this.main.getEventManager().getEvent().isEventsEnabled() ? "&aYes" : "&cNo"),
|
||||
"",
|
||||
"&b&lEvents",
|
||||
"&7» " + (this.main.getEventManager().getEvent().isBlockPlaceEventEnabled() ? "&aBlockPlaceEvent" : "&cBlockPlaceEvent"),
|
||||
"&7» " + (this.main.getEventManager().getEvent().isBlockBreakEventEnabled() ? "&aBlockBreakEvent" : "&cBlockBreakEvent"),
|
||||
"",
|
||||
"&fLeft Click: " + (this.main.getEventManager().getEvent().isEventsEnabled() ? "&cDisable" : "&aEnable"),
|
||||
"&fRight Click: &3Change"
|
||||
)
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? material : Material.DIAMOND,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton startItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&c&lAccess Denied" : "&b&lStart"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? new ArrayList<String>() :
|
||||
Arrays.asList(
|
||||
"&bClick to start"
|
||||
)
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? material : Material.LIME_WOOL,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton stopItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ? "&b&lStop" : "&c&lAccess Denied"),
|
||||
ColorUtils.getMessageType(this.main.getEventManager().getEvent().isStarted() ?
|
||||
Arrays.asList(
|
||||
"&bClick to stop"
|
||||
) : new ArrayList<String>()
|
||||
),
|
||||
this.main.getEventManager().getEvent().isStarted() ? Material.RED_WOOL : material,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStackButton startedItemStackButton = new ItemStackButton(
|
||||
ColorUtils.getMessageType("&b&lStarted"),
|
||||
ColorUtils.getMessageType(
|
||||
Arrays.asList(
|
||||
"&7» " + (this.main.getEventManager().getEvent().isStarted() ? "&aYes" : "&cNo")
|
||||
)
|
||||
),
|
||||
Material.NETHER_STAR,
|
||||
0,
|
||||
1
|
||||
);
|
||||
|
||||
ItemStack nameItemStack = nameItemStackButton.makeItemStack();
|
||||
ItemStack spawnPointItemStack = spawnPointItemStackButton.makeItemStack();
|
||||
ItemStack durationItemStack = durationItemStackButton.makeItemStack();
|
||||
ItemStack amountOfTeamsItemStack = amountOfTeamsItemStackButton.makeItemStack();
|
||||
ItemStack amountPerTeamItemStack = amountPerTeamItemStackButton.makeItemStack();
|
||||
ItemStack teamSpawnPointsItemStack = teamSpawnPointsItemStackButton.makeItemStack();
|
||||
ItemStack scoreboardEnabledItemStack = scoreboardEnabledItemStackButton.makeItemStack();
|
||||
ItemStack timerEnabledItemStack = timerEnabledItemStackButton.makeItemStack();
|
||||
ItemStack eventsEnabledItemStack = eventsEnabledItemStackButton.makeItemStack();
|
||||
ItemStack startItemStack = startItemStackButton.makeItemStack();
|
||||
ItemStack stopItemStack = stopItemStackButton.makeItemStack();
|
||||
ItemStack startedItemStack = startedItemStackButton.makeItemStack();
|
||||
|
||||
this.setFillerGlass();
|
||||
this.inventory.setItem(10, new ItemStackButton(ColorUtils.getMessageType("&b&lGeneral Information"), new ArrayList<String>(), Material.OAK_SIGN, 0, 1).makeItemStack());
|
||||
this.inventory.setItem(11, new ItemStackButton(ColorUtils.getMessageType(""), new ArrayList<String>(), Material.WHITE_STAINED_GLASS_PANE, 0, 1).makeItemStack());
|
||||
this.inventory.setItem(12, nameItemStack);
|
||||
this.inventory.setItem(13, spawnPointItemStack);
|
||||
this.inventory.setItem(14, durationItemStack);
|
||||
this.inventory.setItem(19, new ItemStackButton(ColorUtils.getMessageType("&b&lTeams Information"), new ArrayList<String>(), Material.OAK_SIGN, 0, 1).makeItemStack());
|
||||
this.inventory.setItem(20, new ItemStackButton(ColorUtils.getMessageType(""), new ArrayList<String>(), Material.WHITE_STAINED_GLASS_PANE, 0, 1).makeItemStack());
|
||||
this.inventory.setItem(21, amountOfTeamsItemStack);
|
||||
this.inventory.setItem(22, amountPerTeamItemStack);
|
||||
this.inventory.setItem(23, teamSpawnPointsItemStack);
|
||||
this.inventory.setItem(28, new ItemStackButton(ColorUtils.getMessageType("&b&lToggleable Settings"), new ArrayList<String>(), Material.OAK_SIGN, 0, 1).makeItemStack());
|
||||
this.inventory.setItem(29, new ItemStackButton(ColorUtils.getMessageType(""), new ArrayList<String>(), Material.WHITE_STAINED_GLASS_PANE, 0, 1).makeItemStack());
|
||||
this.inventory.setItem(30, scoreboardEnabledItemStack);
|
||||
this.inventory.setItem(31, timerEnabledItemStack);
|
||||
this.inventory.setItem(32, eventsEnabledItemStack);
|
||||
this.inventory.setItem(37, new ItemStackButton(ColorUtils.getMessageType("&b&lManagement Settings"), new ArrayList<String>(), Material.OAK_SIGN, 0, 1).makeItemStack());
|
||||
this.inventory.setItem(38, new ItemStackButton(ColorUtils.getMessageType(""), new ArrayList<String>(), Material.WHITE_STAINED_GLASS_PANE, 0, 1).makeItemStack());
|
||||
this.inventory.setItem(39, startItemStack);
|
||||
this.inventory.setItem(40, stopItemStack);
|
||||
this.inventory.setItem(41, startedItemStack);
|
||||
}
|
||||
}
|
@ -33,6 +33,9 @@ public class Constants {
|
||||
COMMAND_MESSAGES.put("bypass-mode.enabled", Collections.singletonList(this.main.getMessagesConfig().getConfig().getString("MESSAGES.COMMANDS.BYPASS-MODE.ENABLED")));
|
||||
COMMAND_MESSAGES.put("bypass-mode.disabled", Collections.singletonList(this.main.getMessagesConfig().getConfig().getString("MESSAGES.COMMANDS.BYPASS-MODE.DISABLED")));
|
||||
|
||||
// /event
|
||||
COMMAND_MESSAGES.put("event.help", this.main.getMessagesConfig().getConfig().getStringList("MESSAGES.COMMANDS.EVENT.HELP"));
|
||||
|
||||
// AsyncPlayerChatEvent
|
||||
LISTENER_MESSAGES.put("chat-muted", Collections.singletonList(this.main.getMessagesConfig().getConfig().getString("MESSAGES.LISTENERS.CHAT-MUTED")));
|
||||
LISTENER_MESSAGES.put("chat-cooldown", this.main.getMessagesConfig().getConfig().getStringList("MESSAGES.LISTENERS.CHAT-COOLDOWN"));
|
||||
|
@ -22,6 +22,16 @@ MESSAGES:
|
||||
BYPASS-MODE: # Permission Node - eventcore.command.bypassmode
|
||||
ENABLED: "&bYou've &aenabled &bbypass mode"
|
||||
DISABLED: "&bYou've &cdisabled &bbypass mode"
|
||||
EVENT: # Permission Node - eventcore.command.event
|
||||
HELP:
|
||||
- "%line%"
|
||||
- "&bEvent Commands"
|
||||
- "%line%"
|
||||
- "&7⚫ &9/event &7- &eList of commands"
|
||||
- "&7⚫ &9/event start &7- &eStart the event"
|
||||
- "&7⚫ &9/event stop &7- &eStop the event"
|
||||
- "&7⚫ &9/event manage &7- &eManagement menu"
|
||||
- "%line%"
|
||||
LISTENERS:
|
||||
CHAT-MUTED: "&cChat is muted"
|
||||
CHAT-COOLDOWN:
|
||||
|
Loading…
Reference in New Issue
Block a user