server/block: Add buttons, pressure plates and redstone lamp - #1327
Open
cqdetdev wants to merge 12 commits into
Open
server/block: Add buttons, pressure plates and redstone lamp#1327cqdetdev wants to merge 12 commits into
cqdetdev wants to merge 12 commits into
Conversation
Port the redstone power sources narrowed out of the world-owned engine review (df-mc#1250) onto the merged engine: buttons of every material with press scheduling, stone/wooden pressure plates, light and heavy weighted plates with analog 1-15 output based on entity count, and the redstone lamp driven through RedstonePowerConsumer. Pressure plates react to entities through EntityStepOn and scheduled release ticks, ignoring snowballs and, for stone-like plates, non-living entities, matching vanilla behaviour. Materials are modelled as ButtonType and PressurePlateType following the established *_type.go value type convention. Adds the pressure plate click sounds and their level sound event mappings.
Non-player entities now trigger EntityStepper blocks: entity movement checks the block stood on after each tick like players do, letting mobs, items and projectiles activate pressure plates. Wooden buttons are pressed by arrows. Projectiles notify the block of the cell they come to rest in, since blocks without a collision box are passed through by the trace, and a wooden button stays pressed while an arrow rests inside it. Redstone lamps now turn off after two redstone ticks instead of immediately, keeping them lit through short pulses. Buttons and pressure plates drop their unpowered forms so a replaced component cannot start permanently powered, and crimson and warped variants are no longer usable as furnace fuel, matching WoodType.Flammable.
Redstone lamps now turn off after three redstone ticks (six game ticks) to match Bedrock; the previous two-tick delay was the Java value. Wooden buttons and pressure plates are now axe-effective, while stone, polished blackstone and weighted variants stay pickaxe-effective. Pressure plates recompute their power on the rising edge only and let the scheduled tick keep the weighted level current, matching the vanilla periodic re-check and avoiding a per-entity rescan each tick. The click sound now plays only when a plate first activates. Snowballs are no longer excluded from activating wooden and weighted plates, which react to any entity in vanilla.
HashimTheArab
force-pushed
the
feat/redstone-sources
branch
from
July 20, 2026 02:14
2a56ff7 to
721a0fb
Compare
HashimTheArab
force-pushed
the
feat/redstone-sources
branch
from
July 20, 2026 05:15
7475b05 to
093ce67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the redstone power sources that were narrowed out of the world-owned redstone engine PR (#1250), building on the merged. Part of the redstone feature tracking issue (#1228):