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


Java EventPriority.LOWEST属性代码示例

本文整理汇总了Java中cpw.mods.fml.common.eventhandler.EventPriority.LOWEST属性的典型用法代码示例。如果您正苦于以下问题:Java EventPriority.LOWEST属性的具体用法?Java EventPriority.LOWEST怎么用?Java EventPriority.LOWEST使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在cpw.mods.fml.common.eventhandler.EventPriority的用法示例。


在下文中一共展示了EventPriority.LOWEST属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: denyCraft

@SubscribeEvent(priority = EventPriority.LOWEST)
public void denyCraft(final ToolBuildEvent event) {
    if (ExtraUtils.tcon_unstable_material_id <= 0) {
        return;
    }
    final WorldServer world = DimensionManager.getWorld(0);
    if (world == null) {
        return;
    }
    if (isToolExpired(event.headStack, world) || isToolExpired(event.handleStack, world) || isToolExpired(event.accessoryStack, world) || isToolExpired(event.extraStack, world)) {
        event.headStack = null;
        event.handleStack = null;
        event.accessoryStack = null;
        event.extraStack = null;
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:16,代码来源:TConEvents.java

示例2: onServerChat

@SubscribeEvent(priority=EventPriority.LOWEST)
public void onServerChat(ServerChatEvent e)
{
    EntityPlayerMP sender = e.player;
    List<EntityPlayerMP> players = MinecraftServer.getServer().getConfigurationManager().playerEntityList;


    String finalMessage = ChatFormatter.ChatParser(sender);


    for (EntityPlayerMP receiver : players)
    {receiver.addChatMessage(new ChatComponentText(finalMessage + "<" + e.username + ">: " + e.message));
    }

    BetterChat.bLog.info(sender.getDisplayName() + " said: " + e.message);
    e.setCanceled(true);
}
 
开发者ID:mads256c,项目名称:BetterChat,代码行数:17,代码来源:EventHandler.java

示例3: onPlayerPearl

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPlayerPearl(EnderTeleportEvent event)
{
    if ( !(event.entityLiving instanceof EntityPlayerMP) )
        return;

    if ( Config.getKnockBack() == 0.0 || !Config.getDenyEnderpearl() )
        return;

    EntityPlayerMP player = (EntityPlayerMP) event.entityLiving;
    Log.trace( "Caught pearl teleport event by %s", player.getDisplayName() );

    Location target = new Location(event, player);
    Location newLoc = BorderCheck.checkPlayer(player, target, true, true);

    if (newLoc != null)
    {
        event.setCanceled(true);
        event.targetX = newLoc.posX;
        event.targetY = newLoc.posY;
        event.targetZ = newLoc.posZ;
    }
}
 
开发者ID:RoyCurtis,项目名称:WorldBorder-Forge,代码行数:23,代码来源:EnderPearlListener.java

示例4: onWorldDecoration

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onWorldDecoration(DecorateBiomeEvent.Decorate event) 
{
	if ((event.getResult() == Result.ALLOW || event.getResult() == Result.DEFAULT) && event.type == EventType.FLOWERS) 
	{
		for(int i = 0; i < 2; i++) 
		{
			int x = event.chunkX + event.rand.nextInt(16) + 8;
			int z = event.chunkZ + event.rand.nextInt(16) + 8;
			int y = event.world.getTopSolidOrLiquidBlock(x, z);

			if(event.world.isAirBlock(x, y, z) && Blocks.flower_pot.canBlockStay(event.world, x, y, z) && ConfigPrimitiveCraft.genrocks)
			{
				event.world.setBlock(x, y, z, ModBlocks.rock);
			}
			else if(event.world.getBlock(x, y, z) == Blocks.water && ConfigPrimitiveCraft.genshale)
			{
				event.world.setBlock(x, y-1, z, ModBlocks.shale);
			}
		}
	}
}
 
开发者ID:gigabit101,项目名称:PrimitiveCraft,代码行数:22,代码来源:WorldGenStones.java

示例5: playerInteractEvent

@SubscribeEvent(priority = EventPriority.LOWEST)
public void playerInteractEvent(PlayerInteractEvent event)
{
    WorldInteractLogEvent log = new WorldInteractLogEvent();

    log.setType(TYPE_INTERACT_WORLD);
    if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR)
    {
        log.setPlayerPosAndUuid(event.entityPlayer);
    }
    else
    {
        log.setPlayerUUID(event.entityPlayer);
        log.setPosition(event.entity.dimension, event.x, event.y, event.z);
        log.setData(event.action, event.face, event.entityPlayer.getCurrentEquippedItem());
    }

    LoggingQueue.addToQueue(log);
}
 
开发者ID:DoubleDoorDevelopment,项目名称:D3Log,代码行数:19,代码来源:ForgeEventHandlers.java

示例6: onBiomeDecoration

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onBiomeDecoration(DecorateBiomeEvent.Decorate event)
{
    if (event.type == DecorateBiomeEvent.Decorate.EventType.FLOWERS && (event.getResult() == Event.Result.ALLOW || event.getResult() == Event.Result.DEFAULT))
    {
        for (int i = 0; i < Settings.FLOWER_QUANTITY; i++)
        {
            int x = event.chunkX + event.rand.nextInt(16) + 8;
            int z = event.chunkZ + event.rand.nextInt(16) + 8;
            int y = event.world.getTopSolidOrLiquidBlock(x, z);
            Block randomPlant = ModBlocks.plants[event.rand.nextInt(ModBlocks.plants.length)];

            if (event.world.isAirBlock(x, y, z) && (!event.world.provider.hasNoSky || y < 255) && randomPlant.canBlockStay(event.world, x, y, z))
            {
                event.world.setBlock(x, y, z, randomPlant, 0, 2);
            }
        }
    }
}
 
开发者ID:Dynious,项目名称:Biota,代码行数:19,代码来源:TerrainEventHandler.java

示例7: blockBreakEvent

@SubscribeEvent(priority = EventPriority.LOWEST)
public void blockBreakEvent(BlockEvent.BreakEvent event)
{
    BlockSnapshotLogEvent log = new BlockSnapshotLogEvent();

    log.setType(TYPE_BLOCK_BREAK);
    log.setPlayerUUID(event.getPlayer());
    log.setPosition(event.world.provider.dimensionId, event.x, event.y, event.z);
    NBTTagCompound nbt = null;
    if (event.block.hasTileEntity(event.blockMetadata))
    {
        TileEntity te = event.world.getTileEntity(event.x, event.y, event.z);
        if (te != null)
        {
            nbt = new NBTTagCompound();
            te.writeToNBT(nbt);
        }
    }
    log.setData(new BlockSnapshot(event.world, event.x, event.y, event.z, event.block, event.blockMetadata, nbt));

    LoggingQueue.addToQueue(log);
}
 
开发者ID:DoubleDoorDevelopment,项目名称:D3Log,代码行数:22,代码来源:ForgeEventHandlers.java

示例8: onWorldDecoration

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onWorldDecoration(DecorateBiomeEvent.Decorate event) {
    BiomeGenBase biome = event.world.getBiomeGenForCoords(event.chunkX, event.chunkZ);
    if (biome != null && isValidBiomeType(biome)) {
        if ((event.getResult() == Event.Result.ALLOW || event.getResult() == Event.Result.DEFAULT) && event.type == DecorateBiomeEvent.Decorate.EventType.FLOWERS) {
            for (int i = 0; i < ModLibs.manaFlowerQuantity; i++) {
                int x = event.chunkX + event.rand.nextInt(16) + 8;
                int z = event.chunkZ + event.rand.nextInt(16) + 8;
                int y = event.world.getTopSolidOrLiquidBlock(x, z);

                for (int j = 0; j < ModLibs.manaFlowerDensity; j++) {
                    int x1 = x + event.rand.nextInt(8) - event.rand.nextInt(8);
                    int y1 = y + event.rand.nextInt(4) - event.rand.nextInt(4);
                    int z1 = z + event.rand.nextInt(8) - event.rand.nextInt(8);

                    if (event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.manaFlower.canBlockStay(event.world, x1, y1, z1))
                        event.world.setBlock(x1, y1, z1, ModBlocks.manaFlower, event.rand.nextInt(3), 2);
                }
            }
        }
    }
}
 
开发者ID:Lomeli12,项目名称:MagicalRings,代码行数:22,代码来源:BiomeDecorHandler.java

示例9: onLivingDrop

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onLivingDrop(LivingDropsEvent event)
{
    if (event.entityLiving instanceof EntityCreeper)
    {
        boolean foundRecord = false;
        Iterator<EntityItem> iter = event.drops.iterator();
        while (iter.hasNext())
        {
            EntityItem e = iter.next();
            if (e.getEntityItem().getItem() instanceof ItemRecord)
            {
                foundRecord = true;
            }
        }

        if (foundRecord)
        {
            addRandomRecordToDrops(event.drops);
        }
    }
}
 
开发者ID:tterrag1098,项目名称:CustomThings,代码行数:22,代码来源:LivingDropsHandler.java

示例10: onServerTick

/** Uses lowest event priority to run after everything else has */
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onServerTick(TickEvent.ServerTickEvent event)
{
    // Only run at end of tick to catch players that just moved past border
    if (event.phase == TickEvent.Phase.START)
        return;

    if ( WorldBorder.SERVER.getTickCounter() % Config.getTimerTicks() != 0 )
        return;

    for (Object o : WorldBorder.SERVER.getConfigurationManager().playerEntityList)
        BorderCheck.checkPlayer( (EntityPlayerMP) o, null, false, true );
}
 
开发者ID:RoyCurtis,项目名称:WorldBorder-Forge,代码行数:14,代码来源:BorderCheckTask.java

示例11: entityInteractEvent

@SubscribeEvent(priority = EventPriority.LOWEST)
public void entityInteractEvent(EntityInteractEvent event)
{
    EntityInteractLogEvent log = new EntityInteractLogEvent();

    log.setType(TYPE_INTERACT_ENTITY);
    log.setPlayerPosAndUuid(event.entityPlayer);
    log.setData(event.target, event.entityPlayer.getCurrentEquippedItem());

    LoggingQueue.addToQueue(log);
}
 
开发者ID:DoubleDoorDevelopment,项目名称:D3Log,代码行数:11,代码来源:ForgeEventHandlers.java

示例12: onModify

@SubscribeEvent(priority=EventPriority.LOWEST)
public void onModify(ModifyEvent event){
	String key = event.modifier.key;
	if(incompatibleModifierKeys.containsKey(key)){
		for(String s : incompatibleModifierKeys.get(key))
			if(event.itemStack.getTagCompound().getCompoundTag(event.item.getBaseTagName()).hasKey(s))
			{
				event.setCanceled(true);
				return;
			}
	}
}
 
开发者ID:UnderMybrella,项目名称:TiM,代码行数:12,代码来源:TModifiers.java

示例13: onArrowNock

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onArrowNock(ArrowNockEvent event) {
  EntityPlayer player = event.entityPlayer;
  ItemStack stack = player.getHeldItem();
  if (player.capabilities.isCreativeMode || player.inventory.hasItem(Items.arrow)
      || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0) {
    player.setItemInUse(stack, stack.getItem().getMaxItemUseDuration(stack));
  }

  event.result = stack;
  event.setCanceled(true);
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:12,代码来源:InfiniBow.java

示例14: renderPost

@SubscribeEvent(priority = EventPriority.LOWEST, receiveCanceled = true)
public void renderPost(RenderLivingEvent.Post event) {
    if(event.entity instanceof EntityPlayer) {
        EntityPlayer p = (EntityPlayer) event.entity;
        if(armor != null) {
            p.inventory.armorInventory = armor;
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:9,代码来源:RenderEventHandler.java

示例15: playerEvent_Login

@SubscribeEvent(priority = EventPriority.LOWEST)
public void playerEvent_Login(PlayerEvent.PlayerLoggedInEvent event)
{
    PlayerCache.login(event.player.getGameProfile());

    LogEvent log = new LogEvent();

    log.setType(TYPE_LOGIN);
    log.setPlayerPosAndUuid(event.player);

    LoggingQueue.addToQueue(log);
}
 
开发者ID:DoubleDoorDevelopment,项目名称:D3Log,代码行数:12,代码来源:FMLEventHandler.java


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