about summary refs log tree commit diff
path: root/src/main/java/dev/genbyte/sunfright/Damager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/dev/genbyte/sunfright/Damager.java')
-rw-r--r--src/main/java/dev/genbyte/sunfright/Damager.java6
1 files changed, 5 insertions, 1 deletions
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<? extends Player> 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);
 			}
 		}
 	}