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


Java EventPriority.LOW属性代码示例

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


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

示例1: gunRenderEvent

@SubscribeEvent(priority=EventPriority.LOW)
public void gunRenderEvent(RenderPlayerEvent.Pre event) {

	ItemStack item = event.entityPlayer.getHeldItem();

	RenderPlayer rp = event.renderer;
	
	if (item != null && item.getItem() instanceof ItemGun) {
		
		rp.modelBipedMain.aimedBow = true;
		rp.modelArmor.aimedBow = true;
		rp.modelArmorChestplate.aimedBow = true;
	} 
	
	else {
		rp.modelBipedMain.aimedBow = false;
		rp.modelArmor.aimedBow = false;
		rp.modelArmorChestplate.aimedBow = false;
	}
}
 
开发者ID:TeamMonumental,项目名称:FissionWarfare,代码行数:20,代码来源:GunRenderEvent.java

示例2: gunRenderEvent

@SubscribeEvent(priority=EventPriority.LOW)
public void gunRenderEvent(RenderPlayerEvent.Pre event) {

	ItemStack item = event.entityPlayer.getHeldItem();

	RenderPlayer rp = event.renderer;
	
	if (item != null && (item.getItem() instanceof ItemFusionGun || item.getItem() instanceof ItemRocketLauncher)) {

		rp.modelBipedMain.aimedBow = true;
		rp.modelArmor.aimedBow = true;
		rp.modelArmorChestplate.aimedBow = true;
	} else {
		rp.modelBipedMain.aimedBow = false;
		rp.modelArmor.aimedBow = false;
		rp.modelArmorChestplate.aimedBow = false;
	}
}
 
开发者ID:TeamMonumental,项目名称:FusionWarfare,代码行数:18,代码来源:GunRenderEvent.java

示例3: on

