Merge pull request #543 from thatsIch/e-remove-submodules
Remove gitmodules
This commit is contained in:
commit
2af5a17054
243 changed files with 14227 additions and 9 deletions
7
.gitmodules
vendored
7
.gitmodules
vendored
|
@ -1,7 +0,0 @@
|
||||||
|
|
||||||
[submodule "src/main/resources/assets/appliedenergistics2/lang"]
|
|
||||||
path = src/main/resources/assets/appliedenergistics2/lang
|
|
||||||
url = https://github.com/AppliedEnergistics/AppliedEnergistics-2-Localization.git
|
|
||||||
[submodule "src/api/java/appeng/api"]
|
|
||||||
path = src/api/java/appeng/api
|
|
||||||
url = https://github.com/AppliedEnergistics/Applied-Energistics-2-API.git
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 5dd2dd9d4cf50eeeb1b6d57d4770cbff82ebe935
|
|
38
src/api/java/appeng/api/AEApi.java
Normal file
38
src/api/java/appeng/api/AEApi.java
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
package appeng.api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Entry point for api.
|
||||||
|
*
|
||||||
|
* Available IMCs:
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class AEApi
|
||||||
|
{
|
||||||
|
|
||||||
|
static private IAppEngApi api = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API Entry Point.
|
||||||
|
*
|
||||||
|
* @return the {@link IAppEngApi} or null if the instance could not be retrieved
|
||||||
|
*/
|
||||||
|
public static IAppEngApi instance()
|
||||||
|
{
|
||||||
|
if ( api == null )
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Class c = Class.forName( "appeng.core.Api" );
|
||||||
|
api = (IAppEngApi) c.getField( "instance" ).get( c );
|
||||||
|
}
|
||||||
|
catch (Throwable e)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return api;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
71
src/api/java/appeng/api/IAppEngApi.java
Normal file
71
src/api/java/appeng/api/IAppEngApi.java
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
package appeng.api;
|
||||||
|
|
||||||
|
import appeng.api.definitions.Blocks;
|
||||||
|
import appeng.api.definitions.Items;
|
||||||
|
import appeng.api.definitions.Materials;
|
||||||
|
import appeng.api.definitions.Parts;
|
||||||
|
import appeng.api.exceptions.FailedConnection;
|
||||||
|
import appeng.api.features.IRegistryContainer;
|
||||||
|
import appeng.api.networking.IGridBlock;
|
||||||
|
import appeng.api.networking.IGridConnection;
|
||||||
|
import appeng.api.networking.IGridHost;
|
||||||
|
import appeng.api.networking.IGridNode;
|
||||||
|
import appeng.api.parts.IPartHelper;
|
||||||
|
import appeng.api.storage.IStorageHelper;
|
||||||
|
|
||||||
|
public interface IAppEngApi
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Registry Container for the numerous registries in AE2.
|
||||||
|
*/
|
||||||
|
IRegistryContainer registries();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return helper for working with storage data types.
|
||||||
|
*/
|
||||||
|
IStorageHelper storage();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return helper for working with grids, and buses.
|
||||||
|
*/
|
||||||
|
IPartHelper partHelper();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return an accessible list of all of AE's Items
|
||||||
|
*/
|
||||||
|
Items items();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return an accessible list of all of AE's materials; materials are items
|
||||||
|
*/
|
||||||
|
Materials materials();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return an accessible list of all of AE's blocks
|
||||||
|
*/
|
||||||
|
Blocks blocks();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return an accessible list of all of AE's parts, parts are items
|
||||||
|
*/
|
||||||
|
Parts parts();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a grid node for your {@link IGridHost}
|
||||||
|
*
|
||||||
|
* @param block grid block
|
||||||
|
* @return grid node of block
|
||||||
|
*/
|
||||||
|
IGridNode createGridNode(IGridBlock block);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a connection between two {@link IGridNode}
|
||||||
|
*
|
||||||
|
* @param a to be connected gridnode
|
||||||
|
* @param b to be connected gridnode
|
||||||
|
* @throws FailedConnection
|
||||||
|
*/
|
||||||
|
IGridConnection createGridConnection(IGridNode a, IGridNode b) throws FailedConnection;
|
||||||
|
|
||||||
|
}
|
20
src/api/java/appeng/api/LICENSE
Normal file
20
src/api/java/appeng/api/LICENSE
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013 AlgorithmX2
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
src/api/java/appeng/api/README.md
Normal file
19
src/api/java/appeng/api/README.md
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
Applied-Energistics-2-API
|
||||||
|
=========================
|
||||||
|
|
||||||
|
The API for Applied Energistics 2. It is open source to discuss changes, improve documentation, and provide better add-on support in general.
|
||||||
|
|
||||||
|
Development and standard builds can be obtained [Here](http://ae2.ae-mod.info/Downloads/).
|
||||||
|
|
||||||
|
Maven
|
||||||
|
=========================
|
||||||
|
|
||||||
|
When compiling against the AE2 API you can use gradle dependencies, just add
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile "appeng:appliedenergistics2:rv_-_____-__:dev"
|
||||||
|
}
|
||||||
|
|
||||||
|
or add the compile line to your existing dependencies task to your build.gradle
|
||||||
|
|
||||||
|
Where the __ are filled in with the correct version criteria; AE2 is available from the default forge maven so no additional repositories are necessary.
|
48
src/api/java/appeng/api/config/AccessRestriction.java
Normal file
48
src/api/java/appeng/api/config/AccessRestriction.java
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum AccessRestriction
|
||||||
|
{
|
||||||
|
NO_ACCESS(0), READ(1), WRITE(2), READ_WRITE(3);
|
||||||
|
|
||||||
|
private final int permissionBit;
|
||||||
|
|
||||||
|
private AccessRestriction(int v) {
|
||||||
|
permissionBit = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasPermission(AccessRestriction ar)
|
||||||
|
{
|
||||||
|
return (permissionBit & ar.permissionBit) == ar.permissionBit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccessRestriction restrictPermissions(AccessRestriction ar)
|
||||||
|
{
|
||||||
|
return getPermByBit( permissionBit & ar.permissionBit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccessRestriction addPermissions(AccessRestriction ar)
|
||||||
|
{
|
||||||
|
return getPermByBit( permissionBit | ar.permissionBit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccessRestriction removePermissions(AccessRestriction ar)
|
||||||
|
{
|
||||||
|
return getPermByBit( permissionBit & (~ar.permissionBit) );
|
||||||
|
}
|
||||||
|
|
||||||
|
private AccessRestriction getPermByBit(int bit)
|
||||||
|
{
|
||||||
|
switch (bit)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case 0:
|
||||||
|
return NO_ACCESS;
|
||||||
|
case 1:
|
||||||
|
return READ;
|
||||||
|
case 2:
|
||||||
|
return WRITE;
|
||||||
|
case 3:
|
||||||
|
return READ_WRITE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
src/api/java/appeng/api/config/ActionItems.java
Normal file
6
src/api/java/appeng/api/config/ActionItems.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum ActionItems
|
||||||
|
{
|
||||||
|
WRENCH, CLOSE, STASH, ENCODE, SUBSTITUTION
|
||||||
|
}
|
14
src/api/java/appeng/api/config/Actionable.java
Normal file
14
src/api/java/appeng/api/config/Actionable.java
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum Actionable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Perform the intended action.
|
||||||
|
*/
|
||||||
|
MODULATE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pretend to perform the action.
|
||||||
|
*/
|
||||||
|
SIMULATE
|
||||||
|
}
|
15
src/api/java/appeng/api/config/CondenserOutput.java
Normal file
15
src/api/java/appeng/api/config/CondenserOutput.java
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
|
||||||
|
public enum CondenserOutput
|
||||||
|
{
|
||||||
|
|
||||||
|
TRASH, // 0
|
||||||
|
|
||||||
|
MATTER_BALLS, // 256
|
||||||
|
|
||||||
|
SINGULARITY; // 250,000
|
||||||
|
|
||||||
|
public int requiredPower = 0;
|
||||||
|
|
||||||
|
}
|
6
src/api/java/appeng/api/config/CopyMode.java
Normal file
6
src/api/java/appeng/api/config/CopyMode.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum CopyMode
|
||||||
|
{
|
||||||
|
CLEAR_ON_REMOVE, KEEP_ON_REMOVE
|
||||||
|
}
|
6
src/api/java/appeng/api/config/FullnessMode.java
Normal file
6
src/api/java/appeng/api/config/FullnessMode.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum FullnessMode
|
||||||
|
{
|
||||||
|
EMPTY, HALF, FULL
|
||||||
|
}
|
21
src/api/java/appeng/api/config/FuzzyMode.java
Normal file
21
src/api/java/appeng/api/config/FuzzyMode.java
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
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);
|
||||||
|
|
||||||
|
final public float breakPoint;
|
||||||
|
final public float percentage;
|
||||||
|
|
||||||
|
private FuzzyMode(float p) {
|
||||||
|
percentage = p;
|
||||||
|
breakPoint = p / 100.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int calculateBreakPoint(int maxDamage)
|
||||||
|
{
|
||||||
|
return (int) ((percentage * maxDamage) / 100.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
6
src/api/java/appeng/api/config/IncludeExclude.java
Normal file
6
src/api/java/appeng/api/config/IncludeExclude.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum IncludeExclude
|
||||||
|
{
|
||||||
|
WHITELIST, BLACKLIST
|
||||||
|
}
|
10
src/api/java/appeng/api/config/LevelEmitterMode.java
Normal file
10
src/api/java/appeng/api/config/LevelEmitterMode.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum LevelEmitterMode
|
||||||
|
{
|
||||||
|
|
||||||
|
STORED_AMOUNT,
|
||||||
|
|
||||||
|
STORABLE_AMOUNT
|
||||||
|
|
||||||
|
}
|
10
src/api/java/appeng/api/config/LevelType.java
Normal file
10
src/api/java/appeng/api/config/LevelType.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum LevelType
|
||||||
|
{
|
||||||
|
|
||||||
|
ITEM_LEVEL,
|
||||||
|
|
||||||
|
ENERGY_LEVEL
|
||||||
|
|
||||||
|
}
|
6
src/api/java/appeng/api/config/ModSettings.java
Normal file
6
src/api/java/appeng/api/config/ModSettings.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum ModSettings
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
12
src/api/java/appeng/api/config/NetworkEmitterMode.java
Normal file
12
src/api/java/appeng/api/config/NetworkEmitterMode.java
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum NetworkEmitterMode
|
||||||
|
{
|
||||||
|
|
||||||
|
POWER_LEVEL,
|
||||||
|
|
||||||
|
BOOTING,
|
||||||
|
|
||||||
|
CHANNEL_ERROR
|
||||||
|
|
||||||
|
}
|
6
src/api/java/appeng/api/config/OperationMode.java
Normal file
6
src/api/java/appeng/api/config/OperationMode.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum OperationMode
|
||||||
|
{
|
||||||
|
FILL, EMPTY
|
||||||
|
}
|
6
src/api/java/appeng/api/config/OutputMode.java
Normal file
6
src/api/java/appeng/api/config/OutputMode.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum OutputMode
|
||||||
|
{
|
||||||
|
EXPORT_ONLY, EXPORT_OR_CRAFT, CRAFT_ONLY
|
||||||
|
}
|
21
src/api/java/appeng/api/config/PowerMultiplier.java
Normal file
21
src/api/java/appeng/api/config/PowerMultiplier.java
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum PowerMultiplier
|
||||||
|
{
|
||||||
|
ONE, CONFIG;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* please do not edit this value, it is set when AE loads its config files.
|
||||||
|
*/
|
||||||
|
public double multiplier = 1.0;
|
||||||
|
|
||||||
|
public double multiply(double in)
|
||||||
|
{
|
||||||
|
return in * multiplier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double divide(double in)
|
||||||
|
{
|
||||||
|
return in / multiplier;
|
||||||
|
}
|
||||||
|
}
|
42
src/api/java/appeng/api/config/PowerUnits.java
Normal file
42
src/api/java/appeng/api/config/PowerUnits.java
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum PowerUnits
|
||||||
|
{
|
||||||
|
AE("gui.appliedenergistics2.units.appliedenergstics"), // Native Units - AE Energy
|
||||||
|
MJ("gui.appliedenergistics2.units.buildcraft"), // BuildCraft - Minecraft Joules
|
||||||
|
EU("gui.appliedenergistics2.units.ic2"), // IndustrialCraft 2 - Energy Units
|
||||||
|
WA("gui.appliedenergistics2.units.rotarycraft"), // RotaryCraft - Watts
|
||||||
|
RF("gui.appliedenergistics2.units.thermalexpansion"), // ThermalExpansion - Redstone Flux
|
||||||
|
MK("gui.appliedenergistics2.units.mekanism"); // Mekanism - Joules
|
||||||
|
|
||||||
|
private PowerUnits(String un) {
|
||||||
|
unlocalizedName = un;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* please do not edit this value, it is set when AE loads its config files.
|
||||||
|
*/
|
||||||
|
public double conversionRatio = 1.0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* unlocalized name for the power unit.
|
||||||
|
*/
|
||||||
|
final public String unlocalizedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* do power conversion using AE's conversion rates.
|
||||||
|
*
|
||||||
|
* Example: PowerUnits.EU.convertTo( PowerUnits.AE, 32 );
|
||||||
|
*
|
||||||
|
* will normally returns 64, as it will convert the EU, to AE with AE's power settings.
|
||||||
|
*
|
||||||
|
* @param target target power unit
|
||||||
|
* @param value value
|
||||||
|
* @return value converted to target units, from this units.
|
||||||
|
*/
|
||||||
|
public double convertTo(PowerUnits target, double value)
|
||||||
|
{
|
||||||
|
return (value * conversionRatio) / target.conversionRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
6
src/api/java/appeng/api/config/RedstoneMode.java
Normal file
6
src/api/java/appeng/api/config/RedstoneMode.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum RedstoneMode
|
||||||
|
{
|
||||||
|
IGNORE, LOW_SIGNAL, HIGH_SIGNAL, SIGNAL_PULSE
|
||||||
|
}
|
6
src/api/java/appeng/api/config/RelativeDirection.java
Normal file
6
src/api/java/appeng/api/config/RelativeDirection.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum RelativeDirection
|
||||||
|
{
|
||||||
|
LEFT, RIGHT, UP, DOW
|
||||||
|
}
|
6
src/api/java/appeng/api/config/SearchBoxMode.java
Normal file
6
src/api/java/appeng/api/config/SearchBoxMode.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum SearchBoxMode
|
||||||
|
{
|
||||||
|
AUTOSEARCH, MANUAL_SEARCH, NEI_AUTOSEARCH, NEI_MANUAL_SEARCH
|
||||||
|
}
|
47
src/api/java/appeng/api/config/SecurityPermissions.java
Normal file
47
src/api/java/appeng/api/config/SecurityPermissions.java
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represent the security systems basic permissions, these are not for anti-griefing, they are part of the mod as a
|
||||||
|
* gameplay feature.
|
||||||
|
*/
|
||||||
|
public enum SecurityPermissions
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* required to insert items into the network via terminal ( also used for machines based on the owner of the
|
||||||
|
* network, which is determined by its Security Block. )
|
||||||
|
*/
|
||||||
|
INJECT,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* required to extract items from the network via terminal ( also used for machines based on the owner of the
|
||||||
|
* network, which is determined by its Security Block. )
|
||||||
|
*/
|
||||||
|
EXTRACT,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* required to request crafting from the network via terminal.
|
||||||
|
*/
|
||||||
|
CRAFT,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* required to modify automation, and make modifications to the networks physical layout.
|
||||||
|
*/
|
||||||
|
BUILD,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* required to modify the security blocks settings.
|
||||||
|
*/
|
||||||
|
SECURITY;
|
||||||
|
|
||||||
|
final private String unlocalizedName = "gui.appliedenergistics2.security." + name().toLowerCase();
|
||||||
|
|
||||||
|
public String getUnlocalizedName()
|
||||||
|
{
|
||||||
|
return unlocalizedName + ".name";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnlocalizedTip()
|
||||||
|
{
|
||||||
|
return unlocalizedName + ".tip";
|
||||||
|
}
|
||||||
|
}
|
46
src/api/java/appeng/api/config/Settings.java
Normal file
46
src/api/java/appeng/api/config/Settings.java
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
public enum Settings
|
||||||
|
{
|
||||||
|
LEVEL_EMITTER_MODE(EnumSet.allOf( LevelEmitterMode.class )),
|
||||||
|
|
||||||
|
REDSTONE_EMITTER(EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL )), REDSTONE_CONTROLLED(EnumSet.allOf( RedstoneMode.class )),
|
||||||
|
|
||||||
|
CONDENSER_OUTPUT(EnumSet.allOf( CondenserOutput.class )),
|
||||||
|
|
||||||
|
POWER_UNITS(EnumSet.allOf( PowerUnits.class )), ACCESS(EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE )),
|
||||||
|
|
||||||
|
SORT_DIRECTION(EnumSet.allOf( SortDir.class )), SORT_BY(EnumSet.allOf( SortOrder.class )),
|
||||||
|
|
||||||
|
SEARCH_TOOLTIPS(EnumSet.of( YesNo.YES, YesNo.NO )), VIEW_MODE(EnumSet.allOf( ViewItems.class )), SEARCH_MODE(EnumSet.allOf( SearchBoxMode.class )),
|
||||||
|
|
||||||
|
ACTIONS(EnumSet.allOf( ActionItems.class )), IO_DIRECTION(EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT )),
|
||||||
|
|
||||||
|
BLOCK(EnumSet.of( YesNo.YES, YesNo.NO )), OPERATION_MODE(EnumSet.allOf( OperationMode.class )),
|
||||||
|
|
||||||
|
FULLNESS_MODE(EnumSet.allOf( FullnessMode.class )), CRAFT_ONLY(EnumSet.of( YesNo.YES, YesNo.NO )),
|
||||||
|
|
||||||
|
FUZZY_MODE(EnumSet.allOf( FuzzyMode.class )), LEVEL_TYPE(EnumSet.allOf( LevelType.class )),
|
||||||
|
|
||||||
|
TERMINAL_STYLE(EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL )), COPY_MODE(EnumSet.allOf( CopyMode.class )),
|
||||||
|
|
||||||
|
INTERFACE_TERMINAL(EnumSet.of( YesNo.YES, YesNo.NO )), CRAFT_VIA_REDSTONE(EnumSet.of( YesNo.YES, YesNo.NO )),
|
||||||
|
|
||||||
|
STORAGE_FILTER(EnumSet.allOf( StorageFilter.class ));
|
||||||
|
|
||||||
|
private EnumSet values;
|
||||||
|
|
||||||
|
public EnumSet getPossibleValues()
|
||||||
|
{
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Settings(EnumSet set) {
|
||||||
|
if ( set == null || set.isEmpty() )
|
||||||
|
throw new RuntimeException( "Invalid configuration." );
|
||||||
|
values = set;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
6
src/api/java/appeng/api/config/SortDir.java
Normal file
6
src/api/java/appeng/api/config/SortDir.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum SortDir
|
||||||
|
{
|
||||||
|
ASCENDING, DESCENDING
|
||||||
|
}
|
6
src/api/java/appeng/api/config/SortOrder.java
Normal file
6
src/api/java/appeng/api/config/SortOrder.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum SortOrder
|
||||||
|
{
|
||||||
|
NAME, AMOUNT, MOD, INVTWEAKS
|
||||||
|
}
|
10
src/api/java/appeng/api/config/StorageFilter.java
Normal file
10
src/api/java/appeng/api/config/StorageFilter.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum StorageFilter
|
||||||
|
{
|
||||||
|
|
||||||
|
NONE,
|
||||||
|
|
||||||
|
EXTRACTABLE_ONLY
|
||||||
|
|
||||||
|
}
|
12
src/api/java/appeng/api/config/TerminalStyle.java
Normal file
12
src/api/java/appeng/api/config/TerminalStyle.java
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum TerminalStyle
|
||||||
|
{
|
||||||
|
|
||||||
|
TALL,
|
||||||
|
|
||||||
|
FULL,
|
||||||
|
|
||||||
|
SMALL
|
||||||
|
|
||||||
|
}
|
15
src/api/java/appeng/api/config/TunnelType.java
Normal file
15
src/api/java/appeng/api/config/TunnelType.java
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum TunnelType
|
||||||
|
{
|
||||||
|
ME, // Network Tunnel
|
||||||
|
BC_POWER, // MJ Tunnel
|
||||||
|
IC2_POWER, // EU Tunnel
|
||||||
|
RF_POWER, // RF Tunnel
|
||||||
|
REDSTONE, // Redstone Tunnel
|
||||||
|
FLUID, // Fluid Tunnel
|
||||||
|
ITEM, // Item Tunnel
|
||||||
|
LIGHT, // Light Tunnel
|
||||||
|
BUNDLED_REDSTONE, // Bundled Redstone Tunnel
|
||||||
|
COMPUTER_MESSAGE // Computer Message Tunnel
|
||||||
|
}
|
39
src/api/java/appeng/api/config/Upgrades.java
Normal file
39
src/api/java/appeng/api/config/Upgrades.java
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public enum Upgrades
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Gold Tier Upgrades.
|
||||||
|
*/
|
||||||
|
CAPACITY(0), REDSTONE(0), CRAFTING(0),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Diamond Tier Upgrades.
|
||||||
|
*/
|
||||||
|
FUZZY(1), SPEED(1), INVERTER(1);
|
||||||
|
|
||||||
|
public final int myTier;
|
||||||
|
public final HashMap<ItemStack, Integer> supportedMax = new HashMap<ItemStack, Integer>();
|
||||||
|
|
||||||
|
private Upgrades(int tier) {
|
||||||
|
myTier = tier;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return list of Items/Blocks that support this upgrade, and how many it supports.
|
||||||
|
*/
|
||||||
|
public HashMap<ItemStack, Integer> getSupported()
|
||||||
|
{
|
||||||
|
return supportedMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerItem(ItemStack myItem, int maxSupported)
|
||||||
|
{
|
||||||
|
if ( myItem != null )
|
||||||
|
supportedMax.put( myItem, maxSupported );
|
||||||
|
}
|
||||||
|
}
|
6
src/api/java/appeng/api/config/ViewItems.java
Normal file
6
src/api/java/appeng/api/config/ViewItems.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum ViewItems
|
||||||
|
{
|
||||||
|
ALL, STORED, CRAFTABLE
|
||||||
|
}
|
6
src/api/java/appeng/api/config/YesNo.java
Normal file
6
src/api/java/appeng/api/config/YesNo.java
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package appeng.api.config;
|
||||||
|
|
||||||
|
public enum YesNo
|
||||||
|
{
|
||||||
|
YES, NO, UNDECIDED
|
||||||
|
}
|
89
src/api/java/appeng/api/definitions/Blocks.java
Normal file
89
src/api/java/appeng/api/definitions/Blocks.java
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
package appeng.api.definitions;
|
||||||
|
|
||||||
|
import appeng.api.util.AEItemDefinition;
|
||||||
|
|
||||||
|
public class Blocks
|
||||||
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
|
* World Gen
|
||||||
|
*/
|
||||||
|
public AEItemDefinition blockQuartzOre;
|
||||||
|
public AEItemDefinition blockQuartzOreCharged;
|
||||||
|
public AEItemDefinition blockMatrixFrame;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Decorative
|
||||||
|
*/
|
||||||
|
public AEItemDefinition blockQuartz;
|
||||||
|
public AEItemDefinition blockQuartzPillar;
|
||||||
|
public AEItemDefinition blockQuartzChiseled;
|
||||||
|
public AEItemDefinition blockQuartzGlass;
|
||||||
|
public AEItemDefinition blockQuartzVibrantGlass;
|
||||||
|
public AEItemDefinition blockQuartzTorch;
|
||||||
|
public AEItemDefinition blockFluix;
|
||||||
|
public AEItemDefinition blockSkyStone;
|
||||||
|
public AEItemDefinition blockSkyChest;
|
||||||
|
public AEItemDefinition blockSkyCompass;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Misc
|
||||||
|
*/
|
||||||
|
public AEItemDefinition blockGrindStone;
|
||||||
|
public AEItemDefinition blockCrankHandle;
|
||||||
|
public AEItemDefinition blockInscriber;
|
||||||
|
public AEItemDefinition blockWireless;
|
||||||
|
public AEItemDefinition blockCharger;
|
||||||
|
public AEItemDefinition blockTinyTNT;
|
||||||
|
public AEItemDefinition blockSecurity;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Quantum Network Bridge
|
||||||
|
*/
|
||||||
|
public AEItemDefinition blockQuantumRing;
|
||||||
|
public AEItemDefinition blockQuantumLink;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Spatial IO
|
||||||
|
*/
|
||||||
|
public AEItemDefinition blockSpatialPylon;
|
||||||
|
public AEItemDefinition blockSpatialIOPort;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Bus / Cables
|
||||||
|
*/
|
||||||
|
public AEItemDefinition blockMultiPart;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Machines
|
||||||
|
*/
|
||||||
|
public AEItemDefinition blockController;
|
||||||
|
public AEItemDefinition blockDrive;
|
||||||
|
public AEItemDefinition blockChest;
|
||||||
|
public AEItemDefinition blockInterface;
|
||||||
|
public AEItemDefinition blockCellWorkbench;
|
||||||
|
public AEItemDefinition blockIOPort;
|
||||||
|
public AEItemDefinition blockCondenser;
|
||||||
|
public AEItemDefinition blockEnergyAcceptor;
|
||||||
|
public AEItemDefinition blockVibrationChamber;
|
||||||
|
public AEItemDefinition blockQuartzGrowthAccelerator;
|
||||||
|
|
||||||
|
public AEItemDefinition blockEnergyCell;
|
||||||
|
public AEItemDefinition blockEnergyCellDense;
|
||||||
|
public AEItemDefinition blockEnergyCellCreative;
|
||||||
|
|
||||||
|
// rv1
|
||||||
|
public AEItemDefinition blockCraftingUnit;
|
||||||
|
public AEItemDefinition blockCraftingAccelerator;
|
||||||
|
public AEItemDefinition blockCraftingStorage1k;
|
||||||
|
public AEItemDefinition blockCraftingStorage4k;
|
||||||
|
public AEItemDefinition blockCraftingStorage16k;
|
||||||
|
public AEItemDefinition blockCraftingStorage64k;
|
||||||
|
public AEItemDefinition blockCraftingMonitor;
|
||||||
|
|
||||||
|
public AEItemDefinition blockMolecularAssembler;
|
||||||
|
|
||||||
|
public AEItemDefinition blockLightDetector;
|
||||||
|
public AEItemDefinition blockPaint;
|
||||||
|
|
||||||
|
}
|
54
src/api/java/appeng/api/definitions/Items.java
Normal file
54
src/api/java/appeng/api/definitions/Items.java
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
package appeng.api.definitions;
|
||||||
|
|
||||||
|
import appeng.api.util.AEColoredItemDefinition;
|
||||||
|
import appeng.api.util.AEItemDefinition;
|
||||||
|
|
||||||
|
public class Items
|
||||||
|
{
|
||||||
|
|
||||||
|
public AEItemDefinition itemCertusQuartzAxe;
|
||||||
|
public AEItemDefinition itemCertusQuartzHoe;
|
||||||
|
public AEItemDefinition itemCertusQuartzShovel;
|
||||||
|
public AEItemDefinition itemCertusQuartzPick;
|
||||||
|
public AEItemDefinition itemCertusQuartzSword;
|
||||||
|
public AEItemDefinition itemCertusQuartzWrench;
|
||||||
|
public AEItemDefinition itemCertusQuartzKnife;
|
||||||
|
|
||||||
|
public AEItemDefinition itemNetherQuartzAxe;
|
||||||
|
public AEItemDefinition itemNetherQuartzHoe;
|
||||||
|
public AEItemDefinition itemNetherQuartzShovel;
|
||||||
|
public AEItemDefinition itemNetherQuartzPick;
|
||||||
|
public AEItemDefinition itemNetherQuartzSword;
|
||||||
|
public AEItemDefinition itemNetherQuartzWrench;
|
||||||
|
public AEItemDefinition itemNetherQuartzKnife;
|
||||||
|
|
||||||
|
public AEItemDefinition itemEntropyManipulator;
|
||||||
|
public AEItemDefinition itemWirelessTerminal;
|
||||||
|
public AEItemDefinition itemBiometricCard;
|
||||||
|
public AEItemDefinition itemChargedStaff;
|
||||||
|
public AEItemDefinition itemMassCannon;
|
||||||
|
public AEItemDefinition itemMemoryCard;
|
||||||
|
public AEItemDefinition itemNetworkTool;
|
||||||
|
public AEItemDefinition itemPortableCell;
|
||||||
|
|
||||||
|
public AEItemDefinition itemCellCreative;
|
||||||
|
public AEItemDefinition itemViewCell;
|
||||||
|
|
||||||
|
public AEItemDefinition itemCell1k;
|
||||||
|
public AEItemDefinition itemCell4k;
|
||||||
|
public AEItemDefinition itemCell16k;
|
||||||
|
public AEItemDefinition itemCell64k;
|
||||||
|
|
||||||
|
public AEItemDefinition itemSpatialCell2;
|
||||||
|
public AEItemDefinition itemSpatialCell16;
|
||||||
|
public AEItemDefinition itemSpatialCell128;
|
||||||
|
|
||||||
|
public AEItemDefinition itemFacade;
|
||||||
|
public AEItemDefinition itemCrystalSeed;
|
||||||
|
|
||||||
|
// rv1
|
||||||
|
public AEItemDefinition itemEncodedPattern;
|
||||||
|
public AEItemDefinition itemColorApplicator;
|
||||||
|
public AEColoredItemDefinition itemPaintBall;
|
||||||
|
public AEColoredItemDefinition itemLumenPaintBall;
|
||||||
|
}
|
80
src/api/java/appeng/api/definitions/Materials.java
Normal file
80
src/api/java/appeng/api/definitions/Materials.java
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
package appeng.api.definitions;
|
||||||
|
|
||||||
|
import appeng.api.util.AEItemDefinition;
|
||||||
|
|
||||||
|
public class Materials
|
||||||
|
{
|
||||||
|
|
||||||
|
public AEItemDefinition materialCell2SpatialPart;
|
||||||
|
public AEItemDefinition materialCell16SpatialPart;
|
||||||
|
public AEItemDefinition materialCell128SpatialPart;
|
||||||
|
|
||||||
|
public AEItemDefinition materialSilicon;
|
||||||
|
public AEItemDefinition materialSkyDust;
|
||||||
|
|
||||||
|
public AEItemDefinition materialCalcProcessorPress;
|
||||||
|
public AEItemDefinition materialEngProcessorPress;
|
||||||
|
public AEItemDefinition materialLogicProcessorPress;
|
||||||
|
|
||||||
|
public AEItemDefinition materialCalcProcessorPrint;
|
||||||
|
public AEItemDefinition materialEngProcessorPrint;
|
||||||
|
public AEItemDefinition materialLogicProcessorPrint;
|
||||||
|
|
||||||
|
public AEItemDefinition materialSiliconPress;
|
||||||
|
public AEItemDefinition materialSiliconPrint;
|
||||||
|
|
||||||
|
public AEItemDefinition materialNamePress;
|
||||||
|
|
||||||
|
public AEItemDefinition materialLogicProcessor;
|
||||||
|
public AEItemDefinition materialCalcProcessor;
|
||||||
|
public AEItemDefinition materialEngProcessor;
|
||||||
|
|
||||||
|
public AEItemDefinition materialBasicCard;
|
||||||
|
public AEItemDefinition materialAdvCard;
|
||||||
|
|
||||||
|
public AEItemDefinition materialPurifiedCertusQuartzCrystal;
|
||||||
|
public AEItemDefinition materialPurifiedNetherQuartzCrystal;
|
||||||
|
public AEItemDefinition materialPurifiedFluixCrystal;
|
||||||
|
|
||||||
|
public AEItemDefinition materialCell1kPart;
|
||||||
|
public AEItemDefinition materialCell4kPart;
|
||||||
|
public AEItemDefinition materialCell16kPart;
|
||||||
|
public AEItemDefinition materialCell64kPart;
|
||||||
|
public AEItemDefinition materialEmptyStorageCell;
|
||||||
|
|
||||||
|
public AEItemDefinition materialCardRedstone;
|
||||||
|
public AEItemDefinition materialCardSpeed;
|
||||||
|
public AEItemDefinition materialCardCapacity;
|
||||||
|
public AEItemDefinition materialCardFuzzy;
|
||||||
|
public AEItemDefinition materialCardInverter;
|
||||||
|
public AEItemDefinition materialCardCrafting;
|
||||||
|
|
||||||
|
public AEItemDefinition materialEnderDust;
|
||||||
|
public AEItemDefinition materialFlour;
|
||||||
|
public AEItemDefinition materialGoldDust;
|
||||||
|
public AEItemDefinition materialIronDust;
|
||||||
|
public AEItemDefinition materialFluixDust;
|
||||||
|
public AEItemDefinition materialCertusQuartzDust;
|
||||||
|
public AEItemDefinition materialNetherQuartzDust;
|
||||||
|
|
||||||
|
public AEItemDefinition materialMatterBall;
|
||||||
|
public AEItemDefinition materialIronNugget;
|
||||||
|
|
||||||
|
public AEItemDefinition materialCertusQuartzCrystal;
|
||||||
|
public AEItemDefinition materialCertusQuartzCrystalCharged;
|
||||||
|
public AEItemDefinition materialFluixCrystal;
|
||||||
|
public AEItemDefinition materialFluixPearl;
|
||||||
|
|
||||||
|
public AEItemDefinition materialWoodenGear;
|
||||||
|
|
||||||
|
public AEItemDefinition materialWireless;
|
||||||
|
public AEItemDefinition materialWirelessBooster;
|
||||||
|
|
||||||
|
public AEItemDefinition materialAnnihilationCore;
|
||||||
|
public AEItemDefinition materialFormationCore;
|
||||||
|
|
||||||
|
public AEItemDefinition materialSingularity;
|
||||||
|
public AEItemDefinition materialQESingularity;
|
||||||
|
public AEItemDefinition materialBlankPattern;
|
||||||
|
|
||||||
|
}
|
54
src/api/java/appeng/api/definitions/Parts.java
Normal file
54
src/api/java/appeng/api/definitions/Parts.java
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
package appeng.api.definitions;
|
||||||
|
|
||||||
|
import appeng.api.util.AEColoredItemDefinition;
|
||||||
|
import appeng.api.util.AEItemDefinition;
|
||||||
|
|
||||||
|
public class Parts
|
||||||
|
{
|
||||||
|
|
||||||
|
public AEColoredItemDefinition partCableSmart;
|
||||||
|
public AEColoredItemDefinition partCableCovered;
|
||||||
|
public AEColoredItemDefinition partCableGlass;
|
||||||
|
public AEColoredItemDefinition partCableDense;
|
||||||
|
|
||||||
|
public AEColoredItemDefinition partLumenCableSmart;
|
||||||
|
public AEColoredItemDefinition partLumenCableCovered;
|
||||||
|
public AEColoredItemDefinition partLumenCableGlass;
|
||||||
|
public AEColoredItemDefinition partLumenCableDense;
|
||||||
|
|
||||||
|
public AEItemDefinition partQuartzFiber;
|
||||||
|
public AEItemDefinition partToggleBus;
|
||||||
|
public AEItemDefinition partInvertedToggleBus;
|
||||||
|
|
||||||
|
public AEItemDefinition partStorageBus;
|
||||||
|
public AEItemDefinition partImportBus;
|
||||||
|
public AEItemDefinition partExportBus;
|
||||||
|
public AEItemDefinition partInterface;
|
||||||
|
|
||||||
|
public AEItemDefinition partLevelEmitter;
|
||||||
|
|
||||||
|
public AEItemDefinition partAnnihilationPlane;
|
||||||
|
public AEItemDefinition partFormationPlane;
|
||||||
|
|
||||||
|
public AEItemDefinition partP2PTunnelME;
|
||||||
|
public AEItemDefinition partP2PTunnelRedstone;
|
||||||
|
public AEItemDefinition partP2PTunnelItems;
|
||||||
|
public AEItemDefinition partP2PTunnelLiquids;
|
||||||
|
public AEItemDefinition partP2PTunnelMJ;
|
||||||
|
public AEItemDefinition partP2PTunnelEU;
|
||||||
|
public AEItemDefinition partP2PTunnelRF;
|
||||||
|
public AEItemDefinition partP2PTunnelLight;
|
||||||
|
|
||||||
|
public AEItemDefinition partCableAnchor;
|
||||||
|
public AEItemDefinition partMonitor;
|
||||||
|
public AEItemDefinition partSemiDarkMonitor;
|
||||||
|
public AEItemDefinition partDarkMonitor;
|
||||||
|
|
||||||
|
public AEItemDefinition partInterfaceTerminal;
|
||||||
|
public AEItemDefinition partPatternTerminal;
|
||||||
|
public AEItemDefinition partCraftingTerminal;
|
||||||
|
public AEItemDefinition partTerminal;
|
||||||
|
public AEItemDefinition partStorageMonitor;
|
||||||
|
public AEItemDefinition partConversionMonitor;
|
||||||
|
|
||||||
|
}
|
28
src/api/java/appeng/api/events/LocatableEventAnnounce.java
Normal file
28
src/api/java/appeng/api/events/LocatableEventAnnounce.java
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
package appeng.api.events;
|
||||||
|
|
||||||
|
import appeng.api.features.ILocatable;
|
||||||
|
import cpw.mods.fml.common.eventhandler.Event;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Input Event:
|
||||||
|
*
|
||||||
|
* Used to Notify the Location Registry of objects, and their availability.
|
||||||
|
*/
|
||||||
|
public class LocatableEventAnnounce extends Event
|
||||||
|
{
|
||||||
|
|
||||||
|
public enum LocatableEvent
|
||||||
|
{
|
||||||
|
Register, // Adds the locatable to the registry
|
||||||
|
Unregister // Removes the locatable from the registry
|
||||||
|
}
|
||||||
|
|
||||||
|
final public ILocatable target;
|
||||||
|
final public LocatableEvent change;
|
||||||
|
|
||||||
|
public LocatableEventAnnounce(ILocatable o, LocatableEvent ev) {
|
||||||
|
target = o;
|
||||||
|
change = ev;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
11
src/api/java/appeng/api/exceptions/AppEngException.java
Normal file
11
src/api/java/appeng/api/exceptions/AppEngException.java
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
public class AppEngException extends Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -9051434206368465494L;
|
||||||
|
|
||||||
|
public AppEngException(String t) {
|
||||||
|
super( t );
|
||||||
|
}
|
||||||
|
}
|
10
src/api/java/appeng/api/exceptions/FailedConnection.java
Normal file
10
src/api/java/appeng/api/exceptions/FailedConnection.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
public class FailedConnection extends Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -2544208090248293753L;
|
||||||
|
|
||||||
|
public FailedConnection() {
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
public class MissingIngredientError extends Exception {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -998858343831371697L;
|
||||||
|
|
||||||
|
public MissingIngredientError(String n) {
|
||||||
|
super( n );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
12
src/api/java/appeng/api/exceptions/ModNotInstalled.java
Normal file
12
src/api/java/appeng/api/exceptions/ModNotInstalled.java
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
public class ModNotInstalled extends Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -9052435206368425494L;
|
||||||
|
|
||||||
|
public ModNotInstalled(String t) {
|
||||||
|
super( t );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
12
src/api/java/appeng/api/exceptions/RecipeError.java
Normal file
12
src/api/java/appeng/api/exceptions/RecipeError.java
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
public class RecipeError extends Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -6602870588617670262L;
|
||||||
|
|
||||||
|
public RecipeError(String n) {
|
||||||
|
super( n );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
12
src/api/java/appeng/api/exceptions/RegistrationError.java
Normal file
12
src/api/java/appeng/api/exceptions/RegistrationError.java
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
public class RegistrationError extends Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -6602870588617670263L;
|
||||||
|
|
||||||
|
public RegistrationError(String n) {
|
||||||
|
super( n );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
96
src/api/java/appeng/api/features/IGrinderEntry.java
Normal file
96
src/api/java/appeng/api/features/IGrinderEntry.java
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registration Records for {@link IGrinderRegistry}
|
||||||
|
*/
|
||||||
|
public interface IGrinderEntry
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the current input
|
||||||
|
*
|
||||||
|
* @return input that the grinder will accept.
|
||||||
|
*/
|
||||||
|
public ItemStack getInput();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* lets you change the grinder recipe by changing its input.
|
||||||
|
*
|
||||||
|
* @param input input item
|
||||||
|
*/
|
||||||
|
public void setInput(ItemStack input);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets the current output
|
||||||
|
*
|
||||||
|
* @return output that the grinder will produce
|
||||||
|
*/
|
||||||
|
public ItemStack getOutput();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets the current output
|
||||||
|
*
|
||||||
|
* @return output that the grinder will produce
|
||||||
|
*/
|
||||||
|
public ItemStack getOptionalOutput();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets the current output
|
||||||
|
*
|
||||||
|
* @return output that the grinder will produce
|
||||||
|
*/
|
||||||
|
public ItemStack getSecondOptionalOutput();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* allows you to change the output.
|
||||||
|
*
|
||||||
|
* @param output output item
|
||||||
|
*/
|
||||||
|
public void setOutput(ItemStack output);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stack, and 0.0-1.0 chance that it will be generated.
|
||||||
|
*
|
||||||
|
* @param output output item
|
||||||
|
* @param chance generation chance
|
||||||
|
*/
|
||||||
|
public void setOptionalOutput(ItemStack output, float chance);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.0 - 1.0 the chance that the optional output will be generated.
|
||||||
|
*
|
||||||
|
* @return chance of optional output
|
||||||
|
*/
|
||||||
|
public float getOptionalChance();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stack, and 0.0-1.0 chance that it will be generated.
|
||||||
|
*
|
||||||
|
* @param output second optional output item
|
||||||
|
* @param chance second optional output chance
|
||||||
|
*/
|
||||||
|
public void setSecondOptionalOutput(ItemStack output, float chance);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.0 - 1.0 the chance that the optional output will be generated.
|
||||||
|
*
|
||||||
|
* @return second optional output chance
|
||||||
|
*/
|
||||||
|
public float getSecondOptionalChance();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Energy cost, in turns.
|
||||||
|
*
|
||||||
|
* @return number of turns it takes to produce the output from the input.
|
||||||
|
*/
|
||||||
|
public int getEnergyCost();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows you to adjust the number of turns
|
||||||
|
*
|
||||||
|
* @param c number of turns to produce output.
|
||||||
|
*/
|
||||||
|
public void setEnergyCost(int c);
|
||||||
|
}
|
61
src/api/java/appeng/api/features/IGrinderRegistry.java
Normal file
61
src/api/java/appeng/api/features/IGrinderRegistry.java
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lets you manipulate Grinder Recipes, by adding or editing existing ones.
|
||||||
|
*/
|
||||||
|
public interface IGrinderRegistry
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Current list of registered recipes, you can modify this if you want too.
|
||||||
|
*
|
||||||
|
* @return currentlyRegisteredRecipes
|
||||||
|
*/
|
||||||
|
public List<IGrinderEntry> getRecipes();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add a new recipe the easy way, in → out, how many turns., duplicates will not be added.
|
||||||
|
*
|
||||||
|
* @param in input
|
||||||
|
* @param out output
|
||||||
|
* @param turns amount of turns to turn the input into the output
|
||||||
|
*/
|
||||||
|
public void addRecipe(ItemStack in, ItemStack out, int turns);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add a new recipe with optional outputs, duplicates will not be added.
|
||||||
|
*
|
||||||
|
* @param in input
|
||||||
|
* @param out output
|
||||||
|
* @param optional optional output
|
||||||
|
* @param chance chance to get the optional output within 0.0 - 1.0
|
||||||
|
* @param turns amount of turns to turn the input into the outputs
|
||||||
|
*/
|
||||||
|
void addRecipe(ItemStack in, ItemStack out, ItemStack optional, float chance, int turns);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add a new recipe with optional outputs, duplicates will not be added.
|
||||||
|
*
|
||||||
|
* @param in input
|
||||||
|
* @param out output
|
||||||
|
* @param optional optional output
|
||||||
|
* @param chance chance to get the optional output within 0.0 - 1.0
|
||||||
|
* @param optional2 second optional output
|
||||||
|
* @param chance2 chance to get the second optional output within 0.0 - 1.0
|
||||||
|
* @param turns amount of turns to turn the input into the outputs
|
||||||
|
*/
|
||||||
|
void addRecipe(ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int turns);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Searches for a recipe for a given input, and returns it.
|
||||||
|
*
|
||||||
|
* @param input input
|
||||||
|
* @return identified recipe or null
|
||||||
|
*/
|
||||||
|
public IGrinderEntry getRecipeForInput(ItemStack input);
|
||||||
|
|
||||||
|
}
|
10
src/api/java/appeng/api/features/IItemComparison.java
Normal file
10
src/api/java/appeng/api/features/IItemComparison.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
public interface IItemComparison
|
||||||
|
{
|
||||||
|
|
||||||
|
public boolean sameAsPrecise(IItemComparison comp);
|
||||||
|
|
||||||
|
public boolean sameAsFuzzy(IItemComparison comp);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provider for special comparisons. when an item is encountered AE Will request
|
||||||
|
* if the comparison function handles the item, by trying to request a
|
||||||
|
* IItemComparison class.
|
||||||
|
*/
|
||||||
|
public interface IItemComparisonProvider
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* should return a new IItemComparison, or return null if it doesn't handle
|
||||||
|
* the supplied item.
|
||||||
|
*
|
||||||
|
* @param is item
|
||||||
|
* @return IItemComparison, or null
|
||||||
|
*/
|
||||||
|
IItemComparison getComparison(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple test for support ( AE generally skips this and calls the above function. )
|
||||||
|
*
|
||||||
|
* @param stack item
|
||||||
|
* @return true, if getComparison will return a valid IItemComparison Object
|
||||||
|
*/
|
||||||
|
public boolean canHandle(ItemStack stack);
|
||||||
|
|
||||||
|
}
|
17
src/api/java/appeng/api/features/ILocatable.java
Normal file
17
src/api/java/appeng/api/features/ILocatable.java
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import appeng.api.events.LocatableEventAnnounce;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A registration record for the {@link ILocatableRegistry} use the {@link LocatableEventAnnounce} event on the Forge
|
||||||
|
* Event bus to update the registry.
|
||||||
|
*/
|
||||||
|
public interface ILocatable
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the serial for a locatable object
|
||||||
|
*/
|
||||||
|
long getLocatableSerial();
|
||||||
|
|
||||||
|
}
|
18
src/api/java/appeng/api/features/ILocatableRegistry.java
Normal file
18
src/api/java/appeng/api/features/ILocatableRegistry.java
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Registry for locatable items, works based on serial numbers.
|
||||||
|
*/
|
||||||
|
public interface ILocatableRegistry
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempts to find the object with the serial specified, if it can it
|
||||||
|
* returns the object.
|
||||||
|
*
|
||||||
|
* @param serial serial
|
||||||
|
* @return requestedObject, or null
|
||||||
|
*/
|
||||||
|
public abstract Object findLocatableBySerial(long serial);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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);
|
||||||
|
|
||||||
|
}
|
27
src/api/java/appeng/api/features/INetworkEncodable.java
Normal file
27
src/api/java/appeng/api/features/INetworkEncodable.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public interface INetworkEncodable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to get the current key from the item.
|
||||||
|
*
|
||||||
|
* @param item item
|
||||||
|
* @return string key of item
|
||||||
|
*/
|
||||||
|
String getEncryptionKey(ItemStack item);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encode the wireless frequency via the Controller.
|
||||||
|
*
|
||||||
|
* @param item
|
||||||
|
* the wireless terminal.
|
||||||
|
* @param encKey
|
||||||
|
* the wireless encryption key.
|
||||||
|
* @param name
|
||||||
|
* null for now.
|
||||||
|
*/
|
||||||
|
void setEncryptionKey(ItemStack item, String encKey, String name);
|
||||||
|
|
||||||
|
}
|
31
src/api/java/appeng/api/features/IP2PTunnelRegistry.java
Normal file
31
src/api/java/appeng/api/features/IP2PTunnelRegistry.java
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import appeng.api.config.TunnelType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Registry for how p2p Tunnels are attuned
|
||||||
|
*/
|
||||||
|
public interface IP2PTunnelRegistry
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows third parties to register items from their mod as potential
|
||||||
|
* attunements for AE's P2P Tunnels
|
||||||
|
*
|
||||||
|
* @param trigger
|
||||||
|
* - the item which triggers attunement
|
||||||
|
* @param type
|
||||||
|
* - the type of tunnel
|
||||||
|
*/
|
||||||
|
public abstract void addNewAttunement(ItemStack trigger, TunnelType type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns null if no attunement can be found.
|
||||||
|
*
|
||||||
|
* @param trigger attunement trigger
|
||||||
|
* @return null if no attunement can be found or attunement
|
||||||
|
*/
|
||||||
|
TunnelType getTunnelTypeByItem(ItemStack trigger);
|
||||||
|
|
||||||
|
}
|
32
src/api/java/appeng/api/features/IPlayerRegistry.java
Normal file
32
src/api/java/appeng/api/features/IPlayerRegistry.java
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maintains a save specific list of userids and username combinations this greatly simplifies storage internally and
|
||||||
|
* gives a common place to look up and get IDs for the security framework.
|
||||||
|
*/
|
||||||
|
public interface IPlayerRegistry
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param gameProfile user game profile
|
||||||
|
* @return user id of a username.
|
||||||
|
*/
|
||||||
|
int getID(GameProfile gameProfile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param player player
|
||||||
|
* @return user id of a player entity.
|
||||||
|
*/
|
||||||
|
int getID(EntityPlayer player);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param playerID to be found player id
|
||||||
|
* @return PlayerEntity, or null if the player could not be found.
|
||||||
|
*/
|
||||||
|
EntityPlayer findPlayer(int playerID);
|
||||||
|
|
||||||
|
}
|
49
src/api/java/appeng/api/features/IRecipeHandlerRegistry.java
Normal file
49
src/api/java/appeng/api/features/IRecipeHandlerRegistry.java
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import appeng.api.recipes.ICraftHandler;
|
||||||
|
import appeng.api.recipes.IRecipeHandler;
|
||||||
|
import appeng.api.recipes.ISubItemResolver;
|
||||||
|
|
||||||
|
public interface IRecipeHandlerRegistry
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new Recipe Handler to the parser.
|
||||||
|
*
|
||||||
|
* MUST BE CALLED IN PRE-INIT
|
||||||
|
*
|
||||||
|
* @param name name of crafthandler
|
||||||
|
* @param handler class of crafthandler
|
||||||
|
*/
|
||||||
|
void addNewCraftHandler(String name, Class<? extends ICraftHandler> handler);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new resolver to the parser.
|
||||||
|
*
|
||||||
|
* MUST BE CALLED IN PRE-INIT
|
||||||
|
*
|
||||||
|
* @param sir sub item resolver
|
||||||
|
*/
|
||||||
|
void addNewSubItemResolver(ISubItemResolver sir);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param name name of crafting handler
|
||||||
|
* @return A recipe handler by name, returns null on failure.
|
||||||
|
*/
|
||||||
|
ICraftHandler getCraftHandlerFor(String name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a new recipe handler, which can be used to parse, and read recipe files.
|
||||||
|
*/
|
||||||
|
public IRecipeHandler createNewRecipehandler();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* resolve sub items by name.
|
||||||
|
*
|
||||||
|
* @param nameSpace namespace of item
|
||||||
|
* @param itemName full name of item
|
||||||
|
* @return ResolverResult or ResolverResultSet
|
||||||
|
*/
|
||||||
|
Object resolveItem(String nameSpace, String itemName);
|
||||||
|
|
||||||
|
}
|
76
src/api/java/appeng/api/features/IRegistryContainer.java
Normal file
76
src/api/java/appeng/api/features/IRegistryContainer.java
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import appeng.api.movable.IMovableRegistry;
|
||||||
|
import appeng.api.networking.IGridCacheRegistry;
|
||||||
|
import appeng.api.storage.ICellRegistry;
|
||||||
|
import appeng.api.storage.IExternalStorageRegistry;
|
||||||
|
|
||||||
|
public interface IRegistryContainer
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use the movable registry to white list your tiles.
|
||||||
|
*/
|
||||||
|
IMovableRegistry movable();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add new Grid Caches for use during run time, only use during loading phase.
|
||||||
|
*/
|
||||||
|
IGridCacheRegistry gridCache();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add additional storage bus handlers to improve interplay with mod blocks that contains special inventories that
|
||||||
|
* function unlike vanilla chests. AE uses this internally for barrels, DSU's, quantum chests, AE Networks and more.
|
||||||
|
*/
|
||||||
|
IExternalStorageRegistry externalStorage();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add additional special comparison functionality, AE Uses this internally for Bees.
|
||||||
|
*/
|
||||||
|
ISpecialComparisonRegistry specialComparison();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lets you register your items as wireless terminals
|
||||||
|
*/
|
||||||
|
IWirelessTermRegistry wireless();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows you to register new cell types, these will function in drives
|
||||||
|
*/
|
||||||
|
ICellRegistry cell();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manage grinder recipes via API
|
||||||
|
*/
|
||||||
|
IGrinderRegistry grinder();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get access to the locatable registry
|
||||||
|
*/
|
||||||
|
ILocatableRegistry locatable();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get access to the p2p tunnel registry.
|
||||||
|
*/
|
||||||
|
IP2PTunnelRegistry p2pTunnel();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get access to the ammo registry.
|
||||||
|
*/
|
||||||
|
IMatterCannonAmmoRegistry matterCannon();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get access to the player registry
|
||||||
|
*/
|
||||||
|
IPlayerRegistry players();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get access to the ae2 recipe api
|
||||||
|
*/
|
||||||
|
IRecipeHandlerRegistry recipes();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get access to the world-gen api.
|
||||||
|
*/
|
||||||
|
IWorldGen worldgen();
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Registry of any special comparison handlers for AE To use.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface ISpecialComparisonRegistry
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return TheHandler or null.
|
||||||
|
*
|
||||||
|
* @param stack item
|
||||||
|
* @return a handler it found for a specific item
|
||||||
|
*/
|
||||||
|
IItemComparison getSpecialComparison(ItemStack stack);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a new special comparison function with AE.
|
||||||
|
*
|
||||||
|
* @param prov comparison provider
|
||||||
|
*/
|
||||||
|
public void addComparisonProvider(IItemComparisonProvider prov);
|
||||||
|
|
||||||
|
}
|
46
src/api/java/appeng/api/features/IWirelessTermHandler.java
Normal file
46
src/api/java/appeng/api/features/IWirelessTermHandler.java
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import appeng.api.util.IConfigManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A handler for a wireless terminal.
|
||||||
|
*/
|
||||||
|
public interface IWirelessTermHandler extends INetworkEncodable
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param is wireless terminal
|
||||||
|
* @return true, if usePower, hasPower, etc... can be called for the provided item
|
||||||
|
*/
|
||||||
|
boolean canHandle(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* use an amount of power, in AE units
|
||||||
|
*
|
||||||
|
* @param amount
|
||||||
|
* is in AE units ( 5 per MJ ), if you return false, the item should be dead and return false for
|
||||||
|
* hasPower
|
||||||
|
* @param is wireless terminal
|
||||||
|
* @return true if wireless terminal uses power
|
||||||
|
*/
|
||||||
|
boolean usePower(EntityPlayer player, double amount, ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets the power status of the item.
|
||||||
|
*
|
||||||
|
* @param is wireless terminal
|
||||||
|
* @return returns true if there is any power left.
|
||||||
|
*/
|
||||||
|
boolean hasPower(EntityPlayer player, double amount, ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the config manager for the wireless terminal.
|
||||||
|
*
|
||||||
|
* @param is wireless terminal
|
||||||
|
* @return config manager of wireless terminal
|
||||||
|
*/
|
||||||
|
IConfigManager getConfigManager(ItemStack is);
|
||||||
|
|
||||||
|
}
|
39
src/api/java/appeng/api/features/IWirelessTermRegistry.java
Normal file
39
src/api/java/appeng/api/features/IWirelessTermRegistry.java
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registration record for a Custom Cell handler.
|
||||||
|
*/
|
||||||
|
public interface IWirelessTermRegistry
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add this handler to the list of other wireless handler.
|
||||||
|
*
|
||||||
|
* @param handler wireless handler
|
||||||
|
*/
|
||||||
|
void registerWirelessHandler(IWirelessTermHandler handler);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param is item which might have a handler
|
||||||
|
* @return true if there is a handler for this item
|
||||||
|
*/
|
||||||
|
boolean isWirelessTerminal(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param is item with handler
|
||||||
|
* @return a register handler for the item in question, or null if there
|
||||||
|
* isn't one
|
||||||
|
*/
|
||||||
|
IWirelessTermHandler getWirelessTerminalHandler(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* opens the wireless terminal gui, the wireless terminal item, must be in
|
||||||
|
* the active slot on the tool bar.
|
||||||
|
*/
|
||||||
|
void openWirelessTerminalGui(ItemStack item, World w, EntityPlayer player);
|
||||||
|
|
||||||
|
}
|
22
src/api/java/appeng/api/features/IWorldGen.java
Normal file
22
src/api/java/appeng/api/features/IWorldGen.java
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
package appeng.api.features;
|
||||||
|
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.WorldProvider;
|
||||||
|
|
||||||
|
public interface IWorldGen
|
||||||
|
{
|
||||||
|
|
||||||
|
public enum WorldGenType
|
||||||
|
{
|
||||||
|
CertusQuartz, ChargedCertusQuartz, Meteorites
|
||||||
|
}
|
||||||
|
|
||||||
|
public void disableWorldGenForProviderID(WorldGenType type, Class<? extends WorldProvider> provider);
|
||||||
|
|
||||||
|
public void enableWorldGenForDimension(WorldGenType type, int dimID);
|
||||||
|
|
||||||
|
public void disableWorldGenForDimension(WorldGenType type, int dimID);
|
||||||
|
|
||||||
|
boolean isWorldGenEnabled(WorldGenType type, World w);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package appeng.api.implementations;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implemented on {@link Item}
|
||||||
|
*/
|
||||||
|
public interface ICraftingPatternItem
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Access Details about a pattern
|
||||||
|
*
|
||||||
|
* @param is pattern
|
||||||
|
* @param w crafting world
|
||||||
|
* @return details of pattern
|
||||||
|
*/
|
||||||
|
ICraftingPatternDetails getPatternForItem(ItemStack is, World w);
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package appeng.api.implementations;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is intended for use on the client side to provide details to WAILA.
|
||||||
|
*/
|
||||||
|
public interface IPowerChannelState
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the part/tile is powered.
|
||||||
|
*/
|
||||||
|
boolean isPowered();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the part/tile isActive
|
||||||
|
*/
|
||||||
|
boolean isActive();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package appeng.api.implementations;
|
||||||
|
|
||||||
|
import appeng.api.util.IConfigurableObject;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import appeng.api.config.Upgrades;
|
||||||
|
import appeng.api.implementations.tiles.ISegmentedInventory;
|
||||||
|
|
||||||
|
public interface IUpgradeableHost extends IConfigurableObject, ISegmentedInventory
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* determine how many of an upgrade are installed.
|
||||||
|
*/
|
||||||
|
int getInstalledUpgrades(Upgrades u);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the tile...
|
||||||
|
*
|
||||||
|
* @return tile entity
|
||||||
|
*/
|
||||||
|
TileEntity getTile();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package appeng.api.implementations;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the result of performing a transition from the world into a storage
|
||||||
|
* cell, if its possible, and what the energy usage is.
|
||||||
|
*/
|
||||||
|
public class TransitionResult
|
||||||
|
{
|
||||||
|
public final boolean success;
|
||||||
|
public final double energyUsage;
|
||||||
|
|
||||||
|
public TransitionResult(boolean _success, double power) {
|
||||||
|
success = _success;
|
||||||
|
energyUsage = power;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package appeng.api.implementations.guiobjects;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implemented on Item objects, to return objects used to manage, and interact
|
||||||
|
* with the contents.
|
||||||
|
*/
|
||||||
|
public interface IGuiItem
|
||||||
|
{
|
||||||
|
|
||||||
|
IGuiItemObject getGuiObject(ItemStack is, World world, int x, int y, int z);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package appeng.api.implementations.guiobjects;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public interface IGuiItemObject
|
||||||
|
{
|
||||||
|
|
||||||
|
public ItemStack getItemStack();
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package appeng.api.implementations.guiobjects;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import appeng.api.networking.IGridHost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtained via {@link IGuiItem} getGuiObject
|
||||||
|
*/
|
||||||
|
public interface INetworkTool extends IInventory, IGuiItemObject
|
||||||
|
{
|
||||||
|
|
||||||
|
IGridHost getGridHost(); // null for most purposes.
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package appeng.api.implementations.guiobjects;
|
||||||
|
|
||||||
|
import appeng.api.networking.energy.IEnergySource;
|
||||||
|
import appeng.api.storage.IMEMonitor;
|
||||||
|
import appeng.api.storage.ITerminalHost;
|
||||||
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtained via {@link IGuiItem} getGuiObject
|
||||||
|
*/
|
||||||
|
public interface IPortableCell extends ITerminalHost, IMEMonitor<IAEItemStack>, IEnergySource, IGuiItemObject
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import appeng.api.config.AccessRestriction;
|
||||||
|
import appeng.api.networking.energy.IAEPowerStorage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basically the same as {@link IAEPowerStorage}, but for items.
|
||||||
|
*/
|
||||||
|
public interface IAEItemPowerStorage
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inject amt, power into the device, it will store what it can, and return
|
||||||
|
* the amount unable to be stored.
|
||||||
|
*
|
||||||
|
* @return amount unable to be stored
|
||||||
|
*/
|
||||||
|
public double injectAEPower(ItemStack is, double amt);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempt to extract power from the device, it will extract what it can and
|
||||||
|
* return it.
|
||||||
|
*
|
||||||
|
* @param amt to be extracted power from device
|
||||||
|
* @return what it could extract
|
||||||
|
*/
|
||||||
|
public double extractAEPower(ItemStack is, double amt);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the current maximum power ( this can change :P )
|
||||||
|
*/
|
||||||
|
public double getAEMaxPower(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the current AE Power Level, this may exceed getMEMaxPower()
|
||||||
|
*/
|
||||||
|
public double getAECurrentPower(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Control the power flow by telling what the network can do, either add? or
|
||||||
|
* subtract? or both!
|
||||||
|
*
|
||||||
|
* @return access restriction of network
|
||||||
|
*/
|
||||||
|
public AccessRestriction getPowerFlow(ItemStack is);
|
||||||
|
|
||||||
|
}
|
25
src/api/java/appeng/api/implementations/items/IAEWrench.java
Normal file
25
src/api/java/appeng/api/implementations/items/IAEWrench.java
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implemented on AE's wrench(s) as a substitute for if BC's API is not
|
||||||
|
* available.
|
||||||
|
*/
|
||||||
|
public interface IAEWrench
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the wrench can be used.
|
||||||
|
*
|
||||||
|
* @param player wrenching player
|
||||||
|
* @param x x pos of wrenched block
|
||||||
|
* @param y y pos of wrenched block
|
||||||
|
* @param z z pos of wrenched block
|
||||||
|
*
|
||||||
|
* @return true if wrench can be used
|
||||||
|
*/
|
||||||
|
boolean canWrench(ItemStack wrench, EntityPlayer player, int x, int y, int z);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
import appeng.api.config.SecurityPermissions;
|
||||||
|
import appeng.api.features.IPlayerRegistry;
|
||||||
|
import appeng.api.networking.security.ISecurityRegistry;
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
public interface IBiometricCard
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the {@link GameProfile} to null, to clear it.
|
||||||
|
*/
|
||||||
|
void setProfile(ItemStack itemStack, GameProfile username);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@link GameProfile} of the player encoded on this card, or a blank string.
|
||||||
|
*/
|
||||||
|
GameProfile getProfile(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param itemStack card
|
||||||
|
* @return the full list of permissions encoded on the card.
|
||||||
|
*/
|
||||||
|
EnumSet<SecurityPermissions> getPermissions(ItemStack itemStack);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a permission is encoded on the card.
|
||||||
|
*
|
||||||
|
* @param permission card
|
||||||
|
* @return true if this permission is set on the card.
|
||||||
|
*/
|
||||||
|
boolean hasPermission(ItemStack is, SecurityPermissions permission);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* remove a permission from the item stack.
|
||||||
|
*
|
||||||
|
* @param itemStack card
|
||||||
|
* @param permission to be removed permission
|
||||||
|
*/
|
||||||
|
void removePermission(ItemStack itemStack, SecurityPermissions permission);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add a permission to the item stack.
|
||||||
|
*
|
||||||
|
* @param itemStack card
|
||||||
|
* @param permission to be added permission
|
||||||
|
*/
|
||||||
|
void addPermission(ItemStack itemStack, SecurityPermissions permission);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public interface IGrowableCrystal
|
||||||
|
{
|
||||||
|
|
||||||
|
ItemStack triggerGrowth(ItemStack is);
|
||||||
|
|
||||||
|
float getMultiplier(Block blk, Material mat);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lets you specify the name of the group of items this falls under.
|
||||||
|
*/
|
||||||
|
public interface IItemGroup
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returning null, is the same as not implementing the interface at all.
|
||||||
|
*
|
||||||
|
* @param is item
|
||||||
|
* @return an unlocalized string to use for the items group name.
|
||||||
|
*/
|
||||||
|
String getUnlocalizedGroupName(Set<ItemStack> otherItems, ItemStack is);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Memory Card API
|
||||||
|
*
|
||||||
|
* AE's Memory Card Item Class implements this interface.
|
||||||
|
*/
|
||||||
|
public interface IMemoryCard
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures the data stored on the memory card, the SettingsName, will be
|
||||||
|
* localized when displayed.
|
||||||
|
*
|
||||||
|
* @param is item
|
||||||
|
* @param SettingsName
|
||||||
|
* unlocalized string that represents the tile entity.
|
||||||
|
* @param data
|
||||||
|
* may contain a String called "tooltip" which is is a
|
||||||
|
* unlocalized string displayed after the settings name, optional
|
||||||
|
* but can be used to add details to the card for later.
|
||||||
|
*/
|
||||||
|
void setMemoryCardContents(ItemStack is, String SettingsName, NBTTagCompound data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns the settings name provided by a previous call to
|
||||||
|
* setMemoryCardContents, or "AppEng.GuiITooltip.Blank" if there was no
|
||||||
|
* previous call to setMemoryCardContents.
|
||||||
|
*
|
||||||
|
* @param is item
|
||||||
|
* @return setting name
|
||||||
|
*/
|
||||||
|
String getSettingsName(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param is item
|
||||||
|
* @return the NBT Data previously saved by setMemoryCardContents, or an
|
||||||
|
* empty NBTCompound
|
||||||
|
*/
|
||||||
|
NBTTagCompound getData(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* notify the user of a outcome related to the memory card.
|
||||||
|
*
|
||||||
|
* @param player
|
||||||
|
* that used the card.
|
||||||
|
* @param msg
|
||||||
|
* which message to send.
|
||||||
|
*/
|
||||||
|
void notifyUser(EntityPlayer player, MemoryCardMessages msg);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import appeng.api.implementations.TransitionResult;
|
||||||
|
import appeng.api.util.WorldCoord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implemented on a {@link Item}
|
||||||
|
*/
|
||||||
|
public interface ISpatialStorageCell
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param is spatial storage cell
|
||||||
|
* @return true if this item is a spatial storage cell
|
||||||
|
*/
|
||||||
|
boolean isSpatialStorage(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param is spatial storage cell
|
||||||
|
* @return the maximum size of the spatial storage cell along any given axis
|
||||||
|
*/
|
||||||
|
int getMaxStoredDim(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param is spatial storage cell
|
||||||
|
* @return the world for this cell
|
||||||
|
*/
|
||||||
|
World getWorld(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the currently stored size.
|
||||||
|
*
|
||||||
|
* @param is spatial storage cell
|
||||||
|
* @return size of spatial
|
||||||
|
*/
|
||||||
|
WorldCoord getStoredSize(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minimum coordinates in its world for the storage cell.
|
||||||
|
*
|
||||||
|
* @param is spatial storage cell
|
||||||
|
* @return minimum coordinate of dimension
|
||||||
|
*/
|
||||||
|
WorldCoord getMin(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maximum coordinates in its world for the storage cell.
|
||||||
|
*
|
||||||
|
* @param is spatial storage cell
|
||||||
|
* @return maximum coordinate of dimension
|
||||||
|
*/
|
||||||
|
WorldCoord getMax(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform a spatial swap with the contents of the cell, and the world.
|
||||||
|
*
|
||||||
|
* @param is spatial storage cell
|
||||||
|
* @param w world of spatial
|
||||||
|
* @param min min coord
|
||||||
|
* @param max max coord
|
||||||
|
* @param doTransition transition
|
||||||
|
* @return result of transition
|
||||||
|
*/
|
||||||
|
TransitionResult doSpatialTransition(ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import appeng.api.storage.ICellWorkbenchItem;
|
||||||
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Any item which implements this can be treated as an IMEInventory via
|
||||||
|
* Util.getCell / Util.isCell It automatically handles the internals and NBT
|
||||||
|
* data, which is both nice, and bad for you!
|
||||||
|
*
|
||||||
|
* Good cause it means you don't have to do anything, bad because you have
|
||||||
|
* little to no control over it.
|
||||||
|
*
|
||||||
|
* The standard AE implementation only provides 1-63 Types
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface IStorageCell extends ICellWorkbenchItem
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If this returns something where N % 8 != 0 Then you will be shot on
|
||||||
|
* sight, or your car will explode, something like that least...
|
||||||
|
*
|
||||||
|
* @param cellItem item
|
||||||
|
* @return number of bytes
|
||||||
|
*/
|
||||||
|
int getBytes(ItemStack cellItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines the number of bytes used for any type included on the cell.
|
||||||
|
*
|
||||||
|
* @param cellItem item
|
||||||
|
* @return number of bytes
|
||||||
|
*/
|
||||||
|
int BytePerType(ItemStack cellItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Must be between 1 and 63, indicates how many types you want to store on
|
||||||
|
* the item.
|
||||||
|
*
|
||||||
|
* @param cellItem item
|
||||||
|
* @return number of types
|
||||||
|
*/
|
||||||
|
int getTotalTypes(ItemStack cellItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows you to fine tune which items are allowed on a given cell, if you
|
||||||
|
* don't care, just return false; As the handler for this type of cell is
|
||||||
|
* still the default cells, the normal AE black list is also applied.
|
||||||
|
*
|
||||||
|
* @param cellItem item
|
||||||
|
* @param requestedAddition requested addition
|
||||||
|
* @return true to preventAdditionOfItem
|
||||||
|
*/
|
||||||
|
boolean isBlackListed(ItemStack cellItem, IAEItemStack requestedAddition);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows you to specify if this storage cell can be stored inside other
|
||||||
|
* storage cells, only set this for special items like the matter cannon
|
||||||
|
* that are not general purpose storage.
|
||||||
|
*
|
||||||
|
* @return true if the storage cell can be stored inside other storage
|
||||||
|
* cells, this is generally false, except for certain situations
|
||||||
|
* such as the matter cannon.
|
||||||
|
*/
|
||||||
|
boolean storableInStorageCell();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows an item to selectively enable or disable its status as a storage
|
||||||
|
* cell.
|
||||||
|
*
|
||||||
|
* @param i item
|
||||||
|
* @return if the ItemStack should behavior as a storage cell.
|
||||||
|
*/
|
||||||
|
boolean isStorageCell(ItemStack i);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return drain in ae/t this storage cell will use.
|
||||||
|
*/
|
||||||
|
double getIdleDrain();
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implemented on a {@link Item}
|
||||||
|
*/
|
||||||
|
public interface IStorageComponent
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This isn't necessarily the same as if you make a storage cell out of it,
|
||||||
|
* but all of AE's default cells do it that way, its currently only used for
|
||||||
|
* the condenser.
|
||||||
|
*
|
||||||
|
* @param is item
|
||||||
|
* @return number of bytes
|
||||||
|
*/
|
||||||
|
int getBytes(ItemStack is);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Just true or false for the item stack.
|
||||||
|
*
|
||||||
|
* @param is item
|
||||||
|
* @return true if item is a storage component
|
||||||
|
*/
|
||||||
|
boolean isStorageComponent(ItemStack is);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import appeng.api.config.Upgrades;
|
||||||
|
|
||||||
|
public interface IUpgradeModule
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param itemstack item with potential upgrades
|
||||||
|
* @return null, or a valid upgrade type.
|
||||||
|
*/
|
||||||
|
Upgrades getType(ItemStack itemstack);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package appeng.api.implementations.items;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Status Results for use with {@link IMemoryCard}
|
||||||
|
*/
|
||||||
|
public enum MemoryCardMessages
|
||||||
|
{
|
||||||
|
INVALID_MACHINE, SETTINGS_LOADED, SETTINGS_SAVED, SETTINGS_CLEARED
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package appeng.api.implementations.parts;
|
||||||
|
|
||||||
|
import appeng.api.networking.IGridHost;
|
||||||
|
import appeng.api.parts.BusSupport;
|
||||||
|
import appeng.api.parts.IPart;
|
||||||
|
import appeng.api.parts.IPartHost;
|
||||||
|
import appeng.api.util.AECableType;
|
||||||
|
import appeng.api.util.AEColor;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implemented on the {@link IPart}s cable objects that can be placed at {@link ForgeDirection}.UNKNOWN in
|
||||||
|
* {@link IPartHost}s
|
||||||
|
*/
|
||||||
|
public interface IPartCable extends IPart, IGridHost
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* does this cable support buses?
|
||||||
|
*/
|
||||||
|
BusSupport supportsBuses();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the current color of the cable.
|
||||||
|
*/
|
||||||
|
AEColor getCableColor();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the Cable type.
|
||||||
|
*/
|
||||||
|
AECableType getCableConnectionType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the color of the cable, this should cost a small amount of dye, or something.
|
||||||
|
*
|
||||||
|
* @param newColor new color
|
||||||
|
* @return if the color change was successful.
|
||||||
|
*/
|
||||||
|
boolean changeColor(AEColor newColor, EntityPlayer who);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change sides on the cables node.
|
||||||
|
*
|
||||||
|
* Called by AE, do not invoke.
|
||||||
|
*
|
||||||
|
* @param sides sides of cable
|
||||||
|
*/
|
||||||
|
void setValidSides(EnumSet<ForgeDirection> sides);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* used to tests if a cable connects to neighbors visually.
|
||||||
|
*
|
||||||
|
* @param side neighbor side
|
||||||
|
* @return true if this side is currently connects to an external block.
|
||||||
|
*/
|
||||||
|
boolean isConnected(ForgeDirection side);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package appeng.api.implementations.parts;
|
||||||
|
|
||||||
|
import appeng.api.networking.IGridHost;
|
||||||
|
import appeng.api.parts.IPart;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implemented by all screen like parts provided by AE.
|
||||||
|
*/
|
||||||
|
public interface IPartMonitor extends IPart, IGridHost
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return if the device is online you should check this before providing
|
||||||
|
* any other information.
|
||||||
|
*/
|
||||||
|
boolean isPowered();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package appeng.api.implementations.parts;
|
||||||
|
|
||||||
|
import appeng.api.networking.IGridHost;
|
||||||
|
import appeng.api.parts.IPart;
|
||||||
|
import appeng.api.storage.data.IAEStack;
|
||||||
|
import appeng.api.util.INetworkToolAgent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Storage monitor is a {@link IPart} located on the sides of a IPartHost
|
||||||
|
*/
|
||||||
|
public interface IPartStorageMonitor extends IPartMonitor, IPart, IGridHost, INetworkToolAgent
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the item being displayed on the storage monitor, in AEStack Form, can be either a IAEItemStack or an
|
||||||
|
* IAEFluidStack the quantity is important remember to use getStackSize() on the IAEStack, and not on the
|
||||||
|
* FluidStack/ItemStack acquired from it.
|
||||||
|
*/
|
||||||
|
IAEStack getDisplayed();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the current locked state of the Storage Monitor
|
||||||
|
*/
|
||||||
|
boolean isLocked();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import appeng.api.networking.IGridHost;
|
||||||
|
import appeng.api.storage.ICellContainer;
|
||||||
|
import appeng.api.util.IOrientable;
|
||||||
|
|
||||||
|
public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return how many slots are available. Chest has 1, Drive has 10.
|
||||||
|
*/
|
||||||
|
int getCellCount();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 if the device is online you should check this before providing any other information.
|
||||||
|
*/
|
||||||
|
boolean isPowered();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param slot slot index
|
||||||
|
* @return is the cell currently blinking to show activity.
|
||||||
|
*/
|
||||||
|
boolean isCellBlinking(int slot);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import appeng.api.util.AEColor;
|
||||||
|
|
||||||
|
public interface IColorableTile
|
||||||
|
{
|
||||||
|
|
||||||
|
AEColor getColor();
|
||||||
|
|
||||||
|
boolean recolourBlock(ForgeDirection side, AEColor colour, EntityPlayer who);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.InventoryCrafting;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
||||||
|
|
||||||
|
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, InventoryCrafting table, ForgeDirection 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();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Crank/Crankable API,
|
||||||
|
*
|
||||||
|
* Tiles that Implement this can receive power, from the crank, and have the
|
||||||
|
* crank placed on them.
|
||||||
|
*
|
||||||
|
* Tiles that access other tiles that implement this method can act as Cranks.
|
||||||
|
*
|
||||||
|
* This interface must be implemented by a tile entity.
|
||||||
|
*/
|
||||||
|
public interface ICrankable
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test if the crank can turn, return false if there is no work to be done.
|
||||||
|
*
|
||||||
|
* @return if crank should be allowed to turn.
|
||||||
|
*/
|
||||||
|
boolean canTurn();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The crank has completed one turn.
|
||||||
|
*/
|
||||||
|
void applyTurn();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the crank can attach on the given side.
|
||||||
|
*/
|
||||||
|
boolean canCrankAttach(ForgeDirection directionToCrank);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
public interface ICrystalGrowthAccelerator
|
||||||
|
{
|
||||||
|
|
||||||
|
boolean isPowered();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import appeng.api.networking.energy.IEnergySource;
|
||||||
|
|
||||||
|
public interface IMEChest extends IChestOrDrive, ITileStorageMonitorable, IEnergySource
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
|
||||||
|
public interface ISegmentedInventory
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Access an internal inventory, note, not all inventories contain real items, some may be ghost items, and treating
|
||||||
|
* them a real inventories will result in duplication.
|
||||||
|
*
|
||||||
|
* @param name inventory name
|
||||||
|
* @return inventory with inventory name
|
||||||
|
*/
|
||||||
|
IInventory getInventoryByName(String name);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import appeng.api.networking.security.BaseActionSource;
|
||||||
|
import appeng.api.storage.IStorageMonitorable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implemented on inventories that can share their inventories with other networks, best example, ME Interface.
|
||||||
|
*/
|
||||||
|
public interface ITileStorageMonitorable
|
||||||
|
{
|
||||||
|
|
||||||
|
IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
|
||||||
|
public interface IViewCellStorage
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* should contains at least 5 slot, the first 5
|
||||||
|
*
|
||||||
|
* @return inventory with at least 5 slot
|
||||||
|
*/
|
||||||
|
IInventory getViewCellStorage();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package appeng.api.implementations.tiles;
|
||||||
|
|
||||||
|
import appeng.api.networking.IGrid;
|
||||||
|
import appeng.api.networking.security.IActionHost;
|
||||||
|
import appeng.api.util.DimensionalCoord;
|
||||||
|
|
||||||
|
public interface IWirelessAccessPoint extends IActionHost
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return location of WAP
|
||||||
|
*/
|
||||||
|
DimensionalCoord getLocation();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return max range for this WAP
|
||||||
|
*/
|
||||||
|
double getRange();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return can you use this WAP?
|
||||||
|
*/
|
||||||
|
boolean isActive();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return grid of linked WAP
|
||||||
|
*/
|
||||||
|
IGrid getGrid();
|
||||||
|
|
||||||
|
}
|
20
src/api/java/appeng/api/integration/IBeeComparison.java
Normal file
20
src/api/java/appeng/api/integration/IBeeComparison.java
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
package appeng.api.integration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An interface to get access to the individual settings for AE's Internal Bee
|
||||||
|
* Comparison handler.
|
||||||
|
*
|
||||||
|
* Assessable via: ( IBeeComparison )
|
||||||
|
* IAEItemStack.getTagCompound().getSpecialComparison()
|
||||||
|
*
|
||||||
|
* If you don't have the forestry API, just delete this file when using the API.
|
||||||
|
*/
|
||||||
|
public interface IBeeComparison
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the Forestry IIndividual for this comparison object - cast this to a IIndividual if you want to use it.
|
||||||
|
*/
|
||||||
|
Object getIndividual();
|
||||||
|
|
||||||
|
}
|
44
src/api/java/appeng/api/movable/IMovableHandler.java
Normal file
44
src/api/java/appeng/api/movable/IMovableHandler.java
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
package appeng.api.movable;
|
||||||
|
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public interface IMovableHandler
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* if you return true from this, your saying you can handle the class, not
|
||||||
|
* that single entity, you cannot opt out of single entities.
|
||||||
|
*
|
||||||
|
* @param myClass tile entity class
|
||||||
|
* @param tile tile entity
|
||||||
|
* @return true if it can handle moving
|
||||||
|
*/
|
||||||
|
boolean canHandle(Class<? extends TileEntity> myClass, TileEntity tile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* request that the handler move the the tile from its current location to
|
||||||
|
* the new one. the tile has already been invalidated, and the blocks have
|
||||||
|
* already been fully moved.
|
||||||
|
*
|
||||||
|
* Potential Example:
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* {@code
|
||||||
|
* Chunk c = world.getChunkFromBlockCoords( x, z ); c.setChunkBlockTileEntity( x
|
||||||
|
* & 0xF, y + y, z & 0xF, tile );
|
||||||
|
*
|
||||||
|
* if ( c.isChunkLoaded ) { world.addTileEntity( tile ); world.markBlockForUpdate( x,
|
||||||
|
* y, z ); }
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param tile to be moved tile
|
||||||
|
* @param world world of tile
|
||||||
|
* @param x x coord of tile
|
||||||
|
* @param y y coord of tile
|
||||||
|
* @param z z coord of tile
|
||||||
|
*/
|
||||||
|
void moveTile(TileEntity tile, World world, int x, int y, int z);
|
||||||
|
|
||||||
|
}
|
97
src/api/java/appeng/api/movable/IMovableRegistry.java
Normal file
97
src/api/java/appeng/api/movable/IMovableRegistry.java
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
package appeng.api.movable;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to determine if a tile is marked as movable, a block will be considered movable, if...
|
||||||
|
*
|
||||||
|
* 1. The Tile or its super classes have been white listed with whiteListTileEntity.
|
||||||
|
*
|
||||||
|
* 2. The Tile has been register with the IMC ( which basically calls whiteListTileEntity. )
|
||||||
|
*
|
||||||
|
* 3. The Tile implements IMovableTile 4. A IMovableHandler is register that returns canHandle = true for the Tile
|
||||||
|
* Entity Class
|
||||||
|
*
|
||||||
|
* IMC Example: FMLInterModComms.sendMessage( "appliedenergistics2", "movabletile", "appeng.common.AppEngTile" );
|
||||||
|
*
|
||||||
|
* The movement process is as follows,
|
||||||
|
*
|
||||||
|
* 1. IMovableTile.prepareToMove() or TileEntity.invalidate() depending on your opt-in method. 2. The tile will be
|
||||||
|
* removed from the world. 3. Its world, coordinates will be changed. *** this can be overridden with a IMovableHandler
|
||||||
|
* *** 4. It will then be re-added to the world, or a new world. 5. TileEntity.validate() 6. IMovableTile.doneMoving (
|
||||||
|
* if you implemented IMovableTile )
|
||||||
|
*
|
||||||
|
* Please note, this is a 100% white list only feature, I will never opt in any non-vanilla, non-AE blocks. If you do
|
||||||
|
* not want to support your tiles being moved, you don't have to do anything.
|
||||||
|
*
|
||||||
|
* I appreciate anyone that takes the effort to get their tiles to work with this system to create a better use
|
||||||
|
* experience.
|
||||||
|
*
|
||||||
|
* If you need a build of deobf build of AE for testing, do not hesitate to ask.
|
||||||
|
*/
|
||||||
|
public interface IMovableRegistry
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Black list a block from movement, please only use this to prevent exploits.
|
||||||
|
*
|
||||||
|
* You can also use the IMC, FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial",
|
||||||
|
* "appeng.common.AppEngTile" );
|
||||||
|
*
|
||||||
|
* @param blk block
|
||||||
|
*/
|
||||||
|
void blacklistBlock(Block blk);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* White list your tile entity with the registry.
|
||||||
|
*
|
||||||
|
* You can also use the IMC, FMLInterModComms.sendMessage( "appliedenergistics2", "blacklist-block-spatial", new
|
||||||
|
* ItemStack(...) );
|
||||||
|
*
|
||||||
|
* If you tile is handled with IMovableHandler or IMovableTile you do not need to white list it.
|
||||||
|
*/
|
||||||
|
void whiteListTileEntity(Class<? extends TileEntity> c);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param te to be moved tile entity
|
||||||
|
* @return true if the tile has accepted your request to move it
|
||||||
|
*/
|
||||||
|
boolean askToMove(TileEntity te);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tells the tile you are done moving it.
|
||||||
|
*
|
||||||
|
* @param te moved tile entity
|
||||||
|
*/
|
||||||
|
void doneMoving(TileEntity te);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add a new handler movable handler.
|
||||||
|
*
|
||||||
|
* @param handler moving handler
|
||||||
|
*/
|
||||||
|
void addHandler(IMovableHandler handler);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* handlers are used to perform movement, this allows you to override AE's internal version.
|
||||||
|
*
|
||||||
|
* only valid after askToMove(...) = true
|
||||||
|
*
|
||||||
|
* @param te tile entity
|
||||||
|
* @return moving handler of tile entity
|
||||||
|
*/
|
||||||
|
IMovableHandler getHandler(TileEntity te);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a copy of the default handler
|
||||||
|
*/
|
||||||
|
IMovableHandler getDefaultHandler();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param blk block
|
||||||
|
* @return true if this block is blacklisted
|
||||||
|
*/
|
||||||
|
boolean isBlacklisted(Block blk);
|
||||||
|
|
||||||
|
}
|
23
src/api/java/appeng/api/movable/IMovableTile.java
Normal file
23
src/api/java/appeng/api/movable/IMovableTile.java
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
package appeng.api.movable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You can implement this, or use the IMovableRegistry to white list your tile,
|
||||||
|
* please see the registry for more information.
|
||||||
|
*/
|
||||||
|
public interface IMovableTile
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* notification that your block will be moved, called instead of invalidate,
|
||||||
|
* return false to prevent movement.
|
||||||
|
*
|
||||||
|
* @return false to prevent movement
|
||||||
|
*/
|
||||||
|
boolean prepareToMove();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* notification that your block was moved, called after validate.
|
||||||
|
*/
|
||||||
|
void doneMoving();
|
||||||
|
|
||||||
|
}
|
45
src/api/java/appeng/api/networking/GridFlags.java
Normal file
45
src/api/java/appeng/api/networking/GridFlags.java
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
package appeng.api.networking;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Various flags to determine network node behavior.
|
||||||
|
*/
|
||||||
|
public enum GridFlags
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* import/export buses, terminals, and other devices that use network features, will use this setting.
|
||||||
|
*/
|
||||||
|
REQUIRE_CHANNEL,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* P2P ME tunnels use this setting.
|
||||||
|
*/
|
||||||
|
COMPRESSED_CHANNEL,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cannot carry channels over this node.
|
||||||
|
*/
|
||||||
|
CANNOT_CARRY,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used by P2P Tunnels to prevent tunnels from tunneling recursively.
|
||||||
|
*/
|
||||||
|
CANNOT_CARRY_COMPRESSED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This node can transmit 32 signals, this should only apply to Tier2 Cable, P2P Tunnels, and Quantum Network
|
||||||
|
* Bridges.
|
||||||
|
*/
|
||||||
|
DENSE_CAPACITY,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This block is part of a multiblock, used in conjunction with REQUIRE_CHANNEL, and {@link IGridMultiblock} see this
|
||||||
|
* interface for details.
|
||||||
|
*/
|
||||||
|
MULTIBLOCK,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates which path might be preferred, this only matters if two routes of equal length exist, ad only changes
|
||||||
|
* the order they are processed in.
|
||||||
|
*/
|
||||||
|
PREFERRED
|
||||||
|
}
|
9
src/api/java/appeng/api/networking/GridNotification.java
Normal file
9
src/api/java/appeng/api/networking/GridNotification.java
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
package appeng.api.networking;
|
||||||
|
|
||||||
|
public enum GridNotification
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* the visible connections for this node have changed, useful for cable.
|
||||||
|
*/
|
||||||
|
ConnectionsChanged,
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue