Continue mapping migration

This commit is contained in:
Aleksey 2021-04-12 21:38:22 +03:00
parent 99ade39404
commit f03fd03bd0
499 changed files with 12567 additions and 12723 deletions

View file

@ -1,31 +1,32 @@
package ru.betterend.blocks.entities;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.util.Tickable;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.TickableBlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.blocks.HydrothermalVentBlock;
import ru.betterend.registry.EndBlockEntities;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndParticles;
public class BlockEntityHydrothermalVent extends BlockEntity implements Tickable {
public class BlockEntityHydrothermalVent extends BlockEntity implements TickableBlockEntity {
public BlockEntityHydrothermalVent() {
super(EndBlockEntities.HYDROTHERMAL_VENT);
}
@Override
public void tick() {
if (world.random.nextInt(20) == 0) {
double x = pos.getX() + world.random.nextDouble();
double y = pos.getY() + 0.9 + world.random.nextDouble() * 0.3;
double z = pos.getZ() + world.random.nextDouble();
BlockState state = getCachedState();
if (level.random.nextInt(20) == 0) {
double x = worldPosition.getX() + level.random.nextDouble();
double y = worldPosition.getY() + 0.9 + level.random.nextDouble() * 0.3;
double z = worldPosition.getZ() + level.random.nextDouble();
BlockState state = getBlockState();
if (state.is(EndBlocks.HYDROTHERMAL_VENT) && state.getValue(HydrothermalVentBlock.ACTIVATED)) {
if (state.getValue(HydrothermalVentBlock.WATERLOGGED)) {
world.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0);
} else {
world.addParticle(ParticleTypes.BUBBLE, x, y, z, 0, 0, 0);
level.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0);
}
else {
level.addParticle(ParticleTypes.BUBBLE, x, y, z, 0, 0, 0);
}
}
}