use of it.hurts.sskirillss.relics.client.particles.circle.CircleTintData in project relics by SSKirillSS.
the class StellarCatalystProjectileEntity method tick.
@Override
public void tick() {
super.tick();
StellarCatalystItem.Stats config = StellarCatalystItem.INSTANCE.getStats();
Random random = this.getCommandSenderWorld().getRandom();
for (int i = 0; i < 3; i++) level.addParticle(new CircleTintData(new Color(255 - random.nextInt(150), 0, 255 - random.nextInt(150)), 0.2F + random.nextFloat() * 0.15F, 20, 0.95F, false), this.xo, this.yo, this.zo, MathUtils.randomFloat(random) * 0.2F, random.nextFloat() * 0.75F, MathUtils.randomFloat(random) * 0.2F);
if (this.tickCount > 100)
this.remove();
this.setDeltaMovement(0.0F, -config.projectileSpeed - this.tickCount * 0.01F, 0.0F);
}
use of it.hurts.sskirillss.relics.client.particles.circle.CircleTintData in project relics by SSKirillSS.
the class BloodyLecternTile method tick.
@Override
public void tick() {
if (level == null)
return;
ticksExisted++;
ItemStack stack = getStack();
if (stack.isEmpty() || stack.getItem() != ItemRegistry.RELIC_CONTRACT.get())
return;
int blood = NBTUtils.getInt(stack, RelicContractItem.TAG_BLOOD, 0) + 1;
if (blood == 0)
return;
Random random = level.getRandom();
BlockPos pos = this.getBlockPos();
for (int i = 0; i < blood; i++) if (level.getRandom().nextInt(3) == 0)
level.addParticle(new CircleTintData(new Color(255, 0, 0), random.nextFloat() * 0.025F + 0.04F, 20, 0.94F, true), pos.getX() + 0.5F + MathUtils.randomFloat(random) * 0.3F, pos.getY() + 0.95F, pos.getZ() + 0.5F + MathUtils.randomFloat(random) * 0.3F, 0, random.nextFloat() * 0.05D, 0);
}
use of it.hurts.sskirillss.relics.client.particles.circle.CircleTintData in project relics by SSKirillSS.
the class PedestalTile method tick.
@Override
public void tick() {
if (level == null)
return;
ticksExisted++;
if (stack != null && !stack.isEmpty() && this.ticksExisted % 3 == 0) {
Random random = level.getRandom();
CircleTintData particle = new CircleTintData(stack.getRarity().color.getColor() != null ? new Color(stack.getRarity().color.getColor(), false) : new Color(255, 255, 255), random.nextFloat() * 0.025F + 0.04F, 20, 0.94F, true);
BlockPos blockPos = this.getBlockPos();
Vector3d pos = new Vector3d(blockPos.getX() + 0.5D, blockPos.getY() + 0.5D, blockPos.getZ() + 0.5D);
Direction direction = this.getBlockState().getValue(PedestalBlock.DIRECTION);
double motionX = 0.0D, motionY = 0.0D, motionZ = 0.0D;
double x = pos.x(), y = pos.y(), z = pos.z();
if (direction == Direction.UP) {
x = pos.x() + MathUtils.randomFloat(random) * 0.175F;
y = pos.y() - 0.25D;
z = pos.z() + MathUtils.randomFloat(random) * 0.175F;
motionY = random.nextFloat() * 0.05D;
} else if (direction == Direction.DOWN) {
x = pos.x() + MathUtils.randomFloat(random) * 0.175F;
y = pos.y() + 0.25D;
z = pos.z() + MathUtils.randomFloat(random) * 0.175F;
motionY = -random.nextFloat() * 0.05D;
} else if (direction == Direction.NORTH) {
x = pos.x() + MathUtils.randomFloat(random) * 0.175F;
y = pos.y() + MathUtils.randomFloat(random) * 0.175F;
z = pos.z() + 0.25D;
motionZ = -random.nextFloat() * 0.05D;
} else if (direction == Direction.SOUTH) {
x = pos.x() + MathUtils.randomFloat(random) * 0.175F;
y = pos.y() + MathUtils.randomFloat(random) * 0.175F;
z = pos.z() - 0.25D;
motionZ = random.nextFloat() * 0.05D;
} else if (direction == Direction.EAST) {
x = pos.x() - 0.25D;
y = pos.y() + MathUtils.randomFloat(random) * 0.175F;
z = pos.z() + MathUtils.randomFloat(random) * 0.175F;
motionX = random.nextFloat() * 0.05D;
} else if (direction == Direction.WEST) {
x = pos.x() + 0.25D;
y = pos.y() + MathUtils.randomFloat(random) * 0.175F;
z = pos.z() + MathUtils.randomFloat(random) * 0.175F;
motionX = -random.nextFloat() * 0.05D;
}
level.addParticle(particle, x, y, z, motionX, motionY, motionZ);
}
}
use of it.hurts.sskirillss.relics.client.particles.circle.CircleTintData in project relics by SSKirillSS.
the class RunicAltarTile method spawnParticles.
protected void spawnParticles(World world, Random random) {
if (!world.isClientSide())
return;
BlockPos pos = getBlockPos();
world.addParticle(new CircleTintData(relicStack.getRarity().color.getColor() != null ? new Color(relicStack.getRarity().color.getColor(), false) : new Color(255, 255, 255), random.nextFloat() * 0.025F + 0.04F, 20, 0.94F, true), pos.getX() + 0.5D + MathUtils.randomFloat(random) * 0.2F, pos.getY() + 0.85F, pos.getZ() + 0.5D + MathUtils.randomFloat(random) * 0.2F, 0, random.nextFloat() * 0.05D, 0);
}
use of it.hurts.sskirillss.relics.client.particles.circle.CircleTintData in project relics by SSKirillSS.
the class ElytraBoosterItem method collectBreath.
private void collectBreath(PlayerEntity player, ItemStack stack) {
World world = player.getCommandSenderWorld();
int breath = NBTUtils.getInt(stack, TAG_BREATH_AMOUNT, 0);
if (breath >= stats.breathCapacity)
return;
if (world.dimension() == World.END && player.tickCount % (stats.breathRegenerationCooldown * 20) == 0)
NBTUtils.setInt(stack, TAG_BREATH_AMOUNT, breath + 1);
for (AreaEffectCloudEntity cloud : world.getEntitiesOfClass(AreaEffectCloudEntity.class, player.getBoundingBox().inflate(stats.breathConsumptionRadius))) {
if (cloud.getParticle() != ParticleTypes.DRAGON_BREATH)
continue;
if (player.tickCount % 5 == 0)
NBTUtils.setInt(stack, TAG_BREATH_AMOUNT, breath + 1);
if (cloud.getRadius() <= 0)
cloud.remove();
cloud.setRadius(cloud.getRadius() - stats.breathConsumptionSpeed);
Vector3d direction = player.position().add(0, 1, 0).subtract(cloud.position()).normalize();
double distance = player.position().add(0, 1, 0).distanceTo(cloud.position());
world.addParticle(new CircleTintData(new Color(160, 0, 255), (float) (distance * 0.075F), (int) distance * 5, 0.95F, false), cloud.getX(), cloud.getY(), cloud.getZ(), direction.x * 0.2F, direction.y * 0.2F, direction.z * 0.2F);
}
}
Aggregations