Compare commits
19 Commits
a16e960ac1
...
ac8e6ca8f7
Author | SHA1 | Date | |
---|---|---|---|
ac8e6ca8f7 | |||
422d94e311 | |||
54614811d6 | |||
d18c76b578 | |||
4852ee7200 | |||
27c170fbed | |||
be5478c88b | |||
69cc65bc8a | |||
dbdaee8eed | |||
b900a7aff3 | |||
437275f8e4 | |||
1280300a4a | |||
d598f02bcd | |||
7ad7a5e842 | |||
e0ff72b43f | |||
eed93cbc5d | |||
31f5af2c58 | |||
0f2b5b7b2f | |||
20221b2618 |
135
blocks.lua
@ -18,7 +18,7 @@ bobblocks.colorlist = {
|
||||
|
||||
bobblocks.opacity = 150 -- Opacity: 0-255; 0 Full transparent, 255 Full opaque
|
||||
|
||||
bobblocks.update_bobblock = function (pos, node)
|
||||
local function update_bobblock(pos, node)
|
||||
local newnode = node
|
||||
if string.find(newnode.name, "_off") then
|
||||
newnode.name = string.sub(newnode.name, 1, -5)
|
||||
@ -31,6 +31,13 @@ bobblocks.update_bobblock = function (pos, node)
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||
end
|
||||
|
||||
bobblocks.update_bobblock = update_bobblock
|
||||
|
||||
local function dig_block(pos, node, digger)
|
||||
update_bobblock(pos, node)
|
||||
return unifieddyes.on_dig(pos, node, digger)
|
||||
end
|
||||
|
||||
-- Nodes
|
||||
|
||||
minetest.register_node("bobblocks:block", {
|
||||
@ -40,7 +47,6 @@ minetest.register_node("bobblocks:block", {
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
place_param2 = 240,
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
@ -51,9 +57,9 @@ minetest.register_node("bobblocks:block", {
|
||||
offstate = "bobblocks:block_off"
|
||||
}
|
||||
},
|
||||
on_rightclick = bobblocks.update_bobblock,
|
||||
on_rightclick = update_bobblock,
|
||||
on_construct = unifieddyes.on_construct,
|
||||
after_dig_node = unifieddyes.after_dig_node
|
||||
on_dig = unifieddyes.on_dig,
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:block_off", {
|
||||
@ -62,19 +68,17 @@ minetest.register_node("bobblocks:block_off", {
|
||||
tiles = {"bobblocks_block.png^[opacity:"..bobblocks.opacity},
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
place_param2 = 240,
|
||||
is_ground_content = false,
|
||||
use_texture_alpha = true,
|
||||
use_texture_alpha = "blend",
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1, ud_param2_colorable = 1},
|
||||
drop = "bobblocks:block",
|
||||
mesecons = {conductor={
|
||||
state = mesecon.state.off,
|
||||
onstate = "bobblocks:block"
|
||||
}
|
||||
},
|
||||
on_rightclick = bobblocks.update_bobblock,
|
||||
on_rightclick = update_bobblock,
|
||||
on_construct = unifieddyes.on_construct,
|
||||
after_dig_node = unifieddyes.after_dig_node
|
||||
on_dig = dig_block,
|
||||
})
|
||||
|
||||
-- Block Poles
|
||||
@ -86,7 +90,6 @@ minetest.register_node("bobblocks:pole", {
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
place_param2 = 240,
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
@ -97,9 +100,9 @@ minetest.register_node("bobblocks:pole", {
|
||||
offstate = "bobblocks:pole_off"
|
||||
}
|
||||
},
|
||||
on_rightclick = bobblocks.update_bobblock,
|
||||
on_rightclick = update_bobblock,
|
||||
on_construct = unifieddyes.on_construct,
|
||||
after_dig_node = unifieddyes.after_dig_node
|
||||
on_dig = unifieddyes.on_dig,
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:pole_off", {
|
||||
@ -109,25 +112,23 @@ minetest.register_node("bobblocks:pole_off", {
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
place_param2 = 240,
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
use_texture_alpha = true,
|
||||
use_texture_alpha = "blend",
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = LIGHT_MAX-10,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1, ud_param2_colorable = 1},
|
||||
drop = 'bobblocks:pole',
|
||||
mesecons = {conductor={
|
||||
state = mesecon.state.off,
|
||||
onstate = "bobblocks:pole"
|
||||
}
|
||||
},
|
||||
on_rightclick = bobblocks.update_bobblock,
|
||||
on_rightclick = update_bobblock,
|
||||
on_construct = unifieddyes.on_construct,
|
||||
after_dig_node = unifieddyes.after_dig_node
|
||||
on_dig = dig_block,
|
||||
})
|
||||
|
||||
-- old static nodes grandfathered-in because they have a different texture or usage than the colored ones.
|
||||
-- old nodes grandfathered-in because they have a different texture or usage than the colored ones.
|
||||
|
||||
minetest.register_node("bobblocks:btm", {
|
||||
description = "Bobs TransMorgifier v5",
|
||||
@ -146,7 +147,6 @@ minetest.register_node("bobblocks:wavyblock", {
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
place_param2 = 240,
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
@ -158,9 +158,9 @@ minetest.register_node("bobblocks:wavyblock", {
|
||||
offstate = "bobblocks:wavyblock_off"
|
||||
}
|
||||
},
|
||||
on_rightclick = bobblocks.update_bobblock,
|
||||
on_rightclick = update_bobblock,
|
||||
on_construct = unifieddyes.on_construct,
|
||||
after_dig_node = unifieddyes.after_dig_node
|
||||
on_dig = unifieddyes.on_dig,
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:wavyblock_off", {
|
||||
@ -169,20 +169,18 @@ minetest.register_node("bobblocks:wavyblock_off", {
|
||||
tiles = {"bobblocks_wavyblock.png^[opacity:"..bobblocks.opacity},
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
place_param2 = 240,
|
||||
is_ground_content = false,
|
||||
use_texture_alpha = true,
|
||||
use_texture_alpha = "blend",
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1, ud_param2_colorable = 1},
|
||||
drop = "bobblocks:wavyblock",
|
||||
mesecons = {conductor=
|
||||
{
|
||||
state = mesecon.state.off,
|
||||
onstate = "bobblocks:wavyblock"
|
||||
}
|
||||
},
|
||||
on_rightclick = bobblocks.update_bobblock,
|
||||
on_rightclick = update_bobblock,
|
||||
on_construct = unifieddyes.on_construct,
|
||||
after_dig_node = unifieddyes.after_dig_node
|
||||
on_dig = dig_block,
|
||||
})
|
||||
|
||||
minetest.register_node("bobblocks:wavypole", {
|
||||
@ -193,13 +191,12 @@ minetest.register_node("bobblocks:wavypole", {
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
place_param2 = 240,
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1},
|
||||
on_construct = unifieddyes.on_construct,
|
||||
after_dig_node = unifieddyes.after_dig_node,
|
||||
on_dig = unifieddyes.on_dig,
|
||||
--light_source = LIGHT_MAX-0,
|
||||
})
|
||||
|
||||
@ -224,6 +221,17 @@ minetest.register_craft({
|
||||
},
|
||||
})
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "bobblocks:block",
|
||||
palette = "extended",
|
||||
type = "shapeless",
|
||||
neutral_node = "bobblocks:block",
|
||||
recipe = {
|
||||
"NEUTRAL_NODE",
|
||||
"MAIN_DYE"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "bobblocks:pole",
|
||||
recipe = {
|
||||
@ -231,15 +239,50 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "bobblocks:pole",
|
||||
palette = "extended",
|
||||
type = "shapeless",
|
||||
neutral_node = "bobblocks:pole",
|
||||
recipe = {
|
||||
"NEUTRAL_NODE",
|
||||
"MAIN_DYE"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "bobblocks:wavyblock 2",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"bobblocks:block",
|
||||
"bobblocks:block"
|
||||
"default:cobble"
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "bobblocks:wavyblock 2",
|
||||
palette = "extended",
|
||||
type = "shapeless",
|
||||
neutral_node = "bobblocks:block",
|
||||
recipe = {
|
||||
"MAIN_DYE",
|
||||
"NEUTRAL_NODE",
|
||||
"default:cobble"
|
||||
}
|
||||
})
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "bobblocks:wavyblock",
|
||||
palette = "extended",
|
||||
type = "shapeless",
|
||||
neutral_node = "bobblocks:wavyblock",
|
||||
recipe = {
|
||||
"MAIN_DYE",
|
||||
"NEUTRAL_NODE"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "bobblocks:wavypole",
|
||||
recipe = {
|
||||
@ -247,6 +290,17 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "bobblocks:wavypole",
|
||||
palette = "extended",
|
||||
type = "shapeless",
|
||||
neutral_node = "bobblocks:wavypole",
|
||||
recipe = {
|
||||
"NEUTRAL_NODE",
|
||||
"MAIN_DYE"
|
||||
}
|
||||
})
|
||||
|
||||
-- Convert old static nodes to the param2 scheme
|
||||
|
||||
for _, i in ipairs(bobblocks.colorlist) do
|
||||
@ -278,7 +332,7 @@ minetest.register_lbm({
|
||||
|
||||
-- custom re-mappings to use unified dyes' colors that are most similar to the originals
|
||||
if color == "blue" then
|
||||
newcolor = "medium_skyblue"
|
||||
newcolor = "medium_azure"
|
||||
end
|
||||
if color == "indigo" then
|
||||
newcolor = "light_violet"
|
||||
@ -313,24 +367,3 @@ minetest.register_lbm({
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "bobblocks:recolor_stuff",
|
||||
label = "Convert 89-color fences to use UD extended palette",
|
||||
run_at_every_load = false,
|
||||
nodenames = {
|
||||
"bobblocks:block",
|
||||
"bobblocks:block_off",
|
||||
"bobblocks:pole",
|
||||
"bobblocks:pole_off",
|
||||
"bobblocks:wavyblock",
|
||||
"bobblocks:wavyblock_off",
|
||||
"bobblocks:wavypole"
|
||||
},
|
||||
action = function(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_string("palette") ~= "ext" then
|
||||
minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] })
|
||||
meta:set_string("palette", "ext")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
@ -1,3 +0,0 @@
|
||||
default
|
||||
mesecons
|
||||
unifieddyes
|
@ -1 +0,0 @@
|
||||
Add some colorful nodes to building and also to add light.
|
4
init.lua
@ -1,4 +1,4 @@
|
||||
print("[BobBlocks By minetest@rabbibob.com] Version 0.0.8 loading....")
|
||||
print("[BobBlocks By minetest@rabbibob.com] Version 0.0.9 loading....")
|
||||
print("[BobBlocks] loading Blocks")
|
||||
dofile(minetest.get_modpath("bobblocks") .. "/blocks.lua")
|
||||
print("[BobBlocks] loaded Blocks")
|
||||
@ -8,4 +8,4 @@ print("[BobBlocks] loaded Health")
|
||||
print("[BobBlocks] loading Traps")
|
||||
dofile(minetest.get_modpath("bobblocks") .. "/trap.lua")
|
||||
print("[BobBlocks] loaded Traps")
|
||||
print("[BobBlocks By minetest@rabbibob.com] Version 0.0.8 loaded!")
|
||||
print("[BobBlocks By minetest@rabbibob.com] Version 0.0.9 loaded!")
|
||||
|
2
mod.conf
@ -1 +1,3 @@
|
||||
name = bobblocks
|
||||
depends = default, mesecons, unifieddyes
|
||||
description = Add some colorful nodes to building and also to add light.
|
13
readme.txt
@ -1,8 +1,15 @@
|
||||
-- BobBlocks v0.0.8
|
||||
-- (Minetest 0.4.5 compatible 20130315)
|
||||
-- BobBlocks v0.0.9
|
||||
-- (Minetest 5.3.0 compatible 20201103)
|
||||
-- http://forum.minetest.net/viewtopic.php?id=1274
|
||||
--------------------------------------------------------------------------
|
||||
--------------------------------------------------------------------------
|
||||
-- Full dependencies (including sub-dependencies):
|
||||
-- basic_materials
|
||||
-- mesecons
|
||||
-- moreores
|
||||
-- unifieddyes
|
||||
|
||||
---- Notes prior to v0.0.9
|
||||
-- Requirements: Mesecons --
|
||||
-- http://forum.minetest.net/viewtopic.php?id=628 --
|
||||
-- --
|
||||
@ -50,4 +57,4 @@
|
||||
# http://www.freesound.org/people/Rock%20Savage/sounds/65924/#
|
||||
# Edited by rabbibob
|
||||
# bobblocks_health
|
||||
# http://hamsterrepublic.com/ohrrpgce/Free_Sound_Effects.html
|
||||
# http://hamsterrepublic.com/ohrrpgce/Free_Sound_Effects.html
|
||||
|
BIN
textures/bobblocks_blueblock.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 9.2 KiB |
BIN
textures/bobblocks_greenblock.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
textures/bobblocks_greyblock.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
textures/bobblocks_indigoblock.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
textures/bobblocks_invbluepole.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
textures/bobblocks_invgreenpole.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
textures/bobblocks_invgreypole.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
textures/bobblocks_invindigopole.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
textures/bobblocks_invorangepole.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
textures/bobblocks_invredpole.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
textures/bobblocks_invvioletpole.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
textures/bobblocks_invwhitepole.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
textures/bobblocks_invyellowpole.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 12 KiB |
BIN
textures/bobblocks_orangeblock.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
textures/bobblocks_redblock.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
textures/bobblocks_redblock_off.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
BIN
textures/bobblocks_violetblock.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
textures/bobblocks_whiteblock.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
textures/bobblocks_yellowblock.png
Normal file
After Width: | Height: | Size: 8.4 KiB |