@SubscribeEvent(priority = EventPriority.LOW)
public void on(EntityJoinWorldEvent event) {
    if(!event.world.isRemote && event.entity instanceof EntityItem) {
        ItemStack stack = ((EntityItem) event.entity).getEntityItem();
        if(isDisguised(stack)) {
            long time = event.world.getTotalWorldTime() + event.world.rand.nextInt(60) + 40;
            trackedItems.put((EntityItem) event.entity, time);
        }
        if(stack.getItem() instanceof ItemElement && !(event.entity instanceof EntityItemElement)) {
            event.setCanceled(true);
            EntityItem newItem = new EntityItemElement(event.world,
                    event.entity.posX, event.entity.posY, event.entity.posZ,
                    ((EntityItem) event.entity).getEntityItem());
            newItem.delayBeforeCanPickup = ((EntityItem) event.entity).delayBeforeCanPickup;
            newItem.motionX = event.entity.motionX;
            newItem.motionY = event.entity.motionY;
            newItem.motionZ = event.entity.motionZ;
            event.world.spawnEntityInWorld(newItem);
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:21,代码来源:EventHandlerWorld.java

示例4: onPlayerLoggedIn

@SubscribeEvent(priority = EventPriority.LOW)
public void onPlayerLoggedIn(EntityJoinWorldEvent event) {
	if (event.entity instanceof EntityPlayerMP) {
		EntityPlayerMP player = (EntityPlayerMP) event.entity;
		System.out.println("UUID of player: " + player.getUniqueID());
		System.out.println("ID of player: " + event.entity.getEntityId());
		
		UUIDOffline.snw.sendTo(new ActualUUIDMessage(player.getUniqueID().toString()), player);
	}
}
 
开发者ID:TehSomeLuigi,项目名称:UUIDOffline,代码行数:10,代码来源:LoginHandler.java

示例5: onRenderBar

@SubscribeEvent(priority = EventPriority.LOW)
public void onRenderBar(RenderGameOverlayEvent event) {
    if (event.isCancelable() || event.type != ElementType.ALL || mc.thePlayer.getHeldItem() == null ||
            !(mc.thePlayer.getHeldItem().getItem() instanceof IMagicalItem)) {
        return;
    }

    IMagicalItem f = (IMagicalItem) mc.thePlayer.getHeldItem().getItem();

    // Starting position for the buff bar - 2 pixels from the top left corner.
    int xPos = 2;
    int yPos = 100;

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_LIGHTING);
    Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("dynamiccraft", "textures/gui/magic.png"));

    this.drawTexturedModalRect(xPos, yPos, 6, 0, 5, 70);

    int i1;
    if (f.getMagic(mc.thePlayer.getHeldItem()) > 0) {
        i1 = f.getMagic(mc.thePlayer.getHeldItem()) * 70 / f.getMaxMagic(mc.thePlayer.getHeldItem());

        this.drawTexturedModalRect(xPos, yPos + 70 - i1, 0, 70 - i1, 5, i1);
    }

}
 
开发者ID:BRForgers,项目名称:DynamicCraft,代码行数:27,代码来源:GuiMagicBar.java

示例6: onWorldDecoration

@SubscribeEvent(priority = EventPriority.LOW)
public void onWorldDecoration(final DecorateBiomeEvent.Decorate event) {

	if (isGenerationAllowed(event)) {

		// Calculate the range and scaling based on
		// the world sea level. Normal sea level is assumed
		// to be 64, which is the Overworld sea level.
		final int groundLevel = event.world.provider.getAverageGroundLevel();
		final int attempts = (int) (ModOptions.getRubblePileDensity() * ((float) groundLevel / 64F));
		final int maxY = groundLevel - 4;
		final int spread = maxY - MIN_Y;

		// In case someone does something real funky with a
		// dimension.
		if (spread < 1 || attempts < 1)
			return;

		// Use our random routine, but seed with the provided
		// Random. The provided Random seed is deterministic
		// where map gen is concerned.
		final XorShiftRandom random = new XorShiftRandom(event.rand);

		for (int i = 0; i < attempts; i++) {

			final int x = event.chunkX + random.nextInt(16) + 8;
			final int z = event.chunkZ + random.nextInt(16) + 8;
			int y = random.nextInt(spread) + MIN_Y;

			for (int j = 0; j < PLACE_ATTEMPTS; j++) {
				if (event.world.isAirBlock(x, y, z)
						&& BlockManager.pileOfRubble.canBlockStay(event.world, x, y, z)) {
					event.world.setBlock(x, y, z, BlockManager.pileOfRubble);
					break;
				}
				y--;
			}
		}
	}
}
 
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:40,代码来源:BiomeDecorationHandler.java

示例7: chatEvent

@SubscribeEvent(priority = EventPriority.LOW)
public void chatEvent(ServerChatEvent event)
{
	String name = event.player.getDisplayName();
	for (int i = 0; i < chats.size(); i++) {
		if (chats.get(i).getUsername().equals(name)) {
			chats.get(i).send(event.message);
		}
	}
}
 
开发者ID:fatcat32594,项目名称:MineXMPP,代码行数:10,代码来源:MineXMPP.java

示例8: onRenderExperienceBar

@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.LOW)
public void onRenderExperienceBar(RenderGameOverlayEvent event) 
{		
	if (event.isCancelable() || event.type != ElementType.ALL)
		return;
	
	LocX = ConfigBaublesHud.hudPositionX;
	LocY = ConfigBaublesHud.hudPositionY;
	isVertical = ConfigBaublesHud.isVertical;
	scale = ConfigBaublesHud.hudScale;
	if(isVertical == 0)
	{
		LocOffsetY = 15;
		LocOffsetX = 0;
	}
	if(isVertical == 1)
	{
		LocOffsetY = 0;
		LocOffsetX = 15;
	}

	if (mc.inGameHasFocus || mc.currentScreen == null || (mc.currentScreen instanceof GuiChat) || (mc.currentScreen instanceof GuiHud) && !mc.gameSettings.showDebugInfo)
	{ 
		if(ConfigBaublesHud.enable == 0)
			drawBaublesHudIcons(event.resolution);
	}
}
 
开发者ID:gigabit101,项目名称:BaublesHud,代码行数:28,代码来源:HudBaubles.java

示例9: onLoadWorld

