Skip to content

Commit

Permalink
feat(worldgen): move more to datagen
Browse files Browse the repository at this point in the history
  • Loading branch information
CallMeEchoCodes committed Nov 24, 2024
1 parent 4bb2295 commit fccdd97
Show file tree
Hide file tree
Showing 21 changed files with 464 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,29 @@
"config": {
"decorators": [
{
"type": "hollow:branch_tree_decorator",
"type": "hollow:polypore_tree_decorator",
"provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:birch_log"
"Name": "hollow:polypore",
"Properties": {
"amount": "1",
"facing": "north"
}
}
},
"max_amount": 2,
"probability": 0.5
}
},
{
"type": "hollow:polypore_tree_decorator",
"type": "hollow:branch_tree_decorator",
"max_amount": 2,
"probability": 0.5,
"provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "hollow:polypore"
"Name": "minecraft:birch_log",
"Properties": {
"axis": "y"
}
}
}
}
Expand All @@ -31,11 +38,11 @@
},
"foliage_placer": {
"type": "hollow:blob_with_hanging",
"hanging_leaves_chance": 0.25,
"hanging_leaves_extension_chance": 0.4,
"height": 3,
"offset": 0,
"radius": 2,
"hanging_leaves_chance": 0.25,
"hanging_leaves_extension_chance": 0.4
"radius": 2
},
"foliage_provider": {
"type": "minecraft:simple_state_provider",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"type": "minecraft:random_patch",
"config": {
"tries": 10,
"xz_spread": 7,
"y_spread": 3,
"feature": {
"feature": {
"type": "minecraft:simple_block",
Expand All @@ -12,16 +9,16 @@
"type": "minecraft:weighted_state_provider",
"entries": [
{
"weight": 4,
"data": {
"Name": "minecraft:lily_pad"
}
},
"weight": 4
},
{
"weight": 1,
"data": {
"Name": "hollow:lotus_lilypad"
}
},
"weight": 1
}
]
}
Expand All @@ -36,6 +33,9 @@
}
}
]
}
},
"tries": 10,
"xz_spread": 7,
"y_spread": 3
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,29 @@
"config": {
"decorators": [
{
"type": "hollow:branch_tree_decorator",
"type": "hollow:polypore_tree_decorator",
"provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:birch_log"
"Name": "hollow:polypore",
"Properties": {
"amount": "1",
"facing": "north"
}
}
},
"max_amount": 5,
"probability": 0.5
}
},
{
"type": "hollow:polypore_tree_decorator",
"type": "hollow:branch_tree_decorator",
"max_amount": 5,
"probability": 0.5,
"provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "hollow:polypore"
"Name": "minecraft:birch_log",
"Properties": {
"axis": "y"
}
}
}
}
Expand All @@ -31,11 +38,11 @@
},
"foliage_placer": {
"type": "hollow:blob_with_hanging",
"hanging_leaves_chance": 0.25,
"hanging_leaves_extension_chance": 0.4,
"height": 3,
"offset": 0,
"radius": 2,
"hanging_leaves_chance": 0.25,
"hanging_leaves_extension_chance": 0.4
"radius": 2
},
"foliage_provider": {
"type": "minecraft:simple_state_provider",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
},
{
"type": "hollow:big_branch_tree_decorator",
"probability": 0.5,
"provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:oak_log"
"Name": "minecraft:oak_log",
"Properties": {
"axis": "y"
}
}
},
"probability": 0.5
}
}
],
"dirt_provider": {
Expand All @@ -25,11 +28,11 @@
},
"foliage_placer": {
"type": "hollow:blob_with_hanging",
"hanging_leaves_chance": 1.0,
"hanging_leaves_extension_chance": 0.5,
"height": 3,
"offset": 0,
"radius": 3,
"hanging_leaves_chance": 1.0,
"hanging_leaves_extension_chance": 0.5
"radius": 3
},
"foliage_provider": {
"type": "minecraft:simple_state_provider",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{
"feature": "hollow:birch_tall",
"placement": [
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
},
{
"type": "minecraft:count",
"count": {
"type": "minecraft:weighted_list",
"distribution": [
{
"data": 3,
"data": 10,
"weight": 9
},
{
"data": 4,
"data": 11,
"weight": 1
}
]
Expand All @@ -25,11 +29,19 @@
"max_water_depth": 0
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR"
"type": "minecraft:biome"
},
{
"type": "minecraft:biome"
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:would_survive",
"state": {
"Name": "minecraft:birch_sapling",
"Properties": {
"stage": "0"
}
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
"feature": "hollow:cattails",
"placement": [
{
"type": "minecraft:in_square"
"type": "minecraft:count",
"count": 2
},
{
"type": "minecraft:rarity_filter",
"chance": 2
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR_WG"
},
{
"type": "minecraft:count",
"count": 32
"type": "minecraft:biome"
},
{
"type": "minecraft:biome"
"type": "minecraft:in_square"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
"placement": [
{
"type": "minecraft:count",
"count": 4
"count": 1
},
{
"type": "minecraft:rarity_filter",
"chance": 2
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
},
{
"type": "minecraft:in_square"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"type": "minecraft:rarity_filter",
"chance": 2
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
},
{
"type": "minecraft:in_square"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"type": "minecraft:count",
"count": 4
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
},
{
"type": "minecraft:in_square"
}
]
}
11 changes: 11 additions & 0 deletions src/main/java/dev/spiritstudios/hollow/block/CattailBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ public BlockState getPlacementState(ItemPlacementContext ctx) {
return null;
}

@Override
protected boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
boolean canPlace = true;
if (state.get(PIECE) == Piece.BASE) {
FluidState fluidState = world.getFluidState(pos);
if (!fluidState.isIn(FluidTags.WATER) || fluidState.getLevel() != 8) canPlace = false;

}
return super.canPlaceAt(state, world, pos) && canPlace;
}

@Override
protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
return SHAPE;
Expand Down
Loading

0 comments on commit fccdd97

Please sign in to comment.