diff --git a/mods/paintings/depends.txt b/mods/paintings/depends.txt new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/mods/paintings/depends.txt @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/mods/paintings/init.lua b/mods/paintings/init.lua new file mode 100644 index 0000000..08aa76e --- /dev/null +++ b/mods/paintings/init.lua @@ -0,0 +1,47 @@ + +--texture format: paintings_[name].png, must be the same as the node name (NOT the description) +--sizes are: 1X1, 1X2, 2X2 +local paintings = { + --{"name/texture", "description", "size"} + {"small", "Small Painting (test)", "1X1"}, + {"medium", "Medium Painting (test)", "1X2"}, + {"large", "Large Painting (test)", "2X2"}, +} + +local small = {-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5} +local medium = {-1.5, -0.5, 0.4375, 0.5, 0.5, 0.5} +local large = {-0.5, -0.5, 0.4375, 1.5, 1.5, 0.5} + +for _, row in ipairs(paintings) do + local name = row[1] + local description = row[2] + local size = row[3] + local box = small + if size == "1X2" then + box = medium + elseif size == "2X2" then + box = large + end + minetest.register_node("paintings:"..name, { + description = description, + drawtype = "mesh", + mesh = size..".obj", + tiles = { + "paintings_"..name..".png", + }, + visual_scale = 0.5, + wield_scale = {x=0.5, y=0.5, z=0.5}, + paramtype = "light", + paramtype2 = "facedir", + groups = {choppy=1}, + selection_box = { + type = "fixed", + fixed = box + }, + collision_box = { + type = "fixed", + fixed = box + }, + sounds = default.node_sound_wood_defaults() +}) +end \ No newline at end of file diff --git a/mods/paintings/models/1X1.obj b/mods/paintings/models/1X1.obj new file mode 100644 index 0000000..9da74dc --- /dev/null +++ b/mods/paintings/models/1X1.obj @@ -0,0 +1,34 @@ +# Blender v2.72 (sub 0) OBJ File: '1X1.blend' +# www.blender.org +mtllib 1X1.mtl +o Shape1 +v 1.000000 -1.000000 0.865452 +v -1.000000 -1.000000 0.865452 +v -1.000000 1.000000 0.865452 +v 1.000000 1.000000 0.865452 +v -1.000000 -1.000000 0.990452 +v 1.000000 -1.000000 0.990452 +v 1.000000 1.000000 0.990452 +v -1.000000 1.000000 0.990452 +vt 0.015625 0.468750 +vt 0.265625 0.468750 +vt 0.265625 0.968750 +vt 0.015625 0.968750 +vt 0.281250 0.468750 +vt 0.531250 0.468750 +vt 0.531250 0.968750 +vt 0.281250 0.968750 +vt 0.265625 1.000000 +vt 0.015625 1.000000 +vt 0.515625 0.968750 +vt 0.515625 1.000000 +vt 0.000000 0.468750 +vt 0.000000 0.968750 +usemtl None +s off +f 1/1 2/2 3/3 4/4 +f 5/5 6/6 7/7 8/8 +f 4/4 3/3 8/9 7/10 +f 6/3 5/11 2/12 1/9 +f 6/13 1/1 4/4 7/14 +f 2/2 5/5 8/8 3/3 diff --git a/mods/paintings/models/1X2.obj b/mods/paintings/models/1X2.obj new file mode 100644 index 0000000..27ed854 --- /dev/null +++ b/mods/paintings/models/1X2.obj @@ -0,0 +1,34 @@ +# Blender v2.72 (sub 0) OBJ File: '1X2.blend' +# www.blender.org +mtllib 1X2.mtl +o Shape1 +v 3.000000 -1.000000 0.872898 +v -1.000000 -1.000000 0.872898 +v -1.000000 1.000000 0.872899 +v 3.000000 1.000000 0.872899 +v -1.000000 -1.000000 0.997898 +v 3.000000 -1.000000 0.997898 +v 3.000000 1.000000 0.997899 +v -1.000000 1.000000 0.997899 +vt 0.007813 0.734375 +vt 0.257813 0.734375 +vt 0.257813 0.984375 +vt 0.007813 0.984375 +vt 0.265625 0.734375 +vt 0.515625 0.734375 +vt 0.515625 0.984375 +vt 0.265625 0.984375 +vt 0.257813 1.000000 +vt 0.007813 1.000000 +vt 0.507813 0.984375 +vt 0.507813 1.000000 +vt 0.000000 0.734375 +vt 0.000000 0.984375 +usemtl None +s off +f 1/1 2/2 3/3 4/4 +f 5/5 6/6 7/7 8/8 +f 4/4 3/3 8/9 7/10 +f 6/3 5/11 2/12 1/9 +f 6/13 1/1 4/4 7/14 +f 2/2 5/5 8/8 3/3 diff --git a/mods/paintings/models/2X2.obj b/mods/paintings/models/2X2.obj new file mode 100644 index 0000000..ca5a805 --- /dev/null +++ b/mods/paintings/models/2X2.obj @@ -0,0 +1,34 @@ +# Blender v2.72 (sub 0) OBJ File: '4X4.blend' +# www.blender.org +mtllib 2X2.mtl +o Shape1 +v 0.999998 -0.999998 0.856839 +v -2.999998 -0.999998 0.856839 +v -2.999998 2.999998 0.856840 +v 0.999998 2.999998 0.856840 +v -2.999998 -0.999998 0.981839 +v 0.999998 -0.999998 0.981839 +v 0.999998 2.999998 0.981839 +v -2.999998 2.999998 0.981839 +vt 0.007813 0.484375 +vt 0.257813 0.484375 +vt 0.257813 0.984375 +vt 0.007813 0.984375 +vt 0.265625 0.484375 +vt 0.515625 0.484375 +vt 0.515625 0.984375 +vt 0.265625 0.984375 +vt 0.257813 1.000000 +vt 0.007813 1.000000 +vt 0.507813 0.984375 +vt 0.507813 1.000000 +vt 0.000000 0.484375 +vt 0.000000 0.984375 +usemtl None +s off +f 1/1 2/2 3/3 4/4 +f 5/5 6/6 7/7 8/8 +f 4/4 3/3 8/9 7/10 +f 6/3 5/11 2/12 1/9 +f 6/13 1/1 4/4 7/14 +f 2/2 5/5 8/8 3/3 diff --git a/mods/paintings/textures/paintings_large.png b/mods/paintings/textures/paintings_large.png new file mode 100644 index 0000000..d4076d3 Binary files /dev/null and b/mods/paintings/textures/paintings_large.png differ diff --git a/mods/paintings/textures/paintings_medium.png b/mods/paintings/textures/paintings_medium.png new file mode 100644 index 0000000..4eb48aa Binary files /dev/null and b/mods/paintings/textures/paintings_medium.png differ diff --git a/mods/paintings/textures/paintings_small.png b/mods/paintings/textures/paintings_small.png new file mode 100644 index 0000000..288c51e Binary files /dev/null and b/mods/paintings/textures/paintings_small.png differ