mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
fix entities.spawn in coroutines
This commit is contained in:
parent
35a6985d7e
commit
bbe5688a53
3 changed files with 12 additions and 3 deletions
|
|
@ -1,10 +1,12 @@
|
|||
local util = require("core:tests_util")
|
||||
local util = require "core:tests_util"
|
||||
|
||||
-- Create world and prepare settings
|
||||
util.create_demo_world("core:default")
|
||||
app.set_setting("chunks.load-distance", 3)
|
||||
app.set_setting("chunks.load-speed", 1)
|
||||
|
||||
local base_util = require "base:util"
|
||||
|
||||
-- Create player
|
||||
local pid = player.create("Xerxes")
|
||||
player.set_spawnpoint(pid, 0, 100, 0)
|
||||
|
|
@ -22,3 +24,7 @@ assert(block.get(0, 2, 0) == 0)
|
|||
|
||||
-- Wait for the block to fall
|
||||
app.sleep_until(function () return block.get(0, 1, 0) == block.index("base:sand") end, 100)
|
||||
|
||||
local drop = base_util.drop({player.get_pos(pid)}, item.index("base:bazalt_breaker"), 11)
|
||||
assert(drop ~= nil)
|
||||
assert(drop.rigidbody ~= nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue