mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
fix dispensers
previously dispensers were not working at all, this change blocks lava and water and allows dispensers to function normally again on servers with plotsquared. if you were trying to block dispensers launching items into the road however that still is not blocked by this
This commit is contained in:
parent
ae1e58c0ac
commit
d673537026
1 changed files with 6 additions and 5 deletions
|
@ -1322,12 +1322,13 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||
case WATER_BUCKET:
|
||||
case LAVA_BUCKET: {
|
||||
if (event.getBlock().getType() == Material.DROPPER) return;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Location location = BukkitUtil.getLocation(event.getVelocity().toLocation(event.getBlock().getWorld()));
|
||||
if (location.isPlotRoad()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
|
|
Loading…
Reference in a new issue