Skip to content

Commit 2f12560

Browse files
committed
Fixed #20 #19 #10
1 parent 41c4b9e commit 2f12560

8 files changed

Lines changed: 122 additions & 5 deletions

File tree

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
mod_id=dtphc2
33
mod_name=Dynamic Trees PHC2
44
mod_license=MIT
5-
mod_version=1.4.0-BETA01
6-
version_type=beta
5+
mod_version=1.4.0
6+
version_type=stable
77
mod_group_id=maxhyper.dtphc2
88
mod_authors=Max Hyper
99
mod_credits=Ferreusveritas, ChefExperte and HawkSteak

src/main/java/maxhyper/dtphc2/blocks/IFallingFruit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ default boolean doFall(BlockState state, Level world, BlockPos pos){
4242
if (!world.hasNearbyAlivePlayer(pos.getX(), rootY, pos.getZ(), getPlayerDistanceToFall())){
4343
return false;
4444
}
45-
if (pos.getY() >= 0 && FallingBlock.isFree(world.getBlockState(pos.below()))) {
45+
if (pos.getY() >= world.getMinBuildHeight() && FallingBlock.isFree(world.getBlockState(pos.below()))) {
4646
if (world.isLoaded(pos)) {
4747
if (!world.isClientSide()) {
4848
FallingBlockEntity fallingBlockEntity = getFallingEntity(world, pos, state);

src/main/java/maxhyper/dtphc2/genfeatures/SyrupGenFeature.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,14 @@ private void dripSyrup(LevelAccessor world, BlockPos rootPos) {
7575
}
7676

7777
public float seasonalFruitProductionFactor(LevelContext levelContext, BlockPos pos, GenFeatureConfiguration config) {
78-
float season = SeasonHelper.getSeasonValue(levelContext, pos);
79-
return config.getAsOptional(SEASONAL_OFFSET).isPresent() ? SeasonHelper.globalSeasonalFruitProductionFactor(levelContext, new BlockPos(0,(int)(season*64),-1), -config.get(SEASONAL_OFFSET), true) : 1.0F;
78+
Float season = SeasonHelper.getSeasonValue(levelContext, pos);
79+
if (config.getAsOptional(SEASONAL_OFFSET).isEmpty() || season == null) return 1.0f;
80+
81+
return SeasonHelper.globalSeasonalFruitProductionFactor(
82+
levelContext,
83+
new BlockPos(0,(int)(season*64),-1),
84+
-config.get(SEASONAL_OFFSET),
85+
true);
8086
}
8187

8288
}

src/main/resources/META-INF/neoforge.mods.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,9 @@ file="META-INF/accesstransformer.cfg"
7272
modId="dtterralith"
7373
type="optional"
7474
versionRange="(0.0,)"
75+
ordering="AFTER"
76+
[[dependencies.${mod_id}]]
77+
modId="dtbloomingnature"
78+
type="optional"
79+
versionRange="(0.0,)"
7580
ordering="AFTER"

src/main/resources/data/dtphc2/loot_table/blocks/passion_fruit_vine.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,41 @@
1818
}
1919
}
2020
]
21+
},
22+
{
23+
"rolls": 1.0,
24+
"entries": [
25+
{
26+
"type": "minecraft:item",
27+
"name": "dtphc2:passion_fruit_vine"
28+
}
29+
],
30+
"conditions": [
31+
{
32+
"condition": "minecraft:any_of",
33+
"terms": [
34+
{
35+
"ability": "shears_dig",
36+
"condition": "neoforge:can_item_perform_ability"
37+
},
38+
{
39+
"condition": "minecraft:match_tool",
40+
"predicate": {
41+
"predicates": {
42+
"minecraft:enchantments": [
43+
{
44+
"enchantments": "minecraft:silk_touch",
45+
"levels": {
46+
"min": 1
47+
}
48+
}
49+
]
50+
}
51+
}
52+
}
53+
]
54+
}
55+
]
2156
}
2257
],
2358
"functions": [

src/main/resources/data/dtphc2/loot_table/blocks/peppercorn_vine.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,41 @@
3636
}
3737
}
3838
]
39+
},
40+
{
41+
"rolls": 1.0,
42+
"entries": [
43+
{
44+
"type": "minecraft:item",
45+
"name": "dtphc2:peppercorn_vine"
46+
}
47+
],
48+
"conditions": [
49+
{
50+
"condition": "minecraft:any_of",
51+
"terms": [
52+
{
53+
"ability": "shears_dig",
54+
"condition": "neoforge:can_item_perform_ability"
55+
},
56+
{
57+
"condition": "minecraft:match_tool",
58+
"predicate": {
59+
"predicates": {
60+
"minecraft:enchantments": [
61+
{
62+
"enchantments": "minecraft:silk_touch",
63+
"levels": {
64+
"min": 1
65+
}
66+
}
67+
]
68+
}
69+
}
70+
}
71+
]
72+
}
73+
]
3974
}
4075
],
4176
"functions": [

src/main/resources/data/dtphc2/loot_table/blocks/vanilla_vine.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,41 @@
1818
}
1919
}
2020
]
21+
},
22+
{
23+
"rolls": 1.0,
24+
"entries": [
25+
{
26+
"type": "minecraft:item",
27+
"name": "dtphc2:vanilla_vine"
28+
}
29+
],
30+
"conditions": [
31+
{
32+
"condition": "minecraft:any_of",
33+
"terms": [
34+
{
35+
"ability": "shears_dig",
36+
"condition": "neoforge:can_item_perform_ability"
37+
},
38+
{
39+
"condition": "minecraft:match_tool",
40+
"predicate": {
41+
"predicates": {
42+
"minecraft:enchantments": [
43+
{
44+
"enchantments": "minecraft:silk_touch",
45+
"levels": {
46+
"min": 1
47+
}
48+
}
49+
]
50+
}
51+
}
52+
}
53+
]
54+
}
55+
]
2156
}
2257
],
2358
"functions": [

src/main/resources/trees/dynamictrees/species/oak.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"can_craft_seed_to_sapling": false
2525
}
2626
],
27+
"drop_seeds": true,
2728
"fruits": [
2829
"dtphc2:acorn"
2930
],

0 commit comments

Comments
 (0)