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


Java EntityGhast類代碼示例

本文整理匯總了Java中net.minecraft.entity.monster.EntityGhast的典型用法代碼示例。如果您正苦於以下問題:Java EntityGhast類的具體用法?Java EntityGhast怎麽用?Java EntityGhast使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EntityGhast類屬於net.minecraft.entity.monster包,在下文中一共展示了EntityGhast類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addCollisionBoxToList

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
@SuppressWarnings("deprecation")
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
	if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)) {
		entityIn.attackEntityFrom(DamageSource.MAGIC, 1);
	}
	if (entityIn instanceof EntityBlaze) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityEnderman) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityGhast) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityVex) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:23,代碼來源:BlockSaltBarrier.java

示例2: shouldAttackEntity

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:22,代碼來源:EntityWolf.java

示例3: shouldAttackEntity

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) {
	if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) {
		if (p_142018_1_ instanceof EntityFrienderman) {
			EntityFrienderman frienderman = (EntityFrienderman) p_142018_1_;

			if (frienderman.isTamed() && frienderman.getOwner() == p_142018_2_) {
				return false;
			}
		}

		return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame();
	}
	else {
		return false;
	}
}
 
開發者ID:p455w0rd,項目名稱:EndermanEvolution,代碼行數:17,代碼來源:EntityFrienderman.java

示例4: shouldAttackEntity

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof AbstractHorse) || !((AbstractHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:22,代碼來源:EntityWolf.java

示例5: onClickAir

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
@Override
public void onClickAir(PossessivePlayer possessivePlayer, EntityPlayer player) {
    EntityGhast possessing = (EntityGhast) possessivePlayer.getPossessing();
    if (!player.worldObj.isRemote && this.getData(player).getShort("ProjectileCooldown") <= 0) {
        player.worldObj.playEvent(null, 1018, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ), 0);
        float pitchVelocity = MathHelper.cos(player.rotationPitch * 0.017453292F);
        float velocityX = -MathHelper.sin(player.rotationYaw * 0.017453292F) * pitchVelocity;
        float velocityY = -MathHelper.sin(player.rotationPitch * 0.017453292F);
        float velocityZ = MathHelper.cos(player.rotationYaw * 0.017453292F) * pitchVelocity;
        EntityLargeFireball fireball = new EntityLargeFireball(player.worldObj, player, velocityX + player.motionX, velocityY + player.motionY, velocityZ + player.motionZ);
        fireball.posY = player.posY + player.height / 2.0F + 0.5D;
        player.worldObj.spawnEntityInWorld(fireball);
        this.getData(player).setShort("ProjectileCooldown", (short) 20);
        possessing.setAttacking(true);
    }
}
 
開發者ID:Fararise,項目名稱:Possessed,代碼行數:17,代碼來源:GhastHandler.java

示例6: func_142018_a

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
@Override
public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase)
{
    if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast))
    {
        if (par1EntityLivingBase instanceof EntitySlimeling)
        {
            EntitySlimeling slimeling = (EntitySlimeling) par1EntityLivingBase;

            if (slimeling.isTamed() && slimeling.getOwner() == par2EntityLivingBase)
            {
                return false;
            }
        }

        return !(par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase)) && (!(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame());
    }
    else
    {
        return false;
    }
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:23,代碼來源:EntitySlimeling.java

示例7: isValidTarget

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
private boolean isValidTarget(Entity e)
{
	if (e == null) return false;
	else if (e instanceof EntityPlayer)
	{
		EntityPlayer p = ((EntityPlayer) e);
		if (p.capabilities.isCreativeMode) return false;
		else
		{
			if (kPlayers) return true;
			else if (!kTeam) return false;
			RivalRebelsPlayer rrp = RivalRebels.round.rrplayerlist.getForName(((EntityPlayer) e).getCommandSenderName());
			if (rrp == null) return kTeam;
			if (rrp.rrteam == RivalRebelsTeam.NONE) return !p.getCommandSenderName().equals(username);
			if (rrp.rrteam != team) return kTeam;
			else return false;
		}
	}
	else return (kMobs && (e instanceof EntityRhodes || (e instanceof EntityMob && !(e instanceof EntityAnimal) && !(e instanceof EntityBat) && !(e instanceof EntityVillager) && !(e instanceof EntitySquid)) || e instanceof EntityGhast));
}
 
