vacuum compat, jumping with air compartment into ignore works
This commit is contained in:
parent
a518f6a266
commit
29ca8dcf16
17
air.lua
Normal file
17
air.lua
Normal file
@ -0,0 +1,17 @@
|
||||
-- jumpdrive buffer air (for vacuum jumps)
|
||||
|
||||
minetest.register_node("jumpdrive:air", {
|
||||
description = "Jumpdrive buffer air",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
drawtype = "glasslike",
|
||||
tiles = {"jumpdrive_air.png"},
|
||||
groups = {not_in_creative_inventory=0},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_timer = function(pos,elapsed)
|
||||
minetest.set_node(pos, {name="air"})
|
||||
end
|
||||
})
|
10
common.lua
10
common.lua
@ -1,4 +1,5 @@
|
||||
|
||||
local has_vacuum_mod = minetest.get_modpath("vacuum")
|
||||
local has_travelnet_mod = minetest.get_modpath("travelnet")
|
||||
local has_technic_mod = minetest.get_modpath("technic")
|
||||
local has_elevator_mod = minetest.get_modpath("elevator")
|
||||
@ -235,6 +236,15 @@ jumpdrive.execute_jump = function(pos, player)
|
||||
return true
|
||||
end
|
||||
|
||||
if node.name == "air" and newNode.name == "ignore" and has_vacuum_mod then
|
||||
-- fill air with buffer air
|
||||
minetest.set_node(to, {name="jumpdrive:air"})
|
||||
local timer = minetest.get_node_timer(to)
|
||||
-- buffer air expires after 10 seconds
|
||||
timer:start(10)
|
||||
return true
|
||||
end
|
||||
|
||||
local meta = minetest.get_meta(from):to_table() -- Get metadata of current node
|
||||
minetest.set_node(from, {name="air"}) -- perf reason (faster)
|
||||
|
||||
|
5
init.lua
5
init.lua
@ -1,3 +1,4 @@
|
||||
local has_vacuum_mod = minetest.get_modpath("vacuum")
|
||||
|
||||
jumpdrive = {
|
||||
config = {
|
||||
@ -18,6 +19,10 @@ jumpdrive = {
|
||||
|
||||
local MP = minetest.get_modpath("jumpdrive")
|
||||
|
||||
if has_vacuum_mod then
|
||||
dofile(MP.."/air.lua")
|
||||
end
|
||||
|
||||
dofile(MP.."/marker.lua")
|
||||
dofile(MP.."/common.lua")
|
||||
dofile(MP.."/engine.lua")
|
||||
|
BIN
textures/jumpdrive_air.png
Normal file
BIN
textures/jumpdrive_air.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 144 B |
Loading…
x
Reference in New Issue
Block a user