Skip to content
Discussion options

You must be logged in to vote

Yeaaaaah. Block support for generic peripherals is one of the things I want to look at as part of the 1.21.5 changes, as we half need this for #1890. Whether this happens or not ... remains to been seen.

I think the interface I'm probably thinking of right now is something like:

interface BlockPeripheralTarget {
  ServerLevel level();
  BlockPos pos();
  BlockState state();
  @Nullable BlockEntity blockEntity();
  @Nullable Direction side();
}

Then peripherals look something like:

final class NoteBlockPeripheral implements GenericPeripheral {
  @LuaFunction(mainThread = true)
  public void playNote(BlockPeripheralTarget block) {
    // ...
  }
}

However, this requires a way to select what…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by SirEndii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants