Added older registries back in

This commit is contained in:
Sebastian Hartte
2020-06-04 23:25:11 +02:00
parent 70444999b9
commit 51e82587c7
38 changed files with 453 additions and 434 deletions
@@ -11,6 +11,7 @@ import appeng.api.storage.data.IAEStack;
import appeng.api.util.IClientHelper;
import appeng.core.localization.GuiText;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
public class ApiClientHelper implements IClientHelper
@@ -27,10 +28,15 @@ public class ApiClientHelper implements IClientHelper
if( cellInventory != null )
{
lines.add( cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() );
lines.add(new StringTextComponent(cellInventory.getUsedBytes() + " ")
.appendSibling(GuiText.Of.textComponent())
.appendText(" " + cellInventory.getTotalBytes() + " ")
.appendSibling(GuiText.BytesUsed.textComponent()));
lines.add( cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalItemTypes() + ' ' + GuiText.Types
.getLocal() );
lines.add(new StringTextComponent(cellInventory.getStoredItemTypes() + " ")
.appendSibling(GuiText.Of.textComponent())
.appendText(" " + cellInventory.getTotalItemTypes() + " ")
.appendSibling(GuiText.Types.textComponent()));
}
if( handler.isPreformatted() )
@@ -39,11 +45,15 @@ public class ApiClientHelper implements IClientHelper
if( handler.isFuzzy() )
{
lines.add( GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal() );
lines.add( GuiText.Partitioned.textComponent()
.appendText(" - " + list + " ")
.appendSibling(GuiText.Fuzzy.textComponent()));
}
else
{
lines.add( GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal() );
lines.add( GuiText.Partitioned.textComponent()
.appendText(" - " + list + " ")
.appendSibling(GuiText.Precise.textComponent()));
}
}
@@ -24,7 +24,37 @@ import appeng.api.definitions.IItems;
import appeng.api.util.AEColoredItemDefinition;
import appeng.bootstrap.FeatureFactory;
import appeng.api.features.AEFeature;
import appeng.bootstrap.components.IEntityRegistrationComponent;
import appeng.client.render.crafting.ItemEncodedPatternRendering;
import appeng.core.CreativeTabFacade;
import appeng.debug.ToolDebugCard;
import appeng.debug.ToolEraser;
import appeng.debug.ToolMeteoritePlacer;
import appeng.debug.ToolReplicatorCard;
import appeng.entity.EntityGrowingCrystal;
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;
import appeng.items.misc.*;
import appeng.items.parts.FacadeRendering;
import appeng.items.parts.ItemFacade;
import appeng.items.storage.BasicItemStorageCell;
import appeng.items.storage.ItemCreativeStorageCell;
import appeng.items.storage.ItemSpatialStorageCell;
import appeng.items.storage.ItemViewCell;
import appeng.items.tools.*;
import appeng.items.tools.powered.*;
import appeng.items.tools.quartz.*;
import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraftforge.common.ToolType;
import java.util.function.Consumer;
/**
@@ -32,209 +62,250 @@ import appeng.items.tools.quartz.*;
*/
public final class ApiItems implements IItems
{
// FIXME: Make final after porting
private IItemDefinition certusQuartzAxe;
private IItemDefinition certusQuartzHoe;
private IItemDefinition certusQuartzShovel;
private IItemDefinition certusQuartzPick;
private IItemDefinition certusQuartzSword;
private IItemDefinition certusQuartzWrench;
private IItemDefinition certusQuartzKnife;
private final IItemDefinition certusQuartzAxe;
private final IItemDefinition certusQuartzHoe;
private final IItemDefinition certusQuartzShovel;
private final IItemDefinition certusQuartzPick;
private final IItemDefinition certusQuartzSword;
private final IItemDefinition certusQuartzWrench;
private final IItemDefinition certusQuartzKnife;
private IItemDefinition netherQuartzAxe;
private IItemDefinition netherQuartzHoe;
private IItemDefinition netherQuartzShovel;
private IItemDefinition netherQuartzPick;
private IItemDefinition netherQuartzSword;
private IItemDefinition netherQuartzWrench;
private IItemDefinition netherQuartzKnife;
private final IItemDefinition netherQuartzAxe;
private final IItemDefinition netherQuartzHoe;
private final IItemDefinition netherQuartzShovel;
private final IItemDefinition netherQuartzPick;
private final IItemDefinition netherQuartzSword;
private final IItemDefinition netherQuartzWrench;
private final IItemDefinition netherQuartzKnife;
private IItemDefinition entropyManipulator;
private IItemDefinition wirelessTerminal;
private IItemDefinition biometricCard;
private IItemDefinition chargedStaff;
private IItemDefinition massCannon;
private IItemDefinition memoryCard;
private IItemDefinition networkTool;
private IItemDefinition portableCell;
private final IItemDefinition entropyManipulator;
private final IItemDefinition wirelessTerminal;
private final IItemDefinition biometricCard;
private final IItemDefinition chargedStaff;
private final IItemDefinition massCannon;
private final IItemDefinition memoryCard;
private final IItemDefinition networkTool;
private final IItemDefinition portableCell;
private IItemDefinition cellCreative;
private IItemDefinition viewCell;
private final IItemDefinition cellCreative;
private final IItemDefinition viewCell;
private IItemDefinition cell1k;
private IItemDefinition cell4k;
private IItemDefinition cell16k;
private IItemDefinition cell64k;
private final IItemDefinition cell1k;
private final IItemDefinition cell4k;
private final IItemDefinition cell16k;
private final IItemDefinition cell64k;
private IItemDefinition fluidCell1k;
private IItemDefinition fluidCell4k;
private IItemDefinition fluidCell16k;
private IItemDefinition fluidCell64k;
private final IItemDefinition fluidCell1k;
private final IItemDefinition fluidCell4k;
private final IItemDefinition fluidCell16k;
private final IItemDefinition fluidCell64k;
private IItemDefinition spatialCell2;
private IItemDefinition spatialCell16;
private IItemDefinition spatialCell128;
private final IItemDefinition spatialCell2;
private final IItemDefinition spatialCell16;
private final IItemDefinition spatialCell128;
private IItemDefinition facade;
private IItemDefinition crystalSeed;
private final IItemDefinition facade;
private final IItemDefinition crystalSeed;
// rv1
private IItemDefinition encodedPattern;
private IItemDefinition colorApplicator;
private final IItemDefinition encodedPattern;
private final IItemDefinition colorApplicator;
private IItemDefinition paintBall;
private AEColoredItemDefinition coloredPaintBall;
private AEColoredItemDefinition coloredLumenPaintBall;
private final IItemDefinition paintBall;
private final AEColoredItemDefinition coloredPaintBall;
private final AEColoredItemDefinition coloredLumenPaintBall;
// unsupported dev tools
private IItemDefinition toolEraser;
private IItemDefinition toolMeteoritePlacer;
private IItemDefinition toolDebugCard;
private IItemDefinition toolReplicatorCard;
private final IItemDefinition toolEraser;
private final IItemDefinition toolMeteoritePlacer;
private final IItemDefinition toolDebugCard;
private final IItemDefinition toolReplicatorCard;
private IItemDefinition dummyFluidItem;
private final IItemDefinition dummyFluidItem;
public ApiItems( FeatureFactory registry )
{
FeatureFactory certusTools = registry.features( AEFeature.CERTUS_QUARTZ_TOOLS );
this.certusQuartzAxe = certusTools.item( "certus_quartz_axe", () -> new ToolQuartzAxe( AEFeature.CERTUS_QUARTZ_TOOLS ) )
this.certusQuartzAxe = certusTools.item( "certus_quartz_axe", props -> new ToolQuartzAxe( props, AEFeature.CERTUS_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.TOOLS)
.addFeatures( AEFeature.QUARTZ_AXE )
.build();
this.certusQuartzHoe = certusTools.item( "certus_quartz_hoe", () -> new ToolQuartzHoe( AEFeature.CERTUS_QUARTZ_TOOLS ) )
this.certusQuartzHoe = certusTools.item( "certus_quartz_hoe", props -> new ToolQuartzHoe( props, AEFeature.CERTUS_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.TOOLS)
.addFeatures( AEFeature.QUARTZ_HOE )
.build();
this.certusQuartzShovel = certusTools.item( "certus_quartz_spade", () -> new ToolQuartzSpade( AEFeature.CERTUS_QUARTZ_TOOLS ) )
this.certusQuartzShovel = certusTools.item( "certus_quartz_spade", props -> new ToolQuartzSpade( props, AEFeature.CERTUS_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.TOOLS)
.addFeatures( AEFeature.QUARTZ_SPADE )
.build();
this.certusQuartzPick = certusTools.item( "certus_quartz_pickaxe", () -> new ToolQuartzPickaxe( AEFeature.CERTUS_QUARTZ_TOOLS ) )
this.certusQuartzPick = certusTools.item( "certus_quartz_pickaxe", props -> new ToolQuartzPickaxe( props, AEFeature.CERTUS_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.TOOLS)
.addFeatures( AEFeature.QUARTZ_PICKAXE )
.build();
this.certusQuartzSword = certusTools.item( "certus_quartz_sword", () -> new ToolQuartzSword( AEFeature.CERTUS_QUARTZ_TOOLS ) )
this.certusQuartzSword = certusTools.item( "certus_quartz_sword", props -> new ToolQuartzSword( props, AEFeature.CERTUS_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.COMBAT)
.addFeatures( AEFeature.QUARTZ_SWORD )
.build();
this.certusQuartzWrench = certusTools.item( "certus_quartz_wrench", ToolQuartzWrench::new )
.itemGroup(ItemGroup.TOOLS)
.props(props -> props.maxStackSize( 1 ) )
.addFeatures( AEFeature.QUARTZ_WRENCH )
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzWrench", new ItemStack( item ) ) )
.build();
this.certusQuartzKnife = certusTools.item( "certus_quartz_cutting_knife", () -> new ToolQuartzCuttingKnife( AEFeature.CERTUS_QUARTZ_TOOLS ) )
this.certusQuartzKnife = certusTools.item( "certus_quartz_cutting_knife", props -> new ToolQuartzCuttingKnife( props, AEFeature.CERTUS_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.TOOLS)
.props(props -> props.maxStackSize(1).maxDamage(50).setNoRepair())
.addFeatures( AEFeature.QUARTZ_KNIFE )
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzKnife", new ItemStack( item ) ) )
.build();
FeatureFactory netherTools = registry.features( AEFeature.NETHER_QUARTZ_TOOLS );
this.netherQuartzAxe = netherTools.item( "nether_quartz_axe", () -> new ToolQuartzAxe( AEFeature.NETHER_QUARTZ_TOOLS ) )
this.netherQuartzAxe = netherTools.item( "nether_quartz_axe", props -> new ToolQuartzAxe( props, AEFeature.NETHER_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.TOOLS)
.addFeatures( AEFeature.QUARTZ_AXE )
.build();
this.netherQuartzHoe = netherTools.item( "nether_quartz_hoe", () -> new ToolQuartzHoe( AEFeature.NETHER_QUARTZ_TOOLS ) )
this.netherQuartzHoe = netherTools.item( "nether_quartz_hoe", props -> new ToolQuartzHoe( props, AEFeature.NETHER_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.TOOLS)
.addFeatures( AEFeature.QUARTZ_HOE )
.build();
this.netherQuartzShovel = netherTools.item( "nether_quartz_spade", () -> new ToolQuartzSpade( AEFeature.NETHER_QUARTZ_TOOLS ) )
this.netherQuartzShovel = netherTools.item( "nether_quartz_spade", props -> new ToolQuartzSpade( props, AEFeature.NETHER_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.TOOLS)
.addFeatures( AEFeature.QUARTZ_SPADE )
.build();
this.netherQuartzPick = netherTools.item( "nether_quartz_pickaxe", () -> new ToolQuartzPickaxe( AEFeature.NETHER_QUARTZ_TOOLS ) )
this.netherQuartzPick = netherTools.item( "nether_quartz_pickaxe", props -> new ToolQuartzPickaxe( props, AEFeature.NETHER_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.TOOLS)
.addFeatures( AEFeature.QUARTZ_PICKAXE )
.build();
this.netherQuartzSword = netherTools.item( "nether_quartz_sword", () -> new ToolQuartzSword( AEFeature.NETHER_QUARTZ_TOOLS ) )
this.netherQuartzSword = netherTools.item( "nether_quartz_sword", props -> new ToolQuartzSword( props, AEFeature.NETHER_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.COMBAT)
.addFeatures( AEFeature.QUARTZ_SWORD )
.build();
this.netherQuartzWrench = netherTools.item( "nether_quartz_wrench", ToolQuartzWrench::new )
.itemGroup(ItemGroup.TOOLS)
.props(props -> props.maxStackSize( 1 ) )
.addFeatures( AEFeature.QUARTZ_WRENCH )
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzWrench", new ItemStack( item ) ) )
.build();
this.netherQuartzKnife = netherTools.item( "nether_quartz_cutting_knife", () -> new ToolQuartzCuttingKnife( AEFeature.NETHER_QUARTZ_TOOLS ) )
this.netherQuartzKnife = netherTools.item( "nether_quartz_cutting_knife", props -> new ToolQuartzCuttingKnife( props, AEFeature.NETHER_QUARTZ_TOOLS ) )
.itemGroup(ItemGroup.TOOLS)
.props(props -> props.maxStackSize(1).maxDamage(50).setNoRepair())
.addFeatures( AEFeature.QUARTZ_KNIFE )
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzKnife", new ItemStack( item ) ) )
.build();
// FeatureFactory powerTools = registry.features( AEFeature.POWERED_TOOLS );
// this.entropyManipulator = powerTools.item( "entropy_manipulator", ToolEntropyManipulator::new )
// .addFeatures( AEFeature.ENTROPY_MANIPULATOR )
// .dispenserBehavior( DispenserBlockTool::new )
// .build();
// this.wirelessTerminal = powerTools.item( "wireless_terminal", ToolWirelessTerminal::new ).addFeatures( AEFeature.WIRELESS_ACCESS_TERMINAL ).build();
// this.chargedStaff = powerTools.item( "charged_staff", ToolChargedStaff::new ).addFeatures( AEFeature.CHARGED_STAFF ).build();
// this.massCannon = powerTools.item( "matter_cannon", ToolMatterCannon::new )
// .addFeatures( AEFeature.MATTER_CANNON )
// .dispenserBehavior( DispenserMatterCannon::new )
// .build();
// this.portableCell = powerTools.item( "portable_cell", ToolPortableCell::new ).addFeatures( AEFeature.PORTABLE_CELL, AEFeature.STORAGE_CELLS ).build();
// this.colorApplicator = powerTools.item( "color_applicator", ToolColorApplicator::new )
// .addFeatures( AEFeature.COLOR_APPLICATOR )
// .dispenserBehavior( DispenserBlockTool::new )
// .rendering( new ToolColorApplicatorRendering() )
// .build();
//
// this.biometricCard = registry.item( "biometric_card", ToolBiometricCard::new )
// .rendering( new ToolBiometricCardRendering() )
// .features( AEFeature.SECURITY )
// .build();
// this.memoryCard = registry.item( "memory_card", ToolMemoryCard::new )
// .rendering( new ToolMemoryCardRendering() )
// .features( AEFeature.MEMORY_CARD )
// .build();
// this.networkTool = registry.item( "network_tool", ToolNetworkTool::new ).features( AEFeature.NETWORK_TOOL ).build();
//
// this.cellCreative = registry.item( "creative_storage_cell", ItemCreativeStorageCell::new )
// .features( AEFeature.STORAGE_CELLS, AEFeature.CREATIVE )
// .build();
// 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 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();
// this.spatialCell16 = spatialCells.item( "spatial_storage_cell_16_cubed", () -> new ItemSpatialStorageCell( 16 ) ).build();
// this.spatialCell128 = spatialCells.item( "spatial_storage_cell_128_cubed", () -> new ItemSpatialStorageCell( 128 ) ).build();
//
// this.facade = registry.item( "facade", ItemFacade::new )
// .features( AEFeature.FACADES )
// .creativeTab( CreativeTabFacade.instance )
// .rendering( new FacadeRendering() )
// .build();
// this.crystalSeed = registry.item( "crystal_seed", ItemCrystalSeed::new )
// .features( AEFeature.CRYSTAL_SEEDS )
// .rendering( new ItemCrystalSeedRendering() )
// .bootstrap( item -> (IEntityRegistrationComponent) r ->
// {
// r.register( EntityEntryBuilder.create()
// .entity( EntityGrowingCrystal.class )
// .id( new ResourceLocation( "appliedenergistics2", EntityGrowingCrystal.class.getName() ),
// EntityIds.get( EntityGrowingCrystal.class ) )
// .name( EntityGrowingCrystal.class.getSimpleName() )
// .tracker( 16, 4, true )
// .build() );
// } )
// .build();
//
// // rv1
// this.encodedPattern = registry.item( "encoded_pattern", ItemEncodedPattern::new )
// .features( AEFeature.PATTERNS )
// .rendering( new ItemEncodedPatternRendering() )
// .build();
//
// this.paintBall = registry.item( "paint_ball", ItemPaintBall::new )
// .features( AEFeature.PAINT_BALLS )
// .rendering( new ItemPaintBallRendering() )
// .build();
// this.coloredPaintBall = registry.colored( this.paintBall, 0 );
// this.coloredLumenPaintBall = registry.colored( this.paintBall, 20 );
//
// FeatureFactory debugTools = registry.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE );
// this.toolEraser = debugTools.item( "debug_eraser", ToolEraser::new ).build();
// 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();
Consumer<Item.Properties> chargedDefaults = props -> props.maxStackSize( 1 ).maxDamage( 32 ).setNoRepair();
FeatureFactory powerTools = registry.features( AEFeature.POWERED_TOOLS );
this.entropyManipulator = powerTools.item( "entropy_manipulator", ToolEntropyManipulator::new )
.props(chargedDefaults)
.addFeatures( AEFeature.ENTROPY_MANIPULATOR )
.dispenserBehavior( DispenserBlockTool::new )
.build();
this.wirelessTerminal = powerTools.item( "wireless_terminal", ToolWirelessTerminal::new )
.props(chargedDefaults)
.addFeatures( AEFeature.WIRELESS_ACCESS_TERMINAL )
.build();
this.chargedStaff = powerTools.item( "charged_staff", ToolChargedStaff::new )
.props(chargedDefaults)
.addFeatures( AEFeature.CHARGED_STAFF )
.build();
this.massCannon = powerTools.item( "matter_cannon", ToolMatterCannon::new )
.props(chargedDefaults)
.addFeatures( AEFeature.MATTER_CANNON )
.dispenserBehavior( DispenserMatterCannon::new )
.build();
this.portableCell = powerTools.item( "portable_cell", ToolPortableCell::new )
.props(chargedDefaults)
.addFeatures( AEFeature.PORTABLE_CELL, AEFeature.STORAGE_CELLS )
.build();
this.colorApplicator = powerTools.item( "color_applicator", ToolColorApplicator::new )
.props(chargedDefaults)
.addFeatures( AEFeature.COLOR_APPLICATOR )
.dispenserBehavior( DispenserBlockTool::new )
.rendering( new ToolColorApplicatorRendering() )
.build();
this.biometricCard = registry.item( "biometric_card", ToolBiometricCard::new )
.props(props -> props.maxStackSize( 1 ))
.rendering( new ToolBiometricCardRendering() )
.features( AEFeature.SECURITY )
.build();
this.memoryCard = registry.item( "memory_card", ToolMemoryCard::new )
.props(props -> props.maxStackSize( 1 ))
.rendering( new ToolMemoryCardRendering() )
.features( AEFeature.MEMORY_CARD )
.build();
this.networkTool = registry.item( "network_tool", ToolNetworkTool::new )
.props(props -> props.maxStackSize( 1 ).addToolType( ToolType.get("wrench"), 0 ) )
.features( AEFeature.NETWORK_TOOL )
.build();
this.cellCreative = registry.item( "creative_storage_cell", ItemCreativeStorageCell::new )
.props(props -> props.maxStackSize(1))
.features( AEFeature.STORAGE_CELLS, AEFeature.CREATIVE )
.build();
this.viewCell = registry.item( "view_cell", ItemViewCell::new )
.props(props -> props.maxStackSize(1))
.features( AEFeature.VIEW_CELL )
.build();
FeatureFactory storageCells = registry.features( AEFeature.STORAGE_CELLS );
this.cell1k = storageCells.item( "storage_cell_1k", props -> new BasicItemStorageCell(props, MaterialType.CELL1K_PART, 1 ) ).build();
this.cell4k = storageCells.item( "storage_cell_4k", props -> new BasicItemStorageCell(props, MaterialType.CELL4K_PART, 4 ) ).build();
this.cell16k = storageCells.item( "storage_cell_16k", props -> new BasicItemStorageCell(props, MaterialType.CELL16K_PART, 16 ) ).build();
this.cell64k = storageCells.item( "storage_cell_64k", props -> new BasicItemStorageCell(props, MaterialType.CELL64K_PART, 64 ) ).build();
this.fluidCell1k = storageCells.item( "fluid_storage_cell_1k", props -> new BasicFluidStorageCell(props, MaterialType.FLUID_CELL1K_PART, 1 ) ).build();
this.fluidCell4k = storageCells.item( "fluid_storage_cell_4k", props -> new BasicFluidStorageCell(props, MaterialType.FLUID_CELL4K_PART, 4 ) ).build();
this.fluidCell16k = storageCells.item( "fluid_storage_cell_16k", props -> new BasicFluidStorageCell(props, MaterialType.FLUID_CELL16K_PART, 16 ) ).build();
this.fluidCell64k = storageCells.item( "fluid_storage_cell_64k", props -> new BasicFluidStorageCell(props, MaterialType.FLUID_CELL64K_PART, 64 ) ).build();
FeatureFactory spatialCells = registry.features( AEFeature.SPATIAL_IO );
this.spatialCell2 = spatialCells.item( "spatial_storage_cell_2_cubed", props -> new ItemSpatialStorageCell(props, 2 ) ).build();
this.spatialCell16 = spatialCells.item( "spatial_storage_cell_16_cubed", props -> new ItemSpatialStorageCell(props, 16 ) ).build();
this.spatialCell128 = spatialCells.item( "spatial_storage_cell_128_cubed", props -> new ItemSpatialStorageCell(props, 128 ) ).build();
this.facade = registry.item( "facade", ItemFacade::new )
.features( AEFeature.FACADES )
.itemGroup( CreativeTabFacade.instance )
.rendering( new FacadeRendering() )
.build();
this.crystalSeed = registry.item( "crystal_seed", ItemCrystalSeed::new )
.features( AEFeature.CRYSTAL_SEEDS )
.rendering( new ItemCrystalSeedRendering() )
.bootstrap( item -> (IEntityRegistrationComponent) r ->
{
r.register( EntityType.Builder.<EntityGrowingCrystal>create(EntityGrowingCrystal::new, EntityClassification.MISC)
.setTrackingRange(16)
.setUpdateInterval(4)
.setShouldReceiveVelocityUpdates(true)
.build("appliedenergistics2:growing_crystal")
.setRegistryName("appliedenergistics2:growing_crystal")
);
} )
.build();
// rv1
this.encodedPattern = registry.item( "encoded_pattern", ItemEncodedPattern::new )
.props(props -> props.maxStackSize(1))
.features( AEFeature.PATTERNS )
.rendering( new ItemEncodedPatternRendering() )
.build();
this.paintBall = registry.item( "paint_ball", ItemPaintBall::new )
.features( AEFeature.PAINT_BALLS )
.rendering( new ItemPaintBallRendering() )
.build();
this.coloredPaintBall = registry.colored( this.paintBall, 0 );
this.coloredLumenPaintBall = registry.colored( this.paintBall, 20 );
FeatureFactory debugTools = registry.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE );
this.toolEraser = debugTools.item( "debug_eraser", ToolEraser::new ).build();
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
@@ -22,8 +22,8 @@ package appeng.core.api.definitions;
import java.util.Arrays;
import java.util.stream.Collectors;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.EntityEntryBuilder;
import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -35,7 +35,6 @@ import appeng.bootstrap.ItemRenderingCustomizer;
import appeng.bootstrap.components.IEntityRegistrationComponent;
import appeng.core.features.DamagedItemDefinition;
import appeng.entity.EntityChargedQuartz;
import appeng.entity.EntityIds;
import appeng.entity.EntitySingularity;
import appeng.items.materials.ItemMaterial;
import appeng.items.materials.MaterialType;
@@ -124,15 +123,14 @@ public final class ApiMaterials implements IMaterials
public ApiMaterials( FeatureFactory registry )
{
final ItemMaterial materials = new ItemMaterial();
registry.item( "material", () -> materials )
IItemDefinition materialDef = registry.item( "material", ItemMaterial::new )
.rendering( new ItemRenderingCustomizer()
{
@Override
@OnlyIn( Dist.CLIENT )
public void customize( IItemRendering rendering )
{
rendering.meshDefinition( is -> materials.getTypeByStack( is ).getModel() );
// FIXME rendering.meshDefinition( is -> materials.getTypeByStack( is ).getModel() );
// Register a resource location for every material type
rendering.variants( Arrays.stream( MaterialType.values() )
.map( MaterialType::getModel )
@@ -141,21 +139,23 @@ public final class ApiMaterials implements IMaterials
} )
.bootstrap( item -> (IEntityRegistrationComponent) r ->
{
r.register( EntityEntryBuilder.create()
.entity( EntitySingularity.class )
.id( new ResourceLocation( "appliedenergistics2", EntitySingularity.class.getName() ), EntityIds.get( EntitySingularity.class ) )
.name( EntitySingularity.class.getSimpleName() )
.tracker( 16, 4, true )
.build() );
r.register( EntityEntryBuilder.create()
.entity( EntityChargedQuartz.class )
.id( new ResourceLocation( "appliedenergistics2", EntityChargedQuartz.class.getName() ),
EntityIds.get( EntityChargedQuartz.class ) )
.name( EntityChargedQuartz.class.getSimpleName() )
.tracker( 16, 4, true )
.build() );
r.register( EntityType.Builder.<EntitySingularity>create(EntitySingularity::new, EntityClassification.MISC)
.setTrackingRange(16)
.setUpdateInterval(4)
.setShouldReceiveVelocityUpdates(true)
.build("appliedenergistics2:singularity")
.setRegistryName("appliedenergistics2:singularity")
);
r.register( EntityType.Builder.<EntityChargedQuartz>create(EntityChargedQuartz::new, EntityClassification.MISC)
.setTrackingRange(16)
.setUpdateInterval(4)
.setShouldReceiveVelocityUpdates(true)
.build("appliedenergistics2:charged_quartz")
.setRegistryName("appliedenergistics2:charged_quartz")
);
} )
.build();
final ItemMaterial materials = (ItemMaterial) materialDef.item();
this.cell2SpatialPart = new DamagedItemDefinition( "material.cell.spatial.2", materials.createMaterial( MaterialType.CELL2_SPATIAL_PART ) );
this.cell16SpatialPart = new DamagedItemDefinition( "material.cell.spatial.16", materials.createMaterial( MaterialType.CELL16_SPATIAL_PART ) );
@@ -88,10 +88,10 @@ public final class ApiParts implements IParts
public ApiParts( FeatureFactory registry, PartModels partModels )
{
final ItemPart itemPart = new ItemPart();
registry.item( "part", () -> itemPart )
.rendering( new ItemPartRendering( partModels, itemPart ) )
IItemDefinition itemPartDef = registry.item( "part", ItemPart::new )
.rendering( new ItemPartRendering( partModels ) )
.build();
final ItemPart itemPart = (ItemPart) itemPartDef.item();
// Register all part models
for( PartType partType : PartType.values() )
@@ -126,9 +126,9 @@ public final class ApiParts implements IParts
this.fluidFormationPlane = new DamagedItemDefinition( "part.plane.fluid_formation", itemPart.createPart( PartType.FLUID_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 ) );
this.p2PTunnelItems = new DamagedItemDefinition( "part.tunnel.item", itemPart.createPart( PartType.P2P_TUNNEL_ITEMS ) );
this.p2PTunnelFluids = new DamagedItemDefinition( "part.tunnel.fluid", itemPart.createPart( PartType.P2P_TUNNEL_FLUIDS ) );
this.p2PTunnelEU = new DamagedItemDefinition( "part.tunnel.eu", itemPart.createPart( PartType.P2P_TUNNEL_IC2 ) );
this.p2PTunnelItems = null; // FIXME new DamagedItemDefinition( "part.tunnel.item", itemPart.createPart( PartType.P2P_TUNNEL_ITEMS ) );
this.p2PTunnelFluids = null; // FIXME new DamagedItemDefinition( "part.tunnel.fluid", itemPart.createPart( PartType.P2P_TUNNEL_FLUIDS ) );
this.p2PTunnelEU = null; // FIXME new DamagedItemDefinition( "part.tunnel.eu", itemPart.createPart( PartType.P2P_TUNNEL_IC2 ) );
this.p2PTunnelFE = new DamagedItemDefinition( "part.tunnel.fe", itemPart.createPart( PartType.P2P_TUNNEL_FE ) );
this.p2PTunnelLight = new DamagedItemDefinition( "part.tunnel.light", itemPart.createPart( PartType.P2P_TUNNEL_LIGHT ) );
// this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart(