Interface IPeripheralProvider

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface IPeripheralProvider
This interface is used to create peripheral implementations for blocks.

If you have a BlockEntity which acts as a peripheral, you may alternatively expose the IPeripheral capability.

dan200.computercraft.api.ForgeComputerCraftAPI#registerPeripheralProvider(IPeripheralProvider) should be used to register a peripheral provider.

  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraftforge.common.util.LazyOptional<IPeripheral>
    getPeripheral(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)
    Produce an peripheral implementation from a block location.
  • Method Details

    • getPeripheral

      net.minecraftforge.common.util.LazyOptional<IPeripheral> getPeripheral(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)
      Produce an peripheral implementation from a block location.
      Parameters:
      world - The world the block is in.
      pos - The position the block is at.
      side - The side to get the peripheral from.
      Returns:
      A peripheral, or LazyOptional.empty() if there is not a peripheral here you'd like to handle.