diff --git a/gradle.properties b/gradle.properties index 045cfa0..44ea246 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ minecraft_version=1.20.1 yarn_mappings=1.20.1+build.10 loader_version=0.18.3 # Mod Properties -mod_version=26.3.28 +mod_version=26.3.29 maven_group=dev.tggamesyt archives_base_name=szar # Dependencies diff --git a/src/client/java/dev/tggamesyt/szar/client/SzarClient.java b/src/client/java/dev/tggamesyt/szar/client/SzarClient.java index c1ee60e..8ad0723 100644 --- a/src/client/java/dev/tggamesyt/szar/client/SzarClient.java +++ b/src/client/java/dev/tggamesyt/szar/client/SzarClient.java @@ -565,6 +565,18 @@ public class SzarClient implements ClientModInitializer { Szar.CANNABIS_BLOCK, RenderLayer.getCutout() ); + BlockRenderLayerMap.INSTANCE.putBlock( + CONNECT_FOUR_BLOCK, + RenderLayer.getCutout() + ); + BlockRenderLayerMap.INSTANCE.putBlock( + SMALL_CHORUS, + RenderLayer.getCutout() + ); + BlockRenderLayerMap.INSTANCE.putBlock( + SMALL_CHORUS_FLOWER, + RenderLayer.getCutout() + ); BlockRenderLayerMap.INSTANCE.putBlock( ROULETTE_BLOCK, RenderLayer.getCutout() diff --git a/src/main/java/dev/tggamesyt/szar/ChorusEndStone.java b/src/main/java/dev/tggamesyt/szar/ChorusEndStone.java index dcc8f38..096226e 100644 --- a/src/main/java/dev/tggamesyt/szar/ChorusEndStone.java +++ b/src/main/java/dev/tggamesyt/szar/ChorusEndStone.java @@ -25,7 +25,7 @@ public class ChorusEndStone extends EndSpreadableBlock implements Fertilizable { @Override public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state, boolean isClient) { - return world.getBlockState(pos.up()).isAir(); + return true; } @Override @@ -35,50 +35,28 @@ public class ChorusEndStone extends EndSpreadableBlock implements Fertilizable { @Override public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) { - BlockPos start = pos.up(); + BlockPos target = pos.up(); - // your custom placed feature (we'll register this next) var registry = world.getRegistryManager().get(RegistryKeys.PLACED_FEATURE); + var featureEntry = registry.getEntry(Szar.SMALL_CHORUS_PLACED); - var smallChorusFeature = registry.getEntry(Szar.SMALL_CHORUS_PLACED); + // ❌ if blocked, do nothing + if (!world.getBlockState(target).isAir()) return; - outer: - for (int i = 0; i < 128; i++) { - BlockPos target = start; + // 🌸 VERY RARE chorus flower (~5%) + if (random.nextInt(20) == 0) { + world.setBlockState(target, Blocks.CHORUS_FLOWER.getDefaultState()); + return; + } - for (int j = 0; j < i / 16; j++) { - target = target.add( - random.nextInt(3) - 1, - (random.nextInt(3) - 1) * random.nextInt(3) / 2, - random.nextInt(3) - 1 - ); - - if (!world.getBlockState(target.down()).isOf(this) - || world.getBlockState(target).isFullCube(world, target)) { - continue outer; - } - } - - BlockState targetState = world.getBlockState(target); - - if (targetState.isAir()) { - - // 🌟 Rare: spawn chorus flower (~1/12 chance) - if (random.nextInt(12) == 0) { - world.setBlockState(target, Blocks.CHORUS_FLOWER.getDefaultState()); - continue; - } - - // 🌿 Common: spawn your custom feature - if (smallChorusFeature.isPresent()) { - smallChorusFeature.get().value().generateUnregistered( - world, - world.getChunkManager().getChunkGenerator(), - random, - target - ); - } - } + // 🌿 otherwise place ONE patch + if (featureEntry.isPresent()) { + featureEntry.get().value().generateUnregistered( + world, + world.getChunkManager().getChunkGenerator(), + random, + target + ); } } } diff --git a/src/main/java/dev/tggamesyt/szar/SmallChorusBlock.java b/src/main/java/dev/tggamesyt/szar/SmallChorusBlock.java index d32e0e0..7ee89b7 100644 --- a/src/main/java/dev/tggamesyt/szar/SmallChorusBlock.java +++ b/src/main/java/dev/tggamesyt/szar/SmallChorusBlock.java @@ -1,16 +1,23 @@ package dev.tggamesyt.szar; +import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.PlantBlock; +import net.minecraft.block.ShapeContext; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.BlockView; public class SmallChorusBlock extends PlantBlock { - + protected static final VoxelShape SHAPE = Block.createCuboidShape((double)2.0F, (double)0.0F, (double)2.0F, (double)14.0F, (double)13.0F, (double)14.0F); public SmallChorusBlock(Settings settings) { super(settings); } + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return SHAPE; + } + @Override protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) { return floor.isOf(Szar.CHORUS_ENDSTONE); diff --git a/src/main/java/dev/tggamesyt/szar/SmallChorusFlowerBlock.java b/src/main/java/dev/tggamesyt/szar/SmallChorusFlowerBlock.java new file mode 100644 index 0000000..78fddcb --- /dev/null +++ b/src/main/java/dev/tggamesyt/szar/SmallChorusFlowerBlock.java @@ -0,0 +1,52 @@ +package dev.tggamesyt.szar; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.PlantBlock; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.random.Random; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; + +public class SmallChorusFlowerBlock extends PlantBlock { + + protected static final VoxelShape SHAPE = Block.createCuboidShape( + 2.0, 0.0, 2.0, + 14.0, 13.0, 14.0 + ); + + public SmallChorusFlowerBlock(Settings settings) { + super(settings); + } + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, net.minecraft.block.ShapeContext context) { + return SHAPE; + } + + @Override + protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) { + return floor.isOf(Szar.CHORUS_ENDSTONE); + } + + @Override + public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + + // small chance per random tick → averages ~5–10 minutes + if (random.nextInt(6) == 0) { // tweak this number + + // only grow if space above + if (world.getBlockState(pos.up()).isAir()) { + world.setBlockState(pos, Blocks.CHORUS_FLOWER.getDefaultState()); + } + } + } + + @Override + public boolean hasRandomTicks(BlockState state) { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/dev/tggamesyt/szar/SurfaceReplaceFeature.java b/src/main/java/dev/tggamesyt/szar/SurfaceReplaceFeature.java new file mode 100644 index 0000000..de2507c --- /dev/null +++ b/src/main/java/dev/tggamesyt/szar/SurfaceReplaceFeature.java @@ -0,0 +1,48 @@ +package dev.tggamesyt.szar; + +import com.mojang.serialization.Codec; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.StructureWorldAccess; +import net.minecraft.world.gen.feature.DefaultFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.util.FeatureContext; + +public class SurfaceReplaceFeature extends Feature { + + public SurfaceReplaceFeature(Codec codec) { + super(codec); + } + + @Override + public boolean generate(FeatureContext context) { + StructureWorldAccess world = context.getWorld(); + BlockPos origin = context.getOrigin(); + + // snap to chunk corner + int startX = (origin.getX() >> 4) << 4; + int startZ = (origin.getZ() >> 4) << 4; + + for (int x = 0; x < 16; x++) { + for (int z = 0; z < 16; z++) { + BlockPos column = new BlockPos(startX + x, origin.getY(), startZ + z); + + for (int i = 10; i > -10; i--) { + BlockPos pos = column.up(i); + BlockState state = world.getBlockState(pos); + + if (state.isOf(Blocks.END_STONE)) { + world.setBlockState(pos, Szar.CHORUS_ENDSTONE.getDefaultState(), Block.NOTIFY_LISTENERS); + break; + } else if (!state.isAir()) { + break; + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/dev/tggamesyt/szar/Szar.java b/src/main/java/dev/tggamesyt/szar/Szar.java index 206e989..7775d34 100644 --- a/src/main/java/dev/tggamesyt/szar/Szar.java +++ b/src/main/java/dev/tggamesyt/szar/Szar.java @@ -1,7 +1,6 @@ package dev.tggamesyt.szar; import com.google.common.collect.ImmutableSet; -import com.mojang.authlib.minecraft.client.MinecraftClient; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.biome.v1.BiomeModifications; @@ -28,6 +27,7 @@ import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder; import net.fabricmc.fabric.api.object.builder.v1.trade.TradeOfferHelper; import net.fabricmc.fabric.api.object.builder.v1.world.poi.PointOfInterestHelper; import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry; +import net.fabricmc.fabric.impl.biome.TheEndBiomeData; import net.minecraft.advancement.Advancement; import net.minecraft.block.*; import net.minecraft.block.dispenser.FallibleItemDispenserBehavior; @@ -75,6 +75,7 @@ import net.minecraft.village.TradeOffer; import net.minecraft.village.VillagerProfession; import net.minecraft.world.Heightmap; import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.BiomeKeys; import net.minecraft.world.dimension.DimensionOptions; import net.minecraft.world.dimension.DimensionType; @@ -90,14 +91,12 @@ import net.minecraft.world.poi.PointOfInterestType; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.awt.*; import java.util.*; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.regex.Pattern; import static dev.tggamesyt.szar.ServerCosmetics.USERS; -import static dev.tggamesyt.szar.ServerCosmetics.sync; public class Szar implements ModInitializer { public static final String MOD_ID = "szar"; @@ -164,6 +163,7 @@ public class Szar implements ModInitializer { new Identifier(Szar.MOD_ID, "won"), SoundEvent.of(new Identifier(Szar.MOD_ID, "won")) ); + private static final Set chorusRolledEntities = new HashSet<>(); public static final SoundEvent MERL_SOUND = SoundEvent.of(new Identifier(MOD_ID, "merl")); public static final Map recentPlaneCrashDeaths = new java.util.HashMap<>(); @@ -389,6 +389,7 @@ public class Szar implements ModInitializer { // end update entries.add(Szar.CHORUS_ENDSTONE_ITEM); entries.add(Szar.SMALL_CHORUS_ITEM); + entries.add(Szar.SMALL_CHORUS_FLOWER_ITEM); // blueprint stuff entries.add(BlueprintBlocks.BLUEPRINT); entries.add(BlueprintBlocks.BLUEPRINT_DOOR_ITEM); @@ -1383,6 +1384,35 @@ public class Szar implements ModInitializer { ServerLifecycleEvents.SERVER_STARTED.register(SzarGameRules::pushToGameRules); BlueprintBlocks.init(); + + ServerTickEvents.END_SERVER_TICK.register(server -> { + for (ServerWorld world : server.getWorlds()) { + + + // Handle item transformation + for (ItemEntity item : world.getEntitiesByType(EntityType.ITEM, e -> true)) { + if (!item.getStack().isOf(Items.CHORUS_FRUIT)) continue; + + BlockPos pos = item.getBlockPos(); + BlockPos down = pos.down(); + + if (!chorusRolledEntities.contains(item.getId()) && world.getBlockState(down).isOf(Szar.CHORUS_ENDSTONE)) { + chorusRolledEntities.add(item.getId()); + + int roll = world.getRandom().nextInt(100); // 0-99 + if (roll < 5) { // 5% -> 1 in 20 chance + world.setBlockState(pos, Szar.SMALL_CHORUS.getDefaultState()); + item.remove(Entity.RemovalReason.DISCARDED); + } else if (roll == 5) { // 2% -> 1 in 50 chance + world.setBlockState(pos, Szar.SMALL_CHORUS_FLOWER.getDefaultState()); + item.remove(Entity.RemovalReason.DISCARDED); + } + // otherwise do nothing, just mark it as rolled + } + } + } + }); + TheEndBiomeData.addEndBiomeReplacement(BiomeKeys.END_HIGHLANDS, Szar.CHORUS_FOREST, 0.3); } public static final Block TIC_TAC_TOE_BLOCK = Registry.register( @@ -1454,7 +1484,7 @@ public class Szar implements ModInitializer { public static final Block CHORUS_ENDSTONE = Registry.register( Registries.BLOCK, new Identifier(MOD_ID, "chorus_endstone"), - new Block(FabricBlockSettings.copyOf(Blocks.END_STONE)) + new ChorusEndStone(FabricBlockSettings.copyOf(Blocks.END_STONE).ticksRandomly()) ); public static final Item CHORUS_ENDSTONE_ITEM = Registry.register( Registries.ITEM, @@ -1471,6 +1501,25 @@ public class Szar implements ModInitializer { new Identifier(MOD_ID, "small_chorus"), new BlockItem(SMALL_CHORUS, new FabricItemSettings()) ); + public static final Block SMALL_CHORUS_FLOWER = Registry.register( + Registries.BLOCK, + new Identifier(MOD_ID, "small_chorus_flower"), + new SmallChorusFlowerBlock(FabricBlockSettings.copyOf(Blocks.POPPY).ticksRandomly()) + ); + public static final Item SMALL_CHORUS_FLOWER_ITEM = Registry.register( + Registries.ITEM, + new Identifier(MOD_ID, "small_chorus_flower"), + new BlockItem(SMALL_CHORUS_FLOWER, new FabricItemSettings()) + ); + public static final RegistryKey CHORUS_FOREST = RegistryKey.of( + RegistryKeys.BIOME, + new Identifier(MOD_ID, "chorus_forest") + ); + public static final Feature SURFACE_REPLACE = Registry.register( + Registries.FEATURE, + new Identifier(MOD_ID, "surface_replace"), + new SurfaceReplaceFeature(DefaultFeatureConfig.CODEC) + ); // Blocks public static final TrackerBlock TRACKER_BLOCK = Registry.register( Registries.BLOCK, new Identifier(MOD_ID, "tracker"), diff --git a/src/main/java/dev/tggamesyt/szar/mixin/ChorusPlantFeatureMixin.java b/src/main/java/dev/tggamesyt/szar/mixin/ChorusPlantFeatureMixin.java new file mode 100644 index 0000000..48f553a --- /dev/null +++ b/src/main/java/dev/tggamesyt/szar/mixin/ChorusPlantFeatureMixin.java @@ -0,0 +1,36 @@ +package dev.tggamesyt.szar.mixin; + +import dev.tggamesyt.szar.Szar; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; +import net.minecraft.world.gen.feature.ChorusPlantFeature; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(ChorusPlantFeature.class) +public class ChorusPlantFeatureMixin { + + @Unique + private static final TagKey ENDSTONES = + TagKey.of(RegistryKeys.BLOCK, new Identifier(Szar.MOD_ID, "endstones")); + + @Redirect( + method = "generate", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z" + ) + ) + private boolean replaceEndStoneCheck(BlockState state, Block block) { + if (block == Blocks.END_STONE) { + return state.isIn(ENDSTONES); + } + return state.isOf(block); + } +} \ No newline at end of file diff --git a/src/main/java/dev/tggamesyt/szar/mixin/VanillaSurfaceRulesMixin.java b/src/main/java/dev/tggamesyt/szar/mixin/VanillaSurfaceRulesMixin.java new file mode 100644 index 0000000..4c664f1 --- /dev/null +++ b/src/main/java/dev/tggamesyt/szar/mixin/VanillaSurfaceRulesMixin.java @@ -0,0 +1,24 @@ +package dev.tggamesyt.szar.mixin; + +import dev.tggamesyt.szar.Szar; +import net.minecraft.block.Blocks; +import net.minecraft.world.gen.surfacebuilder.MaterialRules; +import net.minecraft.world.gen.surfacebuilder.VanillaSurfaceRules; +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(VanillaSurfaceRules.class) +public class VanillaSurfaceRulesMixin { + + @Inject(method = "getEndStoneRule", at = @At("RETURN"), cancellable = true) + private static void overrideEndStoneRule(CallbackInfoReturnable cir) { + MaterialRules.MaterialRule chorusForest = MaterialRules.condition( + MaterialRules.biome(Szar.CHORUS_FOREST), + MaterialRules.block(Szar.CHORUS_ENDSTONE.getDefaultState()) + ); + + cir.setReturnValue(MaterialRules.sequence(chorusForest, cir.getReturnValue())); + } +} \ No newline at end of file diff --git a/src/main/resources/assets/szar/blockstates/small_chorus_flower.json b/src/main/resources/assets/szar/blockstates/small_chorus_flower.json new file mode 100644 index 0000000..f3d2bd9 --- /dev/null +++ b/src/main/resources/assets/szar/blockstates/small_chorus_flower.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "szar:block/small_chorus_flower" + } + } +} diff --git a/src/main/resources/assets/szar/lang/en_us.json b/src/main/resources/assets/szar/lang/en_us.json index 8e28c9b..0152570 100644 --- a/src/main/resources/assets/szar/lang/en_us.json +++ b/src/main/resources/assets/szar/lang/en_us.json @@ -201,5 +201,6 @@ "item.szar.blueprint": "Blueprint", "block.szar.chorus_endstone": "Chorus EndStone", - "block.szar.small_chorus": "Small Chorus" + "block.szar.small_chorus": "Small Chorus", + "block.szar.small_chorus_flower": "Small Chorus Flower" } diff --git a/src/main/resources/assets/szar/models/block/small_chorus_flower.json b/src/main/resources/assets/szar/models/block/small_chorus_flower.json new file mode 100644 index 0000000..980874d --- /dev/null +++ b/src/main/resources/assets/szar/models/block/small_chorus_flower.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "szar:block/small_chorus_flower" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/szar/models/item/small_chorus_flower.json b/src/main/resources/assets/szar/models/item/small_chorus_flower.json new file mode 100644 index 0000000..61af42d --- /dev/null +++ b/src/main/resources/assets/szar/models/item/small_chorus_flower.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "szar:block/small_chorus_flower" + } +} diff --git a/src/main/resources/assets/szar/textures/block/small_chorus.png b/src/main/resources/assets/szar/textures/block/small_chorus.png index da6be8e..905b3fe 100644 Binary files a/src/main/resources/assets/szar/textures/block/small_chorus.png and b/src/main/resources/assets/szar/textures/block/small_chorus.png differ diff --git a/src/main/resources/assets/szar/textures/block/small_chorus_flower.png b/src/main/resources/assets/szar/textures/block/small_chorus_flower.png new file mode 100644 index 0000000..4fc88d5 Binary files /dev/null and b/src/main/resources/assets/szar/textures/block/small_chorus_flower.png differ diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index 4732ef6..7e61b98 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -2,6 +2,7 @@ "replace": false, "values": [ "szar:uranium_ore", - "szar:niggerite_block" + "szar:niggerite_block", + "szar:chorus_endstone" ] } diff --git a/src/main/resources/data/szar/loot_tables/blocks/blueprint_slab.json b/src/main/resources/data/szar/loot_tables/blocks/blueprint_slab.json index 6e04e39..225c593 100644 --- a/src/main/resources/data/szar/loot_tables/blocks/blueprint_slab.json +++ b/src/main/resources/data/szar/loot_tables/blocks/blueprint_slab.json @@ -2,28 +2,34 @@ "type": "minecraft:block", "pools": [ { - "rolls": 1, + "bonus_rolls": 0.0, "entries": [ { "type": "minecraft:item", - "name": "szar:blueprint_slab", "functions": [ { - "function": "minecraft:set_count", - "count": { - "type": "minecraft:block_state_property", - "block": "szar:blueprint_slab", - "property": "type", - "values": { - "double": 2, - "bottom": 1, - "top": 1 + "add": false, + "conditions": [ + { + "block": "szar:blueprint_slab", + "condition": "minecraft:block_state_property", + "properties": { + "type": "double" + } } - } + ], + "count": 2.0, + "function": "minecraft:set_count" + }, + { + "function": "minecraft:explosion_decay" } - ] + ], + "name": "szar:blueprint_slab" } - ] + ], + "rolls": 1.0 } - ] + ], + "random_sequence": "minecraft:blocks/stone_slab" } \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/chorus_endstone.json b/src/main/resources/data/szar/loot_tables/blocks/chorus_endstone.json new file mode 100644 index 0000000..0568803 --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/chorus_endstone.json @@ -0,0 +1,45 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ], + "name": "szar:chorus_endstone" + }, + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "name": "minecraft:end_stone" + } + ] + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "minecraft:blocks/grass_block" +} \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/small_chorus.json b/src/main/resources/data/szar/loot_tables/blocks/small_chorus.json new file mode 100644 index 0000000..ac43137 --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/small_chorus.json @@ -0,0 +1,54 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:shears" + ] + } + } + ], + "name": "szar:small_chorus" + }, + { + "type": "minecraft:item", + "conditions": [ + { + "chance": 0.125, + "condition": "minecraft:random_chance" + } + ], + "functions": [ + { + "enchantment": "minecraft:fortune", + "formula": "minecraft:uniform_bonus_count", + "function": "minecraft:apply_bonus", + "parameters": { + "bonusMultiplier": 2 + } + }, + { + "function": "minecraft:explosion_decay" + } + ], + "name": "minecraft:chorus_fruit" + } + ] + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "minecraft:blocks/grass" +} \ No newline at end of file diff --git a/src/main/resources/data/szar/loot_tables/blocks/small_chorus_flower.json b/src/main/resources/data/szar/loot_tables/blocks/small_chorus_flower.json new file mode 100644 index 0000000..7e62157 --- /dev/null +++ b/src/main/resources/data/szar/loot_tables/blocks/small_chorus_flower.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "szar:small_chorus_flower" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "minecraft:blocks/poppy" +} \ No newline at end of file diff --git a/src/main/resources/data/szar/worldgen/biome/chorus_forest.json b/src/main/resources/data/szar/worldgen/biome/chorus_forest.json new file mode 100644 index 0000000..0cf4c4d --- /dev/null +++ b/src/main/resources/data/szar/worldgen/biome/chorus_forest.json @@ -0,0 +1,46 @@ +{ + "temperature": 0.5, + "downfall": 0.0, + "has_precipitation": false, + "effects": { + "sky_color": 0, + "fog_color": 10518688, + "water_color": 4159204, + "water_fog_color": 329011, + "mood_sound": { + "sound": "minecraft:ambient.cave", + "tick_delay": 6000, + "block_search_extent": 8, + "offset": 2.0 + } + }, + "creature_spawn_probability": 0.1, + "spawners": { + "monster": [ + { + "type": "minecraft:enderman", + "weight": 10, + "minCount": 1, + "maxCount": 4 + } + ], + "creature": [], + "ambient": [], + "water_creature": [], + "water_ambient": [], + "underground_water_creature": [], + "axolotls": [], + "misc": [] + }, + "spawn_costs": {}, + "features": [ + [], [], [], [], [], [], [], + [ + "szar:small_chorus_patch", + "minecraft:end_spike", + "minecraft:chorus_plant" + ], + [], [] + ], + "carvers": {} +} \ No newline at end of file diff --git a/src/main/resources/data/szar/worldgen/configured_feature/chorus_endstone_surface.json b/src/main/resources/data/szar/worldgen/configured_feature/chorus_endstone_surface.json new file mode 100644 index 0000000..c33d0a4 --- /dev/null +++ b/src/main/resources/data/szar/worldgen/configured_feature/chorus_endstone_surface.json @@ -0,0 +1,4 @@ +{ + "type": "szar:surface_replace", + "config": {} +} \ No newline at end of file diff --git a/src/main/resources/data/szar/worldgen/configured_feature/small_chorus.json b/src/main/resources/data/szar/worldgen/configured_feature/small_chorus.json index 45d9fe5..d7d9d63 100644 --- a/src/main/resources/data/szar/worldgen/configured_feature/small_chorus.json +++ b/src/main/resources/data/szar/worldgen/configured_feature/small_chorus.json @@ -6,10 +6,21 @@ "type": "minecraft:simple_block", "config": { "to_place": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "szar:small_chorus_block" - } + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "weight": 9, + "data": { + "Name": "szar:small_chorus" + } + }, + { + "weight": 1, + "data": { + "Name": "szar:small_chorus_flower" + } + } + ] } } }, @@ -24,7 +35,7 @@ ] }, "tries": 32, - "xz_spread": 7, + "xz_spread": 5, "y_spread": 3 } } \ No newline at end of file diff --git a/src/main/resources/data/szar/worldgen/placed_feature/chorus_endstone_surface.json b/src/main/resources/data/szar/worldgen/placed_feature/chorus_endstone_surface.json new file mode 100644 index 0000000..aefb536 --- /dev/null +++ b/src/main/resources/data/szar/worldgen/placed_feature/chorus_endstone_surface.json @@ -0,0 +1,15 @@ +{ + "feature": "szar:chorus_endstone_surface", + "placement": [ + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "WORLD_SURFACE_WG" + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/szar/worldgen/placed_feature/small_chorus_patch.json b/src/main/resources/data/szar/worldgen/placed_feature/small_chorus_patch.json index 0204271..0b19e58 100644 --- a/src/main/resources/data/szar/worldgen/placed_feature/small_chorus_patch.json +++ b/src/main/resources/data/szar/worldgen/placed_feature/small_chorus_patch.json @@ -2,8 +2,6 @@ "feature": "szar:small_chorus", "placement": [ { "type": "minecraft:count", "count": 5 }, - { "type": "minecraft:in_square" }, - { "type": "minecraft:heightmap", "heightmap": "WORLD_SURFACE_WG" }, - { "type": "minecraft:biome" } + { "type": "minecraft:in_square" } ] } \ No newline at end of file diff --git a/src/main/resources/szar.mixins.json b/src/main/resources/szar.mixins.json index 96eb005..1fd74fd 100644 --- a/src/main/resources/szar.mixins.json +++ b/src/main/resources/szar.mixins.json @@ -6,6 +6,7 @@ "mixins": [ "ChorusFlowerBlockMixin", "ChorusPlantBlockMixin", + "ChorusPlantFeatureMixin", "CraftingScreenHandlerMixin", "CraftingScreenHandlerMixin2", "EntityCollisionMixin", @@ -18,7 +19,8 @@ "PlayerEntityMixin", "PlayerInteractionMixin", "PlayerSleepMixin", - "RadiatedItemMixin" + "RadiatedItemMixin", + "VanillaSurfaceRulesMixin" ], "injectors": { "defaultRequire": 1