當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。