Fixed the water damage block Bug

This commit is contained in:
DarkLiKally 2011-02-22 17:27:58 +01:00
parent c9c747693d
commit 2204bd67a7

View File

@ -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());