Utils ported
This commit is contained in:
@@ -20,8 +20,8 @@ package appeng.block.qnb;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -35,13 +35,13 @@ import appeng.tile.qnb.QuantumBridgeBlockEntity;
|
||||
|
||||
public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeBlockEntity> {
|
||||
|
||||
public static final BooleanProperty FORMED = BooleanProperty.create("formed");
|
||||
public static final BooleanProperty FORMED = BooleanProperty.of("formed");
|
||||
|
||||
private static final VoxelShape SHAPE;
|
||||
|
||||
static {
|
||||
final float shave = 2.0f / 16.0f;
|
||||
SHAPE = VoxelShapes.create(new Box(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave));
|
||||
SHAPE = VoxelShapes.cuboid(new Box(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave));
|
||||
}
|
||||
|
||||
public QuantumBaseBlock(Settings props) {
|
||||
@@ -51,13 +51,13 @@ public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeBloc
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
super.appendProperties(builder);
|
||||
builder.add(FORMED);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeBloc
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final QuantumBridgeBlockEntity bridge = this.getBlockEntity(world, pos);
|
||||
if (bridge != null) {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
|
||||
static {
|
||||
final double onePixel = 2.0 / 16.0;
|
||||
SHAPE = VoxelShapes.create(
|
||||
SHAPE = VoxelShapes.cuboid(
|
||||
new Box(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random rand) {
|
||||
public void randomDisplayTick(final BlockState state, final World w, final BlockPos pos, final Random rand) {
|
||||
final QuantumBridgeBlockEntity bridge = this.getBlockEntity(w, pos);
|
||||
if (bridge != null) {
|
||||
if (bridge.hasQES()) {
|
||||
@@ -90,7 +90,7 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ public class QuantumRingBlock extends QuantumBaseBlock {
|
||||
private static final VoxelShape SHAPE_FORMED = createShape(1.0 / 16.0);
|
||||
|
||||
public QuantumRingBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
super(defaultProps(Material.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
|
||||
final QuantumBridgeBlockEntity bridge = this.getBlockEntity(w, pos);
|
||||
if (bridge != null && bridge.isCorner()) {
|
||||
return SHAPE_CORNER;
|
||||
@@ -51,7 +51,7 @@ public class QuantumRingBlock extends QuantumBaseBlock {
|
||||
}
|
||||
|
||||
private static VoxelShape createShape(double onePixel) {
|
||||
return VoxelShapes.create(
|
||||
return VoxelShapes.cuboid(
|
||||
new Box(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user