mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-21 16:05:03 +00:00
Fix respawn anchor explosion protection (#3778)
Fixes #3723, where respawn anchors explode at charges > 0 when glowstone isn't in the players hand, or at charges = 4 on right click regardless of item.
This commit is contained in:
parent
2342d53dba
commit
f5d5ed9844
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ public class EssentialsProtectBlockListener_1_16_R1 implements Listener {
|
|||
final World.Environment environment = block.getWorld().getEnvironment();
|
||||
if (block.getType() == Material.RESPAWN_ANCHOR && !environment.equals(World.Environment.NETHER)) {
|
||||
final RespawnAnchor respawnAnchor = (RespawnAnchor) block.getBlockData();
|
||||
if (respawnAnchor.getCharges() == respawnAnchor.getMaximumCharges()) {
|
||||
if ((respawnAnchor.getCharges() > 0 && (event.getItem() == null || event.getItem().getType() != Material.GLOWSTONE)) || respawnAnchor.getCharges() == respawnAnchor.getMaximumCharges()) {
|
||||
event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_respawn_anchor_explosion));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue