Only warn once when placing tnt
This commit is contained in:
parent
173bd794fe
commit
9a70c2218b
|
|
@ -299,10 +299,11 @@ public class BlockEventHandler implements Listener
|
||||||
playerData.lastClaim = claim;
|
playerData.lastClaim = claim;
|
||||||
|
|
||||||
//warn about TNT not destroying claimed blocks
|
//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.Warn, Messages.NoTNTDamageClaims);
|
||||||
GriefPrevention.sendMessage(player, TextMode.Instr, Messages.ClaimExplosivesAdvertisement);
|
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
|
//if the player has permission for the claim and he's placing UNDER the claim
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,9 @@ public class PlayerData
|
||||||
//whether this player was recently warned about building outside land claims
|
//whether this player was recently warned about building outside land claims
|
||||||
boolean warnedAboutBuildingOutsideClaims = false;
|
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)
|
//whether the player was kicked (set and used during logout)
|
||||||
boolean wasKicked = false;
|
boolean wasKicked = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user