dynmap/map.java
fescen9 7a2b1598eb - Markers are now known as "Signs"
- map-markerpath is now map-signspath (YOU MUST SET THIS TO YOUR CURRENT FILE IF YOU HAVE ONE)
 - Commands have been renamed to: /addsign, /removesign, /listsigns, /tpsign (Update groups.txt if required)
 - New map-showmarkers server.property (comma separated list of options spawn,homes,warps,signs,players or you can set it to all or none; yes, can even hide players but still show warps, spawns, etc...)
 - map-showmarkers directly affects what output via the "up" directory so what you include in your options is included in the data, and ultimately the map
 - Internally, signs are now Warp based so no longer owner based
 - index.html updated to add divs around checkboxes
 - map.js updated to consolidate both players and markers into a single if statement
 - checkboxes dynamically show/hide from the map based on the number of items on the map (will hide if there are none, especially based on map-showmarkers)
 - Player list shows/hides based on number of players (or map-showmarkers setting)
2010-12-11 04:56:06 +00:00

57 lines
1.8 KiB
Java

import java.util.logging.Logger;
import java.io.IOException;
public class map extends Plugin {
protected static final Logger log = Logger.getLogger("Minecraft");
private WebServer server = null;
private MapManager mgr = null;
private MapListener listener = null;
@Override
public void enable() {
log.info("Map INIT");
mgr = new MapManager();
mgr.startManager();
try {
server = new WebServer(mgr.serverport, mgr);
} catch(IOException e) {
log.info("position failed to start WebServer (IOException)");
}
listener = new MapListener(mgr);
}
@Override
public void disable() {
log.info("Map UNINIT");
mgr.stopManager();
if(server != null) {
server.shutdown();
server = null;
}
}
@Override
public void initialize() {
etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM);
etc.getLoader().addListener(PluginLoader.Hook.BLOCK_CREATED, listener, this, PluginListener.Priority.MEDIUM);
etc.getLoader().addListener(PluginLoader.Hook.BLOCK_DESTROYED, listener, this, PluginListener.Priority.MEDIUM);
etc.getInstance().addCommand("/map_wait", " [wait] - set wait between tile renders (ms)");
etc.getInstance().addCommand("/map_stat", " - query number of tiles in render queue");
etc.getInstance().addCommand("/map_regen", " - regenerate entire map");
etc.getInstance().addCommand("/map_debug", " - send map debugging messages");
etc.getInstance().addCommand("/map_nodebug", " - disable map debugging messages");
etc.getInstance().addCommand("/addsign", " [name] - adds a named sign to the map");
etc.getInstance().addCommand("/removesign", " [name] - removes a named sign to the map");
etc.getInstance().addCommand("/listsigns", " - list all named signs");
etc.getInstance().addCommand("/tpsign", " [name] - teleport to a named sign");
}
}