Skip to content

Commit 9f1ee63

Browse files
committed
Fix BlockPileFeature
1 parent 4fbbf0d commit 9f1ee63

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
NoFeatureConfig.NO_FEATURE_CONFIG
1+
<#include "mcitems.ftl">
2+
${toStatetoFeatureState(input$block)}

src/main/resources/forge-1.14.4/templates/feature/feature.java.ftl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class ${name}Feature extends ${generator.map(featuretype, "features")} {
7070
public static Feature<?> feature() {
7171
Random random = new Random();
7272
FEATURE = new ${name}Feature();
73-
CONFIGURED_FEATURE = new ConfiguredFeature<>(Feature.DECORATED, new DecoratedFeatureConfig(FEATURE, <#if featuretype == "configured_feature_reference">${nonHardcodedConfiguration}<#else><#if nonHardcodedConfiguration == "">NoFeatureConfig.NO_FEATURE_CONFIG<#else>${nonHardcodedConfiguration}</#if></#if>, Placement.NOPE, IPlacementConfig.NO_PLACEMENT_CONFIG));
73+
CONFIGURED_FEATURE = new ConfiguredFeature<>(Feature.DECORATED, new DecoratedFeatureConfig(FEATURE, <#if featuretype == "configured_feature_reference">${nonHardcodedConfiguration}<#else><#if nonHardcodedConfiguration == "" || generator.map(featuretype, "features") == "BlockPileFeature">NoFeatureConfig.NO_FEATURE_CONFIG<#else>${nonHardcodedConfiguration}</#if></#if>, Placement.NOPE, IPlacementConfig.NO_PLACEMENT_CONFIG));
7474

7575
return FEATURE;
7676
}
@@ -155,6 +155,12 @@ public class ${name}Feature extends ${generator.map(featuretype, "features")} {
155155
return true;
156156
}
157157
</#if>
158+
159+
<#if generator.map(featuretype, "features") == "BlockPileFeature">
160+
@Override protected BlockState getRandomBlock(IWorld worldIn) {
161+
return ${nonHardcodedConfiguration};
162+
}
163+
</#if>
158164
}</#compress>
159165
<#-- @formatter:on -->
160166
<#function expandBiomeTag biomeTag>

src/main/resources/forge-1.14.4/utils/mcitems.ftl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,6 @@
362362
</#if>
363363
</#function>
364364

365-
<#function toStateProvidertoFeatureState block>
366-
<#return toFeatureState(mappedBlockToBlockStateProvider(block))>
367-
</#function>
368-
369365
<#function toStatetoFeatureState block>
370366
<#return toFeatureState(mappedBlockToBlockStateCode(block))>
371367
</#function>

0 commit comments

Comments
 (0)