Flattening part 1

This commit is contained in:
Sebastian Hartte
2020-06-05 22:47:29 +02:00
parent c411a800f6
commit bb453b0d35
43 changed files with 492 additions and 594 deletions
@@ -29,6 +29,7 @@ import appeng.bootstrap.IBlockRendering;
import appeng.bootstrap.IItemRendering;
// FIXME REMOVE
public class BlockEnergyCellRendering extends BlockRenderingCustomizer
{
@@ -42,37 +43,6 @@ public class BlockEnergyCellRendering extends BlockRenderingCustomizer
@Override
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
// FIXME itemRendering.meshDefinition( this::getItemModel );
// Note: Since we use the block models, we dont need to register custom variants
}
/**
* Determines which version of the energy cell model should be used depending on the fill factor
* of the item stack.
*/
// FIXME private ModelResourceLocation getItemModel( ItemStack is )
// FIXME {
// FIXME double fillFactor = getFillFactor( is );
// FIXME
// FIXME int storageLevel = TileEnergyCell.getStorageLevelFromFillFactor( fillFactor );
// FIXME return new ModelResourceLocation( this.baseModel, "fullness=" + storageLevel );
// FIXME }
/**
* Helper method that returns the energy fill factor (between 0 and 1) of a given item stack.
* Returns 0 if the item stack has no fill factor.
*/
private static double getFillFactor( ItemStack is )
{
if( !( is.getItem() instanceof IAEItemPowerStorage ) )
{
return 0;
}
AEBaseBlockItemChargeable itemChargeable = (AEBaseBlockItemChargeable) is.getItem();
double curPower = itemChargeable.getAECurrentPower( is );
double maxPower = itemChargeable.getAEMaxPower( is );
return curPower / maxPower;
}
}