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


Java EntityFireball类代码示例

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


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

示例1: handle_auroblast

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
public static void handle_auroblast(World world, EntityPlayerMP sender)
{
	float a;
	float b;
	float c;
	
	a = (float) sender.getLookVec().xCoord;
	b = (float) sender.getLookVec().yCoord;
	c = (float) sender.getLookVec().zCoord;
	EntityFireball fireball = new EntityLargeFireball(world, sender.posX + a, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
    EntityFireball fireball2 = new EntityLargeFireball(world, sender.posX + a + 4, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball2);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
    EntityFireball fireball3 = new EntityLargeFireball(world, sender.posX - a - 4, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball3);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:23,代码来源:ServerSpellHandler.java

示例2: setShooter

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
private void setShooter(Entity ent, EntityLivingBase shooter) 
{
	if (ent instanceof EntityArrow)
	{
		((EntityArrow)ent).shootingEntity = shooter;
	}
	else if (ent instanceof EntityFireball)
	{
		((EntityFireball)ent).shootingEntity = shooter;
	}
	else if (ent instanceof EntityFireball)
	{
		((EntityFireball)ent).shootingEntity = shooter;
	}
	else if (ent instanceof EntityDartBase)
	{
		((EntityDartBase)ent).shootingEntity = shooter;
	}
}
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:20,代码来源:AbilityRepulsion.java

示例3: shootFireballAtTarget

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
private void shootFireballAtTarget() {
    EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D);
    if (targetedEntity != null) {
        int holdRand = rand.nextInt(10) - 5;
        double sourcePositionX = this.posX + holdRand;
        double sourcePositionY = this.posY + 20;
        holdRand = rand.nextInt(10) - 5;
        double sourcePositionZ = this.posZ + holdRand;

        double var11 = targetedEntity.posX - sourcePositionX;
        double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F
                - (sourcePositionY + this.height / 2.0F);
        double var15 = targetedEntity.posZ - sourcePositionZ;
        this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI;

        this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY,
                (int) this.posZ, 0);
        EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15);
        double var18 = 1.0D;
        Vec3 var20 = this.getLook(1.0F);
        var17.posX = sourcePositionX + var20.xCoord * var18;
        var17.posY = sourcePositionY + this.height / 2.0F + 0.5D;
        var17.posZ = sourcePositionZ + var20.zCoord * var18;
        this.worldObj.spawnEntityInWorld(var17);
    }
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:27,代码来源:EntityMummyPharaoh.java

示例4: onUsingTick

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
@Override
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
	if (toolMaterial == ToolMaterial.EMERALD) {
		if (player.getHeldItem() != null && ZSSPlayerInfo.get(player).canBlock()) {
			Vec3 vec3 = player.getLookVec();
			double dx = player.posX + vec3.xCoord * 2.0D;
			double dy = player.posY + player.getEyeHeight() + vec3.yCoord * 2.0D;
			double dz = player.posZ + vec3.zCoord * 2.0D;
			List<EntityFireball> list = player.worldObj.getEntitiesWithinAABB(EntityFireball.class, new AxisAlignedBB(dx - 1, dy - 1, dz - 1, dx + 1, dy + 1, dz + 1));
			for (EntityFireball fireball : list) {
				DamageSource source = DamageSource.causeFireballDamage(fireball, fireball.shootingEntity);
				if (canBlockDamage(stack, source) && fireball.attackEntityFrom(DamageSource.causePlayerDamage(player), 1.0F)) {
					fireball.getEntityData().setBoolean("isReflected", true);
					ZSSPlayerInfo.get(player).onAttackBlocked(stack, 1.0F);
					WorldUtils.playSoundAtEntity(player, Sounds.HAMMER, 0.4F, 0.5F);
					break;
				}
			}
		}
	}
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:22,代码来源:ItemZeldaShield.java

示例5: repulse

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
public void repulse(World world, int i, int j, int k) {
    float distance = 5.0F;
    Entity entity;
    Iterator iterator;
    List list = world.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getBoundingBox(i - distance, j - distance, k - distance, i + distance, j + distance, k + distance));
    for (iterator = list.iterator(); iterator.hasNext(); push(entity, i, j, k)) {
        entity = (Entity)iterator.next();
    }
    list = world.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getBoundingBox(i - distance, j - distance, k - distance, i + distance, j + distance, k + distance));
    for (iterator = list.iterator(); iterator.hasNext(); push(entity, i, j, k)) {
        entity = (Entity)iterator.next();
    }
    list = world.getEntitiesWithinAABB(EntityFireball.class, AxisAlignedBB.getBoundingBox(i - distance, j - distance, k - distance, i + distance, j + distance, k + distance));
    for (iterator = list.iterator(); iterator.hasNext(); push(entity, i, j, k)) {
        entity = (Entity)iterator.next();
    }
    list = world.getEntitiesWithinAABB(EntityPotion.class, AxisAlignedBB.getBoundingBox(i - distance, j - distance, k - distance, i + distance, j + distance, k + distance));
    for (iterator = list.iterator(); iterator.hasNext(); push(entity, i, j, k)) {
        entity = (Entity)iterator.next();
    }
}
 
