From 9089f26a449ff619143673f6e1d2b11c830fc48c Mon Sep 17 00:00:00 2001 From: craisinlord Date: Fri, 24 Jul 2026 17:09:30 -0500 Subject: [PATCH] Added various missing tags, finalize 1.0 --- .../content/block/AmberLichenBlock.java | 41 +++++++++++++++++++ .../content/block/BluestoneWireBlock.java | 7 +++- .../worldgen/elythia/ElythiaFloraFeature.java | 2 +- .../mixins/AbstractMinecartMixin.java | 12 +++++- .../peach_forest_petals.json | 34 +++++++++++++-- .../placed_feature/peach_forest_petals.json | 2 +- .../data/c/tags/item/animal_foods.json | 6 ++- .../resources/data/c/tags/item/foods.json | 4 ++ .../data/c/tags/item/foods/cooked_meat.json | 7 ++++ .../data/c/tags/item/foods/fruit.json | 6 +++ .../data/c/tags/item/foods/raw_fish.json | 6 +++ .../data/c/tags/item/foods/raw_meat.json | 7 ++++ .../resources/data/c/tags/item/seeds.json | 6 +++ .../data/c/tags/item/tools/melee_weapon.json | 11 +++++ .../data/c/tags/item/tools/ranged_weapon.json | 11 +++++ .../data/minecraft/tags/item/horse_food.json | 6 +++ .../data/minecraft/tags/item/meat.json | 9 ++++ .../data/minecraft/tags/item/parrot_food.json | 6 +++ .../tags/item/villager_plantable_seeds.json | 6 +++ .../fabric/registry/AntarchyFabricBlocks.java | 4 +- .../registry/AntarchyNeoforgeBlocks.java | 4 +- 21 files changed, 183 insertions(+), 14 deletions(-) create mode 100644 common/src/main/java/com/craisinlord/antarchy/content/block/AmberLichenBlock.java create mode 100644 common/src/main/resources/data/c/tags/item/foods/cooked_meat.json create mode 100644 common/src/main/resources/data/c/tags/item/foods/fruit.json create mode 100644 common/src/main/resources/data/c/tags/item/foods/raw_fish.json create mode 100644 common/src/main/resources/data/c/tags/item/foods/raw_meat.json create mode 100644 common/src/main/resources/data/c/tags/item/seeds.json create mode 100644 common/src/main/resources/data/c/tags/item/tools/melee_weapon.json create mode 100644 common/src/main/resources/data/c/tags/item/tools/ranged_weapon.json create mode 100644 common/src/main/resources/data/minecraft/tags/item/horse_food.json create mode 100644 common/src/main/resources/data/minecraft/tags/item/meat.json create mode 100644 common/src/main/resources/data/minecraft/tags/item/parrot_food.json create mode 100644 common/src/main/resources/data/minecraft/tags/item/villager_plantable_seeds.json diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/AmberLichenBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/AmberLichenBlock.java new file mode 100644 index 00000000..9dc25973 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/AmberLichenBlock.java @@ -0,0 +1,41 @@ +package com.craisinlord.antarchy.content.block; + +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; +import com.mojang.serialization.MapCodec; +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.block.GlowLichenBlock; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Fluid; +import net.minecraft.world.level.material.FluidState; +import net.minecraft.world.level.material.Fluids; + +public class AmberLichenBlock extends GlowLichenBlock { + public static final MapCodec CODEC = simpleCodec(AmberLichenBlock::new); + + public AmberLichenBlock(BlockBehaviour.Properties properties) { + super(properties); + } + + @Override + public MapCodec codec() { + return (MapCodec) (MapCodec) CODEC; + } + + @Override + public boolean canPlaceLiquid(Player player, BlockGetter level, BlockPos pos, BlockState state, Fluid fluid) { + return fluid == Fluids.WATER || AntarchyFluidChecks.isBile(fluid.defaultFluidState()); + } + + @Override + public boolean placeLiquid(LevelAccessor level, BlockPos pos, BlockState state, FluidState fluidState) { + if (AntarchyFluidChecks.isBile(fluidState)) { + level.setBlock(pos, fluidState.createLegacyBlock(), 3); + return true; + } + return super.placeLiquid(level, pos, state, fluidState); + } +} 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 a92590b2..2d9b8325 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 @@ -121,7 +121,8 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { return net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(); } if (direction.getAxis().isHorizontal() || direction == Direction.UP || direction == Direction.DOWN) { - return this.calculateShape(level, pos, state); + BlockState shaped = this.calculateShape(level, pos, state); + return level instanceof Level actualLevel ? this.updatePowerFromNeighbors(actualLevel, pos, shaped) : shaped; } return super.updateShape(state, direction, neighborState, level, pos, neighborPos); } @@ -295,7 +296,9 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { } private int calculateTargetStrength(Level level, BlockPos pos) { + shouldSignal = false; int external = this.getExternalSignal(level, pos); + shouldSignal = true; int neighborWirePower = 0; boolean openBelowCurrent = !level.getBlockState(pos.below()).isRedstoneConductor(level, pos.below()); @@ -324,7 +327,7 @@ public class BluestoneWireBlock extends Block implements BluestoneSignalSource { if (neighborState.getBlock() instanceof BluestoneWireBlock) { continue; } - signal = Math.max(signal, neighborState.getSignal(level, neighborPos, direction)); + signal = Math.max(signal, BluestoneSignalHelper.getSignalExcludingRedstoneWire(level, neighborPos, direction.getOpposite())); if (signal >= 15) { return 15; } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/worldgen/elythia/ElythiaFloraFeature.java b/common/src/main/java/com/craisinlord/antarchy/content/worldgen/elythia/ElythiaFloraFeature.java index da81c72e..baba8d74 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/worldgen/elythia/ElythiaFloraFeature.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/worldgen/elythia/ElythiaFloraFeature.java @@ -99,7 +99,7 @@ public class ElythiaFloraFeature extends Feature { }) { placedAny |= this.placeMilkweedPatch(level, origin, random, AntarchyObjects.PINK_MILKWEED.get()); } - if (this.variant == Variant.PEACH_FOREST && random.nextFloat() < 0.035F) { + if (this.variant == Variant.PEACH_FOREST && random.nextFloat() < 0.14F) { placedAny |= this.placeMilkweedPatch(level, origin, random, antarchyBlock(CAMELLIA_ID)); } diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/AbstractMinecartMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/AbstractMinecartMixin.java index bab95d5c..87ed3bf4 100644 --- a/common/src/main/java/com/craisinlord/antarchy/mixins/AbstractMinecartMixin.java +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/AbstractMinecartMixin.java @@ -13,6 +13,8 @@ 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.npc.Villager; +import net.minecraft.world.entity.npc.WanderingTrader; import net.minecraft.world.entity.vehicle.AbstractMinecart; import net.minecraft.world.level.block.BaseRailBlock; import net.minecraft.world.level.block.state.BlockState; @@ -97,11 +99,19 @@ public abstract class AbstractMinecartMixin implements AntimetalMinecartAccess { } } + @Unique + private static final double ANTARCHY$STANDING_PASSENGER_OFFSET = 0.1875D; + @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; + boolean standing = passenger instanceof Villager || passenger instanceof WanderingTrader; + double sourceY = standing ? original.y + ANTARCHY$STANDING_PASSENGER_OFFSET : original.y; + double mirroredY = 2.0D * AntimetalRailHelper.CART_MODEL_PIVOT_Y - sourceY + 1.0D; + if (standing) { + mirroredY -= ANTARCHY$STANDING_PASSENGER_OFFSET; + } cir.setReturnValue(new Vec3(original.x, mirroredY, original.z)); } } diff --git a/common/src/main/resources/data/antarchy/worldgen/configured_feature/peach_forest_petals.json b/common/src/main/resources/data/antarchy/worldgen/configured_feature/peach_forest_petals.json index 0f348bb7..b6be7acd 100644 --- a/common/src/main/resources/data/antarchy/worldgen/configured_feature/peach_forest_petals.json +++ b/common/src/main/resources/data/antarchy/worldgen/configured_feature/peach_forest_petals.json @@ -2,10 +2,36 @@ "type": "minecraft:simple_block", "config": { "to_place": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "minecraft:pink_petals" - } + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "minecraft:pink_petals", + "Properties": { + "flower_amount": "2" + } + }, + "weight": 1 + }, + { + "data": { + "Name": "minecraft:pink_petals", + "Properties": { + "flower_amount": "3" + } + }, + "weight": 1 + }, + { + "data": { + "Name": "minecraft:pink_petals", + "Properties": { + "flower_amount": "4" + } + }, + "weight": 1 + } + ] } } } diff --git a/common/src/main/resources/data/antarchy/worldgen/placed_feature/peach_forest_petals.json b/common/src/main/resources/data/antarchy/worldgen/placed_feature/peach_forest_petals.json index e03dcf94..9ff2e915 100644 --- a/common/src/main/resources/data/antarchy/worldgen/placed_feature/peach_forest_petals.json +++ b/common/src/main/resources/data/antarchy/worldgen/placed_feature/peach_forest_petals.json @@ -3,7 +3,7 @@ "placement": [ { "type": "minecraft:count", - "count": 3 + "count": 12 }, { "type": "minecraft:in_square" diff --git a/common/src/main/resources/data/c/tags/item/animal_foods.json b/common/src/main/resources/data/c/tags/item/animal_foods.json index feb046f5..31cdfa7a 100644 --- a/common/src/main/resources/data/c/tags/item/animal_foods.json +++ b/common/src/main/resources/data/c/tags/item/animal_foods.json @@ -1,6 +1,10 @@ { "replace": false, "values": [ - "antarchy:moleworm" + "antarchy:moleworm", + "antarchy:raw_bug_meat", + "antarchy:cooked_bug_meat", + "antarchy:raw_venison", + "antarchy:cooked_venison" ] } diff --git a/common/src/main/resources/data/c/tags/item/foods.json b/common/src/main/resources/data/c/tags/item/foods.json index d8703380..35048616 100644 --- a/common/src/main/resources/data/c/tags/item/foods.json +++ b/common/src/main/resources/data/c/tags/item/foods.json @@ -6,6 +6,10 @@ "antarchy:cornbread", "antarchy:popcorn", "antarchy:peach_pie", + "antarchy:cheep", + "antarchy:broodfruit", + "antarchy:raw_bug_meat", + "antarchy:cooked_bug_meat", "antarchy:raw_venison", "antarchy:cooked_venison", "antarchy:mud_pie", diff --git a/common/src/main/resources/data/c/tags/item/foods/cooked_meat.json b/common/src/main/resources/data/c/tags/item/foods/cooked_meat.json new file mode 100644 index 00000000..e3f95c3d --- /dev/null +++ b/common/src/main/resources/data/c/tags/item/foods/cooked_meat.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "antarchy:cooked_venison", + "antarchy:cooked_bug_meat" + ] +} diff --git a/common/src/main/resources/data/c/tags/item/foods/fruit.json b/common/src/main/resources/data/c/tags/item/foods/fruit.json new file mode 100644 index 00000000..aa4f6517 --- /dev/null +++ b/common/src/main/resources/data/c/tags/item/foods/fruit.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:peach" + ] +} diff --git a/common/src/main/resources/data/c/tags/item/foods/raw_fish.json b/common/src/main/resources/data/c/tags/item/foods/raw_fish.json new file mode 100644 index 00000000..12df0487 --- /dev/null +++ b/common/src/main/resources/data/c/tags/item/foods/raw_fish.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:cheep" + ] +} diff --git a/common/src/main/resources/data/c/tags/item/foods/raw_meat.json b/common/src/main/resources/data/c/tags/item/foods/raw_meat.json new file mode 100644 index 00000000..999e42f3 --- /dev/null +++ b/common/src/main/resources/data/c/tags/item/foods/raw_meat.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "antarchy:raw_venison", + "antarchy:raw_bug_meat" + ] +} diff --git a/common/src/main/resources/data/c/tags/item/seeds.json b/common/src/main/resources/data/c/tags/item/seeds.json new file mode 100644 index 00000000..48cf8010 --- /dev/null +++ b/common/src/main/resources/data/c/tags/item/seeds.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:corn_seeds" + ] +} diff --git a/common/src/main/resources/data/c/tags/item/tools/melee_weapon.json b/common/src/main/resources/data/c/tags/item/tools/melee_weapon.json new file mode 100644 index 00000000..84a8485a --- /dev/null +++ b/common/src/main/resources/data/c/tags/item/tools/melee_weapon.json @@ -0,0 +1,11 @@ +{ + "replace": false, + "values": [ + "antarchy:ultimate_sword", + "antarchy:battle_axe", + "antarchy:nightmare_sword", + "antarchy:basilisk_dagger", + "antarchy:emperor_scorpion_whip", + "antarchy:attitude_adjuster" + ] +} diff --git a/common/src/main/resources/data/c/tags/item/tools/ranged_weapon.json b/common/src/main/resources/data/c/tags/item/tools/ranged_weapon.json new file mode 100644 index 00000000..9dff752f --- /dev/null +++ b/common/src/main/resources/data/c/tags/item/tools/ranged_weapon.json @@ -0,0 +1,11 @@ +{ + "replace": false, + "values": [ + "antarchy:ultimate_bow", + "antarchy:ultimate_crossbow", + "antarchy:krakens_grasp", + "antarchy:water_cannon", + "antarchy:squidzooka", + "antarchy:rpo_launcher" + ] +} diff --git a/common/src/main/resources/data/minecraft/tags/item/horse_food.json b/common/src/main/resources/data/minecraft/tags/item/horse_food.json new file mode 100644 index 00000000..aa4f6517 --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/item/horse_food.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:peach" + ] +} diff --git a/common/src/main/resources/data/minecraft/tags/item/meat.json b/common/src/main/resources/data/minecraft/tags/item/meat.json new file mode 100644 index 00000000..6e665875 --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/item/meat.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + "antarchy:raw_venison", + "antarchy:cooked_venison", + "antarchy:raw_bug_meat", + "antarchy:cooked_bug_meat" + ] +} diff --git a/common/src/main/resources/data/minecraft/tags/item/parrot_food.json b/common/src/main/resources/data/minecraft/tags/item/parrot_food.json new file mode 100644 index 00000000..48cf8010 --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/item/parrot_food.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:corn_seeds" + ] +} diff --git a/common/src/main/resources/data/minecraft/tags/item/villager_plantable_seeds.json b/common/src/main/resources/data/minecraft/tags/item/villager_plantable_seeds.json new file mode 100644 index 00000000..48cf8010 --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/item/villager_plantable_seeds.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:corn_seeds" + ] +} 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 a1f4209a..259c86b1 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 @@ -546,8 +546,8 @@ public final class AntarchyFabricBlocks { () -> new UmbralMossCarpetBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_CARPET).noOcclusion())); - public static final DeferredBlock AMBER_LICHEN = BLOCKS.register("amber_lichen", - () -> new GlowLichenBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.GLOW_LICHEN).lightLevel(state -> 4))); + public static final DeferredBlock AMBER_LICHEN = BLOCKS.register("amber_lichen", + () -> new AmberLichenBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.GLOW_LICHEN).lightLevel(state -> 4))); public static final DeferredBlock BILE_VEIN = BLOCKS.register("bile_vein", 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 50331dc5..80b94d74 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 @@ -303,8 +303,8 @@ public final class AntarchyNeoforgeBlocks { () -> new AmberMossBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_BLOCK))); public static final DeferredBlock AMBER_MOSS_CARPET = BLOCKS.register("amber_moss_carpet", () -> new UmbralMossCarpetBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_CARPET).noOcclusion())); - public static final DeferredBlock AMBER_LICHEN = BLOCKS.register("amber_lichen", - () -> new GlowLichenBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.GLOW_LICHEN).lightLevel(state -> 4))); + public static final DeferredBlock AMBER_LICHEN = BLOCKS.register("amber_lichen", + () -> new AmberLichenBlock(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",