Class BlockEntityEnergyBattery
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity
org.cyclops.integrateddynamics.core.blockentity.BlockEntityCableConnectable
org.cyclops.integrateddynamics.blockentity.BlockEntityEnergyBattery
- All Implemented Interfaces:
net.minecraftforge.common.capabilities.ICapabilityProvider
,net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>
,net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>
,net.minecraftforge.common.extensions.IForgeBlockEntity
,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
,net.minecraftforge.energy.IEnergyStorage
,org.cyclops.cyclopscore.blockentity.IBlockEntityDelayedTickable
,org.cyclops.cyclopscore.persist.IDirtyMarkListener
,org.cyclops.cyclopscore.persist.nbt.INBTProvider
,IEnergyStorageCapacity
public class BlockEntityEnergyBattery
extends BlockEntityCableConnectable
implements IEnergyStorageCapacity
A part entity used to store variables.
Internally, this also acts as an expression cache
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>>
-
Field Summary
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB
-
Constructor Summary
ConstructorDescriptionBlockEntityEnergyBattery
(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
addEnergy
(int energy) protected int
addEnergyFe
(int energy, boolean simulate) boolean
boolean
int
extractEnergy
(int energy, boolean simulate) protected int
static int
getEnergyPerTick
(int capacity) int
int
int
boolean
void
int
receiveEnergy
(int energy, boolean simulate) void
setCapacity
(int capacity) protected void
setEnergy
(int energy) void
setEnergyStored
(int energy) Methods inherited from class org.cyclops.integrateddynamics.core.blockentity.BlockEntityCableConnectable
getCable, getConnected, onChunkUnloaded, read
Methods inherited from class org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity
addCapabilityInternal, addCapabilitySided, canInteractWith, getCapability, getRotation, getStoredCapabilities, getUpdateBackoff, getUpdatePacket, getUpdateTag, invalidateCaps, load, onDataPacket, onDirty, onLoad, readGeneratedFieldsFromNBT, saveAdditional, sendUpdate, setUpdateBackoff, shouldSendUpdate, transformFacingForRotation, unsetSendUpdate, writeGeneratedFieldsToNBT, writeToItemStack
Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEvent
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cyclops.cyclopscore.blockentity.IBlockEntityDelayedTickable
reduceUpdateBackoff, sendImmediateUpdate
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, requestModelDataUpdate, serializeNBT
-
Constructor Details
-
BlockEntityEnergyBattery
public BlockEntityEnergyBattery(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
-
-
Method Details
-
isCreative
public boolean isCreative() -
setEnergyStored
public void setEnergyStored(int energy) -
getEnergyStored
public int getEnergyStored()- Specified by:
getEnergyStored
in interfacenet.minecraftforge.energy.IEnergyStorage
-
getMaxEnergyStored
public int getMaxEnergyStored()- Specified by:
getMaxEnergyStored
in interfacenet.minecraftforge.energy.IEnergyStorage
-
canExtract
public boolean canExtract()- Specified by:
canExtract
in interfacenet.minecraftforge.energy.IEnergyStorage
-
canReceive
public boolean canReceive()- Specified by:
canReceive
in interfacenet.minecraftforge.energy.IEnergyStorage
-
setEnergy
protected void setEnergy(int energy) -
getUpdateBackoffTicks
public int getUpdateBackoffTicks()- Specified by:
getUpdateBackoffTicks
in interfaceorg.cyclops.cyclopscore.blockentity.IBlockEntityDelayedTickable
- Overrides:
getUpdateBackoffTicks
in classorg.cyclops.cyclopscore.blockentity.CyclopsBlockEntity
-
onUpdateReceived
public void onUpdateReceived()- Overrides:
onUpdateReceived
in classorg.cyclops.cyclopscore.blockentity.CyclopsBlockEntity
-
getEnergyPerTick
public static int getEnergyPerTick(int capacity) -
getEnergyPerTick
protected int getEnergyPerTick() -
receiveEnergy
public int receiveEnergy(int energy, boolean simulate) - Specified by:
receiveEnergy
in interfacenet.minecraftforge.energy.IEnergyStorage
-
extractEnergy
public int extractEnergy(int energy, boolean simulate) - Specified by:
extractEnergy
in interfacenet.minecraftforge.energy.IEnergyStorage
-
addEnergy
protected int addEnergy(int energy) -
addEnergyFe
protected int addEnergyFe(int energy, boolean simulate) -
setCapacity
public void setCapacity(int capacity) - Specified by:
setCapacity
in interfaceIEnergyStorageCapacity
-