diff --git a/src/generated/resources/assets/anvilcraft/blockstates/sliding_rail.json b/src/generated/resources/assets/anvilcraft/blockstates/sliding_rail.json index 5fa1b7e9f..95cfeb6f9 100644 --- a/src/generated/resources/assets/anvilcraft/blockstates/sliding_rail.json +++ b/src/generated/resources/assets/anvilcraft/blockstates/sliding_rail.json @@ -5,7 +5,7 @@ "y": 90 }, "axis=y": { - "model": "anvilcraft:block/sliding_rail" + "model": "anvilcraft:block/sliding_rail_cross" }, "axis=z": { "model": "anvilcraft:block/sliding_rail" diff --git a/src/main/java/dev/dubhe/anvilcraft/block/SlidingRailBlock.java b/src/main/java/dev/dubhe/anvilcraft/block/SlidingRailBlock.java index a09f59fc6..014ce92ab 100644 --- a/src/main/java/dev/dubhe/anvilcraft/block/SlidingRailBlock.java +++ b/src/main/java/dev/dubhe/anvilcraft/block/SlidingRailBlock.java @@ -63,6 +63,14 @@ public class SlidingRailBlock extends Block implements IHammerChangeable, IHamme Block.box(0, 12, 0, 5, 16, 16), Block.box(11, 6, 0, 14, 12, 16) ).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get(); + public static final VoxelShape AABB_Y = + Stream.of( + Block.box(0, 0, 0, 16, 6, 16), + Block.box(11, 6, 11, 16, 16, 16), + Block.box(0, 6, 11, 5, 16, 16), + Block.box(0, 6, 0, 5, 16, 5), + Block.box(11, 6, 0, 16, 16, 5) + ).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get(); public static final EnumProperty AXIS = BlockStateProperties.AXIS; public static final HashMap MOVING_PISTON_MAP = new HashMap<>(); @@ -99,8 +107,9 @@ public VoxelShape getShape( case X: yield AABB_X; case Z: - default: yield AABB_Z; + case Y: + yield AABB_Y; }; } diff --git a/src/main/java/dev/dubhe/anvilcraft/block/entity/BaseLaserBlockEntity.java b/src/main/java/dev/dubhe/anvilcraft/block/entity/BaseLaserBlockEntity.java index 790b752e1..564c8439a 100644 --- a/src/main/java/dev/dubhe/anvilcraft/block/entity/BaseLaserBlockEntity.java +++ b/src/main/java/dev/dubhe/anvilcraft/block/entity/BaseLaserBlockEntity.java @@ -157,17 +157,17 @@ public void emitLaser(Direction direction) { if (!(level instanceof ServerLevel serverLevel)) return; updateLaserLevel(calculateLaserLevel()); - AABB trackBoundingBox = new AABB( - getBlockPos() - .relative(direction) - .getCenter() - .add(-0.0625, -0.0625, -0.0625), - irradiateBlockPos.relative(direction.getOpposite()) - .getCenter() - .add(0.0625, 0.0625, 0.0625) - ); int hurt = Math.min(16, laserLevel - 4); if (hurt > 0) { + AABB trackBoundingBox = new AABB( + getBlockPos() + .relative(direction) + .getCenter() + .add(-0.0625, -0.0625, -0.0625), + irradiateBlockPos.relative(direction.getOpposite()) + .getCenter() + .add(0.0625, 0.0625, 0.0625) + ); level.getEntities( EntityTypeTest.forClass(LivingEntity.class), trackBoundingBox, @@ -180,16 +180,16 @@ public void emitLaser(Direction direction) { ); } BlockState irradiateBlock = level.getBlockState(irradiateBlockPos); - List drops = Block.getDrops( - irradiateBlock, - serverLevel, - irradiateBlockPos, - level.getBlockEntity(irradiateBlockPos) - ); int cooldown = COOLDOWNS[Math.clamp(laserLevel / 4, 0, 4)]; if (tickCount >= cooldown) { tickCount = 0; if (irradiateBlock.is(Tags.Blocks.ORES)) { + List drops = Block.getDrops( + irradiateBlock, + serverLevel, + irradiateBlockPos, + level.getBlockEntity(irradiateBlockPos) + ); Vec3 blockPos = getBlockPos().relative(direction.getOpposite()).getCenter(); IItemHandler cap = getLevel() .getCapability( @@ -216,16 +216,12 @@ public void emitLaser(Direction direction) { }); if (irradiateBlock.is(Blocks.ANCIENT_DEBRIS)) { level.setBlockAndUpdate(irradiateBlockPos, Blocks.NETHERRACK.defaultBlockState()); + } else if (irradiateBlock.is(Tags.Blocks.ORES_IN_GROUND_DEEPSLATE)) { + level.setBlockAndUpdate(irradiateBlockPos, Blocks.DEEPSLATE.defaultBlockState()); + } else if (irradiateBlock.is(Tags.Blocks.ORES_IN_GROUND_NETHERRACK)) { + level.setBlockAndUpdate(irradiateBlockPos, Blocks.NETHERRACK.defaultBlockState()); } else { - if (irradiateBlock.is(Tags.Blocks.ORES_IN_GROUND_DEEPSLATE)) - level.setBlockAndUpdate(irradiateBlockPos, Blocks.DEEPSLATE.defaultBlockState()); - else { - if (irradiateBlock.is(Tags.Blocks.ORES_IN_GROUND_NETHERRACK)) { - level.setBlockAndUpdate(irradiateBlockPos, Blocks.NETHERRACK.defaultBlockState()); - } else { - level.setBlockAndUpdate(irradiateBlockPos, Blocks.STONE.defaultBlockState()); - } - } + level.setBlockAndUpdate(irradiateBlockPos, Blocks.STONE.defaultBlockState()); } /* else { if (level.getBlockState(irradiateBlockPos).getBlock().defaultDestroyTime() >= 0 diff --git a/src/main/java/dev/dubhe/anvilcraft/block/entity/TeslaTowerBlockEntity.java b/src/main/java/dev/dubhe/anvilcraft/block/entity/TeslaTowerBlockEntity.java index 21e1ae34e..14a606c9b 100644 --- a/src/main/java/dev/dubhe/anvilcraft/block/entity/TeslaTowerBlockEntity.java +++ b/src/main/java/dev/dubhe/anvilcraft/block/entity/TeslaTowerBlockEntity.java @@ -98,7 +98,7 @@ public static TeslaTowerBlockEntity createBlockEntity(BlockEntityType type, B if (!this.getBlockState().is(ModBlocks.TESLA_TOWER.get())) return PowerComponentType.INVALID; if (this.getBlockState().getValue(TeslaTowerBlock.HALF) != Vertical4PartHalf.BOTTOM) return PowerComponentType.INVALID; - return PowerComponentType.TRANSMITTER; + return PowerComponentType.CONSUMER; } @Override diff --git a/src/main/java/dev/dubhe/anvilcraft/data/recipe/BlockCompressRecipeLoader.java b/src/main/java/dev/dubhe/anvilcraft/data/recipe/BlockCompressRecipeLoader.java index e2062f42f..991f0bd7f 100644 --- a/src/main/java/dev/dubhe/anvilcraft/data/recipe/BlockCompressRecipeLoader.java +++ b/src/main/java/dev/dubhe/anvilcraft/data/recipe/BlockCompressRecipeLoader.java @@ -44,6 +44,11 @@ public static void init(RegistrateRecipeProvider provider) { .input(Blocks.DIRT) .result(Blocks.MYCELIUM) .save(provider); + BlockCompressRecipe.builder() + .input(ModBlocks.VOID_MATTER_BLOCK.get()) + .input(ModBlocks.SUPERCRITICAL_NESTING_SHULKER_BOX.get()) + .result(ModBlocks.SPACE_OVERCOMPRESSOR.get()) + .save(provider); } private static void blockCompress(RegistrateRecipeProvider provider, Block block1, Block block2, Block result) { diff --git a/src/main/java/dev/dubhe/anvilcraft/init/ModBlocks.java b/src/main/java/dev/dubhe/anvilcraft/init/ModBlocks.java index 68aabc0cd..e73567165 100644 --- a/src/main/java/dev/dubhe/anvilcraft/init/ModBlocks.java +++ b/src/main/java/dev/dubhe/anvilcraft/init/ModBlocks.java @@ -1335,7 +1335,9 @@ public class ModBlocks { .modelFile(DangerUtil.genModModelFile("block/sliding_rail").get()) .rotationY(90) .buildLast()}; - case Z, Y -> DangerUtil.genConfiguredModel("block/sliding_rail") + case Z -> DangerUtil.genConfiguredModel("block/sliding_rail") + .get(); + case Y -> DangerUtil.genConfiguredModel("block/sliding_rail_cross") .get(); }); })