More fixes, time to sleep...

This commit is contained in:
Flanks255 2021-08-29 19:01:35 -05:00
parent 626df0f7fa
commit 56ec90df99
6 changed files with 16 additions and 53 deletions

View file

@ -24,7 +24,7 @@ public class BlockCrystal extends ActuallyBlock {
public AABlockItem createBlockItem() { public AABlockItem createBlockItem() {
return new AABlockItem(this, getItemProperties()) { return new AABlockItem(this, getItemProperties()) {
@Override @Override
public boolean hasEffect(ItemStack stack) { public boolean isFoil(ItemStack stack) {
return isEmpowered; return isEmpowered;
} }
}; };

View file

@ -1,39 +0,0 @@
// TODO: [port][note] not used
///*
// * This file ("BlockFurnaceSolar.java") is part of the Actually Additions mod for Minecraft.
// * It is created and owned by Ellpeck and distributed
// * under the Actually Additions License to be found at
// * http://ellpeck.de/actaddlicense
// * View the source code at https://github.com/Ellpeck/ActuallyAdditions
// *
// * © 2015-2017 Ellpeck
// */
//
//package de.ellpeck.actuallyadditions.mod.blocks;
//
//import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
//import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceSolar;
//import net.minecraft.block.BlockState;
//import net.minecraft.block.SoundType;
//import net.minecraft.block.material.Material;
//import net.minecraft.tileentity.TileEntity;
//import net.minecraft.util.math.AxisAlignedBB;
//import net.minecraft.util.math.BlockPos;
//import net.minecraft.world.IBlockAccess;
//import net.minecraft.world.IBlockReader;
//
//public class BlockFurnaceSolar extends BlockContainerBase {
// public BlockFurnaceSolar() {
// super(Material.ROCK, this.name);
// this.setHarvestLevel("pickaxe", 0);
// this.setHardness(1.5F);
// this.setResistance(10.0F);
// this.setSoundType(SoundType.STONE);
// }
//
//
// @Override
// public TileEntity createNewTileEntity(IBlockReader worldIn) {
// return new TileEntityFurnaceSolar();
// }
//}

View file

@ -19,13 +19,15 @@ import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
import javax.annotation.Nullable;
public class BlockItemInterface extends BlockContainerBase { public class BlockItemInterface extends BlockContainerBase {
public BlockItemInterface() { public BlockItemInterface() {
super(ActuallyBlocks.defaultPickProps(0)); super(ActuallyBlocks.defaultPickProps(0));
} }
@Override @Override
public TileEntity createNewTileEntity(IBlockReader worldIn) { public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityItemInterface(); return new TileEntityItemInterface();
} }

View file

@ -29,7 +29,7 @@ public class BlockItemInterfaceHopping extends BlockItemInterface {
} }
@Override @Override
public TileEntity createNewTileEntity(IBlockReader worldIn) { public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityItemInterfaceHopping(); return new TileEntityItemInterfaceHopping();
} }
} }

View file

@ -31,12 +31,12 @@ public class BlockLongRangeBreaker extends FullyDirectionalBlock.Container {
} }
@Override @Override
public TileEntity createNewTileEntity(IBlockReader worldIn) { public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityLongRangeBreaker(); return new TileEntityLongRangeBreaker();
} }
@Override @Override
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
if (this.tryToggleRedstone(world, pos, player)) { if (this.tryToggleRedstone(world, pos, player)) {
return ActionResultType.PASS; return ActionResultType.PASS;
} }
@ -46,7 +46,7 @@ public class BlockLongRangeBreaker extends FullyDirectionalBlock.Container {
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
switch (state.get(FACING)) { switch (state.getValue(FACING)) {
case UP: case UP:
return Shapes.DirectionalBlockBreakerShapes.SHAPE_U; return Shapes.DirectionalBlockBreakerShapes.SHAPE_U;
case DOWN: case DOWN:

View file

@ -38,21 +38,21 @@ import java.util.Random;
public class BlockPoweredFurnace extends BlockContainerBase { public class BlockPoweredFurnace extends BlockContainerBase {
public BlockPoweredFurnace() { public BlockPoweredFurnace() {
// TODO: [port] confirm this is correct for light level... Might not be reactive. // TODO: [port] confirm this is correct for light level... Might not be reactive.
super(ActuallyBlocks.defaultPickProps(0).tickRandomly().setLightLevel(state -> state.get(LIT) super(ActuallyBlocks.defaultPickProps(0).randomTicks().lightLevel(state -> state.getValue(LIT)
? 12 ? 12
: 0)); : 0));
this.setDefaultState(this.stateContainer.getBaseState().with(HORIZONTAL_FACING, Direction.NORTH).with(LIT, false)); registerDefaultState(getStateDefinition().any().setValue(HORIZONTAL_FACING, Direction.NORTH).setValue(LIT, false));
} }
@Override @Override
public TileEntity createNewTileEntity(IBlockReader worldIn) { public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityPoweredFurnace(); return new TileEntityPoweredFurnace();
} }
@Override @Override
public void randomTick(BlockState state, ServerWorld worldIn, BlockPos pos, Random random) { public void randomTick(BlockState state, ServerWorld worldIn, BlockPos pos, Random random) {
if (state.get(LIT)) { if (state.getValue(LIT)) {
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
worldIn.addParticle(ParticleTypes.SMOKE, (double) pos.getX() + 0.5F, (double) pos.getY() + 1.0F, (double) pos.getZ() + 0.5F, 0.0D, 0.0D, 0.0D); worldIn.addParticle(ParticleTypes.SMOKE, (double) pos.getX() + 0.5F, (double) pos.getY() + 1.0F, (double) pos.getZ() + 0.5F, 0.0D, 0.0D, 0.0D);
} }
@ -60,17 +60,17 @@ public class BlockPoweredFurnace extends BlockContainerBase {
} }
@Override @Override
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { public ActionResultType use(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
return this.openGui(worldIn, player, pos, TileEntityPoweredFurnace.class); return this.openGui(worldIn, player, pos, TileEntityPoweredFurnace.class);
} }
@Override @Override
public BlockState getStateForPlacement(BlockItemUseContext context) { public BlockState getStateForPlacement(BlockItemUseContext context) {
return this.getDefaultState().with(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).with(LIT, false); return defaultBlockState().setValue(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).setValue(LIT, false);
} }
@Override @Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
builder.add(LIT).add(HORIZONTAL_FACING); builder.add(LIT).add(HORIZONTAL_FACING);
} }
@ -91,7 +91,7 @@ public class BlockPoweredFurnace extends BlockContainerBase {
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
switch (state.get(HORIZONTAL_FACING)) { switch (state.getValue(HORIZONTAL_FACING)) {
case EAST: case EAST:
return Shapes.FurnaceDoubleShapes.SHAPE_E; return Shapes.FurnaceDoubleShapes.SHAPE_E;
case SOUTH: case SOUTH: