From 4548f2d19e1525eef3a43af9fb6b9d25b4953758 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 31 Jul 2017 05:35:55 +0200 Subject: [PATCH 1/6] Add new lever model by Gerold55 --- .../REDSTONE/mesecons_walllever/init.lua | 41 +-- .../jeija_wall_lever_lever_light_on.png | Bin 0 -> 344 bytes .../models/jeija_wall_lever_off.obj | 90 ++++++ .../models/jeija_wall_lever_on.obj | 90 ++++++ .../mesecons_walllever/models/levier_off.x | 244 ---------------- .../mesecons_walllever/models/levier_on.x | 274 ------------------ .../textures/jeija_wall_lever.png | Bin 126 -> 141 bytes .../textures/jeija_wall_lever_back.png | Bin 320 -> 0 bytes .../textures/jeija_wall_lever_bottom.png | Bin 301 -> 0 bytes .../textures/jeija_wall_lever_off.png | Bin 281 -> 0 bytes .../textures/jeija_wall_lever_on.png | Bin 268 -> 0 bytes .../textures/jeija_wall_lever_sides.png | Bin 285 -> 0 bytes .../textures/jeija_wall_lever_tb.png | Bin 219 -> 0 bytes .../textures/jeija_wall_lever_top.png | Bin 304 -> 0 bytes 14 files changed, 191 insertions(+), 548 deletions(-) create mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_lever_light_on.png create mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_off.obj create mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_on.obj delete mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/models/levier_off.x delete mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/models/levier_on.x delete mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_back.png delete mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_bottom.png delete mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_off.png delete mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_on.png delete mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_sides.png delete mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_tb.png delete mode 100644 mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_top.png diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua index b75c7b9dfc..e93b4f011b 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua @@ -2,30 +2,21 @@ -- Basically a switch that can be attached to a wall -- Powers the block 2 nodes behind (using a receiver) minetest.register_node("mesecons_walllever:wall_lever_off", { - drawtype = "nodebox", + drawtype = "mesh", tiles = { - "jeija_wall_lever_tb.png", - "jeija_wall_lever_bottom.png", - "jeija_wall_lever_sides.png", - "jeija_wall_lever_sides.png", - "jeija_wall_lever_back.png", - "jeija_wall_lever_off.png", + "jeija_wall_lever_lever_light_on.png", }, inventory_image = "jeija_wall_lever.png", wield_image = "jeija_wall_lever.png", paramtype = "light", paramtype2 = "facedir", + drawtype = "mesh", + mesh = "jeija_wall_lever_off.obj", sunlight_propagates = true, walkable = false, selection_box = { type = "fixed", - fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, - { -1/16, -8/16, 7/16, 1/16, 0/16, 5/16 }}, - }, - node_box = { - type = "fixed", - fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base - { -1/16, -8/16, 7/16, 1/16, 0/16, 5/16 }} -- the lever itself. + fixed = { -3/16, -8/16, -4/16, 3/16, -2/16, 4/16 }, }, groups = {handy=1, dig_by_water=1, destroy_by_lava_flow=1, dig_by_piston=1}, is_ground_content = false, @@ -37,7 +28,7 @@ minetest.register_node("mesecons_walllever:wall_lever_off", { mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node)) minetest.sound_play("mesecons_lever", {pos=pos}) end, - sounds = mcl_sounds.node_sound_wood_defaults(), + sounds = mcl_sounds.node_sound_stone_defaults(), mesecons = {receptor = { rules = mesecon.rules.buttonlike_get, state = mesecon.state.off @@ -46,29 +37,19 @@ minetest.register_node("mesecons_walllever:wall_lever_off", { _mcl_hardness = 0.5, }) minetest.register_node("mesecons_walllever:wall_lever_on", { - drawtype = "nodebox", + drawtype = "mesh", tiles = { - "jeija_wall_lever_top.png", - "jeija_wall_lever_tb.png", - "jeija_wall_lever_sides.png", - "jeija_wall_lever_sides.png", - "jeija_wall_lever_back.png", - "jeija_wall_lever_on.png", + "jeija_wall_lever_lever_light_on.png", }, inventory_image = "jeija_wall_lever.png", paramtype = "light", paramtype2 = "facedir", + mesh = "jeija_wall_lever_on.obj", sunlight_propagates = true, walkable = false, selection_box = { type = "fixed", - fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, - { -1/16, 0, 7/16, 1/16, 8/16, 5/16 }}, - }, - node_box = { - type = "fixed", - fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base - { -1/16, 0/16, 7/16, 1/16, 8/16, 5/16 }} -- the lever itself. + fixed = { -3/16, -8/16, -4/16, 3/16, -2/16, 4/16 }, }, groups = {handy=1, not_in_creative_inventory = 1, dig_by_water=1, destroy_by_lava_flow=1, dig_by_piston=1}, is_ground_content = false, @@ -80,7 +61,7 @@ minetest.register_node("mesecons_walllever:wall_lever_on", { mesecon:receptor_off(pos, mesecon.rules.buttonlike_get(node)) minetest.sound_play("mesecons_lever", {pos=pos}) end, - sounds = mcl_sounds.node_sound_wood_defaults(), + sounds = mcl_sounds.node_sound_stone_defaults(), mesecons = {receptor = { rules = mesecon.rules.buttonlike_get, state = mesecon.state.on diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_lever_light_on.png b/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_lever_light_on.png new file mode 100644 index 0000000000000000000000000000000000000000..9f8af946d09921b140a73279d6b2eef917081d56 GIT binary patch literal 344 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dymH|E?u0T50(w%>I*o_uaj-P9G?( zS*W6u_>afd;_UfC4u+sq1Lb&@#uO$Bjwx=RHfgWS - SWORD major; - SWORD minor; - DWORD flags; -} - -template Vector { - <3D82AB5E-62DA-11cf-AB39-0020AF71E433> - FLOAT x; - FLOAT y; - FLOAT z; -} - -template Coords2d { - - FLOAT u; - FLOAT v; -} - -template Matrix4x4 { - - array FLOAT matrix[16]; -} - -template ColorRGBA { - <35FF44E0-6C7C-11cf-8F52-0040333594A3> - FLOAT red; - FLOAT green; - FLOAT blue; - FLOAT alpha; -} - -template ColorRGB { - - FLOAT red; - FLOAT green; - FLOAT blue; -} - -template IndexedColor { - <1630B820-7842-11cf-8F52-0040333594A3> - DWORD index; - ColorRGBA indexColor; -} - -template Boolean { - <4885AE61-78E8-11cf-8F52-0040333594A3> - SWORD truefalse; -} - -template Boolean2d { - <4885AE63-78E8-11cf-8F52-0040333594A3> - Boolean u; - Boolean v; -} - -template MaterialWrap { - <4885AE60-78E8-11cf-8F52-0040333594A3> - Boolean u; - Boolean v; -} - -template TextureFilename { - - STRING filename; -} - -template Material { - <3D82AB4D-62DA-11cf-AB39-0020AF71E433> - ColorRGBA faceColor; - FLOAT power; - ColorRGB specularColor; - ColorRGB emissiveColor; - [...] -} - -template MeshFace { - <3D82AB5F-62DA-11cf-AB39-0020AF71E433> - DWORD nFaceVertexIndices; - array DWORD faceVertexIndices[nFaceVertexIndices]; -} - -template MeshFaceWraps { - <4885AE62-78E8-11cf-8F52-0040333594A3> - DWORD nFaceWrapValues; - Boolean2d faceWrapValues; -} - -template MeshTextureCoords { - - DWORD nTextureCoords; - array Coords2d textureCoords[nTextureCoords]; -} - -template MeshMaterialList { - - DWORD nMaterials; - DWORD nFaceIndexes; - array DWORD faceIndexes[nFaceIndexes]; - [Material] -} - -template MeshNormals { - - DWORD nNormals; - array Vector normals[nNormals]; - DWORD nFaceNormals; - array MeshFace faceNormals[nFaceNormals]; -} - -template MeshVertexColors { - <1630B821-7842-11cf-8F52-0040333594A3> - DWORD nVertexColors; - array IndexedColor vertexColors[nVertexColors]; -} - -template Mesh { - <3D82AB44-62DA-11cf-AB39-0020AF71E433> - DWORD nVertices; - array Vector vertices[nVertices]; - DWORD nFaces; - array MeshFace faces[nFaces]; - [...] -} - -template FrameTransformMatrix { - - Matrix4x4 frameMatrix; -} - -template Frame { - <3D82AB46-62DA-11cf-AB39-0020AF71E433> - [...] -} - -Header { - 1; - 0; - 1; -} - - - -Mesh CINEMA4D_Mesh { - 16; - // Lever1 - -4.481;-4.311;-6.25;, - -44.655;43.567;-6.25;, - 5.095;3.724;-6.25;, - -35.079;51.602;-6.25;, - 5.095;3.724;6.25;, - -35.079;51.602;6.25;, - -4.481;-4.311;6.25;, - -44.655;43.567;6.25;, - // Lever_Hold - -25.0;-9.375;-18.75;, - -25.0;9.375;-18.75;, - 25.0;-9.375;-18.75;, - 25.0;9.375;-18.75;, - 25.0;-9.375;18.75;, - 25.0;9.375;18.75;, - -25.0;-9.375;18.75;, - -25.0;9.375;18.75;; - - 12; - // Lever1 - 4;0,1,3,2;, - 4;2,3,5,4;, - 4;4,5,7,6;, - 4;6,7,1,0;, - 4;1,7,5,3;, - 4;6,0,2,4;, - // Lever_Hold - 4;8,9,11,10;, - 4;10,11,13,12;, - 4;12,13,15,14;, - 4;14,15,9,8;, - 4;9,15,13,11;, - 4;14,8,10,12;; - - MeshNormals { - 16; - // Lever1 - 0.088;-0.161;-0.036;, - -0.144;0.115;-0.036;, - 0.144;-0.115;-0.036;, - -0.088;0.161;-0.036;, - 0.144;-0.115;0.036;, - -0.088;0.161;0.036;, - 0.088;-0.161;0.036;, - -0.144;0.115;0.036;, - // Lever_Hold - -0.144;-0.054;-0.108;, - -0.144;0.054;-0.108;, - 0.144;-0.054;-0.108;, - 0.144;0.054;-0.108;, - 0.144;-0.054;0.108;, - 0.144;0.054;0.108;, - -0.144;-0.054;0.108;, - -0.144;0.054;0.108;; - - 12; - // Lever1 - 4;0,1,3,2;, - 4;2,3,5,4;, - 4;4,5,7,6;, - 4;6,7,1,0;, - 4;1,7,5,3;, - 4;6,0,2,4;, - // Lever_Hold - 4;8,9,11,10;, - 4;10,11,13,12;, - 4;12,13,15,14;, - 4;14,15,9,8;, - 4;9,15,13,11;, - 4;14,8,10,12;; - - } - MeshTextureCoords { - 16; - // Lever1 - 0.027;0.399;, - 0.027;0.437;, - 0.035;0.399;, - 0.035;0.437;, - 0.035;0.437;, - 0.035;0.399;, - 0.027;0.437;, - 0.027;0.399;, - // Lever_Hold - 0.0;0.063;, - 0.0;0.086;, - 0.031;0.063;, - 0.031;0.086;, - 0.031;0.086;, - 0.031;0.063;, - 0.0;0.086;, - 0.0;0.063;; - } -} \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/models/levier_on.x b/mods/ITEMS/REDSTONE/mesecons_walllever/models/levier_on.x deleted file mode 100644 index cda53766ab..0000000000 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/models/levier_on.x +++ /dev/null @@ -1,274 +0,0 @@ -xof 0302txt 0064 -// File created by CINEMA 4D - -template Header { - <3D82AB43-62DA-11cf-AB39-0020AF71E433> - SWORD major; - SWORD minor; - DWORD flags; -} - -template Vector { - <3D82AB5E-62DA-11cf-AB39-0020AF71E433> - FLOAT x; - FLOAT y; - FLOAT z; -} - -template Coords2d { - - FLOAT u; - FLOAT v; -} - -template Matrix4x4 { - - array FLOAT matrix[16]; -} - -template ColorRGBA { - <35FF44E0-6C7C-11cf-8F52-0040333594A3> - FLOAT red; - FLOAT green; - FLOAT blue; - FLOAT alpha; -} - -template ColorRGB { - - FLOAT red; - FLOAT green; - FLOAT blue; -} - -template IndexedColor { - <1630B820-7842-11cf-8F52-0040333594A3> - DWORD index; - ColorRGBA indexColor; -} - -template Boolean { - <4885AE61-78E8-11cf-8F52-0040333594A3> - SWORD truefalse; -} - -template Boolean2d { - <4885AE63-78E8-11cf-8F52-0040333594A3> - Boolean u; - Boolean v; -} - -template MaterialWrap { - <4885AE60-78E8-11cf-8F52-0040333594A3> - Boolean u; - Boolean v; -} - -template TextureFilename { - - STRING filename; -} - -template Material { - <3D82AB4D-62DA-11cf-AB39-0020AF71E433> - ColorRGBA faceColor; - FLOAT power; - ColorRGB specularColor; - ColorRGB emissiveColor; - [...] -} - -template MeshFace { - <3D82AB5F-62DA-11cf-AB39-0020AF71E433> - DWORD nFaceVertexIndices; - array DWORD faceVertexIndices[nFaceVertexIndices]; -} - -template MeshFaceWraps { - <4885AE62-78E8-11cf-8F52-0040333594A3> - DWORD nFaceWrapValues; - Boolean2d faceWrapValues; -} - -template MeshTextureCoords { - - DWORD nTextureCoords; - array Coords2d textureCoords[nTextureCoords]; -} - -template MeshMaterialList { - - DWORD nMaterials; - DWORD nFaceIndexes; - array DWORD faceIndexes[nFaceIndexes]; - [Material] -} - -template MeshNormals { - - DWORD nNormals; - array Vector normals[nNormals]; - DWORD nFaceNormals; - array MeshFace faceNormals[nFaceNormals]; -} - -template MeshVertexColors { - <1630B821-7842-11cf-8F52-0040333594A3> - DWORD nVertexColors; - array IndexedColor vertexColors[nVertexColors]; -} - -template Mesh { - <3D82AB44-62DA-11cf-AB39-0020AF71E433> - DWORD nVertices; - array Vector vertices[nVertices]; - DWORD nFaces; - array MeshFace faces[nFaces]; - [...] -} - -template FrameTransformMatrix { - - Matrix4x4 frameMatrix; -} - -template Frame { - <3D82AB46-62DA-11cf-AB39-0020AF71E433> - [...] -} - -Header { - 1; - 0; - 1; -} - - - -Mesh CINEMA4D_Mesh { - 16; - // Lever1 - 4.968;-3.861;6.175;, - 44.767;43.898;-0.249;, - -4.623;4.154;6.346;, - 35.177;51.913;-0.078;, - -5.577;3.277;-6.087;, - 34.222;51.036;-12.511;, - 4.014;-4.738;-6.258;, - 43.813;43.021;-12.682;, - // Lever_Hold - -25.0;-9.375;-18.75;, - -25.0;9.375;-18.75;, - 25.0;-9.375;-18.75;, - 25.0;9.375;-18.75;, - 25.0;-9.375;18.75;, - 25.0;9.375;18.75;, - -25.0;-9.375;18.75;, - -25.0;9.375;18.75;; - - 12; - // Lever1 - 4;0,1,3,2;, - 4;2,3,5,4;, - 4;4,5,7,6;, - 4;6,7,1,0;, - 4;1,7,5,3;, - 4;6,0,2,4;, - // Lever_Hold - 4;8,9,11,10;, - 4;10,11,13,12;, - 4;12,13,15,14;, - 4;14,15,9,8;, - 4;9,15,13,11;, - 4;14,8,10,12;; - - MeshNormals { - 16; - // Lever1 - -0.084;-0.158;0.054;, - 0.145;0.117;0.017;, - -0.14;-0.112;0.055;, - 0.09;0.164;0.018;, - -0.145;-0.117;-0.017;, - 0.084;0.158;-0.054;, - -0.09;-0.164;-0.018;, - 0.14;0.112;-0.055;, - // Lever_Hold - -0.144;-0.054;-0.108;, - -0.144;0.054;-0.108;, - 0.144;-0.054;-0.108;, - 0.144;0.054;-0.108;, - 0.144;-0.054;0.108;, - 0.144;0.054;0.108;, - -0.144;-0.054;0.108;, - -0.144;0.054;0.108;; - - 12; - // Lever1 - 4;0,1,3,2;, - 4;2,3,5,4;, - 4;4,5,7,6;, - 4;6,7,1,0;, - 4;1,7,5,3;, - 4;6,0,2,4;, - // Lever_Hold - 4;8,9,11,10;, - 4;10,11,13,12;, - 4;12,13,15,14;, - 4;14,15,9,8;, - 4;9,15,13,11;, - 4;14,8,10,12;; - - } - MeshTextureCoords { - 16; - // Lever1 - 0.027;0.399;, - 0.027;0.437;, - 0.035;0.399;, - 0.035;0.437;, - 0.035;0.437;, - 0.035;0.399;, - 0.027;0.437;, - 0.027;0.399;, - // Lever_Hold - 0.0;0.063;, - 0.0;0.086;, - 0.031;0.063;, - 0.031;0.086;, - 0.031;0.086;, - 0.031;0.063;, - 0.0;0.086;, - 0.0;0.063;; - } - MeshMaterialList { - 2; - 12; - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1; - - Material C4DMAT_NONE { - 1.0;1.0;1.0;1.0;; - 1.0; - 0.0;0.0;0.0;; - 0.0;0.0;0.0;; - } - Material C4DMAT_Terrain { - 1.0;1.0;1.0;1.0;; - 1.0; - 0.0;0.0;0.0;; - 0.0;0.0;0.0;; - } - - } -} \ No newline at end of file diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever.png b/mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever.png index 34e4626e0f056a4091ebb5e7177b01f546486e71..5774607cf9393ce8cc24359157c34169b633a655 100644 GIT binary patch delta 122 zcmb>HWt<>c!o45?sDR*>##>g(%UvP4D5 zcZSC!o7c5jdc>46Q2`s!X9rYUdmMzItINNqeqkNJn!(5k5yj#9FuUXEk$II}` WR@iCr-iN5{)9{+#n&R8c)nxC&)E~G3w3exW#p@PG5Xh!d!?{z2@GIkG%zjuu1?JsFf@R9s{ zdyU0NJ37?_sd@mE33m@z(kB#?CO-*v#~374Hm3#!={i8oWpiQS%GQQdv%`|?lL4_@ zDOq5g)3sl>kR#oyR3!FB>kpKSD>-!EuUbi0nc+EfYHtlxQ5Fp>YQN4aNS*&X)Cu&< SsKz}20000Nkl3)Cia=MoZQXtzKd;|TJJ9mZEFa%lZBI`Q1ap=Y7<#YL zqhle8G}aZum)s+RF~AeS{Zzm`v$X{m$-Kj6L*mF1~-bW&*22IRSOumBIB7PB#iwy2Ej*00000NkvXXu0mjf)1iV5 diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_off.png b/mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_off.png deleted file mode 100644 index 6723c2089825ea4b9b9f2c67ddd39b715a3194c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!M}SX=E0CTwYu4Pka~CXFuyEnR zMT-_KS+b-*!*oir%Jk{eXU?2CE7usPV0Nk9oH=uV%I43XkF0X((xq$b?Kif2JdTSx z12l`hB*+hBHVA~Kyovx)m7Xq+Arj%eeiwzB4LDwJDLxm=3!819FU~ LtDnm{r-UW|be3{) diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_on.png b/mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_on.png deleted file mode 100644 index 6a3b496c514d05bac8bb9114c9561df76b5acc04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Yk*IPE0CT(efrFqGiS}3HGB5# zIdkUBojZ5_{P_zOELga3;i5&0mMmGabm`Kwvn?+!aJafUmdKI;Vst0H_jg5C8xG diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_sides.png b/mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_sides.png deleted file mode 100644 index 7dbc66959abd08711c6b1acfeaa2a72f001367a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}a)3{WYjt&XO-)T*U0r>BeM3V- zV`F1eQ&V$ub4yE0Yiny;TU&d3dq+n{XJ=8RU#}J9|)Shs@ z<^Ud+=?AiB+i>ii{(HWWgy2abdF8doza?4s`8H?XSLc0JI@eTUdg>J${YhsYJ(iWc zyj|sjQSr4Imt#3gTL15UAnACirTApNk`;UL%%opNQxr_gGdmV_rb$Tgu3ER+WX11& g*KFcXZPPWiUs53yVSKjmG|&MIp00i_>zopr0N~7azW@LL diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_tb.png b/mods/ITEMS/REDSTONE/mesecons_walllever/textures/jeija_wall_lever_tb.png deleted file mode 100644 index a646cf53e3e2b349901a2bfef1db9db3704559dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx*Bp9q_EZ7UA7J0fjhDb=V9%L*!Y{0?daPO{# zvc)@=6NSrv7M7nqIkD_d##hJFw+ttI3(1_Yf$wcmy6yBR)y3(aH31)M|C{D=O8QRo zmkGQ5^or1uk4zfEc99jP#m-wZPtBg7uH=!Glh4Zfa;L-F+J@$+RX}n zt5mg*>(v16egBOzb0c+6Sk~3QV|Pt5ENgOJcmDJ0Lu|KJFRJ-wH8Hhcl841MsEB88*{M_J zN}S2@de5#!$@xidU^@7B!ePU{zIRf|j>aiZ?K(v+&Svsn+s*saXIoaZ`CCP&ooHKT~0o}^r>FVdQ&MBb@0OC@8 A5C8xG From dfc0d52372307bbfa4b29837ab8287aa8f0f346f Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 8 Jan 2018 17:45:30 +0100 Subject: [PATCH 2/6] Implement correct lever orientations --- .../REDSTONE/mesecons_walllever/init.lua | 108 ++++++++++++++++-- 1 file changed, 99 insertions(+), 9 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua index e93b4f011b..9ac9e98817 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua @@ -1,6 +1,19 @@ --- WALL LEVER --- Basically a switch that can be attached to a wall --- Powers the block 2 nodes behind (using a receiver) +local lever_get_output_rules = function(node) + local rules = { + {x = -1, y = 0, z = 0}, + {x = 1, y = 0, z = 0}, + {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = 1}, + {x = 0, y = -1, z = 0}, + {x = 0, y = 1, z = 0}, + } + local dir = minetest.facedir_to_dir(node.param2) + dir = vector.multiply(dir, 2) + table.insert(rules, dir) + return rules +end + +-- LEVER minetest.register_node("mesecons_walllever:wall_lever_off", { drawtype = "mesh", tiles = { @@ -24,15 +37,91 @@ minetest.register_node("mesecons_walllever:wall_lever_off", { _doc_items_longdesc = "A lever is a redstone component which can be flipped on and off. It supplies redstone power to the blocks behind while it is in the “on” state.", _doc_items_usagehelp = "Right-click the lever to flip it on or off.", on_rightclick = function (pos, node) - mesecon:swap_node(pos, "mesecons_walllever:wall_lever_on") - mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node)) + minetest.swap_node(pos, {name="mesecons_walllever:wall_lever_on",param2=node.param2}) + mesecon:receptor_on(pos, lever_get_output_rules(node)) minetest.sound_play("mesecons_lever", {pos=pos}) end, + node_placement_prediction = "", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" then + -- no interaction possible with entities + return itemstack + end + + local under = pointed_thing.under + local node = minetest.get_node(under) + local def = minetest.registered_nodes[node.name] + if not def then return end + local groups = def.groups + + -- Check special rightclick action of pointed node + if def and def.on_rightclick then + if not placer:get_player_control().sneak then + return def.on_rightclick(under, node, placer, itemstack, + pointed_thing) or itemstack, false + end + end + + -- If the pointed node is buildable, let's look at the node *behind* that node + if def.buildable_to then + local dir = vector.subtract(pointed_thing.above, pointed_thing.under) + local actual = vector.subtract(under, dir) + local actualnode = minetest.get_node(actual) + def = minetest.registered_nodes[actualnode.name] + groups = def.groups + end + + -- Only allow placement on full-cube solid opaque nodes + if (not groups) or (not groups.solid) or (not groups.opaque) or (def.node_box and def.node_box.type ~= "regular") then + return itemstack + end + + local above = pointed_thing.above + local dir = vector.subtract(above, under) + local wdir + local tau = math.pi*2 + if dir.z == 1 then + wdir = 6 + elseif dir.z == -1 then + wdir = 8 + elseif dir.x == 1 then + wdir = 15 + elseif dir.x == -1 then + wdir = 17 + elseif dir.y ~= 0 then + local yaw = placer:get_look_horizontal() + if (yaw > tau/8 and yaw < (tau/8)*3) or (yaw < (tau/8)*7 and yaw > (tau/8)*5) then + if dir.y == -1 then + wdir = 23 + else + wdir = 1 + end + else + if dir.y == -1 then + wdir = 22 + else + wdir = 2 + end + end + end + + local idef = itemstack:get_definition() + local itemstack, success = minetest.item_place_node(itemstack, placer, pointed_thing, wdir) + + if success then + if idef.sounds and idef.sounds.place then + minetest.sound_play(idef.sounds.place, {pos=above, gain=1}) + end + end + return itemstack + end, + sounds = mcl_sounds.node_sound_stone_defaults(), mesecons = {receptor = { - rules = mesecon.rules.buttonlike_get, + rules = lever_get_output_rules, state = mesecon.state.off }}, + on_rotate = false, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, }) @@ -57,15 +146,16 @@ minetest.register_node("mesecons_walllever:wall_lever_on", { description="Lever", _doc_items_create_entry = false, on_rightclick = function (pos, node) - mesecon:swap_node(pos, "mesecons_walllever:wall_lever_off") - mesecon:receptor_off(pos, mesecon.rules.buttonlike_get(node)) + minetest.swap_node(pos, {name="mesecons_walllever:wall_lever_off", param2=node.param2}) + mesecon:receptor_off(pos, lever_get_output_rules(node)) minetest.sound_play("mesecons_lever", {pos=pos}) end, sounds = mcl_sounds.node_sound_stone_defaults(), mesecons = {receptor = { - rules = mesecon.rules.buttonlike_get, + rules = lever_get_output_rules, state = mesecon.state.on }}, + on_rotate = false, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, }) From 1505290e24002ef7d7c330d24cea4c349f6c9f1f Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 8 Jan 2018 20:10:44 +0100 Subject: [PATCH 3/6] New way to attach node: attached_node_facedir --- GROUPS.md | 1 + mods/CORE/mcl_attached/description.txt | 1 + mods/CORE/mcl_attached/init.lua | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 mods/CORE/mcl_attached/description.txt create mode 100644 mods/CORE/mcl_attached/init.lua diff --git a/GROUPS.md b/GROUPS.md index c1b6f4eb5f..3116d64302 100644 --- a/GROUPS.md +++ b/GROUPS.md @@ -48,6 +48,7 @@ Please read to learn how digging times * `destroys_items=1`: If an item happens to be *inside* this node, the item will be destroyed * `no_eat_delay=1`: Only for foodstuffs. When eating this, all eating delays are ignored. * `can_eat_when_full=1`: Only for foodstuffs. This item can be eaten when the user has a full hunger bar +* `attached_node_facedir=1`: Like `attached_node`, but for facedir nodes #### Footnotes diff --git a/mods/CORE/mcl_attached/description.txt b/mods/CORE/mcl_attached/description.txt new file mode 100644 index 0000000000..3532db31db --- /dev/null +++ b/mods/CORE/mcl_attached/description.txt @@ -0,0 +1 @@ +Adds additional ways for nodes to be attached. diff --git a/mods/CORE/mcl_attached/init.lua b/mods/CORE/mcl_attached/init.lua new file mode 100644 index 0000000000..45e1e56b03 --- /dev/null +++ b/mods/CORE/mcl_attached/init.lua @@ -0,0 +1,24 @@ +local original_function = minetest.check_single_for_falling + +minetest.check_single_for_falling = function(pos) + local ret_o = original_function(pos) + + local ret = false + local node = minetest.get_node(pos) + if minetest.get_item_group(node.name, "attached_node_facedir") ~= 0 then + local dir = minetest.facedir_to_dir(node.param2) + local cpos = vector.add(pos, dir) + local cnode = minetest.get_node(cpos) + if minetest.get_item_group(cnode.name, "solid") == 0 then + minetest.remove_node(pos) + local drops = minetest.get_node_drops(node.name, "") + for dr=1, #drops do + minetest.add_item(pos, drops[dr]) + end + ret = true + end + end + + return ret_o or ret +end + From 33386b19caef3e2985d6e2e1b7864b138005c98c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 8 Jan 2018 20:11:33 +0100 Subject: [PATCH 4/6] Drop lever when attached node is destroyed --- .../REDSTONE/mesecons_walllever/init.lua | 30 ++- .../models/jeija_wall_lever_off.obj | 172 +++++++++--------- .../models/jeija_wall_lever_on.obj | 170 ++++++++--------- 3 files changed, 182 insertions(+), 190 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua index 9ac9e98817..72bfee16b4 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua @@ -29,9 +29,9 @@ minetest.register_node("mesecons_walllever:wall_lever_off", { walkable = false, selection_box = { type = "fixed", - fixed = { -3/16, -8/16, -4/16, 3/16, -2/16, 4/16 }, + fixed = { -3/16, -4/16, 2/16, 3/16, 4/16, 8/16 }, }, - groups = {handy=1, dig_by_water=1, destroy_by_lava_flow=1, dig_by_piston=1}, + groups = {handy=1, dig_by_water=1, destroy_by_lava_flow=1, dig_by_piston=1, attached_node_facedir=1}, is_ground_content = false, description="Lever", _doc_items_longdesc = "A lever is a redstone component which can be flipped on and off. It supplies redstone power to the blocks behind while it is in the “on” state.", @@ -77,30 +77,22 @@ minetest.register_node("mesecons_walllever:wall_lever_off", { end local above = pointed_thing.above - local dir = vector.subtract(above, under) - local wdir + local dir = vector.subtract(under, above) local tau = math.pi*2 - if dir.z == 1 then - wdir = 6 - elseif dir.z == -1 then - wdir = 8 - elseif dir.x == 1 then - wdir = 15 - elseif dir.x == -1 then - wdir = 17 - elseif dir.y ~= 0 then + local wdir = minetest.dir_to_facedir(dir, true) + if dir.y ~= 0 then local yaw = placer:get_look_horizontal() if (yaw > tau/8 and yaw < (tau/8)*3) or (yaw < (tau/8)*7 and yaw > (tau/8)*5) then if dir.y == -1 then - wdir = 23 + wdir = 13 else - wdir = 1 + wdir = 15 end else if dir.y == -1 then - wdir = 22 + wdir = 10 else - wdir = 2 + wdir = 8 end end end @@ -138,9 +130,9 @@ minetest.register_node("mesecons_walllever:wall_lever_on", { walkable = false, selection_box = { type = "fixed", - fixed = { -3/16, -8/16, -4/16, 3/16, -2/16, 4/16 }, + fixed = { -3/16, -4/16, 2/16, 3/16, 4/16, 8/16 }, }, - groups = {handy=1, not_in_creative_inventory = 1, dig_by_water=1, destroy_by_lava_flow=1, dig_by_piston=1}, + groups = {handy=1, not_in_creative_inventory = 1, dig_by_water=1, destroy_by_lava_flow=1, dig_by_piston=1, attached_node_facedir=1}, is_ground_content = false, drop = '"mesecons_walllever:wall_lever_off" 1', description="Lever", diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_off.obj b/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_off.obj index 22df3acfd9..158387ea38 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_off.obj +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_off.obj @@ -1,90 +1,90 @@ -# Blender v2.78 (sub 0) OBJ File: '' +# Blender v2.79 (sub 0) OBJ File: '' # www.blender.org -mtllib jeija_wall_lever_on.mtl -o nodebox1.002 -v -0.070437 -0.459607 0.138449 -v -0.070383 -0.407163 0.058550 -v -0.070618 -0.117856 0.289534 -v -0.070672 -0.170301 0.369433 -v 0.054549 -0.459593 0.139679 -v 0.054604 -0.407150 0.059783 -v 0.054369 -0.117843 0.290768 -v 0.054313 -0.170287 0.370665 -vt 0.0625 0.5625 -vt 0.1250 0.5625 -vt 0.1250 0.8750 -vt 0.0625 0.8750 -vt 0.1875 0.5625 -vt 0.2500 0.5625 -vt 0.2500 0.8750 -vt 0.1875 0.8750 -vt 0.1250 0.5625 -vt 0.1250 0.8750 -vt 0.0625 0.8750 -vt 0.0625 0.5625 -vt 0.2500 0.5625 -vt 0.2500 0.8750 -vt 0.1875 0.8750 -vt 0.1875 0.5625 -vt 0.6250 0.8750 -vt 0.6250 0.9375 -vt 0.5625 0.9375 -vt 0.5625 0.8750 -vt 0.0000 0.0000 -vt 0.0000 0.0000 -vt 0.0000 0.0000 -vt 0.0000 0.0000 -vn 1.0000 0.0002 0.0008 -vn 0.0076 0.6239 -0.7814 -vn 0.0076 0.6239 -0.7815 -vn 0.0055 -0.8360 -0.5487 -usemtl none.000 +mtllib jeija_wall_lever_off.mtl +o nodebox1.001 +v -0.170183 0.248882 0.492124 +v -0.161792 -0.249536 0.496140 +v -0.161781 -0.250523 0.373114 +v -0.170172 0.247894 0.369098 +v 0.161753 0.245254 0.492135 +v 0.170145 -0.253163 0.496151 +v 0.170155 -0.254151 0.373125 +v 0.161764 0.244266 0.369109 +vt 0.500000 0.203100 +vt 0.000000 0.203100 +vt 0.000000 0.000000 +vt 0.500000 0.000000 +vt 0.500000 0.203100 +vt 0.000000 0.203100 +vt 0.000000 0.000000 +vt 0.500000 0.000000 +vt 0.000000 0.203100 +vt 0.000100 0.000100 +vt 0.500000 0.000000 +vt 0.500000 0.203100 +vt 0.000000 0.203100 +vt 0.000000 -0.000000 +vt 0.000000 0.500000 +vt 0.000000 0.000000 +vt 0.500000 -0.000000 +vt 0.500000 0.500000 +vt -0.000000 0.500000 +vt 0.500000 -0.000000 +vt 0.500000 0.500000 +vn 0.9999 0.0168 -0.0000 +vn 0.9999 0.0168 -0.0001 +vn -0.0109 -0.9999 0.0080 +vn 0.0001 0.0081 1.0000 +usemtl none.003 s 1 f 1/1/1 2/2/1 3/3/1 4/4/1 -f 5/5/1 6/6/1 7/7/1 8/8/1 -f 1/9/2 4/10/2 8/11/2 5/12/2 -f 2/13/3 3/14/3 7/15/3 6/16/3 -f 4/17/4 3/18/4 7/19/4 8/20/4 -usemtl none.000_NONE -f 1/21/4 2/22/4 6/23/4 5/24/4 -o nodebox1.003 -v -0.170183 -0.492185 0.248761 -v -0.161792 -0.496079 -0.249657 -v -0.161781 -0.373053 -0.250614 -v -0.170172 -0.369159 0.247804 -v 0.161753 -0.492195 0.245133 -v 0.170145 -0.496089 -0.253285 -v 0.170155 -0.373063 -0.254242 -v 0.161764 -0.369169 0.244176 -vt 0.5000 0.2031 -vt 0.0000 0.2031 -vt 0.0000 0.0000 -vt 0.5000 0.0000 -vt 0.5000 0.2031 -vt 0.0000 0.2031 -vt 0.0000 0.0000 -vt 0.5000 0.0000 -vt 0.0000 0.2031 -vt 0.0001 0.0001 -vt 0.5000 0.0000 -vt 0.5000 0.2031 -vt 0.0000 0.2031 -vt 0.0000 -0.0000 -vt 0.0000 0.5000 -vt 0.0000 0.0000 -vt 0.5000 -0.0000 -vt 0.5000 0.5000 -vt -0.0000 0.5000 -vt 0.5000 -0.0000 -vt 0.5000 0.5000 -vn 0.9999 0.0000 0.0168 -vn -0.0109 -0.0078 -0.9999 -vn 0.0001 -1.0000 0.0078 -usemtl none.001 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 1/9/3 4/10/3 8/8/3 5/5/3 +f 2/11/3 3/12/3 7/13/3 6/14/3 +f 1/15/4 2/16/4 6/17/4 5/18/4 +f 4/19/4 3/3/4 7/20/4 8/21/4 +o nodebox1.000 +v -0.070437 0.138562 0.459573 +v -0.070383 0.058650 0.407149 +v -0.070618 0.289563 0.117785 +v -0.070672 0.369475 0.170211 +v 0.054549 0.139792 0.459559 +v 0.054604 0.059883 0.407135 +v 0.054369 0.290797 0.117772 +v 0.054313 0.370707 0.170196 +vt 0.062500 0.562500 +vt 0.125000 0.562500 +vt 0.125000 0.875000 +vt 0.062500 0.875000 +vt 0.187500 0.562500 +vt 0.250000 0.562500 +vt 0.250000 0.875000 +vt 0.187500 0.875000 +vt 0.125000 0.562500 +vt 0.125000 0.875000 +vt 0.062500 0.875000 +vt 0.062500 0.562500 +vt 0.250000 0.562500 +vt 0.250000 0.875000 +vt 0.187500 0.875000 +vt 0.187500 0.562500 +vt 0.625000 0.875000 +vt 0.625000 0.937500 +vt 0.562500 0.937500 +vt 0.562500 0.875000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vn 1.0000 0.0008 -0.0002 +vn 0.0076 -0.7816 -0.6237 +vn 0.0055 -0.5485 0.8361 +usemtl none.002 s 1 -f 9/25/5 10/26/5 11/27/5 12/28/5 -f 13/29/5 14/30/5 15/31/5 16/32/5 -f 9/33/6 12/34/6 16/32/6 13/29/6 -f 10/35/6 11/36/6 15/37/6 14/38/6 -f 9/39/7 10/40/7 14/41/7 13/42/7 -f 12/43/7 11/27/7 15/44/7 16/45/7 +f 9/22/5 10/23/5 11/24/5 12/25/5 +f 13/26/5 14/27/5 15/28/5 16/29/5 +f 9/30/6 12/31/6 16/32/6 13/33/6 +f 10/34/6 11/35/6 15/36/6 14/37/6 +f 12/38/7 11/39/7 15/40/7 16/41/7 +usemtl none.000_NONE.001 +f 9/42/7 10/43/7 14/44/7 13/45/7 diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_on.obj b/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_on.obj index 5852fa96c3..e0874ecf82 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_on.obj +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_on.obj @@ -1,90 +1,90 @@ -# Blender v2.78 (sub 0) OBJ File: '' +# Blender v2.79 (sub 0) OBJ File: '' # www.blender.org -mtllib jeija_wall_lever_off.mtl -o nodebox1.007 -v -0.170183 -0.492185 0.248761 -v -0.161792 -0.496079 -0.249657 -v -0.161781 -0.373053 -0.250614 -v -0.170172 -0.369159 0.247804 -v 0.161753 -0.492195 0.245133 -v 0.170145 -0.496089 -0.253285 -v 0.170155 -0.373063 -0.254242 -v 0.161764 -0.369169 0.244176 -vt 0.5000 0.2031 -vt 0.0000 0.2031 -vt 0.0000 0.0000 -vt 0.5000 0.0000 -vt 0.5000 0.2031 -vt 0.0000 0.2031 -vt 0.0000 0.0000 -vt 0.5000 0.0000 -vt 0.0000 0.2031 -vt 0.0001 0.0001 -vt 0.5000 0.0000 -vt 0.5000 0.2031 -vt 0.0000 0.2031 -vt 0.0000 -0.0000 -vt 0.0000 0.5000 -vt 0.0000 0.0000 -vt 0.5000 -0.0000 -vt 0.5000 0.5000 -vt -0.0000 0.5000 -vt 0.5000 -0.0000 -vt 0.5000 0.5000 -vn 0.9999 0.0000 0.0168 -vn -0.0109 -0.0078 -0.9999 -vn 0.0001 -1.0000 0.0078 -usemtl none.007 -s 1 -f 1/1/1 2/2/1 3/3/1 4/4/1 -f 5/5/1 6/6/1 7/7/1 8/8/1 -f 1/9/2 4/10/2 8/8/2 5/5/2 -f 2/11/2 3/12/2 7/13/2 6/14/2 -f 1/15/3 2/16/3 6/17/3 5/18/3 -f 4/19/3 3/3/3 7/20/3 8/21/3 +mtllib jeija_wall_lever_on.mtl o nodebox1.006 -v 0.070437 -0.459607 -0.138449 -v 0.070383 -0.407163 -0.058550 -v 0.070618 -0.117856 -0.289534 -v 0.070672 -0.170301 -0.369433 -v -0.054549 -0.459593 -0.139679 -v -0.054604 -0.407150 -0.059783 -v -0.054369 -0.117843 -0.290768 -v -0.054313 -0.170287 -0.370665 -vt 0.0000 0.0000 -vt 0.0000 0.0000 -vt 0.0000 0.0000 -vt 0.0000 0.0000 -vt 0.0625 0.5625 -vt 0.1250 0.5625 -vt 0.1250 0.8750 -vt 0.0625 0.8750 -vt 0.1875 0.5625 -vt 0.2500 0.5625 -vt 0.2500 0.8750 -vt 0.1875 0.8750 -vt 0.1250 0.5625 -vt 0.1250 0.8750 -vt 0.0625 0.8750 -vt 0.0625 0.5625 -vt 0.2500 0.5625 -vt 0.2500 0.8750 -vt 0.1875 0.8750 -vt 0.1875 0.5625 -vt 0.6250 0.8750 -vt 0.6250 0.9375 -vt 0.5625 0.9375 -vt 0.5625 0.8750 -vn -0.0055 -0.8360 0.5487 -vn -1.0000 0.0002 -0.0008 -vn -0.0076 0.6239 0.7814 -vn -0.0076 0.6239 0.7815 +v 0.070437 -0.138656 0.459545 +v 0.070383 -0.058733 0.407137 +v -0.054604 -0.059966 0.407123 +v -0.054549 -0.139886 0.459530 +v 0.070618 -0.289587 0.117726 +v 0.070672 -0.369510 0.170135 +v -0.054369 -0.290821 0.117712 +v -0.054313 -0.370742 0.170120 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.062500 0.562500 +vt 0.125000 0.562500 +vt 0.125000 0.875000 +vt 0.062500 0.875000 +vt 0.187500 0.562500 +vt 0.250000 0.562500 +vt 0.250000 0.875000 +vt 0.187500 0.875000 +vt 0.125000 0.562500 +vt 0.125000 0.875000 +vt 0.062500 0.875000 +vt 0.062500 0.562500 +vt 0.250000 0.562500 +vt 0.250000 0.875000 +vt 0.187500 0.875000 +vt 0.187500 0.562500 +vt 0.625000 0.875000 +vt 0.625000 0.937500 +vt 0.562500 0.937500 +vt 0.562500 0.875000 +vn -0.0055 0.5483 0.8362 +vn -1.0000 -0.0008 -0.0002 +vn -0.0076 0.7817 -0.6236 +vn -0.0055 0.5484 0.8362 usemtl none.000_NONE.002 s 1 -f 9/22/4 10/23/4 14/24/4 13/25/4 +f 1/1/1 2/2/1 3/3/1 4/4/1 usemtl none.006 -f 9/26/5 10/27/5 11/28/5 12/29/5 -f 13/30/5 14/31/5 15/32/5 16/33/5 -f 9/34/6 12/35/6 16/36/6 13/37/6 -f 10/38/7 11/39/7 15/40/7 14/41/7 -f 12/42/4 11/43/4 15/44/4 16/45/4 +f 1/5/2 2/6/2 5/7/2 6/8/2 +f 4/9/2 3/10/2 7/11/2 8/12/2 +f 1/13/3 6/14/3 8/15/3 4/16/3 +f 2/17/3 5/18/3 7/19/3 3/20/3 +f 6/21/4 5/22/4 7/23/4 8/24/4 +o nodebox1.007 +v -0.170183 0.248540 0.492297 +v -0.161792 -0.249880 0.495967 +v -0.161781 -0.250782 0.372940 +v -0.170172 0.247638 0.369270 +v 0.161753 0.244912 0.492305 +v 0.170145 -0.253508 0.495975 +v 0.170155 -0.254410 0.372949 +v 0.161764 0.244010 0.369279 +vt 0.500000 0.203100 +vt 0.000000 0.203100 +vt 0.000000 0.000000 +vt 0.500000 0.000000 +vt 0.500000 0.203100 +vt 0.000000 0.203100 +vt 0.000000 0.000000 +vt 0.500000 0.000000 +vt 0.000000 0.203100 +vt 0.000100 0.000100 +vt 0.500000 0.000000 +vt 0.500000 0.203100 +vt 0.000000 0.203100 +vt 0.000000 -0.000000 +vt 0.000000 0.500000 +vt 0.000000 0.000000 +vt 0.500000 -0.000000 +vt 0.500000 0.500000 +vt -0.000000 0.500000 +vt 0.500000 -0.000000 +vt 0.500000 0.500000 +vn 0.9999 0.0168 -0.0000 +vn -0.0109 -0.9999 0.0073 +vn 0.0001 0.0074 1.0000 +usemtl none.007 +s 1 +f 9/25/5 10/26/5 11/27/5 12/28/5 +f 13/29/5 14/30/5 15/31/5 16/32/5 +f 9/33/6 12/34/6 16/32/6 13/29/6 +f 10/35/6 11/36/6 15/37/6 14/38/6 +f 9/39/7 10/40/7 14/41/7 13/42/7 +f 12/43/7 11/27/7 15/44/7 16/45/7 From d4d03526db4467594da3321844792917dbeca832 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 8 Jan 2018 20:19:33 +0100 Subject: [PATCH 5/6] Cocoas now use attached_node_facedir This fixes some annoying bugs when removing jungle trees nearby --- mods/ITEMS/mcl_cocoas/init.lua | 9 ++------- mods/ITEMS/mcl_core/nodes_trees.lua | 30 ++--------------------------- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/mods/ITEMS/mcl_cocoas/init.lua b/mods/ITEMS/mcl_cocoas/init.lua index 0a3160bbfd..f0290df7ad 100644 --- a/mods/ITEMS/mcl_cocoas/init.lua +++ b/mods/ITEMS/mcl_cocoas/init.lua @@ -68,12 +68,7 @@ end -- Cocoa definition -- 1st stage ---[[ TODO (code quality): Turn the cocoa nodes into attached nodes and make use of wallmounted. This is much better -than the current ugly hacky check after digging a jungle tree (in mcl_core). -Problem: If we want to use wallmounted, we MUST use a mesh, since wallmounted does not support -nodeboxes with multiple boxes. :-( -Using meshes will also clean up the texture mess. -]] +--[[ TODO: Use a mesh for cocoas for perfect texture compability. ]] local crop_def = { description = "Premature Cocoa", _doc_items_create_entry = true, @@ -110,7 +105,7 @@ local crop_def = { }, }, groups = { - handy=1,axey=1, cocoa=1, not_in_creative_inventory=1, dig_by_water=1, destroy_by_lava_flow=1, dig_by_piston=1 + handy=1,axey=1, cocoa=1, not_in_creative_inventory=1, dig_by_water=1, destroy_by_lava_flow=1, dig_by_piston=1, attached_node_facedir=1, }, sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 15, diff --git a/mods/ITEMS/mcl_core/nodes_trees.lua b/mods/ITEMS/mcl_core/nodes_trees.lua index cc0070bb13..deef53b758 100644 --- a/mods/ITEMS/mcl_core/nodes_trees.lua +++ b/mods/ITEMS/mcl_core/nodes_trees.lua @@ -1,6 +1,6 @@ -- Tree nodes: Wood, Wooden Planks, Sapling, Leaves -local register_tree_trunk = function(subname, description, longdesc, tiles, after_dig_node) +local register_tree_trunk = function(subname, description, longdesc, tiles) minetest.register_node("mcl_core:"..subname, { description = description, _doc_items_longdesc = longdesc, @@ -13,8 +13,6 @@ local register_tree_trunk = function(subname, description, longdesc, tiles, afte sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 10, _mcl_hardness = 2, - - after_dig_node = after_dig_node, }) end @@ -118,29 +116,6 @@ end --------------------- --- This is a bad bad workaround which is only done because cocoas are not wallmounted (but should) --- As long cocoas only EVER stick to jungle trees, and nothing else, this is probably a lesser sin. -local jungle_tree_after_dig_node = function(pos, oldnode, oldmetadata, digger) - -- Drop attached cocoas - local posses = { - { x = pos.x + 1, y = pos.y, z = pos.z }, - { x = pos.x - 1, y = pos.y, z = pos.z }, - { x = pos.x, y = pos.y, z = pos.z + 1 }, - { x = pos.x, y = pos.y, z = pos.z - 1 }, - } - for p=1, #posses do - local node = minetest.get_node(posses[p]) - local g = minetest.get_item_group(node.name, "cocoa") - if g and g >= 1 then - minetest.remove_node(posses[p]) - local drops = minetest.get_node_drops(node.name, "") - for d=1, #drops do - minetest.add_item(posses[p], drops[d]) - end - end - end -end - register_tree_trunk("tree", "Oak Wood", "The trunk of an oak tree.", {"default_tree_top.png", "default_tree_top.png", "default_tree.png"}) register_tree_trunk("darktree", "Dark Oak Wood", "The trunk of a dark oak tree.", {"mcl_core_log_big_oak_top.png", "mcl_core_log_big_oak_top.png", "mcl_core_log_big_oak.png"}) register_tree_trunk("acaciatree", "Acacia Wood", "The trunk of an acacia.", {"default_acacia_tree_top.png", "default_acacia_tree_top.png", "default_acacia_tree.png"}) @@ -148,8 +123,7 @@ register_tree_trunk("darktree", "Dark Oak Wood", "The trunk of a dark oak tree." register_tree_trunk("sprucetree", "Spruce Wood", "The trunk of a spruce tree.", {"mcl_core_log_spruce_top.png", "mcl_core_log_spruce_top.png", "mcl_core_log_spruce.png"}) register_tree_trunk("birchtree", "Birch Wood", "The trunk of a birch tree.", {"mcl_core_log_birch_top.png", "mcl_core_log_birch_top.png", "mcl_core_log_birch.png"}) -register_tree_trunk("jungletree", "Jungle Wood", "The trunk of a jungle tree.", {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}, jungle_tree_after_dig_node) - +register_tree_trunk("jungletree", "Jungle Wood", "The trunk of a jungle tree.", {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}) register_wooden_planks("wood", "Oak Wood Planks", {"default_wood.png"}) register_wooden_planks("darkwood", "Dark Oak Wood Planks", {"mcl_core_planks_big_oak.png"}) From 68a9a9bc40ddaa8daaf6c9ceef0d5e952773d9a5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 8 Jan 2018 20:46:44 +0100 Subject: [PATCH 6/6] Fix normals of wall levers and remove unused face --- .../models/jeija_wall_lever_off.obj | 114 +++++++++--------- .../models/jeija_wall_lever_on.obj | 114 +++++++++--------- 2 files changed, 112 insertions(+), 116 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_off.obj b/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_off.obj index 158387ea38..c5044de1c1 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_off.obj +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_off.obj @@ -1,7 +1,48 @@ # Blender v2.79 (sub 0) OBJ File: '' # www.blender.org mtllib jeija_wall_lever_off.mtl -o nodebox1.001 +o nodebox1.009 +v -0.070437 0.138562 0.459573 +v -0.070383 0.058650 0.407149 +v -0.070618 0.289563 0.117785 +v -0.070672 0.369475 0.170211 +v 0.054549 0.139792 0.459559 +v 0.054604 0.059883 0.407135 +v 0.054369 0.290797 0.117772 +v 0.054313 0.370707 0.170196 +vt 0.062500 0.562500 +vt 0.062500 0.875000 +vt 0.125000 0.875000 +vt 0.125000 0.562500 +vt 0.187500 0.562500 +vt 0.250000 0.562500 +vt 0.250000 0.875000 +vt 0.187500 0.875000 +vt 0.125000 0.562500 +vt 0.062500 0.562500 +vt 0.062500 0.875000 +vt 0.125000 0.875000 +vt 0.250000 0.562500 +vt 0.250000 0.875000 +vt 0.187500 0.875000 +vt 0.187500 0.562500 +vt 0.625000 0.875000 +vt 0.562500 0.875000 +vt 0.562500 0.937500 +vt 0.625000 0.937500 +vn -1.0000 -0.0008 0.0002 +vn 1.0000 0.0008 -0.0002 +vn -0.0076 0.7816 0.6237 +vn 0.0076 -0.7816 -0.6237 +vn -0.0055 0.5485 -0.8361 +usemtl none.009 +s off +f 1/1/1 4/2/1 3/3/1 2/4/1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 1/9/3 5/10/3 8/11/3 4/12/3 +f 2/13/4 3/14/4 7/15/4 6/16/4 +f 4/17/5 8/18/5 7/19/5 3/20/5 +o nodebox1.008 v -0.170183 0.248882 0.492124 v -0.161792 -0.249536 0.496140 v -0.161781 -0.250523 0.373114 @@ -11,9 +52,9 @@ v 0.170145 -0.253163 0.496151 v 0.170155 -0.254151 0.373125 v 0.161764 0.244266 0.369109 vt 0.500000 0.203100 -vt 0.000000 0.203100 -vt 0.000000 0.000000 vt 0.500000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.203100 vt 0.500000 0.203100 vt 0.000000 0.203100 vt 0.000000 0.000000 @@ -29,62 +70,19 @@ vt 0.000000 0.000000 vt 0.500000 -0.000000 vt 0.500000 0.500000 vt -0.000000 0.500000 -vt 0.500000 -0.000000 vt 0.500000 0.500000 +vt 0.500000 -0.000000 +vn -0.9999 -0.0168 0.0000 vn 0.9999 0.0168 -0.0000 -vn 0.9999 0.0168 -0.0001 +vn 0.0109 0.9999 -0.0080 vn -0.0109 -0.9999 0.0080 vn 0.0001 0.0081 1.0000 -usemtl none.003 -s 1 -f 1/1/1 2/2/1 3/3/1 4/4/1 -f 5/5/2 6/6/2 7/7/2 8/8/2 -f 1/9/3 4/10/3 8/8/3 5/5/3 -f 2/11/3 3/12/3 7/13/3 6/14/3 -f 1/15/4 2/16/4 6/17/4 5/18/4 -f 4/19/4 3/3/4 7/20/4 8/21/4 -o nodebox1.000 -v -0.070437 0.138562 0.459573 -v -0.070383 0.058650 0.407149 -v -0.070618 0.289563 0.117785 -v -0.070672 0.369475 0.170211 -v 0.054549 0.139792 0.459559 -v 0.054604 0.059883 0.407135 -v 0.054369 0.290797 0.117772 -v 0.054313 0.370707 0.170196 -vt 0.062500 0.562500 -vt 0.125000 0.562500 -vt 0.125000 0.875000 -vt 0.062500 0.875000 -vt 0.187500 0.562500 -vt 0.250000 0.562500 -vt 0.250000 0.875000 -vt 0.187500 0.875000 -vt 0.125000 0.562500 -vt 0.125000 0.875000 -vt 0.062500 0.875000 -vt 0.062500 0.562500 -vt 0.250000 0.562500 -vt 0.250000 0.875000 -vt 0.187500 0.875000 -vt 0.187500 0.562500 -vt 0.625000 0.875000 -vt 0.625000 0.937500 -vt 0.562500 0.937500 -vt 0.562500 0.875000 -vt 0.000000 0.000000 -vt 0.000000 0.000000 -vt 0.000000 0.000000 -vt 0.000000 0.000000 -vn 1.0000 0.0008 -0.0002 -vn 0.0076 -0.7816 -0.6237 -vn 0.0055 -0.5485 0.8361 -usemtl none.002 -s 1 -f 9/22/5 10/23/5 11/24/5 12/25/5 -f 13/26/5 14/27/5 15/28/5 16/29/5 -f 9/30/6 12/31/6 16/32/6 13/33/6 -f 10/34/6 11/35/6 15/36/6 14/37/6 -f 12/38/7 11/39/7 15/40/7 16/41/7 -usemtl none.000_NONE.001 -f 9/42/7 10/43/7 14/44/7 13/45/7 +vn -0.0001 -0.0081 -1.0000 +usemtl none.008 +s off +f 9/21/6 12/22/6 11/23/6 10/24/6 +f 13/25/7 14/26/7 15/27/7 16/28/7 +f 9/29/8 13/25/8 16/28/8 12/30/8 +f 10/31/9 11/32/9 15/33/9 14/34/9 +f 9/35/10 10/36/10 14/37/10 13/38/10 +f 12/39/11 16/40/11 15/41/11 11/23/11 diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_on.obj b/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_on.obj index e0874ecf82..5de8075ba1 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_on.obj +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/models/jeija_wall_lever_on.obj @@ -1,53 +1,7 @@ # Blender v2.79 (sub 0) OBJ File: '' # www.blender.org mtllib jeija_wall_lever_on.mtl -o nodebox1.006 -v 0.070437 -0.138656 0.459545 -v 0.070383 -0.058733 0.407137 -v -0.054604 -0.059966 0.407123 -v -0.054549 -0.139886 0.459530 -v 0.070618 -0.289587 0.117726 -v 0.070672 -0.369510 0.170135 -v -0.054369 -0.290821 0.117712 -v -0.054313 -0.370742 0.170120 -vt 0.000000 0.000000 -vt 0.000000 0.000000 -vt 0.000000 0.000000 -vt 0.000000 0.000000 -vt 0.062500 0.562500 -vt 0.125000 0.562500 -vt 0.125000 0.875000 -vt 0.062500 0.875000 -vt 0.187500 0.562500 -vt 0.250000 0.562500 -vt 0.250000 0.875000 -vt 0.187500 0.875000 -vt 0.125000 0.562500 -vt 0.125000 0.875000 -vt 0.062500 0.875000 -vt 0.062500 0.562500 -vt 0.250000 0.562500 -vt 0.250000 0.875000 -vt 0.187500 0.875000 -vt 0.187500 0.562500 -vt 0.625000 0.875000 -vt 0.625000 0.937500 -vt 0.562500 0.937500 -vt 0.562500 0.875000 -vn -0.0055 0.5483 0.8362 -vn -1.0000 -0.0008 -0.0002 -vn -0.0076 0.7817 -0.6236 -vn -0.0055 0.5484 0.8362 -usemtl none.000_NONE.002 -s 1 -f 1/1/1 2/2/1 3/3/1 4/4/1 -usemtl none.006 -f 1/5/2 2/6/2 5/7/2 6/8/2 -f 4/9/2 3/10/2 7/11/2 8/12/2 -f 1/13/3 6/14/3 8/15/3 4/16/3 -f 2/17/3 5/18/3 7/19/3 3/20/3 -f 6/21/4 5/22/4 7/23/4 8/24/4 -o nodebox1.007 +o nodebox1.011 v -0.170183 0.248540 0.492297 v -0.161792 -0.249880 0.495967 v -0.161781 -0.250782 0.372940 @@ -57,9 +11,9 @@ v 0.170145 -0.253508 0.495975 v 0.170155 -0.254410 0.372949 v 0.161764 0.244010 0.369279 vt 0.500000 0.203100 -vt 0.000000 0.203100 -vt 0.000000 0.000000 vt 0.500000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.203100 vt 0.500000 0.203100 vt 0.000000 0.203100 vt 0.000000 0.000000 @@ -75,16 +29,60 @@ vt 0.000000 0.000000 vt 0.500000 -0.000000 vt 0.500000 0.500000 vt -0.000000 0.500000 -vt 0.500000 -0.000000 vt 0.500000 0.500000 +vt 0.500000 -0.000000 +vn -0.9999 -0.0168 0.0000 vn 0.9999 0.0168 -0.0000 +vn 0.0109 0.9999 -0.0073 vn -0.0109 -0.9999 0.0073 vn 0.0001 0.0074 1.0000 -usemtl none.007 -s 1 -f 9/25/5 10/26/5 11/27/5 12/28/5 -f 13/29/5 14/30/5 15/31/5 16/32/5 -f 9/33/6 12/34/6 16/32/6 13/29/6 -f 10/35/6 11/36/6 15/37/6 14/38/6 -f 9/39/7 10/40/7 14/41/7 13/42/7 -f 12/43/7 11/27/7 15/44/7 16/45/7 +vn -0.0001 -0.0074 -1.0000 +usemtl none.011 +s off +f 1/1/1 4/2/1 3/3/1 2/4/1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 1/9/3 5/5/3 8/8/3 4/10/3 +f 2/11/4 3/12/4 7/13/4 6/14/4 +f 1/15/5 2/16/5 6/17/5 5/18/5 +f 4/19/6 8/20/6 7/21/6 3/3/6 +o nodebox1.010 +v 0.070437 -0.138656 0.459545 +v 0.070383 -0.058733 0.407137 +v -0.054604 -0.059966 0.407123 +v -0.054549 -0.139886 0.459530 +v 0.070618 -0.289587 0.117726 +v 0.070672 -0.369510 0.170135 +v -0.054369 -0.290821 0.117712 +v -0.054313 -0.370742 0.170120 +vt 0.062500 0.562500 +vt 0.062500 0.875000 +vt 0.125000 0.875000 +vt 0.125000 0.562500 +vt 0.187500 0.562500 +vt 0.250000 0.562500 +vt 0.250000 0.875000 +vt 0.187500 0.875000 +vt 0.125000 0.562500 +vt 0.062500 0.562500 +vt 0.062500 0.875000 +vt 0.125000 0.875000 +vt 0.250000 0.562500 +vt 0.250000 0.875000 +vt 0.187500 0.875000 +vt 0.187500 0.562500 +vt 0.625000 0.875000 +vt 0.562500 0.875000 +vt 0.562500 0.937500 +vt 0.625000 0.937500 +vn 1.0000 0.0008 0.0002 +vn -1.0000 -0.0008 -0.0002 +vn 0.0076 -0.7817 0.6236 +vn -0.0076 0.7817 -0.6236 +vn 0.0055 -0.5484 -0.8362 +usemtl none.010 +s off +f 9/22/7 14/23/7 13/24/7 10/25/7 +f 12/26/8 11/27/8 15/28/8 16/29/8 +f 9/30/9 12/31/9 16/32/9 14/33/9 +f 10/34/10 13/35/10 15/36/10 11/37/10 +f 14/38/11 16/39/11 15/40/11 13/41/11