Skip to content

Commit d4a8e10

Browse files
committed
Add item attributes for fan processing
1 parent 770e812 commit d4a8e10

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

CHANGELOG.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
### Create: Dragons Plus 1.5.0
1+
### Create: Dragons Plus 1.5.1
22

33
#### Features
4-
- Added Bulk Sanding (needs Quicksand), supports all Sand Parper Polishing recipes.
5-
- Added Sand Paper Polishing recipes for Polished Blocks.
6-
- Added Sand Paper Polishing recipes for Oxidized Blocks.
7-
- Added Sand Paper Polishing recipes for Waxed Blocks.
8-
- Added Bulk Ending (needs Dragon Head or Dragon's Breath (Fluid)).
9-
- Added block and bucket for Dragon's Breath (Fluid).
10-
- Added Automated Brewing recipes for Dragon's Breath (Fluid).
4+
- Added Item Attributes for Bulk Freezing, Bulk Sanding, Bulk Ending
115

12-
#### Update
13-
- Add French Translation by @fabien-gigante
14-
- Update Japanese Translation by @YukkuriOfuton
15-
16-
#### Compatibility
17-
- Incompatible with Create: Central Kitchen < 2.1 due to breaking change,
18-
please update Create: Central Kitchen to 2.1+.
6+
#### Fix
7+
- Fix certain mods with blocks without items causing crash on Sand Paper Polishing due to
8+
invalid generated recipes with empty ingredient.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod_id = create_dragons_plus
1717
mod_artifact_id = create-dragons-plus
1818
mod_name = Create: Dragons Plus
1919
mod_license = LGPL-3.0-or-later
20-
mod_version = 1.5.0
20+
mod_version = 1.5.1
2121
mod_group_id = plus.dragons.createdragonsplus
2222
mod_authors = DragonsPlus
2323
mod_description = Library mod for DragonsPlusMinecraft Create-addons.

src/main/java/plus/dragons/createdragonsplus/data/internal/CDPRuntimeRecipeProvider.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import net.minecraft.data.recipes.RecipeOutput;
3030
import net.minecraft.data.recipes.RecipeProvider;
3131
import net.minecraft.resources.ResourceLocation;
32+
import net.minecraft.world.item.Items;
3233
import net.minecraft.world.item.crafting.Recipe;
3334
import net.minecraft.world.item.crafting.RecipeHolder;
3435
import net.neoforged.bus.api.SubscribeEvent;
@@ -61,34 +62,44 @@ private static void buildPolishedBlockRecipes(RecipeOutput output) {
6162
var baseId = polishedId.withPath(name -> name.replace("polished_", ""));
6263
if (!BuiltInRegistries.BLOCK.containsKey(baseId))
6364
return;
64-
var polished = holder.value();
65-
var base = BuiltInRegistries.BLOCK.get(baseId);
65+
var polishedItem = holder.value().asItem();
66+
var baseItem = BuiltInRegistries.BLOCK.get(baseId).asItem();
67+
if (polishedItem == Items.AIR || baseItem == Items.AIR)
68+
return;
6669
var recipeId = CDPCommon.asResource(baseId.toString().replace(':', '/'));
6770
new ProcessingRecipeBuilder<>(SandPaperPolishingRecipe::new, recipeId)
68-
.require(base)
69-
.output(polished)
71+
.require(baseItem)
72+
.output(polishedItem)
7073
.build(output);
7174
});
7275
}
7376

7477
private static void buildOxidizedBlockRecipes(RecipeOutput output) {
7578
DataMapHooks.INVERSE_OXIDIZABLES_DATAMAP.forEach((oxidized, polished) -> {
79+
var oxidizedItem = oxidized.asItem();
80+
var polishedItem = polished.asItem();
81+
if (oxidizedItem == Items.AIR || polishedItem == Items.AIR)
82+
return;
7683
var oxidizedId = BuiltInRegistries.BLOCK.getKey(oxidized);
7784
var recipeId = CDPCommon.asResource(oxidizedId.toString().replace(':', '/'));
7885
new ProcessingRecipeBuilder<>(SandPaperPolishingRecipe::new, recipeId)
79-
.require(oxidized)
80-
.output(polished)
86+
.require(oxidizedItem)
87+
.output(polishedItem)
8188
.build(output);
8289
});
8390
}
8491

8592
private static void buildWaxedBlockRecipes(RecipeOutput output) {
8693
DataMapHooks.INVERSE_WAXABLES_DATAMAP.forEach((waxed, polished) -> {
94+
var waxedItem = waxed.asItem();
95+
var polishedItem = polished.asItem();
96+
if (waxedItem == Items.AIR || polishedItem == Items.AIR)
97+
return;
8798
var waxedId = BuiltInRegistries.BLOCK.getKey(waxed);
8899
var recipeId = CDPCommon.asResource(waxedId.toString().replace(':', '/'));
89100
new ProcessingRecipeBuilder<>(SandPaperPolishingRecipe::new, recipeId)
90-
.require(waxed)
91-
.output(polished)
101+
.require(waxedItem)
102+
.output(polishedItem)
92103
.build(output);
93104
});
94105
}

0 commit comments

Comments
 (0)