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


Java EntityThrowable类代码示例

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


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

示例1: doRender

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
@Override
public void doRender(EntityThrowable entity, double x, double y, double z, float yaw, float partialTick) {
	GlStateManager.pushMatrix();
	GlStateManager.translate(x, y, z);
	GlStateManager.pushAttrib();
	GlStateManager.enableBlend();
	GlStateManager.enableLighting();
	GlStateManager.enableTexture2D();
	GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GlStateManager.scale(1.5F, 0.5F, 1.5F);
	this.bindTexture(this.getEntityTexture(entity));
	Tessellator tessellator = Tessellator.getInstance();
	WorldRenderer renderer = tessellator.getWorldRenderer();
	GlStateManager.rotate(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
	GlStateManager.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
	float rgb = this.getRgb(entity);
	GlStateManager.color(rgb, rgb, rgb);
	renderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL);
	renderer.pos(-0.5D, -0.25D, 0.0D).tex(0, 1).normal(0.0F, 1.0F, 0.0F).endVertex();
	renderer.pos(0.5D, -0.25D, 0.0D).tex(1, 1).normal(0.0F, 1.0F, 0.0F).endVertex();
	renderer.pos(0.5D, 0.75D, 0.0D).tex(1, 0).normal(0.0F, 1.0F, 0.0F).endVertex();
	renderer.pos(-0.5D, 0.75D, 0.0D).tex(0, 0).normal(0.0F, 1.0F, 0.0F).endVertex();
	tessellator.draw();
	GlStateManager.popAttrib();
	GlStateManager.popMatrix();
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:27,代码来源:RenderEntitySwordBeam.java

示例2: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
@Override
public void attackEntityWithRangedAttack(EntityLivingBase sucker, float par2) {
	if (worldObj.isRemote)
		return;
	final EntityCosmeticShadowRiser ecsr = new EntityCosmeticShadowRiser(worldObj);
	ecsr.setPosition(posX, posY + getEyeHeight(), posZ);
	worldObj.spawnEntityInWorld(ecsr);
	final boolean harm_undead = sucker.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
	final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(sucker.posX - 8.0, sucker.posY - 16.0, sucker.posZ - 8.0,
			sucker.posX + 8.0, sucker.posY + 16.0, sucker.posZ + 8.0);
	if (!harm_undead) {
		final List li = worldObj.getEntitiesWithinAABBExcludingEntity(this, bb);
		for (final Object obj : li)
			if (obj instanceof EntityNyxSkeleton) {
				final EntityThrowable entityball = new EntityShadowBall(worldObj, this, false, true);
				final Entity target = (Entity) obj;
				entityball.setPosition(target.posX, target.posY + 32 + worldObj.rand.nextFloat() * 32, target.posZ);
				entityball.setThrowableHeading(0, -1, 0, 0.40F, 0F);
				worldObj.spawnEntityInWorld(entityball);
			}
	}
	final EntityThrowable entitysmite = new EntityShadowBall(worldObj, this, harm_undead, true);
	entitysmite.setPosition(sucker.posX, sucker.posY + 32 + worldObj.rand.nextFloat() * 32, sucker.posZ);
	entitysmite.setThrowableHeading(0, -1, 0, 0.40F, 0F);
	worldObj.spawnEntityInWorld(entitysmite);
}
 
开发者ID:TheDaemoness,项目名称:IceAndShadow2,代码行数:27,代码来源:EntityNyxNecromancer.java

示例3: doShadowAttack

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
public void doShadowAttack(EntityLivingBase par1EntityLiving, float par2) {
	final boolean harm_undead = par1EntityLiving.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
	final EntityThrowable entityball = new EntityShadowBall(worldObj, this, harm_undead,
			IaSWorldHelper.getRegionLevel(par1EntityLiving) >= 6);

	final double d0 = par1EntityLiving.posX + par1EntityLiving.motionX - posX;
	final double d1 = par1EntityLiving.posY + par1EntityLiving.getEyeHeight() - getEyeHeight() - posY;
	final double d2 = par1EntityLiving.posZ + par1EntityLiving.motionZ - posZ;
	final float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);

	if (f1 <= 2.0) {
		entityball.setThrowableHeading(d0, d1, d2, 0.40F, 8.0F);
	} else {
		entityball.rotationPitch += 20.0F;
	}
	entityball.setThrowableHeading(d0, d1 + f1 * 0.2F, d2, 0.80F, 8.0F);
	worldObj.spawnEntityInWorld(entityball);
}
 
开发者ID:TheDaemoness,项目名称:IceAndShadow2,代码行数:19,代码来源:EntityNyxSkeleton.java

