mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Ignore interact events from Spectators
This commit is contained in:
parent
11c24cff68
commit
9e584069e6
@ -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())
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user