add drop-item model, new block functions
This commit is contained in:
@@ -17,27 +17,32 @@ vt 1.0 1.0
|
||||
vt 0.0 1.0
|
||||
vt 1.0 0.0
|
||||
vt 1.0 1.0
|
||||
vt 0.0 1.0
|
||||
vt 0.0 0.0
|
||||
vt 1.0 0.0
|
||||
vt 0.0 1.0
|
||||
vt 0.0 0.0
|
||||
vt 0.0 1.0
|
||||
vt 1.0 0.0
|
||||
vt 1.0 1.0
|
||||
vt 1.0 0.0
|
||||
vt 1.0 1.0
|
||||
vt 0.0 1.0
|
||||
vt 0.0 0.0
|
||||
vn 0.0 -1.0 0.0
|
||||
vn 0.0 1.0 0.0
|
||||
vn 1.0 -0.0 0.0
|
||||
vn -0.0 -0.0 1.0
|
||||
vn -1.0 -0.0 -0.0
|
||||
vn 0.0 0.0 -1.0
|
||||
usemtl $0
|
||||
vn -0.0 -0.0 1.0
|
||||
usemtl $2
|
||||
s off
|
||||
f 1/1/1 2/2/1 3/3/1 4/4/1
|
||||
usemtl $3
|
||||
f 5/5/2 8/6/2 7/7/2 6/8/2
|
||||
f 1/1/3 5/9/3 6/10/3 2/11/3
|
||||
f 2/12/4 6/13/4 7/7/4 3/14/4
|
||||
f 3/15/5 7/16/5 8/17/5 4/4/5
|
||||
f 5/5/6 1/18/6 4/19/6 8/20/6
|
||||
usemtl $0
|
||||
f 1/9/3 5/10/3 6/8/3 2/11/3
|
||||
usemtl $1
|
||||
f 3/12/4 7/7/4 8/13/4 4/14/4
|
||||
usemtl $4
|
||||
f 5/15/5 1/1/5 4/16/5 8/17/5
|
||||
usemtl $5
|
||||
f 2/2/6 6/18/6 7/19/6 3/20/6
|
||||
@@ -5,10 +5,11 @@
|
||||
"events/pickup"
|
||||
],
|
||||
"models": [
|
||||
"cube",
|
||||
"item"
|
||||
"drop-block",
|
||||
"drop-item"
|
||||
],
|
||||
"rigs": [
|
||||
"drop"
|
||||
"drop",
|
||||
"drop-item"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"root": {
|
||||
"model": "drop-item"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"root": {
|
||||
"model": "cube"
|
||||
"model": "drop-block"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,19 +7,27 @@ ready = false
|
||||
|
||||
local dropitem = ARGS.item
|
||||
|
||||
local rotation = mat4.rotate({0, 1, 0}, math.random() * 360)
|
||||
mat4.rotate(rotation, {1, 0, 0}, math.random() * 360, rotation)
|
||||
mat4.rotate(rotation, {0, 0, 1}, math.random() * 360, rotation)
|
||||
rig:set_matrix(0, rotation)
|
||||
local icon = item.icon(dropitem.id)
|
||||
if icon:find("^block%-previews%:") then
|
||||
local bid = block.index(icon:sub(16))
|
||||
local textures = block.get_textures(bid)
|
||||
for i,t in ipairs(textures) do
|
||||
rig:set_texture("$"..tostring(i-1), "blocks:"..textures[i])
|
||||
do -- setup visuals
|
||||
local rotation = mat4.rotate({0, 1, 0}, math.random() * 360)
|
||||
mat4.rotate(rotation, {1, 0, 0}, math.random() * 360, rotation)
|
||||
mat4.rotate(rotation, {0, 0, 1}, math.random() * 360, rotation)
|
||||
rig:set_matrix(0, rotation)
|
||||
local icon = item.icon(dropitem.id)
|
||||
if icon:find("^block%-previews%:") then
|
||||
local bid = block.index(icon:sub(16))
|
||||
if block.get_model(bid) == "X" then
|
||||
entity:set_rig("drop-item")
|
||||
rig:set_texture("$0", icon)
|
||||
else
|
||||
local textures = block.get_textures(bid)
|
||||
for i,t in ipairs(textures) do
|
||||
rig:set_texture("$"..tostring(i-1), "blocks:"..textures[i])
|
||||
end
|
||||
end
|
||||
else
|
||||
entity:set_rig("drop-item")
|
||||
rig:set_texture("$0", icon)
|
||||
end
|
||||
else
|
||||
rig:set_texture("$0", icon)
|
||||
end
|
||||
|
||||
function on_grounded(force)
|
||||
|
||||
Reference in New Issue
Block a user