Applied-Energistics-2-tiler.../src/main/java/appeng/items/materials/MaterialType.java
thatsIch 37ae2131fe Closes #1899, Fixed #1898: Adds an easy way to export interesting information into CSV format
Mostly used for the recipe system, but can also be used for debugging purposes. Debug options needs to be ticked to use the full information gain. Recipes only require the normal localization and the specific name plus metadata.

Shifted the recipes into a recipes folder where the CSV will also reside. This will also elevate the copying of the readme to the user directory since it can reside in the recipes folder.

Fixed a bug where the copier would copy the would also copy empty folders
2015-09-26 23:15:25 +02:00

205 lines
5.5 KiB
Java

/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2015, 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.items.materials;
import java.util.EnumSet;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import appeng.core.AppEng;
import appeng.core.features.AEFeature;
import appeng.core.features.MaterialStackSrc;
import appeng.entity.EntityChargedQuartz;
import appeng.entity.EntityIds;
import appeng.entity.EntitySingularity;
public enum MaterialType
{
InvalidType( -1, AEFeature.Core ),
CertusQuartzCrystal( 0, AEFeature.Core, "crystalCertusQuartz" ),
CertusQuartzCrystalCharged( 1, AEFeature.Core, EntityChargedQuartz.class ),
CertusQuartzDust( 2, AEFeature.Core, "dustCertusQuartz" ),
NetherQuartzDust( 3, AEFeature.Core, "dustNetherQuartz" ),
Flour( 4, AEFeature.Flour, "dustWheat" ),
GoldDust( 51, AEFeature.Core, "dustGold" ),
IronDust( 49, AEFeature.Core, "dustIron" ),
IronNugget( 50, AEFeature.Core, "nuggetIron" ),
Silicon( 5, AEFeature.Core, "itemSilicon" ),
MatterBall( 6 ),
FluixCrystal( 7, AEFeature.Core, "crystalFluix" ),
FluixDust( 8, AEFeature.Core, "dustFluix" ),
FluixPearl( 9, AEFeature.Core, "pearlFluix" ),
PurifiedCertusQuartzCrystal( 10 ),
PurifiedNetherQuartzCrystal( 11 ),
PurifiedFluixCrystal( 12 ),
CalcProcessorPress( 13 ),
EngProcessorPress( 14 ),
LogicProcessorPress( 15 ),
CalcProcessorPrint( 16 ),
EngProcessorPrint( 17 ),
LogicProcessorPrint( 18 ),
SiliconPress( 19 ),
SiliconPrint( 20 ),
NamePress( 21 ),
LogicProcessor( 22 ),
CalcProcessor( 23 ),
EngProcessor( 24 ),
// Basic Cards
BasicCard( 25 ),
CardRedstone( 26 ),
CardCapacity( 27 ),
// Adv Cards
AdvCard( 28 ),
CardFuzzy( 29 ), CardSpeed( 30 ),
CardInverter( 31 ),
Cell2SpatialPart( 32, AEFeature.SpatialIO ),
Cell16SpatialPart( 33, AEFeature.SpatialIO ),
Cell128SpatialPart( 34, AEFeature.SpatialIO ),
Cell1kPart( 35, AEFeature.StorageCells ),
Cell4kPart( 36, AEFeature.StorageCells ),
Cell16kPart( 37, AEFeature.StorageCells ),
Cell64kPart( 38, AEFeature.StorageCells ),
EmptyStorageCell( 39, AEFeature.StorageCells ),
WoodenGear( 40, AEFeature.GrindStone, "gearWood" ),
Wireless( 41, AEFeature.WirelessAccessTerminal ),
WirelessBooster( 42, AEFeature.WirelessAccessTerminal ),
FormationCore( 43 ),
AnnihilationCore( 44 ),
SkyDust( 45, AEFeature.Core ),
EnderDust( 46, AEFeature.QuantumNetworkBridge, "dustEnder,dustEnderPearl", EntitySingularity.class ),
Singularity( 47, AEFeature.QuantumNetworkBridge, EntitySingularity.class ),
QESingularity( 48, AEFeature.QuantumNetworkBridge, EntitySingularity.class ),
BlankPattern( 52 ),
CardCrafting( 53 );
private final EnumSet<AEFeature> features;
// IIcon for the material.
@SideOnly( Side.CLIENT )
public IIcon IIcon;
public Item itemInstance;
public int damageValue;
// stack!
public MaterialStackSrc stackSrc;
private String oreName;
private Class<? extends Entity> droppedEntity;
private boolean isRegistered = false;
MaterialType( final int metaValue )
{
this.damageValue = metaValue;
this.features = EnumSet.of( AEFeature.Core );
}
MaterialType( final int metaValue, final AEFeature part )
{
this.damageValue = metaValue;
this.features = EnumSet.of( part );
}
MaterialType( final int metaValue, final AEFeature part, final Class<? extends Entity> c )
{
this.features = EnumSet.of( part );
this.damageValue = metaValue;
this.droppedEntity = c;
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true );
}
MaterialType( final int metaValue, final AEFeature part, final String oreDictionary, final Class<? extends Entity> c )
{
this.features = EnumSet.of( part );
this.damageValue = metaValue;
this.oreName = oreDictionary;
this.droppedEntity = c;
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true );
}
MaterialType( final int metaValue, final AEFeature part, final String oreDictionary )
{
this.features = EnumSet.of( part );
this.damageValue = metaValue;
this.oreName = oreDictionary;
}
public ItemStack stack( final int size )
{
return new ItemStack( this.itemInstance, size, this.damageValue );
}
public EnumSet<AEFeature> getFeature()
{
return this.features;
}
public String getOreName()
{
return this.oreName;
}
public boolean hasCustomEntity()
{
return this.droppedEntity != null;
}
public Class<? extends Entity> getCustomEntityClass()
{
return this.droppedEntity;
}
public boolean isRegistered()
{
return this.isRegistered;
}
public void markReady()
{
this.isRegistered = true;
}
}