⚠️ 请注意,描述仅针对最新版本进行维护
实现了 2 种粒子类型
粒子
static_particle
- 可配置的
color(颜色)、alpha(透明度)、size(大小)、lifetime(生命周期)、texture(纹理)
- 具有自发光特性(在黑暗中发光)
static_oriented
- 可配置的
color(颜色)、alpha(透明度)、sizeX(X轴大小)、sizeY(Y轴大小)、lifetime(生命周期)、rotation(旋转)、post_rotation(后旋转)、cull(剔除)、texture(纹理)
- 具有自发光特性(在黑暗中发光)
注意
需要知道的重要一点是,所有数字参数实际上是字符串参数,这是由于 Minecraft 代码库的限制,这样下面的功能才能正常工作
⠀
-
所有数字参数(粒子参数)都支持范围("x..y"=从 x 到 y 的随机值),旋转参数也支持 ~,它将在适当的轴上使用命令旋转上下文
-
除 lifetime 外的所有数字参数都支持动画序列("x->y->z" = 从 x 动画过渡到 y 再到 z),支持任意数量的关键帧,您还可以添加更多连字符来控制关键帧的时间
-
旋转参数支持 billboard 作为值,这将使粒子在其指定的轴上面向玩家的相机
-
另外,如果你想知道,post_rotation 只是第二次旋转传递,技术上来说是多余的,但为了方便使用
纹理
目前实现了 8 种纹理:
dot
dither
smooth
pixel
shockwave
spark
dither_beam
smooth_beam
有 5 个独立命令
命令
/fov <add|multiply|set|query> <targets> <float> [interpolation type] [interpolation duration]
/setperspective <targets> <perspective index|distance> [camera distance]
/rendertext <targets> <x> <y> <z> <rotation> <text> <alignment> <sizeX> <sizeY> [duration] [opacity] {options}
- 在目标屏幕上输入的位置显示文本
- {options} 是一个接受以下内容的复合选项:
offset:[x,y] extraColor:O/S#RGBA|none(S 表示阴影,O 表示轮廓,颜色还接受 followx<bright mult><alpha mult>) hideWithHud/hudHidden:bool guiScaleIndependent/scaleIndependent:bool overlay:bool angle:int fade:{in:int,out:int} blend/blendMode:additive/add/glow | invert/inverted/exclusion/difference | multiply
/log <client|server> [targets] <logger name> <message>
/camerarot <targets> <pitch> <yaw> <roll> [duration]
注意
(滚转工作完美,偏航和俯仰在技术上也可以,只是有点不直观,在大多数情况下,最好使用实际的实体旋转)
该模组为谓词添加了 3 种条件
谓词
mouse* 条件
{
"condition": "staticparticle:player_action",
"action": "attack"/"pick_item"/"use"/"scroll_up"/"scroll_down",
"context": "in_game"/"in_menu"
}
key 条件
- 该模组添加了 5 个新的按键绑定,它们除了告诉服务器客户端已按下外没有任何作用
{
"condition": "staticparticle:special_key",
"key": 0/1/2/3/4
}
movement input 条件
{
"condition": "staticparticle:input",
"action": "forward/back/left/right/jump/sprint/sneak"
}
该模组还允许服务器将值发送到资源包着色器中
如何实现
将数据块添加到着色器中
layout(std140) uniform SP_Data {
vec4 slots[64];
} uniformData;
现在你可以使用 uniformData.slots[<index>] 从中获取数据,请记住,它是一个 vec4
使用 /execute store result uniform <players> <index> run - 将数据发送到着色器中
值将在客户端缓存直到从服务器更新,你可以设置一次值,只要客户端运行它就会一直存在,由于 Brigadier 只能返回整数,因此值始终以整数形式传递
⚠️ please keep in mind that the description is only maintained for the latest version
2 particle types are implemented
particles
static_particle
- configurable
color, alpha, size, lifetime, texture
- is emissive (glow in the dark)
static_oriented
- configurable
color, alpha, sizeX, sizeY, lifetime, rotation, post_rotation, cull, texture
- is emissive (glow in the dark)
note
important thing to know is that all number arguments are actually string arguments, due to a limitation of minecrafts codebase, its so that the stuff listed below can work
⠀
-
all number arguments(the particle parameters) support ranges ("x..y"=random from x to y), rotation arguments also support ~ which will use the command rotation context on the appropriate axis
-
all number arguments except lifetime support animation sequences ("x->y->z" = animate from x to y to z), any amount of keyframes is supported, you can also add more dashes to control the timing of the keyframes
-
the rotation arguments support billboard as a value, which will cause the particle to face the players camera on he specified axes
-
also if youre wondering, post_rotation is just a second pass of rotation, technically redundant, just convenient
textures
currently 8 textures are implemented:
dot
dither
smooth
pixel
shockwave
spark
dither_beam
smooth_beam
there are 5 standalone commands
commands
/fov <add|multiply|set|query> <targets> <float> [interpolation type] [interpolation duration]
- changes/gets the client FOV of the targets
/setperspective <targets> <perspective index|distance> [camera distance]
- changes the client perspective
/rendertext <targets> <x> <y> <z> <rotation> <text> <alignment> <sizeX> <sizeY> [duration] [opacity] {options}
- displays text on the targets screens at the inputted position
- {options} is a compound accepting
offset:[x,y] extraColor:O/S#RGBA|none(S for shadow, O for outline, color also accepts followx<bright mult><alpha mult>) hideWithHud/hudHidden:bool guiScaleIndependent/scaleIndependent:bool overlay:bool angle:int fade:{in:int,out:int} blend/blendMode:additive/add/glow | invert/inverted/exclusion/difference | multiply
/log <client|server> [targets] <logger name> <message>
- sends the message under the logger name in the client's/server's console (not in chat)
/camerarot <targets> <pitch> <yaw> <roll> [duration]
- adds rotation offset to the client camera (linear interpolation)
note
(roll works perfectly, yaw and pitch technically do too, just a bit un-intuitive, in most cases its better to use actual entity rotation instead)
the mod adds 3 conditions for predicates
predicates
mouse* condition
{
"condition": "staticparticle:player_action",
"action": "attack"/"pick_item"/"use"/"scroll_up"/"scroll_down",
"context": "in_game"/"in_menu"
}
- true when the target of the predicate is holding the respective buttons in the respective context
key condition
- the mod adds 5 new keybinds that dont do anything, except for tell the server theyve been pressed by a client
{
"condition": "staticparticle:special_key",
"key": 0/1/2/3/4
}
- true when the target of the predicate is holding the respective key
movement input condition
{
"condition": "staticparticle:input",
"action": "forward/back/left/right/jump/sprint/sneak"
}
the mod also adds a way for the server to send in values into resourcepack shaders
how to implement
add the datablock to a shader
layout(std140) uniform SP_Data {
vec4 slots[64];
} uniformData;
you can now use uniformData.slots[<index>] to get data from it, keep in mind, its a vec4
use /execute store result uniform <players> <index> run - to send data into the shaders
values will be cached on the client until updated from the server, you can set a value once and itll stay for as long as the client is running, values are always passed in as integers since brigadier can only return integers anyway
评论 0
登录后参与评分
还没有评论,来抢沙发吧