This commit is contained in:
Brianna O'Keefe 2019-02-02 12:55:09 -05:00
parent 094d08218c
commit c156797c03
2 changed files with 116 additions and 124 deletions

View File

@ -73,6 +73,7 @@ public class Block implements Listener {
if (stackableManager != null
&& stackableManager.isStacked(block.getLocation())) {
Stackable stackable = stackableManager.getStack(block.getLocation(), block.getType());
if (stackable != null) {
stackable.takeOne();
if (stackable.getSize() <= 1) {
stackableManager.removeStack(stackable);
@ -80,6 +81,7 @@ public class Block implements Listener {
event.setCancelled(true);
block.getWorld().dropItemNaturally(block.getLocation().clone().add(.5, 1, .5), new ItemStack(block.getType()));
}
}
if (generatorManager != null
&& generatorManager.isGenerator(block)
@ -291,6 +293,9 @@ public class Block implements Listener {
if (!LocationUtil.isLocationAtLocationRadius(block.getLocation(),
island.getLocation(world, IslandEnvironment.Island), island.getRadius() - 2.0D)) {
event.setCancelled(true);
} else if (skyblock.getStackableManager() != null
&& skyblock.getStackableManager().isStacked(block.getLocation())) {
event.setCancelled(true);
} else if (LocationUtil.isLocationLocation(block.getLocation(),
island.getLocation(world, IslandEnvironment.Main)
.clone()

View File

@ -66,9 +66,7 @@ public class Levelling {
FileConfiguration configLoad = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"))
.getFileConfiguration();
nInventoryUtil nInv = new nInventoryUtil(player, new ClickEventHandler() {
@Override
public void onClick(ClickEvent event) {
nInventoryUtil nInv = new nInventoryUtil(player, event -> {
if (islandManager.getIsland(player) == null) {
messageManager.sendMessage(player, configLoad.getString("Command.Island.Level.Owner.Message"));
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
@ -162,30 +160,20 @@ public class Levelling {
}
});
} else if ((is.getType() == SkullUtil.createItemStack().getType()) && (is.hasItemMeta())) {
PlayerData playerData = skyblock.getPlayerDataManager().getPlayerData(player);
PlayerData playerData1 = skyblock.getPlayerDataManager().getPlayerData(player);
if (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&',
configLoad.getString("Menu.Levelling.Item.Previous.Displayname")))) {
playerData.setPage(playerData.getPage() - 1);
playerData1.setPage(playerData1.getPage() - 1);
soundManager.playSound(player, Sounds.ARROW_HIT.bukkitSound(), 1.0F, 1.0F);
Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(skyblock, new Runnable() {
@Override
public void run() {
open(player);
}
}, 1L);
Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(skyblock, () -> open(player), 1L);
} else if (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes(
'&', configLoad.getString("Menu.Levelling.Item.Next.Displayname")))) {
playerData.setPage(playerData.getPage() + 1);
playerData1.setPage(playerData1.getPage() + 1);
soundManager.playSound(player, Sounds.ARROW_HIT.bukkitSound(), 1.0F, 1.0F);
Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(skyblock, new Runnable() {
@Override
public void run() {
open(player);
}
}, 1L);
Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(skyblock, () -> open(player), 1L);
} else {
soundManager.playSound(player, Sounds.CHICKEN_EGG_POP.bukkitSound(), 1.0F, 1.0F);
@ -199,7 +187,6 @@ public class Levelling {
event.setWillDestroy(false);
}
}
}
});
Island island = islandManager.getIsland(player);