Fixed unchecked warning

This commit is contained in:
drcrazy 2018-05-17 03:41:19 +03:00
parent 8cf66a7f1d
commit 29b886ea8d

View file

@ -74,11 +74,11 @@ public class TileCable extends TileEntity implements ITickable, IEnergyStorage,
return super.hasCapability(capability, facing); return super.hasCapability(capability, facing);
} }
@SuppressWarnings("unchecked")
@Override @Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) { public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
if (capability == CapabilityEnergy.ENERGY) { if (capability == CapabilityEnergy.ENERGY) {
return (T) this; return CapabilityEnergy.ENERGY.cast(this);
} }
return super.getCapability(capability, facing); return super.getCapability(capability, facing);
} }