diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java index 2b2f67e3b..254fc9dbf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java @@ -24,7 +24,7 @@ public class BlockCrystal extends ActuallyBlock { public AABlockItem createBlockItem() { return new AABlockItem(this, getItemProperties()) { @Override - public boolean hasEffect(ItemStack stack) { + public boolean isFoil(ItemStack stack) { return isEmpowered; } }; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java deleted file mode 100644 index 8d6c619a0..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java +++ /dev/null @@ -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(); -// } -//} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterface.java index 5189a4314..e3408e28a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterface.java @@ -19,13 +19,15 @@ import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; +import javax.annotation.Nullable; + public class BlockItemInterface extends BlockContainerBase { public BlockItemInterface() { super(ActuallyBlocks.defaultPickProps(0)); } @Override - public TileEntity createNewTileEntity(IBlockReader worldIn) { + public TileEntity newBlockEntity(IBlockReader worldIn) { return new TileEntityItemInterface(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterfaceHopping.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterfaceHopping.java index a7d1ea150..ce6a08052 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterfaceHopping.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterfaceHopping.java @@ -29,7 +29,7 @@ public class BlockItemInterfaceHopping extends BlockItemInterface { } @Override - public TileEntity createNewTileEntity(IBlockReader worldIn) { + public TileEntity newBlockEntity(IBlockReader worldIn) { return new TileEntityItemInterfaceHopping(); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLongRangeBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLongRangeBreaker.java index 8e0ee123f..d12535f88 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLongRangeBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLongRangeBreaker.java @@ -31,12 +31,12 @@ public class BlockLongRangeBreaker extends FullyDirectionalBlock.Container { } @Override - public TileEntity createNewTileEntity(IBlockReader worldIn) { + public TileEntity newBlockEntity(IBlockReader worldIn) { return new TileEntityLongRangeBreaker(); } @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)) { return ActionResultType.PASS; } @@ -46,7 +46,7 @@ public class BlockLongRangeBreaker extends FullyDirectionalBlock.Container { @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { - switch (state.get(FACING)) { + switch (state.getValue(FACING)) { case UP: return Shapes.DirectionalBlockBreakerShapes.SHAPE_U; case DOWN: diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPoweredFurnace.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPoweredFurnace.java index 5d0ad1fad..99ee560ab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPoweredFurnace.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPoweredFurnace.java @@ -38,21 +38,21 @@ import java.util.Random; public class BlockPoweredFurnace extends BlockContainerBase { public BlockPoweredFurnace() { // 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 : 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 - public TileEntity createNewTileEntity(IBlockReader worldIn) { + public TileEntity newBlockEntity(IBlockReader worldIn) { return new TileEntityPoweredFurnace(); } @Override 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++) { 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 - 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); } @Override 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 - protected void fillStateContainer(StateContainer.Builder builder) { + protected void createBlockStateDefinition(StateContainer.Builder builder) { builder.add(LIT).add(HORIZONTAL_FACING); } @@ -91,7 +91,7 @@ public class BlockPoweredFurnace extends BlockContainerBase { @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { - switch (state.get(HORIZONTAL_FACING)) { + switch (state.getValue(HORIZONTAL_FACING)) { case EAST: return Shapes.FurnaceDoubleShapes.SHAPE_E; case SOUTH: