initial commit
subgame + mods
15
mods/colormachine/README.md
Executable file
@ -0,0 +1,15 @@
|
||||
If any menu shows something unexpected, please go to another menu page
|
||||
and come back from there. This ought to update the first menu page.
|
||||
|
||||
depends on: dye
|
||||
|
||||
supports:
|
||||
unifieddyes
|
||||
coloredwood
|
||||
unifiedbricks
|
||||
stained_glass
|
||||
cotton
|
||||
wool
|
||||
flags
|
||||
blox
|
||||
|
17
mods/colormachine/depends.txt
Executable file
@ -0,0 +1,17 @@
|
||||
dye
|
||||
default?
|
||||
unifieddyes?
|
||||
coloredwood?
|
||||
unifiedbricks?
|
||||
stained_glass?
|
||||
cotton?
|
||||
wool?
|
||||
flags?
|
||||
blox?
|
||||
homedecor?
|
||||
plasticbox?
|
||||
kerova?
|
||||
hardenedclay?
|
||||
clstone?
|
||||
colorcubes?
|
||||
colouredstonebricks?
|
1915
mods/colormachine/init.lua
Executable file
62
mods/colormachine/paint_roller.lua
Executable file
@ -0,0 +1,62 @@
|
||||
-- This is based upon the paint_roller mod by Krock.
|
||||
|
||||
minetest.register_tool("colormachine:paint_roller", {
|
||||
description = "Paint roller",
|
||||
inventory_image = "paint_roller.png",
|
||||
on_use = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
local idx = placer:get_wield_index() + 1
|
||||
if idx > 7 then --copied from explorer tools moo-ha-ha
|
||||
return
|
||||
end
|
||||
if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
|
||||
minetest.record_protection_violation(pointed_thing.under, placer:get_player_name())
|
||||
return
|
||||
end
|
||||
local node = minetest.get_node(pointed_thing.under);
|
||||
local node_name = node.name
|
||||
|
||||
local inv = placer:get_inventory()
|
||||
local stack = inv:get_stack("main", idx) --dye
|
||||
local stack_name = stack:get_name()
|
||||
|
||||
local res = colormachine.get_node_name_painted( node_name, stack_name );
|
||||
|
||||
if( not( res) or not( res.possible ) or #res.possible < 1 or (#res.possible==1 and res.possible[1]==node_name)) then
|
||||
return;
|
||||
end
|
||||
local index = 1;
|
||||
for i,v in ipairs( res.possible ) do
|
||||
if( v==node_name and i < #res.possible and #res.possible[i+1]) then
|
||||
index = i+1;
|
||||
end
|
||||
end
|
||||
|
||||
-- return the old dye
|
||||
if( res.old_dye and res.old_dye ~= stack_name ) then
|
||||
inv:add_item( 'main', res.old_dye..' 1' );
|
||||
end
|
||||
|
||||
-- consume one dye
|
||||
if( stack_name and stack_name ~= '' and (not(res.old_dye) or res.old_dye~=stack_name)) then
|
||||
inv:remove_item( 'main', stack_name..' 1');
|
||||
end
|
||||
|
||||
-- paint the node
|
||||
minetest.set_node(pointed_thing.under, {name=res.possible[ index ], param2=node.param2})
|
||||
|
||||
--itemstack:add_wear( 65535 / 30 );
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "colormachine:paint_roller",
|
||||
recipe = {
|
||||
{"wool:white", "wool:white", "default:steel_ingot"},
|
||||
{"", "default:steel_ingot", ""},
|
||||
{"", "default:steel_ingot", ""},
|
||||
}
|
||||
})
|
BIN
mods/colormachine/textures/colormachine_bottom.png
Executable file
After Width: | Height: | Size: 2.1 KiB |
BIN
mods/colormachine/textures/colormachine_front.png
Executable file
After Width: | Height: | Size: 2.4 KiB |
BIN
mods/colormachine/textures/colormachine_front_active.png
Executable file
After Width: | Height: | Size: 2.4 KiB |
BIN
mods/colormachine/textures/colormachine_side.png
Executable file
After Width: | Height: | Size: 2.2 KiB |
BIN
mods/colormachine/textures/colormachine_top.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
mods/colormachine/textures/colormachine_top_active.png
Executable file
After Width: | Height: | Size: 2.2 KiB |
BIN
mods/colormachine/textures/paint_roller.png
Executable file
After Width: | Height: | Size: 417 B |