Updating to 0.4.16+ functions

master
TenPlus1 2017-10-09 11:17:34 +01:00
parent 87378233a1
commit fa180c3c45
4 changed files with 16 additions and 11 deletions

View File

@ -10,6 +10,10 @@ Ethereal Mapgen mod for Minetest (works on all except v6)
## Changelog
### 1.24
- Updating code to newer functions, requires Minetest 0.4.16 and above
### 1.23
- Added bonemeal support for bush sapling and acacia bush sapling

View File

@ -295,18 +295,13 @@ minetest.register_craftitem("ethereal:bonemeal", {
return
end
if not minetest.setting_getbool("creative_mode") then
if not ethereal.check_creative(user:get_player_name()) then
local item = user:get_wielded_item()
item:take_item()
user:set_wielded_item(item)
itemstack:take_item()
end
growth(pointed_thing)
itemstack:take_item()
return itemstack
end
end,

View File

@ -107,7 +107,7 @@ minetest.register_node("ethereal:candle", {
length = 1.0
}
},
},
},
paramtype = "light",
light_source = 11,
sunlight_propagates = true,
@ -288,7 +288,7 @@ minetest.register_tool("ethereal:light_staff", {
minetest.swap_node(pos, {name = "ethereal:glostone"})
if not minetest.setting_getbool("creative_mode") then
if not ethereal.check_creative(user:get_player_name()) then
itemstack:add_wear(65535 / 149) -- 150 uses
end

View File

@ -1,6 +1,6 @@
--[[
Minetest Ethereal Mod (1st March 2017)
Minetest Ethereal Mod
Created by ChinChow
@ -9,7 +9,7 @@
]]
ethereal = {} -- DO NOT change settings below, use the settings.conf file
ethereal.version = "1.22"
ethereal.version = "1.24"
ethereal.leaftype = 0 -- 0 for 2D plantlike, 1 for 3D allfaces
ethereal.leafwalk = false -- true for walkable leaves, false to fall through
ethereal.cavedirt = true -- caves chop through dirt when true
@ -72,6 +72,12 @@ ethereal.intllib = S
-- Falling node function
ethereal.check_falling = minetest.check_for_falling or nodeupdate
-- creative check
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
function ethereal.check_creative(name)
return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
end
dofile(path .. "/plantlife.lua")
dofile(path .. "/mushroom.lua")
dofile(path .. "/onion.lua")