2021-12-31 13:54:51 +01:00
|
|
|
package com.minelittlepony.unicopia.block;
|
|
|
|
|
2021-12-31 14:47:29 +01:00
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
2021-12-31 13:54:51 +01:00
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.block.Blocks;
|
|
|
|
import net.minecraft.block.FrostedIceBlock;
|
2021-12-31 14:47:29 +01:00
|
|
|
import net.minecraft.block.entity.BlockEntity;
|
2021-12-31 13:54:51 +01:00
|
|
|
import net.minecraft.block.piston.PistonBehavior;
|
2021-12-31 14:47:29 +01:00
|
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.stat.Stats;
|
2021-12-31 13:54:51 +01:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
|
|
|
public class FrostedObsidianBlock extends FrostedIceBlock {
|
|
|
|
public FrostedObsidianBlock(Settings settings) {
|
|
|
|
super(settings);
|
|
|
|
}
|
|
|
|
|
2021-12-31 14:47:29 +01:00
|
|
|
@Override
|
|
|
|
public void afterBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) {
|
|
|
|
player.incrementStat(Stats.MINED.getOrCreateStat(this));
|
|
|
|
player.addExhaustion(0.005f);
|
|
|
|
Block.dropStacks(state, world, pos, blockEntity, player, stack);
|
|
|
|
}
|
|
|
|
|
2021-12-31 13:54:51 +01:00
|
|
|
@Override
|
|
|
|
protected void melt(BlockState state, World world, BlockPos pos) {
|
2022-06-25 00:19:55 +02:00
|
|
|
if (world.getDimension().ultrawarm()) {
|
2021-12-31 13:54:51 +01:00
|
|
|
world.removeBlock(pos, false);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
world.setBlockState(pos, Blocks.LAVA.getDefaultState());
|
|
|
|
world.updateNeighbor(pos, Blocks.LAVA, pos);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public PistonBehavior getPistonBehavior(BlockState state) {
|
|
|
|
return PistonBehavior.BLOCK;
|
|
|
|
}
|
|
|
|
}
|