-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Tiny Cactus plants to the Dryland
- Loading branch information
Showing
28 changed files
with
325 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...generated/resources/data/biomesoplenty/worldgen/configured_feature/patch_tiny_cactus.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"type": "minecraft:random_patch", | ||
"config": { | ||
"feature": { | ||
"feature": { | ||
"type": "minecraft:simple_block", | ||
"config": { | ||
"to_place": { | ||
"type": "minecraft:simple_state_provider", | ||
"state": { | ||
"Name": "biomesoplenty:tiny_cactus" | ||
} | ||
} | ||
} | ||
}, | ||
"placement": [ | ||
{ | ||
"type": "minecraft:block_predicate_filter", | ||
"predicate": { | ||
"type": "minecraft:matching_blocks", | ||
"blocks": "minecraft:air" | ||
} | ||
} | ||
] | ||
}, | ||
"tries": 96, | ||
"xz_spread": 7, | ||
"y_spread": 3 | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/generated/resources/data/biomesoplenty/worldgen/placed_feature/patch_dead_bush_4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"feature": "minecraft:patch_dead_bush", | ||
"placement": [ | ||
{ | ||
"type": "minecraft:count", | ||
"count": 4 | ||
}, | ||
{ | ||
"type": "minecraft:in_square" | ||
}, | ||
{ | ||
"type": "minecraft:heightmap", | ||
"heightmap": "WORLD_SURFACE_WG" | ||
}, | ||
{ | ||
"type": "minecraft:biome" | ||
} | ||
] | ||
} |
19 changes: 19 additions & 0 deletions
19
src/generated/resources/data/biomesoplenty/worldgen/placed_feature/patch_tiny_cactus.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"feature": "biomesoplenty:patch_tiny_cactus", | ||
"placement": [ | ||
{ | ||
"type": "minecraft:rarity_filter", | ||
"chance": 2 | ||
}, | ||
{ | ||
"type": "minecraft:in_square" | ||
}, | ||
{ | ||
"type": "minecraft:heightmap", | ||
"heightmap": "MOTION_BLOCKING" | ||
}, | ||
{ | ||
"type": "minecraft:biome" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/java/biomesoplenty/common/block/TinyCactusBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/******************************************************************************* | ||
* Copyright 2022, the Glitchfiend Team. | ||
* All rights reserved. | ||
******************************************************************************/ | ||
package biomesoplenty.common.block; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.tags.BlockTags; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.level.BlockGetter; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.LevelReader; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.BushBlock; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.pathfinder.PathComputationType; | ||
import net.minecraft.world.phys.shapes.CollisionContext; | ||
import net.minecraft.world.phys.shapes.VoxelShape; | ||
import net.minecraftforge.common.IPlantable; | ||
|
||
public class TinyCactusBlock extends BushBlock implements IPlantable | ||
{ | ||
protected static final VoxelShape NORMAL = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D); | ||
|
||
public TinyCactusBlock(Properties properties) | ||
{ | ||
super(properties); | ||
} | ||
|
||
@Override | ||
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext selectionContext) | ||
{ | ||
return NORMAL; | ||
} | ||
|
||
@Override | ||
public boolean canSurvive(BlockState state, LevelReader worldIn, BlockPos pos) | ||
{ | ||
BlockState groundState = worldIn.getBlockState(pos.below()); | ||
|
||
return groundState.is(BlockTags.DIRT) || groundState.is(BlockTags.SAND); | ||
} | ||
|
||
@Override | ||
public void entityInside(BlockState p_51148_, Level p_51149_, BlockPos p_51150_, Entity p_51151_) | ||
{ | ||
p_51151_.hurt(p_51149_.damageSources().cactus(), 1.0F); | ||
} | ||
|
||
@Override | ||
public boolean isPathfindable(BlockState p_51143_, BlockGetter p_51144_, BlockPos p_51145_, PathComputationType p_51146_) | ||
{ | ||
return false; | ||
} | ||
|
||
// @Override | ||
// public PlantType getPlantType(BlockGetter world, BlockPos pos) | ||
// { | ||
// return PlantType.PLAINS; | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.