Only warn once when placing tnt

This commit is contained in:
Len 2022-06-04 21:26:09 +02:00
parent 173bd794fe
commit 9a70c2218b
2 changed files with 1320 additions and 1316 deletions

View File

@ -299,10 +299,11 @@ public class BlockEventHandler implements Listener
playerData.lastClaim = claim;
//warn about TNT not destroying claimed blocks
if (block.getType() == Material.TNT && !claim.areExplosivesAllowed)
if (block.getType() == Material.TNT && !claim.areExplosivesAllowed && !playerData.warnedAboutPlacingTnt)
{
GriefPrevention.sendMessage(player, TextMode.Warn, Messages.NoTNTDamageClaims);
GriefPrevention.sendMessage(player, TextMode.Instr, Messages.ClaimExplosivesAdvertisement);
playerData.warnedAboutPlacingTnt = true;
}
//if the player has permission for the claim and he's placing UNDER the claim

View File

@ -70,6 +70,9 @@ public class PlayerData
//whether this player was recently warned about building outside land claims
boolean warnedAboutBuildingOutsideClaims = false;
//whether this player was recently warned about placing tnt
boolean warnedAboutPlacingTnt = false;
//whether the player was kicked (set and used during logout)
boolean wasKicked = false;