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


Java EntityEvent.EntityConstructing方法代碼示例

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


在下文中一共展示了EntityEvent.EntityConstructing方法的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: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例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);
    }

    if (isClient)
    {
        this.onEntityConstructingClient(event);
    }
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:14,代碼來源:GCPlayerHandler.java

示例11: 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

示例12: onEntityConstructing

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

示例13: onEntityConstructing

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

示例14: onEntityConstructing

import net.minecraftforge.event.entity.EntityEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onEntityConstructing(EntityEvent.EntityConstructing event) {
    Side side = FMLCommonHandler.instance().getEffectiveSide();
    if (side == Side.SERVER) {
        if (event.entity instanceof EntityPlayer) {
            LoreStatusTracker.attachStatusTracker((EntityPlayer) event.entity);
        }
    }
}
 
開發者ID:dmillerw,項目名稱:EventMod,代碼行數:10,代碼來源:EventHandler.java

示例15: on

import net.minecraftforge.event.entity.EntityEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.LOWEST)
public void on(EntityEvent.EntityConstructing e) {
    if(e.entity instanceof EntityGolemBase) {
        EntityGolemBase golem = (EntityGolemBase) e.entity;

        golem.registerExtendedProperties(Gadomancy.MODID, new ExtendedGolemProperties(golem));

        golem.getDataWatcher().addObject(ModConfig.golemDatawatcherId, "");
    }
}
 
開發者ID:makeoo,項目名稱:Gadomancy,代碼行數:11,代碼來源:EventHandlerGolem.java


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