From c019114f293a08909192dccf0310031f6cd1294f Mon Sep 17 00:00:00 2001 From: Esophose Date: Sun, 14 Apr 2019 21:42:18 -0600 Subject: [PATCH] Build 73_1, fix block duplication with island spawn --- .../commands/island/SetSpawnCommand.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/SetSpawnCommand.java b/src/main/java/me/goodandevil/skyblock/command/commands/island/SetSpawnCommand.java index 8f7a1fd6..ea768f00 100644 --- a/src/main/java/me/goodandevil/skyblock/command/commands/island/SetSpawnCommand.java +++ b/src/main/java/me/goodandevil/skyblock/command/commands/island/SetSpawnCommand.java @@ -95,24 +95,15 @@ public class SetSpawnCommand extends SubCommand { if (LocationUtil.isLocationCentreOfBlock(location)) { new BukkitRunnable() { public void run() { - if (location.getBlock().getType() != Material.AIR && location.getBlock() - .getType() != Materials.MOVING_PISTON.parseMaterial()) { - location.getWorld().dropItemNaturally(location, - new ItemStack(location.getBlock().getType())); + if (location.getBlock().getType() != Material.AIR && location.getBlock().getType() != Materials.MOVING_PISTON.parseMaterial()) { + location.getBlock().breakNaturally(); } - if (location.clone().add(0.0D, 1.0D, 0.0D).getBlock() - .getType() != Material.AIR - && location.getBlock().getType() != Materials.MOVING_PISTON - .parseMaterial()) { - location.getWorld().dropItemNaturally( - location.clone().add(0.0D, 1.0D, 0.0D), - new ItemStack(location.clone().add(0.0D, 1.0D, 0.0D) - .getBlock().getType())); + if (location.clone().add(0.0D, 1.0D, 0.0D).getBlock().getType() != Material.AIR && location.getBlock().getType() != Materials.MOVING_PISTON.parseMaterial()) { + location.clone().add(0.0D, 1.0D, 0.0D).getBlock().breakNaturally(); } - islandManager - .removeSpawnProtection(island.getLocation(world, environment)); + islandManager.removeSpawnProtection(island.getLocation(world, environment)); } }.runTask(skyblock); } else {