fix global check, add 9x lucky blocks, smoker has 200 uses
This commit is contained in:
parent
da07098441
commit
20258fe826
@ -1,2 +1,3 @@
|
|||||||
default
|
default
|
||||||
intllib?
|
intllib?
|
||||||
|
lucky_block?
|
||||||
|
65
init.lua
65
init.lua
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
-- Intllib support
|
-- Intllib support
|
||||||
local S
|
local S
|
||||||
if intllib then
|
if minetest.global_exists('intllib') then
|
||||||
S = intllib.Getter()
|
S = intllib.Getter()
|
||||||
else
|
else
|
||||||
S = function(s) return s end
|
S = function(s) return s end
|
||||||
@ -253,7 +253,12 @@ minetest.register_node('bees:bees', {
|
|||||||
damage_per_second = 1,
|
damage_per_second = 1,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
pointable = false,
|
selection_box = {
|
||||||
|
type = 'fixed',
|
||||||
|
fixed = {
|
||||||
|
{-0.3, -0.4, -0.3, 0.3, 0.4, 0.3},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
on_punch = function(pos, node, puncher)
|
on_punch = function(pos, node, puncher)
|
||||||
|
|
||||||
@ -854,13 +859,13 @@ minetest.register_tool('bees:smoker', {
|
|||||||
damage_groups = {fleshy = 2},
|
damage_groups = {fleshy = 2},
|
||||||
},
|
},
|
||||||
|
|
||||||
on_use = function(tool, user, node)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
|
|
||||||
if node then
|
if pointed_thing.type ~= "node" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local pos = node.under
|
local pos = pointed_thing.under
|
||||||
|
|
||||||
if pos then
|
|
||||||
|
|
||||||
for i = 1, 6 do
|
for i = 1, 6 do
|
||||||
|
|
||||||
@ -879,14 +884,13 @@ minetest.register_tool('bees:smoker', {
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
--tool:add_wear(2)
|
itemstack:add_wear(65535 / 200)
|
||||||
|
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
meta:set_int('agressive', 0)
|
meta:set_int('agressive', 0)
|
||||||
|
|
||||||
return nil
|
return itemstack
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -1195,4 +1199,43 @@ if minetest.get_modpath("pipeworks") then
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- LUCKY BLOCKS
|
||||||
|
|
||||||
|
if minetest.get_modpath('lucky_block') then
|
||||||
|
|
||||||
|
local add_bees = function(pos, player)
|
||||||
|
|
||||||
|
local objs = minetest.get_objects_inside_radius(pos, 15)
|
||||||
|
local violet = minetest.get_color_escape_sequence("#ff00ff")
|
||||||
|
|
||||||
|
minetest.chat_send_player(player:get_player_name(),
|
||||||
|
violet .. S("Bees! Bees for all!"))
|
||||||
|
|
||||||
|
for n = 1, #objs do
|
||||||
|
|
||||||
|
if objs[n]:is_player() then
|
||||||
|
|
||||||
|
local player_pos = objs[n]:get_pos()
|
||||||
|
|
||||||
|
player_pos.y = player_pos.y + 1
|
||||||
|
|
||||||
|
minetest.swap_node(player_pos, {name = 'bees:bees'})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
lucky_block:add_blocks({
|
||||||
|
{'cus', add_bees},
|
||||||
|
{'dro', {'bees:grafting_tool'}, 1},
|
||||||
|
{'dro', {'bees:frame_empty'}, 2},
|
||||||
|
{'dro', {'bees:queen'}, 1},
|
||||||
|
{'nod', 'bees:extractor'},
|
||||||
|
{'dro', {'bees:frame_full'}, 2},
|
||||||
|
{'dro', {'bees:bottle_honey'}, 3},
|
||||||
|
{'dro', {'bees:smoker'}, 1},
|
||||||
|
{'nod', 'bees:hive_artificial'},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
print(S('[MOD] Bees Loaded!'))
|
print(S('[MOD] Bees Loaded!'))
|
||||||
|
@ -12,6 +12,8 @@ FEATURES
|
|||||||
- Change compatibility abm to lbm
|
- Change compatibility abm to lbm
|
||||||
- Change from WTFPL to MIT license
|
- Change from WTFPL to MIT license
|
||||||
- Make wild hive abm less intensive (thanks VanessaE)
|
- Make wild hive abm less intensive (thanks VanessaE)
|
||||||
|
- Added 9x Lucky Blocks
|
||||||
|
- Smokers have 200 uses before breaking
|
||||||
|
|
||||||
2.2.2
|
2.2.2
|
||||||
- Pipeworks compatibility (Industrial beehive)
|
- Pipeworks compatibility (Industrial beehive)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user