This commit is contained in:
Brianna 2019-06-08 16:54:58 -04:00
parent 6ac0814358
commit c0880b0a8c
18 changed files with 107 additions and 137 deletions

View File

@ -74,5 +74,10 @@
<version>1.7.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.songoda</groupId>
<artifactId>epicspawners</artifactId>
<version>6-pre4</version>
</dependency>
</dependencies>
</project>

View File

@ -3,7 +3,7 @@ package com.songoda.epicanchors;
import com.songoda.epicanchors.anchor.Anchor;
import com.songoda.epicanchors.anchor.AnchorManager;
import com.songoda.epicanchors.command.CommandManager;
import com.songoda.epicanchors.handlers.AnchorHandler;
import com.songoda.epicanchors.tasks.AnchorTask;
import com.songoda.epicanchors.listeners.BlockListeners;
import com.songoda.epicanchors.listeners.InteractListeners;
import com.songoda.epicanchors.utils.*;
@ -75,7 +75,8 @@ public class EpicAnchors extends JavaPlugin {
loadAnchorsFromFile();
new AnchorHandler(this);
// Start tasks
new AnchorTask(this);
// Command registration
this.getCommand("EpicAnchors").setExecutor(new CommandManager(this));
@ -148,7 +149,7 @@ public class EpicAnchors extends JavaPlugin {
return 0;
}
public ItemStack makeAnchorItem(int ticks) {
public ItemStack makAnchorItem(int ticks) {
ItemStack item = new ItemStack(Material.valueOf(EpicAnchors.getInstance().getConfig().getString("Main.Anchor Block Material")), 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Methods.formatText(Methods.formatName(ticks, true)));
@ -162,26 +163,6 @@ public class EpicAnchors extends JavaPlugin {
return item;
}
public void bust(Location location) {
if (!getAnchorManager().isAnchor(location)) return;
Anchor anchor = getAnchorManager().getAnchor(location);
if (getConfig().getBoolean("Main.Allow Anchor Breaking")) {
ItemStack item = makeAnchorItem(anchor.getTicksLeft());
anchor.getLocation().getWorld().dropItemNaturally(anchor.getLocation(), item);
}
location.getBlock().setType(Material.AIR);
if (isServerVersionAtLeast(ServerVersion.V1_9))
location.getWorld().spawnParticle(Particle.LAVA, location.clone().add(.5, .5, .5), 5, 0, 0, 0, 5);
location.getWorld().playSound(location, this.isServerVersionAtLeast(ServerVersion.V1_9)
? Sound.ENTITY_GENERIC_EXPLODE : Sound.valueOf("EXPLODE"), 10, 10);
getAnchorManager().removeAnchor(location);
}
public ServerVersion getServerVersion() {
return serverVersion;
}

View File

@ -1,23 +1,20 @@
package com.songoda.epicanchors.anchor;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.api.anchor.Anchor;
import com.songoda.epicanchors.gui.GUIOverview;
import com.songoda.epicanchors.utils.ServerVersion;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.*;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.RegisteredServiceProvider;
public class EAnchor implements Anchor {
public class Anchor {
private Location location;
private int ticksLeft;
public EAnchor(Location location, int ticksLeft) {
public Anchor(Location location, int ticksLeft) {
this.location = location;
this.ticksLeft = ticksLeft;
}
@ -64,17 +61,32 @@ public class EAnchor implements Anchor {
player.getWorld().spawnParticle(Particle.SPELL_WITCH, getLocation().add(.5, .5, .5), 100, .5, .5, .5);
}
@Override
public void bust() {
EpicAnchors plugin = EpicAnchors.getInstance();
if (plugin.getConfig().getBoolean("Main.Allow Anchor Breaking")) {
ItemStack item = plugin.makAnchorItem(getTicksLeft());
getLocation().getWorld().dropItemNaturally(getLocation(), item);
}
location.getBlock().setType(Material.AIR);
if (plugin.isServerVersionAtLeast(ServerVersion.V1_9))
location.getWorld().spawnParticle(Particle.LAVA, location.clone().add(.5, .5, .5), 5, 0, 0, 0, 5);
location.getWorld().playSound(location, plugin.isServerVersionAtLeast(ServerVersion.V1_9)
? Sound.ENTITY_GENERIC_EXPLODE : Sound.valueOf("EXPLODE"), 10, 10);
plugin.getAnchorManager().removAnchor(location);
}
public Location getLocation() {
return location.clone();
}
@Override
public int getTicksLeft() {
return ticksLeft;
}
@Override
public void setTicksLeft(int ticksLeft) {
this.ticksLeft = ticksLeft;
}

View File

@ -1,38 +1,31 @@
package com.songoda.epicanchors.anchor;
import com.songoda.epicanchors.api.anchor.Anchor;
import com.songoda.epicanchors.api.anchor.AnchorManager;
import org.bukkit.Location;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class EAnchorManager implements AnchorManager {
public class AnchorManager {
private final Map<Location, Anchor> registeredAnchors = new HashMap<>();
@Override
public Anchor addAnchor(Location location, Anchor anchor) {
return registeredAnchors.put(roundLocation(location), anchor);
}
@Override
public void removeAnchor(Location location) {
public void removAnchor(Location location) {
registeredAnchors.remove(roundLocation(location));
}
@Override
public Anchor getAnchor(Location location) {
return registeredAnchors.get(roundLocation(location));
}
@Override
public boolean isAnchor(Location location) {
return registeredAnchors.containsKey(location);
}
@Override
public Map<Location, Anchor> getAnchors() {
return Collections.unmodifiableMap(registeredAnchors);
}

View File

@ -1,6 +1,6 @@
package com.songoda.epicanchors.command;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.EpicAnchors;
import org.bukkit.command.CommandSender;
public abstract class AbstractCommand {
@ -31,7 +31,7 @@ public abstract class AbstractCommand {
return noConsole;
}
protected abstract ReturnType runCommand(EpicAnchorsPlugin instance, CommandSender sender, String... args);
protected abstract ReturnType runCommand(EpicAnchors instance, CommandSender sender, String... args);
public abstract String getPermissionNode();

View File

@ -1,6 +1,6 @@
package com.songoda.epicanchors.command;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.command.commands.CommandEpicAnchors;
import com.songoda.epicanchors.command.commands.CommandGive;
import com.songoda.epicanchors.command.commands.CommandReload;
@ -17,11 +17,11 @@ import java.util.List;
public class CommandManager implements CommandExecutor {
private EpicAnchorsPlugin instance;
private EpicAnchors instance;
private List<AbstractCommand> commands = new ArrayList<>();
public CommandManager(EpicAnchorsPlugin instance) {
public CommandManager(EpicAnchors instance) {
this.instance = instance;
AbstractCommand commandEpicAnchors = addCommand(new CommandEpicAnchors());

View File

@ -1,6 +1,6 @@
package com.songoda.epicanchors.command.commands;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.command.AbstractCommand;
import com.songoda.epicanchors.utils.Methods;
import org.bukkit.command.CommandSender;
@ -12,7 +12,7 @@ public class CommandEpicAnchors extends AbstractCommand {
}
@Override
protected ReturnType runCommand(EpicAnchorsPlugin instance, CommandSender sender, String... args) {
protected ReturnType runCommand(EpicAnchors instance, CommandSender sender, String... args) {
sender.sendMessage("");
sender.sendMessage(Methods.formatText(instance.getReferences().getPrefix() + "&7Version " + instance.getDescription().getVersion() + " Created with <3 by &5&l&oBrianna"));

View File

@ -1,6 +1,6 @@
package com.songoda.epicanchors.command.commands;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.command.AbstractCommand;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
@ -14,7 +14,7 @@ public class CommandGive extends AbstractCommand {
}
@Override
protected ReturnType runCommand(EpicAnchorsPlugin instance, CommandSender sender, String... args) {
protected ReturnType runCommand(EpicAnchors instance, CommandSender sender, String... args) {
if (args.length != 3) return ReturnType.SYNTAX_ERROR;
if (Bukkit.getPlayer(args[1]) == null && !args[1].trim().toLowerCase().equals("all")) {
@ -22,7 +22,7 @@ public class CommandGive extends AbstractCommand {
return ReturnType.SYNTAX_ERROR;
}
ItemStack itemStack = instance.makeAnchorItem(Integer.parseInt(args[2]) * 20 * 60 * 60);
ItemStack itemStack = instance.makAnchorItem(Integer.parseInt(args[2]) * 20 * 60 * 60);
if (!args[1].trim().toLowerCase().equals("all")) {
Player player = Bukkit.getOfflinePlayer(args[1]).getPlayer();

View File

@ -1,6 +1,6 @@
package com.songoda.epicanchors.command.commands;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.command.AbstractCommand;
import com.songoda.epicanchors.utils.Methods;
import org.bukkit.command.CommandSender;
@ -12,7 +12,7 @@ public class CommandReload extends AbstractCommand {
}
@Override
protected ReturnType runCommand(EpicAnchorsPlugin instance, CommandSender sender, String... args) {
protected ReturnType runCommand(EpicAnchors instance, CommandSender sender, String... args) {
instance.reload();
sender.sendMessage(Methods.formatText(instance.getReferences().getPrefix() + "&7Configuration and Language files reloaded."));
return ReturnType.SUCCESS;

View File

@ -1,6 +1,6 @@
package com.songoda.epicanchors.command.commands;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.command.AbstractCommand;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -12,7 +12,7 @@ public class CommandSettings extends AbstractCommand {
}
@Override
protected ReturnType runCommand(EpicAnchorsPlugin instance, CommandSender sender, String... args) {
protected ReturnType runCommand(EpicAnchors instance, CommandSender sender, String... args) {
instance.getSettingsManager().openSettingsManager((Player) sender);
return ReturnType.SUCCESS;
}

View File

@ -1,7 +1,7 @@
package com.songoda.epicanchors.gui;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.anchor.EAnchor;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.anchor.Anchor;
import com.songoda.epicanchors.utils.Methods;
import com.songoda.epicanchors.utils.gui.AbstractGUI;
import org.bukkit.Bukkit;
@ -15,12 +15,12 @@ import java.util.List;
public class GUIOverview extends AbstractGUI {
private final EpicAnchorsPlugin plugin;
private final EAnchor anchor;
private final EpicAnchors plugin;
private final Anchor anchor;
private int task;
public GUIOverview(EpicAnchorsPlugin plugin, EAnchor anchor, Player player) {
public GUIOverview(EpicAnchors plugin, Anchor anchor, Player player) {
super(player);
this.plugin = plugin;
this.anchor = anchor;
@ -72,7 +72,7 @@ public class GUIOverview extends AbstractGUI {
itemmetaECO.setLore(loreECO);
itemECO.setItemMeta(itemmetaECO);
ItemStack item = plugin.makeAnchorItem(anchor.getTicksLeft());
ItemStack item = plugin.makAnchorItem(anchor.getTicksLeft());
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Methods.formatText(plugin.getLocale().getMessage("interface.anchor.smalltitle")));
List<String> lore = new ArrayList<>();

View File

@ -1,10 +1,7 @@
package com.songoda.epicanchors.listeners;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.anchor.EAnchor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.anchor.Anchor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
@ -13,20 +10,14 @@ import org.bukkit.inventory.ItemStack;
public class BlockListeners implements Listener {
private EpicAnchorsPlugin instance;
private EpicAnchors instance;
public BlockListeners(EpicAnchorsPlugin instance) {
public BlockListeners(EpicAnchors instance) {
this.instance = instance;
}
@EventHandler(ignoreCancelled = true)
public void onBlockPlace(BlockPlaceEvent event) {
Player player = event.getPlayer();
Block block = event.getBlock();
if (!instance.canBuild(player, block.getLocation())
|| event.getBlock().getType() != Material.valueOf(instance.getConfig().getString("Main.Anchor Block Material")))
return;
ItemStack item = event.getItemInHand();
@ -34,7 +25,7 @@ public class BlockListeners implements Listener {
|| !item.getItemMeta().hasDisplayName()
|| instance.getTicksFromItem(item) == 0) return;
instance.getAnchorManager().addAnchor(event.getBlock().getLocation(), new EAnchor(event.getBlock().getLocation(), instance.getTicksFromItem(item)));
instance.getAnchorManager().addAnchor(event.getBlock().getLocation(), new Anchor(event.getBlock().getLocation(), instance.getTicksFromItem(item)));
}

View File

@ -1,8 +1,7 @@
package com.songoda.epicanchors.listeners;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.anchor.EAnchor;
import com.songoda.epicanchors.api.anchor.Anchor;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.anchor.Anchor;
import com.songoda.epicanchors.utils.Methods;
import com.songoda.epicanchors.utils.ServerVersion;
import org.bukkit.GameMode;
@ -18,9 +17,9 @@ import org.bukkit.inventory.ItemStack;
public class InteractListeners implements Listener {
private EpicAnchorsPlugin instance;
private EpicAnchors instance;
public InteractListeners(EpicAnchorsPlugin instance) {
public InteractListeners(EpicAnchors instance) {
this.instance = instance;
}
@ -29,22 +28,15 @@ public class InteractListeners implements Listener {
public void onBlockInteract(PlayerInteractEvent event) {
if (event.getClickedBlock() == null) return;
if (instance.getAnchorManager().getAnchor(event.getClickedBlock().getLocation()) == null) return;
if (!instance.canBuild(event.getPlayer(), event.getClickedBlock().getLocation())) {
event.setCancelled(true);
return;
}
if (event.getAction() != Action.RIGHT_CLICK_BLOCK) {
instance.bust(event.getClickedBlock().getLocation());
event.setCancelled(true);
return;
}
Anchor anchor = instance.getAnchorManager().getAnchor(event.getClickedBlock().getLocation());
if (anchor == null) return;
if (event.getAction() != Action.RIGHT_CLICK_BLOCK) {
anchor.bust();
event.setCancelled(true);
return;
}
Player player = event.getPlayer();
ItemStack item = player.getItemInHand();
@ -63,10 +55,10 @@ public class InteractListeners implements Listener {
if (player.getGameMode() != GameMode.CREATIVE)
Methods.takeItem(player, 1);
Sound sound = EpicAnchorsPlugin.getInstance().isServerVersionAtLeast(ServerVersion.V1_9) ? Sound.ENTITY_PLAYER_LEVELUP : Sound.valueOf("LEVEL_UP");
Sound sound = EpicAnchors.getInstance().isServerVersionAtLeast(ServerVersion.V1_9) ? Sound.ENTITY_PLAYER_LEVELUP : Sound.valueOf("LEVEL_UP");
player.playSound(player.getLocation(), sound, 0.6F, 15.0F);
if (EpicAnchorsPlugin.getInstance().isServerVersionAtLeast(ServerVersion.V1_9))
if (EpicAnchors.getInstance().isServerVersionAtLeast(ServerVersion.V1_9))
player.getWorld().spawnParticle(Particle.SPELL_WITCH, anchor.getLocation().add(.5, .5, .5), 100, .5, .5, .5);
event.setCancelled(true);
@ -74,7 +66,7 @@ public class InteractListeners implements Listener {
return;
}
((EAnchor) anchor).overview(player);
((Anchor) anchor).overview(player);
}

View File

@ -1,29 +1,25 @@
package com.songoda.epicanchors.handlers;
package com.songoda.epicanchors.tasks;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.api.anchor.Anchor;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.anchor.Anchor;
import com.songoda.epicanchors.utils.ServerVersion;
import com.songoda.epicspawners.EpicSpawners;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
public class AnchorHandler {
public class AnchorTask extends BukkitRunnable {
private static EpicAnchors plugin;
private EpicAnchorsPlugin instance;
private Map<Location, Integer> delays = new HashMap<>();
private Class<?> clazzEntity, clazzCraftEntity, clazzMinecraftServer;
@ -34,22 +30,24 @@ public class AnchorHandler {
private boolean epicSpawners;
public AnchorHandler(EpicAnchorsPlugin instance) {
this.instance = instance;
public AnchorTask(EpicAnchors plug) {
plugin = plug;
epicSpawners = Bukkit.getPluginManager().getPlugin("EpicSpawners") != null;
try {
String ver = Bukkit.getServer().getClass().getPackage().getName().substring(23);
clazzMinecraftServer = Class.forName("net.minecraft.server." + ver + ".MinecraftServer");
clazzEntity = Class.forName("net.minecraft.server." + ver + ".Entity");
clazzCraftEntity = Class.forName("org.bukkit.craftbukkit." + ver + ".entity.CraftEntity");
if (instance.isServerVersionAtLeast(ServerVersion.V1_13))
if (plugin.isServerVersionAtLeast(ServerVersion.V1_13))
methodTick = clazzEntity.getDeclaredMethod("tick");
else if (instance.isServerVersion(ServerVersion.V1_12))
else if (plugin.isServerVersion(ServerVersion.V1_12))
methodTick = clazzEntity.getDeclaredMethod("B_");
else if (instance.isServerVersion(ServerVersion.V1_11))
else if (plugin.isServerVersion(ServerVersion.V1_11))
methodTick = clazzEntity.getDeclaredMethod("A_");
else if (instance.isServerVersionAtLeast(ServerVersion.V1_9))
else if (plugin.isServerVersionAtLeast(ServerVersion.V1_9))
methodTick = clazzEntity.getDeclaredMethod("m");
else
methodTick = clazzEntity.getDeclaredMethod("t_");
@ -62,15 +60,12 @@ public class AnchorHandler {
} catch (ReflectiveOperationException e) {
e.printStackTrace();
}
epicSpawners = instance.getServer().getPluginManager().getPlugin("EpicSpawners") != null;
Bukkit.getScheduler().scheduleSyncRepeatingTask(instance, this::doAnchorCheck, 0, 1); //ToDo: way to fast.
if (instance.isServerVersionAtLeast(ServerVersion.V1_9))
Bukkit.getScheduler().scheduleSyncRepeatingTask(instance, this::doParticle, 0, 2); //ToDo: way to fast.
this.runTaskTimer(plugin, 0, 3);
}
private void doParticle() {
for (Anchor anchor : instance.getAnchorManager().getAnchors().values()) {
for (Anchor anchor : plugin.getAnchorManager().getAnchors().values()) {
Location location1 = anchor.getLocation().add(.5, .5, .5);
if (location1.getWorld() == null) continue;
float xx = (float) (0 + (Math.random() * .15));
@ -81,23 +76,24 @@ public class AnchorHandler {
xx = (float) (0 + (Math.random() * .75));
yy = (float) (0 + (Math.random() * 1));
zz = (float) (0 + (Math.random() * .75));
if (!instance.isServerVersionAtLeast(ServerVersion.V1_13))
if (!plugin.isServerVersionAtLeast(ServerVersion.V1_13))
location1.getWorld().spawnParticle(Particle.REDSTONE, location1, 5, xx, yy, zz, 1);
else
location1.getWorld().spawnParticle(Particle.REDSTONE, location1, 5, xx, yy, zz, 1, new Particle.DustOptions(Color.WHITE, 1F));
}
}
private void doAnchorCheck() {
for (Anchor anchor : instance.getAnchorManager().getAnchors().values()) {
@Override
public void run() {
if (plugin.isServerVersionAtLeast(ServerVersion.V1_9))
doParticle();
for (Anchor anchor : plugin.getAnchorManager().getAnchors().values()) {
if (anchor.getLocation() == null) continue;
Location location = anchor.getLocation();
if (anchor.getLocation().getBlock().getType() != Material.valueOf(instance.getConfig().getString("Main.Anchor Block Material")))
if (anchor.getLocation().getBlock().getType() != Material.valueOf(plugin.getConfig().getString("Main.Anchor Block Material")))
continue;
Chunk chunk = location.getChunk();
@ -123,13 +119,13 @@ public class AnchorHandler {
}
int ticksLeft = anchor.getTicksLeft();
anchor.setTicksLeft(ticksLeft - 1);
anchor.setTicksLeft(ticksLeft - 3);
if (ticksLeft <= 0) {
instance.getAnchorManager().removeAnchor(location);
if (instance.isServerVersionAtLeast(ServerVersion.V1_9))
plugin.getAnchorManager().removAnchor(location);
if (plugin.isServerVersionAtLeast(ServerVersion.V1_9))
location.getWorld().spawnParticle(Particle.LAVA, location.clone().add(.5, .5, .5), 5, 0, 0, 0, 5);
location.getWorld().playSound(location, instance.isServerVersionAtLeast(ServerVersion.V1_13)
location.getWorld().playSound(location, plugin.isServerVersionAtLeast(ServerVersion.V1_13)
? Sound.ENTITY_GENERIC_EXPLODE : Sound.valueOf("EXPLODE"), 10, 10);
location.getBlock().setType(Material.AIR);
chunk.unload();

View File

@ -173,7 +173,7 @@ public class SettingsManager implements Listener {
}
public enum Setting {
o1("Main.Name-Tag", "&eAnchor &8(&7{REMAINING}&8)"),
o1("Main.Name-Tag", "&Anchor &8(&7{REMAINING}&8)"),
o2("Main.Anchor-Lore", "&7Place down to keep that chunk|&7loaded until the time runs out."),
o3("Main.Anchor Block Material", EpicAnchors.getInstance().isServerVersionAtLeast(ServerVersion.V1_13) ? "END_PORTAL_FRAME" : "ENDER_PORTAL_FRAME"),
o4("Main.Add Time With Economy", true),

View File

@ -1,6 +1,6 @@
package com.songoda.epicanchors.utils.gui;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.utils.Methods;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -125,7 +125,7 @@ public abstract class AbstractGUI implements Listener {
registerOnCloses();
}
constructGUI();
initializeListeners(EpicAnchorsPlugin.getInstance());
initializeListeners(EpicAnchors.getInstance());
player.openInventory(inventory);
}

View File

@ -1,6 +1,6 @@
package com.songoda.epicanchors.utils.gui;
import com.songoda.epicanchors.EpicAnchorsPlugin;
import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.utils.ServerVersion;
import org.bukkit.Sound;
import org.bukkit.event.inventory.ClickType;
@ -24,7 +24,7 @@ public class Range {
this.bottom = bottom;
if (onClickSound == null) {
if (EpicAnchorsPlugin.getInstance().isServerVersionAtLeast(ServerVersion.V1_9)) {
if (EpicAnchors.getInstance().isServerVersionAtLeast(ServerVersion.V1_9)) {
this.onClickSound = Sound.UI_BUTTON_CLICK;
} else {
this.onClickSound = Sound.valueOf("CLICK");

View File

@ -2,7 +2,7 @@ name: EpicAnchors
description: EpicAnchors
version: maven-version-number
softdepend: [EpicSpawners, Towny, RedProtect, Kingdoms, PlotsSquared, GriefPrevention, USkyBlock, ASkyBlock, WorldGuard, Factions, Vault]
main: com.songoda.epicanchors.EpicAnchorsPlugin
main: com.songoda.epicanchors.EpicAnchors
author: songoda
api-version: 1.13
commands: