From 4bc80ddba1ae82aac60952b5f53c459bfe211f9b Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Wed, 10 Jun 2015 18:40:02 +0200 Subject: [PATCH] Updated moreblocks (with slopes) - Solves #87 --- mods/moreblocks/circular_saw.lua | 31 ++++++++++++++---- mods/moreblocks/nodes.lua | 24 +++++++++----- mods/moreblocks/redefinitions.lua | 2 +- .../textures/moreblocks_empty_bookshelf.png | Bin 585 -> 219 bytes 4 files changed, 41 insertions(+), 16 deletions(-) mode change 100755 => 100644 mods/moreblocks/textures/moreblocks_empty_bookshelf.png diff --git a/mods/moreblocks/circular_saw.lua b/mods/moreblocks/circular_saw.lua index 98ddecbc..4735dcda 100755 --- a/mods/moreblocks/circular_saw.lua +++ b/mods/moreblocks/circular_saw.lua @@ -25,7 +25,8 @@ circular_saw.cost_in_microblocks = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 2, 4, 2, 4, 5, 6, 7, 1, 1, 2, 4, 6, 7, 8, - 3, 1, 1, 2, 4, 0, 0, 0, + 3, 1, 1, 2, 4, 4, 2, 7, + 7, 2, 7, 6, 4, 6, 5, 4, } circular_saw.names = { @@ -58,6 +59,17 @@ circular_saw.names = { {"stair", "_alt_2"}, {"stair", "_alt_4"}, {"stair", "_alt"}, + {"slope", ""}, + {"slope", "_half"}, + {"slope", "_half_raised"}, + {"slope", "_inner"}, + {"slope", "_inner_half"}, + {"slope", "_inner_half_raised"}, + {"slope", "_outer"}, + {"slope", "_outer_half"}, + {"slope", "_outer_half_raised"}, + {"slope", "_outer_cut"}, + {"slope", "_outer_cut_half"}, } function circular_saw:get_cost(inv, stackname) @@ -72,6 +84,8 @@ function circular_saw:get_output_inv(modname, material, amount, max) if (not max or max < 1 or max > 99) then max = 99 end local list = {} + local pos = #list + -- If there is nothing inside, display empty inventory: if amount < 1 then return list @@ -79,8 +93,10 @@ function circular_saw:get_output_inv(modname, material, amount, max) for i, t in ipairs(circular_saw.names) do local cost = circular_saw.cost_in_microblocks[i] - table.insert(list, modname .. ":" .. t[1] .. "_" .. material .. t[2] - .. " " .. math.min(math.floor(amount/cost), max)) + local balance = math.min(math.floor(amount/cost), max) + pos = pos + 1 + list[pos] = modname .. ":" .. t[1] .. "_" .. material .. t[2] + .. " " .. balance end return list end @@ -277,7 +293,8 @@ gui_slots = "listcolors[#606060AA;#808080;#101010;#202020;#FFF]" function circular_saw.on_construct(pos) local meta = minetest.get_meta(pos) - meta:set_string("formspec", "size[11,9]" ..gui_slots.. + local fancy_inv = default.gui_bg..default.gui_bg_img..default.gui_slots + meta:set_string("formspec", "size[11,9]"..fancy_inv.. "label[0,0;" ..S("Input\nmaterial").. "]" .. "list[current_name;input;1.5,0;1,1;]" .. "label[0,1;" ..S("Left-over").. "]" .. @@ -286,8 +303,8 @@ function circular_saw.on_construct(pos) "list[current_name;recycle;1.5,2;1,1;]" .. "field[0.3,3.5;1,1;max_offered;" ..S("Max").. ":;${max_offered}]" .. "button[1,3.2;1,1;Set;" ..S("Set").. "]" .. - "list[current_name;output;2.8,0;8,4;]" .. - "list[current_player;main;1.5,5;8,4;]") + "list[current_name;output;2.8,0;8,5;]" .. + "list[current_player;main;1.5,5.25;8,4;]") meta:set_int("anz", 0) -- No microblocks inside yet. meta:set_string("max_offered", 99) -- How many items of this kind are offered by default? @@ -297,7 +314,7 @@ function circular_saw.on_construct(pos) inv:set_size("input", 1) -- Input slot for full blocks of material x. inv:set_size("micro", 1) -- Storage for 1-7 surplus microblocks. inv:set_size("recycle", 1) -- Surplus partial blocks can be placed here. - inv:set_size("output", 4*8) -- 4x8 versions of stair-parts of material x. + inv:set_size("output", 5*8) -- 5x8 versions of stair-parts of material x. circular_saw:reset(pos) end diff --git a/mods/moreblocks/nodes.lua b/mods/moreblocks/nodes.lua index 859c5508..810df361 100755 --- a/mods/moreblocks/nodes.lua +++ b/mods/moreblocks/nodes.lua @@ -137,7 +137,8 @@ local nodes = { ["iron_glass"] = { description = S("Iron Glass"), drawtype = "glasslike_framed_optional", - tiles = {"moreblocks_iron_glass.png", "moreblocks_iron_glass_detail.png"}, + --tiles = {"moreblocks_iron_glass.png", "moreblocks_iron_glass_detail.png"}, + tiles = {"moreblocks_iron_glass.png"}, paramtype = "light", sunlight_propagates = true, groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3}, @@ -146,7 +147,8 @@ local nodes = { ["coal_glass"] = { description = S("Coal Glass"), drawtype = "glasslike_framed_optional", - tiles = {"moreblocks_coal_glass.png", "moreblocks_coal_glass_detail.png"}, + --tiles = {"moreblocks_coal_glass.png", "moreblocks_coal_glass_detail.png"}, + tiles = {"moreblocks_coal_glass.png"}, paramtype = "light", sunlight_propagates = true, groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3}, @@ -155,7 +157,8 @@ local nodes = { ["clean_glass"] = { description = S("Clean Glass"), drawtype = "glasslike_framed_optional", - tiles = {"moreblocks_clean_glass.png", "moreblocks_clean_glass_detail.png"}, + --tiles = {"moreblocks_clean_glass.png", "moreblocks_clean_glass_detail.png"}, + tiles = {"moreblocks_clean_glass.png"}, paramtype = "light", sunlight_propagates = true, groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3}, @@ -227,7 +230,8 @@ local nodes = { ["trap_glass"] = { description = S("Trap Glass"), drawtype = "glasslike_framed_optional", - tiles = {"moreblocks_trap_glass.png", "default_glass_detail.png"}, + --tiles = {"moreblocks_trap_glass.png", "default_glass_detail.png"}, + tiles = {"moreblocks_trap_glass.png"}, paramtype = "light", sunlight_propagates = true, walkable = false, @@ -267,7 +271,8 @@ local nodes = { ["glow_glass"] = { description = S("Glow Glass"), drawtype = "glasslike_framed_optional", - tiles = {"moreblocks_glow_glass.png", "moreblocks_glow_glass_detail.png"}, + --tiles = {"moreblocks_glow_glass.png", "moreblocks_glow_glass_detail.png"}, + tiles = {"moreblocks_glow_glass.png"}, paramtype = "light", sunlight_propagates = true, light_source = 11, @@ -277,7 +282,8 @@ local nodes = { ["trap_glow_glass"] = { description = S("Trap Glow Glass"), drawtype = "glasslike_framed_optional", - tiles = {"moreblocks_trap_glass.png", "moreblocks_glow_glass_detail.png"}, + --tiles = {"moreblocks_trap_glass.png", "moreblocks_glow_glass_detail.png"}, + tiles = {"moreblocks_trap_glass.png"}, paramtype = "light", sunlight_propagates = true, light_source = 11, @@ -289,7 +295,8 @@ local nodes = { ["super_glow_glass"] = { description = S("Super Glow Glass"), drawtype = "glasslike_framed_optional", - tiles = {"moreblocks_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"}, + --tiles = {"moreblocks_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"}, + tiles = {"moreblocks_super_glow_glass.png"}, paramtype = "light", sunlight_propagates = true, light_source = 15, @@ -299,7 +306,8 @@ local nodes = { ["trap_super_glow_glass"] = { description = S("Trap Super Glow Glass"), drawtype = "glasslike_framed_optional", - tiles = {"moreblocks_trap_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"}, + --tiles = {"moreblocks_trap_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"}, + tiles = {"moreblocks_trap_super_glow_glass.png"}, paramtype = "light", sunlight_propagates = true, light_source = 15, diff --git a/mods/moreblocks/redefinitions.lua b/mods/moreblocks/redefinitions.lua index 6987f1b4..ec60ab6e 100755 --- a/mods/moreblocks/redefinitions.lua +++ b/mods/moreblocks/redefinitions.lua @@ -33,7 +33,7 @@ minetest.register_craft({ }) minetest.register_craft({ - output = "default:rail 16", + output = "default:rail 16", -- /MFF (Mg|06/10/15) recipe = { {"default:steel_ingot", "", "default:steel_ingot"}, {"default:steel_ingot", "default:stick", "default:steel_ingot"}, diff --git a/mods/moreblocks/textures/moreblocks_empty_bookshelf.png b/mods/moreblocks/textures/moreblocks_empty_bookshelf.png old mode 100755 new mode 100644 index b49fd2e4eb111d6658173c07f12824b4db9f272f..af874d74981ac7cb927f6968801beff4af72db2e GIT binary patch delta 203 zcmX@fa+`62L_G^L0|Ud`yN`l^lvaRGh^xGul(mskkiBwol!<|+OuUCigtJOVrgd(J zer=*zUWj%{gl&Y{6LgV7%a&pcrIKaT>!^5q>Bge+f z(afw-6zCZc;3>1>*wMfXM*}+&54k!DOi1GJWo`~>b9wu8>Dgn)j>U2m^Bvg2?jUi; zfq5=V>=YK;#Ah9bIR!yMydgooDH~pJ^78h+*ucWj9V3yPwf6mWpv4THu6{1-oD!M< Dan?lF delta 572 zcmV-C0>k~=0m%fA7=H)`0000V^Z#K000Iz6L_t(I%cYV{ZWBQigum|TpRwKJ#EuaT z3ak>52%#WFtXOaemN@{|V8IbM21^dXo&&JpM}P>n=f|GunQ^liF^LseQJdH5_o~!g zuf*$@7ePryQ)c8_MI#Lm*c2!nP!{I~D1U8HZg0Zd_maF6&;k+o zy2R)iNxTOUWW|bIY=MHyXDyNS>8sR^Y3qP>F>PBBNkcLjlI1zRuE_HRwQn%Sg1DA3 z-##FZA0APyTL7wcN&c$2_{2SLfkTSW4b7Qh%fgQ%3pHb*XMHDEq41a6lTQbx69JyJ1>CD*5Ow`+zSjQ4-n6fpYNQUoFeN6jIez~Z^9+rbA71rbr+s|l~VZ?jRYXyGlrm^37#_rUUvMy+A>@eI8mxk<()k?BDI0000< KMNUMnLSTabiw*Sv