mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-25 10:07:37 +01:00
Tiles will now also generate when destroying blocks.
This commit is contained in:
parent
dfc051743d
commit
686b09bc9d
@ -20,4 +20,12 @@ public class DynmapBlockListener extends BlockListener {
|
||||
Block blockPlaced = event.getBlock();
|
||||
mgr.touch(blockPlaced.getX(), blockPlaced.getY(), blockPlaced.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDamaged(BlockDamagedEvent event) {
|
||||
if (event.getDamageLevel() == BlockDamageLevel.BROKEN) {
|
||||
Block blockBroken = event.getBlock();
|
||||
mgr.touch(blockBroken.getX(), blockBroken.getY(), blockBroken.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import java.io.File;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.event.*;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.block.BlockListener;
|
||||
import org.bukkit.plugin.*;
|
||||
import org.bukkit.plugin.java.*;
|
||||
import org.dynmap.debug.BukkitPlayerDebugger;
|
||||
@ -29,7 +30,6 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
return getServer().getWorlds()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
debugger.enable();
|
||||
mgr = new MapManager(getWorld(), debugger);
|
||||
@ -44,7 +44,6 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
registerEvents();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
mgr.stopManager();
|
||||
|
||||
@ -56,7 +55,10 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
}
|
||||
|
||||
public void registerEvents() {
|
||||
getServer().getPluginManager().registerEvent(Event.Type.BLOCK_PLACED, new DynmapBlockListener(mgr), Priority.Normal, this);
|
||||
BlockListener blockListener = new DynmapBlockListener(mgr);
|
||||
getServer().getPluginManager().registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Normal, this);
|
||||
getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DAMAGED, blockListener, Priority.Normal, this);
|
||||
|
||||
getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND, new DynmapPlayerListener(mgr), Priority.Normal, this);
|
||||
//getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DESTROYED, listener, Priority.Normal, this);
|
||||
/* etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM);
|
||||
|
@ -1,15 +1,12 @@
|
||||
package org.dynmap.debug;
|
||||
|
||||
public class NullDebugger implements Debugger {
|
||||
@Override
|
||||
public void debug(String message) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(String message) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(String message, Throwable thrown) {
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user