Skip to content

Commit

Permalink
Check waterlogged blocks for water-flow flag.
Browse files Browse the repository at this point in the history
Also remove some terribly outdated obsidian generator protection.

Fixes #1546.
  • Loading branch information
wizjany committed Mar 30, 2020
1 parent 570b7f7 commit 1fcda13
Showing 1 changed file with 2 additions and 8 deletions.
Expand Up @@ -34,6 +34,7 @@
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.data.Waterlogged;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowman;
import org.bukkit.event.EventHandler;
Expand Down Expand Up @@ -194,7 +195,7 @@ public void onBlockFromTo(BlockFromToEvent event) {
}
}

if (wcfg.highFreqFlags && isWater
if (wcfg.highFreqFlags && (isWater || blockFrom.getBlockData() instanceof Waterlogged)
&& WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery().queryState(BukkitAdapter.adapt(blockFrom.getLocation()), (RegionAssociable) null, Flags.WATER_FLOW) == StateFlag.State.DENY) {
event.setCancelled(true);
return;
Expand All @@ -205,13 +206,6 @@ public void onBlockFromTo(BlockFromToEvent event) {
event.setCancelled(true);
return;
}

if (wcfg.disableObsidianGenerators && (isAir || isLava)
&& (blockTo.getType() == Material.REDSTONE_WIRE
|| blockTo.getType() == Material.TRIPWIRE)) {
blockTo.setType(Material.AIR);
return;
}
}

/*
Expand Down

0 comments on commit 1fcda13

Please sign in to comment.