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

ElectricJuicer #4191

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

Conversation

Intybyte
Copy link

@Intybyte Intybyte commented May 16, 2024

Approved suggestion #2560 discord

Description

Adding an ElectricJuicer so people aren't force to use the manual MultiBlock to get juicer, and can automate the process with cargo.

Proposed changes

Added on PostSetup a juicer recipe loader to a new machine called ElectricJuicer.
The new recipe is similar to the original multiblock, but requiring some electric motors, a battery and some other basic blocks.

Checklist

  • I have fully tested the proposed changes and promise that they will not break everything into chaos.
  • I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
  • I have made sure that the proposed changes do not break compatibility across the supported Minecraft versions (1.16.* - 1.20.*).
  • I followed the existing code standards and didn't mess up the formatting.
  • I did my best to add documentation to any public classes or methods I added.
  • I have added Nonnull and Nullable annotations to my methods to indicate their behaviour for null values
  • I added sufficient Unit Tests to cover my code.

Suggestion Slimefun#2560 discord
@Intybyte Intybyte requested a review from a team as a code owner May 16, 2024 13:34
@github-actions github-actions bot added the 🎈 Feature This Pull Request adds a new feature. label May 16, 2024
Copy link
Contributor

Your Pull Request was automatically labelled as: "🎈 Feature"
Thank you for contributing to this project! ❤️

Comment on lines +211 to +237
private static void loadJuicer() {
List<ItemStack[]> juicerRecipes = new ArrayList<>();

Juicer juicer = (Juicer) SlimefunItems.JUICER.getItem();
if (juicer == null) {
return;
}

ItemStack[] input = null;

for (ItemStack[] recipe : juicer.getRecipes()) {

if (input == null) {
input = recipe;
continue;
}

if (input[0] != null && recipe[0] != null) {
juicerRecipes.add(new ItemStack[] { input[0], recipe[0] });
}

input = null;
}

Stream<ItemStack[]> stream = juicerRecipes.stream();
stream.forEach(recipe -> registerMachineRecipe("ELECTRIC_JUICER", 2, new ItemStack[] { recipe[0] }, new ItemStack[] { recipe[1] }));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a huge fan with how this works but ill wait to see others opinions

Copy link
Author

Choose a reason for hiding this comment

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

The only way to load multiblocks recipes into electric machines that I know of is this

@J3fftw1
Copy link
Member

J3fftw1 commented May 18, 2024

We previously denied a PR like this since it’s in one of the addons already I think

@JustAHuman-xD
Copy link
Contributor

Oh really? Anyone know what addon?

@Intybyte
Copy link
Author

We previously denied a PR like this since it’s in one of the addons already I think

Just because an addon adds it it isn't a good reason to not accept the PR man, someone a day made a mod for pistons in minecraft back in beta and mojang decided to add it to the main game. Never saw anyone whining about pistons xD

@Boomer-1
Copy link

As a general rule, core slimefun doesn't add items that addons have for obvious reasons. it's not to say it wouldn't happen, but it doesn't make sense to duplicate others work

@JustAHuman-xD
Copy link
Contributor

Can anyone say what addon this is in? If it's abandoned or unmaintained, something like that, I think that'd be justification enough for it being added to core slimefun.

@Boomer-1
Copy link

Boomer-1 commented Jun 3, 2024

i've not seen one that i can remember. i just checked the active addons and it's not there. the only other juicer i've seen is in fast machines

Copy link
Contributor

github-actions bot commented Jun 3, 2024

Slimefun preview build

A Slimefun preview build is available for testing!
Commit: 66d8b39

https://preview-builds.walshy.dev/download/Slimefun/4191/66d8b392

Note: This is not a supported build and is only here for the purposes of testing.
Do not run this on a live server and do not report bugs anywhere but this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎈 Feature This Pull Request adds a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants