Initial Fluid Integration (#3510)

* Added Fluid Storage Cells

* Added Fluid Import Bus

* Added Fluid Export Bus

* Added Fluid Storage Bus

* Added Fluid Terminal.
While holding a item with the FLUID_HANDLER_ITEM_CAPABILITY, such as a tank
Left click on a fluid to extract the fluid
Right click to insert the fluid
This commit is contained in:
Brock
2018-06-12 03:55:33 +10:00
committed by yueh
parent 89bebc4385
commit d16677224a
126 changed files with 8031 additions and 778 deletions
@@ -163,7 +163,7 @@ public class ApiStorage implements IStorageHelper
@Override
public int transferFactor()
{
return 1000;
return 125;
}
@Override
@@ -30,6 +30,9 @@ import appeng.debug.ToolDebugCard;
import appeng.debug.ToolEraser;
import appeng.debug.ToolMeteoritePlacer;
import appeng.debug.ToolReplicatorCard;
import appeng.fluids.items.BasicFluidStorageCell;
import appeng.fluids.items.FluidDummyItem;
import appeng.fluids.items.FluidDummyItemRendering;
import appeng.hooks.DispenserBlockTool;
import appeng.hooks.DispenserMatterCannon;
import appeng.items.materials.MaterialType;
@@ -40,7 +43,7 @@ import appeng.items.misc.ItemPaintBall;
import appeng.items.misc.ItemPaintBallRendering;
import appeng.items.parts.FacadeRendering;
import appeng.items.parts.ItemFacade;
import appeng.items.storage.ItemBasicStorageCell;
import appeng.items.storage.BasicItemStorageCell;
import appeng.items.storage.ItemCreativeStorageCell;
import appeng.items.storage.ItemSpatialStorageCell;
import appeng.items.storage.ItemViewCell;
@@ -102,6 +105,11 @@ public final class ApiItems implements IItems
private final IItemDefinition cell16k;
private final IItemDefinition cell64k;
private final IItemDefinition fluidCell1k;
private final IItemDefinition fluidCell4k;
private final IItemDefinition fluidCell16k;
private final IItemDefinition fluidCell64k;
private final IItemDefinition spatialCell2;
private final IItemDefinition spatialCell16;
private final IItemDefinition spatialCell128;
@@ -123,6 +131,8 @@ public final class ApiItems implements IItems
private final IItemDefinition toolDebugCard;
private final IItemDefinition toolReplicatorCard;
private final IItemDefinition dummyFluidItem;
public ApiItems( FeatureFactory registry )
{
FeatureFactory certusTools = registry.features( AEFeature.CERTUS_QUARTZ_TOOLS );
@@ -198,10 +208,15 @@ public final class ApiItems implements IItems
this.viewCell = registry.item( "view_cell", ItemViewCell::new ).features( AEFeature.VIEW_CELL ).build();
FeatureFactory storageCells = registry.features( AEFeature.STORAGE_CELLS );
this.cell1k = storageCells.item( "storage_cell_1k", () -> new ItemBasicStorageCell( MaterialType.CELL1K_PART, 1 ) ).build();
this.cell4k = storageCells.item( "storage_cell_4k", () -> new ItemBasicStorageCell( MaterialType.CELL4K_PART, 4 ) ).build();
this.cell16k = storageCells.item( "storage_cell_16k", () -> new ItemBasicStorageCell( MaterialType.CELL16K_PART, 16 ) ).build();
this.cell64k = storageCells.item( "storage_cell_64k", () -> new ItemBasicStorageCell( MaterialType.CELL64K_PART, 64 ) ).build();
this.cell1k = storageCells.item( "storage_cell_1k", () -> new BasicItemStorageCell( MaterialType.CELL1K_PART, 1 ) ).build();
this.cell4k = storageCells.item( "storage_cell_4k", () -> new BasicItemStorageCell( MaterialType.CELL4K_PART, 4 ) ).build();
this.cell16k = storageCells.item( "storage_cell_16k", () -> new BasicItemStorageCell( MaterialType.CELL16K_PART, 16 ) ).build();
this.cell64k = storageCells.item( "storage_cell_64k", () -> new BasicItemStorageCell( MaterialType.CELL64K_PART, 64 ) ).build();
this.fluidCell1k = storageCells.item( "fluid_storage_cell_1k", () -> new BasicFluidStorageCell( MaterialType.FLUID_CELL1K_PART, 1 ) ).build();
this.fluidCell4k = storageCells.item( "fluid_storage_cell_4k", () -> new BasicFluidStorageCell( MaterialType.FLUID_CELL4K_PART, 4 ) ).build();
this.fluidCell16k = storageCells.item( "fluid_storage_cell_16k", () -> new BasicFluidStorageCell( MaterialType.FLUID_CELL16K_PART, 16 ) ).build();
this.fluidCell64k = storageCells.item( "fluid_storage_cell_64k", () -> new BasicFluidStorageCell( MaterialType.FLUID_CELL64K_PART, 64 ) ).build();
FeatureFactory spatialCells = registry.features( AEFeature.SPATIAL_IO );
this.spatialCell2 = spatialCells.item( "spatial_storage_cell_2_cubed", () -> new ItemSpatialStorageCell( 2 ) ).build();
@@ -236,6 +251,8 @@ public final class ApiItems implements IItems
this.toolMeteoritePlacer = debugTools.item( "debug_meteorite_placer", ToolMeteoritePlacer::new ).build();
this.toolDebugCard = debugTools.item( "debug_card", ToolDebugCard::new ).build();
this.toolReplicatorCard = debugTools.item( "debug_replicator_card", ToolReplicatorCard::new ).build();
this.dummyFluidItem = registry.item( "dummy_fluid_item", FluidDummyItem::new ).rendering( new FluidDummyItemRendering() ).build();
}
@Override
@@ -406,6 +423,30 @@ public final class ApiItems implements IItems
return this.cell64k;
}
@Override
public IItemDefinition fluidCell1k()
{
return this.fluidCell1k;
}
@Override
public IItemDefinition fluidCell4k()
{
return this.fluidCell4k;
}
@Override
public IItemDefinition fluidCell16k()
{
return this.fluidCell16k;
}
@Override
public IItemDefinition fluidCell64k()
{
return this.fluidCell64k;
}
@Override
public IItemDefinition spatialCell2()
{
@@ -484,4 +525,9 @@ public final class ApiItems implements IItems
{
return this.toolReplicatorCard;
}
public IItemDefinition dummyFluidItem()
{
return this.dummyFluidItem;
}
}
@@ -111,6 +111,11 @@ public final class ApiMaterials implements IMaterials
private final IItemDefinition qESingularity;
private final IItemDefinition blankPattern;
private final IItemDefinition fluidCell1kPart;
private final IItemDefinition fluidCell4kPart;
private final IItemDefinition fluidCell16kPart;
private final IItemDefinition fluidCell64kPart;
public ApiMaterials( FeatureFactory registry )
{
final ItemMaterial materials = new ItemMaterial();
@@ -210,6 +215,11 @@ public final class ApiMaterials implements IMaterials
this.qESingularity = new DamagedItemDefinition( "material.singularity.entangled.quantum", materials
.createMaterial( MaterialType.QUANTUM_ENTANGLED_SINGULARITY ) );
this.blankPattern = new DamagedItemDefinition( "material.pattern.blank", materials.createMaterial( MaterialType.BLANK_PATTERN ) );
this.fluidCell1kPart = new DamagedItemDefinition( "material.cell.storage.1k", materials.createMaterial( MaterialType.FLUID_CELL1K_PART ) );
this.fluidCell4kPart = new DamagedItemDefinition( "material.cell.storage.4k", materials.createMaterial( MaterialType.FLUID_CELL4K_PART ) );
this.fluidCell16kPart = new DamagedItemDefinition( "material.cell.storage.16k", materials.createMaterial( MaterialType.FLUID_CELL16K_PART ) );
this.fluidCell64kPart = new DamagedItemDefinition( "material.cell.storage.64k", materials.createMaterial( MaterialType.FLUID_CELL64K_PART ) );
}
@Override
@@ -529,4 +539,28 @@ public final class ApiMaterials implements IMaterials
{
return this.blankPattern;
}
@Override
public IItemDefinition fluidCell1kPart()
{
return this.fluidCell1kPart;
}
@Override
public IItemDefinition fluidCell4kPart()
{
return this.fluidCell4kPart;
}
@Override
public IItemDefinition fluidCell16kPart()
{
return this.fluidCell16kPart;
}
@Override
public IItemDefinition fluidCell64kPart()
{
return this.fluidCell64kPart;
}
}
@@ -77,6 +77,10 @@ public final class ApiParts implements IParts
private final IItemDefinition terminal;
private final IItemDefinition storageMonitor;
private final IItemDefinition conversionMonitor;
private final IItemDefinition fluidImportBus;
private final IItemDefinition fluidExportBus;
private final IItemDefinition fluidTerminal;
private final IItemDefinition fluidStorageBus;
public ApiParts( FeatureFactory registry, PartModels partModels )
{
@@ -109,8 +113,8 @@ public final class ApiParts implements IParts
this.iface = new DamagedItemDefinition( "part.interface", itemPart.createPart( PartType.INTERFACE ) );
this.levelEmitter = new DamagedItemDefinition( "part.level_emitter", itemPart.createPart( PartType.LEVEL_EMITTER ) );
this.annihilationPlane = new DamagedItemDefinition( "part.plane.annihilation", itemPart.createPart( PartType.ANNIHILATION_PLANE ) );
this.identityAnnihilationPlane = new DamagedItemDefinition( "part.plane.annihiliation.identity", itemPart
.createPart( PartType.IDENTITY_ANNIHILATION_PLANE ) );
this.identityAnnihilationPlane = new DamagedItemDefinition( "part.plane.annihiliation.identity",
itemPart.createPart( PartType.IDENTITY_ANNIHILATION_PLANE ) );
this.formationPlane = new DamagedItemDefinition( "part.plane.formation", itemPart.createPart( PartType.FORMATION_PLANE ) );
this.p2PTunnelME = new DamagedItemDefinition( "part.tunnel.me", itemPart.createPart( PartType.P2P_TUNNEL_ME ) );
this.p2PTunnelRedstone = new DamagedItemDefinition( "part.tunnel.redstone", itemPart.createPart( PartType.P2P_TUNNEL_REDSTONE ) );
@@ -131,6 +135,10 @@ public final class ApiParts implements IParts
this.terminal = new DamagedItemDefinition( "part.terminal", itemPart.createPart( PartType.TERMINAL ) );
this.storageMonitor = new DamagedItemDefinition( "part.monitor.storage", itemPart.createPart( PartType.STORAGE_MONITOR ) );
this.conversionMonitor = new DamagedItemDefinition( "part.monitor.conversion", itemPart.createPart( PartType.CONVERSION_MONITOR ) );
this.fluidImportBus = new DamagedItemDefinition( "part.bus.import.fluid", itemPart.createPart( PartType.FLUID_IMPORT_BUS ) );
this.fluidExportBus = new DamagedItemDefinition( "part.bus.export.fluid", itemPart.createPart( PartType.FLUID_EXPORT_BUS ) );
this.fluidTerminal = new DamagedItemDefinition( "part.terminal.fluid", itemPart.createPart( PartType.FLUID_TERMINAL ) );
this.fluidStorageBus = new DamagedItemDefinition( "part.bus.storage.fluid", itemPart.createPart( PartType.FLUID_STORAGE_BUS ) );
}
private static AEColoredItemDefinition constructColoredDefinition( final ItemPart target, final PartType type )
@@ -380,4 +388,28 @@ public final class ApiParts implements IParts
{
return this.conversionMonitor;
}
@Override
public IItemDefinition fluidTerminal()
{
return this.fluidTerminal;
}
@Override
public IItemDefinition fluidImportBus()
{
return this.fluidImportBus;
}
@Override
public IItemDefinition fluidExportBus()
{
return this.fluidExportBus;
}
@Override
public IItemDefinition fluidStorageBus()
{
return this.fluidStorageBus;
}
}