Workaround: Client-side fire bug.
When creative mode player tries to put out a fire without permission, it APPEARS to succeed to that player, until he logs out and back in. This works around that by explicitly sending that player a block update for the fire block, which really hasn't changed.
This commit is contained in:
parent
aa9f847fb6
commit
647f874cc0
|
|
@ -1099,7 +1099,10 @@ class PlayerEventHandler implements Listener
|
||||||
if(!this.onLeftClickWatchList(clickedBlockType) && !GriefPrevention.instance.config_mods_accessTrustIds.Contains(new MaterialInfo(clickedBlock.getTypeId(), clickedBlock.getData(), null)))
|
if(!this.onLeftClickWatchList(clickedBlockType) && !GriefPrevention.instance.config_mods_accessTrustIds.Contains(new MaterialInfo(clickedBlock.getTypeId(), clickedBlock.getData(), null)))
|
||||||
{
|
{
|
||||||
//and an exception for putting our fires
|
//and an exception for putting our fires
|
||||||
if(GriefPrevention.instance.config_claims_protectFires && event.getClickedBlock() != null && event.getClickedBlock().getRelative(event.getBlockFace()).getType() == Material.FIRE)
|
if(GriefPrevention.instance.config_claims_protectFires && event.getClickedBlock() != null)
|
||||||
|
{
|
||||||
|
Block adjacentBlock = event.getClickedBlock().getRelative(event.getBlockFace());
|
||||||
|
if(adjacentBlock.getType() == Material.FIRE)
|
||||||
{
|
{
|
||||||
if(playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
if(playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
||||||
Claim claim = this.dataStore.getClaimAt(clickedBlock.getLocation(), false, playerData.lastClaim);
|
Claim claim = this.dataStore.getClaimAt(clickedBlock.getLocation(), false, playerData.lastClaim);
|
||||||
|
|
@ -1112,10 +1115,12 @@ class PlayerEventHandler implements Listener
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
GriefPrevention.sendMessage(player, TextMode.Err, noBuildReason);
|
GriefPrevention.sendMessage(player, TextMode.Err, noBuildReason);
|
||||||
|
player.sendBlockChange(adjacentBlock.getLocation(), adjacentBlock.getTypeId(), adjacentBlock.getData());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user