Skip to content

Complete the adjustment of the powered sliding rail完成动力滑轨调整#3434

Open
1dianliu wants to merge 3 commits into
Anvil-Dev:dev/1.21/1.6from
1dianliu:sliding_rail_stop_like
Open

Complete the adjustment of the powered sliding rail完成动力滑轨调整#3434
1dianliu wants to merge 3 commits into
Anvil-Dev:dev/1.21/1.6from
1dianliu:sliding_rail_stop_like

Conversation

@1dianliu
Copy link
Copy Markdown
Contributor

@1dianliu 1dianliu commented Apr 26, 2026

添加类滑轨站tag 实现类滑轨站方块上方的方块受到更新时检测是否有动力滑轨吸它 把滑轨站被吸相关的方法一起移到了NeighbourNotifyListener中 (有更好的地方推荐的话我就把canMoveBlockTo和moveBlocksAbove挪过去)

粘连部分我肘不动 #3227 修不好 并且现在在加热的钨块上放粘液块 被动力滑轨拉时动力滑轨会被一起肘飞(被粘液块粘着一起往前走 但是钨块没动)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes the powered sliding rail adjustment by introducing a new sliding_rail_stop_like block tag so that powered sliding rails can pull blocks from on top of more block types (heatable blocks, campfire, heater, corrupted beacon, neutron irradiator) — not only the sliding rail stop. It also fixes the bug where placing a block on a sliding rail stop with an adjacent powered rail didn't start a slide, by moving the pull/push logic into a new NeighbourNotifyListener event handler and invoking it both from neighbor notify events and from the powered rail's own neighborChanged.

Changes:

  • Add SLIDING_RAIL_STOP_LIKE block tag and populate it via datagen.
  • Extract sliding-block movement logic from SlidingRailStopBlock into a new NeighbourNotifyListener event handler; make changeSlidingDirection / canMoveSlidingTo static and reuse via tag check.
  • Update PoweredSlidingRailBlock and SlidingBlockEntity to recognize the new tag for pulling/checking sliding continuity.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/main/java/dev/dubhe/anvilcraft/init/block/ModBlockTags.java Declares the new SLIDING_RAIL_STOP_LIKE block tag.
src/main/java/dev/dubhe/anvilcraft/data/tags/BlockTagLoader.java Populates the new tag with heatable blocks, campfire, sliding rail stop, heater, corrupted beacon, neutron irradiator.
src/generated/resources/data/anvilcraft/tags/block/sliding_rail_stop_like.json Generated tag JSON.
src/main/java/dev/dubhe/anvilcraft/event/NeighbourNotifyListener.java New event handler that detects placements above stop-like blocks and triggers moveBlocksAbove; also hosts moved canMoveBlockTo/moveBlocksAbove helpers.
src/main/java/dev/dubhe/anvilcraft/block/sliding/SlidingRailStopBlock.java Removes the in-block neighborChanged push logic and the private moveBlocksAbove; exposes changeSlidingDirection/canMoveSlidingTo as static for shared use.
src/main/java/dev/dubhe/anvilcraft/block/sliding/PoweredSlidingRailBlock.java When powered, actively pulls a pushable block from the stop-like block behind it via the listener helpers.
src/main/java/dev/dubhe/anvilcraft/entity/SlidingBlockEntity.java A sliding block over a stop-like block now uses SlidingRailStopBlock.changeSlidingDirection, and checkCanMove accepts stop-like blocks below.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TODO] 动力滑轨调整 [Bug] 滑轨站特定情况下不往前方同向动力滑轨送方块

2 participants