use of net.minecraft.client.particle.Particle in project EnderIO by SleepyTrousers.
the class BlockCombustionGenerator method randomDisplayTick.
@Override
public void randomDisplayTick(@Nonnull IBlockState bs, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull Random rand) {
// If active, randomly throw some smoke around
if (isActive(world, pos)) {
TileEntity te = world.getTileEntity(pos);
EnumFacing facing = EnumFacing.SOUTH;
if (te instanceof AbstractMachineEntity) {
AbstractMachineEntity me = (AbstractMachineEntity) te;
facing = me.facing;
}
for (int j = 0; j < (isEnhanced ? 3 : 1); j++) {
boolean toTop = rand.nextBoolean();
// top:front<->back or side:bottom<->top
float offsetA = rand.nextFloat();
// right<->left
float offsetB = .5f + rand.nextFloat() * .2f - rand.nextFloat() * .2f;
float startX = pos.getX(), startY = pos.getY(), startZ = pos.getZ();
if (toTop) {
startY += 0.95f;
switch(facing) {
case NORTH:
case SOUTH:
startX += offsetB;
startZ += offsetA;
break;
case EAST:
case WEST:
default:
startX += offsetA;
startZ += offsetB;
break;
}
} else {
boolean swap = rand.nextBoolean();
startY += offsetA;
switch(facing) {
case NORTH:
case SOUTH:
startX += offsetB;
startZ += swap ? 0.05f : 0.95f;
break;
case EAST:
case WEST:
default:
startX += swap ? 0.05f : 0.95f;
startZ += offsetB;
break;
}
}
for (int i = 0; i < (isEnhanced ? 5 : 2); i++) {
ParticleManager er = Minecraft.getMinecraft().effectRenderer;
Particle fx = er.spawnEffectParticle(EnumParticleTypes.SMOKE_NORMAL.getParticleID(), startX, startY, startZ, 0.0D, 0.0D, 0.0D);
if (fx != null && rand.nextFloat() > .75f) {
fx.setRBGColorF(1 - (rand.nextFloat() * 0.2f), 1 - (rand.nextFloat() * 0.1f), 1 - (rand.nextFloat() * 0.2f));
}
startX += rand.nextFloat() * .1f - rand.nextFloat() * .1f;
startY += rand.nextFloat() * .1f - rand.nextFloat() * .1f;
startZ += rand.nextFloat() * .1f - rand.nextFloat() * .1f;
}
}
}
}
use of net.minecraft.client.particle.Particle in project Binnie by ForestryMC.
the class SequencerFX method onRandomDisplayTick.
@SideOnly(Side.CLIENT)
@Override
public void onRandomDisplayTick(World world, BlockPos pos, Random rand) {
if (!this.getUtil().getProcess().isInProgress()) {
return;
}
Particle particle = new SequencerParticleRandomTick(world, pos, rand);
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(particle);
}
use of net.minecraft.client.particle.Particle in project Binnie by ForestryMC.
the class SequencerFX method onDisplayTick.
@SideOnly(Side.CLIENT)
@Override
public void onDisplayTick(World world, BlockPos pos, Random rand) {
if (!this.getUtil().getProcess().isInProgress())
return;
final int ticks = (int) (world.getTotalWorldTime() % 16L);
if (ticks == 0) {
final Particle particle = new SequencerParticle(world, pos);
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(particle);
}
}
use of net.minecraft.client.particle.Particle in project Binnie by ForestryMC.
the class GenepoolFX method onDisplayTick.
@SideOnly(Side.CLIENT)
@Override
public void onDisplayTick(World world, BlockPos pos, Random rand) {
if (this.getUtil().getProcess().isInProgress()) {
final Particle particle = new GenepoolParticle(world, pos, rand);
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(particle);
}
}
use of net.minecraft.client.particle.Particle in project Random-Things by lumien231.
the class RTEventHandler method spawnEntityFilterParticles.
@SideOnly(Side.CLIENT)
private void spawnEntityFilterParticles(LivingUpdateEvent event) {
EntityPlayer player = Minecraft.getMinecraft().player;
ItemStack equipped = player.getHeldItemMainhand();
if (!equipped.isEmpty() && equipped.getItem() instanceof IEntityFilterItem) {
IEntityFilterItem filterInstance = (IEntityFilterItem) equipped.getItem();
if (filterInstance.apply(equipped, event.getEntityLiving())) {
for (int i = 0; i < 1; ++i) {
Particle particle = Minecraft.getMinecraft().effectRenderer.spawnEffectParticle(EnumParticleTypes.PORTAL.ordinal(), event.getEntityLiving().posX + (RTEventHandler.rng.nextDouble() - 0.5D) * event.getEntityLiving().width, event.getEntityLiving().posY + RTEventHandler.rng.nextDouble() * event.getEntityLiving().height - 0.25D, event.getEntityLiving().posZ + (RTEventHandler.rng.nextDouble() - 0.5D) * event.getEntityLiving().width, (RTEventHandler.rng.nextDouble() - 0.5D) * 2.0D, -RTEventHandler.rng.nextDouble(), (RTEventHandler.rng.nextDouble() - 0.5D) * 2.0D);
particle.setRBGColorF(0.2F, 0.2F, 1);
}
}
}
}
Aggregations