Jump to content

[1.14] Output redstone signal for all sides except input


Samusoidal

Recommended Posts

I am creating a 5 way 'repeater clone' block which takes an input to 1 side and outputs a signal of strength 15 from all the other faces when active. I don't understand yet how the redstone methods work within Forge and I haven't been able to accomplish this. I haven't been able to find any tutorials or documentation to point me on the right path, and reviewing the RepeaterBlock and RedstoneDiodeBlock classes haven't helped much. Anybody can show me how to accomplish this?

Link to comment
Share on other sites

The

@Override
public int getWeakPower(BlockState blockState, IBlockReader blockAccess, BlockPos pos, Direction side) {
    return super.getWeakPower(blockState, blockAccess, pos, side);
}

method can be overridden. (You should also override getStrongPower to return the value of getWeakPower). If you return 15 from there, then all sides will output a 15-strength redstone signal. Now you can get the input side from the blockstate and return 15 for all but the input side.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.