Remove Meta values from Config.
Fixed a number of rendering gltiches with Smart/Covered Cables
This commit is contained in:
@@ -1,298 +1,306 @@
|
||||
package appeng.items.materials;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.implementations.items.IStorageComponent;
|
||||
import appeng.api.implementations.items.IUpgradeModule;
|
||||
import appeng.client.texture.MissingIcon;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.AEFeatureHandler;
|
||||
import appeng.core.features.ItemStackSrc;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class ItemMaterial extends AEBaseItem implements IStorageComponent, IUpgradeModule
|
||||
{
|
||||
|
||||
HashMap<Integer, MaterialType> dmgToMaterial = new HashMap();
|
||||
|
||||
public static ItemMaterial instance;
|
||||
|
||||
public ItemMaterial() {
|
||||
super( ItemMaterial.class );
|
||||
setfeature( EnumSet.of( AEFeature.Core ) );
|
||||
setHasSubtypes( true );
|
||||
instance = this;
|
||||
}
|
||||
|
||||
class SlightlyBetterSort implements Comparator<String>
|
||||
{
|
||||
|
||||
Pattern p;
|
||||
|
||||
public SlightlyBetterSort(Pattern p) {
|
||||
this.p = p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(String o1, String o2)
|
||||
{
|
||||
try
|
||||
{
|
||||
Matcher a = p.matcher( o1 );
|
||||
Matcher b = p.matcher( o2 );
|
||||
if ( a.find() && b.find() )
|
||||
{
|
||||
int ia = Integer.parseInt( a.group( 1 ) );
|
||||
int ib = Integer.parseInt( b.group( 1 ) );
|
||||
return Integer.compare( ia, ib );
|
||||
}
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
// ek!
|
||||
}
|
||||
return o1.compareTo( o2 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List details, boolean moar)
|
||||
{
|
||||
super.addInformation( is, player, details, moar );
|
||||
|
||||
MaterialType mt = getTypeByStack( is );
|
||||
if ( mt == null )
|
||||
return;
|
||||
|
||||
if ( mt == MaterialType.NamePress )
|
||||
{
|
||||
NBTTagCompound c = Platform.openNbtData( is );
|
||||
details.add( c.getString( "InscribeName" ) );
|
||||
}
|
||||
|
||||
Upgrades u = getType( is );
|
||||
if ( u != null )
|
||||
{
|
||||
List<String> textList = new LinkedList();
|
||||
for (Entry<ItemStack, Integer> j : u.getSupported().entrySet())
|
||||
{
|
||||
String name = null;
|
||||
|
||||
int limit = j.getValue();
|
||||
|
||||
if ( j.getKey().getItem() instanceof IItemGroup )
|
||||
{
|
||||
IItemGroup ig = (IItemGroup) j.getKey().getItem();
|
||||
String str = ig.getUnlocalizedGroupName( j.getKey() );
|
||||
if ( str != null )
|
||||
name = Platform.gui_localize( str ) + (limit > 1 ? " (" + limit + ")" : "");
|
||||
}
|
||||
|
||||
if ( name == null )
|
||||
name = j.getKey().getDisplayName() + (limit > 1 ? " (" + limit + ")" : "");
|
||||
|
||||
if ( !textList.contains( name ) )
|
||||
textList.add( name );
|
||||
}
|
||||
|
||||
Pattern p = Pattern.compile( "(\\d+)[^\\d]" );
|
||||
SlightlyBetterSort s = new SlightlyBetterSort( p );
|
||||
Collections.sort( textList, s );
|
||||
details.addAll( textList );
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStackSrc createMaterial(MaterialType mat)
|
||||
{
|
||||
String name = mat.name();
|
||||
|
||||
if ( mat.damageValue == -1 )
|
||||
{
|
||||
boolean enabled = true;
|
||||
for (AEFeature f : mat.getFeature())
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
|
||||
if ( enabled )
|
||||
{
|
||||
int newMaterialNum = AEConfig.instance.get( "materials", name, AEConfig.instance.getFreeMaterial( mat.ordinal() ) ).getInt();
|
||||
mat.damageValue = newMaterialNum;
|
||||
ItemStackSrc output = new ItemStackSrc( this, newMaterialNum );
|
||||
|
||||
dmgToMaterial.put( newMaterialNum, mat );
|
||||
|
||||
if ( mat.getOreName() != null )
|
||||
OreDictionary.registerOre( mat.getOreName(), output.stack( 1 ) );
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
else
|
||||
throw new RuntimeException( "Cannot create the same material twice..." );
|
||||
}
|
||||
|
||||
public MaterialType getTypeByStack(ItemStack is)
|
||||
{
|
||||
if ( dmgToMaterial.containsKey( is.getItemDamage() ) )
|
||||
return dmgToMaterial.get( is.getItemDamage() );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int dmg)
|
||||
{
|
||||
if ( dmgToMaterial.containsKey( dmg ) )
|
||||
return dmgToMaterial.get( dmg ).IIcon;
|
||||
return new MissingIcon( this );
|
||||
}
|
||||
|
||||
private String nameOf(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
return "null";
|
||||
|
||||
MaterialType mt = getTypeByStack( is );
|
||||
if ( mt == null )
|
||||
return "null";
|
||||
|
||||
return AEFeatureHandler.getName( ItemMaterial.class, mt.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return "item.appliedenergistics2." + nameOf( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister icoRegister)
|
||||
{
|
||||
for (MaterialType mat : MaterialType.values())
|
||||
{
|
||||
if ( mat.damageValue != -1 )
|
||||
{
|
||||
String tex = "appliedenergistics2:" + nameOf( new ItemStack( this, 1, mat.damageValue ) );
|
||||
mat.IIcon = icoRegister.registerIcon( tex );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack is)
|
||||
{
|
||||
return getTypeByStack( is ).hasCustomEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity createEntity(World w, Entity location, ItemStack itemstack)
|
||||
{
|
||||
Class<? extends Entity> droppedEntity = getTypeByStack( itemstack ).getCustomEntityClass();
|
||||
Entity eqi;
|
||||
|
||||
try
|
||||
{
|
||||
eqi = droppedEntity.getConstructor( World.class, double.class, double.class, double.class, ItemStack.class ).newInstance( w, location.posX,
|
||||
location.posY, location.posZ, itemstack );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
throw new RuntimeException( t );
|
||||
}
|
||||
|
||||
eqi.motionX = location.motionX;
|
||||
eqi.motionY = location.motionY;
|
||||
eqi.motionZ = location.motionZ;
|
||||
|
||||
if ( location instanceof EntityItem && eqi instanceof EntityItem )
|
||||
((EntityItem) eqi).delayBeforeCanPickup = ((EntityItem) location).delayBeforeCanPickup;
|
||||
|
||||
return eqi;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes(ItemStack is)
|
||||
{
|
||||
switch (getTypeByStack( is ))
|
||||
{
|
||||
case Cell1kPart:
|
||||
return 1024;
|
||||
case Cell4kPart:
|
||||
return 1024 * 4;
|
||||
case Cell16kPart:
|
||||
return 1024 * 16;
|
||||
case Cell64kPart:
|
||||
return 1024 * 64;
|
||||
default:
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageComponent(ItemStack is)
|
||||
{
|
||||
switch (getTypeByStack( is ))
|
||||
{
|
||||
case Cell1kPart:
|
||||
case Cell4kPart:
|
||||
case Cell16kPart:
|
||||
case Cell64kPart:
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Upgrades getType(ItemStack itemstack)
|
||||
{
|
||||
switch (getTypeByStack( itemstack ))
|
||||
{
|
||||
case CardCapacity:
|
||||
return Upgrades.CAPACITY;
|
||||
case CardFuzzy:
|
||||
return Upgrades.FUZZY;
|
||||
case CardRedstone:
|
||||
return Upgrades.REDSTONE;
|
||||
case CardSpeed:
|
||||
return Upgrades.SPEED;
|
||||
case CardInverter:
|
||||
return Upgrades.INVERTER;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List cList)
|
||||
{
|
||||
for (MaterialType mat : MaterialType.values())
|
||||
{
|
||||
if ( mat.damageValue >= 0 )
|
||||
cList.add( new ItemStack( this, 1, mat.damageValue ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
package appeng.items.materials;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.implementations.items.IStorageComponent;
|
||||
import appeng.api.implementations.items.IUpgradeModule;
|
||||
import appeng.client.texture.MissingIcon;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.AEFeatureHandler;
|
||||
import appeng.core.features.ItemStackSrc;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, IUpgradeModule
|
||||
{
|
||||
|
||||
HashMap<Integer, MaterialType> dmgToMaterial = new HashMap();
|
||||
|
||||
public static ItemMultiMaterial instance;
|
||||
|
||||
public ItemMultiMaterial() {
|
||||
super( ItemMultiMaterial.class );
|
||||
setfeature( EnumSet.of( AEFeature.Core ) );
|
||||
setHasSubtypes( true );
|
||||
instance = this;
|
||||
}
|
||||
|
||||
class SlightlyBetterSort implements Comparator<String>
|
||||
{
|
||||
|
||||
Pattern p;
|
||||
|
||||
public SlightlyBetterSort(Pattern p) {
|
||||
this.p = p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(String o1, String o2)
|
||||
{
|
||||
try
|
||||
{
|
||||
Matcher a = p.matcher( o1 );
|
||||
Matcher b = p.matcher( o2 );
|
||||
if ( a.find() && b.find() )
|
||||
{
|
||||
int ia = Integer.parseInt( a.group( 1 ) );
|
||||
int ib = Integer.parseInt( b.group( 1 ) );
|
||||
return Integer.compare( ia, ib );
|
||||
}
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
// ek!
|
||||
}
|
||||
return o1.compareTo( o2 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List details, boolean moar)
|
||||
{
|
||||
super.addInformation( is, player, details, moar );
|
||||
|
||||
MaterialType mt = getTypeByStack( is );
|
||||
if ( mt == null )
|
||||
return;
|
||||
|
||||
if ( mt == MaterialType.NamePress )
|
||||
{
|
||||
NBTTagCompound c = Platform.openNbtData( is );
|
||||
details.add( c.getString( "InscribeName" ) );
|
||||
}
|
||||
|
||||
Upgrades u = getType( is );
|
||||
if ( u != null )
|
||||
{
|
||||
List<String> textList = new LinkedList();
|
||||
for (Entry<ItemStack, Integer> j : u.getSupported().entrySet())
|
||||
{
|
||||
String name = null;
|
||||
|
||||
int limit = j.getValue();
|
||||
|
||||
if ( j.getKey().getItem() instanceof IItemGroup )
|
||||
{
|
||||
IItemGroup ig = (IItemGroup) j.getKey().getItem();
|
||||
String str = ig.getUnlocalizedGroupName( j.getKey() );
|
||||
if ( str != null )
|
||||
name = Platform.gui_localize( str ) + (limit > 1 ? " (" + limit + ")" : "");
|
||||
}
|
||||
|
||||
if ( name == null )
|
||||
name = j.getKey().getDisplayName() + (limit > 1 ? " (" + limit + ")" : "");
|
||||
|
||||
if ( !textList.contains( name ) )
|
||||
textList.add( name );
|
||||
}
|
||||
|
||||
Pattern p = Pattern.compile( "(\\d+)[^\\d]" );
|
||||
SlightlyBetterSort s = new SlightlyBetterSort( p );
|
||||
Collections.sort( textList, s );
|
||||
details.addAll( textList );
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStackSrc createMaterial(MaterialType mat)
|
||||
{
|
||||
if ( !mat.isRegistered() )
|
||||
{
|
||||
boolean enabled = true;
|
||||
for (AEFeature f : mat.getFeature())
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
|
||||
if ( enabled )
|
||||
{
|
||||
int newMaterialNum = mat.damageValue;
|
||||
mat.markReady();
|
||||
|
||||
ItemStackSrc output = new ItemStackSrc( this, newMaterialNum );
|
||||
|
||||
if ( dmgToMaterial.get( newMaterialNum ) == null )
|
||||
dmgToMaterial.put( newMaterialNum, mat );
|
||||
else
|
||||
throw new RuntimeException( "Meta Overlap detected." );
|
||||
|
||||
if ( mat.getOreName() != null )
|
||||
OreDictionary.registerOre( mat.getOreName(), output.stack( 1 ) );
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
else
|
||||
throw new RuntimeException( "Cannot create the same material twice..." );
|
||||
}
|
||||
|
||||
public ItemStack getStackByType(MaterialType mt)
|
||||
{
|
||||
return new ItemStack( this, 1, mt.damageValue );
|
||||
}
|
||||
|
||||
public MaterialType getTypeByStack(ItemStack is)
|
||||
{
|
||||
if ( dmgToMaterial.containsKey( is.getItemDamage() ) )
|
||||
return dmgToMaterial.get( is.getItemDamage() );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int dmg)
|
||||
{
|
||||
if ( dmgToMaterial.containsKey( dmg ) )
|
||||
return dmgToMaterial.get( dmg ).IIcon;
|
||||
return new MissingIcon( this );
|
||||
}
|
||||
|
||||
private String nameOf(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
return "null";
|
||||
|
||||
MaterialType mt = getTypeByStack( is );
|
||||
if ( mt == null )
|
||||
return "null";
|
||||
|
||||
return AEFeatureHandler.getName( ItemMultiMaterial.class, mt.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return "item.appliedenergistics2." + nameOf( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister icoRegister)
|
||||
{
|
||||
for (MaterialType mat : MaterialType.values())
|
||||
{
|
||||
if ( mat.damageValue != -1 )
|
||||
{
|
||||
String tex = "appliedenergistics2:" + nameOf( new ItemStack( this, 1, mat.damageValue ) );
|
||||
mat.IIcon = icoRegister.registerIcon( tex );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack is)
|
||||
{
|
||||
return getTypeByStack( is ).hasCustomEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity createEntity(World w, Entity location, ItemStack itemstack)
|
||||
{
|
||||
Class<? extends Entity> droppedEntity = getTypeByStack( itemstack ).getCustomEntityClass();
|
||||
Entity eqi;
|
||||
|
||||
try
|
||||
{
|
||||
eqi = droppedEntity.getConstructor( World.class, double.class, double.class, double.class, ItemStack.class ).newInstance( w, location.posX,
|
||||
location.posY, location.posZ, itemstack );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
throw new RuntimeException( t );
|
||||
}
|
||||
|
||||
eqi.motionX = location.motionX;
|
||||
eqi.motionY = location.motionY;
|
||||
eqi.motionZ = location.motionZ;
|
||||
|
||||
if ( location instanceof EntityItem && eqi instanceof EntityItem )
|
||||
((EntityItem) eqi).delayBeforeCanPickup = ((EntityItem) location).delayBeforeCanPickup;
|
||||
|
||||
return eqi;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes(ItemStack is)
|
||||
{
|
||||
switch (getTypeByStack( is ))
|
||||
{
|
||||
case Cell1kPart:
|
||||
return 1024;
|
||||
case Cell4kPart:
|
||||
return 1024 * 4;
|
||||
case Cell16kPart:
|
||||
return 1024 * 16;
|
||||
case Cell64kPart:
|
||||
return 1024 * 64;
|
||||
default:
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageComponent(ItemStack is)
|
||||
{
|
||||
switch (getTypeByStack( is ))
|
||||
{
|
||||
case Cell1kPart:
|
||||
case Cell4kPart:
|
||||
case Cell16kPart:
|
||||
case Cell64kPart:
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Upgrades getType(ItemStack itemstack)
|
||||
{
|
||||
switch (getTypeByStack( itemstack ))
|
||||
{
|
||||
case CardCapacity:
|
||||
return Upgrades.CAPACITY;
|
||||
case CardFuzzy:
|
||||
return Upgrades.FUZZY;
|
||||
case CardRedstone:
|
||||
return Upgrades.REDSTONE;
|
||||
case CardSpeed:
|
||||
return Upgrades.SPEED;
|
||||
case CardInverter:
|
||||
return Upgrades.INVERTER;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List cList)
|
||||
{
|
||||
for (MaterialType mat : MaterialType.values())
|
||||
{
|
||||
if ( mat.damageValue >= 0 && mat.isRegistered() )
|
||||
cList.add( new ItemStack( this, 1, mat.damageValue ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,48 +17,48 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public enum MaterialType
|
||||
{
|
||||
CertusQuartzCrystal(AEFeature.Core, "crystalCertusQuartz"), CertusQuartzCrystalCharged(AEFeature.Core, EntityChargedQuartz.class),
|
||||
CertusQuartzCrystal(0, AEFeature.Core, "crystalCertusQuartz"), CertusQuartzCrystalCharged(1, AEFeature.Core, EntityChargedQuartz.class),
|
||||
|
||||
CertusQuartzDust(AEFeature.Core, "dustCertusQuartz"), NetherQuartzDust(AEFeature.Core, "dustNetherQuartz"), Flour(AEFeature.Flour, "dustWheat"), GoldDust(
|
||||
AEFeature.Core, "dustGold"), IronDust(AEFeature.Core, "dustIron"), IronNugget(AEFeature.Core, "nuggetIron"),
|
||||
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(AEFeature.Core, "itemSilicon"), MatterBall,
|
||||
Silicon(5, AEFeature.Core, "itemSilicon"), MatterBall(6),
|
||||
|
||||
FluixCrystal(AEFeature.Core, "crystalFluix"), FluixDust(AEFeature.Core, "dustFluix"), FluixPearl(AEFeature.Core, "pearlFluix"),
|
||||
FluixCrystal(7, AEFeature.Core, "crystalFluix"), FluixDust(8, AEFeature.Core, "dustFluix"), FluixPearl(9, AEFeature.Core, "pearlFluix"),
|
||||
|
||||
PureifiedCertusQuartzCrystal, PureifiedNetherQuartzCrystal, PureifiedFluixCrystal,
|
||||
PureifiedCertusQuartzCrystal(10), PureifiedNetherQuartzCrystal(11), PureifiedFluixCrystal(12),
|
||||
|
||||
CalcProcessorPress, EngProcessorPress, LogicProcessorPress,
|
||||
CalcProcessorPress(13), EngProcessorPress(14), LogicProcessorPress(15),
|
||||
|
||||
CalcProcessorPrint, EngProcessorPrint, LogicProcessorPrint,
|
||||
CalcProcessorPrint(16), EngProcessorPrint(17), LogicProcessorPrint(18),
|
||||
|
||||
SiliconPress, SiliconPrint,
|
||||
SiliconPress(19), SiliconPrint(20),
|
||||
|
||||
NamePress,
|
||||
NamePress(21),
|
||||
|
||||
LogicProcessor, CalcProcessor, EngProcessor,
|
||||
LogicProcessor(22), CalcProcessor(23), EngProcessor(24),
|
||||
|
||||
// Basic Cards
|
||||
BasicCard, CardRedstone, CardCapacity,
|
||||
BasicCard(25), CardRedstone(26), CardCapacity(27),
|
||||
|
||||
// Adv Cards
|
||||
AdvCard, CardFuzzy, CardSpeed, CardInverter,
|
||||
AdvCard(28), CardFuzzy(29), CardSpeed(30), CardInverter(31),
|
||||
|
||||
Cell2SpatialPart(AEFeature.SpatialIO), Cell16SpatialPart(AEFeature.SpatialIO), Cell128SpatialPart(AEFeature.SpatialIO),
|
||||
Cell2SpatialPart(32, AEFeature.SpatialIO), Cell16SpatialPart(33, AEFeature.SpatialIO), Cell128SpatialPart(34, AEFeature.SpatialIO),
|
||||
|
||||
Cell1kPart(AEFeature.StorageCells), Cell4kPart(AEFeature.StorageCells), Cell16kPart(AEFeature.StorageCells), Cell64kPart(AEFeature.StorageCells), EmptyStorageCell(
|
||||
AEFeature.StorageCells),
|
||||
Cell1kPart(35, AEFeature.StorageCells), Cell4kPart(36, AEFeature.StorageCells), Cell16kPart(37, AEFeature.StorageCells), Cell64kPart(38,
|
||||
AEFeature.StorageCells), EmptyStorageCell(39, AEFeature.StorageCells),
|
||||
|
||||
WoodenGear(AEFeature.GrindStone, "gearWood"),
|
||||
WoodenGear(39, AEFeature.GrindStone, "gearWood"),
|
||||
|
||||
Wireless(AEFeature.WirelessAccessTerminal), WirelessBooster(AEFeature.WirelessAccessTerminal),
|
||||
Wireless(41, AEFeature.WirelessAccessTerminal), WirelessBooster(42, AEFeature.WirelessAccessTerminal),
|
||||
|
||||
FormationCore, AnnihilationCore,
|
||||
FormationCore(43), AnnihilationCore(44),
|
||||
|
||||
SkyDust(AEFeature.Core),
|
||||
SkyDust(45, AEFeature.Core),
|
||||
|
||||
EnderDust(AEFeature.QuantumNetworkBridge, "dustEnder", EntitySingularity.class), Singularity(AEFeature.QuantumNetworkBridge, EntitySingularity.class), QESingularity(
|
||||
AEFeature.QuantumNetworkBridge, EntitySingularity.class);
|
||||
EnderDust(46, AEFeature.QuantumNetworkBridge, "dustEnder", EntitySingularity.class), Singularity(47, AEFeature.QuantumNetworkBridge,
|
||||
EntitySingularity.class), QESingularity(48, AEFeature.QuantumNetworkBridge, EntitySingularity.class);
|
||||
|
||||
private String oreName;
|
||||
private EnumSet<AEFeature> features;
|
||||
@@ -67,25 +67,30 @@ public enum MaterialType
|
||||
// IIcon for the material.
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon IIcon;
|
||||
public int damageValue = -1;
|
||||
final public int damageValue;
|
||||
private boolean isRegistered = false;
|
||||
|
||||
MaterialType() {
|
||||
MaterialType(int metaValue) {
|
||||
damageValue = metaValue;
|
||||
features = EnumSet.of( AEFeature.Core );
|
||||
}
|
||||
|
||||
MaterialType(AEFeature part) {
|
||||
MaterialType(int metaValue, AEFeature part) {
|
||||
damageValue = metaValue;
|
||||
features = EnumSet.of( part );
|
||||
}
|
||||
|
||||
MaterialType(AEFeature part, Class<? extends Entity> c) {
|
||||
MaterialType(int metaValue, AEFeature part, Class<? extends Entity> c) {
|
||||
features = EnumSet.of( part );
|
||||
damageValue = metaValue;
|
||||
droppedEntity = c;
|
||||
|
||||
EntityRegistry.registerModEntity( droppedEntity, droppedEntity.getSimpleName(), EntityIds.get( droppedEntity ), AppEng.instance, 16, 4, true );
|
||||
}
|
||||
|
||||
MaterialType(AEFeature part, String oreDictionary, Class<? extends Entity> c) {
|
||||
MaterialType(int metaValue, AEFeature part, String oreDictionary, Class<? extends Entity> c) {
|
||||
features = EnumSet.of( part );
|
||||
damageValue = metaValue;
|
||||
oreName = oreDictionary;
|
||||
if ( OreDictionary.getOres( oreDictionary ).size() > 0 )
|
||||
features.add( AEFeature.DuplicateItems );
|
||||
@@ -94,8 +99,9 @@ public enum MaterialType
|
||||
EntityRegistry.registerModEntity( droppedEntity, droppedEntity.getSimpleName(), EntityIds.get( droppedEntity ), AppEng.instance, 16, 4, true );
|
||||
}
|
||||
|
||||
MaterialType(AEFeature part, String oreDictionary) {
|
||||
MaterialType(int metaValue, AEFeature part, String oreDictionary) {
|
||||
features = EnumSet.of( part );
|
||||
damageValue = metaValue;
|
||||
oreName = oreDictionary;
|
||||
if ( OreDictionary.getOres( oreDictionary ).size() > 0 )
|
||||
features.add( AEFeature.DuplicateItems );
|
||||
@@ -103,7 +109,7 @@ public enum MaterialType
|
||||
|
||||
public ItemStack stack(int size)
|
||||
{
|
||||
return new ItemStack( ItemMaterial.instance, size, damageValue );
|
||||
return new ItemStack( ItemMultiMaterial.instance, size, damageValue );
|
||||
}
|
||||
|
||||
public EnumSet<AEFeature> getFeature()
|
||||
@@ -126,4 +132,14 @@ public enum MaterialType
|
||||
return droppedEntity;
|
||||
}
|
||||
|
||||
public boolean isRegistered()
|
||||
{
|
||||
return isRegistered;
|
||||
}
|
||||
|
||||
public void markReady()
|
||||
{
|
||||
isRegistered = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,220 +1,229 @@
|
||||
package appeng.items.parts;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.AEFeatureHandler;
|
||||
import appeng.core.features.ItemStackSrc;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
{
|
||||
|
||||
class PartTypeIst
|
||||
{
|
||||
|
||||
PartType part;
|
||||
int varient;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon ico;
|
||||
|
||||
};
|
||||
|
||||
HashMap<Integer, PartTypeIst> dmgToPart = new HashMap();
|
||||
|
||||
public static ItemPart instance;
|
||||
|
||||
public ItemPart() {
|
||||
super( ItemPart.class );
|
||||
setfeature( EnumSet.of( AEFeature.Core ) );
|
||||
AEApi.instance().partHelper().setItemBusRenderer( this );
|
||||
setHasSubtypes( true );
|
||||
instance = this;
|
||||
}
|
||||
|
||||
public ItemStackSrc createPart(PartType mat, Enum varient)
|
||||
{
|
||||
try
|
||||
{
|
||||
// I think this still works?
|
||||
ItemStack is = new ItemStack( this );
|
||||
mat.getPart().getConstructor( ItemStack.class ).newInstance( is );
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
return null; // part not supported..
|
||||
}
|
||||
|
||||
String name = varient == null ? mat.name() : mat.name() + "." + varient.name();
|
||||
int varID = varient == null ? 0 : varient.ordinal();
|
||||
|
||||
// verify
|
||||
for (PartTypeIst p : dmgToPart.values())
|
||||
{
|
||||
if ( p.part == mat && p.varient == varID )
|
||||
throw new RuntimeException( "Cannot create the same material twice..." );
|
||||
}
|
||||
|
||||
boolean enabled = true;
|
||||
for (AEFeature f : mat.getFeature())
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
|
||||
if ( enabled )
|
||||
{
|
||||
int newPartNum = AEConfig.instance.get( "parts", name, AEConfig.instance.getFreePart( mat.ordinal() * 32 + varID ) ).getInt();
|
||||
ItemStackSrc output = new ItemStackSrc( this, newPartNum );
|
||||
|
||||
PartTypeIst pti = new PartTypeIst();
|
||||
pti.part = mat;
|
||||
pti.varient = varID;
|
||||
|
||||
dmgToPart.put( newPartNum, pti );
|
||||
return output;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getDamageByType(PartType t)
|
||||
{
|
||||
for (Entry<Integer, PartTypeIst> pt : dmgToPart.entrySet())
|
||||
{
|
||||
if ( pt.getValue().part == t )
|
||||
return pt.getKey();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public PartType getTypeByStack(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
return null;
|
||||
|
||||
PartTypeIst pt = dmgToPart.get( is.getItemDamage() );
|
||||
if ( pt != null )
|
||||
return pt.part;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getSpriteNumber()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int dmg)
|
||||
{
|
||||
IIcon ico = dmgToPart.get( dmg ).ico;
|
||||
return ico;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return "item.appliedenergistics2." + getname( is );
|
||||
}
|
||||
|
||||
public String getname(ItemStack is)
|
||||
{
|
||||
return AEFeatureHandler.getName( ItemPart.class, getTypeByStack( is ).name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack is)
|
||||
{
|
||||
PartType pt = getTypeByStack( is );
|
||||
if ( pt == null )
|
||||
return "Unnamed";
|
||||
|
||||
Enum[] varients = pt.getVarients();
|
||||
|
||||
if ( varients != null )
|
||||
return super.getItemStackDisplayName( is ) + " - " + varients[dmgToPart.get( is.getItemDamage() ).varient].toString();
|
||||
|
||||
if ( pt.getExtraName() != null )
|
||||
return super.getItemStackDisplayName( is ) + " - " + pt.getExtraName().getLocal();
|
||||
|
||||
return super.getItemStackDisplayName( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister)
|
||||
{
|
||||
for (Entry<Integer, PartTypeIst> part : dmgToPart.entrySet())
|
||||
{
|
||||
String tex = "appliedenergistics2:" + getname( new ItemStack( this, 1, part.getKey() ) );
|
||||
part.getValue().ico = par1IconRegister.registerIcon( tex );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return AEApi.instance().partHelper().placeBus( is, x, y, z, side, player, w );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPart createPartFromItemStack(ItemStack is)
|
||||
{
|
||||
try
|
||||
{
|
||||
PartType t = getTypeByStack( is );
|
||||
if ( t != null )
|
||||
return t.getPart().getConstructor( ItemStack.class ).newInstance( is );
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException( "Unable to construct IBusPart from IBusItem : " + getTypeByStack( is ).getPart().getName()
|
||||
+ " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item number, CreativeTabs tab, List cList)
|
||||
{
|
||||
for (Entry<Integer, PartTypeIst> part : dmgToPart.entrySet())
|
||||
cList.add( new ItemStack( this, 1, part.getKey() ) );
|
||||
}
|
||||
|
||||
public int varientOf(int itemDamage)
|
||||
{
|
||||
return dmgToPart.get( itemDamage ).varient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName(ItemStack is)
|
||||
{
|
||||
switch (getTypeByStack( is ))
|
||||
{
|
||||
case ImportBus:
|
||||
case ExportBus:
|
||||
return GuiText.IOBuses.getUnlocalized();
|
||||
default:
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.items.parts;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.AEFeatureHandler;
|
||||
import appeng.core.features.ItemStackSrc;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
{
|
||||
|
||||
class PartTypeIst
|
||||
{
|
||||
|
||||
PartType part;
|
||||
int varient;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon ico;
|
||||
};
|
||||
|
||||
HashMap<Integer, PartTypeIst> dmgToPart = new HashMap();
|
||||
|
||||
public static ItemMultiPart instance;
|
||||
|
||||
public ItemMultiPart() {
|
||||
super( ItemMultiPart.class );
|
||||
setfeature( EnumSet.of( AEFeature.Core ) );
|
||||
AEApi.instance().partHelper().setItemBusRenderer( this );
|
||||
setHasSubtypes( true );
|
||||
instance = this;
|
||||
}
|
||||
|
||||
public ItemStackSrc createPart(PartType mat, Enum varient)
|
||||
{
|
||||
try
|
||||
{
|
||||
// I think this still works?
|
||||
ItemStack is = new ItemStack( this );
|
||||
mat.getPart().getConstructor( ItemStack.class ).newInstance( is );
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
return null; // part not supported..
|
||||
}
|
||||
|
||||
int varID = varient == null ? 0 : varient.ordinal();
|
||||
|
||||
// verify
|
||||
for (PartTypeIst p : dmgToPart.values())
|
||||
{
|
||||
if ( p.part == mat && p.varient == varID )
|
||||
throw new RuntimeException( "Cannot create the same material twice..." );
|
||||
}
|
||||
|
||||
boolean enabled = true;
|
||||
for (AEFeature f : mat.getFeature())
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
|
||||
if ( enabled )
|
||||
{
|
||||
int newPartNum = mat.baseDamage + varID;
|
||||
ItemStackSrc output = new ItemStackSrc( this, newPartNum );
|
||||
|
||||
PartTypeIst pti = new PartTypeIst();
|
||||
pti.part = mat;
|
||||
pti.varient = varID;
|
||||
|
||||
if ( dmgToPart.get( newPartNum ) == null )
|
||||
{
|
||||
dmgToPart.put( newPartNum, pti );
|
||||
return output;
|
||||
}
|
||||
else
|
||||
throw new RuntimeException( "Meta Overlap detected." );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getDamageByType(PartType t)
|
||||
{
|
||||
for (Entry<Integer, PartTypeIst> pt : dmgToPart.entrySet())
|
||||
{
|
||||
if ( pt.getValue().part == t )
|
||||
return pt.getKey();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public PartType getTypeByStack(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
return null;
|
||||
|
||||
PartTypeIst pt = dmgToPart.get( is.getItemDamage() );
|
||||
if ( pt != null )
|
||||
return pt.part;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getSpriteNumber()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int dmg)
|
||||
{
|
||||
IIcon ico = dmgToPart.get( dmg ).ico;
|
||||
return ico;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return "item.appliedenergistics2." + getname( is );
|
||||
}
|
||||
|
||||
public String getname(ItemStack is)
|
||||
{
|
||||
return AEFeatureHandler.getName( ItemMultiPart.class, getTypeByStack( is ).name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack is)
|
||||
{
|
||||
PartType pt = getTypeByStack( is );
|
||||
if ( pt == null )
|
||||
return "Unnamed";
|
||||
|
||||
Enum[] varients = pt.getVarients();
|
||||
|
||||
if ( varients != null )
|
||||
return super.getItemStackDisplayName( is ) + " - " + varients[dmgToPart.get( is.getItemDamage() ).varient].toString();
|
||||
|
||||
if ( pt.getExtraName() != null )
|
||||
return super.getItemStackDisplayName( is ) + " - " + pt.getExtraName().getLocal();
|
||||
|
||||
return super.getItemStackDisplayName( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister)
|
||||
{
|
||||
for (Entry<Integer, PartTypeIst> part : dmgToPart.entrySet())
|
||||
{
|
||||
String tex = "appliedenergistics2:" + getname( new ItemStack( this, 1, part.getKey() ) );
|
||||
part.getValue().ico = par1IconRegister.registerIcon( tex );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return AEApi.instance().partHelper().placeBus( is, x, y, z, side, player, w );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPart createPartFromItemStack(ItemStack is)
|
||||
{
|
||||
try
|
||||
{
|
||||
PartType t = getTypeByStack( is );
|
||||
if ( t != null )
|
||||
return t.getPart().getConstructor( ItemStack.class ).newInstance( is );
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException( "Unable to construct IBusPart from IBusItem : " + getTypeByStack( is ).getPart().getName()
|
||||
+ " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item number, CreativeTabs tab, List cList)
|
||||
{
|
||||
for (Entry<Integer, PartTypeIst> part : dmgToPart.entrySet())
|
||||
cList.add( new ItemStack( this, 1, part.getKey() ) );
|
||||
}
|
||||
|
||||
public int varientOf(int itemDamage)
|
||||
{
|
||||
if ( dmgToPart.containsKey( itemDamage ) )
|
||||
return dmgToPart.get( itemDamage ).varient;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName(ItemStack is)
|
||||
{
|
||||
switch (getTypeByStack( is ))
|
||||
{
|
||||
case ImportBus:
|
||||
case ExportBus:
|
||||
return GuiText.IOBuses.getUnlocalized();
|
||||
default:
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ItemStack getStackFromTypeAndVarient(PartType mt, int varient)
|
||||
{
|
||||
return new ItemStack( this, 1, mt.baseDamage + varient );
|
||||
}
|
||||
}
|
||||
+41
-35
@@ -39,76 +39,82 @@ import appeng.parts.reporting.PartTerminal;
|
||||
|
||||
public enum PartType
|
||||
{
|
||||
ToggleBus(AEFeature.Core, PartToggleBus.class),
|
||||
CableGlass(0, AEFeature.Core, PartCableGlass.class),
|
||||
|
||||
InvertedToggleBus(AEFeature.Core, PartInvertedToggleBus.class),
|
||||
CableCovered(20, AEFeature.Core, PartCableCovered.class),
|
||||
|
||||
CableSmart(AEFeature.Core, PartCableSmart.class), CableCovered(AEFeature.Core, PartCableCovered.class), CableGlass(AEFeature.Core, PartCableGlass.class),
|
||||
CableSmart(40, AEFeature.Core, PartCableSmart.class),
|
||||
|
||||
CableDense(AEFeature.DenseCables, PartDenseCable.class),
|
||||
CableDense(60, AEFeature.DenseCables, PartDenseCable.class),
|
||||
|
||||
CableAnchor(AEFeature.Core, PartCableAnchor.class),
|
||||
ToggleBus(80, AEFeature.Core, PartToggleBus.class),
|
||||
|
||||
QuartzFiber(AEFeature.Core, PartQuartzFiber.class),
|
||||
InvertedToggleBus(100, AEFeature.Core, PartInvertedToggleBus.class),
|
||||
|
||||
Monitor(AEFeature.Core, PartMonitor.class),
|
||||
CableAnchor(120, AEFeature.Core, PartCableAnchor.class),
|
||||
|
||||
SemiDarkMonitor(AEFeature.Core, PartSemiDarkMonitor.class),
|
||||
QuartzFiber(140, AEFeature.Core, PartQuartzFiber.class),
|
||||
|
||||
DarkMonitor(AEFeature.Core, PartDarkMonitor.class),
|
||||
Monitor(160, AEFeature.Core, PartMonitor.class),
|
||||
|
||||
StorageBus(AEFeature.StorageBus, PartStorageBus.class),
|
||||
SemiDarkMonitor(180, AEFeature.Core, PartSemiDarkMonitor.class),
|
||||
|
||||
ImportBus(AEFeature.ImportBus, PartImportBus.class),
|
||||
DarkMonitor(200, AEFeature.Core, PartDarkMonitor.class),
|
||||
|
||||
ExportBus(AEFeature.ExportBus, PartExportBus.class),
|
||||
StorageBus(220, AEFeature.StorageBus, PartStorageBus.class),
|
||||
|
||||
LevelEmitter(AEFeature.LevelEmiter, PartLevelEmitter.class),
|
||||
ImportBus(240, AEFeature.ImportBus, PartImportBus.class),
|
||||
|
||||
AnnihilationPlane(AEFeature.AnnihilationPlane, PartAnnihilationPlane.class),
|
||||
ExportBus(260, AEFeature.ExportBus, PartExportBus.class),
|
||||
|
||||
FormationPlane(AEFeature.FormationPlane, PartFormationPlane.class),
|
||||
LevelEmitter(280, AEFeature.LevelEmiter, PartLevelEmitter.class),
|
||||
|
||||
P2PTunnelME(AEFeature.P2PTunnelME, PartP2PTunnelME.class, GuiText.METunnel),
|
||||
AnnihilationPlane(300, AEFeature.AnnihilationPlane, PartAnnihilationPlane.class),
|
||||
|
||||
P2PTunnelRedstone(AEFeature.P2PTunnelRedstone, PartP2PRedstone.class, GuiText.RedstoneTunnel),
|
||||
|
||||
P2PTunnelItems(AEFeature.P2PTunnelItems, PartP2PItems.class, GuiText.ItemTunnel),
|
||||
|
||||
P2PTunnelLiquids(AEFeature.P2PTunnelLiquids, PartP2PLiquids.class, GuiText.FluidTunnel),
|
||||
|
||||
P2PTunnelMJ(AEFeature.P2PTunnelMJ, PartP2PBCPower.class, GuiText.MJTunnel),
|
||||
|
||||
P2PTunnelEU(AEFeature.P2PTunnelEU, PartP2PIC2Power.class, GuiText.EUTunnel),
|
||||
FormationPlane(320, AEFeature.FormationPlane, PartFormationPlane.class),
|
||||
|
||||
// CraftingMonitor(AEFeature.Crafting, PartCraftingMonitor.class),
|
||||
|
||||
PatternTerminal(AEFeature.CraftingTerminal, PartPatternTerminal.class),
|
||||
PatternTerminal(340, AEFeature.CraftingTerminal, PartPatternTerminal.class),
|
||||
|
||||
CraftingTerminal(AEFeature.CraftingTerminal, PartCraftingTerminal.class),
|
||||
CraftingTerminal(360, AEFeature.CraftingTerminal, PartCraftingTerminal.class),
|
||||
|
||||
Terminal(AEFeature.Core, PartTerminal.class),
|
||||
Terminal(380, AEFeature.Core, PartTerminal.class),
|
||||
|
||||
StorageMonitor(AEFeature.StorageMonitor, PartStorageMonitor.class),
|
||||
StorageMonitor(400, AEFeature.StorageMonitor, PartStorageMonitor.class),
|
||||
|
||||
ConversionMonitor(AEFeature.PartConversionMonitor, PartConversionMonitor.class),
|
||||
ConversionMonitor(420, AEFeature.PartConversionMonitor, PartConversionMonitor.class),
|
||||
|
||||
Interface(AEFeature.Core, PartInterface.class),
|
||||
Interface(440, AEFeature.Core, PartInterface.class),
|
||||
|
||||
P2PTunnelRF(AEFeature.P2PTunnelRF, PartP2PRFPower.class, GuiText.RFTunnel);
|
||||
P2PTunnelME(460, AEFeature.P2PTunnelME, PartP2PTunnelME.class, GuiText.METunnel),
|
||||
|
||||
P2PTunnelRedstone(461, AEFeature.P2PTunnelRedstone, PartP2PRedstone.class, GuiText.RedstoneTunnel),
|
||||
|
||||
P2PTunnelItems(462, AEFeature.P2PTunnelItems, PartP2PItems.class, GuiText.ItemTunnel),
|
||||
|
||||
P2PTunnelLiquids(463, AEFeature.P2PTunnelLiquids, PartP2PLiquids.class, GuiText.FluidTunnel),
|
||||
|
||||
P2PTunnelMJ(464, AEFeature.P2PTunnelMJ, PartP2PBCPower.class, GuiText.MJTunnel),
|
||||
|
||||
P2PTunnelEU(465, AEFeature.P2PTunnelEU, PartP2PIC2Power.class, GuiText.EUTunnel),
|
||||
|
||||
P2PTunnelRF(466, AEFeature.P2PTunnelRF, PartP2PRFPower.class, GuiText.RFTunnel);
|
||||
|
||||
private final EnumSet<AEFeature> features;
|
||||
private final Class<? extends IPart> myPart;
|
||||
private final GuiText extraName;
|
||||
public final int baseDamage;
|
||||
|
||||
PartType(AEFeature part, Class<? extends IPart> c) {
|
||||
this( part, c, null );
|
||||
PartType(int baseMetaValue, AEFeature part, Class<? extends IPart> c) {
|
||||
this( baseMetaValue, part, c, null );
|
||||
}
|
||||
|
||||
PartType(AEFeature part, Class<? extends IPart> c, GuiText en) {
|
||||
PartType(int baseMetaValue, AEFeature part, Class<? extends IPart> c, GuiText en) {
|
||||
features = EnumSet.of( part );
|
||||
myPart = c;
|
||||
extraName = en;
|
||||
baseDamage = baseMetaValue;
|
||||
}
|
||||
|
||||
public Enum[] getVarients()
|
||||
|
||||
Reference in New Issue
Block a user