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


Java EntitySnowball.setThrowableHeading方法代码示例

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


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

示例1: tossSnowball

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
private void tossSnowball(EntityLivingBase attackTarget) {
	EntitySnowball entitysnowball = new EntitySnowball(worldObj, this);
	double d = attackTarget.posX - this.posX;
	double d1 = ( attackTarget.posY + (double) attackTarget.getEyeHeight() )
			- 1.1000000238418579D - entitysnowball.posY;
	double d2 = attackTarget.posZ - this.posZ;
	float f = MathHelper.sqrt_double(d * d + d2 * d2) * 0.2F;
	entitysnowball.setThrowableHeading(d, d1 + (double) f, d2, 1.6F, 12F);
	worldObj.playSoundAtEntity(this, "random.bow", 1.0F,
			1.0F / ( this.getRNG().nextFloat() * 0.4F + 0.8F ));
	worldObj.spawnEntityInWorld(entitysnowball);
	attackTime = 30;
	armSwing(!didSwing);
	faceEntity(attackTarget, 180F, 180F);
	snowballin -= 1;

	if (snowballin < 0) {
		snowballin = 0;
	}
}
 
开发者ID:allaryin,项目名称:FairyFactions,代码行数:21,代码来源:EntityFairy.java

示例2: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 */
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_)
{
    EntitySnowball entitysnowball = new EntitySnowball(this.worldObj, this);
    double d0 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D;
    double d1 = p_82196_1_.posX - this.posX;
    double d2 = d0 - entitysnowball.posY;
    double d3 = p_82196_1_.posZ - this.posZ;
    float f = MathHelper.sqrt_double(d1 * d1 + d3 * d3) * 0.2F;
    entitysnowball.setThrowableHeading(d1, d2 + (double)f, d3, 1.6F, 12.0F);
    this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
    this.worldObj.spawnEntityInWorld(entitysnowball);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:16,代码来源:EntitySnowman.java

示例3: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 *  
 * @param distanceFactor How far the target is, normalized and clamped between 0.1 and 1.0
 */
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor)
{
    EntitySnowball entitysnowball = new EntitySnowball(this.world, this);
    double d0 = target.posY + (double)target.getEyeHeight() - 1.100000023841858D;
    double d1 = target.posX - this.posX;
    double d2 = d0 - entitysnowball.posY;
    double d3 = target.posZ - this.posZ;
    float f = MathHelper.sqrt(d1 * d1 + d3 * d3) * 0.2F;
    entitysnowball.setThrowableHeading(d1, d2 + (double)f, d3, 1.6F, 12.0F);
    this.playSound(SoundEvents.ENTITY_SNOWMAN_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
    this.world.spawnEntityInWorld(entitysnowball);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:EntitySnowman.java

示例4: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 *  
 * @param distanceFactor How far the target is, normalized and clamped between 0.1 and 1.0
 */
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor)
{
    EntitySnowball entitysnowball = new EntitySnowball(this.worldObj, this);
    double d0 = target.posY + (double)target.getEyeHeight() - 1.100000023841858D;
    double d1 = target.posX - this.posX;
    double d2 = d0 - entitysnowball.posY;
    double d3 = target.posZ - this.posZ;
    float f = MathHelper.sqrt_double(d1 * d1 + d3 * d3) * 0.2F;
    entitysnowball.setThrowableHeading(d1, d2 + (double)f, d3, 1.6F, 12.0F);
    this.playSound(SoundEvents.ENTITY_SNOWMAN_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
    this.worldObj.spawnEntityInWorld(entitysnowball);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:EntitySnowman.java

示例5: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 */
public void attackEntityWithRangedAttack(EntityLivingBase entity, float damage)
{
	if (System.currentTimeMillis() % 5000 < 2000)
	{
     EntitySnowball entitysnowball = new EntitySnowball(this.worldObj, this);
     double d0 = entity.posX - this.posX;
     double d1 = entity.posY + (double)entity.getEyeHeight() - 1.100000023841858D - entitysnowball.posY;
     double d2 = entity.posZ - this.posZ;
     float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2) * 0.2F;
     entitysnowball.setThrowableHeading(d0, d1 + (double)f1, d2, 1.6F, 12.0F);
     this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
     this.worldObj.spawnEntityInWorld(entitysnowball);
	}
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:18,代码来源:EntitySnowCube.java

示例6: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 */
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
    EntitySnowball var3 = new EntitySnowball(this.worldObj, this);
    double var4 = par1EntityLivingBase.posX - this.posX;
    double var6 = par1EntityLivingBase.posY + (double)par1EntityLivingBase.getEyeHeight() - 1.100000023841858D - var3.posY;
    double var8 = par1EntityLivingBase.posZ - this.posZ;
    float var10 = MathHelper.sqrt_double(var4 * var4 + var8 * var8) * 0.2F;
    var3.setThrowableHeading(var4, var6 + (double)var10, var8, 1.6F, 12.0F);
    this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
    this.worldObj.spawnEntityInWorld(var3);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:15,代码来源:EntitySnowman.java

示例7: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
    EntitySnowball entitysnowball = new EntitySnowball(this.world, this);
    EntityArrow entityarrow = new EntityTippedArrow(this.world, this);
    double d0 = par1EntityLivingBase.posX - this.posX;
    double d1 = par1EntityLivingBase.posY + (double)par1EntityLivingBase.getEyeHeight() - 1.100000023841858D - entitysnowball.posY;
    double d2 = par1EntityLivingBase.posZ - this.posZ;
    float f1 = MathHelper.sqrt(d0 * d0 + d2 * d2) * 0.2F;
    entitysnowball.setThrowableHeading(d0, d1 + (double)f1, d2, 1.6F, 12.0F);
    entityarrow.setThrowableHeading(d0, d1 + (double)f1, d2, 1.6F, 12.0F);
    this.playSound(SoundEvents.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
    this.world.spawnEntity(entityarrow);
    this.world.spawnEntity(entitysnowball);
}
 
开发者ID:elias54,项目名称:Fake-Ores-2,代码行数:15,代码来源:EntityOresBoss.java

示例8: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 */
public void attackEntityWithRangedAttack(EntityLivingBase target, float p_82196_2_)
{
    EntitySnowball entitysnowball = new EntitySnowball(this.worldObj, this);
    double d0 = target.posY + (double)target.getEyeHeight() - 1.100000023841858D;
    double d1 = target.posX - this.posX;
    double d2 = d0 - entitysnowball.posY;
    double d3 = target.posZ - this.posZ;
    float f = MathHelper.sqrt_double(d1 * d1 + d3 * d3) * 0.2F;
    entitysnowball.setThrowableHeading(d1, d2 + (double)f, d3, 1.6F, 12.0F);
    this.playSound(SoundEvents.ENTITY_SNOWMAN_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
    this.worldObj.spawnEntityInWorld(entitysnowball);
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:16,代码来源:EntitySnowman.java

示例9: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_)
{
    EntitySnowball entitysnowball = new EntitySnowball(this.worldObj, this);
    double d0 = p_82196_1_.posX - this.posX;
    double d1 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D - entitysnowball.posY;
    double d2 = p_82196_1_.posZ - this.posZ;
    float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2) * 0.2F;
    entitysnowball.setThrowableHeading(d0, d1 + (double)f1, d2, 1.6F, 12.0F);
    this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
    this.worldObj.spawnEntityInWorld(entitysnowball);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:12,代码来源:EntitySnowman.java

示例10: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 */
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
    EntitySnowball entitysnowball = new EntitySnowball(this.worldObj, this);
    double d0 = par1EntityLivingBase.posX - this.posX;
    double d1 = par1EntityLivingBase.posY + (double)par1EntityLivingBase.getEyeHeight() - 1.100000023841858D - entitysnowball.posY;
    double d2 = par1EntityLivingBase.posZ - this.posZ;
    float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2) * 0.2F;
    entitysnowball.setThrowableHeading(d0, d1 + (double)f1, d2, 1.6F, 12.0F);
    this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
    this.worldObj.spawnEntityInWorld(entitysnowball);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:EntitySnowman.java

示例11: attackEntityWithRangedAttack

import net.minecraft.entity.projectile.EntitySnowball; //导入方法依赖的package包/类
/**
 * Attack the specified entity using a ranged attack.
 */
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor)
{
    EntitySnowball entitysnowball = new EntitySnowball(this.world, this);
    double d0 = target.posY + (double)target.getEyeHeight() - 1.100000023841858D;
    double d1 = target.posX - this.posX;
    double d2 = d0 - entitysnowball.posY;
    double d3 = target.posZ - this.posZ;
    float f = MathHelper.sqrt(d1 * d1 + d3 * d3) * 0.2F;
    entitysnowball.setThrowableHeading(d1, d2 + (double)f, d3, 1.6F, 12.0F);
    this.playSound(SoundEvents.ENTITY_SNOWMAN_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
    this.world.spawnEntity(entitysnowball);
}
 
开发者ID:ProBossGamers,项目名称:TurtleMod,代码行数:16,代码来源:EntityArcticTurtle.java


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