mirror of
https://github.com/encounter/dynmap.git
synced 2026-03-30 11:08:39 -07:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bae2a48a83 | |||
| 11b2123f14 | |||
| f93f37deea | |||
| cf5e2e00e6 | |||
| 121c1050ce |
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.dynmap</groupId>
|
||||
<artifactId>dynmap</artifactId>
|
||||
<version>0.36</version>
|
||||
<version>0.36.1</version>
|
||||
<name>dynmap</name>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -73,6 +73,7 @@ import org.dynmap.common.DynmapPlayer;
|
||||
import org.dynmap.common.DynmapServerInterface;
|
||||
import org.dynmap.common.DynmapListenerManager.EventType;
|
||||
import org.dynmap.markers.MarkerAPI;
|
||||
import org.getspout.spoutapi.plugin.SpoutPlugin;
|
||||
|
||||
public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
private DynmapCore core;
|
||||
@@ -1107,7 +1108,10 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
|
||||
private boolean detectSpout() {
|
||||
Plugin p = this.getServer().getPluginManager().getPlugin("Spout");
|
||||
return (p != null);
|
||||
if(p != null) {
|
||||
return p.isEnabled();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasSpout() {
|
||||
|
||||
@@ -590,11 +590,22 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
|
||||
private static class SpoutChunkSnapshot implements ChunkSnapshot {
|
||||
private ChunkSnapshot chunk;
|
||||
private short[] customids; /* (X << 11) | (Z << 7) | Y */
|
||||
private short[] customids;
|
||||
private final int shiftx;
|
||||
private final int shiftz;
|
||||
|
||||
SpoutChunkSnapshot(ChunkSnapshot chunk, short[] customids) {
|
||||
SpoutChunkSnapshot(ChunkSnapshot chunk, short[] customids, int height) {
|
||||
this.chunk = chunk;
|
||||
this.customids = customids.clone();
|
||||
int sx = 11;
|
||||
int sz = 7; /* 128 high values */
|
||||
while(height > 128) {
|
||||
sx++;
|
||||
sz++;
|
||||
height = (height >> 1);
|
||||
}
|
||||
shiftx = sx;
|
||||
shiftz = sz;
|
||||
}
|
||||
/* Need these for interface, but not used */
|
||||
public final int getX() { return chunk.getX(); }
|
||||
@@ -606,7 +617,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
public final long getCaptureFullTime() { return chunk.getCaptureFullTime(); }
|
||||
|
||||
public final int getBlockTypeId(int x, int y, int z) {
|
||||
int id = customids[(x << 11) | (z << 7) | y];
|
||||
int id = customids[(x << shiftx) | (z << shiftz) | y];
|
||||
if(id != 0) return id;
|
||||
return chunk.getBlockTypeId(x, y, z);
|
||||
}
|
||||
@@ -716,7 +727,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
SpoutChunk sc = (SpoutChunk)c;
|
||||
short[] custids = sc.getCustomBlockIds();
|
||||
if(custids != null) {
|
||||
return new SpoutChunkSnapshot(ss, custids);
|
||||
return new SpoutChunkSnapshot(ss, custids, c.getWorld().getMaxHeight());
|
||||
}
|
||||
}
|
||||
return ss;
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.List;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.dynmap.Log;
|
||||
import org.getspout.spoutapi.block.design.BlockDesign;
|
||||
import org.getspout.spoutapi.block.design.GenericBlockDesign;
|
||||
@@ -73,6 +74,7 @@ public class SpoutPluginBlocks {
|
||||
for(CustomBlock b : cb) {
|
||||
BlockDesign bd = b.getBlockDesign();
|
||||
String blkid = bd.getTexturePlugin() + "." + b.getName();
|
||||
blkid = blkid.replace(' ', '_');
|
||||
/* If not GenericCubiodBlockDesign, we don't handle it */
|
||||
if((bd instanceof GenericCuboidBlockDesign) == false) {
|
||||
Log.info("Block " + blkid + " not suppored - only cubiod blocks");
|
||||
@@ -166,7 +168,7 @@ public class SpoutPluginBlocks {
|
||||
blks.add(b);
|
||||
|
||||
sb.append("block:id=" + b.getCustomId() + ",data=*,bottom=" + txtidx[0] + ",west=" +txtidx[1] + ",south=" + txtidx[2] + ",east=" + txtidx[3] + ",north="+txtidx[4]+",top="+txtidx[5]);
|
||||
if(b.isOpaque() == false)
|
||||
if(b.getBlockId() == Material.GLASS.getId())
|
||||
sb.append(",transparency=TRANSPARENT");
|
||||
sb.append(",txtid=" + txfileid + "\n");
|
||||
cnt++;
|
||||
|
||||
Reference in New Issue
Block a user