1个不稳定版本
0.2.0-alpha.1+mc.1.20.1 | 2023年8月11日 |
---|
1363 在 游戏开发
235KB
5.5K SLoC
valence_world_border
包含用于处理Minecraft的世界边界的插件。
要为层启用世界边界功能,请在层实体上插入WorldBorderBundle
组件。注意,层实体必须具有ChunkLayer
组件才能正常工作。
示例
use bevy_ecs::prelude::*;
use valence_world_border::*;
fn example_system(mut world_borders: Query<(&mut WorldBorderCenter, &mut WorldBorderLerp)>) {
for (mut center, mut lerp) in &mut world_borders {
// Change the center position of the world border.
center.x = 123.0;
center.z = 456.0;
// Change the diameter of the world border.
// If you want to change the diameter without interpolating, stop after this.
lerp.target_diameter = 100.0;
// Have the world border linearly interpolate its diameter from 50 to 100 over 200 ticks.
// `current_diameter` and `remaining_ticks` will change automatically, but you can modify their values at any time.
lerp.current_diameter = 50.0;
lerp.remaining_ticks = 200;
}
}
依赖关系
~17–26MB
~443K SLoC