Package commoble.morered.wires

# Class BundledCableBlockEntity

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

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

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

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected class`
`BundledCableBlockEntity.SidedPowerSupplier`

## 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
`static final String`
`CHANNEL_FLAGS`
`protected byte[][]`
`power`
Table of power values The first index is the direction ordinal of the face of the wire where the power is stored (dunswe order) The second index is the power channel ordinal (dye color order)
`static final String`
`POWER`
`static final String`
`POWER_BYTES`
`protected Map<net.minecraft.core.Direction,ChanneledPowerSupplier>`
`sidedPowerSuppliers`

### 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
`BundledCableBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)`
`BundledCableBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<? extends BundledCableBlockEntity> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)`

## Method Summary

Modifier and Type
Method
Description
`ChanneledPowerSupplier`
`getChanneledPower(net.minecraft.core.Direction side)`
`int`
`getPower(int side, int channel)`
`byte[]`
`getPowerChannels(int side)`
Returns the power for all channels on the given side
`void`
`loadAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries)`
`void`
`readServerData(net.minecraft.nbt.CompoundTag compound)`
`void`
`readUpdatedPowerData(net.minecraft.nbt.CompoundTag compound)`
`void`
`saveAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries)`
`boolean`
`setPower(int side, int channel, int newPower)`
Sets the power value and marks the block and TE updated if the power changed on the server
`void`
`setPowerRaw(byte[][] newPower)`
`net.minecraft.nbt.CompoundTag`
`writeAllPowerData(net.minecraft.nbt.CompoundTag compound)`
`net.minecraft.nbt.CompoundTag`
`writeServerData(net.minecraft.nbt.CompoundTag compound)`

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

### CHANNEL_FLAGS

public static final String CHANNEL_FLAGS

See Also:
  - Constant Field Values

### POWER_BYTES

public static final String POWER_BYTES

See Also:
  - Constant Field Values

### power

protected byte[][] power
Table of power values The first index is the direction ordinal of the face of the wire where the power is stored (dunswe order) The second index is the power channel ordinal (dye color order)

### sidedPowerSuppliers

protected Map<net.minecraft.core.Direction,ChanneledPowerSupplier> sidedPowerSuppliers

## Constructor Details

### BundledCableBlockEntity

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

### BundledCableBlockEntity

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

## Method Details

### getPower

public int getPower(int side, int channel)

### getPowerChannels

public byte[] getPowerChannels(int side)
Returns the power for all channels on the given side

Parameters:
  `side` - Directional ordinal
Returns:
  The power array for all channels on the given side (be sure to clone before storing)

### setPower

public boolean setPower(int side, int channel, int newPower)
Sets the power value and marks the block and TE updated if the power changed on the server

Parameters:
  `side` - The attachment side to set the power of, in the range [0,5]
  `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

### setPowerRaw

public void setPowerRaw(byte[][] newPower)

### getChanneledPower

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

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

### writeServerData

public net.minecraft.nbt.CompoundTag writeServerData(net.minecraft.nbt.CompoundTag compound)

### readServerData

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

### writeAllPowerData

public net.minecraft.nbt.CompoundTag writeAllPowerData(net.minecraft.nbt.CompoundTag compound)

### readUpdatedPowerData

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