Java Code Examples for net.minecraftforge.energy.CapabilityEnergy#ENERGY
The following examples show how to use
net.minecraftforge.energy.CapabilityEnergy#ENERGY .
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: TileFastFurnace.java From YouTubeModdingTutorial with MIT License | 6 votes |
@Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { if (facing == null) { return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(combinedHandler); } else if (facing == EnumFacing.UP) { return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(inputHandler); } else { return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(outputHandler); } } if (capability == CapabilityEnergy.ENERGY) { return CapabilityEnergy.ENERGY.cast(energyStorage); } return super.getCapability(capability, facing); }
Example 2
Source File: TileFastFurnace.java From YouTubeModdingTutorial with MIT License | 5 votes |
@Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { return true; } if (capability == CapabilityEnergy.ENERGY) { return true; } return super.hasCapability(capability, facing); }
Example 3
Source File: TidalGeneratorTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) return true; if (capability == CapabilityAnimation.ANIMATION_CAPABILITY) return true; return super.hasCapability(capability, facing); }
Example 4
Source File: LightTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) return true; if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return true; return super.hasCapability(capability, facing); }
Example 5
Source File: DiffuserTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(this.gasHandler); if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(this.itemHandler); if (capability == CapabilityEnergy.ENERGY) return CapabilityEnergy.ENERGY.cast(this.consumerEnergyHandler); return super.getCapability(capability, facing); }
Example 6
Source File: DiffuserTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@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 7
Source File: HarvesterTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { 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 8
Source File: HarvesterTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return true; if (capability == CapabilityEnergy.ENERGY) return true; if (capability == CapabilityAnimation.ANIMATION_CAPABILITY) return true; return super.hasCapability(capability, facing); }
Example 9
Source File: BioreactorTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(this.fluidHandler); if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(this.automationItemHandler); if (capability == CapabilityEnergy.ENERGY) return CapabilityEnergy.ENERGY.cast(this.consumerEnergyHandler); return super.getCapability(capability, facing); }
Example 10
Source File: FabricatorTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(this.automationItemHandler); if (capability == CapabilityEnergy.ENERGY) return CapabilityEnergy.ENERGY.cast(this.consumerEnergyHandler); return super.getCapability(capability, facing); }
Example 11
Source File: AlgaeBioreactorTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@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 12
Source File: TileGenerator.java From YouTubeModdingTutorial with MIT License | 5 votes |
@Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) { return CapabilityEnergy.ENERGY.cast(energyStorage); } if (capability == CapabilityAnimation.ANIMATION_CAPABILITY) { return CapabilityAnimation.ANIMATION_CAPABILITY.cast(asm); } return super.getCapability(capability, facing); }
Example 13
Source File: ScrubberTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@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 14
Source File: ScrubberTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@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; if (capability == CapabilityAnimation.ANIMATION_CAPABILITY) return true; return super.hasCapability(capability, facing); }
Example 15
Source File: SolarGlassTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) return true; return super.hasCapability(capability, facing); }
Example 16
Source File: PiezoelectricTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) return true; return super.hasCapability(capability, facing); }
Example 17
Source File: TidalGeneratorTileEntity.java From EmergingTechnology with MIT License | 5 votes |
@Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) return CapabilityEnergy.ENERGY.cast(this.generatorEnergyHandler); if (capability == CapabilityAnimation.ANIMATION_CAPABILITY) return CapabilityAnimation.ANIMATION_CAPABILITY.cast(getAnimator()); return super.getCapability(capability, facing); }
Example 18
Source File: SolarTileEntity.java From EmergingTechnology with MIT License | 4 votes |
@Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) return CapabilityEnergy.ENERGY.cast(this.generatorEnergyHandler); return super.getCapability(capability, facing); }
Example 19
Source File: CapabilityEnergyProvider.java From MiningGadgets with MIT License | 4 votes |
@Nonnull @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) { return cap == CapabilityEnergy.ENERGY ? capability.cast() : LazyOptional.empty(); }
Example 20
Source File: PiezoelectricTileEntity.java From EmergingTechnology with MIT License | 4 votes |
@Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) return CapabilityEnergy.ENERGY.cast(this.generatorEnergyHandler); return super.getCapability(capability, facing); }