Skip to content

Commit

Permalink
fix logic for static removal
Browse files Browse the repository at this point in the history
  • Loading branch information
zifnab06 committed Jan 8, 2014
1 parent 184f406 commit 150e7ba
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/at/junction/glacier/GlacierListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,21 @@ public void onBlockBreak(BlockBreakEvent event) {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockFromTo(BlockFromToEvent event) {
//If flowing INTO a frozen block, remove block's static-icity
if (plugin.frozenBlocks.get(event.getToBlock().getLocation().getWorld().getName()).contains(plugin.hashLocation(event.getToBlock().getLocation()))){
plugin.delFrozen(event.getToBlock().getLocation());
}
if (plugin.frozenBlocks.get(event.getBlock().getWorld().getName()).contains(plugin.hashLocation(event.getBlock().getLocation()))) {
event.setCancelled(true);
return;
}

if (!plugin.canFlowInRegion(event.getBlock(), event.getToBlock())) {
event.setCancelled(true);
return;
}

//At this point things should be allowed to flow. If it flows into a static block, remove the static block.
if (plugin.frozenBlocks.get(event.getToBlock().getLocation().getWorld().getName()).contains(plugin.hashLocation(event.getToBlock().getLocation()))){
plugin.delFrozen(event.getToBlock().getLocation());
}

}

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
Expand Down

0 comments on commit 150e7ba

Please sign in to comment.