mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 23:47:38 +01:00
We have SPONGE!
(and not only for mixins...)
This commit is contained in:
parent
3d0898c59b
commit
9df9a99185
1 changed files with 10 additions and 0 deletions
|
@ -22,6 +22,7 @@ import net.minecraft.entity.item.ItemEntity;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.state.DirectionProperty;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
|
@ -36,6 +37,10 @@ import net.minecraft.util.math.shapes.VoxelShape;
|
|||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
|
@ -95,6 +100,11 @@ public class BasinBlock extends Block implements ITE<BasinTileEntity>, IWrenchab
|
|||
if (EmptyingByBasin.canItemBeEmptied(worldIn, heldItem)
|
||||
|| GenericItemFilling.canItemBeFilled(worldIn, heldItem))
|
||||
return ActionResultType.SUCCESS;
|
||||
if (heldItem.getItem().equals(Items.SPONGE) &&
|
||||
!te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY).map(iFluidHandler ->
|
||||
iFluidHandler.drain(Integer.MAX_VALUE, IFluidHandler.FluidAction.EXECUTE)).orElse(FluidStack.EMPTY).isEmpty()) {
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue