forked from VoxeLibre/VoxeLibre
Use protection to make a worldborder
This commit is contained in:
parent
859892d3b2
commit
f84dcf0940
|
@ -38,7 +38,8 @@ minetest.register_craftitem("mcljepc_core:block", {
|
|||
nodename = "mcljepc_core:grass"
|
||||
end
|
||||
|
||||
minetest.set_node(pointed_thing.above, { name = nodename })
|
||||
-- Unlike set node, this actually checks against protection
|
||||
minetest.item_place(ItemStack(nodename), user, pointed_thing)
|
||||
end,
|
||||
on_drop = function(itemstack, dropper, pos)
|
||||
return itemstack
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
local ymax = 21
|
||||
local ymin = mcljepc_mapgen.depth * -1
|
||||
local zmax = mcljepc_mapgen.size
|
||||
local zmin = mcljepc_mapgen.size * -1
|
||||
local xmax = mcljepc_mapgen.size
|
||||
local xmin = mcljepc_mapgen.size * -1
|
||||
local old_is_protected = minetest.is_protected
|
||||
function minetest.is_protected(pos, name)
|
||||
return old_is_protected(pos, name) or not (
|
||||
ymin < pos.y and pos.y < ymax
|
||||
and zmin < pos.z and pos.z < zmax
|
||||
and xmin < pos.x and pos.x < xmax
|
||||
)
|
||||
end
|
|
@ -0,0 +1,2 @@
|
|||
name = mcljepc_fakeworldborder
|
||||
depends = mcljepc_mapgen,mcljepc_core
|
Loading…
Reference in New Issue