开发者ID:Andrew2448,项目名称:Andrew2448PowersuitAddons,代码行数:22,代码来源:MobRepulsorModule.java

示例6: handleSpecialEntities

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
public void handleSpecialEntities(Entity ent)
{
    if(ent instanceof EntityBlock)
    {
        ((EntityBlock)ent).timeExisting = 2;
    }
    else if(ent instanceof EntityFallingBlock)
    {
        ((EntityFallingBlock)ent).fallTime = 2;
    }
    else if(ent instanceof EntityFireball)
    {
        EntityFireball fireball = (EntityFireball)ent;
        float[] appliedAcceleration = getQuaternionFormula().applyPositionalRotation(new float[] { (float)fireball.accelerationX, (float)fireball.accelerationY, (float)fireball.accelerationZ });
        fireball.accelerationX = appliedAcceleration[0];
        fireball.accelerationY = appliedAcceleration[1];
        fireball.accelerationZ = appliedAcceleration[2];
    }
    else if(ent instanceof EntityArrow)
    {
        ((EntityArrow)ent).inGround = false;
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:24,代码来源:WorldPortal.java

示例7: initializeEntityActivationState

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的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

示例8: doRender

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityFireball entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    this.bindEntityTexture(entity);
    GlStateManager.translate((float)x, (float)y, (float)z);
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(this.scale, this.scale, this.scale);
    TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(Items.fire_charge);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMaxU();
    float f2 = textureatlassprite.getMinV();
    float f3 = textureatlassprite.getMaxV();
    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
    worldrenderer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    tessellator.draw();
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:36,代码来源:RenderFireball.java

示例9: handle_holyblade

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
public static void handle_holyblade(World world, EntityPlayerMP sender)
{
	float a;
	float b;
	float c;
	
	a = (float) sender.getLookVec().xCoord;
	b = (float) sender.getLookVec().yCoord;
	c = (float) sender.getLookVec().zCoord;
	EntityFireball fireball = new EntityLargeFireball(world, sender.posX + a, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:15,代码来源:ServerSpellHandler.java

示例10: handle_airrender

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
public static void handle_airrender(World world, EntityPlayerMP sender)
{
	float a;
	float b;
	float c;
	
	a = (float) sender.getLookVec().xCoord;
	b = (float) sender.getLookVec().yCoord;
	c = (float) sender.getLookVec().zCoord;
	EntityFireball fireball = new EntityLargeFireball(world, sender.posX + a, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:15,代码来源:ServerSpellHandler.java

示例11: getShooter

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的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

示例12: initializeEntityActivationState

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的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

示例13: initializeEntityActivationState

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的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

示例14: doRender

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
 */
public void doRender(EntityFireball par1EntityFireball, double par2, double par4, double par6, float par8, float par9)
{
    GL11.glPushMatrix();
    this.bindEntityTexture(par1EntityFireball);
    GL11.glTranslatef((float)par2, (float)par4, (float)par6);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    float var10 = this.field_77002_a;
    GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F);
    IIcon var11 = Items.fire_charge.getIconFromDamage(0);
    Tessellator var12 = Tessellator.instance;
    float var13 = var11.getMinU();
    float var14 = var11.getMaxU();
    float var15 = var11.getMinV();
    float var16 = var11.getMaxV();
    float var17 = 1.0F;
    float var18 = 0.5F;
    float var19 = 0.25F;
    GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    var12.startDrawingQuads();
    var12.setNormal(0.0F, 1.0F, 0.0F);
    var12.addVertexWithUV((double)(0.0F - var18), (double)(0.0F - var19), 0.0D, (double)var13, (double)var16);
    var12.addVertexWithUV((double)(var17 - var18), (double)(0.0F - var19), 0.0D, (double)var14, (double)var16);
    var12.addVertexWithUV((double)(var17 - var18), (double)(1.0F - var19), 0.0D, (double)var14, (double)var15);
    var12.addVertexWithUV((double)(0.0F - var18), (double)(1.0F - var19), 0.0D, (double)var13, (double)var15);
    var12.draw();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:36,代码来源:RenderFireball.java

示例15: onItemRightClick

import net.minecraft.entity.projectile.EntityFireball; //导入依赖的package包/类
/**
 * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
 *
 * @param stack
 * @param world
 * @param player
 */
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){
    AxisAlignedBB axisAlignedBB = new AxisAlignedBB(player.posX - 6, player.posY - 6, player.posZ - 6, player.posX + 6, player.posY + 6, player.posZ + 6);
    ArrayList<EntityFireball> fireballs = (ArrayList<EntityFireball>) world.getEntitiesWithinAABB(EntityFireball.class, axisAlignedBB);
    for (EntityFireball fireball : fireballs) {
        if (fireball.getDistanceSqToEntity(player) <= 25) {
            redirect(fireball);
        }
    }
    AuraCascade.proxy.networkWrapper.sendToAllAround(new PacketBurst(7, player.posX, player.posY, player.posZ), new NetworkRegistry.TargetPoint(player.worldObj.provider.getDimension(), player.posX, player.posY, player.posZ, 32));

    return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);
}
 
开发者ID:AdlyTempleton,项目名称:Aura-Cascade,代码行数:21,代码来源:ItemMirror.java


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