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


Java EntityEvent类代码示例

本文整理汇总了Java中net.minecraftforge.event.entity.EntityEvent的典型用法代码示例。如果您正苦于以下问题:Java EntityEvent类的具体用法?Java EntityEvent怎么用?Java EntityEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityConstructing(EntityEvent.EntityConstructing event) {
    if(event.entity instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) event.entity;
        if(PlayerSymptoms.getForPlayer(player) == null) {
            PlayerSymptoms.addToPlayer(player);

            HealthMod.debug("Adding symptoms");
            PlayerSymptoms.getForPlayer(player).addSymptom(new SymptomFever().instantiate(0));
            PlayerSymptoms.getForPlayer(player).addSymptom(new SymptomNausea().instantiate(2));
        }

        if(PlayerBodyProperties.getForPlayer(player) == null) {
            PlayerBodyProperties.addToPlayer(player);
        }

        if(PlayerDiseases.getForPlayer(player) == null) {
            PlayerDiseases.addToPlayer(player);
        }
    }
}
 
开发者ID:meew0,项目名称:HealthMod,代码行数:22,代码来源:HealthModEventHandler.java

示例2: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityConstructing(EntityEvent.EntityConstructing event)
{
	if (event.entity instanceof EntityPlayer && ARKPlayer.get((EntityPlayer) event.entity) == null)
	{
		ARKPlayer.register((EntityPlayer) event.entity, event.entity.worldObj);
		if (event.entity.worldObj.isRemote) // On client
		{
			LogHelper.info("ARKPlayerEventHandler: Registered a new ARKPlayer on client.");
		}
		else
		{
			LogHelper.info("ARKPlayerEventHandler: Registered a new ARKPlayer on server.");
		}
	}
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:17,代码来源:ItemsCommonEventHandler.java

示例3: onEnterChunk

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEnterChunk(EntityEvent.EnteringChunk event)
{
    if(FMLCommonHandler.instance().getEffectiveSide().isServer() && (event.entity instanceof EntityMeteorite || event.entity instanceof EntityPigzilla) && !event.entity.isDead)
    {
        ForgeChunkManager.Ticket ticket = ChunkLoadHandler.tickets.get(event.entity);
        if(ticket == null)
        {
            ticket = ForgeChunkManager.requestTicket(ItFellFromTheSky.instance, event.entity.worldObj, ForgeChunkManager.Type.ENTITY);
            if(ticket != null)
            {
                ticket.bindEntity(event.entity);
                ChunkLoadHandler.addTicket(event.entity, ticket);
            }
        }
        if(ticket != null)
        {
            if(event.oldChunkX != 0 && event.oldChunkZ != 0)
            {
                ForgeChunkManager.unforceChunk(ticket, new ChunkCoordIntPair(event.oldChunkX, event.oldChunkZ));
            }
            ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(event.newChunkX, event.newChunkZ));
        }
    }
}
 
开发者ID:iChun,项目名称:ItFellFromTheSky,代码行数:26,代码来源:EventHandler.java

示例4: onPlayerJoinWorld

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@ForgeSubscribe
public void onPlayerJoinWorld(EntityEvent.EntityConstructing event)
{
    if (event.entity != null)
        if (event.entity.worldObj != null)
            if (!event.entity.worldObj.isRemote)
                if (event.entity instanceof EntityPlayer)
                {
                    EntityPlayer player = (EntityPlayer) event.entity;
                    if (player
                            .getExtendedProperties(R0b0tsPlayerProperties.IDENTIFIER) == null)
                        player.registerExtendedProperties(
                                R0b0tsPlayerProperties.IDENTIFIER,
                                new R0b0tsPlayerProperties());
                }
}
 
开发者ID:PaleoCrafter,项目名称:R0b0ts,代码行数:17,代码来源:PlayerHandler.java

