From 7865a85ab8156d863f9ac4e392eead9167949641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=86=AC=E7=85=9C?= <10185101162@stu.ecnu.edu.cn> Date: Tue, 11 Mar 2025 21:45:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat[salt]:=20=E7=9B=90=E7=9F=BF=E7=9A=84?= =?UTF-8?q?=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../worldgen/ModBiomeModifierRegistry.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/polaris2023/wild_wind/datagen/worldgen/ModBiomeModifierRegistry.java b/src/main/java/org/polaris2023/wild_wind/datagen/worldgen/ModBiomeModifierRegistry.java index 0d5bb0da..aa94bce3 100644 --- a/src/main/java/org/polaris2023/wild_wind/datagen/worldgen/ModBiomeModifierRegistry.java +++ b/src/main/java/org/polaris2023/wild_wind/datagen/worldgen/ModBiomeModifierRegistry.java @@ -15,9 +15,8 @@ import org.polaris2023.wild_wind.util.Helpers; public class ModBiomeModifierRegistry { - public static final ResourceKey BRITTLE_ICE = ResourceKey.create( - NeoForgeRegistries.Keys.BIOME_MODIFIERS, Helpers.location("brittle_ice") - ); + public static final ResourceKey BRITTLE_ICE = create("brittle_ice"); + public static final ResourceKey SALT_ORE = create("salt_ore"); public static void bootstrap(BootstrapContext context) { HolderGetter biomesLookup = context.lookup(Registries.BIOME); @@ -25,7 +24,16 @@ public static void bootstrap(BootstrapContext context) { context.register(BRITTLE_ICE, new BiomeModifiers.AddFeaturesBiomeModifier( biomesLookup.getOrThrow(Tags.Biomes.IS_COLD_OVERWORLD), HolderSet.direct(placedFeaturesLookup.getOrThrow(ModPlacedFeatureRegistry.BRITTLE_ICE), placedFeaturesLookup.getOrThrow(ModPlacedFeatureRegistry.DISK_BRITTLE_ICE)), - GenerationStep.Decoration.TOP_LAYER_MODIFICATION) - ); + GenerationStep.Decoration.TOP_LAYER_MODIFICATION + )); + context.register(SALT_ORE, new BiomeModifiers.AddFeaturesBiomeModifier( + biomesLookup.getOrThrow(Tags.Biomes.IS_OVERWORLD), + HolderSet.direct(placedFeaturesLookup.getOrThrow(ModPlacedFeatureRegistry.ORE_SALT), placedFeaturesLookup.getOrThrow(ModPlacedFeatureRegistry.ORE_SALT_BURIED)), + GenerationStep.Decoration.UNDERGROUND_ORES + )); + } + + private static ResourceKey create(String name) { + return ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, Helpers.location(name)); } } From 173d9a9e50d72ce4cbfe07521c51b36803f9c52c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=86=AC=E7=85=9C?= <10185101162@stu.ecnu.edu.cn> Date: Tue, 11 Mar 2025 22:11:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat[sculk=5Fjaw]:=20=E5=B9=BD=E5=8C=BF?= =?UTF-8?q?=E9=A2=9A=E5=8F=A3=E7=9A=84=E6=8E=89=E8=90=BD=E4=B8=8E=E7=BB=8F?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wild_wind/common/block/SculkJawBlock.java | 17 +++++++++++++---- .../datagen/loot/ModBlockLootSubProvider.java | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/polaris2023/wild_wind/common/block/SculkJawBlock.java b/src/main/java/org/polaris2023/wild_wind/common/block/SculkJawBlock.java index 4d5078c0..cb37c693 100644 --- a/src/main/java/org/polaris2023/wild_wind/common/block/SculkJawBlock.java +++ b/src/main/java/org/polaris2023/wild_wind/common/block/SculkJawBlock.java @@ -1,13 +1,22 @@ package org.polaris2023.wild_wind.common.block; +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; + +import javax.annotation.Nullable; -/** - * @author : baka4n - * {@code @Date : 2025/02/12 16:23:45} - */ public class SculkJawBlock extends Block { public SculkJawBlock(Properties properties) { super(properties); } + + @Override + public int getExpDrop(BlockState state, net.minecraft.world.level.LevelAccessor level, BlockPos pos, + @Nullable BlockEntity blockEntity, @Nullable Entity breaker, ItemStack tool) { + return 5; + } } diff --git a/src/main/java/org/polaris2023/wild_wind/datagen/loot/ModBlockLootSubProvider.java b/src/main/java/org/polaris2023/wild_wind/datagen/loot/ModBlockLootSubProvider.java index 2caa804a..e82bfb4b 100644 --- a/src/main/java/org/polaris2023/wild_wind/datagen/loot/ModBlockLootSubProvider.java +++ b/src/main/java/org/polaris2023/wild_wind/datagen/loot/ModBlockLootSubProvider.java @@ -62,7 +62,7 @@ public void generate() { this.dropSelf(ModBlocks.STRIPPED_BAOBAB_LOG.get()); this.dropSelf(ModBlocks.BAOBAB_WOOD.get()); this.dropSelf(ModBlocks.STRIPPED_BAOBAB_WOOD.get()); - this.dropSelf(ModBlocks.SCULK_JAW.get()); + this.dropWhenSilkTouch(ModBlocks.SCULK_JAW.get()); this.dropSelf(ModBlocks.DUCKWEED.get()); this.dropSelf(ModBlocks.GLISTERING_MELON.get()); this.dropSelf(ModBlocks.POLISHED_STONE.get());