diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/dev/genbyte/sunfright/Damager.java | 8 | ||||
-rw-r--r-- | src/main/resources/plugin.yml | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/dev/genbyte/sunfright/Damager.java b/src/main/java/dev/genbyte/sunfright/Damager.java index 42d6133..bfb977f 100644 --- a/src/main/java/dev/genbyte/sunfright/Damager.java +++ b/src/main/java/dev/genbyte/sunfright/Damager.java @@ -4,6 +4,7 @@ import java.util.Collection; import java.util.logging.Level; import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -43,6 +44,13 @@ public class Damager extends BukkitRunnable { public void run() { ItemStack helmet = player.getInventory().getHelmet(); + Block topBlock = player.getWorld().getBlockAt( + player.getWorld().getHighestBlockAt(player.getLocation()).getLocation().subtract(0, 1, 0)); + + if (topBlock.getLocation().getY() > player.getLocation().getY() + && topBlock.getType().equals(Material.BLACK_STAINED_GLASS)) { + return; + } if (helmet != null) { ItemMeta helmetMeta = helmet.getItemMeta(); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 991a8e4..c26f3ca 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -4,4 +4,5 @@ description: ${description} author: ${author} website: ${url} +api-version: 1.13 main: ${mainClass} \ No newline at end of file |