Updated for 0.4.11 dev and above

This commit is contained in:
tenplus1 2015-03-01 11:20:12 +00:00
parent 41e4423dd9
commit 7db8a5122f
6 changed files with 30 additions and 12 deletions

View File

@ -148,7 +148,7 @@ minetest.register_tool("ethereal:shovel_crystal", {
local inv = user:get_inventory() local inv = user:get_inventory()
minetest.env:remove_node(pointed_thing.under) minetest.remove_node(pointed_thing.under)
nodeupdate(pos) nodeupdate(pos)
inv:add_item("main", {name = nn}) inv:add_item("main", {name = nn})

View File

@ -285,9 +285,9 @@ minetest.register_tool("ethereal:light_staff", {
local node = minetest.get_node(pos).name local node = minetest.get_node(pos).name
if node == "default:stone" then if node == "default:stone" then
minetest.env:add_node(pos, {name="ethereal:glostone"}) minetest.add_node(pos, {name="ethereal:glostone"})
elseif node == "ethereal:glostone" then elseif node == "ethereal:glostone" then
minetest.env:add_node(pos, {name="default:stone"}) minetest.add_node(pos, {name="default:stone"})
end end
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then

View File

@ -49,7 +49,7 @@ minetest.register_craftitem("ethereal:fishing_rod_baited", {
liquids_pointable = true, liquids_pointable = true,
on_use = function (itemstack, user, pointed_thing) on_use = function (itemstack, user, pointed_thing)
if pointed_thing and pointed_thing.under then if pointed_thing and pointed_thing.under then
local node = minetest.env:get_node(pointed_thing.under) local node = minetest.get_node(pointed_thing.under)
if string.find(node.name, "default:water_source") then if string.find(node.name, "default:water_source") then
if math.random(1, 100) < 5 then if math.random(1, 100) < 5 then
local inv = user:get_inventory() local inv = user:get_inventory()

View File

@ -1,6 +1,6 @@
--[[ --[[
Minetest Ethereal Mod 1.14 (4th Feb 2015) Minetest Ethereal Mod 1.14 (1st March 2015)
Created by ChinChow Created by ChinChow
@ -54,8 +54,8 @@ dofile(minetest.get_modpath("ethereal").."/sealife.lua")
dofile(minetest.get_modpath("ethereal").."/fences.lua") dofile(minetest.get_modpath("ethereal").."/fences.lua")
dofile(minetest.get_modpath("ethereal").."/gates.lua") dofile(minetest.get_modpath("ethereal").."/gates.lua")
dofile(minetest.get_modpath("ethereal").."/stairs.lua") dofile(minetest.get_modpath("ethereal").."/stairs.lua")
dofile(minetest.get_modpath("ethereal").."/mapgen_v7s.lua") --dofile(minetest.get_modpath("ethereal").."/mapgen_v7s.lua") -- 0.4.11 and below
--dofile(minetest.get_modpath("ethereal").."/mapgen_v7n.lua") -- 0.4.11 dev only dofile(minetest.get_modpath("ethereal").."/mapgen_v7n.lua") -- 0.4.11 dev and above
-- Xanadu server Only -- Xanadu server Only
--dofile(minetest.get_modpath("ethereal").."/plantpack.lua") --dofile(minetest.get_modpath("ethereal").."/plantpack.lua")

View File

@ -40,7 +40,7 @@ ethereal.register_sapling( "ethereal:acacia_sapling", "Acacia Sapling", "moretre
ethereal.place_tree = function (pos, ofx, ofz, schem) ethereal.place_tree = function (pos, ofx, ofz, schem)
-- Remove Sapling and Place Tree Schematic -- Remove Sapling and Place Tree Schematic
minetest.env:set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
pos.x = pos.x - ofx pos.x = pos.x - ofx
pos.z = pos.z - ofz pos.z = pos.z - ofz
minetest.place_schematic(pos, minetest.get_modpath("ethereal").."/schematics/"..schem..".mts", "0", {}, false ); minetest.place_schematic(pos, minetest.get_modpath("ethereal").."/schematics/"..schem..".mts", "0", {}, false );

View File

@ -66,9 +66,9 @@ minetest.register_abm({
local pos0 = {x=pos.x-1,y=pos.y-1,z=pos.z-1} local pos0 = {x=pos.x-1,y=pos.y-1,z=pos.z-1}
local pos1 = {x=pos.x+1,y=pos.y+1,z=pos.z+1} local pos1 = {x=pos.x+1,y=pos.y+1,z=pos.z+1}
local water = minetest.env:find_nodes_in_area(pos0, pos1, "default:water_source") local water = minetest.find_nodes_in_area(pos0, pos1, "default:water_source")
if water then if water then
minetest.env:set_node(water[1], {name="default:ice"}) minetest.set_node(water[1], {name="default:ice"})
end end
end, end,
}) })
@ -118,12 +118,30 @@ minetest.register_abm({
local pos0 = {x=pos.x-1,y=pos.y-1,z=pos.z-1} local pos0 = {x=pos.x-1,y=pos.y-1,z=pos.z-1}
local pos1 = {x=pos.x+1,y=pos.y+1,z=pos.z+1} local pos1 = {x=pos.x+1,y=pos.y+1,z=pos.z+1}
local water = minetest.env:find_nodes_in_area(pos0, pos1, "group:water") local water = minetest.find_nodes_in_area(pos0, pos1, "group:water")
if water then if water then
for n = 1, #water do for n = 1, #water do
minetest.env:set_node(water[n], {name="air"}) minetest.set_node(water[n], {name="air"})
end end
end end
end, end,
}) })
]] ]]
--[[
-- If torch next to water then drop torch
minetest.register_abm({
nodenames = {"default:torch"},
neighbors = {"default:water_source", "default:water_flowing"},
interval = 1,
chance = 1,
action = function(pos, node)
local pos0 = {x=pos.x-1,y=pos.y,z=pos.z-1}
local pos1 = {x=pos.x+1,y=pos.y+1,z=pos.z+1}
if #minetest.find_nodes_in_area(pos0, pos1, {"default:water_source", "default:water_flowing"}) > 0 then
minetest.set_node(pos, {name="default:water_flowing"})
minetest.add_item(pos, {name = "default:torch"})
end
end,
})
]]