forked from Railcraft/Railcraft
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated buildscript and .gitignore * Don't void fluids in boilers - Fluid boilers GUIs only accept valid fluids - Fluid and solid boilers only drain liquid containers when they have space for their contents
- Loading branch information
Showing
4 changed files
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/mods/railcraft/common/gui/slots/SlotBoilerFluidContainerFilled.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package mods.railcraft.common.gui.slots; | ||
|
||
import mods.railcraft.api.fuel.FuelManager; | ||
import mods.railcraft.common.fluids.FluidItemHelper; | ||
import mods.railcraft.common.fluids.Fluids; | ||
import net.minecraft.inventory.IInventory; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.fluids.Fluid; | ||
|
||
public class SlotBoilerFluidContainerFilled extends SlotFluidContainerFilled { | ||
|
||
public SlotBoilerFluidContainerFilled(IInventory iinventory, int slotIndex, int posX, int posY) { | ||
super(iinventory, slotIndex, posX, posY); | ||
} | ||
|
||
|
||
@Override | ||
public boolean isItemValid(ItemStack itemstack) | ||
{ | ||
Fluid fluid = FluidItemHelper.getFluidInContainer(itemstack); | ||
return super.isItemValid(itemstack) && (FuelManager.getBoilerFuelValue(fluid) > 0 || Fluids.WATER.is(fluid)); | ||
} | ||
|
||
} |