diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 228177e..1029b65 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/sig/plugin/TwosideKeeper/CustomDamage.java b/src/sig/plugin/TwosideKeeper/CustomDamage.java index 7e79b5d..ce66c55 100644 --- a/src/sig/plugin/TwosideKeeper/CustomDamage.java +++ b/src/sig/plugin/TwosideKeeper/CustomDamage.java @@ -1165,14 +1165,14 @@ public class CustomDamage { private static int GetHeartAmount(double dmg) { int heartcount = 1; double dmgamountcopy = dmg; - TwosideKeeper.log("Starting Damage: "+dmgamountcopy, 0); + //TwosideKeeper.log("Starting Damage: "+dmgamountcopy, 0); while (dmgamountcopy>10) { dmgamountcopy/=2; heartcount++; - TwosideKeeper.log("Hearts: "+heartcount, 0); - TwosideKeeper.log("Remaining Damage: "+dmgamountcopy, 0); + //TwosideKeeper.log("Hearts: "+heartcount, 0); + //TwosideKeeper.log("Remaining Damage: "+dmgamountcopy, 0); } - TwosideKeeper.log(ChatColor.RED+"Final Heart Count: "+heartcount, 0); + //TwosideKeeper.log(ChatColor.RED+"Final Heart Count: "+heartcount, 0); return heartcount; } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index 3d8fa0e..956bcfa 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -18,6 +18,7 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.attribute.Attribute; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.block.Sign; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; @@ -4339,7 +4340,7 @@ public class GenericFunctions { Location originalloc = player.getLocation().clone(); Location teleloc = target.getLocation().add(target.getLocation().getDirection().multiply(-1.0-mult)); int i=0; - while (!(teleloc.getBlock().getRelative(0, -1, 0).getType().isSolid() && teleloc.getBlock().getType()==Material.AIR && teleloc.getBlock().getRelative(0, 1, 0).getType()==Material.AIR)) { + /*while (!(teleloc.getBlock().getRelative(0, -1, 0).getType().isSolid() && teleloc.getBlock().getType()==Material.AIR && teleloc.getBlock().getRelative(0, 1, 0).getType()==Material.AIR)) { if (i==0) { teleloc=target.getLocation(); } else @@ -4358,6 +4359,23 @@ public class GenericFunctions { teleloc=teleloc.add(0,1,0); } i++; + }*/ + int tries = 0; + while (tries<2) { + if ((TwosideKeeper.isNatural.contains(teleloc.getBlock().getType()) || teleloc.getBlock().getType()==Material.AIR) && + (TwosideKeeper.isNatural.contains(teleloc.getBlock().getRelative(BlockFace.UP).getType()) || teleloc.getBlock().getType()==Material.AIR)) { + break; + } else { + //Try 1 higher. + teleloc.add(0,1,0); + tries++; + } + } + if (TwosideKeeper.isNatural.contains(teleloc.getBlock().getType())) { + teleloc.getBlock().breakNaturally(); + } + if (TwosideKeeper.isNatural.contains(teleloc.getBlock().getRelative(BlockFace.UP).getType())) { + teleloc.getBlock().getRelative(BlockFace.UP).breakNaturally(); } SoundUtils.playGlobalSound(teleloc, Sound.BLOCK_NOTE_SNARE, 1.0f, 1.0f); teleloc.setPitch((float)pitch); diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index 8f19d11..a902af6 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -448,6 +448,16 @@ public class TwosideKeeper extends JavaPlugin implements Listener { public static List blockqueue = new ArrayList(); public static List jobrecipes = new ArrayList(); long LastClearStructureTime = 0; + + public static final Set isNatural = ImmutableSet.of(Material.CLAY, Material.DIRT, Material.GRASS, + Material.GRASS_PATH, Material.GRAVEL, Material.MYCEL, Material.SAND, Material.SNOW, Material.SNOW_BLOCK, + Material.SOUL_SAND, Material.STONE, Material.COBBLESTONE, Material.DOUBLE_PLANT, Material.LONG_GRASS, + Material.RED_ROSE, Material.YELLOW_FLOWER, Material.STATIONARY_WATER, Material.STATIONARY_LAVA, + Material.MOSSY_COBBLESTONE, Material.COAL_ORE, Material.IRON_ORE, Material.GOLD_ORE, Material.REDSTONE_ORE, + Material.GLOWING_REDSTONE_ORE, Material.LAPIS_ORE, Material.DIAMOND_ORE, Material.EMERALD_ORE, + Material.OBSIDIAN, Material.ENDER_STONE, Material.NETHERRACK, Material.NETHER_BRICK, Material.HARD_CLAY, + Material.STAINED_CLAY, Material.SANDSTONE, Material.LOG, Material.LOG_2, Material.WOOD, + Material.FENCE, Material.PUMPKIN, Material.MELON_BLOCK, Material.LEAVES, Material.LEAVES_2); public int TeamCounter = 0; public static int time_passed = 0; //The total amount of time lost due to modifications to FullTime().