Skip to content

Commit

Permalink
heightmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
AViewFromTheTop committed Feb 28, 2025
1 parent f581231 commit 22b66fc
Show file tree
Hide file tree
Showing 39 changed files with 273 additions and 57 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,12 @@ hi
- Grows in length if below a Fragile Ice block, or an ice block with water above.
- Occasionally spreads to other ice blocks if able to grow in length.
- Will occasionally fall if placed under an ice block.
- Certain vibrations, such as explosions and falling, will cause icicles to fall.
- Game Events in the `wilderwild:makes_icicle_fall` game event tag will cause nearby Icicles to fall.
- Added Fragile Ice.
- Will crack twice when stood on before shattering.
- Shatters when an entity falls onto the block.
- When shattered, all adjacent Fragile Ice blocks will shatter.
- Ice can be smelted into Fragile Ice.
- Mobs in the `wilderwild:fragile_ice_unwalkable_mobs` entity tag will crack, then shatter Fragile Ice when standing on it.
- Mobs not in the `wilderwild:fragile_ice_doesnt_crack_on_fall` entity tag will cause Fragile Ice to shatter when falling onto it.
- Revamped the Frozen Caves biome, removing snow patches and utilizing Fragile Ice and Icicles.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"wilderwild:falling_icicle"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"wilderwild:prickly_pear"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_ice": {
"conditions": {
"items": [
{
"items": "minecraft:ice"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "wilderwild:fragile_ice"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_ice"
]
],
"rewards": {
"recipes": [
"wilderwild:fragile_ice"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "fallingIcicle",
"scaling": "when_caused_by_living_non_player"
}
12 changes: 12 additions & 0 deletions src/main/generated/data/wilderwild/recipe/fragile_ice.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "minecraft:smelting",
"category": "blocks",
"cookingtime": 100,
"experience": 0.05,
"ingredient": {
"item": "minecraft:ice"
},
"result": {
"id": "wilderwild:fragile_ice"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values": [
{
"id": "#minecraft:ice",
"required": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"values": [
"minecraft:phantom",
"minecraft:breeze",
"minecraft:chicken",
"minecraft:cat",
"minecraft:ocelot",
"minecraft:rabbit",
"minecraft:item",
"minecraft:parrot",
"minecraft:bee",
"minecraft:bat",
"minecraft:allay",
"minecraft:experience_orb",
"wilderwild:firefly",
"wilderwild:butterfly",
"wilderwild:tumbleweed"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,8 @@
[],
[
"minecraft:glow_lichen",
"minecraft:patch_tall_grass_2",
"minecraft:trees_plains",
"minecraft:flower_plains",
"minecraft:patch_grass_plain",
"minecraft:brown_mushroom_normal",
"minecraft:red_mushroom_normal",
"minecraft:patch_sugar_cane",
"minecraft:patch_pumpkin"
"minecraft:red_mushroom_normal"
],
[
"minecraft:freeze_top_layer",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"type": "frozenlib:fading_disk_feature",
"config": {
"fade_start_distance_percent": 0.8,
"heightmap": "MOTION_BLOCKING_NO_LEAVES",
"inner_chance": 0.925,
"inner_percent": 0.65,
"inner_replaceable_blocks": "#wilderwild:feature/surface_fragile_ice_replaceable",
"inner_state": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "wilderwild:fragile_ice",
"Properties": {
"age": "0"
}
}
},
"outer_replaceable_blocks": "#wilderwild:feature/surface_fragile_ice_replaceable",
"outer_state": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "wilderwild:fragile_ice",
"Properties": {
"age": "0"
}
}
},
"placement_chance": 0.95,
"radius": {
"type": "minecraft:uniform",
"max_inclusive": 6,
"min_inclusive": 2
},
"use_heightmap_instead_of_circular_placement": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"blocks": "minecraft:coarse_dirt"
}
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR_WG"
},
{
"type": "minecraft:random_offset",
"xz_spread": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:block_predicate_filter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:block_predicate_filter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"tag": "wilderwild:feature/red_sand_transition_placeable"
}
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"tag": "wilderwild:feature/sand_transition_placeable"
}
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:block_predicate_filter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:biome"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ public void stepOn(Level level, BlockPos blockPos, BlockState blockState, @NotNu
@Override
public void fallOn(Level level, BlockState blockState, BlockPos blockPos, Entity entity, float fallDistance) {
super.fallOn(level, blockState, blockPos, entity, fallDistance);
if (fallDistance >= 4F) this.scheduleShatter(level, blockPos, blockState);
if (!entity.getType().is(WWEntityTags.FRAGILE_ICE_DOESNT_CRACK_ON_FALL)) {
if (fallDistance >= 4F) this.scheduleShatter(level, blockPos, blockState);
}
}

