Code Cleanup
This commit is contained in:
@@ -33,16 +33,16 @@ 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.
|
||||
*
|
||||
*
|
||||
* The registry is used in favor of an additional method for
|
||||
* {@link IAEItemPowerStorage} with a fixed value per item. This allows more
|
||||
* flexibility for other charger like machines to choose their own values when
|
||||
* needed.
|
||||
*
|
||||
*
|
||||
* There is no guarantee that this is charged per tick, it only represents the
|
||||
* value per operation. By default this is one charging operation every 10 ticks
|
||||
* in case of an AE2 charger.
|
||||
*
|
||||
*
|
||||
* @author yueh
|
||||
* @version rv5
|
||||
* @since rv5
|
||||
@@ -51,10 +51,10 @@ public interface IChargerRegistry {
|
||||
|
||||
/**
|
||||
* Fetch a charge rate for a specific item.
|
||||
*
|
||||
*
|
||||
* The specific item does not need to have a mapping registered at all. In this
|
||||
* case it will use a default value of 160 AE.
|
||||
*
|
||||
*
|
||||
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
|
||||
* @return custom rate or default of 160
|
||||
*/
|
||||
@@ -63,12 +63,12 @@ public interface IChargerRegistry {
|
||||
|
||||
/**
|
||||
* Register a custom charge rate for a specific item.
|
||||
*
|
||||
*
|
||||
* Capped at 16000 to avoid extracting too much energy from a network for each
|
||||
* operation. This is done silently without any feedback or exception. Further
|
||||
* the cap is not fixed, it can change at any time in the future should power
|
||||
* issues arise.
|
||||
*
|
||||
*
|
||||
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
|
||||
* @param chargeRate the custom rate, must be > 0, capped to 16000d
|
||||
*/
|
||||
@@ -76,9 +76,9 @@ public interface IChargerRegistry {
|
||||
|
||||
/**
|
||||
* Remove the custom rate for a specific item.
|
||||
*
|
||||
*
|
||||
* It will revert to the default value afterwards.
|
||||
*
|
||||
*
|
||||
* @param item A {@link Item} implementing {@link IAEItemPowerStorage}.
|
||||
*/
|
||||
void removeChargeRate(@Nonnull Item item);
|
||||
|
||||
@@ -25,12 +25,10 @@ package appeng.api.implementations.items;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
import appeng.api.implementations.TransitionResult;
|
||||
import appeng.api.storage.ISpatialDimension;
|
||||
import appeng.api.util.WorldCoord;
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,6 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.IAppEngApi;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
@@ -36,15 +36,15 @@ import appeng.api.config.Actionable;
|
||||
public interface IEnergyGridProvider {
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
*
|
||||
* Can return a list of providers behind the current.
|
||||
*
|
||||
*
|
||||
* An example would be something acting as proxy between different
|
||||
* {@link IEnergyGrid}s.
|
||||
*
|
||||
*
|
||||
* This can contain duplicate entries, AE will ensure that each provider is only
|
||||
* visited once.
|
||||
*
|
||||
*
|
||||
* internal use only
|
||||
*/
|
||||
@Nonnull
|
||||
@@ -52,12 +52,12 @@ public interface IEnergyGridProvider {
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
*
|
||||
* Extracts the requested amount from the provider.
|
||||
*
|
||||
*
|
||||
* This should never forward a call to another {@link IEnergyGridProvider},
|
||||
* instead return them via {@link IEnergyGridProvider#providers()}
|
||||
*
|
||||
*
|
||||
* @return the used amount
|
||||
*/
|
||||
@Nonnegative
|
||||
@@ -65,12 +65,12 @@ public interface IEnergyGridProvider {
|
||||
|
||||
/**
|
||||
* Injects the offered amount into the provider.
|
||||
*
|
||||
*
|
||||
* This should never forward a call to another {@link IEnergyGridProvider},
|
||||
* instead return them via {@link IEnergyGridProvider#providers()}
|
||||
*
|
||||
*
|
||||
* internal use only
|
||||
*
|
||||
*
|
||||
* @return the leftover amount
|
||||
*/
|
||||
@Nonnegative
|
||||
@@ -78,13 +78,13 @@ public interface IEnergyGridProvider {
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
*
|
||||
* Returns the current demand of an provider.
|
||||
*
|
||||
*
|
||||
* 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,33 +93,33 @@ public interface IEnergyGridProvider {
|
||||
|
||||
/**
|
||||
* internal use only
|
||||
*
|
||||
*
|
||||
* AE currently uses this to enqueue the next visited provider.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* AE currently uses this to enqueue the next visited provider.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*
|
||||
* E.g. inject into the the lowest one first or extract from the highest one.
|
||||
*
|
||||
*
|
||||
* @return the maximum amount stored.
|
||||
*/
|
||||
@Nonnegative
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
|
||||
package appeng.api.parts;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
//@formatter:off
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface ICellInventoryHandler<T extends IAEStack<T>> extends IMEInvento
|
||||
|
||||
/**
|
||||
* Get access to the ICellInventory. Can be null for custom cells.
|
||||
*
|
||||
*
|
||||
* @return get access to the Cell Inventory.
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -33,7 +33,7 @@ import javax.annotation.Nullable;
|
||||
public interface ISaveProvider {
|
||||
/**
|
||||
* Cell has changed and needs to be changed.
|
||||
*
|
||||
*
|
||||
* @param cellInventory can be null for custom cells.
|
||||
*/
|
||||
void saveChanges(@Nullable ICellInventory<?> cellInventory);
|
||||
|
||||
@@ -24,7 +24,6 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import appeng.api.storage.data.IAEStack;
|
||||
public interface IClientHelper {
|
||||
/**
|
||||
* Add cell information to the provided list. Used for tooltip content.
|
||||
*
|
||||
*
|
||||
* @param handler Cell handler.
|
||||
* @param lines List of lines to add to.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user