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
Changes from 1 commit
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
Next Next commit
Fix fluid handling for Emi integration
  • Loading branch information
shartte committed Jun 23, 2024
commit 3f5e8197abd4d41c940eb43c7088011b84f7c00c
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