I am going to update my angled walls mod but...., am currently changing all the code for the angled glass (windows).
The excellent model pithy provided for the windows accepts 2 textures, the material and the glass so, I want to correct the code to utilize this. It will really clean up the code and the mod.
However, upon setting off on it..., I added a separate function to register the glass node, etc..
Nothing was showing up so, I then decided to add a dofile to the init.lua and split the glass into it's own mod.
I am stuck now because still, nothing shows up.
Does anyone see what's wrong and why this first node is not even showing up in inventory at all?
As far as I can tell, everything is as it should be, yet no results so, obviously not. WTH am I missing here?
Code: Select all
-- [MOD] Angled Glass [angledglass] [1.2] by TumeniNodes 6-24-2016
angledglass = {}
-- Angled place function
-- To use put "on_place = angledglass.angled_place" in the node def
function angledglass.angled_place(itemstack, placer, pointed_thing)
local placer_pos = placer:getpos()
local pos = pointed_thing.above
local param2
if pos.x > placer_pos.x then
if pos.z > placer_pos.z then
param2 = 1
else
param2 = 2
end
else
if pos.z > placer_pos.z then
param2 = 0
else
param2 = 3
end
end
return minetest.item_place(itemstack, placer, pointed_thing, param2)
end
--Register angledglass.
--Node will be called angledglass:glass_<subname>
function angledglass.register_glass(subname, recipeitem, groups, images, description, sounds)
groups.glass = 1
minetest.register_node(":angledglass:glass" .. subname, {
description = description,
drawtype = "mesh",
mesh = "angled_glass.obj",
tiles = images,
use_texture_alpha = true,
paramtype = "light",
sunlight_propogates = true,
paramtype2 = "facedir",
is_ground_content = false,
groups = groups,
sounds = sounds,
collision_box = {
type = "fixed",
fixed = {
{0.375, -0.5, 0.375, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.375, 0.5, -0.375},
{-0.4375, -0.5, -0.4375, -0.3125, 0.5, -0.3125},
{0.3125, -0.5, 0.3125, 0.4375, 0.5, 0.4375},
{0.25, -0.5, 0.25, 0.375, 0.5, 0.375},
{-0.375, -0.5, -0.375, -0.25, 0.5, -0.25},
{0.1875, -0.5, 0.1875, 0.3125, 0.5, 0.3125},
{-0.3125, -0.5, -0.3125, -0.1875, 0.5, -0.1875},
{0.125, -0.5, 0.125, 0.25, 0.5, 0.25},
{-0.25, -0.5, -0.25, -0.125, 0.5, -0.125},
{0.0625, -0.5, 0.0625, 0.1875, 0.5, 0.1875},
{-0.1875, -0.5, -0.1875, -0.0625, 0.5, -0.0625},
{0, -0.5, 0, 0.125, 0.5, 0.125},
{-0.125, -0.5, -0.125, 0, 0.5, 0},
{-0.0625, -0.5, -0.0625, 0.0625, 0.5, 0.0625},
}
},
on_place = angledglass.angled_place
})
end
-- Angled glass registration function.
-- Nodes will be called angledglass:{glass}_<subname>
function angledglass.register_glass(subname, recipeitem, groups, images, desc_glass, sounds)
end
-- Register glass
angledglass.register_glass("wood", "default:wood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
{"default_wood.png", "default_glass.png"},
"Wooden Glass",
default.node_sound_glass_defaults())