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
+2 -1
View File
@@ -79,7 +79,7 @@ sourceSets {
include 'appeng/util/inv/InvOperation.java' include 'appeng/util/inv/InvOperation.java'
include 'appeng/core/features/registries/PartModels.java' include 'appeng/core/features/registries/PartModels.java'
include 'appeng/core/features/registries/PartModels.java' include 'appeng/core/features/registries/PartModels.java'
include 'appeng/core/api/definitions/ApiBlocks.java' include 'appeng/core/api/**'
include 'appeng/core/api/definitions/ApiItems.java' include 'appeng/core/api/definitions/ApiItems.java'
include 'appeng/items/tools/quartz/**' include 'appeng/items/tools/quartz/**'
include 'appeng/items/AEBaseItem.java' include 'appeng/items/AEBaseItem.java'
@@ -100,6 +100,7 @@ sourceSets {
include 'appeng/debug/**' include 'appeng/debug/**'
include 'appeng/core/localization/**' include 'appeng/core/localization/**'
include 'appeng/core/stats/**' include 'appeng/core/stats/**'
include 'appeng/client/render/crafting/ItemEncodedPatternRendering.java'
exclude 'appeng/parts/p2p/PartP2PFluids.java' exclude 'appeng/parts/p2p/PartP2PFluids.java'
exclude 'appeng/parts/p2p/PartP2PItems.java' exclude 'appeng/parts/p2p/PartP2PItems.java'
include 'appeng/tile/AEBaseTile.java' include 'appeng/tile/AEBaseTile.java'
@@ -95,9 +95,9 @@ public class FeatureFactory
return new BlockDefinitionBuilder( this, id, block ).features( this.defaultFeatures ); return new BlockDefinitionBuilder( this, id, block ).features( this.defaultFeatures );
} }
public IItemBuilder item( String id, Supplier<Item> item ) public IItemBuilder item( String id, Function<Item.Properties, Item> itemFactory )
{ {
return new ItemDefinitionBuilder( this, id, item ).features( this.defaultFeatures ); return new ItemDefinitionBuilder( this, id, itemFactory ).features( this.defaultFeatures );
} }
public <T extends AEBaseTile> TileEntityBuilder<T> tileEntity(String id, Class<T> teClass, Function<TileEntityType<T>, T> factory) public <T extends AEBaseTile> TileEntityBuilder<T> tileEntity(String id, Class<T> teClass, Function<TileEntityType<T>, T> factory)
@@ -19,6 +19,7 @@
package appeng.bootstrap; package appeng.bootstrap;
import java.util.function.Consumer;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
@@ -44,7 +45,9 @@ public interface IItemBuilder
IItemBuilder itemGroup( ItemGroup tab ); IItemBuilder itemGroup( ItemGroup tab );
//FIXME IItemBuilder rendering( ItemRenderingCustomizer callback ); IItemBuilder props(Consumer<Item.Properties> customizer);
IItemBuilder rendering( ItemRenderingCustomizer callback );
/** /**
* Registers a custom dispenser behavior for this item. * Registers a custom dispenser behavior for this item.
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
@@ -38,6 +39,8 @@ import appeng.core.CreativeTab;
import appeng.api.features.AEFeature; import appeng.api.features.AEFeature;
import appeng.core.features.ItemDefinition; import appeng.core.features.ItemDefinition;
import appeng.util.Platform; import appeng.util.Platform;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
class ItemDefinitionBuilder implements IItemBuilder class ItemDefinitionBuilder implements IItemBuilder
@@ -47,28 +50,29 @@ class ItemDefinitionBuilder implements IItemBuilder
private final String registryName; private final String registryName;
private final Supplier<Item> itemSupplier; private final Function<Item.Properties, Item> itemFactory;
private final EnumSet<AEFeature> features = EnumSet.noneOf( AEFeature.class ); private final EnumSet<AEFeature> features = EnumSet.noneOf( AEFeature.class );
private final List<Function<Item, IBootstrapComponent>> boostrapComponents = new ArrayList<>(); private final List<Function<Item, IBootstrapComponent>> boostrapComponents = new ArrayList<>();
private final Item.Properties props = new Item.Properties();
private Supplier<IDispenseItemBehavior> dispenserBehaviorSupplier; private Supplier<IDispenseItemBehavior> dispenserBehaviorSupplier;
// FIXME @OnlyIn( Dist.CLIENT )
// @OnlyIn( Dist.CLIENT ) private ItemRendering itemRendering;
// private ItemRendering itemRendering;
//
private ItemGroup itemGroup = CreativeTab.instance; private ItemGroup itemGroup = CreativeTab.instance;
ItemDefinitionBuilder( FeatureFactory factory, String registryName, Supplier<Item> itemSupplier ) ItemDefinitionBuilder( FeatureFactory factory, String registryName, Function<Item.Properties, Item> itemFactory )
{ {
this.factory = factory; this.factory = factory;
this.registryName = registryName; this.registryName = registryName;
this.itemSupplier = itemSupplier; this.itemFactory = itemFactory;
if( Platform.hasClientClasses() ) if( Platform.hasClientClasses() )
{ {
// FIXME this.itemRendering = new ItemRendering(); this.itemRendering = new ItemRendering();
} }
} }
@@ -101,16 +105,23 @@ class ItemDefinitionBuilder implements IItemBuilder
return this; return this;
} }
// FIXME @Override @Override
// FIXME public IItemBuilder rendering( ItemRenderingCustomizer callback ) public IItemBuilder props( Consumer<Item.Properties> consumer )
// FIXME { {
// FIXME if( Platform.hasClientClasses() ) consumer.accept(props);
// FIXME { return this;
// FIXME this.customizeForClient( callback ); }
// FIXME }
// FIXME @Override
// FIXME return this; public IItemBuilder rendering( ItemRenderingCustomizer callback )
// FIXME } {
if( Platform.hasClientClasses() )
{
this.customizeForClient( callback );
}
return this;
}
@Override @Override
public IItemBuilder dispenserBehavior( Supplier<IDispenseItemBehavior> behavior ) public IItemBuilder dispenserBehavior( Supplier<IDispenseItemBehavior> behavior )
@@ -119,16 +130,18 @@ class ItemDefinitionBuilder implements IItemBuilder
return this; return this;
} }
// FIXME @OnlyIn( Dist.CLIENT ) @OnlyIn( Dist.CLIENT )
// FIXME private void customizeForClient( ItemRenderingCustomizer callback ) private void customizeForClient( ItemRenderingCustomizer callback )
// FIXME { {
// FIXME callback.customize( this.itemRendering ); callback.customize( this.itemRendering );
// FIXME } }
@Override @Override
public ItemDefinition build() public ItemDefinition build()
{ {
Item item = this.itemSupplier.get(); props.group(itemGroup);
Item item = this.itemFactory.apply(props);
item.setRegistryName( AppEng.MOD_ID, this.registryName ); item.setRegistryName( AppEng.MOD_ID, this.registryName );
ItemDefinition definition = new ItemDefinition( this.registryName, item, features ); ItemDefinition definition = new ItemDefinition( this.registryName, item, features );
@@ -150,7 +163,7 @@ class ItemDefinitionBuilder implements IItemBuilder
if( Platform.hasClientClasses() ) if( Platform.hasClientClasses() )
{ {
// FIXME this.itemRendering.apply( this.factory, item ); this.itemRendering.apply( this.factory, item );
} }
return definition; return definition;
@@ -2,7 +2,6 @@
package appeng.client.render.crafting; package appeng.client.render.crafting;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@@ -21,8 +20,8 @@ public class ItemEncodedPatternRendering extends ItemRenderingCustomizer
@OnlyIn( Dist.CLIENT ) @OnlyIn( Dist.CLIENT )
public void customize( IItemRendering rendering ) public void customize( IItemRendering rendering )
{ {
rendering.builtInModel( "models/item/builtin/encoded_pattern", new ItemEncodedPatternModel() ); // FIXME rendering.builtInModel( "models/item/builtin/encoded_pattern", new ItemEncodedPatternModel() );
rendering.model( new ModelResourceLocation( MODEL, "inventory" ) ).variants( MODEL ); // FIXME rendering.model( new ModelResourceLocation( MODEL, "inventory" ) ).variants( MODEL );
} }
} }
+14 -16
View File
@@ -35,6 +35,7 @@ import net.minecraftforge.fml.config.ModConfig;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import java.util.*; import java.util.*;
import java.util.function.DoubleSupplier;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -68,7 +69,7 @@ public final class AEConfig implements IConfigurableObject, IConfigManagerHost
public static final String PACKET_CHANNEL = "AE"; public static final String PACKET_CHANNEL = "AE";
// Config instance // Config instance
private static AEConfig instance; private static final AEConfig instance = new AEConfig();
private final IConfigManager settings = new ConfigManager( this ); private final IConfigManager settings = new ConfigManager( this );
@@ -138,9 +139,6 @@ public final class AEConfig implements IConfigurableObject, IConfigManagerHost
@SubscribeEvent @SubscribeEvent
public static void onModConfigEvent(final ModConfig.ModConfigEvent configEvent) { public static void onModConfigEvent(final ModConfig.ModConfigEvent configEvent) {
if (configEvent.getConfig().getSpec() == CLIENT_SPEC) { if (configEvent.getConfig().getSpec() == CLIENT_SPEC) {
if (instance == null) {
instance = new AEConfig();
}
instance.syncConfig(CLIENT); instance.syncConfig(CLIENT);
} }
} }
@@ -529,34 +527,34 @@ public final class AEConfig implements IConfigurableObject, IConfigManagerHost
return this.oreDoublePercentage; return this.oreDoublePercentage;
} }
public int getWirelessTerminalBattery() public DoubleSupplier getWirelessTerminalBattery()
{ {
return this.wirelessTerminalBattery; return () -> this.wirelessTerminalBattery;
} }
public int getEntropyManipulatorBattery() public DoubleSupplier getEntropyManipulatorBattery()
{ {
return this.entropyManipulatorBattery; return () -> this.entropyManipulatorBattery;
} }
public int getMatterCannonBattery() public DoubleSupplier getMatterCannonBattery()
{ {
return this.matterCannonBattery; return () -> this.matterCannonBattery;
} }
public int getPortableCellBattery() public DoubleSupplier getPortableCellBattery()
{ {
return this.portableCellBattery; return () -> this.portableCellBattery;
} }
public int getColorApplicatorBattery() public DoubleSupplier getColorApplicatorBattery()
{ {
return this.colorApplicatorBattery; return () -> this.colorApplicatorBattery;
} }
public int getChargedStaffBattery() public DoubleSupplier getChargedStaffBattery()
{ {
return this.chargedStaffBattery; return () -> this.chargedStaffBattery;
} }
public float getSpawnChargedChance() public float getSpawnChargedChance()
+49 -71
View File
@@ -22,64 +22,67 @@ package appeng.core;
import appeng.api.IAppEngApi; import appeng.api.IAppEngApi;
import appeng.api.features.IRegistryContainer; import appeng.api.features.IRegistryContainer;
import appeng.api.networking.IGridHelper; import appeng.api.networking.IGridHelper;
import appeng.api.parts.IPartHelper;
import appeng.api.storage.IStorageHelper; import appeng.api.storage.IStorageHelper;
import appeng.api.util.IClientHelper; import appeng.api.util.IClientHelper;
import appeng.core.api.ApiClientHelper;
import appeng.core.api.ApiGrid;
import appeng.core.api.ApiPart;
import appeng.core.api.ApiStorage;
import appeng.core.features.registries.PartModels; import appeng.core.features.registries.PartModels;
import appeng.core.features.registries.RegistryContainer;
public final class Api implements IAppEngApi public final class Api implements IAppEngApi
{ {
public static final Api INSTANCE = new Api(); public static final Api INSTANCE = new Api();
// FIXME private final ApiPart partHelper; private final ApiPart partHelper;
// private MovableTileRegistry MovableRegistry = new MovableTileRegistry(); // private MovableTileRegistry MovableRegistry = new MovableTileRegistry();
// FIXME private final IRegistryContainer registryContainer; private final IRegistryContainer registryContainer;
// FIXME private final IStorageHelper storageHelper; private final IStorageHelper storageHelper;
// FIXME private final IGridHelper networkHelper; private final IGridHelper networkHelper;
private final ApiDefinitions definitions; private final ApiDefinitions definitions;
// FIXME private final IClientHelper client; private final IClientHelper client;
private Api() private Api()
{ {
// FIXME this.storageHelper = new ApiStorage(); this.storageHelper = new ApiStorage();
// FIXME this.networkHelper = new ApiGrid(); this.networkHelper = new ApiGrid();
// FIXME this.registryContainer = new RegistryContainer(); this.registryContainer = new RegistryContainer();
// FIXME this.partHelper = new ApiPart(); this.partHelper = new ApiPart();
PartModels partModels = new PartModels(); this.definitions = new ApiDefinitions( (PartModels) this.registryContainer.partModels() );
this.definitions = new ApiDefinitions( partModels /* FIXME (PartModels) this.registryContainer.partModels() */ ); this.client = new ApiClientHelper();
// FIXME this.client = new ApiClientHelper();
} }
// FIXME public PartModels getPartModels() public PartModels getPartModels()
// FIXME { {
// FIXME return (PartModels) this.registryContainer.partModels(); return (PartModels) this.registryContainer.partModels();
// FIXME } }
// FIXME
// FIXME @Override @Override
// FIXME public IRegistryContainer registries() public IRegistryContainer registries()
// FIXME { {
// FIXME return this.registryContainer; return this.registryContainer;
// FIXME } }
// FIXME
// FIXME @Override @Override
// FIXME public IStorageHelper storage() public IStorageHelper storage()
// FIXME { {
// FIXME return this.storageHelper; return this.storageHelper;
// FIXME } }
// FIXME
// FIXME @Override @Override
// FIXME public IGridHelper grid() public IGridHelper grid()
// FIXME { {
// FIXME return this.networkHelper; return this.networkHelper;
// FIXME } }
// FIXME
// FIXME @Override @Override
// FIXME public ApiPart partHelper() public ApiPart partHelper()
// FIXME { {
// FIXME return this.partHelper; return this.partHelper;
// FIXME } }
@Override @Override
public ApiDefinitions definitions() public ApiDefinitions definitions()
@@ -87,35 +90,10 @@ public final class Api implements IAppEngApi
return this.definitions; return this.definitions;
} }
// FIXME @Override @Override
// FIXME public IClientHelper client() public IClientHelper client()
// FIXME { {
// FIXME return this.client; return this.client;
// FIXME } }
// FIXME
@Override
public IRegistryContainer registries() {
return null;
}
// FIXME
@Override
public IStorageHelper storage() {
return null;
}
// FIXME
@Override
public IGridHelper grid() {
return null;
}
// FIXME
@Override
public IPartHelper partHelper() {
return null;
}
// FIXME
@Override
public IClientHelper client() {
return null;
}
} }
@@ -26,6 +26,8 @@ import appeng.api.definitions.IParts;
import appeng.bootstrap.FeatureFactory; import appeng.bootstrap.FeatureFactory;
import appeng.core.api.definitions.ApiBlocks; import appeng.core.api.definitions.ApiBlocks;
import appeng.core.api.definitions.ApiItems; import appeng.core.api.definitions.ApiItems;
import appeng.core.api.definitions.ApiMaterials;
import appeng.core.api.definitions.ApiParts;
import appeng.core.features.registries.PartModels; import appeng.core.features.registries.PartModels;
@@ -36,8 +38,8 @@ public final class ApiDefinitions implements IDefinitions
{ {
private final ApiBlocks blocks; private final ApiBlocks blocks;
private final ApiItems items; private final ApiItems items;
//private final ApiMaterials materials; private final ApiMaterials materials;
//private final ApiParts parts; private final ApiParts parts;
private final FeatureFactory registry = new FeatureFactory(); private final FeatureFactory registry = new FeatureFactory();
@@ -45,8 +47,8 @@ public final class ApiDefinitions implements IDefinitions
{ {
this.blocks = new ApiBlocks( this.registry, partModels ); this.blocks = new ApiBlocks( this.registry, partModels );
this.items = new ApiItems( this.registry ); this.items = new ApiItems( this.registry );
//this.materials = new ApiMaterials( this.registry ); this.materials = new ApiMaterials( this.registry );
//this.parts = new ApiParts( this.registry, partModels ); this.parts = new ApiParts( this.registry, partModels );
} }
public FeatureFactory getRegistry() public FeatureFactory getRegistry()
@@ -69,12 +71,12 @@ public final class ApiDefinitions implements IDefinitions
@Override @Override
public IMaterials materials() public IMaterials materials()
{ {
return null /* FIXME */; return materials;
} }
@Override @Override
public IParts parts() public IParts parts()
{ {
return null /* FIXME */; return parts;
} }
} }
@@ -11,6 +11,7 @@ import appeng.api.storage.data.IAEStack;
import appeng.api.util.IClientHelper; import appeng.api.util.IClientHelper;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
public class ApiClientHelper implements IClientHelper public class ApiClientHelper implements IClientHelper
@@ -27,10 +28,15 @@ public class ApiClientHelper implements IClientHelper
if( cellInventory != null ) 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 lines.add(new StringTextComponent(cellInventory.getStoredItemTypes() + " ")
.getLocal() ); .appendSibling(GuiText.Of.textComponent())
.appendText(" " + cellInventory.getTotalItemTypes() + " ")
.appendSibling(GuiText.Types.textComponent()));
} }
if( handler.isPreformatted() ) if( handler.isPreformatted() )
@@ -39,11 +45,15 @@ public class ApiClientHelper implements IClientHelper
if( handler.isFuzzy() ) if( handler.isFuzzy() )
{ {
lines.add( GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal() ); lines.add( GuiText.Partitioned.textComponent()
.appendText(" - " + list + " ")
.appendSibling(GuiText.Fuzzy.textComponent()));
} }
else 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.api.util.AEColoredItemDefinition;
import appeng.bootstrap.FeatureFactory; import appeng.bootstrap.FeatureFactory;
import appeng.api.features.AEFeature; 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 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 public final class ApiItems implements IItems
{ {
// FIXME: Make final after porting private final IItemDefinition certusQuartzAxe;
private IItemDefinition certusQuartzAxe; private final IItemDefinition certusQuartzHoe;
private IItemDefinition certusQuartzHoe; private final IItemDefinition certusQuartzShovel;
private IItemDefinition certusQuartzShovel; private final IItemDefinition certusQuartzPick;
private IItemDefinition certusQuartzPick; private final IItemDefinition certusQuartzSword;
private IItemDefinition certusQuartzSword; private final IItemDefinition certusQuartzWrench;
private IItemDefinition certusQuartzWrench; private final IItemDefinition certusQuartzKnife;
private IItemDefinition certusQuartzKnife;
private IItemDefinition netherQuartzAxe; private final IItemDefinition netherQuartzAxe;
private IItemDefinition netherQuartzHoe; private final IItemDefinition netherQuartzHoe;
private IItemDefinition netherQuartzShovel; private final IItemDefinition netherQuartzShovel;
private IItemDefinition netherQuartzPick; private final IItemDefinition netherQuartzPick;
private IItemDefinition netherQuartzSword; private final IItemDefinition netherQuartzSword;
private IItemDefinition netherQuartzWrench; private final IItemDefinition netherQuartzWrench;
private IItemDefinition netherQuartzKnife; private final IItemDefinition netherQuartzKnife;
private IItemDefinition entropyManipulator; private final IItemDefinition entropyManipulator;
private IItemDefinition wirelessTerminal; private final IItemDefinition wirelessTerminal;
private IItemDefinition biometricCard; private final IItemDefinition biometricCard;
private IItemDefinition chargedStaff; private final IItemDefinition chargedStaff;
private IItemDefinition massCannon; private final IItemDefinition massCannon;
private IItemDefinition memoryCard; private final IItemDefinition memoryCard;
private IItemDefinition networkTool; private final IItemDefinition networkTool;
private IItemDefinition portableCell; private final IItemDefinition portableCell;
private IItemDefinition cellCreative; private final IItemDefinition cellCreative;
private IItemDefinition viewCell; private final IItemDefinition viewCell;
private IItemDefinition cell1k; private final IItemDefinition cell1k;
private IItemDefinition cell4k; private final IItemDefinition cell4k;
private IItemDefinition cell16k; private final IItemDefinition cell16k;
private IItemDefinition cell64k; private final IItemDefinition cell64k;
private IItemDefinition fluidCell1k; private final IItemDefinition fluidCell1k;
private IItemDefinition fluidCell4k; private final IItemDefinition fluidCell4k;
private IItemDefinition fluidCell16k; private final IItemDefinition fluidCell16k;
private IItemDefinition fluidCell64k; private final IItemDefinition fluidCell64k;
private IItemDefinition spatialCell2; private final IItemDefinition spatialCell2;
private IItemDefinition spatialCell16; private final IItemDefinition spatialCell16;
private IItemDefinition spatialCell128; private final IItemDefinition spatialCell128;
private IItemDefinition facade; private final IItemDefinition facade;
private IItemDefinition crystalSeed; private final IItemDefinition crystalSeed;
// rv1 // rv1
private IItemDefinition encodedPattern; private final IItemDefinition encodedPattern;
private IItemDefinition colorApplicator; private final IItemDefinition colorApplicator;
private IItemDefinition paintBall; private final IItemDefinition paintBall;
private AEColoredItemDefinition coloredPaintBall; private final AEColoredItemDefinition coloredPaintBall;
private AEColoredItemDefinition coloredLumenPaintBall; private final AEColoredItemDefinition coloredLumenPaintBall;
// unsupported dev tools // unsupported dev tools
private IItemDefinition toolEraser; private final IItemDefinition toolEraser;
private IItemDefinition toolMeteoritePlacer; private final IItemDefinition toolMeteoritePlacer;
private IItemDefinition toolDebugCard; private final IItemDefinition toolDebugCard;
private IItemDefinition toolReplicatorCard; private final IItemDefinition toolReplicatorCard;
private IItemDefinition dummyFluidItem; private final IItemDefinition dummyFluidItem;
public ApiItems( FeatureFactory registry ) public ApiItems( FeatureFactory registry )
{ {
FeatureFactory certusTools = registry.features( AEFeature.CERTUS_QUARTZ_TOOLS ); 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 ) .addFeatures( AEFeature.QUARTZ_AXE )
.build(); .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 ) .addFeatures( AEFeature.QUARTZ_HOE )
.build(); .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 ) .addFeatures( AEFeature.QUARTZ_SPADE )
.build(); .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 ) .addFeatures( AEFeature.QUARTZ_PICKAXE )
.build(); .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 ) .addFeatures( AEFeature.QUARTZ_SWORD )
.build(); .build();
this.certusQuartzWrench = certusTools.item( "certus_quartz_wrench", ToolQuartzWrench::new ) this.certusQuartzWrench = certusTools.item( "certus_quartz_wrench", ToolQuartzWrench::new )
.itemGroup(ItemGroup.TOOLS)
.props(props -> props.maxStackSize( 1 ) )
.addFeatures( AEFeature.QUARTZ_WRENCH ) .addFeatures( AEFeature.QUARTZ_WRENCH )
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzWrench", new ItemStack( item ) ) ) // FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzWrench", new ItemStack( item ) ) )
.build(); .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 ) .addFeatures( AEFeature.QUARTZ_KNIFE )
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzKnife", new ItemStack( item ) ) ) // FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzKnife", new ItemStack( item ) ) )
.build(); .build();
FeatureFactory netherTools = registry.features( AEFeature.NETHER_QUARTZ_TOOLS ); 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 ) .addFeatures( AEFeature.QUARTZ_AXE )
.build(); .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 ) .addFeatures( AEFeature.QUARTZ_HOE )
.build(); .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 ) .addFeatures( AEFeature.QUARTZ_SPADE )
.build(); .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 ) .addFeatures( AEFeature.QUARTZ_PICKAXE )
.build(); .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 ) .addFeatures( AEFeature.QUARTZ_SWORD )
.build(); .build();
this.netherQuartzWrench = netherTools.item( "nether_quartz_wrench", ToolQuartzWrench::new ) this.netherQuartzWrench = netherTools.item( "nether_quartz_wrench", ToolQuartzWrench::new )
.itemGroup(ItemGroup.TOOLS)
.props(props -> props.maxStackSize( 1 ) )
.addFeatures( AEFeature.QUARTZ_WRENCH ) .addFeatures( AEFeature.QUARTZ_WRENCH )
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzWrench", new ItemStack( item ) ) ) // FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzWrench", new ItemStack( item ) ) )
.build(); .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 ) .addFeatures( AEFeature.QUARTZ_KNIFE )
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzKnife", new ItemStack( item ) ) ) // FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzKnife", new ItemStack( item ) ) )
.build(); .build();
// FeatureFactory powerTools = registry.features( AEFeature.POWERED_TOOLS ); Consumer<Item.Properties> chargedDefaults = props -> props.maxStackSize( 1 ).maxDamage( 32 ).setNoRepair();
// this.entropyManipulator = powerTools.item( "entropy_manipulator", ToolEntropyManipulator::new )
// .addFeatures( AEFeature.ENTROPY_MANIPULATOR ) FeatureFactory powerTools = registry.features( AEFeature.POWERED_TOOLS );
// .dispenserBehavior( DispenserBlockTool::new ) this.entropyManipulator = powerTools.item( "entropy_manipulator", ToolEntropyManipulator::new )
// .build(); .props(chargedDefaults)
// this.wirelessTerminal = powerTools.item( "wireless_terminal", ToolWirelessTerminal::new ).addFeatures( AEFeature.WIRELESS_ACCESS_TERMINAL ).build(); .addFeatures( AEFeature.ENTROPY_MANIPULATOR )
// this.chargedStaff = powerTools.item( "charged_staff", ToolChargedStaff::new ).addFeatures( AEFeature.CHARGED_STAFF ).build(); .dispenserBehavior( DispenserBlockTool::new )
// this.massCannon = powerTools.item( "matter_cannon", ToolMatterCannon::new ) .build();
// .addFeatures( AEFeature.MATTER_CANNON ) this.wirelessTerminal = powerTools.item( "wireless_terminal", ToolWirelessTerminal::new )
// .dispenserBehavior( DispenserMatterCannon::new ) .props(chargedDefaults)
// .build(); .addFeatures( AEFeature.WIRELESS_ACCESS_TERMINAL )
// this.portableCell = powerTools.item( "portable_cell", ToolPortableCell::new ).addFeatures( AEFeature.PORTABLE_CELL, AEFeature.STORAGE_CELLS ).build(); .build();
// this.colorApplicator = powerTools.item( "color_applicator", ToolColorApplicator::new ) this.chargedStaff = powerTools.item( "charged_staff", ToolChargedStaff::new )
// .addFeatures( AEFeature.COLOR_APPLICATOR ) .props(chargedDefaults)
// .dispenserBehavior( DispenserBlockTool::new ) .addFeatures( AEFeature.CHARGED_STAFF )
// .rendering( new ToolColorApplicatorRendering() ) .build();
// .build(); this.massCannon = powerTools.item( "matter_cannon", ToolMatterCannon::new )
// .props(chargedDefaults)
// this.biometricCard = registry.item( "biometric_card", ToolBiometricCard::new ) .addFeatures( AEFeature.MATTER_CANNON )
// .rendering( new ToolBiometricCardRendering() ) .dispenserBehavior( DispenserMatterCannon::new )
// .features( AEFeature.SECURITY ) .build();
// .build(); this.portableCell = powerTools.item( "portable_cell", ToolPortableCell::new )
// this.memoryCard = registry.item( "memory_card", ToolMemoryCard::new ) .props(chargedDefaults)
// .rendering( new ToolMemoryCardRendering() ) .addFeatures( AEFeature.PORTABLE_CELL, AEFeature.STORAGE_CELLS )
// .features( AEFeature.MEMORY_CARD ) .build();
// .build(); this.colorApplicator = powerTools.item( "color_applicator", ToolColorApplicator::new )
// this.networkTool = registry.item( "network_tool", ToolNetworkTool::new ).features( AEFeature.NETWORK_TOOL ).build(); .props(chargedDefaults)
// .addFeatures( AEFeature.COLOR_APPLICATOR )
// this.cellCreative = registry.item( "creative_storage_cell", ItemCreativeStorageCell::new ) .dispenserBehavior( DispenserBlockTool::new )
// .features( AEFeature.STORAGE_CELLS, AEFeature.CREATIVE ) .rendering( new ToolColorApplicatorRendering() )
// .build(); .build();
// this.viewCell = registry.item( "view_cell", ItemViewCell::new ).features( AEFeature.VIEW_CELL ).build();
// this.biometricCard = registry.item( "biometric_card", ToolBiometricCard::new )
// FeatureFactory storageCells = registry.features( AEFeature.STORAGE_CELLS ); .props(props -> props.maxStackSize( 1 ))
// this.cell1k = storageCells.item( "storage_cell_1k", () -> new BasicItemStorageCell( MaterialType.CELL1K_PART, 1 ) ).build(); .rendering( new ToolBiometricCardRendering() )
// this.cell4k = storageCells.item( "storage_cell_4k", () -> new BasicItemStorageCell( MaterialType.CELL4K_PART, 4 ) ).build(); .features( AEFeature.SECURITY )
// this.cell16k = storageCells.item( "storage_cell_16k", () -> new BasicItemStorageCell( MaterialType.CELL16K_PART, 16 ) ).build(); .build();
// this.cell64k = storageCells.item( "storage_cell_64k", () -> new BasicItemStorageCell( MaterialType.CELL64K_PART, 64 ) ).build(); this.memoryCard = registry.item( "memory_card", ToolMemoryCard::new )
// .props(props -> props.maxStackSize( 1 ))
// this.fluidCell1k = storageCells.item( "fluid_storage_cell_1k", () -> new BasicFluidStorageCell( MaterialType.FLUID_CELL1K_PART, 1 ) ).build(); .rendering( new ToolMemoryCardRendering() )
// this.fluidCell4k = storageCells.item( "fluid_storage_cell_4k", () -> new BasicFluidStorageCell( MaterialType.FLUID_CELL4K_PART, 4 ) ).build(); .features( AEFeature.MEMORY_CARD )
// this.fluidCell16k = storageCells.item( "fluid_storage_cell_16k", () -> new BasicFluidStorageCell( MaterialType.FLUID_CELL16K_PART, 16 ) ).build(); .build();
// this.fluidCell64k = storageCells.item( "fluid_storage_cell_64k", () -> new BasicFluidStorageCell( MaterialType.FLUID_CELL64K_PART, 64 ) ).build(); this.networkTool = registry.item( "network_tool", ToolNetworkTool::new )
// .props(props -> props.maxStackSize( 1 ).addToolType( ToolType.get("wrench"), 0 ) )
// FeatureFactory spatialCells = registry.features( AEFeature.SPATIAL_IO ); .features( AEFeature.NETWORK_TOOL )
// this.spatialCell2 = spatialCells.item( "spatial_storage_cell_2_cubed", () -> new ItemSpatialStorageCell( 2 ) ).build(); .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.cellCreative = registry.item( "creative_storage_cell", ItemCreativeStorageCell::new )
// .props(props -> props.maxStackSize(1))
// this.facade = registry.item( "facade", ItemFacade::new ) .features( AEFeature.STORAGE_CELLS, AEFeature.CREATIVE )
// .features( AEFeature.FACADES ) .build();
// .creativeTab( CreativeTabFacade.instance ) this.viewCell = registry.item( "view_cell", ItemViewCell::new )
// .rendering( new FacadeRendering() ) .props(props -> props.maxStackSize(1))
// .build(); .features( AEFeature.VIEW_CELL )
// this.crystalSeed = registry.item( "crystal_seed", ItemCrystalSeed::new ) .build();
// .features( AEFeature.CRYSTAL_SEEDS )
// .rendering( new ItemCrystalSeedRendering() ) FeatureFactory storageCells = registry.features( AEFeature.STORAGE_CELLS );
// .bootstrap( item -> (IEntityRegistrationComponent) r -> 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();
// r.register( EntityEntryBuilder.create() this.cell16k = storageCells.item( "storage_cell_16k", props -> new BasicItemStorageCell(props, MaterialType.CELL16K_PART, 16 ) ).build();
// .entity( EntityGrowingCrystal.class ) this.cell64k = storageCells.item( "storage_cell_64k", props -> new BasicItemStorageCell(props, MaterialType.CELL64K_PART, 64 ) ).build();
// .id( new ResourceLocation( "appliedenergistics2", EntityGrowingCrystal.class.getName() ),
// EntityIds.get( EntityGrowingCrystal.class ) ) this.fluidCell1k = storageCells.item( "fluid_storage_cell_1k", props -> new BasicFluidStorageCell(props, MaterialType.FLUID_CELL1K_PART, 1 ) ).build();
// .name( EntityGrowingCrystal.class.getSimpleName() ) this.fluidCell4k = storageCells.item( "fluid_storage_cell_4k", props -> new BasicFluidStorageCell(props, MaterialType.FLUID_CELL4K_PART, 4 ) ).build();
// .tracker( 16, 4, true ) this.fluidCell16k = storageCells.item( "fluid_storage_cell_16k", props -> new BasicFluidStorageCell(props, MaterialType.FLUID_CELL16K_PART, 16 ) ).build();
// .build() ); this.fluidCell64k = storageCells.item( "fluid_storage_cell_64k", props -> new BasicFluidStorageCell(props, MaterialType.FLUID_CELL64K_PART, 64 ) ).build();
// } )
// .build(); FeatureFactory spatialCells = registry.features( AEFeature.SPATIAL_IO );
// this.spatialCell2 = spatialCells.item( "spatial_storage_cell_2_cubed", props -> new ItemSpatialStorageCell(props, 2 ) ).build();
// // rv1 this.spatialCell16 = spatialCells.item( "spatial_storage_cell_16_cubed", props -> new ItemSpatialStorageCell(props, 16 ) ).build();
// this.encodedPattern = registry.item( "encoded_pattern", ItemEncodedPattern::new ) this.spatialCell128 = spatialCells.item( "spatial_storage_cell_128_cubed", props -> new ItemSpatialStorageCell(props, 128 ) ).build();
// .features( AEFeature.PATTERNS )
// .rendering( new ItemEncodedPatternRendering() ) this.facade = registry.item( "facade", ItemFacade::new )
// .build(); .features( AEFeature.FACADES )
// .itemGroup( CreativeTabFacade.instance )
// this.paintBall = registry.item( "paint_ball", ItemPaintBall::new ) .rendering( new FacadeRendering() )
// .features( AEFeature.PAINT_BALLS ) .build();
// .rendering( new ItemPaintBallRendering() ) this.crystalSeed = registry.item( "crystal_seed", ItemCrystalSeed::new )
// .build(); .features( AEFeature.CRYSTAL_SEEDS )
// this.coloredPaintBall = registry.colored( this.paintBall, 0 ); .rendering( new ItemCrystalSeedRendering() )
// this.coloredLumenPaintBall = registry.colored( this.paintBall, 20 ); .bootstrap( item -> (IEntityRegistrationComponent) r ->
// {
// FeatureFactory debugTools = registry.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE ); r.register( EntityType.Builder.<EntityGrowingCrystal>create(EntityGrowingCrystal::new, EntityClassification.MISC)
// this.toolEraser = debugTools.item( "debug_eraser", ToolEraser::new ).build(); .setTrackingRange(16)
// this.toolMeteoritePlacer = debugTools.item( "debug_meteorite_placer", ToolMeteoritePlacer::new ).build(); .setUpdateInterval(4)
// this.toolDebugCard = debugTools.item( "debug_card", ToolDebugCard::new ).build(); .setShouldReceiveVelocityUpdates(true)
// this.toolReplicatorCard = debugTools.item( "debug_replicator_card", ToolReplicatorCard::new ).build(); .build("appliedenergistics2:growing_crystal")
// .setRegistryName("appliedenergistics2:growing_crystal")
// this.dummyFluidItem = registry.item( "dummy_fluid_item", FluidDummyItem::new ).rendering( new FluidDummyItemRendering() ).build(); );
} )
.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 @Override
@@ -22,8 +22,8 @@ package appeng.core.api.definitions;
import java.util.Arrays; import java.util.Arrays;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import net.minecraft.util.ResourceLocation; import net.minecraft.entity.EntityClassification;
import net.minecraftforge.fml.common.registry.EntityEntryBuilder; import net.minecraft.entity.EntityType;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@@ -35,7 +35,6 @@ import appeng.bootstrap.ItemRenderingCustomizer;
import appeng.bootstrap.components.IEntityRegistrationComponent; import appeng.bootstrap.components.IEntityRegistrationComponent;
import appeng.core.features.DamagedItemDefinition; import appeng.core.features.DamagedItemDefinition;
import appeng.entity.EntityChargedQuartz; import appeng.entity.EntityChargedQuartz;
import appeng.entity.EntityIds;
import appeng.entity.EntitySingularity; import appeng.entity.EntitySingularity;
import appeng.items.materials.ItemMaterial; import appeng.items.materials.ItemMaterial;
import appeng.items.materials.MaterialType; import appeng.items.materials.MaterialType;
@@ -124,15 +123,14 @@ public final class ApiMaterials implements IMaterials
public ApiMaterials( FeatureFactory registry ) public ApiMaterials( FeatureFactory registry )
{ {
final ItemMaterial materials = new ItemMaterial(); IItemDefinition materialDef = registry.item( "material", ItemMaterial::new )
registry.item( "material", () -> materials )
.rendering( new ItemRenderingCustomizer() .rendering( new ItemRenderingCustomizer()
{ {
@Override @Override
@OnlyIn( Dist.CLIENT ) @OnlyIn( Dist.CLIENT )
public void customize( IItemRendering rendering ) 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 // Register a resource location for every material type
rendering.variants( Arrays.stream( MaterialType.values() ) rendering.variants( Arrays.stream( MaterialType.values() )
.map( MaterialType::getModel ) .map( MaterialType::getModel )
@@ -141,21 +139,23 @@ public final class ApiMaterials implements IMaterials
} ) } )
.bootstrap( item -> (IEntityRegistrationComponent) r -> .bootstrap( item -> (IEntityRegistrationComponent) r ->
{ {
r.register( EntityEntryBuilder.create() r.register( EntityType.Builder.<EntitySingularity>create(EntitySingularity::new, EntityClassification.MISC)
.entity( EntitySingularity.class ) .setTrackingRange(16)
.id( new ResourceLocation( "appliedenergistics2", EntitySingularity.class.getName() ), EntityIds.get( EntitySingularity.class ) ) .setUpdateInterval(4)
.name( EntitySingularity.class.getSimpleName() ) .setShouldReceiveVelocityUpdates(true)
.tracker( 16, 4, true ) .build("appliedenergistics2:singularity")
.build() ); .setRegistryName("appliedenergistics2:singularity")
r.register( EntityEntryBuilder.create() );
.entity( EntityChargedQuartz.class ) r.register( EntityType.Builder.<EntityChargedQuartz>create(EntityChargedQuartz::new, EntityClassification.MISC)
.id( new ResourceLocation( "appliedenergistics2", EntityChargedQuartz.class.getName() ), .setTrackingRange(16)
EntityIds.get( EntityChargedQuartz.class ) ) .setUpdateInterval(4)
.name( EntityChargedQuartz.class.getSimpleName() ) .setShouldReceiveVelocityUpdates(true)
.tracker( 16, 4, true ) .build("appliedenergistics2:charged_quartz")
.build() ); .setRegistryName("appliedenergistics2:charged_quartz")
);
} ) } )
.build(); .build();
final ItemMaterial materials = (ItemMaterial) materialDef.item();
this.cell2SpatialPart = new DamagedItemDefinition( "material.cell.spatial.2", materials.createMaterial( MaterialType.CELL2_SPATIAL_PART ) ); 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 ) ); 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 ) public ApiParts( FeatureFactory registry, PartModels partModels )
{ {
final ItemPart itemPart = new ItemPart(); IItemDefinition itemPartDef = registry.item( "part", ItemPart::new )
registry.item( "part", () -> itemPart ) .rendering( new ItemPartRendering( partModels ) )
.rendering( new ItemPartRendering( partModels, itemPart ) )
.build(); .build();
final ItemPart itemPart = (ItemPart) itemPartDef.item();
// Register all part models // Register all part models
for( PartType partType : PartType.values() ) 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.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.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.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.p2PTunnelItems = null; // FIXME 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.p2PTunnelFluids = null; // FIXME 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.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.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.p2PTunnelLight = new DamagedItemDefinition( "part.tunnel.light", itemPart.createPart( PartType.P2P_TUNNEL_LIGHT ) );
// this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart( // this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart(
@@ -32,9 +32,9 @@ import net.minecraft.world.World;
public abstract class AEBaseEntityItem extends ItemEntity public abstract class AEBaseEntityItem extends ItemEntity
{ {
public AEBaseEntityItem( final World world ) public AEBaseEntityItem( EntityType<? extends AEBaseEntityItem> entityType, final World world )
{ {
super( EntityType.ITEM, world ); super( entityType, world );
} }
public AEBaseEntityItem( final World world, final double x, final double y, final double z, final ItemStack stack ) public AEBaseEntityItem( final World world, final double x, final double y, final double z, final ItemStack stack )
@@ -24,6 +24,7 @@ import java.util.List;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
@@ -47,7 +48,11 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
private int delay = 0; private int delay = 0;
private int transformTime = 0; private int transformTime = 0;
public EntityChargedQuartz( final World w, final double x, final double y, final double z, final ItemStack is ) public EntityChargedQuartz(EntityType<? extends EntityChargedQuartz> entityType, World world) {
super(entityType, world);
}
public EntityChargedQuartz(final World w, final double x, final double y, final double z, final ItemStack is )
{ {
super( w, x, y, z, is ); super( w, x, y, z, is );
} }
@@ -21,6 +21,7 @@ package appeng.entity;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -43,7 +44,11 @@ public final class EntityGrowingCrystal extends ItemEntity
private int progress_1000 = 0; private int progress_1000 = 0;
public EntityGrowingCrystal( final World w, final double x, final double y, final double z, final ItemStack is ) public EntityGrowingCrystal(EntityType<? extends EntityGrowingCrystal> type, World world) {
super(type, world);
}
public EntityGrowingCrystal(final World w, final double x, final double y, final double z, final ItemStack is )
{ {
super( w, x, y, z, is ); super( w, x, y, z, is );
this.setNoDespawn(); this.setNoDespawn();
@@ -1,57 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.entity;
import net.minecraft.entity.Entity;
public final class EntityIds
{
private static final int TINY_TNT = 10;
private static final int SINGULARITY = 11;
private static final int CHARGED_QUARTZ = 12;
private static final int GROWING_CRYSTAL = 13;
private EntityIds()
{
}
public static int get( final Class<? extends Entity> droppedEntity )
{
if( droppedEntity == EntityTinyTNTPrimed.class )
{
return TINY_TNT;
}
if( droppedEntity == EntitySingularity.class )
{
return SINGULARITY;
}
if( droppedEntity == EntityChargedQuartz.class )
{
return CHARGED_QUARTZ;
}
if( droppedEntity == EntityGrowingCrystal.class )
{
return GROWING_CRYSTAL;
}
throw new IllegalStateException( "Missing entity id: " + droppedEntity.getName() );
}
}
@@ -23,6 +23,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
@@ -43,10 +44,9 @@ public final class EntitySingularity extends AEBaseEntityItem
private static int randTickSeed = 0; private static int randTickSeed = 0;
@Reflected public EntitySingularity(EntityType<? extends EntitySingularity> entityType, final World w )
public EntitySingularity( final World w )
{ {
super( w ); super( entityType, w );
} }
public EntitySingularity( final World w, final double x, final double y, final double z, final ItemStack is ) public EntitySingularity( final World w, final double x, final double y, final double z, final ItemStack is )
@@ -56,9 +56,8 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
// rather simple client side caching. // rather simple client side caching.
private static final Map<ItemStack, ItemStack> SIMPLE_CACHE = new WeakHashMap<>(); private static final Map<ItemStack, ItemStack> SIMPLE_CACHE = new WeakHashMap<>();
public ItemEncodedPattern() public ItemEncodedPattern(Properties properties) {
{ super(properties);
super(new Item.Properties().maxStackSize(1));
} }
@Override @Override
@@ -45,12 +45,9 @@ public class ItemPartRendering extends ItemRenderingCustomizer
private final PartModels partModels; private final PartModels partModels;
private final ItemPart item; public ItemPartRendering( PartModels partModels )
public ItemPartRendering( PartModels partModels, ItemPart item )
{ {
this.partModels = partModels; this.partModels = partModels;
this.item = item;
} }
@Override @Override
@@ -137,10 +134,10 @@ public class ItemPartRendering extends ItemRenderingCustomizer
this.partModels.registerModels( partResourceLocs ); this.partModels.registerModels( partResourceLocs );
} }
private ModelResourceLocation getItemMeshDefinition( ItemStack is ) // FIXME private ModelResourceLocation getItemMeshDefinition( ItemStack is )
{ // FIXME {
PartType partType = this.item.getTypeByStack( is ); // FIXME PartType partType = this.item.getTypeByStack( is );
int variant = this.item.variantOf( is.getDamage() ); // FIXME int variant = this.item.variantOf( is.getDamage() );
return partType.getItemModels().get( variant ); // FIXME return partType.getItemModels().get( variant );
} // FIXME }
} }
@@ -46,7 +46,6 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc
public ItemCreativeStorageCell(Properties props) public ItemCreativeStorageCell(Properties props)
{ {
super(props); super(props);
// FIXME this.setMaxStackSize( 1 );
} }
@Override @Override
@@ -44,12 +44,11 @@ import appeng.util.prioritylist.PrecisePriorityList;
public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
{ {
public ItemViewCell() public ItemViewCell(Properties properties) {
{ super(properties);
super(new Item.Properties().maxStackSize(1));
} }
public static IPartitionList<IAEItemStack> createFilter( final ItemStack[] list ) public static IPartitionList<IAEItemStack> createFilter(final ItemStack[] list )
{ {
IPartitionList<IAEItemStack> myPartitionList = null; IPartitionList<IAEItemStack> myPartitionList = null;
@@ -49,9 +49,8 @@ import appeng.util.Platform;
public class ToolBiometricCard extends AEBaseItem implements IBiometricCard public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
{ {
public ToolBiometricCard() public ToolBiometricCard(Properties properties) {
{ super(properties);
super( new Properties().maxStackSize( 1 ) );
} }
@Override @Override
@@ -62,9 +62,8 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
AEColor.TRANSPARENT, AEColor.TRANSPARENT,
}; };
public ToolMemoryCard() public ToolMemoryCard(Properties properties) {
{ super(properties);
super( new Properties().maxStackSize( 1 ) );
} }
@Override @Override
@@ -58,9 +58,8 @@ import appeng.util.Platform;
public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench
{ {
public ToolNetworkTool() public ToolNetworkTool(Properties properties) {
{ super(properties);
super(new Item.Properties().maxStackSize( 1 ).addToolType( ToolType.get("wrench"), 0 ));
} }
@Override @Override
@@ -20,6 +20,7 @@ package appeng.items.tools.powered;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
@@ -35,9 +36,9 @@ import appeng.util.Platform;
public class ToolChargedStaff extends AEBasePoweredItem public class ToolChargedStaff extends AEBasePoweredItem
{ {
public ToolChargedStaff() public ToolChargedStaff(Item.Properties props)
{ {
super( AEConfig.instance().getChargedStaffBattery() ); super( AEConfig.instance().getChargedStaffBattery(), props );
} }
@Override @Override
@@ -51,6 +51,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.SnowballItem; import net.minecraft.item.SnowballItem;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
@@ -87,9 +88,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
} }
} }
public ToolColorApplicator() public ToolColorApplicator(Item.Properties props)
{ {
super( AEConfig.instance().getColorApplicatorBattery() ); super( AEConfig.instance().getColorApplicatorBattery(), props );
} }
@Override @Override
@@ -31,6 +31,7 @@ import net.minecraft.block.TNTBlock;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
@@ -60,9 +61,9 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
private final Map<InWorldToolOperationIngredient, InWorldToolOperationResult> heatUp; private final Map<InWorldToolOperationIngredient, InWorldToolOperationResult> heatUp;
private final Map<InWorldToolOperationIngredient, InWorldToolOperationResult> coolDown; private final Map<InWorldToolOperationIngredient, InWorldToolOperationResult> coolDown;
public ToolEntropyManipulator() public ToolEntropyManipulator(Item.Properties props)
{ {
super( AEConfig.instance().getEntropyManipulatorBattery() ); super( AEConfig.instance().getEntropyManipulatorBattery(), props );
this.heatUp = new HashMap<>(); this.heatUp = new HashMap<>();
this.coolDown = new HashMap<>(); this.coolDown = new HashMap<>();
@@ -29,6 +29,7 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.passive.SheepEntity; import net.minecraft.entity.passive.SheepEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*; import net.minecraft.util.*;
@@ -73,9 +74,9 @@ import appeng.util.Platform;
public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<IAEItemStack> public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<IAEItemStack>
{ {
public ToolMatterCannon() public ToolMatterCannon(Item.Properties props)
{ {
super( AEConfig.instance().getMatterCannonBattery() ); super( AEConfig.instance().getMatterCannonBattery(), props );
} }
@OnlyIn( Dist.CLIENT ) @OnlyIn( Dist.CLIENT )
@@ -24,6 +24,7 @@ import java.util.Set;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
@@ -60,9 +61,9 @@ import appeng.util.Platform;
public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell<IAEItemStack>, IGuiItem, IItemGroup public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell<IAEItemStack>, IGuiItem, IItemGroup
{ {
public ToolPortableCell() public ToolPortableCell(Item.Properties props)
{ {
super( AEConfig.instance().getPortableCellBattery() ); super( AEConfig.instance().getPortableCellBattery(), props );
} }
@Override @Override
@@ -24,6 +24,7 @@ import java.util.List;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
@@ -52,9 +53,9 @@ import appeng.util.ConfigManager;
public class ToolWirelessTerminal extends AEBasePoweredItem implements IWirelessTermHandler public class ToolWirelessTerminal extends AEBasePoweredItem implements IWirelessTermHandler
{ {
public ToolWirelessTerminal() public ToolWirelessTerminal(Item.Properties props)
{ {
super( AEConfig.instance().getWirelessTerminalBattery() ); super( AEConfig.instance().getWirelessTerminalBattery(), props );
} }
@Override @Override
@@ -21,6 +21,7 @@ package appeng.items.tools.powered.powersink;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.List; import java.util.List;
import java.util.function.DoubleSupplier;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
@@ -47,14 +48,12 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
{ {
private static final String CURRENT_POWER_NBT_KEY = "internalCurrentPower"; private static final String CURRENT_POWER_NBT_KEY = "internalCurrentPower";
private static final String MAX_POWER_NBT_KEY = "internalMaxPower"; private static final String MAX_POWER_NBT_KEY = "internalMaxPower";
private final double powerCapacity; private final DoubleSupplier powerCapacity;
public AEBasePoweredItem( final double powerCapacity ) public AEBasePoweredItem(final DoubleSupplier powerCapacity, Properties props )
{ {
super(new Properties().maxStackSize( 1 ).maxDamage( 32 ).setNoRepair()); super(props);
//FIXME // FIXME this.setFull3D();
// this.hasSubtypes = false;
// this.setFull3D();
this.powerCapacity = powerCapacity; this.powerCapacity = powerCapacity;
} }
@@ -153,7 +152,7 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
@Override @Override
public double getAEMaxPower( final ItemStack is ) public double getAEMaxPower( final ItemStack is )
{ {
return this.powerCapacity; return this.powerCapacity.getAsDouble();
} }
@Override @Override
@@ -33,9 +33,9 @@ public class ToolQuartzAxe extends AxeItem
{ {
private final AEFeature type; private final AEFeature type;
public ToolQuartzAxe( final AEFeature type ) public ToolQuartzAxe( Item.Properties props, final AEFeature type )
{ {
super( ItemTier.IRON, 6.0F, -3.1F, ( new Item.Properties() ).group( ItemGroup.TOOLS ) ); super( ItemTier.IRON, 6.0F, -3.1F, props );
this.type = type; this.type = type;
} }
@@ -42,13 +42,9 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
{ {
private final AEFeature type; private final AEFeature type;
public ToolQuartzCuttingKnife( final AEFeature type ) public ToolQuartzCuttingKnife( Item.Properties props, final AEFeature type )
{ {
super(new Item.Properties() super(props);
.group(ItemGroup.TOOLS)
.maxStackSize(1)
.maxDamage(50)
.setNoRepair());
this.type = type; this.type = type;
} }
@@ -33,9 +33,9 @@ public class ToolQuartzHoe extends HoeItem
{ {
private final AEFeature type; private final AEFeature type;
public ToolQuartzHoe( final AEFeature type ) public ToolQuartzHoe( Item.Properties props, final AEFeature type )
{ {
super( ItemTier.IRON, -1.0F, ( new Item.Properties() ).group( ItemGroup.TOOLS ) ); super( ItemTier.IRON, -1.0F, props);
this.type = type; this.type = type;
} }
@@ -33,9 +33,9 @@ public class ToolQuartzPickaxe extends PickaxeItem
{ {
private final AEFeature type; private final AEFeature type;
public ToolQuartzPickaxe( final AEFeature type ) public ToolQuartzPickaxe( Item.Properties props, final AEFeature type )
{ {
super( ItemTier.IRON, 1, -2.8F, ( new Item.Properties() ).group( ItemGroup.TOOLS ) ); super( ItemTier.IRON, 1, -2.8F, props );
this.type = type; this.type = type;
} }
@@ -33,9 +33,9 @@ public class ToolQuartzSpade extends ShovelItem
{ {
private final AEFeature type; private final AEFeature type;
public ToolQuartzSpade( final AEFeature type ) public ToolQuartzSpade( Item.Properties props, final AEFeature type )
{ {
super( ItemTier.IRON, 1.5F, -3.0F, ( new Item.Properties() ).group( ItemGroup.TOOLS ) ); super( ItemTier.IRON, 1.5F, -3.0F, props );
this.type = type; this.type = type;
} }
@@ -33,9 +33,9 @@ public class ToolQuartzSword extends SwordItem
{ {
private final AEFeature type; private final AEFeature type;
public ToolQuartzSword( AEFeature type ) public ToolQuartzSword( Item.Properties props, AEFeature type )
{ {
super( ItemTier.IRON, 3, -2.4F, ( new Item.Properties() ).group( ItemGroup.COMBAT ) ); super( ItemTier.IRON, 3, -2.4F, props );
this.type = type; this.type = type;
} }
@@ -22,6 +22,7 @@ package appeng.items.tools.quartz;
import appeng.core.CreativeTab; import appeng.core.CreativeTab;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext; import net.minecraft.item.ItemUseContext;
@@ -38,11 +39,9 @@ import appeng.util.Platform;
public class ToolQuartzWrench extends AEBaseItem implements IAEWrench public class ToolQuartzWrench extends AEBaseItem implements IAEWrench
{ {
public ToolQuartzWrench() public ToolQuartzWrench(Item.Properties props)
{ {
super( new Properties() super( props );
.group(ItemGroup.TOOLS)
.maxStackSize( 1 ) );
} }
@Override @Override