From 2795134604c7f5adbdaf78a4f4377cae414cb3cf Mon Sep 17 00:00:00 2001 From: craisinlord Date: Fri, 24 Jul 2026 02:35:28 -0500 Subject: [PATCH] finished bluestone, antimetal rails, nyxite button and pressure plate, various other tweaks and fixes --- .../block/AbstractAntimetalRailBlock.java | 87 +++++ .../block/AbstractCeilingBluestoneBlock.java | 2 +- .../block/AbstractCeilingDiodeBlock.java | 2 +- .../block/AntimetalActivatorRailBlock.java | 65 ++++ .../block/AntimetalDetectorRailBlock.java | 110 ++++++ .../content/block/AntimetalPowerHelper.java | 80 +++++ .../block/AntimetalPoweredRailBlock.java | 118 ++++++ .../content/block/AntimetalRailBlock.java | 34 ++ .../block/BluestoneComparatorBlock.java | 129 ++++++- .../content/block/BluestoneRepeaterBlock.java | 48 +++ .../content/block/BluestoneSignalHelper.java | 30 ++ .../content/block/BluestoneTorchBlock.java | 125 ++++++- .../content/block/BluestoneWireBlock.java | 179 +++++++-- .../content/block/CorneaStalkBlock.java | 3 + .../content/block/CreepvineBlock.java | 73 ++++ .../content/block/HangingCreeprootsBlock.java | 34 +- .../content/block/MoltingVinesBlock.java | 33 +- .../content/block/PeachLeavesBlock.java | 116 +++++- .../PolishedNyxitePressurePlateBlock.java | 68 ++++ .../content/creative/CreativeTabContents.java | 18 +- .../content/effect/StinkyBehavior.java | 9 +- .../content/entity/lucid/LucidBoltEntity.java | 30 +- .../content/fluid/AntarchyFluidChecks.java | 30 ++ .../content/horde/CavarynHordeManager.java | 13 +- .../content/item/BluestoneDustItem.java | 2 +- ...ngCompatiblePlacementTooltipBlockItem.java | 22 ++ .../CeilingPlacementTooltipBlockItem.java | 2 +- .../item/CeilingPlacementTooltipItem.java | 2 +- .../minecart/AntimetalDismountHelper.java | 66 ++++ .../minecart/AntimetalMinecartAccess.java | 15 + .../minecart/AntimetalMinecartPhysics.java | 339 ++++++++++++++++++ .../content/minecart/AntimetalRailHelper.java | 122 +++++++ .../cavaryn/CavarynBileCystFeature.java | 17 +- .../cavaryn/CavarynBileVeinFeature.java | 19 +- .../cavaryn/CavarynCreepvineFeature.java | 7 + .../worldgen/cavaryn/CavarynFoliageGuard.java | 38 ++ .../cavaryn/GroundMoltingVinesFeature.java | 7 + .../cavaryn/HangingCreeprootsFeature.java | 7 + .../worldgen/cavaryn/MoltingVinesFeature.java | 7 + .../worldgen/elythia/PeachTreeFeature.java | 8 +- .../mixins/AbstractMinecartMixin.java | 153 ++++++++ .../antarchy/mixins/DiodeBlockMixin.java | 20 ++ .../antarchy/mixins/MinecartItemMixin.java | 58 +++ .../mixins/RedStoneWireBlockMixin.java | 75 +++- .../client/AbstractMinecartRendererMixin.java | 37 ++ .../mixins/client/EntityLightProbeMixin.java | 22 ++ .../resources/antarchy-common.mixins.json | 5 + .../blockstates/antimetal_activator_rail.json | 46 +++ .../blockstates/antimetal_detector_rail.json | 46 +++ .../blockstates/antimetal_powered_rail.json | 46 +++ .../antarchy/blockstates/antimetal_rail.json | 40 +++ .../blockstates/bluestone_repeater.json | 305 ++++++++++++++++ .../antarchy/blockstates/bluestone_torch.json | 78 +++- .../antarchy/blockstates/bluestone_wire.json | 94 ++++- .../blockstates/polished_nyxite_button.json | 118 ++++++ .../polished_nyxite_pressure_plate.json | 18 + .../assets/antarchy/items/bluestone_wire.json | 6 + .../resources/assets/antarchy/lang/en_us.json | 12 + .../block/antimetal_activator_rail.json | 4 + .../block/antimetal_activator_rail_on.json | 4 + .../antimetal_activator_rail_raised_ne.json | 4 + ...antimetal_activator_rail_raised_on_ne.json | 4 + ...antimetal_activator_rail_raised_on_sw.json | 4 + .../antimetal_activator_rail_raised_sw.json | 4 + .../models/block/antimetal_detector_rail.json | 4 + .../block/antimetal_detector_rail_on.json | 4 + .../antimetal_detector_rail_raised_ne.json | 4 + .../antimetal_detector_rail_raised_on_ne.json | 4 + .../antimetal_detector_rail_raised_on_sw.json | 4 + .../antimetal_detector_rail_raised_sw.json | 4 + .../models/block/antimetal_powered_rail.json | 4 + .../block/antimetal_powered_rail_on.json | 4 + .../antimetal_powered_rail_raised_ne.json | 4 + .../antimetal_powered_rail_raised_on_ne.json | 4 + .../antimetal_powered_rail_raised_on_sw.json | 4 + .../antimetal_powered_rail_raised_sw.json | 4 + .../antarchy/models/block/antimetal_rail.json | 4 + .../models/block/antimetal_rail_corner.json | 4 + .../block/antimetal_rail_raised_ne.json | 4 + .../block/antimetal_rail_raised_sw.json | 4 + .../models/block/bluestone_comparator.json | 36 +- .../models/block/bluestone_comparator_on.json | 36 +- .../block/bluestone_comparator_subtract.json | 57 ++- .../bluestone_comparator_subtract_on.json | 59 ++- .../models/block/bluestone_repeater.json | 20 +- .../block/bluestone_repeater_delay2.json | 46 +++ .../block/bluestone_repeater_delay2_on.json | 48 +++ .../block/bluestone_repeater_delay3.json | 46 +++ .../block/bluestone_repeater_delay3_on.json | 48 +++ .../block/bluestone_repeater_delay4.json | 46 +++ .../block/bluestone_repeater_delay4_on.json | 48 +++ .../models/block/bluestone_repeater_lock.json | 19 + .../models/block/bluestone_repeater_on.json | 20 +- .../models/block/bluestone_torch.json | 8 +- .../models/block/bluestone_torch_off.json | 8 +- .../models/block/bluestone_wall_torch.json | 39 ++ .../block/bluestone_wall_torch_off.json | 39 ++ .../models/block/bluestone_wire_dot.json | 2 +- .../models/block/bluestone_wire_down.json | 8 + .../models/block/bluestone_wire_line0.json | 19 +- .../models/block/bluestone_wire_line1.json | 19 +- .../models/block/bluestone_wire_side0.json | 6 + .../models/block/bluestone_wire_side1.json | 6 + .../block/bluestone_wire_side_alt0.json | 6 + .../block/bluestone_wire_side_alt1.json | 6 + .../models/block/polished_nyxite_button.json | 6 + .../polished_nyxite_button_inventory.json | 6 + .../block/polished_nyxite_button_pressed.json | 6 + .../block/polished_nyxite_pressure_plate.json | 6 + .../polished_nyxite_pressure_plate_down.json | 6 + .../block/template_antimetal_rail_flat.json | 14 + .../template_antimetal_rail_raised_ne.json | 20 ++ .../template_antimetal_rail_raised_sw.json | 20 ++ .../models/item/antimetal_activator_rail.json | 6 + .../models/item/antimetal_detector_rail.json | 6 + .../models/item/antimetal_powered_rail.json | 6 + .../antarchy/models/item/antimetal_rail.json | 6 + .../antarchy/models/item/bluestone.json | 6 + .../antarchy/models/item/bluestone_dust.json | 2 +- .../antarchy/models/item/bluestone_wire.json | 6 + .../models/item/polished_nyxite_button.json | 3 + .../item/polished_nyxite_pressure_plate.json | 3 + .../block/bluestone/bluestone_torch.png | Bin 256 -> 257 bytes .../antarchy/textures/item/bluestone.png | Bin 0 -> 375 bytes .../trims/color_palettes/bluestone.png | Bin 0 -> 120 bytes .../assets/minecraft/atlases/armor_trims.json | 1 + .../blocks/antimetal_activator_rail.json | 15 + .../blocks/antimetal_detector_rail.json | 15 + .../blocks/antimetal_powered_rail.json | 15 + .../loot_table/blocks/antimetal_rail.json | 15 + .../blocks/polished_nyxite_button.json | 21 ++ .../polished_nyxite_pressure_plate.json | 21 ++ .../recipe/antimetal_activator_rail.json | 18 + .../recipe/antimetal_detector_rail.json | 18 + .../recipe/antimetal_powered_rail.json | 18 + .../data/antarchy/recipe/antimetal_rail.json | 17 + .../data/antarchy/recipe/bluestone_block.json | 2 +- .../antarchy/recipe/bluestone_comparator.json | 6 +- ...bluestone_from_blasting_bluestone_ore.json | 2 +- ...bluestone_from_smelting_bluestone_ore.json | 2 +- .../antarchy/recipe/bluestone_repeater.json | 6 +- .../data/antarchy/recipe/bluestone_torch.json | 4 +- .../recipe/crafter_from_bluestone.json | 27 ++ .../recipe/dispenser_from_bluestone.json | 24 ++ .../recipe/dropper_from_bluestone.json | 21 ++ .../recipe/observer_from_bluestone.json | 24 ++ .../recipe/piston_from_bluestone.json | 27 ++ .../recipe/polished_nyxite_button.json | 14 + .../polished_nyxite_pressure_plate.json | 17 + .../recipe/target_from_bluestone.json | 21 ++ .../antarchy/trim_material/bluestone.json | 9 + .../worldgen/biome/biowart_caves.json | 6 + .../worldgen/biome/brooding_tunnels.json | 8 +- .../data/antarchy/worldgen/biome/cavaryn.json | 6 + .../antarchy/worldgen/biome/dream_dunes.json | 3 + .../worldgen/biome/glowcap_caves.json | 6 + .../antarchy/worldgen/biome/lucid_pools.json | 5 +- .../worldgen/biome/nightmare_wastes.json | 4 +- .../antarchy/worldgen/biome/rolly_caves.json | 6 + .../antarchy/worldgen/biome/umbral_hills.json | 4 +- .../configured_feature/bluestone_ore.json | 18 + .../placed_feature/bluestone_ore.json | 27 ++ .../placed_feature/brown_ant_nest.json | 2 +- .../placed_feature/rainbow_ant_nest.json | 2 +- .../tags/block/mineable/pickaxe.json | 4 +- .../minecraft/tags/block/stone_buttons.json | 5 + .../tags/block/stone_pressure_plates.json | 5 + .../minecraft/tags/item/stone_buttons.json | 5 + .../minecraft/tags/item/trim_materials.json | 3 +- fabric/build.gradle | 5 +- .../client/AntarchyFabricClientBootstrap.java | 9 +- .../fabric/registry/AntarchyFabricBlocks.java | 25 +- .../AntarchyFabricCreativeModeTabs.java | 16 +- .../fabric/registry/AntarchyFabricItems.java | 13 + gradle.properties | 2 +- neoforge/build.gradle | 1 + .../client/AntarchyNeoForgeClient.java | 9 +- .../registry/AntarchyNeoforgeBlocks.java | 16 +- .../AntarchyNeoforgeCreativeModeTabs.java | 1 - .../registry/AntarchyNeoforgeItems.java | 11 + 180 files changed, 4570 insertions(+), 243 deletions(-) create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/block/AbstractAntimetalRailBlock.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalActivatorRailBlock.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalDetectorRailBlock.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalPowerHelper.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalPoweredRailBlock.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalRailBlock.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/block/CreepvineBlock.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/block/PolishedNyxitePressurePlateBlock.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/item/CeilingCompatiblePlacementTooltipBlockItem.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalDismountHelper.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalMinecartAccess.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalMinecartPhysics.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalRailHelper.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/worldgen/cavaryn/CavarynFoliageGuard.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/mixins/AbstractMinecartMixin.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/mixins/DiodeBlockMixin.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/mixins/MinecartItemMixin.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/mixins/client/AbstractMinecartRendererMixin.java create mode 100644 common/src/main/java/com/craisinlord/antarchy/mixins/client/EntityLightProbeMixin.java create mode 100644 common/src/main/resources/assets/antarchy/blockstates/antimetal_activator_rail.json create mode 100644 common/src/main/resources/assets/antarchy/blockstates/antimetal_detector_rail.json create mode 100644 common/src/main/resources/assets/antarchy/blockstates/antimetal_powered_rail.json create mode 100644 common/src/main/resources/assets/antarchy/blockstates/antimetal_rail.json create mode 100644 common/src/main/resources/assets/antarchy/blockstates/polished_nyxite_button.json create mode 100644 common/src/main/resources/assets/antarchy/blockstates/polished_nyxite_pressure_plate.json create mode 100644 common/src/main/resources/assets/antarchy/items/bluestone_wire.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_on.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_ne.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_on_ne.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_on_sw.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_sw.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_on.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_ne.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_on_ne.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_on_sw.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_sw.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_on.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_ne.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_on_ne.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_on_sw.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_sw.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_rail.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_rail_corner.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_rail_raised_ne.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/antimetal_rail_raised_sw.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay2.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay2_on.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay3.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay3_on.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay4.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay4_on.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_lock.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_wall_torch.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_wall_torch_off.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_wire_down.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side0.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side1.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side_alt0.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side_alt1.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button_inventory.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button_pressed.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/polished_nyxite_pressure_plate.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/polished_nyxite_pressure_plate_down.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_flat.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_raised_ne.json create mode 100644 common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_raised_sw.json create mode 100644 common/src/main/resources/assets/antarchy/models/item/antimetal_activator_rail.json create mode 100644 common/src/main/resources/assets/antarchy/models/item/antimetal_detector_rail.json create mode 100644 common/src/main/resources/assets/antarchy/models/item/antimetal_powered_rail.json create mode 100644 common/src/main/resources/assets/antarchy/models/item/antimetal_rail.json create mode 100644 common/src/main/resources/assets/antarchy/models/item/bluestone.json create mode 100644 common/src/main/resources/assets/antarchy/models/item/bluestone_wire.json create mode 100644 common/src/main/resources/assets/antarchy/models/item/polished_nyxite_button.json create mode 100644 common/src/main/resources/assets/antarchy/models/item/polished_nyxite_pressure_plate.json create mode 100644 common/src/main/resources/assets/antarchy/textures/item/bluestone.png create mode 100644 common/src/main/resources/assets/antarchy/textures/trims/color_palettes/bluestone.png create mode 100644 common/src/main/resources/data/antarchy/loot_table/blocks/antimetal_activator_rail.json create mode 100644 common/src/main/resources/data/antarchy/loot_table/blocks/antimetal_detector_rail.json create mode 100644 common/src/main/resources/data/antarchy/loot_table/blocks/antimetal_powered_rail.json create mode 100644 common/src/main/resources/data/antarchy/loot_table/blocks/antimetal_rail.json create mode 100644 common/src/main/resources/data/antarchy/loot_table/blocks/polished_nyxite_button.json create mode 100644 common/src/main/resources/data/antarchy/loot_table/blocks/polished_nyxite_pressure_plate.json create mode 100644 common/src/main/resources/data/antarchy/recipe/antimetal_activator_rail.json create mode 100644 common/src/main/resources/data/antarchy/recipe/antimetal_detector_rail.json create mode 100644 common/src/main/resources/data/antarchy/recipe/antimetal_powered_rail.json create mode 100644 common/src/main/resources/data/antarchy/recipe/antimetal_rail.json create mode 100644 common/src/main/resources/data/antarchy/recipe/crafter_from_bluestone.json create mode 100644 common/src/main/resources/data/antarchy/recipe/dispenser_from_bluestone.json create mode 100644 common/src/main/resources/data/antarchy/recipe/dropper_from_bluestone.json create mode 100644 common/src/main/resources/data/antarchy/recipe/observer_from_bluestone.json create mode 100644 common/src/main/resources/data/antarchy/recipe/piston_from_bluestone.json create mode 100644 common/src/main/resources/data/antarchy/recipe/polished_nyxite_button.json create mode 100644 common/src/main/resources/data/antarchy/recipe/polished_nyxite_pressure_plate.json create mode 100644 common/src/main/resources/data/antarchy/recipe/target_from_bluestone.json create mode 100644 common/src/main/resources/data/antarchy/trim_material/bluestone.json create mode 100644 common/src/main/resources/data/antarchy/worldgen/configured_feature/bluestone_ore.json create mode 100644 common/src/main/resources/data/antarchy/worldgen/placed_feature/bluestone_ore.json create mode 100644 common/src/main/resources/data/minecraft/tags/block/stone_buttons.json create mode 100644 common/src/main/resources/data/minecraft/tags/block/stone_pressure_plates.json create mode 100644 common/src/main/resources/data/minecraft/tags/item/stone_buttons.json diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractAntimetalRailBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractAntimetalRailBlock.java new file mode 100644 index 00000000..6ee4a58e --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractAntimetalRailBlock.java @@ -0,0 +1,87 @@ +package com.craisinlord.antarchy.content.block; + +import com.craisinlord.antarchy.content.minecart.AntimetalRailHelper; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.BaseRailBlock; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.RailShape; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; + +public abstract class AbstractAntimetalRailBlock extends BaseRailBlock { + protected static final VoxelShape CEILING_FLAT_SHAPE = Block.box(0.0D, 14.0D, 0.0D, 16.0D, 16.0D, 16.0D); + protected static final VoxelShape CEILING_SLOPE_SHAPE = Block.box(0.0D, 6.0D, 0.0D, 16.0D, 16.0D, 16.0D); + + protected AbstractAntimetalRailBlock(boolean isStraight, BlockBehaviour.Properties properties) { + super(isStraight, properties); + } + + public static boolean isAntimetalRail(BlockState state) { + return state.getBlock() instanceof AbstractAntimetalRailBlock; + } + + public static boolean hasCeilingSupport(LevelReader level, BlockPos pos) { + return Block.canSupportCenter(level, pos.above(), Direction.DOWN); + } + + @Override + protected VoxelShape getShape(BlockState state, net.minecraft.world.level.BlockGetter level, BlockPos pos, CollisionContext context) { + RailShape shape = state.getValue(getShapeProperty()); + return shape.isAscending() ? CEILING_SLOPE_SHAPE : CEILING_FLAT_SHAPE; + } + + @Override + protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) { + return hasCeilingSupport(level, pos); + } + + @Override + public BlockState getStateForPlacement(BlockPlaceContext context) { + if (context.getClickedFace() != Direction.DOWN && context.getClickedFace() != Direction.UP && !context.replacingClickedOnBlock()) { + return null; + } + if (!hasCeilingSupport(context.getLevel(), context.getClickedPos())) { + return null; + } + return AntimetalRailHelper.getStateForPlacement(this, context); + } + + @Override + protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor level, BlockPos pos, BlockPos neighborPos) { + if (!state.canSurvive(level, pos)) { + return Blocks.AIR.defaultBlockState(); + } + if (direction != Direction.DOWN && direction != Direction.UP) { + AntimetalRailHelper.updateConnections(this, state, level, pos); + } + return state; + } + + @Override + protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) { + if (!oldState.is(state.getBlock())) { + AntimetalRailHelper.updateConnections(this, state, level, pos); + } + } + + @Override + protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, BlockPos neighborPos, boolean movedByPiston) { + if (level.isClientSide()) { + return; + } + if (!state.canSurvive(level, pos)) { + dropResources(state, level, pos); + level.removeBlock(pos, movedByPiston); + return; + } + AntimetalRailHelper.updateConnections(this, state, level, pos); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractCeilingBluestoneBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractCeilingBluestoneBlock.java index f09752c6..874c0301 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractCeilingBluestoneBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractCeilingBluestoneBlock.java @@ -26,7 +26,7 @@ public abstract class AbstractCeilingBluestoneBlock extends Block { @Override protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor level, BlockPos pos, BlockPos neighborPos) { - if (!state.canSurvive(level, pos)) { + if (direction == Direction.UP && !state.canSurvive(level, pos)) { return net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(); } return super.updateShape(state, direction, neighborState, level, pos, neighborPos); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractCeilingDiodeBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractCeilingDiodeBlock.java index 5e3c3d53..9ca1dbab 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractCeilingDiodeBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/AbstractCeilingDiodeBlock.java @@ -26,7 +26,7 @@ public abstract class AbstractCeilingDiodeBlock extends DiodeBlock { @Override protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor level, BlockPos pos, BlockPos neighborPos) { - if (!state.canSurvive(level, pos)) { + if (direction == Direction.UP && !state.canSurvive(level, pos)) { return net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(); } return super.updateShape(state, direction, neighborState, level, pos, neighborPos); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalActivatorRailBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalActivatorRailBlock.java new file mode 100644 index 00000000..a1e870dc --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalActivatorRailBlock.java @@ -0,0 +1,65 @@ +package com.craisinlord.antarchy.content.block; + +import com.mojang.serialization.MapCodec; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.Property; +import net.minecraft.world.level.block.state.properties.RailShape; + +public class AntimetalActivatorRailBlock extends AbstractAntimetalRailBlock { + public static final MapCodec CODEC = simpleCodec(AntimetalActivatorRailBlock::new); + public static final EnumProperty SHAPE = BlockStateProperties.RAIL_SHAPE_STRAIGHT; + public static final BooleanProperty POWERED = BlockStateProperties.POWERED; + + public AntimetalActivatorRailBlock(BlockBehaviour.Properties properties) { + super(true, properties); + this.registerDefaultState(this.stateDefinition.any().setValue(SHAPE, RailShape.NORTH_SOUTH).setValue(POWERED, false).setValue(WATERLOGGED, false)); + } + + @Override + protected MapCodec codec() { + return CODEC; + } + + @Override + public Property getShapeProperty() { + return SHAPE; + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(SHAPE, POWERED, WATERLOGGED); + } + + @Override + protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, BlockPos neighborPos, boolean movedByPiston) { + super.neighborChanged(state, level, pos, neighborBlock, neighborPos, movedByPiston); + updatePoweredState(level, pos, level.getBlockState(pos)); + } + + @Override + protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) { + super.onPlace(state, level, pos, oldState, movedByPiston); + if (!oldState.is(state.getBlock())) { + updatePoweredState(level, pos, level.getBlockState(pos)); + } + } + + private void updatePoweredState(Level level, BlockPos pos, BlockState state) { + if (level.isClientSide() || !(state.getBlock() instanceof AntimetalActivatorRailBlock)) { + return; + } + boolean powered = AntimetalPowerHelper.isPoweredWithChain(level, pos, state, SHAPE, AntimetalActivatorRailBlock.class); + if (state.getValue(POWERED) != powered) { + level.setBlock(pos, state.setValue(POWERED, powered), 3); + AntimetalPowerHelper.notifyAllSignalNeighbors(level, pos); + } + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalDetectorRailBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalDetectorRailBlock.java new file mode 100644 index 00000000..6f26cc55 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalDetectorRailBlock.java @@ -0,0 +1,110 @@ +package com.craisinlord.antarchy.content.block; + +import com.craisinlord.antarchy.content.minecart.AntimetalMinecartAccess; +import com.mojang.serialization.MapCodec; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.RandomSource; +import net.minecraft.world.Container; +import net.minecraft.world.entity.vehicle.AbstractMinecart; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.Property; +import net.minecraft.world.level.block.state.properties.RailShape; +import net.minecraft.world.phys.AABB; + +import java.util.List; + +public class AntimetalDetectorRailBlock extends AbstractAntimetalRailBlock { + public static final MapCodec CODEC = simpleCodec(AntimetalDetectorRailBlock::new); + public static final EnumProperty SHAPE = BlockStateProperties.RAIL_SHAPE_STRAIGHT; + public static final BooleanProperty POWERED = BlockStateProperties.POWERED; + private static final int CHECK_PERIOD = 20; + + public AntimetalDetectorRailBlock(BlockBehaviour.Properties properties) { + super(true, properties); + this.registerDefaultState(this.stateDefinition.any().setValue(SHAPE, RailShape.NORTH_SOUTH).setValue(POWERED, false).setValue(WATERLOGGED, false)); + } + + @Override + protected MapCodec codec() { + return CODEC; + } + + @Override + public Property getShapeProperty() { + return SHAPE; + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(SHAPE, POWERED, WATERLOGGED); + } + + @Override + protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) { + super.onPlace(state, level, pos, oldState, movedByPiston); + if (!oldState.is(state.getBlock()) && !level.isClientSide()) { + level.scheduleTick(pos, this, CHECK_PERIOD); + } + } + + @Override + protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + boolean detected = !getDetectedCarts(level, pos).isEmpty(); + if (detected != state.getValue(POWERED)) { + level.setBlock(pos, state.setValue(POWERED, detected), 3); + AntimetalPowerHelper.notifyAllSignalNeighbors(level, pos); + } + level.scheduleTick(pos, this, CHECK_PERIOD); + } + + private static List getDetectedCarts(Level level, BlockPos pos) { + AABB box = new AABB(pos.getX(), pos.getY() - 2.0D, pos.getZ(), pos.getX() + 1.0D, pos.getY() + 1.0D, pos.getZ() + 1.0D); + return level.getEntitiesOfClass(AbstractMinecart.class, box, cart -> + cart instanceof AntimetalMinecartAccess access && pos.equals(access.antarchy$getAntimetalRailPos())); + } + + @Override + protected boolean isSignalSource(BlockState state) { + return true; + } + + @Override + protected int getSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return state.getValue(POWERED) ? 15 : 0; + } + + @Override + protected int getDirectSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return state.getValue(POWERED) ? 15 : 0; + } + + @Override + protected boolean hasAnalogOutputSignal(BlockState state) { + return true; + } + + @Override + protected int getAnalogOutputSignal(BlockState state, Level level, BlockPos pos) { + if (!state.getValue(POWERED)) { + return 0; + } + int best = 0; + for (AbstractMinecart cart : getDetectedCarts(level, pos)) { + if (cart instanceof Container container) { + best = Math.max(best, AbstractContainerMenu.getRedstoneSignalFromContainer(container)); + } + } + return best; + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalPowerHelper.java b/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalPowerHelper.java new file mode 100644 index 00000000..bf32e62f --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalPowerHelper.java @@ -0,0 +1,80 @@ +package com.craisinlord.antarchy.content.block; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.RailShape; + +public final class AntimetalPowerHelper { + private static final int MAX_POWER_PROPAGATION = 8; + + private AntimetalPowerHelper() { + } + + public static boolean hasAnySignal(LevelReader level, BlockPos pos) { + if (level instanceof Level realLevel && realLevel.hasNeighborSignal(pos)) { + return true; + } + return BluestoneSignalHelper.getBestNeighborSignal(level, pos) > 0; + } + + public static int getBestAnySignal(LevelReader level, BlockPos pos) { + int vanillaSignal = level instanceof Level realLevel ? realLevel.getBestNeighborSignal(pos) : 0; + int bluestoneSignal = BluestoneSignalHelper.getBestNeighborSignal(level, pos); + return Math.max(vanillaSignal, bluestoneSignal); + } + + public static void notifyAllSignalNeighbors(Level level, BlockPos pos) { + level.updateNeighborsAt(pos, level.getBlockState(pos).getBlock()); + BluestoneSignalHelper.updateBluestoneNeighbors(level, pos); + } + + public static boolean isPoweredWithChain(Level level, BlockPos pos, BlockState state, EnumProperty shapeProperty, Class railClass) { + if (!railClass.isInstance(state.getBlock())) { + return false; + } + if (hasAnySignal(level, pos)) { + return true; + } + RailShape shape = state.getValue(shapeProperty); + for (Direction direction : exitDirections(shape)) { + if (chain(level, pos, direction, shapeProperty, railClass, 1)) { + return true; + } + } + return false; + } + + private static boolean chain(Level level, BlockPos pos, Direction direction, EnumProperty shapeProperty, Class railClass, int distance) { + if (distance > MAX_POWER_PROPAGATION) { + return false; + } + BlockPos[] candidates = {pos.relative(direction), pos.relative(direction).above(), pos.relative(direction).below()}; + for (BlockPos candidate : candidates) { + BlockState candidateState = level.getBlockState(candidate); + if (railClass.isInstance(candidateState.getBlock()) && sameAxis(candidateState.getValue(shapeProperty), direction)) { + if (hasAnySignal(level, candidate)) { + return true; + } + if (chain(level, candidate, direction, shapeProperty, railClass, distance + 1)) { + return true; + } + } + } + return false; + } + + private static boolean sameAxis(RailShape shape, Direction direction) { + boolean zAxis = shape == RailShape.NORTH_SOUTH || shape == RailShape.ASCENDING_NORTH || shape == RailShape.ASCENDING_SOUTH; + return direction.getAxis() == (zAxis ? Direction.Axis.Z : Direction.Axis.X); + } + + private static Direction[] exitDirections(RailShape shape) { + boolean zAxis = shape == RailShape.NORTH_SOUTH || shape == RailShape.ASCENDING_NORTH || shape == RailShape.ASCENDING_SOUTH; + return zAxis ? new Direction[]{Direction.NORTH, Direction.SOUTH} : new Direction[]{Direction.EAST, Direction.WEST}; + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalPoweredRailBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalPoweredRailBlock.java new file mode 100644 index 00000000..cbcae0dc --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalPoweredRailBlock.java @@ -0,0 +1,118 @@ +package com.craisinlord.antarchy.content.block; + +import com.mojang.serialization.MapCodec; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.Property; +import net.minecraft.world.level.block.state.properties.RailShape; + +public class AntimetalPoweredRailBlock extends AbstractAntimetalRailBlock { + public static final MapCodec CODEC = simpleCodec(AntimetalPoweredRailBlock::new); + public static final EnumProperty SHAPE = BlockStateProperties.RAIL_SHAPE_STRAIGHT; + public static final BooleanProperty POWERED = BlockStateProperties.POWERED; + + public AntimetalPoweredRailBlock(BlockBehaviour.Properties properties) { + super(true, properties); + this.registerDefaultState(this.stateDefinition.any().setValue(SHAPE, RailShape.NORTH_SOUTH).setValue(POWERED, false).setValue(WATERLOGGED, false)); + } + + @Override + protected MapCodec codec() { + return CODEC; + } + + @Override + public Property getShapeProperty() { + return SHAPE; + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(SHAPE, POWERED, WATERLOGGED); + } + + @Override + protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, BlockPos neighborPos, boolean movedByPiston) { + super.neighborChanged(state, level, pos, neighborBlock, neighborPos, movedByPiston); + updatePoweredState(level, pos, level.getBlockState(pos)); + } + + @Override + protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) { + super.onPlace(state, level, pos, oldState, movedByPiston); + if (!oldState.is(state.getBlock())) { + updatePoweredState(level, pos, level.getBlockState(pos)); + } + } + + private void updatePoweredState(Level level, BlockPos pos, BlockState state) { + if (level.isClientSide() || !(state.getBlock() instanceof AntimetalPoweredRailBlock)) { + return; + } + boolean powered = AntimetalPowerHelper.isPoweredWithChain(level, pos, state, SHAPE, AntimetalPoweredRailBlock.class); + if (state.getValue(POWERED) != powered) { + level.setBlock(pos, state.setValue(POWERED, powered), 3); + AntimetalPowerHelper.notifyAllSignalNeighbors(level, pos.below()); + AntimetalPowerHelper.notifyAllSignalNeighbors(level, pos.above()); + } + } + + @Override + protected BlockState rotate(BlockState state, net.minecraft.world.level.block.Rotation rotation) { + return switch (rotation) { + case CLOCKWISE_180 -> switch (state.getValue(SHAPE)) { + case NORTH_SOUTH -> state.setValue(SHAPE, RailShape.NORTH_SOUTH); + case EAST_WEST -> state.setValue(SHAPE, RailShape.EAST_WEST); + case ASCENDING_EAST -> state.setValue(SHAPE, RailShape.ASCENDING_WEST); + case ASCENDING_WEST -> state.setValue(SHAPE, RailShape.ASCENDING_EAST); + case ASCENDING_NORTH -> state.setValue(SHAPE, RailShape.ASCENDING_SOUTH); + case ASCENDING_SOUTH -> state.setValue(SHAPE, RailShape.ASCENDING_NORTH); + default -> state; + }; + case CLOCKWISE_90 -> switch (state.getValue(SHAPE)) { + case NORTH_SOUTH -> state.setValue(SHAPE, RailShape.EAST_WEST); + case EAST_WEST -> state.setValue(SHAPE, RailShape.NORTH_SOUTH); + case ASCENDING_EAST -> state.setValue(SHAPE, RailShape.ASCENDING_NORTH); + case ASCENDING_WEST -> state.setValue(SHAPE, RailShape.ASCENDING_SOUTH); + case ASCENDING_NORTH -> state.setValue(SHAPE, RailShape.ASCENDING_WEST); + case ASCENDING_SOUTH -> state.setValue(SHAPE, RailShape.ASCENDING_EAST); + default -> state; + }; + case COUNTERCLOCKWISE_90 -> switch (state.getValue(SHAPE)) { + case NORTH_SOUTH -> state.setValue(SHAPE, RailShape.EAST_WEST); + case EAST_WEST -> state.setValue(SHAPE, RailShape.NORTH_SOUTH); + case ASCENDING_EAST -> state.setValue(SHAPE, RailShape.ASCENDING_SOUTH); + case ASCENDING_WEST -> state.setValue(SHAPE, RailShape.ASCENDING_NORTH); + case ASCENDING_NORTH -> state.setValue(SHAPE, RailShape.ASCENDING_EAST); + case ASCENDING_SOUTH -> state.setValue(SHAPE, RailShape.ASCENDING_WEST); + default -> state; + }; + default -> state; + }; + } + + @Override + protected BlockState mirror(BlockState state, net.minecraft.world.level.block.Mirror mirror) { + RailShape shape = state.getValue(SHAPE); + return switch (mirror) { + case LEFT_RIGHT -> switch (shape) { + case ASCENDING_NORTH -> state.setValue(SHAPE, RailShape.ASCENDING_SOUTH); + case ASCENDING_SOUTH -> state.setValue(SHAPE, RailShape.ASCENDING_NORTH); + default -> state; + }; + case FRONT_BACK -> switch (shape) { + case ASCENDING_EAST -> state.setValue(SHAPE, RailShape.ASCENDING_WEST); + case ASCENDING_WEST -> state.setValue(SHAPE, RailShape.ASCENDING_EAST); + default -> state; + }; + default -> state; + }; + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalRailBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalRailBlock.java new file mode 100644 index 00000000..5ae7d699 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/AntimetalRailBlock.java @@ -0,0 +1,34 @@ +package com.craisinlord.antarchy.content.block; + +import com.mojang.serialization.MapCodec; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.Property; +import net.minecraft.world.level.block.state.properties.RailShape; + +public class AntimetalRailBlock extends AbstractAntimetalRailBlock { + public static final MapCodec CODEC = simpleCodec(AntimetalRailBlock::new); + public static final EnumProperty SHAPE = BlockStateProperties.RAIL_SHAPE; + + public AntimetalRailBlock(BlockBehaviour.Properties properties) { + super(false, properties); + this.registerDefaultState(this.stateDefinition.any().setValue(SHAPE, RailShape.NORTH_SOUTH).setValue(WATERLOGGED, false)); + } + + @Override + protected MapCodec codec() { + return CODEC; + } + + @Override + public Property getShapeProperty() { + return SHAPE; + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(SHAPE, WATERLOGGED); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneComparatorBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneComparatorBlock.java index e7f81d41..5b65d6dc 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneComparatorBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneComparatorBlock.java @@ -6,19 +6,30 @@ import java.util.function.Supplier; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.DustParticleOptions; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.SignalGetter; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.ComparatorBlock; +import net.minecraft.world.level.block.DiodeBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.ComparatorMode; +import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.util.RandomSource; +import net.minecraft.world.ticks.TickPriority; import org.joml.Vector3f; public class BluestoneComparatorBlock extends ComparatorBlock { @@ -58,7 +69,7 @@ public class BluestoneComparatorBlock extends ComparatorBlock { @Override public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor level, BlockPos pos, BlockPos neighborPos) { - if (!state.canSurvive(level, pos)) { + if (direction == Direction.UP && !state.canSurvive(level, pos)) { return net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(); } return super.updateShape(state, direction, neighborState, level, pos, neighborPos); @@ -69,6 +80,122 @@ public class BluestoneComparatorBlock extends ComparatorBlock { return new BluestoneComparatorBlockEntity(pos, state, this.blockEntityTypeSupplier); } + @Override + protected int getOutputSignal(BlockGetter level, BlockPos pos, BlockState state) { + BlockEntity blockEntity = level.getBlockEntity(pos); + return blockEntity instanceof BluestoneComparatorBlockEntity comparator ? comparator.getOutputSignal() : 0; + } + + @Override + protected int getInputSignal(Level level, BlockPos pos, BlockState state) { + Direction facing = state.getValue(FACING); + BlockPos inputPos = pos.relative(facing); + BlockState inputState = level.getBlockState(inputPos); + int signal = BluestoneSignalHelper.getSignalExcludingRedstoneWire(level, inputPos, facing); + signal = Math.max(signal, this.getDirectBluestoneRearSignal(level, inputPos, inputState, facing)); + + if (signal < 15 && inputState.isRedstoneConductor(level, inputPos)) { + BlockPos fartherInputPos = inputPos.relative(facing); + BlockState fartherInputState = level.getBlockState(fartherInputPos); + signal = Math.max(signal, BluestoneSignalHelper.getSignalExcludingRedstoneWire(level, fartherInputPos, facing)); + signal = Math.max(signal, this.getDirectBluestoneRearSignal(level, fartherInputPos, fartherInputState, facing)); + } + + return signal; + } + + @Override + protected int getAlternateSignal(SignalGetter level, BlockPos pos, BlockState state) { + Direction facing = state.getValue(FACING); + Direction clockwise = facing.getClockWise(); + Direction counterClockwise = facing.getCounterClockWise(); + int signal = this.getBluestoneSideSignal(level, pos.relative(clockwise), clockwise.getOpposite()); + signal = Math.max(signal, this.getBluestoneSideSignal(level, pos.relative(counterClockwise), counterClockwise.getOpposite())); + return signal; + } + + private int getBluestoneSideSignal(SignalGetter level, BlockPos pos, Direction direction) { + BlockState neighborState = level.getBlockState(pos); + if (neighborState.getBlock() instanceof BluestoneSignalSource source) { + return source.getBluestoneSignal(level instanceof LevelReader levelReader ? levelReader : null, pos, neighborState, direction); + } + return 0; + } + + private int getDirectBluestoneRearSignal(LevelReader level, BlockPos pos, BlockState state, Direction direction) { + if (state.getBlock() instanceof BluestoneSignalSource source) { + return source.getBluestoneSignal(level, pos, state, direction); + } + return BluestoneSignalHelper.getDirectBluestoneSignal(level, pos, direction); + } + + @Override + protected boolean isSignalSource(BlockState state) { + return true; + } + + @Override + protected void checkTickOnNeighbor(Level level, BlockPos pos, BlockState state) { + if (level.getBlockTicks().willTickThisTick(pos, this)) { + return; + } + int outputSignal = this.calculateBluestoneOutputSignal(level, pos, state); + int storedOutputSignal = this.getOutputSignal(level, pos, state); + if (outputSignal != storedOutputSignal || state.getValue(POWERED) != this.shouldTurnOn(level, pos, state)) { + TickPriority tickPriority = this.shouldPrioritize(level, pos, state) ? TickPriority.HIGH : TickPriority.NORMAL; + level.scheduleTick(pos, this, 2, tickPriority); + } + } + + @Override + protected void tick(BlockState state, net.minecraft.server.level.ServerLevel level, BlockPos pos, RandomSource random) { + this.refreshBluestoneOutputState(level, pos, state); + } + + @Override + protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) { + if (!player.getAbilities().mayBuild) { + return InteractionResult.PASS; + } + BlockState updated = state.cycle(MODE); + float pitch = updated.getValue(MODE) == ComparatorMode.SUBTRACT ? 0.55F : 0.5F; + level.playSound(player, pos, SoundEvents.COMPARATOR_CLICK, SoundSource.BLOCKS, 0.3F, pitch); + level.setBlock(pos, updated, 2); + this.refreshBluestoneOutputState(level, pos, updated); + return InteractionResult.sidedSuccess(level.isClientSide); + } + + private int calculateBluestoneOutputSignal(Level level, BlockPos pos, BlockState state) { + int inputSignal = this.getInputSignal(level, pos, state); + if (inputSignal == 0) { + return 0; + } + int alternateSignal = this.getAlternateSignal(level, pos, state); + if (alternateSignal > inputSignal) { + return 0; + } + return state.getValue(MODE) == ComparatorMode.SUBTRACT ? inputSignal - alternateSignal : inputSignal; + } + + private void refreshBluestoneOutputState(Level level, BlockPos pos, BlockState state) { + int outputSignal = this.calculateBluestoneOutputSignal(level, pos, state); + BlockEntity blockEntity = level.getBlockEntity(pos); + int storedOutputSignal = 0; + if (blockEntity instanceof BluestoneComparatorBlockEntity comparator) { + storedOutputSignal = comparator.getOutputSignal(); + comparator.setOutputSignal(outputSignal); + } + boolean shouldTurnOn = this.shouldTurnOn(level, pos, state); + boolean powered = state.getValue(DiodeBlock.POWERED); + if (powered != shouldTurnOn) { + state = state.setValue(DiodeBlock.POWERED, shouldTurnOn); + level.setBlock(pos, state, 2); + } + if (storedOutputSignal != outputSignal || powered != shouldTurnOn) { + this.updateNeighborsInFront(level, pos, state); + } + } + @Override public void animateTick(BlockState state, net.minecraft.world.level.Level level, BlockPos pos, RandomSource random) { if (!state.getValue(POWERED)) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneRepeaterBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneRepeaterBlock.java index 42788e29..9ae3d14c 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneRepeaterBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneRepeaterBlock.java @@ -6,9 +6,12 @@ import net.minecraft.core.Direction; import net.minecraft.core.particles.DustParticleOptions; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.SignalGetter; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.RepeaterBlock; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; @@ -54,6 +57,51 @@ public class BluestoneRepeaterBlock extends RepeaterBlock { return super.updateShape(state, direction, neighborState, level, pos, neighborPos); } + @Override + protected int getAlternateSignal(SignalGetter level, BlockPos pos, BlockState state) { + Direction facing = state.getValue(FACING); + Direction clockwise = facing.getClockWise(); + Direction counterClockwise = facing.getCounterClockWise(); + int signal = this.getBluestoneSideSignal(level, pos.relative(clockwise), clockwise.getOpposite()); + signal = Math.max(signal, this.getBluestoneSideSignal(level, pos.relative(counterClockwise), counterClockwise.getOpposite())); + return signal; + } + + @Override + protected int getInputSignal(Level level, BlockPos pos, BlockState state) { + Direction facing = state.getValue(FACING); + BlockPos inputPos = pos.relative(facing); + BlockState inputState = level.getBlockState(inputPos); + int signal = BluestoneSignalHelper.getSignalExcludingRedstoneWire(level, inputPos, facing); + if (signal >= 15) { + return signal; + } + if (inputState.getBlock() instanceof BluestoneSignalSource source) { + return Math.max(signal, source.getBluestoneSignal(level, inputPos, inputState, facing)); + } + return signal; + } + + @Override + public boolean isLocked(LevelReader level, BlockPos pos, BlockState state) { + return this.getAlternateSignal(level, pos, state) > 0; + } + + private int getBluestoneSideSignal(SignalGetter level, BlockPos pos, Direction towardThisRepeater) { + BlockState neighborState = level.getBlockState(pos); + if (neighborState.getBlock() instanceof BluestoneRepeaterBlock + && neighborState.getValue(POWERED) + && neighborState.getValue(FACING) == towardThisRepeater) { + return 15; + } + return 0; + } + + @Override + protected boolean isSignalSource(BlockState state) { + return true; + } + @Override public void animateTick(BlockState state, net.minecraft.world.level.Level level, BlockPos pos, RandomSource random) { if (!state.getValue(POWERED)) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneSignalHelper.java b/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneSignalHelper.java index fa3daa87..0a865d30 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneSignalHelper.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneSignalHelper.java @@ -4,7 +4,9 @@ import com.craisinlord.antarchy.content.AntarchyTags; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.level.Level; +import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; public final class BluestoneSignalHelper { @@ -38,6 +40,34 @@ public final class BluestoneSignalHelper { return 0; } + public static int getSignalExcludingRedstoneWire(LevelReader level, BlockPos pos, Direction direction) { + BlockState state = level.getBlockState(pos); + if (state.is(Blocks.REDSTONE_WIRE)) { + return 0; + } + int signal = state.getSignal(level, pos, direction); + if (state.isRedstoneConductor(level, pos)) { + signal = Math.max(signal, getDirectSignalToExcludingRedstoneWire(level, pos)); + } + return signal; + } + + private static int getDirectSignalToExcludingRedstoneWire(BlockGetter level, BlockPos pos) { + int signal = 0; + for (Direction direction : Direction.values()) { + BlockPos neighborPos = pos.relative(direction); + BlockState neighborState = level.getBlockState(neighborPos); + if (neighborState.is(Blocks.REDSTONE_WIRE)) { + continue; + } + signal = Math.max(signal, neighborState.getDirectSignal(level, neighborPos, direction)); + if (signal >= 15) { + return 15; + } + } + return signal; + } + public static boolean canBluestoneConnectTo(BlockState state) { return state.is(AntarchyTags.Blocks.BLUESTONE_CONNECTABLE); } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneTorchBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneTorchBlock.java index 87202838..6f6185ce 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneTorchBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneTorchBlock.java @@ -16,29 +16,83 @@ import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.HorizontalDirectionalBlock; +import net.minecraft.world.level.block.Mirror; +import net.minecraft.world.level.block.Rotation; +import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.AttachFace; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.joml.Vector3f; -public class BluestoneTorchBlock extends AbstractCeilingBluestoneBlock implements BluestoneSignalSource { +public class BluestoneTorchBlock extends Block implements BluestoneSignalSource { public static final BooleanProperty LIT = BlockStateProperties.LIT; - private static final VoxelShape SHAPE = Block.box(6.0D, 6.0D, 6.0D, 10.0D, 16.0D, 10.0D); + public static final EnumProperty FACE = BlockStateProperties.ATTACH_FACE; + public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING; + private static final VoxelShape CEILING_SHAPE = Block.box(6.0D, 6.0D, 6.0D, 10.0D, 16.0D, 10.0D); + private static final Map WALL_SHAPES = Map.of( + Direction.NORTH, Block.box(5.5D, 3.0D, 11.0D, 10.5D, 13.0D, 16.0D), + Direction.SOUTH, Block.box(5.5D, 3.0D, 0.0D, 10.5D, 13.0D, 5.0D), + Direction.WEST, Block.box(11.0D, 3.0D, 5.5D, 16.0D, 13.0D, 10.5D), + Direction.EAST, Block.box(0.0D, 3.0D, 5.5D, 5.0D, 13.0D, 10.5D) + ); private static final DustParticleOptions BLUESTONE_PARTICLE = new DustParticleOptions(new Vector3f(0.18F, 0.54F, 1.0F), 1.0F); private static final Map> RECENT_TOGGLES = new WeakHashMap<>(); public BluestoneTorchBlock(BlockBehaviour.Properties properties) { super(properties); - this.registerDefaultState(this.defaultBlockState().setValue(LIT, true)); + this.registerDefaultState(this.defaultBlockState() + .setValue(LIT, true) + .setValue(FACE, AttachFace.CEILING) + .setValue(FACING, Direction.NORTH)); } @Override protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) { - return SHAPE; + return state.getValue(FACE) == AttachFace.WALL ? WALL_SHAPES.get(state.getValue(FACING)) : CEILING_SHAPE; + } + + @Override + protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) { + return switch (state.getValue(FACE)) { + case CEILING -> BluestonePlacementHelper.hasCeilingSupport(level, pos); + case WALL -> this.hasWallSupport(level, pos, state.getValue(FACING)); + default -> false; + }; + } + + @Override + public BlockState getStateForPlacement(net.minecraft.world.item.context.BlockPlaceContext context) { + LevelReader level = context.getLevel(); + BlockPos pos = context.getClickedPos(); + for (Direction direction : context.getNearestLookingDirections()) { + if (direction == Direction.DOWN && BluestonePlacementHelper.hasCeilingSupport(level, pos)) { + return this.defaultBlockState().setValue(FACE, AttachFace.CEILING); + } + if (direction.getAxis().isHorizontal()) { + Direction facing = direction.getOpposite(); + BlockState state = this.defaultBlockState().setValue(FACE, AttachFace.WALL).setValue(FACING, facing); + if (state.canSurvive(level, pos)) { + return state; + } + } + } + return null; + } + + @Override + protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, net.minecraft.world.level.LevelAccessor level, BlockPos pos, BlockPos neighborPos) { + if (!state.canSurvive(level, pos)) { + return net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(); + } + return super.updateShape(state, direction, neighborState, level, pos, neighborPos); } @Override @@ -48,7 +102,10 @@ public class BluestoneTorchBlock extends AbstractCeilingBluestoneBlock implement @Override protected int getSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { - if (direction == Direction.DOWN) { + if (this.isDirectlyPoweringRedstoneWire(level, pos, direction)) { + return 0; + } + if (this.isBlockedOutputDirection(state, direction)) { return 0; } return state.getValue(LIT) ? 15 : 0; @@ -56,7 +113,16 @@ public class BluestoneTorchBlock extends AbstractCeilingBluestoneBlock implement @Override protected int getDirectSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { - return this.getSignal(state, level, pos, direction); + if (!state.getValue(LIT)) { + return 0; + } + if (this.isDirectlyPoweringRedstoneWire(level, pos, direction)) { + return 0; + } + if (state.getValue(FACE) == AttachFace.WALL) { + return direction == Direction.UP ? 15 : 0; + } + return this.isBlockedOutputDirection(state, direction) ? 0 : 15; } @Override @@ -76,7 +142,7 @@ public class BluestoneTorchBlock extends AbstractCeilingBluestoneBlock implement @Override protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block block, BlockPos fromPos, boolean moving) { if (!level.isClientSide) { - boolean powered = this.hasInputSignal(level, pos); + boolean powered = this.hasInputSignal(level, pos, state); if (state.getValue(LIT) == powered) { level.scheduleTick(pos, this, 2); } @@ -85,7 +151,7 @@ public class BluestoneTorchBlock extends AbstractCeilingBluestoneBlock implement @Override protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { - boolean powered = this.hasInputSignal(level, pos); + boolean powered = this.hasInputSignal(level, pos, state); boolean lit = state.getValue(LIT); if (lit) { @@ -108,24 +174,57 @@ public class BluestoneTorchBlock extends AbstractCeilingBluestoneBlock implement return; } double x = pos.getX() + 0.5D; - double y = pos.getY() + 0.3D; + double y = pos.getY() + (state.getValue(FACE) == AttachFace.CEILING ? 0.3D : 0.35D); double z = pos.getZ() + 0.5D; + if (state.getValue(FACE) == AttachFace.WALL) { + Direction facing = state.getValue(FACING).getOpposite(); + x += 0.27D * facing.getStepX(); + z += 0.27D * facing.getStepZ(); + } level.addParticle(ParticleTypes.SMOKE, x, y, z, 0.0D, 0.0D, 0.0D); level.addParticle(BLUESTONE_PARTICLE, x, y, z, 0.0D, 0.0D, 0.0D); } @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { - builder.add(LIT); + builder.add(LIT, FACE, FACING); } @Override public int getBluestoneSignal(LevelReader level, BlockPos pos, BlockState state, Direction direction) { - return direction == Direction.DOWN ? 0 : state.getValue(LIT) ? 15 : 0; + return this.isBlockedOutputDirection(state, direction) ? 0 : state.getValue(LIT) ? 15 : 0; } - private boolean hasInputSignal(Level level, BlockPos pos) { - return level.hasNeighborSignal(pos.above()); + @Override + protected BlockState rotate(BlockState state, Rotation rotation) { + return state.getValue(FACE) == AttachFace.WALL ? state.setValue(FACING, rotation.rotate(state.getValue(FACING))) : state; + } + + @Override + protected BlockState mirror(BlockState state, Mirror mirror) { + return state.getValue(FACE) == AttachFace.WALL ? state.rotate(mirror.getRotation(state.getValue(FACING))) : state; + } + + private boolean hasInputSignal(Level level, BlockPos pos, BlockState state) { + Direction supportDirection = state.getValue(FACE) == AttachFace.CEILING ? Direction.UP : state.getValue(FACING).getOpposite(); + return level.hasSignal(pos.relative(supportDirection), supportDirection); + } + + private boolean hasWallSupport(LevelReader level, BlockPos pos, Direction facing) { + BlockPos supportPos = pos.relative(facing.getOpposite()); + return level.getBlockState(supportPos).isFaceSturdy(level, supportPos, facing); + } + + private boolean isBlockedOutputDirection(BlockState state, Direction direction) { + return this.getBlockedOutputDirection(state) == direction; + } + + private boolean isDirectlyPoweringRedstoneWire(BlockGetter level, BlockPos pos, Direction direction) { + return level.getBlockState(pos.relative(direction.getOpposite())).is(Blocks.REDSTONE_WIRE); + } + + private Direction getBlockedOutputDirection(BlockState state) { + return state.getValue(FACE) == AttachFace.WALL ? state.getValue(FACING) : Direction.DOWN; } private boolean isToggledTooFrequently(Level level, BlockPos pos, boolean addNew) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneWireBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneWireBlock.java index 89e8435a..a92590b2 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneWireBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/BluestoneWireBlock.java @@ -10,6 +10,9 @@ import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.item.ItemStack; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; @@ -17,8 +20,10 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.HorizontalDirectionalBlock; import net.minecraft.world.level.block.Mirror; +import net.minecraft.world.level.block.RedStoneWireBlock; import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.TrapDoorBlock; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -48,6 +53,7 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { private static final VoxelShape WEST_SHAPE = Block.box(0.0D, 14.0D, 3.0D, 13.0D, 16.0D, 13.0D); private static final VoxelShape EAST_SHAPE = Block.box(3.0D, 14.0D, 3.0D, 16.0D, 16.0D, 13.0D); private static boolean shouldSignal = true; + private final BlockState crossState; public BluestoneWireBlock() { this(BlockBehaviour.Properties.of().noCollission().instabreak().sound(SoundType.WOOL)); @@ -55,12 +61,18 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { public BluestoneWireBlock(BlockBehaviour.Properties properties) { super(properties); - this.registerDefaultState(this.defaultBlockState() + BlockState defaultState = this.defaultBlockState() .setValue(NORTH, BluestoneSide.NONE) .setValue(EAST, BluestoneSide.NONE) .setValue(SOUTH, BluestoneSide.NONE) .setValue(WEST, BluestoneSide.NONE) - .setValue(POWER, 0)); + .setValue(POWER, 0); + this.registerDefaultState(defaultState); + this.crossState = defaultState + .setValue(NORTH, BluestoneSide.SIDE) + .setValue(EAST, BluestoneSide.SIDE) + .setValue(SOUTH, BluestoneSide.SIDE) + .setValue(WEST, BluestoneSide.SIDE); } public MapCodec codec() { @@ -117,6 +129,7 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { @Override protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean moving) { if (!oldState.is(state.getBlock())) { + this.notifyNeighborShapes(level, pos); this.updateNeighbors(level, pos, state); } } @@ -124,13 +137,11 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { @Override protected void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean movedByPiston) { if (!state.is(newState.getBlock())) { - BluestoneSignalHelper.updateBluestoneNeighbors(level, pos); + this.notifyNeighborShapes(level, pos); for (Direction direction : Direction.Plane.HORIZONTAL) { - BlockPos neighborPos = pos.relative(direction); - BlockState neighborState = level.getBlockState(neighborPos); - if (neighborState.is(this)) { - this.updateNeighbors(level, neighborPos, neighborState); - } + this.updateNeighborWire(level, pos.relative(direction)); + this.updateNeighborWire(level, pos.relative(direction).above()); + this.updateNeighborWire(level, pos.relative(direction).below()); } } super.onRemove(state, level, pos, newState, movedByPiston); @@ -169,22 +180,32 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { @Override protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) { - if (level.isClientSide) { + if (!player.getAbilities().mayBuild) { + return InteractionResult.PASS; + } + if (!isCross(state) && !isDot(state)) { + return InteractionResult.PASS; + } + BlockState toggled = isCross(state) ? this.defaultBlockState() : this.crossState; + BlockState updated = toggled.setValue(POWER, state.getValue(POWER)); + if (!hasAnyAutomaticConnections(level, pos)) { + if (!updated.equals(state)) { + level.setBlock(pos, updated, 3); + } return InteractionResult.SUCCESS; } - boolean isDot = state.getValue(NORTH) == BluestoneSide.NONE - && state.getValue(EAST) == BluestoneSide.NONE - && state.getValue(SOUTH) == BluestoneSide.NONE - && state.getValue(WEST) == BluestoneSide.NONE; - BlockState updated = isDot - ? this.calculateShape(level, pos, state) - : state.setValue(NORTH, BluestoneSide.NONE) - .setValue(EAST, BluestoneSide.NONE) - .setValue(SOUTH, BluestoneSide.NONE) - .setValue(WEST, BluestoneSide.NONE); - level.setBlock(pos, updated, 3); - this.updateNeighbors(level, pos, updated); - return InteractionResult.SUCCESS; + updated = this.calculateShape(level, pos, updated); + if (!updated.equals(state)) { + level.setBlock(pos, updated, 3); + this.updateNeighbors(level, pos, updated); + return InteractionResult.SUCCESS; + } + return InteractionResult.PASS; + } + + @Override + public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) { + return new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.fromNamespaceAndPath("antarchy", "bluestone"))); } @Override @@ -235,10 +256,37 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { } BlockState shaped = this.calculateShape(level, pos, state); BlockState powered = this.updatePowerFromNeighbors(level, pos, shaped); - if (!powered.equals(state)) { - level.setBlock(pos, powered, 3); + if (powered.equals(state)) { + return; + } + level.setBlock(pos, powered, 2); + this.notifyNeighborShapes(level, pos); + for (Direction direction : Direction.Plane.HORIZONTAL) { + this.updateNeighborWire(level, pos.relative(direction)); + this.updateNeighborWire(level, pos.relative(direction).above()); + this.updateNeighborWire(level, pos.relative(direction).below()); + } + } + + private void updateNeighborWire(Level level, BlockPos pos) { + BlockState neighborState = level.getBlockState(pos); + if (!neighborState.is(this)) { + return; + } + BlockState shaped = this.calculateShape(level, pos, neighborState); + BlockState powered = this.updatePowerFromNeighbors(level, pos, shaped); + if (powered.equals(neighborState)) { + return; + } + level.setBlock(pos, powered, 2); + this.notifyNeighborShapes(level, pos); + } + + private void notifyNeighborShapes(Level level, BlockPos pos) { + level.updateNeighborsAt(pos, this); + for (Direction direction : Direction.values()) { + level.updateNeighborsAt(pos.relative(direction), this); } - BluestoneSignalHelper.updateBluestoneNeighbors(level, pos); } private BlockState updatePowerFromNeighbors(Level level, BlockPos pos, BlockState state) { @@ -249,12 +297,15 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { private int calculateTargetStrength(Level level, BlockPos pos) { int external = this.getExternalSignal(level, pos); int neighborWirePower = 0; + boolean openBelowCurrent = !level.getBlockState(pos.below()).isRedstoneConductor(level, pos.below()); for (Direction direction : Direction.Plane.HORIZONTAL) { BlockPos sidePos = pos.relative(direction); + BlockState sideState = level.getBlockState(sidePos); neighborWirePower = Math.max(neighborWirePower, BluestoneSignalHelper.getWireSignal(level, sidePos)); - neighborWirePower = Math.max(neighborWirePower, BluestoneSignalHelper.getWireSignal(level, sidePos.below())); - if (level.getBlockState(sidePos).isRedstoneConductor(level, sidePos)) { + if (sideState.isRedstoneConductor(level, sidePos)) { + neighborWirePower = Math.max(neighborWirePower, BluestoneSignalHelper.getWireSignal(level, sidePos.below())); + } else if (openBelowCurrent) { neighborWirePower = Math.max(neighborWirePower, BluestoneSignalHelper.getWireSignal(level, sidePos.above())); } } @@ -281,32 +332,90 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { return signal; } + private static boolean isCross(BlockState state) { + return state.getValue(NORTH) != BluestoneSide.NONE + && state.getValue(EAST) != BluestoneSide.NONE + && state.getValue(SOUTH) != BluestoneSide.NONE + && state.getValue(WEST) != BluestoneSide.NONE; + } + + private static boolean isDot(BlockState state) { + return state.getValue(NORTH) == BluestoneSide.NONE + && state.getValue(EAST) == BluestoneSide.NONE + && state.getValue(SOUTH) == BluestoneSide.NONE + && state.getValue(WEST) == BluestoneSide.NONE; + } + + private boolean hasAnyAutomaticConnections(LevelReader level, BlockPos pos) { + return this.getConnectingSide(level, pos, Direction.NORTH) != BluestoneSide.NONE + || this.getConnectingSide(level, pos, Direction.EAST) != BluestoneSide.NONE + || this.getConnectingSide(level, pos, Direction.SOUTH) != BluestoneSide.NONE + || this.getConnectingSide(level, pos, Direction.WEST) != BluestoneSide.NONE; + } + private BlockState calculateShape(LevelReader level, BlockPos pos, BlockState state) { - return state.setValue(NORTH, this.getConnectingSide(level, pos, Direction.NORTH)) + boolean wasDot = isDot(state); + BlockState result = state.setValue(NORTH, this.getConnectingSide(level, pos, Direction.NORTH)) .setValue(EAST, this.getConnectingSide(level, pos, Direction.EAST)) .setValue(SOUTH, this.getConnectingSide(level, pos, Direction.SOUTH)) .setValue(WEST, this.getConnectingSide(level, pos, Direction.WEST)); + if (wasDot && isDot(result)) { + return result; + } + + boolean north = result.getValue(NORTH) != BluestoneSide.NONE; + boolean south = result.getValue(SOUTH) != BluestoneSide.NONE; + boolean east = result.getValue(EAST) != BluestoneSide.NONE; + boolean west = result.getValue(WEST) != BluestoneSide.NONE; + boolean northSouthEmpty = !north && !south; + boolean eastWestEmpty = !east && !west; + if (!west && northSouthEmpty) { + result = result.setValue(WEST, BluestoneSide.SIDE); + } + if (!east && northSouthEmpty) { + result = result.setValue(EAST, BluestoneSide.SIDE); + } + if (!north && eastWestEmpty) { + result = result.setValue(NORTH, BluestoneSide.SIDE); + } + if (!south && eastWestEmpty) { + result = result.setValue(SOUTH, BluestoneSide.SIDE); + } + return result; } private BluestoneSide getConnectingSide(LevelReader level, BlockPos pos, Direction direction) { + boolean openBelowCurrent = !level.getBlockState(pos.below()).isRedstoneConductor(level, pos.below()); + return this.getConnectingSide(level, pos, direction, openBelowCurrent); + } + + private BluestoneSide getConnectingSide(LevelReader level, BlockPos pos, Direction direction, boolean openBelowCurrent) { BlockPos sidePos = pos.relative(direction); BlockState sideState = level.getBlockState(sidePos); + if (openBelowCurrent) { + boolean canSupportBelow = sideState.getBlock() instanceof TrapDoorBlock + || Block.canSupportCenter(level, sidePos, Direction.DOWN); + if (canSupportBelow && this.canConnectTo(level.getBlockState(sidePos.below()), direction)) { + return sideState.isFaceSturdy(level, sidePos, direction.getOpposite()) ? BluestoneSide.DOWN : BluestoneSide.SIDE; + } + } + if (this.canConnectTo(sideState, direction)) { return BluestoneSide.SIDE; } - if (!sideState.isRedstoneConductor(level, sidePos) && this.canConnectTo(level.getBlockState(sidePos.below()), direction)) { - return BluestoneSide.DOWN; + if (sideState.isRedstoneConductor(level, sidePos)) { + return BluestoneSide.NONE; } - if (sideState.isRedstoneConductor(level, sidePos) && this.canConnectTo(level.getBlockState(sidePos.above()), direction)) { - return BluestoneSide.SIDE; - } - - return BluestoneSide.NONE; + BlockPos sidePosAbove = sidePos.above(); + return this.canConnectTo(level.getBlockState(sidePosAbove), direction) ? BluestoneSide.SIDE : BluestoneSide.NONE; } private boolean canConnectTo(BlockState state, Direction direction) { + if (state.getBlock() instanceof RedStoneWireBlock || state.is(net.minecraft.world.level.block.Blocks.REDSTONE_WIRE)) { + return false; + } if (state.getBlock() instanceof BluestoneWireBlock || state.getBlock() instanceof BluestoneTorchBlock || state.getBlock() instanceof BluestoneBlock) { return true; } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/CorneaStalkBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/CorneaStalkBlock.java index 26047442..3880d300 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/CorneaStalkBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/CorneaStalkBlock.java @@ -8,6 +8,8 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; import net.minecraft.tags.BlockTags; import net.minecraft.util.RandomSource; import net.minecraft.world.item.ItemStack; @@ -147,6 +149,7 @@ public class CorneaStalkBlock extends BushBlock implements BonemealableBlock { if (!level.isClientSide) { this.dropCorneaFruit(level, pos, level.random); level.setBlock(pos, state.setValue(AGE, 1), Block.UPDATE_ALL); + level.playSound(null, pos, SoundEvents.CAVE_VINES_PICK_BERRIES, SoundSource.BLOCKS, 1.0F, 0.9F + level.random.nextFloat() * 0.2F); } return ItemInteractionResult.sidedSuccess(level.isClientSide); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/CreepvineBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/CreepvineBlock.java new file mode 100644 index 00000000..9c79809a --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/CreepvineBlock.java @@ -0,0 +1,73 @@ +package com.craisinlord.antarchy.content.block; + +import com.mojang.serialization.MapCodec; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.util.RandomSource; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.ItemInteractionResult; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.VineBlock; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.phys.BlockHitResult; + +public class CreepvineBlock extends VineBlock { + public static final MapCodec CODEC = Block.simpleCodec(CreepvineBlock::new); + public static final BooleanProperty STUNTED = BooleanProperty.create("stunted"); + + public CreepvineBlock(BlockBehaviour.Properties properties) { + super(properties); + this.registerDefaultState(this.defaultBlockState() + .setValue(NORTH, false) + .setValue(EAST, false) + .setValue(SOUTH, false) + .setValue(WEST, false) + .setValue(UP, false) + .setValue(STUNTED, false)); + } + + @Override + public MapCodec codec() { + return (MapCodec) (MapCodec) CODEC; + } + + @Override + protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + if (state.getValue(STUNTED)) { + return; + } + super.randomTick(state, level, pos, random); + } + + @Override + protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { + if (!stack.is(Items.SHEARS) || state.getValue(STUNTED)) { + return super.useItemOn(stack, state, level, pos, player, hand, hitResult); + } + + if (!level.isClientSide) { + level.setBlock(pos, state.setValue(STUNTED, true), Block.UPDATE_ALL); + stack.hurtAndBreak(1, player, hand == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND); + level.playSound(null, pos, SoundEvents.SHEEP_SHEAR, SoundSource.BLOCKS, 1.0F, 1.0F); + } + + return ItemInteractionResult.sidedSuccess(level.isClientSide); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(STUNTED); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/HangingCreeprootsBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/HangingCreeprootsBlock.java index 866f3a7f..068307e5 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/HangingCreeprootsBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/HangingCreeprootsBlock.java @@ -3,8 +3,17 @@ package com.craisinlord.antarchy.content.block; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.world.level.Level; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.RandomSource; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.ItemInteractionResult; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelReader; @@ -15,6 +24,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; @@ -22,12 +32,13 @@ public class HangingCreeprootsBlock extends BushBlock { public static final MapCodec CODEC = Block.simpleCodec(HangingCreeprootsBlock::new); public static final IntegerProperty DISTANCE = IntegerProperty.create("distance", 0, 4); public static final BooleanProperty BOTTOM = BooleanProperty.create("bottom"); + public static final BooleanProperty STUNTED = BooleanProperty.create("stunted"); private static final int MAX_DISTANCE = 4; private static final VoxelShape SHAPE = Block.box(4.0D, 0.0D, 4.0D, 12.0D, 16.0D, 12.0D); public HangingCreeprootsBlock(BlockBehaviour.Properties properties) { super(properties); - this.registerDefaultState(this.stateDefinition.any().setValue(DISTANCE, 0).setValue(BOTTOM, true)); + this.registerDefaultState(this.stateDefinition.any().setValue(DISTANCE, 0).setValue(BOTTOM, true).setValue(STUNTED, false)); } @Override @@ -67,12 +78,12 @@ public class HangingCreeprootsBlock extends BushBlock { @Override protected boolean isRandomlyTicking(BlockState state) { - return state.getValue(BOTTOM) && state.getValue(DISTANCE) < MAX_DISTANCE; + return state.getValue(BOTTOM) && !state.getValue(STUNTED) && state.getValue(DISTANCE) < MAX_DISTANCE; } @Override protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { - if (!state.getValue(BOTTOM) || state.getValue(DISTANCE) >= MAX_DISTANCE) { + if (state.getValue(STUNTED) || !state.getValue(BOTTOM) || state.getValue(DISTANCE) >= MAX_DISTANCE) { return; } @@ -86,8 +97,23 @@ public class HangingCreeprootsBlock extends BushBlock { level.setBlock(belowPos, this.defaultBlockState().setValue(DISTANCE, distance + 1).setValue(BOTTOM, true), Block.UPDATE_ALL); } + @Override + protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { + if (!stack.is(Items.SHEARS) || state.getValue(STUNTED)) { + return super.useItemOn(stack, state, level, pos, player, hand, hitResult); + } + + if (!level.isClientSide) { + level.setBlock(pos, state.setValue(STUNTED, true), Block.UPDATE_ALL); + stack.hurtAndBreak(1, player, hand == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND); + level.playSound(null, pos, SoundEvents.SHEEP_SHEAR, SoundSource.BLOCKS, 1.0F, 1.0F); + } + + return ItemInteractionResult.sidedSuccess(level.isClientSide); + } + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { - builder.add(DISTANCE, BOTTOM); + builder.add(DISTANCE, BOTTOM, STUNTED); } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/MoltingVinesBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/MoltingVinesBlock.java index e3a0156c..44a54eda 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/MoltingVinesBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/MoltingVinesBlock.java @@ -6,12 +6,16 @@ import net.minecraft.core.Direction; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.ItemInteractionResult; +import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; @@ -36,6 +40,7 @@ public class MoltingVinesBlock extends BushBlock implements BonemealableBlock { public static final BooleanProperty TOP_CAP = BooleanProperty.create("top_cap"); public static final BooleanProperty BOTTOM_CAP = BooleanProperty.create("bottom_cap"); public static final BooleanProperty BROODFRUIT = BooleanProperty.create("broodfruit"); + public static final BooleanProperty STUNTED = BooleanProperty.create("stunted"); public static final IntegerProperty DISTANCE = IntegerProperty.create("distance", 0, 6); private static final int MAX_DISTANCE = 6; private static final int NATURAL_FRUIT_CHANCE = 40; @@ -49,6 +54,7 @@ public class MoltingVinesBlock extends BushBlock implements BonemealableBlock { .setValue(TOP_CAP, false) .setValue(BOTTOM_CAP, true) .setValue(BROODFRUIT, false) + .setValue(STUNTED, false) .setValue(DISTANCE, 0)); } @@ -134,11 +140,15 @@ public class MoltingVinesBlock extends BushBlock implements BonemealableBlock { @Override protected boolean isRandomlyTicking(BlockState state) { - return true; + return !state.getValue(STUNTED); } @Override protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + if (state.getValue(STUNTED)) { + return; + } + boolean isTip = state.getValue(GROWTH_DIRECTION) == Direction.DOWN ? state.getValue(BOTTOM_CAP) : state.getValue(TOP_CAP); if (isTip && state.getValue(DISTANCE) < MAX_DISTANCE && random.nextInt(6) == 0) { BlockPos growPos = pos.relative(state.getValue(GROWTH_DIRECTION)); @@ -181,6 +191,16 @@ public class MoltingVinesBlock extends BushBlock implements BonemealableBlock { @Override protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { + if (stack.is(Items.SHEARS) && !state.getValue(STUNTED)) { + if (!level.isClientSide) { + level.setBlock(pos, state.setValue(STUNTED, true), Block.UPDATE_ALL); + stack.hurtAndBreak(1, player, hand == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND); + level.playSound(null, pos, SoundEvents.SHEEP_SHEAR, SoundSource.BLOCKS, 1.0F, 1.0F); + } + + return ItemInteractionResult.sidedSuccess(level.isClientSide); + } + if (!state.getValue(BROODFRUIT)) { return super.useItemOn(stack, state, level, pos, player, hand, hitResult); } @@ -188,6 +208,7 @@ public class MoltingVinesBlock extends BushBlock implements BonemealableBlock { if (!level.isClientSide) { BuiltInRegistries.ITEM.getOptional(BROODFRUIT_ITEM_ID).ifPresent(item -> harvestFruit(level, pos, item)); level.setBlock(pos, state.setValue(BROODFRUIT, false), Block.UPDATE_ALL); + level.playSound(null, pos, SoundEvents.CAVE_VINES_PICK_BERRIES, SoundSource.BLOCKS, 1.0F, 0.9F + level.random.nextFloat() * 0.2F); } return ItemInteractionResult.sidedSuccess(level.isClientSide); @@ -197,8 +218,16 @@ public class MoltingVinesBlock extends BushBlock implements BonemealableBlock { Block.popResource(level, pos, new ItemStack(item, 1)); } + @Override + protected void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean movedByPiston) { + if (!level.isClientSide && state.getValue(BROODFRUIT) && !state.is(newState.getBlock())) { + BuiltInRegistries.ITEM.getOptional(BROODFRUIT_ITEM_ID).ifPresent(item -> harvestFruit(level, pos, item)); + } + super.onRemove(state, level, pos, newState, movedByPiston); + } + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { - builder.add(GROWTH_DIRECTION, TOP_CAP, BOTTOM_CAP, BROODFRUIT, DISTANCE); + builder.add(GROWTH_DIRECTION, TOP_CAP, BOTTOM_CAP, BROODFRUIT, STUNTED, DISTANCE); } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/PeachLeavesBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/PeachLeavesBlock.java index 1ac4bc33..6054ecde 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/PeachLeavesBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/PeachLeavesBlock.java @@ -4,29 +4,41 @@ import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.content.AntarchyObjects; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; +import net.minecraft.tags.BlockTags; import net.minecraft.util.RandomSource; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.BonemealableBlock; import net.minecraft.world.level.block.LeavesBlock; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; public class PeachLeavesBlock extends LeavesBlock implements BonemealableBlock { public static final MapCodec CODEC = Block.simpleCodec(PeachLeavesBlock::new); private static final ResourceLocation HANGING_PEACH_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "hanging_peach"); + public static final IntegerProperty PEACH_DISTANCE = IntegerProperty.create("peach_distance", 1, 13); + public static final BooleanProperty PERSISTENT = LeavesBlock.PERSISTENT; + public static final BooleanProperty WATERLOGGED = LeavesBlock.WATERLOGGED; + public static final int PEACH_MAX_DISTANCE = 12; + public static final int PEACH_DECAY_DISTANCE = PEACH_MAX_DISTANCE + 1; public PeachLeavesBlock(BlockBehaviour.Properties properties) { super(properties); - this.registerDefaultState(this.defaultBlockState() + this.registerDefaultState(this.stateDefinition.any() .setValue(DISTANCE, DECAY_DISTANCE) + .setValue(PEACH_DISTANCE, PEACH_DECAY_DISTANCE) .setValue(PERSISTENT, false) .setValue(WATERLOGGED, false)); } @@ -39,9 +51,62 @@ public class PeachLeavesBlock extends LeavesBlock implements BonemealableBlock { @Override public BlockState getStateForPlacement(BlockPlaceContext context) { FluidState fluidState = context.getLevel().getFluidState(context.getClickedPos()); - return this.defaultBlockState() + BlockState state = this.defaultBlockState() .setValue(PERSISTENT, true) .setValue(WATERLOGGED, fluidState.getType() == Fluids.WATER); + + return recalculateDistance(state, context.getLevel(), context.getClickedPos()); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(LeavesBlock.DISTANCE, PEACH_DISTANCE, PERSISTENT, WATERLOGGED); + } + + @Override + protected boolean isRandomlyTicking(BlockState state) { + return decaying(state); + } + + @Override + protected boolean decaying(BlockState state) { + return !state.getValue(PERSISTENT) && state.getValue(PEACH_DISTANCE) > PEACH_MAX_DISTANCE; + } + + @Override + protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + if (decaying(state)) { + dropResources(state, level, pos); + level.removeBlock(pos, false); + } + } + + @Override + protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + level.setBlock(pos, recalculateDistance(state, level, pos), Block.UPDATE_ALL); + } + + @Override + protected BlockState updateShape( + BlockState state, + Direction direction, + BlockState neighborState, + LevelAccessor level, + BlockPos pos, + BlockPos neighborPos + ) { + if (state.getValue(WATERLOGGED)) { + level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); + } + + int neighborDistance = Math.min(PEACH_DECAY_DISTANCE, getDistanceAt(neighborState) + 1); + int currentDistance = state.getValue(PEACH_DISTANCE); + + if (neighborDistance != 1 || currentDistance != neighborDistance) { + level.scheduleTick(pos, this, 1); + } + + return state; } @Override @@ -85,4 +150,51 @@ public class PeachLeavesBlock extends LeavesBlock implements BonemealableBlock { .map(Block::defaultBlockState) .orElseThrow(() -> new IllegalStateException("Missing hanging peach block: " + HANGING_PEACH_ID)); } + + private static BlockState recalculateDistance(BlockState state, LevelReader level, BlockPos pos) { + int bestDistance = PEACH_DECAY_DISTANCE; + BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos(); + + for (Direction direction : Direction.values()) { + cursor.setWithOffset(pos, direction); + bestDistance = Math.min(bestDistance, getDistanceAt(level.getBlockState(cursor)) + 1); + if (bestDistance == 1) { + break; + } + } + + return setPeachDistance(state, Math.min(PEACH_DECAY_DISTANCE, bestDistance)); + } + + private static BlockState setPeachDistance(BlockState state, int distance) { + int peachDistance = Math.max(1, Math.min(PEACH_DECAY_DISTANCE, distance)); + int vanillaDistance = Math.min(LeavesBlock.DECAY_DISTANCE, peachDistance); + + return state + .setValue(PEACH_DISTANCE, peachDistance) + .setValue(LeavesBlock.DISTANCE, vanillaDistance); + } + + private static int getDistanceAt(BlockState state) { + if (state.is(BlockTags.LOGS)) { + return 0; + } + if (state.hasProperty(PEACH_DISTANCE)) { + return state.getValue(PEACH_DISTANCE); + } + if (state.hasProperty(LeavesBlock.DISTANCE)) { + return state.getValue(LeavesBlock.DISTANCE); + } + + return PEACH_DECAY_DISTANCE; + } + + public static BlockState setPeachDistanceForWorldgen(BlockState state, int distance) { + int peachDistance = Math.max(1, Math.min(PEACH_DECAY_DISTANCE, distance)); + int vanillaDistance = Math.min(LeavesBlock.DECAY_DISTANCE, peachDistance); + + return state + .setValue(PEACH_DISTANCE, peachDistance) + .setValue(LeavesBlock.DISTANCE, vanillaDistance); + } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/PolishedNyxitePressurePlateBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/PolishedNyxitePressurePlateBlock.java new file mode 100644 index 00000000..556ece7f --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/PolishedNyxitePressurePlateBlock.java @@ -0,0 +1,68 @@ +package com.craisinlord.antarchy.content.block; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.PressurePlateBlock; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockSetType; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; + +public class PolishedNyxitePressurePlateBlock extends PressurePlateBlock { + public static final BooleanProperty CEILING = BooleanProperty.create("ceiling"); + + private static final VoxelShape CEILING_SHAPE = Block.box(1.0D, 15.0D, 1.0D, 15.0D, 16.0D, 15.0D); + private static final VoxelShape CEILING_PRESSED_SHAPE = Block.box(1.0D, 15.5D, 1.0D, 15.0D, 16.0D, 15.0D); + private static final AABB CEILING_TOUCH_AABB = new AABB(0.0625D, 0.75D, 0.0625D, 0.9375D, 1.0D, 0.9375D); + + public PolishedNyxitePressurePlateBlock(BlockSetType type, BlockBehaviour.Properties properties) { + super(type, properties); + this.registerDefaultState(this.stateDefinition.any().setValue(POWERED, false).setValue(CEILING, false)); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(CEILING); + } + + @Override + public BlockState getStateForPlacement(BlockPlaceContext context) { + boolean ceiling = context.getClickedFace() == Direction.DOWN; + return this.defaultBlockState().setValue(CEILING, ceiling); + } + + @Override + protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) { + return state.getValue(CEILING) + ? Block.canSupportCenter(level, pos.above(), Direction.DOWN) + : super.canSurvive(state, level, pos); + } + + @Override + protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) { + if (!state.getValue(CEILING)) { + return super.getShape(state, level, pos, context); + } + return state.getValue(POWERED) ? CEILING_PRESSED_SHAPE : CEILING_SHAPE; + } + + @Override + protected int getSignalStrength(Level level, BlockPos pos) { + BlockState state = level.getBlockState(pos); + if (!state.getValue(CEILING)) { + return super.getSignalStrength(level, pos); + } + return getEntityCount(level, CEILING_TOUCH_AABB.move(pos), Entity.class) > 0 ? 15 : 0; + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/creative/CreativeTabContents.java b/common/src/main/java/com/craisinlord/antarchy/content/creative/CreativeTabContents.java index 5be42b26..3d7d8131 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/creative/CreativeTabContents.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/creative/CreativeTabContents.java @@ -101,6 +101,8 @@ public final class CreativeTabContents { entry("polished_nyxite_stairs", "building_blocks"), entry("polished_nyxite_slab", "building_blocks"), entry("polished_nyxite_wall", "building_blocks"), + entry("polished_nyxite_pressure_plate", "building_blocks"), + entry("polished_nyxite_button", "building_blocks"), entry("nyxite_bricks", "building_blocks"), entry("nyxite_brick_stairs", "building_blocks"), entry("nyxite_brick_slab", "building_blocks"), @@ -112,6 +114,10 @@ public final class CreativeTabContents { entry("antimetal", "building_blocks"), entry("polished_antimetal", "building_blocks"), entry("antimetal_scaffolding", "building_blocks"), + entry("antimetal_rail", "redstone_blocks"), + entry("antimetal_powered_rail", "redstone_blocks"), + entry("antimetal_detector_rail", "redstone_blocks"), + entry("antimetal_activator_rail", "redstone_blocks"), entry("umbral_moss_block", "building_blocks"), entry("umbral_moss_carpet", "building_blocks"), entry("dream_torch", "building_blocks"), @@ -170,10 +176,10 @@ public final class CreativeTabContents { entry("uranium_trapdoor", "building_blocks"), entry("uranium_bars", "building_blocks"), entry("uranium_bulb", "building_blocks"), - entry("bluestone_block", "building_blocks"), - entry("bluestone_repeater", "building_blocks"), - entry("bluestone_comparator", "building_blocks"), - entry("bluestone_torch", "building_blocks"), + entry("bluestone_block", "redstone_blocks"), + entry("bluestone_repeater", "redstone_blocks"), + entry("bluestone_comparator", "redstone_blocks"), + entry("bluestone_torch", "redstone_blocks"), entry("titanium_block", "building_blocks"), entry("raw_titanium_block", "building_blocks"), entry("cut_titanium", "building_blocks"), @@ -222,7 +228,7 @@ public final class CreativeTabContents { entry("deepslate_uranium_ore", "natural_blocks"), entry("titanium_ore", "natural_blocks"), entry("deepslate_titanium_ore", "natural_blocks"), - entry("bluestone_ore", "natural_blocks"), + entry("bluestone_ore", "redstone_blocks"), entry("corn_seeds", "natural_blocks"), entry("star_coral", "natural_blocks"), entry("star_coral_fan", "natural_blocks"), @@ -284,7 +290,7 @@ public final class CreativeTabContents { entry("jumpy_boots", "combat"), entry("raw_uranium_scrap", "ingredients"), entry("raw_titanium_scrap", "ingredients"), - entry("bluestone", "ingredients"), + entry("bluestone", "redstone_blocks"), entry("raw_uranium", "ingredients"), entry("raw_titanium", "ingredients"), entry("uranium_nugget", "ingredients"), diff --git a/common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyBehavior.java b/common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyBehavior.java index 879016bb..622e4ddc 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyBehavior.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyBehavior.java @@ -31,7 +31,7 @@ public final class StinkyBehavior { if (!(entity.level() instanceof ServerLevel serverLevel)) { return; } - if (!entity.isAlive() || !entity.hasEffect(AntarchyObjects.STINKY_EFFECT.get())) { + if (!entity.isAlive() || !entity.hasEffect(AntarchyObjects.STINKY_EFFECT.get()) || isSpectatorPlayer(entity)) { return; } if (entity.tickCount % TRAIL_INTERVAL_TICKS != 0) { @@ -84,6 +84,9 @@ public final class StinkyBehavior { if (!(entity.level() instanceof ServerLevel serverLevel)) { return; } + if (isSpectatorPlayer(entity)) { + return; + } serverLevel.sendParticles( AntarchyObjects.STINKY_GAS.get(), entity.getX(), @@ -223,4 +226,8 @@ public final class StinkyBehavior { return !mob.isAlliedTo(source); } + private static boolean isSpectatorPlayer(LivingEntity entity) { + return entity instanceof Player player && player.isSpectator(); + } + } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/lucid/LucidBoltEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/lucid/LucidBoltEntity.java index ad4dc39f..07753f1f 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/lucid/LucidBoltEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/lucid/LucidBoltEntity.java @@ -3,21 +3,21 @@ package com.craisinlord.antarchy.content.entity.lucid; import com.craisinlord.antarchy.content.AntarchySoundEvents; import com.craisinlord.antarchy.content.AntarchyTags; import net.minecraft.core.Holder; +import net.minecraft.network.syncher.SynchedEntityData; +import net.minecraft.sounds.SoundSource; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.projectile.AbstractArrow; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; +import net.minecraft.world.entity.projectile.ThrowableProjectile; import net.minecraft.world.level.Level; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.EntityHitResult; import java.util.function.Supplier; -public class LucidBoltEntity extends AbstractArrow { +public class LucidBoltEntity extends ThrowableProjectile { private static final int MAX_LIFETIME_TICKS = 40; private static final int INVERTED_EFFECT_DURATION = 100; private static final double BASE_DAMAGE = 3.0D; @@ -30,19 +30,16 @@ public class LucidBoltEntity extends AbstractArrow { } public LucidBoltEntity(EntityType entityType, LivingEntity shooter, Level level) { - super(entityType, shooter, level, new ItemStack(Items.BOW), new ItemStack(Items.BOW)); + super(entityType, shooter, level); this.configureBolt(); } private void configureBolt() { - this.pickup = Pickup.DISALLOWED; this.setNoGravity(true); - this.setBaseDamage(BASE_DAMAGE); } @Override - protected ItemStack getDefaultPickupItem() { - return ItemStack.EMPTY; + protected void defineSynchedData(SynchedEntityData.Builder builder) { } @Override @@ -50,11 +47,6 @@ public class LucidBoltEntity extends AbstractArrow { return 0.0D; } - @Override - protected net.minecraft.sounds.SoundEvent getDefaultHitGroundSoundEvent() { - return AntarchySoundEvents.LUCID_BOLT_SOUND.get(); - } - @Override public void tick() { if (!this.level().isClientSide() && this.tickCount > MAX_LIFETIME_TICKS) { @@ -72,14 +64,12 @@ public class LucidBoltEntity extends AbstractArrow { return; } - super.onHitEntity(result); - if (!this.level().isClientSide() && result.getEntity() instanceof LivingEntity target) { Entity owner = this.getOwner(); if (owner instanceof LivingEntity shooter) { - target.hurt(this.damageSources().mobAttack(shooter), (float) this.getBaseDamage()); + target.hurt(this.damageSources().mobAttack(shooter), (float) BASE_DAMAGE); } else { - target.hurt(this.damageSources().magic(), (float) this.getBaseDamage()); + target.hurt(this.damageSources().magic(), (float) BASE_DAMAGE); } if (invertedEffectSupplier != null) { @@ -92,7 +82,9 @@ public class LucidBoltEntity extends AbstractArrow { @Override protected void onHitBlock(BlockHitResult result) { - super.onHitBlock(result); + if (!this.level().isClientSide()) { + this.level().playSound(null, result.getBlockPos(), AntarchySoundEvents.LUCID_BOLT_SOUND.get(), SoundSource.HOSTILE, 0.8F, 1.0F); + } this.discard(); } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/fluid/AntarchyFluidChecks.java b/common/src/main/java/com/craisinlord/antarchy/content/fluid/AntarchyFluidChecks.java index 33b2e5c9..b79ae3af 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/fluid/AntarchyFluidChecks.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/fluid/AntarchyFluidChecks.java @@ -1,8 +1,11 @@ package com.craisinlord.antarchy.content.fluid; import com.craisinlord.antarchy.Antarchy; +import net.minecraft.core.BlockPos; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.FluidState; public final class AntarchyFluidChecks { @@ -14,6 +17,7 @@ public final class AntarchyFluidChecks { private static final ResourceLocation FLOWING_LUMEN_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "flowing_lumen"); private static final ResourceLocation BILE_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "bile"); private static final ResourceLocation FLOWING_BILE_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "flowing_bile"); + private static final ResourceLocation BILE_VEIN_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "bile_vein"); private AntarchyFluidChecks() { } @@ -41,4 +45,30 @@ public final class AntarchyFluidChecks { public static boolean usesWaterLikePhysics(FluidState fluidState) { return isIchor(fluidState) || isLumen(fluidState) || isBile(fluidState); } + + public static boolean isBileVein(BlockState state) { + ResourceLocation blockId = BuiltInRegistries.BLOCK.getKey(state.getBlock()); + return BILE_VEIN_ID.equals(blockId); + } + + /** + * Bile always wins: worldgen foliage must not anchor on or near bile fluid or its solid + * bile_vein shell, since cyst/vein features can carve into a neighboring chunk after this + * chunk's vegetation has already been placed. + */ + public static boolean hasBileNearby(LevelAccessor level, BlockPos center, int radius) { + BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos(); + for (int dx = -radius; dx <= radius; dx++) { + for (int dy = -radius; dy <= radius; dy++) { + for (int dz = -radius; dz <= radius; dz++) { + mutable.set(center.getX() + dx, center.getY() + dy, center.getZ() + dz); + BlockState state = level.getBlockState(mutable); + if (isBile(state.getFluidState()) || isBileVein(state)) { + return true; + } + } + } + } + return false; + } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java b/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java index 3a86d921..ac7ed897 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java @@ -326,7 +326,7 @@ public final class CavarynHordeManager { private static void tickDormantPressure(ServerLevel level, HordeData data, ServerPlayer player, PlayerAttention attention, long areaKey, long gameTime) { long nextSpawnTime = data.areaSpawnCooldowns.getOrDefault(areaKey, 0L); - if (gameTime < nextSpawnTime || level.getDifficulty() == Difficulty.PEACEFUL) { + if (gameTime < nextSpawnTime || level.getDifficulty() == Difficulty.PEACEFUL || !mobSpawningEnabled(level)) { return; } @@ -435,7 +435,7 @@ public final class CavarynHordeManager { } private static void spawnAwakeningSkirmish(ServerLevel level, Encounter encounter, List targets) { - if (level.getDifficulty() == Difficulty.PEACEFUL) { + if (level.getDifficulty() == Difficulty.PEACEFUL || !mobSpawningEnabled(level)) { return; } int players = Math.max(1, targets.size()); @@ -457,7 +457,7 @@ public final class CavarynHordeManager { } private static void spawnPulse(ServerLevel level, Encounter encounter, List targets) { - if (level.getDifficulty() == Difficulty.PEACEFUL) { + if (level.getDifficulty() == Difficulty.PEACEFUL || !mobSpawningEnabled(level)) { return; } @@ -485,6 +485,9 @@ public final class CavarynHordeManager { } private static boolean spawnDirectMob(ServerLevel level, @Nullable Encounter encounter, CavarynHordeDefinitions.SpawnChoice choice, ServerPlayer target) { + if (!mobSpawningEnabled(level)) { + return false; + } EntityType type = choice.type(); BlockPos spawnPos = findSpawnPos(level, target, type, level.random); if (spawnPos == null) { @@ -635,6 +638,10 @@ public final class CavarynHordeManager { return level.getGameRules().getBoolean(AntarchyGameRules.RULE_DO_CAVARYN_HORDES); } + private static boolean mobSpawningEnabled(ServerLevel level) { + return level.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_DOMOBSPAWNING); + } + private static void clearDisabledState(ServerLevel level, HordeData data) { boolean dirty = false; if (!data.encounters.isEmpty()) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/item/BluestoneDustItem.java b/common/src/main/java/com/craisinlord/antarchy/content/item/BluestoneDustItem.java index 55beb3f2..9c4f09d6 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/item/BluestoneDustItem.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/item/BluestoneDustItem.java @@ -26,7 +26,7 @@ public class BluestoneDustItem extends Item { @Override public void appendHoverText(ItemStack stack, Item.TooltipContext context, List tooltipComponents, TooltipFlag tooltipFlag) { - tooltipComponents.add(Component.translatable("tooltip.antarchy.bluestone_placement").withStyle(ChatFormatting.BLUE)); + tooltipComponents.add(Component.translatable("tooltip.antarchy.bluestone_placement").withStyle(ChatFormatting.DARK_AQUA)); super.appendHoverText(stack, context, tooltipComponents, tooltipFlag); } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingCompatiblePlacementTooltipBlockItem.java b/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingCompatiblePlacementTooltipBlockItem.java new file mode 100644 index 00000000..e2d4e2b1 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingCompatiblePlacementTooltipBlockItem.java @@ -0,0 +1,22 @@ +package com.craisinlord.antarchy.content.item; + +import java.util.List; +import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.block.Block; + +public class CeilingCompatiblePlacementTooltipBlockItem extends BlockItem { + public CeilingCompatiblePlacementTooltipBlockItem(Block block, Properties properties) { + super(block, properties); + } + + @Override + public void appendHoverText(ItemStack stack, Item.TooltipContext context, List tooltipComponents, TooltipFlag tooltipFlag) { + tooltipComponents.add(Component.translatable("tooltip.antarchy.ceiling_compatible_placement").withStyle(ChatFormatting.DARK_AQUA)); + super.appendHoverText(stack, context, tooltipComponents, tooltipFlag); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingPlacementTooltipBlockItem.java b/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingPlacementTooltipBlockItem.java index 80040022..bec63a19 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingPlacementTooltipBlockItem.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingPlacementTooltipBlockItem.java @@ -16,7 +16,7 @@ public class CeilingPlacementTooltipBlockItem extends BlockItem { @Override public void appendHoverText(ItemStack stack, Item.TooltipContext context, List tooltipComponents, TooltipFlag tooltipFlag) { - tooltipComponents.add(Component.translatable("tooltip.antarchy.bluestone_placement").withStyle(ChatFormatting.BLUE)); + tooltipComponents.add(Component.translatable("tooltip.antarchy.bluestone_placement").withStyle(ChatFormatting.DARK_AQUA)); super.appendHoverText(stack, context, tooltipComponents, tooltipFlag); } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingPlacementTooltipItem.java b/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingPlacementTooltipItem.java index ee64aaf8..ba7b8cda 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingPlacementTooltipItem.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/item/CeilingPlacementTooltipItem.java @@ -14,7 +14,7 @@ public class CeilingPlacementTooltipItem extends Item { @Override public void appendHoverText(ItemStack stack, Item.TooltipContext context, List tooltipComponents, TooltipFlag tooltipFlag) { - tooltipComponents.add(Component.translatable("tooltip.antarchy.bluestone_placement").withStyle(ChatFormatting.BLUE)); + tooltipComponents.add(Component.translatable("tooltip.antarchy.bluestone_placement").withStyle(ChatFormatting.DARK_AQUA)); super.appendHoverText(stack, context, tooltipComponents, tooltipFlag); } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalDismountHelper.java b/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalDismountHelper.java new file mode 100644 index 00000000..1acb191c --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalDismountHelper.java @@ -0,0 +1,66 @@ +package com.craisinlord.antarchy.content.minecart; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.vehicle.AbstractMinecart; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.Vec3; + +public final class AntimetalDismountHelper { + private static final Vec3[] SEARCH_OFFSETS = new Vec3[]{ + new Vec3(-1, -1, 0), + new Vec3(1, -1, 0), + new Vec3(0, -1, -1), + new Vec3(0, -1, 1), + new Vec3(-1, -1, -1), + new Vec3(-1, -1, 1), + new Vec3(1, -1, -1), + new Vec3(1, -1, 1), + new Vec3(0, -1.6, 0) + }; + + private AntimetalDismountHelper() { + } + + public static Vec3 findDismountPosition(AbstractMinecart cart, LivingEntity passenger) { + Level level = cart.level(); + Vec3 cartPos = cart.position(); + double width = Math.max(passenger.getBbWidth(), 0.6D); + double height = passenger.getBbHeight(); + + for (Vec3 offset : SEARCH_OFFSETS) { + Vec3 candidate = cartPos.add(offset); + if (isClear(level, candidate, width, height)) { + return candidate; + } + } + return cartPos.add(0, -1.0D, 0); + } + + private static boolean isClear(Level level, Vec3 pos, double width, double height) { + AABB box = new AABB( + pos.x - width / 2.0D, pos.y, pos.z - width / 2.0D, + pos.x + width / 2.0D, pos.y + height, pos.z + width / 2.0D + ); + BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos(); + int minX = net.minecraft.util.Mth.floor(box.minX); + int maxX = net.minecraft.util.Mth.floor(box.maxX); + int minY = net.minecraft.util.Mth.floor(box.minY); + int maxY = net.minecraft.util.Mth.floor(box.maxY); + int minZ = net.minecraft.util.Mth.floor(box.minZ); + int maxZ = net.minecraft.util.Mth.floor(box.maxZ); + + for (int x = minX; x <= maxX; x++) { + for (int y = minY; y <= maxY; y++) { + for (int z = minZ; z <= maxZ; z++) { + mutable.set(x, y, z); + if (!level.getBlockState(mutable).getCollisionShape(level, mutable).isEmpty()) { + return false; + } + } + } + } + return true; + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalMinecartAccess.java b/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalMinecartAccess.java new file mode 100644 index 00000000..e051bfb5 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalMinecartAccess.java @@ -0,0 +1,15 @@ +package com.craisinlord.antarchy.content.minecart; + +import net.minecraft.core.BlockPos; +import org.jetbrains.annotations.Nullable; + +public interface AntimetalMinecartAccess { + boolean antarchy$isOnAntimetalRail(); + + void antarchy$setOnAntimetalRail(boolean value); + + @Nullable + BlockPos antarchy$getAntimetalRailPos(); + + void antarchy$setAntimetalRailPos(@Nullable BlockPos pos); +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalMinecartPhysics.java b/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalMinecartPhysics.java new file mode 100644 index 00000000..51dc3cdd --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalMinecartPhysics.java @@ -0,0 +1,339 @@ +package com.craisinlord.antarchy.content.minecart; + +import com.craisinlord.antarchy.content.block.AbstractAntimetalRailBlock; +import com.craisinlord.antarchy.content.block.AntimetalActivatorRailBlock; +import com.craisinlord.antarchy.content.block.AntimetalPoweredRailBlock; +import com.mojang.datafixers.util.Pair; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Vec3i; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.MoverType; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.entity.vehicle.AbstractMinecart; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.RailShape; +import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.Nullable; + +/** + * A direct mirror of {@code AbstractMinecart.moveAlongTrack}/{@code getPos}/{@code getPosOffs}, + * adapted for ceiling-mounted track. The world-Y meaning of "ascending"/"descending" does not + * need to be sign-flipped anywhere here — lower world Y is lower world Y whether a rail rests on + * a floor or hangs from a ceiling. What actually differs from vanilla is: the rail sits near the + * top of its cell instead of near the bottom (see {@link AntimetalRailHelper#attachY}), support + * is required above instead of below, and the "which cell owns this position" disambiguation + * checks the cell above instead of the cell below. Everything else — the exit-projection math, + * the slope acceleration constant, the player-push nudge, using real collision-checked + * {@code Entity.move} rather than a hand-rolled collision test — is a straight port. + */ +public final class AntimetalMinecartPhysics { + private static final double SLOPE_ACCEL = 0.0078125D; + private static final double MAX_RAIL_SPEED = 0.4D; + private static final double RAIL_ACCELERATION = 0.06D; + private static final double HITBOX_DROP = 0.4625D; + + private AntimetalMinecartPhysics() { + } + + @Nullable + public static BlockPos findCell(Level level, double x, double y, double z) { + int i = Mth.floor(x); + int j = Mth.floor(y); + int k = Mth.floor(z); + BlockPos direct = new BlockPos(i, j, k); + if (isAntimetalRailAt(level, direct)) { + return direct; + } + BlockPos above = direct.above(); + return isAntimetalRailAt(level, above) ? above : null; + } + + public static boolean isAntimetalRailAt(Level level, BlockPos pos) { + return AbstractAntimetalRailBlock.isAntimetalRail(level.getBlockState(pos)); + } + + private static boolean isAntimetalRailAt(Level level, int x, int y, int z) { + return isAntimetalRailAt(level, new BlockPos(x, y, z)); + } + + @Nullable + private static Vec3 ascendingPosition(RailShape shape, BlockPos cell, double x, double z) { + double baseY = AntimetalRailHelper.attachY(cell.getY(), 0); + double centerX = cell.getX() + 0.5D; + double centerZ = cell.getZ() + 0.5D; + return switch (shape) { + case ASCENDING_EAST -> { + double t = Mth.clamp(cell.getX() + 1.0D - x, 0.0D, 1.0D); + yield new Vec3(cell.getX() + 1.0D - t, baseY - t, centerZ); + } + case ASCENDING_WEST -> { + double t = Mth.clamp(x - cell.getX(), 0.0D, 1.0D); + yield new Vec3(cell.getX() + t, baseY - t, centerZ); + } + case ASCENDING_NORTH -> { + double t = Mth.clamp(z - cell.getZ(), 0.0D, 1.0D); + yield new Vec3(centerX, baseY - t, cell.getZ() + t); + } + case ASCENDING_SOUTH -> { + double t = Mth.clamp(cell.getZ() + 1.0D - z, 0.0D, 1.0D); + yield new Vec3(centerX, baseY - t, cell.getZ() + 1.0D - t); + } + default -> null; + }; + } + + public static void moveAlongTrack(AbstractMinecart cart, BlockPos railPos, BlockState railState) { + cart.resetFallDistance(); + double x = cart.getX(); + double y = cart.getY(); + double z = cart.getZ(); + Vec3 before = getPos(cart, x, y, z); + double targetY = AntimetalRailHelper.attachY(railPos.getY(), 0); + + boolean poweredOn = false; + boolean unpoweredBraking = false; + if (railState.getBlock() instanceof AntimetalPoweredRailBlock) { + poweredOn = railState.getValue(AntimetalPoweredRailBlock.POWERED); + unpoweredBraking = !poweredOn; + } + + RailShape shape = railState.getValue(((AbstractAntimetalRailBlock) railState.getBlock()).getShapeProperty()); + Vec3 motion = cart.getDeltaMovement(); + switch (shape) { + case ASCENDING_EAST -> cart.setDeltaMovement(motion.add(-SLOPE_ACCEL, 0.0D, 0.0D)); + case ASCENDING_WEST -> cart.setDeltaMovement(motion.add(SLOPE_ACCEL, 0.0D, 0.0D)); + case ASCENDING_NORTH -> cart.setDeltaMovement(motion.add(0.0D, 0.0D, SLOPE_ACCEL)); + case ASCENDING_SOUTH -> cart.setDeltaMovement(motion.add(0.0D, 0.0D, -SLOPE_ACCEL)); + default -> { + } + } + + motion = cart.getDeltaMovement(); + Pair exits = AntimetalRailHelper.getExits(shape); + Vec3i exitA = exits.getFirst(); + Vec3i exitB = exits.getSecond(); + double dx = exitB.getX() - exitA.getX(); + double dz = exitB.getZ() - exitA.getZ(); + double dirLength = Math.sqrt(dx * dx + dz * dz); + double alignment = motion.x * dx + motion.z * dz; + if (alignment < 0.0D) { + dx = -dx; + dz = -dz; + } + + double speed = Math.min(2.0D, motion.horizontalDistance()); + motion = new Vec3(speed * dx / dirLength, motion.y, speed * dz / dirLength); + cart.setDeltaMovement(motion); + + Entity firstPassenger = cart.getFirstPassenger(); + if (firstPassenger instanceof Player) { + Vec3 riderMotion = firstPassenger.getDeltaMovement(); + double riderSpeedSq = riderMotion.horizontalDistanceSqr(); + double cartSpeedSq = cart.getDeltaMovement().horizontalDistanceSqr(); + if (riderSpeedSq > 1.0E-4D && cartSpeedSq < 0.01D) { + cart.setDeltaMovement(cart.getDeltaMovement().add(riderMotion.x * 0.1D, 0.0D, riderMotion.z * 0.1D)); + unpoweredBraking = false; + } + } + + if (unpoweredBraking) { + double brakingSpeed = cart.getDeltaMovement().horizontalDistance(); + if (brakingSpeed < 0.03D) { + cart.setDeltaMovement(Vec3.ZERO); + } else { + cart.setDeltaMovement(cart.getDeltaMovement().multiply(0.5D, 0.0D, 0.5D)); + } + } + + Vec3 ascendingPos = shape.isAscending() ? ascendingPosition(shape, railPos, x, z) : null; + if (ascendingPos != null) { + x = ascendingPos.x; + targetY = ascendingPos.y; + z = ascendingPos.z; + } else { + double startX = railPos.getX() + 0.5D + exitA.getX() * 0.5D; + double startZ = railPos.getZ() + 0.5D + exitA.getZ() * 0.5D; + double endX = railPos.getX() + 0.5D + exitB.getX() * 0.5D; + double endZ = railPos.getZ() + 0.5D + exitB.getZ() * 0.5D; + dx = endX - startX; + dz = endZ - startZ; + double s; + if (dx == 0.0D) { + s = z - railPos.getZ(); + } else if (dz == 0.0D) { + s = x - railPos.getX(); + } else { + double px = x - startX; + double pz = z - startZ; + s = (px * dx + pz * dz) * 2.0D; + } + x = startX + dx * s; + z = startZ + dz * s; + } + cart.setPos(x, targetY, z); + cart.setBoundingBox(cart.getBoundingBox().move(0.0D, -HITBOX_DROP, 0.0D)); + + double passengerFactor = cart.isVehicle() ? 0.75D : 1.0D; + motion = cart.getDeltaMovement(); + Vec3 clampedMotion = new Vec3( + Mth.clamp(passengerFactor * motion.x, -MAX_RAIL_SPEED, MAX_RAIL_SPEED), + 0.0D, + Mth.clamp(passengerFactor * motion.z, -MAX_RAIL_SPEED, MAX_RAIL_SPEED) + ); + if (shape.isAscending()) { + cart.setPos(cart.getX() + clampedMotion.x, cart.getY(), cart.getZ() + clampedMotion.z); + } else { + cart.move(MoverType.SELF, clampedMotion); + } + + if (exitA.getY() != 0 && Mth.floor(cart.getX()) - railPos.getX() == exitA.getX() && Mth.floor(cart.getZ()) - railPos.getZ() == exitA.getZ()) { + cart.setPos(cart.getX(), cart.getY() + exitA.getY(), cart.getZ()); + } else if (exitB.getY() != 0 && Mth.floor(cart.getX()) - railPos.getX() == exitB.getX() && Mth.floor(cart.getZ()) - railPos.getZ() == exitB.getZ()) { + cart.setPos(cart.getX(), cart.getY() + exitB.getY(), cart.getZ()); + } + + applyNaturalSlowdown(cart); + + Vec3 after = getPos(cart, cart.getX(), cart.getY(), cart.getZ()); + if (after != null && before != null) { + double slopeDelta = (before.y - after.y) * 0.05D; + Vec3 currentMotion = cart.getDeltaMovement(); + double horizontalSpeed = currentMotion.horizontalDistance(); + if (horizontalSpeed > 0.0D) { + cart.setDeltaMovement(currentMotion.multiply((horizontalSpeed + slopeDelta) / horizontalSpeed, 1.0D, (horizontalSpeed + slopeDelta) / horizontalSpeed)); + } + cart.setPos(cart.getX(), after.y, cart.getZ()); + } + + int cellX = Mth.floor(cart.getX()); + int cellZ = Mth.floor(cart.getZ()); + if (cellX != railPos.getX() || cellZ != railPos.getZ()) { + Vec3 currentMotion = cart.getDeltaMovement(); + double horizontalSpeed = currentMotion.horizontalDistance(); + cart.setDeltaMovement(horizontalSpeed * (cellX - railPos.getX()), currentMotion.y, horizontalSpeed * (cellZ - railPos.getZ())); + } + + cart.setBoundingBox(cart.getBoundingBox().move(0.0D, -HITBOX_DROP, 0.0D)); + + if (poweredOn) { + Vec3 currentMotion = cart.getDeltaMovement(); + double horizontalSpeed = currentMotion.horizontalDistance(); + if (horizontalSpeed > 0.01D) { + cart.setDeltaMovement(currentMotion.add(currentMotion.x / horizontalSpeed * RAIL_ACCELERATION, 0.0D, currentMotion.z / horizontalSpeed * RAIL_ACCELERATION)); + } else if (shape == RailShape.EAST_WEST) { + Vec3 currentMotion2 = cart.getDeltaMovement(); + double nudgeX = currentMotion2.x; + if (isRedstoneConductor(cart.level(), railPos.west())) { + nudgeX = 0.02D; + } else if (isRedstoneConductor(cart.level(), railPos.east())) { + nudgeX = -0.02D; + } + cart.setDeltaMovement(nudgeX, currentMotion2.y, currentMotion2.z); + } else if (shape == RailShape.NORTH_SOUTH) { + Vec3 currentMotion2 = cart.getDeltaMovement(); + double nudgeZ = currentMotion2.z; + if (isRedstoneConductor(cart.level(), railPos.north())) { + nudgeZ = 0.02D; + } else if (isRedstoneConductor(cart.level(), railPos.south())) { + nudgeZ = -0.02D; + } + cart.setDeltaMovement(currentMotion2.x, currentMotion2.y, nudgeZ); + } + } + + if (railState.getBlock() instanceof AntimetalActivatorRailBlock && railState.getValue(AntimetalActivatorRailBlock.POWERED)) { + cart.activateMinecart(railPos.getX(), railPos.getY(), railPos.getZ(), true); + } + } + + private static boolean isRedstoneConductor(Level level, BlockPos pos) { + return level.getBlockState(pos).isRedstoneConductor(level, pos); + } + + private static void applyNaturalSlowdown(AbstractMinecart cart) { + double drag = cart.isVehicle() ? 0.997D : 0.96D; + Vec3 motion = cart.getDeltaMovement(); + cart.setDeltaMovement(motion.multiply(drag, 0.0D, drag)); + } + + @Nullable + public static Vec3 getPosOffs(AbstractMinecart cart, double x, double y, double z, double offset) { + BlockPos cell = findCell(cart.level(), x, y, z); + if (cell == null) { + return null; + } + BlockState state = cart.level().getBlockState(cell); + RailShape shape = state.getValue(((AbstractAntimetalRailBlock) state.getBlock()).getShapeProperty()); + double targetY = AntimetalRailHelper.attachY(cell.getY(), 0); + + Pair exits = AntimetalRailHelper.getExits(shape); + Vec3i exitA = exits.getFirst(); + Vec3i exitB = exits.getSecond(); + double dx = exitB.getX() - exitA.getX(); + double dz = exitB.getZ() - exitA.getZ(); + double length = Math.sqrt(dx * dx + dz * dz); + dx /= length; + dz /= length; + x += dx * offset; + z += dz * offset; + if (exitA.getY() != 0 && Mth.floor(x) - cell.getX() == exitA.getX() && Mth.floor(z) - cell.getZ() == exitA.getZ()) { + targetY += exitA.getY(); + } else if (exitB.getY() != 0 && Mth.floor(x) - cell.getX() == exitB.getX() && Mth.floor(z) - cell.getZ() == exitB.getZ()) { + targetY += exitB.getY(); + } + Vec3 result = getPos(cart, x, targetY, z); + if (result != null && (shape == RailShape.ASCENDING_NORTH || shape == RailShape.ASCENDING_SOUTH)) { + double baseY = AntimetalRailHelper.attachY(cell.getY(), 0); + double mirroredY = 2.0D * (baseY - 0.5D) - result.y; + result = new Vec3(result.x, mirroredY, result.z); + } + return result; + } + + @Nullable + public static Vec3 getPos(AbstractMinecart cart, double x, double y, double z) { + BlockPos cell = findCell(cart.level(), x, y, z); + if (cell == null) { + return null; + } + BlockState state = cart.level().getBlockState(cell); + RailShape shape = state.getValue(((AbstractAntimetalRailBlock) state.getBlock()).getShapeProperty()); + + Vec3 ascendingPos = shape.isAscending() ? ascendingPosition(shape, cell, x, z) : null; + if (ascendingPos != null) { + return ascendingPos; + } + + Pair exits = AntimetalRailHelper.getExits(shape); + Vec3i exitA = exits.getFirst(); + Vec3i exitB = exits.getSecond(); + + double startX = cell.getX() + 0.5D + exitA.getX() * 0.5D; + double startY = AntimetalRailHelper.attachY(cell.getY(), 0) + exitA.getY() * 0.5D; + double startZ = cell.getZ() + 0.5D + exitA.getZ() * 0.5D; + double endX = cell.getX() + 0.5D + exitB.getX() * 0.5D; + double endY = AntimetalRailHelper.attachY(cell.getY(), 0) + exitB.getY() * 0.5D; + double endZ = cell.getZ() + 0.5D + exitB.getZ() * 0.5D; + + double dx = endX - startX; + double dy = (endY - startY) * 2.0D; + double dz = endZ - startZ; + double s; + if (dx == 0.0D) { + s = z - cell.getZ(); + } else if (dz == 0.0D) { + s = x - cell.getX(); + } else { + double px = x - startX; + double pz = z - startZ; + s = (px * dx + pz * dz) * 2.0D; + } + + x = startX + dx * s; + y = startY + dy * s; + z = startZ + dz * s; + return new Vec3(x, y, z); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalRailHelper.java b/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalRailHelper.java new file mode 100644 index 00000000..c9425141 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/minecart/AntimetalRailHelper.java @@ -0,0 +1,122 @@ +package com.craisinlord.antarchy.content.minecart; + +import com.craisinlord.antarchy.content.block.AbstractAntimetalRailBlock; +import com.mojang.datafixers.util.Pair; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.Vec3i; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.RailShape; + +import java.util.EnumMap; +import java.util.Map; + +public final class AntimetalRailHelper { + public static final double RAIL_TOP_OFFSET = 0.0625D; + public static final double CART_MODEL_HEIGHT = 0.7D; + public static final double CART_HANG_OFFSET = CART_MODEL_HEIGHT - 0.1875D; + public static final double CART_MODEL_PIVOT_Y = CART_MODEL_HEIGHT / 2.0D; + + private static final Map> ANTIMETAL_EXITS = new EnumMap<>(RailShape.class); + + static { + ANTIMETAL_EXITS.put(RailShape.NORTH_SOUTH, Pair.of(new Vec3i(0, 0, -1), new Vec3i(0, 0, 1))); + ANTIMETAL_EXITS.put(RailShape.EAST_WEST, Pair.of(new Vec3i(-1, 0, 0), new Vec3i(1, 0, 0))); + ANTIMETAL_EXITS.put(RailShape.ASCENDING_EAST, Pair.of(new Vec3i(-1, -1, 0), new Vec3i(1, 0, 0))); + ANTIMETAL_EXITS.put(RailShape.ASCENDING_WEST, Pair.of(new Vec3i(-1, 0, 0), new Vec3i(1, -1, 0))); + ANTIMETAL_EXITS.put(RailShape.ASCENDING_NORTH, Pair.of(new Vec3i(0, 0, -1), new Vec3i(0, -1, 1))); + ANTIMETAL_EXITS.put(RailShape.ASCENDING_SOUTH, Pair.of(new Vec3i(0, -1, -1), new Vec3i(0, 0, 1))); + ANTIMETAL_EXITS.put(RailShape.SOUTH_EAST, Pair.of(new Vec3i(0, 0, 1), new Vec3i(1, 0, 0))); + ANTIMETAL_EXITS.put(RailShape.SOUTH_WEST, Pair.of(new Vec3i(0, 0, 1), new Vec3i(-1, 0, 0))); + ANTIMETAL_EXITS.put(RailShape.NORTH_WEST, Pair.of(new Vec3i(0, 0, -1), new Vec3i(-1, 0, 0))); + ANTIMETAL_EXITS.put(RailShape.NORTH_EAST, Pair.of(new Vec3i(0, 0, -1), new Vec3i(1, 0, 0))); + } + + private AntimetalRailHelper() { + } + + public static Pair getExits(RailShape shape) { + return ANTIMETAL_EXITS.get(shape); + } + + public static double attachY(int railY, int exitDy) { + return railY + exitDy + 1.0D - RAIL_TOP_OFFSET - CART_HANG_OFFSET; + } + + private static boolean isRail(LevelReader level, BlockPos pos) { + return AbstractAntimetalRailBlock.isAntimetalRail(level.getBlockState(pos)); + } + + private static RailShape computeShape(AbstractAntimetalRailBlock block, LevelReader level, BlockPos pos, Direction.Axis fallbackAxis) { + boolean northDown = isRail(level, pos.north().below()); + boolean southDown = isRail(level, pos.south().below()); + boolean eastDown = isRail(level, pos.east().below()); + boolean westDown = isRail(level, pos.west().below()); + + boolean north = isRail(level, pos.north()) || isRail(level, pos.north().above()) || northDown; + boolean south = isRail(level, pos.south()) || isRail(level, pos.south().above()) || southDown; + boolean east = isRail(level, pos.east()) || isRail(level, pos.east().above()) || eastDown; + boolean west = isRail(level, pos.west()) || isRail(level, pos.west().above()) || westDown; + + if (block.isStraight()) { + if (northDown) return RailShape.ASCENDING_SOUTH; + if (southDown) return RailShape.ASCENDING_NORTH; + if (eastDown) return RailShape.ASCENDING_WEST; + if (westDown) return RailShape.ASCENDING_EAST; + if ((east || west) && !(north || south)) return RailShape.EAST_WEST; + if ((north || south) && !(east || west)) return RailShape.NORTH_SOUTH; + return fallbackAxis == Direction.Axis.X ? RailShape.EAST_WEST : RailShape.NORTH_SOUTH; + } + + if (northDown) return RailShape.ASCENDING_SOUTH; + if (southDown) return RailShape.ASCENDING_NORTH; + if (eastDown) return RailShape.ASCENDING_WEST; + if (westDown) return RailShape.ASCENDING_EAST; + + if (south && east && !north && !west) return RailShape.SOUTH_EAST; + if (south && west && !north && !east) return RailShape.SOUTH_WEST; + if (north && west && !south && !east) return RailShape.NORTH_WEST; + if (north && east && !south && !west) return RailShape.NORTH_EAST; + + if ((east || west) && !(north || south)) return RailShape.EAST_WEST; + if ((north || south) && !(east || west)) return RailShape.NORTH_SOUTH; + return fallbackAxis == Direction.Axis.X ? RailShape.EAST_WEST : RailShape.NORTH_SOUTH; + } + + public static BlockState getStateForPlacement(AbstractAntimetalRailBlock block, BlockPlaceContext context) { + Direction.Axis axis = context.getHorizontalDirection().getAxis(); + RailShape shape = computeShape(block, context.getLevel(), context.getClickedPos(), axis); + return block.defaultBlockState().setValue(block.getShapeProperty(), shape); + } + + public static void updateConnections(AbstractAntimetalRailBlock block, BlockState state, LevelAccessor level, BlockPos pos) { + if (!(level instanceof Level realLevel) || realLevel.isClientSide()) { + return; + } + RailShape shape = computeShape(block, realLevel, pos, Direction.Axis.Z); + if (state.getValue(block.getShapeProperty()) != shape) { + realLevel.setBlock(pos, state.setValue(block.getShapeProperty(), shape), 3); + } + for (Direction direction : Direction.Plane.HORIZONTAL) { + BlockPos horizontalPos = pos.relative(direction); + recomputeIfRail(realLevel, horizontalPos); + recomputeIfRail(realLevel, horizontalPos.above()); + recomputeIfRail(realLevel, horizontalPos.below()); + } + } + + private static void recomputeIfRail(Level level, BlockPos pos) { + BlockState state = level.getBlockState(pos); + if (state.getBlock() instanceof AbstractAntimetalRailBlock block) { + RailShape shape = computeShape(block, level, pos, Direction.Axis.Z); + if (state.getValue(block.getShapeProperty()) != shape) { + level.setBlock(pos, state.setValue(block.getShapeProperty(), shape), 3); + } + } + } + +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/worldgen/cavaryn/CavarynBileCystFeature.java b/common/src/main/java/com/craisinlord/antarchy/content/worldgen/cavaryn/CavarynBileCystFeature.java index 43ed184a..542406f7 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/worldgen/cavaryn/CavarynBileCystFeature.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/worldgen/cavaryn/CavarynBileCystFeature.java @@ -60,7 +60,7 @@ public final class CavarynBileCystFeature extends Feature if (!level.getBlockState(mutable).canBeReplaced()) { continue; } + if (AntarchyFluidChecks.hasBileNearby(level, mutable, 1)) { + continue; + } BlockPos abovePos = mutable.above(); BlockState aboveState = level.getBlockState(abovePos); if (!aboveState.isFaceSturdy(level, abovePos, net.minecraft.core.Direction.DOWN)) { @@ -83,6 +87,9 @@ public final class MoltingVinesFeature extends Feature if (!existing.canBeReplaced()) { break; } + if (AntarchyFluidChecks.hasBileNearby(level, mutable, 1)) { + break; + } length++; mutable.move(0, -1, 0); } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/worldgen/elythia/PeachTreeFeature.java b/common/src/main/java/com/craisinlord/antarchy/content/worldgen/elythia/PeachTreeFeature.java index 35bf2e73..7ff6430b 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/worldgen/elythia/PeachTreeFeature.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/worldgen/elythia/PeachTreeFeature.java @@ -349,7 +349,7 @@ public class PeachTreeFeature extends Feature { while (!queue.isEmpty()) { BlockPos current = queue.removeFirst(); int currentDistance = distances.getOrDefault(current, 0); - if (currentDistance >= 6) { + if (currentDistance >= PeachLeavesBlock.PEACH_MAX_DISTANCE) { continue; } @@ -373,14 +373,14 @@ public class PeachTreeFeature extends Feature { continue; } - IntegerProperty property = state.getBlock() instanceof PeachLeavesBlock ? LeavesBlock.DISTANCE : null; + IntegerProperty property = state.getBlock() instanceof PeachLeavesBlock ? PeachLeavesBlock.PEACH_DISTANCE : null; if (property == null) { continue; } - int distance = Math.min(6, distances.getOrDefault(pos, 6)); + int distance = Math.min(PeachLeavesBlock.PEACH_DECAY_DISTANCE, distances.getOrDefault(pos, PeachLeavesBlock.PEACH_DECAY_DISTANCE)); if (state.getValue(property) != distance) { - setBlock(level, pos, state.setValue(property, distance)); + setBlock(level, pos, PeachLeavesBlock.setPeachDistanceForWorldgen(state, distance)); } } } diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/AbstractMinecartMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/AbstractMinecartMixin.java new file mode 100644 index 00000000..bab95d5c --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/AbstractMinecartMixin.java @@ -0,0 +1,153 @@ +package com.craisinlord.antarchy.mixins; + +import com.craisinlord.antarchy.content.AntarchyObjects; +import com.craisinlord.antarchy.content.minecart.AntimetalDismountHelper; +import com.craisinlord.antarchy.content.minecart.AntimetalMinecartAccess; +import com.craisinlord.antarchy.content.minecart.AntimetalMinecartPhysics; +import com.craisinlord.antarchy.content.minecart.AntimetalRailHelper; +import net.minecraft.core.BlockPos; +import net.minecraft.network.syncher.EntityDataAccessor; +import net.minecraft.network.syncher.EntityDataSerializers; +import net.minecraft.network.syncher.SynchedEntityData; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityDimensions; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.vehicle.AbstractMinecart; +import net.minecraft.world.level.block.BaseRailBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(AbstractMinecart.class) +public abstract class AbstractMinecartMixin implements AntimetalMinecartAccess { + @Unique + private static final EntityDataAccessor ANTARCHY$ON_ANTIMETAL_RAIL = + SynchedEntityData.defineId(AbstractMinecart.class, EntityDataSerializers.BOOLEAN); + private static final int ANTARCHY$INVERTED_REFRESH_TICKS = 20; + + @Unique + private boolean antarchy$antimetalActive; + @Unique + @Nullable + private BlockPos antarchy$antimetalRailPos; + @Unique + @Nullable + private BlockState antarchy$antimetalRailState; + + @Shadow + protected abstract void moveAlongTrack(BlockPos pos, BlockState state); + + @Inject(method = "defineSynchedData", at = @At("TAIL")) + private void antarchy$defineData(SynchedEntityData.Builder builder, CallbackInfo ci) { + builder.define(ANTARCHY$ON_ANTIMETAL_RAIL, false); + } + + @Inject(method = "tick", at = @At("HEAD")) + private void antarchy$findAntimetalRail(CallbackInfo ci) { + AbstractMinecart self = (AbstractMinecart) (Object) this; + if (self.level().isClientSide()) { + return; + } + BlockPos cell = AntimetalMinecartPhysics.findCell(self.level(), self.getX(), self.getY(), self.getZ()); + antarchy$antimetalActive = cell != null; + antarchy$antimetalRailPos = cell; + antarchy$antimetalRailState = cell != null ? self.level().getBlockState(cell) : null; + self.getEntityData().set(ANTARCHY$ON_ANTIMETAL_RAIL, antarchy$antimetalActive); + if (antarchy$antimetalActive) { + antarchy$applyInvertedGravity(self); + } + } + + @Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/BaseRailBlock;isRail(Lnet/minecraft/world/level/block/state/BlockState;)Z")) + private boolean antarchy$redirectIsRail(BlockState state) { + if (antarchy$antimetalActive) { + return true; + } + return BaseRailBlock.isRail(state); + } + + @Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/vehicle/AbstractMinecart;moveAlongTrack(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;)V")) + private void antarchy$redirectMoveAlongTrack(AbstractMinecart self, BlockPos pos, BlockState state) { + if (antarchy$antimetalActive && antarchy$antimetalRailPos != null && antarchy$antimetalRailState != null) { + AntimetalMinecartPhysics.moveAlongTrack(self, antarchy$antimetalRailPos, antarchy$antimetalRailState); + } else { + this.moveAlongTrack(pos, state); + } + } + + @Unique + private void antarchy$applyInvertedGravity(AbstractMinecart cart) { + for (Entity passenger : cart.getIndirectPassengers()) { + if (!(passenger instanceof LivingEntity living)) { + continue; + } + MobEffectInstance current = living.getEffect(AntarchyObjects.INVERTED_EFFECT.get()); + if (current == null || current.getDuration() < 10) { + living.addEffect(new MobEffectInstance(AntarchyObjects.INVERTED_EFFECT.get(), ANTARCHY$INVERTED_REFRESH_TICKS, 0, true, false, false)); + } + } + } + + @Inject(method = "getPassengerAttachmentPoint", at = @At("RETURN"), cancellable = true) + private void antarchy$mirrorPassengerAttachment(Entity passenger, EntityDimensions dimensions, float partialTick, CallbackInfoReturnable cir) { + if (this.antarchy$isOnAntimetalRail()) { + Vec3 original = cir.getReturnValue(); + double mirroredY = 2.0D * AntimetalRailHelper.CART_MODEL_PIVOT_Y - original.y + 1.0D; + cir.setReturnValue(new Vec3(original.x, mirroredY, original.z)); + } + } + + @Inject(method = "getDismountLocationForPassenger", at = @At("HEAD"), cancellable = true) + private void antarchy$dismountBelowRail(LivingEntity passenger, CallbackInfoReturnable cir) { + if (this.antarchy$isOnAntimetalRail()) { + AbstractMinecart self = (AbstractMinecart) (Object) this; + cir.setReturnValue(AntimetalDismountHelper.findDismountPosition(self, passenger)); + } + } + + @Inject(method = "getPosOffs", at = @At("HEAD"), cancellable = true) + private void antarchy$sampleAntimetalPosOffs(double x, double y, double z, double offset, CallbackInfoReturnable cir) { + AbstractMinecart self = (AbstractMinecart) (Object) this; + if (this.antarchy$isOnAntimetalRail()) { + cir.setReturnValue(AntimetalMinecartPhysics.getPosOffs(self, x, y, z, offset)); + } + } + + @Inject(method = "getPos", at = @At("HEAD"), cancellable = true) + private void antarchy$sampleAntimetalPos(double x, double y, double z, CallbackInfoReturnable cir) { + AbstractMinecart self = (AbstractMinecart) (Object) this; + if (this.antarchy$isOnAntimetalRail()) { + cir.setReturnValue(AntimetalMinecartPhysics.getPos(self, x, y, z)); + } + } + + @Override + public boolean antarchy$isOnAntimetalRail() { + return ((AbstractMinecart) (Object) this).getEntityData().get(ANTARCHY$ON_ANTIMETAL_RAIL); + } + + @Override + public void antarchy$setOnAntimetalRail(boolean value) { + ((AbstractMinecart) (Object) this).getEntityData().set(ANTARCHY$ON_ANTIMETAL_RAIL, value); + } + + @Override + @Nullable + public BlockPos antarchy$getAntimetalRailPos() { + return antarchy$antimetalRailPos; + } + + @Override + public void antarchy$setAntimetalRailPos(@Nullable BlockPos pos) { + antarchy$antimetalRailPos = pos; + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/DiodeBlockMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/DiodeBlockMixin.java new file mode 100644 index 00000000..eb15a305 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/DiodeBlockMixin.java @@ -0,0 +1,20 @@ +package com.craisinlord.antarchy.mixins; + +import com.craisinlord.antarchy.content.block.BluestoneComparatorBlock; +import com.craisinlord.antarchy.content.block.BluestoneRepeaterBlock; +import net.minecraft.world.level.block.DiodeBlock; +import net.minecraft.world.level.block.state.BlockState; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(DiodeBlock.class) +public class DiodeBlockMixin { + @Inject(method = "isDiode", at = @At("HEAD"), cancellable = true) + private static void antarchy$ignoreBluestoneDiodes(BlockState state, CallbackInfoReturnable cir) { + if (state.getBlock() instanceof BluestoneRepeaterBlock || state.getBlock() instanceof BluestoneComparatorBlock) { + cir.setReturnValue(false); + } + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/MinecartItemMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/MinecartItemMixin.java new file mode 100644 index 00000000..92d7de7b --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/MinecartItemMixin.java @@ -0,0 +1,58 @@ +package com.craisinlord.antarchy.mixins; + +import com.craisinlord.antarchy.content.block.AbstractAntimetalRailBlock; +import com.craisinlord.antarchy.content.minecart.AntimetalRailHelper; +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.entity.vehicle.AbstractMinecart; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.MinecartItem; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.gameevent.GameEvent; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(MinecartItem.class) +public abstract class MinecartItemMixin { + @Shadow + @Final + AbstractMinecart.Type type; + + @Inject(method = "useOn", at = @At("HEAD"), cancellable = true) + private void antarchy$placeOnAntimetalRail(UseOnContext context, CallbackInfoReturnable cir) { + Level level = context.getLevel(); + BlockPos pos = context.getClickedPos(); + BlockState state = level.getBlockState(pos); + if (!(state.getBlock() instanceof AbstractAntimetalRailBlock)) { + return; + } + if (level.isClientSide()) { + cir.setReturnValue(InteractionResult.SUCCESS); + return; + } + ServerLevel serverLevel = (ServerLevel) level; + double x = pos.getX() + 0.5D; + double y = AntimetalRailHelper.attachY(pos.getY(), 0); + double z = pos.getZ() + 0.5D; + ItemStack stack = context.getItemInHand(); + Player player = context.getPlayer(); + + AbstractMinecart cart = AbstractMinecart.createMinecart(serverLevel, x, y, z, this.type, stack, player); + if (cart != null) { + serverLevel.addFreshEntity(cart); + serverLevel.gameEvent(GameEvent.ENTITY_PLACE, pos, GameEvent.Context.of(player)); + if (player == null || !player.getAbilities().instabuild) { + stack.shrink(1); + } + } + cir.setReturnValue(InteractionResult.sidedSuccess(level.isClientSide())); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/RedStoneWireBlockMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/RedStoneWireBlockMixin.java index 7ccd14ac..e93cc98c 100644 --- a/common/src/main/java/com/craisinlord/antarchy/mixins/RedStoneWireBlockMixin.java +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/RedStoneWireBlockMixin.java @@ -1,9 +1,18 @@ package com.craisinlord.antarchy.mixins; import com.craisinlord.antarchy.content.AntarchyTags; +import com.craisinlord.antarchy.content.block.BluestoneBlock; +import com.craisinlord.antarchy.content.block.BluestoneComparatorBlock; +import com.craisinlord.antarchy.content.block.BluestoneRepeaterBlock; +import com.craisinlord.antarchy.content.block.BluestoneTorchBlock; +import com.craisinlord.antarchy.content.block.BluestoneWireBlock; +import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; import net.minecraft.world.level.block.RedStoneWireBlock; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.RedstoneSide; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -13,15 +22,77 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; public class RedStoneWireBlockMixin { @Inject(method = "shouldConnectTo(Lnet/minecraft/world/level/block/state/BlockState;)Z", at = @At("HEAD"), cancellable = true) private static void antarchy$rejectBluestone(BlockState state, CallbackInfoReturnable cir) { - if (state.is(AntarchyTags.Blocks.BLUESTONE_COMPONENTS)) { + if (antarchy$isBluestoneBlock(state)) { cir.setReturnValue(false); } } @Inject(method = "shouldConnectTo(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/core/Direction;)Z", at = @At("HEAD"), cancellable = true) private static void antarchy$rejectBluestone(BlockState state, Direction direction, CallbackInfoReturnable cir) { - if (state.is(AntarchyTags.Blocks.BLUESTONE_COMPONENTS)) { + if (antarchy$isBluestoneBlock(state)) { cir.setReturnValue(false); } } + + @Inject(method = "getConnectingSide", at = @At("HEAD"), cancellable = true) + private void antarchy$blockBluestoneSide(BlockGetter level, BlockPos pos, Direction direction, CallbackInfoReturnable cir) { + BlockPos sidePos = pos.relative(direction); + if (antarchy$isBluestoneConnection(level, sidePos)) { + cir.setReturnValue(RedstoneSide.NONE); + } + } + + @Inject(method = "calculateTargetStrength", at = @At("HEAD"), cancellable = true) + private void antarchy$ignoreBluestonePower(Level level, BlockPos pos, CallbackInfoReturnable cir) { + cir.setReturnValue(this.antarchy$getReceivedRedstonePower(level, pos)); + } + + private int antarchy$getReceivedRedstonePower(Level level, BlockPos pos) { + int signal = 0; + for (Direction direction : Direction.values()) { + BlockPos sidePos = pos.relative(direction); + BlockState sideState = level.getBlockState(sidePos); + signal = Math.max(signal, this.antarchy$getSignalFromState(level, sidePos, sideState, direction)); + if (signal >= 15) { + return 15; + } + BlockPos abovePos = sidePos.above(); + BlockPos belowPos = sidePos.below(); + BlockState aboveState = level.getBlockState(abovePos); + BlockState belowState = level.getBlockState(belowPos); + if (sideState.isRedstoneConductor(level, sidePos)) { + if (!aboveState.isRedstoneConductor(level, abovePos)) { + signal = Math.max(signal, this.antarchy$getSignalFromState(level, abovePos, aboveState, direction)); + } + } else { + signal = Math.max(signal, this.antarchy$getSignalFromState(level, belowPos, belowState, direction)); + } + if (signal >= 15) { + return 15; + } + } + return signal; + } + + private int antarchy$getSignalFromState(Level level, BlockPos pos, BlockState state, Direction direction) { + if (antarchy$isBluestoneBlock(state)) { + return 0; + } + return state.getSignal(level, pos, direction); + } + + private static boolean antarchy$isBluestoneBlock(BlockState state) { + return state.is(AntarchyTags.Blocks.BLUESTONE_COMPONENTS) + || state.getBlock() instanceof BluestoneWireBlock + || state.getBlock() instanceof BluestoneRepeaterBlock + || state.getBlock() instanceof BluestoneComparatorBlock + || state.getBlock() instanceof BluestoneTorchBlock + || state.getBlock() instanceof BluestoneBlock; + } + + private static boolean antarchy$isBluestoneConnection(BlockGetter level, BlockPos pos) { + return antarchy$isBluestoneBlock(level.getBlockState(pos)) + || antarchy$isBluestoneBlock(level.getBlockState(pos.above())) + || antarchy$isBluestoneBlock(level.getBlockState(pos.below())); + } } diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/client/AbstractMinecartRendererMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/client/AbstractMinecartRendererMixin.java new file mode 100644 index 00000000..16777d5a --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/client/AbstractMinecartRendererMixin.java @@ -0,0 +1,37 @@ +package com.craisinlord.antarchy.mixins.client; + +import com.craisinlord.antarchy.content.minecart.AntimetalMinecartAccess; +import com.craisinlord.antarchy.content.minecart.AntimetalRailHelper; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.math.Axis; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.entity.MinecartRenderer; +import net.minecraft.world.entity.vehicle.AbstractMinecart; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(MinecartRenderer.class) +public abstract class AbstractMinecartRendererMixin { + private static final double ANTARCHY$FLIP_PIVOT_Y = AntimetalRailHelper.CART_MODEL_PIVOT_Y; + private static final double ANTARCHY$MODEL_DROP = 0.1875D; + + @Inject(method = "render(Lnet/minecraft/world/entity/vehicle/AbstractMinecart;FFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", at = @At("HEAD")) + private void antarchy$flipHead(T entity, float yaw, float partialTick, PoseStack poseStack, MultiBufferSource buffer, int packedLight, CallbackInfo ci) { + if (entity instanceof AntimetalMinecartAccess access && access.antarchy$isOnAntimetalRail()) { + poseStack.pushPose(); + poseStack.translate(0.0D, -ANTARCHY$MODEL_DROP, 0.0D); + poseStack.translate(0.0D, ANTARCHY$FLIP_PIVOT_Y, 0.0D); + poseStack.mulPose(Axis.ZP.rotationDegrees(180.0F)); + poseStack.translate(0.0D, -ANTARCHY$FLIP_PIVOT_Y, 0.0D); + } + } + + @Inject(method = "render(Lnet/minecraft/world/entity/vehicle/AbstractMinecart;FFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", at = @At("TAIL")) + private void antarchy$flipTail(T entity, float yaw, float partialTick, PoseStack poseStack, MultiBufferSource buffer, int packedLight, CallbackInfo ci) { + if (entity instanceof AntimetalMinecartAccess access && access.antarchy$isOnAntimetalRail()) { + poseStack.popPose(); + } + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/client/EntityLightProbeMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/client/EntityLightProbeMixin.java new file mode 100644 index 00000000..9665f87d --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/client/EntityLightProbeMixin.java @@ -0,0 +1,22 @@ +package com.craisinlord.antarchy.mixins.client; + +import com.craisinlord.antarchy.content.minecart.AntimetalMinecartAccess; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.phys.Vec3; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(Entity.class) +public abstract class EntityLightProbeMixin { + @Inject(method = "getLightProbePosition", at = @At("RETURN"), cancellable = true) + private void antarchy$mirrorLightProbe(float partialTick, CallbackInfoReturnable cir) { + if ((Object) this instanceof AntimetalMinecartAccess access && access.antarchy$isOnAntimetalRail()) { + Entity self = (Entity) (Object) this; + Vec3 original = cir.getReturnValue(); + double mirroredY = original.y - 2.0D * self.getEyeHeight(); + cir.setReturnValue(new Vec3(original.x, mirroredY, original.z)); + } + } +} diff --git a/common/src/main/resources/antarchy-common.mixins.json b/common/src/main/resources/antarchy-common.mixins.json index 48ec149d..dd76a4bb 100644 --- a/common/src/main/resources/antarchy-common.mixins.json +++ b/common/src/main/resources/antarchy-common.mixins.json @@ -4,6 +4,7 @@ "plugin": "com.craisinlord.antarchy.mixins.AntarchyMixinPlugin", "compatibilityLevel": "JAVA_21", "mixins": [ + "AbstractMinecartMixin", "AccessorRangedAttribute", "AmericanFoodConsumeMixin", "AmericanFoodNameMixin", @@ -12,6 +13,7 @@ "DreamFireBlockMixin", "DreamSandFallingSpeedMixin", "DreamSandLowGravityMixin", + "DiodeBlockMixin", "FarChunkSetBlockWarningMixin", "FireVisualBaseFireBlockMixin", "FireVisualEntityMixin", @@ -22,6 +24,7 @@ "GlowVinesUnderLeavesMixin", "MantisClawWallClimbMixin", "MilkBucketSizeResetMixin", + "MinecartItemMixin", "GoopedStepSoundMixin", "ExperimentalSettingsLevelSummaryMixin", "NightmareSwordDamageMixin", @@ -65,6 +68,8 @@ "multipart.EntityMultipartLifecycleMixin" ], "client": [ + "client.AbstractMinecartRendererMixin", + "client.EntityLightProbeMixin", "client.CustomBossBarMixin", "client.CavarynSkyMixin", "client.CavarynHordeFogMixin", diff --git a/common/src/main/resources/assets/antarchy/blockstates/antimetal_activator_rail.json b/common/src/main/resources/assets/antarchy/blockstates/antimetal_activator_rail.json new file mode 100644 index 00000000..48622177 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/blockstates/antimetal_activator_rail.json @@ -0,0 +1,46 @@ +{ + "variants": { + "shape=north_south,powered=false": { + "model": "antarchy:block/antimetal_activator_rail" + }, + "shape=east_west,powered=false": { + "model": "antarchy:block/antimetal_activator_rail", + "y": 90 + }, + "shape=ascending_north,powered=false": { + "model": "antarchy:block/antimetal_activator_rail_raised_ne" + }, + "shape=ascending_east,powered=false": { + "model": "antarchy:block/antimetal_activator_rail_raised_ne", + "y": 90 + }, + "shape=ascending_south,powered=false": { + "model": "antarchy:block/antimetal_activator_rail_raised_sw" + }, + "shape=ascending_west,powered=false": { + "model": "antarchy:block/antimetal_activator_rail_raised_sw", + "y": 90 + }, + "shape=north_south,powered=true": { + "model": "antarchy:block/antimetal_activator_rail_on" + }, + "shape=east_west,powered=true": { + "model": "antarchy:block/antimetal_activator_rail_on", + "y": 90 + }, + "shape=ascending_north,powered=true": { + "model": "antarchy:block/antimetal_activator_rail_raised_on_ne" + }, + "shape=ascending_east,powered=true": { + "model": "antarchy:block/antimetal_activator_rail_raised_on_ne", + "y": 90 + }, + "shape=ascending_south,powered=true": { + "model": "antarchy:block/antimetal_activator_rail_raised_on_sw" + }, + "shape=ascending_west,powered=true": { + "model": "antarchy:block/antimetal_activator_rail_raised_on_sw", + "y": 90 + } + } +} diff --git a/common/src/main/resources/assets/antarchy/blockstates/antimetal_detector_rail.json b/common/src/main/resources/assets/antarchy/blockstates/antimetal_detector_rail.json new file mode 100644 index 00000000..06aad0d4 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/blockstates/antimetal_detector_rail.json @@ -0,0 +1,46 @@ +{ + "variants": { + "shape=north_south,powered=false": { + "model": "antarchy:block/antimetal_detector_rail" + }, + "shape=east_west,powered=false": { + "model": "antarchy:block/antimetal_detector_rail", + "y": 90 + }, + "shape=ascending_north,powered=false": { + "model": "antarchy:block/antimetal_detector_rail_raised_ne" + }, + "shape=ascending_east,powered=false": { + "model": "antarchy:block/antimetal_detector_rail_raised_ne", + "y": 90 + }, + "shape=ascending_south,powered=false": { + "model": "antarchy:block/antimetal_detector_rail_raised_sw" + }, + "shape=ascending_west,powered=false": { + "model": "antarchy:block/antimetal_detector_rail_raised_sw", + "y": 90 + }, + "shape=north_south,powered=true": { + "model": "antarchy:block/antimetal_detector_rail_on" + }, + "shape=east_west,powered=true": { + "model": "antarchy:block/antimetal_detector_rail_on", + "y": 90 + }, + "shape=ascending_north,powered=true": { + "model": "antarchy:block/antimetal_detector_rail_raised_on_ne" + }, + "shape=ascending_east,powered=true": { + "model": "antarchy:block/antimetal_detector_rail_raised_on_ne", + "y": 90 + }, + "shape=ascending_south,powered=true": { + "model": "antarchy:block/antimetal_detector_rail_raised_on_sw" + }, + "shape=ascending_west,powered=true": { + "model": "antarchy:block/antimetal_detector_rail_raised_on_sw", + "y": 90 + } + } +} diff --git a/common/src/main/resources/assets/antarchy/blockstates/antimetal_powered_rail.json b/common/src/main/resources/assets/antarchy/blockstates/antimetal_powered_rail.json new file mode 100644 index 00000000..c8151c28 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/blockstates/antimetal_powered_rail.json @@ -0,0 +1,46 @@ +{ + "variants": { + "shape=north_south,powered=false": { + "model": "antarchy:block/antimetal_powered_rail" + }, + "shape=east_west,powered=false": { + "model": "antarchy:block/antimetal_powered_rail", + "y": 90 + }, + "shape=ascending_north,powered=false": { + "model": "antarchy:block/antimetal_powered_rail_raised_ne" + }, + "shape=ascending_east,powered=false": { + "model": "antarchy:block/antimetal_powered_rail_raised_ne", + "y": 90 + }, + "shape=ascending_south,powered=false": { + "model": "antarchy:block/antimetal_powered_rail_raised_sw" + }, + "shape=ascending_west,powered=false": { + "model": "antarchy:block/antimetal_powered_rail_raised_sw", + "y": 90 + }, + "shape=north_south,powered=true": { + "model": "antarchy:block/antimetal_powered_rail_on" + }, + "shape=east_west,powered=true": { + "model": "antarchy:block/antimetal_powered_rail_on", + "y": 90 + }, + "shape=ascending_north,powered=true": { + "model": "antarchy:block/antimetal_powered_rail_raised_on_ne" + }, + "shape=ascending_east,powered=true": { + "model": "antarchy:block/antimetal_powered_rail_raised_on_ne", + "y": 90 + }, + "shape=ascending_south,powered=true": { + "model": "antarchy:block/antimetal_powered_rail_raised_on_sw" + }, + "shape=ascending_west,powered=true": { + "model": "antarchy:block/antimetal_powered_rail_raised_on_sw", + "y": 90 + } + } +} diff --git a/common/src/main/resources/assets/antarchy/blockstates/antimetal_rail.json b/common/src/main/resources/assets/antarchy/blockstates/antimetal_rail.json new file mode 100644 index 00000000..5f8e8940 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/blockstates/antimetal_rail.json @@ -0,0 +1,40 @@ +{ + "variants": { + "shape=north_south": { + "model": "antarchy:block/antimetal_rail" + }, + "shape=east_west": { + "model": "antarchy:block/antimetal_rail", + "y": 90 + }, + "shape=ascending_north": { + "model": "antarchy:block/antimetal_rail_raised_ne" + }, + "shape=ascending_east": { + "model": "antarchy:block/antimetal_rail_raised_ne", + "y": 90 + }, + "shape=ascending_south": { + "model": "antarchy:block/antimetal_rail_raised_sw" + }, + "shape=ascending_west": { + "model": "antarchy:block/antimetal_rail_raised_sw", + "y": 90 + }, + "shape=south_east": { + "model": "antarchy:block/antimetal_rail_corner" + }, + "shape=south_west": { + "model": "antarchy:block/antimetal_rail_corner", + "y": 90 + }, + "shape=north_west": { + "model": "antarchy:block/antimetal_rail_corner", + "y": 180 + }, + "shape=north_east": { + "model": "antarchy:block/antimetal_rail_corner", + "y": 270 + } + } +} diff --git a/common/src/main/resources/assets/antarchy/blockstates/bluestone_repeater.json b/common/src/main/resources/assets/antarchy/blockstates/bluestone_repeater.json index 9a62138f..095d2a9a 100644 --- a/common/src/main/resources/assets/antarchy/blockstates/bluestone_repeater.json +++ b/common/src/main/resources/assets/antarchy/blockstates/bluestone_repeater.json @@ -2,6 +2,7 @@ "multipart": [ { "when": { + "delay": "1", "facing": "north", "powered": "false" }, @@ -11,6 +12,7 @@ }, { "when": { + "delay": "1", "facing": "east", "powered": "false" }, @@ -21,6 +23,7 @@ }, { "when": { + "delay": "1", "facing": "south", "powered": "false" }, @@ -31,6 +34,7 @@ }, { "when": { + "delay": "1", "facing": "west", "powered": "false" }, @@ -41,6 +45,7 @@ }, { "when": { + "delay": "1", "facing": "north", "powered": "true" }, @@ -50,6 +55,7 @@ }, { "when": { + "delay": "1", "facing": "east", "powered": "true" }, @@ -60,6 +66,7 @@ }, { "when": { + "delay": "1", "facing": "south", "powered": "true" }, @@ -70,6 +77,7 @@ }, { "when": { + "delay": "1", "facing": "west", "powered": "true" }, @@ -77,6 +85,303 @@ "model": "antarchy:block/bluestone_repeater_on", "y": 270 } + }, + { + "when": { + "delay": "2", + "facing": "north", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay2" + } + }, + { + "when": { + "delay": "2", + "facing": "east", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay2", + "y": 90 + } + }, + { + "when": { + "delay": "2", + "facing": "south", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay2", + "y": 180 + } + }, + { + "when": { + "delay": "2", + "facing": "west", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay2", + "y": 270 + } + }, + { + "when": { + "delay": "2", + "facing": "north", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay2_on" + } + }, + { + "when": { + "delay": "2", + "facing": "east", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay2_on", + "y": 90 + } + }, + { + "when": { + "delay": "2", + "facing": "south", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay2_on", + "y": 180 + } + }, + { + "when": { + "delay": "2", + "facing": "west", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay2_on", + "y": 270 + } + }, + { + "when": { + "delay": "3", + "facing": "north", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay3" + } + }, + { + "when": { + "delay": "3", + "facing": "east", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay3", + "y": 90 + } + }, + { + "when": { + "delay": "3", + "facing": "south", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay3", + "y": 180 + } + }, + { + "when": { + "delay": "3", + "facing": "west", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay3", + "y": 270 + } + }, + { + "when": { + "delay": "3", + "facing": "north", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay3_on" + } + }, + { + "when": { + "delay": "3", + "facing": "east", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay3_on", + "y": 90 + } + }, + { + "when": { + "delay": "3", + "facing": "south", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay3_on", + "y": 180 + } + }, + { + "when": { + "delay": "3", + "facing": "west", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay3_on", + "y": 270 + } + }, + { + "when": { + "delay": "4", + "facing": "north", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay4" + } + }, + { + "when": { + "delay": "4", + "facing": "east", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay4", + "y": 90 + } + }, + { + "when": { + "delay": "4", + "facing": "south", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay4", + "y": 180 + } + }, + { + "when": { + "delay": "4", + "facing": "west", + "powered": "false" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay4", + "y": 270 + } + }, + { + "when": { + "delay": "4", + "facing": "north", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay4_on" + } + }, + { + "when": { + "delay": "4", + "facing": "east", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay4_on", + "y": 90 + } + }, + { + "when": { + "delay": "4", + "facing": "south", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay4_on", + "y": 180 + } + }, + { + "when": { + "delay": "4", + "facing": "west", + "powered": "true" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_delay4_on", + "y": 270 + } + }, + { + "when": { + "locked": "true", + "facing": "north" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_lock" + } + }, + { + "when": { + "locked": "true", + "facing": "east" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_lock", + "y": 90 + } + }, + { + "when": { + "locked": "true", + "facing": "south" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_lock", + "y": 180 + } + }, + { + "when": { + "locked": "true", + "facing": "west" + }, + "apply": { + "model": "antarchy:block/bluestone_repeater_lock", + "y": 270 + } } ] } diff --git a/common/src/main/resources/assets/antarchy/blockstates/bluestone_torch.json b/common/src/main/resources/assets/antarchy/blockstates/bluestone_torch.json index 97d8ea11..cd7dafb9 100644 --- a/common/src/main/resources/assets/antarchy/blockstates/bluestone_torch.json +++ b/common/src/main/resources/assets/antarchy/blockstates/bluestone_torch.json @@ -1,10 +1,84 @@ { "variants": { - "lit=false": { + "face=ceiling,facing=north,lit=false": { "model": "antarchy:block/bluestone_torch_off" }, - "lit=true": { + "face=ceiling,facing=east,lit=false": { + "model": "antarchy:block/bluestone_torch_off" + }, + "face=ceiling,facing=south,lit=false": { + "model": "antarchy:block/bluestone_torch_off" + }, + "face=ceiling,facing=west,lit=false": { + "model": "antarchy:block/bluestone_torch_off" + }, + "face=floor,facing=north,lit=false": { + "model": "antarchy:block/bluestone_torch_off" + }, + "face=floor,facing=east,lit=false": { + "model": "antarchy:block/bluestone_torch_off" + }, + "face=floor,facing=south,lit=false": { + "model": "antarchy:block/bluestone_torch_off" + }, + "face=floor,facing=west,lit=false": { + "model": "antarchy:block/bluestone_torch_off" + }, + "face=ceiling,facing=north,lit=true": { "model": "antarchy:block/bluestone_torch" + }, + "face=ceiling,facing=east,lit=true": { + "model": "antarchy:block/bluestone_torch" + }, + "face=ceiling,facing=south,lit=true": { + "model": "antarchy:block/bluestone_torch" + }, + "face=ceiling,facing=west,lit=true": { + "model": "antarchy:block/bluestone_torch" + }, + "face=floor,facing=north,lit=true": { + "model": "antarchy:block/bluestone_torch" + }, + "face=floor,facing=east,lit=true": { + "model": "antarchy:block/bluestone_torch" + }, + "face=floor,facing=south,lit=true": { + "model": "antarchy:block/bluestone_torch" + }, + "face=floor,facing=west,lit=true": { + "model": "antarchy:block/bluestone_torch" + }, + "face=wall,facing=north,lit=false": { + "model": "antarchy:block/bluestone_wall_torch_off", + "y": 270 + }, + "face=wall,facing=east,lit=false": { + "model": "antarchy:block/bluestone_wall_torch_off", + "y": 0 + }, + "face=wall,facing=south,lit=false": { + "model": "antarchy:block/bluestone_wall_torch_off", + "y": 90 + }, + "face=wall,facing=west,lit=false": { + "model": "antarchy:block/bluestone_wall_torch_off", + "y": 180 + }, + "face=wall,facing=north,lit=true": { + "model": "antarchy:block/bluestone_wall_torch", + "y": 270 + }, + "face=wall,facing=east,lit=true": { + "model": "antarchy:block/bluestone_wall_torch", + "y": 0 + }, + "face=wall,facing=south,lit=true": { + "model": "antarchy:block/bluestone_wall_torch", + "y": 90 + }, + "face=wall,facing=west,lit=true": { + "model": "antarchy:block/bluestone_wall_torch", + "y": 180 } } } diff --git a/common/src/main/resources/assets/antarchy/blockstates/bluestone_wire.json b/common/src/main/resources/assets/antarchy/blockstates/bluestone_wire.json index ada417f6..0430f950 100644 --- a/common/src/main/resources/assets/antarchy/blockstates/bluestone_wire.json +++ b/common/src/main/resources/assets/antarchy/blockstates/bluestone_wire.json @@ -4,6 +4,32 @@ "apply": { "model": "antarchy:block/bluestone_wire_dot", "x": 180 + }, + "when": { + "OR": [ + { + "east": "none", + "north": "none", + "south": "none", + "west": "none" + }, + { + "east": "side|down", + "north": "side|down" + }, + { + "east": "side|down", + "south": "side|down" + }, + { + "south": "side|down", + "west": "side|down" + }, + { + "north": "side|down", + "west": "side|down" + } + ] } }, { @@ -11,17 +37,9 @@ "north": "side|down" }, "apply": { - "model": "antarchy:block/bluestone_wire_line0", - "x": 180 - } - }, - { - "when": { - "east": "side|down" - }, - "apply": { - "model": "antarchy:block/bluestone_wire_line1", - "x": 180 + "model": "antarchy:block/bluestone_wire_side0", + "x": 180, + "y": 180 } }, { @@ -29,20 +47,70 @@ "south": "side|down" }, "apply": { - "model": "antarchy:block/bluestone_wire_line0", + "model": "antarchy:block/bluestone_wire_side_alt0", "x": 180, "y": 180 } }, + { + "when": { + "east": "side|down" + }, + "apply": { + "model": "antarchy:block/bluestone_wire_side_alt1", + "x": 180, + "y": 90 + } + }, { "when": { "west": "side|down" }, "apply": { - "model": "antarchy:block/bluestone_wire_line1", + "model": "antarchy:block/bluestone_wire_side1", + "x": 180, + "y": 90 + } + }, + { + "when": { + "north": "down" + }, + "apply": { + "model": "antarchy:block/bluestone_wire_down", "x": 180, "y": 180 } + }, + { + "when": { + "east": "down" + }, + "apply": { + "model": "antarchy:block/bluestone_wire_down", + "x": 180, + "y": 90 + } + }, + { + "when": { + "south": "down" + }, + "apply": { + "model": "antarchy:block/bluestone_wire_down", + "x": 180, + "y": 0 + } + }, + { + "when": { + "west": "down" + }, + "apply": { + "model": "antarchy:block/bluestone_wire_down", + "x": 180, + "y": 270 + } } ] } diff --git a/common/src/main/resources/assets/antarchy/blockstates/polished_nyxite_button.json b/common/src/main/resources/assets/antarchy/blockstates/polished_nyxite_button.json new file mode 100644 index 00000000..7821fbc3 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/blockstates/polished_nyxite_button.json @@ -0,0 +1,118 @@ +{ + "variants": { + "face=ceiling,facing=east,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "x": 180, + "y": 270 + }, + "face=ceiling,facing=east,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "x": 180, + "y": 270 + }, + "face=ceiling,facing=north,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "x": 180, + "y": 180 + }, + "face=ceiling,facing=north,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "x": 180, + "y": 180 + }, + "face=ceiling,facing=south,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "x": 180 + }, + "face=ceiling,facing=south,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "x": 180 + }, + "face=ceiling,facing=west,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "x": 180, + "y": 90 + }, + "face=ceiling,facing=west,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "x": 180, + "y": 90 + }, + "face=floor,facing=east,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "y": 90 + }, + "face=floor,facing=east,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "y": 90 + }, + "face=floor,facing=north,powered=false": { + "model": "antarchy:block/polished_nyxite_button" + }, + "face=floor,facing=north,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed" + }, + "face=floor,facing=south,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "y": 180 + }, + "face=floor,facing=south,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "y": 180 + }, + "face=floor,facing=west,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "y": 270 + }, + "face=floor,facing=west,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "y": 270 + }, + "face=wall,facing=east,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "uvlock": true, + "x": 90, + "y": 90 + }, + "face=wall,facing=east,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "uvlock": true, + "x": 90, + "y": 90 + }, + "face=wall,facing=north,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "uvlock": true, + "x": 90 + }, + "face=wall,facing=north,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "uvlock": true, + "x": 90 + }, + "face=wall,facing=south,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "uvlock": true, + "x": 90, + "y": 180 + }, + "face=wall,facing=south,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "uvlock": true, + "x": 90, + "y": 180 + }, + "face=wall,facing=west,powered=false": { + "model": "antarchy:block/polished_nyxite_button", + "uvlock": true, + "x": 90, + "y": 270 + }, + "face=wall,facing=west,powered=true": { + "model": "antarchy:block/polished_nyxite_button_pressed", + "uvlock": true, + "x": 90, + "y": 270 + } + } +} diff --git a/common/src/main/resources/assets/antarchy/blockstates/polished_nyxite_pressure_plate.json b/common/src/main/resources/assets/antarchy/blockstates/polished_nyxite_pressure_plate.json new file mode 100644 index 00000000..c27f4f6e --- /dev/null +++ b/common/src/main/resources/assets/antarchy/blockstates/polished_nyxite_pressure_plate.json @@ -0,0 +1,18 @@ +{ + "variants": { + "ceiling=false,powered=false": { + "model": "antarchy:block/polished_nyxite_pressure_plate" + }, + "ceiling=false,powered=true": { + "model": "antarchy:block/polished_nyxite_pressure_plate_down" + }, + "ceiling=true,powered=false": { + "model": "antarchy:block/polished_nyxite_pressure_plate", + "x": 180 + }, + "ceiling=true,powered=true": { + "model": "antarchy:block/polished_nyxite_pressure_plate_down", + "x": 180 + } + } +} diff --git a/common/src/main/resources/assets/antarchy/items/bluestone_wire.json b/common/src/main/resources/assets/antarchy/items/bluestone_wire.json new file mode 100644 index 00000000..1d8c4ff9 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/items/bluestone_wire.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "antarchy:item/bluestone_wire" + } +} diff --git a/common/src/main/resources/assets/antarchy/lang/en_us.json b/common/src/main/resources/assets/antarchy/lang/en_us.json index 7ef2c1c5..4979a68c 100644 --- a/common/src/main/resources/assets/antarchy/lang/en_us.json +++ b/common/src/main/resources/assets/antarchy/lang/en_us.json @@ -84,6 +84,8 @@ "block.antarchy.polished_nyxite_stairs": "Polished Nyxite Stairs", "block.antarchy.polished_nyxite_slab": "Polished Nyxite Slab", "block.antarchy.polished_nyxite_wall": "Polished Nyxite Wall", + "block.antarchy.polished_nyxite_pressure_plate": "Polished Nyxite Pressure Plate", + "block.antarchy.polished_nyxite_button": "Polished Nyxite Button", "block.antarchy.nyxite_brick_stairs": "Nyxite Brick Stairs", "block.antarchy.nyxite_brick_slab": "Nyxite Brick Slab", "block.antarchy.nyxite_brick_wall": "Nyxite Brick Wall", @@ -97,6 +99,10 @@ "block.antarchy.antimetal": "Antimetal", "block.antarchy.polished_antimetal": "Polished Antimetal", "block.antarchy.antimetal_scaffolding": "Antimetal Scaffolding", + "block.antarchy.antimetal_rail": "Antimetal Rail", + "block.antarchy.antimetal_powered_rail": "Antimetal Powered Rail", + "block.antarchy.antimetal_detector_rail": "Antimetal Detector Rail", + "block.antarchy.antimetal_activator_rail": "Antimetal Activator Rail", "block.antarchy.cornea_stalk": "Cornea Stalk", "block.antarchy.corn_crop": "Corn Crop", "block.antarchy.dream_torch": "Dream Torch", @@ -158,6 +164,7 @@ "block.antarchy.titanium_bars": "Titanium Bars", "tooltip.antarchy.signal_saving_bulb": "Toggles on/off. Has light level equal to the signal strength stored on it.", "tooltip.antarchy.bluestone_placement": "Places below blocks", + "tooltip.antarchy.ceiling_compatible_placement": "Can also be placed on ceilings", "block.antarchy.bile": "Bile", "block.antarchy.ichor": "Ichor", "block.antarchy.antiwater": "Antiwater", @@ -308,6 +315,10 @@ "item.antarchy.antimetal": "Antimetal", "item.antarchy.polished_antimetal": "Polished Antimetal", "item.antarchy.antimetal_scaffolding": "Antimetal Scaffolding", + "item.antarchy.antimetal_rail": "Antimetal Rail", + "item.antarchy.antimetal_powered_rail": "Antimetal Powered Rail", + "item.antarchy.antimetal_detector_rail": "Antimetal Detector Rail", + "item.antarchy.antimetal_activator_rail": "Antimetal Activator Rail", "item.antarchy.ouranwood_acorn": "Ouranwood Acorn", "item.antarchy.ouranwood_boat": "Ouranwood Boat", "item.antarchy.ouranwood_chest_boat": "Ouranwood Chest Boat", @@ -869,6 +880,7 @@ "biome.antarchy.cloud_sea": "Cloud Sea", "block.antarchy.wild_corn": "Wild Corn", "trim_material.antarchy.blood_crystal": "Blood Crystal", + "trim_material.antarchy.bluestone": "Bluestone", "trim_material.antarchy.nightmare_scale": "Nightmare Scale", "trim_material.antarchy.uranium": "Uranium", "trim_material.antarchy.titanium": "Titanium", diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail.json new file mode 100644 index 00000000..0b3ae3eb --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_flat", + "textures": { "rail": "antarchy:block/antimetal/antimetal_activator_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_on.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_on.json new file mode 100644 index 00000000..14ed2a27 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_on.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_flat", + "textures": { "rail": "antarchy:block/antimetal/antimetal_activator_rail_on" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_ne.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_ne.json new file mode 100644 index 00000000..41a63aa3 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_ne.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_ne", + "textures": { "rail": "antarchy:block/antimetal/antimetal_activator_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_on_ne.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_on_ne.json new file mode 100644 index 00000000..b6b31600 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_on_ne.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_ne", + "textures": { "rail": "antarchy:block/antimetal/antimetal_activator_rail_on" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_on_sw.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_on_sw.json new file mode 100644 index 00000000..9419659d --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_on_sw.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_sw", + "textures": { "rail": "antarchy:block/antimetal/antimetal_activator_rail_on" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_sw.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_sw.json new file mode 100644 index 00000000..4daaed2b --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_activator_rail_raised_sw.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_sw", + "textures": { "rail": "antarchy:block/antimetal/antimetal_activator_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail.json new file mode 100644 index 00000000..73393e7c --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_flat", + "textures": { "rail": "antarchy:block/antimetal/antimetal_detector_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_on.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_on.json new file mode 100644 index 00000000..e47007cb --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_on.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_flat", + "textures": { "rail": "antarchy:block/antimetal/antimetal_detector_rail_on" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_ne.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_ne.json new file mode 100644 index 00000000..ed7bf60f --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_ne.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_ne", + "textures": { "rail": "antarchy:block/antimetal/antimetal_detector_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_on_ne.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_on_ne.json new file mode 100644 index 00000000..cb9ab264 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_on_ne.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_ne", + "textures": { "rail": "antarchy:block/antimetal/antimetal_detector_rail_on" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_on_sw.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_on_sw.json new file mode 100644 index 00000000..afd368ee --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_on_sw.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_sw", + "textures": { "rail": "antarchy:block/antimetal/antimetal_detector_rail_on" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_sw.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_sw.json new file mode 100644 index 00000000..af312c74 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_detector_rail_raised_sw.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_sw", + "textures": { "rail": "antarchy:block/antimetal/antimetal_detector_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail.json new file mode 100644 index 00000000..7d26b6bc --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_flat", + "textures": { "rail": "antarchy:block/antimetal/antimetal_powered_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_on.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_on.json new file mode 100644 index 00000000..9d77a757 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_on.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_flat", + "textures": { "rail": "antarchy:block/antimetal/antimetal_powered_rail_on" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_ne.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_ne.json new file mode 100644 index 00000000..b76892c7 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_ne.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_ne", + "textures": { "rail": "antarchy:block/antimetal/antimetal_powered_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_on_ne.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_on_ne.json new file mode 100644 index 00000000..8205e196 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_on_ne.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_ne", + "textures": { "rail": "antarchy:block/antimetal/antimetal_powered_rail_on" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_on_sw.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_on_sw.json new file mode 100644 index 00000000..b0689b05 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_on_sw.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_sw", + "textures": { "rail": "antarchy:block/antimetal/antimetal_powered_rail_on" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_sw.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_sw.json new file mode 100644 index 00000000..c44a445c --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_powered_rail_raised_sw.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_sw", + "textures": { "rail": "antarchy:block/antimetal/antimetal_powered_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_rail.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_rail.json new file mode 100644 index 00000000..bd327e43 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_rail.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_flat", + "textures": { "rail": "antarchy:block/antimetal/antimetal_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_rail_corner.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_rail_corner.json new file mode 100644 index 00000000..80c6492e --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_rail_corner.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_flat", + "textures": { "rail": "antarchy:block/antimetal/antimetal_rail_corner" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_rail_raised_ne.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_rail_raised_ne.json new file mode 100644 index 00000000..9597f5e2 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_rail_raised_ne.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_ne", + "textures": { "rail": "antarchy:block/antimetal/antimetal_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/antimetal_rail_raised_sw.json b/common/src/main/resources/assets/antarchy/models/block/antimetal_rail_raised_sw.json new file mode 100644 index 00000000..60baa47a --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/antimetal_rail_raised_sw.json @@ -0,0 +1,4 @@ +{ + "parent": "antarchy:block/template_antimetal_rail_raised_sw", + "textures": { "rail": "antarchy:block/antimetal/antimetal_rail" } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator.json index 1ba59573..4a6da2b0 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator.json @@ -21,36 +21,36 @@ } }, { - "from": [4, 9, 11], - "to": [6, 14, 13], + "from": [4, 9, 2], + "to": [6, 14, 4], "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, - "north": { "uv": [7, 6, 9, 11], "texture": "#unlit" }, - "south": { "uv": [7, 6, 9, 11], "texture": "#unlit" }, - "west": { "uv": [7, 6, 9, 11], "texture": "#unlit" }, - "east": { "uv": [7, 6, 9, 11], "texture": "#unlit" } + "north": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#unlit" } } }, { - "from": [10, 9, 11], - "to": [12, 14, 13], + "from": [10, 9, 2], + "to": [12, 14, 4], "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, - "north": { "uv": [7, 6, 9, 11], "texture": "#unlit" }, - "south": { "uv": [7, 6, 9, 11], "texture": "#unlit" }, - "west": { "uv": [7, 6, 9, 11], "texture": "#unlit" }, - "east": { "uv": [7, 6, 9, 11], "texture": "#unlit" } + "north": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#unlit" } } }, { - "from": [7, 11, 2], - "to": [9, 14, 4], + "from": [7, 11, 11], + "to": [9, 14, 13], "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, - "north": { "uv": [7, 6, 9, 9], "texture": "#unlit" }, - "south": { "uv": [7, 6, 9, 9], "texture": "#unlit" }, - "west": { "uv": [7, 6, 9, 9], "texture": "#unlit" }, - "east": { "uv": [7, 6, 9, 9], "texture": "#unlit" } + "north": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#unlit" } } } ] diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_on.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_on.json index 16282ddc..fc3dc84a 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_on.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_on.json @@ -21,39 +21,39 @@ } }, { - "from": [4, 9, 11], - "to": [6, 14, 13], + "from": [4, 9, 2], + "to": [6, 14, 4], "shade": false, "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, - "north": { "uv": [7, 6, 9, 11], "texture": "#lit" }, - "south": { "uv": [7, 6, 9, 11], "texture": "#lit" }, - "west": { "uv": [7, 6, 9, 11], "texture": "#lit" }, - "east": { "uv": [7, 6, 9, 11], "texture": "#lit" } + "north": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#lit" } } }, { - "from": [10, 9, 11], - "to": [12, 14, 13], + "from": [10, 9, 2], + "to": [12, 14, 4], "shade": false, "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, - "north": { "uv": [7, 6, 9, 11], "texture": "#lit" }, - "south": { "uv": [7, 6, 9, 11], "texture": "#lit" }, - "west": { "uv": [7, 6, 9, 11], "texture": "#lit" }, - "east": { "uv": [7, 6, 9, 11], "texture": "#lit" } + "north": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#lit" } } }, { - "from": [7, 11, 2], - "to": [9, 14, 4], + "from": [7, 11, 11], + "to": [9, 14, 13], "shade": false, "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, - "north": { "uv": [7, 6, 9, 9], "texture": "#unlit" }, - "south": { "uv": [7, 6, 9, 9], "texture": "#unlit" }, - "west": { "uv": [7, 6, 9, 9], "texture": "#unlit" }, - "east": { "uv": [7, 6, 9, 9], "texture": "#unlit" } + "north": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#unlit" } } } ] diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_subtract.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_subtract.json index 5336ab38..a96b7b91 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_subtract.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_subtract.json @@ -1,3 +1,58 @@ { - "parent": "antarchy:block/bluestone_comparator" + "ambientocclusion": false, + "textures": { + "particle": "antarchy:block/bluestone/bluestone_comparator", + "slab": "minecraft:block/smooth_stone", + "top": "antarchy:block/bluestone/bluestone_comparator", + "unlit": "antarchy:block/bluestone/bluestone_torch_off", + "lit": "antarchy:block/bluestone/bluestone_torch" + }, + "elements": [ + { + "from": [0, 14, 0], + "to": [16, 16, 16], + "faces": { + "down": { "uv": [0, 0, 16, 16], "texture": "#top", "cullface": "down" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#slab", "cullface": "up" }, + "north": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "east" } + } + }, + { + "from": [4, 9, 2], + "to": [6, 14, 4], + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, + "north": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#unlit" } + } + }, + { + "from": [10, 9, 2], + "to": [12, 14, 4], + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, + "north": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#unlit" } + } + }, + { + "from": [7, 11, 11], + "to": [9, 14, 13], + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, + "north": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#lit" } + } + } + ] } diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_subtract_on.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_subtract_on.json index b4b434ba..0081c140 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_subtract_on.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_comparator_subtract_on.json @@ -1,3 +1,60 @@ { - "parent": "antarchy:block/bluestone_comparator_on" + "ambientocclusion": false, + "textures": { + "particle": "antarchy:block/bluestone/bluestone_comparator_on", + "slab": "minecraft:block/smooth_stone", + "top": "antarchy:block/bluestone/bluestone_comparator_on", + "unlit": "antarchy:block/bluestone/bluestone_torch_off", + "lit": "antarchy:block/bluestone/bluestone_torch" + }, + "elements": [ + { + "from": [0, 14, 0], + "to": [16, 16, 16], + "faces": { + "down": { "uv": [0, 0, 16, 16], "texture": "#top", "cullface": "down" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#slab", "cullface": "up" }, + "north": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "east" } + } + }, + { + "from": [4, 9, 2], + "to": [6, 14, 4], + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, + "north": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#lit" } + } + }, + { + "from": [10, 9, 2], + "to": [12, 14, 4], + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, + "north": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#lit" } + } + }, + { + "from": [7, 11, 11], + "to": [9, 14, 13], + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, + "north": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#lit" } + } + } + ] } diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater.json index b909f091..96d5017d 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater.json @@ -25,21 +25,21 @@ "to": [9, 14, 13], "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, - "north": { "uv": [7, 6, 9, 11], "texture": "#unlit" }, - "south": { "uv": [7, 6, 9, 11], "texture": "#unlit" }, - "west": { "uv": [7, 6, 9, 11], "texture": "#unlit" }, - "east": { "uv": [7, 6, 9, 11], "texture": "#unlit" } + "north": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#unlit" } } }, { - "from": [7, 11, 4], - "to": [9, 14, 6], + "from": [7, 11, 2], + "to": [9, 14, 4], "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, - "north": { "uv": [7, 6, 9, 9], "texture": "#unlit" }, - "south": { "uv": [7, 6, 9, 9], "texture": "#unlit" }, - "west": { "uv": [7, 6, 9, 9], "texture": "#unlit" }, - "east": { "uv": [7, 6, 9, 9], "texture": "#unlit" } + "north": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#unlit" } } } ] diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay2.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay2.json new file mode 100644 index 00000000..990234b1 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay2.json @@ -0,0 +1,46 @@ +{ + "parent": "antarchy:block/bluestone_repeater", + "textures": { + "particle": "antarchy:block/bluestone/bluestone_repeater", + "slab": "minecraft:block/smooth_stone", + "top": "antarchy:block/bluestone/bluestone_repeater", + "unlit": "antarchy:block/bluestone/bluestone_torch_off", + "lit": "antarchy:block/bluestone/bluestone_torch" + }, + "elements": [ + { + "from": [0, 14, 0], + "to": [16, 16, 16], + "faces": { + "down": { "uv": [0, 0, 16, 16], "texture": "#top", "cullface": "down" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#slab", "cullface": "up" }, + "north": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "east" } + } + }, + { + "from": [7, 9, 11], + "to": [9, 14, 13], + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, + "north": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#unlit" } + } + }, + { + "from": [7, 11, 4], + "to": [9, 14, 6], + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, + "north": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#unlit" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay2_on.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay2_on.json new file mode 100644 index 00000000..524ff5f4 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay2_on.json @@ -0,0 +1,48 @@ +{ + "parent": "antarchy:block/bluestone_repeater_on", + "textures": { + "particle": "antarchy:block/bluestone/bluestone_repeater_on", + "slab": "minecraft:block/smooth_stone", + "top": "antarchy:block/bluestone/bluestone_repeater_on", + "unlit": "antarchy:block/bluestone/bluestone_torch_off", + "lit": "antarchy:block/bluestone/bluestone_torch" + }, + "elements": [ + { + "from": [0, 14, 0], + "to": [16, 16, 16], + "faces": { + "down": { "uv": [0, 0, 16, 16], "texture": "#top", "cullface": "down" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#slab", "cullface": "up" }, + "north": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "east" } + } + }, + { + "from": [7, 9, 11], + "to": [9, 14, 13], + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, + "north": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#lit" } + } + }, + { + "from": [7, 11, 4], + "to": [9, 14, 6], + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, + "north": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#lit" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay3.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay3.json new file mode 100644 index 00000000..06e05079 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay3.json @@ -0,0 +1,46 @@ +{ + "parent": "antarchy:block/bluestone_repeater", + "textures": { + "particle": "antarchy:block/bluestone/bluestone_repeater", + "slab": "minecraft:block/smooth_stone", + "top": "antarchy:block/bluestone/bluestone_repeater", + "unlit": "antarchy:block/bluestone/bluestone_torch_off", + "lit": "antarchy:block/bluestone/bluestone_torch" + }, + "elements": [ + { + "from": [0, 14, 0], + "to": [16, 16, 16], + "faces": { + "down": { "uv": [0, 0, 16, 16], "texture": "#top", "cullface": "down" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#slab", "cullface": "up" }, + "north": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "east" } + } + }, + { + "from": [7, 9, 11], + "to": [9, 14, 13], + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, + "north": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#unlit" } + } + }, + { + "from": [7, 11, 6], + "to": [9, 14, 8], + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, + "north": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#unlit" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay3_on.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay3_on.json new file mode 100644 index 00000000..b5c5b0d0 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay3_on.json @@ -0,0 +1,48 @@ +{ + "parent": "antarchy:block/bluestone_repeater_on", + "textures": { + "particle": "antarchy:block/bluestone/bluestone_repeater_on", + "slab": "minecraft:block/smooth_stone", + "top": "antarchy:block/bluestone/bluestone_repeater_on", + "unlit": "antarchy:block/bluestone/bluestone_torch_off", + "lit": "antarchy:block/bluestone/bluestone_torch" + }, + "elements": [ + { + "from": [0, 14, 0], + "to": [16, 16, 16], + "faces": { + "down": { "uv": [0, 0, 16, 16], "texture": "#top", "cullface": "down" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#slab", "cullface": "up" }, + "north": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "east" } + } + }, + { + "from": [7, 9, 11], + "to": [9, 14, 13], + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, + "north": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#lit" } + } + }, + { + "from": [7, 11, 6], + "to": [9, 14, 8], + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, + "north": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#lit" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay4.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay4.json new file mode 100644 index 00000000..08d043fe --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay4.json @@ -0,0 +1,46 @@ +{ + "parent": "antarchy:block/bluestone_repeater", + "textures": { + "particle": "antarchy:block/bluestone/bluestone_repeater", + "slab": "minecraft:block/smooth_stone", + "top": "antarchy:block/bluestone/bluestone_repeater", + "unlit": "antarchy:block/bluestone/bluestone_torch_off", + "lit": "antarchy:block/bluestone/bluestone_torch" + }, + "elements": [ + { + "from": [0, 14, 0], + "to": [16, 16, 16], + "faces": { + "down": { "uv": [0, 0, 16, 16], "texture": "#top", "cullface": "down" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#slab", "cullface": "up" }, + "north": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "east" } + } + }, + { + "from": [7, 9, 11], + "to": [9, 14, 13], + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, + "north": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#unlit" } + } + }, + { + "from": [7, 11, 8], + "to": [9, 14, 10], + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#unlit" }, + "north": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#unlit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#unlit" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay4_on.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay4_on.json new file mode 100644 index 00000000..0d115718 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_delay4_on.json @@ -0,0 +1,48 @@ +{ + "parent": "antarchy:block/bluestone_repeater_on", + "textures": { + "particle": "antarchy:block/bluestone/bluestone_repeater_on", + "slab": "minecraft:block/smooth_stone", + "top": "antarchy:block/bluestone/bluestone_repeater_on", + "unlit": "antarchy:block/bluestone/bluestone_torch_off", + "lit": "antarchy:block/bluestone/bluestone_torch" + }, + "elements": [ + { + "from": [0, 14, 0], + "to": [16, 16, 16], + "faces": { + "down": { "uv": [0, 0, 16, 16], "texture": "#top", "cullface": "down" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#slab", "cullface": "up" }, + "north": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [0, 14, 16, 16], "texture": "#slab", "cullface": "east" } + } + }, + { + "from": [7, 9, 11], + "to": [9, 14, 13], + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, + "north": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#lit" } + } + }, + { + "from": [7, 11, 8], + "to": [9, 14, 10], + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, + "north": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#lit" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_lock.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_lock.json new file mode 100644 index 00000000..9e16c0b0 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_lock.json @@ -0,0 +1,19 @@ +{ + "ambientocclusion": false, + "textures": { + "lock": "minecraft:block/bedrock" + }, + "elements": [ + { + "from": [2, 12, 6], + "to": [14, 14, 8], + "faces": { + "down": { "uv": [7, 2, 9, 14], "texture": "#lock", "rotation": 90 }, + "north": { "uv": [2, 7, 14, 9], "texture": "#lock" }, + "south": { "uv": [2, 7, 14, 9], "texture": "#lock" }, + "west": { "uv": [6, 7, 8, 9], "texture": "#lock" }, + "east": { "uv": [6, 7, 8, 9], "texture": "#lock" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_on.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_on.json index 516c905b..3679b595 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_on.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_repeater_on.json @@ -26,22 +26,22 @@ "shade": false, "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, - "north": { "uv": [7, 6, 9, 11], "texture": "#lit" }, - "south": { "uv": [7, 6, 9, 11], "texture": "#lit" }, - "west": { "uv": [7, 6, 9, 11], "texture": "#lit" }, - "east": { "uv": [7, 6, 9, 11], "texture": "#lit" } + "north": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 11, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 11, 9, 6], "texture": "#lit" } } }, { - "from": [7, 11, 4], - "to": [9, 14, 6], + "from": [7, 11, 2], + "to": [9, 14, 4], "shade": false, "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#lit" }, - "north": { "uv": [7, 6, 9, 9], "texture": "#lit" }, - "south": { "uv": [7, 6, 9, 9], "texture": "#lit" }, - "west": { "uv": [7, 6, 9, 9], "texture": "#lit" }, - "east": { "uv": [7, 6, 9, 9], "texture": "#lit" } + "north": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "south": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "west": { "uv": [7, 9, 9, 6], "texture": "#lit" }, + "east": { "uv": [7, 9, 9, 6], "texture": "#lit" } } } ] diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_torch.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_torch.json index 5993f56d..59b0ccd8 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_torch.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_torch.json @@ -12,10 +12,10 @@ "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#torch" }, "up": { "uv": [7, 13, 9, 15], "texture": "#torch", "cullface": "up" }, - "north": { "uv": [7, 6, 9, 16], "texture": "#torch" }, - "east": { "uv": [7, 6, 9, 16], "texture": "#torch" }, - "south": { "uv": [7, 6, 9, 16], "texture": "#torch" }, - "west": { "uv": [7, 6, 9, 16], "texture": "#torch" } + "north": { "uv": [7, 16, 9, 6], "texture": "#torch" }, + "east": { "uv": [7, 16, 9, 6], "texture": "#torch" }, + "south": { "uv": [7, 16, 9, 6], "texture": "#torch" }, + "west": { "uv": [7, 16, 9, 6], "texture": "#torch" } } } ] diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_torch_off.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_torch_off.json index c1d49a31..0c13883e 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_torch_off.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_torch_off.json @@ -12,10 +12,10 @@ "faces": { "down": { "uv": [7, 6, 9, 8], "texture": "#torch" }, "up": { "uv": [7, 13, 9, 15], "texture": "#torch", "cullface": "up" }, - "north": { "uv": [7, 6, 9, 16], "texture": "#torch" }, - "east": { "uv": [7, 6, 9, 16], "texture": "#torch" }, - "south": { "uv": [7, 6, 9, 16], "texture": "#torch" }, - "west": { "uv": [7, 6, 9, 16], "texture": "#torch" } + "north": { "uv": [7, 16, 9, 6], "texture": "#torch" }, + "east": { "uv": [7, 16, 9, 6], "texture": "#torch" }, + "south": { "uv": [7, 16, 9, 6], "texture": "#torch" }, + "west": { "uv": [7, 16, 9, 6], "texture": "#torch" } } } ] diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_wall_torch.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_wall_torch.json new file mode 100644 index 00000000..8c42b6fb --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_wall_torch.json @@ -0,0 +1,39 @@ +{ + "ambientocclusion": false, + "textures": { + "torch": "antarchy:block/bluestone/bluestone_torch", + "particle": "antarchy:block/bluestone/bluestone_torch" + }, + "elements": [ + { + "from": [-1, 2.5, 7], + "to": [1, 12.5, 9], + "rotation": { "origin": [0, 12.5, 8], "axis": "z", "angle": 22.5 }, + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#torch" }, + "up": { "uv": [7, 13, 9, 15], "texture": "#torch" } + } + }, + { + "from": [-1, -3.5, 0], + "to": [1, 12.5, 16], + "rotation": { "origin": [0, 12.5, 8], "axis": "z", "angle": 22.5 }, + "shade": false, + "faces": { + "west": { "uv": [0, 16, 16, 0], "texture": "#torch" }, + "east": { "uv": [0, 16, 16, 0], "texture": "#torch" } + } + }, + { + "from": [-8, -3.5, 7], + "to": [8, 12.5, 9], + "rotation": { "origin": [0, 12.5, 8], "axis": "z", "angle": 22.5 }, + "shade": false, + "faces": { + "north": { "uv": [0, 16, 16, 0], "texture": "#torch" }, + "south": { "uv": [0, 16, 16, 0], "texture": "#torch" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_wall_torch_off.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_wall_torch_off.json new file mode 100644 index 00000000..42474e08 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_wall_torch_off.json @@ -0,0 +1,39 @@ +{ + "ambientocclusion": false, + "textures": { + "torch": "antarchy:block/bluestone/bluestone_torch_off", + "particle": "antarchy:block/bluestone/bluestone_torch_off" + }, + "elements": [ + { + "from": [-1, 2.5, 7], + "to": [1, 12.5, 9], + "rotation": { "origin": [0, 12.5, 8], "axis": "z", "angle": 22.5 }, + "shade": false, + "faces": { + "down": { "uv": [7, 6, 9, 8], "texture": "#torch" }, + "up": { "uv": [7, 13, 9, 15], "texture": "#torch" } + } + }, + { + "from": [-1, -3.5, 0], + "to": [1, 12.5, 16], + "rotation": { "origin": [0, 12.5, 8], "axis": "z", "angle": 22.5 }, + "shade": false, + "faces": { + "west": { "uv": [0, 16, 16, 0], "texture": "#torch" }, + "east": { "uv": [0, 16, 16, 0], "texture": "#torch" } + } + }, + { + "from": [-8, -3.5, 7], + "to": [8, 12.5, 9], + "rotation": { "origin": [0, 12.5, 8], "axis": "z", "angle": 22.5 }, + "shade": false, + "faces": { + "north": { "uv": [0, 16, 16, 0], "texture": "#torch" }, + "south": { "uv": [0, 16, 16, 0], "texture": "#torch" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_dot.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_dot.json index 4ffe05af..30ea3070 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_dot.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_dot.json @@ -1,7 +1,7 @@ { "parent": "minecraft:block/redstone_dust_dot", "textures": { - "cross": "antarchy:block/bluestone/bluestone_dust_dot", + "line": "antarchy:block/bluestone/bluestone_dust_dot", "overlay": "antarchy:block/bluestone/bluestone_dust_overlay" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_down.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_down.json new file mode 100644 index 00000000..76ae5a0a --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_down.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/redstone_dust_up", + "textures": { + "line": "antarchy:block/bluestone/bluestone_dust_line0", + "overlay": "antarchy:block/bluestone/bluestone_dust_overlay", + "particle": "antarchy:block/bluestone/bluestone_dust_dot" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_line0.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_line0.json index 363d7a8e..74aaa3c9 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_line0.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_line0.json @@ -1,7 +1,18 @@ { - "parent": "minecraft:block/redstone_dust_line0", + "ambientocclusion": false, "textures": { - "line": "antarchy:block/bluestone/bluestone_dust_line0", - "overlay": "antarchy:block/bluestone/bluestone_dust_overlay" - } + "particle": "antarchy:block/bluestone/bluestone_dust_line0", + "line": "antarchy:block/bluestone/bluestone_dust_line0" + }, + "elements": [ + { + "from": [0, 0, 7.0], + "to": [16, 0, 9.0], + "shade": false, + "faces": { + "up": { "uv": [0, 0, 16, 2], "texture": "#line", "tintindex": 0 }, + "down": { "uv": [0, 0, 16, 2], "texture": "#line", "tintindex": 0 } + } + } + ] } diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_line1.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_line1.json index c74602f4..8a5eabd7 100644 --- a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_line1.json +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_line1.json @@ -1,7 +1,18 @@ { - "parent": "minecraft:block/redstone_dust_line1", + "ambientocclusion": false, "textures": { - "line": "antarchy:block/bluestone/bluestone_dust_line1", - "overlay": "antarchy:block/bluestone/bluestone_dust_overlay" - } + "particle": "antarchy:block/bluestone/bluestone_dust_line1", + "line": "antarchy:block/bluestone/bluestone_dust_line1" + }, + "elements": [ + { + "from": [0, 0, 7.0], + "to": [16, 0, 9.0], + "shade": false, + "faces": { + "up": { "uv": [0, 0, 16, 2], "texture": "#line", "tintindex": 0 }, + "down": { "uv": [0, 0, 16, 2], "texture": "#line", "tintindex": 0 } + } + } + ] } diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side0.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side0.json new file mode 100644 index 00000000..b5504412 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/redstone_dust_side0", + "textures": { + "line": "antarchy:block/bluestone/bluestone_dust_line0" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side1.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side1.json new file mode 100644 index 00000000..93a4be67 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/redstone_dust_side1", + "textures": { + "line": "antarchy:block/bluestone/bluestone_dust_line1" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side_alt0.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side_alt0.json new file mode 100644 index 00000000..80647677 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side_alt0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/redstone_dust_side_alt0", + "textures": { + "line": "antarchy:block/bluestone/bluestone_dust_line0" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side_alt1.json b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side_alt1.json new file mode 100644 index 00000000..10f7eac4 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/bluestone_wire_side_alt1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/redstone_dust_side_alt1", + "textures": { + "line": "antarchy:block/bluestone/bluestone_dust_line1" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button.json b/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button.json new file mode 100644 index 00000000..3e41553c --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/stone_button", + "textures": { + "texture": "antarchy:block/polished_nyxite" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button_inventory.json b/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button_inventory.json new file mode 100644 index 00000000..6adeaaeb --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/stone_button_inventory", + "textures": { + "texture": "antarchy:block/polished_nyxite" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button_pressed.json b/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button_pressed.json new file mode 100644 index 00000000..92ac7b73 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_button_pressed.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/stone_button_pressed", + "textures": { + "texture": "antarchy:block/polished_nyxite" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_pressure_plate.json b/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_pressure_plate.json new file mode 100644 index 00000000..33d98943 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_pressure_plate.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/stone_pressure_plate", + "textures": { + "texture": "antarchy:block/polished_nyxite" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_pressure_plate_down.json b/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_pressure_plate_down.json new file mode 100644 index 00000000..94e787b3 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/polished_nyxite_pressure_plate_down.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/stone_pressure_plate_down", + "textures": { + "texture": "antarchy:block/polished_nyxite" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_flat.json b/common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_flat.json new file mode 100644 index 00000000..67eddae9 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_flat.json @@ -0,0 +1,14 @@ +{ + "ambientocclusion": false, + "textures": { "particle": "#rail" }, + "elements": [ + { + "from": [0, 15, 0], + "to": [16, 15, 16], + "faces": { + "down": { "uv": [0, 16, 16, 0], "texture": "#rail" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#rail" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_raised_ne.json b/common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_raised_ne.json new file mode 100644 index 00000000..a89efaa1 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_raised_ne.json @@ -0,0 +1,20 @@ +{ + "ambientocclusion": false, + "textures": { "particle": "#rail" }, + "elements": [ + { + "from": [0, 7, 0], + "to": [16, 7, 16], + "rotation": { + "origin": [8, 7, 8], + "axis": "x", + "angle": 45, + "rescale": true + }, + "faces": { + "down": { "uv": [0, 16, 16, 0], "texture": "#rail" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#rail" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_raised_sw.json b/common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_raised_sw.json new file mode 100644 index 00000000..4e014807 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/template_antimetal_rail_raised_sw.json @@ -0,0 +1,20 @@ +{ + "ambientocclusion": false, + "textures": { "particle": "#rail" }, + "elements": [ + { + "from": [0, 7, 0], + "to": [16, 7, 16], + "rotation": { + "origin": [8, 7, 8], + "axis": "x", + "angle": -45, + "rescale": true + }, + "faces": { + "down": { "uv": [0, 16, 16, 0], "texture": "#rail" }, + "up": { "uv": [0, 0, 16, 16], "texture": "#rail" } + } + } + ] +} diff --git a/common/src/main/resources/assets/antarchy/models/item/antimetal_activator_rail.json b/common/src/main/resources/assets/antarchy/models/item/antimetal_activator_rail.json new file mode 100644 index 00000000..d8c28f40 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/antimetal_activator_rail.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "antarchy:block/antimetal/antimetal_activator_rail" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/item/antimetal_detector_rail.json b/common/src/main/resources/assets/antarchy/models/item/antimetal_detector_rail.json new file mode 100644 index 00000000..3a168fb7 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/antimetal_detector_rail.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "antarchy:block/antimetal/antimetal_detector_rail" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/item/antimetal_powered_rail.json b/common/src/main/resources/assets/antarchy/models/item/antimetal_powered_rail.json new file mode 100644 index 00000000..7d9d71d7 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/antimetal_powered_rail.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "antarchy:block/antimetal/antimetal_powered_rail" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/item/antimetal_rail.json b/common/src/main/resources/assets/antarchy/models/item/antimetal_rail.json new file mode 100644 index 00000000..eb6f0422 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/antimetal_rail.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "antarchy:block/antimetal/antimetal_rail" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/item/bluestone.json b/common/src/main/resources/assets/antarchy/models/item/bluestone.json new file mode 100644 index 00000000..b4e90930 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/bluestone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "antarchy:item/bluestone" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/item/bluestone_dust.json b/common/src/main/resources/assets/antarchy/models/item/bluestone_dust.json index 4bb6d35c..b4e90930 100644 --- a/common/src/main/resources/assets/antarchy/models/item/bluestone_dust.json +++ b/common/src/main/resources/assets/antarchy/models/item/bluestone_dust.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "antarchy:item/bluestone/bluestone" + "layer0": "antarchy:item/bluestone" } } diff --git a/common/src/main/resources/assets/antarchy/models/item/bluestone_wire.json b/common/src/main/resources/assets/antarchy/models/item/bluestone_wire.json new file mode 100644 index 00000000..f6cd0b71 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/bluestone_wire.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "antarchy:block/bluestone/bluestone_dust_dot" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/item/polished_nyxite_button.json b/common/src/main/resources/assets/antarchy/models/item/polished_nyxite_button.json new file mode 100644 index 00000000..3cdf70da --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/polished_nyxite_button.json @@ -0,0 +1,3 @@ +{ + "parent": "antarchy:block/polished_nyxite_button_inventory" +} diff --git a/common/src/main/resources/assets/antarchy/models/item/polished_nyxite_pressure_plate.json b/common/src/main/resources/assets/antarchy/models/item/polished_nyxite_pressure_plate.json new file mode 100644 index 00000000..c9dbefb5 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/polished_nyxite_pressure_plate.json @@ -0,0 +1,3 @@ +{ + "parent": "antarchy:block/polished_nyxite_pressure_plate" +} diff --git a/common/src/main/resources/assets/antarchy/textures/block/bluestone/bluestone_torch.png b/common/src/main/resources/assets/antarchy/textures/block/bluestone/bluestone_torch.png index 3a2a0df17e8d32a778cdabdb635180bca9720ca9..56371114f451db82f8ad3154364f360a5af66c55 100644 GIT binary patch delta 229 zcmV*0)YaMB!9L^L_t(|0ql@53IZ_@MZXJLge?R+@cGZm|T55SFtuOm>+=H{6G6#{&g!w>#9FNV1J*KzuyQ6UHu4deqb+x za<@?N!!E2KP&$n4=(CheejYHhBld)YZJvo*AG_C7-~tYiWUp5;=_46GJ6*}QVG5c8 zGU+h#BG<`7?p6WhjGEe-6;y{5*H@KqeftHi!oF|}00960cVWcK00006Nkl tintIndex == 0 ? bluestoneWireColor(15) : -1, - AntarchyFabricItems.BLUESTONE_DUST.get() - ); ColorProviderRegistry.ITEM.register((stack, tintIndex) -> FoliageColor.getDefaultColor(), AntarchyFabricItems.OURANWOOD_LEAVES_ITEM.get()); ColorProviderRegistry.ITEM.register( (stack, tintIndex) -> tintIndex == 0 ? net.minecraft.world.level.GrassColor.getDefaultColor() : -1, @@ -288,6 +284,10 @@ public final class AntarchyFabricClientBootstrap { } private static void registerRenderLayers() { + BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.ANTIMETAL_RAIL.get(), RenderType.cutout()); + BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.ANTIMETAL_POWERED_RAIL.get(), RenderType.cutout()); + BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.ANTIMETAL_DETECTOR_RAIL.get(), RenderType.cutout()); + BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.ANTIMETAL_ACTIVATOR_RAIL.get(), RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.OURANWOOD_LEAVES.get(), RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.OURANWOOD_DOOR.get(), RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.OURANWOOD_TRAPDOOR.get(), RenderType.cutout()); @@ -333,6 +333,7 @@ public final class AntarchyFabricClientBootstrap { BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.BLOOD_CRYSTAL_CRYSTAL.get(), RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.DREAM_TORCH.get(), RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.DREAM_WALL_TORCH.get(), RenderType.cutout()); + BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.DREAM_CEILING_TORCH.get(), RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.BLUESTONE_WIRE.get(), RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.BLUESTONE_REPEATER.get(), RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.BLUESTONE_COMPARATOR.get(), RenderType.cutout()); diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricBlocks.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricBlocks.java index 3923017a..a1f4209a 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricBlocks.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricBlocks.java @@ -310,6 +310,11 @@ public final class AntarchyFabricBlocks { public static final DeferredBlock POLISHED_NYXITE_WALL = BLOCKS.register("polished_nyxite_wall", () -> new net.minecraft.world.level.block.WallBlock(nyxiteProperties())); + public static final DeferredBlock POLISHED_NYXITE_PRESSURE_PLATE = BLOCKS.register("polished_nyxite_pressure_plate", + () -> new com.craisinlord.antarchy.content.block.PolishedNyxitePressurePlateBlock(net.minecraft.world.level.block.state.properties.BlockSetType.STONE, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_PRESSURE_PLATE))); + public static final DeferredBlock POLISHED_NYXITE_BUTTON = BLOCKS.register("polished_nyxite_button", + () -> new net.minecraft.world.level.block.ButtonBlock(net.minecraft.world.level.block.state.properties.BlockSetType.STONE, 20, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BUTTON))); + public static final DeferredBlock NYXITE_BRICK_STAIRS = BLOCKS.register("nyxite_brick_stairs", () -> new net.minecraft.world.level.block.StairBlock(NYXITE_BRICKS.get().defaultBlockState(), nyxiteProperties())); @@ -549,8 +554,8 @@ public final class AntarchyFabricBlocks { () -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.NETHERRACK).lightLevel(state -> 2))); - public static final DeferredBlock CREEPVINE = BLOCKS.register("creepvine", - () -> new VineBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.VINE))); + public static final DeferredBlock CREEPVINE = BLOCKS.register("creepvine", + () -> new CreepvineBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.VINE))); public static final DeferredBlock BLUSH_MOSS_BLOCK = BLOCKS.register("blush_moss_block", @@ -819,6 +824,22 @@ public final class AntarchyFabricBlocks { () -> new com.craisinlord.antarchy.content.block.AntimetalScaffoldingBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.SCAFFOLDING))); + public static final DeferredBlock ANTIMETAL_RAIL = BLOCKS.register("antimetal_rail", + () -> new com.craisinlord.antarchy.content.block.AntimetalRailBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.RAIL))); + + + public static final DeferredBlock ANTIMETAL_POWERED_RAIL = BLOCKS.register("antimetal_powered_rail", + () -> new com.craisinlord.antarchy.content.block.AntimetalPoweredRailBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.POWERED_RAIL))); + + + public static final DeferredBlock ANTIMETAL_DETECTOR_RAIL = BLOCKS.register("antimetal_detector_rail", + () -> new com.craisinlord.antarchy.content.block.AntimetalDetectorRailBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.DETECTOR_RAIL))); + + + public static final DeferredBlock ANTIMETAL_ACTIVATOR_RAIL = BLOCKS.register("antimetal_activator_rail", + () -> new com.craisinlord.antarchy.content.block.AntimetalActivatorRailBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.ACTIVATOR_RAIL))); + + public static final DeferredBlock CORNEA_STALK = BLOCKS.register("cornea_stalk", () -> new CorneaStalkBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.SWEET_BERRY_BUSH).randomTicks())); diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricCreativeModeTabs.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricCreativeModeTabs.java index f91c4591..334b7524 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricCreativeModeTabs.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricCreativeModeTabs.java @@ -2,6 +2,7 @@ package com.craisinlord.antarchy.fabric.registry; import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.content.creative.CreativeTabContents; +import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.minecraft.core.registries.Registries; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; @@ -18,9 +19,6 @@ public final class AntarchyFabricCreativeModeTabs { .icon(() -> new ItemStack(AntarchyFabricItems.GRAVITY_GUN.get())) .displayItems((parameters, output) -> populateCreativeTab(output)) .build()); - - - private static void populateCreativeTab(CreativeModeTab.Output output) { CreativeTabContents.populateAntarchyTab(new CreativeTabContents.AntarchyTabOutput() { @Override @@ -38,6 +36,18 @@ public final class AntarchyFabricCreativeModeTabs { public static void register() { CREATIVE_MODE_TABS.register(); + ItemGroupEvents.modifyEntriesEvent(net.minecraft.world.item.CreativeModeTabs.REDSTONE_BLOCKS).register(entries -> { + entries.accept(AntarchyFabricItems.BLUESTONE_DUST.get()); + entries.accept(AntarchyFabricItems.BLUESTONE_BLOCK_ITEM.get()); + entries.accept(AntarchyFabricItems.BLUESTONE_TORCH_ITEM.get()); + entries.accept(AntarchyFabricItems.BLUESTONE_REPEATER_ITEM.get()); + entries.accept(AntarchyFabricItems.BLUESTONE_COMPARATOR_ITEM.get()); + entries.accept(AntarchyFabricItems.BLUESTONE_ORE_ITEM.get()); + entries.accept(AntarchyFabricItems.ANTIMETAL_RAIL_ITEM.get()); + entries.accept(AntarchyFabricItems.ANTIMETAL_POWERED_RAIL_ITEM.get()); + entries.accept(AntarchyFabricItems.ANTIMETAL_DETECTOR_RAIL_ITEM.get()); + entries.accept(AntarchyFabricItems.ANTIMETAL_ACTIVATOR_RAIL_ITEM.get()); + }); } } diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java index b7ad3ee4..412ff378 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java @@ -371,6 +371,16 @@ public final class AntarchyFabricItems { () -> new AntimetalScaffoldingItem(AntarchyFabricBlocks.ANTIMETAL_SCAFFOLDING.get(), new Item.Properties())); + public static final DeferredItem ANTIMETAL_RAIL_ITEM = ITEMS.register("antimetal_rail", + () -> new CeilingPlacementTooltipBlockItem(AntarchyFabricBlocks.ANTIMETAL_RAIL.get(), new Item.Properties())); + public static final DeferredItem ANTIMETAL_POWERED_RAIL_ITEM = ITEMS.register("antimetal_powered_rail", + () -> new CeilingPlacementTooltipBlockItem(AntarchyFabricBlocks.ANTIMETAL_POWERED_RAIL.get(), new Item.Properties())); + public static final DeferredItem ANTIMETAL_DETECTOR_RAIL_ITEM = ITEMS.register("antimetal_detector_rail", + () -> new CeilingPlacementTooltipBlockItem(AntarchyFabricBlocks.ANTIMETAL_DETECTOR_RAIL.get(), new Item.Properties())); + public static final DeferredItem ANTIMETAL_ACTIVATOR_RAIL_ITEM = ITEMS.register("antimetal_activator_rail", + () -> new CeilingPlacementTooltipBlockItem(AntarchyFabricBlocks.ANTIMETAL_ACTIVATOR_RAIL.get(), new Item.Properties())); + + public static final DeferredItem SMALL_BLOOD_CRYSTAL_BUD_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.SMALL_BLOOD_CRYSTAL_BUD); @@ -503,6 +513,9 @@ public final class AntarchyFabricItems { public static final DeferredItem POLISHED_NYXITE_WALL_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.POLISHED_NYXITE_WALL); + public static final DeferredItem POLISHED_NYXITE_PRESSURE_PLATE_ITEM = ITEMS.register("polished_nyxite_pressure_plate", + () -> new com.craisinlord.antarchy.content.item.CeilingCompatiblePlacementTooltipBlockItem(AntarchyFabricBlocks.POLISHED_NYXITE_PRESSURE_PLATE.get(), new Item.Properties())); + public static final DeferredItem POLISHED_NYXITE_BUTTON_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.POLISHED_NYXITE_BUTTON); public static final DeferredItem NYXITE_BRICK_STAIRS_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.NYXITE_BRICK_STAIRS); diff --git a/gradle.properties b/gradle.properties index cfce331e..18851444 100644 --- a/gradle.properties +++ b/gradle.properties @@ -43,7 +43,7 @@ jei_version=19.27.0.336 intapi_curseforge_id = 817709 intapi_curseforge_file_id_neoforge = 7781663 -#intapi_curseforge_file_id_fabric = 5178464 +intapi_curseforge_file_id_fabric = 5178464 intapi_curseforge_file_id_common = 5178461 create_curseforge_id_neoforge = 328085 diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 739602f2..25ef52ce 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -46,6 +46,7 @@ dependencies { // modLocalRuntime("curse.maven:idas-${idas_curseforge_id}:${idas_curseforge_file_id}") compileOnly "mezz.jei:jei-${minecraft_version}-common-api:${jei_version}" compileOnly "mezz.jei:jei-${minecraft_version}-neoforge-api:${jei_version}" + modLocalRuntime "mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}" // modLocalRuntime("curse.maven:create-${create_curseforge_id}:${create_curseforge_file_id}") // modLocalRuntime("curse.maven:theoneprobe-${top_curseforge_id}:${top_curseforge_file_id}") // modLocalRuntime("curse.maven:worldedit-${worldedit_curseforge_id}:${worldedit_curseforge_file_id}") diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java index 3b5df446..9903ee49 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java @@ -240,10 +240,6 @@ public final class AntarchyNeoForgeClient { @SubscribeEvent public static void registerItemColors(RegisterColorHandlersEvent.Item event) { - event.register( - (stack, tintIndex) -> tintIndex == 0 ? bluestoneWireColor(15) : -1, - AntarchyNeoforgeItems.BLUESTONE_DUST.get() - ); event.register( (stack, tintIndex) -> FoliageColor.getDefaultColor(), AntarchyNeoforgeItems.OURANWOOD_LEAVES_ITEM.get() @@ -544,6 +540,10 @@ public final class AntarchyNeoForgeClient { @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { event.enqueueWork(() -> { + ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.ANTIMETAL_RAIL.get(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.ANTIMETAL_POWERED_RAIL.get(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.ANTIMETAL_DETECTOR_RAIL.get(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.ANTIMETAL_ACTIVATOR_RAIL.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.OURANWOOD_LEAVES.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.OURANWOOD_DOOR.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.OURANWOOD_TRAPDOOR.get(), RenderType.cutout()); @@ -587,6 +587,7 @@ public final class AntarchyNeoForgeClient { ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.BLOOD_CRYSTAL_CRYSTAL.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.DREAM_TORCH.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.DREAM_WALL_TORCH.get(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.DREAM_CEILING_TORCH.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.BLUESTONE_WIRE.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.BLUESTONE_REPEATER.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.BLUESTONE_COMPARATOR.get(), RenderType.cutout()); diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeBlocks.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeBlocks.java index 4bb72465..50331dc5 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeBlocks.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeBlocks.java @@ -181,6 +181,10 @@ public final class AntarchyNeoforgeBlocks { () -> new SlabBlock(nyxiteProperties())); public static final DeferredBlock POLISHED_NYXITE_WALL = BLOCKS.register("polished_nyxite_wall", () -> new WallBlock(nyxiteProperties())); + public static final DeferredBlock POLISHED_NYXITE_PRESSURE_PLATE = BLOCKS.register("polished_nyxite_pressure_plate", + () -> new com.craisinlord.antarchy.content.block.PolishedNyxitePressurePlateBlock(BlockSetType.STONE, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_PRESSURE_PLATE))); + public static final DeferredBlock POLISHED_NYXITE_BUTTON = BLOCKS.register("polished_nyxite_button", + () -> new ButtonBlock(BlockSetType.STONE, 20, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BUTTON))); public static final DeferredBlock NYXITE_BRICK_STAIRS = BLOCKS.register("nyxite_brick_stairs", () -> new StairBlock(NYXITE_BRICKS.get().defaultBlockState(), nyxiteProperties())); public static final DeferredBlock NYXITE_BRICK_SLAB = BLOCKS.register("nyxite_brick_slab", @@ -303,8 +307,8 @@ public final class AntarchyNeoforgeBlocks { () -> new GlowLichenBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.GLOW_LICHEN).lightLevel(state -> 4))); public static final DeferredBlock BILE_VEIN = BLOCKS.register("bile_vein", () -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.NETHERRACK).lightLevel(state -> 2))); - public static final DeferredBlock CREEPVINE = BLOCKS.register("creepvine", - () -> new VineBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.VINE))); + public static final DeferredBlock CREEPVINE = BLOCKS.register("creepvine", + () -> new CreepvineBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.VINE))); public static final DeferredBlock BLUSH_MOSS_BLOCK = BLOCKS.register("blush_moss_block", () -> new BlushMossBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_BLOCK))); public static final DeferredBlock BLUSH_MOSS_CARPET = BLOCKS.register("blush_moss_carpet", @@ -450,6 +454,14 @@ public final class AntarchyNeoforgeBlocks { () -> new RotatedPillarBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.POLISHED_BASALT))); public static final DeferredBlock ANTIMETAL_SCAFFOLDING = BLOCKS.register("antimetal_scaffolding", () -> new com.craisinlord.antarchy.content.block.AntimetalScaffoldingBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.SCAFFOLDING))); + public static final DeferredBlock ANTIMETAL_RAIL = BLOCKS.register("antimetal_rail", + () -> new com.craisinlord.antarchy.content.block.AntimetalRailBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.RAIL))); + public static final DeferredBlock ANTIMETAL_POWERED_RAIL = BLOCKS.register("antimetal_powered_rail", + () -> new com.craisinlord.antarchy.content.block.AntimetalPoweredRailBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.POWERED_RAIL))); + public static final DeferredBlock ANTIMETAL_DETECTOR_RAIL = BLOCKS.register("antimetal_detector_rail", + () -> new com.craisinlord.antarchy.content.block.AntimetalDetectorRailBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.DETECTOR_RAIL))); + public static final DeferredBlock ANTIMETAL_ACTIVATOR_RAIL = BLOCKS.register("antimetal_activator_rail", + () -> new com.craisinlord.antarchy.content.block.AntimetalActivatorRailBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.ACTIVATOR_RAIL))); public static final DeferredBlock CORNEA_STALK = BLOCKS.register("cornea_stalk", () -> new CorneaStalkBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.SWEET_BERRY_BUSH).randomTicks())); public static final DeferredBlock GLOWCAP_MUSHROOM = BLOCKS.register("glowcap_mushroom", diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java index 890a3f04..0743d3d0 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java @@ -26,7 +26,6 @@ public class AntarchyNeoforgeCreativeModeTabs { .displayItems((parameters, output) -> {}) .build()); - static void buildCreativeTabs(BuildCreativeModeTabContentsEvent event) { if (event.getTabKey() == ANTARCHY_TAB.getKey()) { CreativeTabContents.populateAntarchyTab(new CreativeTabContents.AntarchyTabOutput() { diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java index f1c12a5a..c92f23bb 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java @@ -279,6 +279,14 @@ public final class AntarchyNeoforgeItems { () -> new AntimetalBlockItem(AntarchyNeoforgeBlocks.POLISHED_ANTIMETAL.get(), new Item.Properties())); public static final DeferredItem ANTIMETAL_SCAFFOLDING_ITEM = ITEMS.register("antimetal_scaffolding", () -> new AntimetalScaffoldingItem(AntarchyNeoforgeBlocks.ANTIMETAL_SCAFFOLDING.get(), new Item.Properties())); + public static final DeferredItem ANTIMETAL_RAIL_ITEM = ITEMS.register("antimetal_rail", + () -> new CeilingPlacementTooltipBlockItem(AntarchyNeoforgeBlocks.ANTIMETAL_RAIL.get(), new Item.Properties())); + public static final DeferredItem ANTIMETAL_POWERED_RAIL_ITEM = ITEMS.register("antimetal_powered_rail", + () -> new CeilingPlacementTooltipBlockItem(AntarchyNeoforgeBlocks.ANTIMETAL_POWERED_RAIL.get(), new Item.Properties())); + public static final DeferredItem ANTIMETAL_DETECTOR_RAIL_ITEM = ITEMS.register("antimetal_detector_rail", + () -> new CeilingPlacementTooltipBlockItem(AntarchyNeoforgeBlocks.ANTIMETAL_DETECTOR_RAIL.get(), new Item.Properties())); + public static final DeferredItem ANTIMETAL_ACTIVATOR_RAIL_ITEM = ITEMS.register("antimetal_activator_rail", + () -> new CeilingPlacementTooltipBlockItem(AntarchyNeoforgeBlocks.ANTIMETAL_ACTIVATOR_RAIL.get(), new Item.Properties())); public static final DeferredItem SMALL_BLOOD_CRYSTAL_BUD_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.SMALL_BLOOD_CRYSTAL_BUD); public static final DeferredItem MEDIUM_BLOOD_CRYSTAL_BUD_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.MEDIUM_BLOOD_CRYSTAL_BUD); public static final DeferredItem LARGE_BLOOD_CRYSTAL_BUD_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.LARGE_BLOOD_CRYSTAL_BUD); @@ -343,6 +351,9 @@ public final class AntarchyNeoforgeItems { public static final DeferredItem POLISHED_NYXITE_STAIRS_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.POLISHED_NYXITE_STAIRS); public static final DeferredItem POLISHED_NYXITE_SLAB_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.POLISHED_NYXITE_SLAB); public static final DeferredItem POLISHED_NYXITE_WALL_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.POLISHED_NYXITE_WALL); + public static final DeferredItem POLISHED_NYXITE_PRESSURE_PLATE_ITEM = ITEMS.register("polished_nyxite_pressure_plate", + () -> new CeilingCompatiblePlacementTooltipBlockItem(AntarchyNeoforgeBlocks.POLISHED_NYXITE_PRESSURE_PLATE.get(), new Item.Properties())); + public static final DeferredItem POLISHED_NYXITE_BUTTON_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.POLISHED_NYXITE_BUTTON); public static final DeferredItem NYXITE_BRICK_STAIRS_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.NYXITE_BRICK_STAIRS); public static final DeferredItem NYXITE_BRICK_SLAB_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.NYXITE_BRICK_SLAB); public static final DeferredItem NYXITE_BRICK_WALL_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.NYXITE_BRICK_WALL);