pick 97420a31d The big reformat of 2020

This commit is contained in:
yueh
2020-06-16 21:41:28 +02:00
parent 5304b3febe
commit 5225ea426b
2252 changed files with 95466 additions and 118582 deletions
+29 -38
View File
@@ -23,54 +23,45 @@
package appeng.api;
import java.lang.reflect.Field;
import appeng.api.exceptions.CoreInaccessibleException;
/**
* Entry point for api.
*/
public enum AEApi
{
;
public enum AEApi {
;
private static final String CORE_API_FQN = "appeng.core.Api";
private static final String CORE_API_FIELD = "INSTANCE";
private static final IAppEngApi HELD_API;
private static final String CORE_API_FQN = "appeng.core.Api";
private static final String CORE_API_FIELD = "INSTANCE";
private static final IAppEngApi HELD_API;
static
{
try
{
final Class<?> apiClass = Class.forName( CORE_API_FQN );
final Field apiField = apiClass.getField( CORE_API_FIELD );
static {
try {
final Class<?> apiClass = Class.forName(CORE_API_FQN);
final Field apiField = apiClass.getField(CORE_API_FIELD);
HELD_API = (IAppEngApi) apiField.get( apiClass );
}
catch( final ClassNotFoundException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FQN + " class, without it being declared." );
}
catch( final NoSuchFieldException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without it being declared." );
}
catch( final IllegalAccessException e )
{
throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without enough access permissions." );
}
}
HELD_API = (IAppEngApi) apiField.get(apiClass);
} catch (final ClassNotFoundException e) {
throw new CoreInaccessibleException(
"AE2 API tried to access the " + CORE_API_FQN + " class, without it being declared.");
} catch (final NoSuchFieldException e) {
throw new CoreInaccessibleException("AE2 API tried to access the " + CORE_API_FIELD + " field in "
+ CORE_API_FQN + " without it being declared.");
} catch (final IllegalAccessException e) {
throw new CoreInaccessibleException("AE2 API tried to access the " + CORE_API_FIELD + " field in "
+ CORE_API_FQN + " without enough access permissions.");
}
}
/**
* API Entry Point.
*
* @return the {@link IAppEngApi}
*/
public static IAppEngApi instance()
{
return HELD_API;
}
/**
* API Entry Point.
*
* @return the {@link IAppEngApi}
*/
public static IAppEngApi instance() {
return HELD_API;
}
}
+6 -7
View File
@@ -18,17 +18,16 @@
package appeng.api;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Marks interfaces that can be used as injectable constructor arguments for an {@link AEPlugin}.
* Marks interfaces that can be used as injectable constructor arguments for an
* {@link AEPlugin}.
*/
@Target( ElementType.TYPE )
@Retention( RetentionPolicy.RUNTIME )
public @interface AEInjectable
{}
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface AEInjectable {
}
+7 -9
View File
@@ -18,22 +18,20 @@
package appeng.api;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Use this annotation on a class in your Mod to have it instantiated during the initialization phase of Applied
* Energistics.
* AE expects your class to have a single constructor and can supply certain arguments to your constructor using
* Use this annotation on a class in your Mod to have it instantiated during the
* initialization phase of Applied Energistics. AE expects your class to have a
* single constructor and can supply certain arguments to your constructor using
* dependency injection.
*/
@Target( ElementType.TYPE )
@Retention( RetentionPolicy.RUNTIME )
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface AEPlugin
{}
public @interface AEPlugin {
}
+25 -28
View File
@@ -23,7 +23,6 @@
package appeng.api;
import appeng.api.definitions.IDefinitions;
import appeng.api.features.IRegistryContainer;
import appeng.api.networking.IGridHelper;
@@ -32,38 +31,36 @@ import appeng.api.parts.IPartHelper;
import appeng.api.storage.IStorageHelper;
import appeng.api.util.IClientHelper;
@AEInjectable
public interface IAppEngApi
{
/**
* @return Registry Container for the numerous registries in AE2.
*/
IRegistryContainer registries();
public interface IAppEngApi {
/**
* @return Registry Container for the numerous registries in AE2.
*/
IRegistryContainer registries();
/**
* @return A helper for working with storage data types.
*/
IStorageHelper storage();
/**
* @return A helper for working with storage data types.
*/
IStorageHelper storage();
/**
* @return A helper to create {@link IGridNode} and other grid related objects.
*/
IGridHelper grid();
/**
* @return A helper to create {@link IGridNode} and other grid related objects.
*/
IGridHelper grid();
/**
* @return A helper for working with grids, and buses.
*/
IPartHelper partHelper();
/**
* @return A helper for working with grids, and buses.
*/
IPartHelper partHelper();
/**
* @return An accessible list of all AE definitions
*/
IDefinitions definitions();
/**
* @return An accessible list of all AE definitions
*/
IDefinitions definitions();
/**
* @return Utility methods primarily useful for client side stuff
*/
IClientHelper client();
/**
* @return Utility methods primarily useful for client side stuff
*/
IClientHelper client();
}
@@ -23,51 +23,42 @@
package appeng.api.config;
public enum AccessRestriction {
NO_ACCESS(0), READ(1), WRITE(2), READ_WRITE(3);
public enum AccessRestriction
{
NO_ACCESS( 0 ), READ( 1 ), WRITE( 2 ), READ_WRITE( 3 );
private final int permissionBit;
private final int permissionBit;
AccessRestriction(final int v) {
this.permissionBit = v;
}
AccessRestriction( final int v )
{
this.permissionBit = v;
}
public boolean hasPermission(final AccessRestriction ar) {
return (this.permissionBit & ar.permissionBit) == ar.permissionBit;
}
public boolean hasPermission( final AccessRestriction ar )
{
return ( this.permissionBit & ar.permissionBit ) == ar.permissionBit;
}
public AccessRestriction restrictPermissions(final AccessRestriction ar) {
return this.getPermByBit(this.permissionBit & ar.permissionBit);
}
public AccessRestriction restrictPermissions( final AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit & ar.permissionBit );
}
private AccessRestriction getPermByBit(final int bit) {
switch (bit) {
default:
case 0:
return NO_ACCESS;
case 1:
return READ;
case 2:
return WRITE;
case 3:
return READ_WRITE;
}
}
private AccessRestriction getPermByBit( final int bit )
{
switch( bit )
{
default:
case 0:
return NO_ACCESS;
case 1:
return READ;
case 2:
return WRITE;
case 3:
return READ_WRITE;
}
}
public AccessRestriction addPermissions(final AccessRestriction ar) {
return this.getPermByBit(this.permissionBit | ar.permissionBit);
}
public AccessRestriction addPermissions( final AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit | ar.permissionBit );
}
public AccessRestriction removePermissions( final AccessRestriction ar )
{
return this.getPermByBit( this.permissionBit & ( ~ar.permissionBit ) );
}
public AccessRestriction removePermissions(final AccessRestriction ar) {
return this.getPermByBit(this.permissionBit & (~ar.permissionBit));
}
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum ActionItems
{
WRENCH, CLOSE, STASH, ENCODE, ENABLE_SUBSTITUTION, DISABLE_SUBSTITUTION
public enum ActionItems {
WRENCH, CLOSE, STASH, ENCODE, ENABLE_SUBSTITUTION, DISABLE_SUBSTITUTION
}
+16 -21
View File
@@ -23,31 +23,26 @@
package appeng.api.config;
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
public enum Actionable {
/**
* Perform the intended action.
*/
MODULATE(FluidAction.EXECUTE),
public enum Actionable
{
/**
* Perform the intended action.
*/
MODULATE( FluidAction.EXECUTE ),
/**
* Pretend to perform the action.
*/
SIMULATE(FluidAction.SIMULATE);
/**
* Pretend to perform the action.
*/
SIMULATE( FluidAction.SIMULATE );
private final FluidAction fluidAction;
private final FluidAction fluidAction;
Actionable(FluidAction fluidAction) {
this.fluidAction = fluidAction;
}
Actionable( FluidAction fluidAction )
{
this.fluidAction = fluidAction;
}
public FluidAction getFluidAction()
{
return fluidAction;
}
public FluidAction getFluidAction() {
return fluidAction;
}
}
@@ -23,16 +23,14 @@
package appeng.api.config;
public enum CondenserOutput {
public enum CondenserOutput
{
TRASH, // 0
TRASH, // 0
MATTER_BALLS, // 256
MATTER_BALLS, // 256
SINGULARITY; // 250,000
SINGULARITY; // 250,000
public int requiredPower = 0;
public int requiredPower = 0;
}
+2 -4
View File
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum CopyMode
{
CLEAR_ON_REMOVE, KEEP_ON_REMOVE
public enum CopyMode {
CLEAR_ON_REMOVE, KEEP_ON_REMOVE
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum FullnessMode
{
EMPTY, HALF, FULL
public enum FullnessMode {
EMPTY, HALF, FULL
}
+12 -20
View File
@@ -23,28 +23,20 @@
package appeng.api.config;
public enum FuzzyMode {
// Note that percentage damaged, is the inverse of percentage durability.
IGNORE_ALL(-1), PERCENT_99(0), PERCENT_75(25), PERCENT_50(50), PERCENT_25(75);
public enum FuzzyMode
{
// Note that percentage damaged, is the inverse of percentage durability.
IGNORE_ALL( -1 ),
PERCENT_99( 0 ),
PERCENT_75( 25 ),
PERCENT_50( 50 ),
PERCENT_25( 75 );
public final float breakPoint;
public final float percentage;
public final float breakPoint;
public final float percentage;
FuzzyMode(final float p) {
this.percentage = p;
this.breakPoint = p / 100.0f;
}
FuzzyMode( final float p )
{
this.percentage = p;
this.breakPoint = p / 100.0f;
}
public int calculateBreakPoint( final int maxDamage )
{
return (int) ( ( this.percentage * maxDamage ) / 100.0f );
}
public int calculateBreakPoint(final int maxDamage) {
return (int) ((this.percentage * maxDamage) / 100.0f);
}
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum IncludeExclude
{
WHITELIST, BLACKLIST
public enum IncludeExclude {
WHITELIST, BLACKLIST
}
@@ -23,12 +23,10 @@
package appeng.api.config;
public enum LevelEmitterMode {
public enum LevelEmitterMode
{
STORED_AMOUNT,
STORED_AMOUNT,
STORABLE_AMOUNT
STORABLE_AMOUNT
}
@@ -23,12 +23,10 @@
package appeng.api.config;
public enum LevelType {
public enum LevelType
{
ITEM_LEVEL,
ITEM_LEVEL,
ENERGY_LEVEL
ENERGY_LEVEL
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum ModSettings
{
public enum ModSettings {
}
@@ -23,14 +23,12 @@
package appeng.api.config;
public enum NetworkEmitterMode {
public enum NetworkEmitterMode
{
POWER_LEVEL,
POWER_LEVEL,
BOOTING,
BOOTING,
CHANNEL_ERROR
CHANNEL_ERROR
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum OperationMode
{
FILL, EMPTY
public enum OperationMode {
FILL, EMPTY
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum OutputMode
{
EXPORT_ONLY, EXPORT_OR_CRAFT, CRAFT_ONLY
public enum OutputMode {
EXPORT_ONLY, EXPORT_OR_CRAFT, CRAFT_ONLY
}
@@ -23,23 +23,19 @@
package appeng.api.config;
public enum PowerMultiplier {
ONE, CONFIG;
public enum PowerMultiplier
{
ONE, CONFIG;
/**
* please do not edit this value, it is set when AE loads its config files.
*/
public double multiplier = 1.0;
/**
* please do not edit this value, it is set when AE loads its config files.
*/
public double multiplier = 1.0;
public double multiply(final double in) {
return in * this.multiplier;
}
public double multiply( final double in )
{
return in * this.multiplier;
}
public double divide( final double in )
{
return in / this.multiplier;
}
public double divide(final double in) {
return in / this.multiplier;
}
}
+34 -37
View File
@@ -23,49 +23,46 @@
package appeng.api.config;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
public enum PowerUnits
{
AE( "gui.appliedenergistics2.units.appliedenergstics" ), // Native Units - AE Energy
EU( "gui.appliedenergistics2.units.ic2" ), // IndustrialCraft 2 - Energy Units
RF( "gui.appliedenergistics2.units.rf" ); // RF - Redstone Flux
public enum PowerUnits {
AE("gui.appliedenergistics2.units.appliedenergstics"), // Native Units - AE Energy
EU("gui.appliedenergistics2.units.ic2"), // IndustrialCraft 2 - Energy Units
RF("gui.appliedenergistics2.units.rf"); // RF - Redstone Flux
/**
* unlocalized name for the power unit.
*/
public final String unlocalizedName;
/**
* please do not edit this value, it is set when AE loads its config files.
*/
public double conversionRatio = 1.0;
/**
* unlocalized name for the power unit.
*/
public final String unlocalizedName;
/**
* please do not edit this value, it is set when AE loads its config files.
*/
public double conversionRatio = 1.0;
PowerUnits( final String un )
{
this.unlocalizedName = un;
}
PowerUnits(final String un) {
this.unlocalizedName = un;
}
/**
* do power conversion using AE's conversion rates.
*
* Example: PowerUnits.EU.convertTo( PowerUnits.AE, 32 );
*
* will normally returns 64, as it will convert the EU, to AE with AE's power settings.
*
* @param target target power unit
* @param value value
*
* @return value converted to target units, from this units.
*/
public double convertTo( final PowerUnits target, final double value )
{
return ( value * this.conversionRatio ) / target.conversionRatio;
}
/**
* do power conversion using AE's conversion rates.
*
* Example: PowerUnits.EU.convertTo( PowerUnits.AE, 32 );
*
* will normally returns 64, as it will convert the EU, to AE with AE's power
* settings.
*
* @param target target power unit
* @param value value
*
* @return value converted to target units, from this units.
*/
public double convertTo(final PowerUnits target, final double value) {
return (value * this.conversionRatio) / target.conversionRatio;
}
public ITextComponent textComponent() {
return new TranslationTextComponent(unlocalizedName);
}
public ITextComponent textComponent() {
return new TranslationTextComponent(unlocalizedName);
}
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum RedstoneMode
{
IGNORE, LOW_SIGNAL, HIGH_SIGNAL, SIGNAL_PULSE
public enum RedstoneMode {
IGNORE, LOW_SIGNAL, HIGH_SIGNAL, SIGNAL_PULSE
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum RelativeDirection
{
LEFT, RIGHT, UP, DOW
public enum RelativeDirection {
LEFT, RIGHT, UP, DOW
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum SchedulingMode
{
DEFAULT, ROUNDROBIN, RANDOM
public enum SchedulingMode {
DEFAULT, ROUNDROBIN, RANDOM
}
@@ -23,19 +23,18 @@
package appeng.api.config;
public enum SearchBoxMode {
AUTOSEARCH(false), AUTOSEARCH_KEEP(false), MANUAL_SEARCH(false), MANUAL_SEARCH_KEEP(false), JEI_AUTOSEARCH(true),
JEI_AUTOSEARCH_KEEP(true), JEI_MANUAL_SEARCH(true), JEI_MANUAL_SEARCH_KEEP(true);
public enum SearchBoxMode
{
AUTOSEARCH(false), AUTOSEARCH_KEEP(false), MANUAL_SEARCH(false), MANUAL_SEARCH_KEEP(false), JEI_AUTOSEARCH(true), JEI_AUTOSEARCH_KEEP(true), JEI_MANUAL_SEARCH(true), JEI_MANUAL_SEARCH_KEEP(true);
private final boolean requiresJei;
private final boolean requiresJei;
SearchBoxMode(boolean requiresJei) {
this.requiresJei = requiresJei;
}
SearchBoxMode(boolean requiresJei) {
this.requiresJei = requiresJei;
}
public boolean isRequiresJei() {
return requiresJei;
}
public boolean isRequiresJei() {
return requiresJei;
}
}
@@ -23,49 +23,48 @@
package appeng.api.config;
/**
* Represent the security systems basic permissions, these are not for anti-griefing, they are part of the mod as a
* gameplay feature.
* Represent the security systems basic permissions, these are not for
* anti-griefing, they are part of the mod as a gameplay feature.
*/
public enum SecurityPermissions
{
/**
* required to insert items into the network via terminal ( also used for machines based on the owner of the
* network, which is determined by its Security Block. )
*/
INJECT,
public enum SecurityPermissions {
/**
* required to insert items into the network via terminal ( also used for
* machines based on the owner of the network, which is determined by its
* Security Block. )
*/
INJECT,
/**
* required to extract items from the network via terminal ( also used for machines based on the owner of the
* network, which is determined by its Security Block. )
*/
EXTRACT,
/**
* required to extract items from the network via terminal ( also used for
* machines based on the owner of the network, which is determined by its
* Security Block. )
*/
EXTRACT,
/**
* required to request crafting from the network via terminal.
*/
CRAFT,
/**
* required to request crafting from the network via terminal.
*/
CRAFT,
/**
* required to modify automation, and make modifications to the networks physical layout.
*/
BUILD,
/**
* required to modify automation, and make modifications to the networks
* physical layout.
*/
BUILD,
/**
* required to modify the security blocks settings.
*/
SECURITY;
/**
* required to modify the security blocks settings.
*/
SECURITY;
private final String translationKey = "gui.appliedenergistics2.security." + this.name().toLowerCase();
private final String translationKey = "gui.appliedenergistics2.security." + this.name().toLowerCase();
public String getTranslatedName()
{
return this.translationKey + ".name";
}
public String getTranslatedName() {
return this.translationKey + ".name";
}
public String getTranslatedTip()
{
return this.translationKey + ".tip";
}
public String getTranslatedTip() {
return this.translationKey + ".tip";
}
}
+36 -42
View File
@@ -23,79 +23,73 @@
package appeng.api.config;
import java.util.EnumSet;
import javax.annotation.Nonnull;
public enum Settings {
LEVEL_EMITTER_MODE(EnumSet.allOf(LevelEmitterMode.class)),
public enum Settings
{
LEVEL_EMITTER_MODE( EnumSet.allOf( LevelEmitterMode.class ) ),
REDSTONE_EMITTER(EnumSet.of(RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL)),
REDSTONE_EMITTER( EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL ) ),
REDSTONE_CONTROLLED(EnumSet.allOf(RedstoneMode.class)),
REDSTONE_CONTROLLED( EnumSet.allOf( RedstoneMode.class ) ),
CONDENSER_OUTPUT(EnumSet.allOf(CondenserOutput.class)),
CONDENSER_OUTPUT( EnumSet.allOf( CondenserOutput.class ) ),
POWER_UNITS(EnumSet.allOf(PowerUnits.class)),
POWER_UNITS( EnumSet.allOf( PowerUnits.class ) ),
ACCESS(EnumSet.of(AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE)),
ACCESS( EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE ) ),
SORT_DIRECTION(EnumSet.allOf(SortDir.class)),
SORT_DIRECTION( EnumSet.allOf( SortDir.class ) ),
SORT_BY(EnumSet.allOf(SortOrder.class)),
SORT_BY( EnumSet.allOf( SortOrder.class ) ),
SEARCH_TOOLTIPS(EnumSet.of(YesNo.YES, YesNo.NO)),
SEARCH_TOOLTIPS( EnumSet.of( YesNo.YES, YesNo.NO ) ),
VIEW_MODE(EnumSet.allOf(ViewItems.class)),
VIEW_MODE( EnumSet.allOf( ViewItems.class ) ),
SEARCH_MODE(EnumSet.allOf(SearchBoxMode.class)),
SEARCH_MODE( EnumSet.allOf( SearchBoxMode.class ) ),
IO_DIRECTION(EnumSet.of(RelativeDirection.LEFT, RelativeDirection.RIGHT)),
IO_DIRECTION( EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT ) ),
BLOCK(EnumSet.of(YesNo.YES, YesNo.NO)),
BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
OPERATION_MODE(EnumSet.allOf(OperationMode.class)),
OPERATION_MODE( EnumSet.allOf( OperationMode.class ) ),
FULLNESS_MODE(EnumSet.allOf(FullnessMode.class)),
FULLNESS_MODE( EnumSet.allOf( FullnessMode.class ) ),
CRAFT_ONLY(EnumSet.of(YesNo.YES, YesNo.NO)),
CRAFT_ONLY( EnumSet.of( YesNo.YES, YesNo.NO ) ),
FUZZY_MODE(EnumSet.allOf(FuzzyMode.class)),
FUZZY_MODE( EnumSet.allOf( FuzzyMode.class ) ),
LEVEL_TYPE(EnumSet.allOf(LevelType.class)),
LEVEL_TYPE( EnumSet.allOf( LevelType.class ) ),
TERMINAL_STYLE(EnumSet.of(TerminalStyle.TALL, TerminalStyle.SMALL)),
TERMINAL_STYLE( EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL ) ),
COPY_MODE(EnumSet.allOf(CopyMode.class)),
COPY_MODE( EnumSet.allOf( CopyMode.class ) ),
INTERFACE_TERMINAL(EnumSet.of(YesNo.YES, YesNo.NO)),
INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ),
CRAFT_VIA_REDSTONE(EnumSet.of(YesNo.YES, YesNo.NO)),
CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ),
STORAGE_FILTER(EnumSet.allOf(StorageFilter.class)),
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ),
PLACE_BLOCK(EnumSet.of(YesNo.YES, YesNo.NO)),
PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
SCHEDULING_MODE(EnumSet.allOf(SchedulingMode.class));
SCHEDULING_MODE( EnumSet.allOf( SchedulingMode.class ) );
private final EnumSet<? extends Enum<?>> values;
private final EnumSet<? extends Enum<?>> values;
Settings(@Nonnull final EnumSet<? extends Enum<?>> possibleOptions) {
if (possibleOptions.isEmpty()) {
throw new IllegalArgumentException("Tried to instantiate an empty setting.");
}
Settings( @Nonnull final EnumSet<? extends Enum<?>> possibleOptions )
{
if( possibleOptions.isEmpty() )
{
throw new IllegalArgumentException( "Tried to instantiate an empty setting." );
}
this.values = possibleOptions;
}
this.values = possibleOptions;
}
public EnumSet<? extends Enum<?>> getPossibleValues()
{
return this.values;
}
public EnumSet<? extends Enum<?>> getPossibleValues() {
return this.values;
}
}
+2 -4
View File
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum SortDir
{
ASCENDING, DESCENDING
public enum SortDir {
ASCENDING, DESCENDING
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum SortOrder
{
NAME, AMOUNT, MOD, INVTWEAKS
public enum SortOrder {
NAME, AMOUNT, MOD, INVTWEAKS
}
@@ -23,12 +23,10 @@
package appeng.api.config;
public enum StorageFilter {
public enum StorageFilter
{
NONE,
NONE,
EXTRACTABLE_ONLY
EXTRACTABLE_ONLY
}
@@ -23,14 +23,12 @@
package appeng.api.config;
public enum TerminalStyle {
public enum TerminalStyle
{
TALL,
TALL,
FULL,
FULL,
SMALL
SMALL
}
+10 -12
View File
@@ -23,16 +23,14 @@
package appeng.api.config;
public enum TunnelType
{
ME, // Network Tunnel
IC2_POWER, // EU Tunnel
FE_POWER, // Forge Energy tunnel
REDSTONE, // Redstone Tunnel
FLUID, // Fluid Tunnel
ITEM, // Item Tunnel
LIGHT, // Light Tunnel
BUNDLED_REDSTONE, // Bundled Redstone Tunnel
COMPUTER_MESSAGE // Computer Message Tunnel
public enum TunnelType {
ME, // Network Tunnel
IC2_POWER, // EU Tunnel
FE_POWER, // Forge Energy tunnel
REDSTONE, // Redstone Tunnel
FLUID, // Fluid Tunnel
ITEM, // Item Tunnel
LIGHT, // Light Tunnel
BUNDLED_REDSTONE, // Bundled Redstone Tunnel
COMPUTER_MESSAGE // Computer Message Tunnel
}
+44 -56
View File
@@ -23,7 +23,6 @@
package appeng.api.config;
import java.util.HashMap;
import java.util.Map;
@@ -31,66 +30,55 @@ import net.minecraft.item.ItemStack;
import appeng.api.definitions.IItemDefinition;
public enum Upgrades {
/**
* Gold Tier Upgrades.
*/
CAPACITY(0), REDSTONE(0), CRAFTING(0),
public enum Upgrades
{
/**
* Gold Tier Upgrades.
*/
CAPACITY( 0 ),
REDSTONE( 0 ),
CRAFTING( 0 ),
/**
* Diamond Tier Upgrades.
*/
FUZZY(1), SPEED(1), INVERTER(1);
/**
* Diamond Tier Upgrades.
*/
FUZZY( 1 ),
SPEED( 1 ),
INVERTER( 1 );
private final int tier;
private final Map<ItemStack, Integer> supportedMax = new HashMap<>();
private final int tier;
private final Map<ItemStack, Integer> supportedMax = new HashMap<>();
Upgrades(final int tier) {
this.tier = tier;
}
Upgrades( final int tier )
{
this.tier = tier;
}
/**
* @return list of Items/Blocks that support this upgrade, and how many it
* supports.
*/
public Map<ItemStack, Integer> getSupported() {
return this.supportedMax;
}
/**
* @return list of Items/Blocks that support this upgrade, and how many it supports.
*/
public Map<ItemStack, Integer> getSupported()
{
return this.supportedMax;
}
/**
* Registers a specific amount of this upgrade into a specific machine
*
* @param item machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed
*/
public void registerItem(final IItemDefinition item, final int maxSupported) {
item.maybeStack(1).ifPresent(is -> this.registerItem(is, maxSupported));
}
/**
* Registers a specific amount of this upgrade into a specific machine
*
* @param item machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed
*/
public void registerItem( final IItemDefinition item, final int maxSupported )
{
item.maybeStack( 1 ).ifPresent( is -> this.registerItem( is, maxSupported ) );
}
/**
* Registers a specific amount of this upgrade into a specific machine
*
* @param stack machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed
*/
public void registerItem(final ItemStack stack, final int maxSupported) {
if (stack != null) {
this.supportedMax.put(stack, maxSupported);
}
}
/**
* Registers a specific amount of this upgrade into a specific machine
*
* @param stack machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed
*/
public void registerItem( final ItemStack stack, final int maxSupported )
{
if( stack != null )
{
this.supportedMax.put( stack, maxSupported );
}
}
public int getTier()
{
return this.tier;
}
public int getTier() {
return this.tier;
}
}
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum ViewItems
{
ALL, STORED, CRAFTABLE
public enum ViewItems {
ALL, STORED, CRAFTABLE
}
+2 -4
View File
@@ -23,8 +23,6 @@
package appeng.api.config;
public enum YesNo
{
YES, NO, UNDECIDED
public enum YesNo {
YES, NO, UNDECIDED
}
@@ -18,42 +18,39 @@
package appeng.api.definitions;
import java.util.Optional;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import java.util.Optional;
public interface IBlockDefinition extends IItemDefinition {
/**
* @return the {@link Block} implementation if applicable
*/
default Optional<Block> maybeBlock() {
return Optional.of(block());
}
Block block();
public interface IBlockDefinition extends IItemDefinition
{
/**
* @return the {@link Block} implementation if applicable
*/
default Optional<Block> maybeBlock() {
return Optional.of(block());
}
/**
* @return the {@link BlockItem} implementation if applicable
*/
default Optional<BlockItem> maybeBlockItem() {
return Optional.of(blockItem());
}
Block block();
BlockItem blockItem();
/**
* @return the {@link BlockItem} implementation if applicable
*/
default Optional<BlockItem> maybeBlockItem() {
return Optional.of(blockItem());
}
BlockItem blockItem();
/**
* Compare Block with world.
*
* @param world world of block
* @param pos location
*
* @return if the block is placed in the world at the specific location.
*/
boolean isSameAs( IBlockReader world, BlockPos pos );
/**
* Compare Block with world.
*
* @param world world of block
* @param pos location
*
* @return if the block is placed in the world at the specific location.
*/
boolean isSameAs(IBlockReader world, BlockPos pos);
}
@@ -23,169 +23,167 @@
package appeng.api.definitions;
/**
* A list of all blocks in AE
*/
public interface IBlocks
{
/*
* world gen
*/
IBlockDefinition quartzOre();
public interface IBlocks {
/*
* world gen
*/
IBlockDefinition quartzOre();
IBlockDefinition quartzOreCharged();
IBlockDefinition quartzOreCharged();
IBlockDefinition matrixFrame();
IBlockDefinition matrixFrame();
/*
* decorative
*/
IBlockDefinition quartzBlock();
/*
* decorative
*/
IBlockDefinition quartzBlock();
IBlockDefinition quartzPillar();
IBlockDefinition quartzPillar();
IBlockDefinition chiseledQuartzBlock();
IBlockDefinition chiseledQuartzBlock();
IBlockDefinition quartzGlass();
IBlockDefinition quartzGlass();
IBlockDefinition quartzVibrantGlass();
IBlockDefinition quartzVibrantGlass();
IBlockDefinition quartzFixture();
IBlockDefinition quartzFixture();
IBlockDefinition fluixBlock();
IBlockDefinition fluixBlock();
IBlockDefinition skyStoneBlock();
IBlockDefinition skyStoneBlock();
IBlockDefinition smoothSkyStoneBlock();
IBlockDefinition smoothSkyStoneBlock();
IBlockDefinition skyStoneBrick();
IBlockDefinition skyStoneBrick();
IBlockDefinition skyStoneSmallBrick();
IBlockDefinition skyStoneSmallBrick();
IBlockDefinition skyStoneChest();
IBlockDefinition skyStoneChest();
IBlockDefinition smoothSkyStoneChest();
IBlockDefinition smoothSkyStoneChest();
IBlockDefinition skyCompass();
IBlockDefinition skyCompass();
IBlockDefinition skyStoneStairs();
IBlockDefinition skyStoneStairs();
IBlockDefinition smoothSkyStoneStairs();
IBlockDefinition smoothSkyStoneStairs();
IBlockDefinition skyStoneBrickStairs();
IBlockDefinition skyStoneBrickStairs();
IBlockDefinition skyStoneSmallBrickStairs();
IBlockDefinition skyStoneSmallBrickStairs();
IBlockDefinition fluixStairs();
IBlockDefinition fluixStairs();
IBlockDefinition quartzStairs();
IBlockDefinition quartzStairs();
IBlockDefinition chiseledQuartzStairs();
IBlockDefinition chiseledQuartzStairs();
IBlockDefinition quartzPillarStairs();
IBlockDefinition quartzPillarStairs();
IBlockDefinition skyStoneSlab();
IBlockDefinition skyStoneSlab();
IBlockDefinition smoothSkyStoneSlab();
IBlockDefinition smoothSkyStoneSlab();
IBlockDefinition skyStoneBrickSlab();
IBlockDefinition skyStoneBrickSlab();
IBlockDefinition skyStoneSmallBrickSlab();
IBlockDefinition skyStoneSmallBrickSlab();
IBlockDefinition fluixSlab();
IBlockDefinition fluixSlab();
IBlockDefinition quartzSlab();
IBlockDefinition quartzSlab();
IBlockDefinition chiseledQuartzSlab();
IBlockDefinition chiseledQuartzSlab();
IBlockDefinition quartzPillarSlab();
IBlockDefinition quartzPillarSlab();
/*
* misc
*/
ITileDefinition grindstone();
/*
* misc
*/
ITileDefinition grindstone();
ITileDefinition crank();
ITileDefinition crank();
ITileDefinition inscriber();
ITileDefinition inscriber();
ITileDefinition wirelessAccessPoint();
ITileDefinition wirelessAccessPoint();
ITileDefinition charger();
ITileDefinition charger();
IBlockDefinition tinyTNT();
IBlockDefinition tinyTNT();
ITileDefinition securityStation();
ITileDefinition securityStation();
/*
* quantum Network Bridge
*/
ITileDefinition quantumRing();
/*
* quantum Network Bridge
*/
ITileDefinition quantumRing();
ITileDefinition quantumLink();
ITileDefinition quantumLink();
/*
* spatial iO
*/
ITileDefinition spatialPylon();
/*
* spatial iO
*/
ITileDefinition spatialPylon();
ITileDefinition spatialIOPort();
ITileDefinition spatialIOPort();
/*
* Bus / cables
*/
ITileDefinition multiPart();
/*
* Bus / cables
*/
ITileDefinition multiPart();
/*
* machines
*/
ITileDefinition controller();
/*
* machines
*/
ITileDefinition controller();
ITileDefinition drive();
ITileDefinition drive();
ITileDefinition chest();
ITileDefinition chest();
ITileDefinition iface();
ITileDefinition iface();
ITileDefinition fluidIface();
ITileDefinition fluidIface();
ITileDefinition cellWorkbench();
ITileDefinition cellWorkbench();
ITileDefinition iOPort();
ITileDefinition iOPort();
ITileDefinition condenser();
ITileDefinition condenser();
ITileDefinition energyAcceptor();
ITileDefinition energyAcceptor();
ITileDefinition vibrationChamber();
ITileDefinition vibrationChamber();
ITileDefinition quartzGrowthAccelerator();
ITileDefinition quartzGrowthAccelerator();
ITileDefinition energyCell();
ITileDefinition energyCell();
ITileDefinition energyCellDense();
ITileDefinition energyCellDense();
ITileDefinition energyCellCreative();
ITileDefinition energyCellCreative();
// rv1
ITileDefinition craftingUnit();
// rv1
ITileDefinition craftingUnit();
ITileDefinition craftingAccelerator();
ITileDefinition craftingAccelerator();
ITileDefinition craftingStorage1k();
ITileDefinition craftingStorage1k();
ITileDefinition craftingStorage4k();
ITileDefinition craftingStorage4k();
ITileDefinition craftingStorage16k();
ITileDefinition craftingStorage16k();
ITileDefinition craftingStorage64k();
ITileDefinition craftingStorage64k();
ITileDefinition craftingMonitor();
ITileDefinition craftingMonitor();
ITileDefinition molecularAssembler();
ITileDefinition molecularAssembler();
ITileDefinition lightDetector();
ITileDefinition lightDetector();
ITileDefinition paint();
ITileDefinition paint();
}
@@ -18,10 +18,8 @@
package appeng.api.definitions;
import net.minecraft.item.ItemStack;
/**
* Interface to compare a definition with an itemstack or a block
*
@@ -29,14 +27,13 @@ import net.minecraft.item.ItemStack;
* @version rv2
* @since rv2
*/
public interface IComparableDefinition
{
/**
* Compare {@link ItemStack} with this
*
* @param comparableStack compared item
*
* @return true if the item stack is a matching item.
*/
boolean isSameAs( ItemStack comparableStack );
public interface IComparableDefinition {
/**
* Compare {@link ItemStack} with this
*
* @param comparableStack compared item
*
* @return true if the item stack is a matching item.
*/
boolean isSameAs(ItemStack comparableStack);
}
@@ -23,29 +23,27 @@
package appeng.api.definitions;
/**
* All definitions in AE
*/
public interface IDefinitions
{
/**
* @return an accessible list of all of AE's blocks
*/
IBlocks blocks();
public interface IDefinitions {
/**
* @return an accessible list of all of AE's blocks
*/
IBlocks blocks();
/**
* @return an accessible list of all of AE's Items
*/
IItems items();
/**
* @return an accessible list of all of AE's Items
*/
IItems items();
/**
* @return an accessible list of all of AE's materials; materials are items
*/
IMaterials materials();
/**
* @return an accessible list of all of AE's materials; materials are items
*/
IMaterials materials();
/**
* @return an accessible list of all of AE's parts, parts are items
*/
IParts parts();
/**
* @return an accessible list of all of AE's parts, parts are items
*/
IParts parts();
}
@@ -23,46 +23,44 @@
package appeng.api.definitions;
import java.util.Optional;
import java.util.Set;
import javax.annotation.Nonnull;
import appeng.api.features.AEFeature;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import appeng.api.features.AEFeature;
public interface IItemDefinition extends IComparableDefinition
{
/**
* @return the unique name of the definition which will be used to register the underlying structure. Will never be
* null
*/
@Nonnull
String identifier();
public interface IItemDefinition extends IComparableDefinition {
/**
* @return the unique name of the definition which will be used to register the
* underlying structure. Will never be null
*/
@Nonnull
String identifier();
/**
* @return the {@link Item} Implementation if applicable
*/
default Optional<Item> maybeItem() {
return Optional.of(item());
}
/**
* @return the {@link Item} Implementation if applicable
*/
default Optional<Item> maybeItem() {
return Optional.of(item());
}
Item item();
Item item();
/**
* @return an {@link ItemStack} with specified quantity of this item.
*/
default Optional<ItemStack> maybeStack( int stackSize ) {
return Optional.of(stack(stackSize));
}
/**
* @return an {@link ItemStack} with specified quantity of this item.
*/
default Optional<ItemStack> maybeStack(int stackSize) {
return Optional.of(stack(stackSize));
}
ItemStack stack( int stackSize );
ItemStack stack(int stackSize);
/**
* @return an immutable set of the features of this item
*/
Set<AEFeature> features();
/**
* @return an immutable set of the features of this item
*/
Set<AEFeature> features();
}
+46 -49
View File
@@ -23,101 +23,98 @@
package appeng.api.definitions;
import appeng.api.util.AEColoredItemDefinition;
/**
* A list of all items in AE
*/
public interface IItems
{
IItemDefinition certusQuartzAxe();
public interface IItems {
IItemDefinition certusQuartzAxe();
IItemDefinition certusQuartzHoe();
IItemDefinition certusQuartzHoe();
IItemDefinition certusQuartzShovel();
IItemDefinition certusQuartzShovel();
IItemDefinition certusQuartzPick();
IItemDefinition certusQuartzPick();
IItemDefinition certusQuartzSword();
IItemDefinition certusQuartzSword();
IItemDefinition certusQuartzWrench();
IItemDefinition certusQuartzWrench();
IItemDefinition certusQuartzKnife();
IItemDefinition certusQuartzKnife();
IItemDefinition netherQuartzAxe();
IItemDefinition netherQuartzAxe();
IItemDefinition netherQuartzHoe();
IItemDefinition netherQuartzHoe();
IItemDefinition netherQuartzShovel();
IItemDefinition netherQuartzShovel();
IItemDefinition netherQuartzPick();
IItemDefinition netherQuartzPick();
IItemDefinition netherQuartzSword();
IItemDefinition netherQuartzSword();
IItemDefinition netherQuartzWrench();
IItemDefinition netherQuartzWrench();
IItemDefinition netherQuartzKnife();
IItemDefinition netherQuartzKnife();
IItemDefinition entropyManipulator();
IItemDefinition entropyManipulator();
IItemDefinition wirelessTerminal();
IItemDefinition wirelessTerminal();
IItemDefinition biometricCard();
IItemDefinition biometricCard();
IItemDefinition chargedStaff();
IItemDefinition chargedStaff();
IItemDefinition massCannon();
IItemDefinition massCannon();
IItemDefinition memoryCard();
IItemDefinition memoryCard();
IItemDefinition networkTool();
IItemDefinition networkTool();
IItemDefinition portableCell();
IItemDefinition portableCell();
IItemDefinition cellCreative();
IItemDefinition cellCreative();
IItemDefinition viewCell();
IItemDefinition viewCell();
IItemDefinition cell1k();
IItemDefinition cell1k();
IItemDefinition cell4k();
IItemDefinition cell4k();
IItemDefinition cell16k();
IItemDefinition cell16k();
IItemDefinition cell64k();
IItemDefinition cell64k();
IItemDefinition fluidCell1k();
IItemDefinition fluidCell1k();
IItemDefinition fluidCell4k();
IItemDefinition fluidCell4k();
IItemDefinition fluidCell16k();
IItemDefinition fluidCell16k();
IItemDefinition fluidCell64k();
IItemDefinition fluidCell64k();
IItemDefinition spatialCell2();
IItemDefinition spatialCell2();
IItemDefinition spatialCell16();
IItemDefinition spatialCell16();
IItemDefinition spatialCell128();
IItemDefinition spatialCell128();
IItemDefinition facade();
IItemDefinition facade();
IItemDefinition certusCrystalSeed();
IItemDefinition certusCrystalSeed();
IItemDefinition fluixCrystalSeed();
IItemDefinition fluixCrystalSeed();
IItemDefinition netherQuartzSeed();
IItemDefinition netherQuartzSeed();
IItemDefinition dummyFluidItem();
IItemDefinition dummyFluidItem();
// rv1
IItemDefinition encodedPattern();
// rv1
IItemDefinition encodedPattern();
IItemDefinition colorApplicator();
IItemDefinition colorApplicator();
AEColoredItemDefinition coloredPaintBall();
AEColoredItemDefinition coloredPaintBall();
AEColoredItemDefinition coloredLumenPaintBall();
AEColoredItemDefinition coloredLumenPaintBall();
}
@@ -23,123 +23,121 @@
package appeng.api.definitions;
/**
* A list of all materials in AE
*/
public interface IMaterials
{
IItemDefinition cell2SpatialPart();
public interface IMaterials {
IItemDefinition cell2SpatialPart();
IItemDefinition cell16SpatialPart();
IItemDefinition cell16SpatialPart();
IItemDefinition cell128SpatialPart();
IItemDefinition cell128SpatialPart();
IItemDefinition silicon();
IItemDefinition silicon();
IItemDefinition skyDust();
IItemDefinition skyDust();
IItemDefinition calcProcessorPress();
IItemDefinition calcProcessorPress();
IItemDefinition engProcessorPress();
IItemDefinition engProcessorPress();
IItemDefinition logicProcessorPress();
IItemDefinition logicProcessorPress();
IItemDefinition calcProcessorPrint();
IItemDefinition calcProcessorPrint();
IItemDefinition engProcessorPrint();
IItemDefinition engProcessorPrint();
IItemDefinition logicProcessorPrint();
IItemDefinition logicProcessorPrint();
IItemDefinition siliconPress();
IItemDefinition siliconPress();
IItemDefinition siliconPrint();
IItemDefinition siliconPrint();
IItemDefinition namePress();
IItemDefinition namePress();
IItemDefinition logicProcessor();
IItemDefinition logicProcessor();
IItemDefinition calcProcessor();
IItemDefinition calcProcessor();
IItemDefinition engProcessor();
IItemDefinition engProcessor();
IItemDefinition basicCard();
IItemDefinition basicCard();
IItemDefinition advCard();
IItemDefinition advCard();
IItemDefinition purifiedCertusQuartzCrystal();
IItemDefinition purifiedCertusQuartzCrystal();
IItemDefinition purifiedNetherQuartzCrystal();
IItemDefinition purifiedNetherQuartzCrystal();
IItemDefinition purifiedFluixCrystal();
IItemDefinition purifiedFluixCrystal();
IItemDefinition cell1kPart();
IItemDefinition cell1kPart();
IItemDefinition cell4kPart();
IItemDefinition cell4kPart();
IItemDefinition cell16kPart();
IItemDefinition cell16kPart();
IItemDefinition cell64kPart();
IItemDefinition cell64kPart();
IItemDefinition emptyStorageCell();
IItemDefinition emptyStorageCell();
IItemDefinition cardRedstone();
IItemDefinition cardRedstone();
IItemDefinition cardSpeed();
IItemDefinition cardSpeed();
IItemDefinition cardCapacity();
IItemDefinition cardCapacity();
IItemDefinition cardFuzzy();
IItemDefinition cardFuzzy();
IItemDefinition cardInverter();
IItemDefinition cardInverter();
IItemDefinition cardCrafting();
IItemDefinition cardCrafting();
IItemDefinition enderDust();
IItemDefinition enderDust();
IItemDefinition flour();
IItemDefinition flour();
IItemDefinition goldDust();
IItemDefinition goldDust();
IItemDefinition ironDust();
IItemDefinition ironDust();
IItemDefinition fluixDust();
IItemDefinition fluixDust();
IItemDefinition certusQuartzDust();
IItemDefinition certusQuartzDust();
IItemDefinition netherQuartzDust();
IItemDefinition netherQuartzDust();
IItemDefinition matterBall();
IItemDefinition matterBall();
IItemDefinition certusQuartzCrystal();
IItemDefinition certusQuartzCrystal();
IItemDefinition certusQuartzCrystalCharged();
IItemDefinition certusQuartzCrystalCharged();
IItemDefinition fluixCrystal();
IItemDefinition fluixCrystal();
IItemDefinition fluixPearl();
IItemDefinition fluixPearl();
IItemDefinition woodenGear();
IItemDefinition woodenGear();
IItemDefinition wirelessReceiver();
IItemDefinition wirelessReceiver();
IItemDefinition wirelessBooster();
IItemDefinition wirelessBooster();
IItemDefinition annihilationCore();
IItemDefinition annihilationCore();
IItemDefinition formationCore();
IItemDefinition formationCore();
IItemDefinition singularity();
IItemDefinition singularity();
IItemDefinition qESingularity();
IItemDefinition qESingularity();
IItemDefinition blankPattern();
IItemDefinition blankPattern();
IItemDefinition fluidCell1kPart();
IItemDefinition fluidCell1kPart();
IItemDefinition fluidCell4kPart();
IItemDefinition fluidCell4kPart();
IItemDefinition fluidCell16kPart();
IItemDefinition fluidCell16kPart();
IItemDefinition fluidCell64kPart();
IItemDefinition fluidCell64kPart();
}
+42 -45
View File
@@ -23,94 +23,91 @@
package appeng.api.definitions;
import appeng.api.util.AEColoredItemDefinition;
/**
* A list of all parts in AE
*/
public interface IParts
{
AEColoredItemDefinition cableSmart();
public interface IParts {
AEColoredItemDefinition cableSmart();
AEColoredItemDefinition cableCovered();
AEColoredItemDefinition cableCovered();
AEColoredItemDefinition cableGlass();
AEColoredItemDefinition cableGlass();
AEColoredItemDefinition cableDenseCovered();
AEColoredItemDefinition cableDenseCovered();
AEColoredItemDefinition cableDenseSmart();
AEColoredItemDefinition cableDenseSmart();
IItemDefinition quartzFiber();
IItemDefinition quartzFiber();
IItemDefinition toggleBus();
IItemDefinition toggleBus();
IItemDefinition invertedToggleBus();
IItemDefinition invertedToggleBus();
IItemDefinition storageBus();
IItemDefinition storageBus();
IItemDefinition importBus();
IItemDefinition importBus();
IItemDefinition exportBus();
IItemDefinition exportBus();
IItemDefinition iface();
IItemDefinition iface();
IItemDefinition fluidIface();
IItemDefinition fluidIface();
IItemDefinition levelEmitter();
IItemDefinition levelEmitter();
IItemDefinition annihilationPlane();
IItemDefinition annihilationPlane();
IItemDefinition identityAnnihilationPlane();
IItemDefinition identityAnnihilationPlane();
IItemDefinition formationPlane();
IItemDefinition formationPlane();
IItemDefinition p2PTunnelME();
IItemDefinition p2PTunnelME();
IItemDefinition p2PTunnelRedstone();
IItemDefinition p2PTunnelRedstone();
IItemDefinition p2PTunnelItems();
IItemDefinition p2PTunnelItems();
IItemDefinition p2PTunnelFluids();
IItemDefinition p2PTunnelFluids();
IItemDefinition p2PTunnelEU();
IItemDefinition p2PTunnelEU();
IItemDefinition p2PTunnelFE();
IItemDefinition p2PTunnelFE();
IItemDefinition p2PTunnelLight();
IItemDefinition p2PTunnelLight();
IItemDefinition cableAnchor();
IItemDefinition cableAnchor();
IItemDefinition monitor();
IItemDefinition monitor();
IItemDefinition semiDarkMonitor();
IItemDefinition semiDarkMonitor();
IItemDefinition darkMonitor();
IItemDefinition darkMonitor();
IItemDefinition interfaceTerminal();
IItemDefinition interfaceTerminal();
IItemDefinition patternTerminal();
IItemDefinition patternTerminal();
IItemDefinition craftingTerminal();
IItemDefinition craftingTerminal();
IItemDefinition terminal();
IItemDefinition terminal();
IItemDefinition storageMonitor();
IItemDefinition storageMonitor();
IItemDefinition conversionMonitor();
IItemDefinition conversionMonitor();
IItemDefinition fluidTerminal();
IItemDefinition fluidTerminal();
IItemDefinition fluidImportBus();
IItemDefinition fluidImportBus();
IItemDefinition fluidExportBus();
IItemDefinition fluidExportBus();
IItemDefinition fluidStorageBus();
IItemDefinition fluidStorageBus();
IItemDefinition fluidLevelEmitter();
IItemDefinition fluidLevelEmitter();
IItemDefinition fluidAnnihilationPlane();
IItemDefinition fluidAnnihilationPlane();
IItemDefinition fluidFormationnPlane();
IItemDefinition fluidFormationnPlane();
}
@@ -18,16 +18,13 @@
package appeng.api.definitions;
import java.util.Optional;
import net.minecraft.tileentity.TileEntity;
public interface ITileDefinition extends IBlockDefinition
{
/**
* @return the {@link TileEntity} Class if applicable.
*/
Optional<? extends Class<? extends TileEntity>> maybeEntity();
public interface ITileDefinition extends IBlockDefinition {
/**
* @return the {@link TileEntity} Class if applicable.
*/
Optional<? extends Class<? extends TileEntity>> maybeEntity();
}
@@ -23,39 +23,34 @@
package appeng.api.events;
import net.minecraftforge.eventbus.api.Event;
import appeng.api.features.ILocatable;
/**
* Input Event:
*
* Used to Notify the Location Registry of objects, and their availability.
*/
public class LocatableEventAnnounce extends Event
{
public class LocatableEventAnnounce extends Event {
public final ILocatable target;
public final LocatableEvent change;
public final ILocatable target;
public final LocatableEvent change;
public LocatableEventAnnounce( final ILocatable o, final LocatableEvent ev )
{
this.target = o;
this.change = ev;
}
public LocatableEventAnnounce(final ILocatable o, final LocatableEvent ev) {
this.target = o;
this.change = ev;
}
public enum LocatableEvent
{
/**
* Adds the locatable to the registry
*/
REGISTER,
public enum LocatableEvent {
/**
* Adds the locatable to the registry
*/
REGISTER,
/**
* Removes the locatable from the registry
*/
UNREGISTER
}
/**
* Removes the locatable from the registry
*/
UNREGISTER
}
}
@@ -23,14 +23,11 @@
package appeng.api.exceptions;
public class AppEngException extends Exception {
public class AppEngException extends Exception
{
private static final long serialVersionUID = -9051434206368465494L;
private static final long serialVersionUID = -9051434206368465494L;
public AppEngException( final String t )
{
super( t );
}
public AppEngException(final String t) {
super(t);
}
}
@@ -18,13 +18,10 @@
package appeng.api.exceptions;
public class CoreInaccessibleException extends RuntimeException {
private static final long serialVersionUID = -7434641554655517242L;
public class CoreInaccessibleException extends RuntimeException
{
private static final long serialVersionUID = -7434641554655517242L;
public CoreInaccessibleException( final String message )
{
super( message );
}
public CoreInaccessibleException(final String message) {
super(message);
}
}
@@ -23,34 +23,30 @@
package appeng.api.exceptions;
import appeng.api.networking.IGridNode;
/**
* Exception occurred because of an already existing connection between the two {@link IGridNode}s
* Exception occurred because of an already existing connection between the two
* {@link IGridNode}s
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
* Intended to signal an internal exception and not intended to be thrown by any
* 3rd party module.
*
* @author yueh
* @version rv3
* @since rv3
*/
public class ExistingConnectionException extends FailedConnectionException
{
public class ExistingConnectionException extends FailedConnectionException {
private static final long serialVersionUID = 2975450379720353182L;
private static final String DEFAULT_MESSAGE = "Connection between both nodes already exists.";
private static final long serialVersionUID = 2975450379720353182L;
private static final String DEFAULT_MESSAGE = "Connection between both nodes already exists.";
public ExistingConnectionException()
{
super( DEFAULT_MESSAGE );
}
public ExistingConnectionException() {
super(DEFAULT_MESSAGE);
}
public ExistingConnectionException( String message )
{
super( message );
}
public ExistingConnectionException(String message) {
super(message);
}
}
@@ -23,15 +23,13 @@
package appeng.api.exceptions;
import appeng.api.networking.IGridNode;
/**
* Exception indicating a failed connection between two {@link IGridNode}s.
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
* Intended to signal an internal exception and not intended to be thrown by any
* 3rd party module.
*
* See any subclass for a more specific reason.
*
@@ -40,17 +38,14 @@ import appeng.api.networking.IGridNode;
* @version rv3
* @since rv0
*/
public class FailedConnectionException extends Exception
{
public class FailedConnectionException extends Exception {
private static final long serialVersionUID = -2544208090248293753L;
private static final long serialVersionUID = -2544208090248293753L;
public FailedConnectionException()
{
}
public FailedConnectionException() {
}
public FailedConnectionException( String message )
{
super( message );
}
public FailedConnectionException(String message) {
super(message);
}
}
@@ -18,13 +18,10 @@
package appeng.api.exceptions;
public class MissingDefinitionException extends RuntimeException {
private static final long serialVersionUID = -6547396584255825761L;
public class MissingDefinitionException extends RuntimeException
{
private static final long serialVersionUID = -6547396584255825761L;
public MissingDefinitionException( final String message )
{
super( message );
}
public MissingDefinitionException(final String message) {
super(message);
}
}
@@ -23,14 +23,11 @@
package appeng.api.exceptions;
public class MissingIngredientException extends Exception {
public class MissingIngredientException extends Exception
{
private static final long serialVersionUID = -998858343831371697L;
private static final long serialVersionUID = -998858343831371697L;
public MissingIngredientException( final String n )
{
super( n );
}
public MissingIngredientException(final String n) {
super(n);
}
}
@@ -23,14 +23,11 @@
package appeng.api.exceptions;
public class ModNotInstalledException extends Exception {
public class ModNotInstalledException extends Exception
{
private static final long serialVersionUID = -9052435206368425494L;
private static final long serialVersionUID = -9052435206368425494L;
public ModNotInstalledException( final String t )
{
super( t );
}
public ModNotInstalledException(final String t) {
super(t);
}
}
@@ -23,31 +23,27 @@
package appeng.api.exceptions;
/**
* Exception due to trying to connect one or more null values.
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
* Intended to signal an internal exception and not intended to be thrown by any
* 3rd party module.
*
* @author yueh
* @version rv3
* @since rv3
*/
public class NullNodeConnectionException extends FailedConnectionException
{
public class NullNodeConnectionException extends FailedConnectionException {
private static final long serialVersionUID = -2143719383495321764L;
private static final String DEFAULT_MESSAGE = "Connection forged between null entities.";
private static final long serialVersionUID = -2143719383495321764L;
private static final String DEFAULT_MESSAGE = "Connection forged between null entities.";
public NullNodeConnectionException()
{
super( DEFAULT_MESSAGE );
}
public NullNodeConnectionException() {
super(DEFAULT_MESSAGE);
}
public NullNodeConnectionException( String message )
{
super( message );
}
public NullNodeConnectionException(String message) {
super(message);
}
}
@@ -23,14 +23,11 @@
package appeng.api.exceptions;
public class RecipeException extends Exception {
public class RecipeException extends Exception
{
private static final long serialVersionUID = -6602870588617670262L;
private static final long serialVersionUID = -6602870588617670262L;
public RecipeException( final String n )
{
super( n );
}
public RecipeException(final String n) {
super(n);
}
}
@@ -23,14 +23,11 @@
package appeng.api.exceptions;
public class RegistrationException extends Exception {
public class RegistrationException extends Exception
{
private static final long serialVersionUID = -6602870588617670263L;
private static final long serialVersionUID = -6602870588617670263L;
public RegistrationException( final String n )
{
super( n );
}
public RegistrationException(final String n) {
super(n);
}
}
@@ -23,30 +23,26 @@
package appeng.api.exceptions;
/**
* Exception due to trying to connect different security realms.
*
* Intended to signal an internal exception and not intended to be thrown by
* any 3rd party module.
* Intended to signal an internal exception and not intended to be thrown by any
* 3rd party module.
*
* @author yueh
* @version rv3
* @since rv3
*/
public class SecurityConnectionException extends FailedConnectionException
{
private static final long serialVersionUID = 5048714900434215426L;
private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms.";
public class SecurityConnectionException extends FailedConnectionException {
private static final long serialVersionUID = 5048714900434215426L;
private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms.";
public SecurityConnectionException()
{
super( DEFAULT_MESSAGE );
}
public SecurityConnectionException() {
super(DEFAULT_MESSAGE);
}
public SecurityConnectionException( String message )
{
super( message );
}
public SecurityConnectionException(String message) {
super(message);
}
}
+185 -219
View File
@@ -18,257 +18,223 @@
package appeng.api.features;
public enum AEFeature {
// stuff that has no reason for ever being turned off, or that
// is just flat out required by tons of
// important stuff.
CORE("Core", null) {
@Override
public boolean isVisible() {
return false;
}
},
public enum AEFeature
{
// stuff that has no reason for ever being turned off, or that
// is just flat out required by tons of
// important stuff.
CORE( "Core", null )
{
@Override
public boolean isVisible()
{
return false;
}
},
CERTUS_QUARTZ_WORLD_GEN("CertusQuartzWorldGen", Constants.CATEGORY_WORLD),
METEORITE_WORLD_GEN("MeteoriteWorldGen", Constants.CATEGORY_WORLD),
DECORATIVE_LIGHTS("DecorativeLights", Constants.CATEGORY_WORLD),
DECORATIVE_BLOCKS("DecorativeBlocks", Constants.CATEGORY_WORLD,
"Blocks that are not used in any essential recipes, also slabs and stairs."),
SKY_STONE_CHESTS("SkyStoneChests", Constants.CATEGORY_WORLD),
SPAWN_PRESSES_IN_METEORITES("SpawnPressesInMeteorites", Constants.CATEGORY_WORLD),
FLOUR("Flour", Constants.CATEGORY_WORLD), CHEST_LOOT("ChestLoot", Constants.CATEGORY_WORLD),
VILLAGER_TRADING("VillagerTrading", Constants.CATEGORY_WORLD), TINY_TNT("TinyTNT", Constants.CATEGORY_WORLD),
CERTUS_ORE("CertusOre", Constants.CATEGORY_WORLD), CHARGED_CERTUS_ORE("ChargedCertusOre", Constants.CATEGORY_WORLD),
CERTUS_QUARTZ_WORLD_GEN( "CertusQuartzWorldGen", Constants.CATEGORY_WORLD ),
METEORITE_WORLD_GEN( "MeteoriteWorldGen", Constants.CATEGORY_WORLD ),
DECORATIVE_LIGHTS( "DecorativeLights", Constants.CATEGORY_WORLD ),
DECORATIVE_BLOCKS( "DecorativeBlocks", Constants.CATEGORY_WORLD, "Blocks that are not used in any essential recipes, also slabs and stairs." ),
SKY_STONE_CHESTS( "SkyStoneChests", Constants.CATEGORY_WORLD ),
SPAWN_PRESSES_IN_METEORITES( "SpawnPressesInMeteorites", Constants.CATEGORY_WORLD ),
FLOUR( "Flour", Constants.CATEGORY_WORLD ),
CHEST_LOOT( "ChestLoot", Constants.CATEGORY_WORLD ),
VILLAGER_TRADING( "VillagerTrading", Constants.CATEGORY_WORLD ),
TINY_TNT( "TinyTNT", Constants.CATEGORY_WORLD ),
CERTUS_ORE( "CertusOre", Constants.CATEGORY_WORLD ),
CHARGED_CERTUS_ORE( "ChargedCertusOre", Constants.CATEGORY_WORLD ),
GRIND_STONE("GrindStone", Constants.CATEGORY_MACHINES), INSCRIBER("Inscriber", Constants.CATEGORY_MACHINES),
CHARGER("Charger", Constants.CATEGORY_MACHINES),
CRYSTAL_GROWTH_ACCELERATOR("CrystalGrowthAccelerator", Constants.CATEGORY_MACHINES),
POWER_GEN("VibrationChamber", Constants.CATEGORY_MACHINES),
GRIND_STONE( "GrindStone", Constants.CATEGORY_MACHINES ),
INSCRIBER( "Inscriber", Constants.CATEGORY_MACHINES ),
CHARGER( "Charger", Constants.CATEGORY_MACHINES ),
CRYSTAL_GROWTH_ACCELERATOR( "CrystalGrowthAccelerator", Constants.CATEGORY_MACHINES ),
POWER_GEN( "VibrationChamber", Constants.CATEGORY_MACHINES ),
POWERED_TOOLS("PoweredTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS),
CERTUS_QUARTZ_TOOLS("CertusQuartzTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS),
NETHER_QUARTZ_TOOLS("NetherQuartzTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS),
POWERED_TOOLS( "PoweredTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS ),
CERTUS_QUARTZ_TOOLS( "CertusQuartzTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS ),
NETHER_QUARTZ_TOOLS( "NetherQuartzTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS ),
QUARTZ_HOE("QuartzHoe", Constants.CATEGORY_TOOLS), QUARTZ_SPADE("QuartzSpade", Constants.CATEGORY_TOOLS),
QUARTZ_SWORD("QuartzSword", Constants.CATEGORY_TOOLS), QUARTZ_PICKAXE("QuartzPickaxe", Constants.CATEGORY_TOOLS),
QUARTZ_AXE("QuartzAxe", Constants.CATEGORY_TOOLS), QUARTZ_KNIFE("QuartzKnife", Constants.CATEGORY_TOOLS),
QUARTZ_WRENCH("QuartzWrench", Constants.CATEGORY_TOOLS), CHARGED_STAFF("ChargedStaff", Constants.CATEGORY_TOOLS),
ENTROPY_MANIPULATOR("EntropyManipulator", Constants.CATEGORY_TOOLS),
MATTER_CANNON("MatterCannon", Constants.CATEGORY_TOOLS),
WIRELESS_ACCESS_TERMINAL("WirelessAccessTerminal", Constants.CATEGORY_TOOLS),
COLOR_APPLICATOR("ColorApplicator", Constants.CATEGORY_TOOLS),
METEORITE_COMPASS("MeteoriteCompass", Constants.CATEGORY_TOOLS),
QUARTZ_HOE( "QuartzHoe", Constants.CATEGORY_TOOLS ),
QUARTZ_SPADE( "QuartzSpade", Constants.CATEGORY_TOOLS ),
QUARTZ_SWORD( "QuartzSword", Constants.CATEGORY_TOOLS ),
QUARTZ_PICKAXE( "QuartzPickaxe", Constants.CATEGORY_TOOLS ),
QUARTZ_AXE( "QuartzAxe", Constants.CATEGORY_TOOLS ),
QUARTZ_KNIFE( "QuartzKnife", Constants.CATEGORY_TOOLS ),
QUARTZ_WRENCH( "QuartzWrench", Constants.CATEGORY_TOOLS ),
CHARGED_STAFF( "ChargedStaff", Constants.CATEGORY_TOOLS ),
ENTROPY_MANIPULATOR( "EntropyManipulator", Constants.CATEGORY_TOOLS ),
MATTER_CANNON( "MatterCannon", Constants.CATEGORY_TOOLS ),
WIRELESS_ACCESS_TERMINAL( "WirelessAccessTerminal", Constants.CATEGORY_TOOLS ),
COLOR_APPLICATOR( "ColorApplicator", Constants.CATEGORY_TOOLS ),
METEORITE_COMPASS( "MeteoriteCompass", Constants.CATEGORY_TOOLS ),
SECURITY("Security", Constants.CATEGORY_NETWORK_FEATURES),
SPATIAL_IO("SpatialIO", Constants.CATEGORY_NETWORK_FEATURES),
QUANTUM_NETWORK_BRIDGE("QuantumNetworkBridge", Constants.CATEGORY_NETWORK_FEATURES),
CHANNELS("Channels", Constants.CATEGORY_NETWORK_FEATURES),
SECURITY( "Security", Constants.CATEGORY_NETWORK_FEATURES ),
SPATIAL_IO( "SpatialIO", Constants.CATEGORY_NETWORK_FEATURES ),
QUANTUM_NETWORK_BRIDGE( "QuantumNetworkBridge", Constants.CATEGORY_NETWORK_FEATURES ),
CHANNELS( "Channels", Constants.CATEGORY_NETWORK_FEATURES ),
INTERFACE("Interface", Constants.CATEGORY_NETWORK_BUSES),
FLUID_INTERFACE("FluidInterface", Constants.CATEGORY_NETWORK_BUSES),
LEVEL_EMITTER("LevelEmitter", Constants.CATEGORY_NETWORK_BUSES),
FLUID_LEVEL_EMITTER("FluidLevelEmitter", Constants.CATEGORY_NETWORK_BUSES),
FLUID_TERMINAL("FluidTerminal", Constants.CATEGORY_NETWORK_BUSES),
CRAFTING_TERMINAL("CraftingTerminal", Constants.CATEGORY_NETWORK_BUSES),
TERMINAL("Terminal", Constants.CATEGORY_NETWORK_BUSES),
STORAGE_MONITOR("StorageMonitor", Constants.CATEGORY_NETWORK_BUSES),
P2P_TUNNEL("P2PTunnel", Constants.CATEGORY_NETWORK_BUSES),
FORMATION_PLANE("FormationPlane", Constants.CATEGORY_NETWORK_BUSES),
FLUID_FORMATION_PLANE("FluidFormationPlane", Constants.CATEGORY_NETWORK_BUSES),
ANNIHILATION_PLANE("AnnihilationPlane", Constants.CATEGORY_NETWORK_BUSES),
IDENTITY_ANNIHILATION_PLANE("IdentityAnnihilationPlane", Constants.CATEGORY_NETWORK_BUSES),
FLUID_ANNIHILATION_PLANE("FluidAnnihilationPlane", Constants.CATEGORY_NETWORK_BUSES),
IMPORT_BUS("ImportBus", Constants.CATEGORY_NETWORK_BUSES),
FLUID_IMPORT_BUS("FluidImportBus", Constants.CATEGORY_NETWORK_BUSES),
EXPORT_BUS("ExportBus", Constants.CATEGORY_NETWORK_BUSES),
FLUID_EXPORT_BUS("FluidExportBus", Constants.CATEGORY_NETWORK_BUSES),
STORAGE_BUS("StorageBus", Constants.CATEGORY_NETWORK_BUSES),
FLUID_STORAGE_BUS("FluidStorageBus", Constants.CATEGORY_NETWORK_BUSES),
PART_CONVERSION_MONITOR("PartConversionMonitor", Constants.CATEGORY_NETWORK_BUSES),
TOGGLE_BUS("ToggleBus", Constants.CATEGORY_NETWORK_BUSES), PANELS("Panels", Constants.CATEGORY_NETWORK_BUSES),
QUARTZ_FIBER("QuartzFiber", Constants.CATEGORY_NETWORK_BUSES),
CABLE_ANCHOR("CableAnchor", Constants.CATEGORY_NETWORK_BUSES),
INTERFACE( "Interface", Constants.CATEGORY_NETWORK_BUSES ),
FLUID_INTERFACE( "FluidInterface", Constants.CATEGORY_NETWORK_BUSES ),
LEVEL_EMITTER( "LevelEmitter", Constants.CATEGORY_NETWORK_BUSES ),
FLUID_LEVEL_EMITTER( "FluidLevelEmitter", Constants.CATEGORY_NETWORK_BUSES ),
FLUID_TERMINAL( "FluidTerminal", Constants.CATEGORY_NETWORK_BUSES ),
CRAFTING_TERMINAL( "CraftingTerminal", Constants.CATEGORY_NETWORK_BUSES ),
TERMINAL( "Terminal", Constants.CATEGORY_NETWORK_BUSES ),
STORAGE_MONITOR( "StorageMonitor", Constants.CATEGORY_NETWORK_BUSES ),
P2P_TUNNEL( "P2PTunnel", Constants.CATEGORY_NETWORK_BUSES ),
FORMATION_PLANE( "FormationPlane", Constants.CATEGORY_NETWORK_BUSES ),
FLUID_FORMATION_PLANE( "FluidFormationPlane", Constants.CATEGORY_NETWORK_BUSES ),
ANNIHILATION_PLANE( "AnnihilationPlane", Constants.CATEGORY_NETWORK_BUSES ),
IDENTITY_ANNIHILATION_PLANE( "IdentityAnnihilationPlane", Constants.CATEGORY_NETWORK_BUSES ),
FLUID_ANNIHILATION_PLANE( "FluidAnnihilationPlane", Constants.CATEGORY_NETWORK_BUSES ),
IMPORT_BUS( "ImportBus", Constants.CATEGORY_NETWORK_BUSES ),
FLUID_IMPORT_BUS( "FluidImportBus", Constants.CATEGORY_NETWORK_BUSES ),
EXPORT_BUS( "ExportBus", Constants.CATEGORY_NETWORK_BUSES ),
FLUID_EXPORT_BUS( "FluidExportBus", Constants.CATEGORY_NETWORK_BUSES ),
STORAGE_BUS( "StorageBus", Constants.CATEGORY_NETWORK_BUSES ),
FLUID_STORAGE_BUS( "FluidStorageBus", Constants.CATEGORY_NETWORK_BUSES ),
PART_CONVERSION_MONITOR( "PartConversionMonitor", Constants.CATEGORY_NETWORK_BUSES ),
TOGGLE_BUS( "ToggleBus", Constants.CATEGORY_NETWORK_BUSES ),
PANELS( "Panels", Constants.CATEGORY_NETWORK_BUSES ),
QUARTZ_FIBER( "QuartzFiber", Constants.CATEGORY_NETWORK_BUSES ),
CABLE_ANCHOR( "CableAnchor", Constants.CATEGORY_NETWORK_BUSES ),
PORTABLE_CELL("PortableCell", Constants.CATEGORY_PORTABLE_CELL),
PORTABLE_CELL( "PortableCell", Constants.CATEGORY_PORTABLE_CELL ),
STORAGE_CELLS("StorageCells", Constants.CATEGORY_STORAGE), ME_CHEST("MEChest", Constants.CATEGORY_STORAGE),
ME_DRIVE("MEDrive", Constants.CATEGORY_STORAGE), IO_PORT("IOPort", Constants.CATEGORY_STORAGE),
CONDENSER("Condenser", Constants.CATEGORY_STORAGE),
STORAGE_CELLS( "StorageCells", Constants.CATEGORY_STORAGE ),
ME_CHEST( "MEChest", Constants.CATEGORY_STORAGE ),
ME_DRIVE( "MEDrive", Constants.CATEGORY_STORAGE ),
IO_PORT( "IOPort", Constants.CATEGORY_STORAGE ),
CONDENSER( "Condenser", Constants.CATEGORY_STORAGE ),
NETWORK_TOOL("NetworkTool", Constants.CATEGORY_NETWORK_TOOL),
MEMORY_CARD("MemoryCard", Constants.CATEGORY_NETWORK_TOOL),
NETWORK_TOOL( "NetworkTool", Constants.CATEGORY_NETWORK_TOOL ),
MEMORY_CARD( "MemoryCard", Constants.CATEGORY_NETWORK_TOOL ),
GLASS_CABLES("GlassCables", Constants.CATEGORY_CABLES), COVERED_CABLES("CoveredCables", Constants.CATEGORY_CABLES),
SMART_CABLES("SmartCables", Constants.CATEGORY_CABLES), DENSE_CABLES("DenseCables", Constants.CATEGORY_CABLES),
GLASS_CABLES( "GlassCables", Constants.CATEGORY_CABLES ),
COVERED_CABLES( "CoveredCables", Constants.CATEGORY_CABLES ),
SMART_CABLES( "SmartCables", Constants.CATEGORY_CABLES ),
DENSE_CABLES( "DenseCables", Constants.CATEGORY_CABLES ),
ENERGY_CELLS("EnergyCells", Constants.CATEGORY_ENERGY),
ENERGY_ACCEPTOR("EnergyAcceptor", Constants.CATEGORY_ENERGY),
DENSE_ENERGY_CELLS("DenseEnergyCells", Constants.CATEGORY_ENERGY),
ENERGY_CELLS( "EnergyCells", Constants.CATEGORY_ENERGY ),
ENERGY_ACCEPTOR( "EnergyAcceptor", Constants.CATEGORY_ENERGY ),
DENSE_ENERGY_CELLS( "DenseEnergyCells", Constants.CATEGORY_ENERGY ),
P2P_TUNNEL_ME("P2PTunnelME", Constants.CATEGORY_P2P_TUNNELS),
P2P_TUNNEL_ITEMS("P2PTunnelItems", Constants.CATEGORY_P2P_TUNNELS),
P2P_TUNNEL_REDSTONE("P2PTunnelRedstone", Constants.CATEGORY_P2P_TUNNELS),
P2P_TUNNEL_EU("P2PTunnelEU", Constants.CATEGORY_P2P_TUNNELS),
P2P_TUNNEL_FE("P2PTunnelFE", Constants.CATEGORY_P2P_TUNNELS),
P2P_TUNNEL_FLUIDS("P2PTunnelFluids", Constants.CATEGORY_P2P_TUNNELS),
P2P_TUNNEL_LIGHT("P2PTunnelLight", Constants.CATEGORY_P2P_TUNNELS),
P2P_TUNNEL_OPEN_COMPUTERS("P2PTunnelOpenComputers", Constants.CATEGORY_P2P_TUNNELS),
P2P_TUNNEL_PRESSURE("P2PTunnelPressure", Constants.CATEGORY_P2P_TUNNELS),
P2P_TUNNEL_ME( "P2PTunnelME", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_ITEMS( "P2PTunnelItems", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_REDSTONE( "P2PTunnelRedstone", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_EU( "P2PTunnelEU", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_FE( "P2PTunnelFE", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_FLUIDS( "P2PTunnelFluids", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_LIGHT( "P2PTunnelLight", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_OPEN_COMPUTERS( "P2PTunnelOpenComputers", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_PRESSURE( "P2PTunnelPressure", Constants.CATEGORY_P2P_TUNNELS ),
MASS_CANNON_BLOCK_DAMAGE("MassCannonBlockDamage", Constants.CATEGORY_BLOCK_FEATURES),
TINY_TNT_BLOCK_DAMAGE("TinyTNTBlockDamage", Constants.CATEGORY_BLOCK_FEATURES),
MASS_CANNON_BLOCK_DAMAGE( "MassCannonBlockDamage", Constants.CATEGORY_BLOCK_FEATURES ),
TINY_TNT_BLOCK_DAMAGE( "TinyTNTBlockDamage", Constants.CATEGORY_BLOCK_FEATURES ),
FACADES("Facades", Constants.CATEGORY_FACADES),
FACADES( "Facades", Constants.CATEGORY_FACADES ),
UNSUPPORTED_DEVELOPER_TOOLS("UnsupportedDeveloperTools", Constants.CATEGORY_MISC, false),
CREATIVE("Creative", Constants.CATEGORY_MISC), GRINDER_LOGGING("GrinderLogging", Constants.CATEGORY_MISC, false),
LOGGING("Logging", Constants.CATEGORY_MISC),
INTEGRATION_LOGGING("IntegrationLogging", Constants.CATEGORY_MISC, false),
WEBSITE_RECIPES("WebsiteRecipes", Constants.CATEGORY_MISC, false),
LOG_SECURITY_AUDITS("LogSecurityAudits", Constants.CATEGORY_MISC, false),
ACHIEVEMENTS("Achievements", Constants.CATEGORY_MISC),
UPDATE_LOGGING("UpdateLogging", Constants.CATEGORY_MISC, false),
PACKET_LOGGING("PacketLogging", Constants.CATEGORY_MISC, false),
CRAFTING_LOG("CraftingLog", Constants.CATEGORY_MISC, false),
LIGHT_DETECTOR("LightDetector", Constants.CATEGORY_MISC),
DEBUG_LOGGING("DebugLogging", Constants.CATEGORY_MISC, false),
UNSUPPORTED_DEVELOPER_TOOLS( "UnsupportedDeveloperTools", Constants.CATEGORY_MISC, false ),
CREATIVE( "Creative", Constants.CATEGORY_MISC ),
GRINDER_LOGGING( "GrinderLogging", Constants.CATEGORY_MISC, false ),
LOGGING( "Logging", Constants.CATEGORY_MISC ),
INTEGRATION_LOGGING( "IntegrationLogging", Constants.CATEGORY_MISC, false ),
WEBSITE_RECIPES( "WebsiteRecipes", Constants.CATEGORY_MISC, false ),
LOG_SECURITY_AUDITS( "LogSecurityAudits", Constants.CATEGORY_MISC, false ),
ACHIEVEMENTS( "Achievements", Constants.CATEGORY_MISC ),
UPDATE_LOGGING( "UpdateLogging", Constants.CATEGORY_MISC, false ),
PACKET_LOGGING( "PacketLogging", Constants.CATEGORY_MISC, false ),
CRAFTING_LOG( "CraftingLog", Constants.CATEGORY_MISC, false ),
LIGHT_DETECTOR( "LightDetector", Constants.CATEGORY_MISC ),
DEBUG_LOGGING( "DebugLogging", Constants.CATEGORY_MISC, false ),
ENABLE_FACADE_CRAFTING("EnableFacadeCrafting", Constants.CATEGORY_CRAFTING),
IN_WORLD_SINGULARITY("InWorldSingularity", Constants.CATEGORY_CRAFTING),
IN_WORLD_FLUIX("InWorldFluix", Constants.CATEGORY_CRAFTING),
IN_WORLD_PURIFICATION("InWorldPurification", Constants.CATEGORY_CRAFTING),
INTERFACE_TERMINAL("InterfaceTerminal", Constants.CATEGORY_CRAFTING),
ENABLE_DISASSEMBLY_CRAFTING("EnableDisassemblyCrafting", Constants.CATEGORY_CRAFTING),
ENABLE_FACADE_CRAFTING( "EnableFacadeCrafting", Constants.CATEGORY_CRAFTING ),
IN_WORLD_SINGULARITY( "InWorldSingularity", Constants.CATEGORY_CRAFTING ),
IN_WORLD_FLUIX( "InWorldFluix", Constants.CATEGORY_CRAFTING ),
IN_WORLD_PURIFICATION( "InWorldPurification", Constants.CATEGORY_CRAFTING ),
INTERFACE_TERMINAL( "InterfaceTerminal", Constants.CATEGORY_CRAFTING ),
ENABLE_DISASSEMBLY_CRAFTING( "EnableDisassemblyCrafting", Constants.CATEGORY_CRAFTING ),
ALPHA_PASS("AlphaPass", Constants.CATEGORY_RENDERING), PAINT_BALLS("PaintBalls", Constants.CATEGORY_TOOLS),
ALPHA_PASS( "AlphaPass", Constants.CATEGORY_RENDERING ),
PAINT_BALLS( "PaintBalls", Constants.CATEGORY_TOOLS ),
MOLECULAR_ASSEMBLER("MolecularAssembler", Constants.CATEGORY_CRAFTING_FEATURES),
PATTERNS("Patterns", Constants.CATEGORY_CRAFTING_FEATURES),
CRAFTING_CPU("CraftingCPU", Constants.CATEGORY_CRAFTING_FEATURES),
MOLECULAR_ASSEMBLER( "MolecularAssembler", Constants.CATEGORY_CRAFTING_FEATURES ),
PATTERNS( "Patterns", Constants.CATEGORY_CRAFTING_FEATURES ),
CRAFTING_CPU( "CraftingCPU", Constants.CATEGORY_CRAFTING_FEATURES ),
BASIC_CARDS("BasicCards", Constants.CATEGORY_UPGRADES),
ADVANCED_CARDS("AdvancedCards", Constants.CATEGORY_UPGRADES), VIEW_CELL("ViewCell", Constants.CATEGORY_UPGRADES),
BASIC_CARDS( "BasicCards", Constants.CATEGORY_UPGRADES ),
ADVANCED_CARDS( "AdvancedCards", Constants.CATEGORY_UPGRADES ),
VIEW_CELL( "ViewCell", Constants.CATEGORY_UPGRADES ),
CRYSTAL_SEEDS("CrystalSeeds", Constants.CATEGORY_MATERIALS),
PURE_CRYSTALS("PureCrystals", Constants.CATEGORY_MATERIALS), CERTUS("Certus", Constants.CATEGORY_MATERIALS),
FLUIX("Fluix", Constants.CATEGORY_MATERIALS), SILICON("Silicon", Constants.CATEGORY_MATERIALS),
DUSTS("Dusts", Constants.CATEGORY_MATERIALS), NUGGETS("Nuggets", Constants.CATEGORY_MATERIALS),
QUARTZ_GLASS("QuartzGlass", Constants.CATEGORY_MATERIALS), SKY_STONE("SkyStone", Constants.CATEGORY_MATERIALS),
CRYSTAL_SEEDS( "CrystalSeeds", Constants.CATEGORY_MATERIALS ),
PURE_CRYSTALS( "PureCrystals", Constants.CATEGORY_MATERIALS ),
CERTUS( "Certus", Constants.CATEGORY_MATERIALS ),
FLUIX( "Fluix", Constants.CATEGORY_MATERIALS ),
SILICON( "Silicon", Constants.CATEGORY_MATERIALS ),
DUSTS( "Dusts", Constants.CATEGORY_MATERIALS ),
NUGGETS( "Nuggets", Constants.CATEGORY_MATERIALS ),
QUARTZ_GLASS( "QuartzGlass", Constants.CATEGORY_MATERIALS ),
SKY_STONE( "SkyStone", Constants.CATEGORY_MATERIALS ),
PROCESSORS("Processors", Constants.CATEGORY_COMPONENTS),
PRINTED_CIRCUITS("PrintedCircuits", Constants.CATEGORY_COMPONENTS),
PRESSES("Presses", Constants.CATEGORY_COMPONENTS), MATTER_BALL("MatterBall", Constants.CATEGORY_COMPONENTS),
CORES("Cores", Constants.CATEGORY_COMPONENTS),
PROCESSORS( "Processors", Constants.CATEGORY_COMPONENTS ),
PRINTED_CIRCUITS( "PrintedCircuits", Constants.CATEGORY_COMPONENTS ),
PRESSES( "Presses", Constants.CATEGORY_COMPONENTS ),
MATTER_BALL( "MatterBall", Constants.CATEGORY_COMPONENTS ),
CORES( "Cores", Constants.CATEGORY_COMPONENTS ),
CHUNK_LOGGER_TRACE("ChunkLoggerTrace", Constants.CATEGORY_COMMANDS, false);
CHUNK_LOGGER_TRACE( "ChunkLoggerTrace", Constants.CATEGORY_COMMANDS, false );
private final String key;
private final String category;
private final boolean enabled;
private final String comment;
private final String key;
private final String category;
private final boolean enabled;
private final String comment;
AEFeature(final String key, final String cat) {
this(key, cat, true);
}
AEFeature( final String key, final String cat )
{
this( key, cat, true );
}
AEFeature(final String key, final String cat, final String comment) {
this(key, cat, true, comment);
}
AEFeature( final String key, final String cat, final String comment )
{
this( key, cat, true, comment );
}
AEFeature(final String key, final String cat, final boolean enabled) {
this(key, cat, enabled, null);
}
AEFeature( final String key, final String cat, final boolean enabled )
{
this( key, cat, enabled, null );
}
AEFeature(final String key, final String cat, final boolean enabled, final String comment) {
this.key = key;
this.category = cat;
this.enabled = enabled;
this.comment = comment;
}
AEFeature( final String key, final String cat, final boolean enabled, final String comment )
{
this.key = key;
this.category = cat;
this.enabled = enabled;
this.comment = comment;
}
/**
* override to set visibility
*
* @return default true
*/
public boolean isVisible() {
return true;
}
/**
* override to set visibility
*
* @return default true
*/
public boolean isVisible()
{
return true;
}
public String key() {
return this.key;
}
public String key()
{
return this.key;
}
public String category() {
return this.category;
}
public String category()
{
return this.category;
}
public boolean isEnabled() {
return this.enabled;
}
public boolean isEnabled()
{
return this.enabled;
}
public String comment() {
return this.comment;
}
public String comment()
{
return this.comment;
}
private enum Constants {
;
private enum Constants
{
;
private static final String CATEGORY_MISC = "Misc";
private static final String CATEGORY_CRAFTING = "Crafting";
private static final String CATEGORY_WORLD = "World";
private static final String CATEGORY_MACHINES = "Machines";
private static final String CATEGORY_TOOLS = "Tools";
private static final String CATEGORY_TOOLS_CLASSIFICATIONS = "ToolsClassifications";
private static final String CATEGORY_NETWORK_BUSES = "NetworkBuses";
private static final String CATEGORY_P2P_TUNNELS = "P2PTunnels";
private static final String CATEGORY_BLOCK_FEATURES = "BlockFeatures";
private static final String CATEGORY_CRAFTING_FEATURES = "CraftingFeatures";
private static final String CATEGORY_STORAGE = "Storage";
private static final String CATEGORY_CABLES = "Cables";
private static final String CATEGORY_NETWORK_FEATURES = "NetworkFeatures";
private static final String CATEGORY_COMMANDS = "Commands";
private static final String CATEGORY_RENDERING = "Rendering";
private static final String CATEGORY_FACADES = "Facades";
private static final String CATEGORY_NETWORK_TOOL = "NetworkTool";
private static final String CATEGORY_PORTABLE_CELL = "PortableCell";
private static final String CATEGORY_ENERGY = "Energy";
private static final String CATEGORY_UPGRADES = "Upgrades";
private static final String CATEGORY_MATERIALS = "Materials";
private static final String CATEGORY_COMPONENTS = "CraftingComponents";
}
private static final String CATEGORY_MISC = "Misc";
private static final String CATEGORY_CRAFTING = "Crafting";
private static final String CATEGORY_WORLD = "World";
private static final String CATEGORY_MACHINES = "Machines";
private static final String CATEGORY_TOOLS = "Tools";
private static final String CATEGORY_TOOLS_CLASSIFICATIONS = "ToolsClassifications";
private static final String CATEGORY_NETWORK_BUSES = "NetworkBuses";
private static final String CATEGORY_P2P_TUNNELS = "P2PTunnels";
private static final String CATEGORY_BLOCK_FEATURES = "BlockFeatures";
private static final String CATEGORY_CRAFTING_FEATURES = "CraftingFeatures";
private static final String CATEGORY_STORAGE = "Storage";
private static final String CATEGORY_CABLES = "Cables";
private static final String CATEGORY_NETWORK_FEATURES = "NetworkFeatures";
private static final String CATEGORY_COMMANDS = "Commands";
private static final String CATEGORY_RENDERING = "Rendering";
private static final String CATEGORY_FACADES = "Facades";
private static final String CATEGORY_NETWORK_TOOL = "NetworkTool";
private static final String CATEGORY_PORTABLE_CELL = "PortableCell";
private static final String CATEGORY_ENERGY = "Energy";
private static final String CATEGORY_UPGRADES = "Upgrades";
private static final String CATEGORY_MATERIALS = "Materials";
private static final String CATEGORY_COMPONENTS = "CraftingComponents";
}
}
@@ -23,7 +23,6 @@
package appeng.api.features;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
@@ -31,54 +30,57 @@ import net.minecraft.item.Item;
import appeng.api.implementations.items.IAEItemPowerStorage;
/**
* A registry to allow mapping {@link Item}s to a specific charge rate when being placed inside a charger.
* A registry to allow mapping {@link Item}s to a specific charge rate when
* being placed inside a charger.
*
* The registry is used in favor of an additional method for {@link IAEItemPowerStorage} with a fixed value per item.
* This allows more flexibility for other charger like machines to choose their own values when needed.
* The registry is used in favor of an additional method for
* {@link IAEItemPowerStorage} with a fixed value per item. This allows more
* flexibility for other charger like machines to choose their own values when
* needed.
*
* There is no guarantee that this is charged per tick, it only represents the value per operation.
* By default this is one charging operation every 10 ticks in case of an AE2 charger.
* There is no guarantee that this is charged per tick, it only represents the
* value per operation. By default this is one charging operation every 10 ticks
* in case of an AE2 charger.
*
* @author yueh
* @version rv5
* @since rv5
*/
public interface IChargerRegistry
{
public interface IChargerRegistry {
/**
* Fetch a charge rate for a specific item.
*
* The specific item does not need to have a mapping registered at all.
* In this case it will use a default value of 160 AE.
*
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
* @return custom rate or default of 160
*/
@Nonnegative
double getChargeRate( @Nonnull Item item );
/**
* Fetch a charge rate for a specific item.
*
* The specific item does not need to have a mapping registered at all. In this
* case it will use a default value of 160 AE.
*
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
* @return custom rate or default of 160
*/
@Nonnegative
double getChargeRate(@Nonnull Item item);
/**
* Register a custom charge rate for a specific item.
*
* Capped at 16000 to avoid extracting too much energy from a network for each operation.
* This is done silently without any feedback or exception.
* Further the cap is not fixed, it can change at any time in the future should power issues arise.
*
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
* @param chargeRate the custom rate, must be > 0, capped to 16000d
*/
void addChargeRate( @Nonnull Item item, @Nonnegative double chargeRate );
/**
* Register a custom charge rate for a specific item.
*
* Capped at 16000 to avoid extracting too much energy from a network for each
* operation. This is done silently without any feedback or exception. Further
* the cap is not fixed, it can change at any time in the future should power
* issues arise.
*
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
* @param chargeRate the custom rate, must be > 0, capped to 16000d
*/
void addChargeRate(@Nonnull Item item, @Nonnegative double chargeRate);
/**
* Remove the custom rate for a specific item.
*
* It will revert to the default value afterwards.
*
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
*/
void removeChargeRate( @Nonnull Item item );
/**
* Remove the custom rate for a specific item.
*
* It will revert to the default value afterwards.
*
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
*/
void removeChargeRate(@Nonnull Item item);
}
@@ -23,10 +23,8 @@
package appeng.api.features;
public interface IItemComparison {
boolean sameAsPrecise(IItemComparison comp);
public interface IItemComparison
{
boolean sameAsPrecise( IItemComparison comp );
boolean sameAsFuzzy( IItemComparison comp );
boolean sameAsFuzzy(IItemComparison comp);
}
@@ -23,34 +23,32 @@
package appeng.api.features;
import net.minecraft.item.ItemStack;
/**
* Provider for special comparisons. when an item is encountered AE Will request
* if the comparison function handles the item, by trying to request a
* IItemComparison class.
*/
public interface IItemComparisonProvider
{
public interface IItemComparisonProvider {
/**
* should return a new IItemComparison, or return null if it doesn't handle
* the supplied item.
*
* @param is item
*
* @return IItemComparison, or null
*/
IItemComparison getComparison( ItemStack is );
/**
* should return a new IItemComparison, or return null if it doesn't handle the
* supplied item.
*
* @param is item
*
* @return IItemComparison, or null
*/
IItemComparison getComparison(ItemStack is);
/**
* Simple test for support ( AE generally skips this and calls the above function. )
*
* @param stack item
*
* @return true, if getComparison will return a valid IItemComparison Object
*/
boolean canHandle( ItemStack stack );
/**
* Simple test for support ( AE generally skips this and calls the above
* function. )
*
* @param stack item
*
* @return true, if getComparison will return a valid IItemComparison Object
*/
boolean canHandle(ItemStack stack);
}
@@ -23,19 +23,17 @@
package appeng.api.features;
import appeng.api.events.LocatableEventAnnounce;
/**
* A registration record for the {@link ILocatableRegistry} use the {@link LocatableEventAnnounce} event on the Forge
* Event bus to update the registry.
* A registration record for the {@link ILocatableRegistry} use the
* {@link LocatableEventAnnounce} event on the Forge Event bus to update the
* registry.
*/
public interface ILocatable
{
public interface ILocatable {
/**
* @return the serial for a locatable object
*/
long getLocatableSerial();
/**
* @return the serial for a locatable object
*/
long getLocatableSerial();
}
@@ -23,19 +23,17 @@
package appeng.api.features;
/**
* A Registry for locatable items, works based on serial numbers.
*/
public interface ILocatableRegistry
{
public interface ILocatableRegistry {
/**
* Gets the {@link ILocatable} with the registered serial, if available
*
* @param serial serial
*
* @return requestedObject, or null, if the object does not exist anymore
*/
ILocatable getLocatableBy( long serial );
/**
* Gets the {@link ILocatable} with the registered serial, if available
*
* @param serial serial
*
* @return requestedObject, or null, if the object does not exist anymore
*/
ILocatable getLocatableBy(long serial);
}
@@ -23,27 +23,25 @@
package appeng.api.features;
import net.minecraft.item.ItemStack;
public interface IMatterCannonAmmoRegistry {
public interface IMatterCannonAmmoRegistry
{
/**
* register a new ammo, generally speaking this is based off of atomic weight to
* make it easier to guess at
*
* @param ammo new ammo
* @param weight atomic weight
*/
void registerAmmo(ItemStack ammo, double weight);
/**
* register a new ammo, generally speaking this is based off of atomic weight to make it easier to guess at
*
* @param ammo new ammo
* @param weight atomic weight
*/
void registerAmmo( ItemStack ammo, double weight );
/**
* get the penetration value for a particular ammo, 0 indicates a non-ammo.
*
* @param is ammo
*
* @return 0 or a valid penetration value.
*/
float getPenetration( ItemStack is );
/**
* get the penetration value for a particular ammo, 0 indicates a non-ammo.
*
* @param is ammo
*
* @return 0 or a valid penetration value.
*/
float getPenetration(ItemStack is);
}
@@ -23,28 +23,25 @@
package appeng.api.features;
import net.minecraft.item.ItemStack;
public interface INetworkEncodable {
public interface INetworkEncodable
{
/**
* Used to get the current key from the item.
*
* @param item item
*
* @return string key of item
*/
String getEncryptionKey(ItemStack item);
/**
* Used to get the current key from the item.
*
* @param item item
*
* @return string key of item
*/
String getEncryptionKey( ItemStack item );
/**
* Encode the wireless frequency via the Controller.
*
* @param item the wireless terminal.
* @param encKey the wireless encryption key.
* @param name null for now.
*/
void setEncryptionKey( ItemStack item, String encKey, String name );
/**
* Encode the wireless frequency via the Controller.
*
* @param item the wireless terminal.
* @param encKey the wireless encryption key.
* @param name null for now.
*/
void setEncryptionKey(ItemStack item, String encKey, String name);
}
@@ -23,7 +23,6 @@
package appeng.api.features;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -32,33 +31,32 @@ import net.minecraftforge.common.capabilities.Capability;
import appeng.api.config.TunnelType;
/**
* A Registry for how p2p Tunnels are attuned
*/
public interface IP2PTunnelRegistry
{
public interface IP2PTunnelRegistry {
/**
* Allows third parties to register items from their mod as potential
* attunements for AE's P2P Tunnels
*
* @param trigger - the item which triggers attunement. Nullable, but then ignored
* @param type - the type of tunnel. Nullable, but then ignored
*/
void addNewAttunement( @Nonnull ItemStack trigger, @Nullable TunnelType type );
/**
* Allows third parties to register items from their mod as potential
* attunements for AE's P2P Tunnels
*
* @param trigger - the item which triggers attunement. Nullable, but then
* ignored
* @param type - the type of tunnel. Nullable, but then ignored
*/
void addNewAttunement(@Nonnull ItemStack trigger, @Nullable TunnelType type);
void addNewAttunement( @Nonnull String ModId, @Nullable TunnelType type );
void addNewAttunement(@Nonnull String ModId, @Nullable TunnelType type);
void addNewAttunement( @Nonnull Capability<?> cap, @Nullable TunnelType type );
void addNewAttunement(@Nonnull Capability<?> cap, @Nullable TunnelType type);
/**
* returns null if no attunement can be found.
*
* @param trigger attunement trigger
*
* @return null if no attunement can be found or attunement
*/
@Nonnull
TunnelType getTunnelTypeByItem( ItemStack trigger );
/**
* returns null if no attunement can be found.
*
* @param trigger attunement trigger
*
* @return null if no attunement can be found or attunement
*/
@Nonnull
TunnelType getTunnelTypeByItem(ItemStack trigger);
}
@@ -23,40 +23,38 @@
package appeng.api.features;
import javax.annotation.Nullable;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.PlayerEntity;
/**
* Maintains a save specific list of userids and username combinations this greatly simplifies storage internally and
* gives a common place to look up and get IDs for the security framework.
* Maintains a save specific list of userids and username combinations this
* greatly simplifies storage internally and gives a common place to look up and
* get IDs for the security framework.
*/
public interface IPlayerRegistry
{
public interface IPlayerRegistry {
/**
* @param gameProfile user game profile
*
* @return user id of a username.
*/
int getID( GameProfile gameProfile );
/**
* @param gameProfile user game profile
*
* @return user id of a username.
*/
int getID(GameProfile gameProfile);
/**
* @param player player
*
* @return user id of a player entity.
*/
int getID( PlayerEntity player );
/**
* @param player player
*
* @return user id of a player entity.
*/
int getID(PlayerEntity player);
/**
* @param playerID to be found player id
*
* @return PlayerEntity, or null if the player could not be found.
*/
@Nullable
PlayerEntity findPlayer( int playerID );
/**
* @param playerID to be found player id
*
* @return PlayerEntity, or null if the player could not be found.
*/
@Nullable
PlayerEntity findPlayer(int playerID);
}
@@ -23,14 +23,12 @@
package appeng.api.features;
import appeng.api.AEInjectable;
import appeng.api.movable.IMovableRegistry;
import appeng.api.networking.IGridCacheRegistry;
import appeng.api.parts.IPartModels;
import appeng.api.storage.ICellRegistry;
/**
* @author AlgorithmX2
* @author thatsIch
@@ -39,66 +37,66 @@ import appeng.api.storage.ICellRegistry;
* @since rv0
*/
@AEInjectable
public interface IRegistryContainer
{
public interface IRegistryContainer {
/**
* Use the movable registry to white list your tiles.
*/
IMovableRegistry movable();
/**
* Use the movable registry to white list your tiles.
*/
IMovableRegistry movable();
/**
* Add new Grid Caches for use during run time, only use during loading phase.
*/
IGridCacheRegistry gridCache();
/**
* Add new Grid Caches for use during run time, only use during loading phase.
*/
IGridCacheRegistry gridCache();
/**
* Add additional special comparison functionality, AE Uses this internally for Bees.
*/
ISpecialComparisonRegistry specialComparison();
/**
* Add additional special comparison functionality, AE Uses this internally for
* Bees.
*/
ISpecialComparisonRegistry specialComparison();
/**
* Lets you register your items as wireless terminals
*/
IWirelessTermRegistry wireless();
/**
* Lets you register your items as wireless terminals
*/
IWirelessTermRegistry wireless();
/**
* Allows you to register new cell types, these will function in drives
*/
ICellRegistry cell();
/**
* Allows you to register new cell types, these will function in drives
*/
ICellRegistry cell();
/**
* Manage charger via API
*/
IChargerRegistry charger();
/**
* Manage charger via API
*/
IChargerRegistry charger();
/**
* get access to the locatable registry
*/
ILocatableRegistry locatable();
/**
* get access to the locatable registry
*/
ILocatableRegistry locatable();
/**
* get access to the p2p tunnel registry.
*/
IP2PTunnelRegistry p2pTunnel();
/**
* get access to the p2p tunnel registry.
*/
IP2PTunnelRegistry p2pTunnel();
/**
* get access to the ammo registry.
*/
IMatterCannonAmmoRegistry matterCannon();
/**
* get access to the ammo registry.
*/
IMatterCannonAmmoRegistry matterCannon();
/**
* get access to the player registry
*/
IPlayerRegistry players();
/**
* get access to the player registry
*/
IPlayerRegistry players();
/**
* get access to the world-gen api.
*/
IWorldGen worldgen();
/**
* get access to the world-gen api.
*/
IWorldGen worldgen();
/**
* Register your IPart models before using them.
*/
IPartModels partModels();
/**
* Register your IPart models before using them.
*/
IPartModels partModels();
}
@@ -23,29 +23,26 @@
package appeng.api.features;
import net.minecraft.item.ItemStack;
/**
* A Registry of any special comparison handlers for AE To use.
*/
public interface ISpecialComparisonRegistry
{
public interface ISpecialComparisonRegistry {
/**
* return TheHandler or null.
*
* @param stack item
*
* @return a handler it found for a specific item
*/
IItemComparison getSpecialComparison( ItemStack stack );
/**
* return TheHandler or null.
*
* @param stack item
*
* @return a handler it found for a specific item
*/
IItemComparison getSpecialComparison(ItemStack stack);
/**
* Register a new special comparison function with AE.
*
* @param prov comparison provider
*/
void addComparisonProvider( IItemComparisonProvider prov );
/**
* Register a new special comparison function with AE.
*
* @param prov comparison provider
*/
void addComparisonProvider(IItemComparisonProvider prov);
}
@@ -23,52 +23,50 @@
package appeng.api.features;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import appeng.api.util.IConfigManager;
/**
* A handler for a wireless terminal.
*/
public interface IWirelessTermHandler extends INetworkEncodable
{
public interface IWirelessTermHandler extends INetworkEncodable {
/**
* @param is wireless terminal
*
* @return true, if usePower, hasPower, etc... can be called for the provided item
*/
boolean canHandle( ItemStack is );
/**
* @param is wireless terminal
*
* @return true, if usePower, hasPower, etc... can be called for the provided
* item
*/
boolean canHandle(ItemStack is);
/**
* use an amount of power, in AE units
*
* @param amount is in AE units ( 5 per MJ ), if you return false, the item should be dead and return false for
* hasPower
* @param is wireless terminal
*
* @return true if wireless terminal uses power
*/
boolean usePower( PlayerEntity player, double amount, ItemStack is );
/**
* use an amount of power, in AE units
*
* @param amount is in AE units ( 5 per MJ ), if you return false, the item
* should be dead and return false for hasPower
* @param is wireless terminal
*
* @return true if wireless terminal uses power
*/
boolean usePower(PlayerEntity player, double amount, ItemStack is);
/**
* gets the power status of the item.
*
* @param is wireless terminal
*
* @return returns true if there is any power left.
*/
boolean hasPower( PlayerEntity player, double amount, ItemStack is );
/**
* gets the power status of the item.
*
* @param is wireless terminal
*
* @return returns true if there is any power left.
*/
boolean hasPower(PlayerEntity player, double amount, ItemStack is);
/**
* Return the config manager for the wireless terminal.
*
* @param is wireless terminal
*
* @return config manager of wireless terminal
*/
IConfigManager getConfigManager( ItemStack is );
/**
* Return the config manager for the wireless terminal.
*
* @param is wireless terminal
*
* @return config manager of wireless terminal
*/
IConfigManager getConfigManager(ItemStack is);
}
@@ -23,44 +23,40 @@
package appeng.api.features;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import net.minecraft.world.IBlockReader;
/**
* Registration record for a Custom Cell handler.
*/
public interface IWirelessTermRegistry
{
public interface IWirelessTermRegistry {
/**
* add this handler to the list of other wireless handler.
*
* @param handler wireless handler
*/
void registerWirelessHandler( IWirelessTermHandler handler );
/**
* add this handler to the list of other wireless handler.
*
* @param handler wireless handler
*/
void registerWirelessHandler(IWirelessTermHandler handler);
/**
* @param is item which might have a handler
*
* @return true if there is a handler for this item
*/
boolean isWirelessTerminal( ItemStack is );
/**
* @param is item which might have a handler
*
* @return true if there is a handler for this item
*/
boolean isWirelessTerminal(ItemStack is);
/**
* @param is item with handler
* PlayerEntity
* @return a register handler for the item in question, or null if there
* isn't one
*/
IWirelessTermHandler getWirelessTerminalHandler( ItemStack is );
/**
* @param is item with handler PlayerEntity
* @return a register handler for the item in question, or null if there isn't
* one
*/
IWirelessTermHandler getWirelessTerminalHandler(ItemStack is);
/**
* opens the wireless terminal gui, the wireless terminal item, must be in
* the active slot on the tool bar.
*/
void openWirelessTerminalGui( ItemStack item, IBlockReader world, PlayerEntity player, Hand hand );
/**
* opens the wireless terminal gui, the wireless terminal item, must be in the
* active slot on the tool bar.
*/
void openWirelessTerminalGui(ItemStack item, IBlockReader world, PlayerEntity player, Hand hand);
}
@@ -23,25 +23,21 @@
package appeng.api.features;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.world.dimension.Dimension;
public interface IWorldGen {
public interface IWorldGen
{
void disableWorldGenForProviderID(WorldGenType type, Class<? extends Dimension> provider);
void disableWorldGenForProviderID( WorldGenType type, Class<? extends Dimension> provider );
void enableWorldGenForDimension(WorldGenType type, ResourceLocation dimID);
void enableWorldGenForDimension( WorldGenType type, ResourceLocation dimID );
void disableWorldGenForDimension(WorldGenType type, ResourceLocation dimID);
void disableWorldGenForDimension( WorldGenType type, ResourceLocation dimID );
boolean isWorldGenEnabled(WorldGenType type, World w);
boolean isWorldGenEnabled( WorldGenType type, World w );
enum WorldGenType
{
CERTUS_QUARTZ, CHARGED_CERTUS_QUARTZ, METEORITES
}
enum WorldGenType {
CERTUS_QUARTZ, CHARGED_CERTUS_QUARTZ, METEORITES
}
}
@@ -18,16 +18,14 @@
package appeng.api.features;
public enum InscriberProcessType {
/**
* uses the optionals as catalyst
*/
INSCRIBE,
public enum InscriberProcessType
{
/**
* uses the optionals as catalyst
*/
INSCRIBE,
/**
* spends the optionals
*/
PRESS
/**
* spends the optionals
*/
PRESS
}
@@ -23,27 +23,24 @@
package appeng.api.implementations;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import appeng.api.networking.crafting.ICraftingPatternDetails;
/**
* Implemented on {@link Item}
*/
public interface ICraftingPatternItem
{
public interface ICraftingPatternItem {
/**
* Access Details about a pattern
*
* @param is pattern
* @param w crafting world
*
* @return details of pattern
*/
ICraftingPatternDetails getPatternForItem( ItemStack is, World w );
/**
* Access Details about a pattern
*
* @param is pattern
* @param w crafting world
*
* @return details of pattern
*/
ICraftingPatternDetails getPatternForItem(ItemStack is, World w);
}
@@ -23,20 +23,18 @@
package appeng.api.implementations;
/**
* This is intended for use on the client side to provide details to WAILA.
*/
public interface IPowerChannelState
{
public interface IPowerChannelState {
/**
* @return true if the part/tile is powered.
*/
boolean isPowered();
/**
* @return true if the part/tile is powered.
*/
boolean isPowered();
/**
* @return true if the part/tile isActive
*/
boolean isActive();
/**
* @return true if the part/tile isActive
*/
boolean isActive();
}
@@ -23,26 +23,23 @@
package appeng.api.implementations;
import net.minecraft.tileentity.TileEntity;
import appeng.api.config.Upgrades;
import appeng.api.implementations.tiles.ISegmentedInventory;
import appeng.api.util.IConfigurableObject;
public interface IUpgradeableHost extends IConfigurableObject, ISegmentedInventory {
public interface IUpgradeableHost extends IConfigurableObject, ISegmentedInventory
{
/**
* determine how many of an upgrade are installed.
*/
int getInstalledUpgrades(Upgrades u);
/**
* determine how many of an upgrade are installed.
*/
int getInstalledUpgrades( Upgrades u );
/**
* the tile...
*
* @return tile entity
*/
TileEntity getTile();
/**
* the tile...
*
* @return tile entity
*/
TileEntity getTile();
}
@@ -23,19 +23,16 @@
package appeng.api.implementations;
/**
* Defines the result of performing a transition from the world into a storage
* cell, if its possible, and what the energy usage is.
*/
public class TransitionResult
{
public final boolean success;
public final double energyUsage;
public class TransitionResult {
public final boolean success;
public final double energyUsage;
public TransitionResult( final boolean success, final double power )
{
this.success = success;
this.energyUsage = power;
}
public TransitionResult(final boolean success, final double power) {
this.success = success;
this.energyUsage = power;
}
}
@@ -23,28 +23,27 @@
package appeng.api.implementations.guiobjects;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import javax.annotation.Nullable;
/**
* Implemented on Item objects, to return objects used to manage, and interact
* with the contents.
*/
public interface IGuiItem
{
/**
*
* @param is The item used to open the container.
* @param playerInventorySlot The slot in the player's inventory the item is in.
* @param world The world the player is in.
* @param pos If the item was used on a block in the world, has that block's position. Null if no block was targetted.
* @return Null if no GUI object is available.
*/
@Nullable
IGuiItemObject getGuiObject( ItemStack is, int playerInventorySlot, World world, @Nullable BlockPos pos );
public interface IGuiItem {
/**
*
* @param is The item used to open the container.
* @param playerInventorySlot The slot in the player's inventory the item is in.
* @param world The world the player is in.
* @param pos If the item was used on a block in the world, has
* that block's position. Null if no block was
* targetted.
* @return Null if no GUI object is available.
*/
@Nullable
IGuiItemObject getGuiObject(ItemStack is, int playerInventorySlot, World world, @Nullable BlockPos pos);
}
@@ -23,12 +23,9 @@
package appeng.api.implementations.guiobjects;
import net.minecraft.item.ItemStack;
public interface IGuiItemObject {
public interface IGuiItemObject
{
ItemStack getItemStack();
ItemStack getItemStack();
}
@@ -23,18 +23,15 @@
package appeng.api.implementations.guiobjects;
import net.minecraftforge.items.IItemHandler;
import appeng.api.networking.IGridHost;
/**
* Obtained via {@link IGuiItem} getGuiObject
*/
public interface INetworkTool extends IGuiItemObject
{
IGridHost getGridHost(); // null for most purposes.
public interface INetworkTool extends IGuiItemObject {
IGridHost getGridHost(); // null for most purposes.
IItemHandler getInventory();
IItemHandler getInventory();
}
@@ -23,17 +23,14 @@
package appeng.api.implementations.guiobjects;
import appeng.api.networking.energy.IEnergySource;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack;
/**
* Obtained via {@link IGuiItem} getGuiObject
*/
public interface IPortableCell extends ITerminalHost, IMEMonitor<IAEItemStack>, IEnergySource, IGuiItemObject
{
public interface IPortableCell extends ITerminalHost, IMEMonitor<IAEItemStack>, IEnergySource, IGuiItemObject {
}
@@ -23,53 +23,50 @@
package appeng.api.implementations.items;
import net.minecraft.item.ItemStack;
import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable;
import appeng.api.networking.energy.IAEPowerStorage;
/**
* Basically the same as {@link IAEPowerStorage}, but for items.
*/
public interface IAEItemPowerStorage
{
/**
* Inject amt, power into the device, it will store what it can, and return
* the amount unable to be stored.
*
* @return amount unable to be stored
*/
double injectAEPower( ItemStack stack, double amount, Actionable mode );
public interface IAEItemPowerStorage {
/**
* Inject amt, power into the device, it will store what it can, and return the
* amount unable to be stored.
*
* @return amount unable to be stored
*/
double injectAEPower(ItemStack stack, double amount, Actionable mode);
/**
* Attempt to extract power from the device, it will extract what it can and
* return it.
*
* @param amount to be extracted power from device
*
* @return what it could extract
*/
double extractAEPower( ItemStack stack, double amount, Actionable mode );
/**
* Attempt to extract power from the device, it will extract what it can and
* return it.
*
* @param amount to be extracted power from device
*
* @return what it could extract
*/
double extractAEPower(ItemStack stack, double amount, Actionable mode);
/**
* @return the current maximum power ( this can change :P )
*/
double getAEMaxPower( ItemStack stack );
/**
* @return the current maximum power ( this can change :P )
*/
double getAEMaxPower(ItemStack stack);
/**
* @return the current AE Power Level, this may exceed getMEMaxPower()
*/
double getAECurrentPower( ItemStack stack );
/**
* @return the current AE Power Level, this may exceed getMEMaxPower()
*/
double getAECurrentPower(ItemStack stack);
/**
* Control the power flow by telling what the network can do, either add? or
* subtract? or both!
*
* @return access restriction of network
*/
AccessRestriction getPowerFlow( ItemStack stack );
/**
* Control the power flow by telling what the network can do, either add? or
* subtract? or both!
*
* @return access restriction of network
*/
AccessRestriction getPowerFlow(ItemStack stack);
}
@@ -23,26 +23,23 @@
package appeng.api.implementations.items;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
/**
* Implemented on AE's wrench(s) as a substitute for if BC's API is not
* available.
*/
public interface IAEWrench
{
public interface IAEWrench {
/**
* Check if the wrench can be used.
*
* @param player wrenching player
* @param pos of block.
*
* @return true if wrench can be used
*/
boolean canWrench( ItemStack wrench, PlayerEntity player, BlockPos pos );
/**
* Check if the wrench can be used.
*
* @param player wrenching player
* @param pos of block.
*
* @return true if wrench can be used
*/
boolean canWrench(ItemStack wrench, PlayerEntity player, BlockPos pos);
}
@@ -23,7 +23,6 @@
package appeng.api.implementations.items;
import java.util.EnumSet;
import com.mojang.authlib.GameProfile;
@@ -34,58 +33,58 @@ import appeng.api.config.SecurityPermissions;
import appeng.api.features.IPlayerRegistry;
import appeng.api.networking.security.ISecurityRegistry;
public interface IBiometricCard {
public interface IBiometricCard
{
/**
* Set the {@link GameProfile} to null, to clear it.
*/
void setProfile(ItemStack itemStack, GameProfile username);
/**
* Set the {@link GameProfile} to null, to clear it.
*/
void setProfile( ItemStack itemStack, GameProfile username );
/**
* @return {@link GameProfile} of the player encoded on this card, or a blank
* string.
*/
GameProfile getProfile(ItemStack is);
/**
* @return {@link GameProfile} of the player encoded on this card, or a blank string.
*/
GameProfile getProfile( ItemStack is );
/**
* @param itemStack card
*
* @return the full list of permissions encoded on the card.
*/
EnumSet<SecurityPermissions> getPermissions(ItemStack itemStack);
/**
* @param itemStack card
*
* @return the full list of permissions encoded on the card.
*/
EnumSet<SecurityPermissions> getPermissions( ItemStack itemStack );
/**
* Check if a permission is encoded on the card.
*
* @param permission card
*
* @return true if this permission is set on the card.
*/
boolean hasPermission(ItemStack is, SecurityPermissions permission);
/**
* Check if a permission is encoded on the card.
*
* @param permission card
*
* @return true if this permission is set on the card.
*/
boolean hasPermission( ItemStack is, SecurityPermissions permission );
/**
* remove a permission from the item stack.
*
* @param itemStack card
* @param permission to be removed permission
*/
void removePermission(ItemStack itemStack, SecurityPermissions permission);
/**
* remove a permission from the item stack.
*
* @param itemStack card
* @param permission to be removed permission
*/
void removePermission( ItemStack itemStack, SecurityPermissions permission );
/**
* add a permission to the item stack.
*
* @param itemStack card
* @param permission to be added permission
*/
void addPermission(ItemStack itemStack, SecurityPermissions permission);
/**
* add a permission to the item stack.
*
* @param itemStack card
* @param permission to be added permission
*/
void addPermission( ItemStack itemStack, SecurityPermissions permission );
/**
* lets you handle submission of security values on the card for custom behavior.
*
* @param registry security registry
* @param pr player registry
* @param is card
*/
void registerPermissions( ISecurityRegistry registry, IPlayerRegistry pr, ItemStack is );
/**
* lets you handle submission of security values on the card for custom
* behavior.
*
* @param registry security registry
* @param pr player registry
* @param is card
*/
void registerPermissions(ISecurityRegistry registry, IPlayerRegistry pr, ItemStack is);
}
@@ -23,16 +23,13 @@
package appeng.api.implementations.items;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
public interface IGrowableCrystal {
public interface IGrowableCrystal
{
ItemStack triggerGrowth(ItemStack is);
ItemStack triggerGrowth( ItemStack is );
float getMultiplier( Block blk, Material mat );
float getMultiplier(Block blk, Material mat);
}
@@ -23,24 +23,21 @@
package appeng.api.implementations.items;
import java.util.Set;
import net.minecraft.item.ItemStack;
/**
* Lets you specify the name of the group of items this falls under.
*/
public interface IItemGroup
{
public interface IItemGroup {
/**
* returning null, is the same as not implementing the interface at all.
*
* @param is item
*
* @return an unlocalized string to use for the items group name.
*/
String getUnlocalizedGroupName( Set<ItemStack> otherItems, ItemStack is );
/**
* returning null, is the same as not implementing the interface at all.
*
* @param is item
*
* @return an unlocalized string to use for the items group name.
*/
String getUnlocalizedGroupName(Set<ItemStack> otherItems, ItemStack is);
}
@@ -23,74 +23,74 @@
package appeng.api.implementations.items;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import appeng.api.util.AEColor;
/**
* Memory Card API
*
* AE's Memory Card Item Class implements this interface.
*/
public interface IMemoryCard
{
public interface IMemoryCard {
/**
* Configures the data stored on the memory card, the SettingsName, will be
* localized when displayed.
*
* The data can contain an optional string with the key "tooltip", which will be used as
* unlocalized string to display it after the settings name.
*
* The data can contain an optional intArray using "colorCode" to be displayed on the model itself.
* It needs to have exactly 8 elements representing the ordinal of the matching {@link AEColor}.
* The first 4 values represent the top row, left to right. The second 4 the bottom row.
*
* @param is item
* @param settingsName unlocalized string that represents the tile entity.
* @param data the NBT tag, refer to the normal comment for special keys.
*/
void setMemoryCardContents( ItemStack is, String settingsName, CompoundNBT data );
/**
* Configures the data stored on the memory card, the SettingsName, will be
* localized when displayed.
*
* The data can contain an optional string with the key "tooltip", which will be
* used as unlocalized string to display it after the settings name.
*
* The data can contain an optional intArray using "colorCode" to be displayed
* on the model itself. It needs to have exactly 8 elements representing the
* ordinal of the matching {@link AEColor}. The first 4 values represent the top
* row, left to right. The second 4 the bottom row.
*
* @param is item
* @param settingsName unlocalized string that represents the tile entity.
* @param data the NBT tag, refer to the normal comment for special
* keys.
*/
void setMemoryCardContents(ItemStack is, String settingsName, CompoundNBT data);
/**
* returns the settings name provided by a previous call to
* setMemoryCardContents, or "AppEng.GuiITooltip.Blank" if there was no
* previous call to setMemoryCardContents.
*
* @param is item
*
* @return setting name
*/
String getSettingsName( ItemStack is );
/**
* returns the settings name provided by a previous call to
* setMemoryCardContents, or "AppEng.GuiITooltip.Blank" if there was no previous
* call to setMemoryCardContents.
*
* @param is item
*
* @return setting name
*/
String getSettingsName(ItemStack is);
/**
* @param is item
*
* @return the NBT Data previously saved by setMemoryCardContents, or an
* empty NBTCompound
*/
CompoundNBT getData( ItemStack is );
/**
* @param is item
*
* @return the NBT Data previously saved by setMemoryCardContents, or an empty
* NBTCompound
*/
CompoundNBT getData(ItemStack is);
/**
* This represent as 4x2 grid of {@link AEColor} without transparent/fluix color.
*
* First 4 colors are used for the top row, second for the bottom one.
*
* @param is item
*
* @return a hash representation of the memory card content
*/
AEColor[] getColorCode( ItemStack is );
/**
* This represent as 4x2 grid of {@link AEColor} without transparent/fluix
* color.
*
* First 4 colors are used for the top row, second for the bottom one.
*
* @param is item
*
* @return a hash representation of the memory card content
*/
AEColor[] getColorCode(ItemStack is);
/**
* notify the user of a outcome related to the memory card.
*
* @param player that used the card.
* @param msg which message to send.
*/
void notifyUser( PlayerEntity player, MemoryCardMessages msg );
/**
* notify the user of a outcome related to the memory card.
*
* @param player that used the card.
* @param msg which message to send.
*/
void notifyUser(PlayerEntity player, MemoryCardMessages msg);
}
@@ -23,57 +23,54 @@
package appeng.api.implementations.items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.dimension.DimensionType;
import appeng.api.implementations.TransitionResult;
import appeng.api.storage.ISpatialDimension;
import appeng.api.util.WorldCoord;
import net.minecraft.world.dimension.DimensionType;
/**
* Implemented on a {@link Item}
*/
public interface ISpatialStorageCell
{
public interface ISpatialStorageCell {
/**
* @param is spatial storage cell
*
* @return true if this item is a spatial storage cell
*/
boolean isSpatialStorage( ItemStack is );
/**
* @param is spatial storage cell
*
* @return true if this item is a spatial storage cell
*/
boolean isSpatialStorage(ItemStack is);
/**
* @param is spatial storage cell
*
* @return the maximum size of the spatial storage cell along any given axis
*/
int getMaxStoredDim( ItemStack is );
/**
* @param is spatial storage cell
*
* @return the maximum size of the spatial storage cell along any given axis
*/
int getMaxStoredDim(ItemStack is);
/**
* get the currently stored Dimension id.
*
* @param is spatial storage cell
*
* @return dimension id or -1
*/
DimensionType getStoredDimension(ItemStack is );
/**
* get the currently stored Dimension id.
*
* @param is spatial storage cell
*
* @return dimension id or -1
*/
DimensionType getStoredDimension(ItemStack is);
/**
* Perform a spatial swap with the contents of the cell, and the world.
*
* @param is spatial storage cell
* @param w world of spatial
* @param min min coord
* @param max max coord
* @param playerId owner of current grid or -1
*
* @return result of transition
*/
TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, int playerId );
/**
* Perform a spatial swap with the contents of the cell, and the world.
*
* @param is spatial storage cell
* @param w world of spatial
* @param min min coord
* @param max max coord
* @param playerId owner of current grid or -1
*
* @return result of transition
*/
TransitionResult doSpatialTransition(ItemStack is, World w, WorldCoord min, WorldCoord max, int playerId);
}
@@ -23,7 +23,6 @@
package appeng.api.implementations.items;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
@@ -32,7 +31,6 @@ import appeng.api.storage.ICellWorkbenchItem;
import appeng.api.storage.IStorageChannel;
import appeng.api.storage.data.IAEStack;
/**
* Any item which implements this can be treated as an IMEInventory via
* Util.getCell / Util.isCell It automatically handles the internals and NBT
@@ -43,79 +41,77 @@ import appeng.api.storage.data.IAEStack;
*
* The standard AE implementation only provides 1-63 Types
*/
public interface IStorageCell<T extends IAEStack<T>> extends ICellWorkbenchItem
{
public interface IStorageCell<T extends IAEStack<T>> extends ICellWorkbenchItem {
/**
* It wont work if the return is not a multiple of 8.
* The limit is ({@link Integer#MAX_VALUE} + 1) / 8.
*
* @param cellItem item
*
* @return number of bytes
*/
int getBytes( @Nonnull ItemStack cellItem );
/**
* It wont work if the return is not a multiple of 8. The limit is
* ({@link Integer#MAX_VALUE} + 1) / 8.
*
* @param cellItem item
*
* @return number of bytes
*/
int getBytes(@Nonnull ItemStack cellItem);
/**
* Determines the number of bytes used for any type included on the cell.
*
* @param cellItem item
*
* @return number of bytes
*/
int getBytesPerType( @Nonnull ItemStack cellItem );
/**
* Determines the number of bytes used for any type included on the cell.
*
* @param cellItem item
*
* @return number of bytes
*/
int getBytesPerType(@Nonnull ItemStack cellItem);
/**
* Must be between 1 and 63, indicates how many types you want to store on
* the item.
*
* @param cellItem item
*
* @return number of types
*/
int getTotalTypes( @Nonnull ItemStack cellItem );
/**
* Must be between 1 and 63, indicates how many types you want to store on the
* item.
*
* @param cellItem item
*
* @return number of types
*/
int getTotalTypes(@Nonnull ItemStack cellItem);
/**
* Allows you to fine tune which items are allowed on a given cell, if you
* don't care, just return false; As the handler for this type of cell is
* still the default cells, the normal AE black list is also applied.
*
* @param cellItem item
* @param requestedAddition requested addition
*
* @return true to preventAdditionOfItem
*/
boolean isBlackListed( @Nonnull ItemStack cellItem, @Nonnull T requestedAddition );
/**
* Allows you to fine tune which items are allowed on a given cell, if you don't
* care, just return false; As the handler for this type of cell is still the
* default cells, the normal AE black list is also applied.
*
* @param cellItem item
* @param requestedAddition requested addition
*
* @return true to preventAdditionOfItem
*/
boolean isBlackListed(@Nonnull ItemStack cellItem, @Nonnull T requestedAddition);
/**
* Allows you to specify if this storage cell can be stored inside other
* storage cells, only set this for special items like the matter cannon
* that are not general purpose storage.
*
* @return true if the storage cell can be stored inside other storage
* cells, this is generally false, except for certain situations
* such as the matter cannon.
*/
boolean storableInStorageCell();
/**
* Allows you to specify if this storage cell can be stored inside other storage
* cells, only set this for special items like the matter cannon that are not
* general purpose storage.
*
* @return true if the storage cell can be stored inside other storage cells,
* this is generally false, except for certain situations such as the
* matter cannon.
*/
boolean storableInStorageCell();
/**
* Allows an item to selectively enable or disable its status as a storage
* cell.
*
* @param i item
*
* @return if the ItemStack should behavior as a storage cell.
*/
boolean isStorageCell( @Nonnull ItemStack i );
/**
* Allows an item to selectively enable or disable its status as a storage cell.
*
* @param i item
*
* @return if the ItemStack should behavior as a storage cell.
*/
boolean isStorageCell(@Nonnull ItemStack i);
/**
* @return drain in ae/t this storage cell will use.
*/
double getIdleDrain();
/**
* @return drain in ae/t this storage cell will use.
*/
double getIdleDrain();
/**
* @return the type of channel your cell should be part of
*/
@Nonnull
IStorageChannel<T> getChannel();
/**
* @return the type of channel your cell should be part of
*/
@Nonnull
IStorageChannel<T> getChannel();
}
@@ -23,34 +23,31 @@
package appeng.api.implementations.items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
/**
* Implemented on a {@link Item}
*/
public interface IStorageComponent
{
public interface IStorageComponent {
/**
* This isn't necessarily the same as if you make a storage cell out of it,
* but all of AE's default cells do it that way, its currently only used for
* the condenser.
*
* @param is item
*
* @return number of bytes
*/
int getBytes( ItemStack is );
/**
* This isn't necessarily the same as if you make a storage cell out of it, but
* all of AE's default cells do it that way, its currently only used for the
* condenser.
*
* @param is item
*
* @return number of bytes
*/
int getBytes(ItemStack is);
/**
* Just true or false for the item stack.
*
* @param is item
*
* @return true if item is a storage component
*/
boolean isStorageComponent( ItemStack is );
/**
* Just true or false for the item stack.
*
* @param is item
*
* @return true if item is a storage component
*/
boolean isStorageComponent(ItemStack is);
}
@@ -23,19 +23,16 @@
package appeng.api.implementations.items;
import net.minecraft.item.ItemStack;
import appeng.api.config.Upgrades;
public interface IUpgradeModule {
public interface IUpgradeModule
{
/**
* @param itemstack item with potential upgrades
*
* @return null, or a valid upgrade type.
*/
Upgrades getType( ItemStack itemstack );
/**
* @param itemstack item with potential upgrades
*
* @return null, or a valid upgrade type.
*/
Upgrades getType(ItemStack itemstack);
}
@@ -23,11 +23,9 @@
package appeng.api.implementations.items;
/**
* Status Results for use with {@link IMemoryCard}
*/
public enum MemoryCardMessages
{
INVALID_MACHINE, SETTINGS_LOADED, SETTINGS_SAVED, SETTINGS_RESET, SETTINGS_CLEARED
public enum MemoryCardMessages {
INVALID_MACHINE, SETTINGS_LOADED, SETTINGS_SAVED, SETTINGS_RESET, SETTINGS_CLEARED
}
@@ -23,7 +23,6 @@
package appeng.api.implementations.parts;
import java.util.EnumSet;
import net.minecraft.entity.player.PlayerEntity;
@@ -37,54 +36,53 @@ import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation;
/**
* Implemented on the {@link IPart}s cable objects that can be placed at {@link AEPartLocation}.UNKNOWN in
* {@link IPartHost}s
* Implemented on the {@link IPart}s cable objects that can be placed at
* {@link AEPartLocation}.UNKNOWN in {@link IPartHost}s
*/
public interface IPartCable extends IPart, IGridHost
{
public interface IPartCable extends IPart, IGridHost {
/**
* does this cable support buses?
*/
BusSupport supportsBuses();
/**
* does this cable support buses?
*/
BusSupport supportsBuses();
/**
* @return the current color of the cable.
*/
AEColor getCableColor();
/**
* @return the current color of the cable.
*/
AEColor getCableColor();
/**
* @return the Cable type.
*/
AECableType getCableConnectionType();
/**
* @return the Cable type.
*/
AECableType getCableConnectionType();
/**
* Change the color of the cable, this should cost a small amount of dye, or something.
*
* @param newColor new color
*
* @return if the color change was successful.
*/
boolean changeColor( AEColor newColor, PlayerEntity who );
/**
* Change the color of the cable, this should cost a small amount of dye, or
* something.
*
* @param newColor new color
*
* @return if the color change was successful.
*/
boolean changeColor(AEColor newColor, PlayerEntity who);
/**
* Change sides on the cables node.
*
* Called by AE, do not invoke.
*
* @param sides sides of cable
*/
void setValidSides( EnumSet<Direction> sides );
/**
* Change sides on the cables node.
*
* Called by AE, do not invoke.
*
* @param sides sides of cable
*/
void setValidSides(EnumSet<Direction> sides);
/**
* used to tests if a cable connects to neighbors visually.
*
* @param side neighbor side
*
* @return true if this side is currently connects to an external block.
*/
boolean isConnected( Direction side );
/**
* used to tests if a cable connects to neighbors visually.
*
* @param side neighbor side
*
* @return true if this side is currently connects to an external block.
*/
boolean isConnected(Direction side);
}
@@ -23,20 +23,17 @@
package appeng.api.implementations.parts;
import appeng.api.networking.IGridHost;
import appeng.api.parts.IPart;
/**
* Implemented by all screen like parts provided by AE.
*/
public interface IPartMonitor extends IPart, IGridHost
{
public interface IPartMonitor extends IPart, IGridHost {
/**
* @return if the device is online you should check this before providing
* any other information.
*/
boolean isPowered();
/**
* @return if the device is online you should check this before providing any
* other information.
*/
boolean isPowered();
}
@@ -23,28 +23,26 @@
package appeng.api.implementations.parts;
import appeng.api.networking.IGridHost;
import appeng.api.parts.IPart;
import appeng.api.storage.data.IAEStack;
import appeng.api.util.INetworkToolAgent;
/**
* The Storage monitor is a {@link IPart} located on the sides of a IPartHost
*/
public interface IPartStorageMonitor extends IPartMonitor, IPart, IGridHost, INetworkToolAgent
{
public interface IPartStorageMonitor extends IPartMonitor, IPart, IGridHost, INetworkToolAgent {
/**
* @return the item being displayed on the storage monitor, in AEStack Form, can be either a IAEItemStack or an
* IAEFluidStack the quantity is important remember to use getStackSize() on the IAEStack, and not on the
* FluidStack/ItemStack acquired from it.
*/
IAEStack<?> getDisplayed();
/**
* @return the item being displayed on the storage monitor, in AEStack Form, can
* be either a IAEItemStack or an IAEFluidStack the quantity is
* important remember to use getStackSize() on the IAEStack, and not on
* the FluidStack/ItemStack acquired from it.
*/
IAEStack<?> getDisplayed();
/**
* @return the current locked state of the Storage Monitor
*/
boolean isLocked();
/**
* @return the current locked state of the Storage Monitor
*/
boolean isLocked();
}
@@ -23,54 +23,53 @@
package appeng.api.implementations.tiles;
import javax.annotation.Nullable;
import net.minecraft.item.Item;
import appeng.api.networking.IGridHost;
import appeng.api.storage.ICellContainer;
import appeng.api.util.IOrientable;
import net.minecraft.item.Item;
import javax.annotation.Nullable;
public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable {
/**
* @return how many slots are available. Chest has 1, Drive has 10.
*/
int getCellCount();
public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable
{
/**
* 0 - cell is missing.
*
* 1 - green,
*
* 2 - orange,
*
* 3 - red
*
* @param slot slot index
*
* @return status of the slot, one of the above indices.
*/
int getCellStatus(int slot);
/**
* @return how many slots are available. Chest has 1, Drive has 10.
*/
int getCellCount();
/**
* @return if the device is online you should check this before providing any
* other information.
*/
boolean isPowered();
/**
* 0 - cell is missing.
*
* 1 - green,
*
* 2 - orange,
*
* 3 - red
*
* @param slot slot index
*
* @return status of the slot, one of the above indices.
*/
int getCellStatus( int slot );
/**
* @param slot slot index
*
* @return is the cell currently blinking to show activity.
*/
boolean isCellBlinking(int slot);
/**
* @return if the device is online you should check this before providing any other information.
*/
boolean isPowered();
/**
* @param slot slot index
*
* @return is the cell currently blinking to show activity.
*/
boolean isCellBlinking( int slot );
/**
* Returns the item of the cell in the given slot or null.
*/
@Nullable
Item getCellItem(int slot );
/**
* Returns the item of the cell in the given slot or null.
*/
@Nullable
Item getCellItem(int slot);
}
@@ -23,17 +23,14 @@
package appeng.api.implementations.tiles;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Direction;
import appeng.api.util.AEColor;
public interface IColorableTile {
public interface IColorableTile
{
AEColor getColor();
AEColor getColor();
boolean recolourBlock( Direction side, AEColor colour, PlayerEntity who );
boolean recolourBlock(Direction side, AEColor colour, PlayerEntity who);
}
@@ -23,32 +23,31 @@
package appeng.api.implementations.tiles;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.util.Direction;
import appeng.api.networking.crafting.ICraftingPatternDetails;
public interface ICraftingMachine {
public interface ICraftingMachine
{
/**
* inserts a crafting plan, and the necessary items into the crafting machine.
*
* @param patternDetails details of pattern
* @param table crafting table
* @param ejectionDirection ejection direction
*
* @return if it was accepted, all or nothing.
*/
boolean pushPattern(ICraftingPatternDetails patternDetails, CraftingInventory table, Direction ejectionDirection);
/**
* inserts a crafting plan, and the necessary items into the crafting machine.
*
* @param patternDetails details of pattern
* @param table crafting table
* @param ejectionDirection ejection direction
*
* @return if it was accepted, all or nothing.
*/
boolean pushPattern( ICraftingPatternDetails patternDetails, CraftingInventory table, Direction ejectionDirection );
/**
* check if the crafting machine is accepting pushes via pushPattern, if this is false, all calls to push will fail,
* you can try inserting into the inventory instead.
*
* @return true, if pushPattern can complete, if its false push will always be false.
*/
boolean acceptsPlans();
/**
* check if the crafting machine is accepting pushes via pushPattern, if this is
* false, all calls to push will fail, you can try inserting into the inventory
* instead.
*
* @return true, if pushPattern can complete, if its false push will always be
* false.
*/
boolean acceptsPlans();
}
@@ -23,10 +23,8 @@
package appeng.api.implementations.tiles;
import net.minecraft.util.Direction;
/**
* Crank/Crankable API,
*
@@ -37,23 +35,22 @@ import net.minecraft.util.Direction;
*
* This interface must be implemented by a tile entity.
*/
public interface ICrankable
{
public interface ICrankable {
/**
* Test if the crank can turn, return false if there is no work to be done.
*
* @return if crank should be allowed to turn.
*/
boolean canTurn();
/**
* Test if the crank can turn, return false if there is no work to be done.
*
* @return if crank should be allowed to turn.
*/
boolean canTurn();
/**
* The crank has completed one turn.
*/
void applyTurn();
/**
* The crank has completed one turn.
*/
void applyTurn();
/**
* @return true if the crank can attach on the given side.
*/
boolean canCrankAttach( Direction directionToCrank );
/**
* @return true if the crank can attach on the given side.
*/
boolean canCrankAttach(Direction directionToCrank);
}
@@ -23,9 +23,7 @@
package appeng.api.implementations.tiles;
public interface ICrystalGrowthAccelerator {
public interface ICrystalGrowthAccelerator
{
boolean isPowered();
boolean isPowered();
}
@@ -23,11 +23,8 @@
package appeng.api.implementations.tiles;
import appeng.api.networking.energy.IEnergySource;
public interface IMEChest extends IChestOrDrive, IEnergySource
{
public interface IMEChest extends IChestOrDrive, IEnergySource {
}
@@ -23,20 +23,18 @@
package appeng.api.implementations.tiles;
import net.minecraftforge.items.IItemHandler;
public interface ISegmentedInventory {
public interface ISegmentedInventory
{
/**
* Access an internal inventory, note, not all inventories contain real items, some may be ghost items, and treating
* them a real inventories will result in duplication.
*
* @param name inventory name
*
* @return inventory with inventory name
*/
IItemHandler getInventoryByName( String name );
/**
* Access an internal inventory, note, not all inventories contain real items,
* some may be ghost items, and treating them a real inventories will result in
* duplication.
*
* @param name inventory name
*
* @return inventory with inventory name
*/
IItemHandler getInventoryByName(String name);
}

Some files were not shown because too many files have changed in this diff Show More