mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 05:05:16 +01:00
Merge pull request #2623 from gabsoftware/v3.0
fixed disappearing markers (webbukkit#2533), many thanks to tiagoad
This commit is contained in:
commit
be9aac072d
@ -178,7 +178,6 @@ public abstract class DynmapServerInterface {
|
||||
* @return block ID, or -1 if chunk at given coordinate isn't loaded
|
||||
*/
|
||||
public abstract int getBlockIDAt(String wname, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* Checks if a sign is at a given coordinate in a given world (if chunk is loaded)
|
||||
* @param wname - world name
|
||||
@ -187,8 +186,7 @@ public abstract class DynmapServerInterface {
|
||||
* @param z - Z coordinate
|
||||
* @return 1 if a sign is at the location, 0 if it's not, -1 if the chunk isn't loaded
|
||||
*/
|
||||
public abstract int isSignAt(String wname, int x, int y, int z);
|
||||
|
||||
public abstract int isSignAt(String wname, int x, int y, int z);
|
||||
/**
|
||||
* Get current TPS for server (20.0 is nominal)
|
||||
* @return ticks per second
|
||||
|
@ -19,7 +19,7 @@ public class MarkerSignManager {
|
||||
private static MarkerSignManager mgr = null;
|
||||
private static DynmapCore plugin = null;
|
||||
private static String defSignSet = null;
|
||||
|
||||
|
||||
private static class SignRec {
|
||||
String wname;
|
||||
int x, y, z;
|
||||
@ -147,7 +147,7 @@ public class MarkerSignManager {
|
||||
iter.remove();
|
||||
}
|
||||
else {
|
||||
if(plugin.getServer().isSignAt(r.wname, r.x, r.y, r.z) == 0) {
|
||||
if(plugin.getServer().isSignAt(r.wname, r.x, r.y, r.z) == 0) {
|
||||
r.m.deleteMarker();
|
||||
iter.remove();
|
||||
}
|
||||
|
@ -149,6 +149,9 @@ public class DynmapPlugin
|
||||
private static final int SIGNPOST_ID = 63;
|
||||
private static final int WALLSIGN_ID = 68;
|
||||
|
||||
private static final int SIGNPOST_ID = 63;
|
||||
private static final int WALLSIGN_ID = 68;
|
||||
|
||||
private static final String[] TRIGGER_DEFAULTS = { "blockupdate", "chunkpopulate", "chunkgenerate" };
|
||||
|
||||
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
|
||||
@ -527,6 +530,20 @@ public class DynmapPlugin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isSignAt(String wname, int x, int y, int z) {
|
||||
int blkid = this.getBlockIDAt(wname, x, y, z);
|
||||
|
||||
if (blkid == -1)
|
||||
return -1;
|
||||
|
||||
if((blkid == WALLSIGN_ID) || (blkid == SIGNPOST_ID)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleServerTask(Runnable run, long delay)
|
||||
{
|
||||
|
@ -535,6 +535,20 @@ public class DynmapPlugin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isSignAt(String wname, int x, int y, int z) {
|
||||
int blkid = this.getBlockIDAt(wname, x, y, z);
|
||||
|
||||
if (blkid == -1)
|
||||
return -1;
|
||||
|
||||
if((blkid == WALLSIGN_ID) || (blkid == SIGNPOST_ID)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleServerTask(Runnable run, long delay)
|
||||
{
|
||||
|
@ -149,6 +149,9 @@ public class DynmapPlugin
|
||||
private static final int SIGNPOST_ID = 63;
|
||||
private static final int WALLSIGN_ID = 68;
|
||||
|
||||
private static final int SIGNPOST_ID = 63;
|
||||
private static final int WALLSIGN_ID = 68;
|
||||
|
||||
private static final String[] TRIGGER_DEFAULTS = { "blockupdate", "chunkpopulate", "chunkgenerate" };
|
||||
|
||||
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
|
||||
@ -540,6 +543,20 @@ public class DynmapPlugin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isSignAt(String wname, int x, int y, int z) {
|
||||
int blkid = this.getBlockIDAt(wname, x, y, z);
|
||||
|
||||
if (blkid == -1)
|
||||
return -1;
|
||||
|
||||
if((blkid == WALLSIGN_ID) || (blkid == SIGNPOST_ID)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleServerTask(Runnable run, long delay)
|
||||
{
|
||||
|
@ -160,6 +160,9 @@ public class DynmapPlugin
|
||||
private static final int SIGNPOST_ID = 63;
|
||||
private static final int WALLSIGN_ID = 68;
|
||||
|
||||
private static final int SIGNPOST_ID = 63;
|
||||
private static final int WALLSIGN_ID = 68;
|
||||
|
||||
private static final String[] TRIGGER_DEFAULTS = { "blockupdate", "chunkpopulate", "chunkgenerate" };
|
||||
|
||||
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
|
||||
@ -522,6 +525,11 @@ public class DynmapPlugin
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isSignAt(String wname, int x, int y, int z) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleServerTask(Runnable run, long delay)
|
||||
{
|
||||
|
@ -144,6 +144,9 @@ public class DynmapPlugin
|
||||
private static final int SIGNPOST_ID = 63;
|
||||
private static final int WALLSIGN_ID = 68;
|
||||
|
||||
private static final int SIGNPOST_ID = 63;
|
||||
private static final int WALLSIGN_ID = 68;
|
||||
|
||||
private static final String[] TRIGGER_DEFAULTS = { "blockupdate", "chunkpopulate", "chunkgenerate" };
|
||||
|
||||
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
|
||||
@ -511,6 +514,20 @@ public class DynmapPlugin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isSignAt(String wname, int x, int y, int z) {
|
||||
int blkid = this.getBlockIDAt(wname, x, y, z);
|
||||
|
||||
if (blkid == -1)
|
||||
return -1;
|
||||
|
||||
if((blkid == WALLSIGN_ID) || (blkid == SIGNPOST_ID)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleServerTask(Runnable run, long delay)
|
||||
{
|
||||
|
@ -142,6 +142,9 @@ public class DynmapPlugin
|
||||
private static final int SIGNPOST_ID = 63;
|
||||
private static final int WALLSIGN_ID = 68;
|
||||
|
||||
private static final int SIGNPOST_ID = 63;
|
||||
private static final int WALLSIGN_ID = 68;
|
||||
|
||||
private static final String[] TRIGGER_DEFAULTS = { "blockupdate", "chunkpopulate", "chunkgenerate" };
|
||||
|
||||
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
|
||||
@ -514,6 +517,20 @@ public class DynmapPlugin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isSignAt(String wname, int x, int y, int z) {
|
||||
int blkid = this.getBlockIDAt(wname, x, y, z);
|
||||
|
||||
if (blkid == -1)
|
||||
return -1;
|
||||
|
||||
if((blkid == WALLSIGN_ID) || (blkid == SIGNPOST_ID)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleServerTask(Runnable run, long delay)
|
||||
{
|
||||
|
@ -230,6 +230,22 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isSignAt(String wname, int x, int y, int z) {
|
||||
World w = getServer().getWorld(wname);
|
||||
if((w != null) && w.isChunkLoaded(x >> 4, z >> 4)) {
|
||||
Block b = w.getBlockAt(x, y, z);
|
||||
BlockState s = b.getState();
|
||||
|
||||
if (s instanceof Sign) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleServerTask(Runnable run, long delay) {
|
||||
getServer().getScheduler().scheduleSyncDelayedTask(DynmapPlugin.this, run, delay);
|
||||
|
Loading…
Reference in New Issue
Block a user