Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Additional Enchanted Miner compat #277

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

code-onigiri
Copy link

add compat with Additional Enchanted Miner WorkBench

@WaitingIdly WaitingIdly added the mod compat Relating to compatability with a mod or features of a mod label Dec 4, 2024
Copy link
Collaborator

@WaitingIdly WaitingIdly left a comment

Choose a reason for hiding this comment

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

needs spotless to be applied. is using the scala classes needed? WorkbenchPlusRecipe doesnt seem needed, can just call WorkbenchRecipe methods directly.

Comment on lines 12 to 14
import scala.Option;
import scala.collection.JavaConversions;
import scala.collection.Map;
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you have to use scala here?



public static WorkbenchPlusRecipe addRecipe(WorkbenchPlusRecipe recipe) {
addIngredientRecipe(recipe.location, recipe.output, recipe.energy, recipe.input, true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not WorkbenchRecipe.addIngredientRecipe instead of importing a static just for this

}

@RecipeBuilderDescription(example =
@Example(".output(item('minecraft:nether_star')).input(item('minecraft:diamond'),item('minecraft:gold_ingot')).energy(10000)")
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you provide a second example?

return WorkbenchPlusRecipe.removeByOutput(output);
}

public Boolean removeById(String id) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be used by people using GroovyScript be calling this method? if so, use @MethodDescription and state what it does. otherwise, private or @GroovyBlacklist. same with removeAll.


import static com.yogpc.qp.recipe.WorkbenchRecipe.addIngredientRecipe;

public class WorkbenchPlusRecipe {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is the point of this class? what purpose does it serve that it couldnt be replaced by some code in the register() method?

Copy link
Author

Choose a reason for hiding this comment

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

Now that I think about it, I realize that I don't need WorkbenchPlusRecipe, I'll fix it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

nothing changed here.

@code-onigiri
Copy link
Author

Fixed.

Copy link
Collaborator

@WaitingIdly WaitingIdly left a comment

Choose a reason for hiding this comment

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

still need to apply spotless.

Comment on lines +7 to +8
// groovyscript.wiki.quarryplus.work_bench_plus.title:
// groovyscript.wiki.quarryplus.work_bench_plus.description.
Copy link
Collaborator

@WaitingIdly WaitingIdly Dec 6, 2024

Choose a reason for hiding this comment

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

where lang? peep the groovy.log to see the missing lang keys and add a translation for those

@Override
public void onReload() {
removeScripted().forEach(recipe -> WorkbenchRecipe.removeRecipe(recipe.getLocation()));
restoreFromBackup().forEach(ModSupport.ADDITIONAL_ENCHANTED_MINER.get().WorkBenchPlus::add);
Copy link
Collaborator

Choose a reason for hiding this comment

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

calling this method adds the method to the scripted list, which should not be done.

import com.cleanroommc.groovyscript.compat.mods.GroovyPropertyContainer;

public class AdditionalEnchantedMiner extends GroovyPropertyContainer {
public final WorkBenchPlus WorkBenchPlus = new WorkBenchPlus();
Copy link
Collaborator

Choose a reason for hiding this comment

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

fields should be in camelCase - WorkBenchPlus is PascalCase, it should be workBenchPlus


import static com.yogpc.qp.recipe.WorkbenchRecipe.addIngredientRecipe;

public class WorkbenchPlusRecipe {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nothing changed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod compat Relating to compatability with a mod or features of a mod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants