Skip to content

Change Pam's Harvest the Nether script to Fether#1622

Open
glowredman wants to merge 13 commits intomasterfrom
fether-compat
Open

Change Pam's Harvest the Nether script to Fether#1622
glowredman wants to merge 13 commits intomasterfrom
fether-compat

Conversation

@glowredman
Copy link
Member

... and a bit of cleanup (see commit history)

@glowredman glowredman requested a review from a team February 24, 2026 20:20
@glowredman glowredman added the refactor For PRs rewritting a part of the code to have a nicer code overall. label Feb 24, 2026
Comment on lines 55 to 62
try {
Class forestryFermenterRecipeManager = Class.forName("forestry.factory.recipes.FermenterRecipeManager");
Class<?> forestryFermenterRecipeManager = Class
.forName("forestry.factory.recipes.FermenterRecipeManager");
Field fieldFermenterRecipes = forestryFermenterRecipeManager.getDeclaredField("recipes");
fieldFermenterRecipes.setAccessible(true);

@SuppressWarnings("unchecked")
Iterable<IFermenterRecipe> recipes = (Iterable<IFermenterRecipe>) fieldFermenterRecipes.get(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reference Forestry's class directly, please.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(int) casts are unnecessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, aren't there better ways to get a fluid stack for a material other than creating it with new?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, calling Materials.<someMaterial>.getFluid() / .getMolten() would still create a new FluidStack

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably get rid of this comment, then?

return false;
}

@SuppressWarnings("unchecked")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. You should probably remove // noinspection unchecked from these methods.

}
}

@SuppressWarnings("unchecked")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of continuing with this HashMap madness, perhaps we just replace them with an Arrays.asList of pairs?

Comment on lines 44 to 48
netherPlanks.stackSize = 2;
addShapelessRecipe(netherPlanks, netherLog);

netherPlanks.stackSize = 4;
addShapedRecipe(netherPlanks, "craftingToolSaw", netherLog, null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't. I'd like to someday remove the copy operations from the recipe adders, and it would be preferable if these were just new ItemStacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor For PRs rewritting a part of the code to have a nicer code overall.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants