From 911469c746d127c91e02f14dfaaa96f1d99575c6 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Mon, 1 Aug 2022 17:15:13 -0400 Subject: [PATCH] creative mode should not be attackable --- .../tylermurphy/hideAndSeek/game/listener/DisguiseHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DisguiseHandler.java b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DisguiseHandler.java index 50c45fb..10db324 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DisguiseHandler.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DisguiseHandler.java @@ -11,6 +11,7 @@ import com.cryptomorin.xseries.XMaterial; import net.tylermurphy.hideAndSeek.Main; import net.tylermurphy.hideAndSeek.game.util.Disguise; import org.bukkit.Bukkit; +import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.attribute.Attribute; @@ -73,6 +74,7 @@ public class DisguiseHandler implements Listener { Disguise disguise = Main.getInstance().getDisguiser().getByEntityID(id); if(disguise == null) disguise = Main.getInstance().getDisguiser().getByHitBoxID(id); if(disguise == null) return; + if(disguise.getPlayer().getGameMode() == GameMode.CREATIVE) return; event.setCancelled(true); handleAttack(disguise, player); }