Complete the adjustment of the powered sliding rail完成动力滑轨调整#3434
Complete the adjustment of the powered sliding rail完成动力滑轨调整#34341dianliu wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
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_LIKEblock tag and populate it via datagen. - Extract sliding-block movement logic from
SlidingRailStopBlockinto a newNeighbourNotifyListenerevent handler; makechangeSlidingDirection/canMoveSlidingTostatic and reuse via tag check. - Update
PoweredSlidingRailBlockandSlidingBlockEntityto 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.
添加类滑轨站tag 实现类滑轨站方块上方的方块受到更新时检测是否有动力滑轨吸它 把滑轨站被吸相关的方法一起移到了NeighbourNotifyListener中 (有更好的地方推荐的话我就把canMoveBlockTo和moveBlocksAbove挪过去)
粘连部分我肘不动 #3227 修不好 并且现在在加热的钨块上放粘液块 被动力滑轨拉时动力滑轨会被一起肘飞(被粘液块粘着一起往前走 但是钨块没动)