Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make blocks transmit redstone signal from buttons and levers #157

Open
Danielxs01 opened this issue Mar 10, 2024 · 0 comments
Open

Make blocks transmit redstone signal from buttons and levers #157

Danielxs01 opened this issue Mar 10, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request Forge (all versions) Priority: High Indicates that the issue or enhancement is of high priority Signals Problem belongs to the signals part Stellwand Problem belongs to the stellwand part

Comments

@Danielxs01
Copy link
Member

Danielxs01 commented Mar 10, 2024

Make blocks transmit redstone signal

Current behaviour:
Currently blocks are unable to pass redstone.

Wanted behaviour:
Blocks pass redstone signal provided by buttons, levers or redstone wires.

Code example:

public class Tile??? extends BlockEntity implements IRedstoneProvider {
    
    @TagField
    private int redstonePass = 0;

    @Override
    public void onNeighborChange(Vec3i neighbor) {
        redstonePass = 0;
        int newRedstonePass = getWorld().getRedstone(getPos());
        if(this.redstonePass != newRedstonePass){
            this.redstonePass = newRedstonePass;
            getWorld().notifyNeighborsOfStateChange(getPos(), LOSBlocks.BLOCK_???, true);
        }
    }

    @Override
    public int getStrongPower(Facing from) {
        return redstonePass;
    }

    @Override
    public int getWeakPower(Facing from) {
        return redstonePass;
    }

}
@Danielxs01 Danielxs01 added enhancement New feature or request Stellwand Problem belongs to the stellwand part Signals Problem belongs to the signals part Priority: High Indicates that the issue or enhancement is of high priority Forge (all versions) labels Mar 10, 2024
@Danielxs01 Danielxs01 self-assigned this Mar 10, 2024
Danielxs01 added a commit that referenced this issue Apr 17, 2024
Danielxs01 added a commit that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Forge (all versions) Priority: High Indicates that the issue or enhancement is of high priority Signals Problem belongs to the signals part Stellwand Problem belongs to the stellwand part
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant