Adds a pair of mixins that calculate velocity from the entity's current position and the position in the tick prior.
Test program:
local mods = peripheral.wrap("back")
mods.canvas().clear()
local text = mods.canvas().addText({0,0}, "")
while true do
local meta = mods.getMetaOwner()
text.setText(meta.motionX.." "..meta.motionY.." "..meta.motionZ)
end
Use on NI with introspection module, overlay glasses, and entity sensor.
Move around, see velocity change.
When changing dimensions, for a single tick, the entity velocity spikes. Should this be intended behavior?
Some alternatives:
Providing the dimension the entity is in in the metadata so the player can account for this programmatically.
Storing positions per dimension. This has the side effect that when entering the nether, heading to another portal and exiting the nether through it, the overworld velocity will spike.
Assuming the entity's velocity is always 0 when entering any dimension. I think this might be the best bet, but I like the idea of exposing the dimension the entity is in too...
Fixes SwitchCraftCC/Plethora-Fabric#52.
Adds a pair of mixins that calculate velocity from the entity's current position and the position in the tick prior.
Test program:
Use on NI with introspection module, overlay glasses, and entity sensor. Move around, see velocity change.