Interface EtheriumHandler
- All Known Implementing Classes:
EtheriumGeneratorBlockEntity
public interface EtheriumHandler
Represents an etherium capability handler.
-
Method Summary
Modifier and TypeMethodDescriptionintaddAmount(net.minecraft.core.Holder<EtheriumType> type, int amount) Adds the given amount to the stored amount for the givenEtheriumType.voidaddConnectedPosition(net.minecraft.core.BlockPos pos) Adds aBlockPosto connect.booleanintgetAmount(net.minecraft.core.Holder<EtheriumType> type) SequencedSet<net.minecraft.core.BlockPos> List<net.minecraft.core.Holder<EtheriumType>> intgetMaxAmount(net.minecraft.core.Holder<EtheriumType> type) @Nullable net.minecraft.world.phys.AABBgetOutline(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Returns the block outlineAABBto render when the Magitech Goggles are equipped.intgetOutlineColor(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Returns the block outline color, in ARGB format.voidremoveConnectedPosition(net.minecraft.core.BlockPos pos) Removes aBlockPosto connect.voidsetAmount(net.minecraft.core.Holder<EtheriumType> type, int amount) Sets the stored amount for the givenEtheriumType.intsubtractAmount(net.minecraft.core.Holder<EtheriumType> type, int amount) Subtracts the given amount to the stored amount for the givenEtheriumType.
-
Method Details
-
getEtheriumTypes
List<net.minecraft.core.Holder<EtheriumType>> getEtheriumTypes()- Returns:
- The
EtheriumTypes supported by the handler.
-
getAmount
- Parameters:
type- TheEtheriumTypeto get the stored amount for.- Returns:
- The amount of the
EtheriumTypestored in the handler.
-
getMaxAmount
- Parameters:
type- TheEtheriumTypeto get the maximum amount for.- Returns:
- The maximum amount of the
EtheriumTypethat can be stored in the handler.
-
setAmount
Sets the stored amount for the givenEtheriumType.- Parameters:
type- TheEtheriumTypeto set the stored amount for.amount- The stored amount to set.
-
addAmount
Adds the given amount to the stored amount for the given
EtheriumType.Returns the amount left to be added. For example, if all etherium was successfully added, 0 will be returned. If the handler is full, the amount will be returned.
- Parameters:
type- TheEtheriumTypeto add the given amount for.amount- The amount to add.- Returns:
- The amount left to be added.
-
subtractAmount
Subtracts the given amount to the stored amount for the given
EtheriumType.Returns the amount left to be subtracted. For example, if all etherium was successfully subtracted, 0 will be returned. If the handler is full, the amount will be returned.
- Parameters:
type- TheEtheriumTypeto subtract the given amount for.amount- The amount to subtract.- Returns:
- The amount left to be subtracted.
-
getOutline
@Nullable net.minecraft.world.phys.AABB getOutline(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Returns the block outlineAABBto render when the Magitech Goggles are equipped. If the handler is not in a block context, this method should return null. If this is a block larger than 1x1x1, only the part that actually controls the logic should return anAABB, all other parts should return null.- Parameters:
level- TheLevelto use.pos- TheBlockPosto use.state- TheBlockStateto use.- Returns:
- The block outline
AABB.
-
getOutlineColor
int getOutlineColor(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Returns the block outline color, in ARGB format.- Parameters:
level- TheLevelto use.pos- TheBlockPosto use.state- TheBlockStateto use.- Returns:
- The block outline color.
-
canHaveConnectedPositions
boolean canHaveConnectedPositions()- Returns:
- Whether the handler is allowed to have connections to other handlers.
-
getConnectedPositions
SequencedSet<net.minecraft.core.BlockPos> getConnectedPositions()- Returns:
- A
SequencedSetof connections to other handlers. IfcanHaveConnectedPositions()returns false, this is expected to be always empty.
-
addConnectedPosition
void addConnectedPosition(net.minecraft.core.BlockPos pos) Adds aBlockPosto connect. IfcanHaveConnectedPositions()returns false, this method should do nothing.- Parameters:
pos- TheBlockPosto add.
-
removeConnectedPosition
void removeConnectedPosition(net.minecraft.core.BlockPos pos) Removes aBlockPosto connect. IfcanHaveConnectedPositions()returns false, this method should do nothing.- Parameters:
pos- TheBlockPosto remove.
-