Package commoble.morered.bitwise_logic

# Class ChanneledPowerStorageBlockEntity

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
commoble.morered.bitwise_logic.ChanneledPowerStorageBlockEntity

All Implemented Interfaces:
  `ChanneledPowerSupplier`, `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>`

public class ChanneledPowerStorageBlockEntity extends net.minecraft.world.level.block.entity.BlockEntity implements ChanneledPowerSupplier

## 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
Modifier and Type
Field
Description
`protected byte[]`
`power`
`static final String`
`POWER`
`protected net.minecraftforge.common.util.LazyOptional<ChanneledPowerSupplier>`
`powerHolder`

### 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

Constructors
Constructor
Description
`ChanneledPowerStorageBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)`
`ChanneledPowerStorageBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<? extends ChanneledPowerStorageBlockEntity> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)`

## Method Summary

Modifier and Type
Method
Description
`static ChanneledPowerStorageBlockEntity`
`create(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)`
`<T> net.minecraftforge.common.util.LazyOptional<T>`
`getCapability(net.minecraftforge.common.capabilities.Capability<T> cap, net.minecraft.core.Direction side)`
`int`
`getPower(int channel)`
`int`
`getPowerOnChannel(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos wirePos, net.minecraft.world.level.block.state.BlockState wireState, net.minecraft.core.Direction wireFace, int channel)`
Gets the per-channel power of the block this wire connector is assigned to.
`byte[]`
`getStrongestNeighborPower()`
`void`
`invalidateCaps()`
`void`
`load(net.minecraft.nbt.CompoundTag compound)`
`void`
`resetCapabilities()`
`void`
`saveAdditional(net.minecraft.nbt.CompoundTag compound)`
`boolean`
`setPower(byte[] newPowers)`
`boolean`
`setPower(int channel, int newPower)`
Sets the power value and marks the block and TE updated if the power changed on the server use setPower(int[]) where possible to minimize neighbor updates
`void`
`updatePower()`

### Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity

`addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadStatic, onChunkUnloaded, 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 net.minecraftforge.common.capabilities.ICapabilityProvider

`getCapability`

### Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity

`deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT`

## Field Details

### POWER

public static final String POWER

See Also:
  - Constant Field Values

### power

protected byte[] power

### powerHolder

protected net.minecraftforge.common.util.LazyOptional<ChanneledPowerSupplier> powerHolder

## Constructor Details

### ChanneledPowerStorageBlockEntity

public ChanneledPowerStorageBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<? extends ChanneledPowerStorageBlockEntity> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)

### ChanneledPowerStorageBlockEntity

public ChanneledPowerStorageBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)

## Method Details

### create

public static ChanneledPowerStorageBlockEntity create(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)

### getCapability

public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> cap, net.minecraft.core.Direction side)

Specified by:
  `getCapability` in interface `net.minecraftforge.common.capabilities.ICapabilityProvider`
Overrides:
  `getCapability` in class `net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>`

### invalidateCaps

public void invalidateCaps()

Specified by:
  `invalidateCaps` in interface `net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>`
Overrides:
  `invalidateCaps` in class `net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>`

### resetCapabilities

public void resetCapabilities()

### getPowerOnChannel

public int getPowerOnChannel(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos wirePos, net.minecraft.world.level.block.state.BlockState wireState, net.minecraft.core.Direction wireFace, int channel)
Description copied from interface: `ChanneledPowerSupplier`
Gets the per-channel power of the block this wire connector is assigned to. Internally, cable blocks use 0-31 for power storage (redstone-capable cables output half of this value to non-wires).

Specified by:
  `getPowerOnChannel` in interface `ChanneledPowerSupplier`
Parameters:
  `level` - The world we're doing power queries in
  `wirePos` - The position of a wire block
  `wireState` - The blockstate of the block requesting power. Not guaranteed to be any particular class or have any particular blockstate properties.
  `wireFace` - The attachment face of the subwire we're supplying power to. Can be null if e.g. querier isn't a wire-like block.
  `channel` - The channel index we're querying power for. Currently values [0,15] are supported (equivalent to dyecolor ordinals)
Returns:
  a power value in the range [0, 31]

### getPower

public int getPower(int channel)

### setPower

public boolean setPower(byte[] newPowers)

Parameters:
  `newPowers` - An array of 16 values in the range 0-31. This will be copied.
Returns:
  true if any values changed, false otherwise

### setPower

public boolean setPower(int channel, int newPower)
Sets the power value and marks the block and TE updated if the power changed on the server use setPower(int[]) where possible to minimize neighbor updates

Parameters:
  `channel` - The channel to set the power of, in the range [0,15]
  `newPower` - The power value to set the power of, in the range [0,31]
Returns:
  True if the power changed, false otherwise

### saveAdditional

public void saveAdditional(net.minecraft.nbt.CompoundTag compound)

Overrides:
  `saveAdditional` in class `net.minecraft.world.level.block.entity.BlockEntity`

### load

public void load(net.minecraft.nbt.CompoundTag compound)

Overrides:
  `load` in class `net.minecraft.world.level.block.entity.BlockEntity`

### updatePower

public void updatePower()

### getStrongestNeighborPower

public byte[] getStrongestNeighborPower()