diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java index da48ab2b..a8183c32 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java @@ -4,6 +4,7 @@ import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.util.Groups; import org.bukkit.ChatColor; +import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.EntityType; @@ -69,6 +70,10 @@ public class InteractBlocker extends FreedomService private void handleRightClick(PlayerInteractEvent event) { final Player player = event.getPlayer(); + if (player.getGameMode().equals(GameMode.SPECTATOR)) { + return; + } + final Block clickedBlock = event.getClickedBlock(); if (clickedBlock != null && clickedBlock.getType() == Material.RESPAWN_ANCHOR && !ConfigEntry.ALLOW_RESPAWN_ANCHORS.getBoolean()) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/fun/ItemFun.java b/src/main/java/me/totalfreedom/totalfreedommod/fun/ItemFun.java index 773294d3..e3597942 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/fun/ItemFun.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/fun/ItemFun.java @@ -13,13 +13,7 @@ import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.player.PlayerData; import me.totalfreedom.totalfreedommod.shop.ShopItem; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.bukkit.ChatColor; -import org.bukkit.Color; -import org.bukkit.FireworkEffect; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.SoundCategory; +import org.bukkit.*; import org.bukkit.block.Block; import org.bukkit.entity.Arrow; import org.bukkit.entity.EnderPearl; @@ -100,6 +94,11 @@ public class ItemFun extends FreedomService { Player player = event.getPlayer(); + if (player.getGameMode().equals(GameMode.SPECTATOR)) + { + return; + } + Entity entity = event.getRightClicked(); FPlayer fPlayer = plugin.pl.getPlayer(player);