示例4: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase,
		float f) {
	EntityThrowable ent = entitySelect(this.worldObj);
	double toX = entitylivingbase.posX - this.posX;
	float percentToMouth = 0.5F;
	double toY = entitylivingbase.posY + this.height * percentToMouth
			- 1.0D - ent.posY;
	double toZ = entitylivingbase.posZ - this.posZ;
	float f1 = MathHelper.sqrt_double(toX * toX + toZ * toZ) * 0.2F;
	ent.setThrowableHeading(toX, toY + f1, toZ, 1.6F, 12.0F);
	playSound("random.bow", 1.0F,
			1.0F / (getRNG().nextFloat() * 0.4F + 0.8F));
	this.worldObj.spawnEntityInWorld(ent);
	if (entitylivingbase instanceof EntityCreature) {
		((EntityCreature) entitylivingbase).setAttackTarget(this);
	}
}
 
开发者ID:TheTemportalist,项目名称:CountryGamer_PlantsVsZombies,代码行数:18,代码来源:EntityPlantShooterBase.java

示例5: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f)
{
  if (entitySelect(this.worldObj) != null)
  {
    int numbPods = this.min + (int)(Math.random() * (this.max - this.min + 1));
    for (int i = 0; i < numbPods; i++) {
      EntityThrowable ent = entitySelect(this.worldObj);
      double toX = entitylivingbase.posX - this.posX;
      float percentToMouth = 0.5F;
      double toY = entitylivingbase.posY + this.height * percentToMouth - 1.0D - ent.posY;
      double toZ = entitylivingbase.posZ - this.posZ;
      float f1 = MathHelper.sqrt_double(toX * toX + toZ * toZ) * 0.2F;
      ent.setThrowableHeading(toX, toY + f1, toZ, 1.6F, 12.0F);
      playSound("random.bow", 1.0F, 1.0F / (getRNG().nextFloat() * 0.4F + 0.8F));
      this.worldObj.spawnEntityInWorld(ent);
    }
  }
}
 
开发者ID:TheTemportalist,项目名称:CountryGamer_PlantsVsZombies,代码行数:19,代码来源:EntityFumeShroom.java

示例6: initializeEntityActivationState

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:45,代码来源:ActivationRange.java

示例7: findTarget

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
private Entity findTarget()
{
	Iterator iter = worldObj.loadedEntityList.iterator();
	Entity target = null;
	double priority = 0;
	while(iter.hasNext())
	{
		Entity e = (Entity) iter.next();
		if (e != this && !e.isDead && (!(e instanceof EntityLivingBase) || ((EntityLivingBase)e).getHealth()>0) && (!(e instanceof EntityRhodes) || (RivalRebels.rhodesFF && (RivalRebels.rhodesCC || ((EntityRhodes)e).colorType != colorType))) &&
			!( e instanceof EntityThrowable
			|| e instanceof EntityInanimate
			|| e instanceof EntityItem
			|| e instanceof EntityAnimal
			|| e instanceof EntityVillager
			|| e instanceof EntityBat
			|| e instanceof EntitySquid
			|| e instanceof EntityBoat
			|| e instanceof EntityMinecart))
		{
			double prio = getPriority(e)-getDistanceToEntity(e);
			if (prio > priority)
			{
				target = e;
				priority = prio;
			}
		}
	}
	return target;
}
 
开发者ID:rodolphito,项目名称:Rival-Rebels-Mod,代码行数:30,代码来源:EntityRhodes.java

示例8: getShooter

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
private Entity getShooter(Entity ent) 
{
	return ent instanceof EntityArrow ? ((EntityArrow)ent).shootingEntity :
		ent instanceof EntityThrowable ? ((EntityThrowable)ent).getThrower() :
			ent instanceof EntityDartBase ? ((EntityDartBase)ent).shootingEntity :
				ent instanceof EntityFireball ? ((EntityFireball)ent).shootingEntity :
						null;
}
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:9,代码来源:AbilityRepulsion.java

示例9: onItemRightClick

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
@Override
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
   {
	ItemStack itemstack = playerIn.getHeldItem(handIn);

       if (!playerIn.capabilities.isCreativeMode)
       {
           itemstack.shrink(1);
       }

       //It seems like it's playing a sound to null player.
	//But it seems to work regardless? This might be a bug within multiplayer. We'll have to check.
       worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));

       if (!worldIn.isRemote)
       {
       	EntityThrowable rock = new EntityRockNormal(worldIn, playerIn);
       	switch(type)
           {
           	
           	case NORMAL: rock = new EntityRockNormal(worldIn, playerIn);
           		break;
			case FLAT: rock = new EntityRockFlat(worldIn, playerIn);
				break;
			default:
				break;
           }

		rock.shoot(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F); //rock.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
           //wtf is "shoot"? //Forge changed their shit
           worldIn.spawnEntity(rock);
       }
       
       return new ActionResult<>(EnumActionResult.SUCCESS, itemstack);
   }
 
