mirror of
https://github.com/encounter/dynmap.git
synced 2026-03-30 11:08:39 -07:00
Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7f0218d0f | |||
| 3fd4ac7373 | |||
| ac0f756fae | |||
| 551f35f3f9 | |||
| ec9ebf2dbb | |||
| 3702918a6f | |||
| 8085221087 | |||
| 7de967f1c2 | |||
| f6e127b7f0 | |||
| 22d1923ad5 | |||
| d8d3061696 | |||
| 14da080d52 | |||
| 10ce166b54 | |||
| cb9f964348 | |||
| 9850a03945 | |||
| 8abfae3d79 | |||
| f486ad75f1 | |||
| 54b3fb429c | |||
| 86547f8d78 | |||
| 8ec80937e3 | |||
| 0e5e602a90 | |||
| 3239d539c0 | |||
| 05bd2544fd | |||
| 252da2a5c6 | |||
| 5d83ebf8aa | |||
| 026cc72233 | |||
| 0d2cceea4b | |||
| a1dfae7f79 | |||
| d6eb822b26 | |||
| d4f161ca99 | |||
| 376ec447ed | |||
| 926d2a3dbc | |||
| eeffa4f98d | |||
| 8350727a73 | |||
| 3b79890166 | |||
| 17174c177c | |||
| 07e7d53a93 | |||
| 76863aeb71 | |||
| f7d2dac826 | |||
| 3cb7ba342c | |||
| d2ab466dc0 | |||
| d03ed7a461 | |||
| c8469d7aba | |||
| e7c92096b2 | |||
| 0c9d397144 | |||
| b4a3b61c11 | |||
| 564c38b44a | |||
| 664e7da659 | |||
| 9046212a47 | |||
| b6ee68c9b0 | |||
| 7854568d88 | |||
| f1c9417237 | |||
| 336f8302c4 | |||
| d8ccc26109 | |||
| d396046249 | |||
| 1793d910d4 | |||
| f0f881d126 | |||
| 5482ddaa89 | |||
| 47455eb912 | |||
| 32a1c20fd0 | |||
| b85c38e3a7 | |||
| 5bc4de6a8b | |||
| 2d20fd11f7 | |||
| 6a4bb59d60 | |||
| ab45edb82c | |||
| 4f6bc05180 | |||
| 076681e188 | |||
| b7abfe7c06 | |||
| 3a88ac66a6 | |||
| d3b9367794 | |||
| 666840fc8b | |||
| 62f4c12147 | |||
| 4b3f2280b6 | |||
| df55606023 | |||
| 6fc5fddd44 | |||
| dea285c160 | |||
| 204641a4b0 |
@@ -1,11 +1,14 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.dynmap</groupId>
|
||||
<groupId>us.dynmap</groupId>
|
||||
<artifactId>dynmap</artifactId>
|
||||
<name>dynmap</name>
|
||||
<properties>
|
||||
<timestamp>${maven.build.timestamp}</timestamp>
|
||||
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<BUILD_NUMBER>Dev</BUILD_NUMBER>
|
||||
<BUILD_NUMBER>Dev${timestamp}</BUILD_NUMBER>
|
||||
</properties>
|
||||
<url>http://github.com/webbukkit/dynmap/</url>
|
||||
<issueManagement>
|
||||
@@ -41,7 +44,7 @@
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
@@ -55,14 +58,41 @@
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>org.dynmap:dynmap-api:jar:*</include>
|
||||
<include>org.dynmap:DynmapCore:jar:*</include>
|
||||
<include>us.dynmap:dynmap-api:jar:*</include>
|
||||
<include>us.dynmap:DynmapCore:jar:*</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.9.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
@@ -92,22 +122,18 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.3.2-R3.0</version>
|
||||
<version>1.4.7-R1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dynmap</groupId>
|
||||
<groupId>us.dynmap</groupId>
|
||||
<artifactId>dynmap-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dynmap</groupId>
|
||||
<groupId>us.dynmap</groupId>
|
||||
<artifactId>DynmapCore</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.getspout</groupId>
|
||||
@@ -136,5 +162,5 @@
|
||||
<version>2.10.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<version>1.7</version>
|
||||
<version>2.0.0</version>
|
||||
</project>
|
||||
|
||||
@@ -5,11 +5,13 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.ChunkSnapshot;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.dynmap.Log;
|
||||
|
||||
/**
|
||||
@@ -21,6 +23,7 @@ public abstract class BukkitVersionHelper {
|
||||
|
||||
public static final BukkitVersionHelper getHelper() {
|
||||
if(helper == null) {
|
||||
Log.info("version=" + Bukkit.getServer().getVersion());
|
||||
if(Bukkit.getServer().getVersion().contains("MCPC")) {
|
||||
Log.severe("*********************************************************************************");
|
||||
Log.severe("* MCPC-Plus is no longer supported via the Bukkit version of Dynmap. *");
|
||||
@@ -35,6 +38,10 @@ public abstract class BukkitVersionHelper {
|
||||
Log.severe("* Add the DynmapCBBridge plugin to enable support for Dynmap-compatible plugins *");
|
||||
Log.severe("*********************************************************************************");
|
||||
}
|
||||
else if(Bukkit.getServer().getClass().getName().contains("GlowServer")) {
|
||||
Log.info("Loading Glowstone support");
|
||||
helper = new BukkitVersionHelperGlowstone();
|
||||
}
|
||||
else {
|
||||
helper = new BukkitVersionHelperCB();
|
||||
}
|
||||
@@ -64,14 +71,10 @@ public abstract class BukkitVersionHelper {
|
||||
* Get ID from biomebase
|
||||
*/
|
||||
public abstract int getBiomeBaseID(Object bb);
|
||||
/**
|
||||
* Get net.minecraft.server.world for given world
|
||||
*/
|
||||
public abstract Object getNMSWorld(World w);
|
||||
/**
|
||||
* Get unload queue for given NMS world
|
||||
*/
|
||||
public abstract Object getUnloadQueue(Object nmsworld);
|
||||
public abstract Object getUnloadQueue(World world);
|
||||
/**
|
||||
* For testing unload queue for presence of givne chunk
|
||||
*/
|
||||
@@ -83,11 +86,15 @@ public abstract class BukkitVersionHelper {
|
||||
/**
|
||||
* Test if normal chunk snapshot
|
||||
*/
|
||||
public abstract boolean isCraftChunkSnapshot(ChunkSnapshot css);
|
||||
// public abstract boolean isCraftChunkSnapshot(ChunkSnapshot css);
|
||||
/**
|
||||
* Remove entities from given chunk
|
||||
*/
|
||||
public abstract void removeEntitiesFromChunk(Chunk c);
|
||||
/**
|
||||
* Get inhabited ticks count from chunk
|
||||
*/
|
||||
public abstract long getInhabitedTicks(Chunk c);
|
||||
/**
|
||||
* Get tile entities map from chunk
|
||||
*/
|
||||
@@ -128,4 +135,12 @@ public abstract class BukkitVersionHelper {
|
||||
* Get block material index list
|
||||
*/
|
||||
public abstract int[] getBlockMaterialMap();
|
||||
/**
|
||||
* Get list of online players
|
||||
*/
|
||||
public abstract Player[] getOnlinePlayers();
|
||||
/**
|
||||
* Get player health
|
||||
*/
|
||||
public abstract int getHealth(Player p);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.dynmap.bukkit;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
@@ -21,6 +22,7 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
||||
private Field blockbyid;
|
||||
private Field blockname;
|
||||
private Field material;
|
||||
private Method blockbyidfunc; // 1.7+ method for getting block by id
|
||||
|
||||
BukkitVersionHelperCB() {
|
||||
}
|
||||
@@ -43,17 +45,20 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
||||
nmsblock = getNMSClass("net.minecraft.server.Block");
|
||||
nmsblockarray = getNMSClass("[Lnet.minecraft.server.Block;");
|
||||
nmsmaterial = getNMSClass("net.minecraft.server.Material");
|
||||
blockbyid = getField(nmsblock, new String[] { "byId" }, nmsblockarray);
|
||||
blockname = getPrivateField(nmsblock, new String[] { "name" }, String.class);
|
||||
material = getField(nmsblock, new String[] { "material" }, nmsmaterial);
|
||||
blockbyid = getFieldNoFail(nmsblock, new String[] { "byId" }, nmsblockarray);
|
||||
if (blockbyid == null) {
|
||||
blockbyidfunc = getMethod(nmsblock, new String[] { "getById", "e" }, new Class[] { int.class });
|
||||
}
|
||||
blockname = getPrivateField(nmsblock, new String[] { "name", "b" }, String.class);
|
||||
material = getPrivateField(nmsblock, new String[] { "material" }, nmsmaterial);
|
||||
|
||||
/* Set up biomebase fields */
|
||||
biomebase = getNMSClass("net.minecraft.server.BiomeBase");
|
||||
biomebasearray = getNMSClass("[Lnet.minecraft.server.BiomeBase;");
|
||||
biomebaselist = getField(biomebase, new String[] { "biomes" }, biomebasearray);
|
||||
biomebaselist = getPrivateField(biomebase, new String[] { "biomes" }, biomebasearray);
|
||||
biomebasetemp = getField(biomebase, new String[] { "temperature", "F" }, float.class);
|
||||
biomebasehumi = getField(biomebase, new String[] { "humidity", "G" }, float.class);
|
||||
biomebaseidstring = getField(biomebase, new String[] { "y" }, String.class);
|
||||
biomebaseidstring = getField(biomebase, new String[] { "y", "af" }, String.class);
|
||||
biomebaseid = getField(biomebase, new String[] { "id" }, int.class);
|
||||
/* n.m.s.World */
|
||||
nmsworld = getNMSClass("net.minecraft.server.WorldServer");
|
||||
@@ -76,7 +81,11 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
||||
/** n.m.s.Chunk */
|
||||
nmschunk = getNMSClass("net.minecraft.server.Chunk");
|
||||
nmsc_removeentities = getMethod(nmschunk, new String[] { "removeEntities" }, new Class[0]);
|
||||
nmsc_tileentities = getField(nmschunk, new String[] { "tileEntities" }, Map.class);
|
||||
nmsc_tileentities = getField(nmschunk, new String[] { "tileEntities" }, Map.class);
|
||||
nmsc_inhabitedticks = getFieldNoFail(nmschunk, new String[] { "s", "q" }, long.class);
|
||||
if (nmsc_inhabitedticks == null) {
|
||||
Log.info("inhabitedTicks field not found - inhabited shader not functional");
|
||||
}
|
||||
/** nbt classes */
|
||||
nbttagcompound = getNMSClass("net.minecraft.server.NBTTagCompound");
|
||||
nbttagbyte = getNMSClass("net.minecraft.server.NBTTagByte");
|
||||
@@ -89,15 +98,15 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
||||
nbttagstring = getNMSClass("net.minecraft.server.NBTTagString");
|
||||
nbttagintarray = getNMSClass("net.minecraft.server.NBTTagIntArray");
|
||||
compound_get = getMethod(nbttagcompound, new String[] { "get" }, new Class[] { String.class });
|
||||
nbttagbyte_val = getField(nbttagbyte, new String[] { "data" }, byte.class);
|
||||
nbttagshort_val = getField(nbttagshort, new String[] { "data" }, short.class);
|
||||
nbttagint_val = getField(nbttagint, new String[] { "data" }, int.class);
|
||||
nbttaglong_val = getField(nbttaglong, new String[] { "data" }, long.class);
|
||||
nbttagfloat_val = getField(nbttagfloat, new String[] { "data" }, float.class);
|
||||
nbttagdouble_val = getField(nbttagdouble, new String[] { "data" }, double.class);
|
||||
nbttagbytearray_val = getField(nbttagbytearray, new String[] { "data" }, byte[].class);
|
||||
nbttagstring_val = getField(nbttagstring, new String[] { "data" }, String.class);
|
||||
nbttagintarray_val = getField(nbttagintarray, new String[] { "data" }, int[].class);
|
||||
nbttagbyte_val = getPrivateField(nbttagbyte, new String[] { "data" }, byte.class);
|
||||
nbttagshort_val = getPrivateField(nbttagshort, new String[] { "data" }, short.class);
|
||||
nbttagint_val = getPrivateField(nbttagint, new String[] { "data" }, int.class);
|
||||
nbttaglong_val = getPrivateField(nbttaglong, new String[] { "data" }, long.class);
|
||||
nbttagfloat_val = getPrivateField(nbttagfloat, new String[] { "data" }, float.class);
|
||||
nbttagdouble_val = getPrivateField(nbttagdouble, new String[] { "data" }, double.class);
|
||||
nbttagbytearray_val = getPrivateField(nbttagbytearray, new String[] { "data" }, byte[].class);
|
||||
nbttagstring_val = getPrivateField(nbttagstring, new String[] { "data" }, String.class);
|
||||
nbttagintarray_val = getPrivateField(nbttagintarray, new String[] { "data" }, int[].class);
|
||||
|
||||
/** Tile entity */
|
||||
nms_tileentity = getNMSClass("net.minecraft.server.TileEntity");
|
||||
@@ -117,16 +126,27 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
||||
@Override
|
||||
public String[] getBlockShortNames() {
|
||||
try {
|
||||
Object[] byid = (Object[])blockbyid.get(nmsblock);
|
||||
String[] names = new String[byid.length];
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
if (byid[i] != null) {
|
||||
names[i] = (String)blockname.get(byid[i]);
|
||||
String[] names = new String[4096];
|
||||
if (blockbyid != null) {
|
||||
Object[] byid = (Object[])blockbyid.get(nmsblock);
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
if (byid[i] != null) {
|
||||
names[i] = (String)blockname.get(byid[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
Object blk = blockbyidfunc.invoke(nmsblock, i);
|
||||
if (blk != null) {
|
||||
names[i] = (String)blockname.get(blk);
|
||||
}
|
||||
}
|
||||
}
|
||||
return names;
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
} catch (InvocationTargetException e) {
|
||||
}
|
||||
return new String[0];
|
||||
}
|
||||
@@ -153,27 +173,49 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
||||
*/
|
||||
public int[] getBlockMaterialMap() {
|
||||
try {
|
||||
Object[] byid = (Object[])blockbyid.get(nmsblock);
|
||||
int[] map = new int[byid.length];
|
||||
ArrayList<Object> mats = new ArrayList<Object>();
|
||||
for (int i = 0; i < map.length; i++) {
|
||||
if (byid[i] != null) {
|
||||
Object mat = (Object)material.get(byid[i]);
|
||||
if (mat != null) {
|
||||
map[i] = mats.indexOf(mat);
|
||||
if (map[i] < 0) {
|
||||
map[i] = mats.size();
|
||||
mats.add(mat);
|
||||
int[] map = new int[4096];
|
||||
if (blockbyid != null) {
|
||||
Object[] byid = (Object[])blockbyid.get(nmsblock);
|
||||
ArrayList<Object> mats = new ArrayList<Object>();
|
||||
for (int i = 0; i < map.length; i++) {
|
||||
if (byid[i] != null) {
|
||||
Object mat = (Object)material.get(byid[i]);
|
||||
if (mat != null) {
|
||||
map[i] = mats.indexOf(mat);
|
||||
if (map[i] < 0) {
|
||||
map[i] = mats.size();
|
||||
mats.add(mat);
|
||||
}
|
||||
}
|
||||
else {
|
||||
map[i] = -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
map[i] = -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ArrayList<Object> mats = new ArrayList<Object>();
|
||||
for (int i = 0; i < map.length; i++) {
|
||||
Object blk = blockbyidfunc.invoke(nmsblock, i);
|
||||
if (blk != null) {
|
||||
Object mat = (Object)material.get(blk);
|
||||
if (mat != null) {
|
||||
map[i] = mats.indexOf(mat);
|
||||
if (map[i] < 0) {
|
||||
map[i] = mats.size();
|
||||
mats.add(mat);
|
||||
}
|
||||
}
|
||||
else {
|
||||
map[i] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
} catch (InvocationTargetException e) {
|
||||
}
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@@ -3,13 +3,17 @@ package org.dynmap.bukkit;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.ChunkSnapshot;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.dynmap.Log;
|
||||
|
||||
/**
|
||||
@@ -51,6 +55,7 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
protected Class<?> nmschunk;
|
||||
protected Method nmsc_removeentities;
|
||||
protected Field nmsc_tileentities;
|
||||
protected Field nmsc_inhabitedticks;
|
||||
/** nbt classes */
|
||||
protected Class<?> nbttagcompound;
|
||||
protected Class<?> nbttagbyte;
|
||||
@@ -78,6 +83,10 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
protected Field nmst_x;
|
||||
protected Field nmst_y;
|
||||
protected Field nmst_z;
|
||||
/** Server */
|
||||
protected Method server_getonlineplayers;
|
||||
/** Player */
|
||||
protected Method player_gethealth;
|
||||
|
||||
BukkitVersionHelperGeneric() {
|
||||
failed = false;
|
||||
@@ -98,6 +107,12 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
/* CraftChunk */
|
||||
craftchunk = getOBCClass("org.bukkit.craftbukkit.CraftChunk");
|
||||
cc_gethandle = getMethod(craftchunk, new String[] { "getHandle" }, new Class[0]);
|
||||
|
||||
/** Server */
|
||||
server_getonlineplayers = getMethod(Server.class, new String[] { "getOnlinePlayers" }, new Class[0]);
|
||||
/** Player */
|
||||
player_gethealth = getMethod(Player.class, new String[] { "getHealth" }, new Class[0]);
|
||||
|
||||
/* Get NMS classes and fields */
|
||||
if(!failed)
|
||||
loadNMS();
|
||||
@@ -254,13 +269,13 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
}
|
||||
|
||||
/* Get net.minecraft.server.world for given world */
|
||||
public Object getNMSWorld(World w) {
|
||||
protected Object getNMSWorld(World w) {
|
||||
return callMethod(w, cw_gethandle, nullargs, null);
|
||||
}
|
||||
|
||||
/* Get unload queue for given NMS world */
|
||||
public Object getUnloadQueue(Object nmsworld) {
|
||||
Object cps = getFieldValue(nmsworld, nmsw_chunkproviderserver, null); // Get chunkproviderserver
|
||||
public Object getUnloadQueue(World world) {
|
||||
Object cps = getFieldValue(getNMSWorld(world), nmsw_chunkproviderserver, null); // Get chunkproviderserver
|
||||
if(cps != null) {
|
||||
return getFieldValue(cps, cps_unloadqueue, null);
|
||||
}
|
||||
@@ -278,12 +293,12 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
public Object[] getBiomeBaseFromSnapshot(ChunkSnapshot css) {
|
||||
return (Object[])getFieldValue(css, ccss_biome, null);
|
||||
}
|
||||
public boolean isCraftChunkSnapshot(ChunkSnapshot css) {
|
||||
if(craftchunksnapshot != null) {
|
||||
return craftchunksnapshot.isAssignableFrom(css.getClass());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// public boolean isCraftChunkSnapshot(ChunkSnapshot css) {
|
||||
// if(craftchunksnapshot != null) {
|
||||
// return craftchunksnapshot.isAssignableFrom(css.getClass());
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
/** Remove entities from given chunk */
|
||||
public void removeEntitiesFromChunk(Chunk c) {
|
||||
Object omsc = callMethod(c, cc_gethandle, nullargs, null);
|
||||
@@ -291,6 +306,21 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
callMethod(omsc, nmsc_removeentities, nullargs, null);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get inhabited ticks count from chunk
|
||||
*/
|
||||
private static final Long zero = new Long(0);
|
||||
public long getInhabitedTicks(Chunk c) {
|
||||
if (nmsc_inhabitedticks == null) {
|
||||
return 0;
|
||||
}
|
||||
Object omsc = callMethod(c, cc_gethandle, nullargs, null);
|
||||
if(omsc != null) {
|
||||
return (Long)getFieldValue(omsc, nmsc_inhabitedticks, zero);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Get tile entities map from chunk */
|
||||
public Map getTileEntitiesForChunk(Chunk c) {
|
||||
Object omsc = callMethod(c, cc_gethandle, nullargs, null);
|
||||
@@ -369,4 +399,31 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Get list of online players
|
||||
*/
|
||||
public Player[] getOnlinePlayers() {
|
||||
Object players = callMethod(Bukkit.getServer(), server_getonlineplayers, nullargs, null);
|
||||
if (players instanceof Player[]) { /* Pre 1.7.10 */
|
||||
return (Player[]) players;
|
||||
}
|
||||
else {
|
||||
@SuppressWarnings("unchecked")
|
||||
Collection<? extends Player> p = (Collection<? extends Player>) players;
|
||||
return p.toArray(new Player[0]);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get player health
|
||||
*/
|
||||
public int getHealth(Player p) {
|
||||
Object health = callMethod(p, player_gethealth, nullargs, null);
|
||||
if (health instanceof Integer) {
|
||||
return (Integer) health;
|
||||
}
|
||||
else {
|
||||
return ((Double) health).intValue();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,451 @@
|
||||
package org.dynmap.bukkit;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.ChunkSnapshot;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class BukkitVersionHelperGlowstone extends BukkitVersionHelper {
|
||||
private Method rawbiome;
|
||||
private Method server_getonlineplayers;
|
||||
|
||||
public BukkitVersionHelperGlowstone() {
|
||||
try {
|
||||
Class<?> c = Class.forName("net.glowstone.GlowChunkSnapshot");
|
||||
rawbiome = c.getMethod("getRawBiomes", new Class[0]);
|
||||
|
||||
/** Server */
|
||||
server_getonlineplayers = Server.class.getMethod("getOnlinePlayers", new Class[0]);
|
||||
} catch (SecurityException e) {
|
||||
} catch (NoSuchMethodException e) {
|
||||
} catch (ClassNotFoundException e) {
|
||||
}
|
||||
if ((rawbiome == null) && (server_getonlineplayers == null)) {
|
||||
throw new IllegalArgumentException("Error initializing dynmap - Glowstone version incompatible!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getBiomeBaseList() {
|
||||
return new Object[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBiomeBaseTemperature(Object bb) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBiomeBaseHumidity(Object bb) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBiomeBaseIDString(Object bb) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBiomeBaseID(Object bb) {
|
||||
if (bb != null)
|
||||
return (Integer) bb;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getUnloadQueue(World world) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInUnloadQueue(Object unloadqueue, int x, int z) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getBiomeBaseFromSnapshot(ChunkSnapshot css) {
|
||||
Integer b[] = new Integer[256];
|
||||
byte[] rb = null;
|
||||
try {
|
||||
rb = (byte[]) rawbiome.invoke(css, new Object[0]);
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
} catch (InvocationTargetException e) {
|
||||
}
|
||||
if (rb != null) {
|
||||
for (int i = 0; i < 256; i++) {
|
||||
b[i] = Integer.valueOf(255 & (int)rb[i]);
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeEntitiesFromChunk(Chunk c) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getInhabitedTicks(Chunk c) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map getTileEntitiesForChunk(Chunk c) {
|
||||
// TODO Auto-generated method stub
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTileEntityX(Object te) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTileEntityY(Object te) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTileEntityZ(Object te) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object readTileEntityNBT(Object te) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getFieldValue(Object nbt, String field) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unloadChunkNoSave(World w, Chunk c, int cx, int cz) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBlockShortNames() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
private static final String[] bnames = {
|
||||
"Ocean",
|
||||
"Plains",
|
||||
"Desert",
|
||||
"Extreme Hills",
|
||||
"Forest",
|
||||
"Taiga",
|
||||
"Swampland",
|
||||
"River",
|
||||
"Hell",
|
||||
"Sky",
|
||||
"FrozenOcean",
|
||||
"FrozenRiver",
|
||||
"Ice Plains",
|
||||
"Ice Mountains",
|
||||
"MushroomIsland",
|
||||
"MushroomIslandShore",
|
||||
"Beach",
|
||||
"DesertHills",
|
||||
"ForestHills",
|
||||
"TaigaHills",
|
||||
"Extreme Hills Edge",
|
||||
"Jungle",
|
||||
"JungleHills",
|
||||
"JungleEdge",
|
||||
"Deep Ocean",
|
||||
"Stone Beach",
|
||||
"Cold Beach",
|
||||
"Birch Forest",
|
||||
"Birch Forest Hills",
|
||||
"Roofed Forest",
|
||||
"Cold Taiga",
|
||||
"Cold Taiga Hills",
|
||||
"Mega Taiga",
|
||||
"Mega Taiga Hills",
|
||||
"Extreme Hills+",
|
||||
"Savanna",
|
||||
"Savanna Plateau",
|
||||
"Mesa",
|
||||
"Mesa Plateau F",
|
||||
"Mesa Plateau",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
"Sunflower Plains",
|
||||
"Desert M",
|
||||
"Extreme Hills M",
|
||||
"Flower Forest",
|
||||
"Taiga M",
|
||||
"Swampland M",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
"Ice Plains Spikes",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
"Jungle M",
|
||||
null,
|
||||
"JungleEdge M",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
"Birch Forest M",
|
||||
"Birch Forest Hills M",
|
||||
"Roofed Forest M",
|
||||
"Cold Taiga M",
|
||||
null,
|
||||
"Mega Spruce Taiga",
|
||||
"Mega Spruce Taiga",
|
||||
"Extreme Hills+ M",
|
||||
"Savanna M",
|
||||
"Savanna Plateau M",
|
||||
"Mesa (Bryce)",
|
||||
"Mesa Plateau F M",
|
||||
"Mesa Plateau M",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
};
|
||||
|
||||
@Override
|
||||
public String[] getBiomeNames() {
|
||||
return bnames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getBlockMaterialMap() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of online players
|
||||
*/
|
||||
public Player[] getOnlinePlayers() {
|
||||
Object players;
|
||||
try {
|
||||
players = server_getonlineplayers.invoke(Bukkit.getServer(), new Object[0]);
|
||||
if (players instanceof Player[]) { /* Pre 1.7.10 */
|
||||
return (Player[]) players;
|
||||
}
|
||||
else {
|
||||
@SuppressWarnings("unchecked")
|
||||
Collection<? extends Player> p = (Collection<? extends Player>) players;
|
||||
return p.toArray(new Player[0]);
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
} catch (InvocationTargetException e) {
|
||||
}
|
||||
return new Player[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHealth(Player p) {
|
||||
return p.getHealth();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,8 +2,13 @@ package org.dynmap.bukkit;
|
||||
/**
|
||||
* Bukkit specific implementation of DynmapWorld
|
||||
*/
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.permissions.Permission;
|
||||
@@ -12,6 +17,7 @@ import org.dynmap.DynmapChunk;
|
||||
import org.dynmap.DynmapLocation;
|
||||
import org.dynmap.DynmapWorld;
|
||||
import org.dynmap.utils.MapChunkCache;
|
||||
import org.dynmap.utils.TileFlags;
|
||||
|
||||
public class BukkitWorld extends DynmapWorld {
|
||||
private World world;
|
||||
@@ -30,6 +36,20 @@ public class BukkitWorld extends DynmapWorld {
|
||||
this.env = env;
|
||||
skylight = (env == World.Environment.NORMAL);
|
||||
new Permission("dynmap.world." + getName(), "Dynmap access for world " + getName(), PermissionDefault.OP);
|
||||
// Generate non-default environment lighting table
|
||||
switch (env) {
|
||||
case NETHER:
|
||||
{
|
||||
float f = 0.1F;
|
||||
for (int i = 0; i <= 15; ++i) {
|
||||
float f1 = 1.0F - (float)i / 15.0F;
|
||||
this.setBrightnessTableEntry(i, (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set world online
|
||||
@@ -160,4 +180,58 @@ public class BukkitWorld extends DynmapWorld {
|
||||
public World getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
// Return false if unimplemented
|
||||
@Override
|
||||
public int getChunkMap(TileFlags map) {
|
||||
map.clear();
|
||||
if (world == null) return -1;
|
||||
int cnt = 0;
|
||||
// Mark loaded chunks
|
||||
for(Chunk c : world.getLoadedChunks()) {
|
||||
map.setFlag(c.getX(), c.getZ(), true);
|
||||
cnt++;
|
||||
}
|
||||
File f = world.getWorldFolder();
|
||||
File regiondir = new File(f, "region");
|
||||
File[] lst = regiondir.listFiles();
|
||||
if(lst != null) {
|
||||
byte[] hdr = new byte[4096];
|
||||
for(File rf : lst) {
|
||||
if(!rf.getName().endsWith(".mca")) {
|
||||
continue;
|
||||
}
|
||||
String[] parts = rf.getName().split("\\.");
|
||||
if((!parts[0].equals("r")) && (parts.length != 4)) continue;
|
||||
|
||||
RandomAccessFile rfile = null;
|
||||
int x = 0, z = 0;
|
||||
try {
|
||||
x = Integer.parseInt(parts[1]);
|
||||
z = Integer.parseInt(parts[2]);
|
||||
rfile = new RandomAccessFile(rf, "r");
|
||||
rfile.read(hdr, 0, hdr.length);
|
||||
} catch (IOException iox) {
|
||||
Arrays.fill(hdr, (byte)0);
|
||||
} catch (NumberFormatException nfx) {
|
||||
Arrays.fill(hdr, (byte)0);
|
||||
} finally {
|
||||
if(rfile != null) {
|
||||
try { rfile.close(); } catch (IOException iox) {}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
int v = hdr[4*i] | hdr[4*i + 1] | hdr[4*i + 2] | hdr[4*i + 3];
|
||||
if (v == 0) continue;
|
||||
int xx = (x << 5) | (i & 0x1F);
|
||||
int zz = (z << 5) | ((i >> 5) & 0x1F);
|
||||
if (!map.setFlag(xx, zz, true)) {
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -56,9 +56,9 @@ import java.util.logging.Level;
|
||||
* <p> The metrics class obtains data about a plugin and submits statistics about it to the metrics backend. </p> <p>
|
||||
* Public methods provided by this class: </p>
|
||||
* <code>
|
||||
* Graph createGraph(String name); <br/>
|
||||
* void addCustomData(BukkitMetrics.Plotter plotter); <br/>
|
||||
* void start(); <br/>
|
||||
* Graph createGraph(String name); <br>
|
||||
* void addCustomData(BukkitMetrics.Plotter plotter); <br>
|
||||
* void start(); <br>
|
||||
* </code>
|
||||
*/
|
||||
public class Metrics {
|
||||
@@ -121,6 +121,8 @@ public class Metrics {
|
||||
*/
|
||||
private volatile BukkitTask task = null;
|
||||
|
||||
private BukkitVersionHelper helper;
|
||||
|
||||
public Metrics(final Plugin plugin) throws IOException {
|
||||
if (plugin == null) {
|
||||
throw new IllegalArgumentException("Plugin cannot be null");
|
||||
@@ -146,6 +148,8 @@ public class Metrics {
|
||||
// Load the guid then
|
||||
guid = configuration.getString("guid");
|
||||
debug = configuration.getBoolean("debug", false);
|
||||
|
||||
helper = BukkitVersionHelper.getHelper();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -359,7 +363,7 @@ public class Metrics {
|
||||
boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
|
||||
String pluginVersion = description.getVersion();
|
||||
String serverVersion = Bukkit.getVersion();
|
||||
int playersOnline = Bukkit.getServer().getOnlinePlayers().length;
|
||||
int playersOnline = helper.getOnlinePlayers().length;
|
||||
|
||||
// END server software specific section -- all code below does not use any code outside of this class / Java
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.getspout.spoutapi.block.SpoutChunk;
|
||||
/**
|
||||
* Container for managing chunks - dependent upon using chunk snapshots, since rendering is off server thread
|
||||
*/
|
||||
public class NewMapChunkCache implements MapChunkCache {
|
||||
public class NewMapChunkCache extends MapChunkCache {
|
||||
private static boolean init = false;
|
||||
private static boolean use_spout = false;
|
||||
|
||||
@@ -49,12 +49,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
private byte[][] sameneighborbiomecnt;
|
||||
private BiomeMap[][] biomemap;
|
||||
private boolean[][] isSectionNotEmpty; /* Indexed by snapshot index, then by section index */
|
||||
|
||||
private int chunks_read; /* Number of chunks actually loaded */
|
||||
private int chunks_attempted; /* Number of chunks attempted to load */
|
||||
private long total_loadtime; /* Total time loading chunks, in nanoseconds */
|
||||
|
||||
private long exceptions;
|
||||
private long[] inhabitedTicks; /* Index = (x-x_min) + ((z-z_min)*x_dim) */
|
||||
|
||||
private static BukkitVersionHelper helper = BukkitVersionHelper.getHelper();
|
||||
|
||||
@@ -210,7 +205,6 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
try {
|
||||
return biomemap[x - x_base][z - z_base];
|
||||
} catch (Exception ex) {
|
||||
exceptions++;
|
||||
return BiomeMap.NULL;
|
||||
}
|
||||
}
|
||||
@@ -240,7 +234,6 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
mult = ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
}
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
mult = 0xFFFFFF;
|
||||
}
|
||||
return mult;
|
||||
@@ -271,7 +264,6 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
mult = ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
}
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
mult = 0xFFFFFF;
|
||||
}
|
||||
return mult;
|
||||
@@ -313,7 +305,6 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
mult = ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
}
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
mult = 0xFFFFFF;
|
||||
}
|
||||
return mult;
|
||||
@@ -341,7 +332,6 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
}
|
||||
return ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
}
|
||||
@@ -371,7 +361,6 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
mult = ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
}
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
mult = 0xFFFFFF;
|
||||
}
|
||||
return mult;
|
||||
@@ -593,6 +582,14 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
int yoff, int zoff) {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public long getInhabitedTicks() {
|
||||
try {
|
||||
return inhabitedTicks[chunkindex];
|
||||
} catch (Exception x) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class OurEndMapIterator extends OurMapIterator {
|
||||
@@ -779,6 +776,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
|
||||
snapcnt = x_dim * (z_max-z_min+1);
|
||||
snaparray = new ChunkSnapshot[snapcnt];
|
||||
inhabitedTicks = new long[snapcnt];
|
||||
snaptile = new DynIntHashMap[snapcnt];
|
||||
isSectionNotEmpty = new boolean[snapcnt][];
|
||||
}
|
||||
@@ -797,8 +795,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
public int loadChunks(int max_to_load) {
|
||||
if(dw.isLoaded() == false)
|
||||
return 0;
|
||||
long t0 = System.nanoTime();
|
||||
Object queue = helper.getUnloadQueue(helper.getNMSWorld(w));
|
||||
Object queue = helper.getUnloadQueue(w);
|
||||
|
||||
int cnt = 0;
|
||||
if(iterator == null)
|
||||
@@ -808,6 +805,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
//boolean isnormral = w.getEnvironment() == Environment.NORMAL;
|
||||
// Load the required chunks.
|
||||
while((cnt < max_to_load) && iterator.hasNext()) {
|
||||
long startTime = System.nanoTime();
|
||||
DynmapChunk chunk = iterator.next();
|
||||
boolean vis = true;
|
||||
if(visible_limits != null) {
|
||||
@@ -829,10 +827,12 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
}
|
||||
/* Check if cached chunk snapshot found */
|
||||
ChunkSnapshot ss = null;
|
||||
long inhabited_ticks = 0;
|
||||
DynIntHashMap tileData = null;
|
||||
SnapshotRec ssr = DynmapPlugin.plugin.sscache.getSnapshot(dw.getName(), chunk.x, chunk.z, blockdata, biome, biomeraw, highesty);
|
||||
if(ssr != null) {
|
||||
ss = ssr.ss;
|
||||
inhabited_ticks = ssr.inhabitedTicks;
|
||||
if(!vis) {
|
||||
if(hidestyle == HiddenChunkStyle.FILL_STONE_PLAIN)
|
||||
ss = STONE;
|
||||
@@ -844,10 +844,11 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
int idx = (chunk.x-x_min) + (chunk.z - z_min)*x_dim;
|
||||
snaparray[idx] = ss;
|
||||
snaptile[idx] = ssr.tileData;
|
||||
inhabitedTicks[idx] = inhabited_ticks;
|
||||
|
||||
endChunkLoad(startTime, ChunkStats.CACHED_SNAPSHOT_HIT);
|
||||
continue;
|
||||
}
|
||||
chunks_attempted++;
|
||||
boolean wasLoaded = w.isChunkLoaded(chunk.x, chunk.z);
|
||||
boolean didload = false;
|
||||
boolean isunloadpending = false;
|
||||
@@ -870,6 +871,8 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
tileData = new DynIntHashMap();
|
||||
|
||||
Chunk c = w.getChunkAt(chunk.x, chunk.z); /* Get the chunk */
|
||||
/* Get inhabited ticks count */
|
||||
inhabited_ticks = helper.getInhabitedTicks(c);
|
||||
if(!vis) {
|
||||
if(hidestyle == HiddenChunkStyle.FILL_STONE_PLAIN)
|
||||
ss = STONE;
|
||||
@@ -919,16 +922,18 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
if(ss != null) {
|
||||
ssr = new SnapshotRec();
|
||||
ssr.ss = ss;
|
||||
ssr.inhabitedTicks = inhabited_ticks;
|
||||
ssr.tileData = tileData;
|
||||
DynmapPlugin.plugin.sscache.putSnapshot(dw.getName(), chunk.x, chunk.z, ssr, blockdata, biome, biomeraw, highesty);
|
||||
}
|
||||
}
|
||||
snaparray[(chunk.x-x_min) + (chunk.z - z_min)*x_dim] = ss;
|
||||
snaptile[(chunk.x-x_min) + (chunk.z - z_min)*x_dim] = tileData;
|
||||
int chunkIndex = (chunk.x-x_min) + (chunk.z - z_min)*x_dim;
|
||||
snaparray[chunkIndex] = ss;
|
||||
snaptile[chunkIndex] = tileData;
|
||||
inhabitedTicks[chunkIndex] = inhabited_ticks;
|
||||
|
||||
/* If wasn't loaded before, we need to do unload */
|
||||
if (!wasLoaded) {
|
||||
chunks_read++;
|
||||
/* Since we only remember ones we loaded, and we're synchronous, no player has
|
||||
* moved, so it must be safe (also prevent chunk leak, which appears to happen
|
||||
* because isChunkInUse defined "in use" as being within 256 blocks of a player,
|
||||
@@ -936,10 +941,18 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
* by the MC base server is 21x21 (or about a 160 block radius).
|
||||
* Also, if we did generate it, need to save it */
|
||||
helper.unloadChunkNoSave(w, c, chunk.x, chunk.z);
|
||||
endChunkLoad(startTime, ChunkStats.UNLOADED_CHUNKS);
|
||||
}
|
||||
else if (isunloadpending) { /* Else, if loaded and unload is pending */
|
||||
w.unloadChunkRequest(chunk.x, chunk.z); /* Request new unload */
|
||||
endChunkLoad(startTime, ChunkStats.LOADED_CHUNKS);
|
||||
}
|
||||
else {
|
||||
endChunkLoad(startTime, ChunkStats.LOADED_CHUNKS);
|
||||
}
|
||||
}
|
||||
else {
|
||||
endChunkLoad(startTime, ChunkStats.UNGENERATED_CHUNKS);
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
@@ -955,7 +968,6 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
isempty = false;
|
||||
}
|
||||
}
|
||||
total_loadtime += System.nanoTime() - t0;
|
||||
|
||||
return cnt;
|
||||
}
|
||||
@@ -987,6 +999,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
snaparray[i] = null;
|
||||
}
|
||||
snaparray = null;
|
||||
inhabitedTicks = null;
|
||||
}
|
||||
}
|
||||
private void initSectionData(int idx) {
|
||||
@@ -1053,22 +1066,6 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
public DynmapWorld getWorld() {
|
||||
return dw;
|
||||
}
|
||||
@Override
|
||||
public int getChunksLoaded() {
|
||||
return chunks_read;
|
||||
}
|
||||
@Override
|
||||
public int getChunkLoadsAttempted() {
|
||||
return chunks_attempted;
|
||||
}
|
||||
@Override
|
||||
public long getTotalRuntimeNanos() {
|
||||
return total_loadtime;
|
||||
}
|
||||
@Override
|
||||
public long getExceptionCount() {
|
||||
return exceptions;
|
||||
}
|
||||
|
||||
static {
|
||||
Biome[] b = Biome.values();
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.dynmap.bukkit;
|
||||
import java.lang.ref.Reference;
|
||||
import java.lang.ref.ReferenceQueue;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@@ -13,6 +14,7 @@ import org.dynmap.utils.DynIntHashMap;
|
||||
public class SnapshotCache {
|
||||
public static class SnapshotRec {
|
||||
public ChunkSnapshot ss;
|
||||
public long inhabitedTicks;
|
||||
public DynIntHashMap tileData;
|
||||
};
|
||||
|
||||
@@ -20,9 +22,10 @@ public class SnapshotCache {
|
||||
private ReferenceQueue<SnapshotRec> refqueue;
|
||||
private long cache_attempts;
|
||||
private long cache_success;
|
||||
|
||||
private boolean softref;
|
||||
|
||||
private static class CacheRec {
|
||||
WeakReference<SnapshotRec> ref;
|
||||
Reference<SnapshotRec> ref;
|
||||
boolean hasbiome;
|
||||
boolean hasrawbiome;
|
||||
boolean hasblockdata;
|
||||
@@ -32,12 +35,12 @@ public class SnapshotCache {
|
||||
@SuppressWarnings("serial")
|
||||
public class CacheHashMap extends LinkedHashMap<String, CacheRec> {
|
||||
private int limit;
|
||||
private IdentityHashMap<WeakReference<SnapshotRec>, String> reverselookup;
|
||||
private IdentityHashMap<Reference<SnapshotRec>, String> reverselookup;
|
||||
|
||||
public CacheHashMap(int lim) {
|
||||
super(16, (float)0.75, true);
|
||||
limit = lim;
|
||||
reverselookup = new IdentityHashMap<WeakReference<SnapshotRec>, String>();
|
||||
reverselookup = new IdentityHashMap<Reference<SnapshotRec>, String>();
|
||||
}
|
||||
protected boolean removeEldestEntry(Map.Entry<String, CacheRec> last) {
|
||||
boolean remove = (size() >= limit);
|
||||
@@ -51,9 +54,10 @@ public class SnapshotCache {
|
||||
/**
|
||||
* Create snapshot cache
|
||||
*/
|
||||
public SnapshotCache(int max_size) {
|
||||
public SnapshotCache(int max_size, boolean softref) {
|
||||
snapcache = new CacheHashMap(max_size);
|
||||
refqueue = new ReferenceQueue<SnapshotRec>();
|
||||
this.softref = softref;
|
||||
}
|
||||
private String getKey(String w, int cx, int cz) {
|
||||
return w + ":" + cx + ":" + cz;
|
||||
@@ -127,7 +131,10 @@ public class SnapshotCache {
|
||||
rec.hasbiome = biome;
|
||||
rec.hasrawbiome = biomeraw;
|
||||
rec.hashighesty = highesty;
|
||||
rec.ref = new WeakReference<SnapshotRec>(ss, refqueue);
|
||||
if (softref)
|
||||
rec.ref = new SoftReference<SnapshotRec>(ss, refqueue);
|
||||
else
|
||||
rec.ref = new WeakReference<SnapshotRec>(ss, refqueue);
|
||||
CacheRec prevrec = snapcache.put(key, rec);
|
||||
if(prevrec != null) {
|
||||
snapcache.reverselookup.remove(prevrec.ref);
|
||||
|
||||
@@ -228,7 +228,10 @@ public class SpoutPluginBlocks {
|
||||
}
|
||||
String rslt = sb.toString();
|
||||
/* Now, generate spout texture file - see if changed */
|
||||
File st = new File(datadir, "renderdata/spout-texture.txt");
|
||||
File renderdata = new File(datadir, "renderdata");
|
||||
if (renderdata.exists() == false)
|
||||
renderdata.mkdirs();
|
||||
File st = new File(renderdata, "spout-texture.txt");
|
||||
if(st.exists()) {
|
||||
FileReader fr = null;
|
||||
StringBuilder sbold = new StringBuilder();
|
||||
|
||||
@@ -39,7 +39,7 @@ public class BukkitPermissions implements PermissionProvider {
|
||||
}
|
||||
@Override
|
||||
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
||||
Player p = Bukkit.getPlayerExact(name);
|
||||
Player p = Bukkit.getPlayerExact(player);
|
||||
HashSet<String> hasperms = null;
|
||||
if (p != null) {
|
||||
hasperms = new HashSet<String>();
|
||||
|
||||
@@ -35,15 +35,16 @@ public class GroupManagerPermissions implements PermissionProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(CommandSender sender, String permission) {
|
||||
public boolean has(CommandSender sender, String permission) {
|
||||
Player player = sender instanceof Player ? (Player) sender : null;
|
||||
return (player != null) ? wh.getWorldPermissions(player).has(player, name + "." + permission) : true;
|
||||
boolean rslt = (player != null) ? gm.getWorldsHolder().getDefaultWorld().getPermissionsHandler().permission(player, name + "." + permission) : true;
|
||||
return rslt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
||||
HashSet<String> hasperms = new HashSet<String>();
|
||||
AnjoPermissionsHandler apm = wh.getWorldPermissionsByPlayerName(player);
|
||||
AnjoPermissionsHandler apm = gm.getWorldsHolder().getDefaultWorld().getPermissionsHandler();
|
||||
if (apm != null) {
|
||||
for (String pp : perms) {
|
||||
if (apm.permission(player, name + "." + pp)) {
|
||||
@@ -55,10 +56,11 @@ public class GroupManagerPermissions implements PermissionProvider {
|
||||
}
|
||||
@Override
|
||||
public boolean hasOfflinePermission(String player, String perm) {
|
||||
AnjoPermissionsHandler apm = wh.getWorldPermissionsByPlayerName(player);
|
||||
AnjoPermissionsHandler apm = gm.getWorldsHolder().getDefaultWorld().getPermissionsHandler();
|
||||
boolean rslt = false;
|
||||
if(apm != null) {
|
||||
return apm.permission(player, name + "." + perm);
|
||||
rslt = apm.permission(player, name + "." + perm);
|
||||
}
|
||||
return false;
|
||||
return rslt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,9 @@ public class PEXPermissions implements PermissionProvider {
|
||||
server.getPluginManager().enablePlugin(permissionsPlugin);
|
||||
if(permissionsPlugin.isEnabled() == false)
|
||||
return null;
|
||||
if(PermissionsEx.isAvailable() == false)
|
||||
return null;
|
||||
//Broken in new dev builds, apparently
|
||||
//if(PermissionsEx.isAvailable() == false)
|
||||
// return null;
|
||||
Log.info("Using PermissionsEx " + permissionsPlugin.getDescription().getVersion() + " for access control");
|
||||
return new PEXPermissions(name);
|
||||
}
|
||||
|
||||
@@ -13,8 +13,27 @@
|
||||
# The definitions of these templates are in normal-hi_boost_vhi.txt, nether-hi_boost_vhi.txt, and the_end-hi_boost_vhi.txt
|
||||
# To use the HDMap hi-res (16 ppb) map templates, with support for boosting resolution selectively to xhi-res (64 ppb), set value to hi_boost_xhi
|
||||
# The definitions of these templates are in normal-hi_boost_xhi.txt, nether-hi_boost_xhi.txt, and the_end-hi_boost_xhi.txt
|
||||
deftemplatesuffix: vlowres
|
||||
deftemplatesuffix: hires
|
||||
|
||||
# Map storage scheme: only uncommoent one 'type' value
|
||||
# filetree: classic and default scheme: tree of files, with all map data under the directory indicated by 'tilespath' setting
|
||||
# sqlite: single SQLite database file (this can get VERY BIG), located at 'dbfile' setting (default is file dynmap.db in data directory)
|
||||
# mysql: MySQL database, at hostname:port in database, accessed via userid with password
|
||||
storage:
|
||||
# Filetree storage (standard tree of image files for maps)
|
||||
type: filetree
|
||||
# SQLite db for map storage (uses dbfile as storage location)
|
||||
#type: sqlite
|
||||
#dbfile: dynmap.db
|
||||
# MySQL DB for map storage (at 'hostname':'port' in database 'database' using user 'userid' password 'password' and table prefix 'prefix'
|
||||
#type: mysql
|
||||
#hostname: localhost
|
||||
#port: 3306
|
||||
#database: dynmap
|
||||
#userid: dynmap
|
||||
#password: dynmap
|
||||
#prefix: ""
|
||||
|
||||
components:
|
||||
- class: org.dynmap.ClientConfigurationComponent
|
||||
|
||||
@@ -26,6 +45,8 @@ components:
|
||||
hidewebchatip: false
|
||||
trustclientname: false
|
||||
includehiddenplayers: false
|
||||
# (optional) if true, color codes in player display names are used
|
||||
use-name-colors: false
|
||||
# (optional) if true, player login IDs will be used for web chat when their IPs match
|
||||
use-player-login-ip: true
|
||||
# (optional) if use-player-login-ip is true, setting this to true will cause chat messages not matching a known player IP to be ignored
|
||||
@@ -48,6 +69,8 @@ components:
|
||||
protected-player-info: false
|
||||
# If true, hide players with invisibility potion effects active
|
||||
hide-if-invisiblity-potion: true
|
||||
# If true, player names are not shown on map, chat, list
|
||||
hidenames: false
|
||||
#- class: org.dynmap.JsonFileClientUpdateComponent
|
||||
# writeinterval: 1
|
||||
# sendhealth: true
|
||||
@@ -56,6 +79,7 @@ components:
|
||||
# webchat-interval: 5
|
||||
# hidewebchatip: false
|
||||
# includehiddenplayers: false
|
||||
# use-name-colors: false
|
||||
# use-player-login-ip: false
|
||||
# require-player-login-ip: false
|
||||
# block-banned-player-chat: true
|
||||
@@ -69,6 +93,7 @@ components:
|
||||
# # Limit length of single chat messages
|
||||
# chatlengthlimit: 256
|
||||
# hide-if-invisiblity-potion: true
|
||||
# hidenames: false
|
||||
|
||||
- class: org.dynmap.SimpleWebChatComponent
|
||||
allowchat: true
|
||||
@@ -80,6 +105,8 @@ components:
|
||||
type: markers
|
||||
showlabel: false
|
||||
enablesigns: false
|
||||
# Default marker set for sign markers
|
||||
default-sign-set: markers
|
||||
# (optional) add spawn point markers to standard marker layer
|
||||
showspawn: true
|
||||
spawnicon: world
|
||||
@@ -187,6 +214,9 @@ usenormalthreadpriority: true
|
||||
# Save and restore pending tile renders - prevents their loss on server shutdown or /reload
|
||||
saverestorepending: true
|
||||
|
||||
# Save period for pending jobs (in seconds): periodic saving for crash recovery of jobs
|
||||
save-pending-period: 900
|
||||
|
||||
# Zoom-out tile update period - how often to scan for and process tile updates into zoom-out tiles (in seconds)
|
||||
zoomoutperiod: 30
|
||||
|
||||
@@ -210,6 +240,17 @@ enabletilehash: true
|
||||
# Optional - enable smooth lighting by default on all maps supporting it (can be set per map as lighting option)
|
||||
smooth-lighting: true
|
||||
|
||||
# Optional - use world provider lighting table (good for custom worlds with custom lighting curves, like nether)
|
||||
# false=classic Dynmap lighting curve
|
||||
use-brightness-table: true
|
||||
|
||||
# Optional - render specific block IDs using the texures and models of another block ID: can be used to hide/disguise specific
|
||||
# blocks (e.g. make ores look like stone, hide chests) or to provide simple support for rendering unsupported custom blocks
|
||||
block-id-alias:
|
||||
# "14": 1
|
||||
# "15": 1
|
||||
# "16": 1
|
||||
|
||||
# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100)
|
||||
# Has no effect on maps with explicit format settings
|
||||
image-format: png
|
||||
@@ -268,8 +309,12 @@ tilespath: web/tiles
|
||||
# The path where the web-files are located.
|
||||
webpath: web
|
||||
|
||||
# The path were the /dynmapexp command exports OBJ ZIP files
|
||||
exportpath: export
|
||||
|
||||
# The network-interface the webserver will bind to (0.0.0.0 for all interfaces, 127.0.0.1 for only local access).
|
||||
webserver-bindaddress: 0.0.0.0
|
||||
# If not set, uses same setting as server in server.properties (or 0.0.0.0 if not specified)
|
||||
#webserver-bindaddress: 0.0.0.0
|
||||
|
||||
# The TCP-port the webserver will listen on.
|
||||
webserver-port: 8123
|
||||
@@ -305,14 +350,29 @@ progressloginterval: 100
|
||||
# Interval the browser should poll for updates.
|
||||
updaterate: 2000
|
||||
|
||||
# If nonzero, server will pause fullrender/radiusrender processing when 'fullrenderplayerlimit' or more user's are logged in
|
||||
# If nonzero, server will pause fullrender/radiusrender processing when 'fullrenderplayerlimit' or more users are logged in
|
||||
fullrenderplayerlimit: 0
|
||||
# If nonzero, server will pause update render processing when 'updateplayerlimit' or more users are logged in
|
||||
updateplayerlimit: 0
|
||||
# Target limit on server thread use - msec per tick
|
||||
per-tick-time-limit: 50
|
||||
# If TPS of server is below this setting, update renders processing is paused
|
||||
update-min-tps: 18.0
|
||||
# If TPS of server is below this setting, full/radius renders processing is paused
|
||||
fullrender-min-tps: 18.0
|
||||
# If TPS of server is below this setting, zoom out processing is paused
|
||||
zoomout-min-tps: 18.0
|
||||
|
||||
showplayerfacesinmenu: true
|
||||
|
||||
# Control whether players that are hidden or not on current map are grayed out (true=yes)
|
||||
grayplayerswhenhidden: true
|
||||
|
||||
# Use player permissions to order player list: first to last, players are ordered by first permission listed that they have
|
||||
# That is, anyone with first listed permission goes before anyone with second, etc, with users with none of the nodes going last
|
||||
player-sort-permission-nodes:
|
||||
- bukkit.command.op
|
||||
|
||||
# Set sidebaropened: 'true' to pin menu sidebar opened permanently, 'pinned' to default the sidebar to pinned, but allow it to unpin
|
||||
#sidebaropened: true
|
||||
|
||||
@@ -354,12 +414,17 @@ persist-ids-by-ip: true
|
||||
# If true, map text to cyrillic
|
||||
cyrillic-support: false
|
||||
|
||||
# If true, coordinates will be rounded
|
||||
round-coordinates: true
|
||||
|
||||
# Messages to customize
|
||||
msg:
|
||||
maptypes: "Map Types"
|
||||
players: "Players"
|
||||
chatrequireslogin: "Chat Requires Login"
|
||||
chatnotallowed: "You are not permitted to send chat messages"
|
||||
hiddennamejoin: "Player joined"
|
||||
hiddennamequit: "Player quit"
|
||||
|
||||
# URL for client configuration (only need to be tailored for proxies or other non-standard configurations)
|
||||
url:
|
||||
@@ -394,6 +459,11 @@ custom-commands:
|
||||
preupdatecommand: ""
|
||||
# Command run just after any image file is written or updated: run with single parameter with fully qualified file name
|
||||
postupdatecommand: ""
|
||||
|
||||
# Snapshot cache size, in chunks
|
||||
snapshotcachesize: 500
|
||||
# Snapshot cache uses soft references (true), else weak references (false)
|
||||
soft-ref-cache: true
|
||||
|
||||
# Set to true to enable verbose startup messages - can help with debugging map configuration problems
|
||||
# Set to false for a much quieter startup log
|
||||
@@ -402,3 +472,5 @@ verbose: false
|
||||
# Enables debugging.
|
||||
#debuggers:
|
||||
# - class: org.dynmap.debug.LogDebugger
|
||||
# Debug: dump blocks missing render data
|
||||
dump-missing-blocks: false
|
||||
@@ -3,7 +3,7 @@ main: org.dynmap.bukkit.DynmapPlugin
|
||||
version: "${project.version}-${BUILD_NUMBER}"
|
||||
authors: [mikeprimm]
|
||||
website: "http://www.minecraftforum.net/topic/1543523-dynmap-dynamic-web-based-maps-for-minecraft/"
|
||||
softdepend: [ Permissions, PermissionEx, bPermissions, PermissionsBukkit ]
|
||||
softdepend: [ Permissions, PermissionEx, bPermissions, PermissionsBukkit, GroupManager ]
|
||||
commands:
|
||||
dynmap:
|
||||
description: Controls Dynmap.
|
||||
@@ -30,8 +30,12 @@ commands:
|
||||
/<command> resetstats - Reset render statistics.
|
||||
/<command> sendtoweb msg - Send message to web users
|
||||
/<command> purgequeue - Set tile update queue to empty
|
||||
/<command> purgequeue worldname - Set tile update queue to empty for world 'worldname'
|
||||
/<command> purgemap worldname mapname - Delete all the tiles for map 'mapname' of world 'worldname'
|
||||
/<command> purgeworld worldname - Delete all the files for world 'worldname'
|
||||
/<command> pause - Show render pause state
|
||||
/<command> pause <all|none|full|update> - Set render pause state
|
||||
/<command> quiet - Stop progress messages from active jobs
|
||||
/<command> ids-for-ip <ipaddress> - Show player IDs that have logged in from given IP address
|
||||
/<command> ips-for-id <playerid> - Show IP addresses that have been used for the given player ID
|
||||
/<command> add-id-for-ip <playerid> <ipaddress> - Add player ID to given IP address
|
||||
@@ -87,6 +91,17 @@ commands:
|
||||
/<command> listcircles - list details of all circles
|
||||
/<command> updatecircle <label> <arg>:<value> ... - update attributes of circle with given label
|
||||
/<command> updatecircle id:<id> <arg>:<value> ... - update attributes of circle with given ID
|
||||
/<command> getdesc id:<id> type:<icon|area|circle|line> - get description for marker with given ID
|
||||
/<command> getdesc <label> type:<icon|area|circle|line> - get description for marker with given label
|
||||
/<command> resetdesc id:<id> type:<icon|area|circle|line> - clear description for marker with given ID
|
||||
/<command> resetdesc <label> type:<icon|area|circle|line> - clear description for marker with given label
|
||||
/<command> appenddesc id:<id> type:<icon|area|circle|line> desc:"text" - append text line to description for marker with given ID
|
||||
/<command> appenddesc <label> type:<icon|area|circle|line> desc:"text" - append text line to description for marker with given label
|
||||
/<command> importdesc id:<id> type:<icon|area|circle|line> file:<filename> - import description from given file for marker with given ID
|
||||
/<command> importdesc <label> type:<icon|area|circle|line> file:<filename> - import description from given file for marker with given label
|
||||
/<command> importlabel id:<id> type:<icon|area|circle|line> file:<filename> - import label with markup from given file for marker with given ID
|
||||
/<command> importlabel <label> type:<icon|area|circle|line> file:<filename> - import label with markup from given file for marker with given label
|
||||
/<command> getlabel id:<id> type:<icon|area|circle|line> - get label for marker with given ID
|
||||
|
||||
dmap:
|
||||
description: List and modify dynmap configuration
|
||||
@@ -101,6 +116,10 @@ commands:
|
||||
/<command> mapset worldname:mapname attrib:value attrib:value - update given map on given world with given attributes
|
||||
/<command> worldreset worldname - reset given world to default template for world type
|
||||
/<command> worldreset worldname templatename - reset given world to given template
|
||||
dynmapexp:
|
||||
description: Map export commands
|
||||
usage: |
|
||||
/<command> shader <shadername> - Export material library for shader <shadername>
|
||||
|
||||
permissions:
|
||||
dynmap.*:
|
||||
@@ -120,6 +139,9 @@ permissions:
|
||||
dynmap.resetstats: true
|
||||
dynmap.sendtoweb: true
|
||||
dynmap.purgequeue: true
|
||||
dynmap.purgemap: true
|
||||
dynmap.purgeworld: true
|
||||
dynmap.quiet: true
|
||||
dynmap.ids-for-ip: true
|
||||
dynmap.ips-for-id: true
|
||||
dynmap.webregister: true
|
||||
@@ -147,6 +169,12 @@ permissions:
|
||||
dynmap.marker.updatecircle: true
|
||||
dynmap.marker.listcircles: true
|
||||
dynmap.marker.deletecircle: true
|
||||
dynmap.marker.getdesc: true
|
||||
dynmap.marker.resetdesc: true
|
||||
dynmap.marker.appenddesc: true
|
||||
dynmap.marker.importdesc: true
|
||||
dynmap.marker.getlabel: true
|
||||
dynmap.marker.importlabel: true
|
||||
dynmap.dmap.worldlist: true
|
||||
dynmap.dmap.worldset: true
|
||||
dynmap.dmap.worldreset: true
|
||||
@@ -199,9 +227,18 @@ permissions:
|
||||
dynmap.purgequeue:
|
||||
description: Allows /dynmap purgequeue
|
||||
default: op
|
||||
dynmap.purgemap:
|
||||
description: Allows /dynmap purgemap
|
||||
default: op
|
||||
dynmap.purgeworld:
|
||||
description: Allows /dynmap purgeworld
|
||||
default: op
|
||||
dynmap.pause:
|
||||
description: Allows /dynmap pause
|
||||
default: op
|
||||
dynmap.quiet:
|
||||
description: Allows /dynmap quiet
|
||||
default: true
|
||||
dynmap.ids-for-ip:
|
||||
description: Allows /dynmap ids-for-ip
|
||||
default: op
|
||||
@@ -211,7 +248,7 @@ permissions:
|
||||
dynmap.webregister:
|
||||
description: Allows /dynmap webregister
|
||||
default: true
|
||||
dynmao,webregister.other:
|
||||
dynmap.webregister.other:
|
||||
description: Allows /dynmap webregister userid
|
||||
default: op
|
||||
dynmap.marker.add:
|
||||
@@ -292,6 +329,24 @@ permissions:
|
||||
dynmap.marker.deletecircle:
|
||||
description: Allows /dmarker deletecircle
|
||||
default: op
|
||||
dynmap.marker.getdesc:
|
||||
description: Allows /dmarker getdesc
|
||||
default: op
|
||||
dynmap.marker.resetdesc:
|
||||
description: Allows /dmarker resetdesc
|
||||
default: op
|
||||
dynmap.marker.appenddesc:
|
||||
description: Allows /dmarker appenddesc
|
||||
default: op
|
||||
dynmap.marker.importdesc:
|
||||
description: Allows /dmarker importdesc
|
||||
default: op
|
||||
dynmap.marker.getlabel:
|
||||
description: Allows /dmarker getlabel
|
||||
default: op
|
||||
dynmap.marker.importlabel:
|
||||
description: Allows /dmarker importlabel
|
||||
default: op
|
||||
dynmap.dmap.worldlist:
|
||||
description: Allows /dmap worldlist
|
||||
default: op
|
||||
|
||||
Reference in New Issue
Block a user