This commit is contained in:
Jesse Boyd 2018-05-17 15:11:44 +10:00
parent 9f9527d2e2
commit f479a70594
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -1017,7 +1017,7 @@ public class PlayerEvents extends PlotListener implements Listener {
} }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockSpread(BlockFormEvent event) { public void onBlockForm(BlockFormEvent event) {
Block block = event.getBlock(); Block block = event.getBlock();
Location location = BukkitUtil.getLocation(block.getLocation()); Location location = BukkitUtil.getLocation(block.getLocation());
if (location.isPlotRoad()) { if (location.isPlotRoad()) {
@ -1032,9 +1032,26 @@ public class PlayerEvents extends PlotListener implements Listener {
if (plot == null) { if (plot == null) {
return; return;
} }
switch (event.getNewState().getType()) {
case SNOW:
case SNOW_BLOCK:
if (Flags.SNOW_FORM.isFalse(plot)) { if (Flags.SNOW_FORM.isFalse(plot)) {
event.setCancelled(true); event.setCancelled(true);
} }
return;
case ICE:
case FROSTED_ICE:
case PACKED_ICE:
if (Flags.ICE_FORM.isFalse(plot)) {
event.setCancelled(true);
}
return;
case STONE:
case OBSIDIAN:
case COBBLESTONE:
// TODO event ?
return;
}
} }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)