Skip to content

Commit

Permalink
Fixed IllegalArgumentException in Snow.
Browse files Browse the repository at this point in the history
Signed-off-by: me4502 <mnmiller1@hotmail.com>
  • Loading branch information
me4502 committed Nov 9, 2012
1 parent aef7188 commit 35e6837
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mechanisms/src/main/java/com/sk89q/craftbook/mech/Snow.java
Expand Up @@ -180,10 +180,14 @@ public void incrementData(Block block) {
public void setBlockDataWithNotify(Block block, byte data) {

block.setData(data);
for (Player p : block.getWorld().getPlayers())
if (p.getLocation().distanceSquared(block.getLocation()) < plugin.getServer().getViewDistance() * 16 *
plugin.getServer().getViewDistance() * 16) {
p.sendBlockChange(block.getLocation(), block.getTypeId(), data);
for (Player p : block.getWorld().getPlayers()) {
try {
if (p.getLocation().distanceSquared(block.getLocation()) < plugin.getServer().getViewDistance() * 16 *
plugin.getServer().getViewDistance() * 16) {
p.sendBlockChange(block.getLocation(), block.getTypeId(), data);
}
}
catch(Exception e){}
}
}
}

0 comments on commit 35e6837

Please sign in to comment.