remove FEATURE: limit fire placement, to prevent PvP-by-fire

This commit is contained in:
Len 2024-07-20 17:04:23 +02:00
parent 49e1dadf94
commit 6f2a02d610

View File

@ -235,30 +235,6 @@ public class BlockEventHandler implements Listener
Player player = placeEvent.getPlayer();
Block block = placeEvent.getBlock();
//FEATURE: limit fire placement, to prevent PvP-by-fire
//if placed block is fire and pvp is off, apply rules for proximity to other players
if (block.getType() == Material.FIRE && !doesAllowFireProximityInWorld(block.getWorld()))
{
List<Player> players = block.getWorld().getPlayers();
for (Player otherPlayer : players)
{
// Ignore players in creative or spectator mode to avoid users from checking if someone is spectating near them
if (otherPlayer.getGameMode() == GameMode.CREATIVE || otherPlayer.getGameMode() == GameMode.SPECTATOR)
{
continue;
}
Location location = otherPlayer.getLocation();
if (!otherPlayer.equals(player) && location.distanceSquared(block.getLocation()) < 9 && player.canSee(otherPlayer))
{
GriefPrevention.sendMessage(player, TextMode.Err, Messages.PlayerTooCloseForFire2);
placeEvent.setCancelled(true);
return;
}
}
}
//don't track in worlds where claims are not enabled
if (!GriefPrevention.instance.claimsEnabledForWorld(placeEvent.getBlock().getWorld())) return;