Silence EntityChangeBlock for redstone ore.

We already silence this for Action.PHYSICAL PlayerInteractEvents.
Unfortunately Bukkit throws another event at us without the extra info
about interaction type, which gets fired if the interact flag is allow.
So silence that too.

Closes #1573.
This commit is contained in:
wizjany 2020-05-10 02:15:06 -04:00
parent 47cd96a3af
commit b2d2d0815b

View File

@ -35,7 +35,6 @@
import com.sk89q.worldguard.bukkit.event.entity.SpawnEntityEvent;
import com.sk89q.worldguard.bukkit.event.entity.UseEntityEvent;
import com.sk89q.worldguard.bukkit.event.inventory.UseItemEvent;
import com.sk89q.worldguard.bukkit.internal.WGMetadata;
import com.sk89q.worldguard.bukkit.listener.debounce.BlockPistonExtendKey;
import com.sk89q.worldguard.bukkit.listener.debounce.BlockPistonRetractKey;
import com.sk89q.worldguard.bukkit.listener.debounce.EventDebounce;
@ -274,6 +273,8 @@ public void onEntityChangeBlock(EntityChangeBlockEvent event) {
if (trample) {
breakDelagate.setSilent(true);
breakDelagate.getRelevantFlags().add(Flags.TRAMPLE_BLOCKS);
} else if (fromType == Material.REDSTONE_ORE) {
breakDelagate.setSilent(true);
}
boolean denied;
if (!(denied = Events.fireToCancel(event, breakDelagate))) {