diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 53b4b7923..fdc220f92 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1,5 +1,5 @@ 308eb79ef3014c4cf1cc0453e827f43e0a9bcf5f assets/actuallyadditions/blockstates/advanced_item_laser_relay_block.json -a5e93227e5cf3956d4b4753dfca19878e5d3b0a9 assets/actuallyadditions/blockstates/atomic_reconstructor_block.json +0bc1a2d02d57a6b8ca85b8d3d286eafc727088e1 assets/actuallyadditions/blockstates/atomic_reconstructor_block.json 6cc10cd01255886d05b71b898b05faa76e2ccc8a assets/actuallyadditions/blockstates/battery_box_block.json b25315def4a9ff486d8a564449764cfb76b00d78 assets/actuallyadditions/blockstates/bio_reactor_block.json eefccdcc7bb6e2e26af2195d266691148bb2c25b assets/actuallyadditions/blockstates/black_chiseled_quartz_slab_block.json @@ -124,7 +124,7 @@ e2c81adfe240117fa0ce2e3dfcfd04f4e1034153 assets/actuallyadditions/blockstates/wh 207adf3d139369e983100a6002f6f77d36d40916 assets/actuallyadditions/blockstates/xp_solidifier_block.json eebd14886a3c1958765f54a3b7a19d0e28813c5a assets/actuallyadditions/lang/en_us.json 8ce3f2af3288773fb581a3668c2cb90b64c9ee2f assets/actuallyadditions/models/block/advanced_item_laser_relay_block.json -cc4fcbe75d6f858567a944e45cdc49711ad4c2cc assets/actuallyadditions/models/block/atomic_reconstructor_block.json +de74eda6290d47ef2b26961693e537d7b8795a06 assets/actuallyadditions/models/block/atomic_reconstructor_block.json 16a76926a07fc8fa10e4a3949d15ad2ca6920bb8 assets/actuallyadditions/models/block/battery_box_block.json fb5b5a6492a2f7b43b2e799552814d565492efcc assets/actuallyadditions/models/block/bio_reactor_block.json 3d2254e3badb613b7c58bad482c14097fffd64e0 assets/actuallyadditions/models/block/black_chiseled_quartz_slab_block.json diff --git a/src/generated/resources/assets/actuallyadditions/blockstates/atomic_reconstructor_block.json b/src/generated/resources/assets/actuallyadditions/blockstates/atomic_reconstructor_block.json index 97516d8ad..77b9c58d2 100644 --- a/src/generated/resources/assets/actuallyadditions/blockstates/atomic_reconstructor_block.json +++ b/src/generated/resources/assets/actuallyadditions/blockstates/atomic_reconstructor_block.json @@ -1,7 +1,30 @@ { "variants": { - "": { + "facing=down": { + "model": "actuallyadditions:block/atomic_reconstructor_block", + "x": 180 + }, + "facing=up": { "model": "actuallyadditions:block/atomic_reconstructor_block" + }, + "facing=north": { + "model": "actuallyadditions:block/atomic_reconstructor_block", + "x": 90 + }, + "facing=south": { + "model": "actuallyadditions:block/atomic_reconstructor_block", + "x": 90, + "y": 180 + }, + "facing=west": { + "model": "actuallyadditions:block/atomic_reconstructor_block", + "x": 90, + "y": 270 + }, + "facing=east": { + "model": "actuallyadditions:block/atomic_reconstructor_block", + "x": 90, + "y": 90 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/actuallyadditions/models/block/atomic_reconstructor_block.json b/src/generated/resources/assets/actuallyadditions/models/block/atomic_reconstructor_block.json index 13d16a380..fa12fc2f0 100644 --- a/src/generated/resources/assets/actuallyadditions/models/block/atomic_reconstructor_block.json +++ b/src/generated/resources/assets/actuallyadditions/models/block/atomic_reconstructor_block.json @@ -1,6 +1,8 @@ { - "parent": "minecraft:block/cube_all", + "parent": "minecraft:block/orientable", "textures": { - "all": "actuallyadditions:block/atomic_reconstructor_block" + "side": "actuallyadditions:block/atomic_reconstructor_block", + "front": "actuallyadditions:block/atomic_reconstructor_block_front", + "top": "actuallyadditions:block/atomic_reconstructor_block_top" } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/common/blocks/FullyDirectionalBlock.java b/src/main/java/de/ellpeck/actuallyadditions/common/blocks/FullyDirectionalBlock.java new file mode 100644 index 000000000..3bb4d83b2 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/common/blocks/FullyDirectionalBlock.java @@ -0,0 +1,32 @@ +package de.ellpeck.actuallyadditions.common.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.state.DirectionProperty; +import net.minecraft.state.StateContainer; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.util.Direction; + +public class FullyDirectionalBlock extends ActuallyBlock { + public static final DirectionProperty FACING = BlockStateProperties.FACING; + + public FullyDirectionalBlock(Properties properties) { + super(properties); + + this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); + } + + public BlockState getBaseConstructorState() { + return this.stateContainer.getBaseState().with(FACING, Direction.NORTH); + } + + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); + } + + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(FACING); + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/common/blocks/building/CrystalClusterBlock.java b/src/main/java/de/ellpeck/actuallyadditions/common/blocks/building/CrystalClusterBlock.java index e5a3413bb..d76b8c193 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/common/blocks/building/CrystalClusterBlock.java +++ b/src/main/java/de/ellpeck/actuallyadditions/common/blocks/building/CrystalClusterBlock.java @@ -1,18 +1,15 @@ package de.ellpeck.actuallyadditions.common.blocks.building; -import de.ellpeck.actuallyadditions.common.blocks.ActuallyBlock; +import de.ellpeck.actuallyadditions.common.blocks.FullyDirectionalBlock; import de.ellpeck.actuallyadditions.common.blocks.types.Crystals; -import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.DirectionProperty; -import net.minecraft.state.StateContainer; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction; -public class CrystalClusterBlock extends ActuallyBlock { +public class CrystalClusterBlock extends FullyDirectionalBlock { public static final DirectionProperty FACING = BlockStateProperties.FACING; public CrystalClusterBlock(Crystals crystal) { @@ -20,16 +17,11 @@ public class CrystalClusterBlock extends ActuallyBlock { .setLightLevel((e) -> 7) .sound(SoundType.GLASS) .hardnessAndResistance(0.25f, 1.0f)); - - this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.UP)); } - public BlockState getStateForPlacement(BlockItemUseContext context) { - return this.getDefaultState().with(FACING, context.getNearestLookingDirection().getOpposite()); - } - - protected void fillStateContainer(StateContainer.Builder builder) { - builder.add(FACING); + @Override + public BlockState getBaseConstructorState() { + return this.stateContainer.getBaseState().with(FACING, Direction.UP); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/common/blocks/functional/AtomicReconstructorBlock.java b/src/main/java/de/ellpeck/actuallyadditions/common/blocks/functional/AtomicReconstructorBlock.java index 3ef18e2cf..6faa953ec 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/common/blocks/functional/AtomicReconstructorBlock.java +++ b/src/main/java/de/ellpeck/actuallyadditions/common/blocks/functional/AtomicReconstructorBlock.java @@ -1,10 +1,20 @@ package de.ellpeck.actuallyadditions.common.blocks.functional; -import de.ellpeck.actuallyadditions.common.blocks.ActuallyBlock; +import de.ellpeck.actuallyadditions.common.blocks.FullyDirectionalBlock; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.state.DirectionProperty; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraftforge.common.ToolType; + +public class AtomicReconstructorBlock extends FullyDirectionalBlock { + public static final DirectionProperty FACING = BlockStateProperties.FACING; -public class AtomicReconstructorBlock extends ActuallyBlock { public AtomicReconstructorBlock() { - super(Properties.create(Material.ROCK)); + super(Properties.create(Material.ROCK) + .harvestTool(ToolType.PICKAXE) + .harvestLevel(0) + .hardnessAndResistance(10f, 80f) + .sound(SoundType.STONE)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/GeneratorBlockStates.java b/src/main/java/de/ellpeck/actuallyadditions/data/GeneratorBlockStates.java index 60f8a77d6..5be1fc867 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/GeneratorBlockStates.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/GeneratorBlockStates.java @@ -2,7 +2,10 @@ package de.ellpeck.actuallyadditions.data; import de.ellpeck.actuallyadditions.common.ActuallyAdditions; import de.ellpeck.actuallyadditions.common.blocks.ActuallyBlocks; -import net.minecraft.block.*; +import net.minecraft.block.Block; +import net.minecraft.block.SlabBlock; +import net.minecraft.block.StairsBlock; +import net.minecraft.block.WallBlock; import net.minecraft.data.DataGenerator; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.ResourceLocation; @@ -19,6 +22,8 @@ public class GeneratorBlockStates extends BlockStateProvider { @Override protected void registerStatesAndModels() { + fullyDirectionalBlock(ActuallyBlocks.ATOMIC_RECONSTRUCTOR); + buildCubeAll(ActuallyBlocks.CRYSTAL_CLUSTER_RESTONIA); buildCubeAll(ActuallyBlocks.CRYSTAL_CLUSTER_PALIS); buildCubeAll(ActuallyBlocks.CRYSTAL_CLUSTER_DIAMATINE); @@ -37,7 +42,6 @@ public class GeneratorBlockStates extends BlockStateProvider { buildCubeAll(ActuallyBlocks.ITEM_INTERFACE); buildCubeAll(ActuallyBlocks.FIREWORK_BOX); buildCubeAll(ActuallyBlocks.MINER); - buildCubeAll(ActuallyBlocks.ATOMIC_RECONSTRUCTOR); buildCubeAll(ActuallyBlocks.CRYSTAL_RESTONIA); buildCubeAll(ActuallyBlocks.CRYSTAL_PALIS); buildCubeAll(ActuallyBlocks.CRYSTAL_DIAMATINE); @@ -160,4 +164,17 @@ public class GeneratorBlockStates extends BlockStateProvider { .partialState().with(BlockStateProperties.LIT, true) .addModels(ConfiguredModel.builder().modelFile(models().cubeAll(name.toString(), modLoc("block/" + name.getPath().replace("_block", "_on_block")))).build()); } + + private void fullyDirectionalBlock(Supplier block) { + ResourceLocation name = block.get().getRegistryName(); + + assert name != null; + directionalBlock(block.get(), models().orientable( + name.toString(), + modLoc(String.format("block/%s", name.getPath())), + modLoc(String.format("block/%s_front", name.getPath())), + modLoc(String.format("block/%s_top", name.getPath())) + )); + } + } diff --git a/src/main/resources/assets/actuallyadditions/textures/block/crystal_redstonia_empowered_block.png.mcmeta b/src/main/resources/assets/actuallyadditions/textures/block/crystal_restonia_empowered_block.png.mcmeta similarity index 100% rename from src/main/resources/assets/actuallyadditions/textures/block/crystal_redstonia_empowered_block.png.mcmeta rename to src/main/resources/assets/actuallyadditions/textures/block/crystal_restonia_empowered_block.png.mcmeta