public void scheduleShatter(@NotNull Level level, BlockPos blockPos, @NotNull BlockState blockState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import net.frozenblock.wilderwild.block.impl.SnowloggingUtils;
import net.frozenblock.wilderwild.registry.WWBlockEntityTypes;
import net.frozenblock.wilderwild.registry.WWBlocks;
import net.frozenblock.wilderwild.registry.WWDamageTypes;
import net.frozenblock.wilderwild.tag.WWBlockTags;
import net.frozenblock.wilderwild.worldgen.impl.util.IcicleUtils;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -277,8 +278,7 @@ public void onBrokenAfterFall(@NotNull Level level, BlockPos blockPos, @NotNull

@Override
public @NotNull DamageSource getFallDamageSource(@NotNull Entity entity) {
// TODO: Icicle damage source
return entity.damageSources().fallingStalactite(entity);
return entity.damageSources().source(WWDamageTypes.FALLING_ICICLE, entity);
}

private static void spawnFallingIcicle(BlockState blockState, ServerLevel serverLevel, @NotNull BlockPos blockPos) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ public void buildRecipes(RecipeOutput exporter) {
.unlockedBy(getHasName(WWBlocks.SPONGE_BUD), has(WWBlocks.SPONGE_BUD))
.save(exporter, WWConstants.id(getConversionRecipeName(Items.SPONGE, WWBlocks.SPONGE_BUD)));

// ICE

SimpleCookingRecipeBuilder.smelting(Ingredient.of(Blocks.ICE), RecipeCategory.DECORATIONS, WWBlocks.FRAGILE_ICE.asItem(), 0.05F, 100)
.unlockedBy("has_ice", has(Blocks.ICE))
.save(exporter);

// MUD BRICKS

SimpleCookingRecipeBuilder.smelting(Ingredient.of(Blocks.MUD_BRICKS), RecipeCategory.BUILDING_BLOCKS, WWBlocks.CRACKED_MUD_BRICKS.asItem(), 0.1F, 200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ private void generateFeatures() {
.addOptionalTag(BlockTags.ICE)
.addOptionalTag(WWBlockTags.CAVE_ICE_REPLACEABLE);

this.getOrCreateTagBuilder(WWBlockTags.SURFACE_FRAGILE_ICE_REPLACEABLE)
.addOptionalTag(BlockTags.ICE);

this.getOrCreateTagBuilder(WWBlockTags.DIORITE_ICE_REPLACEABLE)
.add(Blocks.GRAVEL)
.addOptionalTag(BlockTags.DIRT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public void addTags(@NotNull HolderLookup.Provider arg) {
this.getOrCreateTagBuilder(DamageTypeTags.PANIC_CAUSES)
.add(WWDamageTypes.TUMBLEWEED);

this.getOrCreateTagBuilder(DamageTypeTags.BYPASSES_SHIELD)
.add(WWDamageTypes.FALLING_ICICLE);

this.getOrCreateTagBuilder(DamageTypeTags.NO_KNOCKBACK)
.add(WWDamageTypes.PRICKLY_PEAR);

this.getOrCreateTagBuilder(WWDamageTypeTags.EMPTY);
}
}
Loading

0 comments on commit 22b66fc

Please sign in to comment.