mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-04-23 07:35:16 +02:00
Adapt mcl_signs for VoxeLibre
also re-adds some files missed by rebase, in particular Wuzzy's sign models and ryvnf's greyscale sign textures
This commit is contained in:
parent
5bd1252cab
commit
a0b7293a2e
14 changed files with 308 additions and 99 deletions
mods/ITEMS
mcl_bamboo
mcl_cherry_blossom
mcl_signs
textures
|
@ -172,15 +172,14 @@ if minetest.get_modpath("mesecons_pressureplates") then
|
|||
end
|
||||
|
||||
if minetest.get_modpath("mcl_signs") then
|
||||
mcl_bamboo.mcl_log("Signs Section Entrance. Modpath exists.")
|
||||
if mcl_signs ~= nil then
|
||||
-- Bamboo Signs...
|
||||
mcl_signs.register_sign_custom("mcl_bamboo", "_bamboo", "mcl_bamboo_bamboo_sign.png",
|
||||
"#ffffff", "mcl_bamboo_bamboo_sign_wield.png", "mcl_bamboo_bamboo_sign_wield.png",
|
||||
S("Bamboo Sign"))
|
||||
mcl_signs.register_sign_craft("mcl_bamboo", BAMBOO_PLANK, "_bamboo")
|
||||
minetest.register_alias("bamboo_sign", "mcl_signs:wall_sign_bamboo")
|
||||
end
|
||||
-- Bamboo Signs...
|
||||
mcl_signs.register_sign("bamboo", "", {
|
||||
description = S("Bamboo Sign"),
|
||||
tiles = {"mcl_bamboo_bamboo_sign.png"},
|
||||
inventory_image = "mcl_bamboo_bamboo_sign_wield.png",
|
||||
wield_image = "mcl_bamboo_bamboo_sign_wield.png",
|
||||
})
|
||||
minetest.register_alias("bamboo_sign", "mcl_signs:wall_sign_bamboo")
|
||||
end
|
||||
|
||||
if minetest.get_modpath("mcl_fences") then
|
||||
|
|
|
@ -81,8 +81,6 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
mcl_signs.register_sign_craft("mcl_cherry_blossom", "mcl_cherry_blossom:cherrywood", "_cherrywood")
|
||||
|
||||
-- Smelting
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
|
|
|
@ -61,9 +61,12 @@ mcl_stairs.register_slab("cherrywood", "mcl_cherry_blossom:cherrywood",
|
|||
S("Double Cherry Slab"))
|
||||
|
||||
-- Signs
|
||||
mcl_signs.register_sign_custom("mcl_cherry_blossom", "_cherrywood",
|
||||
"mcl_cherry_blossom_sign.png", nil,
|
||||
"mcl_cherry_blossom_sign_inv.png", "mcl_cherry_blossom_sign_inv.png", S("Cherry Sign"))
|
||||
mcl_signs.register_sign("cherry", "", {
|
||||
description = S("Cherry Sign"),
|
||||
tiles = {"mcl_cherry_blossom_sign.png"},
|
||||
inventory_image = "mcl_cherry_blossom_sign_inv.png",
|
||||
wield_image = "mcl_cherry_blossom_sign_inv.png",
|
||||
})
|
||||
|
||||
-- Fences & Gates
|
||||
mcl_fences.register_fence_and_fence_gate(
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
# mcl_signs
|
||||
# `mcl_signs` API
|
||||
|
||||
`mcl_signs.register_sign(name, color, [definition])`
|
||||
|
||||
## Sign definition
|
||||
|
||||
```lua
|
||||
{
|
||||
-- This can contain any node definition fields which will ultimately make up the sign nodes.
|
||||
-- Usually you will want to at least supply "description" and "_doc_items_longdesc".
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
# mcl_signs
|
||||
# `mcl_signs`
|
||||
|
||||
* Originally based on reworked signs mod by PilzAdam (https://forum.minetest.net/viewtopic.php?t=3289)
|
||||
* Adapted for mineclone2 by Wuzzy
|
||||
* Adapted for MineClone2 by Wuzzy
|
||||
* Later massively extended by Michial
|
||||
* Mostly rewritten and simplified by cora
|
||||
* Adapted for VoxeLibre by rudzik8
|
||||
|
||||
License of code and font: MIT License
|
||||
|
||||
Font source: 04.jp.org, some modifications and additions were made (added support for Latin-1 Supplement)
|
||||
Font source: 04.jp.org, some modifications and additions were made (added support for Latin-1 Supplement)\
|
||||
Original font license text states: “YOU MAY USE THEM AS YOU LIKE” (in about.gif file distributed with the font)
|
||||
|
||||
License of textures: See README.md in top directory of mineclonia.
|
||||
|
||||
License of models: GPLv3 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Models author: 22i.
|
||||
Source: https://github.com/22i/amc
|
||||
License of models: GPLv3 (https://www.gnu.org/licenses/gpl-3.0.html)\
|
||||
Models author: 22i.\
|
||||
Source: <https://github.com/22i/amc>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
mcl_signs.old_rotnames = {}
|
||||
|
||||
--these are the "rotation strings" of the old sign rotation scheme
|
||||
local rotkeys = {
|
||||
|
@ -5,6 +6,7 @@ local rotkeys = {
|
|||
"45",
|
||||
"67_5"
|
||||
}
|
||||
|
||||
--this is a translation table for the old sign rotation scheme to degrotate
|
||||
--the first level is the itemstring part and the second level represents
|
||||
--the facedir param2 (+1) mapped to the degrotate param2
|
||||
|
@ -28,6 +30,7 @@ local nidp2_degrotate = {
|
|||
15,
|
||||
}
|
||||
}
|
||||
|
||||
local mcl2standingsigns = {}
|
||||
mcl2standingsigns["mcl_signs:standing_sign"] = "mcl_signs:standing_sign_oak"
|
||||
mcl2standingsigns["mcl_signs:standing_sign_acaciawood"] = "mcl_signs:standing_sign_acacia"
|
||||
|
@ -38,7 +41,7 @@ mcl2standingsigns["mcl_signs:standing_sign_sprucewood"] = "mcl_signs:standing_si
|
|||
mcl2standingsigns["mcl_signs:standing_sign_mangrove_wood"] = "mcl_signs:standing_sign_mangrove"
|
||||
mcl2standingsigns["mcl_signs:standing_sign_crimson_hyphae_wood"] = "mcl_signs:standing_sign_crimson"
|
||||
mcl2standingsigns["mcl_signs:standing_sign_warped_hyphae_wood"] = "mcl_signs:standing_sign_warped"
|
||||
mcl2standingsigns["mcl_signs:standing_sign_cherrywood"] = "mcl_signs:standing_sign_cherry_blossom"
|
||||
mcl2standingsigns["mcl_signs:standing_sign_cherrywood"] = "mcl_signs:standing_sign_cherry"
|
||||
|
||||
local mcl2rotsigns = {}
|
||||
|
||||
|
@ -52,24 +55,24 @@ for _,v in pairs(rotkeys) do
|
|||
mcl2rotsigns["mcl_signs:standing_sign"..v.."_mangrove_wood"] = "mcl_signs:standing_sign_mangrove"
|
||||
mcl2rotsigns["mcl_signs:standing_sign"..v.."_crimson_hyphae_wood"] = "mcl_signs:standing_sign_crimson"
|
||||
mcl2rotsigns["mcl_signs:standing_sign"..v.."_warped_hyphae_wood"] = "mcl_signs:standing_sign_warped"
|
||||
mcl2rotsigns["mcl_signs:standing_sign"..v.."_cherrywood"] = "mcl_signs:standing_sign_cherry_blossom"
|
||||
mcl2rotsigns["mcl_signs:standing_sign"..v.."_cherrywood"] = "mcl_signs:standing_sign_cherry"
|
||||
end
|
||||
|
||||
function mcl_signs.upgrade_sign_meta(pos)
|
||||
local m = minetest.get_meta(pos)
|
||||
local col = m:get_string("mcl_signs:text_color")
|
||||
local glo = m:get_string("mcl_signs:glowing_sign")
|
||||
if col ~= "" then
|
||||
m:set_string("color",col)
|
||||
m:set_string("mcl_signs:text_color","")
|
||||
end
|
||||
if glo == "true" then
|
||||
m:set_string("glow",glo)
|
||||
end
|
||||
if glo ~= "" then
|
||||
m:set_string("mcl_signs:glowing_sign","")
|
||||
end
|
||||
mcl_signs.get_text_entity (pos, true) -- the 2nd "true" arg means deleting the entity for respawn
|
||||
local m = core.get_meta(pos)
|
||||
local col = m:get_string("mcl_signs:text_color")
|
||||
local glo = m:get_string("mcl_signs:glowing_sign")
|
||||
if col ~= "" then
|
||||
m:set_string("color",col)
|
||||
m:set_string("mcl_signs:text_color","")
|
||||
end
|
||||
if glo == "true" then
|
||||
m:set_string("glow",glo)
|
||||
end
|
||||
if glo ~= "" then
|
||||
m:set_string("mcl_signs:glowing_sign","")
|
||||
end
|
||||
mcl_signs.get_text_entity(pos, true) -- the 2nd "true" arg means deleting the entity for respawn
|
||||
end
|
||||
|
||||
function mcl_signs.upgrade_sign_rot(pos,node)
|
||||
|
@ -91,7 +94,7 @@ function mcl_signs.upgrade_sign_rot(pos,node)
|
|||
if mcl2standingsigns[node.name] then
|
||||
node.name = mcl2standingsigns[node.name]
|
||||
end
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
local def = core.registered_nodes[node.name]
|
||||
if def and def._mcl_sign_type == "standing" then
|
||||
if node.param2 == 1 or node.param2 == 121 then
|
||||
node.param2 = 180
|
||||
|
@ -102,12 +105,12 @@ function mcl_signs.upgrade_sign_rot(pos,node)
|
|||
end
|
||||
end
|
||||
end
|
||||
minetest.swap_node(pos,node)
|
||||
core.swap_node(pos,node)
|
||||
mcl_signs.upgrade_sign_meta(pos)
|
||||
mcl_signs.update_sign(pos)
|
||||
end
|
||||
|
||||
minetest.register_lbm({
|
||||
core.register_lbm({
|
||||
nodenames = {"group:sign"},
|
||||
name = "mcl_signs:update_old_signs",
|
||||
label = "Update old signs",
|
||||
|
@ -117,7 +120,8 @@ minetest.register_lbm({
|
|||
|
||||
for k,_ in pairs(mcl2rotsigns) do table.insert(mcl_signs.old_rotnames, k) end
|
||||
for k,_ in pairs(mcl2standingsigns) do table.insert(mcl_signs.old_rotnames, k) end
|
||||
minetest.register_lbm({
|
||||
|
||||
core.register_lbm({
|
||||
nodenames = mcl_signs.old_rotnames,
|
||||
name = "mcl_signs:update_old_rotated_standing",
|
||||
label = "Update old standing rotated signs",
|
||||
|
|
|
@ -17,14 +17,12 @@ local DEFAULT_COLOR = "#000000"
|
|||
|
||||
local SIGN_GLOW_INTENSITY = 14
|
||||
|
||||
local signs_editable = minetest.settings:get_bool("mcl_signs_editable", false)
|
||||
local signs_editable = core.settings:get_bool("mcl_signs_editable", false)
|
||||
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local F = minetest.formspec_escape
|
||||
local S = core.get_translator(core.get_current_modname())
|
||||
local F = core.formspec_escape
|
||||
|
||||
local sign_tpl = {
|
||||
paramtype = "light",
|
||||
description = S("Sign"),
|
||||
_tt_help = S("Can be written"),
|
||||
_doc_items_longdesc = S("Signs can be written and come in two variants: Wall sign and sign on a sign post. Signs can be placed on the top and the sides of other blocks, but not below them."),
|
||||
_doc_items_usagehelp = S("After placing the sign, you can write something on it. You have 4 lines of text with up to 15 characters for each line; anything beyond these limits is lost. Not all characters are supported. The text can not be changed once it has been written; you have to break and place the sign again. Can be colored and made to glow."),
|
||||
|
@ -35,12 +33,12 @@ local sign_tpl = {
|
|||
paramtype2 = "degrotate",
|
||||
drawtype = "mesh",
|
||||
mesh = "mcl_signs_sign.obj",
|
||||
inventory_image = "default_sign.png",
|
||||
wield_image = "default_sign.png",
|
||||
selection_box = { type = "fixed", fixed = { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } },
|
||||
tiles = { "mcl_signs_sign.png" },
|
||||
groups = { axey = 1, handy = 2, sign = 1, not_in_creative_inventory = 1 },
|
||||
drop = "mcl_signs:sign",
|
||||
paramtype = "light",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}
|
||||
},
|
||||
groups = {axey = 1, handy = 2, sign = 1, not_in_creative_inventory = 1},
|
||||
stack_max = 16,
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
node_placement_prediction = "",
|
||||
|
@ -51,10 +49,10 @@ local sign_tpl = {
|
|||
local function normalize_rotation(rot) return math.floor(0.5 + rot / 15) * 15 end
|
||||
|
||||
local function get_signdata(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
if not def or minetest.get_item_group(node.name,"sign") < 1 then return end
|
||||
local meta = minetest.get_meta(pos)
|
||||
local node = core.get_node(pos)
|
||||
local def = core.registered_nodes[node.name]
|
||||
if not def or core.get_item_group(node.name, "sign") < 1 then return end
|
||||
local meta = core.get_meta(pos)
|
||||
local text = meta:get_string("text")
|
||||
local color = meta:get_string("color")
|
||||
local glow = meta:get_string("glow")
|
||||
|
@ -67,12 +65,12 @@ local function get_signdata(pos)
|
|||
local typ = "standing"
|
||||
if def.paramtype2 == "wallmounted" then
|
||||
typ = "wall"
|
||||
local dir = minetest.wallmounted_to_dir(node.param2)
|
||||
local dir = core.wallmounted_to_dir(node.param2)
|
||||
spos = vector.add(vector.offset(pos,0,-0.25,0),dir * 0.41 )
|
||||
yaw = minetest.dir_to_yaw(dir)
|
||||
yaw = core.dir_to_yaw(dir)
|
||||
else
|
||||
yaw = math.rad(((node.param2 * 1.5 ) + 1 ) % 360)
|
||||
local dir = minetest.yaw_to_dir(yaw)
|
||||
local dir = core.yaw_to_dir(yaw)
|
||||
spos = vector.add(vector.offset(pos,0,0.08,0),dir * -0.05)
|
||||
end
|
||||
if color == "" then color = DEFAULT_COLOR end
|
||||
|
@ -88,7 +86,7 @@ local function get_signdata(pos)
|
|||
end
|
||||
|
||||
local function set_signmeta(pos,def)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local meta = core.get_meta(pos)
|
||||
if def.text then meta:set_string("text",def.text) end
|
||||
if def.color then meta:set_string("color",def.color) end
|
||||
if def.glow then meta:set_string("glow",def.glow) end
|
||||
|
@ -106,10 +104,10 @@ After line 3, another info block may follow. This repeats until the end of the f
|
|||
|
||||
All character files must be 5 or 6 pixels wide (5 pixels are preferred)
|
||||
]]
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
local modpath = core.get_modpath(core.get_current_modname())
|
||||
local chars_file = io.open(modpath .. "/characters.txt", "r")
|
||||
-- FIXME: Support more characters (many characters are missing). Currently ASCII and Latin-1 Supplement are supported.
|
||||
assert(chars_file,"[mcl_signs] characters.txt not found")
|
||||
assert(chars_file, "[mcl_signs] characters.txt not found")
|
||||
local charmap = {}
|
||||
while true do
|
||||
local char = chars_file:read("*l")
|
||||
|
@ -224,8 +222,8 @@ function sign_tpl.on_place(itemstack, placer, pointed_thing)
|
|||
end
|
||||
|
||||
local under = pointed_thing.under
|
||||
local node = minetest.get_node(under)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
local node = core.get_node(under)
|
||||
local def = core.registered_nodes[node.name]
|
||||
if not def then return itemstack end
|
||||
|
||||
if mcl_util.call_on_rightclick(itemstack, placer, pointed_thing) then
|
||||
|
@ -234,7 +232,7 @@ function sign_tpl.on_place(itemstack, placer, pointed_thing)
|
|||
|
||||
local above = pointed_thing.above
|
||||
local dir = {x = under.x - above.x, y = under.y - above.y, z = under.z - above.z}
|
||||
local wdir = minetest.dir_to_wallmounted(dir)
|
||||
local wdir = core.dir_to_wallmounted(dir)
|
||||
|
||||
local itemstring = itemstack:get_name()
|
||||
local placestack = ItemStack(itemstack)
|
||||
|
@ -244,11 +242,11 @@ function sign_tpl.on_place(itemstack, placer, pointed_thing)
|
|||
-- place on wall
|
||||
if wdir ~= 0 and wdir ~= 1 then
|
||||
placestack:set_name("mcl_signs:wall_sign_"..def._mcl_sign_wood)
|
||||
itemstack, pos = minetest.item_place_node(placestack, placer, pointed_thing, wdir)
|
||||
itemstack, pos = core.item_place_node(placestack, placer, pointed_thing, wdir)
|
||||
elseif wdir == 1 then -- standing, not ceiling
|
||||
placestack:set_name("mcl_signs:standing_sign_"..def._mcl_sign_wood)
|
||||
local rot = normalize_rotation(placer:get_look_horizontal() * 180 / math.pi / 1.5)
|
||||
itemstack, pos = minetest.item_place_node(placestack, placer, pointed_thing, rot) -- param2 value is degrees / 1.5
|
||||
itemstack, pos = core.item_place_node(placestack, placer, pointed_thing, rot) -- param2 value is degrees / 1.5
|
||||
else
|
||||
return itemstack
|
||||
end
|
||||
|
@ -266,7 +264,7 @@ function sign_tpl.on_rightclick(pos, _, clicker, itemstack, _)
|
|||
end
|
||||
set_signmeta(pos,{glow="true",color=data.color})
|
||||
mcl_signs.update_sign(pos)
|
||||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
if not core.is_creative_enabled(clicker:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
|
@ -292,33 +290,33 @@ end
|
|||
local sign_wall = table_merge(sign_tpl,{
|
||||
mesh = "mcl_signs_signonwallmount.obj",
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = { type = "wallmounted", wall_side = { -0.5, -7 / 28, -0.5, -23 / 56, 7 / 28, 0.5 }},
|
||||
groups = { axey = 1, handy = 2, sign = 1 },
|
||||
selection_box = {type = "wallmounted", wall_side = {-0.5, -7 / 28, -0.5, -23 / 56, 7 / 28, 0.5}},
|
||||
groups = {axey = 1, handy = 2, sign = 1},
|
||||
_mcl_sign_type = "wall",
|
||||
})
|
||||
|
||||
--Formspec
|
||||
function mcl_signs.show_formspec(player, pos)
|
||||
if not pos then return end
|
||||
local old_text = minetest.get_meta(pos):get_string("text")
|
||||
minetest.show_formspec(player:get_player_name(),
|
||||
local old_text = core.get_meta(pos):get_string("text")
|
||||
core.show_formspec(player:get_player_name(),
|
||||
"mcl_signs:set_text_" .. pos.x .. "_" .. pos.y .. "_" .. pos.z,
|
||||
"size[6,3]textarea[0.25,0.25;6,1.5;text;" ..
|
||||
F(S("Enter sign text:")) .. ";"..minetest.formspec_escape(old_text) .."]label[0,1.5;" ..
|
||||
F(S("Enter sign text:")) .. ";"..core.formspec_escape(old_text) .."]label[0,1.5;" ..
|
||||
F(S("Maximum line length: 15")) .. "\n" ..
|
||||
F(S("Maximum lines: 4")) ..
|
||||
"]button_exit[0,2.5;6,1;submit;" .. F(S("Done")) .. "]"
|
||||
)
|
||||
end
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
core.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname:find("mcl_signs:set_text_") == 1 then
|
||||
local x, y, z = formname:match("mcl_signs:set_text_(.-)_(.-)_(.*)")
|
||||
local pos = { x = tonumber(x), y = tonumber(y), z = tonumber(z) }
|
||||
local pos = {x = tonumber(x), y = tonumber(y), z = tonumber(z)}
|
||||
if not pos or not pos.x or not pos.y or not pos.z or not fields or not fields.text then
|
||||
return
|
||||
end
|
||||
if not mcl_util.check_position_protection(pos, player) and (signs_editable or minetest.get_meta(pos):get_string("text") == "") then
|
||||
if not mcl_util.check_position_protection(pos, player) and (signs_editable or core.get_meta(pos):get_string("text") == "") then
|
||||
set_signmeta(pos,{
|
||||
text = tostring(fields.text):sub(1, 256), --limit saved text to 256 characters (4 lines x 15 chars = 60 so this should be more than is ever needed).
|
||||
})
|
||||
|
@ -329,7 +327,7 @@ end)
|
|||
|
||||
--Text entity handling
|
||||
function mcl_signs.get_text_entity (pos, force_remove)
|
||||
local objects = minetest.get_objects_inside_radius(pos, 0.5)
|
||||
local objects = core.get_objects_inside_radius(pos, 0.5)
|
||||
local text_entity
|
||||
local i = 0
|
||||
for _, v in pairs(objects) do
|
||||
|
@ -356,7 +354,7 @@ function mcl_signs.update_sign(pos)
|
|||
elseif not data then
|
||||
return false
|
||||
elseif not text_entity then
|
||||
text_entity = minetest.add_entity(data.text_pos, "mcl_signs:text")
|
||||
text_entity = core.add_entity(data.text_pos, "mcl_signs:text")
|
||||
if not text_entity or not text_entity:get_pos() then return end
|
||||
end
|
||||
|
||||
|
@ -365,15 +363,15 @@ function mcl_signs.update_sign(pos)
|
|||
glow = SIGN_GLOW_INTENSITY
|
||||
end
|
||||
text_entity:set_properties({
|
||||
textures = { mcl_signs.generate_texture(data) },
|
||||
textures = {mcl_signs.generate_texture(data)},
|
||||
glow = glow,
|
||||
})
|
||||
text_entity:set_yaw(data.yaw)
|
||||
text_entity:set_armor_groups({ immortal = 1 })
|
||||
text_entity:set_armor_groups({immortal = 1})
|
||||
return true
|
||||
end
|
||||
|
||||
minetest.register_lbm({
|
||||
core.register_lbm({
|
||||
nodenames = {"group:sign"},
|
||||
name = "mcl_signs:restore_entities",
|
||||
label = "Restore sign text",
|
||||
|
@ -383,7 +381,7 @@ minetest.register_lbm({
|
|||
end
|
||||
})
|
||||
|
||||
minetest.register_entity("mcl_signs:text", {
|
||||
core.register_entity("mcl_signs:text", {
|
||||
initial_properties = {
|
||||
pointable = false,
|
||||
visual = "upright_sprite",
|
||||
|
@ -399,27 +397,22 @@ minetest.register_entity("mcl_signs:text", {
|
|||
end,
|
||||
})
|
||||
|
||||
local function colored_texture(texture,color)
|
||||
local function colored_texture(texture, color)
|
||||
return texture.."^[multiply:"..color
|
||||
end
|
||||
|
||||
mcl_signs.old_rotnames = {}
|
||||
|
||||
function mcl_signs.register_sign(name,color,def)
|
||||
function mcl_signs.register_sign(name, color, def)
|
||||
local newfields = {
|
||||
tiles = { colored_texture("mcl_signs_sign_greyscale.png", color) },
|
||||
inventory_image = colored_texture("default_sign_greyscale.png", color),
|
||||
wield_image = colored_texture("default_sign_greyscale.png", color),
|
||||
inventory_image = colored_texture("mcl_signs_default_sign_greyscale.png", color),
|
||||
wield_image = colored_texture("mcl_signs_default_sign_greyscale.png", color),
|
||||
drop = "mcl_signs:wall_sign_"..name,
|
||||
_mcl_sign_wood = name,
|
||||
}
|
||||
|
||||
minetest.register_node(":mcl_signs:standing_sign_"..name, table_merge(sign_tpl, newfields, def or {}))
|
||||
minetest.register_node(":mcl_signs:wall_sign_"..name,table_merge(sign_wall, newfields, def or {}))
|
||||
|
||||
table.insert(mcl_signs.old_rotnames,"mcl_signs:standing_sign22_5_"..name)
|
||||
table.insert(mcl_signs.old_rotnames,"mcl_signs:standing_sign45_"..name)
|
||||
table.insert(mcl_signs.old_rotnames,"mcl_signs:standing_sign67_5_"..name)
|
||||
core.register_node(":mcl_signs:standing_sign_"..name, table_merge(sign_tpl, newfields, def or {}))
|
||||
core.register_node(":mcl_signs:wall_sign_"..name, table_merge(sign_wall, newfields, def or {}))
|
||||
end
|
||||
|
||||
dofile(modpath.."/register.lua")
|
||||
dofile(modpath.."/compat.lua")
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
name = mcl_signs
|
||||
authors = cora, rudzik8
|
||||
depends = mcl_util, mcl_sounds
|
||||
|
|
66
mods/ITEMS/mcl_signs/models/mcl_signs_sign.obj
Normal file
66
mods/ITEMS/mcl_signs/models/mcl_signs_sign.obj
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Blender v2.76 (sub 0) OBJ File: 'sign.blend'
|
||||
# www.blender.org
|
||||
mtllib sign.mtl
|
||||
o wood_Cube.001
|
||||
v 0.499985 0.082879 -0.041665
|
||||
v 0.499985 0.582864 -0.041665
|
||||
v 0.499985 0.082879 0.041666
|
||||
v 0.499985 0.582864 0.041666
|
||||
v -0.499985 0.082879 -0.041666
|
||||
v -0.499985 0.582864 -0.041666
|
||||
v -0.499985 0.082879 0.041665
|
||||
v -0.499985 0.582864 0.041665
|
||||
v 0.041665 -0.500001 -0.041665
|
||||
v 0.041665 0.083315 -0.041665
|
||||
v 0.041665 -0.500001 0.041665
|
||||
v 0.041665 0.083315 0.041665
|
||||
v -0.041665 -0.500001 -0.041665
|
||||
v -0.041665 0.083315 -0.041665
|
||||
v -0.041665 -0.500001 0.041665
|
||||
v -0.041665 0.083315 0.041665
|
||||
vt 0.031250 0.562500
|
||||
vt 0.031250 0.937500
|
||||
vt 0.000000 0.937500
|
||||
vt 0.000000 0.562500
|
||||
vt 0.812500 0.562500
|
||||
vt 0.812500 0.937500
|
||||
vt 0.437500 0.937500
|
||||
vt 0.437500 0.562500
|
||||
vt 0.406250 0.937500
|
||||
vt 0.406250 0.562500
|
||||
vt 0.406250 1.000000
|
||||
vt 0.781250 1.000000
|
||||
vt 0.781250 0.937500
|
||||
vt 0.031250 1.000000
|
||||
vt 0.031250 0.062500
|
||||
vt 0.031250 0.500000
|
||||
vt 0.000000 0.500000
|
||||
vt 0.000000 0.062500
|
||||
vt 0.125000 0.062500
|
||||
vt 0.125000 0.500000
|
||||
vt 0.093750 0.500000
|
||||
vt 0.093750 0.062500
|
||||
vt 0.062500 0.500000
|
||||
vt 0.062500 0.062500
|
||||
vt 0.093750 0.562500
|
||||
vt 0.062500 0.562500
|
||||
vn 1.000000 0.000000 0.000000
|
||||
vn -0.000000 0.000000 1.000000
|
||||
vn -1.000000 0.000000 0.000000
|
||||
vn 0.000000 0.000000 -1.000000
|
||||
vn 0.000000 -1.000000 0.000000
|
||||
vn 0.000000 1.000000 0.000000
|
||||
usemtl None
|
||||
s off
|
||||
f 1/1/1 2/2/1 4/3/1 3/4/1
|
||||
f 3/5/2 4/6/2 8/7/2 7/8/2
|
||||
f 7/8/3 8/7/3 6/9/3 5/10/3
|
||||
f 5/10/4 6/9/4 2/2/4 1/1/4
|
||||
f 3/11/5 7/12/5 5/13/5 1/9/5
|
||||
f 8/11/6 4/14/6 2/2/6 6/9/6
|
||||
f 9/15/1 10/16/1 12/17/1 11/18/1
|
||||
f 11/19/2 12/20/2 16/21/2 15/22/2
|
||||
f 15/22/3 16/21/3 14/23/3 13/24/3
|
||||
f 13/24/4 14/23/4 10/16/4 9/15/4
|
||||
f 11/23/5 15/21/5 13/25/5 9/26/5
|
||||
f 16/16/6 12/23/6 10/26/6 14/1/6
|
40
mods/ITEMS/mcl_signs/models/mcl_signs_signonwall.obj
Normal file
40
mods/ITEMS/mcl_signs/models/mcl_signs_signonwall.obj
Normal file
|
@ -0,0 +1,40 @@
|
|||
# Blender v2.76 (sub 0) OBJ File: 'mcl_signs_signonwall.blend'
|
||||
# www.blender.org
|
||||
mtllib mcl_signs_signonwall.mtl
|
||||
o wood_Cube.001
|
||||
v 0.499985 -0.249993 0.416671
|
||||
v 0.499985 0.249993 0.416671
|
||||
v 0.499985 -0.249993 0.500002
|
||||
v 0.499985 0.249993 0.500002
|
||||
v -0.499985 -0.249993 0.416671
|
||||
v -0.499985 0.249993 0.416671
|
||||
v -0.499985 -0.249993 0.500002
|
||||
v -0.499985 0.249993 0.500002
|
||||
vt 0.031250 0.562500
|
||||
vt 0.031250 0.937500
|
||||
vt 0.000000 0.937500
|
||||
vt 0.000000 0.562500
|
||||
vt 0.812500 0.562500
|
||||
vt 0.812500 0.937500
|
||||
vt 0.437500 0.937500
|
||||
vt 0.437500 0.562500
|
||||
vt 0.406250 0.937500
|
||||
vt 0.406250 0.562500
|
||||
vt 0.406250 1.000000
|
||||
vt 0.781250 1.000000
|
||||
vt 0.781250 0.937500
|
||||
vt 0.031250 1.000000
|
||||
vn 1.000000 0.000000 0.000000
|
||||
vn 0.000000 0.000000 1.000000
|
||||
vn -1.000000 0.000000 0.000000
|
||||
vn -0.000000 0.000000 -1.000000
|
||||
vn 0.000000 -1.000000 0.000000
|
||||
vn 0.000000 1.000000 0.000000
|
||||
usemtl None
|
||||
s off
|
||||
f 1/1/1 2/2/1 4/3/1 3/4/1
|
||||
f 3/5/2 4/6/2 8/7/2 7/8/2
|
||||
f 7/8/3 8/7/3 6/9/3 5/10/3
|
||||
f 5/10/4 6/9/4 2/2/4 1/1/4
|
||||
f 3/11/5 7/12/5 5/13/5 1/9/5
|
||||
f 8/11/6 4/14/6 2/2/6 6/9/6
|
40
mods/ITEMS/mcl_signs/models/mcl_signs_signonwallmount.obj
Normal file
40
mods/ITEMS/mcl_signs/models/mcl_signs_signonwallmount.obj
Normal file
|
@ -0,0 +1,40 @@
|
|||
# Blender v2.76 (sub 0) OBJ File: 'signonwallmount.blend'
|
||||
# www.blender.org
|
||||
mtllib signonwallmount.mtl
|
||||
o wood_Cube.001
|
||||
v 0.499985 -0.416668 -0.249992
|
||||
v 0.499985 -0.416668 0.249993
|
||||
v 0.499985 -0.499999 -0.249992
|
||||
v 0.499985 -0.499999 0.249993
|
||||
v -0.499985 -0.416668 -0.249993
|
||||
v -0.499985 -0.416668 0.249992
|
||||
v -0.499985 -0.499999 -0.249993
|
||||
v -0.499985 -0.499999 0.249992
|
||||
vt 0.031250 0.562500
|
||||
vt 0.031250 0.937500
|
||||
vt 0.000000 0.937500
|
||||
vt 0.000000 0.562500
|
||||
vt 0.812500 0.562500
|
||||
vt 0.812500 0.937500
|
||||
vt 0.437500 0.937500
|
||||
vt 0.437500 0.562500
|
||||
vt 0.406250 0.937500
|
||||
vt 0.406250 0.562500
|
||||
vt 0.406250 1.000000
|
||||
vt 0.781250 1.000000
|
||||
vt 0.781250 0.937500
|
||||
vt 0.031250 1.000000
|
||||
vn 1.000000 0.000000 0.000000
|
||||
vn 0.000000 -1.000000 -0.000000
|
||||
vn -1.000000 0.000000 -0.000000
|
||||
vn -0.000000 1.000000 0.000000
|
||||
vn 0.000000 0.000000 -1.000000
|
||||
vn -0.000000 -0.000000 1.000000
|
||||
usemtl None
|
||||
s off
|
||||
f 1/1/1 2/2/1 4/3/1 3/4/1
|
||||
f 3/5/2 4/6/2 8/7/2 7/8/2
|
||||
f 7/8/3 8/7/3 6/9/3 5/10/3
|
||||
f 5/10/4 6/9/4 2/2/4 1/1/4
|
||||
f 3/11/5 7/12/5 5/13/5 1/9/5
|
||||
f 8/11/6 4/14/6 2/2/6 6/9/6
|
67
mods/ITEMS/mcl_signs/register.lua
Normal file
67
mods/ITEMS/mcl_signs/register.lua
Normal file
|
@ -0,0 +1,67 @@
|
|||
local S = core.get_translator(core.get_current_modname())
|
||||
|
||||
local woods = {
|
||||
oak = {
|
||||
def = {description = S("Oak Sign")},
|
||||
color = "#917056",
|
||||
wood = "mcl_core:wood",
|
||||
},
|
||||
dark_oak = {
|
||||
def = {description = S("Dark Oak Sign")},
|
||||
color = "#625048",
|
||||
wood = "mcl_core:darkwood",
|
||||
},
|
||||
acacia = {
|
||||
def = {description = S("Acacia Sign")},
|
||||
color = "#965638",
|
||||
wood = "mcl_core:acaciawood",
|
||||
},
|
||||
birch = {
|
||||
def = {description = S("Birch Sign")},
|
||||
color = "#AA907A",
|
||||
wood = "mcl_core:birchwood",
|
||||
},
|
||||
jungle = {
|
||||
def = {description = S("Jungle Sign")},
|
||||
color = "#845A43",
|
||||
wood = "mcl_core:junglewood",
|
||||
},
|
||||
spruce = {
|
||||
def = {description = S("Spruce Sign")},
|
||||
color = "#604335",
|
||||
wood = "mcl_core:sprucewood",
|
||||
},
|
||||
}
|
||||
|
||||
if core.get_modpath("mcl_mangrove") then
|
||||
woods.mangrove = {
|
||||
def = {description = S("Mangrove Sign")},
|
||||
color = "#8E3731",
|
||||
wood = "mcl_mangrove:mangrove_wood",
|
||||
}
|
||||
end
|
||||
|
||||
if core.get_modpath("mcl_crimson") then
|
||||
woods.crimson = {
|
||||
def = {description = S("Crimson Hyphae Sign")},
|
||||
color = "#810000",
|
||||
wood = "mcl_crimson:crimson_hyphae_wood",
|
||||
}
|
||||
woods.warped = {
|
||||
def = {description = S("Warped Hyphae Sign")},
|
||||
color = "#0E4C4C",
|
||||
wood = "mcl_crimson:warped_hyphae_wood",
|
||||
}
|
||||
end
|
||||
|
||||
for name, tbl in pairs(woods) do
|
||||
mcl_signs.register_sign(name, tbl.color, tbl.def)
|
||||
core.register_craft({
|
||||
output = "mcl_signs:wall_sign_"..name.." 3",
|
||||
recipe = {
|
||||
{tbl.wood, tbl.wood, tbl.wood},
|
||||
{tbl.wood, tbl.wood, tbl.wood},
|
||||
{"", "mcl_core:stick", ""}
|
||||
}
|
||||
})
|
||||
end
|
Binary file not shown.
Before ![]() (image error) Size: 228 B After ![]() (image error) Size: 4.5 KiB ![]() ![]() |
Binary file not shown.
Before ![]() (image error) Size: 551 B After ![]() (image error) Size: 1 KiB ![]() ![]() |
Loading…
Add table
Reference in a new issue