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

Fix fluid handling for Emi integration #7960

Merged
merged 2 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ neoForge.parchment.mappingsVersion=2024.05.01
#########################################################
top_minecraft_release=1.20
top_version=1.20.4_neo-11.0.1-2
emi_version=1.1.4+1.20.4
emi_version=1.1.7+1.21
# please learn how to use semver...
top_version_range=[1.20.0,)
jade_version_range=[15.0.0,)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.Fluids;
import net.neoforged.neoforge.fluids.FluidStack;

import dev.emi.emi.api.neoforge.NeoForgeEmiStack;
import dev.emi.emi.api.stack.EmiStack;
Expand All @@ -30,10 +31,9 @@ public Class<?> getKeyType() {
public @Nullable GenericStack toGenericStack(EmiStack stack) {
var fluid = stack.getKeyOfType(Fluid.class);
if (fluid != null && fluid != Fluids.EMPTY) {
// TODO 1.20.5
throw new UnsupportedOperationException();
// var fluidKey = AEFluidKey.of(fluid, stack.getNbt());
// return new GenericStack(fluidKey, stack.getAmount());
var fluidStack = new FluidStack(fluid.builtInRegistryHolder(), 1, stack.getComponentChanges());
var fluidKey = AEFluidKey.of(fluidStack);
return new GenericStack(fluidKey, stack.getAmount());
}
return null;
}
Expand Down
Loading