Skip to content

Commit

Permalink
Fix issue with alchemical cauldron
Browse files Browse the repository at this point in the history
  • Loading branch information
maxanier committed May 21, 2017
1 parent 9558ce3 commit aec60d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/java/de/teamlapen/lib/lib/util/ItemStackUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static boolean isValid(ItemStack stack) {
* True if A !=null and B == null
*/
public static boolean doesStackContain(@Nonnull ItemStack stackA, @Nonnull ItemStack stackB) {
return !stackA.isEmpty() && (stackB.isEmpty() || (areStacksEqualIgnoreAmount(stackA, stackB) && stackA.getCount() >= stackB.getCount()));
return (stackB.isEmpty() || !stackA.isEmpty() && (areStacksEqualIgnoreAmount(stackA, stackB) && stackA.getCount() >= stackB.getCount()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
Expand Down Expand Up @@ -394,7 +395,7 @@ public void update() {
}

if (!world.isRemote) {
if (isBurning() || isStackInSlot(SLOT_LIQUID) && isStackInSlot(SLOT_INGREDIENT) && isStackInSlot(SLOT_FUEL)) {
if (isBurning() || isStackInSlot(SLOT_LIQUID) && isStackInSlot(SLOT_FUEL)) {
if (!isBurning() && canCook()) {
this.burnTime = TileEntityFurnace.getItemBurnTime(getStackInSlot(SLOT_FUEL));
if (isBurning()) {
Expand Down Expand Up @@ -504,8 +505,9 @@ private void finishCooking() {
ItemStack fluidContainer = getStackInSlot(SLOT_LIQUID);
FluidStack s = recipe.isValidFluidItem(fluidContainer);
if (s != null) {
IFluidHandler handler = FluidLib.getFluidItemCap(fluidContainer);
IFluidHandlerItem handler = (IFluidHandlerItem) FluidLib.getFluidItemCap(fluidContainer);
handler.drain(s, true);
setInventorySlotContents(SLOT_LIQUID, handler.getContainer());
} else {
VampirismMod.log.w("AlchemicalCauldron", "Cooked item without valid input liquid (Recipe %s, Input %s)", recipe, fluidContainer);
}
Expand Down

0 comments on commit aec60d2

Please sign in to comment.