diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2017-10-09 11:17:34 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2017-10-09 11:17:34 +0100 |
commit | fa180c3c45ebe068a5f620dcae63e275b8ed3854 (patch) | |
tree | b134ebf6a53baba4922bce9087fc325b486e98e3 | |
parent | 87378233a1e51981b9c4b4202bb1f314feabd172 (diff) |
Updating to 0.4.16+ functions
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | bonemeal.lua | 9 | ||||
-rw-r--r-- | extra.lua | 4 | ||||
-rw-r--r-- | init.lua | 10 |
4 files changed, 16 insertions, 11 deletions
@@ -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 diff --git a/bonemeal.lua b/bonemeal.lua index 1de4cbc..60f7ef3 100644 --- a/bonemeal.lua +++ b/bonemeal.lua @@ -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,
@@ -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 @@ -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")
|