Java Code Examples for net.minecraftforge.fluids.capability.CapabilityFluidHandler#FLUID_HANDLER_CAPABILITY

The following examples show how to use net.minecraftforge.fluids.capability.CapabilityFluidHandler#FLUID_HANDLER_CAPABILITY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScrubberTileEntity.java    From EmergingTechnology with MIT License 5 votes vote down vote up
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {

    if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
        return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(this.fluidTanksHandler);
    if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
        return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(this.automationItemHandler);
    if (capability == CapabilityEnergy.ENERGY)
        return CapabilityEnergy.ENERGY.cast(this.consumerEnergyHandler);
    if (capability == CapabilityAnimation.ANIMATION_CAPABILITY)
        return CapabilityAnimation.ANIMATION_CAPABILITY.cast(getAnimator());
    return super.getCapability(capability, facing);
}
 
Example 2
Source File: HydroponicTileEntity.java    From EmergingTechnology with MIT License 5 votes vote down vote up
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
    if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
        return true;
    if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
        return true;
    if (capability == CapabilityEnergy.ENERGY)
        return true;

    return super.hasCapability(capability, facing);
}
 
Example 3
Source File: TileTank.java    From YouTubeModdingTutorial with MIT License 5 votes vote down vote up
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
    if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
        return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(tank);
    }
    return super.getCapability(capability, facing);
}
 
Example 4
Source File: TileEntitySoymilkAdvancedAggregator.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Nullable
@Override
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing) {
    if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
        return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(input);
    }
    return super.getCapability(capability, facing);
}
 
Example 5
Source File: BioreactorTileEntity.java    From EmergingTechnology with MIT License 5 votes vote down vote up
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
    if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
        return true;
    if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
        return true;
    if (capability == CapabilityEnergy.ENERGY)
        return true;

    return super.hasCapability(capability, facing);
}
 
Example 6
Source File: TileCrucible.java    From ExNihiloAdscensio with MIT License 5 votes vote down vote up
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing)
{
	return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY ||
			capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY ||
			super.hasCapability(capability, facing);
   }
 
Example 7
Source File: TileBarrel.java    From ExNihiloAdscensio with MIT License 5 votes vote down vote up
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing)
{
	return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY ||
			capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY ||
			super.hasCapability(capability, facing);
}
 
Example 8
Source File: OptimiserTileEntity.java    From EmergingTechnology with MIT License 5 votes vote down vote up
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
    if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
        return true;
    if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
        return true;
    if (capability == CapabilityEnergy.ENERGY)
        return true;

    return super.hasCapability(capability, facing);
}
 
Example 9
Source File: FillerTileEntity.java    From EmergingTechnology with MIT License 5 votes vote down vote up
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
    if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
        return true;

    return super.hasCapability(capability, facing);
}
 
Example 10
Source File: TileEntityBarrel.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
@Nullable
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing) {
	if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
		return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(tank);
	}
	return super.getCapability(capability, facing);
}
 
Example 11
Source File: MetaTileEntityCokeOven.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing side) {
    if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY ||
        capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
        return null;
    }
    return super.getCapability(capability, side);
}
 
Example 12
Source File: GTTileMagicEnergyConverter.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
	return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY
			? CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(this.tank)
			: super.getCapability(capability, facing);
}
 
Example 13
Source File: GTTileBedrockMiner.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
	return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY
			? CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(this.tank)
			: super.getCapability(capability, facing);
}
 
Example 14
Source File: FillerTileEntity.java    From EmergingTechnology with MIT License 4 votes vote down vote up
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
    if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
        return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(this.fluidHandler);
    return super.getCapability(capability, facing);
}
 
Example 15
Source File: GTTileQuantumTank.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
	return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY
			? CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(this.tank)
			: super.getCapability(capability, facing);
}
 
Example 16
Source File: GTTileCentrifuge.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
	return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || super.hasCapability(capability, facing);
}
 
Example 17
Source File: TileEntityTank.java    From AgriCraft with MIT License 4 votes vote down vote up
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
    return (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
            || super.hasCapability(capability, facing);
}
 
Example 18
Source File: GTTileMagicEnergyConverter.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
	return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY ? true
			: super.hasCapability(capability, facing);
}
 
Example 19
Source File: GTTileMatterFabricator.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
	return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY
			? CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(this.tank)
			: super.getCapability(capability, facing);
}
 
Example 20
Source File: GTTileMatterFabricator.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
	return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY ? true
			: super.hasCapability(capability, facing);
}