Package commoble.morered.api

# Class MoreRedAPI

java.lang.Object
commoble.morered.api.MoreRedAPI

public final class MoreRedAPI extends Object
This class contains some methods that can be used by other mods to interface with More Red's features. To safely refer to this class without creating hard dependencies, create a delegate class (we can call this MoreRedProxy), and then we can statically refer to it like

                    if (ModList.get().isLoaded("morered"))
                    {
                            MoreRedProxy.registerWireConnectors();
                    }

In this way, MoreRedProxy can safely refer to classes from More Red, only causing them to be classloaded if the morered mod is loaded.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final net.minecraftforge.common.capabilities.Capability<ChanneledPowerSupplier>`
`CHANNELED_POWER_CAPABILITY`
Capability instance for the Channeled Power Handler capability.

## Constructor Summary

Constructors
Constructor
Description
`MoreRedAPI()`

## Method Summary

Modifier and Type
Method
Description
`static Map<net.minecraft.world.level.block.Block,WireConnector>`
`getCableConnectabilityRegistry()`
Retrieves the registry for wire connectabilities to bundled cables and colored network cables.
`static WireConnector`
`getDefaultCableConnector()`
`static ExpandedPowerSupplier`
`getDefaultExpandedPowerSupplier()`
`static WireConnector`
`getDefaultWireConnector()`
Gets the default wire connector for blocks that do not have WireConnector overrides registered to them.
`static Map<net.minecraft.world.level.block.Block,ExpandedPowerSupplier>`
`getExpandedPowerRegistry()`
Gets the registry of "expanded power" suppliers.
`static Map<net.minecraft.world.level.block.Block,WireConnector>`
`getWireConnectabilityRegistry()`
Retrieves the registry for wire connectabilities to red alloy wires and colored network cables.

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

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

## Field Details

### CHANNELED_POWER_CAPABILITY

public static final net.minecraftforge.common.capabilities.Capability<ChanneledPowerSupplier> CHANNELED_POWER_CAPABILITY
Capability instance for the Channeled Power Handler capability.

## Constructor Details

### MoreRedAPI

public MoreRedAPI()

## Method Details

### getWireConnectabilityRegistry

public static Map<net.minecraft.world.level.block.Block,WireConnector> getWireConnectabilityRegistry()
Retrieves the registry for wire connectabilities to red alloy wires and colored network cables. During modloading, this map is mutable and thread-safe. This method is not safe to call during mod constructors. Blocks should be registered to this registry in FMLCommonSetupEvent. After modloading completes, the map becomes immutable. Functions registered to this registry will be queried by wire blocks. If the function assigned to a given block returns true, then the wire block will A) supply power to that block when that block is adjacent B) receive power to that block when that block is adjacent C) render additional lines of wires attaching to that block. It does not affect the result of WireBlock::canConnectRedstone.

Returns:
  The wire connectability registry

### getDefaultWireConnector

public static WireConnector getDefaultWireConnector()
Gets the default wire connector for blocks that do not have WireConnector overrides registered to them.

Returns:
  The default wire connector

### getExpandedPowerRegistry

public static Map<net.minecraft.world.level.block.Block,ExpandedPowerSupplier> getExpandedPowerRegistry()
Gets the registry of "expanded power" suppliers. An expanded power supplier is defined here as a block that can supply redstone-like power in the [0,31] range instead of [0,15]. This power behaviour is used by red alloy wires and colored network cables. The default behaviour is to simply take the standard weak power of the block and double it. This behaviour can be overridden by registering a function to this registry. During modloading, this map is mutable and thread-safe. This method is not safe to call during mod constructors. Blocks should be registered to this registry in FMLCommonSetupEvent. After modloading completes, the map becomes immutable.

Returns:

### getDefaultExpandedPowerSupplier

public static ExpandedPowerSupplier getDefaultExpandedPowerSupplier()

### getCableConnectabilityRegistry

public static Map<net.minecraft.world.level.block.Block,WireConnector> getCableConnectabilityRegistry()
Retrieves the registry for wire connectabilities to bundled cables and colored network cables. During modloading, this map is mutable and thread-safe. This method is not safe to call during mod constructors. Blocks should be registered to this registry in FMLCommonSetupEvent. After modloading completes, the map becomes immutable. Functions registered to this registry will be queried by cable blocks. If the function assigned to a given block returns true, then the cable block will A) supply channeled signals to that block when that block is adjacent B) receive channeled signals to that block when that block is adjacent C) render additional lines of wires attaching to that block. It does not affect the result of WireBlock::canConnectRedstone. The default behaviour is to always return false from the wireconnector function.

Returns:
  The cable connectability registry

### getDefaultCableConnector

public static WireConnector getDefaultCableConnector()