當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityConstructing類代碼示例

本文整理匯總了Java中net.minecraftforge.event.entity.EntityEvent.EntityConstructing的典型用法代碼示例。如果您正苦於以下問題:Java EntityConstructing類的具體用法?Java EntityConstructing怎麽用?Java EntityConstructing使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EntityConstructing類屬於net.minecraftforge.event.entity.EntityEvent包,在下文中一共展示了EntityConstructing類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
	/*
	 * Be sure to check if the entity being constructed is the correct type
	 * for the extended properties you're about to add! The null check may
	 * not be necessary - I only use it to make sure properties are only
	 * registered once per entity
	 */
	if (event.entity instanceof EntityPlayer && ExtendedPlayer.get((EntityPlayer) event.entity) == null)
		// This is how extended properties are registered using our
		// convenient method from earlier
		ExtendedPlayer.register((EntityPlayer) event.entity);
	// That will call the constructor as well as cause the init() method
	// to be called automatically

	// If you didn't make the two convenient methods from earlier, your code
	// would be
	// much uglier:
	if (event.entity instanceof EntityPlayer && event.entity.getExtendedProperties(ExtendedPlayer.EXT_PROP_NAME) == null)
		event.entity.registerExtendedProperties(ExtendedPlayer.EXT_PROP_NAME, new ExtendedPlayer((EntityPlayer) event.entity));
}
 
開發者ID:callumhutchy,項目名稱:Runecraft-2,代碼行數:22,代碼來源:Runecraft2EventHandler.java

示例2: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
	if (event.entity instanceof EntityPlayer) ((EntityPlayer) event.entity).eyeHeight = 0.12F;

	/* Be sure to check if the entity being constructed is the correct type for the extended properties you're about to add! The null check may not be necessary - I only
	 * use it to make sure properties are only registered once per entity */
	if (event.entity instanceof EntityPlayer && ExtendedPlayer.get((EntityPlayer) event.entity) == null)
		// This is how extended properties are registered using our convenient method from earlier
		ExtendedPlayer.register((EntityPlayer) event.entity);
	// That will call the constructor as well as cause the init() method to be called automatically

	// If you didn't make the two convenient methods from earlier, your code would be much uglier:
	if (event.entity instanceof EntityPlayer && event.entity.getExtendedProperties(ExtendedPlayer.EXT_PROP_NAME) == null) event.entity.registerExtendedProperties(ExtendedPlayer.EXT_PROP_NAME,
			new ExtendedPlayer((EntityPlayer) event.entity));


}
 
開發者ID:mookie1097,項目名稱:NausicaaMod,代碼行數:18,代碼來源:NausicaaEventHandler.java

示例3: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event)
{
    if (event.entity instanceof EntityPlayer)
    {
        if (PlayerRoleplayMode.get((EntityPlayer) event.entity) == null)
        {
            PlayerRoleplayMode.register((EntityPlayer) event.entity);
        }
    }
}
 
開發者ID:Zundrel,項目名稱:Ye-Olde-Chat,代碼行數:12,代碼來源:ModEventHandler.java

示例4: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent( priority=EventPriority.HIGHEST )
 public void onEntityConstructing( EntityConstructing event )
 {
 	//Register PlayerPlacedBlocks Entity
 	if( ( event.entity instanceof EntityPlayer ) && 
( LimitedBlockPlayer.get( (EntityPlayer) event.entity ) == null ) )
 	{
 		LimitedBlockPlayer.register( (EntityPlayer) event.entity );
 	}
 }
 
開發者ID:DerOli82,項目名稱:LimitedResources,代碼行數:11,代碼來源:BlockPlacingEvent.java

示例5: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
	if (event.entity instanceof EntityPlayer && DragonPlayer.get((EntityPlayer) event.entity) == null) {
		DragonPlayer.register((EntityPlayer) event.entity, event.entity.worldObj);
		if (event.entity.worldObj.isRemote) // On client
			LogHelper.info("DragonPlayerEventHandler: Registered a new DragonPlayer on client.");
		else
			LogHelper.info("DragonPlayerEventHandler: Registered a new DragonPlayer on server.");
	}
}
 
開發者ID:DracoAnimus,項目名稱:Coding,代碼行數:11,代碼來源:DragonPlayerEventHandler.java

示例6: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
	if (event.entity instanceof EntityPlayer && ExtendedPlayerData.get((EntityPlayer) event.entity) == null){
			EntityPlayer player = (EntityPlayer)event.entity;
			ExtendedPlayerData.register(player);
	}
}
 
開發者ID:MoreThanHidden,項目名稱:DoomShrine,代碼行數:8,代碼來源:DoomEventHandler.java

示例7: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) throws InstantiationException, ReflectiveOperationException, Exception, Throwable {

	if (event.entity instanceof EntityPlayer) 
	{
		if (SkillTrackerData.get((EntityPlayer) event.entity) == null) 
		{
			Skillz.logger.info("Registering skill properties for player");
			SkillTrackerData.register((EntityPlayer) event.entity);
		}
		
		if (StatTrackerData.get((EntityPlayer) event.entity) == null)
		{
			Skillz.logger.info("Registering stat properties for player");
			StatTrackerData.register((EntityPlayer) event.entity);				
		}
		
	}
	else if(event.entity instanceof EntityMob)
	{
		EntityMobsExt.register((EntityMob) event.entity);
	}
	else if(event.entity instanceof EntityAnimal)
	{
		EntityAnimalExt.register((EntityAnimal) event.entity);
	}		
}
 
