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

Additional content #136

Merged
merged 12 commits into from
Nov 14, 2022

Conversation

lynxx131
Copy link
Contributor

@lynxx131 lynxx131 commented Oct 31, 2022

This is an attempt to port Rundas01's PR #129 to the current dev-1.18 branch.

I have a few problems / questions though...

1. I was unsure of how to port the distillation stuff as I see material registrations like this:

public static Material WoodTar = AntimatterAPI.register(Material.class, new Material(Ref.ID, "wood_tar", 0x28170b, NONE))
            .asFluid(0,0,true,new DistillationProduct[]{new DistillationProduct(Creosote,"fluid",720),new DistillationProduct(Phenol,"fluid",180),
                    new DistillationProduct(Benzene,"fluid",360),new DistillationProduct(Toluene,"fluid",180)},1440)

I'm assuming that the DistillationProduct arguments being passed to asFluid are to define distillation outputs? If so I am unsure of what the correct way to do this would be against the newer branch.

2. Had issues figuring out how to port the distillery class over:

public class DistilleryLoader {
    public static void init() {
        AntimatterAPI.all(Material.class).forEach(m -> {
            if (!(m.canDistill)) return;
            for(int i=0;i<m.distillsInto.length;i++){
                DISTILLING.RB().ii(INT_CIRCUITS.get(i).setNoConsume()).fi(m.getLiquid(fluidamount(m.amount))).fo(m.distillsInto[i].getLiquid(m.amount[i])).add(m.getDensity(),20);
            }
        });
    }

I'm assuming that MaterialTags would be the way to go in the absence of the canDistill property?

3. Couldn't find replacement Material.getHardness() when porting ExtruderLoader class

In lines like:

EXTRUDING.RB().ii(of(INGOT.getMaterialTag(r),1),of(GregTechData.ShapeRing,1).setNoConsume()).io(RING.get(r,4)).add(r.getHardness(),30);

I did:

long duration = Math.max(r.getMass(), 1);
EXTRUDING.RB().ii(of(INGOT.getMaterialTag(r),1),of(GregTechData.ShapeRing,1).setNoConsume()).io(RING.get(r,4)).add(duration,30);

not sure if this is correct or not.

Not had time to troubleshoot this yet but

I'm keen to see this mod grow as it's my primary blocker to moving over to 1.18 and I do have a development background (just not a huge amount of experience with MC modding) so would like to chip in where possible.

@lynxx131
Copy link
Contributor Author

My last issue is in Miscellaneous.java:

I can't figure out how to port the plantball recipes:

provider.addItemRecipe(output, Ref.ID, "plantball", "misc", "has_wrench", provider.hasSafeItem(WRENCH.getTag()), PlantBall, of(
                'C', Tags.Items.CROPS
        ), "CCC", "C C", "CCC");

The Tags class is net.minecraftforge.common.Tags but I presume due to the desire to maintain compatibility with both Forge and Fabric I can't just directly reference something in net.minecraftforge so would appreciate some guidance here.

@Vliro
Copy link
Contributor

Vliro commented Oct 31, 2022

If it's common, you can't access these no. You can probably just create a tag, since any tag with the same resource location point to the same thing so that's fine.

@Trinsdar
Copy link
Member

Yah use the TagUtils.getForgelikeTag method

@lynxx131
Copy link
Contributor Author

Sorted the tag stuff and those recipes work now just need to figure out my issues in the opening comment.

Still understanding how the machine processing side of things works.

@Trinsdar
Copy link
Member

Well one thing is I haven't actually merged the pr in antimatter yet that this depends on, as i was waiting for rundas to reply to one of my comments, but he seems to have disappeared

@Trinsdar
Copy link
Member

As this depends on this: GregTech-Intergalactical/AntimatterAPI#188

@Trinsdar
Copy link
Member

Trinsdar commented Nov 1, 2022

is that everything?

@lynxx131
Copy link
Contributor Author

lynxx131 commented Nov 1, 2022

No I need to sort the distillery stuff still, currently working on that.

Also I think I've found the use for the distillationAmount argument that you questioned in the Antimatter API PR.

I think that argument is meant to be used as the fluid input amount for the distillation recipes, just figuring out how to get that value through to the distillery class.

I could probably just set all the distillery recipes to use 1 bucket of fluid input for the sake of getting a working implementation.

@lynxx131
Copy link
Contributor Author

lynxx131 commented Nov 1, 2022

Was thinking maybe this GregTech-Intergalactical/AntimatterAPI#194 for passing the distillation input amount into the distillery.

@Trinsdar
Copy link
Member

Trinsdar commented Nov 1, 2022

@lynxx131 ok gregtech has been updated with your antimatter pr

@lynxx131
Copy link
Contributor Author

lynxx131 commented Nov 2, 2022

I think the PR is done now.

I feel like the distillation implementation could be further improved but for now this PR provides a working implementation.

@Trinsdar Trinsdar requested a review from Vliro November 2, 2022 04:11
@Vliro
Copy link
Contributor

Vliro commented Nov 14, 2022

Great work!

@Vliro Vliro merged commit b70ea2e into GregTech-Intergalactical:dev-1.18 Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants