Change 'int blkid' to 'String material' for block and sign-change events.

This commit is contained in:
Mitch Talmadge 2019-12-19 21:34:32 -07:00
parent 5dbb58dfda
commit a3cb46e286
6 changed files with 20 additions and 19 deletions

View file

@ -84,7 +84,7 @@ public class DynmapCore implements DynmapCommonAPI {
*/
public static abstract class EnableCoreCallbacks {
/**
* Called during enableCore to report that confniguration.txt is loaded
* Called during enableCore to report that configuration.txt is loaded
*/
public abstract void configurationLoaded();
}
@ -2400,10 +2400,10 @@ public class DynmapCore implements DynmapCommonAPI {
}
@Override
public void processSignChange(int blkid, String world, int x, int y, int z,
public void processSignChange(String material, String world, int x, int y, int z,
String[] lines, String playerid) {
DynmapPlayer dp = server.getPlayer(playerid);
listenerManager.processSignChangeEvent(EventType.SIGN_CHANGE, blkid, world, x, y, z, lines, dp);
listenerManager.processSignChangeEvent(EventType.SIGN_CHANGE, material, world, x, y, z, lines, dp);
}
public MapStorage getDefaultMapStorage() {

View file

@ -30,10 +30,10 @@ public class DynmapListenerManager {
public void chatEvent(DynmapPlayer p, String msg);
}
public interface BlockEventListener extends EventListener {
public void blockEvent(int blkid, String w, int x, int y, int z);
public void blockEvent(String material, String w, int x, int y, int z);
}
public interface SignChangeEventListener extends EventListener {
public void signChangeEvent(int blkid, String w, int x, int y, int z, String[] lines, DynmapPlayer p);
public void signChangeEvent(String material, String w, int x, int y, int z, String[] lines, DynmapPlayer p);
}
public enum EventType {
WORLD_LOAD,
@ -105,7 +105,7 @@ public class DynmapListenerManager {
}
}
}
public void processBlockEvent(EventType type, int blkid, String world, int x, int y, int z)
public void processBlockEvent(EventType type, String material, String world, int x, int y, int z)
{
ArrayList<EventListener> lst = listeners.get(type);
if(lst == null) return;
@ -114,14 +114,14 @@ public class DynmapListenerManager {
EventListener el = lst.get(i);
if(el instanceof BlockEventListener) {
try {
((BlockEventListener)el).blockEvent(blkid, world, x, y, z);
((BlockEventListener)el).blockEvent(material, world, x, y, z);
} catch (Throwable t) {
Log.warning("processBlockEvent(" + type + "," + blkid + "," + world + "," + x + "," + y + "," + z + ") - exception", t);
Log.warning("processBlockEvent(" + type + "," + material + "," + world + "," + x + "," + y + "," + z + ") - exception", t);
}
}
}
}
public void processSignChangeEvent(EventType type, int blkid, String world, int x, int y, int z, String[] lines, DynmapPlayer p)
public void processSignChangeEvent(EventType type, String material, String world, int x, int y, int z, String[] lines, DynmapPlayer p)
{
ArrayList<EventListener> lst = listeners.get(type);
if(lst == null) return;
@ -130,9 +130,9 @@ public class DynmapListenerManager {
EventListener el = lst.get(i);
if(el instanceof SignChangeEventListener) {
try {
((SignChangeEventListener)el).signChangeEvent(blkid, world, x, y, z, lines, p);
((SignChangeEventListener)el).signChangeEvent(material, world, x, y, z, lines, p);
} catch (Throwable t) {
Log.warning("processSignChangeEvent(" + type + "," + blkid + "," + world + "," + x + "," + y + "," + z + ") - exception", t);
Log.warning("processSignChangeEvent(" + type + "," + material + "," + world + "," + x + "," + y + "," + z + ") - exception", t);
}
}
}

View file

@ -2603,7 +2603,7 @@ public class TexturePack {
* @param ps - perspective state
* @param mapiter - map iterator
* @param rslt - color result (returned with value)
* @param blkid - block ID
* @param blk - block state
* @param lastblocktype - last block ID
* @param ss - shader state
*/

View file

@ -28,7 +28,7 @@ public class MarkerSignManager {
private static class SignListener implements DynmapListenerManager.SignChangeEventListener, Runnable {
@Override
public void signChangeEvent(int blkid, String wname, int x, int y, int z, String[] lines, DynmapPlayer p) {
public void signChangeEvent(String material, String wname, int x, int y, int z, String[] lines, DynmapPlayer p) {
if(mgr == null)
return;