本文整理汇总了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));
}
示例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));
}
示例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);
}
}
}
示例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 );
}
}
示例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.");
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
示例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());
}
}
示例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);
}
示例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));
}
示例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);
}
}
示例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);
}
}
}