From 757c84a8559a4002d1b8b47af6364c3b4e565fec Mon Sep 17 00:00:00 2001 From: Genny Date: Mon, 3 Feb 2020 20:54:34 -0600 Subject: 2x player damage and respawn helmet removal The player will now take twice the damage as the helmet will. Respawn helments now vanish when in a safe area. --- pom.xml | 2 +- src/main/java/dev/genbyte/sunfright/Damager.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 81695c7..dbdd9c8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ dev.genbyte.sunfright sunfright jar - 0.2.1 + 0.2.2 sunfright Burn me to a cript, large glowing orb! diff --git a/src/main/java/dev/genbyte/sunfright/Damager.java b/src/main/java/dev/genbyte/sunfright/Damager.java index 6eb7c4d..8c223fb 100644 --- a/src/main/java/dev/genbyte/sunfright/Damager.java +++ b/src/main/java/dev/genbyte/sunfright/Damager.java @@ -20,10 +20,14 @@ public class Damager extends BukkitRunnable { public void run() { Collection players = sf.getServer().getOnlinePlayers(); + players.forEach((player) -> { byte skylight = player.getLocation().getBlock().getLightFromSky(); + if (skylight > 3) { new DoDamage(player, (byte) 1).runTask(sf); + } else if (player.getInventory().getHelmet().getEnchantmentLevel(Enchantment.VANISHING_CURSE) == 2) { + player.getInventory().setHelmet(new ItemStack(Material.AIR)); } }); } @@ -67,7 +71,7 @@ public class Damager extends BukkitRunnable { } } } else { - player.damage(damage); + player.damage(damage * 2); } } } -- cgit 1.4.1-3-g733a5