Skip to content

Commit

Permalink
don't allow Mekanism fluid tanks into fluid container slots
Browse files Browse the repository at this point in the history
seems to lead to a lockup

#1386
  • Loading branch information
desht committed Dec 28, 2024
1 parent 8e9171c commit caeb1ed
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package me.desht.pneumaticcraft.common.inventory.slot;

import me.desht.pneumaticcraft.common.util.PneumaticCraftUtils;
import me.desht.pneumaticcraft.lib.ModIds;
import net.minecraft.world.item.ItemStack;
import net.neoforged.neoforge.fluids.FluidUtil;
import net.neoforged.neoforge.items.IItemHandler;
Expand All @@ -41,6 +43,10 @@ public FluidContainerSlot(IItemHandler handler, int index, int x, int y) {

@Override
public boolean mayPlace(@Nonnull ItemStack stack) {
if (PneumaticCraftUtils.getRegistryName(stack.getItem()).orElseThrow().getNamespace().equals(ModIds.MEKANISM)) {
// no Mek tanks, they cause a client lockup
return false;
}
if (FluidUtil.getFluidHandler(stack).isPresent()) {
return FluidUtil.getFluidContained(stack).map(fluidStack -> fluidStack.getAmount() >= minFluid).orElse(minFluid == 0);
} else {
Expand Down

0 comments on commit caeb1ed

Please sign in to comment.