use of net.minecraft.client.particle.EntityFX in project Galacticraft by micdoodle8.
the class MarsModuleClient method spawnParticle.
@Override
public void spawnParticle(String particleID, Vector3 position, Vector3 motion, Object... extraData) {
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc != null && mc.getRenderViewEntity() != null && mc.effectRenderer != null) {
final double dPosX = mc.getRenderViewEntity().posX - position.x;
final double dPosY = mc.getRenderViewEntity().posY - position.y;
final double dPosZ = mc.getRenderViewEntity().posZ - position.z;
EntityFX particle = null;
final double maxDistSqrd = 64.0D;
if (dPosX * dPosX + dPosY * dPosY + dPosZ * dPosZ < maxDistSqrd * maxDistSqrd) {
if (particleID.equals("sludgeDrip")) {
// particle = new EntityDropParticleFX(mc.theWorld, position.x, position.y, position.z, Material.water); TODO
} else if (particleID.equals("bacterialDrip")) {
particle = new EntityBacterialDripFX(mc.theWorld, position.x, position.y, position.z);
}
}
if (particle != null) {
particle.prevPosX = particle.posX;
particle.prevPosY = particle.posY;
particle.prevPosZ = particle.posZ;
mc.effectRenderer.addEffect(particle);
}
}
}
use of net.minecraft.client.particle.EntityFX in project Galacticraft by micdoodle8.
the class VenusModuleClient method spawnParticle.
@Override
public void spawnParticle(String particleID, Vector3 position, Vector3 motion, Object... extraData) {
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc != null && mc.getRenderViewEntity() != null && mc.effectRenderer != null) {
double dX = mc.getRenderViewEntity().posX - position.x;
double dY = mc.getRenderViewEntity().posY - position.y;
double dZ = mc.getRenderViewEntity().posZ - position.z;
EntityFX particle = null;
double viewDistance = 64.0D;
if (particleID.equals("acidVapor")) {
particle = new EntityAcidVaporFX(mc.theWorld, position.x, position.y, position.z, motion.x, motion.y, motion.z, 2.5F);
}
if (dX * dX + dY * dY + dZ * dZ < viewDistance * viewDistance) {
if (particleID.equals("acidExhaust")) {
particle = new EntityAcidExhaustFX(mc.theWorld, position.x, position.y, position.z, motion.x, motion.y, motion.z, 0.5F);
}
}
if (particle != null) {
particle.prevPosX = particle.posX;
particle.prevPosY = particle.posY;
particle.prevPosZ = particle.posZ;
mc.effectRenderer.addEffect(particle);
}
}
}
use of net.minecraft.client.particle.EntityFX in project Galacticraft by micdoodle8.
the class AsteroidsModuleClient method spawnParticle.
@Override
public void spawnParticle(String particleID, Vector3 position, Vector3 motion, Object... extraData) {
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc != null && mc.getRenderViewEntity() != null && mc.effectRenderer != null) {
double dX = mc.getRenderViewEntity().posX - position.x;
double dY = mc.getRenderViewEntity().posY - position.y;
double dZ = mc.getRenderViewEntity().posZ - position.z;
EntityFX particle = null;
double viewDistance = 64.0D;
if (dX * dX + dY * dY + dZ * dZ < viewDistance * viewDistance) {
if (particleID.equals("portalBlue")) {
particle = new EntityFXTeleport(mc.theWorld, position, motion, (TileEntityShortRangeTelepad) extraData[0], (Boolean) extraData[1]);
} else if (particleID.equals("cryoFreeze")) {
particle = new EntityCryoFX(mc.theWorld, position, motion);
}
}
if (particle != null) {
particle.prevPosX = particle.posX;
particle.prevPosY = particle.posY;
particle.prevPosZ = particle.posZ;
mc.effectRenderer.addEffect(particle);
}
}
}
use of net.minecraft.client.particle.EntityFX in project BuildCraft by BuildCraft.
the class BlockGenericPipe method addHitEffects.
/**
* Spawn a digging particle effect in the world, this is a wrapper around EffectRenderer.addBlockHitEffects to
* allow the block more control over the particles. Useful when you have entirely different texture sheets for
* different sides/locations in the world.
*
* @param worldObj The current world
* @param target The target the player is looking at {x/y/z/side/sub}
* @param effectRenderer A reference to the current effect renderer.
* @return True to prevent vanilla digging particles form spawning.
*/
@SideOnly(Side.CLIENT)
@Override
public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) {
Pipe<?> pipe = getPipe(worldObj, target.getBlockPos());
if (pipe == null) {
return false;
}
TextureAtlasSprite icon = pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
EnumFacing sideHit = target.sideHit;
Block block = BuildCraftTransport.genericPipeBlock;
float b = 0.1F;
double px = target.hitVec.xCoord + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (b * 2.0F)) + b + block.getBlockBoundsMinX();
double py = target.hitVec.yCoord + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (b * 2.0F)) + b + block.getBlockBoundsMinY();
double pz = target.hitVec.zCoord + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (b * 2.0F)) + b + block.getBlockBoundsMinZ();
if (sideHit == EnumFacing.DOWN) {
py = target.hitVec.yCoord + block.getBlockBoundsMinY() - b;
}
if (sideHit == EnumFacing.UP) {
py = target.hitVec.yCoord + block.getBlockBoundsMaxY() + b;
}
if (sideHit == EnumFacing.NORTH) {
pz = target.hitVec.zCoord + block.getBlockBoundsMinZ() - b;
}
if (sideHit == EnumFacing.SOUTH) {
pz = target.hitVec.zCoord + block.getBlockBoundsMaxZ() + b;
}
if (sideHit == EnumFacing.EAST) {
px = target.hitVec.xCoord + block.getBlockBoundsMinX() - b;
}
if (sideHit == EnumFacing.WEST) {
px = target.hitVec.xCoord + block.getBlockBoundsMaxX() + b;
}
EntityFX fx = effectRenderer.spawnEffectParticle(EnumParticleTypes.BLOCK_CRACK.getParticleID(), px, py, pz, 0.0D, 0.0D, 0.0D, Block.getStateId(worldObj.getBlockState(target.getBlockPos())));
fx.setParticleIcon(icon);
effectRenderer.addEffect(fx.multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
return true;
}
use of net.minecraft.client.particle.EntityFX in project Armourers-Workshop by RiskyKen.
the class BlockMannequin method randomDisplayTick.
@SideOnly(Side.CLIENT)
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
if (isTopOfMannequin(world, x, y, z)) {
if (isValentins) {
if (random.nextFloat() * 100 > 75) {
world.spawnParticle("heart", x + 0.2D + random.nextFloat() * 0.6F, y + 1D, z + 0.2D + random.nextFloat() * 0.6F, 0, 0, 0);
}
}
TileEntityMannequin te = getMannequinTileEntity(world, x, y, z);
if (te != null && te.isRenderExtras()) {
Contributor contributor = Contributors.INSTANCE.getContributor(te.getGameProfile());
if (contributor != null & te.isVisible()) {
for (int i = 0; i < 4; i++) {
EntityFX entityfx = new EntitySpellParticleFX(world, x - 1 + random.nextFloat() * 3F, y - 1D, z - 1 + random.nextFloat() * 3F, 0, 0, 0);
((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
entityfx.setRBGColorF((float) (contributor.r & 0xFF) / 255F, (float) (contributor.g & 0xFF) / 255F, (float) (contributor.b & 0xFF) / 255F);
Minecraft.getMinecraft().effectRenderer.addEffect(entityfx);
}
}
}
}
}
Aggregations