Package commoble.morered.bitwise_logic

# Class ChanneledPowerStorageBlockEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
commoble.morered.bitwise_logic.ChanneledPowerStorageBlockEntity

All Implemented Interfaces:
  `net.neoforged.neoforge.attachment.IAttachmentHolder`, `net.neoforged.neoforge.common.extensions.IBlockEntityExtension`

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

## Nested Class Summary

## Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity

`net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput`

## Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

`net.neoforged.neoforge.attachment.AttachmentHolder.AsField`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected byte[]`
`power`
`static final String`
`POWER`

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

`level, remove, worldPosition`

### Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

`ATTACHMENTS_NBT_KEY`

## 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)`
`ChanneledPowerSupplier`
`getChanneledPower(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)`
`byte[]`
`getStrongestNeighborPower()`
`void`
`loadAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries)`
`void`
`saveAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries)`
`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, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEvent`

### Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

`deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

`getData, getExistingData, hasData, removeData, setData`

### Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension

`getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate`

## Field Details

### POWER

public static final String POWER

See Also:
  - Constant Field Values

### power

protected byte[] power

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

### getChanneledPower

public ChanneledPowerSupplier getChanneledPower(net.minecraft.core.Direction side)

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

### 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, net.minecraft.core.HolderLookup.Provider registries)

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

### loadAdditional

public void loadAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries)

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

### updatePower

public void updatePower()

### getStrongestNeighborPower

public byte[] getStrongestNeighborPower()