mirror of
https://github.com/encounter/dynmap.git
synced 2026-03-30 11:08:39 -07:00
Compare commits
3 Commits
2.1-alpha-1
...
2.1
| Author | SHA1 | Date | |
|---|---|---|---|
| f80b456b2c | |||
| 41d1de1fbb | |||
| 274a363a97 |
@@ -11,6 +11,7 @@ import java.util.List;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.dynmap.DynmapChunk;
|
||||
@@ -124,7 +125,10 @@ public class BukkitWorld extends DynmapWorld {
|
||||
@Override
|
||||
public int getLightLevel(int x, int y, int z) {
|
||||
if(world != null) {
|
||||
return world.getBlockAt(x, y, z).getLightLevel();
|
||||
if ((y >= 0) && (y < this.worldheight)) {
|
||||
return world.getBlockAt(x, y, z).getLightLevel();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
@@ -149,7 +153,12 @@ public class BukkitWorld extends DynmapWorld {
|
||||
@Override
|
||||
public int getSkyLightLevel(int x, int y, int z) {
|
||||
if(world != null) {
|
||||
return world.getBlockAt(x, y, z).getLightFromSky();
|
||||
if ((y >= 0) && (y < this.worldheight)) {
|
||||
return world.getBlockAt(x, y, z).getLightFromSky();
|
||||
}
|
||||
else {
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
|
||||
@@ -256,6 +256,11 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isServerThread() {
|
||||
return Bukkit.getServer().isPrimaryThread();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String stripChatColor(String s) {
|
||||
return ChatColor.stripColor(s);
|
||||
@@ -718,19 +723,24 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
Object[] biomelist = helper.getBiomeBaseList();
|
||||
/* Loop through list, skipping well known biomes */
|
||||
for(int i = 0; i < biomelist.length; i++) {
|
||||
if (!BiomeMap.byBiomeID(i).isDefault()) continue;
|
||||
Object bb = biomelist[i];
|
||||
if(bb != null) {
|
||||
String id = helper.getBiomeBaseIDString(bb);
|
||||
if(id == null) {
|
||||
id = "BIOME_" + i;
|
||||
}
|
||||
float tmp = helper.getBiomeBaseTemperature(bb);
|
||||
float hum = helper.getBiomeBaseHumidity(bb);
|
||||
|
||||
BiomeMap m = new BiomeMap(i, id, tmp, hum);
|
||||
Log.verboseinfo("Add custom biome [" + m.toString() + "] (" + i + ")");
|
||||
cnt++;
|
||||
BiomeMap bmap = BiomeMap.byBiomeID(i);
|
||||
if (bmap.isDefault()) {
|
||||
String id = helper.getBiomeBaseIDString(bb);
|
||||
if(id == null) {
|
||||
id = "BIOME_" + i;
|
||||
}
|
||||
BiomeMap m = new BiomeMap(i, id, tmp, hum);
|
||||
Log.verboseinfo("Add custom biome [" + m.toString() + "] (" + i + ")");
|
||||
cnt++;
|
||||
}
|
||||
else {
|
||||
bmap.setTemperature(tmp);
|
||||
bmap.setRainfall(hum);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cnt > 0) {
|
||||
|
||||
Reference in New Issue
Block a user