@SubscribeEvent(priority=EventPriority.LOW)
public void onLoadWorld(WorldEvent.Load event) {
	if(event.world.provider.dimensionId == 0) {
		if(event.world.isRemote) {
			FMLCommonHandler.instance().bus().register(ModManager.getPlayerTickEventHandler());
		} else {
			ModManager.registerAnvilRecipes();
		}
	}
}
 
开发者ID:Sladki,项目名称:TFC-Cellars-Addon,代码行数:10,代码来源:ChunkEventHandler.java

示例10: onPlayerInteract

@SubscribeEvent(priority=EventPriority.LOW)
public void onPlayerInteract(PlayerInteractEvent event) {
	BlockDoor door = (BlockDoor)Blocks.wooden_door;
	BlockLocation loc = BlockLocation.get(event.world, event.x, event.y, event.z);
	
	if ((event.action != Action.RIGHT_CLICK_BLOCK) ||
	    event.entityPlayer.isSneaking() ||
	    !(loc.getBlock() == door)) return;
	
	int direction = getDoorOrientation(door, loc);
	boolean isOpen = isDoorOpen(door, loc);
	boolean isMirrored = isDoorMirrored(door, loc);
	
	int i = (isMirrored ? -1 : 1);
	switch (direction) {
		case 0: loc = loc.relative(0, 0,  i); break;
		case 1: loc = loc.relative(-i, 0, 0); break;
		case 2: loc = loc.relative(0, 0, -i); break;
		case 3: loc = loc.relative( i, 0, 0); break;
	}
	
	if ((loc.getBlock() == door) &&
	    (getDoorOrientation(door, loc) == direction) &&
	    (isDoorOpen(door, loc) == isOpen) &&
	    (isDoorMirrored(door, loc) != isMirrored))
		door.onBlockActivated(loc.world, loc.x, loc.y, loc.z, event.entityPlayer, event.face, 0, 0, 0);
}
 
开发者ID:copygirl,项目名称:copycore,代码行数:27,代码来源:TweakDoubleDoorInteraction.java

示例11: playerDies

@SubscribeEvent(priority = EventPriority.LOW)
public void playerDies(LivingDeathEvent event)
{
    if (Utils.notNullAndInstanceOf(event.entity, EntityPlayer.class))
    {
        EntityPlayer player = (EntityPlayer) event.entity;
        if (!player.worldObj.isRemote)
        {
            //LogHelper.info("Player died");
            BackpackProperty props = BackpackProperty.get(player);

            if (props.hasWearable())
            {
                //We want to keep the wearables on the player if KeepInventory is active.
                if (!player.getEntityWorld().getGameRules().getGameRuleBooleanValue("keepInventory"))
                {
                    //So if it isn't, we drop it like it's hot, drop it like it's hot, drop it like it's hot.
                    ((IBackWearableItem) props.getWearable().getItem()).onPlayerDeath(player.worldObj, player, props.getWearable());
                }
            }

            if (props.isForcedCampFire())
            {
                ChunkCoordinates lastCampFire = BackpackProperty.get(player).getCampFire();
                if (lastCampFire != null)
                {
                    player.setSpawnChunk(lastCampFire, false, player.dimension);
                }
                //Set the forced spawn coordinates on the campfire. False, because the player must respawn at spawn point if there's no campfire.
            }
            ServerProxy.storePlayerProps(player);
        }
    }
    event.setResult(Event.Result.ALLOW);
}
 
开发者ID:Darkona,项目名称:AdventureBackpack2,代码行数:35,代码来源:PlayerEventHandler.java

示例12: playerInteract

@SubscribeEvent(priority = EventPriority.LOW)
public void playerInteract(PlayerInteractEvent event){
    if(!Config.convertMultipartsToBlocks && event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote) {
        if(placing.get() != null) return;//for mods that do dumb stuff and call this event like MFR
        placing.set(event);
        if(place(event.entityPlayer, event.entityPlayer.worldObj)) event.setCanceled(true);
        placing.set(null);
    }
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:9,代码来源:FMPPlacementListener.java


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