Applied-Energistics-2-tiler.../items/parts/PartType.java

153 lines
5 KiB
Java
Raw Normal View History

package appeng.items.parts;
2014-08-28 10:37:43 +02:00
import java.lang.reflect.Constructor;
import java.util.EnumSet;
import appeng.api.parts.IPart;
import appeng.api.util.AEColor;
import appeng.core.features.AEFeature;
2014-01-31 18:32:30 +01:00
import appeng.core.localization.GuiText;
2014-02-14 05:27:15 +01:00
import appeng.parts.automation.PartAnnihilationPlane;
import appeng.parts.automation.PartExportBus;
2014-02-18 06:51:31 +01:00
import appeng.parts.automation.PartFormationPlane;
import appeng.parts.automation.PartImportBus;
import appeng.parts.automation.PartLevelEmitter;
import appeng.parts.misc.PartCableAnchor;
import appeng.parts.misc.PartInterface;
import appeng.parts.misc.PartInvertedToggleBus;
import appeng.parts.misc.PartStorageBus;
import appeng.parts.misc.PartToggleBus;
import appeng.parts.networking.PartCableCovered;
import appeng.parts.networking.PartCableGlass;
import appeng.parts.networking.PartCableSmart;
2014-01-20 17:41:37 +01:00
import appeng.parts.networking.PartDenseCable;
import appeng.parts.networking.PartQuartzFiber;
2014-02-18 04:41:19 +01:00
import appeng.parts.p2p.PartP2PBCPower;
import appeng.parts.p2p.PartP2PIC2Power;
2014-01-20 17:41:37 +01:00
import appeng.parts.p2p.PartP2PItems;
2014-07-15 09:25:03 +02:00
import appeng.parts.p2p.PartP2PLight;
2014-01-20 17:41:37 +01:00
import appeng.parts.p2p.PartP2PLiquids;
import appeng.parts.p2p.PartP2PRFPower;
2014-01-20 17:41:37 +01:00
import appeng.parts.p2p.PartP2PRedstone;
import appeng.parts.p2p.PartP2PTunnelME;
import appeng.parts.reporting.PartConversionMonitor;
import appeng.parts.reporting.PartCraftingTerminal;
import appeng.parts.reporting.PartDarkMonitor;
import appeng.parts.reporting.PartInterfaceTerminal;
import appeng.parts.reporting.PartMonitor;
import appeng.parts.reporting.PartPatternTerminal;
import appeng.parts.reporting.PartSemiDarkMonitor;
import appeng.parts.reporting.PartStorageMonitor;
import appeng.parts.reporting.PartTerminal;
public enum PartType
{
InvalidType(-1, AEFeature.Core, null),
CableGlass(0, AEFeature.Core, PartCableGlass.class),
CableCovered(20, AEFeature.Core, PartCableCovered.class),
2014-08-25 07:04:26 +02:00
CableSmart(40, AEFeature.Channels, PartCableSmart.class),
2014-08-25 07:04:26 +02:00
CableDense(60, AEFeature.Channels, PartDenseCable.class),
2014-01-20 17:41:37 +01:00
ToggleBus(80, AEFeature.Core, PartToggleBus.class),
InvertedToggleBus(100, AEFeature.Core, PartInvertedToggleBus.class),
CableAnchor(120, AEFeature.Core, PartCableAnchor.class),
QuartzFiber(140, AEFeature.Core, PartQuartzFiber.class),
Monitor(160, AEFeature.Core, PartMonitor.class),
SemiDarkMonitor(180, AEFeature.Core, PartSemiDarkMonitor.class),
DarkMonitor(200, AEFeature.Core, PartDarkMonitor.class),
StorageBus(220, AEFeature.StorageBus, PartStorageBus.class),
ImportBus(240, AEFeature.ImportBus, PartImportBus.class),
ExportBus(260, AEFeature.ExportBus, PartExportBus.class),
2014-09-20 23:34:39 +02:00
LevelEmitter(280, AEFeature.LevelEmitter, PartLevelEmitter.class),
AnnihilationPlane(300, AEFeature.AnnihilationPlane, PartAnnihilationPlane.class),
2014-01-20 17:41:37 +01:00
FormationPlane(320, AEFeature.FormationPlane, PartFormationPlane.class),
2014-01-20 17:41:37 +01:00
PatternTerminal(340, AEFeature.Patterns, PartPatternTerminal.class),
2014-01-20 17:41:37 +01:00
CraftingTerminal(360, AEFeature.CraftingTerminal, PartCraftingTerminal.class),
2014-01-20 17:41:37 +01:00
Terminal(380, AEFeature.Core, PartTerminal.class),
StorageMonitor(400, AEFeature.StorageMonitor, PartStorageMonitor.class),
ConversionMonitor(420, AEFeature.PartConversionMonitor, PartConversionMonitor.class),
Interface(440, AEFeature.Core, PartInterface.class),
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),
2014-07-15 09:25:03 +02:00
P2PTunnelLight(467, AEFeature.P2PTunnelLight, PartP2PLight.class, GuiText.LightTunnel),
InterfaceTerminal(480, AEFeature.InterfaceTerminal, PartInterfaceTerminal.class);
2014-01-31 18:32:30 +01:00
private final EnumSet<AEFeature> features;
private final Class<? extends IPart> myPart;
private final GuiText extraName;
public final int baseDamage;
2014-08-28 10:37:43 +02:00
public Constructor<? extends IPart> constructor;
PartType(int baseMetaValue, AEFeature part, Class<? extends IPart> c) {
this( baseMetaValue, part, c, null );
2014-01-31 18:32:30 +01:00
}
PartType(int baseMetaValue, AEFeature part, Class<? extends IPart> c, GuiText en) {
features = EnumSet.of( part );
myPart = c;
2014-01-31 18:32:30 +01:00
extraName = en;
baseDamage = baseMetaValue;
}
public Enum[] getVarients()
{
if ( this == CableSmart || this == CableCovered || this == CableGlass || this == CableDense )
return AEColor.values();
return null;
}
public EnumSet<AEFeature> getFeature()
{
return features;
}
public Class<? extends IPart> getPart()
{
return myPart;
}
2014-01-31 18:32:30 +01:00
public GuiText getExtraName()
{
return extraName;
}
}