mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-24 16:18:33 +01:00
Compare commits
No commits in common. "56ec90df997851f23314e10539dcd8aa87d86ee5" and "12cd168a36ca2a22e5f21dc2d788d5d88ba283d0" have entirely different histories.
56ec90df99
...
12cd168a36
19 changed files with 105 additions and 71 deletions
|
@ -27,7 +27,7 @@ public class ActuallyBlock extends Block implements IActuallyBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item.Properties getItemProperties() {
|
public Item.Properties getItemProperties() {
|
||||||
return new Item.Properties().tab(ActuallyAdditions.GROUP);
|
return new Item.Properties().group(ActuallyAdditions.GROUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Stairs extends StairsBlock implements IActuallyBlock {
|
public static class Stairs extends StairsBlock implements IActuallyBlock {
|
||||||
|
@ -42,7 +42,7 @@ public class ActuallyBlock extends Block implements IActuallyBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item.Properties getItemProperties() {
|
public Item.Properties getItemProperties() {
|
||||||
return new Item.Properties().tab(ActuallyAdditions.GROUP);
|
return new Item.Properties().group(ActuallyAdditions.GROUP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public class ActuallyBlock extends Block implements IActuallyBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item.Properties getItemProperties() {
|
public Item.Properties getItemProperties() {
|
||||||
return new Item.Properties().tab(ActuallyAdditions.GROUP);
|
return new Item.Properties().group(ActuallyAdditions.GROUP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,9 +29,9 @@ public final class ActuallyBlocks {
|
||||||
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ActuallyAdditions.MODID);
|
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ActuallyAdditions.MODID);
|
||||||
public static final DeferredRegister<TileEntityType<?>> TILES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, ActuallyAdditions.MODID);
|
public static final DeferredRegister<TileEntityType<?>> TILES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, ActuallyAdditions.MODID);
|
||||||
|
|
||||||
private static final Item.Properties defaultBlockItemProperties = new Item.Properties().tab(ActuallyAdditions.GROUP).stacksTo(64);
|
private static final Item.Properties defaultBlockItemProperties = new Item.Properties().group(ActuallyAdditions.GROUP).maxStackSize(64);
|
||||||
|
|
||||||
public static final AbstractBlock.Properties miscBlockProperties = AbstractBlock.Properties.of(Material.STONE).harvestLevel(1).harvestTool(ToolType.PICKAXE).strength(1.5f, 10f);
|
public static final AbstractBlock.Properties miscBlockProperties = AbstractBlock.Properties.create(Material.ROCK).harvestLevel(1).harvestTool(ToolType.PICKAXE).hardnessAndResistance(1.5f, 10f);
|
||||||
|
|
||||||
// Casings
|
// Casings
|
||||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> WOOD_CASING = new AABlockReg<>("wood_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem);
|
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> WOOD_CASING = new AABlockReg<>("wood_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem);
|
||||||
|
@ -217,37 +217,37 @@ public final class ActuallyBlocks {
|
||||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_BLOCK = new AABlockReg<>("chiseled_black_quartz_block", () -> new ActuallyBlock(miscBlockProperties),
|
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_BLOCK = new AABlockReg<>("chiseled_black_quartz_block", () -> new ActuallyBlock(miscBlockProperties),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
|
|
||||||
public static final AABlockReg<StairsBlock, AABlockItem, ?> ETHETIC_GREEN_STAIRS = new AABlockReg<>("ethetic_green_stairs", () -> new StairsBlock(() -> ETHETIC_GREEN_BLOCK.get().defaultBlockState(), AbstractBlock.Properties.copy(ETHETIC_GREEN_BLOCK.get())),
|
public static final AABlockReg<StairsBlock, AABlockItem, ?> ETHETIC_GREEN_STAIRS = new AABlockReg<>("ethetic_green_stairs", () -> new StairsBlock(() -> ETHETIC_GREEN_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<StairsBlock, AABlockItem, ?> ETHETIC_WHITE_STAIRS = new AABlockReg<>("ethetic_white_stairs", () -> new StairsBlock(() -> ETHETIC_WHITE_BLOCK.get().defaultBlockState(), AbstractBlock.Properties.copy(ETHETIC_WHITE_BLOCK.get())),
|
public static final AABlockReg<StairsBlock, AABlockItem, ?> ETHETIC_WHITE_STAIRS = new AABlockReg<>("ethetic_white_stairs", () -> new StairsBlock(() -> ETHETIC_WHITE_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<StairsBlock, AABlockItem, ?> BLACK_QUARTZ_STAIR = new AABlockReg<>("black_quartz_stair", () -> new StairsBlock(() -> BLACK_QUARTZ_BLOCK.get().defaultBlockState(), AbstractBlock.Properties.copy(BLACK_QUARTZ_BLOCK.get())),
|
public static final AABlockReg<StairsBlock, AABlockItem, ?> BLACK_QUARTZ_STAIR = new AABlockReg<>("black_quartz_stair", () -> new StairsBlock(() -> BLACK_QUARTZ_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(BLACK_QUARTZ_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<StairsBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_STAIR = new AABlockReg<>("chiseled_black_quartz_stair", () -> new StairsBlock(() -> CHISELED_BLACK_QUARTZ_BLOCK.get().defaultBlockState(), AbstractBlock.Properties.copy(CHISELED_BLACK_QUARTZ_BLOCK.get())),
|
public static final AABlockReg<StairsBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_STAIR = new AABlockReg<>("chiseled_black_quartz_stair", () -> new StairsBlock(() -> CHISELED_BLACK_QUARTZ_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(CHISELED_BLACK_QUARTZ_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<StairsBlock, AABlockItem, ?> BLACK_QUARTZ_PILLAR_STAIR = new AABlockReg<>("black_quartz_pillar_stair", () -> new StairsBlock(() -> BLACK_QUARTZ_PILLAR_BLOCK.get().defaultBlockState(), AbstractBlock.Properties.copy(BLACK_QUARTZ_PILLAR_BLOCK.get())),
|
public static final AABlockReg<StairsBlock, AABlockItem, ?> BLACK_QUARTZ_PILLAR_STAIR = new AABlockReg<>("black_quartz_pillar_stair", () -> new StairsBlock(() -> BLACK_QUARTZ_PILLAR_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(BLACK_QUARTZ_PILLAR_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
|
|
||||||
public static final AABlockReg<WallBlock, AABlockItem, ?> ETHETIC_GREEN_WALL = new AABlockReg<>("ethetic_green_wall", () -> new WallBlock(AbstractBlock.Properties.copy(ETHETIC_GREEN_BLOCK.get())),
|
public static final AABlockReg<WallBlock, AABlockItem, ?> ETHETIC_GREEN_WALL = new AABlockReg<>("ethetic_green_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<WallBlock, AABlockItem, ?> ETHETIC_WHITE_WALL = new AABlockReg<>("ethetic_white_wall", () -> new WallBlock(AbstractBlock.Properties.copy(ETHETIC_WHITE_BLOCK.get())),
|
public static final AABlockReg<WallBlock, AABlockItem, ?> ETHETIC_WHITE_WALL = new AABlockReg<>("ethetic_white_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<WallBlock, AABlockItem, ?> BLACK_QUARTZ_WALL = new AABlockReg<>("black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.copy(BLACK_QUARTZ_BLOCK.get())),
|
public static final AABlockReg<WallBlock, AABlockItem, ?> BLACK_QUARTZ_WALL = new AABlockReg<>("black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<WallBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_WALL = new AABlockReg<>("chiseled_black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.copy(CHISELED_BLACK_QUARTZ_BLOCK.get())),
|
public static final AABlockReg<WallBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_WALL = new AABlockReg<>("chiseled_black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.from(CHISELED_BLACK_QUARTZ_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<WallBlock, AABlockItem, ?> BLACK_QUARTZ_PILLAR_WALL = new AABlockReg<>("black_quartz_pillar_wall", () -> new WallBlock(AbstractBlock.Properties.copy(BLACK_QUARTZ_PILLAR_BLOCK.get())),
|
public static final AABlockReg<WallBlock, AABlockItem, ?> BLACK_QUARTZ_PILLAR_WALL = new AABlockReg<>("black_quartz_pillar_wall", () -> new WallBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_PILLAR_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
|
|
||||||
public static final AABlockReg<SlabBlock, AABlockItem, ?> ETHETIC_GREEN_SLAB = new AABlockReg<>("ethetic_green_slab", () -> new SlabBlock(AbstractBlock.Properties.copy(ETHETIC_GREEN_BLOCK.get())),
|
public static final AABlockReg<SlabBlock, AABlockItem, ?> ETHETIC_GREEN_SLAB = new AABlockReg<>("ethetic_green_slab", () -> new SlabBlock(AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<SlabBlock, AABlockItem, ?> ETHETIC_WHITE_SLAB = new AABlockReg<>("ethetic_white_slab", () -> new SlabBlock(AbstractBlock.Properties.copy(ETHETIC_WHITE_BLOCK.get())),
|
public static final AABlockReg<SlabBlock, AABlockItem, ?> ETHETIC_WHITE_SLAB = new AABlockReg<>("ethetic_white_slab", () -> new SlabBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<SlabBlock, AABlockItem, ?> BLACK_QUARTZ_SLAB = new AABlockReg<>("black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.copy(BLACK_QUARTZ_BLOCK.get())),
|
public static final AABlockReg<SlabBlock, AABlockItem, ?> BLACK_QUARTZ_SLAB = new AABlockReg<>("black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<SlabBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_SLAB = new AABlockReg<>("chiseled_black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.copy(CHISELED_BLACK_QUARTZ_BLOCK.get())),
|
public static final AABlockReg<SlabBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_SLAB = new AABlockReg<>("chiseled_black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.from(CHISELED_BLACK_QUARTZ_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
public static final AABlockReg<SlabBlock, AABlockItem, ?> BLACK_QUARTZ_PILLAR_SLAB = new AABlockReg<>("black_quartz_pillar_slab", () -> new SlabBlock(AbstractBlock.Properties.copy(BLACK_QUARTZ_PILLAR_BLOCK.get())),
|
public static final AABlockReg<SlabBlock, AABlockItem, ?> BLACK_QUARTZ_PILLAR_SLAB = new AABlockReg<>("black_quartz_pillar_slab", () -> new SlabBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_PILLAR_BLOCK.get())),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 isFoil(ItemStack stack) {
|
public boolean hasEffect(ItemStack stack) {
|
||||||
return isEmpowered;
|
return isEmpowered;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
// 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,15 +19,13 @@ 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 newBlockEntity(IBlockReader worldIn) {
|
public TileEntity createNewTileEntity(IBlockReader worldIn) {
|
||||||
return new TileEntityItemInterface();
|
return new TileEntityItemInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class BlockItemInterfaceHopping extends BlockItemInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity newBlockEntity(IBlockReader worldIn) {
|
public TileEntity createNewTileEntity(IBlockReader worldIn) {
|
||||||
return new TileEntityItemInterfaceHopping();
|
return new TileEntityItemInterfaceHopping();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,12 +31,12 @@ public class BlockLongRangeBreaker extends FullyDirectionalBlock.Container {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity newBlockEntity(IBlockReader worldIn) {
|
public TileEntity createNewTileEntity(IBlockReader worldIn) {
|
||||||
return new TileEntityLongRangeBreaker();
|
return new TileEntityLongRangeBreaker();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
public ActionResultType onBlockActivated(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.getValue(FACING)) {
|
switch (state.get(FACING)) {
|
||||||
case UP:
|
case UP:
|
||||||
return Shapes.DirectionalBlockBreakerShapes.SHAPE_U;
|
return Shapes.DirectionalBlockBreakerShapes.SHAPE_U;
|
||||||
case DOWN:
|
case DOWN:
|
||||||
|
|
|
@ -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).randomTicks().lightLevel(state -> state.getValue(LIT)
|
super(ActuallyBlocks.defaultPickProps(0).tickRandomly().setLightLevel(state -> state.get(LIT)
|
||||||
? 12
|
? 12
|
||||||
: 0));
|
: 0));
|
||||||
|
|
||||||
registerDefaultState(getStateDefinition().any().setValue(HORIZONTAL_FACING, Direction.NORTH).setValue(LIT, false));
|
this.setDefaultState(this.stateContainer.getBaseState().with(HORIZONTAL_FACING, Direction.NORTH).with(LIT, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity newBlockEntity(IBlockReader worldIn) {
|
public TileEntity createNewTileEntity(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.getValue(LIT)) {
|
if (state.get(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 use(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
public ActionResultType onBlockActivated(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 defaultBlockState().setValue(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).setValue(LIT, false);
|
return this.getDefaultState().with(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).with(LIT, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
|
protected void fillStateContainer(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.getValue(HORIZONTAL_FACING)) {
|
switch (state.get(HORIZONTAL_FACING)) {
|
||||||
case EAST:
|
case EAST:
|
||||||
return Shapes.FurnaceDoubleShapes.SHAPE_E;
|
return Shapes.FurnaceDoubleShapes.SHAPE_E;
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
|
|
|
@ -33,29 +33,33 @@ public class CrystalClusterBlock extends FullyDirectionalBlock {
|
||||||
public static final DirectionProperty FACING = BlockStateProperties.FACING;
|
public static final DirectionProperty FACING = BlockStateProperties.FACING;
|
||||||
|
|
||||||
public static final VoxelShape CRYSTAL_SHAPE = Stream.of(
|
public static final VoxelShape CRYSTAL_SHAPE = Stream.of(
|
||||||
Block.box(5, 4, 5, 10, 19, 10), Block.box(4, 0, 4, 11, 5, 11),
|
Block.makeCuboidShape(5, 4, 5, 10, 19, 10), Block.makeCuboidShape(4, 0, 4, 11, 5, 11),
|
||||||
Block.box(3, 0, 3, 5, 4, 5), Block.box(10, 0, 3, 12, 2, 5),
|
Block.makeCuboidShape(3, 0, 3, 5, 4, 5), Block.makeCuboidShape(10, 0, 3, 12, 2, 5),
|
||||||
Block.box(12, 0, 4, 13, 1, 5), Block.box(11, 0, 5, 12, 1, 6),
|
Block.makeCuboidShape(12, 0, 4, 13, 1, 5), Block.makeCuboidShape(11, 0, 5, 12, 1, 6),
|
||||||
Block.box(10, 0, 10, 12, 3, 12), Block.box(3, 0, 10, 5, 1, 12),
|
Block.makeCuboidShape(10, 0, 10, 12, 3, 12), Block.makeCuboidShape(3, 0, 10, 5, 1, 12),
|
||||||
Block.box(9, 0, 3, 10, 3, 4), Block.box(8, 0, 2, 11, 1, 4),
|
Block.makeCuboidShape(9, 0, 3, 10, 3, 4), Block.makeCuboidShape(8, 0, 2, 11, 1, 4),
|
||||||
Block.box(4, 0, 2, 5, 2, 3), Block.box(5, 0, 3, 7, 1, 4),
|
Block.makeCuboidShape(4, 0, 2, 5, 2, 3), Block.makeCuboidShape(5, 0, 3, 7, 1, 4),
|
||||||
Block.box(2, 0, 4, 4, 1, 6), Block.box(3, 0, 5, 4, 3, 6.5),
|
Block.makeCuboidShape(2, 0, 4, 4, 1, 6), Block.makeCuboidShape(3, 0, 5, 4, 3, 6.5),
|
||||||
Block.box(3, 0, 9, 4, 2, 10), Block.box(2, 0, 8, 4, 1, 10),
|
Block.makeCuboidShape(3, 0, 9, 4, 2, 10), Block.makeCuboidShape(2, 0, 8, 4, 1, 10),
|
||||||
Block.box(5, 0, 11, 7, 2, 13), Block.box(7, 0, 11, 11, 1, 13),
|
Block.makeCuboidShape(5, 0, 11, 7, 2, 13), Block.makeCuboidShape(7, 0, 11, 11, 1, 13),
|
||||||
Block.box(10, 0, 9, 13, 1, 11), Block.box(11, 0, 7, 12, 3, 9)
|
Block.makeCuboidShape(10, 0, 9, 13, 1, 11), Block.makeCuboidShape(11, 0, 7, 12, 3, 9)
|
||||||
).reduce((v1, v2) -> VoxelShapes.join(v1, v2, IBooleanFunction.OR) ).get();
|
).reduce((v1, v2) -> {return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR);}).get();
|
||||||
|
|
||||||
public CrystalClusterBlock(Crystals crystal) {
|
public CrystalClusterBlock(Crystals crystal) {
|
||||||
super(Block.Properties.of(Material.GLASS)
|
super(Properties.create(Material.GLASS)
|
||||||
.lightLevel((e) -> 7)
|
.setLightLevel((e) -> 7)
|
||||||
.sound(SoundType.GLASS)
|
.sound(SoundType.GLASS)
|
||||||
.noOcclusion()
|
.hardnessAndResistance(0.25f, 1.0f));
|
||||||
.strength(0.25f, 1.0f));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getBaseConstructorState() {
|
public BlockState getBaseConstructorState() {
|
||||||
return this.defaultBlockState().setValue(FACING, Direction.UP);
|
return this.stateContainer.getBaseState().with(FACING, Direction.UP);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isTransparent(BlockState state) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerBreaker;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerBreaker;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||||
|
@ -47,7 +46,7 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements INamed
|
||||||
}
|
}
|
||||||
|
|
||||||
public TileEntityBreaker() {
|
public TileEntityBreaker() {
|
||||||
super(ActuallyBlocks.BREAKER.getTileEntityType(), 9);
|
super(ActuallyTiles.BREAKER_TILE.get(), 9);
|
||||||
this.isPlacer = false;
|
this.isPlacer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,9 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
||||||
|
|
||||||
public class TileEntityPhantomBooster extends TileEntityBase {
|
public class TileEntityPhantomBooster extends TileEntityBase {
|
||||||
|
|
||||||
public TileEntityPhantomBooster() {
|
public TileEntityPhantomBooster() {
|
||||||
super(ActuallyBlocks.PHANTOM_BOOSTER.getTileEntityType());
|
super(ActuallyTiles.PHANTOM_BOOSTER_TILE.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
||||||
|
@ -18,7 +17,7 @@ import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
||||||
public class TileEntityPhantomBreaker extends TileEntityPhantomPlacer {
|
public class TileEntityPhantomBreaker extends TileEntityPhantomPlacer {
|
||||||
|
|
||||||
public TileEntityPhantomBreaker() {
|
public TileEntityPhantomBreaker() {
|
||||||
super(ActuallyBlocks.PHANTOM_BREAKER.getTileEntityType(), 9);
|
super(ActuallyTiles.PHANTOMBREAKER_TILE.get(), 9);
|
||||||
this.isBreaker = true;
|
this.isBreaker = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import net.minecraft.util.Direction;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.energy.CapabilityEnergy;
|
import net.minecraftforge.energy.CapabilityEnergy;
|
||||||
|
|
||||||
public class TileEntityPhantomEnergyface extends TileEntityPhantomface implements ISharingEnergyProvider {
|
public class TileEntityPhantomEnergyface extends TileEntityPhantomFace implements ISharingEnergyProvider {
|
||||||
|
|
||||||
public TileEntityPhantomEnergyface() {
|
public TileEntityPhantomEnergyface() {
|
||||||
super(ActuallyBlocks.PHANTOM_ENERGYFACE.getTileEntityType());
|
super(ActuallyBlocks.PHANTOM_ENERGYFACE.getTileEntityType());
|
||||||
|
|
|
@ -19,7 +19,7 @@ import net.minecraft.util.Direction;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
|
|
||||||
public class TileEntityPhantomItemface extends TileEntityPhantomface {
|
public class TileEntityPhantomItemface extends TileEntityPhantomFace {
|
||||||
|
|
||||||
public TileEntityPhantomItemface() {
|
public TileEntityPhantomItemface() {
|
||||||
super(ActuallyBlocks.PHANTOM_ITEMFACE.getTileEntityType());
|
super(ActuallyBlocks.PHANTOM_ITEMFACE.getTileEntityType());
|
||||||
|
|
|
@ -17,7 +17,7 @@ import net.minecraft.util.Direction;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||||
|
|
||||||
public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements ISharingFluidHandler {
|
public class TileEntityPhantomLiquiface extends TileEntityPhantomFace implements ISharingFluidHandler {
|
||||||
|
|
||||||
public TileEntityPhantomLiquiface() {
|
public TileEntityPhantomLiquiface() {
|
||||||
super(ActuallyBlocks.PHANTOM_LIQUIFACE.getTileEntityType());
|
super(ActuallyBlocks.PHANTOM_LIQUIFACE.getTileEntityType());
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
|
@ -18,7 +17,7 @@ import net.minecraftforge.common.capabilities.Capability;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class TileEntityPhantomRedstoneface extends TileEntityPhantomface {
|
public class TileEntityPhantomRedstoneface extends TileEntityPhantomFace {
|
||||||
|
|
||||||
public final int[] providesStrong = new int[Direction.values().length];
|
public final int[] providesStrong = new int[Direction.values().length];
|
||||||
public final int[] providesWeak = new int[Direction.values().length];
|
public final int[] providesWeak = new int[Direction.values().length];
|
||||||
|
@ -27,7 +26,7 @@ public class TileEntityPhantomRedstoneface extends TileEntityPhantomface {
|
||||||
private final int[] lastProvidesWeak = new int[this.providesWeak.length];
|
private final int[] lastProvidesWeak = new int[this.providesWeak.length];
|
||||||
|
|
||||||
public TileEntityPhantomRedstoneface() {
|
public TileEntityPhantomRedstoneface() {
|
||||||
super(ActuallyBlocks.PHANTOM_REDSTONEFACE.getTileEntityType());
|
super(ActuallyTiles.PHANTOMREDSTONEFACE_TILE.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -33,6 +33,7 @@ import javax.annotation.Nullable;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
||||||
|
|
||||||
public abstract class TileEntityPhantomface extends TileEntityInventoryBase implements IPhantomTile {
|
public abstract class TileEntityPhantomface extends TileEntityInventoryBase implements IPhantomTile {
|
||||||
|
|
||||||
public static final int RANGE = 16;
|
public static final int RANGE = 16;
|
||||||
public BlockPos boundPosition;
|
public BlockPos boundPosition;
|
||||||
public BlockPhantom.Type type;
|
public BlockPhantom.Type type;
|
||||||
|
@ -42,11 +43,10 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
|
||||||
private Block boundBlockBefore;
|
private Block boundBlockBefore;
|
||||||
private int lastStrength;
|
private int lastStrength;
|
||||||
|
|
||||||
public TileEntityPhantomface(TileEntityType<?> type) {
|
public TileEntityPhantomFace(TileEntityType<?> type) {
|
||||||
super(type, 0);
|
super(type, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static int upgradeRange(int defaultRange, World world, BlockPos pos) {
|
public static int upgradeRange(int defaultRange, World world, BlockPos pos) {
|
||||||
int newRange = defaultRange;
|
int newRange = defaultRange;
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
|
|
|
@ -10,14 +10,13 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
||||||
|
|
||||||
public class TileEntityPlacer extends TileEntityBreaker {
|
public class TileEntityPlacer extends TileEntityBreaker {
|
||||||
|
|
||||||
public TileEntityPlacer() {
|
public TileEntityPlacer() {
|
||||||
super(ActuallyBlocks.PLACER.getTileEntityType(), 9);
|
super(ActuallyTiles.PLACER_TILE.get(), 9);
|
||||||
this.isPlacer = true;
|
this.isPlacer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -39,7 +38,7 @@ public class TileEntityPlayerInterface extends TileEntityBase implements IEnergy
|
||||||
private int range;
|
private int range;
|
||||||
|
|
||||||
public TileEntityPlayerInterface() {
|
public TileEntityPlayerInterface() {
|
||||||
super(ActuallyBlocks.PLAYER_INTERFACE.getTileEntityType());
|
super(ActuallyTiles.PLAYERINTERFACE_TILE.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
private PlayerEntity getPlayer() {
|
private PlayerEntity getPlayer() {
|
||||||
|
|
Loading…
Reference in a new issue