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