minetest.env:* --> minetest.* (#2)
* minetest.env:* --> minetest.* * tile_images --> tiles * Add standard mod files. * Rewrote the mod to use the new param2 color method New dependency on Unified Dyes. This change comes with a few neutral-to-positive side effects: 1) Minor recipe changes were necessary since there are only two blocks and two poles now. 2) All recipes, node names, etc. were updated to current minetest API. 3) Where recipes called for leaves or sticks, I used groups. 4) the "wavy" (formerly "grey") block and fence/pole can now be colored as well. 5) Inside the conversion LBM, some of the original colors were re-mapped to the closest Unified Dyes equivalents, to try to keep the on-screen appearance mostly the same after conversion. 6) Aside from "BTM" and "Health", all block and pole nodes can take on the entire Unified Dyes palette instead of just the 9 originally offered. Mod works the same as others that depend on Unified Dyes - craft and place a block or pole, then right-click on it with dye to colorize it. * unified dyes uses on_use now, instead of on_rightclick * don't run the LBM at every load
1015
blocks.lua
@ -1,2 +1,3 @@
|
||||
default
|
||||
mesecons
|
||||
unifieddyes
|
||||
|
1
description.txt
Normal file
@ -0,0 +1 @@
|
||||
Add some colorful nodes to building and also to add light.
|
10
health.lua
@ -14,7 +14,7 @@ local update_healthpack = function (pos, node)
|
||||
elseif node.name == 'bobblocks:health_on' then
|
||||
nodename = 'bobblocks:health_off'
|
||||
end
|
||||
minetest.env:add_node(pos, {name = nodename})
|
||||
minetest.add_node(pos, {name = nodename})
|
||||
end
|
||||
|
||||
local toggle_healthpack = function (pos, node)
|
||||
@ -32,7 +32,7 @@ end
|
||||
|
||||
minetest.register_node("bobblocks:health_off", {
|
||||
description = "Health Pack 1 Off",
|
||||
tile_images = {"bobblocks_health_off.png"},
|
||||
tiles = {"bobblocks_health_off.png"},
|
||||
inventory_image = "bobblocks_health_off.png",
|
||||
paramtype2 = "facedir",
|
||||
legacy_facedir_simple = true,
|
||||
@ -48,7 +48,7 @@ minetest.register_node("bobblocks:health_off", {
|
||||
|
||||
minetest.register_node("bobblocks:health_on", {
|
||||
description = "Health Pack 1 On",
|
||||
tile_images = {"bobblocks_health_on.png"},
|
||||
tiles = {"bobblocks_health_on.png"},
|
||||
paramtype2 = "facedir",
|
||||
legacy_facedir_simple = true,
|
||||
light_source = LIGHT_MAX-0,
|
||||
@ -69,12 +69,12 @@ minetest.register_abm(
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
minetest.sound_play("bobblocks_health",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||
obj:set_hp(obj:get_hp()+10) -- give 10HP
|
||||
minetest.env:remove_node(pos) -- remove the node after use
|
||||
minetest.remove_node(pos) -- remove the node after use
|
||||
end
|
||||
end,
|
||||
|
||||
|
BIN
textures/bobblocks_block.png
Normal file
After Width: | Height: | Size: 652 B |
BIN
textures/bobblocks_block_off.png
Normal file
After Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
BIN
textures/bobblocks_pole_inv.png
Normal file
After Width: | Height: | Size: 452 B |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
BIN
textures/bobblocks_wavyblock.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
textures/bobblocks_wavypole_inv.png
Normal file
After Width: | Height: | Size: 747 B |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
20
trap.lua
@ -11,7 +11,7 @@ local update_bobtrap = function (pos, node)
|
||||
elseif node.name == 'bobblocks:trap_spike_major' then nodename = 'bobblocks:trap_spike_major_set'
|
||||
elseif node.name == 'bobblocks:trap_spike_major_set' then nodename = 'bobblocks:trap_spike_major'
|
||||
end
|
||||
minetest.env:add_node(pos, {name = nodename})
|
||||
minetest.add_node(pos, {name = nodename})
|
||||
end
|
||||
|
||||
-- Punch Traps
|
||||
@ -35,7 +35,7 @@ minetest.register_abm(
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
|
||||
update_bobtrap(pos, node)
|
||||
@ -49,7 +49,7 @@ minetest.register_abm(
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
|
||||
update_bobtrap(pos, node)
|
||||
@ -64,7 +64,7 @@ minetest.register_abm(
|
||||
-- Nodes
|
||||
minetest.register_node("bobblocks:trap_grass", {
|
||||
description = "Trap Grass",
|
||||
tile_images = {"default_grass.png"},
|
||||
tiles = {"default_grass.png"},
|
||||
paramtype2 = "facedir",
|
||||
legacy_facedir_simple = true,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
@ -77,7 +77,7 @@ minetest.register_node("bobblocks:trap_spike", {
|
||||
description = "Trap Spike Minor",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1,
|
||||
tile_images = {"bobblocks_minorspike.png"},
|
||||
tiles = {"bobblocks_minorspike.png"},
|
||||
inventory_image = ("bobblocks_minorspike.png"),
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
@ -89,7 +89,7 @@ minetest.register_node("bobblocks:trap_spike_set", {
|
||||
description = "Trap Spike Minor Set",
|
||||
drawtype = "raillike",
|
||||
visual_scale = 1,
|
||||
tile_images = {"bobblocks_trap_set.png"},
|
||||
tiles = {"bobblocks_trap_set.png"},
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
@ -102,7 +102,7 @@ minetest.register_node("bobblocks:trap_spike_major", {
|
||||
description = "Trap Spike Major",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1,
|
||||
tile_images = {"bobblocks_majorspike.png"},
|
||||
tiles = {"bobblocks_majorspike.png"},
|
||||
inventory_image = ("bobblocks_majorspike.png"),
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
@ -114,7 +114,7 @@ minetest.register_node("bobblocks:trap_spike_major_set", {
|
||||
description = "Trap Spike Major Set",
|
||||
drawtype = "raillike",
|
||||
visual_scale = 1,
|
||||
tile_images = {"bobblocks_trap_set.png"},
|
||||
tiles = {"bobblocks_trap_set.png"},
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
@ -158,7 +158,7 @@ minetest.register_abm(
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
obj:set_hp(obj:get_hp()-1)
|
||||
minetest.sound_play("bobblocks_trap_fall",
|
||||
@ -172,7 +172,7 @@ minetest.register_abm(
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||
for k, obj in pairs(objs) do
|
||||
obj:set_hp(obj:get_hp()-100)
|
||||
minetest.sound_play("bobblocks_trap_fall",
|
||||
|