Refactored AEConfig (#2633)
Added a singleton getter instead the public field. Reduced all fields to private. Replaced field access with getters. Added setters where necessary (Dimension/Biome Registration) Added config options to disable more features. Splitted Enum name from the config key. Changed FacadeConfig and Networkhandler similar to AEConfig.init().
This commit is contained in:
@@ -172,10 +172,10 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
|
||||
for( final AEFeature f : mat.getFeature() )
|
||||
{
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
enabled = enabled && AEConfig.instance().isFeatureEnabled( f );
|
||||
}
|
||||
|
||||
mat.setStackSrc( new MaterialStackSrc( mat ) );
|
||||
mat.setStackSrc( new MaterialStackSrc( mat, enabled ) );
|
||||
|
||||
if( enabled )
|
||||
{
|
||||
@@ -228,7 +228,7 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
}
|
||||
}
|
||||
|
||||
if( replacement == null || AEConfig.instance.useAEVersion( mt ) )
|
||||
if( replacement == null || AEConfig.instance().useAEVersion( mt ) )
|
||||
{
|
||||
// continue using the AE2 item.
|
||||
for( final String name : names )
|
||||
@@ -339,7 +339,8 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
|
||||
try
|
||||
{
|
||||
eqi = droppedEntity.getConstructor( World.class, double.class, double.class, double.class, ItemStack.class ).newInstance( w, location.posX, location.posY, location.posZ, itemstack );
|
||||
eqi = droppedEntity.getConstructor( World.class, double.class, double.class, double.class, ItemStack.class ).newInstance( w, location.posX,
|
||||
location.posY, location.posZ, itemstack );
|
||||
}
|
||||
catch( final Throwable t )
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.items.materials;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -38,85 +39,85 @@ import appeng.entity.EntitySingularity;
|
||||
|
||||
public enum MaterialType
|
||||
{
|
||||
InvalidType( -1, "material_invalid_type", AEFeature.Core ),
|
||||
InvalidType( -1, "material_invalid_type" ),
|
||||
|
||||
CertusQuartzCrystal( 0, "material_certus_quartz_crystal", AEFeature.Core, "crystalCertusQuartz" ),
|
||||
CertusQuartzCrystalCharged( 1, "material_certus_quartz_crystal_charged", AEFeature.Core, EntityChargedQuartz.class ),
|
||||
CertusQuartzCrystal( 0, "material_certus_quartz_crystal", EnumSet.of( AEFeature.CERTUS ), "crystalCertusQuartz" ),
|
||||
CertusQuartzCrystalCharged( 1, "material_certus_quartz_crystal_charged", EnumSet.of( AEFeature.CERTUS ), EntityChargedQuartz.class ),
|
||||
|
||||
CertusQuartzDust( 2, "material_certus_quartz_dust", AEFeature.Core, "dustCertusQuartz" ),
|
||||
NetherQuartzDust( 3, "material_nether_quartz_dust", AEFeature.Core, "dustNetherQuartz" ),
|
||||
Flour( 4, "material_flour", AEFeature.Flour, "dustWheat" ),
|
||||
GoldDust( 51, "material_gold_dust", AEFeature.Core, "dustGold" ),
|
||||
IronDust( 49, "material_iron_dust", AEFeature.Core, "dustIron" ),
|
||||
IronNugget( 50, "material_iron_nugget", AEFeature.Core, "nuggetIron" ),
|
||||
CertusQuartzDust( 2, "material_certus_quartz_dust", EnumSet.of( AEFeature.DUSTS, AEFeature.CERTUS ), "dustCertusQuartz" ),
|
||||
NetherQuartzDust( 3, "material_nether_quartz_dust", EnumSet.of( AEFeature.DUSTS ), "dustNetherQuartz" ),
|
||||
Flour( 4, "material_flour", EnumSet.of( AEFeature.FLOUR ), "dustWheat" ),
|
||||
GoldDust( 51, "material_gold_dust", EnumSet.of( AEFeature.DUSTS ), "dustGold" ),
|
||||
IronDust( 49, "material_iron_dust", EnumSet.of( AEFeature.DUSTS ), "dustIron" ),
|
||||
IronNugget( 50, "material_iron_nugget", EnumSet.of( AEFeature.NUGGETS ), "nuggetIron" ),
|
||||
|
||||
Silicon( 5, "material_silicon", AEFeature.Core, "itemSilicon" ),
|
||||
MatterBall( 6, "material_matter_ball" ),
|
||||
Silicon( 5, "material_silicon", EnumSet.of( AEFeature.SILICON ), "itemSilicon" ),
|
||||
MatterBall( 6, "material_matter_ball", EnumSet.of( AEFeature.MATTER_BALL ) ),
|
||||
|
||||
FluixCrystal( 7, "material_fluix_crystal", AEFeature.Core, "crystalFluix" ),
|
||||
FluixDust( 8, "material_fluix_dust", AEFeature.Core, "dustFluix" ),
|
||||
FluixPearl( 9, "material_fluix_pearl", AEFeature.Core, "pearlFluix" ),
|
||||
FluixCrystal( 7, "material_fluix_crystal", EnumSet.of( AEFeature.FLUIX ), "crystalFluix" ),
|
||||
FluixDust( 8, "material_fluix_dust", EnumSet.of( AEFeature.FLUIX, AEFeature.DUSTS ), "dustFluix" ),
|
||||
FluixPearl( 9, "material_fluix_pearl", EnumSet.of( AEFeature.FLUIX ), "pearlFluix" ),
|
||||
|
||||
PurifiedCertusQuartzCrystal( 10, "material_purified_certus_quartz_crystal" ),
|
||||
PurifiedNetherQuartzCrystal( 11, "material_purified_nether_quartz_crystal" ),
|
||||
PurifiedFluixCrystal( 12, "material_purified_fluix_crystal" ),
|
||||
PurifiedCertusQuartzCrystal( 10, "material_purified_certus_quartz_crystal", EnumSet.of( AEFeature.CERTUS, AEFeature.PURE_CRYSTALS ) ),
|
||||
PurifiedNetherQuartzCrystal( 11, "material_purified_nether_quartz_crystal", EnumSet.of( AEFeature.PURE_CRYSTALS ) ),
|
||||
PurifiedFluixCrystal( 12, "material_purified_fluix_crystal", EnumSet.of( AEFeature.FLUIX, AEFeature.PURE_CRYSTALS ) ),
|
||||
|
||||
CalcProcessorPress( 13, "material_calc_processor_press" ),
|
||||
EngProcessorPress( 14, "material_eng_processor_press" ),
|
||||
LogicProcessorPress( 15, "material_logic_processor_press" ),
|
||||
CalcProcessorPress( 13, "material_calc_processor_press", EnumSet.of( AEFeature.PRESSES ) ),
|
||||
EngProcessorPress( 14, "material_eng_processor_press", EnumSet.of( AEFeature.PRESSES ) ),
|
||||
LogicProcessorPress( 15, "material_logic_processor_press", EnumSet.of( AEFeature.PRESSES ) ),
|
||||
|
||||
CalcProcessorPrint( 16, "material_calc_processor_print" ),
|
||||
EngProcessorPrint( 17, "material_eng_processor_print" ),
|
||||
LogicProcessorPrint( 18, "material_logic_processor_print" ),
|
||||
CalcProcessorPrint( 16, "material_calc_processor_print", EnumSet.of( AEFeature.PRINTED_CIRCUITS ) ),
|
||||
EngProcessorPrint( 17, "material_eng_processor_print", EnumSet.of( AEFeature.PRINTED_CIRCUITS ) ),
|
||||
LogicProcessorPrint( 18, "material_logic_processor_print", EnumSet.of( AEFeature.PRINTED_CIRCUITS ) ),
|
||||
|
||||
SiliconPress( 19, "material_silicon_press" ),
|
||||
SiliconPrint( 20, "material_silicon_print" ),
|
||||
SiliconPress( 19, "material_silicon_press", EnumSet.of( AEFeature.PRESSES ) ),
|
||||
SiliconPrint( 20, "material_silicon_print", EnumSet.of( AEFeature.PRINTED_CIRCUITS ) ),
|
||||
|
||||
NamePress( 21, "material_name_press" ),
|
||||
NamePress( 21, "material_name_press", EnumSet.of( AEFeature.PRESSES ) ),
|
||||
|
||||
LogicProcessor( 22, "material_logic_processor" ),
|
||||
CalcProcessor( 23, "material_calc_processor" ),
|
||||
EngProcessor( 24, "material_eng_processor" ),
|
||||
LogicProcessor( 22, "material_logic_processor", EnumSet.of( AEFeature.PROCESSORS ) ),
|
||||
CalcProcessor( 23, "material_calc_processor", EnumSet.of( AEFeature.PROCESSORS ) ),
|
||||
EngProcessor( 24, "material_eng_processor", EnumSet.of( AEFeature.PROCESSORS ) ),
|
||||
|
||||
// Basic Cards
|
||||
BasicCard( 25, "material_basic_card" ),
|
||||
CardRedstone( 26, "material_card_redstone" ),
|
||||
CardCapacity( 27, "material_card_capacity" ),
|
||||
BasicCard( 25, "material_basic_card", EnumSet.of( AEFeature.BASIC_CARDS ) ),
|
||||
CardRedstone( 26, "material_card_redstone", EnumSet.of( AEFeature.BASIC_CARDS ) ),
|
||||
CardCapacity( 27, "material_card_capacity", EnumSet.of( AEFeature.BASIC_CARDS ) ),
|
||||
|
||||
// Adv Cards
|
||||
AdvCard( 28, "material_adv_card" ),
|
||||
CardFuzzy( 29, "material_card_fuzzy" ),
|
||||
CardSpeed( 30, "material_card_speed" ),
|
||||
CardInverter( 31, "material_card_inverter" ),
|
||||
AdvCard( 28, "material_adv_card", EnumSet.of( AEFeature.ADVANCED_CARDS ) ),
|
||||
CardFuzzy( 29, "material_card_fuzzy", EnumSet.of( AEFeature.ADVANCED_CARDS ) ),
|
||||
CardSpeed( 30, "material_card_speed", EnumSet.of( AEFeature.ADVANCED_CARDS ) ),
|
||||
CardInverter( 31, "material_card_inverter", EnumSet.of( AEFeature.ADVANCED_CARDS ) ),
|
||||
|
||||
Cell2SpatialPart( 32, "material_cell2_spatial_part", AEFeature.SpatialIO ),
|
||||
Cell16SpatialPart( 33, "material_cell16_spatial_part", AEFeature.SpatialIO ),
|
||||
Cell128SpatialPart( 34, "material_cell128_spatial_part", AEFeature.SpatialIO ),
|
||||
Cell2SpatialPart( 32, "material_cell2_spatial_part", EnumSet.of( AEFeature.SPATIAL_IO ) ),
|
||||
Cell16SpatialPart( 33, "material_cell16_spatial_part", EnumSet.of( AEFeature.SPATIAL_IO ) ),
|
||||
Cell128SpatialPart( 34, "material_cell128_spatial_part", EnumSet.of( AEFeature.SPATIAL_IO ) ),
|
||||
|
||||
Cell1kPart( 35, "material_cell1k_part", AEFeature.StorageCells ),
|
||||
Cell4kPart( 36, "material_cell4k_part", AEFeature.StorageCells ),
|
||||
Cell16kPart( 37, "material_cell16k_part", AEFeature.StorageCells ),
|
||||
Cell64kPart( 38, "material_cell64k_part", AEFeature.StorageCells ),
|
||||
EmptyStorageCell( 39, "material_empty_storage_cell", AEFeature.StorageCells ),
|
||||
Cell1kPart( 35, "material_cell1k_part", EnumSet.of( AEFeature.STORAGE_CELLS ) ),
|
||||
Cell4kPart( 36, "material_cell4k_part", EnumSet.of( AEFeature.STORAGE_CELLS ) ),
|
||||
Cell16kPart( 37, "material_cell16k_part", EnumSet.of( AEFeature.STORAGE_CELLS ) ),
|
||||
Cell64kPart( 38, "material_cell64k_part", EnumSet.of( AEFeature.STORAGE_CELLS ) ),
|
||||
EmptyStorageCell( 39, "material_empty_storage_cell", EnumSet.of( AEFeature.STORAGE_CELLS ) ),
|
||||
|
||||
WoodenGear( 40, "material_wooden_gear", AEFeature.GrindStone, "gearWood" ),
|
||||
WoodenGear( 40, "material_wooden_gear", EnumSet.of( AEFeature.GRIND_STONE ), "gearWood" ),
|
||||
|
||||
Wireless( 41, "material_wireless", AEFeature.WirelessAccessTerminal ),
|
||||
WirelessBooster( 42, "material_wireless_booster", AEFeature.WirelessAccessTerminal ),
|
||||
Wireless( 41, "material_wireless", EnumSet.of( AEFeature.WIRELESS_ACCESS_TERMINAL ) ),
|
||||
WirelessBooster( 42, "material_wireless_booster", EnumSet.of( AEFeature.WIRELESS_ACCESS_TERMINAL ) ),
|
||||
|
||||
FormationCore( 43, "material_formation_core" ),
|
||||
AnnihilationCore( 44, "material_annihilation_core" ),
|
||||
FormationCore( 43, "material_formation_core", EnumSet.of( AEFeature.CORES ) ),
|
||||
AnnihilationCore( 44, "material_annihilation_core", EnumSet.of( AEFeature.CORES ) ),
|
||||
|
||||
SkyDust( 45, "material_sky_dust", AEFeature.Core ),
|
||||
SkyDust( 45, "material_sky_dust", EnumSet.of( AEFeature.DUSTS ) ),
|
||||
|
||||
EnderDust( 46, "material_ender_dust", AEFeature.QuantumNetworkBridge, "dustEnder,dustEnderPearl", EntitySingularity.class ),
|
||||
Singularity( 47, "material_singularity", AEFeature.QuantumNetworkBridge, EntitySingularity.class ),
|
||||
QESingularity( 48, "material_qesingularity", AEFeature.QuantumNetworkBridge, EntitySingularity.class ),
|
||||
EnderDust( 46, "material_ender_dust", EnumSet.of( AEFeature.QUANTUM_NETWORK_BRIDGE ), "dustEnder,dustEnderPearl", EntitySingularity.class ),
|
||||
Singularity( 47, "material_singularity", EnumSet.of( AEFeature.QUANTUM_NETWORK_BRIDGE ), EntitySingularity.class ),
|
||||
QESingularity( 48, "material_qesingularity", EnumSet.of( AEFeature.QUANTUM_NETWORK_BRIDGE ), EntitySingularity.class ),
|
||||
|
||||
BlankPattern( 52, "material_blank_pattern" ),
|
||||
CardCrafting( 53, "material_card_crafting" );
|
||||
BlankPattern( 52, "material_blank_pattern", EnumSet.of( AEFeature.PATTERNS ) ),
|
||||
CardCrafting( 53, "material_card_crafting", EnumSet.of( AEFeature.ADVANCED_CARDS, AEFeature.CRAFTING_CPU ) );
|
||||
|
||||
private final EnumSet<AEFeature> features;
|
||||
private final Set<AEFeature> features;
|
||||
private final ModelResourceLocation model;
|
||||
private Item itemInstance;
|
||||
private int damageValue;
|
||||
@@ -128,35 +129,37 @@ public enum MaterialType
|
||||
|
||||
MaterialType( final int metaValue, String modelName )
|
||||
{
|
||||
this( metaValue, modelName, AEFeature.Core );
|
||||
this( metaValue, modelName, EnumSet.of( AEFeature.CORE ) );
|
||||
}
|
||||
|
||||
MaterialType( final int metaValue, String modelName, final AEFeature part )
|
||||
MaterialType( final int metaValue, String modelName, final Set<AEFeature> features )
|
||||
{
|
||||
this.setDamageValue( metaValue );
|
||||
this.features = EnumSet.of( part );
|
||||
this.features = features;
|
||||
this.model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, modelName ), "inventory" );
|
||||
}
|
||||
|
||||
MaterialType( final int metaValue, String modelName, final AEFeature part, final Class<? extends Entity> c )
|
||||
MaterialType( final int metaValue, String modelName, final Set<AEFeature> features, final Class<? extends Entity> c )
|
||||
{
|
||||
this( metaValue, modelName, part );
|
||||
this( metaValue, modelName, features );
|
||||
this.droppedEntity = c;
|
||||
|
||||
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true );
|
||||
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4,
|
||||
true );
|
||||
}
|
||||
|
||||
MaterialType( final int metaValue, String modelName, final AEFeature part, final String oreDictionary, final Class<? extends Entity> c )
|
||||
MaterialType( final int metaValue, String modelName, final Set<AEFeature> features, final String oreDictionary, final Class<? extends Entity> c )
|
||||
{
|
||||
this( metaValue, modelName, part );
|
||||
this( metaValue, modelName, features );
|
||||
this.oreName = oreDictionary;
|
||||
this.droppedEntity = c;
|
||||
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true );
|
||||
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4,
|
||||
true );
|
||||
}
|
||||
|
||||
MaterialType( final int metaValue, String modelName, final AEFeature part, final String oreDictionary )
|
||||
MaterialType( final int metaValue, String modelName, final Set<AEFeature> features, final String oreDictionary )
|
||||
{
|
||||
this( metaValue, modelName, part );
|
||||
this( metaValue, modelName, features );
|
||||
this.oreName = oreDictionary;
|
||||
}
|
||||
|
||||
@@ -165,7 +168,7 @@ public enum MaterialType
|
||||
return new ItemStack( this.getItemInstance(), size, this.getDamageValue() );
|
||||
}
|
||||
|
||||
EnumSet<AEFeature> getFeature()
|
||||
Set<AEFeature> getFeature()
|
||||
{
|
||||
return this.features;
|
||||
}
|
||||
@@ -225,7 +228,8 @@ public enum MaterialType
|
||||
this.stackSrc = stackSrc;
|
||||
}
|
||||
|
||||
public ModelResourceLocation getModel() {
|
||||
public ModelResourceLocation getModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,9 +133,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
}
|
||||
|
||||
if( FacadeConfig.instance.hasChanged() )
|
||||
if( FacadeConfig.instance().hasChanged() )
|
||||
{
|
||||
FacadeConfig.instance.save();
|
||||
FacadeConfig.instance().save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,7 +183,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
final boolean defaultValue = ( b.isFullyOpaque( blockState ) && hasSimpleModel( blockState ) && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass;
|
||||
if( FacadeConfig.instance.checkEnabled( b, metadata, defaultValue ) )
|
||||
if( FacadeConfig.instance().checkEnabled( b, metadata, defaultValue ) )
|
||||
{
|
||||
if( returnItem )
|
||||
{
|
||||
|
||||
@@ -79,9 +79,9 @@ import appeng.util.Platform;
|
||||
|
||||
public enum PartType
|
||||
{
|
||||
InvalidType( -1, "invalid" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), null ),
|
||||
InvalidType( -1, "invalid", EnumSet.of( AEFeature.CORE ), EnumSet.noneOf( IntegrationType.class ), null ),
|
||||
|
||||
CableGlass( 0, "cable_glass" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartCableGlass.class )
|
||||
CableGlass( 0, "cable_glass", EnumSet.of( AEFeature.GLASS_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableGlass.class )
|
||||
{
|
||||
@Override
|
||||
public boolean isCable()
|
||||
@@ -95,11 +95,11 @@ public enum PartType
|
||||
{
|
||||
return Arrays.stream( AEColor.values() )
|
||||
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
|
||||
.collect( Collectors.toList());
|
||||
.collect( Collectors.toList() );
|
||||
}
|
||||
},
|
||||
|
||||
CableCovered( 20, "cable_covered" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartCableCovered.class )
|
||||
CableCovered( 20, "cable_covered", EnumSet.of( AEFeature.COVERED_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableCovered.class )
|
||||
{
|
||||
@Override
|
||||
public boolean isCable()
|
||||
@@ -113,11 +113,11 @@ public enum PartType
|
||||
{
|
||||
return Arrays.stream( AEColor.values() )
|
||||
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
|
||||
.collect( Collectors.toList());
|
||||
.collect( Collectors.toList() );
|
||||
}
|
||||
},
|
||||
|
||||
CableSmart( 40, "cable_smart" , EnumSet.of( AEFeature.Channels ), EnumSet.noneOf( IntegrationType.class ), PartCableSmart.class )
|
||||
CableSmart( 40, "cable_smart", EnumSet.of( AEFeature.CHANNELS, AEFeature.SMART_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableSmart.class )
|
||||
{
|
||||
@Override
|
||||
public boolean isCable()
|
||||
@@ -131,11 +131,11 @@ public enum PartType
|
||||
{
|
||||
return Arrays.stream( AEColor.values() )
|
||||
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
|
||||
.collect( Collectors.toList());
|
||||
.collect( Collectors.toList() );
|
||||
}
|
||||
},
|
||||
|
||||
CableDense( 60, "cable_dense" , EnumSet.of( AEFeature.Channels ), EnumSet.noneOf( IntegrationType.class ), PartDenseCable.class )
|
||||
CableDense( 60, "cable_dense", EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartDenseCable.class )
|
||||
{
|
||||
@Override
|
||||
public boolean isCable()
|
||||
@@ -149,51 +149,56 @@ public enum PartType
|
||||
{
|
||||
return Arrays.stream( AEColor.values() )
|
||||
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
|
||||
.collect( Collectors.toList());
|
||||
.collect( Collectors.toList() );
|
||||
}
|
||||
},
|
||||
|
||||
ToggleBus( 80, "toggle_bus" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartToggleBus.class ),
|
||||
ToggleBus( 80, "toggle_bus", EnumSet.of( AEFeature.TOGGLE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartToggleBus.class ),
|
||||
|
||||
InvertedToggleBus( 100, "inverted_toggle_bus" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartInvertedToggleBus.class ),
|
||||
InvertedToggleBus( 100, "inverted_toggle_bus", EnumSet.of( AEFeature.TOGGLE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartInvertedToggleBus.class ),
|
||||
|
||||
CableAnchor( 120, "cable_anchor" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartCableAnchor.class ),
|
||||
CableAnchor( 120, "cable_anchor", EnumSet.of( AEFeature.CABLE_ANCHOR ), EnumSet.noneOf( IntegrationType.class ), PartCableAnchor.class ),
|
||||
|
||||
QuartzFiber( 140, "quartz_fiber" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartQuartzFiber.class ),
|
||||
QuartzFiber( 140, "quartz_fiber", EnumSet.of( AEFeature.QUARTZ_FIBER ), EnumSet.noneOf( IntegrationType.class ), PartQuartzFiber.class ),
|
||||
|
||||
Monitor( 160, "monitor" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartPanel.class ),
|
||||
Monitor( 160, "monitor", EnumSet.of( AEFeature.PANELS ), EnumSet.noneOf( IntegrationType.class ), PartPanel.class ),
|
||||
|
||||
SemiDarkMonitor( 180, "semi_dark_monitor" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartSemiDarkPanel.class ),
|
||||
SemiDarkMonitor( 180, "semi_dark_monitor", EnumSet.of( AEFeature.PANELS ), EnumSet.noneOf( IntegrationType.class ), PartSemiDarkPanel.class ),
|
||||
|
||||
DarkMonitor( 200, "dark_monitor" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartDarkPanel.class ),
|
||||
DarkMonitor( 200, "dark_monitor", EnumSet.of( AEFeature.PANELS ), EnumSet.noneOf( IntegrationType.class ), PartDarkPanel.class ),
|
||||
|
||||
StorageBus( 220, "storage_bus" , EnumSet.of( AEFeature.StorageBus ), EnumSet.noneOf( IntegrationType.class ), PartStorageBus.class ),
|
||||
StorageBus( 220, "storage_bus", EnumSet.of( AEFeature.STORAGE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartStorageBus.class ),
|
||||
|
||||
ImportBus( 240, "import_bus" , EnumSet.of( AEFeature.ImportBus ), EnumSet.noneOf( IntegrationType.class ), PartImportBus.class ),
|
||||
ImportBus( 240, "import_bus", EnumSet.of( AEFeature.IMPORT_BUS ), EnumSet.noneOf( IntegrationType.class ), PartImportBus.class ),
|
||||
|
||||
ExportBus( 260, "export_bus" , EnumSet.of( AEFeature.ExportBus ), EnumSet.noneOf( IntegrationType.class ), PartExportBus.class ),
|
||||
ExportBus( 260, "export_bus", EnumSet.of( AEFeature.EXPORT_BUS ), EnumSet.noneOf( IntegrationType.class ), PartExportBus.class ),
|
||||
|
||||
LevelEmitter( 280, "level_emitter" , EnumSet.of( AEFeature.LevelEmitter ), EnumSet.noneOf( IntegrationType.class ), PartLevelEmitter.class ),
|
||||
LevelEmitter( 280, "level_emitter", EnumSet.of( AEFeature.LEVEL_EMITTER ), EnumSet.noneOf( IntegrationType.class ), PartLevelEmitter.class ),
|
||||
|
||||
AnnihilationPlane( 300, "annihilation_plane" , EnumSet.of( AEFeature.AnnihilationPlane ), EnumSet.noneOf( IntegrationType.class ), PartAnnihilationPlane.class ),
|
||||
AnnihilationPlane( 300, "annihilation_plane", EnumSet.of( AEFeature.ANNIHILATION_PLANE ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartAnnihilationPlane.class ),
|
||||
|
||||
IdentityAnnihilationPlane( 301, "identity_annihilation_plane" , EnumSet.of( AEFeature.AnnihilationPlane, AEFeature.IdentityAnnihilationPlane ), EnumSet.noneOf( IntegrationType.class ), PartIdentityAnnihilationPlane.class ),
|
||||
IdentityAnnihilationPlane( 301, "identity_annihilation_plane", EnumSet.of( AEFeature.ANNIHILATION_PLANE, AEFeature.IDENTITY_ANNIHILATION_PLANE ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartIdentityAnnihilationPlane.class ),
|
||||
|
||||
FormationPlane( 320, "formation_plane" , EnumSet.of( AEFeature.FormationPlane ), EnumSet.noneOf( IntegrationType.class ), PartFormationPlane.class ),
|
||||
FormationPlane( 320, "formation_plane", EnumSet.of( AEFeature.FORMATION_PLANE ), EnumSet.noneOf( IntegrationType.class ), PartFormationPlane.class ),
|
||||
|
||||
PatternTerminal( 340, "pattern_terminal" , EnumSet.of( AEFeature.Patterns ), EnumSet.noneOf( IntegrationType.class ), PartPatternTerminal.class ),
|
||||
PatternTerminal( 340, "pattern_terminal", EnumSet.of( AEFeature.PATTERNS ), EnumSet.noneOf( IntegrationType.class ), PartPatternTerminal.class ),
|
||||
|
||||
CraftingTerminal( 360, "crafting_terminal" , EnumSet.of( AEFeature.CraftingTerminal ), EnumSet.noneOf( IntegrationType.class ), PartCraftingTerminal.class ),
|
||||
CraftingTerminal( 360, "crafting_terminal", EnumSet.of( AEFeature.CRAFTING_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartCraftingTerminal.class ),
|
||||
|
||||
Terminal( 380, "terminal" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartTerminal.class ),
|
||||
Terminal( 380, "terminal", EnumSet.of( AEFeature.TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartTerminal.class ),
|
||||
|
||||
StorageMonitor( 400, "storage_monitor" , EnumSet.of( AEFeature.StorageMonitor ), EnumSet.noneOf( IntegrationType.class ), PartStorageMonitor.class ),
|
||||
StorageMonitor( 400, "storage_monitor", EnumSet.of( AEFeature.STORAGE_MONITOR ), EnumSet.noneOf( IntegrationType.class ), PartStorageMonitor.class ),
|
||||
|
||||
ConversionMonitor( 420, "conversion_monitor" , EnumSet.of( AEFeature.PartConversionMonitor ), EnumSet.noneOf( IntegrationType.class ), PartConversionMonitor.class ),
|
||||
ConversionMonitor( 420, "conversion_monitor", EnumSet.of( AEFeature.PART_CONVERSION_MONITOR ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartConversionMonitor.class ),
|
||||
|
||||
Interface( 440, "interface" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartInterface.class ),
|
||||
Interface( 440, "interface", EnumSet.of( AEFeature.INTERFACE ), EnumSet.noneOf( IntegrationType.class ), PartInterface.class ),
|
||||
|
||||
P2PTunnelME( 460, "p2p_tunnel_me" , EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelME ), EnumSet.noneOf( IntegrationType.class ), PartP2PTunnelME.class, GuiText.METunnel ) {
|
||||
P2PTunnelME( 460, "p2p_tunnel_me", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_ME ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartP2PTunnelME.class, GuiText.METunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
@@ -201,7 +206,9 @@ public enum PartType
|
||||
}
|
||||
},
|
||||
|
||||
P2PTunnelRedstone( 461, "p2p_tunnel_redstone" , EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRedstone ), EnumSet.noneOf( IntegrationType.class ), PartP2PRedstone.class, GuiText.RedstoneTunnel ) {
|
||||
P2PTunnelRedstone( 461, "p2p_tunnel_redstone", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_REDSTONE ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartP2PRedstone.class, GuiText.RedstoneTunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
@@ -209,7 +216,9 @@ public enum PartType
|
||||
}
|
||||
},
|
||||
|
||||
P2PTunnelItems( 462, "p2p_tunnel_items" , EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelItems ), EnumSet.noneOf( IntegrationType.class ), PartP2PItems.class, GuiText.ItemTunnel ) {
|
||||
P2PTunnelItems( 462, "p2p_tunnel_items", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_ITEMS ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartP2PItems.class, GuiText.ItemTunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
@@ -217,7 +226,9 @@ public enum PartType
|
||||
}
|
||||
},
|
||||
|
||||
P2PTunnelLiquids( 463, "p2p_tunnel_liquids" , EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLiquids ), EnumSet.noneOf( IntegrationType.class ), PartP2PLiquids.class, GuiText.FluidTunnel ) {
|
||||
P2PTunnelLiquids( 463, "p2p_tunnel_liquids", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_LIQUIDS ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartP2PLiquids.class, GuiText.FluidTunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
@@ -225,20 +236,22 @@ public enum PartType
|
||||
}
|
||||
},
|
||||
|
||||
P2PTunnelEU( 465, "p2p_tunnel_ic2", EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelEU ), EnumSet.of( IntegrationType.IC2 ),
|
||||
PartP2PIC2Power.class, GuiText.EUTunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
return "P2PTunnel";
|
||||
}
|
||||
},
|
||||
P2PTunnelEU( 465, "p2p_tunnel_ic2", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_EU ), EnumSet
|
||||
.of( IntegrationType.IC2 ), PartP2PIC2Power.class, GuiText.EUTunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
return "P2PTunnel";
|
||||
}
|
||||
},
|
||||
|
||||
// P2PTunnelRF( 466, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRF ), EnumSet.of( IntegrationType.RF ),
|
||||
// PartP2PRFPower.class, GuiText.RFTunnel ),
|
||||
|
||||
P2PTunnelLight( 467, "p2p_tunnel_light" , EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLight ), EnumSet.noneOf( IntegrationType.class ), PartP2PLight.class, GuiText.LightTunnel ) {
|
||||
P2PTunnelLight( 467, "p2p_tunnel_light", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_LIGHT ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartP2PLight.class, GuiText.LightTunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
@@ -249,7 +262,8 @@ public enum PartType
|
||||
// P2PTunnelOpenComputers( 468, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers ), EnumSet.of(
|
||||
// IntegrationType.OpenComputers ), PartP2POpenComputers.class, GuiText.OCTunnel ),
|
||||
|
||||
InterfaceTerminal( 480, "interface_terminal" , EnumSet.of( AEFeature.InterfaceTerminal ), EnumSet.noneOf( IntegrationType.class ), PartInterfaceTerminal.class );
|
||||
InterfaceTerminal( 480, "interface_terminal", EnumSet.of( AEFeature.INTERFACE_TERMINAL ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartInterfaceTerminal.class );
|
||||
|
||||
private final int baseDamage;
|
||||
private final Set<AEFeature> features;
|
||||
@@ -276,8 +290,8 @@ public enum PartType
|
||||
this.extraName = en;
|
||||
|
||||
// The part is enabled if all features + integrations it needs are enabled
|
||||
this.enabled = features.stream().allMatch( AEConfig.instance::isFeatureEnabled )
|
||||
&& integrations.stream().allMatch( IntegrationRegistry.INSTANCE::isEnabled );
|
||||
this.enabled = features.stream().allMatch( AEConfig.instance()::isFeatureEnabled ) && integrations.stream()
|
||||
.allMatch( IntegrationRegistry.INSTANCE::isEnabled );
|
||||
|
||||
if( enabled )
|
||||
{
|
||||
@@ -348,7 +362,8 @@ public enum PartType
|
||||
return this.myPart;
|
||||
}
|
||||
|
||||
String getUnlocalizedName() {
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
return name();
|
||||
}
|
||||
|
||||
@@ -378,5 +393,4 @@ public enum PartType
|
||||
return models;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -296,6 +296,6 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
@Override
|
||||
public boolean hasContainerItem( final ItemStack stack )
|
||||
{
|
||||
return AEConfig.instance.isFeatureEnabled( AEFeature.EnableDisassemblyCrafting );
|
||||
return AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench /
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketClick( pos, side, hitX, hitY, hitZ, hand ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketClick( pos, side, hitX, hitY, hitZ, hand ) );
|
||||
}
|
||||
|
||||
return EnumActionResult.SUCCESS;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ToolChargedStaff extends AEBasePoweredItem
|
||||
|
||||
public ToolChargedStaff()
|
||||
{
|
||||
super( AEConfig.instance.chargedStaffBattery );
|
||||
super( AEConfig.instance().getChargedStaffBattery() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -100,7 +100,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
|
||||
public ToolColorApplicator()
|
||||
{
|
||||
super( AEConfig.instance.colorApplicatorBattery );
|
||||
super( AEConfig.instance().getColorApplicatorBattery() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
|
||||
public ToolEntropyManipulator()
|
||||
{
|
||||
super( AEConfig.instance.entropyManipulatorBattery );
|
||||
super( AEConfig.instance().getEntropyManipulatorBattery() );
|
||||
|
||||
this.heatUp = new HashMap<InWorldToolOperationIngredient, InWorldToolOperationResult>();
|
||||
this.coolDown = new HashMap<InWorldToolOperationIngredient, InWorldToolOperationResult>();
|
||||
|
||||
@@ -84,7 +84,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
public ToolMatterCannon()
|
||||
{
|
||||
super( AEConfig.instance.matterCannonBattery );
|
||||
super( AEConfig.instance().getMatterCannonBattery() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -271,7 +271,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
|
||||
pos.entityHit.attackEntityFrom( DamageSource.causePlayerDamage( p ), 0 );
|
||||
NetworkHandler.instance.sendToAll( marker.getPacket() );
|
||||
NetworkHandler.instance().sendToAll( marker.getPacket() );
|
||||
}
|
||||
else if( pos.typeOfHit == RayTraceResult.Type.BLOCK )
|
||||
{
|
||||
@@ -401,7 +401,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
else if( pos.typeOfHit == RayTraceResult.Type.BLOCK )
|
||||
{
|
||||
if( !AEConfig.instance.isFeatureEnabled( AEFeature.MassCannonBlockDamage ) )
|
||||
if( !AEConfig.instance().isFeatureEnabled( AEFeature.MASS_CANNON_BLOCK_DAMAGE ) )
|
||||
{
|
||||
penetration = 0;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
{
|
||||
public ToolPortableCell()
|
||||
{
|
||||
super( AEConfig.instance.portableCellBattery );
|
||||
super( AEConfig.instance().getPortableCellBattery() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
|
||||
public ToolWirelessTerminal()
|
||||
{
|
||||
super( AEConfig.instance.wirelessTerminalBattery );
|
||||
super( AEConfig.instance().getWirelessTerminalBattery() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user