Reformatted, and ported back some enhancements from the Forge version.
This commit is contained in:
@@ -18,20 +18,16 @@
|
||||
|
||||
package appeng.api;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* Use this annotation on a class in your Mod to have it instantiated during the
|
||||
* initialization phase of Applied Energistics.
|
||||
*
|
||||
* <p>
|
||||
* The class also needs to implement {@link IAEAddon}.
|
||||
*
|
||||
* <p>
|
||||
* AE expects your class to have a single constructor without any parameters.
|
||||
*
|
||||
* <p>
|
||||
* This is the only way to get access to the public {@link IAppEngApi} instance.
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
|
||||
@@ -26,19 +26,18 @@ package appeng.api;
|
||||
/**
|
||||
* Every AE2 addon requiring access to {@link IAppEngApi}, needs to provide at
|
||||
* least one class implementing this interface.
|
||||
*
|
||||
* <p>
|
||||
* Further it requires the class to be annotated with {@link AEAddon}.
|
||||
*
|
||||
*/
|
||||
public interface IAEAddon {
|
||||
|
||||
/**
|
||||
* This gets called once the API is successfully constructed and ready to be
|
||||
* used.
|
||||
*
|
||||
* <p>
|
||||
* Each addon is responsible to maintain a reference to {@link IAppEngApi} for
|
||||
* future use. Otherwise there is no alternative to access it later.
|
||||
*
|
||||
*
|
||||
* @param api The API instance when ready.
|
||||
*/
|
||||
void onAPIAvailable(IAppEngApi api);
|
||||
|
||||
@@ -39,21 +39,21 @@ public interface ICellModelRegistry {
|
||||
|
||||
/**
|
||||
* Register a new model for a storage cell item.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* You are responsible for ensuring that the given model is actually loaded by
|
||||
* the game. See
|
||||
* {@see net.minecraftforge.client.model.ModelLoader#addSpecialModel}.
|
||||
*
|
||||
* <p>
|
||||
* This method only maps an {@link Item} to a {@link Identifier} which can be
|
||||
* looked up from the
|
||||
* {@link net.minecraft.client.render.model.BakedModelManager}. No validation
|
||||
* about missing models will be done.
|
||||
*
|
||||
* <p>
|
||||
* Will throw an exception in case a model is already registered for an item.
|
||||
*
|
||||
* <p>
|
||||
* For examples look at our cell part models within the drive model directory.
|
||||
*
|
||||
*
|
||||
* @param item The cell item
|
||||
* @param model The {@link net.minecraft.util.Identifier} representing the
|
||||
* model.
|
||||
@@ -64,7 +64,7 @@ public interface ICellModelRegistry {
|
||||
/**
|
||||
* The {@link Identifier} of the model used to render the given storage cell
|
||||
* {@link Item} when inserted into a drive or similar.
|
||||
*
|
||||
*
|
||||
* @param item
|
||||
* @return null, if no model is registered.
|
||||
*/
|
||||
@@ -73,7 +73,7 @@ public interface ICellModelRegistry {
|
||||
|
||||
/**
|
||||
* An unmodifiable map of all registered mappings.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Nonnull
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface IClientHelper {
|
||||
|
||||
/**
|
||||
* A helper to work with clientside related tasks for cells.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ICellModelRegistry cells();
|
||||
|
||||
@@ -46,15 +46,14 @@ public enum PowerUnits {
|
||||
|
||||
/**
|
||||
* do power conversion using AE's conversion rates.
|
||||
*
|
||||
* <p>
|
||||
* Example: PowerUnits.EU.convertTo( PowerUnits.AE, 32 );
|
||||
*
|
||||
* <p>
|
||||
* will normally returns 64, as it will convert the EU, to AE with AE's power
|
||||
* settings.
|
||||
*
|
||||
* @param target target power unit
|
||||
* @param value value
|
||||
*
|
||||
* @return value converted to target units, from this units.
|
||||
*/
|
||||
public double convertTo(final PowerUnits target, final double value) {
|
||||
|
||||
@@ -23,11 +23,7 @@
|
||||
|
||||
package appeng.api.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ public interface IBlockDefinition extends IItemDefinition {
|
||||
*
|
||||
* @param world world of block
|
||||
* @param pos location
|
||||
*
|
||||
* @return if the block is placed in the world at the specific location.
|
||||
*/
|
||||
boolean isSameAs(BlockView world, BlockPos pos);
|
||||
|
||||
@@ -32,7 +32,6 @@ public interface IComparableDefinition {
|
||||
* Compare {@link ItemStack} with this
|
||||
*
|
||||
* @param comparableStack compared item
|
||||
*
|
||||
* @return true if the item stack is a matching item.
|
||||
*/
|
||||
boolean isSameAs(ItemStack comparableStack);
|
||||
|
||||
@@ -28,7 +28,7 @@ import appeng.api.networking.IGridNode;
|
||||
/**
|
||||
* Exception occurred because of an already existing connection between the two
|
||||
* {@link IGridNode}s
|
||||
*
|
||||
* <p>
|
||||
* Intended to signal an internal exception and not intended to be thrown by any
|
||||
* 3rd party module.
|
||||
*
|
||||
|
||||
@@ -27,10 +27,10 @@ import appeng.api.networking.IGridNode;
|
||||
|
||||
/**
|
||||
* Exception indicating a failed connection between two {@link IGridNode}s.
|
||||
*
|
||||
* <p>
|
||||
* Intended to signal an internal exception and not intended to be thrown by any
|
||||
* 3rd party module.
|
||||
*
|
||||
* <p>
|
||||
* See any subclass for a more specific reason.
|
||||
*
|
||||
* @author AlgorithmX2
|
||||
|
||||
@@ -25,7 +25,7 @@ package appeng.api.exceptions;
|
||||
|
||||
/**
|
||||
* Exception due to trying to connect one or more null values.
|
||||
*
|
||||
* <p>
|
||||
* Intended to signal an internal exception and not intended to be thrown by any
|
||||
* 3rd party module.
|
||||
*
|
||||
|
||||
@@ -25,7 +25,7 @@ package appeng.api.exceptions;
|
||||
|
||||
/**
|
||||
* Exception due to trying to connect different security realms.
|
||||
*
|
||||
* <p>
|
||||
* Intended to signal an internal exception and not intended to be thrown by any
|
||||
* 3rd party module.
|
||||
*
|
||||
|
||||
@@ -33,12 +33,12 @@ import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
/**
|
||||
* A registry to allow mapping {@link Item}s to a specific charge rate when
|
||||
* being placed inside a charger.
|
||||
*
|
||||
* <p>
|
||||
* The registry is used in favor of an additional method for
|
||||
* {@link IAEItemPowerStorage} with a fixed value per item. This allows more
|
||||
* flexibility for other charger like machines to choose their own values when
|
||||
* needed.
|
||||
*
|
||||
* <p>
|
||||
* There is no guarantee that this is charged per tick, it only represents the
|
||||
* value per operation. By default this is one charging operation every 10 ticks
|
||||
* in case of an AE2 charger.
|
||||
@@ -51,7 +51,7 @@ public interface IChargerRegistry {
|
||||
|
||||
/**
|
||||
* Fetch a charge rate for a specific item.
|
||||
*
|
||||
* <p>
|
||||
* The specific item does not need to have a mapping registered at all. In this
|
||||
* case it will use a default value of 160 AE.
|
||||
*
|
||||
@@ -63,7 +63,7 @@ public interface IChargerRegistry {
|
||||
|
||||
/**
|
||||
* Register a custom charge rate for a specific item.
|
||||
*
|
||||
* <p>
|
||||
* Capped at 16000 to avoid extracting too much energy from a network for each
|
||||
* operation. This is done silently without any feedback or exception. Further
|
||||
* the cap is not fixed, it can change at any time in the future should power
|
||||
@@ -76,7 +76,7 @@ public interface IChargerRegistry {
|
||||
|
||||
/**
|
||||
* Remove the custom rate for a specific item.
|
||||
*
|
||||
* <p>
|
||||
* It will revert to the default value afterwards.
|
||||
*
|
||||
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
|
||||
|
||||
@@ -37,7 +37,6 @@ public interface IItemComparisonProvider {
|
||||
* supplied item.
|
||||
*
|
||||
* @param is item
|
||||
*
|
||||
* @return IItemComparison, or null
|
||||
*/
|
||||
IItemComparison getComparison(ItemStack is);
|
||||
@@ -47,7 +46,6 @@ public interface IItemComparisonProvider {
|
||||
* function. )
|
||||
*
|
||||
* @param stack item
|
||||
*
|
||||
* @return true, if getComparison will return a valid IItemComparison Object
|
||||
*/
|
||||
boolean canHandle(ItemStack stack);
|
||||
|
||||
@@ -32,7 +32,6 @@ public interface ILocatableRegistry {
|
||||
* Gets the {@link ILocatable} with the registered serial, if available
|
||||
*
|
||||
* @param serial serial
|
||||
*
|
||||
* @return requestedObject, or null, if the object does not exist anymore
|
||||
*/
|
||||
ILocatable getLocatableBy(long serial);
|
||||
|
||||
@@ -51,7 +51,6 @@ public interface IMatterCannonAmmoRegistry {
|
||||
* 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);
|
||||
|
||||
@@ -31,7 +31,6 @@ public interface INetworkEncodable {
|
||||
* Used to get the current key from the item.
|
||||
*
|
||||
* @param item item
|
||||
*
|
||||
* @return string key of item
|
||||
*/
|
||||
String getEncryptionKey(ItemStack item);
|
||||
|
||||
@@ -55,7 +55,6 @@ public interface IP2PTunnelRegistry {
|
||||
* returns null if no attunement can be found.
|
||||
*
|
||||
* @param trigger attunement trigger
|
||||
*
|
||||
* @return null if no attunement can be found or attunement
|
||||
*/
|
||||
@Nonnull
|
||||
|
||||
@@ -38,21 +38,18 @@ 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(PlayerEntity player);
|
||||
|
||||
/**
|
||||
* @param playerID to be found player id
|
||||
*
|
||||
* @return PlayerEntity, or null if the player could not be found.
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -35,7 +35,6 @@ public interface IWirelessTermHandler extends INetworkEncodable {
|
||||
|
||||
/**
|
||||
* @param is wireless terminal
|
||||
*
|
||||
* @return true, if usePower, hasPower, etc... can be called for the provided
|
||||
* item
|
||||
*/
|
||||
@@ -47,7 +46,6 @@ public interface IWirelessTermHandler extends INetworkEncodable {
|
||||
* @param amount is in AE units ( 5 per MJ ), if you return false, the item
|
||||
* should be dead and return false for hasPower
|
||||
* @param is wireless terminal
|
||||
*
|
||||
* @return true if wireless terminal uses power
|
||||
*/
|
||||
boolean usePower(PlayerEntity player, double amount, ItemStack is);
|
||||
@@ -56,7 +54,6 @@ public interface IWirelessTermHandler extends INetworkEncodable {
|
||||
* gets the power status of the item.
|
||||
*
|
||||
* @param is wireless terminal
|
||||
*
|
||||
* @return returns true if there is any power left.
|
||||
*/
|
||||
boolean hasPower(PlayerEntity player, double amount, ItemStack is);
|
||||
@@ -65,7 +62,6 @@ public interface IWirelessTermHandler extends INetworkEncodable {
|
||||
* Return the config manager for the wireless terminal.
|
||||
*
|
||||
* @param is wireless terminal
|
||||
*
|
||||
* @return config manager of wireless terminal
|
||||
*/
|
||||
IConfigManager getConfigManager(ItemStack is);
|
||||
|
||||
@@ -42,7 +42,6 @@ public interface IWirelessTermRegistry {
|
||||
|
||||
/**
|
||||
* @param is item which might have a handler
|
||||
*
|
||||
* @return true if there is a handler for this item
|
||||
*/
|
||||
boolean isWirelessTerminal(ItemStack is);
|
||||
|
||||
@@ -25,7 +25,6 @@ package appeng.api.features;
|
||||
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.world.ServerWorldAccess;
|
||||
|
||||
public interface IWorldGen {
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ import net.minecraft.world.World;
|
||||
*/
|
||||
public interface IGuiItem {
|
||||
/**
|
||||
*
|
||||
* @param is The item used to open the container.
|
||||
* @param playerInventorySlot The slot in the player's inventory the item is in.
|
||||
* @param world The world the player is in.
|
||||
|
||||
@@ -46,7 +46,6 @@ public interface IAEItemPowerStorage {
|
||||
* return it.
|
||||
*
|
||||
* @param amount to be extracted power from device
|
||||
*
|
||||
* @return what it could extract
|
||||
*/
|
||||
double extractAEPower(ItemStack stack, double amount, Actionable mode);
|
||||
|
||||
@@ -38,7 +38,6 @@ public interface IAEWrench {
|
||||
*
|
||||
* @param player wrenching player
|
||||
* @param pos of block.
|
||||
*
|
||||
* @return true if wrench can be used
|
||||
*/
|
||||
boolean canWrench(ItemStack wrench, PlayerEntity player, BlockPos pos);
|
||||
|
||||
@@ -48,7 +48,6 @@ public interface IBiometricCard {
|
||||
|
||||
/**
|
||||
* @param itemStack card
|
||||
*
|
||||
* @return the full list of permissions encoded on the card.
|
||||
*/
|
||||
EnumSet<SecurityPermissions> getPermissions(ItemStack itemStack);
|
||||
@@ -57,7 +56,6 @@ public interface IBiometricCard {
|
||||
* 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);
|
||||
|
||||
@@ -31,7 +31,7 @@ import appeng.api.util.AEColor;
|
||||
|
||||
/**
|
||||
* Memory Card API
|
||||
*
|
||||
* <p>
|
||||
* AE's Memory Card Item Class implements this interface.
|
||||
*/
|
||||
public interface IMemoryCard {
|
||||
@@ -39,10 +39,10 @@ public interface IMemoryCard {
|
||||
/**
|
||||
* Configures the data stored on the memory card, the SettingsName, will be
|
||||
* localized when displayed.
|
||||
*
|
||||
* <p>
|
||||
* The data can contain an optional string with the key "tooltip", which will be
|
||||
* used as unlocalized string to display it after the settings name.
|
||||
*
|
||||
* <p>
|
||||
* The data can contain an optional intArray using "colorCode" to be displayed
|
||||
* on the model itself. It needs to have exactly 8 elements representing the
|
||||
* ordinal of the matching {@link AEColor}. The first 4 values represent the top
|
||||
@@ -61,14 +61,12 @@ public interface IMemoryCard {
|
||||
* 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
|
||||
*/
|
||||
@@ -77,11 +75,10 @@ public interface IMemoryCard {
|
||||
/**
|
||||
* This represent as 4x2 grid of {@link AEColor} without transparent/fluix
|
||||
* color.
|
||||
*
|
||||
* <p>
|
||||
* First 4 colors are used for the top row, second for the bottom one.
|
||||
*
|
||||
* @param is item
|
||||
*
|
||||
* @return a hash representation of the memory card content
|
||||
*/
|
||||
AEColor[] getColorCode(ItemStack is);
|
||||
|
||||
@@ -26,9 +26,6 @@ package appeng.api.implementations.items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
import appeng.api.util.WorldCoord;
|
||||
|
||||
@@ -39,14 +36,12 @@ 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);
|
||||
@@ -55,7 +50,6 @@ public interface ISpatialStorageCell {
|
||||
* get the currently stored spatial storage plot id.
|
||||
*
|
||||
* @param is spatial storage cell
|
||||
*
|
||||
* @return plot id or -1
|
||||
*/
|
||||
int getAllocatedPlotId(ItemStack is);
|
||||
@@ -68,7 +62,6 @@ public interface ISpatialStorageCell {
|
||||
* @param min min coord
|
||||
* @param max max coord
|
||||
* @param playerId owner of current grid or -1
|
||||
*
|
||||
* @return success of transition
|
||||
*/
|
||||
boolean doSpatialTransition(ItemStack is, ServerWorld w, WorldCoord min, WorldCoord max, int playerId);
|
||||
|
||||
@@ -38,14 +38,14 @@ import appeng.api.storage.data.IAEStack;
|
||||
* {@link ICellHandler#getCellInventory(ItemStack, appeng.api.storage.cells.ISaveProvider, IStorageChannel)}
|
||||
* or {@link ICellHandler#isCell(ItemStack)}. It automatically handles the
|
||||
* internals and NBT data, which is both nice, and bad for you!
|
||||
*
|
||||
* <p>
|
||||
* Good cause it means you don't have to do anything, bad because you have
|
||||
* little to no control over it.
|
||||
*
|
||||
* <p>
|
||||
* Limited to {@link Integer} internally for most calculations. E.g. if the used
|
||||
* or remaining bytes would overflow {@link Integer#MAX_VALUE} the behaviour is
|
||||
* no longer specified. Even if {@link ICellInventory} is using {@link Long}.
|
||||
*
|
||||
* <p>
|
||||
* The standard AE implementation also only provides 1-63 Types.
|
||||
*/
|
||||
public interface IStorageCell<T extends IAEStack<T>> extends ICellWorkbenchItem {
|
||||
@@ -55,7 +55,6 @@ public interface IStorageCell<T extends IAEStack<T>> extends ICellWorkbenchItem
|
||||
* ({@link Integer#MAX_VALUE} + 1) / 8.
|
||||
*
|
||||
* @param cellItem item
|
||||
*
|
||||
* @return number of bytes
|
||||
*/
|
||||
int getBytes(@Nonnull ItemStack cellItem);
|
||||
@@ -64,7 +63,6 @@ public interface IStorageCell<T extends IAEStack<T>> extends ICellWorkbenchItem
|
||||
* Determines the number of bytes used for any type included on the cell.
|
||||
*
|
||||
* @param cellItem item
|
||||
*
|
||||
* @return number of bytes
|
||||
*/
|
||||
int getBytesPerType(@Nonnull ItemStack cellItem);
|
||||
@@ -74,7 +72,6 @@ public interface IStorageCell<T extends IAEStack<T>> extends ICellWorkbenchItem
|
||||
* item.
|
||||
*
|
||||
* @param cellItem item
|
||||
*
|
||||
* @return number of types
|
||||
*/
|
||||
int getTotalTypes(@Nonnull ItemStack cellItem);
|
||||
@@ -86,7 +83,6 @@ public interface IStorageCell<T extends IAEStack<T>> extends ICellWorkbenchItem
|
||||
*
|
||||
* @param cellItem item
|
||||
* @param requestedAddition requested addition
|
||||
*
|
||||
* @return true to preventAdditionOfItem
|
||||
*/
|
||||
boolean isBlackListed(@Nonnull ItemStack cellItem, @Nonnull T requestedAddition);
|
||||
@@ -106,7 +102,6 @@ public interface IStorageCell<T extends IAEStack<T>> extends ICellWorkbenchItem
|
||||
* Allows an item to selectively enable or disable its status as a storage cell.
|
||||
*
|
||||
* @param i item
|
||||
*
|
||||
* @return if the ItemStack should behavior as a storage cell.
|
||||
*/
|
||||
boolean isStorageCell(@Nonnull ItemStack i);
|
||||
|
||||
@@ -37,7 +37,6 @@ public interface IStorageComponent {
|
||||
* condenser.
|
||||
*
|
||||
* @param is item
|
||||
*
|
||||
* @return number of bytes
|
||||
*/
|
||||
int getBytes(ItemStack is);
|
||||
@@ -46,7 +45,6 @@ public interface IStorageComponent {
|
||||
* Just true or false for the item stack.
|
||||
*
|
||||
* @param is item
|
||||
*
|
||||
* @return true if item is a storage component
|
||||
*/
|
||||
boolean isStorageComponent(ItemStack is);
|
||||
|
||||
@@ -31,7 +31,6 @@ public interface IUpgradeModule {
|
||||
|
||||
/**
|
||||
* @param itemstack item with potential upgrades
|
||||
*
|
||||
* @return null, or a valid upgrade type.
|
||||
*/
|
||||
Upgrades getType(ItemStack itemstack);
|
||||
|
||||
@@ -62,14 +62,13 @@ public interface ICablePart extends IPart, IGridHost {
|
||||
* something.
|
||||
*
|
||||
* @param newColor new color
|
||||
*
|
||||
* @return if the color change was successful.
|
||||
*/
|
||||
boolean changeColor(AEColor newColor, PlayerEntity who);
|
||||
|
||||
/**
|
||||
* Change sides on the cables node.
|
||||
*
|
||||
* <p>
|
||||
* Called by AE, do not invoke.
|
||||
*
|
||||
* @param sides sides of cable
|
||||
@@ -80,7 +79,6 @@ public interface ICablePart extends IPart, IGridHost {
|
||||
* used to tests if a cable connects to neighbors visually.
|
||||
*
|
||||
* @param side neighbor side
|
||||
*
|
||||
* @return true if this side is currently connects to an external block.
|
||||
*/
|
||||
boolean isConnected(Direction side);
|
||||
|
||||
@@ -41,7 +41,6 @@ public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable {
|
||||
|
||||
/**
|
||||
* @param slot slot index
|
||||
*
|
||||
* @return status of the slot, one of the above indices.
|
||||
*/
|
||||
CellState getCellStatus(int slot);
|
||||
@@ -54,7 +53,6 @@ public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable {
|
||||
|
||||
/**
|
||||
* @param slot slot index
|
||||
*
|
||||
* @return is the cell currently blinking to show activity.
|
||||
*/
|
||||
boolean isCellBlinking(int slot);
|
||||
|
||||
@@ -36,7 +36,6 @@ public interface ICraftingMachine {
|
||||
* @param patternDetails details of pattern
|
||||
* @param table crafting table
|
||||
* @param ejectionDirection ejection direction
|
||||
*
|
||||
* @return if it was accepted, all or nothing.
|
||||
*/
|
||||
boolean pushPattern(ICraftingPatternDetails patternDetails, CraftingInventory table, Direction ejectionDirection);
|
||||
|
||||
@@ -27,12 +27,12 @@ import net.minecraft.util.math.Direction;
|
||||
|
||||
/**
|
||||
* Crank/Crankable API,
|
||||
*
|
||||
* <p>
|
||||
* Tiles that Implement this can receive power, from the crank, and have the
|
||||
* crank placed on them.
|
||||
*
|
||||
* <p>
|
||||
* Tiles that access other tiles that implement this method can act as Cranks.
|
||||
*
|
||||
* <p>
|
||||
* This interface must be implemented by a block entity.
|
||||
*/
|
||||
public interface ICrankable {
|
||||
|
||||
@@ -33,7 +33,6 @@ public interface ISegmentedInventory {
|
||||
* duplication.
|
||||
*
|
||||
* @param name inventory name
|
||||
*
|
||||
* @return inventory with inventory name
|
||||
*/
|
||||
FixedItemInv getInventoryByName(String name);
|
||||
|
||||
@@ -35,7 +35,6 @@ public interface IMovableHandler {
|
||||
*
|
||||
* @param myClass block entity class
|
||||
* @param tile block entity
|
||||
*
|
||||
* @return true if it can handle moving
|
||||
*/
|
||||
boolean canHandle(Class<? extends BlockEntity> myClass, BlockEntity tile);
|
||||
@@ -44,7 +43,7 @@ public interface IMovableHandler {
|
||||
* 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.
|
||||
*
|
||||
* <p>
|
||||
* Potential Example:
|
||||
*
|
||||
* <pre>
|
||||
|
||||
@@ -29,32 +29,32 @@ import net.minecraft.block.entity.BlockEntity;
|
||||
/**
|
||||
* Used to determine if a tile is marked as movable, a block will be considered
|
||||
* movable, if...
|
||||
*
|
||||
* <p>
|
||||
* 1. The Tile or its super classes have been white listed with
|
||||
* whiteListTileEntity.
|
||||
*
|
||||
* <p>
|
||||
* 2. The Tile implements IMovableTile
|
||||
*
|
||||
* <p>
|
||||
* 3. A IMovableHandler is register that returns canHandle = true for the
|
||||
* {@link BlockEntity} subclass
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* <p>
|
||||
* The movement process is as follows,
|
||||
*
|
||||
* <p>
|
||||
* 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.cancelRemoval() 6. IMovableTile.doneMoving ( if you implemented
|
||||
* IMovableTile )
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
*
|
||||
* <p>
|
||||
* I appreciate anyone that takes the effort to get their tiles to work with
|
||||
* this system to create a better use experience.
|
||||
*
|
||||
* <p>
|
||||
* If you need a build of deobf build of AE for testing, do not hesitate to ask.
|
||||
*/
|
||||
public interface IMovableRegistry {
|
||||
@@ -68,7 +68,7 @@ public interface IMovableRegistry {
|
||||
|
||||
/**
|
||||
* White list your block entity with the registry.
|
||||
*
|
||||
* <p>
|
||||
* If you tile is handled with IMovableHandler or IMovableTile you do not need
|
||||
* to white list it.
|
||||
*/
|
||||
@@ -76,7 +76,6 @@ public interface IMovableRegistry {
|
||||
|
||||
/**
|
||||
* @param te to be moved block entity
|
||||
*
|
||||
* @return true if the tile has accepted your request to move it
|
||||
*/
|
||||
boolean askToMove(BlockEntity te);
|
||||
@@ -98,11 +97,10 @@ public interface IMovableRegistry {
|
||||
/**
|
||||
* handlers are used to perform movement, this allows you to override AE's
|
||||
* internal version.
|
||||
*
|
||||
* <p>
|
||||
* only valid after askToMove(...) = true
|
||||
*
|
||||
* @param te block entity
|
||||
*
|
||||
* @return moving handler of block entity
|
||||
*/
|
||||
IMovableHandler getHandler(BlockEntity te);
|
||||
@@ -114,7 +112,6 @@ public interface IMovableRegistry {
|
||||
|
||||
/**
|
||||
* @param blk block
|
||||
*
|
||||
* @return true if this block is blacklisted
|
||||
*/
|
||||
boolean isBlacklisted(Block blk);
|
||||
|
||||
@@ -30,7 +30,7 @@ import appeng.api.util.IReadOnlyCollection;
|
||||
|
||||
/**
|
||||
* Gives you access to Grid based information.
|
||||
*
|
||||
* <p>
|
||||
* Don't Implement.
|
||||
*/
|
||||
public interface IGrid {
|
||||
@@ -39,7 +39,6 @@ public interface IGrid {
|
||||
* Get Access to various grid modules
|
||||
*
|
||||
* @param iface face
|
||||
*
|
||||
* @return the IGridCache you requested.
|
||||
*/
|
||||
@Nonnull
|
||||
@@ -49,7 +48,6 @@ public interface IGrid {
|
||||
* Post an event into the network event bus.
|
||||
*
|
||||
* @param ev - event to post
|
||||
*
|
||||
* @return returns ev back to original poster
|
||||
*/
|
||||
@Nonnull
|
||||
@@ -59,7 +57,6 @@ public interface IGrid {
|
||||
* Post an event into the network event bus, but direct it at a single node.
|
||||
*
|
||||
* @param ev event to post
|
||||
*
|
||||
* @return returns ev back to original poster
|
||||
*/
|
||||
@Nonnull
|
||||
@@ -79,7 +76,6 @@ public interface IGrid {
|
||||
* Get machines on the network.
|
||||
*
|
||||
* @param gridHostClass class of the grid host
|
||||
*
|
||||
* @return IMachineSet of all nodes belonging to hosts of specified class.
|
||||
*/
|
||||
@Nonnull
|
||||
|
||||
@@ -37,14 +37,14 @@ import appeng.api.util.DimensionalCoord;
|
||||
|
||||
/**
|
||||
* An Implementation is required to create your node for IGridHost
|
||||
*
|
||||
* <p>
|
||||
* Implement for use with IGridHost
|
||||
*/
|
||||
public interface IGridBlock {
|
||||
|
||||
/**
|
||||
* how much power to drain per tick as part of idle network usage.
|
||||
*
|
||||
* <p>
|
||||
* if the value of this changes, you must post a MENetworkPowerIdleChange
|
||||
*
|
||||
* @return ae/t to use.
|
||||
|
||||
@@ -28,7 +28,7 @@ import javax.annotation.Nonnull;
|
||||
/**
|
||||
* Allows you to create a network wide service, AE2 uses these for providing
|
||||
* item, spatial, and tunnel services.
|
||||
*
|
||||
* <p>
|
||||
* Any Class that implements this, should have a public default constructor that
|
||||
* takes a single argument of type IGrid.
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ public interface IGridCache {
|
||||
|
||||
/**
|
||||
* inform your cache, that a machine was removed from the grid.
|
||||
*
|
||||
* <p>
|
||||
* Important: Do not trust the grids state in this method, interact only with
|
||||
* the node you are passed, if you need to manage other grid information, do it
|
||||
* on the next updateTick.
|
||||
@@ -54,7 +54,7 @@ public interface IGridCache {
|
||||
|
||||
/**
|
||||
* informs you cache that a machine was added to the grid.
|
||||
*
|
||||
* <p>
|
||||
* Important: Do not trust the grids state in this method, interact only with
|
||||
* the node you are passed, if you need to manage other grid information, do it
|
||||
* on the next updateTick.
|
||||
|
||||
@@ -45,7 +45,6 @@ public interface IGridCacheRegistry {
|
||||
* requests a new INSTANCE of a grid cache for use, used internally
|
||||
*
|
||||
* @param grid grid
|
||||
*
|
||||
* @return a new Map of IGridCaches from the registry, called from IGrid when
|
||||
* constructing a new grid.
|
||||
*/
|
||||
|
||||
@@ -29,10 +29,10 @@ import appeng.api.util.AEPartLocation;
|
||||
|
||||
/**
|
||||
* Access to AE's internal grid connections.
|
||||
*
|
||||
* <p>
|
||||
* Messing with connection is generally completely unnecessary, you should be
|
||||
* able to just use IGridNode.updateState() to have AE manage them for you.
|
||||
*
|
||||
* <p>
|
||||
* Don't Implement.
|
||||
*/
|
||||
public interface IGridConnection {
|
||||
@@ -41,7 +41,6 @@ public interface IGridConnection {
|
||||
* lets you get the opposing node of the connection by passing your own node.
|
||||
*
|
||||
* @param gridNode current grid node
|
||||
*
|
||||
* @return the IGridNode which represents the opposite side of the connection.
|
||||
*/
|
||||
@Nonnull
|
||||
@@ -51,7 +50,6 @@ public interface IGridConnection {
|
||||
* determine the direction of the connection based on your node.
|
||||
*
|
||||
* @param gridNode current grid node
|
||||
*
|
||||
* @return the direction of the connection, only valid for in world connections.
|
||||
*/
|
||||
@Nonnull
|
||||
|
||||
@@ -39,12 +39,11 @@ public interface IGridHelper {
|
||||
|
||||
/**
|
||||
* Create a grid node for your {@link IGridHost}
|
||||
*
|
||||
* <p>
|
||||
* The passed {@link IGridBlock} represents the definition for properties like
|
||||
* connectable sides. Refer to its documentation for further details.
|
||||
*
|
||||
* @param block grid block
|
||||
*
|
||||
* @return grid node of block
|
||||
*/
|
||||
@Nonnull
|
||||
@@ -52,13 +51,12 @@ public interface IGridHelper {
|
||||
|
||||
/**
|
||||
* Create a direct connection between two {@link IGridNode}.
|
||||
*
|
||||
* <p>
|
||||
* This will be considered as having a distance of 1, regardless of the location
|
||||
* of both nodes.
|
||||
*
|
||||
* @param a to be connected gridnode
|
||||
* @param b to be connected gridnode
|
||||
*
|
||||
* @throws appeng.api.exceptions.FailedConnectionException
|
||||
*/
|
||||
@Nonnull
|
||||
|
||||
@@ -45,7 +45,6 @@ public interface IGridHost {
|
||||
*
|
||||
* @param dir feel free to ignore this, most blocks will use the same node for
|
||||
* every side.
|
||||
*
|
||||
* @return a new IGridNode, create these with AEApi.INSTANCE().createGridNode(
|
||||
* MyIGridBlock )
|
||||
*/
|
||||
|
||||
@@ -36,9 +36,9 @@ import appeng.api.util.IReadOnlyCollection;
|
||||
|
||||
/**
|
||||
* Gives you a view into your Nodes connections and information.
|
||||
*
|
||||
* <p>
|
||||
* updateState, getGrid, destroy are required to implement a proper IGridHost.
|
||||
*
|
||||
* <p>
|
||||
* Don't Implement; Acquire from {@link IAppEngApi}.createGridNode
|
||||
*/
|
||||
public interface IGridNode {
|
||||
@@ -54,10 +54,10 @@ public interface IGridNode {
|
||||
/**
|
||||
* inform the node that your IGridBlock has changed its internal state, and
|
||||
* force the node to update.
|
||||
*
|
||||
* <p>
|
||||
* ALWAYS make sure that your block entity is in the world, and has its node
|
||||
* properly saved to be returned from the host before updating state,
|
||||
*
|
||||
* <p>
|
||||
* If your entity is not in the world, or if you IGridHost returns a different
|
||||
* node for the same side you will likely crash the game.
|
||||
*/
|
||||
@@ -124,7 +124,7 @@ public interface IGridNode {
|
||||
* this should be called for each node you create, if you have a nodeData
|
||||
* compound to load from, you can store all your nods on a single compound using
|
||||
* name.
|
||||
*
|
||||
* <p>
|
||||
* Important: You must call this before updateState.
|
||||
*
|
||||
* @param name nbt name
|
||||
@@ -152,7 +152,6 @@ public interface IGridNode {
|
||||
* see if this node has a certain flag
|
||||
*
|
||||
* @param flag flags
|
||||
*
|
||||
* @return true if has flag
|
||||
*/
|
||||
boolean hasFlag(@Nonnull GridFlags flag);
|
||||
|
||||
@@ -32,12 +32,11 @@ public interface IGridVisitor {
|
||||
|
||||
/**
|
||||
* Called for each node on the network.
|
||||
*
|
||||
* <p>
|
||||
* By returning false your informing the host to stop visiting nodes beyond the
|
||||
* current node.
|
||||
*
|
||||
* @param n the current node.
|
||||
*
|
||||
* @return true to continue visiting nodes beyond this node.
|
||||
*/
|
||||
boolean visitNode(@Nonnull IGridNode n);
|
||||
|
||||
@@ -42,7 +42,6 @@ public interface ICraftingGrid extends IGridCache {
|
||||
* @param world crafting world
|
||||
* @param slot slot index
|
||||
* @param details pattern details
|
||||
*
|
||||
* @return a collection of crafting patterns for the item in question.
|
||||
*/
|
||||
ImmutableCollection<ICraftingPatternDetails> getCraftingFor(IAEItemStack whatToCraft,
|
||||
@@ -56,7 +55,6 @@ public interface ICraftingGrid extends IGridCache {
|
||||
* @param actionSrc source
|
||||
* @param craftWhat result
|
||||
* @param callback callback -- optional
|
||||
*
|
||||
* @return a future which will at an undetermined point in the future get you
|
||||
* the {@link ICraftingJob} do not wait on this, your be waiting
|
||||
* forever.
|
||||
@@ -79,7 +77,6 @@ public interface ICraftingGrid extends IGridCache {
|
||||
* this will be used for extracting items, should
|
||||
* usually be the same as the one provided to
|
||||
* beginCraftingJob.
|
||||
*
|
||||
* @return null ( if failed ) or an {@link ICraftingLink} other wise, if you
|
||||
* send requestingMachine you need to properly keep track of this and
|
||||
* handle the nbt saving and loading of the object as well as the
|
||||
@@ -96,7 +93,6 @@ public interface ICraftingGrid extends IGridCache {
|
||||
|
||||
/**
|
||||
* @param what to be requested item
|
||||
*
|
||||
* @return true if the item can be requested via a crafting emitter.
|
||||
*/
|
||||
boolean canEmitFor(IAEItemStack what);
|
||||
@@ -105,7 +101,6 @@ public interface ICraftingGrid extends IGridCache {
|
||||
* is this item being crafted?
|
||||
*
|
||||
* @param what item being crafted
|
||||
*
|
||||
* @return true if it is being crafting
|
||||
*/
|
||||
boolean isRequesting(IAEItemStack what);
|
||||
@@ -114,7 +109,6 @@ public interface ICraftingGrid extends IGridCache {
|
||||
* The total amount being requested across all crafting cpus of a grid.
|
||||
*
|
||||
* @param what item being requested, ignores stacksize
|
||||
*
|
||||
* @return The total amount being requested.
|
||||
*/
|
||||
long requesting(IAEItemStack what);
|
||||
|
||||
@@ -37,7 +37,6 @@ public interface ICraftingMedium {
|
||||
*
|
||||
* @param patternDetails details
|
||||
* @param table crafting table
|
||||
*
|
||||
* @return if the pattern was successfully pushed.
|
||||
*/
|
||||
boolean pushPattern(ICraftingPatternDetails patternDetails, CraftingInventory table);
|
||||
|
||||
@@ -49,7 +49,6 @@ public interface ICraftingPatternDetails {
|
||||
* @param slotIndex specific slot index
|
||||
* @param itemStack item in slot
|
||||
* @param world crafting world
|
||||
*
|
||||
* @return if an item can be used in the specific slot for this pattern.
|
||||
*/
|
||||
boolean isValidItemForSlot(int slotIndex, ItemStack itemStack, World world);
|
||||
@@ -70,7 +69,7 @@ public interface ICraftingPatternDetails {
|
||||
* The list will be sorted in descending order by stack size. However there is
|
||||
* no guarantee about maintaining the placement order of the inputs in case of
|
||||
* equal values.
|
||||
*
|
||||
*
|
||||
* @return an immutable list of inputs without nulls
|
||||
*/
|
||||
List<IAEItemStack> getInputs();
|
||||
@@ -81,11 +80,11 @@ public interface ICraftingPatternDetails {
|
||||
* <p>
|
||||
* This should be the preferred way to deal with the list of outputs.
|
||||
* <p>
|
||||
*
|
||||
* <p>
|
||||
* The list will be sorted in descending order by stack size. However there is
|
||||
* no guarantee about maintaining the placement order of the outputs in case of
|
||||
* equal values.
|
||||
*
|
||||
*
|
||||
* @return an immutable list of outputs without nulls
|
||||
*/
|
||||
List<IAEItemStack> getOutputs();
|
||||
@@ -101,7 +100,7 @@ public interface ICraftingPatternDetails {
|
||||
* <p>
|
||||
* This can return a copy from the internal structure, so there are no
|
||||
* guarantees about modifications.
|
||||
*
|
||||
*
|
||||
* @return a list of the inputs, will include nulls.
|
||||
*/
|
||||
IAEItemStack[] getSparseInputs();
|
||||
@@ -117,7 +116,7 @@ public interface ICraftingPatternDetails {
|
||||
* <p>
|
||||
* This can return a copy from the internal structure, so there are no
|
||||
* guarantees about modifications.
|
||||
*
|
||||
*
|
||||
* @return a list of the outputs, will include nulls.
|
||||
*/
|
||||
IAEItemStack[] getSparseOutputs();
|
||||
@@ -133,7 +132,6 @@ public interface ICraftingPatternDetails {
|
||||
*
|
||||
* @param craftingInv inventory
|
||||
* @param world crafting world
|
||||
*
|
||||
* @return the crafted ( work bench ) item.
|
||||
*/
|
||||
ItemStack getOutput(CraftingInventory craftingInv, World world);
|
||||
|
||||
@@ -34,7 +34,7 @@ public interface ICraftingProviderHelper {
|
||||
|
||||
/**
|
||||
* Add new Pattern to AE's crafting cache.
|
||||
*
|
||||
* <p>
|
||||
* This will only accept instances created by
|
||||
* {@link ICraftingHelper#decodePattern(net.minecraft.item.ItemStack, net.minecraft.world.World)}
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,6 @@ public interface ICraftingRequester extends IActionHost {
|
||||
*
|
||||
* @param items item
|
||||
* @param mode action mode
|
||||
*
|
||||
* @return unwanted item
|
||||
*/
|
||||
IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack items, Actionable mode);
|
||||
@@ -53,7 +52,7 @@ public interface ICraftingRequester extends IActionHost {
|
||||
/**
|
||||
* called when the job changes from in progress, to either complete, or
|
||||
* canceled.
|
||||
*
|
||||
* <p>
|
||||
* after this call the crafting link is "dead" and should be discarded.
|
||||
*/
|
||||
void jobStateChange(ICraftingLink link);
|
||||
|
||||
@@ -27,13 +27,13 @@ import appeng.api.storage.data.IAEStack;
|
||||
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
* <p>
|
||||
* Will be injected when adding an {@link ICraftingWatcherHost} to a grid.
|
||||
*/
|
||||
public interface ICraftingWatcher {
|
||||
/**
|
||||
* Add a specific {@link IAEStack} to watch.
|
||||
*
|
||||
* <p>
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
* @param stack
|
||||
|
||||
@@ -41,7 +41,6 @@ public interface IAEPowerStorage extends IEnergySource {
|
||||
*
|
||||
* @param amt to be injected amount
|
||||
* @param mode action mode
|
||||
*
|
||||
* @return amount of power which was unable to be stored
|
||||
*/
|
||||
double injectAEPower(double amt, @Nonnull Actionable mode);
|
||||
@@ -75,16 +74,16 @@ public interface IAEPowerStorage extends IEnergySource {
|
||||
|
||||
/**
|
||||
* The priority to use this energy storage.
|
||||
*
|
||||
* <p>
|
||||
* A higher value means it is more likely to be extracted from first, and less
|
||||
* likely to be inserted into first.
|
||||
*
|
||||
* <p>
|
||||
* The value needs to be constant once added to a {@link IGrid}. Should it ever
|
||||
* need to be changed, it has to be removed from the grid, then update the
|
||||
* value, and finally added back to the grid.
|
||||
*
|
||||
* <p>
|
||||
* This should never use {@link Integer#MIN_VALUE} or {@link Integer#MAX_VALUE}.
|
||||
*
|
||||
*
|
||||
* @return the priority for this storage
|
||||
*/
|
||||
default int getPriority() {
|
||||
|
||||
@@ -61,7 +61,7 @@ public interface IEnergyGrid extends IGridCache, IEnergySource, IEnergyGridProvi
|
||||
* condenses this into a single operation that determines the networks "powered
|
||||
* state" if the network is considered off-line, your machines should not
|
||||
* function.
|
||||
*
|
||||
* <p>
|
||||
* {@link MENetworkPowerStatusChange} events are posted when this value changes
|
||||
* if you need to be notified of the change, most machines can simply test the
|
||||
* value when they operate.
|
||||
@@ -73,21 +73,20 @@ public interface IEnergyGrid extends IGridCache, IEnergySource, IEnergyGridProvi
|
||||
/**
|
||||
* AE will accept any power, and store it, to maintain sanity please don't send
|
||||
* more then 10,000 at a time.
|
||||
*
|
||||
* <p>
|
||||
* IMPORTANT: Network power knows no bounds, for less spamy power flow, networks
|
||||
* can store more then their allotted storage, however, it should be kept to a
|
||||
* minimum, to help with this, this method returns the networks current
|
||||
* OVERFLOW, this is not energy you can store some where else, its already
|
||||
* stored in the network, you can extract it if you want, however it it owned by
|
||||
* the network, this is different then IAEEnergyStore
|
||||
*
|
||||
* <p>
|
||||
* Another important note, is that if a network that had overflow is deleted,
|
||||
* its power is gone, this is one of the reasons why keeping overflow to a
|
||||
* minimum is important.
|
||||
*
|
||||
* @param amt power to inject into the network
|
||||
* @param mode should the action be simulated or performed?
|
||||
*
|
||||
* @return the amount of power that the network has OVER the limit.
|
||||
*/
|
||||
@Nonnegative
|
||||
|
||||
@@ -36,15 +36,15 @@ import appeng.api.config.Actionable;
|
||||
public interface IEnergyGridProvider {
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
* <p>
|
||||
* Can return a list of providers behind the current.
|
||||
*
|
||||
* <p>
|
||||
* An example would be something acting as proxy between different
|
||||
* {@link IEnergyGrid}s.
|
||||
*
|
||||
* <p>
|
||||
* This can contain duplicate entries, AE will ensure that each provider is only
|
||||
* visited once.
|
||||
*
|
||||
* <p>
|
||||
* internal use only
|
||||
*/
|
||||
@Nonnull
|
||||
@@ -52,9 +52,9 @@ public interface IEnergyGridProvider {
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
* <p>
|
||||
* Extracts the requested amount from the provider.
|
||||
*
|
||||
* <p>
|
||||
* This should never forward a call to another {@link IEnergyGridProvider},
|
||||
* instead return them via {@link IEnergyGridProvider#providers()}
|
||||
*
|
||||
@@ -65,10 +65,10 @@ public interface IEnergyGridProvider {
|
||||
|
||||
/**
|
||||
* Injects the offered amount into the provider.
|
||||
*
|
||||
* <p>
|
||||
* This should never forward a call to another {@link IEnergyGridProvider},
|
||||
* instead return them via {@link IEnergyGridProvider#providers()}
|
||||
*
|
||||
* <p>
|
||||
* internal use only
|
||||
*
|
||||
* @return the leftover amount
|
||||
@@ -78,13 +78,12 @@ public interface IEnergyGridProvider {
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
* <p>
|
||||
* Returns the current demand of an provider.
|
||||
*
|
||||
* <p>
|
||||
* This should never forward a call to another {@link IEnergyGridProvider},
|
||||
* instead return them via {@link IEnergyGridProvider#providers()}
|
||||
*
|
||||
*
|
||||
* @param d the max amount offered, the demand should never exceed it.
|
||||
* @return the total amount demanded
|
||||
*/
|
||||
@@ -93,31 +92,29 @@ public interface IEnergyGridProvider {
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
* <p>
|
||||
* AE currently uses this to enqueue the next visited provider.
|
||||
*
|
||||
* <p>
|
||||
* There is no guarantee that this works on in a perfect way. It can be limited
|
||||
* to the returns of the past {@link IEnergyGridProvider#providers()}, but not
|
||||
* any future one discovered by visiting further providers.
|
||||
*
|
||||
* <p>
|
||||
* E.g. inject into the the lowest one first or extract from the highest one.
|
||||
*
|
||||
* @return the current stored amount.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Nonnegative
|
||||
double getProviderStoredEnergy();
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
* <p>
|
||||
* AE currently uses this to enqueue the next visited provider.
|
||||
*
|
||||
* <p>
|
||||
* There is no guarantee that this works on in a perfect way. It can be limited
|
||||
* to the returns of the past {@link IEnergyGridProvider#providers()}, but not
|
||||
* any future one discovered by visiting further providers.
|
||||
*
|
||||
* <p>
|
||||
* E.g. inject into the the lowest one first or extract from the highest one.
|
||||
*
|
||||
* @return the maximum amount stored.
|
||||
|
||||
@@ -36,7 +36,6 @@ public interface IEnergySource {
|
||||
*
|
||||
* @param amt extracted power
|
||||
* @param mode should the action be simulated or performed?
|
||||
*
|
||||
* @return returns extracted power.
|
||||
*/
|
||||
@Nonnegative
|
||||
|
||||
@@ -27,13 +27,13 @@ import javax.annotation.Nonnegative;
|
||||
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
* <p>
|
||||
* Will be injected when adding an {@link IEnergyWatcherHost} to a grid.
|
||||
*/
|
||||
public interface IEnergyWatcher {
|
||||
/**
|
||||
* Add a specific threshold to watch.
|
||||
*
|
||||
* <p>
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
* @param amount
|
||||
|
||||
@@ -28,7 +28,7 @@ import appeng.api.networking.IGridNode;
|
||||
/**
|
||||
* Posted by the network when the booting status of the network goes up or down,
|
||||
* the change is reflected via {@link IGridNode}.isActive()
|
||||
*
|
||||
* <p>
|
||||
* Note: Most machines just need to check {@link IGridNode}.isActive()
|
||||
*/
|
||||
public class MENetworkBootingStatusChange extends MENetworkEvent {
|
||||
|
||||
@@ -25,10 +25,10 @@ package appeng.api.networking.events;
|
||||
|
||||
/**
|
||||
* Posted by storage devices to inform AE to refresh its storage structure.
|
||||
*
|
||||
* <p>
|
||||
* This is done in cases such as a storage cell being removed or added to a
|
||||
* drive.
|
||||
*
|
||||
* <p>
|
||||
* you do not need to send this event when your node is added / removed from the
|
||||
* grid.
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,7 @@ import appeng.api.networking.IGridHost;
|
||||
/**
|
||||
* Posted to the {@link IGridHost} when the channels on the node connections are
|
||||
* altered.
|
||||
*
|
||||
* <p>
|
||||
* Never posted IGridCaches.
|
||||
*/
|
||||
public class MENetworkChannelsChanged extends MENetworkEvent {
|
||||
|
||||
@@ -27,7 +27,7 @@ import appeng.api.networking.IGrid;
|
||||
|
||||
/**
|
||||
* Part of AE's Event Bus.
|
||||
*
|
||||
* <p>
|
||||
* Posted via {@link IGrid}.postEvent or {@link IGrid}.postEventTo
|
||||
*/
|
||||
public class MENetworkEvent {
|
||||
|
||||
@@ -29,7 +29,7 @@ import appeng.api.networking.IGridNode;
|
||||
* Implementers of a IGridBlock must post this event when your getIdlePowerUsage
|
||||
* starts returning a new value, if you do not post this event the network will
|
||||
* not change the idle draw.
|
||||
*
|
||||
* <p>
|
||||
* you do not need to send this event when your node is added / removed from the
|
||||
* grid.
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,7 @@ import appeng.api.networking.energy.IEnergyGrid;
|
||||
* Posted by the network when the power status of the network goes up or down,
|
||||
* the change is reflected via the {@link IEnergyGrid}.isNetworkPowered() or via
|
||||
* {@link IGridNode}.isActive()
|
||||
*
|
||||
* <p>
|
||||
* Note: Most machines just need to check {@link IGridNode}.isActive()
|
||||
*/
|
||||
public class MENetworkPowerStatusChange extends MENetworkEvent {
|
||||
|
||||
@@ -28,10 +28,10 @@ import appeng.api.networking.energy.IAEPowerStorage;
|
||||
/**
|
||||
* informs the network, that a {@link IAEPowerStorage} block that had either
|
||||
* run, out of power, or was full, is no longer in that state.
|
||||
*
|
||||
* <p>
|
||||
* failure to post this event when your {@link IAEPowerStorage} changes state
|
||||
* will result in your block not charging, or not-discharging.
|
||||
*
|
||||
* <p>
|
||||
* you do not need to send this event when your node is added / removed from the
|
||||
* grid.
|
||||
*/
|
||||
|
||||
@@ -29,9 +29,9 @@ import appeng.api.storage.IStorageChannel;
|
||||
/**
|
||||
* posted by the network when the networks Storage Changes, you can use the
|
||||
* currentItems list to check levels, and update status.
|
||||
*
|
||||
* <p>
|
||||
* this is the least useful method of getting info about changes in the network.
|
||||
*
|
||||
* <p>
|
||||
* Do not modify the list or its contents in anyway.
|
||||
*/
|
||||
public class MENetworkStorageEvent extends MENetworkEvent {
|
||||
|
||||
@@ -31,18 +31,17 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
|
||||
/**
|
||||
* The source of any action.
|
||||
*
|
||||
* <p>
|
||||
* This can either be a {@link PlayerEntity} or an {@link IActionHost}.
|
||||
*
|
||||
* <p>
|
||||
* In most cases this is used for security checks, but can be used to validate
|
||||
* the source itself.
|
||||
*
|
||||
*/
|
||||
public interface IActionSource {
|
||||
|
||||
/**
|
||||
* If present, AE will consider the player being the source for the action.
|
||||
*
|
||||
* <p>
|
||||
* This will take precedence over {@link IActionSource#machine()} in any case.
|
||||
*
|
||||
* @return An optional player issuing the action.
|
||||
@@ -52,10 +51,10 @@ public interface IActionSource {
|
||||
|
||||
/**
|
||||
* If present, it indicates the {@link IActionHost} of the source.
|
||||
*
|
||||
* <p>
|
||||
* Should {@link IActionSource#player()} be absent, it will consider a machine
|
||||
* as source.
|
||||
*
|
||||
* <p>
|
||||
* It is recommended to include the machine even when a player is present.
|
||||
*
|
||||
* @return An optional machine issuing the action or acting as proxy for a
|
||||
@@ -66,9 +65,9 @@ public interface IActionSource {
|
||||
|
||||
/**
|
||||
* An {@link IActionSource} can have multiple optional contexts.
|
||||
*
|
||||
* <p>
|
||||
* It is strongly recommended to limit the uses for absolutely necessary cases.
|
||||
*
|
||||
* <p>
|
||||
* Currently there are no public contexts made available by AE. An example would
|
||||
* be the context interfaces use internally to avoid looping items between each
|
||||
* other.
|
||||
|
||||
@@ -43,7 +43,6 @@ public interface ISecurityGrid extends IGridCache {
|
||||
*
|
||||
* @param player to be checked player
|
||||
* @param perm checked permissions
|
||||
*
|
||||
* @return true if the player has permissions.
|
||||
*/
|
||||
boolean hasPermission(@Nonnull PlayerEntity player, @Nonnull SecurityPermissions perm);
|
||||
@@ -53,7 +52,6 @@ public interface ISecurityGrid extends IGridCache {
|
||||
*
|
||||
* @param playerID id of player
|
||||
* @param perm checked permissions
|
||||
*
|
||||
* @return true if the player has permissions.
|
||||
*/
|
||||
boolean hasPermission(@Nonnegative int playerID, @Nonnull SecurityPermissions perm);
|
||||
|
||||
@@ -27,13 +27,13 @@ import appeng.api.storage.data.IAEStack;
|
||||
|
||||
/**
|
||||
* DO NOT IMPLEMENT.
|
||||
*
|
||||
* <p>
|
||||
* Will be injected when adding an {@link IStackWatcherHost} to a grid.
|
||||
*/
|
||||
public interface IStackWatcher {
|
||||
/**
|
||||
* Add a specific {@link IAEStack} to watch.
|
||||
*
|
||||
* <p>
|
||||
* Supports multiple values, duplicate ones will not be added.
|
||||
*
|
||||
* @param stack
|
||||
|
||||
@@ -42,7 +42,7 @@ public interface IStorageGrid extends IGridCache, IStorageMonitorable {
|
||||
* outside of the standard Network operations, Examples, ME Chest inputs from
|
||||
* the world, or a Storage Bus detecting modifications made to the chest by an
|
||||
* outside force.
|
||||
*
|
||||
* <p>
|
||||
* Expects the input to have either a negative or a positive stack size to
|
||||
* correspond to the injection, or extraction operation.
|
||||
*
|
||||
@@ -52,7 +52,7 @@ public interface IStorageGrid extends IGridCache, IStorageMonitorable {
|
||||
|
||||
/**
|
||||
* Used to add a cell provider to the storage system
|
||||
*
|
||||
* <p>
|
||||
* THIS IT NOT FOR USE {@link IGridHost} THAT PROVIDE {@link ICellContainer} -
|
||||
* those are automatically handled by the storage system.
|
||||
*
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface IGridTickable {
|
||||
/**
|
||||
* Return a valid TickingRequest to tell AE a guide for which type of
|
||||
* responsiveness your device wants.
|
||||
*
|
||||
* <p>
|
||||
* This will be called for your tile any time your tile changes grids, this can
|
||||
* happen at any time, so if your using the sleep feature you may wish to
|
||||
* preserve your sleep, in the result of this method. or you can simply reset
|
||||
@@ -61,15 +61,14 @@ public interface IGridTickable {
|
||||
* AE lets you adjust your tick rate based on the results of your tick, if your
|
||||
* block as accomplished work you may wish to increase the ticking speed, if
|
||||
* your block is idle you may wish to slow it down.
|
||||
*
|
||||
* <p>
|
||||
* Its up to you.
|
||||
*
|
||||
* <p>
|
||||
* Note: this is never called if you return null from getTickingRequest.
|
||||
*
|
||||
* @param ticksSinceLastCall the number of world ticks that were skipped since
|
||||
* your last tick, you can use this to adjust speed of
|
||||
* processing or adjust your tick rate.
|
||||
*
|
||||
* @return tick rate adjustment.
|
||||
*/
|
||||
@Nonnull
|
||||
|
||||
@@ -36,7 +36,7 @@ public interface ITickManager extends IGridCache {
|
||||
/**
|
||||
* immediately sets the node to tick, only valid if your node is marked as
|
||||
* "Alertable" in its TickingRequest
|
||||
*
|
||||
* <p>
|
||||
* Sleeping Devices Still Alertable, when your tile is alerted its new status is
|
||||
* determined by the result of its tick.
|
||||
*
|
||||
@@ -48,7 +48,6 @@ public interface ITickManager extends IGridCache {
|
||||
* disables ticking for your device.
|
||||
*
|
||||
* @param node gridnode
|
||||
*
|
||||
* @return if the call was successful.
|
||||
*/
|
||||
boolean sleepDevice(@Nonnull IGridNode node);
|
||||
@@ -57,7 +56,6 @@ public interface ITickManager extends IGridCache {
|
||||
* enables ticking for your device, undoes a sleepDevice call.
|
||||
*
|
||||
* @param node gridnode
|
||||
*
|
||||
* @return if the call was successful.
|
||||
*/
|
||||
boolean wakeDevice(@Nonnull IGridNode node);
|
||||
|
||||
@@ -30,9 +30,9 @@ public class TickingRequest {
|
||||
|
||||
/**
|
||||
* the minimum number of ticks that must pass between ticks.
|
||||
*
|
||||
* <p>
|
||||
* Valid Values are : 1+
|
||||
*
|
||||
* <p>
|
||||
* Suggested is 5-20
|
||||
*/
|
||||
public final int minTickRate;
|
||||
@@ -40,9 +40,9 @@ public class TickingRequest {
|
||||
/**
|
||||
* the maximum number of ticks that can pass between ticks, if this value is
|
||||
* exceeded the tile must tick.
|
||||
*
|
||||
* <p>
|
||||
* Valid Values are 1+
|
||||
*
|
||||
* <p>
|
||||
* Suggested is 20-40
|
||||
*/
|
||||
public final int maxTickRate;
|
||||
|
||||
@@ -32,7 +32,6 @@ public interface IAlphaPassItem {
|
||||
* rendering pipe line.
|
||||
*
|
||||
* @param is item
|
||||
*
|
||||
* @return true to enable a second pass for your parts in the bus rendering pipe
|
||||
* line.
|
||||
*/
|
||||
|
||||
@@ -11,15 +11,10 @@ import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.json.ModelOverrideList;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.BlockRenderView;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
/**
|
||||
* This interface can be implemented by baked models returned by
|
||||
* {@link IPart#getStaticModels()} to indicate that they would like to use the
|
||||
|
||||
@@ -32,7 +32,7 @@ import appeng.api.util.AEPartLocation;
|
||||
|
||||
/**
|
||||
* Used Internally.
|
||||
*
|
||||
* <p>
|
||||
* not intended for implementation.
|
||||
*/
|
||||
public interface IFacadeContainer {
|
||||
@@ -70,9 +70,7 @@ public interface IFacadeContainer {
|
||||
* read from stream
|
||||
*
|
||||
* @param data to be read data
|
||||
*
|
||||
* @return true if it was readable
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
boolean readFromStream(PacketByteBuf data) throws IOException;
|
||||
@@ -88,7 +86,6 @@ public interface IFacadeContainer {
|
||||
* write to stream
|
||||
*
|
||||
* @param data to be written data
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
void writeToStream(PacketByteBuf data) throws IOException;
|
||||
|
||||
@@ -31,7 +31,7 @@ import appeng.api.util.AEPartLocation;
|
||||
|
||||
/**
|
||||
* Used Internally.
|
||||
*
|
||||
* <p>
|
||||
* not intended for implementation.
|
||||
*/
|
||||
public interface IFacadePart {
|
||||
|
||||
@@ -61,7 +61,7 @@ public interface IPart extends ICustomCableConnection {
|
||||
* get an ItemStack that represents the bus, should contain the settings for
|
||||
* whatever, can also be used in conjunction with removePart to take a part off
|
||||
* and drop it or something.
|
||||
*
|
||||
* <p>
|
||||
* This is used to drop the bus, and to save the bus, when saving the bus,
|
||||
* wrenched is false, and writeToNBT will be called to save important details
|
||||
* about the part, if the part is wrenched include in your NBT Data any settings
|
||||
@@ -69,7 +69,6 @@ public interface IPart extends ICustomCableConnection {
|
||||
* constructing your part.
|
||||
*
|
||||
* @param type , what kind of ItemStack to return?
|
||||
*
|
||||
* @return item of part
|
||||
*/
|
||||
ItemStack getItemStack(PartItemStack type);
|
||||
@@ -127,7 +126,6 @@ public interface IPart extends ICustomCableConnection {
|
||||
* does this part act like a ladder?
|
||||
*
|
||||
* @param entity climbing entity
|
||||
*
|
||||
* @return true if entity can climb
|
||||
*/
|
||||
boolean isLadder(LivingEntity entity);
|
||||
@@ -151,7 +149,6 @@ public interface IPart extends ICustomCableConnection {
|
||||
* write data to bus packet.
|
||||
*
|
||||
* @param data to be written data
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
void writeToStream(PacketByteBuf data) throws IOException;
|
||||
@@ -160,9 +157,7 @@ public interface IPart extends ICustomCableConnection {
|
||||
* read data from bus packet.
|
||||
*
|
||||
* @param data to be read data
|
||||
*
|
||||
* @return true will re-draw the part.
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
boolean readFromStream(PacketByteBuf data) throws IOException;
|
||||
@@ -170,7 +165,7 @@ public interface IPart extends ICustomCableConnection {
|
||||
/**
|
||||
* get the Grid Node for the Bus, be sure your IGridBlock is NOT
|
||||
* isWorldAccessible, if it is your going to cause crashes.
|
||||
*
|
||||
* <p>
|
||||
* or null if you don't have a grid node.
|
||||
*
|
||||
* @return grid node
|
||||
@@ -216,7 +211,6 @@ public interface IPart extends ICustomCableConnection {
|
||||
* @param player right clicking player
|
||||
* @param hand hand used
|
||||
* @param pos position of block
|
||||
*
|
||||
* @return if your activate method performed something.
|
||||
*/
|
||||
boolean onActivate(PlayerEntity player, Hand hand, Vec3d pos);
|
||||
@@ -227,7 +221,6 @@ public interface IPart extends ICustomCableConnection {
|
||||
* @param player shift right clicking player
|
||||
* @param hand hand used
|
||||
* @param pos position of block
|
||||
*
|
||||
* @return if your activate method performed something, you should use false
|
||||
* unless you really need it.
|
||||
*/
|
||||
@@ -239,7 +232,6 @@ public interface IPart extends ICustomCableConnection {
|
||||
* @param player left clicking player
|
||||
* @param hand hand used
|
||||
* @param pos position of block
|
||||
*
|
||||
* @return if your activate method performed something, you should use false
|
||||
* unless you really need it.
|
||||
*/
|
||||
@@ -254,7 +246,6 @@ public interface IPart extends ICustomCableConnection {
|
||||
* @param player shift-left clicking player
|
||||
* @param hand hand used
|
||||
* @param pos position of block
|
||||
*
|
||||
* @return if your activate method performed something, you should use false
|
||||
* unless you really need it.
|
||||
*/
|
||||
@@ -299,12 +290,11 @@ public interface IPart extends ICustomCableConnection {
|
||||
|
||||
/**
|
||||
* Used to determine which parts can be placed on what cables.
|
||||
*
|
||||
* <p>
|
||||
* Dense cables are not allowed for functional (getGridNode returns a node)
|
||||
* parts. Doing so will result in crashes.
|
||||
*
|
||||
* @param what placed part
|
||||
*
|
||||
* @return true if the part can be placed on this support.
|
||||
*/
|
||||
boolean canBePlacedOn(BusSupport what);
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface IPartCollisionHelper {
|
||||
|
||||
/**
|
||||
* add a collision box, expects 0.0 - 16.0 block coords.
|
||||
*
|
||||
* <p>
|
||||
* No complaints about the size, I like using pixels :P
|
||||
*
|
||||
* @param minX minimal x collision
|
||||
|
||||
@@ -40,7 +40,6 @@ public interface IPartHelper {
|
||||
* @param side side which the part should be on
|
||||
* @param player player placing part
|
||||
* @param world part in world
|
||||
*
|
||||
* @return true if placing was successful
|
||||
*/
|
||||
// TODO, this should probably take ItemStack + ItemUseContext
|
||||
|
||||
@@ -38,7 +38,7 @@ import appeng.api.util.DimensionalCoord;
|
||||
|
||||
/**
|
||||
* Implemented on AE's TileEntity.
|
||||
*
|
||||
* <p>
|
||||
* Do Not Implement
|
||||
*/
|
||||
public interface IPartHost extends ICustomCableConnection {
|
||||
@@ -54,7 +54,6 @@ public interface IPartHost extends ICustomCableConnection {
|
||||
*
|
||||
* @param part to be added part
|
||||
* @param side part placed onto side
|
||||
*
|
||||
* @return returns false if the part cannot be added.
|
||||
*/
|
||||
boolean canAddPart(ItemStack part, AEPartLocation side);
|
||||
@@ -66,7 +65,6 @@ public interface IPartHost extends ICustomCableConnection {
|
||||
* @param is new part
|
||||
* @param side onto side
|
||||
* @param owner with owning player
|
||||
*
|
||||
* @return null if the item failed to add, the side it was placed on other wise
|
||||
* ( may different for cables, {@link AEPartLocation}.UNKNOWN )
|
||||
*/
|
||||
@@ -76,7 +74,6 @@ public interface IPartHost extends ICustomCableConnection {
|
||||
* Get part by side ( center is {@link AEPartLocation}.UNKNOWN )
|
||||
*
|
||||
* @param side side of part
|
||||
*
|
||||
* @return the part located on the specified side, or null if there is no part.
|
||||
*/
|
||||
IPart getPart(AEPartLocation side);
|
||||
@@ -86,7 +83,6 @@ public interface IPartHost extends ICustomCableConnection {
|
||||
* other varient of getPart.
|
||||
*
|
||||
* @param side side of part
|
||||
*
|
||||
* @return the part located on the specified side, or null if there is no part.
|
||||
*/
|
||||
IPart getPart(Direction side);
|
||||
@@ -95,7 +91,7 @@ public interface IPartHost extends ICustomCableConnection {
|
||||
* removes the part on the side, this doesn't drop it or anything, if you don't
|
||||
* do something with it, its just "gone" and its never coming back; think about
|
||||
* it.
|
||||
*
|
||||
* <p>
|
||||
* if you want to drop the part you must request it prior to removing it.
|
||||
*
|
||||
* @param side side of part
|
||||
@@ -143,7 +139,6 @@ public interface IPartHost extends ICustomCableConnection {
|
||||
* finds the part located at the position ( pos must be relative, not global )
|
||||
*
|
||||
* @param pos part position
|
||||
*
|
||||
* @return a new SelectedPart, this is never null.
|
||||
*/
|
||||
SelectedPart selectPart(Vec3d pos);
|
||||
@@ -162,7 +157,6 @@ public interface IPartHost extends ICustomCableConnection {
|
||||
* get the redstone state of host on this side, this value is cached internally.
|
||||
*
|
||||
* @param side side of part
|
||||
*
|
||||
* @return true of the part host is receiving redstone from an external source.
|
||||
*/
|
||||
boolean hasRedstone(AEPartLocation side);
|
||||
|
||||
@@ -30,10 +30,10 @@ import net.minecraft.item.ItemStack;
|
||||
/**
|
||||
* This is a pretty basic requirement, once you implement the interface, and
|
||||
* createPartFromItemStack
|
||||
*
|
||||
* <p>
|
||||
* you must register your bus with the Bus renderer, using
|
||||
* AEApi.INSTANCE().partHelper().setItemBusRenderer( this );
|
||||
*
|
||||
* <p>
|
||||
* then simply add this, and call AE's Bus Placement Code.
|
||||
*
|
||||
* <pre>
|
||||
@@ -41,9 +41,9 @@ import net.minecraft.item.ItemStack;
|
||||
*
|
||||
* {@literal @}Override
|
||||
* public default ActionResult onItemUse(ItemStack is, PlayerEntity player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
* {
|
||||
* return Api.INSTANCE.partHelper().placeBus( is, pos, side, player, hand, world );
|
||||
* }
|
||||
* {
|
||||
* return Api.INSTANCE.partHelper().placeBus( is, pos, side, player, hand, world );
|
||||
* }
|
||||
* </code>
|
||||
* </pre>
|
||||
*/
|
||||
@@ -53,7 +53,6 @@ public interface IPartItem<P extends IPart> {
|
||||
* create a new part INSTANCE
|
||||
*
|
||||
* @param is ItemStack of this item, may have additional properties.
|
||||
*
|
||||
* @return part from item
|
||||
*/
|
||||
P createPart(ItemStack is);
|
||||
|
||||
@@ -39,7 +39,7 @@ public interface IPartModel {
|
||||
/**
|
||||
* A solid {@link IPartModel} indicates that the rendering requires a cable
|
||||
* connection, which will also result in creating an intersection for the cable.
|
||||
*
|
||||
* <p>
|
||||
* This should be true for pretty much all parts.
|
||||
*
|
||||
* @return true for a solid part.
|
||||
|
||||
@@ -32,9 +32,9 @@ public interface IPartModels {
|
||||
/**
|
||||
* Allows registration of part models that can then be used in
|
||||
* {@link IPart#getStaticModels()}.
|
||||
*
|
||||
* <p>
|
||||
* Models can be registered multiple times without causing issues.
|
||||
*
|
||||
* <p>
|
||||
* This method must be called during the pre-init phase (as part of your
|
||||
* plugin's constructor).
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,7 @@ import appeng.api.util.AEPartLocation;
|
||||
* All Layers must extends this, this get part implementation is provided to
|
||||
* interface with the parts, however a real implementation will be used at
|
||||
* runtime.
|
||||
*
|
||||
* <p>
|
||||
* TODO: Consider removing and replacing with capabilities.
|
||||
*/
|
||||
public abstract class LayerBase extends BlockEntity // implements IPartHost
|
||||
@@ -48,12 +48,11 @@ public abstract class LayerBase extends BlockEntity // implements IPartHost
|
||||
|
||||
/**
|
||||
* Grants access for the layer to the parts of the host.
|
||||
*
|
||||
* <p>
|
||||
* This Method looks silly, that is because its not used at runtime, a real
|
||||
* implementation will be used instead.
|
||||
*
|
||||
* @param side side of part
|
||||
*
|
||||
* @return the part for the requested side.
|
||||
*/
|
||||
public IPart getPart(final AEPartLocation side) {
|
||||
@@ -62,12 +61,11 @@ public abstract class LayerBase extends BlockEntity // implements IPartHost
|
||||
|
||||
/**
|
||||
* Grants access for the layer to the parts of the host.
|
||||
*
|
||||
* <p>
|
||||
* This Method looks silly, that is because its not used at runtime, a real
|
||||
* implementation will be used instead.
|
||||
*
|
||||
* @param side side of part
|
||||
*
|
||||
* @return the part for the requested side.
|
||||
*/
|
||||
public IPart getPart(final Direction side) {
|
||||
|
||||
@@ -27,7 +27,6 @@ import appeng.api.util.AEPartLocation;
|
||||
|
||||
/**
|
||||
* Reports a selected part from the IPartHost
|
||||
*
|
||||
*/
|
||||
public class SelectedPart {
|
||||
|
||||
|
||||
@@ -39,14 +39,14 @@ import appeng.api.storage.data.IAEStack;
|
||||
* Storage Cell Registry, used for specially implemented cells, if you just want
|
||||
* to make a item act like a cell, or new cell with different bytes, then you
|
||||
* should probably consider IStorageCell instead its considerably simpler.
|
||||
*
|
||||
* <p>
|
||||
* Do not Implement, obtained via {@link IAppEngApi}.getCellRegistry()
|
||||
*/
|
||||
public interface ICellRegistry {
|
||||
|
||||
/**
|
||||
* Register a new handler.
|
||||
*
|
||||
* <p>
|
||||
* Never be call before
|
||||
* {@link net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent} was
|
||||
* handled by AE2. Will throw an exception otherwise.
|
||||
@@ -66,7 +66,6 @@ public interface ICellRegistry {
|
||||
* return true, if you can get a InventoryHandler for the item passed.
|
||||
*
|
||||
* @param is to be checked item
|
||||
*
|
||||
* @return true if the provided item, can be handled by a handler in AE, ( AE
|
||||
* May choose to skip this and just get the handler instead. )
|
||||
*/
|
||||
@@ -76,7 +75,6 @@ public interface ICellRegistry {
|
||||
* get the handler, for the requested item.
|
||||
*
|
||||
* @param is to be checked item
|
||||
*
|
||||
* @return the handler registered for this item type.
|
||||
*/
|
||||
@Nullable
|
||||
@@ -100,7 +98,6 @@ public interface ICellRegistry {
|
||||
* @param host can be null. If provided, the host is responsible for persisting
|
||||
* the cell content.
|
||||
* @param chan the storage channel to request the handler for.
|
||||
*
|
||||
* @return new ICellInventoryHandler, or null if there isn't one.
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -31,12 +31,12 @@ import appeng.api.storage.data.IItemList;
|
||||
/**
|
||||
* AE's Equivalent to IInventory, used to reading contents, and manipulating
|
||||
* contents of ME Inventories.
|
||||
*
|
||||
* <p>
|
||||
* Implementations should COMPLETELY ignore stack size limits from an external
|
||||
* view point, Meaning that you can inject Integer.MAX_VALUE items and it should
|
||||
* work as defined, or be able to extract Integer.MAX_VALUE and have it work as
|
||||
* defined, Translations to MC's max stack size are external to the AE API.
|
||||
*
|
||||
* <p>
|
||||
* If you want to request a stack of an item, you should should determine that
|
||||
* prior to requesting the stack from the inventory.
|
||||
*/
|
||||
@@ -48,7 +48,6 @@ public interface IMEInventory<T extends IAEStack<T>> {
|
||||
* @param input item to add.
|
||||
* @param type action type
|
||||
* @param src action source
|
||||
*
|
||||
* @return returns the number of items not added.
|
||||
*/
|
||||
T injectItems(T input, Actionable type, IActionSource src);
|
||||
@@ -58,7 +57,6 @@ public interface IMEInventory<T extends IAEStack<T>> {
|
||||
*
|
||||
* @param request item to request ( with stack size. )
|
||||
* @param mode simulate, or perform action?
|
||||
*
|
||||
* @return returns the number of items extracted, null
|
||||
*/
|
||||
T extractItems(T request, Actionable mode, IActionSource src);
|
||||
@@ -67,7 +65,6 @@ public interface IMEInventory<T extends IAEStack<T>> {
|
||||
* request a full report of all available items, storage.
|
||||
*
|
||||
* @param out the IItemList the results will be written too
|
||||
*
|
||||
* @return returns same list that was passed in, is passed out
|
||||
*/
|
||||
IItemList<T> getAvailableItems(IItemList<T> out);
|
||||
|
||||
@@ -49,7 +49,6 @@ public interface IMEInventoryHandler<T extends IAEStack<T>> extends IMEInventory
|
||||
* inventories.
|
||||
*
|
||||
* @param input - item that might be added
|
||||
*
|
||||
* @return if its prioritized
|
||||
*/
|
||||
boolean isPrioritized(T input);
|
||||
@@ -58,7 +57,6 @@ public interface IMEInventoryHandler<T extends IAEStack<T>> extends IMEInventory
|
||||
* determine if an item can be accepted and stored.
|
||||
*
|
||||
* @param input - item that might be added
|
||||
*
|
||||
* @return if the item can be added
|
||||
*/
|
||||
boolean canAccept(T input);
|
||||
@@ -87,7 +85,6 @@ public interface IMEInventoryHandler<T extends IAEStack<T>> extends IMEInventory
|
||||
* this allows you to do that.
|
||||
*
|
||||
* @param i - pass number ( 1 or 2 )
|
||||
*
|
||||
* @return true, if this inventory is valid for this pass.
|
||||
*/
|
||||
boolean validForPass(int i);
|
||||
|
||||
@@ -33,7 +33,6 @@ public interface IMEMonitorHandlerReceiver<T extends IAEStack<T>> {
|
||||
* return true if this object should remain as a listener.
|
||||
*
|
||||
* @param verificationToken to be checked object
|
||||
*
|
||||
* @return true if object should remain as a listener
|
||||
*/
|
||||
boolean isValid(Object verificationToken);
|
||||
|
||||
@@ -39,7 +39,7 @@ public interface IStorageChannel<T extends IAEStack<T>> {
|
||||
|
||||
/**
|
||||
* Can be used as factor for transferring stacks of a channel.
|
||||
*
|
||||
* <p>
|
||||
* E.g. used by IO Ports to transfer 1000 mB, not 1 mB to match the item channel
|
||||
* transferring a full bucket per operation.
|
||||
*
|
||||
@@ -70,7 +70,7 @@ public interface IStorageChannel<T extends IAEStack<T>> {
|
||||
|
||||
/**
|
||||
* Create a new {@link IAEStack} subtype of the specific object.
|
||||
*
|
||||
* <p>
|
||||
* The parameter is unbound to allow a slightly more flexible approach. But the
|
||||
* general intention is about converting an {@link ItemStack} or
|
||||
* {@link FluidStack} into the corresponding {@link IAEStack}. Another valid
|
||||
|
||||
@@ -44,19 +44,19 @@ public interface IStorageHelper {
|
||||
|
||||
/**
|
||||
* Register a new storage channel.
|
||||
*
|
||||
* <p>
|
||||
* AE2 already provides native channels for {@link IAEItemStack} and
|
||||
* {@link IAEFluidStack}.
|
||||
*
|
||||
* <p>
|
||||
* Each {@link IAEStack} subtype can only have a single factory instance.
|
||||
* Overwriting is not intended. Each subtype should be a direct one, this might
|
||||
* be enforced at any time.
|
||||
*
|
||||
* <p>
|
||||
* Channel class and factory instance can be used interchangeable as identifier.
|
||||
* In most cases the factory instance is used as key as having direct access the
|
||||
* methods is more beneficial compared to being forced to query the registry
|
||||
* each time.
|
||||
*
|
||||
* <p>
|
||||
* Caching the factory instance in a field or local variable is perfectly for
|
||||
* performance reasons. But do not use any AE2 internal field as they can change
|
||||
* randomly between releases.
|
||||
@@ -71,19 +71,19 @@ public interface IStorageHelper {
|
||||
|
||||
/**
|
||||
* Fetch the factory instance for a specific storage channel.
|
||||
*
|
||||
* <p>
|
||||
* Channel must be a direct subtype of {@link IStorageChannel}.
|
||||
*
|
||||
* @throws NullPointerException when fetching an unregistered channel.
|
||||
* @param channel The channel type
|
||||
* @return the factory instance
|
||||
* @throws NullPointerException when fetching an unregistered channel.
|
||||
*/
|
||||
@Nonnull
|
||||
<T extends IAEStack<T>, C extends IStorageChannel<T>> C getStorageChannel(@Nonnull Class<C> channel);
|
||||
|
||||
/**
|
||||
* An unmodifiable collection of all registered factory instance.
|
||||
*
|
||||
* <p>
|
||||
* This is mainly used as helper to let storage grids construct their internal
|
||||
* storage for each type.
|
||||
*/
|
||||
@@ -94,7 +94,6 @@ public interface IStorageHelper {
|
||||
* load a crafting link from nbt data.
|
||||
*
|
||||
* @param data to be loaded data
|
||||
*
|
||||
* @return crafting link
|
||||
*/
|
||||
ICraftingLink loadCraftingLink(CompoundTag data, ICraftingRequester req);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package appeng.api.storage;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package appeng.api.storage.cells;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
||||
@@ -39,7 +39,6 @@ public interface ICellHandler {
|
||||
* choose to skip this method, and just request a handler )
|
||||
*
|
||||
* @param is to be checked item
|
||||
*
|
||||
* @return return true, if getCellHandler will not return null.
|
||||
*/
|
||||
boolean isCell(ItemStack is);
|
||||
@@ -53,7 +52,6 @@ public interface ICellHandler {
|
||||
* null. If provided, the host is responsible for persisting the
|
||||
* cell content.
|
||||
* @param channel the storage channel requested.
|
||||
*
|
||||
* @return a new IMEHandler for the provided item
|
||||
*/
|
||||
<T extends IAEStack<T>> ICellInventoryHandler<T> getCellInventory(ItemStack is, ISaveProvider host,
|
||||
@@ -61,17 +59,16 @@ public interface ICellHandler {
|
||||
|
||||
/**
|
||||
* 0 - cell is missing.
|
||||
*
|
||||
* <p>
|
||||
* 1 - green, ( usually means available room for types or items. )
|
||||
*
|
||||
* <p>
|
||||
* 2 - orange, ( usually means available room for items, but not types. )
|
||||
*
|
||||
* <p>
|
||||
* 3 - red, ( usually means the cell is 100% full )
|
||||
*
|
||||
* @param is the cell item. ( use the handler for any details you can )
|
||||
* @param handler the handler for the cell is provides for reference, you can
|
||||
* cast this to your handler.
|
||||
*
|
||||
* @return get the status of the cell based on its contents.
|
||||
*/
|
||||
default <T extends IAEStack<T>> CellState getStatusForCell(ItemStack is, ICellInventoryHandler<T> handler) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public interface ICellProvider {
|
||||
/**
|
||||
* Inventory of the tile for use with ME, should always return an valid list,
|
||||
* never NULL.
|
||||
*
|
||||
* <p>
|
||||
* You must return the correct Handler for the correct channel, if your handler
|
||||
* returns a IAEItemStack handler, for a Fluid Channel stuffs going to explode,
|
||||
* same with the reverse.
|
||||
@@ -49,7 +49,7 @@ public interface ICellProvider {
|
||||
|
||||
/**
|
||||
* the storage's priority.
|
||||
*
|
||||
* <p>
|
||||
* Positive and negative are supported
|
||||
*/
|
||||
int getPriority();
|
||||
|
||||
@@ -36,7 +36,6 @@ public interface ICellWorkbenchItem {
|
||||
* inserted into the work bench.
|
||||
*
|
||||
* @param is item
|
||||
*
|
||||
* @return true if the item should be editable in the cell workbench.
|
||||
*/
|
||||
boolean isEditable(ItemStack is);
|
||||
@@ -45,16 +44,16 @@ public interface ICellWorkbenchItem {
|
||||
* used to edit the upgrade slots on your cell, should have a capacity of 0-24,
|
||||
* you are also responsible for implementing the valid checks, and any
|
||||
* storage/usage of them.
|
||||
*
|
||||
* <p>
|
||||
* onInventoryChange will be called when saving is needed.
|
||||
*/
|
||||
FixedItemInv getUpgradesInventory(ItemStack is);
|
||||
|
||||
/**
|
||||
* Used to extract, or mirror the contents of the work bench onto the cell.
|
||||
*
|
||||
* <p>
|
||||
* - This should have exactly 63 slots, any more, or less might cause issues.
|
||||
*
|
||||
* <p>
|
||||
* onInventoryChange will be called when saving is needed.
|
||||
*/
|
||||
FixedItemInv getConfigInventory(ItemStack is);
|
||||
|
||||
@@ -28,7 +28,6 @@ import javax.annotation.Nullable;
|
||||
/**
|
||||
* Tells the cell provider that changes have been made an the cell must be
|
||||
* persisted
|
||||
*
|
||||
*/
|
||||
public interface ISaveProvider {
|
||||
/**
|
||||
|
||||
@@ -30,12 +30,12 @@ import alexiil.mc.lib.attributes.fluid.volume.FluidVolume;
|
||||
/**
|
||||
* An alternate version of FluidStack for AE to keep tabs on things easier, and
|
||||
* to support larger storage. stackSizes of getFluidStack will be capped.
|
||||
*
|
||||
* <p>
|
||||
* You may hold on to these if you want, just make sure you let go of them when
|
||||
* your not using them.
|
||||
*
|
||||
* <p>
|
||||
* Don't Implement.
|
||||
*
|
||||
* <p>
|
||||
* Construct with Api.INSTANCE.storage().getStorageChannel(
|
||||
* IFluidStorageChannel.class).createStack( FluidStack )
|
||||
*/
|
||||
|
||||
@@ -29,12 +29,12 @@ import net.minecraft.item.ItemStack;
|
||||
/**
|
||||
* An alternate version of ItemStack for AE to keep tabs on things easier, and
|
||||
* to support larger storage. stackSizes of getItemStack will be capped.
|
||||
*
|
||||
* <p>
|
||||
* You may hold on to these if you want, just make sure you let go of them when
|
||||
* your not using them.
|
||||
*
|
||||
* <p>
|
||||
* Don't Implement.
|
||||
*
|
||||
* <p>
|
||||
* Construct with Api.INSTANCE.storage().getStorageChannel(
|
||||
* IItemStorageChannel.class).createStack( ItemStack )
|
||||
*/
|
||||
@@ -86,7 +86,6 @@ public interface IAEItemStack extends IAEStack<IAEItemStack> {
|
||||
* compare the item/damage/nbt of the stack.
|
||||
*
|
||||
* @param otherStack to be compared item
|
||||
*
|
||||
* @return true if it is the same type (same item, damage, nbt)
|
||||
*/
|
||||
boolean isSameType(IAEItemStack otherStack);
|
||||
@@ -95,7 +94,6 @@ public interface IAEItemStack extends IAEStack<IAEItemStack> {
|
||||
* compare the item/damage/nbt of the stack.
|
||||
*
|
||||
* @param stored to be compared item
|
||||
*
|
||||
* @return true if it is the same type (same item, damage, nbt)
|
||||
*/
|
||||
boolean isSameType(ItemStack stored);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user