mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-29 21:53:42 +01:00
Main class
This commit is contained in:
parent
decf54202f
commit
9bc370616d
@ -58,9 +58,9 @@ import me.goodandevil.skyblock.visit.VisitTask;
|
||||
import me.goodandevil.skyblock.world.WorldManager;
|
||||
import me.goodandevil.skyblock.world.generator.VoidGenerator;
|
||||
|
||||
public class Main extends JavaPlugin {
|
||||
public class SkyBlock extends JavaPlugin {
|
||||
|
||||
private static Main instance;
|
||||
private static SkyBlock instance;
|
||||
|
||||
private FileManager fileManager;
|
||||
private WorldManager worldManager;
|
||||
@ -186,7 +186,7 @@ public class Main extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
public static Main getInstance() {
|
||||
public static SkyBlock getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.util.UUID;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.events.IslandBanEvent;
|
||||
import me.goodandevil.skyblock.events.IslandUnbanEvent;
|
||||
@ -35,11 +35,11 @@ public class Ban {
|
||||
}
|
||||
|
||||
public List<UUID> getBans() {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
List<UUID> islandBans = new ArrayList<>();
|
||||
|
||||
for (String islandBanList : plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml")).getFileConfiguration().getStringList("Bans")) {
|
||||
for (String islandBanList : skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml")).getFileConfiguration().getStringList("Bans")) {
|
||||
islandBans.add(UUID.fromString(islandBanList));
|
||||
}
|
||||
|
||||
@ -47,10 +47,10 @@ public class Ban {
|
||||
}
|
||||
|
||||
public void addBan(UUID uuid) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
List<String> islandBans = new ArrayList<>();
|
||||
FileConfiguration configLoad = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml")).getFileConfiguration();
|
||||
FileConfiguration configLoad = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml")).getFileConfiguration();
|
||||
|
||||
for (String islandBanList : configLoad.getStringList("Bans")) {
|
||||
islandBans.add(islandBanList);
|
||||
@ -63,10 +63,10 @@ public class Ban {
|
||||
}
|
||||
|
||||
public void removeBan(UUID uuid) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
List<String> islandBans = new ArrayList<>();
|
||||
FileConfiguration configLoad = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml")).getFileConfiguration();
|
||||
FileConfiguration configLoad = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml")).getFileConfiguration();
|
||||
|
||||
for (String islandBanList : configLoad.getStringList("Bans")) {
|
||||
if (!uuid.toString().equals(islandBanList)) {
|
||||
@ -80,9 +80,9 @@ public class Ban {
|
||||
}
|
||||
|
||||
public void save() {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml"));
|
||||
|
||||
try {
|
||||
config.getFileConfiguration().save(config.getFile());
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -20,11 +20,11 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class BanManager {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private Map<UUID, Ban> banStorage = new HashMap<>();
|
||||
|
||||
public BanManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public BanManager(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
|
||||
loadIslands();
|
||||
}
|
||||
@ -39,10 +39,10 @@ public class BanManager {
|
||||
}
|
||||
|
||||
public void loadIslands() {
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
if (!fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Unload")) {
|
||||
File configFile = new File(plugin.getDataFolder().toString() + "/island-data");
|
||||
if (!fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Unload")) {
|
||||
File configFile = new File(skyblock.getDataFolder().toString() + "/island-data");
|
||||
|
||||
if (configFile.exists()) {
|
||||
for (File fileList : configFile.listFiles()) {
|
||||
@ -54,13 +54,13 @@ public class BanManager {
|
||||
}
|
||||
|
||||
public void transfer(UUID uuid, UUID islandOwnerUUID) {
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Ban ban = getIsland(islandOwnerUUID);
|
||||
ban.save();
|
||||
|
||||
File oldBanDataFile = new File(new File(plugin.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml");
|
||||
File newBanDataFile = new File(new File(plugin.getDataFolder().toString() + "/ban-data"), uuid.toString() + ".yml");
|
||||
File oldBanDataFile = new File(new File(skyblock.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml");
|
||||
File newBanDataFile = new File(new File(skyblock.getDataFolder().toString() + "/ban-data"), uuid.toString() + ".yml");
|
||||
|
||||
fileManager.unloadConfig(oldBanDataFile);
|
||||
fileManager.unloadConfig(newBanDataFile);
|
||||
@ -72,11 +72,11 @@ public class BanManager {
|
||||
}
|
||||
|
||||
public void removeVisitor(Island island) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
for (UUID visitorList : island.getVisitors()) {
|
||||
@ -121,14 +121,14 @@ public class BanManager {
|
||||
|
||||
public void unloadIsland(UUID islandOwnerUUID) {
|
||||
if (hasIsland(islandOwnerUUID)) {
|
||||
plugin.getFileManager().unloadConfig(new File(new File(plugin.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml"));
|
||||
skyblock.getFileManager().unloadConfig(new File(new File(skyblock.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml"));
|
||||
banStorage.remove(islandOwnerUUID);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteIsland(UUID islandOwnerUUID) {
|
||||
if (hasIsland(islandOwnerUUID)) {
|
||||
plugin.getFileManager().deleteConfig(new File(new File(plugin.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml"));
|
||||
skyblock.getFileManager().deleteConfig(new File(new File(skyblock.getDataFolder().toString() + "/ban-data"), islandOwnerUUID.toString() + ".yml"));
|
||||
banStorage.remove(islandOwnerUUID);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
@ -29,13 +29,13 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class BiomeManager {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private Map<UUID, me.goodandevil.skyblock.biome.Biome> playerBiomeStorage = new HashMap<>();
|
||||
|
||||
public BiomeManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public BiomeManager(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
|
||||
new BiomeTask(plugin).runTaskTimerAsynchronously(plugin, 0L, 20L);
|
||||
new BiomeTask(skyblock).runTaskTimerAsynchronously(skyblock, 0L, 20L);
|
||||
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
loadPlayer(all);
|
||||
@ -84,8 +84,8 @@ public class BiomeManager {
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
if (playerDataManager.hasPlayerData(player)) {
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
@ -97,14 +97,14 @@ public class BiomeManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}.runTaskAsynchronously(skyblock);
|
||||
}
|
||||
|
||||
public void updateBiome(Island island, List<Chunk> chunks) {
|
||||
Class<?> packetPlayOutMapChunkClass = NMSUtil.getNMSClass("PacketPlayOutMapChunk");
|
||||
Class<?> chunkClass = NMSUtil.getNMSClass("Chunk");
|
||||
|
||||
for (Player all : plugin.getIslandManager().getPlayersAtIsland(island, me.goodandevil.skyblock.island.Location.World.Normal)) {
|
||||
for (Player all : skyblock.getIslandManager().getPlayersAtIsland(island, me.goodandevil.skyblock.island.Location.World.Normal)) {
|
||||
for (Chunk chunkList : chunks) {
|
||||
try {
|
||||
if (NMSUtil.getVersionNumber() < 10) {
|
||||
@ -121,7 +121,7 @@ public class BiomeManager {
|
||||
}
|
||||
|
||||
public void createPlayer(Player player, int time) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
@ -138,7 +138,7 @@ public class BiomeManager {
|
||||
}
|
||||
|
||||
public void loadPlayer(Player player) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getString("Island.Biome.Cooldown") != null) {
|
||||
@ -149,7 +149,7 @@ public class BiomeManager {
|
||||
|
||||
public void removePlayer(Player player) {
|
||||
if (hasPlayer(player)) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
@ -169,7 +169,7 @@ public class BiomeManager {
|
||||
if (hasPlayer(player)) {
|
||||
me.goodandevil.skyblock.biome.Biome biome = getPlayer(player);
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
|
@ -4,19 +4,19 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
|
||||
public class BiomeTask extends BukkitRunnable {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
protected BiomeTask(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
protected BiomeTask(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
BiomeManager biomeManager = plugin.getBiomeManager();
|
||||
BiomeManager biomeManager = skyblock.getBiomeManager();
|
||||
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
if (biomeManager.hasPlayer(all)) {
|
||||
|
@ -16,7 +16,7 @@ import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.commands.AcceptCommand;
|
||||
import me.goodandevil.skyblock.command.commands.BanCommand;
|
||||
import me.goodandevil.skyblock.command.commands.BansCommand;
|
||||
@ -68,71 +68,71 @@ import net.md_5.bungee.api.chat.HoverEvent;
|
||||
|
||||
public class CommandManager implements CommandExecutor, TabCompleter {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private HashMap<CommandManager.Type, List<SubCommand>> subCommands = new HashMap<>();
|
||||
|
||||
public CommandManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public CommandManager(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
|
||||
plugin.getCommand("island").setExecutor(this);
|
||||
plugin.getCommand("island").setTabCompleter(this);
|
||||
skyblock.getCommand("island").setExecutor(this);
|
||||
skyblock.getCommand("island").setTabCompleter(this);
|
||||
|
||||
registerSubCommands();
|
||||
}
|
||||
|
||||
public void registerSubCommands() {
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
List<SubCommand> subCommands = new ArrayList<>();
|
||||
subCommands.add(new VisitCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Visit.Info.Message"))));
|
||||
subCommands.add(new VoteCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Vote.Info.Message"))));
|
||||
subCommands.add(new ControlPanelCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.ControlPanel.Info.Message"))));
|
||||
subCommands.add(new LeaderboardCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Leaderboard.Info.Message"))));
|
||||
subCommands.add(new CreateCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Create.Info.Message"))));
|
||||
subCommands.add(new DeleteCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Delete.Info.Message"))));
|
||||
subCommands.add(new TeleportCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Teleport.Info.Message"))));
|
||||
subCommands.add(new SetSpawnCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.SetSpawn.Info.Message"))));
|
||||
subCommands.add(new AcceptCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Accept.Info.Message"))));
|
||||
subCommands.add(new DenyCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Deny.Info.Message"))));
|
||||
subCommands.add(new CancelCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Cancel.Info.Message"))));
|
||||
subCommands.add(new LeaveCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Leave.Info.Message"))));
|
||||
subCommands.add(new PromoteCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Promote.Info.Message"))));
|
||||
subCommands.add(new DemoteCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Demote.Info.Message"))));
|
||||
subCommands.add(new KickCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Kick.Info.Message"))));
|
||||
subCommands.add(new KickAllCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.KickAll.Info.Message"))));
|
||||
subCommands.add(new BanCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Ban.Info.Message"))));
|
||||
subCommands.add(new BansCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Bans.Info.Message"))));
|
||||
subCommands.add(new UnbanCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Unban.Info.Message"))));
|
||||
subCommands.add(new BiomeCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Biome.Info.Message"))));
|
||||
subCommands.add(new WeatherCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Weather.Info.Message"))));
|
||||
//subCommands.add(new RollbackCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Rollback.Info.Message"))));
|
||||
subCommands.add(new LevelCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Level.Info.Message"))));
|
||||
subCommands.add(new SettingsCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Settings.Info.Message"))));
|
||||
subCommands.add(new MembersCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Members.Info.Message"))));
|
||||
subCommands.add(new OwnerCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Ownership.Info.Message"))));
|
||||
subCommands.add(new ConfirmCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Confirmation.Info.Message"))));
|
||||
subCommands.add(new InviteCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Invite.Info.Message"))));
|
||||
subCommands.add(new ChatCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Chat.Info.Message"))));
|
||||
subCommands.add(new VisitorsCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Visitors.Info.Message"))));
|
||||
subCommands.add(new CurrentCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Current.Info.Message"))));
|
||||
subCommands.add(new PublicCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Public.Info.Message"))));
|
||||
subCommands.add(new OpenCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Open.Info.Message"))));
|
||||
subCommands.add(new CloseCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Close.Info.Message"))));
|
||||
subCommands.add(new VisitCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Visit.Info.Message"))));
|
||||
subCommands.add(new VoteCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Vote.Info.Message"))));
|
||||
subCommands.add(new ControlPanelCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.ControlPanel.Info.Message"))));
|
||||
subCommands.add(new LeaderboardCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Leaderboard.Info.Message"))));
|
||||
subCommands.add(new CreateCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Create.Info.Message"))));
|
||||
subCommands.add(new DeleteCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Delete.Info.Message"))));
|
||||
subCommands.add(new TeleportCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Teleport.Info.Message"))));
|
||||
subCommands.add(new SetSpawnCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.SetSpawn.Info.Message"))));
|
||||
subCommands.add(new AcceptCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Accept.Info.Message"))));
|
||||
subCommands.add(new DenyCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Deny.Info.Message"))));
|
||||
subCommands.add(new CancelCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Cancel.Info.Message"))));
|
||||
subCommands.add(new LeaveCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Leave.Info.Message"))));
|
||||
subCommands.add(new PromoteCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Promote.Info.Message"))));
|
||||
subCommands.add(new DemoteCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Demote.Info.Message"))));
|
||||
subCommands.add(new KickCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Kick.Info.Message"))));
|
||||
subCommands.add(new KickAllCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.KickAll.Info.Message"))));
|
||||
subCommands.add(new BanCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Ban.Info.Message"))));
|
||||
subCommands.add(new BansCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Bans.Info.Message"))));
|
||||
subCommands.add(new UnbanCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Unban.Info.Message"))));
|
||||
subCommands.add(new BiomeCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Biome.Info.Message"))));
|
||||
subCommands.add(new WeatherCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Weather.Info.Message"))));
|
||||
//subCommands.add(new RollbackCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Rollback.Info.Message"))));
|
||||
subCommands.add(new LevelCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Level.Info.Message"))));
|
||||
subCommands.add(new SettingsCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Settings.Info.Message"))));
|
||||
subCommands.add(new MembersCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Members.Info.Message"))));
|
||||
subCommands.add(new OwnerCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Ownership.Info.Message"))));
|
||||
subCommands.add(new ConfirmCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Confirmation.Info.Message"))));
|
||||
subCommands.add(new InviteCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Invite.Info.Message"))));
|
||||
subCommands.add(new ChatCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Chat.Info.Message"))));
|
||||
subCommands.add(new VisitorsCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Visitors.Info.Message"))));
|
||||
subCommands.add(new CurrentCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Current.Info.Message"))));
|
||||
subCommands.add(new PublicCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Public.Info.Message"))));
|
||||
subCommands.add(new OpenCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Open.Info.Message"))));
|
||||
subCommands.add(new CloseCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Close.Info.Message"))));
|
||||
|
||||
this.subCommands.put(CommandManager.Type.Default, subCommands);
|
||||
|
||||
subCommands = new ArrayList<>();
|
||||
subCommands.add(new me.goodandevil.skyblock.command.commands.admin.SetSpawnCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.SetSpawn.Info.Message"))));
|
||||
subCommands.add(new SetSizeCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.SetSize.Info.Message"))));
|
||||
subCommands.add(new me.goodandevil.skyblock.command.commands.admin.CreateCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Create.Info.Message"))));
|
||||
subCommands.add(new GeneratorCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Generator.Info.Message"))));
|
||||
subCommands.add(new me.goodandevil.skyblock.command.commands.admin.LevelCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Level.Info.Message"))));
|
||||
subCommands.add(new me.goodandevil.skyblock.command.commands.admin.SettingsCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Settings.Info.Message"))));
|
||||
subCommands.add(new StructureCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Structure.Info.Message"))));
|
||||
subCommands.add(new DeleteCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Delete.Info.Message"))));
|
||||
subCommands.add(new OwnerCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Owner.Info.Message"))));
|
||||
subCommands.add(new ReloadCommand(plugin).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Reload.Info.Message"))));
|
||||
subCommands.add(new me.goodandevil.skyblock.command.commands.admin.SetSpawnCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.SetSpawn.Info.Message"))));
|
||||
subCommands.add(new SetSizeCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.SetSize.Info.Message"))));
|
||||
subCommands.add(new me.goodandevil.skyblock.command.commands.admin.CreateCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Create.Info.Message"))));
|
||||
subCommands.add(new GeneratorCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Generator.Info.Message"))));
|
||||
subCommands.add(new me.goodandevil.skyblock.command.commands.admin.LevelCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Level.Info.Message"))));
|
||||
subCommands.add(new me.goodandevil.skyblock.command.commands.admin.SettingsCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Settings.Info.Message"))));
|
||||
subCommands.add(new StructureCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Structure.Info.Message"))));
|
||||
subCommands.add(new DeleteCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Delete.Info.Message"))));
|
||||
subCommands.add(new OwnerCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Owner.Info.Message"))));
|
||||
subCommands.add(new ReloadCommand(skyblock).setInfo(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Admin.Reload.Info.Message"))));
|
||||
|
||||
this.subCommands.put(CommandManager.Type.Admin, subCommands);
|
||||
}
|
||||
@ -150,19 +150,19 @@ public class CommandManager implements CommandExecutor, TabCompleter {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 0) {
|
||||
if (plugin.getIslandManager().hasIsland(player)) {
|
||||
if (skyblock.getIslandManager().hasIsland(player)) {
|
||||
ControlPanel.getInstance().open(player);
|
||||
soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTask(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.getServer().dispatchCommand(player, "island create");
|
||||
@ -178,7 +178,7 @@ public class CommandManager implements CommandExecutor, TabCompleter {
|
||||
if (args[0].equalsIgnoreCase("help")) {
|
||||
int page = -1;
|
||||
|
||||
if (!fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Command.Help.List")) {
|
||||
if (!fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Command.Help.List")) {
|
||||
page = 1;
|
||||
|
||||
if (args.length == 2) {
|
||||
@ -201,7 +201,7 @@ public class CommandManager implements CommandExecutor, TabCompleter {
|
||||
if (player.hasPermission("skyblock.admin") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
int page = -1;
|
||||
|
||||
if (!fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Command.Help.List")) {
|
||||
if (!fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Command.Help.List")) {
|
||||
page = 1;
|
||||
|
||||
if (args.length == 3) {
|
||||
@ -245,7 +245,7 @@ public class CommandManager implements CommandExecutor, TabCompleter {
|
||||
subCommand.onCommand(player, arguments.toArray(new String[0]));
|
||||
}
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}.runTaskAsynchronously(skyblock);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -324,15 +324,15 @@ public class CommandManager implements CommandExecutor, TabCompleter {
|
||||
}
|
||||
|
||||
public void sendHelpCommands(Player player, CommandManager.Type type, int page) {
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
int pageSize = 7;
|
||||
|
||||
int nextEndIndex = subCommands.get(type).size() - page * pageSize, index = page * pageSize - pageSize, endIndex = index >= subCommands.get(type).size() ? subCommands.get(type).size() - 1 : index + pageSize;
|
||||
boolean showAlises = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Command.Help.Aliases.Enable");
|
||||
boolean showAlises = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Command.Help.Aliases.Enable");
|
||||
|
||||
String subCommandText = "";
|
||||
|
||||
@ -403,7 +403,7 @@ public class CommandManager implements CommandExecutor, TabCompleter {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plugin.getMessageManager().sendMessage(player, helpLines);
|
||||
skyblock.getMessageManager().sendMessage(player, helpLines);
|
||||
}
|
||||
}
|
||||
|
||||
@ -421,7 +421,7 @@ public class CommandManager implements CommandExecutor, TabCompleter {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getSoundManager().playSound(player, Sounds.ARROW_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getSoundManager().playSound(player, Sounds.ARROW_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public SubCommand getSubCommand(CommandManager.Type type, String arg) {
|
||||
|
@ -12,7 +12,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
@ -34,29 +34,29 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class AcceptCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public AcceptCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public AcceptCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
ScoreboardManager scoreboardManager = plugin.getScoreboardManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
ScoreboardManager scoreboardManager = skyblock.getScoreboardManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
InviteManager inviteManager = plugin.getInviteManager();
|
||||
InviteManager inviteManager = skyblock.getInviteManager();
|
||||
|
||||
if (inviteManager.hasInvite(player.getUniqueId())) {
|
||||
Invite invite = inviteManager.getInvite(player.getUniqueId());
|
||||
@ -106,7 +106,7 @@ public class AcceptCommand extends SubCommand {
|
||||
island.setRole(Role.Member, player.getUniqueId());
|
||||
island.save();
|
||||
|
||||
if ((island.getRole(Role.Member).size() + island.getRole(Role.Operator).size() + 1) >= fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Member.Capacity")) {
|
||||
if ((island.getRole(Role.Member).size() + island.getRole(Role.Operator).size() + 1) >= fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Member.Capacity")) {
|
||||
Map<UUID, Invite> invites = inviteManager.getInvites();
|
||||
|
||||
for (UUID inviteList : invites.keySet()) {
|
||||
@ -125,7 +125,7 @@ public class AcceptCommand extends SubCommand {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getVisitManager().getIsland(invite.getOwnerUUID()).removeVoter(player.getUniqueId());
|
||||
skyblock.getVisitManager().getIsland(invite.getOwnerUUID()).removeVoter(player.getUniqueId());
|
||||
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
if (!all.getUniqueId().equals(player.getUniqueId())) {
|
||||
|
@ -21,36 +21,36 @@ import me.goodandevil.skyblock.sound.SoundManager;
|
||||
import me.goodandevil.skyblock.utils.OfflinePlayer;
|
||||
import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.ban.Ban;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
|
||||
public class BanCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public BanCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public BanCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
if (islandManager.hasIsland(player)) {
|
||||
if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning")) {
|
||||
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning")) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(playerData.getOwner());
|
||||
|
||||
if (island.isRole(Role.Owner, player.getUniqueId()) || (island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Ban").getStatus())) {
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -20,24 +20,24 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class BansCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public BansCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public BansCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if ((island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Unban").getStatus()) || island.isRole(Role.Owner, player.getUniqueId())) {
|
||||
if (island.getBan().getBans().size() == 0) {
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -19,24 +19,24 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class BiomeCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public BiomeCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public BiomeCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if ((island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Biome").getStatus()) || island.isRole(Role.Owner, player.getUniqueId())) {
|
||||
me.goodandevil.skyblock.menus.Biome.getInstance().open(player);
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -21,26 +21,26 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class CancelCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public CancelCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public CancelCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
InviteManager inviteManager = plugin.getInviteManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
InviteManager inviteManager = skyblock.getInviteManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (island.isRole(Role.Owner, player.getUniqueId()) || island.isRole(Role.Operator, player.getUniqueId())) {
|
||||
String playerName = args[0];
|
||||
|
@ -19,27 +19,27 @@ import me.goodandevil.skyblock.playerdata.PlayerData;
|
||||
import me.goodandevil.skyblock.playerdata.PlayerDataManager;
|
||||
import me.goodandevil.skyblock.sound.SoundManager;
|
||||
import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
|
||||
public class ChatCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public ChatCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public ChatCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -19,24 +19,24 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class CloseCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public CloseCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public CloseCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (island.isRole(Role.Owner, player.getUniqueId()) || (island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Visitor").getStatus())) {
|
||||
if (island.isOpen()) {
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -30,24 +30,24 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class ConfirmCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public ConfirmCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public ConfirmCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
ScoreboardManager scoreboardManager = plugin.getScoreboardManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
ScoreboardManager scoreboardManager = skyblock.getScoreboardManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (playerData.getConfirmationTime() > 0) {
|
||||
@ -95,7 +95,7 @@ public class ConfirmCommand extends SubCommand {
|
||||
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Confirmation.Confirmed.Message"));
|
||||
|
||||
boolean hasSpawnPoint = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "locations.yml")).getFileConfiguration().getString("Location.Spawn") != null;
|
||||
boolean hasSpawnPoint = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "locations.yml")).getFileConfiguration().getString("Location.Spawn") != null;
|
||||
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
if (island.isRole(Role.Member, all.getUniqueId()) || island.isRole(Role.Operator, all.getUniqueId()) || island.isRole(Role.Owner, all.getUniqueId())) {
|
||||
@ -127,8 +127,8 @@ public class ConfirmCommand extends SubCommand {
|
||||
}
|
||||
|
||||
islandManager.deleteIsland(island);
|
||||
plugin.getVisitManager().deleteIsland(player.getUniqueId());
|
||||
plugin.getBanManager().deleteIsland(player.getUniqueId());
|
||||
skyblock.getVisitManager().deleteIsland(player.getUniqueId());
|
||||
skyblock.getBanManager().deleteIsland(player.getUniqueId());
|
||||
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Confirmation.Deletion.Sender.Message"));
|
||||
soundManager.playSound(player, Sounds.EXPLODE.bukkitSound(), 10.0F, 10.0F);
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -16,25 +16,25 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class ControlPanelCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public ControlPanelCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public ControlPanelCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (plugin.getIslandManager().hasIsland(player)) {
|
||||
if (skyblock.getIslandManager().hasIsland(player)) {
|
||||
ControlPanel.getInstance().open(player);
|
||||
soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
plugin.getMessageManager().sendMessage(player, configLoad.getString("Command.Island.ControlPanel.Owner.Message"));
|
||||
skyblock.getMessageManager().sendMessage(player, configLoad.getString("Command.Island.ControlPanel.Owner.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -25,50 +25,50 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class CreateCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public CreateCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public CreateCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
CreationManager creationManager = plugin.getCreationManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
CreationManager creationManager = skyblock.getCreationManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTask(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (islandManager.hasIsland(player)) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Create.Owner.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
Config mainConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config mainConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
|
||||
if (mainConfig.getFileConfiguration().getBoolean("Island.Creation.Menu.Enable")) {
|
||||
Creator.getInstance().open(player);
|
||||
soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
List<Structure> structures = plugin.getStructureManager().getStructures();
|
||||
List<Structure> structures = skyblock.getStructureManager().getStructures();
|
||||
|
||||
if (structures.size() == 0) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Creator.Selector.None.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
} else if (!fileManager.isFileExist(new File(new File(plugin.getDataFolder().toString() + "/structures"), structures.get(0).getFile()))) {
|
||||
} else if (!fileManager.isFileExist(new File(new File(skyblock.getDataFolder().toString() + "/structures"), structures.get(0).getFile()))) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Creator.Selector.File.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
} else if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Creation.Cooldown.Creation.Enable") && creationManager.hasPlayer(player)) {
|
||||
} else if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Creation.Cooldown.Creation.Enable") && creationManager.hasPlayer(player)) {
|
||||
Creation creation = creationManager.getPlayer(player);
|
||||
|
||||
if (creation.getTime() < 60) {
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -20,20 +20,20 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class CurrentCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public CurrentCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public CurrentCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length > 0) {
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -27,23 +27,23 @@ import net.md_5.bungee.api.chat.HoverEvent;
|
||||
|
||||
public class DeleteCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public DeleteCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public DeleteCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
@ -52,7 +52,7 @@ public class DeleteCommand extends SubCommand {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Delete.Confirmation.Pending.Message"));
|
||||
soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
int confirmationTime = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Confirmation.Timeout");
|
||||
int confirmationTime = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Confirmation.Timeout");
|
||||
|
||||
playerData.setConfirmation(Confirmation.Deletion);
|
||||
playerData.setConfirmationTime(confirmationTime);
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -23,22 +23,22 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class DemoteCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public DemoteCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public DemoteCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -19,20 +19,20 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class DenyCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public DenyCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public DenyCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
InviteManager inviteManager = plugin.getInviteManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
InviteManager inviteManager = skyblock.getInviteManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -29,29 +29,29 @@ import net.md_5.bungee.api.chat.HoverEvent;
|
||||
|
||||
public class InviteCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public InviteCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public InviteCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (island.isRole(Role.Owner, player.getUniqueId()) || (island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Invite").getStatus())) {
|
||||
Config mainConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config mainConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
|
||||
if ((island.getRole(Role.Member).size() + island.getRole(Role.Operator).size() + 1) >= mainConfig.getFileConfiguration().getInt("Island.Member.Capacity")) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Invite.Capacity.Message"));
|
||||
@ -74,8 +74,8 @@ public class InviteCommand extends SubCommand {
|
||||
} else if (island.isRole(Role.Member, targetPlayer.getUniqueId()) || island.isRole(Role.Operator, targetPlayer.getUniqueId()) || island.isRole(Role.Owner, targetPlayer.getUniqueId())) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Invite.Member.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if (plugin.getInviteManager().hasInvite(targetPlayer.getUniqueId())) {
|
||||
Invite invite = plugin.getInviteManager().getInvite(targetPlayer.getUniqueId());
|
||||
} else if (skyblock.getInviteManager().hasInvite(targetPlayer.getUniqueId())) {
|
||||
Invite invite = skyblock.getInviteManager().getInvite(targetPlayer.getUniqueId());
|
||||
|
||||
if (invite.getOwnerUUID().equals(island.getOwnerUUID())) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Invite.Already.Own.Message"));
|
||||
@ -95,7 +95,7 @@ public class InviteCommand extends SubCommand {
|
||||
targetPlayer.spigot().sendMessage(new ChatComponent(messageManager.replaceMessage(targetPlayer, ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Invite.Invited.Target.Received.Message").replace("%player", player.getName()).replace("%time", respondTime/60 + " " + configLoad.getString("Command.Island.Invite.Invited.Word.Minute"))) + " "), false, null, null, null).addExtraChatComponent(new ChatComponent(configLoad.getString("Command.Island.Invite.Invited.Word.Accept").toUpperCase(), true, ChatColor.GREEN, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/island accept " + player.getName()), new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Invite.Invited.Word.Tutorial").replace("%action", configLoad.getString("Command.Island.Invite.Invited.Word.Accept")))).create()))).addExtraChatComponent(new ChatComponent(" | ", false, ChatColor.DARK_GRAY, null, null)).addExtra(new ChatComponent(configLoad.getString("Command.Island.Invite.Invited.Word.Deny").toUpperCase(), true, ChatColor.RED, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/island deny " + player.getName()), new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Command.Island.Invite.Invited.Word.Tutorial").replace("%action", configLoad.getString("Command.Island.Invite.Invited.Word.Deny")))).create()))));
|
||||
}
|
||||
|
||||
Invite invite = plugin.getInviteManager().createInvite(targetPlayer, player, island.getOwnerUUID(), respondTime);
|
||||
Invite invite = skyblock.getInviteManager().createInvite(targetPlayer, player, island.getOwnerUUID(), respondTime);
|
||||
|
||||
Bukkit.getServer().getPluginManager().callEvent(new IslandInviteEvent(targetPlayer, player, island, invite));
|
||||
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -27,21 +27,21 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class KickAllCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public KickAllCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public KickAllCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -33,25 +33,25 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class KickCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public KickCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public KickCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
ScoreboardManager scoreboardManager = plugin.getScoreboardManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
ScoreboardManager scoreboardManager = skyblock.getScoreboardManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
|
||||
Config languageConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
|
||||
if (args.length == 1) {
|
||||
if (islandManager.hasIsland(player)) {
|
||||
@ -113,7 +113,7 @@ public class KickCommand extends SubCommand {
|
||||
soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
if (targetPlayer == null) {
|
||||
Config config = fileManager.getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), targetPlayerUUID.toString() + ".yml"));
|
||||
Config config = fileManager.getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), targetPlayerUUID.toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Statistics.Island.Playtime", null);
|
||||
@ -171,7 +171,7 @@ public class KickCommand extends SubCommand {
|
||||
|
||||
if (targetPlayerData.isChat()) {
|
||||
targetPlayerData.setChat(false);
|
||||
messageManager.sendMessage(targetPlayer, fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Chat.Untoggled.Message"));
|
||||
messageManager.sendMessage(targetPlayer, fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Chat.Untoggled.Message"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import java.io.File;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -14,26 +14,26 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class LeaderboardCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public LeaderboardCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public LeaderboardCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
|
||||
if (playerDataManager.hasPlayerData(player)) {
|
||||
if (plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
|
||||
if (skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
|
||||
playerDataManager.getPlayerData(player).setViewer(new Leaderboard.Viewer(Leaderboard.Viewer.Type.Browse));
|
||||
} else {
|
||||
playerDataManager.getPlayerData(player).setViewer(new Leaderboard.Viewer(Leaderboard.Viewer.Type.Level));
|
||||
}
|
||||
|
||||
Leaderboard.getInstance().open(player);
|
||||
plugin.getSoundManager().playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getSoundManager().playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -29,25 +29,25 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class LeaveCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public LeaveCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public LeaveCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
ScoreboardManager scoreboardManager = plugin.getScoreboardManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
ScoreboardManager scoreboardManager = skyblock.getScoreboardManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
|
||||
Config languageConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(playerData.getOwner());
|
||||
@ -92,7 +92,7 @@ public class LeaveCommand extends SubCommand {
|
||||
|
||||
if (targetPlayerData.isChat()) {
|
||||
targetPlayerData.setChat(false);
|
||||
messageManager.sendMessage(targetPlayer, fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Chat.Untoggled.Message"));
|
||||
messageManager.sendMessage(targetPlayer, fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Chat.Untoggled.Message"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -25,22 +25,22 @@ import me.goodandevil.skyblock.visit.VisitManager;
|
||||
|
||||
public class LevelCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public LevelCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public LevelCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
VisitManager visitManager = plugin.getVisitManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
VisitManager visitManager = skyblock.getVisitManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
@ -92,12 +92,12 @@ public class LevelCommand extends SubCommand {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
player.closeInventory();
|
||||
|
||||
if (plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), island.getOwnerUUID().toString() + ".yml")).getFileConfiguration().getString("Levelling.Materials") == null) {
|
||||
LevellingManager levellingManager = plugin.getLevellingManager();
|
||||
if (skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), island.getOwnerUUID().toString() + ".yml")).getFileConfiguration().getString("Levelling.Materials") == null) {
|
||||
LevellingManager levellingManager = skyblock.getLevellingManager();
|
||||
|
||||
if (levellingManager.hasLevelling(island.getOwnerUUID())) {
|
||||
me.goodandevil.skyblock.levelling.Levelling levelling = levellingManager.getLevelling(island.getOwnerUUID());
|
||||
|
@ -4,7 +4,7 @@ import java.io.File;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -15,26 +15,26 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class MembersCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public MembersCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public MembersCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
if (plugin.getIslandManager().hasIsland(player)) {
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
if (skyblock.getIslandManager().hasIsland(player)) {
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
playerData.setType(Members.Type.Default);
|
||||
playerData.setSort(Members.Sort.Default);
|
||||
|
||||
Members.getInstance().open(player, (Members.Type) playerData.getType(), (Members.Sort) playerData.getSort());
|
||||
soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
plugin.getMessageManager().sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Command.Island.Settings.Owner.Message"));
|
||||
skyblock.getMessageManager().sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Command.Island.Settings.Owner.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -19,24 +19,24 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class OpenCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public OpenCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public OpenCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (island.isRole(Role.Owner, player.getUniqueId()) || (island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Visitor").getStatus())) {
|
||||
if (island.isOpen()) {
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -31,23 +31,23 @@ import net.md_5.bungee.api.chat.HoverEvent;
|
||||
|
||||
public class OwnerCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public OwnerCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public OwnerCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
@ -88,7 +88,7 @@ public class OwnerCommand extends SubCommand {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Ownership.Yourself.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
int confirmationTime = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Confirmation.Timeout");
|
||||
int confirmationTime = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Confirmation.Timeout");
|
||||
|
||||
playerData.setOwnership(targetPlayerUUID);
|
||||
playerData.setConfirmation(Confirmation.Ownership);
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -25,23 +25,23 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class PromoteCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public PromoteCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public PromoteCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -19,24 +19,24 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class PublicCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public PublicCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public PublicCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (island.isRole(Role.Owner, player.getUniqueId()) || (island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Visitor").getStatus())) {
|
||||
if (island.isOpen()) {
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -19,24 +19,24 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class RollbackCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public RollbackCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public RollbackCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (island.isRole(Role.Owner, player.getUniqueId())) {
|
||||
Rollback.getInstance().open(player);
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -26,23 +26,23 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class SetSpawnCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
private String info;
|
||||
private me.goodandevil.skyblock.island.Location.Environment locationEnvironment;
|
||||
|
||||
public SetSpawnCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public SetSpawnCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
@ -58,7 +58,7 @@ public class SetSpawnCommand extends SubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (island.isRole(Role.Operator, player.getUniqueId()) || island.isRole(Role.Owner, player.getUniqueId())) {
|
||||
if ((island.isRole(Role.Operator, player.getUniqueId()) && (island.getSetting(Settings.Role.Operator, locationEnvironment.name() + "Spawn").getStatus())) || island.isRole(Role.Owner, player.getUniqueId())) {
|
||||
@ -66,7 +66,7 @@ public class SetSpawnCommand extends SubCommand {
|
||||
if (LocationUtil.isLocationAtLocationRadius(player.getLocation(), island.getLocation(worldList, me.goodandevil.skyblock.island.Location.Environment.Island), island.getRadius())) {
|
||||
Location location = player.getLocation();
|
||||
|
||||
if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Spawn.Protection")) {
|
||||
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Spawn.Protection")) {
|
||||
if (location.clone().subtract(0.0D, 1.0D, 0.0D).getBlock().getType() == Material.AIR || location.clone().subtract(0.0D, 1.0D, 0.0D).getBlock().getType() == Materials.LEGACY_PISTON_MOVING_PIECE.getPostMaterial()) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.SetSpawn.Protection.Block.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
@ -102,7 +102,7 @@ public class SetSpawnCommand extends SubCommand {
|
||||
islandManager.removeSpawnProtection(island.getLocation(worldList, locationEnvironment));
|
||||
islandManager.setSpawnProtection(location);
|
||||
}
|
||||
}.runTask(plugin);
|
||||
}.runTask(skyblock);
|
||||
} else {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.SetSpawn.Protection.Centre.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -19,24 +19,24 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class SettingsCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public SettingsCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public SettingsCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (island.isRole(Role.Operator, player.getUniqueId()) || island.isRole(Role.Owner, player.getUniqueId())) {
|
||||
if ((island.isRole(Role.Operator, player.getUniqueId()) && (island.getSetting(Settings.Role.Operator, "Visitor").getStatus() || island.getSetting(Settings.Role.Operator, "Member").getStatus())) || island.isRole(Role.Owner, player.getUniqueId())) {
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -23,22 +23,22 @@ import me.goodandevil.skyblock.visit.VisitManager;
|
||||
|
||||
public class TeleportCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public TeleportCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public TeleportCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
VisitManager visitManager = plugin.getVisitManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
VisitManager visitManager = skyblock.getVisitManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
@ -104,9 +104,9 @@ public class TeleportCommand extends SubCommand {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Teleport.Teleported.Yourself.Message"));
|
||||
soundManager.playSound(player, Sounds.ENDERMAN_TELEPORT.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTask(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.teleport(island.getLocation(Location.World.Normal, Location.Environment.Main));
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.ban.Ban;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
@ -26,29 +26,29 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class UnbanCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public UnbanCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public UnbanCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
if (islandManager.hasIsland(player)) {
|
||||
if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning")) {
|
||||
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning")) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(playerData.getOwner());
|
||||
|
||||
if (island.isRole(Role.Owner, player.getUniqueId()) || (island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Unban").getStatus())) {
|
||||
|
@ -2,7 +2,7 @@ package me.goodandevil.skyblock.command.commands;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -12,21 +12,21 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class VisitCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public VisitCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public VisitCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
playerData.setType(Visit.Type.Default);
|
||||
playerData.setSort(Visit.Sort.Default);
|
||||
|
||||
Visit.getInstance().open(player, (Visit.Type) playerData.getType(), (Visit.Sort) playerData.getSort());
|
||||
plugin.getSoundManager().playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getSoundManager().playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,30 +13,30 @@ import me.goodandevil.skyblock.message.MessageManager;
|
||||
import me.goodandevil.skyblock.playerdata.PlayerData;
|
||||
import me.goodandevil.skyblock.sound.SoundManager;
|
||||
import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
|
||||
public class VisitorsCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public VisitorsCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public VisitorsCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(playerData.getOwner());
|
||||
|
||||
if (!island.isOpen()) {
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -27,27 +27,27 @@ import me.goodandevil.skyblock.visit.VisitManager;
|
||||
|
||||
public class VoteCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public VoteCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public VoteCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
VisitManager visitManager = plugin.getVisitManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
VisitManager visitManager = skyblock.getVisitManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 1) {
|
||||
if (!fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
|
||||
if (!fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Vote.Disabled.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -20,24 +20,24 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class WeatherCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public WeatherCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public WeatherCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
me.goodandevil.skyblock.island.Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if ((island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Weather").getStatus()) || island.isRole(Role.Owner, player.getUniqueId())) {
|
||||
Weather.getInstance().open(player);
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -18,20 +18,20 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class CreateCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public CreateCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public CreateCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (player.hasPermission("skyblock.admin.create") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
@ -42,7 +42,7 @@ public class CreateCommand extends SubCommand {
|
||||
Creator.getInstance().open(player);
|
||||
soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
plugin.getMessageManager().sendMessage(player, configLoad.getString("Command.Island.Admin.Create.Permission.Message"));
|
||||
skyblock.getMessageManager().sendMessage(player, configLoad.getString("Command.Island.Admin.Create.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -29,22 +29,22 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class DeleteCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public DeleteCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public DeleteCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
ScoreboardManager scoreboardManager = plugin.getScoreboardManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
ScoreboardManager scoreboardManager = skyblock.getScoreboardManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (player.hasPermission("skyblock.admin.delete") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
@ -65,7 +65,7 @@ public class DeleteCommand extends SubCommand {
|
||||
if (islandManager.isIslandExist(targetPlayerUUID)) {
|
||||
islandManager.loadIsland(targetPlayerUUID);
|
||||
|
||||
boolean hasSpawnPoint = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "locations.yml")).getFileConfiguration().getString("Location.Spawn") != null;
|
||||
boolean hasSpawnPoint = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "locations.yml")).getFileConfiguration().getString("Location.Spawn") != null;
|
||||
Island island = islandManager.getIsland(targetPlayerUUID);
|
||||
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
@ -98,8 +98,8 @@ public class DeleteCommand extends SubCommand {
|
||||
}
|
||||
|
||||
islandManager.deleteIsland(island);
|
||||
plugin.getVisitManager().deleteIsland(player.getUniqueId());
|
||||
plugin.getBanManager().deleteIsland(player.getUniqueId());
|
||||
skyblock.getVisitManager().deleteIsland(player.getUniqueId());
|
||||
skyblock.getBanManager().deleteIsland(player.getUniqueId());
|
||||
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Admin.Delete.Deleted.Message").replace("%player", targetPlayerName));
|
||||
soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -19,27 +19,27 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class GeneratorCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public GeneratorCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public GeneratorCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (!(player.hasPermission("skyblock.admin.generator") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*"))) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Admin.Generator.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if (plugin.getGeneratorManager() == null) {
|
||||
} else if (skyblock.getGeneratorManager() == null) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Admin.Generator.Disabled.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -17,26 +17,26 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class LevelCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public LevelCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public LevelCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (player.hasPermission("skyblock.admin.level") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
Levelling.getInstance().open(player);
|
||||
soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
plugin.getMessageManager().sendMessage(player, configLoad.getString("Command.Island.Admin.Level.Permission.Message"));
|
||||
skyblock.getMessageManager().sendMessage(player, configLoad.getString("Command.Island.Admin.Level.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -21,21 +21,21 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class OwnerCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public OwnerCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public OwnerCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (player.hasPermission("skyblock.admin.owner") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
|
@ -6,7 +6,7 @@ import java.util.Map;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -18,20 +18,20 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class ReloadCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public ReloadCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public ReloadCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (player.hasPermission("skyblock.admin.reload") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
@ -42,13 +42,13 @@ public class ReloadCommand extends SubCommand {
|
||||
Config configFileConfig = configs.get(configFileName);
|
||||
String configFilePath = configFileName.replace(configFileConfig.getFile().getName(), "");
|
||||
|
||||
if (configFilePath.equals(plugin.getDataFolder().toString() + "\\") || configFilePath.equals(plugin.getDataFolder().toString() + "/") ) {
|
||||
if (configFilePath.equals(skyblock.getDataFolder().toString() + "\\") || configFilePath.equals(skyblock.getDataFolder().toString() + "/") ) {
|
||||
configFileConfig.loadFile();
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.getScoreboardManager() != null) {
|
||||
plugin.getScoreboardManager().resendScoreboard();
|
||||
if (skyblock.getScoreboardManager() != null) {
|
||||
skyblock.getScoreboardManager().resendScoreboard();
|
||||
}
|
||||
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Admin.Reload.Reloaded.Message"));
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -29,22 +29,22 @@ import me.goodandevil.skyblock.utils.world.WorldBorder;
|
||||
|
||||
public class SetSizeCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public SetSizeCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public SetSizeCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (player.hasPermission("skyblock.admin.setsize") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
@ -79,7 +79,7 @@ public class SetSizeCommand extends SubCommand {
|
||||
Island island = islandManager.getIsland(islandOwnerUUID);
|
||||
island.setSize(size);
|
||||
|
||||
if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.WorldBorder.Enable")) {
|
||||
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.WorldBorder.Enable")) {
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
if (island.isRole(Role.Member, all.getUniqueId()) || island.isRole(Role.Operator, all.getUniqueId()) || island.isRole(Role.Owner, all.getUniqueId()) || island.getVisit().isVisitor(all.getUniqueId())) {
|
||||
WorldBorder.send(all, island.getSize() + 2.5, island.getLocation(Location.World.Normal, Location.Environment.Island));
|
||||
@ -87,7 +87,7 @@ public class SetSizeCommand extends SubCommand {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
File configFile = new File(plugin.getDataFolder().toString() + "/island-data", islandOwnerUUID.toString() + ".yml");
|
||||
File configFile = new File(skyblock.getDataFolder().toString() + "/island-data", islandOwnerUUID.toString() + ".yml");
|
||||
FileConfiguration islandConfigLoad = YamlConfiguration.loadConfiguration(configFile);
|
||||
islandConfigLoad.set("Size", size);
|
||||
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -19,25 +19,25 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class SetSpawnCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public SetSpawnCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public SetSpawnCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (player.hasPermission("skyblock.admin.setspawn") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
for (Location.World worldList : Location.World.values()) {
|
||||
World world = plugin.getWorldManager().getWorld(worldList);
|
||||
World world = skyblock.getWorldManager().getWorld(worldList);
|
||||
|
||||
if (world.getName().equals(player.getWorld().getName())) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Admin.SetSpawn.World.Message"));
|
||||
@ -47,7 +47,7 @@ public class SetSpawnCommand extends SubCommand {
|
||||
}
|
||||
}
|
||||
|
||||
fileManager.setLocation(fileManager.getConfig(new File(plugin.getDataFolder(), "locations.yml")), "Location.Spawn", player.getLocation(), true);
|
||||
fileManager.setLocation(fileManager.getConfig(new File(skyblock.getDataFolder(), "locations.yml")), "Location.Spawn", player.getLocation(), true);
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Admin.SetSpawn.Set.Message"));
|
||||
soundManager.playSound(player, Sounds.LEVEL_UP.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
import me.goodandevil.skyblock.command.CommandManager.Type;
|
||||
@ -17,26 +17,26 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class SettingsCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public SettingsCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public SettingsCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (player.hasPermission("skyblock.admin.settings") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
Settings.getInstance().open(player, Settings.Type.Categories, null);
|
||||
soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
plugin.getMessageManager().sendMessage(player, configLoad.getString("Command.Island.Admin.Settings.Permission.Message"));
|
||||
skyblock.getMessageManager().sendMessage(player, configLoad.getString("Command.Island.Admin.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
@ -21,25 +21,25 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.command.CommandManager;
|
||||
import me.goodandevil.skyblock.command.SubCommand;
|
||||
|
||||
public class StructureCommand extends SubCommand {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private String info;
|
||||
|
||||
public StructureCommand(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public StructureCommand(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommand(Player player, String[] args) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (args.length == 0 || (args.length > 0 && args[0].equalsIgnoreCase("help"))) {
|
||||
@ -105,7 +105,7 @@ public class StructureCommand extends SubCommand {
|
||||
} else if (args[0].equalsIgnoreCase("save")) {
|
||||
if (player.hasPermission("skyblock.admin.structure.save") || player.hasPermission("skyblock.admin.structure.*") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
if (args.length == 2) {
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
Location position1Location = playerData.getArea().getPosition(1);
|
||||
Location position2Location = playerData.getArea().getPosition(2);
|
||||
@ -127,7 +127,7 @@ public class StructureCommand extends SubCommand {
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
try {
|
||||
File configFile = new File(plugin.getDataFolder().toString() + "/structures/" + args[1] + ".structure");
|
||||
File configFile = new File(skyblock.getDataFolder().toString() + "/structures/" + args[1] + ".structure");
|
||||
StructureUtil.saveStructure(configFile, player.getLocation(), StructureUtil.getFixedLocations(position1Location, position2Location));
|
||||
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Admin.Structure.Save.Saved.Successful.Message").replace("%name", args[1]));
|
||||
|
@ -10,24 +10,24 @@ import java.util.Set;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
|
||||
public class FileChecker {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private final FileManager fileManager;
|
||||
|
||||
private Map<File.Type, File> loadedFiles;
|
||||
|
||||
public FileChecker(Main plugin, FileManager fileManager, String configurationFileName) {
|
||||
this.plugin = plugin;
|
||||
public FileChecker(SkyBlock skyblock, FileManager fileManager, String configurationFileName) {
|
||||
this.skyblock = skyblock;
|
||||
this.fileManager = fileManager;
|
||||
|
||||
loadedFiles = new EnumMap<>(File.Type.class);
|
||||
|
||||
java.io.File configFile = new java.io.File(plugin.getDataFolder(), configurationFileName);
|
||||
java.io.File configFile = new java.io.File(skyblock.getDataFolder(), configurationFileName);
|
||||
loadedFiles.put(File.Type.CREATED, new File(fileManager, configFile, YamlConfiguration.loadConfiguration(configFile)));
|
||||
loadedFiles.put(File.Type.RESOURCE, new File(null, null, YamlConfiguration.loadConfiguration(new InputStreamReader(plugin.getResource(configurationFileName)))));
|
||||
loadedFiles.put(File.Type.RESOURCE, new File(null, null, YamlConfiguration.loadConfiguration(new InputStreamReader(skyblock.getResource(configurationFileName)))));
|
||||
}
|
||||
|
||||
public void loadSections() {
|
||||
@ -52,7 +52,7 @@ public class FileChecker {
|
||||
File resourceFile = loadedFiles.get(File.Type.RESOURCE);
|
||||
|
||||
for (String configKeyList : file.getKeys().keySet()) {
|
||||
if (!configKeyList.contains(plugin.getDescription().getName() + "_COMMENT")) {
|
||||
if (!configKeyList.contains(skyblock.getDescription().getName() + "_COMMENT")) {
|
||||
if (!resourceFile.getKeys().containsKey(configKeyList)) {
|
||||
configLoad.set(configKeyList, null);
|
||||
}
|
||||
@ -63,7 +63,7 @@ public class FileChecker {
|
||||
FileConfiguration createdConfigLoad = createdFile.getFileConfiguration();
|
||||
|
||||
for (String configKeyList : file.getKeys().keySet()) {
|
||||
if (!configKeyList.contains(plugin.getDescription().getName() + "_COMMENT")) {
|
||||
if (!configKeyList.contains(skyblock.getDescription().getName() + "_COMMENT")) {
|
||||
if (createdConfigLoad.getString(configKeyList) == null) {
|
||||
createdConfigLoad.set(configKeyList, file.getKeys().get(configKeyList));
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import java.util.logging.Level;
|
||||
|
||||
import com.google.common.io.ByteStreams;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@ -27,39 +27,39 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
public class FileManager {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private Map<String, Config> loadedConfigs = new HashMap<>();
|
||||
|
||||
public FileManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public FileManager(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
|
||||
loadConfigs();
|
||||
}
|
||||
|
||||
public void loadConfigs() {
|
||||
if (!plugin.getDataFolder().exists()) {
|
||||
plugin.getDataFolder().mkdir();
|
||||
if (!skyblock.getDataFolder().exists()) {
|
||||
skyblock.getDataFolder().mkdir();
|
||||
}
|
||||
|
||||
if (!new File(plugin.getDataFolder().toString() + "/structures").exists()) {
|
||||
new File(plugin.getDataFolder().toString() + "/structures").mkdir();
|
||||
if (!new File(skyblock.getDataFolder().toString() + "/structures").exists()) {
|
||||
new File(skyblock.getDataFolder().toString() + "/structures").mkdir();
|
||||
}
|
||||
|
||||
Map<String, File> configFiles = new HashMap<>();
|
||||
configFiles.put("levelling.yml", new File(plugin.getDataFolder(), "levelling.yml"));
|
||||
configFiles.put("config.yml", new File(plugin.getDataFolder(), "config.yml"));
|
||||
configFiles.put("language.yml", new File(plugin.getDataFolder(), "language.yml"));
|
||||
configFiles.put("settings.yml", new File(plugin.getDataFolder(), "settings.yml"));
|
||||
configFiles.put("generators.yml", new File(plugin.getDataFolder(), "generators.yml"));
|
||||
configFiles.put("structures.yml", new File(plugin.getDataFolder(), "structures.yml"));
|
||||
configFiles.put("structures/default.structure", new File(plugin.getDataFolder().toString() + "/structures", "default.structure"));
|
||||
configFiles.put("levelling.yml", new File(skyblock.getDataFolder(), "levelling.yml"));
|
||||
configFiles.put("config.yml", new File(skyblock.getDataFolder(), "config.yml"));
|
||||
configFiles.put("language.yml", new File(skyblock.getDataFolder(), "language.yml"));
|
||||
configFiles.put("settings.yml", new File(skyblock.getDataFolder(), "settings.yml"));
|
||||
configFiles.put("generators.yml", new File(skyblock.getDataFolder(), "generators.yml"));
|
||||
configFiles.put("structures.yml", new File(skyblock.getDataFolder(), "structures.yml"));
|
||||
configFiles.put("structures/default.structure", new File(skyblock.getDataFolder().toString() + "/structures", "default.structure"));
|
||||
|
||||
for (String configFileList : configFiles.keySet()) {
|
||||
File configFile = configFiles.get(configFileList);
|
||||
|
||||
if (configFile.exists()) {
|
||||
if (configFileList.equals("config.yml") || configFileList.equals("language.yml") || configFileList.equals("settings.yml")) {
|
||||
FileChecker fileChecker = new FileChecker(plugin, this, configFileList);
|
||||
FileChecker fileChecker = new FileChecker(skyblock, this, configFileList);
|
||||
fileChecker.loadSections();
|
||||
fileChecker.compareFiles();
|
||||
fileChecker.saveChanges();
|
||||
@ -67,7 +67,7 @@ public class FileManager {
|
||||
} else {
|
||||
try {
|
||||
configFile.createNewFile();
|
||||
try (InputStream is = plugin.getResource(configFileList);
|
||||
try (InputStream is = skyblock.getResource(configFileList);
|
||||
OutputStream os = new FileOutputStream(configFile)) {
|
||||
ByteStreams.copy(is, os);
|
||||
}
|
||||
@ -98,7 +98,7 @@ public class FileManager {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
plugin.getConfig();
|
||||
skyblock.getConfig();
|
||||
}
|
||||
|
||||
public Location getLocation(Config config, String path, boolean direction) {
|
||||
@ -169,7 +169,7 @@ public class FileManager {
|
||||
}
|
||||
|
||||
try {
|
||||
String addLine, currentLine, pluginName = plugin.getDescription().getName();
|
||||
String addLine, currentLine, pluginName = skyblock.getDescription().getName();
|
||||
int commentNum = 0;
|
||||
|
||||
StringBuilder whole = new StringBuilder("");
|
||||
@ -202,8 +202,8 @@ public class FileManager {
|
||||
StringBuilder config = new StringBuilder("");
|
||||
|
||||
for(String line : lines) {
|
||||
if(line.contains(plugin.getDescription().getName() + "_COMMENT")) {
|
||||
config.append(line.replace("IMPORTANT", "[!]").replace("\n", "").replace(plugin.getDescription().getName() + "_COMMENT_", "#").replaceAll("[0-9]+:", "") + "\n");
|
||||
if(line.contains(skyblock.getDescription().getName() + "_COMMENT")) {
|
||||
config.append(line.replace("IMPORTANT", "[!]").replace("\n", "").replace(skyblock.getDescription().getName() + "_COMMENT_", "#").replaceAll("[0-9]+:", "") + "\n");
|
||||
} else if (line.contains(":")) {
|
||||
config.append(line + "\n");
|
||||
}
|
||||
|
@ -10,18 +10,18 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
|
||||
public class CreationManager {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private Map<UUID, Creation> playerCreationStorage = new HashMap<>();
|
||||
|
||||
public CreationManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public CreationManager(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
|
||||
new CreationTask(plugin).runTaskTimerAsynchronously(plugin, 0L, 20L);
|
||||
new CreationTask(skyblock).runTaskTimerAsynchronously(skyblock, 0L, 20L);
|
||||
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
loadPlayer(all);
|
||||
@ -46,7 +46,7 @@ public class CreationManager {
|
||||
}
|
||||
|
||||
private void savePlayer(UUID uuid, int time) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), uuid.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), uuid.toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
@ -60,7 +60,7 @@ public class CreationManager {
|
||||
}
|
||||
|
||||
public void loadPlayer(Player player) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getString("Island.Creation.Cooldown") != null) {
|
||||
@ -71,7 +71,7 @@ public class CreationManager {
|
||||
|
||||
public void removePlayer(Player player) {
|
||||
if (hasPlayer(player)) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
@ -91,7 +91,7 @@ public class CreationManager {
|
||||
if (hasPlayer(player)) {
|
||||
Creation creation = getPlayer(player);
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), player.getUniqueId().toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
|
@ -4,19 +4,19 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
|
||||
public class CreationTask extends BukkitRunnable {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
protected CreationTask(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
protected CreationTask(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
CreationManager creationManager = plugin.getCreationManager();
|
||||
CreationManager creationManager = skyblock.getCreationManager();
|
||||
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
if (creationManager.hasPlayer(all)) {
|
||||
|
@ -17,7 +17,7 @@ import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.utils.version.Materials;
|
||||
import me.goodandevil.skyblock.utils.version.NMSUtil;
|
||||
@ -25,13 +25,13 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class GeneratorManager {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private List<Generator> generatorStorage = new ArrayList<>();
|
||||
|
||||
public GeneratorManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public GeneratorManager(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "generators.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "generators.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getString("Generators") != null) {
|
||||
@ -93,7 +93,7 @@ public class GeneratorManager {
|
||||
public void generateBlock(Player player, Block block) {
|
||||
block.setType(Material.AIR);
|
||||
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = generatorStorage.size() - 1; i >= 0; i--) {
|
||||
@ -108,9 +108,9 @@ public class GeneratorManager {
|
||||
Materials materials = getRandomMaterials(generator);
|
||||
|
||||
if (materials != null) {
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
Bukkit.getScheduler().runTask(skyblock, new Runnable() {
|
||||
public void run() {
|
||||
plugin.getSoundManager().playSound(block.getLocation(), Sounds.FIZZ.bukkitSound(), 1.0F, 10.0F);
|
||||
skyblock.getSoundManager().playSound(block.getLocation(), Sounds.FIZZ.bukkitSound(), 1.0F, 10.0F);
|
||||
|
||||
if (NMSUtil.getVersionNumber() > 12) {
|
||||
block.setType(materials.parseMaterial());
|
||||
|
@ -6,14 +6,14 @@ import java.util.UUID;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
|
||||
public class InviteManager {
|
||||
|
||||
private Map<UUID, Invite> inviteStorage = new HashMap<>();
|
||||
|
||||
public InviteManager(Main plugin) {
|
||||
new InviteTask(this, plugin).runTaskTimerAsynchronously(plugin, 0L, 20L);
|
||||
public InviteManager(SkyBlock skyblock) {
|
||||
new InviteTask(this, skyblock).runTaskTimerAsynchronously(skyblock, 0L, 20L);
|
||||
}
|
||||
|
||||
public Invite createInvite(Player player, Player sender, UUID owner, int time) {
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.message.MessageManager;
|
||||
import me.goodandevil.skyblock.sound.SoundManager;
|
||||
@ -21,20 +21,20 @@ import net.md_5.bungee.api.chat.HoverEvent;
|
||||
|
||||
public class InviteTask extends BukkitRunnable {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private final InviteManager inviteManager;
|
||||
|
||||
protected InviteTask(InviteManager inviteManager, Main plugin) {
|
||||
protected InviteTask(InviteManager inviteManager, SkyBlock skyblock) {
|
||||
this.inviteManager = inviteManager;
|
||||
this.plugin = plugin;
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
|
@ -18,7 +18,7 @@ import org.bukkit.WeatherType;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.ban.Ban;
|
||||
import me.goodandevil.skyblock.ban.BanManager;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
@ -38,7 +38,7 @@ import me.goodandevil.skyblock.world.WorldManager;
|
||||
|
||||
public class Island {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
private List<Location> islandLocations = new ArrayList<>();
|
||||
private Map<Settings.Role, Map<String, Settings>> islandSettings = new EnumMap<>(Settings.Role.class);
|
||||
@ -48,14 +48,14 @@ public class Island {
|
||||
private int size;
|
||||
|
||||
public Island(UUID ownerUUID, org.bukkit.Location islandNormalLocation, org.bukkit.Location islandNetherLocation) {
|
||||
this.plugin = Main.getInstance();
|
||||
this.skyblock = SkyBlock.getInstance();
|
||||
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
WorldManager worldManager = plugin.getWorldManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
WorldManager worldManager = skyblock.getWorldManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
this.ownerUUID = ownerUUID;
|
||||
this.size = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Size.Minimum");
|
||||
this.size = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Size.Minimum");
|
||||
|
||||
if (this.size > 1000) {
|
||||
this.size = 50;
|
||||
@ -64,7 +64,7 @@ public class Island {
|
||||
islandLocations.add(new Location(Location.World.Normal, Location.Environment.Island, islandNormalLocation));
|
||||
islandLocations.add(new Location(Location.World.Nether, Location.Environment.Island, islandNetherLocation));
|
||||
|
||||
File configFile = new File(plugin.getDataFolder().toString() + "/island-data");
|
||||
File configFile = new File(skyblock.getDataFolder().toString() + "/island-data");
|
||||
Config config = fileManager.getConfig(new File(configFile, ownerUUID + ".yml"));
|
||||
|
||||
if (fileManager.isFileExist(new File(configFile, ownerUUID + ".yml"))) {
|
||||
@ -88,7 +88,7 @@ public class Island {
|
||||
}
|
||||
}
|
||||
|
||||
Config settingsConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "settings.yml"));
|
||||
Config settingsConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "settings.yml"));
|
||||
|
||||
for (Settings.Role roleList : Settings.Role.values()) {
|
||||
HashMap<String, Settings> roleSettings = new HashMap<>();
|
||||
@ -105,7 +105,7 @@ public class Island {
|
||||
islandLocations.add(new Location(Location.World.Normal, Location.Environment.Visitor, islandNormalLocation.clone().add(0.5D, 0.0D, 0.5D)));
|
||||
islandLocations.add(new Location(Location.World.Nether, Location.Environment.Visitor, islandNetherLocation.clone().add(0.5D, 0.0D, 0.5D)));
|
||||
|
||||
Config mainConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config mainConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration mainConfigLoad = mainConfig.getFileConfiguration();
|
||||
|
||||
fileManager.setLocation(config, "Location.Normal.Island", islandNormalLocation, true);
|
||||
@ -125,7 +125,7 @@ public class Island {
|
||||
configLoad.set("Weather.Weather", mainConfigLoad.getString("Island.Weather.Default.Weather").toUpperCase());
|
||||
configLoad.set("Ownership.Original", ownerUUID.toString());
|
||||
|
||||
Config settingsConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "settings.yml"));
|
||||
Config settingsConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "settings.yml"));
|
||||
|
||||
for (Settings.Role roleList : Settings.Role.values()) {
|
||||
HashMap<String, Settings> roleSettings = new HashMap<>();
|
||||
@ -139,14 +139,14 @@ public class Island {
|
||||
|
||||
save();
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(Bukkit.getServer().getPlayer(ownerUUID));
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(Bukkit.getServer().getPlayer(ownerUUID));
|
||||
playerData.setPlaytime(0);
|
||||
playerData.setOwner(ownerUUID);
|
||||
playerData.setMemberSince(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new Date()));
|
||||
playerData.save();
|
||||
|
||||
if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Spawn.Protection")) {
|
||||
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
|
||||
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Spawn.Protection")) {
|
||||
Bukkit.getServer().getScheduler().runTask(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
islandNormalLocation.clone().subtract(0.0D, 1.0D, 0.0D).getBlock().setType(Material.STONE);
|
||||
@ -157,15 +157,15 @@ public class Island {
|
||||
}
|
||||
}
|
||||
|
||||
level = new Level(getOwnerUUID(), plugin);
|
||||
level = new Level(getOwnerUUID(), skyblock);
|
||||
|
||||
VisitManager visitManager = plugin.getVisitManager();
|
||||
VisitManager visitManager = skyblock.getVisitManager();
|
||||
|
||||
if (!visitManager.hasIsland(getOwnerUUID())) {
|
||||
visitManager.createIsland(getOwnerUUID(), new org.bukkit.Location[] { getLocation(Location.World.Normal, Location.Environment.Island), getLocation(Location.World.Nether, Location.Environment.Island) }, size, getRole(Role.Member).size() + getRole(Role.Operator).size() + 1, level, getMessage(Message.Signature), isOpen());
|
||||
}
|
||||
|
||||
BanManager banManager = plugin.getBanManager();
|
||||
BanManager banManager = skyblock.getBanManager();
|
||||
|
||||
if (!banManager.hasIsland(getOwnerUUID())) {
|
||||
banManager.createIsland(getOwnerUUID());
|
||||
@ -182,7 +182,7 @@ public class Island {
|
||||
}
|
||||
|
||||
public UUID getOriginalOwnerUUID() {
|
||||
return UUID.fromString(plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getString("Ownership.Original"));
|
||||
return UUID.fromString(skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getString("Ownership.Original"));
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
@ -195,7 +195,7 @@ public class Island {
|
||||
}
|
||||
|
||||
this.size = size;
|
||||
plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Size", size);
|
||||
skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Size", size);
|
||||
}
|
||||
|
||||
public double getRadius() {
|
||||
@ -203,11 +203,11 @@ public class Island {
|
||||
}
|
||||
|
||||
public boolean hasPassword() {
|
||||
return plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getString("Ownership.Password") != null;
|
||||
return skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getString("Ownership.Password") != null;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getString("Ownership.Password");
|
||||
return skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getString("Ownership.Password");
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
@ -215,7 +215,7 @@ public class Island {
|
||||
Bukkit.getServer().getPluginManager().callEvent(islandPasswordChangeEvent);
|
||||
|
||||
if (!islandPasswordChangeEvent.isCancelled()) {
|
||||
plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Ownership.Password", password);
|
||||
skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Ownership.Password", password);
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,8 +234,8 @@ public class Island {
|
||||
if (islandLocationList.getWorld() == world && islandLocationList.getEnvironment() == environment) {
|
||||
Bukkit.getServer().getPluginManager().callEvent(new IslandLocationChangeEvent(this, islandLocationList, new Location(world, environment, location)));
|
||||
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
fileManager.setLocation(fileManager.getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), getOwnerUUID().toString() + ".yml")), "Location." + world.name() + ".Spawn." + environment.name(), location, true);
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
fileManager.setLocation(fileManager.getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), getOwnerUUID().toString() + ".yml")), "Location." + world.name() + ".Spawn." + environment.name(), location, true);
|
||||
|
||||
islandLocationList.setLocation(location);
|
||||
|
||||
@ -245,7 +245,7 @@ public class Island {
|
||||
}
|
||||
|
||||
public Biome getBiome() {
|
||||
return Biome.valueOf(plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getString("Biome.Type"));
|
||||
return Biome.valueOf(skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getString("Biome.Type"));
|
||||
}
|
||||
|
||||
public String getBiomeName() {
|
||||
@ -254,20 +254,20 @@ public class Island {
|
||||
|
||||
public void setBiome(Biome biome) {
|
||||
Bukkit.getServer().getPluginManager().callEvent(new IslandBiomeChangeEvent(this, getBiome(), biome));
|
||||
plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Biome.Type", biome.name());
|
||||
skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Biome.Type", biome.name());
|
||||
}
|
||||
|
||||
public boolean isWeatherSynchronised() {
|
||||
return plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getBoolean("Weather.Synchronised");
|
||||
return skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getBoolean("Weather.Synchronised");
|
||||
}
|
||||
|
||||
public void setWeatherSynchronised(boolean synchronised) {
|
||||
Bukkit.getServer().getPluginManager().callEvent(new IslandWeatherChangeEvent(this, getWeather(), getTime(), synchronised));
|
||||
plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Weather.Synchronised", synchronised);
|
||||
skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Weather.Synchronised", synchronised);
|
||||
}
|
||||
|
||||
public WeatherType getWeather() {
|
||||
return WeatherType.valueOf(plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getString("Weather.Weather"));
|
||||
return WeatherType.valueOf(skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getString("Weather.Weather"));
|
||||
}
|
||||
|
||||
public String getWeatherName() {
|
||||
@ -276,20 +276,20 @@ public class Island {
|
||||
|
||||
public void setWeather(WeatherType weatherType) {
|
||||
Bukkit.getServer().getPluginManager().callEvent(new IslandWeatherChangeEvent(this, weatherType, getTime(), isWeatherSynchronised()));
|
||||
plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Weather.Weather", weatherType.name());
|
||||
skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Weather.Weather", weatherType.name());
|
||||
}
|
||||
|
||||
public int getTime() {
|
||||
return plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getInt("Weather.Time");
|
||||
return skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getInt("Weather.Time");
|
||||
}
|
||||
|
||||
public void setTime(int time) {
|
||||
Bukkit.getServer().getPluginManager().callEvent(new IslandWeatherChangeEvent(this, getWeather(), time, isWeatherSynchronised()));
|
||||
plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Weather.Time", time);
|
||||
skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Weather.Time", time);
|
||||
}
|
||||
|
||||
public List<UUID> getRole(Role role) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
List<UUID> islandRoles = new ArrayList<>();
|
||||
@ -318,7 +318,7 @@ public class Island {
|
||||
}
|
||||
}
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), getOwnerUUID().toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), getOwnerUUID().toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
@ -347,7 +347,7 @@ public class Island {
|
||||
public void removeRole(Role role, UUID uuid) {
|
||||
if (!(role == Role.Visitor || role == Role.Owner)) {
|
||||
if (isRole(role, uuid)) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
List<String> islandMembers = configLoad.getStringList(role.name() + "s");
|
||||
@ -399,17 +399,17 @@ public class Island {
|
||||
Bukkit.getServer().getPluginManager().callEvent(islandOpenEvent);
|
||||
|
||||
if (!islandOpenEvent.isCancelled()) {
|
||||
plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Visitor.Open", open);
|
||||
skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().set("Visitor.Open", open);
|
||||
getVisit().setOpen(open);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isOpen() {
|
||||
return plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getBoolean("Visitor.Open");
|
||||
return skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml")).getFileConfiguration().getBoolean("Visitor.Open");
|
||||
}
|
||||
|
||||
public List<UUID> getVisitors() {
|
||||
Map<UUID, PlayerData> playerDataStorage = plugin.getPlayerDataManager().getPlayerData();
|
||||
Map<UUID, PlayerData> playerDataStorage = skyblock.getPlayerDataManager().getPlayerData();
|
||||
List<UUID> islandVisitors = new ArrayList<>();
|
||||
|
||||
for (UUID playerDataStorageList : playerDataStorage.keySet()) {
|
||||
@ -431,7 +431,7 @@ public class Island {
|
||||
public List<String> getMessage(Message message) {
|
||||
List<String> islandMessage = new ArrayList<>();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getString("Visitor." + message.name() + ".Message") != null) {
|
||||
@ -442,7 +442,7 @@ public class Island {
|
||||
}
|
||||
|
||||
public String getMessageAuthor(Message message) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getString("Visitor." + message.name() + ".Author") != null) {
|
||||
@ -457,7 +457,7 @@ public class Island {
|
||||
Bukkit.getServer().getPluginManager().callEvent(islandMessageChangeEvent);
|
||||
|
||||
if (!islandMessageChangeEvent.isCancelled()) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
configLoad.set("Visitor." + message.name() + ".Message", islandMessage);
|
||||
configLoad.set("Visitor." + message.name() + ".Author", author);
|
||||
@ -469,11 +469,11 @@ public class Island {
|
||||
}
|
||||
|
||||
public Visit getVisit() {
|
||||
return plugin.getVisitManager().getIsland(getOwnerUUID());
|
||||
return skyblock.getVisitManager().getIsland(getOwnerUUID());
|
||||
}
|
||||
|
||||
public Ban getBan() {
|
||||
return plugin.getBanManager().getIsland(getOwnerUUID());
|
||||
return skyblock.getBanManager().getIsland(getOwnerUUID());
|
||||
}
|
||||
|
||||
public Level getLevel() {
|
||||
@ -481,7 +481,7 @@ public class Island {
|
||||
}
|
||||
|
||||
public void save() {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
|
@ -19,7 +19,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.IllegalPluginAccessException;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.ban.BanManager;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
@ -49,17 +49,17 @@ import me.goodandevil.skyblock.world.WorldManager;
|
||||
|
||||
public class IslandManager {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
private double x = 0, offset = 1200;
|
||||
|
||||
private List<IslandLocation> islandLocations = new ArrayList<>();
|
||||
private Map<UUID, Island> islandStorage = new HashMap<>();
|
||||
|
||||
public IslandManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public IslandManager(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
for (Location.World worldList : Location.World.values()) {
|
||||
@ -79,8 +79,8 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
public void saveNextAvailableLocation() {
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
@ -119,7 +119,7 @@ public class IslandManager {
|
||||
islandLocationList.setZ(z);
|
||||
}
|
||||
|
||||
return new org.bukkit.Location(plugin.getWorldManager().getWorld(world), x, 72, z);
|
||||
return new org.bukkit.Location(skyblock.getWorldManager().getWorld(world), x, 72, z);
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,14 +127,14 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
public void createIsland(Player player, Structure structure) {
|
||||
ScoreboardManager scoreboardManager = plugin.getScoreboardManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
ScoreboardManager scoreboardManager = skyblock.getScoreboardManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Island island = new Island(player.getUniqueId(), prepareNextAvailableLocation(Location.World.Normal), prepareNextAvailableLocation(Location.World.Nether));
|
||||
islandStorage.put(player.getUniqueId(), island);
|
||||
|
||||
try {
|
||||
File structureFile = new File(new File(plugin.getDataFolder().toString() + "/structures"), structure.getFile());
|
||||
File structureFile = new File(new File(skyblock.getDataFolder().toString() + "/structures"), structure.getFile());
|
||||
|
||||
for (World worldList : World.values()) {
|
||||
Float[] direction = StructureUtil.pasteStructure(StructureUtil.loadStructure(structureFile), island.getLocation(worldList, Location.Environment.Island), BlockDegreesType.ROTATE_360);
|
||||
@ -148,10 +148,10 @@ public class IslandManager {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
int minimumSize = configLoad.getInt("Island.Size.Minimum");
|
||||
@ -175,11 +175,11 @@ public class IslandManager {
|
||||
}
|
||||
});
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getBoolean("Island.Creation.Cooldown.Creation.Enable")) {
|
||||
plugin.getCreationManager().createPlayer(player, configLoad.getInt("Island.Creation.Cooldown.Time"));
|
||||
skyblock.getCreationManager().createPlayer(player, configLoad.getInt("Island.Creation.Cooldown.Time"));
|
||||
}
|
||||
|
||||
Bukkit.getServer().getPluginManager().callEvent(new IslandCreateEvent(player, island));
|
||||
@ -190,9 +190,9 @@ public class IslandManager {
|
||||
|
||||
saveNextAvailableLocation();
|
||||
|
||||
plugin.getPlayerDataManager().getPlayerData(player).setIsland(player.getUniqueId());
|
||||
skyblock.getPlayerDataManager().getPlayerData(player).setIsland(player.getUniqueId());
|
||||
|
||||
config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
configLoad = config.getFileConfiguration();
|
||||
|
||||
if (scoreboardManager != null) {
|
||||
@ -203,7 +203,7 @@ public class IslandManager {
|
||||
scoreboard.run();
|
||||
}
|
||||
|
||||
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTask(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.teleport(island.getLocation(Location.World.Normal, Location.Environment.Main));
|
||||
@ -211,18 +211,18 @@ public class IslandManager {
|
||||
});
|
||||
|
||||
if (NMSUtil.getVersionNumber() < 13) {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
plugin.getBiomeManager().setBiome(null, island, Biome.valueOf(fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getString("Island.Biome.Default.Type").toUpperCase()));
|
||||
skyblock.getBiomeManager().setBiome(null, island, Biome.valueOf(fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getString("Island.Biome.Default.Type").toUpperCase()));
|
||||
}
|
||||
}, 20L);
|
||||
}
|
||||
}
|
||||
|
||||
public void giveIslandOwnership(UUID uuid) {
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
|
||||
Player targetPlayer = Bukkit.getServer().getPlayer(uuid);
|
||||
UUID islandOwnerUUID;
|
||||
@ -239,23 +239,23 @@ public class IslandManager {
|
||||
island.getLevel().setOwnerUUID(uuid);
|
||||
island.setOwnerUUID(uuid);
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getBoolean("Island.Ownership.Password.Reset")) {
|
||||
island.setPassword(null);
|
||||
}
|
||||
|
||||
File oldIslandDataFile = new File(new File(plugin.getDataFolder().toString() + "/island-data"), islandOwnerUUID.toString() + ".yml");
|
||||
File newIslandDataFile = new File(new File(plugin.getDataFolder().toString() + "/island-data"), uuid.toString() + ".yml");
|
||||
File oldIslandDataFile = new File(new File(skyblock.getDataFolder().toString() + "/island-data"), islandOwnerUUID.toString() + ".yml");
|
||||
File newIslandDataFile = new File(new File(skyblock.getDataFolder().toString() + "/island-data"), uuid.toString() + ".yml");
|
||||
|
||||
fileManager.unloadConfig(oldIslandDataFile);
|
||||
fileManager.unloadConfig(newIslandDataFile);
|
||||
oldIslandDataFile.renameTo(newIslandDataFile);
|
||||
|
||||
plugin.getVisitManager().transfer(uuid, islandOwnerUUID);
|
||||
plugin.getBanManager().transfer(uuid, islandOwnerUUID);
|
||||
plugin.getInviteManager().tranfer(uuid, islandOwnerUUID);
|
||||
skyblock.getVisitManager().transfer(uuid, islandOwnerUUID);
|
||||
skyblock.getBanManager().transfer(uuid, islandOwnerUUID);
|
||||
skyblock.getInviteManager().tranfer(uuid, islandOwnerUUID);
|
||||
|
||||
if (configLoad.getBoolean("Island.Ownership.Transfer.Operator")) {
|
||||
island.setRole(Role.Operator, islandOwnerUUID);
|
||||
@ -283,7 +283,7 @@ public class IslandManager {
|
||||
targetPlayer = Bukkit.getServer().getPlayer(islandMemberList);
|
||||
|
||||
if (targetPlayer == null) {
|
||||
File configFile = new File(new File(plugin.getDataFolder().toString() + "/player-data"), islandMemberList.toString() + ".yml");
|
||||
File configFile = new File(new File(skyblock.getDataFolder().toString() + "/player-data"), islandMemberList.toString() + ".yml");
|
||||
configLoad = YamlConfiguration.loadConfiguration(configFile);
|
||||
configLoad.set("Island.Owner", uuid.toString());
|
||||
|
||||
@ -302,18 +302,18 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
public void deleteIsland(Island island) {
|
||||
plugin.getVisitManager().removeVisitors(island, VisitManager.Removal.Deleted);
|
||||
skyblock.getVisitManager().removeVisitors(island, VisitManager.Removal.Deleted);
|
||||
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
if (island.isRole(Role.Member, all.getUniqueId()) || island.isRole(Role.Operator, all.getUniqueId()) || island.isRole(Role.Owner, all.getUniqueId())) {
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(all);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(all);
|
||||
playerData.setOwner(null);
|
||||
playerData.setMemberSince(null);
|
||||
playerData.setChat(false);
|
||||
playerData.save();
|
||||
}
|
||||
|
||||
InviteManager inviteManager = plugin.getInviteManager();
|
||||
InviteManager inviteManager = skyblock.getInviteManager();
|
||||
|
||||
if (inviteManager.hasInvite(all.getUniqueId())) {
|
||||
Invite invite = inviteManager.getInvite(all.getUniqueId());
|
||||
@ -324,17 +324,17 @@ public class IslandManager {
|
||||
}
|
||||
}
|
||||
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
fileManager.deleteConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), island.getOwnerUUID().toString() + ".yml"));
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
fileManager.deleteConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), island.getOwnerUUID().toString() + ".yml"));
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
Player player = Bukkit.getServer().getPlayer(island.getOwnerUUID());
|
||||
|
||||
if (player != null) {
|
||||
if (configLoad.getBoolean("Island.Creation.Cooldown.Deletion.Enable")) {
|
||||
plugin.getCreationManager().createPlayer(player, configLoad.getInt("Island.Creation.Cooldown.Time"));
|
||||
skyblock.getCreationManager().createPlayer(player, configLoad.getInt("Island.Creation.Cooldown.Time"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -344,15 +344,15 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
public void loadIsland(UUID uuid) {
|
||||
WorldManager worldManager = plugin.getWorldManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
WorldManager worldManager = skyblock.getWorldManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
UUID islandOwnerUUID = null;
|
||||
|
||||
if (isIslandExist(uuid)) {
|
||||
islandOwnerUUID = uuid;
|
||||
} else {
|
||||
Config config = fileManager.getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), uuid.toString() + ".yml"));
|
||||
Config config = fileManager.getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), uuid.toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getString("Island.Owner") != null) {
|
||||
@ -361,7 +361,7 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
if (islandOwnerUUID != null && !hasIsland(islandOwnerUUID)) {
|
||||
File configFile = new File(plugin.getDataFolder().toString() + "/island-data");
|
||||
File configFile = new File(skyblock.getDataFolder().toString() + "/island-data");
|
||||
Config config = fileManager.getConfig(new File(configFile, islandOwnerUUID.toString() + ".yml"));
|
||||
|
||||
org.bukkit.Location islandNormalLocation = fileManager.getLocation(config, "Location.Normal.Island", true);
|
||||
@ -384,14 +384,14 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
public void unloadIsland(UUID uuid) {
|
||||
ScoreboardManager scoreboardManager = plugin.getScoreboardManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
ScoreboardManager scoreboardManager = skyblock.getScoreboardManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
if (hasIsland(uuid)) {
|
||||
UUID islandOwnerUUID = uuid;
|
||||
|
||||
if (!isIslandExist(uuid)) {
|
||||
Config config = fileManager.getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), uuid.toString() + ".yml"));
|
||||
Config config = fileManager.getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), uuid.toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getString("Island.Owner") != null) {
|
||||
@ -402,7 +402,7 @@ public class IslandManager {
|
||||
Island island = getIsland(islandOwnerUUID);
|
||||
island.save();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
int islandMembers = island.getRole(Role.Member).size() + island.getRole(Role.Operator).size() + 1, islandVisitors = island.getVisitors().size();
|
||||
@ -444,14 +444,14 @@ public class IslandManager {
|
||||
}
|
||||
}
|
||||
|
||||
boolean unloadIsland = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Unload");
|
||||
boolean unloadIsland = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Unload");
|
||||
|
||||
if (unloadIsland) {
|
||||
VisitManager visitManager = plugin.getVisitManager();
|
||||
VisitManager visitManager = skyblock.getVisitManager();
|
||||
visitManager.removeVisitors(island, VisitManager.Removal.Unloaded);
|
||||
visitManager.unloadIsland(islandOwnerUUID);
|
||||
|
||||
BanManager banManager = plugin.getBanManager();
|
||||
BanManager banManager = skyblock.getBanManager();
|
||||
banManager.unloadIsland(islandOwnerUUID);
|
||||
} else {
|
||||
if (island.getVisitors().size() != 0) {
|
||||
@ -459,7 +459,7 @@ public class IslandManager {
|
||||
}
|
||||
}
|
||||
|
||||
fileManager.unloadConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), islandOwnerUUID + ".yml"));
|
||||
fileManager.unloadConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), islandOwnerUUID + ".yml"));
|
||||
islandStorage.remove(islandOwnerUUID);
|
||||
|
||||
Bukkit.getServer().getPluginManager().callEvent(new IslandUnloadEvent(island));
|
||||
@ -467,10 +467,10 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
public void visitIsland(Player player, Island island) {
|
||||
ScoreboardManager scoreboardManager = plugin.getScoreboardManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
ScoreboardManager scoreboardManager = skyblock.getScoreboardManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config languageConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
if (island.isRole(Role.Member, player.getUniqueId()) || island.isRole(Role.Operator, player.getUniqueId()) || island.isRole(Role.Owner, player.getUniqueId())) {
|
||||
@ -481,7 +481,7 @@ public class IslandManager {
|
||||
|
||||
if (islandVisitors == 0) {
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
PlayerData targetPlayerData = plugin.getPlayerDataManager().getPlayerData(all);
|
||||
PlayerData targetPlayerData = skyblock.getPlayerDataManager().getPlayerData(all);
|
||||
|
||||
if (targetPlayerData.getOwner() != null && targetPlayerData.getOwner().equals(island.getOwnerUUID())) {
|
||||
Scoreboard scoreboard = scoreboardManager.getScoreboard(all);
|
||||
@ -512,7 +512,7 @@ public class IslandManager {
|
||||
|
||||
List<String> islandWelcomeMessage = island.getMessage(Message.Welcome);
|
||||
|
||||
if (plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Welcome.Enable") && islandWelcomeMessage.size() != 0) {
|
||||
if (skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Welcome.Enable") && islandWelcomeMessage.size() != 0) {
|
||||
for (String islandWelcomeMessageList : islandWelcomeMessage) {
|
||||
player.sendMessage(ChatColor.translateAlternateColorCodes('&', islandWelcomeMessageList));
|
||||
}
|
||||
@ -523,9 +523,9 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
public void closeIsland(Island island) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
island.setOpen(false);
|
||||
@ -566,14 +566,14 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
public boolean isIslandExist(UUID uuid) {
|
||||
return plugin.getFileManager().isFileExist(new File(new File(plugin.getDataFolder().toString() + "/island-data"), uuid.toString() + ".yml"));
|
||||
return skyblock.getFileManager().isFileExist(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), uuid.toString() + ".yml"));
|
||||
}
|
||||
|
||||
public boolean hasIsland(UUID uuid) {
|
||||
UUID islandOwnerUUID = uuid;
|
||||
|
||||
if (!isIslandExist(uuid)) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/player-data"), uuid.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), uuid.toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getString("Island.Owner") != null) {
|
||||
@ -585,7 +585,7 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
public boolean hasIsland(Player player) {
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
return (playerData == null) ? hasIsland(player.getUniqueId()) : islandStorage.containsKey(playerData.getOwner());
|
||||
}
|
||||
|
||||
@ -595,7 +595,7 @@ public class IslandManager {
|
||||
|
||||
public boolean hasPermission(Player player, String setting) {
|
||||
if (hasIsland(player)) {
|
||||
Island island = getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
Island island = getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
for (Location.World worldList : Location.World.values()) {
|
||||
if (LocationUtil.isLocationAtLocationRadius(player.getLocation(), island.getLocation(worldList, Location.Environment.Island), island.getRadius())) {
|
||||
@ -653,7 +653,7 @@ public class IslandManager {
|
||||
|
||||
public List<UUID> getPlayersAtIsland(Island island) {
|
||||
List<UUID> playersAtIsland = new ArrayList<>();
|
||||
Map<UUID, PlayerData> playerData = plugin.getPlayerDataManager().getPlayerData();
|
||||
Map<UUID, PlayerData> playerData = skyblock.getPlayerDataManager().getPlayerData();
|
||||
|
||||
for (UUID playerDataList : playerData.keySet()) {
|
||||
UUID islandOwnerUUID = playerData.get(playerDataList).getIsland();
|
||||
@ -682,11 +682,11 @@ public class IslandManager {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName())) {
|
||||
Island island = null;
|
||||
|
||||
if (hasIsland(player)) {
|
||||
island = getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
island = getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (!LocationUtil.isLocationAtLocationRadius(player.getLocation(), island.getLocation(Location.World.Normal, Location.Environment.Island), island.getRadius())) {
|
||||
island = null;
|
||||
@ -706,7 +706,7 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
if (island != null) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (!island.isWeatherSynchronised()) {
|
||||
@ -720,6 +720,6 @@ public class IslandManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}.runTaskAsynchronously(skyblock);
|
||||
}
|
||||
}
|
||||
|
@ -8,12 +8,12 @@ import java.util.UUID;
|
||||
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
|
||||
public class Level {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
private UUID ownerUUID;
|
||||
|
||||
@ -22,11 +22,11 @@ public class Level {
|
||||
|
||||
private Map<String, Integer> materials;
|
||||
|
||||
public Level(UUID ownerUUID, Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Level(UUID ownerUUID, SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
this.ownerUUID = ownerUUID;
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
Map<String, Integer> materials = new HashMap<>();
|
||||
@ -47,7 +47,7 @@ public class Level {
|
||||
}
|
||||
|
||||
public int getPoints() {
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "levelling.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "levelling.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
int pointsEarned = 0;
|
||||
@ -68,7 +68,7 @@ public class Level {
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
int division = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Levelling.Division");
|
||||
int division = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Levelling.Division");
|
||||
|
||||
if (division == 0) {
|
||||
division = 1;
|
||||
@ -78,7 +78,7 @@ public class Level {
|
||||
}
|
||||
|
||||
public void setMaterials(Map<String, Integer> materials) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), ownerUUID.toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
|
@ -6,26 +6,26 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.visit.Visit;
|
||||
import me.goodandevil.skyblock.visit.VisitManager;
|
||||
|
||||
public class LeaderboardManager {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
private List<Leaderboard> leaderboardStorage = new ArrayList<>();
|
||||
|
||||
public LeaderboardManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public LeaderboardManager(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
|
||||
new LeaderboardTask(plugin).runTaskTimerAsynchronously(plugin, 0L, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Leaderboard.Reset.Time") * 20);
|
||||
new LeaderboardTask(skyblock).runTaskTimerAsynchronously(skyblock, 0L, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Leaderboard.Reset.Time") * 20);
|
||||
|
||||
resetLeaderboard();
|
||||
}
|
||||
|
||||
public void resetLeaderboard() {
|
||||
VisitManager visitManager = plugin.getVisitManager();
|
||||
VisitManager visitManager = skyblock.getVisitManager();
|
||||
|
||||
List<LeaderboardPlayer> islandLevels = new ArrayList<>();
|
||||
List<LeaderboardPlayer> islandVotes = new ArrayList<>();
|
||||
|
@ -2,19 +2,19 @@ package me.goodandevil.skyblock.leaderboard;
|
||||
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
|
||||
public class LeaderboardTask extends BukkitRunnable {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public LeaderboardTask(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public LeaderboardTask(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
LeaderboardManager leaderboardManager = plugin.getLeaderboardManager();
|
||||
LeaderboardManager leaderboardManager = skyblock.getLeaderboardManager();
|
||||
leaderboardManager.clearLeaderboard();
|
||||
leaderboardManager.resetLeaderboard();
|
||||
}
|
||||
|
@ -8,19 +8,19 @@ import org.bukkit.ChunkSnapshot;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
|
||||
public class Chunk {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private Island island;
|
||||
|
||||
private List<ChunkSnapshot> chunkSnapshots = new ArrayList<>();
|
||||
private boolean complete;
|
||||
|
||||
public Chunk(Main plugin, Island island) {
|
||||
this.plugin = plugin;
|
||||
public Chunk(SkyBlock skyblock, Island island) {
|
||||
this.skyblock = skyblock;
|
||||
this.island = island;
|
||||
|
||||
complete = false;
|
||||
@ -32,7 +32,7 @@ public class Chunk {
|
||||
public void run() {
|
||||
prepareChunkSnapshots();
|
||||
}
|
||||
}.runTask(plugin);
|
||||
}.runTask(skyblock);
|
||||
}
|
||||
|
||||
public List<ChunkSnapshot> getChunkSnapshots() {
|
||||
@ -45,7 +45,7 @@ public class Chunk {
|
||||
|
||||
private void prepareChunkSnapshots() {
|
||||
for (me.goodandevil.skyblock.island.Location.World worldList : me.goodandevil.skyblock.island.Location.World.values()) {
|
||||
if (worldList == me.goodandevil.skyblock.island.Location.World.Normal || (worldList == me.goodandevil.skyblock.island.Location.World.Nether && plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.World.Nether.Enable"))) {
|
||||
if (worldList == me.goodandevil.skyblock.island.Location.World.Normal || (worldList == me.goodandevil.skyblock.island.Location.World.Nether && skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.World.Nether.Enable"))) {
|
||||
Location islandLocation = island.getLocation(worldList, me.goodandevil.skyblock.island.Location.Environment.Island);
|
||||
|
||||
Location minLocation = new Location(islandLocation.getWorld(), islandLocation.getBlockX() - island.getRadius(), 0, islandLocation.getBlockZ() - island.getRadius());
|
||||
|
@ -18,7 +18,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
@ -29,20 +29,20 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class LevellingManager {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
private List<Material> materialStorage = new ArrayList<>();
|
||||
private Map<UUID, Levelling> islandLevellingStorage = new HashMap<>();
|
||||
|
||||
public LevellingManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public LevellingManager(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
|
||||
new LevellingTask(this, plugin).runTaskTimerAsynchronously(plugin, 0L, 20L);
|
||||
new LevellingTask(this, skyblock).runTaskTimerAsynchronously(skyblock, 0L, 20L);
|
||||
|
||||
registerMaterials();
|
||||
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
|
||||
for (Player all : Bukkit.getOnlinePlayers()) {
|
||||
if (islandManager.hasIsland(all)) {
|
||||
@ -56,7 +56,7 @@ public class LevellingManager {
|
||||
}
|
||||
|
||||
public void onDisable() {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
@ -69,7 +69,7 @@ public class LevellingManager {
|
||||
}
|
||||
|
||||
public void calculatePoints(Player player, Island island) {
|
||||
Chunk chunk = new Chunk(plugin, island);
|
||||
Chunk chunk = new Chunk(skyblock, island);
|
||||
chunk.prepare();
|
||||
|
||||
int NMSVersion = NMSUtil.getVersionNumber();
|
||||
@ -147,8 +147,8 @@ public class LevellingManager {
|
||||
}
|
||||
|
||||
if (materials.size() == 0) {
|
||||
plugin.getMessageManager().sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Command.Island.Level.Materials.Message"));
|
||||
plugin.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getMessageManager().sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Command.Island.Level.Materials.Message"));
|
||||
skyblock.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
me.goodandevil.skyblock.island.Level level = island.getLevel();
|
||||
level.setLastPoints(level.getPoints());
|
||||
@ -161,11 +161,11 @@ public class LevellingManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskTimerAsynchronously(plugin, 0L, 1L);
|
||||
}.runTaskTimerAsynchronously(skyblock, 0L, 1L);
|
||||
}
|
||||
|
||||
public void registerMaterials() {
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "levelling.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "levelling.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getString("Materials") != null) {
|
||||
@ -206,11 +206,11 @@ public class LevellingManager {
|
||||
}
|
||||
|
||||
public void createLevelling(UUID playerUUID) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), playerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), playerUUID.toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Levelling.Cooldown", plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Levelling.Cooldown"));
|
||||
configLoad.set("Levelling.Cooldown", skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Levelling.Cooldown"));
|
||||
|
||||
try {
|
||||
configLoad.save(configFile);
|
||||
@ -220,7 +220,7 @@ public class LevellingManager {
|
||||
}
|
||||
|
||||
public void removeLevelling(UUID playerUUID) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), playerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), playerUUID.toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
@ -235,7 +235,7 @@ public class LevellingManager {
|
||||
|
||||
public void saveLevelling(UUID playerUUID) {
|
||||
if (hasLevelling(playerUUID)) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), playerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), playerUUID.toString() + ".yml"));
|
||||
File configFile = config.getFile();
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
@ -251,7 +251,7 @@ public class LevellingManager {
|
||||
|
||||
public void loadLevelling(UUID playerUUID) {
|
||||
if (!hasLevelling(playerUUID)) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(new File(plugin.getDataFolder().toString() + "/island-data"), playerUUID.toString() + ".yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(new File(skyblock.getDataFolder().toString() + "/island-data"), playerUUID.toString() + ".yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getString("Levelling.Cooldown") != null) {
|
||||
|
@ -4,22 +4,22 @@ import java.util.UUID;
|
||||
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
|
||||
public class LevellingTask extends BukkitRunnable {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
private final LevellingManager levellingManager;
|
||||
|
||||
protected LevellingTask(LevellingManager levellingManager, Main plugin) {
|
||||
protected LevellingTask(LevellingManager levellingManager, SkyBlock skyblock) {
|
||||
this.levellingManager = levellingManager;
|
||||
this.plugin = plugin;
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
if (levellingManager.hasLevelling(islandList)) {
|
||||
|
@ -20,7 +20,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.block.BlockSpreadEvent;
|
||||
import org.bukkit.event.block.LeavesDecayEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.generator.GeneratorLocation;
|
||||
import me.goodandevil.skyblock.generator.GeneratorManager;
|
||||
@ -37,10 +37,10 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class Block implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Block(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Block(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -48,10 +48,10 @@ public class Block implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
for (Location.World worldList : Location.World.values()) {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(worldList).getName())) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
GeneratorManager generatorManager = plugin.getGeneratorManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(worldList).getName())) {
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
GeneratorManager generatorManager = skyblock.getGeneratorManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
if (islandManager.hasPermission(player, "Destroy")) {
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
@ -81,7 +81,7 @@ public class Block implements Listener {
|
||||
}
|
||||
|
||||
if (LocationUtil.isLocationLocation(event.getBlock().getLocation(), island.getLocation(worldList, Location.Environment.Main)) || LocationUtil.isLocationLocation(event.getBlock().getLocation(), island.getLocation(worldList, Location.Environment.Main).clone().add(0.0D, 1.0D, 0.0D)) || LocationUtil.isLocationLocation(event.getBlock().getLocation(), island.getLocation(worldList, Location.Environment.Main).clone().subtract(0.0D, 1.0D, 0.0D))) {
|
||||
if (plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Spawn.Protection")) {
|
||||
if (skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Spawn.Protection")) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@ -94,8 +94,8 @@ public class Block implements Listener {
|
||||
} else {
|
||||
event.setCancelled(true);
|
||||
|
||||
plugin.getMessageManager().sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
plugin.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getMessageManager().sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
skyblock.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -108,15 +108,15 @@ public class Block implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
for (Location.World worldList : Location.World.values()) {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(worldList).getName())) {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(worldList).getName())) {
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
if (islandManager.hasPermission(player, "Place")) {
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
|
||||
if (LocationUtil.isLocationAtLocationRadius(event.getBlock().getLocation(), island.getLocation(worldList, Location.Environment.Island), island.getRadius())) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getBoolean("Island.WorldBorder.Block")) {
|
||||
@ -132,7 +132,7 @@ public class Block implements Listener {
|
||||
}
|
||||
|
||||
if (LocationUtil.isLocationLocation(event.getBlock().getLocation(), island.getLocation(worldList, Location.Environment.Main)) || LocationUtil.isLocationLocation(event.getBlock().getLocation(), island.getLocation(worldList, Location.Environment.Main).clone().add(0.0D, 1.0D, 0.0D)) || LocationUtil.isLocationLocation(event.getBlock().getLocation(), island.getLocation(worldList, Location.Environment.Main).clone().subtract(0.0D, 1.0D, 0.0D))) {
|
||||
if (plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Spawn.Protection")) {
|
||||
if (skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Spawn.Protection")) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@ -145,8 +145,8 @@ public class Block implements Listener {
|
||||
} else {
|
||||
event.setCancelled(true);
|
||||
|
||||
plugin.getMessageManager().sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
plugin.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getMessageManager().sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
skyblock.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -156,9 +156,9 @@ public class Block implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onBlockPistonExtend(BlockPistonExtendEvent event) {
|
||||
if (!plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Piston.Connected.Extend")) {
|
||||
if (!skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Piston.Connected.Extend")) {
|
||||
for (Location.World worldList : Location.World.values()) {
|
||||
if (event.getBlock().getLocation().getWorld().getName().equals(plugin.getWorldManager().getWorld(worldList).getName())) {
|
||||
if (event.getBlock().getLocation().getWorld().getName().equals(skyblock.getWorldManager().getWorld(worldList).getName())) {
|
||||
for (org.bukkit.block.Block blockList : event.getBlocks()) {
|
||||
if (blockList.getType() == Materials.PISTON.parseMaterial() || blockList.getType() == Materials.STICKY_PISTON.parseMaterial()) {
|
||||
event.setCancelled(true);
|
||||
@ -173,9 +173,9 @@ public class Block implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onBlockPistonRetract(BlockPistonRetractEvent event) {
|
||||
if (!plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Piston.Connected.Retract")) {
|
||||
if (!skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Piston.Connected.Retract")) {
|
||||
for (Location.World worldList : Location.World.values()) {
|
||||
if (event.getBlock().getLocation().getWorld().getName().equals(plugin.getWorldManager().getWorld(worldList).getName())) {
|
||||
if (event.getBlock().getLocation().getWorld().getName().equals(skyblock.getWorldManager().getWorld(worldList).getName())) {
|
||||
for (org.bukkit.block.Block blockList : event.getBlocks()) {
|
||||
if (blockList.getType() == Materials.PISTON.parseMaterial() || blockList.getType() == Materials.STICKY_PISTON.parseMaterial()) {
|
||||
event.setCancelled(true);
|
||||
@ -191,14 +191,14 @@ public class Block implements Listener {
|
||||
@EventHandler
|
||||
public void onBlockForm(BlockFormEvent event) {
|
||||
for (Location.World worldList : Location.World.values()) {
|
||||
if (event.getBlock().getLocation().getWorld().getName().equals(plugin.getWorldManager().getWorld(worldList).getName())) {
|
||||
if (event.getBlock().getLocation().getWorld().getName().equals(skyblock.getWorldManager().getWorld(worldList).getName())) {
|
||||
if (event.getBlock().getType() == Material.ICE || event.getBlock().getType() == Material.SNOW) {
|
||||
if (!plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Weather.IceAndSnow")) {
|
||||
if (!skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Weather.IceAndSnow")) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
GeneratorManager generatorManager = plugin.getGeneratorManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
GeneratorManager generatorManager = skyblock.getGeneratorManager();
|
||||
|
||||
if (generatorManager != null) {
|
||||
org.bukkit.Location location = event.getBlock().getLocation();
|
||||
@ -234,9 +234,9 @@ public class Block implements Listener {
|
||||
public void onBlockFromTo(BlockFromToEvent event) {
|
||||
if (NMSUtil.getVersionNumber() < 13) {
|
||||
for (Location.World worldList : Location.World.values()) {
|
||||
if (event.getBlock().getLocation().getWorld().getName().equals(plugin.getWorldManager().getWorld(worldList).getName())) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
GeneratorManager generatorManager = plugin.getGeneratorManager();
|
||||
if (event.getBlock().getLocation().getWorld().getName().equals(skyblock.getWorldManager().getWorld(worldList).getName())) {
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
GeneratorManager generatorManager = skyblock.getGeneratorManager();
|
||||
|
||||
if (generatorManager != null) {
|
||||
org.bukkit.Location location = event.getBlock().getLocation();
|
||||
@ -272,8 +272,8 @@ public class Block implements Listener {
|
||||
public void onBlockBurn(BlockBurnEvent event) {
|
||||
org.bukkit.block.Block block = event.getBlock();
|
||||
|
||||
if (block.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || block.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
if (block.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || block.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
@ -297,8 +297,8 @@ public class Block implements Listener {
|
||||
public void onBlockSpread(BlockSpreadEvent event) {
|
||||
org.bukkit.block.Block block = event.getBlock();
|
||||
|
||||
if (block.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || block.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
if (block.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || block.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
@ -322,8 +322,8 @@ public class Block implements Listener {
|
||||
public void onLeavesDecay(LeavesDecayEvent event) {
|
||||
org.bukkit.block.Block block = event.getBlock();
|
||||
|
||||
if (block.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || block.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
if (block.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || block.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
|
@ -8,17 +8,17 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerBucketFillEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.island.Location;
|
||||
import me.goodandevil.skyblock.utils.version.Materials;
|
||||
import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class Bucket implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Bucket(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Bucket(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -26,12 +26,12 @@ public class Bucket implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (event.getBlockClicked().getType() == Material.WATER || event.getBlockClicked().getType() == Materials.LEGACY_STATIONARY_WATER.getPostMaterial() || event.getBlockClicked().getType() == Material.LAVA || event.getBlockClicked().getType() == Materials.LEGACY_STATIONARY_LAVA.getPostMaterial()) {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!plugin.getIslandManager().hasPermission(player, "Bucket")) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "Bucket")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
plugin.getMessageManager().sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
plugin.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getMessageManager().sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
skyblock.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.events.IslandChatEvent;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -22,18 +22,18 @@ import me.goodandevil.skyblock.playerdata.PlayerDataManager;
|
||||
|
||||
public class Chat implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Chat(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Chat(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
if (playerDataManager.hasPlayerData(player)) {
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
@ -41,10 +41,10 @@ public class Chat implements Listener {
|
||||
if (playerData.isChat()) {
|
||||
event.setCancelled(true);
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
Island island = plugin.getIslandManager().getIsland(playerData.getOwner());
|
||||
Island island = skyblock.getIslandManager().getIsland(playerData.getOwner());
|
||||
String islandRole = "";
|
||||
|
||||
if (island.isRole(Role.Member, player.getUniqueId())) {
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.Location;
|
||||
@ -20,10 +20,10 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class Death implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Death(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Death(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -31,11 +31,11 @@ public class Death implements Listener {
|
||||
Player player = event.getEntity();
|
||||
|
||||
for (Location.World worldList : Location.World.values()) {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(worldList).getName())) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(worldList).getName())) {
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
boolean keepInventory = false;
|
||||
|
||||
@ -59,7 +59,7 @@ public class Death implements Listener {
|
||||
}
|
||||
|
||||
if (configLoad.getBoolean("Island.Death.AutoRespawn")) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(skyblock, new Runnable() {
|
||||
public void run() {
|
||||
player.spigot().respawn();
|
||||
player.setFallDistance(0.0F);
|
||||
|
@ -18,7 +18,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.event.player.PlayerShearEntityEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.Location;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
@ -30,23 +30,23 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class Entity implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Entity(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Entity(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
if (event.getDamager() instanceof Player) {
|
||||
Player player = (Player) event.getDamager();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (event.getEntity() instanceof Player) {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
@ -62,10 +62,10 @@ public class Entity implements Listener {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!plugin.getIslandManager().hasPermission(player, "MobHurting")) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "MobHurting")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -78,11 +78,11 @@ public class Entity implements Listener {
|
||||
if (event.getDamager() instanceof Player) {
|
||||
Player player = (Player) event.getDamager();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!plugin.getIslandManager().hasPermission(player, "Destroy")) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "Destroy")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
@ -92,11 +92,11 @@ public class Entity implements Listener {
|
||||
if (projectile.getShooter() instanceof Player) {
|
||||
Player player = (Player) projectile.getShooter();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!plugin.getIslandManager().hasPermission(player, "Destroy")) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "Destroy")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
@ -109,12 +109,12 @@ public class Entity implements Listener {
|
||||
public void onPlayerShearEntity(PlayerShearEntityEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!plugin.getIslandManager().hasPermission(player, "Shearing")) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "Shearing")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
plugin.getMessageManager().sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
plugin.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getMessageManager().sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
skyblock.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -124,12 +124,12 @@ public class Entity implements Listener {
|
||||
if (Bukkit.getServer().getPlayer(event.getOwner().getUniqueId()) != null) {
|
||||
Player player = Bukkit.getServer().getPlayer(event.getOwner().getUniqueId());
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!plugin.getIslandManager().hasPermission(player, "MobTaming")) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "MobTaming")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
plugin.getMessageManager().sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
plugin.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getMessageManager().sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
skyblock.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -140,8 +140,8 @@ public class Entity implements Listener {
|
||||
org.bukkit.entity.Entity entity = event.getEntity();
|
||||
|
||||
if (!(entity instanceof Player)) {
|
||||
if (entity.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || entity.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
if (entity.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || entity.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
@ -166,8 +166,8 @@ public class Entity implements Listener {
|
||||
public void onEntityExplode(EntityExplodeEvent event) {
|
||||
org.bukkit.entity.Entity entity = event.getEntity();
|
||||
|
||||
if (entity.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || entity.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
if (entity.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || entity.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
@ -192,9 +192,9 @@ public class Entity implements Listener {
|
||||
if (event.getSpawnReason() == SpawnReason.CUSTOM || event.getSpawnReason() == SpawnReason.NATURAL) {
|
||||
LivingEntity livingEntity = event.getEntity();
|
||||
|
||||
if (livingEntity.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || livingEntity.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (livingEntity.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || livingEntity.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!livingEntity.hasMetadata("SkyBlock")) {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
|
@ -16,7 +16,7 @@ import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.island.Location;
|
||||
import me.goodandevil.skyblock.message.MessageManager;
|
||||
import me.goodandevil.skyblock.sound.SoundManager;
|
||||
@ -28,27 +28,27 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class Interact implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Interact(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Interact(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (event.getClickedBlock().getType() == Material.ANVIL) {
|
||||
if (!islandManager.hasPermission(player, "Anvil")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -57,7 +57,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Beacon")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -66,7 +66,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Bed")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -75,7 +75,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Brewing")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -84,7 +84,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Storage")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -93,7 +93,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Workbench")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -102,7 +102,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Door")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -111,7 +111,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Enchant")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -120,7 +120,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Furnace")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -129,7 +129,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "LeverButton")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -138,7 +138,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Jukebox")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -147,7 +147,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Redstone")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -156,7 +156,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Gate")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -165,7 +165,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "DropperDispenser")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -174,7 +174,7 @@ public class Interact implements Listener {
|
||||
if (player.getFoodLevel() < 20 && !islandManager.hasPermission(player, "Cake")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -183,7 +183,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "DragonEggUse")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -192,7 +192,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Hopper")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -204,7 +204,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Bucket")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
} else if (event.getItem().getType() == Material.GLASS_BOTTLE) {
|
||||
@ -212,7 +212,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "WaterCollection")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
@ -220,7 +220,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "SpawnEgg")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
@ -235,21 +235,21 @@ public class Interact implements Listener {
|
||||
if (player.hasPermission("skyblock.admin.structure.selection") || player.hasPermission("skyblock.admin.structure.*") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
plugin.getPlayerDataManager().getPlayerData(player).getArea().setPosition(2, event.getClickedBlock().getLocation());
|
||||
skyblock.getPlayerDataManager().getPlayerData(player).getArea().setPosition(2, event.getClickedBlock().getLocation());
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Structure.Tool.Position.Message").replace("%position", "2"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Structure.Tool.Position.Message").replace("%position", "2"));
|
||||
soundManager.playSound(player, Sounds.WOOD_CLICK.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
} else if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (player.getTargetBlock((Set<Material>) null, 5).getType() == Material.FIRE) {
|
||||
if (!islandManager.hasPermission(player, "Fire")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
@ -263,21 +263,21 @@ public class Interact implements Listener {
|
||||
if (player.hasPermission("skyblock.admin.structure.selection") || player.hasPermission("skyblock.admin.structure.*") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
plugin.getPlayerDataManager().getPlayerData(player).getArea().setPosition(1, event.getClickedBlock().getLocation());
|
||||
skyblock.getPlayerDataManager().getPlayerData(player).getArea().setPosition(1, event.getClickedBlock().getLocation());
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Structure.Tool.Position.Message").replace("%position", "1"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Structure.Tool.Position.Message").replace("%position", "1"));
|
||||
soundManager.playSound(player, Sounds.WOOD_CLICK.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
} else if (event.getAction() == Action.PHYSICAL) {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (event.getClickedBlock().getType() == Materials.FARMLAND.parseMaterial()) {
|
||||
if (!islandManager.hasPermission(player, "Crop")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
} else if (event.getClickedBlock().getType() == Materials.STONE_PRESSURE_PLATE.parseMaterial() || event.getClickedBlock().getType() == Materials.OAK_PRESSURE_PLATE.parseMaterial() || event.getClickedBlock().getType() == Materials.SPRUCE_PRESSURE_PLATE.parseMaterial() || event.getClickedBlock().getType() == Materials.BIRCH_PRESSURE_PLATE.parseMaterial() || event.getClickedBlock().getType() == Materials.JUNGLE_PRESSURE_PLATE.parseMaterial() || event.getClickedBlock().getType() == Materials.ACACIA_PRESSURE_PLATE.parseMaterial() || event.getClickedBlock().getType() == Materials.DARK_OAK_PRESSURE_PLATE.parseMaterial()) {
|
||||
@ -290,7 +290,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Redstone")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
@ -303,17 +303,17 @@ public class Interact implements Listener {
|
||||
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if ((player.getItemInHand() != null) && (player.getItemInHand().getType() != Material.AIR)) {
|
||||
if (player.getItemInHand().getType() == Materials.LEAD.parseMaterial()) {
|
||||
if (!islandManager.hasPermission(player, "Leash")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -329,7 +329,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "HorseInventory")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -338,7 +338,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "MobRiding")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -348,7 +348,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "MobRiding")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -359,7 +359,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Milking")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -369,7 +369,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "Trading")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -378,7 +378,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "MinecartBoat")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -420,7 +420,7 @@ public class Interact implements Listener {
|
||||
if (!islandManager.hasPermission(player, "AnimalBreeding")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
@ -429,15 +429,15 @@ public class Interact implements Listener {
|
||||
@EventHandler
|
||||
public void onPlayerInteractAtEntity(PlayerInteractAtEntityEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
if (event.getRightClicked() instanceof ArmorStand) {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!islandManager.hasPermission(player, "ArmorStand")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
plugin.getMessageManager().sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
plugin.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getMessageManager().sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
skyblock.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,29 +8,29 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||
import org.bukkit.inventory.HorseInventory;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.island.Location;
|
||||
import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class Inventory implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Inventory(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Inventory(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryOpen(InventoryOpenEvent event) {
|
||||
Player player = (Player) event.getPlayer();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (event.getInventory() instanceof HorseInventory) {
|
||||
if (!plugin.getIslandManager().hasPermission(player, "HorseInventory")) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "HorseInventory")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
plugin.getMessageManager().sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
plugin.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getMessageManager().sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
skyblock.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,24 +6,24 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.island.Location;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class Item implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Item(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Item(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerDropItem(PlayerDropItemEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!plugin.getIslandManager().hasPermission(player, "ItemDrop")) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "ItemDrop")) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@ -33,8 +33,8 @@ public class Item implements Listener {
|
||||
public void onPlayerPickupItem(PlayerPickupItemEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!plugin.getIslandManager().hasPermission(player, "ItemPickup")) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "ItemPickup")) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -27,21 +27,21 @@ import me.goodandevil.skyblock.scoreboard.ScoreboardManager;
|
||||
|
||||
public class Join implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Join(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Join(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
islandManager.loadIsland(player.getUniqueId());
|
||||
islandManager.loadPlayer(player);
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
playerDataManager.loadPlayerData(player);
|
||||
|
||||
if (playerDataManager.hasPlayerData(player)) {
|
||||
@ -67,20 +67,20 @@ public class Join implements Listener {
|
||||
|
||||
playerDataManager.storeIsland(player);
|
||||
|
||||
plugin.getBiomeManager().loadPlayer(player);
|
||||
plugin.getCreationManager().loadPlayer(player);
|
||||
skyblock.getBiomeManager().loadPlayer(player);
|
||||
skyblock.getCreationManager().loadPlayer(player);
|
||||
|
||||
ScoreboardManager scoreboardManager = plugin.getScoreboardManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
ScoreboardManager scoreboardManager = skyblock.getScoreboardManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
if (scoreboardManager != null) {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
Scoreboard scoreboard = new Scoreboard(player);
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
Island island = islandManager.getIsland(playerDataManager.getPlayerData(player).getOwner());
|
||||
|
||||
plugin.getLevellingManager().loadLevelling(island.getOwnerUUID());
|
||||
skyblock.getLevellingManager().loadLevelling(island.getOwnerUUID());
|
||||
|
||||
if (island.getRole(Role.Member).size() == 0 && island.getRole(Role.Operator).size() == 0) {
|
||||
scoreboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getFileConfiguration().getString("Scoreboard.Island.Solo.Displayname")));
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -25,10 +25,10 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class Move implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Move(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Move(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -39,18 +39,18 @@ public class Move implements Listener {
|
||||
Location to = event.getTo();
|
||||
|
||||
if (from.getX() != to.getX() || from.getY() != to.getY() || from.getZ() != to.getZ()) {
|
||||
String netherWorldName = plugin.getWorldManager().getWorld(me.goodandevil.skyblock.island.Location.World.Nether).getName();
|
||||
String netherWorldName = skyblock.getWorldManager().getWorld(me.goodandevil.skyblock.island.Location.World.Nether).getName();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(me.goodandevil.skyblock.island.Location.World.Normal).getName()) || player.getWorld().getName().equals(netherWorldName)) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(me.goodandevil.skyblock.island.Location.World.Normal).getName()) || player.getWorld().getName().equals(netherWorldName)) {
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
if (player.getWorld().getName().equals(netherWorldName)) {
|
||||
if (!fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.World.Nether.Enable")) {
|
||||
messageManager.sendMessage(player, fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.World.Nether.Message"));
|
||||
if (!fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.World.Nether.Enable")) {
|
||||
messageManager.sendMessage(player, fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.World.Nether.Message"));
|
||||
|
||||
if (playerDataManager.hasPlayerData(player)) {
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
@ -94,7 +94,7 @@ public class Move implements Listener {
|
||||
}
|
||||
|
||||
if (world != null) {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (configLoad.getBoolean("Island.World." + world.name() + ".Liquid.Enable")) {
|
||||
@ -123,13 +123,13 @@ public class Move implements Listener {
|
||||
player.teleport(player.getLocation().add(from.toVector().subtract(to.toVector()).normalize().multiply(2.0D)));
|
||||
soundManager.playSound(player, Sounds.ENDERMAN_TELEPORT.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(me.goodandevil.skyblock.island.Location.World.Normal).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(me.goodandevil.skyblock.island.Location.World.Normal).getName())) {
|
||||
player.teleport(island.getLocation(me.goodandevil.skyblock.island.Location.World.Normal, me.goodandevil.skyblock.island.Location.Environment.Main));
|
||||
} else {
|
||||
player.teleport(island.getLocation(me.goodandevil.skyblock.island.Location.World.Nether, me.goodandevil.skyblock.island.Location.Environment.Main));
|
||||
}
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.WorldBorder.Outside.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.WorldBorder.Outside.Message"));
|
||||
soundManager.playSound(player, Sounds.ENDERMAN_TELEPORT.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,7 @@ public class Move implements Listener {
|
||||
|
||||
LocationUtil.teleportPlayerToSpawn(player);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.WorldBorder.Disappeared.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.WorldBorder.Disappeared.Message"));
|
||||
soundManager.playSound(player, Sounds.ENDERMAN_TELEPORT.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.Location;
|
||||
@ -20,10 +20,10 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class Portal implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Portal(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Portal(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -34,39 +34,39 @@ public class Portal implements Listener {
|
||||
|
||||
Player player = (Player) event.getEntity();
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName())) {
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
|
||||
if (LocationUtil.isLocationAtLocationRadius(player.getLocation(), island.getLocation(Location.World.Normal, Location.Environment.Island), island.getRadius())) {
|
||||
if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.World.Nether.Enable") && islandManager.hasPermission(player, "Portal")) {
|
||||
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.World.Nether.Enable") && islandManager.hasPermission(player, "Portal")) {
|
||||
player.teleport(island.getLocation(Location.World.Nether, Location.Environment.Main));
|
||||
soundManager.playSound(player, Sounds.ENDERMAN_TELEPORT.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
player.teleport(island.getLocation(Location.World.Normal, Location.Environment.Main));
|
||||
messageManager.sendMessage(player, fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
} else if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
Island island = islandManager.getIslands().get(islandList);
|
||||
|
||||
if (LocationUtil.isLocationAtLocationRadius(player.getLocation(), island.getLocation(Location.World.Nether, Location.Environment.Island), island.getRadius())) {
|
||||
if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.World.Nether.Enable") && islandManager.hasPermission(player, "Portal")) {
|
||||
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.World.Nether.Enable") && islandManager.hasPermission(player, "Portal")) {
|
||||
player.teleport(island.getLocation(Location.World.Normal, Location.Environment.Main));
|
||||
soundManager.playSound(player, Sounds.ENDERMAN_TELEPORT.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
player.teleport(island.getLocation(Location.World.Nether, Location.Environment.Main));
|
||||
messageManager.sendMessage(player, fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.island.Location;
|
||||
import me.goodandevil.skyblock.message.MessageManager;
|
||||
import me.goodandevil.skyblock.sound.SoundManager;
|
||||
@ -16,10 +16,10 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class Projectile implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Projectile(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Projectile(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -27,25 +27,25 @@ public class Projectile implements Listener {
|
||||
if (event.getEntity().getShooter() instanceof Player) {
|
||||
Player player = (Player) event.getEntity().getShooter();
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (event.getEntity() instanceof FishHook) {
|
||||
if (!plugin.getIslandManager().hasPermission(player, "Fishing")) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "Fishing")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!plugin.getIslandManager().hasPermission(player, "Projectile")) {
|
||||
if (!skyblock.getIslandManager().hasPermission(player, "Projectile")) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
messageManager.sendMessage(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.biome.BiomeManager;
|
||||
import me.goodandevil.skyblock.creation.CreationManager;
|
||||
import me.goodandevil.skyblock.invite.Invite;
|
||||
@ -27,19 +27,19 @@ import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
|
||||
public class Quit implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Quit(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Quit(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
|
||||
@ -53,7 +53,7 @@ public class Quit implements Listener {
|
||||
List<UUID> islandMembersOnline = islandManager.getMembersOnline(island);
|
||||
|
||||
if (islandMembersOnline.size() == 1) {
|
||||
LevellingManager levellingManager = plugin.getLevellingManager();
|
||||
LevellingManager levellingManager = skyblock.getLevellingManager();
|
||||
levellingManager.saveLevelling(island.getOwnerUUID());
|
||||
levellingManager.unloadLevelling(island.getOwnerUUID());
|
||||
} else if (islandMembersOnline.size() == 2) {
|
||||
@ -64,7 +64,7 @@ public class Quit implements Listener {
|
||||
|
||||
if (targetPlayerData.isChat()) {
|
||||
targetPlayerData.setChat(false);
|
||||
messageManager.sendMessage(targetPlayer, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Chat.Untoggled.Message"));
|
||||
messageManager.sendMessage(targetPlayer, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.Chat.Untoggled.Message"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -82,25 +82,25 @@ public class Quit implements Listener {
|
||||
islandManager.unloadIsland(islandOwnerUUID);
|
||||
}
|
||||
|
||||
InviteManager inviteManager = plugin.getInviteManager();
|
||||
InviteManager inviteManager = skyblock.getInviteManager();
|
||||
|
||||
if (inviteManager.hasInvite(player.getUniqueId())) {
|
||||
Invite invite = inviteManager.getInvite(player.getUniqueId());
|
||||
Player targetPlayer = Bukkit.getServer().getPlayer(invite.getOwnerUUID());
|
||||
|
||||
if (targetPlayer != null) {
|
||||
messageManager.sendMessage(targetPlayer, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml")).getFileConfiguration().getString("Command.Island.Invite.Invited.Sender.Disconnected.Message").replace("%player", player.getName()));
|
||||
plugin.getSoundManager().playSound(targetPlayer, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
messageManager.sendMessage(targetPlayer, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Command.Island.Invite.Invited.Sender.Disconnected.Message").replace("%player", player.getName()));
|
||||
skyblock.getSoundManager().playSound(targetPlayer, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
inviteManager.removeInvite(player.getUniqueId());
|
||||
}
|
||||
|
||||
BiomeManager biomeManager = plugin.getBiomeManager();
|
||||
BiomeManager biomeManager = skyblock.getBiomeManager();
|
||||
biomeManager.savePlayer(player);
|
||||
biomeManager.unloadPlayer(player);
|
||||
|
||||
CreationManager creationManager = plugin.getCreationManager();
|
||||
CreationManager creationManager = skyblock.getCreationManager();
|
||||
creationManager.savePlayer(player);
|
||||
creationManager.unloadPlayer(player);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -23,10 +23,10 @@ import me.goodandevil.skyblock.utils.world.LocationUtil;
|
||||
|
||||
public class Respawn implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Respawn(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Respawn(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -34,12 +34,12 @@ public class Respawn implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
for (me.goodandevil.skyblock.island.Location.World worldList : me.goodandevil.skyblock.island.Location.World.values()) {
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(worldList).getName())) {
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(worldList).getName())) {
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
if (configLoad.getBoolean("Island.Death.Respawn.Island")) {
|
||||
for (UUID islandList : islandManager.getIslands().keySet()) {
|
||||
@ -62,7 +62,7 @@ public class Respawn implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
config = fileManager.getConfig(new File(plugin.getDataFolder(), "locations.yml"));
|
||||
config = fileManager.getConfig(new File(skyblock.getDataFolder(), "locations.yml"));
|
||||
|
||||
if (config.getFileConfiguration().getString("Location.Spawn") == null) {
|
||||
Bukkit.getServer().getLogger().log(Level.WARNING, "SkyBlock | Error: A spawn point hasn't been set.");
|
||||
|
@ -11,7 +11,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.events.IslandEnterEvent;
|
||||
@ -30,27 +30,27 @@ import me.goodandevil.skyblock.visit.Visit;
|
||||
|
||||
public class Teleport implements Listener {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public Teleport(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public Teleport(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerTeleport(PlayerTeleportEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
islandManager.loadPlayer(player);
|
||||
|
||||
if (player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(plugin.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if (player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Normal).getName()) || player.getWorld().getName().equals(skyblock.getWorldManager().getWorld(Location.World.Nether).getName())) {
|
||||
if(event.getCause() == TeleportCause.ENDER_PEARL || event.getCause() == TeleportCause.NETHER_PORTAL) {
|
||||
if (!islandManager.hasPermission(player, "Portal")) {
|
||||
event.setCancelled(true);
|
||||
@ -63,7 +63,7 @@ public class Teleport implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
|
||||
if (playerDataManager.hasPlayerData(player)) {
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
@ -84,7 +84,7 @@ public class Teleport implements Listener {
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
} else if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning") && island.getBan().isBanned(player.getUniqueId())) {
|
||||
} else if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning") && island.getBan().isBanned(player.getUniqueId())) {
|
||||
event.setCancelled(true);
|
||||
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Visit.Banned.Teleport.Message"));
|
||||
@ -104,7 +104,7 @@ public class Teleport implements Listener {
|
||||
|
||||
if (worldList == Location.World.Normal) {
|
||||
if (!island.isWeatherSynchronised()) {
|
||||
player.setPlayerTime(island.getTime(), fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Weather.Time.Cycle"));
|
||||
player.setPlayerTime(island.getTime(), fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Weather.Time.Cycle"));
|
||||
player.setPlayerWeather(island.getWeather());
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -45,16 +45,16 @@ public class Bans implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
|
||||
Island island = plugin.getIslandManager().getIsland(playerData.getOwner());
|
||||
Island island = skyblock.getIslandManager().getIsland(playerData.getOwner());
|
||||
|
||||
Config languageConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
List<UUID> islandBans = island.getBan().getBans();
|
||||
@ -112,27 +112,27 @@ public class Bans implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Bans.Title")))) {
|
||||
event.setCancelled(true);
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
Island island = null;
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
island = islandManager.getIsland(playerData.getOwner());
|
||||
|
||||
if (!fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning")) {
|
||||
if (!fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning")) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Bans.Disabled.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
player.closeInventory();
|
||||
@ -174,7 +174,7 @@ public class Bans implements Listener {
|
||||
public void run() {
|
||||
open(player);
|
||||
}
|
||||
}.runTaskLater(plugin, 3L);
|
||||
}.runTaskLater(skyblock, 3L);
|
||||
} else {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Bans.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
|
||||
|
@ -14,7 +14,7 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.biome.BiomeManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -45,13 +45,13 @@ public class Biome implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Island island = plugin.getIslandManager().getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
Island island = skyblock.getIslandManager().getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
String islandBiomeName = island.getBiomeName();
|
||||
int NMSVersion = NMSUtil.getVersionNumber();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
InventoryUtil inv = new InventoryUtil(configLoad.getString("Menu.Biome.Title"), null, 1);
|
||||
@ -121,23 +121,23 @@ public class Biome implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Biome.Title")))) {
|
||||
event.setCancelled(true);
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
BiomeManager biomeManager = plugin.getBiomeManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
BiomeManager biomeManager = skyblock.getBiomeManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Island island = null;
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (!((island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Biome").getStatus()) || island.isRole(Role.Owner, player.getUniqueId()))) {
|
||||
messageManager.sendMessage(player, config.getFileConfiguration().getString("Command.Island.Biome.Permission.Message"));
|
||||
@ -195,7 +195,7 @@ public class Biome implements Listener {
|
||||
selectedBiomeType = Biomes.ROOFED_FOREST.bukkitBiome();
|
||||
}
|
||||
|
||||
biomeManager.createPlayer(player, plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Biome.Cooldown"));
|
||||
biomeManager.createPlayer(player, skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Biome.Cooldown"));
|
||||
biomeManager.setBiome(player, island, selectedBiomeType);
|
||||
|
||||
island.setBiome(selectedBiomeType);
|
||||
@ -218,13 +218,13 @@ public class Biome implements Listener {
|
||||
public void onInventoryClose(InventoryCloseEvent event) {
|
||||
Player player = (Player) event.getPlayer();
|
||||
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config languageConfig = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Biome.Title")))) {
|
||||
plugin.getSoundManager().playSound(player, Sounds.CHEST_CLOSE.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getSoundManager().playSound(player, Sounds.CHEST_CLOSE.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.utils.item.InventoryUtil;
|
||||
import me.goodandevil.skyblock.utils.version.Materials;
|
||||
@ -32,9 +32,9 @@ public class ControlPanel implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
InventoryUtil inv = new InventoryUtil(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.ControlPanel.Title")), null, 1);
|
||||
@ -57,9 +57,9 @@ public class ControlPanel implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.ControlPanel.Title")))) {
|
||||
@ -69,7 +69,7 @@ public class ControlPanel implements Listener {
|
||||
player.closeInventory();
|
||||
Bukkit.getServer().dispatchCommand(player, "island teleport");
|
||||
} else if ((event.getCurrentItem().getType() == Materials.BLACK_STAINED_GLASS_PANE.parseMaterial()) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.ControlPanel.Item.Barrier.Displayname"))))) {
|
||||
plugin.getSoundManager().playSound(player, Sounds.GLASS.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getSoundManager().playSound(player, Sounds.GLASS.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if ((event.getCurrentItem().getType() == Materials.EXPERIENCE_BOTTLE.parseMaterial()) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.ControlPanel.Item.Level.Displayname"))))) {
|
||||
player.closeInventory();
|
||||
Bukkit.getServer().dispatchCommand(player, "island level");
|
||||
|
@ -13,7 +13,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.creation.Creation;
|
||||
@ -39,14 +39,14 @@ public class Creator implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
List<Structure> availableStructures = new ArrayList<>();
|
||||
|
||||
for (Structure structureList : plugin.getStructureManager().getStructures()) {
|
||||
for (Structure structureList : skyblock.getStructureManager().getStructures()) {
|
||||
if (structureList.getDisplayname() == null || structureList.getDisplayname().isEmpty() || structureList.getFile() == null || structureList.getFile().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
@ -63,8 +63,8 @@ public class Creator implements Listener {
|
||||
int inventoryRows = 0;
|
||||
|
||||
if (availableStructures.size() == 0) {
|
||||
plugin.getMessageManager().sendMessage(player, configLoad.getString("Island.Creator.Selector.None.Message"));
|
||||
plugin.getSoundManager().playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getMessageManager().sendMessage(player, configLoad.getString("Island.Creator.Selector.None.Message"));
|
||||
skyblock.getSoundManager().playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
} else if (availableStructures.size() <= 9) {
|
||||
@ -113,20 +113,20 @@ public class Creator implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Creator.Selector.Title")))) {
|
||||
event.setCancelled(true);
|
||||
|
||||
CreationManager creationManager = plugin.getCreationManager();
|
||||
CreationManager creationManager = skyblock.getCreationManager();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Create.Owner.Message"));
|
||||
@ -135,7 +135,7 @@ public class Creator implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
for (Structure structureList : plugin.getStructureManager().getStructures()) {
|
||||
for (Structure structureList : skyblock.getStructureManager().getStructures()) {
|
||||
if ((event.getCurrentItem().getType() == structureList.getMaterials().parseMaterial()) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Creator.Selector.Item.Island.Displayname").replace("%displayname", structureList.getDisplayname()))))) {
|
||||
if (structureList.isPermission() && structureList.getPermission() != null && !structureList.getPermission().isEmpty()) {
|
||||
if (!player.hasPermission(structureList.getPermission()) && !player.hasPermission("skyblock.island.*") && !player.hasPermission("skyblock.*")) {
|
||||
@ -148,12 +148,12 @@ public class Creator implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
if (!fileManager.isFileExist(new File(new File(plugin.getDataFolder().toString() + "/structures"), structureList.getFile()))) {
|
||||
if (!fileManager.isFileExist(new File(new File(skyblock.getDataFolder().toString() + "/structures"), structureList.getFile()))) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Creator.Selector.File.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
} else if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Creation.Cooldown.Creation.Enable") && creationManager.hasPlayer(player)) {
|
||||
} else if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Creation.Cooldown.Creation.Enable") && creationManager.hasPlayer(player)) {
|
||||
Creation creation = creationManager.getPlayer(player);
|
||||
|
||||
if (creation.getTime() < 60) {
|
||||
|
@ -15,7 +15,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.playerdata.PlayerDataManager;
|
||||
@ -39,12 +39,12 @@ public class Leaderboard implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
Viewer viewer = (Viewer) playerDataManager.getPlayerData(player).getViewer();
|
||||
@ -59,13 +59,13 @@ public class Leaderboard implements Listener {
|
||||
} else {
|
||||
inv = new InventoryUtil(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Leaderboard.Leaderboard.Title").replace("%leaderboard", viewer.getType().name())), null, 6);
|
||||
|
||||
if (fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
|
||||
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
|
||||
inv.addItem(inv.createItem(Materials.OAK_FENCE_GATE.parseItem(), configLoad.getString("Menu.Leaderboard.Leaderboard.Item.Return.Displayname"), null, null, null, null), 0, 8);
|
||||
} else {
|
||||
inv.addItem(inv.createItem(Materials.OAK_FENCE_GATE.parseItem(), configLoad.getString("Menu.Leaderboard.Leaderboard.Item.Exit.Displayname"), null, null, null, null), 0, 8);
|
||||
}
|
||||
|
||||
List<me.goodandevil.skyblock.leaderboard.Leaderboard> leaderboardIslands = plugin.getLeaderboardManager().getLeaderboard(me.goodandevil.skyblock.leaderboard.Leaderboard.Type.valueOf(viewer.getType().name()));
|
||||
List<me.goodandevil.skyblock.leaderboard.Leaderboard> leaderboardIslands = skyblock.getLeaderboardManager().getLeaderboard(me.goodandevil.skyblock.leaderboard.Leaderboard.Type.valueOf(viewer.getType().name()));
|
||||
|
||||
for (int i = 0; i < leaderboardIslands.size(); i++) {
|
||||
me.goodandevil.skyblock.leaderboard.Leaderboard leaderboard = leaderboardIslands.get(i);
|
||||
@ -146,13 +146,13 @@ public class Leaderboard implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Leaderboard." + Viewer.Type.Browse.name() + ".Title")))) {
|
||||
@ -178,7 +178,7 @@ public class Leaderboard implements Listener {
|
||||
soundManager.playSound(player, Sounds.CHEST_CLOSE.bukkitSound(), 1.0F, 1.0F);
|
||||
player.closeInventory();
|
||||
} else if (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Leaderboard.Leaderboard.Item.Return.Displayname")))) {
|
||||
if (plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
|
||||
if (skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
|
||||
playerDataManager.getPlayerData(player).setViewer(new Viewer(Viewer.Type.Browse));
|
||||
open(player);
|
||||
soundManager.playSound(player, Sounds.ARROW_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
|
@ -16,7 +16,7 @@ import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -46,19 +46,19 @@ public class Levelling implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
Island island = plugin.getIslandManager().getIsland(playerData.getOwner());
|
||||
Island island = skyblock.getIslandManager().getIsland(playerData.getOwner());
|
||||
Level level = island.getLevel();
|
||||
|
||||
Map<String, Integer> islandMaterials = level.getMaterials();
|
||||
|
||||
int playerMenuPage = playerData.getPage(), nextEndIndex = islandMaterials.size() - playerMenuPage * 36;
|
||||
|
||||
Config languageConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
InventoryUtil inv = new InventoryUtil(configLoad.getString("Menu.Levelling.Title"), null, 6);
|
||||
@ -80,7 +80,7 @@ public class Levelling implements Listener {
|
||||
} else {
|
||||
int index = playerMenuPage * 36 - 36, endIndex = index >= islandMaterials.size() ? islandMaterials.size() - 1 : index + 36, inventorySlot = 17;
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "levelling.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "levelling.yml"));
|
||||
|
||||
for (; index < endIndex; index++) {
|
||||
if (islandMaterials.size() > index) {
|
||||
@ -119,13 +119,13 @@ public class Levelling implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Levelling.Title")))) {
|
||||
@ -149,8 +149,8 @@ public class Levelling implements Listener {
|
||||
} else if ((event.getCurrentItem().getType() == Material.BARRIER) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Levelling.Item.Nothing.Displayname"))))) {
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if ((event.getCurrentItem().getType() == Materials.FIREWORK_STAR.parseMaterial()) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Levelling.Item.Rescan.Displayname"))))) {
|
||||
LevellingManager levellingManager = plugin.getLevellingManager();
|
||||
Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
LevellingManager levellingManager = skyblock.getLevellingManager();
|
||||
Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (levellingManager.hasLevelling(island.getOwnerUUID())) {
|
||||
me.goodandevil.skyblock.levelling.Levelling levelling = levellingManager.getLevelling(island.getOwnerUUID());
|
||||
@ -180,9 +180,9 @@ public class Levelling implements Listener {
|
||||
levellingManager.loadLevelling(island.getOwnerUUID());
|
||||
levellingManager.calculatePoints(player, island);
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}.runTaskAsynchronously(skyblock);
|
||||
} else if ((event.getCurrentItem().getType() == SkullUtil.createItemStack().getType()) && (is.hasItemMeta())) {
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
if (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Levelling.Item.Previous.Displayname")))) {
|
||||
playerData.setPage(playerData.getPage() - 1);
|
||||
@ -206,13 +206,13 @@ public class Levelling implements Listener {
|
||||
public void onInventoryClose(InventoryCloseEvent event) {
|
||||
Player player = (Player) event.getPlayer();
|
||||
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Levelling.Title")))) {
|
||||
plugin.getSoundManager().playSound(player, Sounds.CHEST_CLOSE.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getSoundManager().playSound(player, Sounds.CHEST_CLOSE.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
@ -53,11 +53,11 @@ public class Members implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player, Members.Type type, Members.Sort sort) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
Island island = plugin.getIslandManager().getIsland(playerData.getOwner());
|
||||
Island island = skyblock.getIslandManager().getIsland(playerData.getOwner());
|
||||
|
||||
List<UUID> displayedMembers = new ArrayList<>();
|
||||
|
||||
@ -83,9 +83,9 @@ public class Members implements Listener {
|
||||
Player targetPlayer = Bukkit.getServer().getPlayer(displayedMemberList);
|
||||
|
||||
if (targetPlayer == null) {
|
||||
sortedPlaytimes.put(YamlConfiguration.loadConfiguration(new File(new File(plugin.getDataFolder().toString() + "/player-data"), displayedMemberList.toString() + ".yml")).getInt("Statistics.Island.Playtime"), displayedMemberList);
|
||||
sortedPlaytimes.put(YamlConfiguration.loadConfiguration(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), displayedMemberList.toString() + ".yml")).getInt("Statistics.Island.Playtime"), displayedMemberList);
|
||||
} else {
|
||||
sortedPlaytimes.put(plugin.getPlayerDataManager().getPlayerData(targetPlayer).getPlaytime(), displayedMemberList);
|
||||
sortedPlaytimes.put(skyblock.getPlayerDataManager().getPlayerData(targetPlayer).getPlaytime(), displayedMemberList);
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,9 +102,9 @@ public class Members implements Listener {
|
||||
|
||||
try {
|
||||
if (targetPlayer == null) {
|
||||
sortedDates.put(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(YamlConfiguration.loadConfiguration(new File(new File(plugin.getDataFolder().toString() + "/player-data"), displayedMemberList.toString() + ".yml")).getString("Statistics.Island.Join")), displayedMemberList);
|
||||
sortedDates.put(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(YamlConfiguration.loadConfiguration(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), displayedMemberList.toString() + ".yml")).getString("Statistics.Island.Join")), displayedMemberList);
|
||||
} else {
|
||||
sortedDates.put(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(plugin.getPlayerDataManager().getPlayerData(targetPlayer).getMemberSince()), displayedMemberList);
|
||||
sortedDates.put(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(skyblock.getPlayerDataManager().getPlayerData(targetPlayer).getMemberSince()), displayedMemberList);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
@ -127,7 +127,7 @@ public class Members implements Listener {
|
||||
onlineMembers.remove(displayedMemberList);
|
||||
|
||||
try {
|
||||
sortedDates.put(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(YamlConfiguration.loadConfiguration(new File(new File(plugin.getDataFolder().toString() + "/player-data"), displayedMemberList.toString() + ".yml")).getString("Statistics.Island.LastOnline")), displayedMemberList);
|
||||
sortedDates.put(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(YamlConfiguration.loadConfiguration(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), displayedMemberList.toString() + ".yml")).getString("Statistics.Island.LastOnline")), displayedMemberList);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -154,13 +154,13 @@ public class Members implements Listener {
|
||||
|
||||
int playerMenuPage = playerData.getPage(), nextEndIndex = displayedMembers.size() - playerMenuPage * 36;
|
||||
|
||||
Config languageConfig = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
InventoryUtil inv = new InventoryUtil(configLoad.getString("Menu.Members.Title"), null, 6);
|
||||
inv.addItem(inv.createItem(Materials.OAK_FENCE_GATE.parseItem(), configLoad.getString("Menu.Members.Item.Exit.Displayname"), null, null, null, null), 0, 8);
|
||||
inv.addItem(inv.createItem(new ItemStack(Material.HOPPER), configLoad.getString("Menu.Members.Item.Type.Displayname"), configLoad.getStringList("Menu.Members.Item.Type.Lore"), inv.createItemLoreVariable(new String[] { "%type#" + type.name() }), null, null), 3);
|
||||
inv.addItem(inv.createItem(new ItemStack(Material.PAINTING), configLoad.getString("Menu.Members.Item.Statistics.Displayname"), configLoad.getStringList("Menu.Members.Item.Statistics.Lore"), inv.createItemLoreVariable(new String[] { "%island_members#" + (islandMembers.size() + islandOperators.size() + 1), "%island_capacity#" + plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Member.Capacity"), "%members#" + islandMembers.size(), "%operators#" + islandOperators.size()}), null, null), 4);
|
||||
inv.addItem(inv.createItem(new ItemStack(Material.PAINTING), configLoad.getString("Menu.Members.Item.Statistics.Displayname"), configLoad.getStringList("Menu.Members.Item.Statistics.Lore"), inv.createItemLoreVariable(new String[] { "%island_members#" + (islandMembers.size() + islandOperators.size() + 1), "%island_capacity#" + skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Member.Capacity"), "%members#" + islandMembers.size(), "%operators#" + islandOperators.size()}), null, null), 4);
|
||||
inv.addItem(inv.createItem(new ItemStack(Material.HOPPER), configLoad.getString("Menu.Members.Item.Sort.Displayname"), configLoad.getStringList("Menu.Members.Item.Sort.Lore"), inv.createItemLoreVariable(new String[] { "%sort#" + StringUtil.capatilizeUppercaseLetters(sort.name()) }), null, null), 5);
|
||||
inv.addItem(inv.createItem(Materials.BLACK_STAINED_GLASS_PANE.parseItem(), configLoad.getString("Menu.Members.Item.Barrier.Displayname"), null, null, null, null), 9, 10, 11, 12, 13, 14, 15, 16, 17);
|
||||
|
||||
@ -209,7 +209,7 @@ public class Members implements Listener {
|
||||
} else {
|
||||
playerName = targetPlayer.getName();
|
||||
|
||||
playerData = plugin.getPlayerDataManager().getPlayerData(targetPlayer);
|
||||
playerData = skyblock.getPlayerDataManager().getPlayerData(targetPlayer);
|
||||
playerTexture = playerData.getTexture();
|
||||
islandPlaytime = playerData.getPlaytime();
|
||||
playTimeDurationTime = NumberUtil.getDuration(Integer.valueOf(islandPlaytime));
|
||||
@ -305,30 +305,30 @@ public class Members implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Members.Title")))) {
|
||||
event.setCancelled(true);
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
if (playerData.getType() == null || playerData.getSort() == null) {
|
||||
playerData.setType(Members.Type.Default);
|
||||
playerData.setSort(Members.Sort.Default);
|
||||
}
|
||||
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Island island = null;
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
island = islandManager.getIsland(playerData.getOwner());
|
||||
} else {
|
||||
plugin.getMessageManager().sendMessage(player, config.getFileConfiguration().getString("Command.Island.Members.Owner.Message"));
|
||||
skyblock.getMessageManager().sendMessage(player, config.getFileConfiguration().getString("Command.Island.Members.Owner.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
player.closeInventory();
|
||||
|
||||
@ -400,7 +400,7 @@ public class Members implements Listener {
|
||||
public void run() {
|
||||
open(player, (Members.Type) playerData.getType(), (Members.Sort) playerData.getSort());
|
||||
}
|
||||
}.runTaskLater(plugin, 3L);
|
||||
}.runTaskLater(skyblock, 3L);
|
||||
|
||||
return;
|
||||
} else if (event.getClick() == ClickType.RIGHT) {
|
||||
@ -411,7 +411,7 @@ public class Members implements Listener {
|
||||
public void run() {
|
||||
open(player, (Members.Type) playerData.getType(), (Members.Sort) playerData.getSort());
|
||||
}
|
||||
}.runTaskLater(plugin, 3L);
|
||||
}.runTaskLater(skyblock, 3L);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -423,7 +423,7 @@ public class Members implements Listener {
|
||||
public void run() {
|
||||
open(player, (Members.Type) playerData.getType(), (Members.Sort) playerData.getSort());
|
||||
}
|
||||
}.runTaskLater(plugin, 3L);
|
||||
}.runTaskLater(skyblock, 3L);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -440,13 +440,13 @@ public class Members implements Listener {
|
||||
public void onInventoryClose(InventoryCloseEvent event) {
|
||||
Player player = (Player) event.getPlayer();
|
||||
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Members.Title")))) {
|
||||
plugin.getSoundManager().playSound(player, Sounds.CHEST_CLOSE.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getSoundManager().playSound(player, Sounds.CHEST_CLOSE.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
@ -46,11 +46,11 @@ public class Ownership implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
|
||||
Island island = plugin.getIslandManager().getIsland(playerDataManager.getPlayerData(player).getOwner());
|
||||
Island island = skyblock.getIslandManager().getIsland(playerDataManager.getPlayerData(player).getOwner());
|
||||
|
||||
UUID originalOwnerUUID = island.getOriginalOwnerUUID();
|
||||
|
||||
@ -68,7 +68,7 @@ public class Ownership implements Listener {
|
||||
playerTexture = playerDataManager.getPlayerData(targetPlayer).getTexture();
|
||||
}
|
||||
|
||||
Config languageConfig = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
InventoryUtil inv = new InventoryUtil(configLoad.getString("Menu.Ownership.Title"), InventoryType.HOPPER, 0);
|
||||
@ -95,14 +95,14 @@ public class Ownership implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Ownership.Title")))) {
|
||||
@ -128,7 +128,7 @@ public class Ownership implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
if (playerData.getType() == null) {
|
||||
playerData.setType(Ownership.Visibility.Hidden);
|
||||
@ -240,7 +240,7 @@ public class Ownership implements Listener {
|
||||
open(player);
|
||||
soundManager.playSound(player, Sounds.ANVIL_USE.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}.runTaskLater(plugin, 3L);
|
||||
}.runTaskLater(skyblock, 3L);
|
||||
|
||||
event.setWillClose(true);
|
||||
event.setWillDestroy(true);
|
||||
|
@ -17,7 +17,7 @@ import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
@ -40,9 +40,9 @@ public class Rollback implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config languageConfig = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
Inventory inv = Bukkit.createInventory(null, InventoryType.HOPPER, ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Rollback.Title")));
|
||||
@ -108,20 +108,20 @@ public class Rollback implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Rollback.Title")))) {
|
||||
event.setCancelled(true);
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (!island.isRole(Role.Owner, player.getUniqueId())) {
|
||||
messageManager.sendMessage(player, config.getFileConfiguration().getString("Command.Island.Rollback.Role.Message"));
|
||||
@ -149,13 +149,13 @@ public class Rollback implements Listener {
|
||||
Location islandLocation = island.getLocation(worldList, Location.Environment.Island);
|
||||
|
||||
try {
|
||||
Schematic.getInstance().save(new File(new File(plugin.getDataFolder().toString() + "/rollback-data/" + island.getOwnerUUID().toString()), worldList.name() + ".schematic"), new Location(islandLocation.getWorld(), islandLocation.getBlockX() + 85, islandLocation.getBlockY(), islandLocation.getBlockZ() + 85), new Location(islandLocation.getWorld(), islandLocation.getBlockX() - 85, islandLocation.getBlockY(), islandLocation.getBlockZ() - 85));
|
||||
Schematic.getInstance().save(new File(new File(skyblock.getDataFolder().toString() + "/rollback-data/" + island.getOwnerUUID().toString()), worldList.name() + ".schematic"), new Location(islandLocation.getWorld(), islandLocation.getBlockX() + 85, islandLocation.getBlockY(), islandLocation.getBlockZ() + 85), new Location(islandLocation.getWorld(), islandLocation.getBlockX() - 85, islandLocation.getBlockY(), islandLocation.getBlockZ() - 85));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);*/
|
||||
}.runTaskAsynchronously(skyblock);*/
|
||||
|
||||
soundManager.playSound(player, Sounds.ANVIL_USE.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if ((event.getCurrentItem().getType() == Material.ENCHANTED_BOOK) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Rollback.Item.Load.Displayname"))))) {
|
||||
@ -165,13 +165,13 @@ public class Rollback implements Listener {
|
||||
Location islandLocation = island.getLocation(worldList, Location.Environment.Island);
|
||||
|
||||
try {
|
||||
Schematic.getInstance().paste(new File(new File(plugin.getDataFolder().toString() + "/rollback-data/" + island.getOwnerUUID().toString()), "Normal.schematic"), new Location(islandLocation.getWorld(), islandLocation.getBlockX() - 85, 0, islandLocation.getBlockZ() - 85), true);
|
||||
Schematic.getInstance().paste(new File(new File(skyblock.getDataFolder().toString() + "/rollback-data/" + island.getOwnerUUID().toString()), "Normal.schematic"), new Location(islandLocation.getWorld(), islandLocation.getBlockX() - 85, 0, islandLocation.getBlockZ() - 85), true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);*/
|
||||
}.runTaskAsynchronously(skyblock);*/
|
||||
|
||||
soundManager.playSound(player, Sounds.PISTON_EXTEND.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
@ -46,13 +46,13 @@ public class Settings implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player, Settings.Type menuType, me.goodandevil.skyblock.island.Settings.Role role, Settings.Panel panel) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Island island = plugin.getIslandManager().getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
Island island = skyblock.getIslandManager().getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
InventoryUtil inv = null;
|
||||
|
||||
Config mainConfig = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config languageConfig = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config mainConfig = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
Config languageConfig = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
if (menuType == Settings.Type.Categories) {
|
||||
@ -67,7 +67,7 @@ public class Settings implements Listener {
|
||||
inv = new InventoryUtil(configLoad.getString("Menu.Settings." + role.name() + ".Title"), null, 6);
|
||||
|
||||
if (role == me.goodandevil.skyblock.island.Settings.Role.Visitor) {
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
Visit visit = island.getVisit();
|
||||
|
||||
if (config.getFileConfiguration().getBoolean("Island.Visitor.Signature.Enable")) {
|
||||
@ -222,9 +222,9 @@ public class Settings implements Listener {
|
||||
}
|
||||
|
||||
private ItemStack createItem(Island island, me.goodandevil.skyblock.island.Settings.Role role, String setting, Material material) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
List<String> itemLore = new ArrayList<>();
|
||||
@ -263,18 +263,18 @@ public class Settings implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Categories.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Member.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Operator.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Owner.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Welcome.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Signature.Title")))) {
|
||||
event.setCancelled(true);
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Island island;
|
||||
|
||||
@ -343,14 +343,14 @@ public class Settings implements Listener {
|
||||
}
|
||||
} else if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Member.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Operator.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Owner.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Welcome.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Signature.Title")))) {
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Signature.Title")))) {
|
||||
if (!plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Signature.Enable")) {
|
||||
if (!skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Signature.Enable")) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Settings.Visitor.Signature.Disabled.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
}
|
||||
} else if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Welcome.Title")))) {
|
||||
if (!plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Welcome.Enable")) {
|
||||
if (!skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Welcome.Enable")) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Settings.Visitor.Welcome.Disabled.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
@ -385,7 +385,7 @@ public class Settings implements Listener {
|
||||
} else if ((is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Welcome.Item.Message.Displayname"))) || is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Signature.Item.Message.Displayname"))))) {
|
||||
soundManager.playSound(player, Sounds.CHICKEN_EGG_POP.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if ((event.getCurrentItem().getType() == Material.ARROW) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Welcome.Item.Line.Add.Displayname")))) && (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Welcome.Title"))))) {
|
||||
if (island.getMessage(Message.Welcome).size() >= plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Visitor.Welcome.Lines")) {
|
||||
if (island.getMessage(Message.Welcome).size() >= skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Visitor.Welcome.Lines")) {
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
soundManager.playSound(player, Sounds.WOOD_CLICK.bukkitSound(), 1.0F, 1.0F);
|
||||
@ -406,7 +406,7 @@ public class Settings implements Listener {
|
||||
event1.setWillDestroy(true);
|
||||
|
||||
return;
|
||||
} else if (!plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Welcome.Enable")) {
|
||||
} else if (!skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Welcome.Enable")) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Settings.Visitor.Welcome.Disabled.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
@ -426,7 +426,7 @@ public class Settings implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
Config config1 = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config1 = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad1 = config1.getFileConfiguration();
|
||||
|
||||
if (island1.getMessage(Message.Welcome).size() > configLoad1.getInt("Island.Visitor.Welcome.Lines") || event1.getName().length() > configLoad1.getInt("Island.Visitor.Welcome.Length")) {
|
||||
@ -443,7 +443,7 @@ public class Settings implements Listener {
|
||||
public void run() {
|
||||
open(player, Settings.Type.Panel, null, Settings.Panel.Welcome);
|
||||
}
|
||||
}.runTaskLater(plugin, 3L);
|
||||
}.runTaskLater(skyblock, 3L);
|
||||
|
||||
event1.setWillClose(true);
|
||||
event1.setWillDestroy(true);
|
||||
@ -473,7 +473,7 @@ public class Settings implements Listener {
|
||||
open(player, Settings.Type.Panel, null, Settings.Panel.Welcome);
|
||||
}
|
||||
} else if ((event.getCurrentItem().getType() == Material.ARROW) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Signature.Item.Line.Add.Displayname")))) && (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Panel.Signature.Title"))))) {
|
||||
if (island.getMessage(Message.Signature).size() >= plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Visitor.Signature.Lines")) {
|
||||
if (island.getMessage(Message.Signature).size() >= skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Visitor.Signature.Lines")) {
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
soundManager.playSound(player, Sounds.WOOD_CLICK.bukkitSound(), 1.0F, 1.0F);
|
||||
@ -491,7 +491,7 @@ public class Settings implements Listener {
|
||||
player.closeInventory();
|
||||
|
||||
return;
|
||||
} else if (!plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Signature.Enable")) {
|
||||
} else if (!skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Signature.Enable")) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Settings.Visitor.Signature.Disabled.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
@ -505,7 +505,7 @@ public class Settings implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
Config config1 = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config1 = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad1 = config1.getFileConfiguration();
|
||||
|
||||
if (island1.getMessage(Message.Signature).size() > configLoad1.getInt("Island.Visitor.Signature.Lines") || event1.getName().length() > configLoad1.getInt("Island.Visitor.Signature.Length")) {
|
||||
@ -522,7 +522,7 @@ public class Settings implements Listener {
|
||||
public void run() {
|
||||
open(player, Settings.Type.Panel, null, Settings.Panel.Signature);
|
||||
}
|
||||
}.runTaskLater(plugin, 3L);
|
||||
}.runTaskLater(skyblock, 3L);
|
||||
|
||||
event1.setWillClose(true);
|
||||
event1.setWillDestroy(true);
|
||||
@ -625,21 +625,21 @@ public class Settings implements Listener {
|
||||
public void onInventoryClose(InventoryCloseEvent event) {
|
||||
Player player = (Player) event.getPlayer();
|
||||
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Visitor.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Settings.Member.Title")))) {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).save();
|
||||
islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).save();
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}.runTaskAsynchronously(skyblock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -54,12 +54,12 @@ public class Visit implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player, Visit.Type type, Visit.Sort sort) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
VisitManager visitManager = plugin.getVisitManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
VisitManager visitManager = skyblock.getVisitManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Map<UUID, me.goodandevil.skyblock.visit.Visit> displayedIslands = new HashMap<>();
|
||||
Map<UUID, me.goodandevil.skyblock.visit.Visit> visitIslands = visitManager.getOpenIslands();
|
||||
@ -121,7 +121,7 @@ public class Visit implements Listener {
|
||||
|
||||
int playerMenuPage = playerDataManager.getPlayerData(player).getPage(), nextEndIndex = displayedIslands.size() - playerMenuPage * 36, totalIslands = visitManager.getIslands().size();
|
||||
|
||||
Config languageConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
InventoryUtil inv = new InventoryUtil(configLoad.getString("Menu.Visit.Title"), null, 6);
|
||||
@ -142,7 +142,7 @@ public class Visit implements Listener {
|
||||
if (displayedIslands.size() == 0) {
|
||||
inv.addItem(inv.createItem(new ItemStack(Material.BARRIER), configLoad.getString("Menu.Visit.Item.Nothing.Displayname"), null, null, null, null), 31);
|
||||
} else {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
|
||||
int index = playerMenuPage * 36 - 36, endIndex = index >= displayedIslands.size() ? displayedIslands.size() - 1 : index + 36, inventorySlot = 17, playerCapacity = config.getFileConfiguration().getInt("Island.Visitor.Capacity");
|
||||
|
||||
@ -258,14 +258,14 @@ public class Visit implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config languageConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Visit.Title")))) {
|
||||
@ -309,8 +309,8 @@ public class Visit implements Listener {
|
||||
} else if ((event.getCurrentItem().getType() == Material.BARRIER) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Visit.Item.Nothing.Displayname"))))) {
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if ((event.getCurrentItem().getType() == SkullUtil.createItemStack().getType()) && (is.hasItemMeta())) {
|
||||
VisitManager visitManager = plugin.getVisitManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
VisitManager visitManager = skyblock.getVisitManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
String targetPlayerName = ChatColor.stripColor(is.getItemMeta().getDisplayName());
|
||||
UUID targetPlayerUUID;
|
||||
@ -333,7 +333,7 @@ public class Visit implements Listener {
|
||||
|
||||
Island island = islandManager.getIsland(targetPlayerUUID);
|
||||
|
||||
if ((!island.isRole(Role.Member, player.getUniqueId()) && !island.isRole(Role.Operator, player.getUniqueId()) && !island.isRole(Role.Owner, player.getUniqueId())) && fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
|
||||
if ((!island.isRole(Role.Member, player.getUniqueId()) && !island.isRole(Role.Operator, player.getUniqueId()) && !island.isRole(Role.Owner, player.getUniqueId())) && fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
|
||||
if (event.getClick() == ClickType.RIGHT) {
|
||||
if (playerData.getIsland() != null && playerData.getIsland().equals(island.getOwnerUUID())) {
|
||||
List<UUID> islandVotes = visit.getVoters();
|
||||
|
@ -19,7 +19,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -48,16 +48,16 @@ public class Visitors implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = playerDataManager.getPlayerData(player);
|
||||
|
||||
Island island = plugin.getIslandManager().getIsland(playerData.getOwner());
|
||||
Island island = skyblock.getIslandManager().getIsland(playerData.getOwner());
|
||||
|
||||
Config languageConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
Map<Integer, UUID> sortedIslandVisitors = new TreeMap<>();
|
||||
@ -91,7 +91,7 @@ public class Visitors implements Listener {
|
||||
if (islandVisitors.size() == 0) {
|
||||
inv.addItem(inv.createItem(new ItemStack(Material.BARRIER), configLoad.getString("Menu.Visitors.Item.Nothing.Displayname"), null, null, null, null), 31);
|
||||
} else {
|
||||
boolean isOperator = island.isRole(Role.Operator, player.getUniqueId()), isOwner = island.isRole(Role.Owner, player.getUniqueId()), canKick = island.getSetting(Settings.Role.Operator, "Kick").getStatus(), canBan = island.getSetting(Settings.Role.Operator, "Ban").getStatus(), banningEnabled = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning");
|
||||
boolean isOperator = island.isRole(Role.Operator, player.getUniqueId()), isOwner = island.isRole(Role.Owner, player.getUniqueId()), canKick = island.getSetting(Settings.Role.Operator, "Kick").getStatus(), canBan = island.getSetting(Settings.Role.Operator, "Ban").getStatus(), banningEnabled = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning");
|
||||
int index = playerMenuPage * 36 - 36, endIndex = index >= islandVisitors.size() ? islandVisitors.size() - 1 : index + 36, inventorySlot = 17;
|
||||
|
||||
for (; index < endIndex; index++) {
|
||||
@ -146,27 +146,27 @@ public class Visitors implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Visitors.Title")))) {
|
||||
event.setCancelled(true);
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
|
||||
Island island = null;
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
island = islandManager.getIsland(playerData.getOwner());
|
||||
} else {
|
||||
plugin.getMessageManager().sendMessage(player, configLoad.getString("Command.Island.Visitors.Owner.Message"));
|
||||
skyblock.getMessageManager().sendMessage(player, configLoad.getString("Command.Island.Visitors.Owner.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
player.closeInventory();
|
||||
|
||||
@ -194,7 +194,7 @@ public class Visitors implements Listener {
|
||||
} else {
|
||||
String playerName = ChatColor.stripColor(is.getItemMeta().getDisplayName());
|
||||
|
||||
boolean isOperator = island.isRole(Role.Operator, player.getUniqueId()), isOwner = island.isRole(Role.Owner, player.getUniqueId()), canKick = island.getSetting(Settings.Role.Operator, "Kick").getStatus(), canBan = island.getSetting(Settings.Role.Operator, "Ban").getStatus(), banningEnabled = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning");
|
||||
boolean isOperator = island.isRole(Role.Operator, player.getUniqueId()), isOwner = island.isRole(Role.Owner, player.getUniqueId()), canKick = island.getSetting(Settings.Role.Operator, "Kick").getStatus(), canBan = island.getSetting(Settings.Role.Operator, "Ban").getStatus(), banningEnabled = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Banning");
|
||||
|
||||
if ((isOperator && canKick) || isOwner) {
|
||||
if (banningEnabled && ((isOperator && canBan) || isOwner)) {
|
||||
@ -225,7 +225,7 @@ public class Visitors implements Listener {
|
||||
public void run() {
|
||||
open(player);
|
||||
}
|
||||
}.runTaskLater(plugin, 3L);
|
||||
}.runTaskLater(skyblock, 3L);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -40,11 +40,11 @@ public class Weather implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Island island = plugin.getIslandManager().getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
Island island = skyblock.getIslandManager().getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
Config languageConfig = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config languageConfig = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
int islandTime = island.getTime();
|
||||
@ -104,14 +104,14 @@ public class Weather implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Weather.Title")))) {
|
||||
@ -120,7 +120,7 @@ public class Weather implements Listener {
|
||||
Island island = null;
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (!((island.isRole(Role.Operator, player.getUniqueId()) && island.getSetting(Settings.Role.Operator, "Biome").getStatus()) || island.isRole(Role.Owner, player.getUniqueId()))) {
|
||||
messageManager.sendMessage(player, config.getFileConfiguration().getString("Command.Island.Weather.Permission.Message"));
|
||||
@ -160,7 +160,7 @@ public class Weather implements Listener {
|
||||
|
||||
if (!island.isWeatherSynchronised()) {
|
||||
for (Player all : islandManager.getPlayersAtIsland(island, Location.World.Normal)) {
|
||||
all.setPlayerTime(island.getTime(), fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Weather.Time.Cycle"));
|
||||
all.setPlayerTime(island.getTime(), fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Weather.Time.Cycle"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ public class Weather implements Listener {
|
||||
WeatherType islandWeather = island.getWeather();
|
||||
|
||||
for (Player all : islandManager.getPlayersAtIsland(island, Location.World.Normal)) {
|
||||
all.setPlayerTime(islandTime, fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Weather.Time.Cycle"));
|
||||
all.setPlayerTime(islandTime, fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Weather.Time.Cycle"));
|
||||
all.setPlayerWeather(islandWeather);
|
||||
}
|
||||
} else {
|
||||
|
@ -18,7 +18,7 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.message.MessageManager;
|
||||
@ -47,14 +47,14 @@ public class Creator implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
StructureManager structureManager = plugin.getStructureManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
StructureManager structureManager = skyblock.getStructureManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
InventoryUtil inv;
|
||||
@ -159,20 +159,20 @@ public class Creator implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
StructureManager structureManager = plugin.getStructureManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
StructureManager structureManager = skyblock.getStructureManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Creator.Title")))) {
|
||||
event.setCancelled(true);
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
if (!(player.hasPermission("skyblock.admin.create") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*"))) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Creator.Permission.Message"));
|
||||
@ -218,17 +218,17 @@ public class Creator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Creator.Created.Message").replace("%structure", event1.getName()));
|
||||
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
}
|
||||
}, 3L);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "structures.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "structures.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Structures." + event1.getName() + ".Name", event1.getName());
|
||||
@ -281,7 +281,7 @@ public class Creator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Creator.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if (playerData.getViewer() == null) {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -291,7 +291,7 @@ public class Creator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Creator.Selected.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if (!structureManager.containsStructure(name)) {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -304,7 +304,7 @@ public class Creator implements Listener {
|
||||
Structure structure = structureManager.getStructure(name);
|
||||
structure.setDisplayname(event1.getName());
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -313,10 +313,10 @@ public class Creator implements Listener {
|
||||
|
||||
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "structures.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "structures.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Structures." + structure.getName() + ".Displayname", event1.getName());
|
||||
@ -374,10 +374,10 @@ public class Creator implements Listener {
|
||||
open(player);
|
||||
soundManager.playSound(player, Sounds.EXPLODE.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "structures.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "structures.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Structures." + structure.getName() + ".Description", structure.getDescription());
|
||||
@ -404,7 +404,7 @@ public class Creator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Creator.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if (playerData.getViewer() == null) {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -414,7 +414,7 @@ public class Creator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Creator.Selected.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if (!structureManager.containsStructure(name)) {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -426,7 +426,7 @@ public class Creator implements Listener {
|
||||
} else {
|
||||
structure.addLine(event1.getName());
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -435,10 +435,10 @@ public class Creator implements Listener {
|
||||
|
||||
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "structures.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "structures.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Structures." + structure.getName() + ".Description", structure.getDescription());
|
||||
@ -498,10 +498,10 @@ public class Creator implements Listener {
|
||||
open(player);
|
||||
soundManager.playSound(player, Sounds.WOOD_CLICK.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "structures.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "structures.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Structures." + structure.getName() + ".Permission", structure.isPermission());
|
||||
@ -541,7 +541,7 @@ public class Creator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Creator.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if (playerData.getViewer() == null) {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -551,7 +551,7 @@ public class Creator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Creator.Selected.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else if (!structureManager.containsStructure(name)) {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -561,11 +561,11 @@ public class Creator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Creator.Exist.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
} else {
|
||||
if (fileManager.isFileExist(new File(plugin.getDataFolder().toString() + "/structures", event1.getName()))) {
|
||||
if (fileManager.isFileExist(new File(skyblock.getDataFolder().toString() + "/structures", event1.getName()))) {
|
||||
Structure structure = structureManager.getStructure(name);
|
||||
structure.setFile(event1.getName());
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -574,10 +574,10 @@ public class Creator implements Listener {
|
||||
|
||||
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "structures.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "structures.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Structures." + structure.getName() + ".File", event1.getName());
|
||||
@ -594,7 +594,7 @@ public class Creator implements Listener {
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -676,10 +676,10 @@ public class Creator implements Listener {
|
||||
if (materials != null) {
|
||||
structure.setMaterials(materials);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "structures.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "structures.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Structures." + structure.getName() + ".Item.Material", structure.getMaterials().name());
|
||||
@ -724,10 +724,10 @@ public class Creator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Creator.Removed.Message").replace("%structure", structureList.getName()));
|
||||
soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "structures.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "structures.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Structures." + structureList.getName(), null);
|
||||
@ -758,13 +758,13 @@ public class Creator implements Listener {
|
||||
public void onInventoryClose(InventoryCloseEvent event) {
|
||||
Player player = (Player) event.getPlayer();
|
||||
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Creator.Title")))) {
|
||||
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
|
||||
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
|
||||
|
||||
if (playerDataManager.hasPlayerData(player)) {
|
||||
Creator.Viewer viewer = (Viewer) playerDataManager.getPlayerData(player).getViewer();
|
||||
@ -772,8 +772,8 @@ public class Creator implements Listener {
|
||||
if (viewer != null) {
|
||||
if (viewer.isItem()) {
|
||||
viewer.setItem(false);
|
||||
plugin.getMessageManager().sendMessage(player, configLoad.getString("Island.Admin.Creator.Item.Removed.Message"));
|
||||
plugin.getSoundManager().playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
skyblock.getMessageManager().sendMessage(player, configLoad.getString("Island.Admin.Creator.Item.Removed.Message"));
|
||||
skyblock.getSoundManager().playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.generator.GeneratorManager;
|
||||
@ -45,14 +45,14 @@ public class Generator implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
GeneratorManager generatorManager = plugin.getGeneratorManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
GeneratorManager generatorManager = skyblock.getGeneratorManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
InventoryUtil inv = new InventoryUtil(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Generator.Title")), null, 6);
|
||||
@ -131,20 +131,20 @@ public class Generator implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
GeneratorManager generatorManager = plugin.getGeneratorManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
GeneratorManager generatorManager = skyblock.getGeneratorManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Generator.Title")))) {
|
||||
event.setCancelled(true);
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
if (!(player.hasPermission("skyblock.admin.generator") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*"))) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Generator.Permission.Message"));
|
||||
@ -199,17 +199,17 @@ public class Generator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Generator.Created.Message").replace("%generator", event1.getName()));
|
||||
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
}
|
||||
}, 3L);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "generators.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "generators.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Generators." + event1.getName() + ".Name", event1.getName());
|
||||
@ -261,10 +261,10 @@ public class Generator implements Listener {
|
||||
open(player);
|
||||
soundManager.playSound(player, Sounds.WOOD_CLICK.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "generators.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "generators.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Generators." + generator.getName() + ".Permission", generator.isPermission());
|
||||
@ -354,17 +354,17 @@ public class Generator implements Listener {
|
||||
generatorMaterialList.setChance(Integer.valueOf(event1.getName()));
|
||||
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
}
|
||||
}, 3L);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "generators.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "generators.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Generators." + generator.getName() + ".Materials." + generatorMaterialList.getMaterials().name() + ".Chance", materialChance);
|
||||
@ -397,10 +397,10 @@ public class Generator implements Listener {
|
||||
} else if (event.getClick() == ClickType.RIGHT) {
|
||||
generator.getGeneratorMaterials().remove(generatorMaterialList);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "generators.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "generators.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Generators." + generator.getName() + ".Materials." + generatorMaterialList.getMaterials().name(), null);
|
||||
@ -450,10 +450,10 @@ public class Generator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Generator.Material.Added.Message").replace("%material", materials.name()).replace("%generator", generator.getName()));
|
||||
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "generators.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "generators.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Generators." + generator.getName() + ".Materials." + materials.name() + ".Chance", 0);
|
||||
@ -493,10 +493,10 @@ public class Generator implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Generator.Removed.Message").replace("%generator", generatorList.getName()));
|
||||
soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "generators.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "generators.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Generators." + generatorList.getName(), null);
|
||||
|
@ -16,7 +16,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.levelling.LevellingManager;
|
||||
@ -46,21 +46,21 @@ public class Levelling implements Listener {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void open(Player player) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
LevellingManager levellingManager = plugin.getLevellingManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
LevellingManager levellingManager = skyblock.getLevellingManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
List<me.goodandevil.skyblock.levelling.Material> levellingMaterials = levellingManager.getMaterials();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
InventoryUtil inv = new InventoryUtil(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Levelling.Title")), null, 6);
|
||||
inv.addItem(inv.createItem(Materials.OAK_FENCE_GATE.parseItem(), configLoad.getString("Menu.Admin.Levelling.Item.Exit.Displayname"), null, null, null, null), 0, 8);
|
||||
inv.addItem(inv.createItem(new ItemStack(org.bukkit.Material.SIGN), configLoad.getString("Menu.Admin.Levelling.Item.Information.Displayname"), configLoad.getStringList("Menu.Admin.Levelling.Item.Information.Lore"), inv.createItemLoreVariable(new String[] { "%materials#" + levellingMaterials.size(), "%division#" + fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Levelling.Division") }), null, null), 4);
|
||||
inv.addItem(inv.createItem(new ItemStack(org.bukkit.Material.SIGN), configLoad.getString("Menu.Admin.Levelling.Item.Information.Displayname"), configLoad.getStringList("Menu.Admin.Levelling.Item.Information.Lore"), inv.createItemLoreVariable(new String[] { "%materials#" + levellingMaterials.size(), "%division#" + fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getInt("Island.Levelling.Division") }), null, null), 4);
|
||||
inv.addItem(inv.createItem(Materials.BLACK_STAINED_GLASS_PANE.parseItem(), configLoad.getString("Menu.Admin.Levelling.Item.Barrier.Displayname"), null, null, null, null), 9, 10, 11, 12, 13, 14, 15, 16, 17);
|
||||
|
||||
int playerMenuPage = playerData.getPage(), nextEndIndex = levellingMaterials.size() - playerMenuPage * 36;
|
||||
@ -98,18 +98,18 @@ public class Levelling implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
LevellingManager levellingManager = plugin.getLevellingManager();
|
||||
MessageManager messageManager = plugin.getMessageManager();
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
LevellingManager levellingManager = skyblock.getLevellingManager();
|
||||
MessageManager messageManager = skyblock.getMessageManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Levelling.Title")))) {
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
if (!(player.hasPermission("skyblock.admin.level") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*"))) {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Levelling.Permission.Message"));
|
||||
@ -144,10 +144,10 @@ public class Levelling implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Levelling.Division.Message").replace("%division", NumberUtil.formatNumber(pointDivision)));
|
||||
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Island.Levelling.Division", pointDivision);
|
||||
@ -160,7 +160,7 @@ public class Levelling implements Listener {
|
||||
}
|
||||
});
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
@ -234,17 +234,17 @@ public class Levelling implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Levelling.Points.Message").replace("%material", materials.name()).replace("%points", NumberUtil.formatNumber(materialPoints)));
|
||||
soundManager.playSound(player, Sounds.LEVEL_UP.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskLater(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
open(player);
|
||||
}
|
||||
}, 3L);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "levelling.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "levelling.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Materials." + materials.name() + ".Points", materialPoints);
|
||||
@ -287,10 +287,10 @@ public class Levelling implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Levelling.Removed.Message").replace("%material", materials.name()));
|
||||
soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "levelling.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "levelling.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Materials." + materials.name(), null);
|
||||
@ -332,10 +332,10 @@ public class Levelling implements Listener {
|
||||
messageManager.sendMessage(player, configLoad.getString("Island.Admin.Levelling.Added.Message").replace("%material", materials.name()));
|
||||
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "levelling.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "levelling.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
configLoad.set("Materials." + materials.name() + ".Points", 0);
|
||||
|
@ -17,7 +17,7 @@ import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
@ -39,13 +39,13 @@ public class Settings implements Listener {
|
||||
}
|
||||
|
||||
public void open(Player player, Settings.Type menuType, me.goodandevil.skyblock.island.Settings.Role role) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
Island island = plugin.getIslandManager().getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
Island island = skyblock.getIslandManager().getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
InventoryUtil inv = null;
|
||||
|
||||
Config mainConfig = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"));
|
||||
Config languageConfig = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config mainConfig = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||
Config languageConfig = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = languageConfig.getFileConfiguration();
|
||||
|
||||
if (menuType == Settings.Type.Categories) {
|
||||
@ -143,11 +143,11 @@ public class Settings implements Listener {
|
||||
}
|
||||
|
||||
private ItemStack createItem(Island island, me.goodandevil.skyblock.island.Settings.Role role, String setting, Material material) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
List<String> itemLore = new ArrayList<>();
|
||||
@ -163,7 +163,7 @@ public class Settings implements Listener {
|
||||
|
||||
im.setDisplayName(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Settings." + roleName + ".Item.Setting." + setting + ".Displayname")));
|
||||
|
||||
if (fileManager.getConfig(new File(plugin.getDataFolder(), "settings.yml")).getFileConfiguration().getBoolean(role.name() + "." + setting)) {
|
||||
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "settings.yml")).getFileConfiguration().getBoolean(role.name() + "." + setting)) {
|
||||
for (String itemLoreList : configLoad.getStringList("Menu.Admin.Settings." + roleName + ".Item.Setting.Status.Enabled.Lore")) {
|
||||
itemLore.add(ChatColor.translateAlternateColorCodes('&', itemLoreList));
|
||||
}
|
||||
@ -186,19 +186,19 @@ public class Settings implements Listener {
|
||||
ItemStack is = event.getCurrentItem();
|
||||
|
||||
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
|
||||
Main plugin = Main.getInstance();
|
||||
SkyBlock skyblock = SkyBlock.getInstance();
|
||||
|
||||
SoundManager soundManager = plugin.getSoundManager();
|
||||
FileManager fileManager = plugin.getFileManager();
|
||||
SoundManager soundManager = skyblock.getSoundManager();
|
||||
FileManager fileManager = skyblock.getFileManager();
|
||||
|
||||
Config config = fileManager.getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Settings.Categories.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Settings.Visitor.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Settings.Member.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Settings.Operator.Title"))) || event.getInventory().getName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Settings.Owner.Title")))) {
|
||||
event.setCancelled(true);
|
||||
|
||||
if (!(player.hasPermission("skyblock.admin.settings") || player.hasPermission("skyblock.admin.*") || player.hasPermission("skyblock.*"))) {
|
||||
plugin.getMessageManager().sendMessage(player, configLoad.getString("Island.Admin.Settings.Permission.Message"));
|
||||
skyblock.getMessageManager().sendMessage(player, configLoad.getString("Island.Admin.Settings.Permission.Message"));
|
||||
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
|
||||
|
||||
return;
|
||||
@ -247,7 +247,7 @@ public class Settings implements Listener {
|
||||
rolePermissionName = role.name();
|
||||
}
|
||||
|
||||
FileConfiguration settingsConfigLoad = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "settings.yml")).getFileConfiguration();
|
||||
FileConfiguration settingsConfigLoad = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "settings.yml")).getFileConfiguration();
|
||||
|
||||
for (String settingList : settingsConfigLoad.getConfigurationSection(roleName).getKeys(false)) {
|
||||
if (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.Admin.Settings." + rolePermissionName + ".Item.Setting." + settingList + ".Displayname")))) {
|
||||
@ -257,11 +257,11 @@ public class Settings implements Listener {
|
||||
settingsConfigLoad.set(roleName + "." + settingList, true);
|
||||
}
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "settings.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "settings.yml"));
|
||||
config.getFileConfiguration().save(config.getFile());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -3,19 +3,19 @@ package me.goodandevil.skyblock.message;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.placeholder.PlaceholderManager;
|
||||
|
||||
public class MessageManager {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public MessageManager(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public MessageManager(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
public void sendMessage(Player player, String message) {
|
||||
PlaceholderManager placeholderManager = plugin.getPlaceholderManager();
|
||||
PlaceholderManager placeholderManager = skyblock.getPlaceholderManager();
|
||||
|
||||
if (placeholderManager.isPlaceholderAPIEnabled()) {
|
||||
message = me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(player, message.replace("&", "clr")).replace("clr", "&");
|
||||
@ -25,7 +25,7 @@ public class MessageManager {
|
||||
}
|
||||
|
||||
public String replaceMessage(Player player, String message) {
|
||||
PlaceholderManager placeholderManager = plugin.getPlaceholderManager();
|
||||
PlaceholderManager placeholderManager = skyblock.getPlaceholderManager();
|
||||
|
||||
if (placeholderManager.isPlaceholderAPIEnabled()) {
|
||||
message = me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(player, message.replace("&", "clr")).replace("clr", "&");
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
@ -18,10 +18,10 @@ import me.goodandevil.skyblock.island.Role;
|
||||
|
||||
public class EZPlaceholder extends PlaceholderExpansion {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public EZPlaceholder(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public EZPlaceholder(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
public String getIdentifier() {
|
||||
@ -33,29 +33,29 @@ public class EZPlaceholder extends PlaceholderExpansion {
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return plugin.getDescription().getAuthors().get(0);
|
||||
return skyblock.getDescription().getAuthors().get(0);
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return plugin.getDescription().getVersion();
|
||||
return skyblock.getDescription().getVersion();
|
||||
}
|
||||
|
||||
public String onPlaceholderRequest(Player player, String identifier) {
|
||||
if (identifier.equalsIgnoreCase("islands")) {
|
||||
return "" + plugin.getVisitManager().getIslands().size();
|
||||
return "" + skyblock.getVisitManager().getIslands().size();
|
||||
}
|
||||
|
||||
if(player == null){
|
||||
return "";
|
||||
}
|
||||
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
if (identifier.equalsIgnoreCase("island_level")) {
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_level.Non-empty.Message").replace("%placeholder", "" + island.getLevel().getLevel()));
|
||||
|
@ -12,7 +12,7 @@ import be.maximvdw.placeholderapi.PlaceholderAPI;
|
||||
import be.maximvdw.placeholderapi.PlaceholderReplaceEvent;
|
||||
import be.maximvdw.placeholderapi.PlaceholderReplacer;
|
||||
|
||||
import me.goodandevil.skyblock.Main;
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
@ -20,26 +20,26 @@ import me.goodandevil.skyblock.island.Role;
|
||||
|
||||
public class MVdWPlaceholder {
|
||||
|
||||
private final Main plugin;
|
||||
private final SkyBlock skyblock;
|
||||
|
||||
public MVdWPlaceholder(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
public MVdWPlaceholder(SkyBlock skyblock) {
|
||||
this.skyblock = skyblock;
|
||||
}
|
||||
|
||||
public void register() {
|
||||
IslandManager islandManager = plugin.getIslandManager();
|
||||
IslandManager islandManager = skyblock.getIslandManager();
|
||||
|
||||
Config config = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "language.yml"));
|
||||
Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||
FileConfiguration configLoad = config.getFileConfiguration();
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_islands", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_islands", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
return "" + plugin.getVisitManager().getIslands().size();
|
||||
return "" + skyblock.getVisitManager().getIslands().size();
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_level", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_level", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -49,14 +49,14 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
return "" + islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).getLevel().getLevel();
|
||||
return "" + islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).getLevel().getLevel();
|
||||
}
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_level.Empty.Message"));
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_points", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_points", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -66,14 +66,14 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_points.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).getLevel().getPoints()));
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_points.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).getLevel().getPoints()));
|
||||
}
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_points.Empty.Message"));
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_role", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_role", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -83,7 +83,7 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
|
||||
for (Role roleList : Role.values()) {
|
||||
if (island.isRole(roleList, player.getUniqueId())) {
|
||||
@ -96,7 +96,7 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_owner", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_owner", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -106,7 +106,7 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
UUID islandOwnerUUID = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).getOwnerUUID();
|
||||
UUID islandOwnerUUID = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).getOwnerUUID();
|
||||
Player targetPlayer = Bukkit.getServer().getPlayer(islandOwnerUUID);
|
||||
|
||||
if (targetPlayer == null) {
|
||||
@ -124,7 +124,7 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_biome", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_biome", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -134,14 +134,14 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_biome.Non-empty.Message").replace("%placeholder", islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).getBiomeName()));
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_biome.Non-empty.Message").replace("%placeholder", islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).getBiomeName()));
|
||||
}
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_biome.Empty.Message"));
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_time", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_time", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -151,14 +151,14 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_time.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).getTime()));
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_time.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).getTime()));
|
||||
}
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_time.Empty.Message"));
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_weather", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_weather", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -168,14 +168,14 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_weather.Non-empty.Message").replace("%placeholder", islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).getWeatherName()));
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_weather.Non-empty.Message").replace("%placeholder", islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).getWeatherName()));
|
||||
}
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_weather.Empty.Message"));
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_bans", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_bans", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -185,14 +185,14 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_bans.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).getBan().getBans().size()));
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_bans.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).getBan().getBans().size()));
|
||||
}
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_bans.Empty.Message"));
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_members_total", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_members_total", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -202,7 +202,7 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
Island island = islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
Island island = islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner());
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_members_total.Non-empty.Message").replace("%placeholder", "" + (island.getRole(Role.Member).size() + island.getRole(Role.Operator).size() + 1)));
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_members", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_members", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -220,14 +220,14 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_members.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).getRole(Role.Member).size()));
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_members.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).getRole(Role.Member).size()));
|
||||
}
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_members.Empty.Message"));
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_operators", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_operators", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -237,14 +237,14 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_operators.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).getRole(Role.Operator).size()));
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_operators.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).getRole(Role.Operator).size()));
|
||||
}
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_operators.Empty.Message"));
|
||||
}
|
||||
});
|
||||
|
||||
PlaceholderAPI.registerPlaceholder(plugin, "skyblock_island_visitors", new PlaceholderReplacer() {
|
||||
PlaceholderAPI.registerPlaceholder(skyblock, "skyblock_island_visitors", new PlaceholderReplacer() {
|
||||
@Override
|
||||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -254,7 +254,7 @@ public class MVdWPlaceholder {
|
||||
}
|
||||
|
||||
if (islandManager.hasIsland(player)) {
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_visitors.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(plugin.getPlayerDataManager().getPlayerData(player).getOwner()).getVisitors().size()));
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_visitors.Non-empty.Message").replace("%placeholder", "" + islandManager.getIsland(skyblock.getPlayerDataManager().getPlayerData(player).getOwner()).getVisitors().size()));
|
||||
}
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', configLoad.getString("Placeholder.skyblock_island_visitors.Empty.Message"));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user