vacuum compat, jumping with air compartment into ignore works

This commit is contained in:
Thomas Rudin 2018-05-29 10:37:34 +02:00
parent a518f6a266
commit 29ca8dcf16
4 changed files with 32 additions and 0 deletions

17
air.lua Normal file
View 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
})

View File

@ -1,4 +1,5 @@
local has_vacuum_mod = minetest.get_modpath("vacuum")
local has_travelnet_mod = minetest.get_modpath("travelnet") local has_travelnet_mod = minetest.get_modpath("travelnet")
local has_technic_mod = minetest.get_modpath("technic") local has_technic_mod = minetest.get_modpath("technic")
local has_elevator_mod = minetest.get_modpath("elevator") local has_elevator_mod = minetest.get_modpath("elevator")
@ -235,6 +236,15 @@ jumpdrive.execute_jump = function(pos, player)
return true return true
end 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 local meta = minetest.get_meta(from):to_table() -- Get metadata of current node
minetest.set_node(from, {name="air"}) -- perf reason (faster) minetest.set_node(from, {name="air"}) -- perf reason (faster)

View File

@ -1,3 +1,4 @@
local has_vacuum_mod = minetest.get_modpath("vacuum")
jumpdrive = { jumpdrive = {
config = { config = {
@ -18,6 +19,10 @@ jumpdrive = {
local MP = minetest.get_modpath("jumpdrive") local MP = minetest.get_modpath("jumpdrive")
if has_vacuum_mod then
dofile(MP.."/air.lua")
end
dofile(MP.."/marker.lua") dofile(MP.."/marker.lua")
dofile(MP.."/common.lua") dofile(MP.."/common.lua")
dofile(MP.."/engine.lua") dofile(MP.."/engine.lua")

BIN
textures/jumpdrive_air.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B