开发者ID:theishiopian,项目名称:ForageCraft,代码行数:36,代码来源:RockItem.java

示例10: initializeEntityActivationState

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityFallingBlock // PaperSpigot - Always tick falling blocks
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
开发者ID:CyberdyneCC,项目名称:Thermos,代码行数:46,代码来源:ActivationRange.java

示例11: shootTwins

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
private void shootTwins(World world, EntityPlayer player, float velocityFactor, float damage) {
  Vec3d vecCrossRight = player.getLookVec().normalize().crossProduct(new Vec3d(0, 2, 0));
  Vec3d vecCrossLeft = player.getLookVec().normalize().crossProduct(new Vec3d(0, -2, 0));
  EntityThrowable projRight = createBullet(world, player, damage);
  projRight.posX += vecCrossRight.x;
  projRight.posZ += vecCrossRight.z;
  this.launchProjectile(world, player, projRight, velocityFactor);
  EntityThrowable projLeft = createBullet(world, player, damage);
  projLeft.posX += vecCrossLeft.x;
  projLeft.posZ += vecCrossLeft.z;
  this.launchProjectile(world, player, projLeft, velocityFactor);
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:13,代码来源:BaseItemRapidScepter.java

示例12: launchProjectile

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
protected void launchProjectile(World world, EntityPlayer player, EntityThrowable thing, float velocity) {
  if (!world.isRemote) {
    //zero pitch offset, meaning match the players existing. 1.0 at end ins inn
    thing.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, PITCHOFFSET, velocity, INACCURACY_DEFAULT);
    world.spawnEntity(thing);
  }
  BlockPos pos = player.getPosition();
  UtilSound.playSound(player, pos, getSound(), SoundCategory.PLAYERS);
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:10,代码来源:BaseItemRapidScepter.java

示例13: shootTwins

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
private void shootTwins(World world, EntityPlayer player, float velocityFactor, float damage) {
  Vec3d vecCrossRight = player.getLookVec().normalize().crossProduct(new Vec3d(0, 2, 0));
  Vec3d vecCrossLeft = player.getLookVec().normalize().crossProduct(new Vec3d(0, -2, 0));
  EntityThrowable projRight = createBullet(world, player, damage);
  projRight.posX += vecCrossRight.x;
  projRight.posZ += vecCrossRight.z;
  this.launchProjectile(world, player, projRight, velocityFactor * VELOCITY_MAX);
  EntityThrowable projLeft = createBullet(world, player, damage);
  projLeft.posX += vecCrossLeft.x;
  projLeft.posZ += vecCrossLeft.z;
  this.launchProjectile(world, player, projLeft, velocityFactor * VELOCITY_MAX);
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:13,代码来源:BaseItemChargeScepter.java

示例14: doThrow

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
public void doThrow(World world, EntityPlayer player, EnumHand hand, EntityThrowable thing, float velocity) {
  if (!world.isRemote) {
    // func_184538_a
    //zero pitch offset, meaning match the players existing. 1.0 at end ins inn
    thing.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, PITCHOFFSET, velocity, INACCURACY_DEFAULT);
    world.spawnEntity(thing);
  }
  player.swingArm(hand);
  BlockPos pos = player.getPosition();
  UtilSound.playSound(player, pos, getSound(), SoundCategory.PLAYERS, 0.5F);
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:12,代码来源:BaseItemProjectile.java

示例15: initializeEntityActivationState

import net.minecraft.entity.projectile.EntityThrowable; //导入依赖的package包/类
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity.getClass().equals(EntityPlayer.class) && !(entity.getClass().equals(FakePlayer.class))) // Cauldron
            || entity.getClass().equals(EntityThrowable.class)
            || entity.getClass().equals(EntityDragon.class)
            || entity.getClass().equals(EntityDragonPart.class)
            || entity.getClass().equals(EntityWither.class)
            || entity.getClass().equals(EntityFireball.class)
            || entity.getClass().equals(EntityWeatherEffect.class)
            || entity.getClass().equals(EntityTNTPrimed.class)
            || entity.getClass().equals(EntityFallingBlock.class)
            || entity.getClass().equals(EntityEnderCrystal.class)
            || entity.getClass().equals(EntityFireworkRocket.class)
            || entity.getClass().equals(EntityVillager.class)
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
开发者ID:Bogdan-G,项目名称:FFoKC,代码行数:46,代码来源:ActivationRange.java


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