Adds a debug generator for ForgeEnergy. (#3259)

* Adds a debug generator for ForgeEnergy.

This adds a simple debug block to test external energy injection via
ForgeEnergy and not rely solely on creative cells.

The energy has two functions. The first is acting as an infinite
ForgEnergy battery, this is unused by AE2 itself as nothing pulls
energy.
The second one is injecting energy every tick into any adjacent block
accepting ForgeEnergy.
The base generation is 8 per tick, but this is increased by the power of
adjacent TileEnergyGenerators.
This commit is contained in:
yueh
2017-12-21 17:29:39 +01:00
committed by GitHub
parent 641d0d40cc
commit e243c8e9a2
9 changed files with 215 additions and 5 deletions
@@ -106,10 +106,12 @@ import appeng.core.features.BlockDefinition;
import appeng.core.features.registries.PartModels;
import appeng.debug.BlockChunkloader;
import appeng.debug.BlockCubeGenerator;
import appeng.debug.BlockEnergyGenerator;
import appeng.debug.BlockItemGen;
import appeng.debug.BlockPhantomNode;
import appeng.debug.TileChunkLoader;
import appeng.debug.TileCubeGenerator;
import appeng.debug.TileEnergyGenerator;
import appeng.debug.TileItemGen;
import appeng.debug.TilePhantomNode;
import appeng.decorative.slab.BlockSlabCommon;
@@ -236,6 +238,7 @@ public final class ApiBlocks implements IBlocks
private final IBlockDefinition chunkLoader;
private final IBlockDefinition phantomNode;
private final IBlockDefinition cubeGenerator;
private final IBlockDefinition energyGenerator;
public ApiBlocks( FeatureFactory registry, PartModels partModels )
{
@@ -526,6 +529,11 @@ public final class ApiBlocks implements IBlocks
.tileEntity( new TileEntityDefinition( TileCubeGenerator.class ) )
.useCustomItemModel()
.build();
this.energyGenerator = registry.block( "debug_energy_gen", BlockEnergyGenerator::new )
.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE )
.tileEntity( new TileEntityDefinition( TileEnergyGenerator.class ) )
.useCustomItemModel()
.build();
}
private static IBlockDefinition makeSlab( String slabId, String doubleSlabId, FeatureFactory registry, IBlockDefinition blockDef )
@@ -1014,4 +1022,9 @@ public final class ApiBlocks implements IBlocks
{
return this.cubeGenerator;
}
public IBlockDefinition energyGenerator()
{
return energyGenerator;
}
}