Fixes #675 No disabled feature should log spam or crash anymore.
Deprecates the old usage of the AEItemDefinitions via the direct method access of * blocks() * parts() * items() * materials() and thus use the new re-direct via definitions(). All definitions are now initialized, no matter what. But SubItems, Items and Blocks are not registered, if by chance are disabled.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.items.parts;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
@@ -42,6 +43,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.exceptions.MissingDefinition;
|
||||
import appeng.api.parts.IAlphaPassItem;
|
||||
import appeng.block.solids.OreQuartz;
|
||||
import appeng.client.render.BusRenderer;
|
||||
@@ -52,11 +54,14 @@ import appeng.facade.IFacadeItem;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassItem
|
||||
{
|
||||
|
||||
public ItemFacade() {
|
||||
super( ItemFacade.class );
|
||||
private List<ItemStack> subTypes = null;
|
||||
|
||||
public ItemFacade()
|
||||
{
|
||||
this.setFeature( EnumSet.of( AEFeature.Facades ) );
|
||||
this.setHasSubtypes( true );
|
||||
if ( Platform.isClient() )
|
||||
@@ -64,20 +69,46 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public int getSpriteNumber()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
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 FacadePart createPartFromItemStack(ItemStack is, ForgeDirection side)
|
||||
public String getItemStackDisplayName( ItemStack is )
|
||||
{
|
||||
try
|
||||
{
|
||||
ItemStack in = this.getTextureItem( is );
|
||||
if ( in != null )
|
||||
{
|
||||
return super.getItemStackDisplayName( is ) + " - " + in.getDisplayName();
|
||||
}
|
||||
}
|
||||
catch ( Throwable ignored )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return super.getItemStackDisplayName( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems( Item number, CreativeTabs tab, List list )
|
||||
{
|
||||
this.calculateSubTypes();
|
||||
list.addAll( this.subTypes );
|
||||
}
|
||||
|
||||
@Override
|
||||
public FacadePart createPartFromItemStack( ItemStack is, ForgeDirection side )
|
||||
{
|
||||
ItemStack in = this.getTextureItem( is );
|
||||
if ( in != null )
|
||||
@@ -85,40 +116,8 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ItemStack> subTypes = null;
|
||||
|
||||
public List<ItemStack> getFacades()
|
||||
{
|
||||
this.calculateSubTypes();
|
||||
return this.subTypes;
|
||||
}
|
||||
|
||||
public ItemStack getCreativeTabIcon()
|
||||
{
|
||||
this.calculateSubTypes();
|
||||
if ( this.subTypes.isEmpty() )
|
||||
return new ItemStack( Items.cake );
|
||||
return this.subTypes.get( 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item number, CreativeTabs tab, List list)
|
||||
{
|
||||
this.calculateSubTypes();
|
||||
list.addAll( this.subTypes );
|
||||
}
|
||||
|
||||
public ItemStack createFromIDs(int[] ids)
|
||||
{
|
||||
ItemStack is = new ItemStack( AEApi.instance().items().itemFacade.item() );
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setIntArray( "x", ids.clone() );
|
||||
is.setTagCompound( data );
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getTextureItem(ItemStack is)
|
||||
public ItemStack getTextureItem( ItemStack is )
|
||||
{
|
||||
Block blk = this.getBlock( is );
|
||||
if ( blk != null )
|
||||
@@ -126,12 +125,51 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMeta( ItemStack is )
|
||||
{
|
||||
NBTTagCompound data = is.getTagCompound();
|
||||
if ( data != null )
|
||||
{
|
||||
int[] blk = data.getIntArray( "x" );
|
||||
if ( blk != null && blk.length == 2 )
|
||||
return blk[1];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock( ItemStack is )
|
||||
{
|
||||
NBTTagCompound data = is.getTagCompound();
|
||||
if ( data != null )
|
||||
{
|
||||
if ( data.hasKey( "modid" ) && data.hasKey( "itemname" ) )
|
||||
{
|
||||
return GameRegistry.findBlock( data.getString( "modid" ), data.getString( "itemname" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] blk = data.getIntArray( "x" );
|
||||
if ( blk != null && blk.length == 2 )
|
||||
return Block.getBlockById( blk[0] );
|
||||
}
|
||||
}
|
||||
return Blocks.glass;
|
||||
}
|
||||
|
||||
public List<ItemStack> getFacades()
|
||||
{
|
||||
this.calculateSubTypes();
|
||||
return this.subTypes;
|
||||
}
|
||||
|
||||
private void calculateSubTypes()
|
||||
{
|
||||
if ( this.subTypes == null )
|
||||
{
|
||||
this.subTypes = new ArrayList<ItemStack>();
|
||||
for (Object blk : Block.blockRegistry)
|
||||
for ( Object blk : Block.blockRegistry )
|
||||
{
|
||||
Block b = (Block) blk;
|
||||
try
|
||||
@@ -140,14 +178,14 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
|
||||
List<ItemStack> tmpList = new ArrayList<ItemStack>();
|
||||
b.getSubBlocks( item, b.getCreativeTabToDisplayOn(), tmpList );
|
||||
for (ItemStack l : tmpList)
|
||||
for ( ItemStack l : tmpList )
|
||||
{
|
||||
ItemStack facade = this.createFacadeForItem( l, false );
|
||||
if ( facade != null )
|
||||
this.subTypes.add( facade );
|
||||
}
|
||||
}
|
||||
catch (Throwable t)
|
||||
catch ( Throwable t )
|
||||
{
|
||||
// just absorb..
|
||||
}
|
||||
@@ -156,10 +194,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
if ( FacadeConfig.instance.hasChanged() )
|
||||
FacadeConfig.instance.save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ItemStack createFacadeForItem(ItemStack l, boolean returnItem)
|
||||
public ItemStack createFacadeForItem( ItemStack l, boolean returnItem )
|
||||
{
|
||||
if ( l == null )
|
||||
return null;
|
||||
@@ -174,7 +211,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
boolean enableGlass = b instanceof BlockGlass || b instanceof BlockStainedGlass;
|
||||
boolean disableOre = b instanceof OreQuartz;
|
||||
|
||||
boolean defaultValue = (b.isOpaqueCube() && !b.getTickRandomly() && !hasTile && !disableOre) || enableGlass;
|
||||
boolean defaultValue = ( b.isOpaqueCube() && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass;
|
||||
if ( FacadeConfig.instance.checkEnabled( b, metadata, defaultValue ) )
|
||||
{
|
||||
if ( returnItem )
|
||||
@@ -195,60 +232,30 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock(ItemStack is)
|
||||
public ItemStack getCreativeTabIcon()
|
||||
{
|
||||
NBTTagCompound data = is.getTagCompound();
|
||||
if ( data != null )
|
||||
this.calculateSubTypes();
|
||||
if ( this.subTypes.isEmpty() )
|
||||
return new ItemStack( Items.cake );
|
||||
return this.subTypes.get( 0 );
|
||||
}
|
||||
|
||||
public ItemStack createFromIDs( int[] ids )
|
||||
{
|
||||
for ( ItemStack facadeStack : AEApi.instance().definitions().items().facade().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
if ( data.hasKey( "modid" ) && data.hasKey( "itemname" ) )
|
||||
{
|
||||
return GameRegistry.findBlock( data.getString( "modid" ), data.getString( "itemname" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] blk = data.getIntArray( "x" );
|
||||
if ( blk != null && blk.length == 2 )
|
||||
return Block.getBlockById( blk[0] );
|
||||
}
|
||||
NBTTagCompound facadeTag = new NBTTagCompound();
|
||||
facadeTag.setIntArray( "x", ids.clone() );
|
||||
facadeStack.setTagCompound( facadeTag );
|
||||
|
||||
return facadeStack;
|
||||
}
|
||||
return Blocks.glass;
|
||||
|
||||
throw new MissingDefinition( "Tried to create a facade, while facades are being deactivated." );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMeta(ItemStack is)
|
||||
{
|
||||
NBTTagCompound data = is.getTagCompound();
|
||||
if ( data != null )
|
||||
{
|
||||
int[] blk = data.getIntArray( "x" );
|
||||
if ( blk != null && blk.length == 2 )
|
||||
return blk[1];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack is)
|
||||
{
|
||||
try
|
||||
{
|
||||
ItemStack in = this.getTextureItem( is );
|
||||
if ( in != null )
|
||||
{
|
||||
return super.getItemStackDisplayName( is ) + " - " + in.getDisplayName();
|
||||
}
|
||||
}
|
||||
catch (Throwable ignored)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return super.getItemStackDisplayName( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useAlphaPass(ItemStack is)
|
||||
public boolean useAlphaPass( ItemStack is )
|
||||
{
|
||||
ItemStack out = this.getTextureItem( is );
|
||||
|
||||
@@ -261,5 +268,4 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,9 +24,12 @@ import java.util.Comparator;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -41,40 +44,80 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHelper;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.AEFeatureHandler;
|
||||
import appeng.core.features.NameResolver;
|
||||
import appeng.core.features.ItemStackSrc;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
|
||||
public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
{
|
||||
private final NameResolver nameResolver;
|
||||
|
||||
static class PartTypeIst
|
||||
private static class PartTypeIst
|
||||
{
|
||||
|
||||
PartType part;
|
||||
int variant;
|
||||
private PartType part;
|
||||
private int variant;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon ico;
|
||||
private IIcon ico;
|
||||
}
|
||||
|
||||
final HashMap<Integer, PartTypeIst> dmgToPart = new HashMap<Integer, PartTypeIst>();
|
||||
private final Map<Integer, PartTypeIst> dmgToPart = new HashMap<Integer, PartTypeIst>();
|
||||
|
||||
public static ItemMultiPart instance;
|
||||
|
||||
public ItemMultiPart() {
|
||||
super( ItemMultiPart.class );
|
||||
public ItemMultiPart( IPartHelper partHelper ) {
|
||||
this.nameResolver = new NameResolver( this.getClass() );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
AEApi.instance().partHelper().setItemBusRenderer( this );
|
||||
partHelper.setItemBusRenderer( this );
|
||||
this.setHasSubtypes( true );
|
||||
instance = this;
|
||||
}
|
||||
|
||||
public final ItemStackSrc createPart( PartType mat )
|
||||
{
|
||||
int varID = 0;
|
||||
|
||||
// verify
|
||||
for (PartTypeIst p : this.dmgToPart.values())
|
||||
{
|
||||
if ( p.part == mat && p.variant == varID )
|
||||
throw new RuntimeException( "Cannot create the same material twice..." );
|
||||
}
|
||||
|
||||
boolean enabled = true;
|
||||
for (AEFeature f : mat.getFeature())
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
|
||||
int newPartNum = mat.baseDamage + varID;
|
||||
ItemStackSrc output = new ItemStackSrc( this, newPartNum );
|
||||
|
||||
if ( enabled )
|
||||
{
|
||||
PartTypeIst pti = new PartTypeIst();
|
||||
pti.part = mat;
|
||||
pti.variant = varID;
|
||||
|
||||
if ( this.dmgToPart.get( newPartNum ) == null )
|
||||
{
|
||||
this.dmgToPart.put( newPartNum, pti );
|
||||
return output;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RuntimeException( "Meta Overlap detected." );
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
public ItemStackSrc createPart(PartType mat, Enum variant)
|
||||
{
|
||||
try
|
||||
@@ -86,6 +129,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
catch (Throwable e)
|
||||
{
|
||||
AELog.integration( e );
|
||||
e.printStackTrace();
|
||||
return null; // part not supported..
|
||||
}
|
||||
|
||||
@@ -133,6 +177,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PartType getTypeByStack(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
@@ -166,7 +211,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
|
||||
public String getName(ItemStack is)
|
||||
{
|
||||
return AEFeatureHandler.getName( ItemMultiPart.class, this.getTypeByStack( is ).name() );
|
||||
return this.nameResolver.getName( this.getTypeByStack( is ).name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -176,10 +221,12 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
if ( pt == null )
|
||||
return "Unnamed";
|
||||
|
||||
Enum[] variants = pt.getVariants();
|
||||
if ( pt.isCable() )
|
||||
{
|
||||
final AEColor[] variants = AEColor.values();
|
||||
|
||||
if ( variants != null )
|
||||
return super.getItemStackDisplayName( is ) + " - " + variants[this.dmgToPart.get( is.getItemDamage() ).variant].toString();
|
||||
}
|
||||
|
||||
if ( pt.getExtraName() != null )
|
||||
return super.getItemStackDisplayName( is ) + " - " + pt.getExtraName().getLocal();
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.lang.reflect.Constructor;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.parts.automation.PartAnnihilationPlane;
|
||||
@@ -61,95 +60,121 @@ import appeng.parts.reporting.PartTerminal;
|
||||
|
||||
public enum PartType
|
||||
{
|
||||
InvalidType( -1, AEFeature.Core, null ),
|
||||
InvalidType( -1, EnumSet.of( AEFeature.Core ), null ),
|
||||
|
||||
CableGlass( 0, AEFeature.Core, PartCableGlass.class ),
|
||||
CableGlass( 0, EnumSet.of( AEFeature.Core ), PartCableGlass.class )
|
||||
{
|
||||
@Override
|
||||
public boolean isCable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
CableCovered( 20, AEFeature.Core, PartCableCovered.class ),
|
||||
CableCovered( 20, EnumSet.of( AEFeature.Core ), PartCableCovered.class )
|
||||
{
|
||||
@Override
|
||||
public boolean isCable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
CableSmart( 40, AEFeature.Channels, PartCableSmart.class ),
|
||||
CableSmart( 40, EnumSet.of( AEFeature.Channels ), PartCableSmart.class )
|
||||
{
|
||||
@Override
|
||||
public boolean isCable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
CableDense( 60, AEFeature.Channels, PartDenseCable.class ),
|
||||
CableDense( 60, EnumSet.of( AEFeature.Channels ), PartDenseCable.class )
|
||||
{
|
||||
@Override
|
||||
public boolean isCable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
ToggleBus( 80, AEFeature.Core, PartToggleBus.class ),
|
||||
ToggleBus( 80, EnumSet.of( AEFeature.Core ), PartToggleBus.class ),
|
||||
|
||||
InvertedToggleBus( 100, AEFeature.Core, PartInvertedToggleBus.class ),
|
||||
InvertedToggleBus( 100, EnumSet.of( AEFeature.Core ), PartInvertedToggleBus.class ),
|
||||
|
||||
CableAnchor( 120, AEFeature.Core, PartCableAnchor.class ),
|
||||
CableAnchor( 120, EnumSet.of( AEFeature.Core ), PartCableAnchor.class ),
|
||||
|
||||
QuartzFiber( 140, AEFeature.Core, PartQuartzFiber.class ),
|
||||
QuartzFiber( 140, EnumSet.of( AEFeature.Core ), PartQuartzFiber.class ),
|
||||
|
||||
Monitor( 160, AEFeature.Core, PartMonitor.class ),
|
||||
Monitor( 160, EnumSet.of( AEFeature.Core ), PartMonitor.class ),
|
||||
|
||||
SemiDarkMonitor( 180, AEFeature.Core, PartSemiDarkMonitor.class ),
|
||||
SemiDarkMonitor( 180, EnumSet.of( AEFeature.Core ), PartSemiDarkMonitor.class ),
|
||||
|
||||
DarkMonitor( 200, AEFeature.Core, PartDarkMonitor.class ),
|
||||
DarkMonitor( 200, EnumSet.of( AEFeature.Core ), PartDarkMonitor.class ),
|
||||
|
||||
StorageBus( 220, AEFeature.StorageBus, PartStorageBus.class ),
|
||||
StorageBus( 220, EnumSet.of( AEFeature.StorageBus ), PartStorageBus.class ),
|
||||
|
||||
ImportBus( 240, AEFeature.ImportBus, PartImportBus.class ),
|
||||
ImportBus( 240, EnumSet.of( AEFeature.ImportBus ), PartImportBus.class ),
|
||||
|
||||
ExportBus( 260, AEFeature.ExportBus, PartExportBus.class ),
|
||||
ExportBus( 260, EnumSet.of( AEFeature.ExportBus ), PartExportBus.class ),
|
||||
|
||||
LevelEmitter( 280, AEFeature.LevelEmitter, PartLevelEmitter.class ),
|
||||
LevelEmitter( 280, EnumSet.of( AEFeature.LevelEmitter ), PartLevelEmitter.class ),
|
||||
|
||||
AnnihilationPlane( 300, AEFeature.AnnihilationPlane, PartAnnihilationPlane.class ),
|
||||
AnnihilationPlane( 300, EnumSet.of( AEFeature.AnnihilationPlane ), PartAnnihilationPlane.class ),
|
||||
|
||||
FormationPlane( 320, AEFeature.FormationPlane, PartFormationPlane.class ),
|
||||
FormationPlane( 320, EnumSet.of( AEFeature.FormationPlane ), PartFormationPlane.class ),
|
||||
|
||||
PatternTerminal( 340, AEFeature.Patterns, PartPatternTerminal.class ),
|
||||
PatternTerminal( 340, EnumSet.of( AEFeature.Patterns ), PartPatternTerminal.class ),
|
||||
|
||||
CraftingTerminal( 360, AEFeature.CraftingTerminal, PartCraftingTerminal.class ),
|
||||
CraftingTerminal( 360, EnumSet.of( AEFeature.CraftingTerminal ), PartCraftingTerminal.class ),
|
||||
|
||||
Terminal( 380, AEFeature.Core, PartTerminal.class ),
|
||||
Terminal( 380, EnumSet.of( AEFeature.Core ), PartTerminal.class ),
|
||||
|
||||
StorageMonitor( 400, AEFeature.StorageMonitor, PartStorageMonitor.class ),
|
||||
StorageMonitor( 400, EnumSet.of( AEFeature.StorageMonitor ), PartStorageMonitor.class ),
|
||||
|
||||
ConversionMonitor( 420, AEFeature.PartConversionMonitor, PartConversionMonitor.class ),
|
||||
ConversionMonitor( 420, EnumSet.of( AEFeature.PartConversionMonitor ), PartConversionMonitor.class ),
|
||||
|
||||
Interface( 440, AEFeature.Core, PartInterface.class ),
|
||||
Interface( 440, EnumSet.of( AEFeature.Core ), PartInterface.class ),
|
||||
|
||||
P2PTunnelME( 460, AEFeature.P2PTunnelME, PartP2PTunnelME.class, GuiText.METunnel ),
|
||||
P2PTunnelME( 460, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelME ), PartP2PTunnelME.class, GuiText.METunnel ),
|
||||
|
||||
P2PTunnelRedstone( 461, AEFeature.P2PTunnelRedstone, PartP2PRedstone.class, GuiText.RedstoneTunnel ),
|
||||
P2PTunnelRedstone( 461, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRedstone ), PartP2PRedstone.class, GuiText.RedstoneTunnel ),
|
||||
|
||||
P2PTunnelItems( 462, AEFeature.P2PTunnelItems, PartP2PItems.class, GuiText.ItemTunnel ),
|
||||
P2PTunnelItems( 462, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelItems ), PartP2PItems.class, GuiText.ItemTunnel ),
|
||||
|
||||
P2PTunnelLiquids( 463, AEFeature.P2PTunnelLiquids, PartP2PLiquids.class, GuiText.FluidTunnel ),
|
||||
P2PTunnelLiquids( 463, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLiquids ), PartP2PLiquids.class, GuiText.FluidTunnel ),
|
||||
|
||||
P2PTunnelEU( 465, AEFeature.P2PTunnelEU, PartP2PIC2Power.class, GuiText.EUTunnel ),
|
||||
P2PTunnelEU( 465, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelEU ), PartP2PIC2Power.class, GuiText.EUTunnel ),
|
||||
|
||||
P2PTunnelRF( 466, AEFeature.P2PTunnelRF, PartP2PRFPower.class, GuiText.RFTunnel ),
|
||||
P2PTunnelRF( 466, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRF ), PartP2PRFPower.class, GuiText.RFTunnel ),
|
||||
|
||||
P2PTunnelLight( 467, AEFeature.P2PTunnelLight, PartP2PLight.class, GuiText.LightTunnel ),
|
||||
P2PTunnelLight( 467, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLight ), PartP2PLight.class, GuiText.LightTunnel ),
|
||||
|
||||
InterfaceTerminal( 480, AEFeature.InterfaceTerminal, PartInterfaceTerminal.class );
|
||||
InterfaceTerminal( 480, EnumSet.of( AEFeature.InterfaceTerminal ), PartInterfaceTerminal.class );
|
||||
|
||||
public final int baseDamage;
|
||||
private final EnumSet<AEFeature> features;
|
||||
private final Class<? extends IPart> myPart;
|
||||
private final GuiText extraName;
|
||||
public final int baseDamage;
|
||||
|
||||
public Constructor<? extends IPart> constructor;
|
||||
|
||||
PartType( int baseMetaValue, AEFeature part, Class<? extends IPart> c )
|
||||
PartType( int baseMetaValue, EnumSet<AEFeature> features, Class<? extends IPart> c )
|
||||
{
|
||||
this( baseMetaValue, part, c, null );
|
||||
this( baseMetaValue, features, c, null );
|
||||
}
|
||||
|
||||
PartType( int baseMetaValue, AEFeature part, Class<? extends IPart> c, GuiText en )
|
||||
PartType( int baseMetaValue, EnumSet<AEFeature> features, Class<? extends IPart> c, GuiText en )
|
||||
{
|
||||
this.features = EnumSet.of( part );
|
||||
this.features = features;
|
||||
this.myPart = c;
|
||||
this.extraName = en;
|
||||
this.baseDamage = baseMetaValue;
|
||||
}
|
||||
|
||||
public Enum<AEColor>[] getVariants()
|
||||
public boolean isCable()
|
||||
{
|
||||
if ( this == CableSmart || this == CableCovered || this == CableGlass || this == CableDense )
|
||||
return AEColor.values();
|
||||
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
|
||||
public EnumSet<AEFeature> getFeature()
|
||||
|
||||
Reference in New Issue
Block a user