From 120afea58570403e21ec491684be66bebbad4513 Mon Sep 17 00:00:00 2001 From: Adeline <50517260+Ad3lineL@users.noreply.github.com> Date: Fri, 6 Feb 2026 23:14:41 +0100 Subject: [PATCH] bug husk start --- .../resources/assets/clinker/lang/en_us.json | 1 + .../clinker/models/item/carapace_husk.json | 3 + .../loot_table/blocks/carapace_husk.json | 21 +++++ .../common/world/block/CarapaceHuskBlock.java | 72 ++++++++++++++++++ .../clinker/core/registry/ClinkerBlocks.java | 7 ++ .../registry/ClinkerCreativeModeTabs.java | 1 + .../providers/ClinkerBlockStateProvider.java | 5 ++ .../clinker/blockstates/carapace_husk.json | 19 +++++ .../clinker/models/block/carapace_husk.json | 57 ++++++++++++++ .../textures/block/carapace_husk_bottom.png | Bin 0 -> 226 bytes .../textures/block/carapace_husk_end.png | Bin 0 -> 395 bytes .../textures/block/carapace_husk_side.png | Bin 0 -> 451 bytes .../textures/block/carapace_husk_side_1.png | Bin 0 -> 427 bytes .../textures/block/carapace_husk_top.png | Bin 0 -> 398 bytes 14 files changed, 186 insertions(+) create mode 100644 src/generated/resources/assets/clinker/models/item/carapace_husk.json create mode 100644 src/generated/resources/data/clinker/loot_table/blocks/carapace_husk.json create mode 100644 src/main/java/birsy/clinker/common/world/block/CarapaceHuskBlock.java create mode 100644 src/main/resources/assets/clinker/blockstates/carapace_husk.json create mode 100644 src/main/resources/assets/clinker/models/block/carapace_husk.json create mode 100644 src/main/resources/assets/clinker/textures/block/carapace_husk_bottom.png create mode 100644 src/main/resources/assets/clinker/textures/block/carapace_husk_end.png create mode 100644 src/main/resources/assets/clinker/textures/block/carapace_husk_side.png create mode 100644 src/main/resources/assets/clinker/textures/block/carapace_husk_side_1.png create mode 100644 src/main/resources/assets/clinker/textures/block/carapace_husk_top.png diff --git a/src/generated/resources/assets/clinker/lang/en_us.json b/src/generated/resources/assets/clinker/lang/en_us.json index e0913c6f..96325367 100644 --- a/src/generated/resources/assets/clinker/lang/en_us.json +++ b/src/generated/resources/assets/clinker/lang/en_us.json @@ -44,6 +44,7 @@ "block.clinker.capstone_slab": "Capstone Slab", "block.clinker.capstone_stairs": "Capstone Stairs", "block.clinker.capstone_wall": "Capstone Wall", + "block.clinker.carapace_husk": "Carapace Husk", "block.clinker.cave_fig_roots": "Cave Fig Roots", "block.clinker.cave_fig_stem": "Cave Fig Stem", "block.clinker.cave_sprouts": "Cave Sprouts", diff --git a/src/generated/resources/assets/clinker/models/item/carapace_husk.json b/src/generated/resources/assets/clinker/models/item/carapace_husk.json new file mode 100644 index 00000000..a762eaa5 --- /dev/null +++ b/src/generated/resources/assets/clinker/models/item/carapace_husk.json @@ -0,0 +1,3 @@ +{ + "parent": "clinker:block/carapace_husk" +} \ No newline at end of file diff --git a/src/generated/resources/data/clinker/loot_table/blocks/carapace_husk.json b/src/generated/resources/data/clinker/loot_table/blocks/carapace_husk.json new file mode 100644 index 00000000..f1abfcb7 --- /dev/null +++ b/src/generated/resources/data/clinker/loot_table/blocks/carapace_husk.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "clinker:carapace_husk" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "clinker:blocks/carapace_husk" +} \ No newline at end of file diff --git a/src/main/java/birsy/clinker/common/world/block/CarapaceHuskBlock.java b/src/main/java/birsy/clinker/common/world/block/CarapaceHuskBlock.java new file mode 100644 index 00000000..424f9c61 --- /dev/null +++ b/src/main/java/birsy/clinker/common/world/block/CarapaceHuskBlock.java @@ -0,0 +1,72 @@ +package birsy.clinker.common.world.block; + +import birsy.clinker.core.registry.ClinkerBlocks; +import com.mojang.serialization.MapCodec; +import net.minecraft.Util; +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.util.Mth; +import net.minecraft.util.RandomSource; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.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.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; +import net.minecraft.world.level.block.state.properties.Tilt; +import net.minecraft.world.phys.shapes.BooleanOp; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import net.minecraft.world.ticks.ScheduledTick; + +public class CarapaceHuskBlock extends HorizontalDirectionalBlock { + public static final MapCodec CODEC = simpleCodec(CarapaceHuskBlock::new); + public static final BooleanProperty DECAYING = BooleanProperty.create("decaying"); + + @Override + public MapCodec codec() { + return CODEC; + } + + public CarapaceHuskBlock(BlockBehaviour.Properties properties) { + super(properties); + this.registerDefaultState(this.stateDefinition.any() + .setValue(DECAYING, false) + ); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(FACING, DECAYING); + } + + @Override + public BlockState getStateForPlacement(BlockPlaceContext context) { + return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite()); + } + + @Override + public void stepOn(Level level, BlockPos pos, BlockState state, Entity entity) { + if (!state.getValue(DECAYING) && !level.isClientSide) { + int i = level.random.nextIntBetweenInclusive(10, 15); + level.playSound(null, entity, SoundEvents.FUNGUS_STEP, entity.getSoundSource(), 0.125F, 0.125F); + level.setBlock(pos, state.setValue(DECAYING, true), 2); + level.scheduleTick(pos, this, i); + } + super.stepOn(level, pos, state, entity); + } + + @Override + protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + if (state.getValue(DECAYING)) { + level.destroyBlock(pos, true); + } + } + +} diff --git a/src/main/java/birsy/clinker/core/registry/ClinkerBlocks.java b/src/main/java/birsy/clinker/core/registry/ClinkerBlocks.java index 38423a49..17570ad9 100644 --- a/src/main/java/birsy/clinker/core/registry/ClinkerBlocks.java +++ b/src/main/java/birsy/clinker/core/registry/ClinkerBlocks.java @@ -482,6 +482,13 @@ public static BlockBehaviour.Properties getOthershoreWoodProperties(MapColor col ); //Special + public static final DeferredBlock CARAPACE_HUSK = createBlock("carapace_husk", () -> new CarapaceHuskBlock(BlockBehaviour.Properties.of() + .noOcclusion() + .pushReaction(PushReaction.DESTROY) + .strength(0.4F) + .mapColor(MapColor.TERRACOTTA_GRAY) + .sound(SoundType.FROGLIGHT) + )); public static final DeferredBlock BLANK_SARCOPHAGUS = createBlock("blank_sarcophagus", () -> new SarcophagusBlock(BlockBehaviour.Properties.ofFullCopy(BRIMSTONE.get()).noOcclusion())); public static void defineFlammability(FireBlock fire) { diff --git a/src/main/java/birsy/clinker/core/registry/ClinkerCreativeModeTabs.java b/src/main/java/birsy/clinker/core/registry/ClinkerCreativeModeTabs.java index 93bc0a3e..89f9a167 100644 --- a/src/main/java/birsy/clinker/core/registry/ClinkerCreativeModeTabs.java +++ b/src/main/java/birsy/clinker/core/registry/ClinkerCreativeModeTabs.java @@ -146,6 +146,7 @@ public static void addBlocks(CreativeModeTab.ItemDisplayParameters pParameters, pOutput.accept(STROMATOLITE.get()); + pOutput.accept(CARAPACE_HUSK.get()); pOutput.accept(PEAT_MOSS.get()); pOutput.accept(PEAT_MOSS_BUDS.get()); pOutput.accept(INDIGO_TORMENTIL.get()); diff --git a/src/main/java/birsy/clinker/datagen/providers/ClinkerBlockStateProvider.java b/src/main/java/birsy/clinker/datagen/providers/ClinkerBlockStateProvider.java index 791aceb8..f01e4474 100644 --- a/src/main/java/birsy/clinker/datagen/providers/ClinkerBlockStateProvider.java +++ b/src/main/java/birsy/clinker/datagen/providers/ClinkerBlockStateProvider.java @@ -617,6 +617,11 @@ protected void registerStatesAndModels() { ); this.flatBlockItem(CAVE_SPROUTS.get()); + this.simpleBlockItem( + CARAPACE_HUSK.get(), + this.models().getExistingFile(this.modLoc(ModelProvider.BLOCK_FOLDER + "/" + "carapace_husk")) + ); + this.simpleBlockItem( PEAT_MOSS.get(), this.models().getExistingFile(this.modLoc(ModelProvider.BLOCK_FOLDER + "/" + "peat_moss")) diff --git a/src/main/resources/assets/clinker/blockstates/carapace_husk.json b/src/main/resources/assets/clinker/blockstates/carapace_husk.json new file mode 100644 index 00000000..ed748fa3 --- /dev/null +++ b/src/main/resources/assets/clinker/blockstates/carapace_husk.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "clinker:block/carapace_husk", + "y": 90 + }, + "facing=north": { + "model": "clinker:block/carapace_husk" + }, + "facing=south": { + "model": "clinker:block/carapace_husk", + "y": 180 + }, + "facing=west": { + "model": "clinker:block/carapace_husk", + "y": 270 + } + } +} diff --git a/src/main/resources/assets/clinker/models/block/carapace_husk.json b/src/main/resources/assets/clinker/models/block/carapace_husk.json new file mode 100644 index 00000000..d4227530 --- /dev/null +++ b/src/main/resources/assets/clinker/models/block/carapace_husk.json @@ -0,0 +1,57 @@ +{ + "format_version": "1.21.11", + "credit": "Made with Blockbench", + "textures": { + "0": "clinker:block/carapace_husk_bottom", + "1": "clinker:block/carapace_husk_end", + "2": "clinker:block/carapace_husk_side", + "3": "clinker:block/carapace_husk_side_1", + "4": "clinker:block/carapace_husk_top", + "particle": "clinker:block/carapace_husk_bottom" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 16, 16], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#1"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#3"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#1"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#2"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "down": {"uv": [0, 0, 16, 16], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, -135, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, -135, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/clinker/textures/block/carapace_husk_bottom.png b/src/main/resources/assets/clinker/textures/block/carapace_husk_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..3ca46d81313760fc31146b6a222048cb38ec562e GIT binary patch literal 226 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|=6Jd|hFJ9O z4K@@yY`_t`@Y9WjfB(BL-aK1z;q&60bb z{@yT8)_}p|$-_dih$2U+&VREqeBmy3WtZDxPyg&~`mx>mPx$MM*?KR5*>5lg(~}Fc5^l8rvd3LZtN8Yo(t1{twbeh*YV{9}u(~r#%q6&x>eKqErsJpg$zBSNJI!1)}No=w-JIRKm4p{P$+=X1*0f_D3n>L}!V zP7Q>E5P3E#hl8-(tPoXH-*C>Ms>#VY2Y`2u>7-1CHm4ow6)~R0naDAnd@J5c{!(l_(}{9rbebH`d0zoRwtFXblQaMT002ovPDHLkV1lVAvg!Z; literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/clinker/textures/block/carapace_husk_side.png b/src/main/resources/assets/clinker/textures/block/carapace_husk_side.png new file mode 100644 index 0000000000000000000000000000000000000000..f82ea1b6ade5ddffb2e5a82d8e83339c0b71e7f7 GIT binary patch literal 451 zcmV;!0X+VRP)Px$eMv+?R5*=ol2MD>Fc5^l#`co>)H(rk5DI-N^tu242L+ClTynC`>_*%@D3ay0 z`(#$Lvoo{)^5^%j4*;)9P@|WQp?Aca@>n&-i2$(4kGb(U+_XZ|%0HO=wy6QVbR1vL zW%$KUT!JUwv=H^u0kG}Avm1Xb3Ud8?KJelvyeiM`2`5s(kG7`kU)uk9J?!>$vgP!8 zx_duiIwz%?@N>8V(AHj2#dId#lz3Cd-3U;6*=n``(E2;01A-buza;MUvzw#-=s}x;O%`{1r^i^c-)QU3Qa4-o6^a4xk9})$xMp8 zraVmN)tgsk4%bBBM2ftcsP5Px$Wl2OqR5*=olEH4=FbqUr*D~R{ZoC2Z669K-=l=f(R14le zt~;ZWyn;{1Q{6%rjJ$~6hHVRN*Hz}KC`#mI^QPpY#4TM`g2}APYl+(UIYsg!a$X4w zQQZQ-)BMQG`Hi37e~{!mC6gI1=Qp0_N1{~Kg#s!a<<2x4ZM?m=C&^a@Nlwn<{o}eD zW3;{&CpmH_YQuG%5pot?XFKKsNX<{0^R}rLALNb!^0kxuCbz)U#N-a{Sl=Ue{sHBM V>-dfIfv*4n002ovPDHLkV1gAB!I%I5 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/clinker/textures/block/carapace_husk_top.png b/src/main/resources/assets/clinker/textures/block/carapace_husk_top.png new file mode 100644 index 0000000000000000000000000000000000000000..52ccc949b89f95ff71bbc30a288c51c3da324521 GIT binary patch literal 398 zcmV;90df9`P)Px$NJ&INR5*=&lR;~PKoEt$=sJiIE7WtL(9(1N|Bos3(ozg0vJn}T^k8PQ8rnIn zLw5x8!91kArP8nl3y8b08bbZ-rrs>+uKa