当前位置: 首页>>代码示例>>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;未经允许,请勿转载。