Merge pull request #2028 from PhanaticD/patch-3

fix dispensers
This commit is contained in:
Jesse Boyd 2018-07-21 12:40:54 +10:00 committed by GitHub
commit aaa70888bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1322,13 +1322,14 @@ public class PlayerEvents extends PlotListener implements Listener {
case WATER_BUCKET:
case LAVA_BUCKET: {
if (event.getBlock().getType() == Material.DROPPER) return;
}
}
Location location = BukkitUtil.getLocation(event.getVelocity().toLocation(event.getBlock().getWorld()));
BlockFace targetFace = ((org.bukkit.material.Dispenser) event.getBlock().getState().getData()).getFacing();
Location location = BukkitUtil.getLocation(event.getBlock().getRelative(targetFace).getLocation());
if (location.isPlotRoad()) {
event.setCancelled(true);
}
}
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onStructureGrow(StructureGrowEvent event) {