示例5: onEntityConstructEvent

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onEntityConstructEvent(EntityEvent.EntityConstructing event)
{
    Entity entity = event.getEntity();
    if(entity instanceof EntityLivingBase) {
        ((EntityLivingBase) entity).getAttributeMap().registerAttribute(PHYSICAL_DAMAGE_RATE);
        ((EntityLivingBase) entity).getAttributeMap().registerAttribute(FIRE_DAMAGE_RATE);
    }
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:10,代码来源:Attributes.java

示例6: entityConstruct

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void entityConstruct(EntityEvent.EntityConstructing e){
	//add custom properties to players
  if(e.entity instanceof EntityPlayer){
    if(e.entity.getExtendedProperties(PlayerProperties.ID) == null){
      e.entity.registerExtendedProperties(PlayerProperties.ID, new PlayerProperties());
    }
  }
}
 
开发者ID:ImagicTheCat,项目名称:FundamentalChemistry,代码行数:10,代码来源:ForgeEventHandler.java

示例7: entityConstructing

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void entityConstructing(final EntityEvent.EntityConstructing event) {

	if (event.getEntity() instanceof EntityPlayerSP) {
		//System.out.println("Constructing player");
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:8,代码来源:TF2EventsClient.java

示例8: entityConstructing

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void entityConstructing(final EntityEvent.EntityConstructing event) {

	
	if (event.getEntity() instanceof EntityLivingBase) {
		//event.getEntity().getDataManager().register(ENTITY_UBER, false);
		event.getEntity().getDataManager().register(ENTITY_OVERHEAL, 0f);
	}
	
	if (event.getEntity() instanceof EntityPlayer && TF2UdpClient.instance != null) {
		TF2UdpClient.instance.shutdown();
		TF2UdpClient.instance = null;
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:15,代码来源:TF2EventsCommon.java

示例9: onEntityConstruction

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOW)
public void onEntityConstruction(EntityEvent.EntityConstructing event)
{
    Entity entity = event.getEntity();
    if(entity instanceof EntityPlayer)
    {
        if(entity.world != null)
        {
            if(event.getEntity().world.isRemote)
            {
                CraftingParadise.proxy.registerCustomSky();
            }
        }
    }
}
 
开发者ID:Lumaceon,项目名称:CraftingParadiseMod,代码行数:16,代码来源:EntityHandler.java

示例10: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityConstructing(EntityEvent.EntityConstructing event)
{
    if (event.entity instanceof EntityPlayerMP && GCPlayerStats.get((EntityPlayerMP) event.entity) == null)
    {
        GCPlayerStats.register((EntityPlayerMP) event.entity);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:9,代码来源:AsteroidsPlayerHandler.java

示例11: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityConstructing(EntityEvent.EntityConstructing event)
{
    if (event.entity instanceof EntityPlayerMP && GCPlayerStats.get((EntityPlayerMP) event.entity) == null)
    {
        GCPlayerStats.register((EntityPlayerMP) event.entity);
    }

    if (isClient)
    {
        this.onEntityConstructingClient(event);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:GCPlayerHandler.java

示例12: onEntityConstructingClient

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void onEntityConstructingClient(EntityEvent.EntityConstructing event)
{
	if (event.entity instanceof EntityClientPlayerMP)
	{
		if (GCPlayerStatsClient.get((EntityClientPlayerMP) event.entity) == null)
		{
			GCPlayerStatsClient.register((EntityClientPlayerMP) event.entity);          
		}

		Minecraft.getMinecraft().gameSettings.sendSettingsToServer();
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:GCPlayerHandler.java

示例13: handleEnteringProvince

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void handleEnteringProvince(EntityEvent.EnteringChunk event) {
	if (!(event.getEntity() instanceof EntityPlayerMP)) {
		return;
	}
	EntityPlayerMP player = (EntityPlayerMP) event.getEntity();
	PlayerCivilizationCapabilityImpl.get(player).updatePlayerLocation(event.getNewChunkX(), event.getNewChunkZ());
}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:9,代码来源:CivilizationHandlers.java

示例14: entityEnteredChunk

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void entityEnteredChunk(EntityEvent.EnteringChunk event) {
    Entity entity = event.entity;
    if (entity instanceof LocoBase) {
        if (!entity.worldObj.isRemote) {
            ((LocoBase) entity).forceChunkLoading(event.newChunkX, event.newChunkZ);
        } else {
            ((LocoBase) entity).setupChunks(event.newChunkX, event.newChunkZ);
        }
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:12,代码来源:ChunkLoaderHandler.java

示例15: Entity

import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
public Entity(World p_i1582_1_)
{
    this.entityId = nextEntityID++;
    this.renderDistanceWeight = 1.0D;
    this.boundingBox = AxisAlignedBB.getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
    this.field_70135_K = true;
    this.width = 0.6F;
    this.height = 1.8F;
    this.nextStepDistance = 1;
    this.rand = new Random();
    this.fireResistance = 1;
    this.firstUpdate = true;
    this.entityUniqueID = UUID.randomUUID();
    this.myEntitySize = Entity.EnumEntitySize.SIZE_2;
    this.worldObj = p_i1582_1_;
    this.setPosition(0.0D, 0.0D, 0.0D);

    if (p_i1582_1_ != null)
    {
        this.dimension = p_i1582_1_.provider.dimensionId;
    }

    this.dataWatcher = new DataWatcher(this);
    this.dataWatcher.addObject(0, Byte.valueOf((byte)0));
    this.dataWatcher.addObject(1, Short.valueOf((short)300));
    this.entityInit();

    extendedProperties = new HashMap<String, IExtendedEntityProperties>();

    MinecraftForge.EVENT_BUS.post(new EntityEvent.EntityConstructing(this));

    for (IExtendedEntityProperties props : this.extendedProperties.values())
    {
        props.init(this, p_i1582_1_);
    }
}
 
开发者ID:wildex999,项目名称:TickDynamic,代码行数:37,代码来源:Entity.java


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