From bb27d753b1fb0217e30cfbe6bb243014b057456a Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Wed, 22 Feb 2017 00:00:27 -0500 Subject: [PATCH] I think this should stop my fireworks from damaging people --- .../java/com/gmail/nossr50/listeners/EntityListener.java | 6 ++++++ src/main/java/com/gmail/nossr50/mcMMO.java | 1 + 2 files changed, 7 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 0590b3f23..7b55a40f2 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -148,6 +148,12 @@ public class EntityListener implements Listener { if (event.getEntity() instanceof ArmorStand) { return; } + + if (event.getDamager().hasMetadata(mcMMO.funfettiMetadataKey)) + { + event.setCancelled(true); + return; + } double damage = event.getFinalDamage(); Entity defender = event.getEntity(); diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index fc5f069e1..1dc5044be 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -103,6 +103,7 @@ public class mcMMO extends JavaPlugin { public final static String blockMetadataKey = "mcMMO: Piston Tracking"; public final static String furnaceMetadataKey = "mcMMO: Tracked Furnace"; public final static String tntMetadataKey = "mcMMO: Tracked TNT"; + public final static String funfettiMetadataKey = "mcMMO: Funfetti"; public final static String tntsafeMetadataKey = "mcMMO: Safe TNT"; public final static String customNameKey = "mcMMO: Custom Name"; public final static String customVisibleKey = "mcMMO: Name Visibility";