Skip to content

Commit

Permalink
Update for 1.1-R3 - use native getLightFromSky and getLightFromBlocks…
Browse files Browse the repository at this point in the history
… APIs
  • Loading branch information
mikeprimm committed Feb 7, 2012
1 parent c2dfa28 commit 13974fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 92 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>[1.0.0-R1-SNAPSHOT,)</version>
<version>[1.1-R3-SNAPSHOT,)</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
79 changes: 0 additions & 79 deletions src/main/java/org/dynmap/mobs/BlockLightLevel.java

This file was deleted.

19 changes: 7 additions & 12 deletions src/main/java/org/dynmap/mobs/DynmapMobsPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.AnimalTamer;
import org.bukkit.entity.LivingEntity;
Expand Down Expand Up @@ -41,7 +42,6 @@ public class DynmapMobsPlugin extends JavaPlugin {
boolean tinyicons;
boolean nolabels;
boolean stop;
BlockLightLevel bll = new BlockLightLevel();

/* Mapping of mobs to icons */
private static class MobMapping {
Expand Down Expand Up @@ -140,22 +140,17 @@ else if(mobs[i].mobid.equals("wolf")) { /* Check for tamed wolf */
continue;

Location loc = le.getLocation();

Block blk = null;
if(hideifshadow < 15) {
if(loc.getBlock().getLightLevel() <= hideifshadow) {
blk = loc.getBlock();
if(blk.getLightLevel() <= hideifshadow) {
continue;
}
}
if(hideifundercover < 15) {
if(bll.isReady()) {
if(bll.getSkyLightLevel(loc.getBlock()) <= hideifundercover) {
continue;
}
}
else {
if(loc.getWorld().getHighestBlockYAt(loc) > loc.getBlockY()) {
continue;
}
if(blk == null) blk = loc.getBlock();
if(blk.getLightFromSky() <= hideifundercover) {
continue;
}
}

Expand Down

0 comments on commit 13974fd

Please sign in to comment.