当前位置: 首页>>代码示例>>Java>>正文


Java Priority.PASSIVE属性代码示例

本文整理汇总了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");
    }
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:20,代码来源:DynmapPlugin.java

示例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");
    }
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:20,代码来源:DynmapPlugin.java

示例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);
    }
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:9,代码来源:DynmapPlugin.java

示例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);
        }
    });
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:13,代码来源:DynmapPlugin.java

示例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);
    }
}
 
开发者ID:toddharrison,项目名称:Zown,代码行数:9,代码来源:ZownPlugin.java

示例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");
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:7,代码来源:DynmapPlugin.java

示例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");
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:7,代码来源:DynmapPlugin.java

示例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");
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:11,代码来源:DynmapPlugin.java

示例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");
    }
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:11,代码来源:DynmapPlugin.java

示例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);
    }
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:13,代码来源:DynmapPlugin.java

示例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");
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:7,代码来源:DynmapPlugin.java

示例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());
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:8,代码来源:DynmapPlugin.java

示例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");
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:7,代码来源:DynmapPlugin.java

示例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);
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:11,代码来源:DynmapPlugin.java

示例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);
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:6,代码来源:DynmapPlugin.java


注:本文中的net.canarymod.plugin.Priority.PASSIVE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。