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


Java EffectRenderer类代码示例

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


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

示例1: addHitEffects

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer)
{
    if (worldObj.getBlockMetadata(target.blockX, target.blockY, target.blockZ) == 6)
    {
        return true;
    }

    TileEntity tileEntity = worldObj.getTileEntity(target.blockX, target.blockY, target.blockZ);

    if (tileEntity instanceof TileEntityTelepadFake)
    {
        BlockVec3 mainBlockPosition = ((TileEntityTelepadFake) tileEntity).mainBlockPosition;

        if (mainBlockPosition != null)
        {
            effectRenderer.addBlockHitEffects(mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z, target);
        }
    }

    return super.addHitEffects(worldObj, target, effectRenderer);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:BlockTelepadFake.java

示例2: addHitEffects

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer)
{
    TileEntity tileEntity = worldObj.getTileEntity(target.blockX, target.blockY, target.blockZ);

    if (tileEntity instanceof TileEntityMulti)
    {
        BlockVec3 mainBlockPosition = ((TileEntityMulti) tileEntity).mainBlockPosition;

        if (mainBlockPosition != null)
        {
            effectRenderer.addBlockHitEffects(mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z, target);
        }
    }

    return super.addHitEffects(worldObj, target, effectRenderer);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:BlockMulti.java

示例3: addBlockHitEffects

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
public static void addBlockHitEffects(World world, Cuboid6 bounds, int side, IIcon icon, EffectRenderer effectRenderer)
{
    float border = 0.1F;
    Vector3 diff = bounds.max.copy().subtract(bounds.min).add(-2*border);
    diff.x*=world.rand.nextDouble();
    diff.y*=world.rand.nextDouble();
    diff.z*=world.rand.nextDouble();
    Vector3 pos = diff.add(bounds.min).add(border);
    
    if (side == 0)
        diff.y = bounds.min.y - border;
    if (side == 1)
        diff.y = bounds.max.y + border;
    if (side == 2)
        diff.z = bounds.min.z - border;
    if (side == 3)
        diff.z = bounds.max.z + border;
    if (side == 4)
        diff.x = bounds.min.x - border;
    if (side == 5)
        diff.x = bounds.max.x + border;
    
    effectRenderer.addEffect(
            new EntityDigIconFX(world, pos.x, pos.y, pos.z, 0, 0, 0, icon)
                .multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:27,代码来源:EntityDigIconFX.java

示例4: addDestroyEffects

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer)
{
    int max = 4;

    for (int xOffset = 0; xOffset < max; ++xOffset)
    {
        for (int yOffset = 0; yOffset < max; ++yOffset)
        {
            for (int zOffset = 0; zOffset < max; ++zOffset)
            {
                double pX = (double) x + ((double) xOffset + 0.5D) / (double) max;
                double pY = (double) y + ((double) yOffset + 0.5D) / (double) max;
                double pZ = (double) z + ((double) zOffset + 0.5D) / (double) max;
                Minecraft.getMinecraft().effectRenderer.addEffect((new EntityDiggingFX(world, pX, pY, pZ, pX - (double) x - 0.5D, pY - (double) y - 0.5D, pZ - (double) z
                        - 0.5D, ((TileIllumination) world.getTileEntity(x, y, z)).camoBlock, meta)).applyColourMultiplier(x, y, z));
            }
        }
    }

    return true;
}
 
开发者ID:MikeLydeamore,项目名称:IlluminatedBows,代码行数:24,代码来源:BlockIlluminatedBlock.java

示例5: spawnBigParticles

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void spawnBigParticles(int temp, float speed)
{
  EffectRenderer renderer = FMLClientHandler.instance().getClient().effectRenderer;
  if (this.currentAttackID == 4) {
    temp *= 2;
  }
  for (int i = 0; i < temp; i++)
  {
    float f = (this.rand.nextFloat() - 0.5F) * speed;
    float f1 = (this.rand.nextFloat() - 0.5F) * speed;
    float f2 = (this.rand.nextFloat() - 0.5F) * speed;
    boolean flag = i < temp / 2;
    if (this.currentAttackID != 4) {
      flag = true;
    }
    boolean death = this.currentAttackID != 10;
    double h = death ? this.height : this.height + 1.0F;
    double w = death ? this.width : this.width * 1.5F;
    double tempX = (flag ? this.posX : this.teleX) + (this.rand.nextDouble() - 0.5D) * w;
    double tempY = (flag ? this.posY : this.teleY) + (this.rand.nextDouble() - 0.5D) * h + (death ? 1.5F : 0.5F);
    double tempZ = (flag ? this.posZ : this.teleZ) + (this.rand.nextDouble() - 0.5D) * w;
    renderer.addEffect(new FXEnder(this.worldObj, tempX, tempY, tempZ, f, f1, f2, true));
  }
}
 
开发者ID:RamiLego4Game,项目名称:GalacticraftPixelGalaxy,代码行数:26,代码来源:MutantEnderman.java

示例6: EntityFireworkStarterFX

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
public EntityFireworkStarterFX(World p_i1208_1_, double p_i1208_2_, double p_i1208_4_, double p_i1208_6_, double p_i1208_8_, double p_i1208_10_, double p_i1208_12_, EffectRenderer p_i1208_14_, NBTTagCompound p_i1208_15_) {
   super(p_i1208_1_, p_i1208_2_, p_i1208_4_, p_i1208_6_, 0.0D, 0.0D, 0.0D);
   this.field_70159_w = p_i1208_8_;
   this.field_70181_x = p_i1208_10_;
   this.field_70179_y = p_i1208_12_;
   this.field_92040_ay = p_i1208_14_;
   this.field_70547_e = 8;
   if(p_i1208_15_ != null) {
      this.field_92039_az = p_i1208_15_.func_74761_m("Explosions");
      if(this.field_92039_az.func_74745_c() == 0) {
         this.field_92039_az = null;
      } else {
         this.field_70547_e = this.field_92039_az.func_74745_c() * 2 - 1;

         for(int var16 = 0; var16 < this.field_92039_az.func_74745_c(); ++var16) {
            NBTTagCompound var17 = (NBTTagCompound)this.field_92039_az.func_74743_b(var16);
            if(var17.func_74767_n("Flicker")) {
               this.field_92041_a = true;
               this.field_70547_e += 15;
               break;
            }
         }
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:27,代码来源:EntityFireworkStarterFX.java

示例7: addDestroyEffect

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
/**
 * Produces block destruction particles at coordinates.
 */
public static void addDestroyEffect(World world, int x, int y, int z, ItemStack itemStack, EffectRenderer effectRenderer)
{
    BlockProperties.prepareItemStackForRendering(itemStack);
    byte factor = 4;

    for (int posX = 0; posX < factor; ++posX)
    {
        for (int posY = 0; posY < factor; ++posY)
        {
            for (int posZ = 0; posZ < factor; ++posZ)
            {
                double dirX = x + (posX + 0.5D) / factor;
                double dirY = y + (posY + 0.5D) / factor;
                double dirZ = z + (posZ + 0.5D) / factor;

                EntityDiggingFX particle = new EntityDiggingFX(world, dirX, dirY, dirZ, dirX - x - 0.5D, dirY - y - 0.5D, dirZ - z - 0.5D, BlockProperties.toBlock(itemStack), itemStack.getItemDamage());
                effectRenderer.addEffect(particle.applyColourMultiplier(x, y, z));
            }
        }
    }
}
 
开发者ID:Mineshopper,项目名称:carpentersblocks,代码行数:25,代码来源:ParticleHelper.java

示例8: perform

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void perform(EffectInstance inst) {
	double x = ((Number) inst.data[0]).doubleValue();
	double y = ((Number) inst.data[1]).doubleValue();
	double z = ((Number) inst.data[2]).doubleValue();
	double dx = ((Number) inst.data[3]).doubleValue();
	double dy = ((Number) inst.data[4]).doubleValue();
	double dz = ((Number) inst.data[5]).doubleValue();
	EffectRenderer effectRenderer = Minecraft.getMinecraft().effectRenderer;
	double d = Math.sqrt(dx*dx + dy*dy + dz*dz);
	for (double i = 0; i < d; i += trailStep) {
		EntityFX particle = new ParticleDust(Minecraft.getMinecraft().theWorld,
				x + dx * i/d,
				y + dy * i/d,
				z + dz * i/d, 0, 0, 0);
		effectRenderer.addEffect(particle);
	}
}
 
开发者ID:Hunternif,项目名称:Dota2Items,代码行数:20,代码来源:EffectForce.java

示例9: perform

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void perform(Entity entity, Object ... data) {
	EffectRenderer effectRenderer = Minecraft.getMinecraft().effectRenderer;
	Random rand = new Random();
	for (int i = 0; i < MAX_PARTICLES; i++) {
		float yaw = (rand.nextFloat()*2.0F - 1.0F) * (float) Math.PI;
		float pitch = (rand.nextFloat() - 0.5F) * (float) Math.PI;
		double distance = rand.nextDouble() * 0.3D + 0.2D;
		double cosYaw = (double) MathHelper.cos(yaw);
		double sinYaw = (double) MathHelper.sin(yaw);
		double cosPitch = (double) MathHelper.cos(pitch);
		double sinPitch = (double) MathHelper.sin(pitch);
		double rX = -sinYaw*cosPitch * distance;
		double rZ = cosYaw*cosPitch * distance;
		double rY = -sinPitch * distance;
		/*double velX = -sinYaw*cosPitch / (distance) * 0.05D;
		double velZ = cosYaw*cosPitch / (distance) * 0.05D;
		double velY = -sinPitch / (distance) * 0.05D;*/
		EntityFX particle = new ParticleLifesteal(entity.worldObj,
				entity.posX + rX, entity.posY - entity.yOffset + 1 + rY, entity.posZ + rZ, distance);
		effectRenderer.addEffect(particle);
	}
}
 
开发者ID:Hunternif,项目名称:Dota2Items,代码行数:25,代码来源:EffectLifesteal.java

示例10: addHitEffects

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) {
	int md = worldObj.getBlockMetadata(target.blockX, target.blockY, target.blockZ);
	if (md < 6)
		UtilsFX.infusedStoneSparkle(worldObj, target.blockX, target.blockY, target.blockZ, md + 1);
	return super.addHitEffects(worldObj, target, effectRenderer);
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:9,代码来源:BlockInfusedBlockOre.java

示例11: addDestroyEffects

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer)
{
    if (world.getBlockMetadata(x, y, z) == 6)
    {
        return true;
    }

    return super.addDestroyEffects(world, x, y, z, meta, effectRenderer);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:12,代码来源:BlockTelepadFake.java

示例12: emitParticles

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
private void emitParticles() {
    int particleLevel = Minecraft.getMinecraft().gameSettings.particleSetting;
    if (particleLevel >= 2) return;
    double r = 7.0 / 16.0;
    double v = getVelocity(EnumFacing.UP) * r;
    double bottom = -3.0 / 16.0;
    double left = -4.0 / 16.0;
    double scootch_x = 3.0 / 16.0;
    double scootch_y = 3.0 / 16.0;
    Quaternion rot = Quaternion.getRotationQuaternionRadians(angle, EnumFacing.UP);
    double motFuzz = v / 20;
    Random rng = worldObj.rand;
    double threshold = velocity / (particleLevel == 1 ? 1 : 4);
    EffectRenderer effectRenderer = Minecraft.getMinecraft().effectRenderer;
    for (int side = 0; side < 4; side++) {
        for (int y = 0; y < 3; y++) {
            if (rng.nextFloat() > threshold) continue;
            Vec3 pos = new Vec3(left + scootch_x * y, bottom + scootch_y * y, r);
            Vec3 mot = new Vec3(-v + rng.nextGaussian() * motFuzz * 3, rng.nextGaussian() * motFuzz, rng.nextGaussian() * motFuzz + r * 0.125);
            rot.applyRotation(pos);
            rot.applyRotation(mot);

            EntityFXSteam steam = new EntityFXSteam(worldObj, pos.xCoord + 0.5 + pos.xCoord, pos.yCoord + 0.5 + pos.yCoord, pos.zCoord + 0.5 + pos.zCoord);
            SpaceUtil.toEntVel(steam, mot);
            effectRenderer.addEffect(steam);
        }
        rot.incrMultiply(Quaternion.getRotationQuaternionRadians(Math.PI / 2, EnumFacing.UP));
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:31,代码来源:TileEntitySteamShaft.java

示例13: spawnParticles

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
void spawnParticles() {
    final double r = 0.5;
    EffectRenderer effectRenderer = Minecraft.getMinecraft().effectRenderer;
    for (double dy = 0; dy < height; dy += r) {
        EntityFXSteam particle = new EntityFXSteam(worldObj, posX, posY + dy, posZ);
        particle.motionX = rand.nextGaussian() / 16;
        particle.motionY = 0.3 + Math.abs(rand.nextGaussian()) / 16;
        particle.motionZ = rand.nextGaussian() / 16;
        effectRenderer.addEffect(particle);
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:13,代码来源:EntitySteamGeyser.java

示例14: WorldView

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
public WorldView(WorldClient worldObj, ChunkCoordinates coords, int width, int height) {
	this.width = width;
	this.height = height;
	this.worldObj = worldObj;
	this.coords = coords;
	this.camera = new EntityCamera(worldObj, coords);
	this.camerawrapper = new ViewCameraImpl(camera);
	this.renderGlobal = new RenderGlobal(Minecraft.getMinecraft());
	this.effectRenderer = new EffectRenderer(worldObj, Minecraft.getMinecraft().getTextureManager());
	// Technically speaking, this is poor practice as it leaks a reference to the view before it's done constructing.
	this.fbo = FrameBufferContainer.createNewFramebuffer(this, width, height);
}
 
开发者ID:XCompWiz,项目名称:LookingGlass,代码行数:13,代码来源:WorldView.java

示例15: addDestroyEffects

import net.minecraft.client.particle.EffectRenderer; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer) {
	if (world.getBlock(x, y, z) instanceof BlockForceLeaves) {
		ClientProxy.addBlockEffects(world, x, y, z, effectRenderer, rng);
		return true;
	}
	return super.addDestroyEffects(world, x, y, z, meta, effectRenderer);
}
 
开发者ID:austinv11,项目名称:DartCraft2,代码行数:10,代码来源:BlockForceLeaves.java


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