Skip to content

Commit

Permalink
Fix Log and Stripped Recipes causing NPE (#2864)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoungOnionMC authored Feb 14, 2025
1 parent 271ebaf commit cc27b93
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ public final class WoodTypeEntry {
public final String woodName;
@NotNull
public final TagKey<Item> logTag;
// 4 sided bark
@Nullable
public final Item log;
@Nullable
public final Item strippedLog;
// 6 sided bark
@Nullable
public final Item wood;
@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,35 +439,41 @@ public static void registerWoodTypeRecipe(Consumer<FinishedRecipe> provider, @No
throw new IllegalStateException("Could not find planks form of WoodTypeEntry '" + name + "'.");
}

// strip log
LATHE_RECIPES.recipeBuilder("strip_" + entry.woodName + "_log")
.inputItems(entry.log)
.outputItems(entry.strippedLog)
.outputItems(dust, Wood, 1)
.duration(160).EUt(VA[ULV])
.save(provider);
// strip wood
LATHE_RECIPES.recipeBuilder("strip_" + entry.woodName + "_wood")
.inputItems(entry.wood)
.outputItems(entry.strippedWood)
.outputItems(dust, Wood, 1)
.duration(160).EUt(VA[ULV])
.save(provider);
if (entry.strippedLog != null) {
// strip log
LATHE_RECIPES.recipeBuilder("strip_" + name + "_log")
.inputItems(entry.log)
.outputItems(entry.strippedLog)
.outputItems(dust, Wood, 1)
.duration(160).EUt(VA[ULV])
.save(provider);

// lathe stripped log
LATHE_RECIPES.recipeBuilder("lathe_stripped_" + entry.woodName + "_log")
.inputItems(entry.strippedLog)
.outputItems(rodLong, Wood, 4)
.outputItems(dust, Wood, 1)
.duration(160).EUt(VA[ULV])
.save(provider);
// lathe stripped wood
LATHE_RECIPES.recipeBuilder("lathe_stripped_" + entry.woodName + "_wood")
.inputItems(entry.strippedWood)
.outputItems(rodLong, Wood, 4)
.outputItems(dust, Wood, 1)
.duration(160).EUt(VA[ULV])
.save(provider);
// lathe stripped log
LATHE_RECIPES.recipeBuilder("lathe_stripped_" + name + "_log")
.inputItems(entry.strippedLog)
.outputItems(rodLong, Wood, 4)
.outputItems(dust, Wood, 1)
.duration(160).EUt(VA[ULV])
.save(provider);
}

if (entry.strippedWood != null) {
// strip wood
LATHE_RECIPES.recipeBuilder("strip_" + name + "_wood")
.inputItems(entry.wood)
.outputItems(entry.strippedWood)
.outputItems(dust, Wood, 1)
.duration(160).EUt(VA[ULV])
.save(provider);

// lathe stripped wood
LATHE_RECIPES.recipeBuilder("lathe_stripped_" + name + "_wood")
.inputItems(entry.strippedWood)
.outputItems(rodLong, Wood, 4)
.outputItems(dust, Wood, 1)
.duration(160).EUt(VA[ULV])
.save(provider);
}

if (entry.generateLogToPlankRecipe) {
if (ConfigHolder.INSTANCE.recipes.nerfWoodCrafting) {
Expand Down

0 comments on commit cc27b93

Please sign in to comment.