类 EmptyEnergyStorage
java.lang.Object
net.minecraftforge.energy.EmptyEnergyStorage
- 所有已实现的接口:
IEnergyStorage
Implementation of
IEnergyStorage
that cannot store, receive, or provide energy.
Use the INSTANCE
, don't instantiate. Example:
ItemStack stack = ...;
IEnergyStorage storage = stack.getCapability(ForgeCapabilities.ENERGY).orElse(EmptyEnergyStorage.INSTANCE);
// Use storage without checking whether it's present.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
Returns if this storage can have energy extracted.boolean
Used to determine if this storage can receive energy.int
extractEnergy
(int maxExtract, boolean simulate) Removes energy from the storage.int
Returns the amount of energy currently stored.int
Returns the maximum amount of energy that can be stored.int
receiveEnergy
(int maxReceive, boolean simulate) Adds energy to the storage.
-
字段详细资料
-
INSTANCE
-
-
构造器详细资料
-
EmptyEnergyStorage
protected EmptyEnergyStorage()
-
-
方法详细资料
-
receiveEnergy
public int receiveEnergy(int maxReceive, boolean simulate) 从接口复制的说明:IEnergyStorage
Adds energy to the storage. Returns quantity of energy that was accepted.- 指定者:
receiveEnergy
在接口中IEnergyStorage
- 参数:
maxReceive
- Maximum amount of energy to be inserted.simulate
- If TRUE, the insertion will only be simulated.- 返回:
- Amount of energy that was (or would have been, if simulated) accepted by the storage.
-
extractEnergy
public int extractEnergy(int maxExtract, boolean simulate) 从接口复制的说明:IEnergyStorage
Removes energy from the storage. Returns quantity of energy that was removed.- 指定者:
extractEnergy
在接口中IEnergyStorage
- 参数:
maxExtract
- Maximum amount of energy to be extracted.simulate
- If TRUE, the extraction will only be simulated.- 返回:
- Amount of energy that was (or would have been, if simulated) extracted from the storage.
-
getEnergyStored
public int getEnergyStored()从接口复制的说明:IEnergyStorage
Returns the amount of energy currently stored.- 指定者:
getEnergyStored
在接口中IEnergyStorage
-
getMaxEnergyStored
public int getMaxEnergyStored()从接口复制的说明:IEnergyStorage
Returns the maximum amount of energy that can be stored.- 指定者:
getMaxEnergyStored
在接口中IEnergyStorage
-
canExtract
public boolean canExtract()从接口复制的说明:IEnergyStorage
Returns if this storage can have energy extracted. If this is false, then any calls to extractEnergy will return 0.- 指定者:
canExtract
在接口中IEnergyStorage
-
canReceive
public boolean canReceive()从接口复制的说明:IEnergyStorage
Used to determine if this storage can receive energy. If this is false, then any calls to receiveEnergy will return 0.- 指定者:
canReceive
在接口中IEnergyStorage
-