Updated caps to be manually disabled via config

Moved the cap injection to a method, allows them to be configurable.
This is not possible for Forge Energy as it is injected before even the
configuration are lodaed, thus violating their own capability contract
to use the method injection to explicitly make it configurable.

Updated the ratio key for forge energy to "ForgeEnergy" without a space
This commit is contained in:
yueh
2017-07-22 13:29:14 +02:00
parent 4ad31f5066
commit a4c468b9cf
7 changed files with 50 additions and 14 deletions
@@ -64,14 +64,14 @@ class PoweredItemCapabilities implements ICapabilityProvider, IEnergyStorage
@Override
public boolean hasCapability( Capability<?> capability, @Nullable EnumFacing facing )
{
return capability == CapabilityEnergy.ENERGY || capability == Capabilities.TESLA_CONSUMER || capability == Capabilities.TESLA_HOLDER;
return capability == Capabilities.FORGE_ENERGY || capability == Capabilities.TESLA_CONSUMER || capability == Capabilities.TESLA_HOLDER;
}
@SuppressWarnings( "unchecked" )
@Override
public <T> T getCapability( Capability<T> capability, @Nullable EnumFacing facing )
{
if( capability == CapabilityEnergy.ENERGY )
if( capability == Capabilities.FORGE_ENERGY )
{
return (T) this;
}