開發者ID:GenDeathrow,項目名稱:Skills,代碼行數:28,代碼來源:EventHandler.java

示例8: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event)
{
	if(event.entity instanceof EntityLivingBase)
	{
		DamageCounterExtendedProperties.register((EntityLivingBase)event.entity);
	}
}
 
開發者ID:WayofTime,項目名稱:Hemomancy,代碼行數:9,代碼來源:EventHandler.java

示例9: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
	if (event.entity instanceof EntityPlayer) {
		RLMPlayerProps.register((EntityPlayer) event.entity);
	}

}
 
開發者ID:ItsAMysterious,項目名稱:Real-Life-Mod-1.8,代碼行數:8,代碼來源:CommonHandler.java

示例10: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onEntityConstructing(EntityConstructing event) {
	if (event.entity instanceof EntityPlayer && ExtendedPlayer.get((EntityPlayer) event.entity) == null) {
           event.entity.registerExtendedProperties(ExtendedPlayer.identifier, new ExtendedPlayer((EntityPlayer) event.entity));
           event.entity.registerExtendedProperties(ExtendedPlayerAchievements.identifier, new ExtendedPlayerAchievements((EntityPlayer) event.entity));
       }
}
 
開發者ID:TheDarkEra,項目名稱:TheDarkEra,代碼行數:8,代碼來源:TDEEventHandler.java

示例11: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
	/*Be sure to check if the entity being constructed is the correct type for the extended properties you're about to add! The null check may not be necessary - I only use it to make sure properties are only registered once per entity */
	if (event.entity instanceof EntityPlayer && ExtendedPlayer.get((EntityPlayer) event.entity) == null) {
		// NFMain.logger.info("current " + ExtendedPlayer.get((EntityPlayer) event.entity).currentInsanity);
		ExtendedPlayer.register((EntityPlayer) event.entity);
		NFMain.logger.info("Creating new playerExt for ");// + event.entity.getCommandSenderName());
	}

}
 
開發者ID:mookie1097,項目名稱:NightfallMod,代碼行數:11,代碼來源:ProjectZEventHandler.java

示例12: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
	/*
	 * Be sure to check if the entity being constructed is the correct type
	 * for the extended properties you're about to add!The null check may
	 * not be necessary - I only use it to make sure properties are only
	 * registered once per entity
	 */
	if ((event.entity instanceof EntityPlayer)&& (PlayerRpgInventory.get((EntityPlayer) event.entity) == null))
		PlayerRpgInventory.register((EntityPlayer) event.entity);
}
 
開發者ID:ArtixAllMighty,項目名稱:rpginventory,代碼行數:12,代碼來源:RPGEventHooks.java

示例13: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
    if (event.entity instanceof EntityPlayer && ImperiumPlayer.get((EntityPlayer) event.entity) == null)
        ImperiumPlayer.register((EntityPlayer) event.entity);

    if (event.entity instanceof EntityPlayer && event.entity.getExtendedProperties(ImperiumPlayer.EXT_PROP_NAME) == null)
        event.entity.registerExtendedProperties(ImperiumPlayer.EXT_PROP_NAME, new ImperiumPlayer((EntityPlayer) event.entity));
}
 
開發者ID:CosmicDan-Minecraft,項目名稱:Imperium,代碼行數:9,代碼來源:EntityEvents.java

示例14: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@ForgeSubscribe
public void onEntityConstructing(EntityConstructing event)
{
	/*
	Be sure to check if the entity being constructed is the correct type for the extended properties you're about to add! The null check may not be necessary - I only use it to make sure properties are only registered once per entity
	 */
	if (event.entity instanceof EntityPlayer && FCraftJobCore.get((EntityPlayer) event.entity) == null){
		// This is how extended properties are registered using our convenient method from earlier
		FCraftJobCore.register((EntityPlayer) event.entity);
	}else if (event.entity instanceof FCraftEntity && FCraftEntityCore.get((FCraftEntity) event.entity) == null){
		// This is how extended properties are registered using our convenient method from earlier
		FCraftEntityCore.register((FCraftEntity) event.entity);
	}
}
 
開發者ID:Unrelentless,項目名稱:FantasyCraft-Mod,代碼行數:15,代碼來源:FCraftEntityConsturctionHandler.java

示例15: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; //導入依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityConstructing parEvent)
{
	if (parEvent.entity instanceof EntityPlayer)
	{
		EntityPlayer player = (EntityPlayer) parEvent.entity;
		if (ExtendedPropertyHealth.get((EntityPlayer)parEvent.entity) == null)
		{
			ExtendedPropertyHealth.register(player);
		}
	}
}
 
開發者ID:andykuo1,項目名稱:mcplus_mods,代碼行數:13,代碼來源:EventHandlerBattleHearts.java


注:本文中的net.minecraftforge.event.entity.EntityEvent.EntityConstructing類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。