開發者ID:rodolphito,項目名稱:Rival-Rebels-Mod,代碼行數:21,代碼來源:TileEntityReciever.java

示例8: determineRelation

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
protected Relation determineRelation() {
	if (entity instanceof EntityMob) {
		return Relation.FOE;
	} else if (entity instanceof EntitySlime) {
		return Relation.FOE;
	} else if (entity instanceof EntityGhast) {
		return Relation.FOE;
	} else if (entity instanceof EntityAnimal) {
		return Relation.FRIEND;
	} else if (entity instanceof EntitySquid) {
		return Relation.FRIEND;
	} else if (entity instanceof EntityAmbientCreature) {
		return Relation.FRIEND;
	} else {
		return Relation.UNKNOWN;
	}
}
 
開發者ID:ToroCraft,項目名稱:ToroHealth,代碼行數:18,代碼來源:AbstractHealthDisplay.java

示例9: func_142018_a

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
@Override
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) {
	if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) {
		if (p_142018_1_ instanceof DemoEntityTameable) {
			DemoEntityTameable demoEntityTameable = (DemoEntityTameable) p_142018_1_;

			if (demoEntityTameable.isTamed() && demoEntityTameable.getOwnerEntity() == p_142018_2_) {
				return false;
			}
		}

		return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer
				&& !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_) ? false
						: !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame();
	} else {
		return false;
	}
}
 
開發者ID:worldwidewoogie,項目名稱:demomod,代碼行數:19,代碼來源:DemoEntityTameable.java

示例10: canTargetCreature

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
public boolean canTargetCreature(EntityLivingBase targetMob, EntityLivingBase thisMob)
{
    if (!(targetMob instanceof EntityCreeper) && !(targetMob instanceof EntityGhast))
    {
        if (targetMob instanceof EntityIatWolf)
        {
            EntityIatWolf entitywolf = (EntityIatWolf)targetMob;

            if (entitywolf.isTamed() && entitywolf.getOwner() == thisMob)
            {
                return false;
            }
        }

        return targetMob instanceof EntityPlayer && thisMob instanceof EntityPlayer && !((EntityPlayer)thisMob).canAttackPlayer((EntityPlayer)targetMob) ? false : !(targetMob instanceof EntityHorse) || !((EntityHorse)targetMob).isTame();
    }
    else
    {
        return false;
    }
}
 
開發者ID:Alex-the-666,項目名稱:It-s-About-Time-Minecraft-Mod,代碼行數:22,代碼來源:EntityIatWolf.java

示例11: func_142018_a

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase)
{
    if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast))
    {
        if (par1EntityLivingBase instanceof EntityWolf)
        {
            EntityWolf var3 = (EntityWolf)par1EntityLivingBase;

            if (var3.isTamed() && var3.getOwner() == par2EntityLivingBase)
            {
                return false;
            }
        }

        return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).canAttackPlayer((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).isTame();
    }
    else
    {
        return false;
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:22,代碼來源:EntityWolf.java

示例12: preRenderCallback

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityGhast par1EntityGhast, float par2)
{
    float var4 = ((float)par1EntityGhast.prevAttackCounter + (float)(par1EntityGhast.attackCounter - par1EntityGhast.prevAttackCounter) * par2) / 20.0F;

    if (var4 < 0.0F)
    {
        var4 = 0.0F;
    }

    var4 = 1.0F / (var4 * var4 * var4 * var4 * var4 * 2.0F + 1.0F);
    float var5 = (8.0F + var4) / 2.0F;
    float var6 = (8.0F + 1.0F / var4) / 2.0F;
    GL11.glScalef(var6, var5, var6);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:20,代碼來源:RenderGhast.java

示例13: func_142018_a

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityKortor)
        {
        	EntityKortor entitywolf = (EntityKortor)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:22,代碼來源:EntityKortor.java

示例14: func_142018_a

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityForisZertum)
        {
            EntityForisZertum entitywolf = (EntityForisZertum)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:22,代碼來源:EntityForisZertum.java

示例15: func_142018_a

import net.minecraft.entity.monster.EntityGhast; //導入依賴的package包/類
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityDestroZertum)
        {
            EntityDestroZertum entitywolf = (EntityDestroZertum)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:22,代碼來源:EntityDestroZertum.java


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