mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-18 23:27:35 +01:00
Fixed the water damage block Bug
This commit is contained in:
parent
c9c747693d
commit
2204bd67a7
@ -174,6 +174,16 @@ public void onBlockFlow(BlockFromToEvent event) {
|
||||
}
|
||||
}*/
|
||||
|
||||
// Check the fluid block (from) whether it is air. If so and the target block is protected, cancel the event
|
||||
if(plugin.preventWaterDamage.size() > 0 && blockFrom.getTypeId() == 0) {
|
||||
int targetId = world.getBlockTypeIdAt(
|
||||
blockTo.getX(), blockTo.getY(), blockTo.getZ());
|
||||
if (plugin.preventWaterDamage.contains(targetId)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.preventWaterDamage.size() > 0 && isWater) {
|
||||
int targetId = world.getBlockTypeIdAt(
|
||||
blockTo.getX(), blockTo.getY(), blockTo.getZ());
|
||||
|
Loading…
Reference in New Issue
Block a user