Compare commits
65 Commits
Alpha_0.0.
...
master
Author | SHA1 | Date |
---|---|---|
TheOnlyJoeEnderman | 5879e3b0fb | |
TheOnlyJoeEnderman | 0d1cd8d748 | |
TheOnlyJoeEnderman | 8f563c8dfb | |
TheOnlyJoeEnderman | 2bc80c9e49 | |
TheOnlyJoeEnderman | 6f5eba27ad | |
TheOnlyJoeEnderman | f0cf412403 | |
TheOnlyJoeEnderman | 09bd129bd5 | |
TheOnlyJoeEnderman | 669032f92a | |
TheOnlyJoeEnderman | 6c30bff098 | |
TheOnlyJoeEnderman | 9eb01e7585 | |
TheOnlyJoeEnderman | 028cdba154 | |
TheOnlyJoeEnderman | 88445afd87 | |
TheOnlyJoeEnderman | 8bbaaa1fda | |
TheOnlyJoeEnderman | fe9ea1683b | |
TheOnlyJoeEnderman | 713f42b19d | |
TheOnlyJoeEnderman | 54e6810691 | |
TheOnlyJoeEnderman | fed2333cfc | |
TheOnlyJoeEnderman | df1a987122 | |
TheOnlyJoeEnderman | daed88c9a4 | |
TheOnlyJoeEnderman | 3d18377be4 | |
TheOnlyJoeEnderman | de187d3f39 | |
TheOnlyJoeEnderman | c1d827c69d | |
TheOnlyJoeEnderman | 058aee2d05 | |
TheOnlyJoeEnderman | 28d0a66834 | |
TheOnlyJoeEnderman | be9952b812 | |
TheOnlyJoeEnderman | 6d41e134f3 | |
TheOnlyJoeEnderman | 30e4a466c4 | |
TheOnlyJoeEnderman | 34df1b1572 | |
TheOnlyJoeEnderman | f9b3653064 | |
TheOnlyJoeEnderman | 00cb9d8860 | |
TheOnlyJoeEnderman | 75269403b8 | |
TheOnlyJoeEnderman | eccd694ccb | |
TheOnlyJoeEnderman | fcd8964a2c | |
TheOnlyJoeEnderman | 90018b21ad | |
TheOnlyJoeEnderman | ae5c999f22 | |
TheOnlyJoeEnderman | 405b20bfd9 | |
TheOnlyJoeEnderman | 3322b8b3cb | |
TheOnlyJoeEnderman | 6d99f08a77 | |
TheOnlyJoeEnderman | 1b3d732bb6 | |
TheOnlyJoeEnderman | 1720da6853 | |
TheOnlyJoeEnderman | 20be5c5b7e | |
TheOnlyJoeEnderman | 485830c40d | |
TheOnlyJoeEnderman | 7607eee421 | |
TheOnlyJoeEnderman | 7e38409579 | |
TheOnlyJoeEnderman | 8a605bd2ac | |
TheOnlyJoeEnderman | aaac2b3037 | |
TheOnlyJoeEnderman | 209dc1754e | |
TheOnlyJoeEnderman | a72fb63d70 | |
TheOnlyJoeEnderman | 3a60b1d832 | |
TheOnlyJoeEnderman | 41cf4fad8e | |
TheOnlyJoeEnderman | 224968a545 | |
TheOnlyJoeEnderman | 700617cafe | |
TheOnlyJoeEnderman | b7c3bb7c9f | |
TheOnlyJoeEnderman | a47d682d2e | |
TheOnlyJoeEnderman | b83aece7c8 | |
TheOnlyJoeEnderman | f566ba089e | |
TheOnlyJoeEnderman | 81f4aae363 | |
TheOnlyJoeEnderman | 97b52e7eb8 | |
TheOnlyJoeEnderman | 395787ac30 | |
TheOnlyJoeEnderman | 23d77b23eb | |
TheOnlyJoeEnderman | 81b69dde9d | |
TheOnlyJoeEnderman | 0028937e86 | |
TheOnlyJoeEnderman | d45aec7a5d | |
TheOnlyJoeEnderman | e5330e6565 | |
TheOnlyJoeEnderman | 4fea7e0781 |
|
@ -1,4 +1,4 @@
|
|||
# Paintings Library
|
||||
|
||||
####
|
||||
Attempts to make it easy to add many paintings of various sizes whilst adding 57 example paintings.
|
||||
Attempts to make it easy to add many paintings of various sizes. Now a paintbrush is included to cycle all paintings at random. You do not have to make your own painting recipes anymore if you do not want to.
|
||||
|
|
91
init.lua
|
@ -6,3 +6,94 @@ local default_path = minetest.get_modpath("paintings_lib")
|
|||
|
||||
dofile(minetest.get_modpath("paintings_lib") .. "/register.lua")
|
||||
dofile(minetest.get_modpath("paintings_lib") .. "/paintings.lua")
|
||||
|
||||
-- Global variable to hold the list of painting nodes
|
||||
local painting_nodes = {}
|
||||
|
||||
-- Function to populate the painting nodes list
|
||||
local function populate_painting_nodes()
|
||||
for name, def in pairs(minetest.registered_nodes) do
|
||||
if def.groups.painting then
|
||||
table.insert(painting_nodes, name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Register the function to be called after all mods have loaded
|
||||
minetest.register_on_mods_loaded(populate_painting_nodes)
|
||||
|
||||
-- Call the function to populate the list at server start
|
||||
populate_painting_nodes()
|
||||
|
||||
-- Retrieve the number of uses from settings
|
||||
local paintbrush_uses = tonumber(minetest.settings:get("paintings_lib_paintbrush_uses")) or 32
|
||||
|
||||
-- Register the paintbrush tool
|
||||
minetest.register_tool("paintings_lib:paintbrush", {
|
||||
description = "Paintbrush",
|
||||
inventory_image = "paintings_lib_paintbrush.png",
|
||||
wield_image = "paintings_lib_paintbrush.png^[transformFX"
|
||||
})
|
||||
|
||||
-- Function to swap the node and wear out the paintbrush
|
||||
local function swap_node(pos, node, clicker)
|
||||
local wielded_item = clicker:get_wielded_item()
|
||||
if wielded_item:get_name() ~= "paintings_lib:paintbrush" then
|
||||
return
|
||||
end
|
||||
|
||||
if #painting_nodes > 0 then
|
||||
local new_node_name = node.name
|
||||
local attempts = 0
|
||||
-- Loop until a different painting is found or after 10 attempts
|
||||
while new_node_name == node.name and attempts < 10 do
|
||||
new_node_name = painting_nodes[math.random(#painting_nodes)]
|
||||
attempts = attempts + 1
|
||||
end
|
||||
|
||||
if new_node_name ~= node.name then
|
||||
minetest.swap_node(pos, {name = new_node_name})
|
||||
-- Adding wear to the paintbrush
|
||||
wielded_item:add_wear(65535 / paintbrush_uses)
|
||||
clicker:set_wielded_item(wielded_item)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Override the on_rightclick for nodes in the "painting" group
|
||||
minetest.register_on_punchnode(function(pos, node, clicker, pointed_thing)
|
||||
if minetest.get_item_group(node.name, "painting") > 0 then
|
||||
swap_node(pos, node, clicker)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
-- Crafting recipe to 'refill' the paintbrush
|
||||
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||
local paintbrush_found, dye_found = false, false
|
||||
|
||||
for _, item in ipairs(old_craft_grid) do
|
||||
if item:get_name() == "paintings_lib:paintbrush" then
|
||||
paintbrush_found = true
|
||||
-- Fully repair the paintbrush
|
||||
itemstack:add_wear(-65535)
|
||||
end
|
||||
if minetest.get_item_group(item:get_name(), "dye") > 0 then
|
||||
dye_found = true
|
||||
end
|
||||
end
|
||||
|
||||
if paintbrush_found and dye_found then
|
||||
return itemstack
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "paintings_lib:paintbrush",
|
||||
recipe = {
|
||||
"paintings_lib:paintbrush",
|
||||
"group:dye", "group:dye", "group:dye", "group:dye",
|
||||
"group:dye", "group:dye", "group:dye", "group:dye"
|
||||
}
|
||||
})
|
||||
|
|
1
mod.conf
|
@ -3,3 +3,4 @@ title = Paintings Library
|
|||
description = A fast, sleek, modern painting API for Minetest Game, but optional support for other games.
|
||||
depends = default
|
||||
min_minetest_version = 5.3
|
||||
author = JoeEnderman
|
||||
|
|
114
paintings.lua
|
@ -1,132 +1,36 @@
|
|||
|
||||
-- 1x1
|
||||
|
||||
paintings_lib.register_painting1x1("blue_vase", "Blue Vase", "paintings_lib_1x1_blue_vase.png^paintings_lib_frame1x1.png")
|
||||
|
||||
paintings_lib.register_painting1x1("highway", "Highway", "paintings_lib_1x1_highway.png^paintings_lib_frame1x1.png")
|
||||
|
||||
paintings_lib.register_painting1x1("last_sunrise", "Last Sunrise", "paintings_lib_1x1_last_sunrise.png^paintings_lib_frame1x1.png")
|
||||
|
||||
paintings_lib.register_painting1x1("lit_vase", "Lit Vase", "paintings_lib_1x1_lit_vase.png^paintings_lib_frame1x1.png")
|
||||
|
||||
paintings_lib.register_painting1x1("ocean_rock", "Ocean Rock", "paintings_lib_1x1_ocean_rock.png^paintings_lib_frame1x1.png")
|
||||
|
||||
paintings_lib.register_painting1x1("roses", "Roses", "paintings_lib_1x1_roses.png^paintings_lib_frame1x1.png")
|
||||
|
||||
paintings_lib.register_painting1x1("seaside_paradise", "Seaside Paradise", "paintings_lib_1x1_seaside_paradise.png^paintings_lib_frame1x1.png")
|
||||
|
||||
paintings_lib.register_painting1x1("the_darkness", "The Darkness", "paintings_lib_1x1_the_darkness.png^paintings_lib_frame1x1.png")
|
||||
|
||||
paintings_lib.register_painting1x1("ufo", "UFO", "paintings_lib_1x1_ufo.png^paintings_lib_frame1x1.png")
|
||||
|
||||
paintings_lib.register_painting1x1("valley", "Valley", "paintings_lib_1x1_valley.png^paintings_lib_frame1x1.png")
|
||||
paintings_lib.register1x1("blank1x1", "Blank 1x1", "paintings_lib_blank_1x1.png^paintings_lib_frame1x1.png")
|
||||
|
||||
-- 1x2
|
||||
|
||||
paintings_lib.register_painting1x2("abstract_expression", "Abstract Expression", "paintings_lib_1x2_abstract_expression.png^paintings_lib_frame1x2.png")
|
||||
|
||||
paintings_lib.register_painting1x2("hungry", "Hungry", "paintings_lib_1x2_hungry.png^paintings_lib_frame1x2.png")
|
||||
|
||||
paintings_lib.register_painting1x2("metal_sky", "Metal Sky", "paintings_lib_1x2_metal_sky.png^paintings_lib_frame1x2.png")
|
||||
|
||||
paintings_lib.register_painting1x2("octopus", "Octopus", "paintings_lib_1x2_octopus.png^paintings_lib_frame1x2.png")
|
||||
paintings_lib.register1x2("blank1x2", "Blank 1x2", "paintings_lib_blank_1x2.png^paintings_lib_frame1x2.png")
|
||||
|
||||
-- 2x1
|
||||
|
||||
paintings_lib.register_painting2x1("aurora", "Aurora", "paintings_lib_2x1_aurora.png^paintings_lib_frame2x1.png")
|
||||
|
||||
paintings_lib.register_painting2x1("metal_river", "Metal River", "paintings_lib_2x1_metal_river.png^paintings_lib_frame2x1.png")
|
||||
|
||||
paintings_lib.register_painting2x1("mountain_landscape", "Mountain Landscape", "paintings_lib_2x1_mountain_landscape.png^paintings_lib_frame2x1.png")
|
||||
|
||||
paintings_lib.register_painting2x1("seafloor", "Seafloor", "paintings_lib_2x1_seafloor.png^paintings_lib_frame2x1.png")
|
||||
|
||||
paintings_lib.register_painting2x1("valley_2", "Valley 2", "paintings_lib_2x1_valley_2.png^paintings_lib_frame2x1.png")
|
||||
paintings_lib.register2x1("blank2x1", "Blank 2x1", "paintings_lib_blank_2x1.png^paintings_lib_frame2x1.png")
|
||||
|
||||
-- 2x2
|
||||
|
||||
paintings_lib.register_painting2x2("abrstract_man", "Abstract Man", "paintings_lib_2x2_abstract_man.png^paintings_lib_frame2x2.png")
|
||||
|
||||
paintings_lib.register_painting2x2("fishbowl", "Fishbowl", "paintings_lib_2x2_fishbowl.png^paintings_lib_frame2x2.png")
|
||||
|
||||
paintings_lib.register_painting2x2("fishbowl_2", "Fishbowl 2", "paintings_lib_2x2_fishbowl_2.png^paintings_lib_frame2x2.png")
|
||||
|
||||
paintings_lib.register_painting2x2("king", "King", "paintings_lib_2x2_king.png^paintings_lib_frame2x2.png")
|
||||
|
||||
paintings_lib.register_painting2x2("skull_cuttingboard", "Skull Cuttingboard", "paintings_lib_2x2_skull_cuttingboard.png^paintings_lib_frame2x2.png")
|
||||
|
||||
paintings_lib.register_painting2x2("the_walk", "The Walk", "paintings_lib_2x2_the_walk.png^paintings_lib_frame2x2.png")
|
||||
|
||||
paintings_lib.register_painting2x2("utah", "Utah", "paintings_lib_2x2_utah.png^paintings_lib_frame2x2.png")
|
||||
paintings_lib.register2x2("blank2x2", "Blank 2x2", "paintings_lib_blank_2x2.png^paintings_lib_frame2x2.png")
|
||||
|
||||
-- 3x2
|
||||
|
||||
paintings_lib.register_painting3x2("billboard", "Billboard", "paintings_lib_3x2_billboard.png^paintings_lib_frame3x2.png")
|
||||
|
||||
paintings_lib.register_painting3x2("future_ruins", "Future Ruins", "paintings_lib_3x2_future_ruins.png^paintings_lib_frame3x2.png")
|
||||
|
||||
paintings_lib.register_painting3x2("galaxy", "Galaxy", "paintings_lib_3x2_galaxy.png^paintings_lib_frame3x2.png")
|
||||
|
||||
paintings_lib.register_painting3x2("japan", "Japan", "paintings_lib_3x2_japan.png^paintings_lib_frame3x2.png")
|
||||
|
||||
paintings_lib.register_painting3x2("skull_sea", "Skull Sea", "paintings_lib_3x2_skull_sea.png^paintings_lib_frame3x2.png")
|
||||
|
||||
paintings_lib.register_painting3x2("solar_flare", "Solar Flare", "paintings_lib_3x2_solar_flare.png^paintings_lib_frame3x2.png")
|
||||
|
||||
paintings_lib.register_painting3x2("the_lake", "The Lake", "paintings_lib_3x2_the_lake.png^paintings_lib_frame3x2.png")
|
||||
paintings_lib.register3x2("blank3x2", "Blank 3x2", "paintings_lib_blank_3x2.png^paintings_lib_frame3x2.png")
|
||||
|
||||
--3x3
|
||||
|
||||
paintings_lib.register_painting3x3("ciruit_city", "Circuit City", "paintings_lib_3x3_circuit_city.png^paintings_lib_frame3x3.png")
|
||||
|
||||
paintings_lib.register_painting3x3("fantasy_forest", "Fantasy Forest", "paintings_lib_3x3_fantasy_forest.png^paintings_lib_frame3x3.png")
|
||||
|
||||
paintings_lib.register_painting3x3("gooseberry", "Gooseberry", "paintings_lib_3x3_gooseberry.png^paintings_lib_frame3x3.png")
|
||||
|
||||
paintings_lib.register_painting3x3("map", "Map", "paintings_lib_3x3_map.png^paintings_lib_frame3x3.png")
|
||||
|
||||
paintings_lib.register_painting3x3("portrait", "Portrait", "paintings_lib_3x3_portrait.png^paintings_lib_frame3x3.png")
|
||||
|
||||
paintings_lib.register_painting3x3("seafloor_2", "Seafloor 2", "paintings_lib_3x3_seafloor_2.png^paintings_lib_frame3x3.png")
|
||||
|
||||
paintings_lib.register_painting3x3("skull_roses", "Skull Roses", "paintings_lib_3x3_skull_roses.png^paintings_lib_frame3x3.png")
|
||||
|
||||
paintings_lib.register_painting3x3("sunrise", "Sunrise", "paintings_lib_3x3_sunrise.png^paintings_lib_frame3x3.png")
|
||||
|
||||
paintings_lib.register_painting3x3("tree", "Tree", "paintings_lib_3x3_tree.png^paintings_lib_frame3x3.png")
|
||||
paintings_lib.register3x3("blank3x3", "Blank 3x3", "paintings_lib_blank_3x3.png^paintings_lib_frame3x3.png")
|
||||
|
||||
-- 4x2
|
||||
|
||||
paintings_lib.register_painting4x2("leaves", "Leaves", "paintings_lib_4x2_leaves.png^paintings_lib_frame4x2.png")
|
||||
|
||||
paintings_lib.register_painting4x2("mountain_landscape_2", "Mountain Landscape 2", "paintings_lib_4x2_mountain_landscape_2.png^paintings_lib_frame4x2.png")
|
||||
|
||||
paintings_lib.register_painting4x2("ruins", "Ruins", "paintings_lib_4x2_ruins.png^paintings_lib_frame4x2.png")
|
||||
paintings_lib.register4x2("blank4x2", "Blank 4x2", "paintings_lib_blank_4x2.png^paintings_lib_frame4x2.png")
|
||||
|
||||
-- 4x3
|
||||
|
||||
paintings_lib.register_painting4x3("autumn", "Autumn", "paintings_lib_4x3_autumn.png^paintings_lib_frame4x3.png")
|
||||
|
||||
paintings_lib.register_painting4x3("dust_storm", "Dust Storm", "paintings_lib_4x3_dust_storm.png^paintings_lib_frame4x3.png")
|
||||
|
||||
paintings_lib.register_painting4x3("neon_city", "Neon City", "paintings_lib_4x3_neon_city.png^paintings_lib_frame4x3.png")
|
||||
|
||||
paintings_lib.register_painting4x3("neon_planets", "Neon Planets", "paintings_lib_4x3_neon_planets.png^paintings_lib_frame4x3.png")
|
||||
|
||||
paintings_lib.register_painting4x3("still_life", "Still Life", "paintings_lib_4x3_still_life.png^paintings_lib_frame4x3.png")
|
||||
|
||||
paintings_lib.register_painting4x3("tv_portal", "TV Portal", "paintings_lib_4x3_tv_portal.png^paintings_lib_frame4x3.png")
|
||||
paintings_lib.register4x3("blank4x3", "Blank 4x3", "paintings_lib_blank_4x3.png^paintings_lib_frame4x3.png")
|
||||
|
||||
-- 4x4
|
||||
|
||||
paintings_lib.register_painting4x4("city_lights", "City Lights", "paintings_lib_4x4_city_lights.png^paintings_lib_frame4x4.png")
|
||||
|
||||
paintings_lib.register_painting4x4("map_2", "Map 2", "paintings_lib_4x4_map_2.png^paintings_lib_frame4x4.png")
|
||||
|
||||
paintings_lib.register_painting4x4("skeleton_flowers", "Skeleton Flowers", "paintings_lib_4x4_skeleton_flowers.png^paintings_lib_frame4x4.png")
|
||||
|
||||
paintings_lib.register_painting4x4("the_machine", "The Machine", "paintings_lib_4x4_the_machine.png^paintings_lib_frame4x4.png")
|
||||
|
||||
paintings_lib.register_painting4x4("the_wreckage", "The Wreckage", "paintings_lib_4x4_the_wreckage.png^paintings_lib_frame4x4.png")
|
||||
|
||||
paintings_lib.register_painting4x4("winter", "Winter", "paintings_lib_4x4_winter.png^paintings_lib_frame4x4.png")
|
||||
paintings_lib.register4x4("blank4x4", "Blank 4x4", "paintings_lib_blank_4x4.png^paintings_lib_frame4x4.png")
|
||||
|
|
99
register.lua
|
@ -3,10 +3,10 @@ paintings_name = {}
|
|||
paintings_texture = {}
|
||||
|
||||
-- define the node registration function
|
||||
function paintings_lib.register_painting1x1(identifier, display_name, texture)
|
||||
local node_name = "paintings_lib:1x1_"..display_name:gsub("%s+", "_")
|
||||
paintings_name["1x1"] = paintings_name["1x1"] or {}
|
||||
paintings_name["1x1"][identifier] = node_name
|
||||
function paintings_lib.register1x1(identifier, display_name, texture)
|
||||
local node_name = ":paintings_lib:1x1_"..identifier:gsub("%s+", "_")
|
||||
paintings_name[identifier] = paintings_name[identifier] or {}
|
||||
paintings_name[identifier]["1x1"] = node_name
|
||||
paintings_texture[node_name] = texture
|
||||
|
||||
-- register the node
|
||||
|
@ -17,19 +17,20 @@ function paintings_lib.register_painting1x1(identifier, display_name, texture)
|
|||
selection_box = {type = "fixed", fixed = {-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5}},
|
||||
collision_box = {type = "fixed", fixed = {-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5}},
|
||||
tiles = {texture},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 3},
|
||||
groups = {painting = 1, choppy = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- define the node registration function
|
||||
function paintings_lib.register_painting1x2(identifier, display_name, texture)
|
||||
local node_name = "paintings_lib:1x2_"..display_name:gsub("%s+", "_")
|
||||
paintings_name["1x2"] = paintings_name["1x2"] or {}
|
||||
paintings_name["1x2"][identifier] = node_name
|
||||
function paintings_lib.register1x2(identifier, display_name, texture)
|
||||
local node_name = ":paintings_lib:1x2_"..identifier:gsub("%s+", "_")
|
||||
paintings_name[identifier] = paintings_name[identifier] or {}
|
||||
paintings_name[identifier]["1x2"] = node_name
|
||||
paintings_texture[node_name] = texture
|
||||
|
||||
-- register the node
|
||||
|
@ -40,19 +41,20 @@ function paintings_lib.register_painting1x2(identifier, display_name, texture)
|
|||
selection_box = {type = "fixed", fixed = {-0.5, -1.5, 0.4375, 0.5, 0.5, 0.5}},
|
||||
collision_box = {type = "fixed", fixed = {-0.5, -1.5, 0.4375, 0.5, 0.5, 0.5}},
|
||||
tiles = {texture},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 3},
|
||||
groups = {painting = 1, choppy = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- define the node registration function
|
||||
function paintings_lib.register_painting2x1(identifier, display_name, texture)
|
||||
local node_name = "paintings_lib:2x1_"..display_name:gsub("%s+", "_")
|
||||
paintings_name["2x1"] = paintings_name["2x1"] or {}
|
||||
paintings_name["2x1"][identifier] = node_name
|
||||
function paintings_lib.register2x1(identifier, display_name, texture)
|
||||
local node_name = ":paintings_lib:2x1_"..identifier:gsub("%s+", "_")
|
||||
paintings_name[identifier] = paintings_name[identifier] or {}
|
||||
paintings_name[identifier]["2x1"] = node_name
|
||||
paintings_texture[node_name] = texture
|
||||
|
||||
-- register the node
|
||||
|
@ -63,19 +65,20 @@ function paintings_lib.register_painting2x1(identifier, display_name, texture)
|
|||
selection_box = {type = "fixed", fixed = {-0.5, -0.5, 0.4375, 1.5, 0.5, 0.5}},
|
||||
collision_box = {type = "fixed", fixed = {-0.5, -0.5, 0.4375, 1.5, 0.5, 0.5}},
|
||||
tiles = {texture},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 3},
|
||||
groups = {painting = 1, choppy = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- define the node registration function
|
||||
function paintings_lib.register_painting2x2(identifier, display_name, texture)
|
||||
local node_name = "paintings_lib:2x2_"..display_name:gsub("%s+", "_")
|
||||
paintings_name["2x2"] = paintings_name["2x2"] or {}
|
||||
paintings_name["2x2"][identifier] = node_name
|
||||
function paintings_lib.register2x2(identifier, display_name, texture)
|
||||
local node_name = ":paintings_lib:2x2_"..identifier:gsub("%s+", "_")
|
||||
paintings_name[identifier] = paintings_name[identifier] or {}
|
||||
paintings_name[identifier]["2x2"] = node_name
|
||||
paintings_texture[node_name] = texture
|
||||
|
||||
-- register the node
|
||||
|
@ -86,19 +89,20 @@ function paintings_lib.register_painting2x2(identifier, display_name, texture)
|
|||
selection_box = {type = "fixed", fixed = {-0.5, -1.5, 0.4375, 1.5, 0.5, 0.5}},
|
||||
collision_box = {type = "fixed", fixed = {-0.5, -1.5, 0.4375, 1.5, 0.5, 0.5}},
|
||||
tiles = {texture},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 3},
|
||||
groups = {painting = 1, choppy = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- define the node registration function
|
||||
function paintings_lib.register_painting3x2(identifier, display_name, texture)
|
||||
local node_name = "paintings_lib:3x2_"..display_name:gsub("%s+", "_")
|
||||
paintings_name["3x2"] = paintings_name["3x2"] or {}
|
||||
paintings_name["3x2"][identifier] = node_name
|
||||
function paintings_lib.register3x2(identifier, display_name, texture)
|
||||
local node_name = ":paintings_lib:3x2_"..identifier:gsub("%s+", "_")
|
||||
paintings_name[identifier] = paintings_name[identifier] or {}
|
||||
paintings_name[identifier]["3x2"] = node_name
|
||||
paintings_texture[node_name] = texture
|
||||
|
||||
-- register the node
|
||||
|
@ -109,19 +113,20 @@ function paintings_lib.register_painting3x2(identifier, display_name, texture)
|
|||
selection_box = {type = "fixed", fixed = {-1.5, -1.5, 0.4375, 1.5, 0.5, 0.5}},
|
||||
collision_box = {type = "fixed", fixed = {-1.5, -1.5, 0.4375, 1.5, 0.5, 0.5}},
|
||||
tiles = {texture},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 3},
|
||||
groups = {painting = 1, choppy = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- define the node registration function
|
||||
function paintings_lib.register_painting3x3(identifier, display_name, texture)
|
||||
local node_name = "paintings_lib:3x3_"..display_name:gsub("%s+", "_")
|
||||
paintings_name["3x3"] = paintings_name["3x3"] or {}
|
||||
paintings_name["3x3"][identifier] = node_name
|
||||
function paintings_lib.register3x3(identifier, display_name, texture)
|
||||
local node_name = ":paintings_lib:3x3_"..identifier:gsub("%s+", "_")
|
||||
paintings_name[identifier] = paintings_name[identifier] or {}
|
||||
paintings_name[identifier]["3x3"] = node_name
|
||||
paintings_texture[node_name] = texture
|
||||
|
||||
-- register the node
|
||||
|
@ -132,19 +137,20 @@ function paintings_lib.register_painting3x3(identifier, display_name, texture)
|
|||
selection_box = {type = "fixed", fixed = {-1.5, -1.5, 0.4375, 1.5, 1.5, 0.5}},
|
||||
collision_box = {type = "fixed", fixed = {-1.5, -1.5, 0.4375, 1.5, 1.5, 0.5}},
|
||||
tiles = {texture},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 3},
|
||||
groups = {painting = 1, choppy = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- define the node registration function
|
||||
function paintings_lib.register_painting4x2(identifier, display_name, texture)
|
||||
local node_name = "paintings_lib:4x2_"..display_name:gsub("%s+", "_")
|
||||
paintings_name["4x2"] = paintings_name["4x2"] or {}
|
||||
paintings_name["4x2"][identifier] = node_name
|
||||
function paintings_lib.register4x2(identifier, display_name, texture)
|
||||
local node_name = ":paintings_lib:4x2_"..identifier:gsub("%s+", "_")
|
||||
paintings_name[identifier] = paintings_name[identifier] or {}
|
||||
paintings_name[identifier]["4x2"] = node_name
|
||||
paintings_texture[node_name] = texture
|
||||
|
||||
-- register the node
|
||||
|
@ -155,19 +161,20 @@ function paintings_lib.register_painting4x2(identifier, display_name, texture)
|
|||
selection_box = {type = "fixed", fixed = {-1.5, -1.5, 0.4375, 2.5, 0.5, 0.5}},
|
||||
collision_box = {type = "fixed", fixed = {-1.5, -1.5, 0.4375, 2.5, 0.5, 0.5}},
|
||||
tiles = {texture},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 3},
|
||||
groups = {painting = 1, choppy = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- define the node registration function
|
||||
function paintings_lib.register_painting4x3(identifier, display_name, texture)
|
||||
local node_name = "paintings_lib:4x3_"..display_name:gsub("%s+", "_")
|
||||
paintings_name["4x3"] = paintings_name["4x3"] or {}
|
||||
paintings_name["4x3"][identifier] = node_name
|
||||
function paintings_lib.register4x3(identifier, display_name, texture)
|
||||
local node_name = ":paintings_lib:4x3_"..identifier:gsub("%s+", "_")
|
||||
paintings_name[identifier] = paintings_name[identifier] or {}
|
||||
paintings_name[identifier]["4x3"] = node_name
|
||||
paintings_texture[node_name] = texture
|
||||
|
||||
-- register the node
|
||||
|
@ -178,19 +185,20 @@ function paintings_lib.register_painting4x3(identifier, display_name, texture)
|
|||
selection_box = {type = "fixed", fixed = {-1.5, -1.5, 0.4375, 2.5, 1.5, 0.5}},
|
||||
collision_box = {type = "fixed", fixed = {-1.5, -1.5, 0.4375, 2.5, 1.5, 0.5}},
|
||||
tiles = {texture},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 3},
|
||||
groups = {painting = 1, choppy = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- define the node registration function
|
||||
function paintings_lib.register_painting4x4(identifier, display_name, texture)
|
||||
local node_name = "paintings_lib:4x4_"..display_name:gsub("%s+", "_")
|
||||
paintings_name["4x4"] = paintings_name["4x4"] or {}
|
||||
paintings_name["4x4"][identifier] = node_name
|
||||
function paintings_lib.register4x4(identifier, display_name, texture)
|
||||
local node_name = ":paintings_lib:4x4_"..identifier:gsub("%s+", "_")
|
||||
paintings_name[identifier] = paintings_name[identifier] or {}
|
||||
paintings_name[identifier]["4x4"] = node_name
|
||||
paintings_texture[node_name] = texture
|
||||
|
||||
-- register the node
|
||||
|
@ -201,10 +209,11 @@ function paintings_lib.register_painting4x4(identifier, display_name, texture)
|
|||
selection_box = {type = "fixed", fixed = {-1.5, -2.5, 0.4375, 2.5, 1.5, 0.5}},
|
||||
collision_box = {type = "fixed", fixed = {-1.5, -2.5, 0.4375, 2.5, 1.5, 0.5}},
|
||||
tiles = {texture},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 3},
|
||||
groups = {painting = 1, choppy = 3, oddly_breakable_by_hand = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
# Number of uses for the paintbrush
|
||||
paintings_lib_paintbrush_uses (Paintbrush uses) int 32 1 1000
|
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 302 B |