use of net.minecraft.particle.DustParticleEffect in project MCDoom by AzureDoom.
the class TotemEntity method tick.
public static void tick(World world, BlockPos pos, BlockState state, TotemEntity blockEntity) {
if (blockEntity.world.getTime() % 80L == 0L) {
blockEntity.applyEffects();
}
if (world != null) {
if (world.isClient) {
double d0 = (double) pos.getX() + 1.0D * (blockEntity.random.nextDouble() - 0.25D) * 2.0D;
double d1 = (double) pos.getY() + 1.0D * (blockEntity.random.nextDouble() - 0.5D) * 2.0D;
double d2 = (double) pos.getZ() + 1.0D * (blockEntity.random.nextDouble() - 0.25D) * 2.0D;
for (int k = 0; k < 4; ++k) {
world.addParticle(new DustParticleEffect(DustParticleEffect.RED, 1), d0, d1, d2, (blockEntity.random.nextDouble() - 0.5D) * 2.0D, -blockEntity.random.nextDouble(), (blockEntity.random.nextDouble() - 0.5D) * 2.0D);
}
}
}
}
use of net.minecraft.particle.DustParticleEffect in project ArmorStandEditor by Patbox.
the class ServerPlayerEntityMixin method showInvisible.
@Inject(method = "playerTick", at = @At("HEAD"))
private void showInvisible(CallbackInfo ci) {
try {
if (ConfigManager.getConfig().configData.holdingToolSpawnsParticles) {
tickTimer++;
if (tickTimer > 10 && this.getMainHandStack().getItem() == ConfigManager.getConfig().armorStandTool) {
tickTimer = 0;
List<ArmorStandEntity> armorStands = this.world.getEntitiesByClass(ArmorStandEntity.class, new Box(this.getBlockPos().add(10, 10, 10), this.getBlockPos().add(-10, -10, -10)), null);
ParticleEffect particleEffect = new DustParticleEffect(0.8f, 0.2f, 0.2f, 1f);
for (ArmorStandEntity armorStand : armorStands) {
this.networkHandler.sendPacket(new ParticleS2CPacket(particleEffect, false, armorStand.getX(), armorStand.getY() + armorStand.getHeight() / 2, armorStand.getZ(), 0.2f, 0.2f, 0.2f, 0.1f, 3));
}
List<ItemFrameEntity> itemFrames = this.world.getEntitiesByClass(ItemFrameEntity.class, new Box(this.getBlockPos().add(10, 10, 10), this.getBlockPos().add(-10, -10, -10)), null);
ParticleEffect particleEffect2 = new DustParticleEffect(0.2f, 0.8f, 0.2f, 1f);
for (ItemFrameEntity itemFrame : itemFrames) {
this.networkHandler.sendPacket(new ParticleS2CPacket(particleEffect2, false, itemFrame.getX(), itemFrame.getY() + itemFrame.getHeight() / 2, itemFrame.getZ(), 0.2f, 0.2f, 0.2f, 0.1f, 3));
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
use of net.minecraft.particle.DustParticleEffect in project FabricSecretRooms by Spaceman.
the class RedstoneChainBlock method randomDisplayTick.
@Override
@Environment(EnvType.CLIENT)
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
if (random.nextInt(state.get(POWER) + 1) > 0) {
double xPos = (double) pos.getX() + 0.5D;
double yPos = (double) pos.getY() + random.nextDouble();
double zPos = (double) pos.getZ() + 0.5D;
world.addParticle(new DustParticleEffect(new Vec3f(1.0F, 0.0F, 0.0F), 0.5F), xPos, yPos, zPos, 0.0D, 0.0D, 0.0D);
}
}
Aggregations