Skip to content

Commit

Permalink
Fix incorrect FluidUtil doc (#2996)
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz authored and cpw committed Jun 23, 2016
1 parent 86d5b5a commit ba9ec61
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/main/java/net/minecraftforge/fluids/FluidUtil.java
Expand Up @@ -208,14 +208,14 @@ else if (container.stackSize == 1) // don't need to stow anything, just fill and
* If the inventory does not accept the emptied container, it will be given to the player or dropped at the players feet.
* If player is null in this case, the action will be aborted.
*
* @param container The Fluid Container Itemstack to fill. This stack WILL be modified on success.
* @param fluidSource The fluid source to fill from
* @param inventory An inventory where any additionally created item (filled container if multiple empty are present) are put
* @param maxAmount Maximum amount of fluid to take from the tank.
* @param player The player that gets the items the inventory can't take. Can be null, only used if the inventory cannot take the filled stack.
* @param container The filled Fluid Container Itemstack to empty. This stack WILL be modified on success.
* @param fluidDestination The fluid destination to fill from the fluid container.
* @param inventory An inventory where any additionally created item (filled container if multiple empty are present) are put
* @param maxAmount Maximum amount of fluid to take from the tank.
* @param player The player that gets the items the inventory can't take. Can be null, only used if the inventory cannot take the filled stack.
* @return True if the container was filled successfully and stowed, false otherwise.
*/
public static boolean tryEmptyContainerAndStow(ItemStack container, IFluidHandler fluidSource, IItemHandler inventory, int maxAmount, @Nullable EntityPlayer player)
public static boolean tryEmptyContainerAndStow(ItemStack container, IFluidHandler fluidDestination, IItemHandler inventory, int maxAmount, @Nullable EntityPlayer player)
{
if (container == null || container.stackSize < 1)
{
Expand All @@ -224,15 +224,15 @@ public static boolean tryEmptyContainerAndStow(ItemStack container, IFluidHandle

if (player != null && player.capabilities.isCreativeMode)
{
ItemStack emptiedReal = tryEmptyContainer(container, fluidSource, maxAmount, player, true);
ItemStack emptiedReal = tryEmptyContainer(container, fluidDestination, maxAmount, player, true);
if (emptiedReal != null)
{
return true;
}
}
else if (container.stackSize == 1) // don't need to stow anything, just fill and edit the container stack
{
ItemStack emptiedReal = tryEmptyContainer(container, fluidSource, maxAmount, player, true);
ItemStack emptiedReal = tryEmptyContainer(container, fluidDestination, maxAmount, player, true);
if (emptiedReal != null)
{
if (emptiedReal.stackSize <= 0)
Expand All @@ -248,12 +248,12 @@ else if (container.stackSize == 1) // don't need to stow anything, just fill and
}
else
{
ItemStack emptiedSimulated = tryEmptyContainer(container, fluidSource, maxAmount, player, false);
ItemStack emptiedSimulated = tryEmptyContainer(container, fluidDestination, maxAmount, player, false);
if (emptiedSimulated != null)
{
if (emptiedSimulated.stackSize <= 0)
{
tryEmptyContainer(container, fluidSource, maxAmount, player, true);
tryEmptyContainer(container, fluidDestination, maxAmount, player, true);
container.stackSize--;
return true;
}
Expand All @@ -263,7 +263,7 @@ else if (container.stackSize == 1) // don't need to stow anything, just fill and
ItemStack remainder = ItemHandlerHelper.insertItemStacked(inventory, emptiedSimulated, true);
if (remainder == null || player != null)
{
ItemStack emptiedReal = tryEmptyContainer(container, fluidSource, maxAmount, player, true);
ItemStack emptiedReal = tryEmptyContainer(container, fluidDestination, maxAmount, player, true);
remainder = ItemHandlerHelper.insertItemStacked(inventory, emptiedReal, false);

// give it to the player or drop it at their feet
Expand Down

0 comments on commit ba9ec61

Please sign in to comment.