mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
More fixes, time to sleep...
This commit is contained in:
parent
626df0f7fa
commit
56ec90df99
6 changed files with 16 additions and 53 deletions
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
// }
|
||||
//}
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public class BlockItemInterfaceHopping extends BlockItemInterface {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(IBlockReader worldIn) {
|
||||
public TileEntity newBlockEntity(IBlockReader worldIn) {
|
||||
return new TileEntityItemInterfaceHopping();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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<Block, BlockState> builder) {
|
||||
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> 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:
|
||||
|
|
Loading…
Reference in a new issue