1
0
Fork 0

Rename wallet mod to mcl_walls

This commit is contained in:
Wuzzy 2017-01-27 18:15:36 +01:00
parent 3613fb1f43
commit f000347380
4 changed files with 21 additions and 10 deletions

View File

@ -13,19 +13,25 @@ local directions = {
local function update_wall(pos) local function update_wall(pos)
local thisnode = minetest.get_node(pos) local thisnode = minetest.get_node(pos)
if thisnode.name:find("wallet:wall") ~= 1 and if minetest.get_item_group(thisnode.name, "wall") == 0 then
thisnode.name:find("wallet:wallmossy") ~= 1 then
-- Not a wall
return return
end end
-- Get the node's base name, including the underscore since we will need it -- Get the node's base name, including the underscore since we will need it
local basename = thisnode.name:find("_") local colonpos = thisnode.name:find(":")
if basename == nil then -- New wall local underscorepos
local itemname, basename
if colonpos ~= nil then
itemname = thisnode.name:sub(colonpos+1)
end
minetest.log("error", itemname)
underscorepos = itemname:find("_")
if underscorepos == nil then -- New wall
basename = thisnode.name .. "_" basename = thisnode.name .. "_"
else -- Already placed wall else -- Already placed wall
basename = thisnode.name:sub(1, basename) basename = "mcl_walls:" .. itemname:sub(1, underscorepos)
end end
minetest.log("error", basename)
local sum = 0 local sum = 0
@ -74,6 +80,11 @@ local full_blocks = {
{-3/16, -0.5, -0.5, 3/16, 5/16, 0.5} {-3/16, -0.5, -0.5, 3/16, 5/16, 0.5}
} }
--[[ Adds a new wall type.
* nodename: Itemstring of base node. Must not contain an underscore
* name: Item name, visible to user
* texture: Wall texture
* invtex: Inventory image ]]
local function register_wall(nodename, name, texture, invtex) local function register_wall(nodename, name, texture, invtex)
for i = 0, 15 do for i = 0, 15 do
local need = {} local need = {}
@ -183,9 +194,9 @@ end
-- Cobblestone wall -- Cobblestone wall
register_wall("wallet:wall", "Cobblestone Wall", "default_cobble.png", "cobblestone_wallet.png") register_wall("mcl_walls:cobble", "Cobblestone Wall", "default_cobble.png", "mcl_walls_cobble.png")
minetest.register_craft({ minetest.register_craft({
output = 'wallet:wall 6', output = 'mcl_walls:cobble 6',
recipe = { recipe = {
{'default:cobble', 'default:cobble', 'default:cobble'}, {'default:cobble', 'default:cobble', 'default:cobble'},
{'default:cobble', 'default:cobble', 'default:cobble'} {'default:cobble', 'default:cobble', 'default:cobble'}
@ -194,9 +205,9 @@ minetest.register_craft({
-- Mossy wall -- Mossy wall
register_wall("wallet:wallmossy", "Mossy Cobblestone Wall", "default_mossycobble.png", "cobblestonemossy_wallet.png") register_wall("mcl_walls:mossycobble", "Mossy Cobblestone Wall", "default_mossycobble.png", "mcl_walls_mossycobble.png")
minetest.register_craft({ minetest.register_craft({
output = 'wallet:wallmossy 6', output = 'mcl_walls:mossycobble 6',
recipe = { recipe = {
{'default:mossycobble', 'default:mossycobble', 'default:mossycobble'}, {'default:mossycobble', 'default:mossycobble', 'default:mossycobble'},
{'default:mossycobble', 'default:mossycobble', 'default:mossycobble'} {'default:mossycobble', 'default:mossycobble', 'default:mossycobble'}

View File

Before

Width:  |  Height:  |  Size: 859 B

After

Width:  |  Height:  |  Size: 859 B

View File

Before

Width:  |  Height:  |  Size: 1008 B

After

Width:  |  Height:  |  Size: 1008 B