本文整理汇总了Java中net.canarymod.plugin.Priority.PASSIVE属性的典型用法代码示例。如果您正苦于以下问题:Java Priority.PASSIVE属性的具体用法?Java Priority.PASSIVE怎么用?Java Priority.PASSIVE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.canarymod.plugin.Priority
的用法示例。
在下文中一共展示了Priority.PASSIVE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockPistonRetract
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onBlockPistonRetract(PistonRetractHook event) {
Block b = event.getPiston();
Location loc = b.getLocation();
String wn = getWorld(loc.getWorld()).getName();
int x = loc.getBlockX(), y = loc.getBlockY(), z = loc.getBlockZ();
sscache.invalidateSnapshot(wn, x, y, z);
if(onpiston)
mapManager.touch(wn, x, y, z, "pistonretract");
b = event.getMoving();
if (b != null) {
loc = b.getLocation();
x = loc.getBlockX();
y = loc.getBlockY();
z = loc.getBlockZ();
sscache.invalidateSnapshot(wn, x, y, z);
if(onpiston)
mapManager.touch(wn, x, y, z, "pistonretract");
}
}
示例2: onBlockPistonExtend
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onBlockPistonExtend(PistonExtendHook event) {
Block b = event.getPiston();
Location loc = b.getLocation();
String wn = getWorld(loc.getWorld()).getName();
int x = loc.getBlockX(), y = loc.getBlockY(), z = loc.getBlockZ();
sscache.invalidateSnapshot(wn, x, y, z);
if(onpiston)
mapManager.touch(wn, x, y, z, "pistonretract");
b = event.getMoving();
if (b != null) {
loc = b.getLocation();
x = loc.getBlockX();
y = loc.getBlockY();
z = loc.getBlockZ();
sscache.invalidateSnapshot(wn, x, y, z);
if(onpiston)
mapManager.touch(wn, x, y, z, "pistonretract");
}
}
示例3: onWorldUnload
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onWorldUnload(UnloadWorldHook event) {
CanaryModWorld w = getWorld(event.getWorld());
if(w != null) {
core.listenerManager.processWorldEvent(EventType.WORLD_UNLOAD, w);
w.setWorldUnloaded();
core.processWorldUnload(w);
}
}
示例4: onPlayerChat
@HookHandler(ignoreCanceled=true,priority=Priority.PASSIVE)
public void onPlayerChat(ChatHook evt) {
final Player p = evt.getPlayer();
final String msg = evt.getMessage();
ServerTaskManager.addTask(new ServerTask(DynmapPlugin.this, 1) {
public void run() {
DynmapPlayer dp = null;
if(p != null)
dp = new BukkitPlayer(p);
core.listenerManager.processChatEvent(EventType.PLAYER_CHAT, dp, msg);
}
});
}
示例5: onWorldLoad
@HookHandler(priority = Priority.PASSIVE)
public void onWorldLoad(final LoadWorldHook hook) {
final World world = hook.getWorld();
if (zownManager.isLoaded(world)) {
LOG.debug("Zowns are already loaded for world " + world.getFqName() + ", skipping.");
} else {
zownManager.loadZowns(world);
}
}
示例6: onBlockRedstone
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onBlockRedstone(RedstoneChangeHook event) {
Location loc = event.getSourceBlock().getLocation();
String wn = getWorld(loc.getWorld()).getName();
sscache.invalidateSnapshot(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
mapManager.touch(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), "blockredstone");
}
示例7: onBlockGrow
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onBlockGrow(BlockGrowHook event) {
Location loc = event.getGrowth().getLocation();
String wn = getWorld(loc.getWorld()).getName();
sscache.invalidateSnapshot(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
mapManager.touch(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), "blockgrow");
}
示例8: onBlockFromTo
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onBlockFromTo(FlowHook event) {
Block b = event.getBlockFrom();
BlockType m = b.getType();
if((m != BlockType.WoodPlate) && (m != BlockType.StonePlate) && (m != null))
checkBlock(b, "blockfromto");
b = event.getBlockTo();
m = b.getType();
if((m != BlockType.WoodPlate) && (m != BlockType.StonePlate) && (m != null))
checkBlock(b, "blockfromto");
}
示例9: onBlockPhysics
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onBlockPhysics(BlockPhysicsHook event) {
Block b = event.getBlock();
BlockType m = b.getType();
if(m == null) return;
if ((m == BlockType.WaterFlowing) || (m == BlockType.Water) ||
(m == BlockType.Lava) || (m == BlockType.LavaFlowing) ||
(m == BlockType.Gravel) || (m == BlockType.Sand)) {
checkBlock(b, "blockphysics");
}
}
示例10: onBlockBurn
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onBlockBurn(IgnitionHook event) {
IgnitionCause ic = event.getCause();
if (ic == IgnitionCause.LAVA) {
return;
}
Location loc = event.getBlock().getLocation();
String wn = getWorld(loc.getWorld()).getName();
sscache.invalidateSnapshot(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
if(onburn) {
mapManager.touch(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), "blockburn." + ic);
}
}
示例11: onLeavesDecay
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onLeavesDecay(LeafDecayHook event) {
Location loc = event.getBlock().getLocation();
String wn = getWorld(loc.getWorld()).getName();
sscache.invalidateSnapshot(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
mapManager.touch(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), "leavesdecay");
}
示例12: onBlockBreak
@HookHandler(ignoreCanceled=true,priority=Priority.PASSIVE)
public void onBlockBreak(BlockDestroyHook evt) {
Block b = evt.getBlock();
if(b == null) return; /* Work around for stupid mods.... */
Location l = b.getLocation();
core.listenerManager.processBlockEvent(EventType.BLOCK_BREAK, b.getType().getId(),
getWorld(l.getWorld()).getName(), l.getBlockX(), l.getBlockY(), l.getBlockZ());
}
示例13: onBlockPlace
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onBlockPlace(BlockPlaceHook event) {
Location loc = event.getBlockPlaced().getLocation();
String wn = getWorld(loc.getWorld()).getName();
sscache.invalidateSnapshot(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
mapManager.touch(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), "blockplace");
}
示例14: onPlayerJoin
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onPlayerJoin(ConnectionHook evt) {
final DynmapPlayer dp = new BukkitPlayer(evt.getPlayer());
// Give other handlers a change to prep player (nicknames and such from Essentials)
server.scheduleServerTask(new Runnable() {
@Override
public void run() {
core.listenerManager.processPlayerEvent(EventType.PLAYER_JOIN, dp);
}
}, 2);
}
示例15: onWorldLoad
@HookHandler(priority=Priority.PASSIVE, ignoreCanceled=true)
public void onWorldLoad(LoadWorldHook event) {
CanaryModWorld w = getWorld(event.getWorld());
if(core.processWorldLoad(w)) /* Have core process load first - fire event listeners if good load after */
core.listenerManager.processWorldEvent(EventType.WORLD_LOAD, w);
}