适用于 Paper/Spigot 1.21+ 的真实水流物理效果。水表现为一种有限资源:倒入多少,流出就有多少。杜绝重复生成。
⚠️ 安装前须知
你可以将此插件用于生存服务器,但请准备好应对资源消耗或严格的配置限制(通过 config.yml 编辑)。该插件最初是为基于会话的小型游戏设计的。
核心逻辑
WaterPhysics 以有限资源模型重写水的行为。每个水方块持有一个整数数量的“单位”(1–8):
- 8 个单位 = 水源块(满)
- 1–7 个单位 = 流动的水
- 0 个单位 = 空气
绝不创造或销毁单位。你倒入多少,就会精确地流出多少。
工作原理
- ? 重力 – 水在一刻钟内瞬间下落一格,从底部到顶部填充列。没有缓慢滴落。
- ? 水平衡 – 水在同一楼层的邻居间平衡水位。当下方有出口时,完全排空。
- ? 寻找排水口 – 位于高原上的水会在约 1024 个方块内搜索最近的孔洞并向其爬行,从而排干整个湖泊。
- ? 瀑布倾泻 – 横向流过边缘的水会立即级联而下形成瀑布,绝不会悬在半空中。
- ? 水洼蒸发 – 无处可流的极薄单层水膜会消失(可配置)。
支持的事件
- 爆炸 – TNT、苦力怕、床、锚会炸出坑洞;水会流入陨石坑。
- 活塞 – 被活塞移动的方块腾出空间;水渗入缝隙。
- 水桶 – 放置水桶会重新排队附近的水,使其能够扩散新鲜的水流。
- 岩浆(可选) – 如果
lava.apply-physics: true,岩浆将在同一系统上流动(实验性功能)。默认情况下:岩浆保持原版行为。
- 水下填充 – 楼梯、台阶、栅栏会在适当的水位下自动进行水下填充。
- 音效 + 粒子 – 水流时的可选效果(粒子仅对附近的玩家可见)。
优化措施
- ? 玩家距离检测 – 仅在玩家附近的加载区块中处理水流。远处的海洋不受影响。
- ? TTL 缓存 – 如果未使用,60 秒后从内存中遗忘方块。
- ? 生物群系排除 – 通过生物群系列表禁用海洋/河流中的物理效果。
- ? 仅交互模式 – 仅当玩家在附近破坏或放置方块时,水才会流动。静态水将被忽略。
- ? bStats – 遥测功能已启用,显示你的设置(可通过
/opt-out 退出)。
命令
/wp # 帮助
/wp reload # 重载 config.yml
/wp enable|disable # 启用/禁用物理效果
/wp stop # 清除队列
/wp status # 状态 + 队列大小
别名:/waterphysics, /water
权限:waterphysics.admin(默认为 op)
完美适用场景
? 小型游戏 – 可配置的洪水、水陷阱、船只竞速
?️ 生存模式 – 真实的水力学、美丽的瀑布、诚实的资源系统
配置
enabled: true
worlds: ["*"] # 所有世界或白名单列表
flow:
interaction-only: true # 仅在破坏/放置时水流流动
batch-size: 512 # 每刻处理的方块数(越高越快,但延迟也越高)
tick-interval: 3 # 每 N 刻运行一次
optimization:
player-proximity-check: true # 仅在玩家附近生效
player-proximity-chunks: 4 # 半径(以区块为单位)
cache-ttl-seconds: 60
cache-max-size: 100000
effects:
enabled: true # 流动时的粒子效果
rate-limit-ticks: 4
lava:
apply-physics: false # 实验性岩浆物理效果
所有内容均公开并通过 /wp reload 实时调整。
常见问题
问:这会导致卡顿吗?
答:取决于配置。默认配置启用了仅交互模式和玩家距离检测——在小型服务器上运行良好。在大型服务器上,请调整 batch-size 和 tick-interval。
问:水悬挂着,不流动?
答:很可能处于被排除的生物群系中(默认:ocean, river 等)。从 config.yml 的 excluded-biomes 中移除它们。
问:是否与原版活塞兼容?
答:是的。活塞推动方块 → 水渗入空隙。同时适用于 TNT、苦力怕和活塞。
问:占用多少内存?
答:~100k 缓存方块 ≈ 3–4 MB。具体取决于 config 中的 cache-max-size。
问:我可以将其与其他水流插件一起使用吗?
答:不行。禁用你拥有的其他任何插件。WaterPhysics 会在受管理的世界中完全取消原版水流。
Realistic water physics for Paper/Spigot 1.21+. Water behaves as a finite resource: what you pour in is what pours out. No duplication.
⚠️ Before Installing
You can use this plugin on survival servers, but be ready for resource consumption or strict configuration limits (edit via config.yml). Originally built for session-based mini-games.
Core logic
WaterPhysics rewrites water behavior on a finite resource model. Each water block holds an integer number of "units" (1–8):
- 8 units = source block (full)
- 1–7 units = flowing water
- 0 units = air
Never creates or destroys units. Everything you pour in flows out exactly.
How it works
- ? Gravity – water instantly falls one tick down, filling the column from bottom to top. No slow dripping.
- ? Level Equalization – water levels with neighbors on the same floor. When there's an exit below, fully drains.
- ? Drain Seeking – water on a plateau searches for the nearest hole within ~1024 blocks and crawls toward it, draining the entire lake.
- ? Falling Sheets – sideways flow over an edge instantly cascades down as a waterfall, never hanging mid-air.
- ? Puddle Evaporation – tiny single-layer films with nowhere else to flow disappear (configurable).
Supported Events
- Explosions – TNT, creepers, beds, anchors blow holes; water flows into craters.
- Pistons – piston-moved blocks free up space; water seeps into gaps.
- Buckets – placing a bucket re-queues nearby water, allowing it to spread fresh.
- Lava (optional) – if
lava.apply-physics: true, lava flows on the same system (experimental). Default: lava stays vanilla.
- Waterlogging – stairs, slabs, fences auto-waterlog at appropriate nearby water levels.
- Sounds + Particles – optional effects on water flow (particles visible only near players).
Optimizations
- ? Player proximity check – water processes only in loaded chunks near players. Far oceans untouched.
- ? TTL cache – blocks forgotten from memory after 60s if unused.
- ? Biome exclusion – disable physics in oceans/rivers via biome list.
- ? Interaction-only mode – water flows only when a player breaks/places a block nearby. Static water ignored.
- ? bStats – telemetry enabled, shows your settings (opt-out via
/opt-out).
Commands
/wp # Help
/wp reload # Reload config.yml
/wp enable|disable # Enable/disable physics
/wp stop # Clear queue
/wp status # Status + queue size
Aliases: /waterphysics, /water
Permission: waterphysics.admin (op by default)
Perfect For
? Mini-games – configurable flooding, water traps, boat races
?️ Survival – realistic hydraulics, beautiful waterfalls, honest resource system
Configuration
enabled: true
worlds: ["*"] # All worlds or whitelist
flow:
interaction-only: true # Water flows only on break/place
batch-size: 512 # Blocks per tick (higher = faster, more lag)
tick-interval: 3 # Run every N ticks
optimization:
player-proximity-check: true # Only near players
player-proximity-chunks: 4 # Radius in chunks
cache-ttl-seconds: 60
cache-max-size: 100000
effects:
enabled: true # Particles on flow
rate-limit-ticks: 4
lava:
apply-physics: false # Experimental lava physics
Everything exposed and live-tunable via /wp reload.
FAQ
Q: Will this lag?
A: Depends on config. Default has interaction-only mode and player proximity enabled — works great on small servers. On large ones, tune batch-size and tick-interval.
Q: Water hangs, won't flow?
A: Likely in an excluded biome (default: ocean, river, etc.). Remove from excluded-biomes in config.yml.
Q: Works with vanilla pistons?
A: Yes. Piston pushes block → water seeps into the gap. Works for TNT, creepers, and pistons simultaneously.
Q: How much memory?
A: ~100k cached blocks ≈ 3–4 MB. Depends on cache-max-size in config.
Q: Can I use this with other water plugins?
A: No. Disable whichever other plugin you have. WaterPhysics cancels vanilla flow entirely in managed worlds.
评论 0
登录后参与评分
还没有评论,来抢沙发吧