mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
test removing client-side logic in headless (base pack scripts/components)
This commit is contained in:
parent
fc80feeb84
commit
2afadb4ae6
6 changed files with 26 additions and 25 deletions
|
|
@ -26,7 +26,6 @@ function on_save()
|
|||
end
|
||||
|
||||
if not VC_HEADLESS then
|
||||
local SCALE = 0.3
|
||||
local scale = {1, 1, 1}
|
||||
local rotation = mat4.rotate({
|
||||
math.random(), math.random(), math.random()
|
||||
|
|
@ -35,8 +34,8 @@ if not VC_HEADLESS then
|
|||
do
|
||||
local matrix = mat4.idt()
|
||||
rig:set_model(0, item.model_name(dropitem.id))
|
||||
local bodysize = math.min(scale[1], scale[2], scale[3]) * SCALE
|
||||
body:set_size({scale[1] * SCALE, bodysize, scale[3] * SCALE})
|
||||
local bodysize = math.min(scale[1], scale[2], scale[3])
|
||||
body:set_size({scale[1], bodysize, scale[3]})
|
||||
mat4.mul(matrix, rotation, matrix)
|
||||
mat4.scale(matrix, scale, matrix)
|
||||
rig:set_matrix(0, matrix)
|
||||
|
|
@ -103,9 +102,7 @@ function on_sensor_enter(index, oid)
|
|||
if timer < 0.0 and index == 0 then
|
||||
entity:despawn()
|
||||
inventory.add(player.get_inventory(pid), dropitem.id, dropitem.count, dropitem.data)
|
||||
if not VC_HEADLESS then
|
||||
audio.play_sound_2d("events/pickup", 0.5, 0.8 + math.random() * 0.4, "regular")
|
||||
end
|
||||
audio.play_sound_2d("events/pickup", 0.5, 0.8 + math.random() * 0.4, "regular")
|
||||
end
|
||||
if index == 1 then
|
||||
target = oid
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
local tsf = entity.transform
|
||||
local body = entity.rigidbody
|
||||
local rig = entity.skeleton
|
||||
|
||||
local blockid = ARGS.block
|
||||
local blockstates = ARGS.states or 0
|
||||
|
|
@ -12,7 +11,8 @@ else
|
|||
SAVED_DATA.states = blockstates
|
||||
end
|
||||
|
||||
do -- setup visuals
|
||||
if not VC_HEADLESS then-- setup visuals
|
||||
local rig = entity.skeleton
|
||||
local id = block.index(blockid)
|
||||
local rotation = block.decompose_state(blockstates)[1]
|
||||
local textures = block.get_textures(id)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
local tsf = entity.transform
|
||||
local body = entity.rigidbody
|
||||
local rig = entity.skeleton
|
||||
local mob = entity:require_component("core:mob")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue