Skip to content

Commit 126a6f6

Browse files
authored
feat: Finish Farming Station (#1209)
1 parent 7947600 commit 126a6f6

32 files changed

+473
-397
lines changed

enderio/src/datagen/java/com/enderio/enderio/datagen/common/loot/EIOBlockLootProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
public class EIOBlockLootProvider extends BlockLootSubProvider {
3030
public EIOBlockLootProvider(HolderLookup.Provider registries) {
31-
super(Set.of(), FeatureFlagSet.of(FeatureFlags.VANILLA, EIOFeatureFlags.ENDERFACE, EIOFeatureFlags.NIARD, EIOFeatureFlags.FARMING_STATION), registries);
31+
super(Set.of(), FeatureFlagSet.of(FeatureFlags.VANILLA, EIOFeatureFlags.ENDERFACE, EIOFeatureFlags.NIARD), registries);
3232
}
3333

3434
@Override

enderio/src/datagen/java/com/enderio/enderio/datagen/common/recipes/MachineRecipeProvider.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,19 @@ public void buildRecipes(RecipeOutput recipeOutput, HolderLookup.Provider regist
517517
InventoryChangeTrigger.TriggerInstance.hasItems(EIOItems.ZOMBIE_ELECTRODE.get()))
518518
.save(recipeOutput);
519519

520+
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, EIOBlocks.FARMING_STATION.get())
521+
.define('E', EIOTags.Items.GEARS_ENERGIZED)
522+
.define('G', EIOTags.Items.GEMS_PULSATING_CRYSTAL)
523+
.define('S', EIOTags.Items.INGOTS_SOULARIUM)
524+
.define('C', EIOBlocks.ENSOULED_CHASSIS.get())
525+
.define('D', EIOTags.Items.INGOTS_DARK_STEEL)
526+
.define('Z', EIOItems.Z_LOGIC_CONTROLLER.get())
527+
.pattern("EGE")
528+
.pattern("SCS")
529+
.pattern("DZD")
530+
.unlockedBy("has_ingredient", InventoryChangeTrigger.TriggerInstance.hasItems(EIOItems.SOULARIUM_INGOT))
531+
.save(recipeOutput);
532+
520533
// TODO: Enable once the block detector has a model.
521534
/*
522535
* ShapedRecipeBuilder .shaped(RecipeCategory.MISC,
@@ -558,6 +571,7 @@ public void buildRecipes(RecipeOutput recipeOutput, HolderLookup.Provider regist
558571
list.add(EIOBlocks.VACUUM_CHEST);
559572
list.add(EIOBlocks.TRAVEL_ANCHOR);
560573
list.add(EIOBlocks.WIRELESS_CHARGER);
574+
list.add(EIOBlocks.FARMING_STATION);
561575
return list;
562576
});
563577

enderio/src/datagen/java/com/enderio/enderio/datagen/common/tags/EIOBlockTagsProvider.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ protected void addTags(HolderLookup.Provider provider) {
251251
.add(EIOBlocks.SILENT_DARK_STEEL_PRESSURE_PLATE.get())
252252
.add(EIOBlocks.SOULARIUM_PRESSURE_PLATE.get())
253253
.add(EIOBlocks.SILENT_SOULARIUM_PRESSURE_PLATE.get());
254+
255+
tag(EIOTags.Blocks.CROPS_WITH_STEM)
256+
.add(Blocks.MELON)
257+
.add(Blocks.PUMPKIN);
254258
}
255259

256260
private void addMachineBlockTags() {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_ingredient": {
5+
"conditions": {
6+
"items": [
7+
{
8+
"items": "enderio:farming_station"
9+
}
10+
]
11+
},
12+
"trigger": "minecraft:inventory_changed"
13+
},
14+
"has_the_recipe": {
15+
"conditions": {
16+
"recipe": "enderio:erase_farming_station"
17+
},
18+
"trigger": "minecraft:recipe_unlocked"
19+
}
20+
},
21+
"requirements": [
22+
[
23+
"has_the_recipe",
24+
"has_ingredient"
25+
]
26+
],
27+
"rewards": {
28+
"recipes": [
29+
"enderio:erase_farming_station"
30+
]
31+
}
32+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_ingredient": {
5+
"conditions": {
6+
"items": [
7+
{
8+
"items": "enderio:soularium_ingot"
9+
}
10+
]
11+
},
12+
"trigger": "minecraft:inventory_changed"
13+
},
14+
"has_the_recipe": {
15+
"conditions": {
16+
"recipe": "enderio:farming_station"
17+
},
18+
"trigger": "minecraft:recipe_unlocked"
19+
}
20+
},
21+
"requirements": [
22+
[
23+
"has_the_recipe",
24+
"has_ingredient"
25+
]
26+
],
27+
"rewards": {
28+
"recipes": [
29+
"enderio:farming_station"
30+
]
31+
}
32+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"type": "minecraft:crafting_shapeless",
3+
"category": "misc",
4+
"ingredients": [
5+
{
6+
"item": "enderio:farming_station"
7+
}
8+
],
9+
"result": {
10+
"count": 1,
11+
"id": "enderio:farming_station"
12+
}
13+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"type": "minecraft:crafting_shaped",
3+
"category": "misc",
4+
"key": {
5+
"C": {
6+
"item": "enderio:ensouled_chassis"
7+
},
8+
"D": {
9+
"tag": "c:ingots/dark_steel"
10+
},
11+
"E": {
12+
"tag": "c:gears/energized"
13+
},
14+
"G": {
15+
"tag": "c:gems/pulsating_crystal"
16+
},
17+
"S": {
18+
"tag": "c:ingots/soularium"
19+
},
20+
"Z": {
21+
"item": "enderio:z_logic_controller"
22+
}
23+
},
24+
"pattern": [
25+
"EGE",
26+
"SCS",
27+
"DZD"
28+
],
29+
"result": {
30+
"count": 1,
31+
"id": "enderio:farming_station"
32+
}
33+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"values": [
3+
"minecraft:melon",
4+
"minecraft:pumpkin"
5+
]
6+
}

enderio/src/main/java/com/enderio/enderio/api/farm/FarmInteraction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
@ApiStatus.Experimental
66
public enum FarmInteraction {
7-
FINISHED, POWERED, BLOCKED, IGNORED
7+
FINISHED, BLOCKED, IGNORED
88
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package com.enderio.enderio.api.farm;
22

33
import net.minecraft.core.BlockPos;
4+
import net.minecraft.world.level.block.entity.BlockEntity;
45
import org.jetbrains.annotations.ApiStatus;
56

67
@ApiStatus.Experimental
78
public interface FarmTask {
89

9-
FarmInteraction farm(BlockPos soil, FarmingStation farmBlockEntity);
10+
<T extends BlockEntity & FarmingMachine>
11+
FarmInteraction process(BlockPos targetBlock, T blockEntity);
1012
}

0 commit comments

Comments
 (0)