Continue mapping migration
This commit is contained in:
parent
99ade39404
commit
f03fd03bd0
499 changed files with 12567 additions and 12723 deletions
|
@ -5,20 +5,20 @@ import java.util.Random;
|
|||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.entity.ItemEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.GameRules;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import ru.betterend.blocks.basis.BlockBaseNotFull;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
|
@ -27,27 +27,26 @@ import ru.betterend.util.BlocksHelper;
|
|||
|
||||
public class MengerSpongeWetBlock extends BlockBaseNotFull implements IRenderTypeable {
|
||||
public MengerSpongeWetBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.WET_SPONGE).nonOpaque());
|
||||
super(FabricBlockSettings.copyOf(Blocks.WET_SPONGE).noOcclusion());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
||||
if (world.getDimension().isUltrawarm()) {
|
||||
world.setBlockAndUpdate(pos, EndBlocks.MENGER_SPONGE.defaultBlockState(), 3);
|
||||
world.syncWorldEvent(2009, pos, 0);
|
||||
world.playLocalSound((Player) null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundSource.BLOCKS, 1.0F,
|
||||
(1.0F + world.getRandom().nextFloat() * 0.2F) * 0.7F);
|
||||
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
||||
if (world.dimensionType().ultraWarm()) {
|
||||
world.setBlock(pos, EndBlocks.MENGER_SPONGE.defaultBlockState(), 3);
|
||||
world.levelEvent(2009, pos, 0);
|
||||
world.playSound((Player) null, pos, SoundEvents.FIRE_EXTINGUISH, SoundSource.BLOCKS, 1.0F, (1.0F + world.getRandom().nextFloat() * 0.2F) * 0.7F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(BlockState state, Level world, BlockPos pos, Random random) {
|
||||
Direction direction = Direction.random(random);
|
||||
Direction direction = Direction.getRandom(random);
|
||||
if (direction != Direction.UP) {
|
||||
BlockPos blockPos = pos.relative(direction);
|
||||
BlockState blockState = world.getBlockState(blockPos);
|
||||
if (!state.isOpaque() || !blockState.isSideSolidFullSquare(world, blockPos, direction.getOpposite())) {
|
||||
if (!state.canOcclude() || !blockState.isFaceSturdy(world, blockPos, direction.getOpposite())) {
|
||||
double x = (double) pos.getX();
|
||||
double y = (double) pos.getY();
|
||||
double z = (double) pos.getZ();
|
||||
|
@ -55,20 +54,24 @@ public class MengerSpongeWetBlock extends BlockBaseNotFull implements IRenderTyp
|
|||
y -= 0.05;
|
||||
x += random.nextDouble();
|
||||
z += random.nextDouble();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
y += random.nextDouble() * 0.8;
|
||||
if (direction.getAxis() == Direction.Axis.X) {
|
||||
z += random.nextDouble();
|
||||
if (direction == Direction.EAST) {
|
||||
++x;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
x += 0.05;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
x += random.nextDouble();
|
||||
if (direction == Direction.SOUTH) {
|
||||
++z;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
z += 0.05;
|
||||
}
|
||||
}
|
||||
|
@ -80,25 +83,24 @@ public class MengerSpongeWetBlock extends BlockBaseNotFull implements IRenderTyp
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBreak(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
public void playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
BlocksHelper.setWithUpdate(world, pos, Blocks.AIR);
|
||||
if (!world.isClientSide()) {
|
||||
world.syncWorldEvent(2001, pos, getRawIdFromState(state));
|
||||
world.levelEvent(2001, pos, getId(state));
|
||||
}
|
||||
if (world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS) && (player == null || !player.isCreative())) {
|
||||
ItemEntity drop = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5,
|
||||
new ItemStack(this));
|
||||
world.spawnEntity(drop);
|
||||
if (world.getGameRules().getBoolean(GameRules.RULE_DOBLOCKDROPS) && (player == null || !player.isCreative())) {
|
||||
ItemEntity drop = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(this));
|
||||
world.addFreshEntity(drop);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ERenderLayer getRenderLayer() {
|
||||
return ERenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public FluidState getFluidState(BlockState state) {
|
||||
return Fluids.WATER.getStill(false);
|
||||
return Fluids.WATER.getSource(false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue