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; package appeng.api;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import appeng.api.exceptions.CoreInaccessibleException; import appeng.api.exceptions.CoreInaccessibleException;
/** /**
* Entry point for api. * 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_FQN = "appeng.core.Api";
private static final String CORE_API_FIELD = "INSTANCE"; private static final String CORE_API_FIELD = "INSTANCE";
private static final IAppEngApi HELD_API; private static final IAppEngApi HELD_API;
static static {
{ try {
try final Class<?> apiClass = Class.forName(CORE_API_FQN);
{ final Field apiField = apiClass.getField(CORE_API_FIELD);
final Class<?> apiClass = Class.forName( CORE_API_FQN );
final Field apiField = apiClass.getField( CORE_API_FIELD );
HELD_API = (IAppEngApi) apiField.get( apiClass ); HELD_API = (IAppEngApi) apiField.get(apiClass);
} } catch (final ClassNotFoundException e) {
catch( final ClassNotFoundException e ) throw new CoreInaccessibleException(
{ "AE2 API tried to access the " + CORE_API_FQN + " class, without it being declared.");
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 "
catch( final NoSuchFieldException e ) + 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 it being declared." ); throw new CoreInaccessibleException("AE2 API tried to access the " + CORE_API_FIELD + " field in "
} + CORE_API_FQN + " without enough access permissions.");
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. * API Entry Point.
* *
* @return the {@link IAppEngApi} * @return the {@link IAppEngApi}
*/ */
public static IAppEngApi instance() public static IAppEngApi instance() {
{ return HELD_API;
return HELD_API; }
}
} }
+6 -7
View File
@@ -18,17 +18,16 @@
package appeng.api; package appeng.api;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; 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 ) @Target(ElementType.TYPE)
@Retention( RetentionPolicy.RUNTIME ) @Retention(RetentionPolicy.RUNTIME)
public @interface AEInjectable public @interface AEInjectable {
{} }
+7 -9
View File
@@ -18,22 +18,20 @@
package appeng.api; package appeng.api;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* Use this annotation on a class in your Mod to have it instantiated during the initialization phase of Applied * Use this annotation on a class in your Mod to have it instantiated during the
* Energistics. * initialization phase of Applied Energistics. AE expects your class to have a
* AE expects your class to have a single constructor and can supply certain arguments to your constructor using * single constructor and can supply certain arguments to your constructor using
* dependency injection. * dependency injection.
*/ */
@Target( ElementType.TYPE ) @Target(ElementType.TYPE)
@Retention( RetentionPolicy.RUNTIME ) @Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
public @interface AEPlugin public @interface AEPlugin {
{} }
+25 -28
View File
@@ -23,7 +23,6 @@
package appeng.api; package appeng.api;
import appeng.api.definitions.IDefinitions; import appeng.api.definitions.IDefinitions;
import appeng.api.features.IRegistryContainer; import appeng.api.features.IRegistryContainer;
import appeng.api.networking.IGridHelper; import appeng.api.networking.IGridHelper;
@@ -32,38 +31,36 @@ import appeng.api.parts.IPartHelper;
import appeng.api.storage.IStorageHelper; import appeng.api.storage.IStorageHelper;
import appeng.api.util.IClientHelper; import appeng.api.util.IClientHelper;
@AEInjectable @AEInjectable
public interface IAppEngApi public interface IAppEngApi {
{ /**
/** * @return Registry Container for the numerous registries in AE2.
* @return Registry Container for the numerous registries in AE2. */
*/ IRegistryContainer registries();
IRegistryContainer registries();
/** /**
* @return A helper for working with storage data types. * @return A helper for working with storage data types.
*/ */
IStorageHelper storage(); IStorageHelper storage();
/** /**
* @return A helper to create {@link IGridNode} and other grid related objects. * @return A helper to create {@link IGridNode} and other grid related objects.
*/ */
IGridHelper grid(); IGridHelper grid();
/** /**
* @return A helper for working with grids, and buses. * @return A helper for working with grids, and buses.
*/ */
IPartHelper partHelper(); IPartHelper partHelper();
/** /**
* @return An accessible list of all AE definitions * @return An accessible list of all AE definitions
*/ */
IDefinitions definitions(); IDefinitions definitions();
/** /**
* @return Utility methods primarily useful for client side stuff * @return Utility methods primarily useful for client side stuff
*/ */
IClientHelper client(); IClientHelper client();
} }
@@ -23,51 +23,42 @@
package appeng.api.config; package appeng.api.config;
public enum AccessRestriction {
NO_ACCESS(0), READ(1), WRITE(2), READ_WRITE(3);
public enum AccessRestriction private final int permissionBit;
{
NO_ACCESS( 0 ), READ( 1 ), WRITE( 2 ), READ_WRITE( 3 );
private final int permissionBit; AccessRestriction(final int v) {
this.permissionBit = v;
}
AccessRestriction( final int v ) public boolean hasPermission(final AccessRestriction ar) {
{ return (this.permissionBit & ar.permissionBit) == ar.permissionBit;
this.permissionBit = v; }
}
public boolean hasPermission( final AccessRestriction ar ) public AccessRestriction restrictPermissions(final AccessRestriction ar) {
{ return this.getPermByBit(this.permissionBit & ar.permissionBit);
return ( this.permissionBit & ar.permissionBit ) == ar.permissionBit; }
}
public AccessRestriction restrictPermissions( final AccessRestriction ar ) private AccessRestriction getPermByBit(final int bit) {
{ switch (bit) {
return this.getPermByBit( this.permissionBit & ar.permissionBit ); 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 ) public AccessRestriction addPermissions(final AccessRestriction ar) {
{ return this.getPermByBit(this.permissionBit | ar.permissionBit);
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 ) public AccessRestriction removePermissions(final AccessRestriction ar) {
{ return this.getPermByBit(this.permissionBit & (~ar.permissionBit));
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; package appeng.api.config;
public enum ActionItems {
public enum ActionItems WRENCH, CLOSE, STASH, ENCODE, ENABLE_SUBSTITUTION, DISABLE_SUBSTITUTION
{
WRENCH, CLOSE, STASH, ENCODE, ENABLE_SUBSTITUTION, DISABLE_SUBSTITUTION
} }
+16 -21
View File
@@ -23,31 +23,26 @@
package appeng.api.config; package appeng.api.config;
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
public enum Actionable {
/**
* Perform the intended action.
*/
MODULATE(FluidAction.EXECUTE),
public enum Actionable /**
{ * Pretend to perform the action.
/** */
* Perform the intended action. SIMULATE(FluidAction.SIMULATE);
*/
MODULATE( FluidAction.EXECUTE ),
/** private final FluidAction fluidAction;
* Pretend to perform the action.
*/
SIMULATE( FluidAction.SIMULATE );
private final FluidAction fluidAction; Actionable(FluidAction fluidAction) {
this.fluidAction = fluidAction;
}
Actionable( FluidAction fluidAction ) public FluidAction getFluidAction() {
{ return fluidAction;
this.fluidAction = fluidAction; }
}
public FluidAction getFluidAction()
{
return fluidAction;
}
} }
@@ -23,16 +23,14 @@
package appeng.api.config; 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; package appeng.api.config;
public enum CopyMode {
public enum CopyMode CLEAR_ON_REMOVE, KEEP_ON_REMOVE
{
CLEAR_ON_REMOVE, KEEP_ON_REMOVE
} }
@@ -23,8 +23,6 @@
package appeng.api.config; package appeng.api.config;
public enum FullnessMode {
public enum FullnessMode EMPTY, HALF, FULL
{
EMPTY, HALF, FULL
} }
+12 -20
View File
@@ -23,28 +23,20 @@
package appeng.api.config; 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 public final float breakPoint;
{ public final float percentage;
// 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; FuzzyMode(final float p) {
public final float percentage; this.percentage = p;
this.breakPoint = p / 100.0f;
}
FuzzyMode( final float p ) public int calculateBreakPoint(final int maxDamage) {
{ return (int) ((this.percentage * maxDamage) / 100.0f);
this.percentage = p; }
this.breakPoint = p / 100.0f;
}
public int calculateBreakPoint( final int maxDamage )
{
return (int) ( ( this.percentage * maxDamage ) / 100.0f );
}
} }
@@ -23,8 +23,6 @@
package appeng.api.config; package appeng.api.config;
public enum IncludeExclude {
public enum IncludeExclude WHITELIST, BLACKLIST
{
WHITELIST, BLACKLIST
} }
@@ -23,12 +23,10 @@
package appeng.api.config; 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; 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; package appeng.api.config;
public enum ModSettings {
public enum ModSettings
{
} }
@@ -23,14 +23,12 @@
package appeng.api.config; 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; package appeng.api.config;
public enum OperationMode {
public enum OperationMode FILL, EMPTY
{
FILL, EMPTY
} }
@@ -23,8 +23,6 @@
package appeng.api.config; package appeng.api.config;
public enum OutputMode {
public enum OutputMode EXPORT_ONLY, EXPORT_OR_CRAFT, CRAFT_ONLY
{
EXPORT_ONLY, EXPORT_OR_CRAFT, CRAFT_ONLY
} }
@@ -23,23 +23,19 @@
package appeng.api.config; package appeng.api.config;
public enum PowerMultiplier {
ONE, CONFIG;
public enum PowerMultiplier /**
{ * please do not edit this value, it is set when AE loads its config files.
ONE, CONFIG; */
public double multiplier = 1.0;
/** public double multiply(final double in) {
* please do not edit this value, it is set when AE loads its config files. return in * this.multiplier;
*/ }
public double multiplier = 1.0;
public double multiply( final double in ) public double divide(final double in) {
{ return in / this.multiplier;
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; package appeng.api.config;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.util.text.TranslationTextComponent;
public enum PowerUnits public enum PowerUnits {
{ AE("gui.appliedenergistics2.units.appliedenergstics"), // Native Units - AE Energy
AE( "gui.appliedenergistics2.units.appliedenergstics" ), // Native Units - AE Energy EU("gui.appliedenergistics2.units.ic2"), // IndustrialCraft 2 - Energy Units
EU( "gui.appliedenergistics2.units.ic2" ), // IndustrialCraft 2 - Energy Units RF("gui.appliedenergistics2.units.rf"); // RF - Redstone Flux
RF( "gui.appliedenergistics2.units.rf" ); // RF - Redstone Flux
/** /**
* unlocalized name for the power unit. * unlocalized name for the power unit.
*/ */
public final String unlocalizedName; public final String unlocalizedName;
/** /**
* please do not edit this value, it is set when AE loads its config files. * please do not edit this value, it is set when AE loads its config files.
*/ */
public double conversionRatio = 1.0; public double conversionRatio = 1.0;
PowerUnits( final String un ) PowerUnits(final String un) {
{ this.unlocalizedName = un;
this.unlocalizedName = un; }
}
/** /**
* do power conversion using AE's conversion rates. * do power conversion using AE's conversion rates.
* *
* Example: PowerUnits.EU.convertTo( PowerUnits.AE, 32 ); * Example: PowerUnits.EU.convertTo( PowerUnits.AE, 32 );
* *
* will normally returns 64, as it will convert the EU, to AE with AE's power settings. * 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 * @param target target power unit
* * @param value value
* @return value converted to target units, from this units. *
*/ * @return value converted to target units, from this units.
public double convertTo( final PowerUnits target, final double value ) */
{ public double convertTo(final PowerUnits target, final double value) {
return ( value * this.conversionRatio ) / target.conversionRatio; return (value * this.conversionRatio) / target.conversionRatio;
} }
public ITextComponent textComponent() { public ITextComponent textComponent() {
return new TranslationTextComponent(unlocalizedName); return new TranslationTextComponent(unlocalizedName);
} }
} }
@@ -23,8 +23,6 @@
package appeng.api.config; package appeng.api.config;
public enum RedstoneMode {
public enum RedstoneMode IGNORE, LOW_SIGNAL, HIGH_SIGNAL, SIGNAL_PULSE
{
IGNORE, LOW_SIGNAL, HIGH_SIGNAL, SIGNAL_PULSE
} }
@@ -23,8 +23,6 @@
package appeng.api.config; package appeng.api.config;
public enum RelativeDirection {
public enum RelativeDirection LEFT, RIGHT, UP, DOW
{
LEFT, RIGHT, UP, DOW
} }
@@ -23,8 +23,6 @@
package appeng.api.config; package appeng.api.config;
public enum SchedulingMode {
public enum SchedulingMode DEFAULT, ROUNDROBIN, RANDOM
{
DEFAULT, ROUNDROBIN, RANDOM
} }
@@ -23,19 +23,18 @@
package appeng.api.config; 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 private final boolean requiresJei;
{
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; SearchBoxMode(boolean requiresJei) {
this.requiresJei = requiresJei;
}
SearchBoxMode(boolean requiresJei) { public boolean isRequiresJei() {
this.requiresJei = requiresJei; return requiresJei;
} }
public boolean isRequiresJei() {
return requiresJei;
}
} }
@@ -23,49 +23,48 @@
package appeng.api.config; package appeng.api.config;
/** /**
* Represent the security systems basic permissions, these are not for anti-griefing, they are part of the mod as a * Represent the security systems basic permissions, these are not for
* gameplay feature. * anti-griefing, they are part of the mod as a gameplay feature.
*/ */
public enum SecurityPermissions public enum SecurityPermissions {
{ /**
/** * required to insert items into the network via terminal ( also used for
* required to insert items into the network via terminal ( also used for machines based on the owner of the * machines based on the owner of the network, which is determined by its
* network, which is determined by its Security Block. ) * Security Block. )
*/ */
INJECT, INJECT,
/** /**
* required to extract items from the network via terminal ( also used for machines based on the owner of the * required to extract items from the network via terminal ( also used for
* network, which is determined by its Security Block. ) * machines based on the owner of the network, which is determined by its
*/ * Security Block. )
EXTRACT, */
EXTRACT,
/** /**
* required to request crafting from the network via terminal. * required to request crafting from the network via terminal.
*/ */
CRAFT, CRAFT,
/** /**
* required to modify automation, and make modifications to the networks physical layout. * required to modify automation, and make modifications to the networks
*/ * physical layout.
BUILD, */
BUILD,
/** /**
* required to modify the security blocks settings. * required to modify the security blocks settings.
*/ */
SECURITY; SECURITY;
private final String translationKey = "gui.appliedenergistics2.security." + this.name().toLowerCase(); private final String translationKey = "gui.appliedenergistics2.security." + this.name().toLowerCase();
public String getTranslatedName() public String getTranslatedName() {
{ return this.translationKey + ".name";
return this.translationKey + ".name"; }
}
public String getTranslatedTip() public String getTranslatedTip() {
{ return this.translationKey + ".tip";
return this.translationKey + ".tip"; }
}
} }
+36 -42
View File
@@ -23,79 +23,73 @@
package appeng.api.config; package appeng.api.config;
import java.util.EnumSet; import java.util.EnumSet;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public enum Settings {
LEVEL_EMITTER_MODE(EnumSet.allOf(LevelEmitterMode.class)),
public enum Settings REDSTONE_EMITTER(EnumSet.of(RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL)),
{
LEVEL_EMITTER_MODE( EnumSet.allOf( LevelEmitterMode.class ) ),
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 ) this.values = possibleOptions;
{ }
if( possibleOptions.isEmpty() )
{
throw new IllegalArgumentException( "Tried to instantiate an empty setting." );
}
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; package appeng.api.config;
public enum SortDir {
public enum SortDir ASCENDING, DESCENDING
{
ASCENDING, DESCENDING
} }
@@ -23,8 +23,6 @@
package appeng.api.config; package appeng.api.config;
public enum SortOrder {
public enum SortOrder NAME, AMOUNT, MOD, INVTWEAKS
{
NAME, AMOUNT, MOD, INVTWEAKS
} }
@@ -23,12 +23,10 @@
package appeng.api.config; package appeng.api.config;
public enum StorageFilter {
public enum StorageFilter NONE,
{
NONE, EXTRACTABLE_ONLY
EXTRACTABLE_ONLY
} }
@@ -23,14 +23,12 @@
package appeng.api.config; 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; package appeng.api.config;
public enum TunnelType {
public enum TunnelType ME, // Network Tunnel
{ IC2_POWER, // EU Tunnel
ME, // Network Tunnel FE_POWER, // Forge Energy tunnel
IC2_POWER, // EU Tunnel REDSTONE, // Redstone Tunnel
FE_POWER, // Forge Energy tunnel FLUID, // Fluid Tunnel
REDSTONE, // Redstone Tunnel ITEM, // Item Tunnel
FLUID, // Fluid Tunnel LIGHT, // Light Tunnel
ITEM, // Item Tunnel BUNDLED_REDSTONE, // Bundled Redstone Tunnel
LIGHT, // Light Tunnel COMPUTER_MESSAGE // Computer Message Tunnel
BUNDLED_REDSTONE, // Bundled Redstone Tunnel
COMPUTER_MESSAGE // Computer Message Tunnel
} }
+44 -56
View File
@@ -23,7 +23,6 @@
package appeng.api.config; package appeng.api.config;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@@ -31,66 +30,55 @@ import net.minecraft.item.ItemStack;
import appeng.api.definitions.IItemDefinition; import appeng.api.definitions.IItemDefinition;
public enum Upgrades {
/**
* Gold Tier Upgrades.
*/
CAPACITY(0), REDSTONE(0), CRAFTING(0),
public enum Upgrades /**
{ * Diamond Tier Upgrades.
/** */
* Gold Tier Upgrades. FUZZY(1), SPEED(1), INVERTER(1);
*/
CAPACITY( 0 ),
REDSTONE( 0 ),
CRAFTING( 0 ),
/** private final int tier;
* Diamond Tier Upgrades. private final Map<ItemStack, Integer> supportedMax = new HashMap<>();
*/
FUZZY( 1 ),
SPEED( 1 ),
INVERTER( 1 );
private final int tier; Upgrades(final int tier) {
private final Map<ItemStack, Integer> supportedMax = new HashMap<>(); this.tier = tier;
}
Upgrades( final int tier ) /**
{ * @return list of Items/Blocks that support this upgrade, and how many it
this.tier = tier; * supports.
} */
public Map<ItemStack, Integer> getSupported() {
return this.supportedMax;
}
/** /**
* @return list of Items/Blocks that support this upgrade, and how many it supports. * Registers a specific amount of this upgrade into a specific machine
*/ *
public Map<ItemStack, Integer> getSupported() * @param item machine in which this upgrade can be installed
{ * @param maxSupported amount how many upgrades can be installed
return this.supportedMax; */
} 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 * Registers a specific amount of this upgrade into a specific machine
* *
* @param item machine in which this upgrade can be installed * @param stack machine in which this upgrade can be installed
* @param maxSupported amount how many upgrades can be installed * @param maxSupported amount how many upgrades can be installed
*/ */
public void registerItem( final IItemDefinition item, final int maxSupported ) public void registerItem(final ItemStack stack, final int maxSupported) {
{ if (stack != null) {
item.maybeStack( 1 ).ifPresent( is -> this.registerItem( is, maxSupported ) ); this.supportedMax.put(stack, maxSupported);
} }
}
/** public int getTier() {
* Registers a specific amount of this upgrade into a specific machine return this.tier;
* }
* @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;
}
} }
@@ -23,8 +23,6 @@
package appeng.api.config; package appeng.api.config;
public enum ViewItems {
public enum ViewItems ALL, STORED, CRAFTABLE
{
ALL, STORED, CRAFTABLE
} }
+2 -4
View File
@@ -23,8 +23,6 @@
package appeng.api.config; package appeng.api.config;
public enum YesNo {
public enum YesNo YES, NO, UNDECIDED
{
YES, NO, UNDECIDED
} }
@@ -18,42 +18,39 @@
package appeng.api.definitions; package appeng.api.definitions;
import java.util.Optional;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader; 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 BlockItem} implementation if applicable
/** */
* @return the {@link Block} implementation if applicable default Optional<BlockItem> maybeBlockItem() {
*/ return Optional.of(blockItem());
default Optional<Block> maybeBlock() { }
return Optional.of(block());
}
Block block(); BlockItem blockItem();
/** /**
* @return the {@link BlockItem} implementation if applicable * Compare Block with world.
*/ *
default Optional<BlockItem> maybeBlockItem() { * @param world world of block
return Optional.of(blockItem()); * @param pos location
} *
* @return if the block is placed in the world at the specific location.
BlockItem blockItem(); */
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; package appeng.api.definitions;
/** /**
* A list of all blocks in AE * A list of all blocks in AE
*/ */
public interface IBlocks public interface IBlocks {
{ /*
/* * world gen
* world gen */
*/ IBlockDefinition quartzOre();
IBlockDefinition quartzOre();
IBlockDefinition quartzOreCharged(); IBlockDefinition quartzOreCharged();
IBlockDefinition matrixFrame(); IBlockDefinition matrixFrame();
/* /*
* decorative * decorative
*/ */
IBlockDefinition quartzBlock(); 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 * misc
*/ */
ITileDefinition grindstone(); 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 * quantum Network Bridge
*/ */
ITileDefinition quantumRing(); ITileDefinition quantumRing();
ITileDefinition quantumLink(); ITileDefinition quantumLink();
/* /*
* spatial iO * spatial iO
*/ */
ITileDefinition spatialPylon(); ITileDefinition spatialPylon();
ITileDefinition spatialIOPort(); ITileDefinition spatialIOPort();
/* /*
* Bus / cables * Bus / cables
*/ */
ITileDefinition multiPart(); ITileDefinition multiPart();
/* /*
* machines * machines
*/ */
ITileDefinition controller(); 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 // rv1
ITileDefinition craftingUnit(); 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; package appeng.api.definitions;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
/** /**
* Interface to compare a definition with an itemstack or a block * Interface to compare a definition with an itemstack or a block
* *
@@ -29,14 +27,13 @@ import net.minecraft.item.ItemStack;
* @version rv2 * @version rv2
* @since rv2 * @since rv2
*/ */
public interface IComparableDefinition public interface IComparableDefinition {
{ /**
/** * Compare {@link ItemStack} with this
* Compare {@link ItemStack} with this *
* * @param comparableStack compared item
* @param comparableStack compared item *
* * @return true if the item stack is a matching item.
* @return true if the item stack is a matching item. */
*/ boolean isSameAs(ItemStack comparableStack);
boolean isSameAs( ItemStack comparableStack );
} }
@@ -23,29 +23,27 @@
package appeng.api.definitions; package appeng.api.definitions;
/** /**
* All definitions in AE * All definitions in AE
*/ */
public interface IDefinitions public interface IDefinitions {
{ /**
/** * @return an accessible list of all of AE's blocks
* @return an accessible list of all of AE's blocks */
*/ IBlocks blocks();
IBlocks blocks();
/** /**
* @return an accessible list of all of AE's Items * @return an accessible list of all of AE's Items
*/ */
IItems items(); IItems items();
/** /**
* @return an accessible list of all of AE's materials; materials are items * @return an accessible list of all of AE's materials; materials are items
*/ */
IMaterials materials(); IMaterials materials();
/** /**
* @return an accessible list of all of AE's parts, parts are items * @return an accessible list of all of AE's parts, parts are items
*/ */
IParts parts(); IParts parts();
} }
@@ -23,46 +23,44 @@
package appeng.api.definitions; package appeng.api.definitions;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import appeng.api.features.AEFeature;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.features.AEFeature;
public interface IItemDefinition extends IComparableDefinition public interface IItemDefinition extends IComparableDefinition {
{ /**
/** * @return the unique name of the definition which will be used to register the
* @return the unique name of the definition which will be used to register the underlying structure. Will never be * underlying structure. Will never be null
* null */
*/ @Nonnull
@Nonnull String identifier();
String identifier();
/** /**
* @return the {@link Item} Implementation if applicable * @return the {@link Item} Implementation if applicable
*/ */
default Optional<Item> maybeItem() { default Optional<Item> maybeItem() {
return Optional.of(item()); return Optional.of(item());
} }
Item item(); Item item();
/** /**
* @return an {@link ItemStack} with specified quantity of this item. * @return an {@link ItemStack} with specified quantity of this item.
*/ */
default Optional<ItemStack> maybeStack( int stackSize ) { default Optional<ItemStack> maybeStack(int stackSize) {
return Optional.of(stack(stackSize)); return Optional.of(stack(stackSize));
} }
ItemStack stack( int stackSize ); ItemStack stack(int stackSize);
/** /**
* @return an immutable set of the features of this item * @return an immutable set of the features of this item
*/ */
Set<AEFeature> features(); Set<AEFeature> features();
} }
+46 -49
View File
@@ -23,101 +23,98 @@
package appeng.api.definitions; package appeng.api.definitions;
import appeng.api.util.AEColoredItemDefinition; import appeng.api.util.AEColoredItemDefinition;
/** /**
* A list of all items in AE * A list of all items in AE
*/ */
public interface IItems public interface IItems {
{ IItemDefinition certusQuartzAxe();
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 // rv1
IItemDefinition encodedPattern(); IItemDefinition encodedPattern();
IItemDefinition colorApplicator(); IItemDefinition colorApplicator();
AEColoredItemDefinition coloredPaintBall(); AEColoredItemDefinition coloredPaintBall();
AEColoredItemDefinition coloredLumenPaintBall(); AEColoredItemDefinition coloredLumenPaintBall();
} }
@@ -23,123 +23,121 @@
package appeng.api.definitions; package appeng.api.definitions;
/** /**
* A list of all materials in AE * A list of all materials in AE
*/ */
public interface IMaterials public interface IMaterials {
{ IItemDefinition cell2SpatialPart();
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; package appeng.api.definitions;
import appeng.api.util.AEColoredItemDefinition; import appeng.api.util.AEColoredItemDefinition;
/** /**
* A list of all parts in AE * A list of all parts in AE
*/ */
public interface IParts public interface IParts {
{ AEColoredItemDefinition cableSmart();
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; package appeng.api.definitions;
import java.util.Optional; import java.util.Optional;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
public interface ITileDefinition extends IBlockDefinition {
public interface ITileDefinition extends IBlockDefinition /**
{ * @return the {@link TileEntity} Class if applicable.
/** */
* @return the {@link TileEntity} Class if applicable. Optional<? extends Class<? extends TileEntity>> maybeEntity();
*/
Optional<? extends Class<? extends TileEntity>> maybeEntity();
} }
@@ -23,39 +23,34 @@
package appeng.api.events; package appeng.api.events;
import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.eventbus.api.Event;
import appeng.api.features.ILocatable; import appeng.api.features.ILocatable;
/** /**
* Input Event: * Input Event:
* *
* Used to Notify the Location Registry of objects, and their availability. * 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 ILocatable target;
public final LocatableEvent change; public final LocatableEvent change;
public LocatableEventAnnounce( final ILocatable o, final LocatableEvent ev ) public LocatableEventAnnounce(final ILocatable o, final LocatableEvent ev) {
{ this.target = o;
this.target = o; this.change = ev;
this.change = ev; }
}
public enum LocatableEvent public enum LocatableEvent {
{ /**
/** * Adds the locatable to the registry
* Adds the locatable to the registry */
*/ REGISTER,
REGISTER,
/** /**
* Removes the locatable from the registry * Removes the locatable from the registry
*/ */
UNREGISTER UNREGISTER
} }
} }
@@ -23,14 +23,11 @@
package appeng.api.exceptions; 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; package appeng.api.exceptions;
public class CoreInaccessibleException extends RuntimeException {
private static final long serialVersionUID = -7434641554655517242L;
public class CoreInaccessibleException extends RuntimeException public CoreInaccessibleException(final String message) {
{ super(message);
private static final long serialVersionUID = -7434641554655517242L; }
public CoreInaccessibleException( final String message )
{
super( message );
}
} }
@@ -23,34 +23,30 @@
package appeng.api.exceptions; package appeng.api.exceptions;
import appeng.api.networking.IGridNode; 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 * Intended to signal an internal exception and not intended to be thrown by any
* any 3rd party module. * 3rd party module.
* *
* @author yueh * @author yueh
* @version rv3 * @version rv3
* @since rv3 * @since rv3
*/ */
public class ExistingConnectionException extends FailedConnectionException public class ExistingConnectionException extends FailedConnectionException {
{
private static final long serialVersionUID = 2975450379720353182L; private static final long serialVersionUID = 2975450379720353182L;
private static final String DEFAULT_MESSAGE = "Connection between both nodes already exists."; private static final String DEFAULT_MESSAGE = "Connection between both nodes already exists.";
public ExistingConnectionException() public ExistingConnectionException() {
{ super(DEFAULT_MESSAGE);
super( DEFAULT_MESSAGE ); }
}
public ExistingConnectionException( String message ) public ExistingConnectionException(String message) {
{ super(message);
super( message ); }
}
} }
@@ -23,15 +23,13 @@
package appeng.api.exceptions; package appeng.api.exceptions;
import appeng.api.networking.IGridNode; import appeng.api.networking.IGridNode;
/** /**
* Exception indicating a failed connection between two {@link IGridNode}s. * Exception indicating a failed connection between two {@link IGridNode}s.
* *
* Intended to signal an internal exception and not intended to be thrown by * Intended to signal an internal exception and not intended to be thrown by any
* any 3rd party module. * 3rd party module.
* *
* See any subclass for a more specific reason. * See any subclass for a more specific reason.
* *
@@ -40,17 +38,14 @@ import appeng.api.networking.IGridNode;
* @version rv3 * @version rv3
* @since rv0 * @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 ) public FailedConnectionException(String message) {
{ super(message);
super( message ); }
}
} }
@@ -18,13 +18,10 @@
package appeng.api.exceptions; package appeng.api.exceptions;
public class MissingDefinitionException extends RuntimeException {
private static final long serialVersionUID = -6547396584255825761L;
public class MissingDefinitionException extends RuntimeException public MissingDefinitionException(final String message) {
{ super(message);
private static final long serialVersionUID = -6547396584255825761L; }
public MissingDefinitionException( final String message )
{
super( message );
}
} }
@@ -23,14 +23,11 @@
package appeng.api.exceptions; 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; 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; package appeng.api.exceptions;
/** /**
* Exception due to trying to connect one or more null values. * Exception due to trying to connect one or more null values.
* *
* Intended to signal an internal exception and not intended to be thrown by * Intended to signal an internal exception and not intended to be thrown by any
* any 3rd party module. * 3rd party module.
* *
* @author yueh * @author yueh
* @version rv3 * @version rv3
* @since rv3 * @since rv3
*/ */
public class NullNodeConnectionException extends FailedConnectionException public class NullNodeConnectionException extends FailedConnectionException {
{
private static final long serialVersionUID = -2143719383495321764L; private static final long serialVersionUID = -2143719383495321764L;
private static final String DEFAULT_MESSAGE = "Connection forged between null entities."; private static final String DEFAULT_MESSAGE = "Connection forged between null entities.";
public NullNodeConnectionException() public NullNodeConnectionException() {
{ super(DEFAULT_MESSAGE);
super( DEFAULT_MESSAGE ); }
}
public NullNodeConnectionException( String message ) public NullNodeConnectionException(String message) {
{ super(message);
super( message ); }
}
} }
@@ -23,14 +23,11 @@
package appeng.api.exceptions; 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; 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; package appeng.api.exceptions;
/** /**
* Exception due to trying to connect different security realms. * Exception due to trying to connect different security realms.
* *
* Intended to signal an internal exception and not intended to be thrown by * Intended to signal an internal exception and not intended to be thrown by any
* any 3rd party module. * 3rd party module.
* *
* @author yueh * @author yueh
* @version rv3 * @version rv3
* @since rv3 * @since rv3
*/ */
public class SecurityConnectionException extends FailedConnectionException public class SecurityConnectionException extends FailedConnectionException {
{ private static final long serialVersionUID = 5048714900434215426L;
private static final long serialVersionUID = 5048714900434215426L; private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms.";
private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms.";
public SecurityConnectionException() public SecurityConnectionException() {
{ super(DEFAULT_MESSAGE);
super( DEFAULT_MESSAGE ); }
}
public SecurityConnectionException( String message ) public SecurityConnectionException(String message) {
{ super(message);
super( message ); }
}
} }
+185 -219
View File
@@ -18,257 +18,223 @@
package appeng.api.features; 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 CERTUS_QUARTZ_WORLD_GEN("CertusQuartzWorldGen", Constants.CATEGORY_WORLD),
{ METEORITE_WORLD_GEN("MeteoriteWorldGen", Constants.CATEGORY_WORLD),
// stuff that has no reason for ever being turned off, or that DECORATIVE_LIGHTS("DecorativeLights", Constants.CATEGORY_WORLD),
// is just flat out required by tons of DECORATIVE_BLOCKS("DecorativeBlocks", Constants.CATEGORY_WORLD,
// important stuff. "Blocks that are not used in any essential recipes, also slabs and stairs."),
CORE( "Core", null ) SKY_STONE_CHESTS("SkyStoneChests", Constants.CATEGORY_WORLD),
{ SPAWN_PRESSES_IN_METEORITES("SpawnPressesInMeteorites", Constants.CATEGORY_WORLD),
@Override FLOUR("Flour", Constants.CATEGORY_WORLD), CHEST_LOOT("ChestLoot", Constants.CATEGORY_WORLD),
public boolean isVisible() 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),
return false;
}
},
CERTUS_QUARTZ_WORLD_GEN( "CertusQuartzWorldGen", Constants.CATEGORY_WORLD ), GRIND_STONE("GrindStone", Constants.CATEGORY_MACHINES), INSCRIBER("Inscriber", Constants.CATEGORY_MACHINES),
METEORITE_WORLD_GEN( "MeteoriteWorldGen", Constants.CATEGORY_WORLD ), CHARGER("Charger", Constants.CATEGORY_MACHINES),
DECORATIVE_LIGHTS( "DecorativeLights", Constants.CATEGORY_WORLD ), CRYSTAL_GROWTH_ACCELERATOR("CrystalGrowthAccelerator", Constants.CATEGORY_MACHINES),
DECORATIVE_BLOCKS( "DecorativeBlocks", Constants.CATEGORY_WORLD, "Blocks that are not used in any essential recipes, also slabs and stairs." ), POWER_GEN("VibrationChamber", Constants.CATEGORY_MACHINES),
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 ), POWERED_TOOLS("PoweredTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS),
INSCRIBER( "Inscriber", Constants.CATEGORY_MACHINES ), CERTUS_QUARTZ_TOOLS("CertusQuartzTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS),
CHARGER( "Charger", Constants.CATEGORY_MACHINES ), NETHER_QUARTZ_TOOLS("NetherQuartzTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS),
CRYSTAL_GROWTH_ACCELERATOR( "CrystalGrowthAccelerator", Constants.CATEGORY_MACHINES ),
POWER_GEN( "VibrationChamber", Constants.CATEGORY_MACHINES ),
POWERED_TOOLS( "PoweredTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS ), QUARTZ_HOE("QuartzHoe", Constants.CATEGORY_TOOLS), QUARTZ_SPADE("QuartzSpade", Constants.CATEGORY_TOOLS),
CERTUS_QUARTZ_TOOLS( "CertusQuartzTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS ), QUARTZ_SWORD("QuartzSword", Constants.CATEGORY_TOOLS), QUARTZ_PICKAXE("QuartzPickaxe", Constants.CATEGORY_TOOLS),
NETHER_QUARTZ_TOOLS( "NetherQuartzTools", Constants.CATEGORY_TOOLS_CLASSIFICATIONS ), 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 ), SECURITY("Security", Constants.CATEGORY_NETWORK_FEATURES),
QUARTZ_SPADE( "QuartzSpade", Constants.CATEGORY_TOOLS ), SPATIAL_IO("SpatialIO", Constants.CATEGORY_NETWORK_FEATURES),
QUARTZ_SWORD( "QuartzSword", Constants.CATEGORY_TOOLS ), QUANTUM_NETWORK_BRIDGE("QuantumNetworkBridge", Constants.CATEGORY_NETWORK_FEATURES),
QUARTZ_PICKAXE( "QuartzPickaxe", Constants.CATEGORY_TOOLS ), CHANNELS("Channels", Constants.CATEGORY_NETWORK_FEATURES),
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 ), INTERFACE("Interface", Constants.CATEGORY_NETWORK_BUSES),
SPATIAL_IO( "SpatialIO", Constants.CATEGORY_NETWORK_FEATURES ), FLUID_INTERFACE("FluidInterface", Constants.CATEGORY_NETWORK_BUSES),
QUANTUM_NETWORK_BRIDGE( "QuantumNetworkBridge", Constants.CATEGORY_NETWORK_FEATURES ), LEVEL_EMITTER("LevelEmitter", Constants.CATEGORY_NETWORK_BUSES),
CHANNELS( "Channels", Constants.CATEGORY_NETWORK_FEATURES ), 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 ), PORTABLE_CELL("PortableCell", Constants.CATEGORY_PORTABLE_CELL),
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 ), 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 ), NETWORK_TOOL("NetworkTool", Constants.CATEGORY_NETWORK_TOOL),
ME_CHEST( "MEChest", Constants.CATEGORY_STORAGE ), MEMORY_CARD("MemoryCard", Constants.CATEGORY_NETWORK_TOOL),
ME_DRIVE( "MEDrive", Constants.CATEGORY_STORAGE ),
IO_PORT( "IOPort", Constants.CATEGORY_STORAGE ),
CONDENSER( "Condenser", Constants.CATEGORY_STORAGE ),
NETWORK_TOOL( "NetworkTool", Constants.CATEGORY_NETWORK_TOOL ), GLASS_CABLES("GlassCables", Constants.CATEGORY_CABLES), COVERED_CABLES("CoveredCables", Constants.CATEGORY_CABLES),
MEMORY_CARD( "MemoryCard", Constants.CATEGORY_NETWORK_TOOL ), SMART_CABLES("SmartCables", Constants.CATEGORY_CABLES), DENSE_CABLES("DenseCables", Constants.CATEGORY_CABLES),
GLASS_CABLES( "GlassCables", Constants.CATEGORY_CABLES ), ENERGY_CELLS("EnergyCells", Constants.CATEGORY_ENERGY),
COVERED_CABLES( "CoveredCables", Constants.CATEGORY_CABLES ), ENERGY_ACCEPTOR("EnergyAcceptor", Constants.CATEGORY_ENERGY),
SMART_CABLES( "SmartCables", Constants.CATEGORY_CABLES ), DENSE_ENERGY_CELLS("DenseEnergyCells", Constants.CATEGORY_ENERGY),
DENSE_CABLES( "DenseCables", Constants.CATEGORY_CABLES ),
ENERGY_CELLS( "EnergyCells", Constants.CATEGORY_ENERGY ), P2P_TUNNEL_ME("P2PTunnelME", Constants.CATEGORY_P2P_TUNNELS),
ENERGY_ACCEPTOR( "EnergyAcceptor", Constants.CATEGORY_ENERGY ), P2P_TUNNEL_ITEMS("P2PTunnelItems", Constants.CATEGORY_P2P_TUNNELS),
DENSE_ENERGY_CELLS( "DenseEnergyCells", Constants.CATEGORY_ENERGY ), 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 ), MASS_CANNON_BLOCK_DAMAGE("MassCannonBlockDamage", Constants.CATEGORY_BLOCK_FEATURES),
P2P_TUNNEL_ITEMS( "P2PTunnelItems", Constants.CATEGORY_P2P_TUNNELS ), TINY_TNT_BLOCK_DAMAGE("TinyTNTBlockDamage", Constants.CATEGORY_BLOCK_FEATURES),
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 ), FACADES("Facades", Constants.CATEGORY_FACADES),
TINY_TNT_BLOCK_DAMAGE( "TinyTNTBlockDamage", Constants.CATEGORY_BLOCK_FEATURES ),
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 ), ENABLE_FACADE_CRAFTING("EnableFacadeCrafting", Constants.CATEGORY_CRAFTING),
CREATIVE( "Creative", Constants.CATEGORY_MISC ), IN_WORLD_SINGULARITY("InWorldSingularity", Constants.CATEGORY_CRAFTING),
GRINDER_LOGGING( "GrinderLogging", Constants.CATEGORY_MISC, false ), IN_WORLD_FLUIX("InWorldFluix", Constants.CATEGORY_CRAFTING),
LOGGING( "Logging", Constants.CATEGORY_MISC ), IN_WORLD_PURIFICATION("InWorldPurification", Constants.CATEGORY_CRAFTING),
INTEGRATION_LOGGING( "IntegrationLogging", Constants.CATEGORY_MISC, false ), INTERFACE_TERMINAL("InterfaceTerminal", Constants.CATEGORY_CRAFTING),
WEBSITE_RECIPES( "WebsiteRecipes", Constants.CATEGORY_MISC, false ), ENABLE_DISASSEMBLY_CRAFTING("EnableDisassemblyCrafting", Constants.CATEGORY_CRAFTING),
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 ), ALPHA_PASS("AlphaPass", Constants.CATEGORY_RENDERING), PAINT_BALLS("PaintBalls", Constants.CATEGORY_TOOLS),
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 ), MOLECULAR_ASSEMBLER("MolecularAssembler", Constants.CATEGORY_CRAFTING_FEATURES),
PAINT_BALLS( "PaintBalls", Constants.CATEGORY_TOOLS ), PATTERNS("Patterns", Constants.CATEGORY_CRAFTING_FEATURES),
CRAFTING_CPU("CraftingCPU", Constants.CATEGORY_CRAFTING_FEATURES),
MOLECULAR_ASSEMBLER( "MolecularAssembler", Constants.CATEGORY_CRAFTING_FEATURES ), BASIC_CARDS("BasicCards", Constants.CATEGORY_UPGRADES),
PATTERNS( "Patterns", Constants.CATEGORY_CRAFTING_FEATURES ), ADVANCED_CARDS("AdvancedCards", Constants.CATEGORY_UPGRADES), VIEW_CELL("ViewCell", Constants.CATEGORY_UPGRADES),
CRAFTING_CPU( "CraftingCPU", Constants.CATEGORY_CRAFTING_FEATURES ),
BASIC_CARDS( "BasicCards", Constants.CATEGORY_UPGRADES ), CRYSTAL_SEEDS("CrystalSeeds", Constants.CATEGORY_MATERIALS),
ADVANCED_CARDS( "AdvancedCards", Constants.CATEGORY_UPGRADES ), PURE_CRYSTALS("PureCrystals", Constants.CATEGORY_MATERIALS), CERTUS("Certus", Constants.CATEGORY_MATERIALS),
VIEW_CELL( "ViewCell", Constants.CATEGORY_UPGRADES ), 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 ), PROCESSORS("Processors", Constants.CATEGORY_COMPONENTS),
PURE_CRYSTALS( "PureCrystals", Constants.CATEGORY_MATERIALS ), PRINTED_CIRCUITS("PrintedCircuits", Constants.CATEGORY_COMPONENTS),
CERTUS( "Certus", Constants.CATEGORY_MATERIALS ), PRESSES("Presses", Constants.CATEGORY_COMPONENTS), MATTER_BALL("MatterBall", Constants.CATEGORY_COMPONENTS),
FLUIX( "Fluix", Constants.CATEGORY_MATERIALS ), CORES("Cores", Constants.CATEGORY_COMPONENTS),
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 ), CHUNK_LOGGER_TRACE("ChunkLoggerTrace", Constants.CATEGORY_COMMANDS, false);
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 ); private final String key;
private final String category;
private final boolean enabled;
private final String comment;
private final String key; AEFeature(final String key, final String cat) {
private final String category; this(key, cat, true);
private final boolean enabled; }
private final String comment;
AEFeature( final String key, final String cat ) AEFeature(final String key, final String cat, final String comment) {
{ this(key, cat, true, comment);
this( key, cat, true ); }
}
AEFeature( final String key, final String cat, final String comment ) AEFeature(final String key, final String cat, final boolean enabled) {
{ this(key, cat, enabled, null);
this( key, cat, true, comment ); }
}
AEFeature( final String key, final String cat, final boolean enabled ) AEFeature(final String key, final String cat, final boolean enabled, final String comment) {
{ this.key = key;
this( key, cat, enabled, null ); this.category = cat;
} this.enabled = enabled;
this.comment = comment;
}
AEFeature( final String key, final String cat, final boolean enabled, final String comment ) /**
{ * override to set visibility
this.key = key; *
this.category = cat; * @return default true
this.enabled = enabled; */
this.comment = comment; public boolean isVisible() {
} return true;
}
/** public String key() {
* override to set visibility return this.key;
* }
* @return default true
*/
public boolean isVisible()
{
return true;
}
public String key() public String category() {
{ return this.category;
return this.key; }
}
public String category() public boolean isEnabled() {
{ return this.enabled;
return this.category; }
}
public boolean isEnabled() public String comment() {
{ return this.comment;
return this.enabled; }
}
public String comment() private enum Constants {
{ ;
return this.comment;
}
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_MISC = "Misc"; private static final String CATEGORY_TOOLS = "Tools";
private static final String CATEGORY_CRAFTING = "Crafting"; private static final String CATEGORY_TOOLS_CLASSIFICATIONS = "ToolsClassifications";
private static final String CATEGORY_WORLD = "World"; private static final String CATEGORY_NETWORK_BUSES = "NetworkBuses";
private static final String CATEGORY_MACHINES = "Machines"; private static final String CATEGORY_P2P_TUNNELS = "P2PTunnels";
private static final String CATEGORY_TOOLS = "Tools"; private static final String CATEGORY_BLOCK_FEATURES = "BlockFeatures";
private static final String CATEGORY_TOOLS_CLASSIFICATIONS = "ToolsClassifications"; private static final String CATEGORY_CRAFTING_FEATURES = "CraftingFeatures";
private static final String CATEGORY_NETWORK_BUSES = "NetworkBuses"; private static final String CATEGORY_STORAGE = "Storage";
private static final String CATEGORY_P2P_TUNNELS = "P2PTunnels"; private static final String CATEGORY_CABLES = "Cables";
private static final String CATEGORY_BLOCK_FEATURES = "BlockFeatures"; private static final String CATEGORY_NETWORK_FEATURES = "NetworkFeatures";
private static final String CATEGORY_CRAFTING_FEATURES = "CraftingFeatures"; private static final String CATEGORY_COMMANDS = "Commands";
private static final String CATEGORY_STORAGE = "Storage"; private static final String CATEGORY_RENDERING = "Rendering";
private static final String CATEGORY_CABLES = "Cables"; private static final String CATEGORY_FACADES = "Facades";
private static final String CATEGORY_NETWORK_FEATURES = "NetworkFeatures"; private static final String CATEGORY_NETWORK_TOOL = "NetworkTool";
private static final String CATEGORY_COMMANDS = "Commands"; private static final String CATEGORY_PORTABLE_CELL = "PortableCell";
private static final String CATEGORY_RENDERING = "Rendering"; private static final String CATEGORY_ENERGY = "Energy";
private static final String CATEGORY_FACADES = "Facades"; private static final String CATEGORY_UPGRADES = "Upgrades";
private static final String CATEGORY_NETWORK_TOOL = "NetworkTool"; private static final String CATEGORY_MATERIALS = "Materials";
private static final String CATEGORY_PORTABLE_CELL = "PortableCell"; private static final String CATEGORY_COMPONENTS = "CraftingComponents";
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; package appeng.api.features;
import javax.annotation.Nonnegative; import javax.annotation.Nonnegative;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
@@ -31,54 +30,57 @@ import net.minecraft.item.Item;
import appeng.api.implementations.items.IAEItemPowerStorage; 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. * The registry is used in favor of an additional method for
* This allows more flexibility for other charger like machines to choose their own values when needed. * {@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. * There is no guarantee that this is charged per tick, it only represents the
* By default this is one charging operation every 10 ticks in case of an AE2 charger. * value per operation. By default this is one charging operation every 10 ticks
* in case of an AE2 charger.
* *
* @author yueh * @author yueh
* @version rv5 * @version rv5
* @since rv5 * @since rv5
*/ */
public interface IChargerRegistry public interface IChargerRegistry {
{
/** /**
* Fetch a charge rate for a specific item. * Fetch a charge rate for a specific item.
* *
* The specific item does not need to have a mapping registered at all. * The specific item does not need to have a mapping registered at all. In this
* In this case it will use a default value of 160 AE. * case it will use a default value of 160 AE.
* *
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}. * @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
* @return custom rate or default of 160 * @return custom rate or default of 160
*/ */
@Nonnegative @Nonnegative
double getChargeRate( @Nonnull Item item ); double getChargeRate(@Nonnull Item item);
/** /**
* Register a custom charge rate for a specific 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. * Capped at 16000 to avoid extracting too much energy from a network for each
* This is done silently without any feedback or exception. * operation. This is done silently without any feedback or exception. Further
* Further the cap is not fixed, it can change at any time in the future should power issues arise. * 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 * @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 ); */
void addChargeRate(@Nonnull Item item, @Nonnegative double chargeRate);
/** /**
* Remove the custom rate for a specific item. * Remove the custom rate for a specific item.
* *
* It will revert to the default value afterwards. * It will revert to the default value afterwards.
* *
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}. * @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
*/ */
void removeChargeRate( @Nonnull Item item ); void removeChargeRate(@Nonnull Item item);
} }
@@ -23,10 +23,8 @@
package appeng.api.features; package appeng.api.features;
public interface IItemComparison {
boolean sameAsPrecise(IItemComparison comp);
public interface IItemComparison boolean sameAsFuzzy(IItemComparison comp);
{
boolean sameAsPrecise( IItemComparison comp );
boolean sameAsFuzzy( IItemComparison comp );
} }
@@ -23,34 +23,32 @@
package appeng.api.features; package appeng.api.features;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
/** /**
* Provider for special comparisons. when an item is encountered AE Will request * Provider for special comparisons. when an item is encountered AE Will request
* if the comparison function handles the item, by trying to request a * if the comparison function handles the item, by trying to request a
* IItemComparison class. * IItemComparison class.
*/ */
public interface IItemComparisonProvider public interface IItemComparisonProvider {
{
/** /**
* should return a new IItemComparison, or return null if it doesn't handle * should return a new IItemComparison, or return null if it doesn't handle the
* the supplied item. * supplied item.
* *
* @param is item * @param is item
* *
* @return IItemComparison, or null * @return IItemComparison, or null
*/ */
IItemComparison getComparison( ItemStack is ); IItemComparison getComparison(ItemStack is);
/** /**
* Simple test for support ( AE generally skips this and calls the above function. ) * Simple test for support ( AE generally skips this and calls the above
* * function. )
* @param stack item *
* * @param stack item
* @return true, if getComparison will return a valid IItemComparison Object *
*/ * @return true, if getComparison will return a valid IItemComparison Object
boolean canHandle( ItemStack stack ); */
boolean canHandle(ItemStack stack);
} }
@@ -23,19 +23,17 @@
package appeng.api.features; package appeng.api.features;
import appeng.api.events.LocatableEventAnnounce; import appeng.api.events.LocatableEventAnnounce;
/** /**
* A registration record for the {@link ILocatableRegistry} use the {@link LocatableEventAnnounce} event on the Forge * A registration record for the {@link ILocatableRegistry} use the
* Event bus to update the registry. * {@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 * @return the serial for a locatable object
*/ */
long getLocatableSerial(); long getLocatableSerial();
} }
@@ -23,19 +23,17 @@
package appeng.api.features; package appeng.api.features;
/** /**
* A Registry for locatable items, works based on serial numbers. * 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 * Gets the {@link ILocatable} with the registered serial, if available
* *
* @param serial serial * @param serial serial
* *
* @return requestedObject, or null, if the object does not exist anymore * @return requestedObject, or null, if the object does not exist anymore
*/ */
ILocatable getLocatableBy( long serial ); ILocatable getLocatableBy(long serial);
} }
@@ -23,27 +23,25 @@
package appeng.api.features; package appeng.api.features;
import net.minecraft.item.ItemStack; 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 * get the penetration value for a particular ammo, 0 indicates a non-ammo.
* *
* @param ammo new ammo * @param is ammo
* @param weight atomic weight *
*/ * @return 0 or a valid penetration value.
void registerAmmo( ItemStack ammo, double weight ); */
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; package appeng.api.features;
import net.minecraft.item.ItemStack; 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. * Encode the wireless frequency via the Controller.
* *
* @param item item * @param item the wireless terminal.
* * @param encKey the wireless encryption key.
* @return string key of item * @param name null for now.
*/ */
String getEncryptionKey( ItemStack item ); 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; package appeng.api.features;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -32,33 +31,32 @@ import net.minecraftforge.common.capabilities.Capability;
import appeng.api.config.TunnelType; import appeng.api.config.TunnelType;
/** /**
* A Registry for how p2p Tunnels are attuned * 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 * Allows third parties to register items from their mod as potential
* attunements for AE's P2P Tunnels * attunements for AE's P2P Tunnels
* *
* @param trigger - the item which triggers attunement. Nullable, but then ignored * @param trigger - the item which triggers attunement. Nullable, but then
* @param type - the type of tunnel. Nullable, but then ignored * ignored
*/ * @param type - the type of tunnel. Nullable, but then ignored
void addNewAttunement( @Nonnull ItemStack trigger, @Nullable TunnelType type ); */
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. * returns null if no attunement can be found.
* *
* @param trigger attunement trigger * @param trigger attunement trigger
* *
* @return null if no attunement can be found or attunement * @return null if no attunement can be found or attunement
*/ */
@Nonnull @Nonnull
TunnelType getTunnelTypeByItem( ItemStack trigger ); TunnelType getTunnelTypeByItem(ItemStack trigger);
} }
@@ -23,40 +23,38 @@
package appeng.api.features; package appeng.api.features;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
/** /**
* Maintains a save specific list of userids and username combinations this greatly simplifies storage internally and * Maintains a save specific list of userids and username combinations this
* gives a common place to look up and get IDs for the security framework. * 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 * @param gameProfile user game profile
* *
* @return user id of a username. * @return user id of a username.
*/ */
int getID( GameProfile gameProfile ); int getID(GameProfile gameProfile);
/** /**
* @param player player * @param player player
* *
* @return user id of a player entity. * @return user id of a player entity.
*/ */
int getID( PlayerEntity player ); int getID(PlayerEntity player);
/** /**
* @param playerID to be found player id * @param playerID to be found player id
* *
* @return PlayerEntity, or null if the player could not be found. * @return PlayerEntity, or null if the player could not be found.
*/ */
@Nullable @Nullable
PlayerEntity findPlayer( int playerID ); PlayerEntity findPlayer(int playerID);
} }
@@ -23,14 +23,12 @@
package appeng.api.features; package appeng.api.features;
import appeng.api.AEInjectable; import appeng.api.AEInjectable;
import appeng.api.movable.IMovableRegistry; import appeng.api.movable.IMovableRegistry;
import appeng.api.networking.IGridCacheRegistry; import appeng.api.networking.IGridCacheRegistry;
import appeng.api.parts.IPartModels; import appeng.api.parts.IPartModels;
import appeng.api.storage.ICellRegistry; import appeng.api.storage.ICellRegistry;
/** /**
* @author AlgorithmX2 * @author AlgorithmX2
* @author thatsIch * @author thatsIch
@@ -39,66 +37,66 @@ import appeng.api.storage.ICellRegistry;
* @since rv0 * @since rv0
*/ */
@AEInjectable @AEInjectable
public interface IRegistryContainer public interface IRegistryContainer {
{
/** /**
* Use the movable registry to white list your tiles. * Use the movable registry to white list your tiles.
*/ */
IMovableRegistry movable(); IMovableRegistry movable();
/** /**
* Add new Grid Caches for use during run time, only use during loading phase. * Add new Grid Caches for use during run time, only use during loading phase.
*/ */
IGridCacheRegistry gridCache(); IGridCacheRegistry gridCache();
/** /**
* Add additional special comparison functionality, AE Uses this internally for Bees. * Add additional special comparison functionality, AE Uses this internally for
*/ * Bees.
ISpecialComparisonRegistry specialComparison(); */
ISpecialComparisonRegistry specialComparison();
/** /**
* Lets you register your items as wireless terminals * Lets you register your items as wireless terminals
*/ */
IWirelessTermRegistry wireless(); IWirelessTermRegistry wireless();
/** /**
* Allows you to register new cell types, these will function in drives * Allows you to register new cell types, these will function in drives
*/ */
ICellRegistry cell(); ICellRegistry cell();
/** /**
* Manage charger via API * Manage charger via API
*/ */
IChargerRegistry charger(); IChargerRegistry charger();
/** /**
* get access to the locatable registry * get access to the locatable registry
*/ */
ILocatableRegistry locatable(); ILocatableRegistry locatable();
/** /**
* get access to the p2p tunnel registry. * get access to the p2p tunnel registry.
*/ */
IP2PTunnelRegistry p2pTunnel(); IP2PTunnelRegistry p2pTunnel();
/** /**
* get access to the ammo registry. * get access to the ammo registry.
*/ */
IMatterCannonAmmoRegistry matterCannon(); IMatterCannonAmmoRegistry matterCannon();
/** /**
* get access to the player registry * get access to the player registry
*/ */
IPlayerRegistry players(); IPlayerRegistry players();
/** /**
* get access to the world-gen api. * get access to the world-gen api.
*/ */
IWorldGen worldgen(); IWorldGen worldgen();
/** /**
* Register your IPart models before using them. * Register your IPart models before using them.
*/ */
IPartModels partModels(); IPartModels partModels();
} }
@@ -23,29 +23,26 @@
package appeng.api.features; package appeng.api.features;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
/** /**
* A Registry of any special comparison handlers for AE To use. * A Registry of any special comparison handlers for AE To use.
*/ */
public interface ISpecialComparisonRegistry public interface ISpecialComparisonRegistry {
{
/** /**
* return TheHandler or null. * return TheHandler or null.
* *
* @param stack item * @param stack item
* *
* @return a handler it found for a specific item * @return a handler it found for a specific item
*/ */
IItemComparison getSpecialComparison( ItemStack stack ); IItemComparison getSpecialComparison(ItemStack stack);
/** /**
* Register a new special comparison function with AE. * Register a new special comparison function with AE.
* *
* @param prov comparison provider * @param prov comparison provider
*/ */
void addComparisonProvider( IItemComparisonProvider prov ); void addComparisonProvider(IItemComparisonProvider prov);
} }
@@ -23,52 +23,50 @@
package appeng.api.features; package appeng.api.features;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.util.IConfigManager; import appeng.api.util.IConfigManager;
/** /**
* A handler for a wireless terminal. * A handler for a wireless terminal.
*/ */
public interface IWirelessTermHandler extends INetworkEncodable public interface IWirelessTermHandler extends INetworkEncodable {
{
/** /**
* @param is wireless terminal * @param is wireless terminal
* *
* @return true, if usePower, hasPower, etc... can be called for the provided item * @return true, if usePower, hasPower, etc... can be called for the provided
*/ * item
boolean canHandle( ItemStack is ); */
boolean canHandle(ItemStack is);
/** /**
* use an amount of power, in AE units * 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 * @param amount is in AE units ( 5 per MJ ), if you return false, the item
* hasPower * should be dead and return false for hasPower
* @param is wireless terminal * @param is wireless terminal
* *
* @return true if wireless terminal uses power * @return true if wireless terminal uses power
*/ */
boolean usePower( PlayerEntity player, double amount, ItemStack is ); boolean usePower(PlayerEntity player, double amount, ItemStack is);
/** /**
* gets the power status of the item. * gets the power status of the item.
* *
* @param is wireless terminal * @param is wireless terminal
* *
* @return returns true if there is any power left. * @return returns true if there is any power left.
*/ */
boolean hasPower( PlayerEntity player, double amount, ItemStack is ); boolean hasPower(PlayerEntity player, double amount, ItemStack is);
/** /**
* Return the config manager for the wireless terminal. * Return the config manager for the wireless terminal.
* *
* @param is wireless terminal * @param is wireless terminal
* *
* @return config manager of wireless terminal * @return config manager of wireless terminal
*/ */
IConfigManager getConfigManager( ItemStack is ); IConfigManager getConfigManager(ItemStack is);
} }
@@ -23,44 +23,40 @@
package appeng.api.features; package appeng.api.features;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
/** /**
* Registration record for a Custom Cell handler. * Registration record for a Custom Cell handler.
*/ */
public interface IWirelessTermRegistry public interface IWirelessTermRegistry {
{
/** /**
* add this handler to the list of other wireless handler. * add this handler to the list of other wireless handler.
* *
* @param handler wireless handler * @param handler wireless handler
*/ */
void registerWirelessHandler( IWirelessTermHandler handler ); void registerWirelessHandler(IWirelessTermHandler handler);
/** /**
* @param is item which might have a handler * @param is item which might have a handler
* *
* @return true if there is a handler for this item * @return true if there is a handler for this item
*/ */
boolean isWirelessTerminal( ItemStack is ); boolean isWirelessTerminal(ItemStack is);
/** /**
* @param is item with handler * @param is item with handler PlayerEntity
* PlayerEntity * @return a register handler for the item in question, or null if there isn't
* @return a register handler for the item in question, or null if there * one
* isn't one */
*/ IWirelessTermHandler getWirelessTerminalHandler(ItemStack is);
IWirelessTermHandler getWirelessTerminalHandler( ItemStack is );
/** /**
* opens the wireless terminal gui, the wireless terminal item, must be in * opens the wireless terminal gui, the wireless terminal item, must be in the
* the active slot on the tool bar. * active slot on the tool bar.
*/ */
void openWirelessTerminalGui( ItemStack item, IBlockReader world, PlayerEntity player, Hand hand ); void openWirelessTerminalGui(ItemStack item, IBlockReader world, PlayerEntity player, Hand hand);
} }
@@ -23,25 +23,21 @@
package appeng.api.features; package appeng.api.features;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.dimension.Dimension; 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; package appeng.api.features;
public enum InscriberProcessType {
/**
* uses the optionals as catalyst
*/
INSCRIBE,
public enum InscriberProcessType /**
{ * spends the optionals
/** */
* uses the optionals as catalyst PRESS
*/
INSCRIBE,
/**
* spends the optionals
*/
PRESS
} }
@@ -23,27 +23,24 @@
package appeng.api.implementations; package appeng.api.implementations;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.api.networking.crafting.ICraftingPatternDetails; import appeng.api.networking.crafting.ICraftingPatternDetails;
/** /**
* Implemented on {@link Item} * Implemented on {@link Item}
*/ */
public interface ICraftingPatternItem public interface ICraftingPatternItem {
{
/** /**
* Access Details about a pattern * Access Details about a pattern
* *
* @param is pattern * @param is pattern
* @param w crafting world * @param w crafting world
* *
* @return details of pattern * @return details of pattern
*/ */
ICraftingPatternDetails getPatternForItem( ItemStack is, World w ); ICraftingPatternDetails getPatternForItem(ItemStack is, World w);
} }
@@ -23,20 +23,18 @@
package appeng.api.implementations; package appeng.api.implementations;
/** /**
* This is intended for use on the client side to provide details to WAILA. * 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. * @return true if the part/tile is powered.
*/ */
boolean isPowered(); boolean isPowered();
/** /**
* @return true if the part/tile isActive * @return true if the part/tile isActive
*/ */
boolean isActive(); boolean isActive();
} }
@@ -23,26 +23,23 @@
package appeng.api.implementations; package appeng.api.implementations;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import appeng.api.config.Upgrades; import appeng.api.config.Upgrades;
import appeng.api.implementations.tiles.ISegmentedInventory; import appeng.api.implementations.tiles.ISegmentedInventory;
import appeng.api.util.IConfigurableObject; 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. * the tile...
*/ *
int getInstalledUpgrades( Upgrades u ); * @return tile entity
*/
/** TileEntity getTile();
* the tile...
*
* @return tile entity
*/
TileEntity getTile();
} }
@@ -23,19 +23,16 @@
package appeng.api.implementations; package appeng.api.implementations;
/** /**
* Defines the result of performing a transition from the world into a storage * Defines the result of performing a transition from the world into a storage
* cell, if its possible, and what the energy usage is. * cell, if its possible, and what the energy usage is.
*/ */
public class TransitionResult public class TransitionResult {
{ public final boolean success;
public final boolean success; public final double energyUsage;
public final double energyUsage;
public TransitionResult( final boolean success, final double power ) public TransitionResult(final boolean success, final double power) {
{ this.success = success;
this.success = success; this.energyUsage = power;
this.energyUsage = power; }
}
} }
@@ -23,28 +23,27 @@
package appeng.api.implementations.guiobjects; package appeng.api.implementations.guiobjects;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import javax.annotation.Nullable;
/** /**
* Implemented on Item objects, to return objects used to manage, and interact * Implemented on Item objects, to return objects used to manage, and interact
* with the contents. * with the contents.
*/ */
public interface IGuiItem public interface IGuiItem {
{ /**
/** *
* * @param is The item used to open the container.
* @param is The item used to open the container. * @param playerInventorySlot The slot in the player's inventory the item is in.
* @param playerInventorySlot The slot in the player's inventory the item is in. * @param world The world the player is in.
* @param world The world the player is in. * @param pos If the item was used on a block in the world, has
* @param pos If the item was used on a block in the world, has that block's position. Null if no block was targetted. * that block's position. Null if no block was
* @return Null if no GUI object is available. * targetted.
*/ * @return Null if no GUI object is available.
@Nullable */
IGuiItemObject getGuiObject( ItemStack is, int playerInventorySlot, World world, @Nullable BlockPos pos ); @Nullable
IGuiItemObject getGuiObject(ItemStack is, int playerInventorySlot, World world, @Nullable BlockPos pos);
} }
@@ -23,12 +23,9 @@
package appeng.api.implementations.guiobjects; package appeng.api.implementations.guiobjects;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public interface IGuiItemObject {
public interface IGuiItemObject ItemStack getItemStack();
{
ItemStack getItemStack();
} }
@@ -23,18 +23,15 @@
package appeng.api.implementations.guiobjects; package appeng.api.implementations.guiobjects;
import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandler;
import appeng.api.networking.IGridHost; import appeng.api.networking.IGridHost;
/** /**
* Obtained via {@link IGuiItem} getGuiObject * Obtained via {@link IGuiItem} getGuiObject
*/ */
public interface INetworkTool extends IGuiItemObject public interface INetworkTool extends IGuiItemObject {
{ IGridHost getGridHost(); // null for most purposes.
IGridHost getGridHost(); // null for most purposes.
IItemHandler getInventory(); IItemHandler getInventory();
} }
@@ -23,17 +23,14 @@
package appeng.api.implementations.guiobjects; package appeng.api.implementations.guiobjects;
import appeng.api.networking.energy.IEnergySource; import appeng.api.networking.energy.IEnergySource;
import appeng.api.storage.IMEMonitor; import appeng.api.storage.IMEMonitor;
import appeng.api.storage.ITerminalHost; import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
/** /**
* Obtained via {@link IGuiItem} getGuiObject * 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; package appeng.api.implementations.items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.config.AccessRestriction; import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable; import appeng.api.config.Actionable;
import appeng.api.networking.energy.IAEPowerStorage; import appeng.api.networking.energy.IAEPowerStorage;
/** /**
* Basically the same as {@link IAEPowerStorage}, but for items. * Basically the same as {@link IAEPowerStorage}, but for items.
*/ */
public interface IAEItemPowerStorage public interface IAEItemPowerStorage {
{ /**
/** * Inject amt, power into the device, it will store what it can, and return the
* Inject amt, power into the device, it will store what it can, and return * amount unable to be stored.
* the amount unable to be stored. *
* * @return amount unable to be stored
* @return amount unable to be stored */
*/ double injectAEPower(ItemStack stack, double amount, Actionable mode);
double injectAEPower( ItemStack stack, double amount, Actionable mode );
/** /**
* Attempt to extract power from the device, it will extract what it can and * Attempt to extract power from the device, it will extract what it can and
* return it. * return it.
* *
* @param amount to be extracted power from device * @param amount to be extracted power from device
* *
* @return what it could extract * @return what it could extract
*/ */
double extractAEPower( ItemStack stack, double amount, Actionable mode ); double extractAEPower(ItemStack stack, double amount, Actionable mode);
/** /**
* @return the current maximum power ( this can change :P ) * @return the current maximum power ( this can change :P )
*/ */
double getAEMaxPower( ItemStack stack ); double getAEMaxPower(ItemStack stack);
/** /**
* @return the current AE Power Level, this may exceed getMEMaxPower() * @return the current AE Power Level, this may exceed getMEMaxPower()
*/ */
double getAECurrentPower( ItemStack stack ); double getAECurrentPower(ItemStack stack);
/** /**
* Control the power flow by telling what the network can do, either add? or * Control the power flow by telling what the network can do, either add? or
* subtract? or both! * subtract? or both!
* *
* @return access restriction of network * @return access restriction of network
*/ */
AccessRestriction getPowerFlow( ItemStack stack ); AccessRestriction getPowerFlow(ItemStack stack);
} }
@@ -23,26 +23,23 @@
package appeng.api.implementations.items; package appeng.api.implementations.items;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
/** /**
* Implemented on AE's wrench(s) as a substitute for if BC's API is not * Implemented on AE's wrench(s) as a substitute for if BC's API is not
* available. * available.
*/ */
public interface IAEWrench public interface IAEWrench {
{
/** /**
* Check if the wrench can be used. * Check if the wrench can be used.
* *
* @param player wrenching player * @param player wrenching player
* @param pos of block. * @param pos of block.
* *
* @return true if wrench can be used * @return true if wrench can be used
*/ */
boolean canWrench( ItemStack wrench, PlayerEntity player, BlockPos pos ); boolean canWrench(ItemStack wrench, PlayerEntity player, BlockPos pos);
} }
@@ -23,7 +23,6 @@
package appeng.api.implementations.items; package appeng.api.implementations.items;
import java.util.EnumSet; import java.util.EnumSet;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
@@ -34,58 +33,58 @@ import appeng.api.config.SecurityPermissions;
import appeng.api.features.IPlayerRegistry; import appeng.api.features.IPlayerRegistry;
import appeng.api.networking.security.ISecurityRegistry; 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. * @return {@link GameProfile} of the player encoded on this card, or a blank
*/ * string.
void setProfile( ItemStack itemStack, GameProfile username ); */
GameProfile getProfile(ItemStack is);
/** /**
* @return {@link GameProfile} of the player encoded on this card, or a blank string. * @param itemStack card
*/ *
GameProfile getProfile( ItemStack is ); * @return the full list of permissions encoded on the card.
*/
EnumSet<SecurityPermissions> getPermissions(ItemStack itemStack);
/** /**
* @param itemStack card * Check if a permission is encoded on the card.
* *
* @return the full list of permissions encoded on the card. * @param permission card
*/ *
EnumSet<SecurityPermissions> getPermissions( ItemStack itemStack ); * @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. * remove a permission from the item stack.
* *
* @param permission card * @param itemStack card
* * @param permission to be removed permission
* @return true if this permission is set on the card. */
*/ void removePermission(ItemStack itemStack, SecurityPermissions permission);
boolean hasPermission( ItemStack is, SecurityPermissions permission );
/** /**
* remove a permission from the item stack. * add a permission to the item stack.
* *
* @param itemStack card * @param itemStack card
* @param permission to be removed permission * @param permission to be added permission
*/ */
void removePermission( ItemStack itemStack, SecurityPermissions permission ); void addPermission(ItemStack itemStack, SecurityPermissions permission);
/** /**
* add a permission to the item stack. * lets you handle submission of security values on the card for custom
* * behavior.
* @param itemStack card *
* @param permission to be added permission * @param registry security registry
*/ * @param pr player registry
void addPermission( ItemStack itemStack, SecurityPermissions permission ); * @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; package appeng.api.implementations.items;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack; 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; package appeng.api.implementations.items;
import java.util.Set; import java.util.Set;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
/** /**
* Lets you specify the name of the group of items this falls under. * 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. * returning null, is the same as not implementing the interface at all.
* *
* @param is item * @param is item
* *
* @return an unlocalized string to use for the items group name. * @return an unlocalized string to use for the items group name.
*/ */
String getUnlocalizedGroupName( Set<ItemStack> otherItems, ItemStack is ); String getUnlocalizedGroupName(Set<ItemStack> otherItems, ItemStack is);
} }
@@ -23,74 +23,74 @@
package appeng.api.implementations.items; package appeng.api.implementations.items;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
/** /**
* Memory Card API * Memory Card API
* *
* AE's Memory Card Item Class implements this interface. * 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 * Configures the data stored on the memory card, the SettingsName, will be
* localized when displayed. * localized when displayed.
* *
* The data can contain an optional string with the key "tooltip", which will be used as * The data can contain an optional string with the key "tooltip", which will be
* unlocalized string to display it after the settings name. * 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. * The data can contain an optional intArray using "colorCode" to be displayed
* It needs to have exactly 8 elements representing the ordinal of the matching {@link AEColor}. * on the model itself. It needs to have exactly 8 elements representing the
* The first 4 values represent the top row, left to right. The second 4 the bottom row. * 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 is item
* @param data the NBT tag, refer to the normal comment for special keys. * @param settingsName unlocalized string that represents the tile entity.
*/ * @param data the NBT tag, refer to the normal comment for special
void setMemoryCardContents( ItemStack is, String settingsName, CompoundNBT data ); * keys.
*/
void setMemoryCardContents(ItemStack is, String settingsName, CompoundNBT data);
/** /**
* returns the settings name provided by a previous call to * returns the settings name provided by a previous call to
* setMemoryCardContents, or "AppEng.GuiITooltip.Blank" if there was no * setMemoryCardContents, or "AppEng.GuiITooltip.Blank" if there was no previous
* previous call to setMemoryCardContents. * call to setMemoryCardContents.
* *
* @param is item * @param is item
* *
* @return setting name * @return setting name
*/ */
String getSettingsName( ItemStack is ); String getSettingsName(ItemStack is);
/** /**
* @param is item * @param is item
* *
* @return the NBT Data previously saved by setMemoryCardContents, or an * @return the NBT Data previously saved by setMemoryCardContents, or an empty
* empty NBTCompound * NBTCompound
*/ */
CompoundNBT getData( ItemStack is ); CompoundNBT getData(ItemStack is);
/** /**
* This represent as 4x2 grid of {@link AEColor} without transparent/fluix color. * 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. *
* * First 4 colors are used for the top row, second for the bottom one.
* @param is item *
* * @param is item
* @return a hash representation of the memory card content *
*/ * @return a hash representation of the memory card content
AEColor[] getColorCode( ItemStack is ); */
AEColor[] getColorCode(ItemStack is);
/** /**
* notify the user of a outcome related to the memory card. * notify the user of a outcome related to the memory card.
* *
* @param player that used the card. * @param player that used the card.
* @param msg which message to send. * @param msg which message to send.
*/ */
void notifyUser( PlayerEntity player, MemoryCardMessages msg ); void notifyUser(PlayerEntity player, MemoryCardMessages msg);
} }
@@ -23,57 +23,54 @@
package appeng.api.implementations.items; package appeng.api.implementations.items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.dimension.DimensionType;
import appeng.api.implementations.TransitionResult; import appeng.api.implementations.TransitionResult;
import appeng.api.storage.ISpatialDimension; import appeng.api.storage.ISpatialDimension;
import appeng.api.util.WorldCoord; import appeng.api.util.WorldCoord;
import net.minecraft.world.dimension.DimensionType;
/** /**
* Implemented on a {@link Item} * Implemented on a {@link Item}
*/ */
public interface ISpatialStorageCell public interface ISpatialStorageCell {
{
/** /**
* @param is spatial storage cell * @param is spatial storage cell
* *
* @return true if this item is a spatial storage cell * @return true if this item is a spatial storage cell
*/ */
boolean isSpatialStorage( ItemStack is ); boolean isSpatialStorage(ItemStack is);
/** /**
* @param is spatial storage cell * @param is spatial storage cell
* *
* @return the maximum size of the spatial storage cell along any given axis * @return the maximum size of the spatial storage cell along any given axis
*/ */
int getMaxStoredDim( ItemStack is ); int getMaxStoredDim(ItemStack is);
/** /**
* get the currently stored Dimension id. * get the currently stored Dimension id.
* *
* @param is spatial storage cell * @param is spatial storage cell
* *
* @return dimension id or -1 * @return dimension id or -1
*/ */
DimensionType getStoredDimension(ItemStack is ); DimensionType getStoredDimension(ItemStack is);
/** /**
* Perform a spatial swap with the contents of the cell, and the world. * Perform a spatial swap with the contents of the cell, and the world.
* *
* @param is spatial storage cell * @param is spatial storage cell
* @param w world of spatial * @param w world of spatial
* @param min min coord * @param min min coord
* @param max max coord * @param max max coord
* @param playerId owner of current grid or -1 * @param playerId owner of current grid or -1
* *
* @return result of transition * @return result of transition
*/ */
TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, int playerId ); TransitionResult doSpatialTransition(ItemStack is, World w, WorldCoord min, WorldCoord max, int playerId);
} }
@@ -23,7 +23,6 @@
package appeng.api.implementations.items; package appeng.api.implementations.items;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -32,7 +31,6 @@ import appeng.api.storage.ICellWorkbenchItem;
import appeng.api.storage.IStorageChannel; import appeng.api.storage.IStorageChannel;
import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IAEStack;
/** /**
* Any item which implements this can be treated as an IMEInventory via * Any item which implements this can be treated as an IMEInventory via
* Util.getCell / Util.isCell It automatically handles the internals and NBT * 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 * 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. * It wont work if the return is not a multiple of 8. The limit is
* The limit is ({@link Integer#MAX_VALUE} + 1) / 8. * ({@link Integer#MAX_VALUE} + 1) / 8.
* *
* @param cellItem item * @param cellItem item
* *
* @return number of bytes * @return number of bytes
*/ */
int getBytes( @Nonnull ItemStack cellItem ); int getBytes(@Nonnull ItemStack cellItem);
/** /**
* Determines the number of bytes used for any type included on the cell. * Determines the number of bytes used for any type included on the cell.
* *
* @param cellItem item * @param cellItem item
* *
* @return number of bytes * @return number of bytes
*/ */
int getBytesPerType( @Nonnull ItemStack cellItem ); int getBytesPerType(@Nonnull ItemStack cellItem);
/** /**
* Must be between 1 and 63, indicates how many types you want to store on * Must be between 1 and 63, indicates how many types you want to store on the
* the item. * item.
* *
* @param cellItem item * @param cellItem item
* *
* @return number of types * @return number of types
*/ */
int getTotalTypes( @Nonnull ItemStack cellItem ); int getTotalTypes(@Nonnull ItemStack cellItem);
/** /**
* Allows you to fine tune which items are allowed on a given cell, if you * Allows you to fine tune which items are allowed on a given cell, if you don't
* don't care, just return false; As the handler for this type of cell is * care, just return false; As the handler for this type of cell is still the
* still the default cells, the normal AE black list is also applied. * default cells, the normal AE black list is also applied.
* *
* @param cellItem item * @param cellItem item
* @param requestedAddition requested addition * @param requestedAddition requested addition
* *
* @return true to preventAdditionOfItem * @return true to preventAdditionOfItem
*/ */
boolean isBlackListed( @Nonnull ItemStack cellItem, @Nonnull T requestedAddition ); boolean isBlackListed(@Nonnull ItemStack cellItem, @Nonnull T requestedAddition);
/** /**
* Allows you to specify if this storage cell can be stored inside other * Allows you to specify if this storage cell can be stored inside other storage
* storage cells, only set this for special items like the matter cannon * cells, only set this for special items like the matter cannon that are not
* that are not general purpose storage. * general purpose storage.
* *
* @return true if the storage cell can be stored inside other storage * @return true if the storage cell can be stored inside other storage cells,
* cells, this is generally false, except for certain situations * this is generally false, except for certain situations such as the
* such as the matter cannon. * matter cannon.
*/ */
boolean storableInStorageCell(); boolean storableInStorageCell();
/** /**
* Allows an item to selectively enable or disable its status as a storage * Allows an item to selectively enable or disable its status as a storage cell.
* cell. *
* * @param i item
* @param i item *
* * @return if the ItemStack should behavior as a storage cell.
* @return if the ItemStack should behavior as a storage cell. */
*/ boolean isStorageCell(@Nonnull ItemStack i);
boolean isStorageCell( @Nonnull ItemStack i );
/** /**
* @return drain in ae/t this storage cell will use. * @return drain in ae/t this storage cell will use.
*/ */
double getIdleDrain(); double getIdleDrain();
/** /**
* @return the type of channel your cell should be part of * @return the type of channel your cell should be part of
*/ */
@Nonnull @Nonnull
IStorageChannel<T> getChannel(); IStorageChannel<T> getChannel();
} }
@@ -23,34 +23,31 @@
package appeng.api.implementations.items; package appeng.api.implementations.items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
/** /**
* Implemented on a {@link Item} * 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, * This isn't necessarily the same as if you make a storage cell out of it, but
* but all of AE's default cells do it that way, its currently only used for * all of AE's default cells do it that way, its currently only used for the
* the condenser. * condenser.
* *
* @param is item * @param is item
* *
* @return number of bytes * @return number of bytes
*/ */
int getBytes( ItemStack is ); int getBytes(ItemStack is);
/** /**
* Just true or false for the item stack. * Just true or false for the item stack.
* *
* @param is item * @param is item
* *
* @return true if item is a storage component * @return true if item is a storage component
*/ */
boolean isStorageComponent( ItemStack is ); boolean isStorageComponent(ItemStack is);
} }
@@ -23,19 +23,16 @@
package appeng.api.implementations.items; package appeng.api.implementations.items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import appeng.api.config.Upgrades; import appeng.api.config.Upgrades;
public interface IUpgradeModule {
public interface IUpgradeModule /**
{ * @param itemstack item with potential upgrades
*
/** * @return null, or a valid upgrade type.
* @param itemstack item with potential upgrades */
* Upgrades getType(ItemStack itemstack);
* @return null, or a valid upgrade type.
*/
Upgrades getType( ItemStack itemstack );
} }
@@ -23,11 +23,9 @@
package appeng.api.implementations.items; package appeng.api.implementations.items;
/** /**
* Status Results for use with {@link IMemoryCard} * Status Results for use with {@link IMemoryCard}
*/ */
public enum MemoryCardMessages public enum MemoryCardMessages {
{ INVALID_MACHINE, SETTINGS_LOADED, SETTINGS_SAVED, SETTINGS_RESET, SETTINGS_CLEARED
INVALID_MACHINE, SETTINGS_LOADED, SETTINGS_SAVED, SETTINGS_RESET, SETTINGS_CLEARED
} }
@@ -23,7 +23,6 @@
package appeng.api.implementations.parts; package appeng.api.implementations.parts;
import java.util.EnumSet; import java.util.EnumSet;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
@@ -37,54 +36,53 @@ import appeng.api.util.AECableType;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
/** /**
* Implemented on the {@link IPart}s cable objects that can be placed at {@link AEPartLocation}.UNKNOWN in * Implemented on the {@link IPart}s cable objects that can be placed at
* {@link IPartHost}s * {@link AEPartLocation}.UNKNOWN in {@link IPartHost}s
*/ */
public interface IPartCable extends IPart, IGridHost public interface IPartCable extends IPart, IGridHost {
{
/** /**
* does this cable support buses? * does this cable support buses?
*/ */
BusSupport supportsBuses(); BusSupport supportsBuses();
/** /**
* @return the current color of the cable. * @return the current color of the cable.
*/ */
AEColor getCableColor(); AEColor getCableColor();
/** /**
* @return the Cable type. * @return the Cable type.
*/ */
AECableType getCableConnectionType(); AECableType getCableConnectionType();
/** /**
* Change the color of the cable, this should cost a small amount of dye, or something. * Change the color of the cable, this should cost a small amount of dye, or
* * something.
* @param newColor new color *
* * @param newColor new color
* @return if the color change was successful. *
*/ * @return if the color change was successful.
boolean changeColor( AEColor newColor, PlayerEntity who ); */
boolean changeColor(AEColor newColor, PlayerEntity who);
/** /**
* Change sides on the cables node. * Change sides on the cables node.
* *
* Called by AE, do not invoke. * Called by AE, do not invoke.
* *
* @param sides sides of cable * @param sides sides of cable
*/ */
void setValidSides( EnumSet<Direction> sides ); void setValidSides(EnumSet<Direction> sides);
/** /**
* used to tests if a cable connects to neighbors visually. * used to tests if a cable connects to neighbors visually.
* *
* @param side neighbor side * @param side neighbor side
* *
* @return true if this side is currently connects to an external block. * @return true if this side is currently connects to an external block.
*/ */
boolean isConnected( Direction side ); boolean isConnected(Direction side);
} }
@@ -23,20 +23,17 @@
package appeng.api.implementations.parts; package appeng.api.implementations.parts;
import appeng.api.networking.IGridHost; import appeng.api.networking.IGridHost;
import appeng.api.parts.IPart; import appeng.api.parts.IPart;
/** /**
* Implemented by all screen like parts provided by AE. * 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 * @return if the device is online you should check this before providing any
* any other information. * other information.
*/ */
boolean isPowered(); boolean isPowered();
} }
@@ -23,28 +23,26 @@
package appeng.api.implementations.parts; package appeng.api.implementations.parts;
import appeng.api.networking.IGridHost; import appeng.api.networking.IGridHost;
import appeng.api.parts.IPart; import appeng.api.parts.IPart;
import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IAEStack;
import appeng.api.util.INetworkToolAgent; import appeng.api.util.INetworkToolAgent;
/** /**
* The Storage monitor is a {@link IPart} located on the sides of a IPartHost * 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 * @return the item being displayed on the storage monitor, in AEStack Form, can
* IAEFluidStack the quantity is important remember to use getStackSize() on the IAEStack, and not on the * be either a IAEItemStack or an IAEFluidStack the quantity is
* FluidStack/ItemStack acquired from it. * important remember to use getStackSize() on the IAEStack, and not on
*/ * the FluidStack/ItemStack acquired from it.
IAEStack<?> getDisplayed(); */
IAEStack<?> getDisplayed();
/** /**
* @return the current locked state of the Storage Monitor * @return the current locked state of the Storage Monitor
*/ */
boolean isLocked(); boolean isLocked();
} }
@@ -23,54 +23,53 @@
package appeng.api.implementations.tiles; package appeng.api.implementations.tiles;
import javax.annotation.Nullable;
import net.minecraft.item.Item;
import appeng.api.networking.IGridHost; import appeng.api.networking.IGridHost;
import appeng.api.storage.ICellContainer; import appeng.api.storage.ICellContainer;
import appeng.api.util.IOrientable; 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. * @return if the device is online you should check this before providing any
*/ * other information.
int getCellCount(); */
boolean isPowered();
/** /**
* 0 - cell is missing. * @param slot slot index
* *
* 1 - green, * @return is the cell currently blinking to show activity.
* */
* 2 - orange, boolean isCellBlinking(int slot);
*
* 3 - red
*
* @param slot slot index
*
* @return status of the slot, one of the above indices.
*/
int getCellStatus( int slot );
/** /**
* @return if the device is online you should check this before providing any other information. * Returns the item of the cell in the given slot or null.
*/ */
boolean isPowered(); @Nullable
Item getCellItem(int slot);
/**
* @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 );
} }
@@ -23,17 +23,14 @@
package appeng.api.implementations.tiles; package appeng.api.implementations.tiles;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import appeng.api.util.AEColor; 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; package appeng.api.implementations.tiles;
import net.minecraft.inventory.CraftingInventory; import net.minecraft.inventory.CraftingInventory;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import appeng.api.networking.crafting.ICraftingPatternDetails; 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. * 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
* @param patternDetails details of pattern * instead.
* @param table crafting table *
* @param ejectionDirection ejection direction * @return true, if pushPattern can complete, if its false push will always be
* * false.
* @return if it was accepted, all or nothing. */
*/ boolean acceptsPlans();
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();
} }
@@ -23,10 +23,8 @@
package appeng.api.implementations.tiles; package appeng.api.implementations.tiles;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
/** /**
* Crank/Crankable API, * Crank/Crankable API,
* *
@@ -37,23 +35,22 @@ import net.minecraft.util.Direction;
* *
* This interface must be implemented by a tile entity. * 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. * Test if the crank can turn, return false if there is no work to be done.
* *
* @return if crank should be allowed to turn. * @return if crank should be allowed to turn.
*/ */
boolean canTurn(); boolean canTurn();
/** /**
* The crank has completed one turn. * The crank has completed one turn.
*/ */
void applyTurn(); void applyTurn();
/** /**
* @return true if the crank can attach on the given side. * @return true if the crank can attach on the given side.
*/ */
boolean canCrankAttach( Direction directionToCrank ); boolean canCrankAttach(Direction directionToCrank);
} }
@@ -23,9 +23,7 @@
package appeng.api.implementations.tiles; package appeng.api.implementations.tiles;
public interface ICrystalGrowthAccelerator {
public interface ICrystalGrowthAccelerator boolean isPowered();
{
boolean isPowered();
} }
@@ -23,11 +23,8 @@
package appeng.api.implementations.tiles; package appeng.api.implementations.tiles;
import appeng.api.networking.energy.IEnergySource; 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; package appeng.api.implementations.tiles;
import net.minecraftforge.items.IItemHandler; 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.
* 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
* *
* @param name inventory name * @return inventory with inventory name
* */
* @return inventory with inventory name IItemHandler getInventoryByName(String name);
*/
IItemHandler getInventoryByName( String name );
} }

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