Created
January 14, 2014 18:49
Revisions
-
KiwiLetsPlay created this gist
Jan 14, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ private static final boolean seesMoon(LivingEntity e) { final BlockIterator bi = new BlockIterator(e.getWorld(), e.getEyeLocation().toVector(), e.getLocation().getDirection(), 0.0, 0); boolean sees = true; while (bi.hasNext()) { final Block block = bi.next(); if (block.getType() != Material.AIR) { sees = false; if (block.getType() == Material.BEDROCK && !bi.hasNext()) {sees = true;} } } return sees; }