Skip to content

Commit

Permalink
Merge pull request #167 from Hojosa/trees
Browse files Browse the repository at this point in the history
small improvents for trees
  • Loading branch information
Alatyami authored Oct 23, 2024
2 parents 7b0cb8d + a9b7cfd commit 7675d5d
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"distribution": [
{
"data": 0,
"weight": 19
"weight": 49
},
{
"data": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"distribution": [
{
"data": 0,
"weight": 19
"weight": 49
},
{
"data": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"growthcraft_bamboo:bamboo_post_vertical",
"growthcraft_bamboo:bamboo_post_horizontal",
"growthcraft_milk:churn",
"growthcraft_milk:hanging_sign_1_oak",
"growthcraft_milk:hanging_sign_2_spruce",
"growthcraft_milk:hanging_sign_1_oak",
"growthcraft_milk:hanging_sign_2_oak",
"growthcraft_milk:hanging_sign_1_spruce"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static void bootstrap(BootstapContext<PlacedFeature> context) {
HolderGetter<ConfiguredFeature<?, ?>> configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE);

register(context, APPLE_TREE_PLACED_KEY, configuredFeatures.getOrThrow(GrowthcraftApplesConfiguredFeatures.APPLE_TREE_KEY),
VegetationPlacements.treePlacement(PlacementUtils.countExtra(0, 0.05F, 1), GrowthcraftApplesBlocks.APPLE_TREE_SAPLING.get()));
VegetationPlacements.treePlacement(PlacementUtils.countExtra(0, 0.02F, 1), GrowthcraftApplesBlocks.APPLE_TREE_SAPLING.get()));
}

private static ResourceKey<PlacedFeature> createKey(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static void bootstrap(BootstapContext<PlacedFeature> context) {
HolderGetter<ConfiguredFeature<?, ?>> configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE);

register(context, CORK_TREE_PLACED_KEY, configuredFeatures.getOrThrow(GrowthcraftCellarConfiguredFeatures.CORK_TREE_KEY),
VegetationPlacements.treePlacement(PlacementUtils.countExtra(0, 0.05F, 1), GrowthcraftCellarBlocks.CORK_TREE_SAPLING.get()));
VegetationPlacements.treePlacement(PlacementUtils.countExtra(0, 0.02F, 1), GrowthcraftCellarBlocks.CORK_TREE_SAPLING.get()));
}

private static ResourceKey<PlacedFeature> createKey(String name) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/growthcraft/lib/block/GrowthcraftLogBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.ToolAction;
import net.minecraftforge.common.ToolActions;

public class GrowthcraftLogBlock extends RotatedPillarBlock {
public GrowthcraftLogBlock() {
Expand Down Expand Up @@ -51,7 +52,7 @@ public int getFireSpreadSpeed(BlockState state, BlockGetter level, BlockPos pos,
//we could also do sub classes or our own map to match logs&stripped logs, but for 4 blocks, this should be enough
@Override
public @Nullable BlockState getToolModifiedState(BlockState state, UseOnContext context, ToolAction toolAction, boolean simulate) {
if (context.getItemInHand().getItem() instanceof AxeItem) {
if (context.getItemInHand().canPerformAction(ToolActions.AXE_STRIP)) {
if(state.is(GrowthcraftApplesBlocks.APPLE_WOOD_LOG.get())) {
return GrowthcraftApplesBlocks.APPLE_WOOD_LOG_STRIPPED.get().defaultBlockState().setValue(AXIS, state.getValue(AXIS));
}
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7675d5d

Please sign in to comment.