2014-11-14 12:02:52 +01:00
|
|
|
/*
|
|
|
|
* 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>.
|
|
|
|
*/
|
|
|
|
|
2014-09-24 02:26:27 +02:00
|
|
|
package appeng.items.parts;
|
|
|
|
|
2014-12-21 19:08:05 +01:00
|
|
|
|
2014-09-24 02:26:27 +02:00
|
|
|
import java.lang.reflect.Constructor;
|
|
|
|
import java.util.EnumSet;
|
|
|
|
|
|
|
|
import appeng.api.parts.IPart;
|
|
|
|
import appeng.core.features.AEFeature;
|
|
|
|
import appeng.core.localization.GuiText;
|
|
|
|
import appeng.parts.automation.PartAnnihilationPlane;
|
|
|
|
import appeng.parts.automation.PartExportBus;
|
|
|
|
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;
|
|
|
|
import appeng.parts.networking.PartDenseCable;
|
|
|
|
import appeng.parts.networking.PartQuartzFiber;
|
|
|
|
import appeng.parts.p2p.PartP2PIC2Power;
|
|
|
|
import appeng.parts.p2p.PartP2PItems;
|
|
|
|
import appeng.parts.p2p.PartP2PLight;
|
|
|
|
import appeng.parts.p2p.PartP2PLiquids;
|
|
|
|
import appeng.parts.p2p.PartP2PRFPower;
|
|
|
|
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;
|
|
|
|
|
2014-12-21 19:08:05 +01:00
|
|
|
|
2014-09-24 02:26:27 +02:00
|
|
|
public enum PartType
|
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
InvalidType( -1, EnumSet.of( AEFeature.Core ), null ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
CableGlass( 0, EnumSet.of( AEFeature.Core ), PartCableGlass.class )
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public boolean isCable()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
},
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
CableCovered( 20, EnumSet.of( AEFeature.Core ), PartCableCovered.class )
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public boolean isCable()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
},
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
CableSmart( 40, EnumSet.of( AEFeature.Channels ), PartCableSmart.class )
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public boolean isCable()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
},
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
CableDense( 60, EnumSet.of( AEFeature.Channels ), PartDenseCable.class )
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public boolean isCable()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
},
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
ToggleBus( 80, EnumSet.of( AEFeature.Core ), PartToggleBus.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
InvertedToggleBus( 100, EnumSet.of( AEFeature.Core ), PartInvertedToggleBus.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
CableAnchor( 120, EnumSet.of( AEFeature.Core ), PartCableAnchor.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
QuartzFiber( 140, EnumSet.of( AEFeature.Core ), PartQuartzFiber.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
Monitor( 160, EnumSet.of( AEFeature.Core ), PartMonitor.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
SemiDarkMonitor( 180, EnumSet.of( AEFeature.Core ), PartSemiDarkMonitor.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
DarkMonitor( 200, EnumSet.of( AEFeature.Core ), PartDarkMonitor.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
StorageBus( 220, EnumSet.of( AEFeature.StorageBus ), PartStorageBus.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
ImportBus( 240, EnumSet.of( AEFeature.ImportBus ), PartImportBus.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
ExportBus( 260, EnumSet.of( AEFeature.ExportBus ), PartExportBus.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
LevelEmitter( 280, EnumSet.of( AEFeature.LevelEmitter ), PartLevelEmitter.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
AnnihilationPlane( 300, EnumSet.of( AEFeature.AnnihilationPlane ), PartAnnihilationPlane.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
FormationPlane( 320, EnumSet.of( AEFeature.FormationPlane ), PartFormationPlane.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
PatternTerminal( 340, EnumSet.of( AEFeature.Patterns ), PartPatternTerminal.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
CraftingTerminal( 360, EnumSet.of( AEFeature.CraftingTerminal ), PartCraftingTerminal.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
Terminal( 380, EnumSet.of( AEFeature.Core ), PartTerminal.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
StorageMonitor( 400, EnumSet.of( AEFeature.StorageMonitor ), PartStorageMonitor.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
ConversionMonitor( 420, EnumSet.of( AEFeature.PartConversionMonitor ), PartConversionMonitor.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
Interface( 440, EnumSet.of( AEFeature.Core ), PartInterface.class ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
P2PTunnelME( 460, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelME ), PartP2PTunnelME.class, GuiText.METunnel ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
P2PTunnelRedstone( 461, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRedstone ), PartP2PRedstone.class, GuiText.RedstoneTunnel ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
P2PTunnelItems( 462, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelItems ), PartP2PItems.class, GuiText.ItemTunnel ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
P2PTunnelLiquids( 463, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLiquids ), PartP2PLiquids.class, GuiText.FluidTunnel ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
P2PTunnelEU( 465, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelEU ), PartP2PIC2Power.class, GuiText.EUTunnel ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
P2PTunnelRF( 466, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRF ), PartP2PRFPower.class, GuiText.RFTunnel ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
P2PTunnelLight( 467, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLight ), PartP2PLight.class, GuiText.LightTunnel ),
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
InterfaceTerminal( 480, EnumSet.of( AEFeature.InterfaceTerminal ), PartInterfaceTerminal.class );
|
2014-09-24 02:26:27 +02:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
public final int baseDamage;
|
2014-09-24 02:26:27 +02:00
|
|
|
private final EnumSet<AEFeature> features;
|
|
|
|
private final Class<? extends IPart> myPart;
|
|
|
|
private final GuiText extraName;
|
|
|
|
public Constructor<? extends IPart> constructor;
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
PartType( int baseMetaValue, EnumSet<AEFeature> features, Class<? extends IPart> c )
|
2014-12-21 19:08:05 +01:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
this( baseMetaValue, features, c, null );
|
2014-09-24 02:26:27 +02:00
|
|
|
}
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
PartType( int baseMetaValue, EnumSet<AEFeature> features, Class<? extends IPart> c, GuiText en )
|
2014-12-21 19:08:05 +01:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
this.features = features;
|
2014-12-29 15:13:47 +01:00
|
|
|
this.myPart = c;
|
|
|
|
this.extraName = en;
|
|
|
|
this.baseDamage = baseMetaValue;
|
2014-09-24 02:26:27 +02:00
|
|
|
}
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
public boolean isCable()
|
2014-09-24 02:26:27 +02:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
return false;
|
2014-09-24 02:26:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public EnumSet<AEFeature> getFeature()
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
return this.features;
|
2014-09-24 02:26:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public Class<? extends IPart> getPart()
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
return this.myPart;
|
2014-09-24 02:26:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public GuiText getExtraName()
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
return this.extraName;
|
2014-09-24 02:26:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|