diff options
author | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-05-11 10:22:53 -0400 |
---|---|---|
committer | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-05-11 10:22:53 -0400 |
commit | 249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3 (patch) | |
tree | 915217a9657158d2a02eb8d93507944f618d5142 | |
parent | af2fedcf9998bb4a854c2cfd63e4cdad91a6dd5d (diff) | |
download | dreambuilder_modpack-249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3.tar dreambuilder_modpack-249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3.tar.gz dreambuilder_modpack-249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3.tar.bz2 dreambuilder_modpack-249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3.tar.xz dreambuilder_modpack-249daeb0e6a7d9b637eeb4e5cfda4710a68d59d3.zip |
Add readme.md mostly taken from the forum thread (and markdown-ified)
Updated several mods: castles, homedecor, digilines, farming redo,
jumping, maptools, mesecons, moreblocks, moretrees, pipeworks,
signs_lib, technic, unified_dyes
Deleted the peaceful_npc mod, as it is broken and unmaintained.
237 files changed, 3273 insertions, 3270 deletions
diff --git a/anvil/init.lua b/anvil/init.lua index 4fd9830..e4bc8bd 100644 --- a/anvil/init.lua +++ b/anvil/init.lua @@ -368,6 +368,6 @@ minetest.register_craft({ recipe = { {"default:steel_ingot","default:steel_ingot","default:steel_ingot"}, {"default:steel_ingot","default:steel_ingot","default:steel_ingot"}, - {'', "group:stick", '' } } + {"group:stick", '', ''} }, }) diff --git a/building_blocks/node_stairs.lua b/building_blocks/node_stairs.lua index 2436e22..9781293 100644 --- a/building_blocks/node_stairs.lua +++ b/building_blocks/node_stairs.lua @@ -1,21 +1,18 @@ local S = homedecor_i18n.gettext +local stairs_groups_names = {"cracky","choppy","flammable","crumbly","snappy"} + local function building_blocks_stairs(nodename, def) - minetest.register_node(nodename, def) + minetest.register_node(nodename, def) if minetest.get_modpath("moreblocks") or minetest.get_modpath("stairs") then local mod, name = nodename:match("(.*):(.*)") minetest.register_alias(mod .. ":slab_" .. name, "stairs:slab_" .. name) minetest.register_alias(mod .. ":stair_" .. name, "stairs:stair_" .. name) - for groupname,value in pairs(def.groups) do - if groupname ~= "cracky" and - groupname ~= "choppy" and - groupname ~="flammable" and - groupname ~="crumbly" and - groupname ~="snappy" - then - def.groups.groupname = nil - end + local stairs_groups = {} + for _, groupname in ipairs(stairs_groups_names) do + stairs_groups[groupname] = def.groups[groupname] end + if minetest.get_modpath("moreblocks") then stairsplus:register_all( mod, @@ -24,13 +21,13 @@ local function building_blocks_stairs(nodename, def) { description = def.description, tiles = def.tiles, - groups = def.groups, + groups = stairs_groups, sounds = def.sounds, } ) else stairs.register_stair_and_slab(name,nodename, - def.groups, + stairs_groups, def.tiles, ("%s Stair"):format(def.description), ("%s Slab"):format(def.description), diff --git a/castle_gates/gate_functions.lua b/castle_gates/gate_functions.lua index 92150d3..5d1e6b7 100644 --- a/castle_gates/gate_functions.lua +++ b/castle_gates/gate_functions.lua @@ -252,15 +252,10 @@ local get_door_layout = function(pos, facedir, player) local swing_corner = {} -- the corner of the square "arc" that a Minetest gate swings through local scan_dir - minetest.debug(axis) - minetest.debug(backfront) - minetest.debug(leftright) swing_corner[axis] = door_node.pos[axis] swing_corner[backfront] = newpos[backfront] swing_corner[leftright] = door_node.pos[leftright] if not (vector.equals(newpos, swing_corner) or vector.equals(door_node.pos, swing_corner)) then -- we're right next to the hinge, no need for further testing - minetest.debug(dump(newpos)) - minetest.debug(dump(swing_corner)) scan_dir = vector.direction(newpos, swing_corner) -- get the direction from the new door position toward the swing corner repeat newpos = vector.add(newpos, scan_dir) -- we start with newpos on the destination node, which has already been tested. diff --git a/computer/locale/es.txt b/computer/locale/es.txt deleted file mode 100644 index db6fdcb..0000000 --- a/computer/locale/es.txt +++ /dev/null @@ -1,6 +0,0 @@ - -# Language: Español -# Author: Diego Martínez <lkaezadl3@gmail.com> - -Plastic sheet = Placa de Plastico -Unprocessed Plastic base = Base de Plastico No Procesada diff --git a/computer/locale/ru.txt b/computer/locale/ru.txt deleted file mode 100644 index 36ce653..0000000 --- a/computer/locale/ru.txt +++ /dev/null @@ -1,6 +0,0 @@ - -# Language: Russian -# Author: inpos <inpos@yandex.ru> - -Plastic sheet = Лист пластика -Unprocessed Plastic base = Необработанная пластиковая основа diff --git a/digilines/inventory.lua b/digilines/inventory.lua index 70cb133..693f882 100644 --- a/digilines/inventory.lua +++ b/digilines/inventory.lua @@ -1,3 +1,5 @@ +local pipeworks_enabled = minetest.get_modpath("pipeworks") ~= nil + local function sendMessage(pos, msg, channel) if channel == nil then channel = minetest.get_meta(pos):get_string("channel") @@ -23,8 +25,8 @@ local function can_insert(pos, stack) return can end -local tubeconn = minetest.get_modpath("pipeworks") and "^pipeworks_tube_connection_wooden.png" or "" -local tubescan = minetest.get_modpath("pipeworks") and function(pos) pipeworks.scan_for_tube_objects(pos) end or nil +local tubeconn = pipeworks_enabled and "^pipeworks_tube_connection_wooden.png" or "" +local tubescan = pipeworks_enabled and function(pos) pipeworks.scan_for_tube_objects(pos) end or nil minetest.register_alias("digilines_inventory:chest", "digilines:chest") minetest.register_node("digilines:chest", { @@ -52,7 +54,8 @@ minetest.register_node("digilines:chest", { "list[current_name;main;0,1;8,4;]".. "field[2,5.5;5,1;channel;Channel;${channel}]".. ((default and default.get_hotbar_bg) and default.get_hotbar_bg(0,6) or "").. - "list[current_player;main;0,6;8,4;]") + "list[current_player;main;0,6;8,4;]".. + "listring[]") local inv = meta:get_inventory() inv:set_size("main", 8*4) end, diff --git a/farming/README.txt b/farming/README.txt index 591fca0..211367c 100644 --- a/farming/README.txt +++ b/farming/README.txt @@ -13,7 +13,12 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: -1.31 - Added Pineapple which can be found growing in savannah areas (place pineapple in crafting to obtain 5x rings to eat and a top for re-planting), also Salt which is made from cooking a bucket of water +1.36 - Added Beetroot, Beetroot Soup (6x beetroot, 1x bowl) +1.35 - Deprecated bronze/mese/diamond hoe's, added hoe bomb and deprecated hoe's as lucky block prizes +1.34 - Added scarecrow Base (5x sticks in a cross shape) +1.33 - Added cooking utensils (wooden bowl, saucepan, cooking pot, baking tray, skillet, cutting board, mortar & pestle, juicer, glass mixing bowl) for easier food crafts. +1.32 - Added Pea plant (textures by Andrey01) - also added Wooden Bowl and Pea Soup crafts +1.31 - Added Pineapple which can be found growing in savannah areas (place pineapple in crafting to obtain 5x rings to eat and a top for re-planting), also Salt which is made from cooking a bucket of water, added food groups so it's more compatible with Ruben's food mods. 1.30 - Added Garlic, Pepper and Onions thanks to Grizzly Adam for sharing textures 1.29 - Updating functions so requires Minetest 0.4.16 and above to run 1.28 - Added chili peppers and bowl of chili, optimized code and fixed a few bugs, added porridge @@ -53,7 +58,7 @@ Changelog: 0.1 - Fixed growing bug 0.0 - Initial release -Lucky Blocks: 16 +Lucky Blocks: 28 License of media (textures): diff --git a/farming/barley.lua b/farming/barley.lua index 8611ee5..4005d2c 100644 --- a/farming/barley.lua +++ b/farming/barley.lua @@ -23,13 +23,18 @@ minetest.register_node("farming:seed_barley", { minetest.register_craftitem("farming:barley", { description = S("Barley"), inventory_image = "farming_barley.png", + groups = {food_barley = 1, flammable = 2}, }) -- flour minetest.register_craft({ type = "shapeless", output = "farming:flour", - recipe = {"farming:barley", "farming:barley", "farming:barley", "farming:barley"} + recipe = { + "farming:barley", "farming:barley", "farming:barley", + "farming:barley", "farming:mortar_pestle" + }, + replacements = {{"farming:mortar_pestle", "farming:mortar_pestle"}}, }) -- barley definition diff --git a/farming/beanpole.lua b/farming/beanpole.lua index 5bd0448..1e81dac 100644 --- a/farming/beanpole.lua +++ b/farming/beanpole.lua @@ -64,6 +64,7 @@ end minetest.register_craftitem("farming:beans", { description = S("Green Beans"), inventory_image = "farming_beans.png", + groups = {food_beans = 1, flammable = 2}, on_use = minetest.item_eat(1), on_place = function(itemstack, placer, pointed_thing) @@ -97,11 +98,32 @@ minetest.register_node("farming:beanpole", { on_place = function(itemstack, placer, pointed_thing) - if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then + local pt = pointed_thing + + -- check if pointing at a node + if not pt or pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + + -- return if any of the nodes are not registered + if not minetest.registered_nodes[under.name] then + return + end + + -- am I right-clicking on something that has a custom on_place set? + -- thanks to Krock for helping with this issue :) + local def = minetest.registered_nodes[under.name] + if def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack) + end + + if minetest.is_protected(pt.under, placer:get_player_name()) then return end - local nodename = minetest.get_node(pointed_thing.under).name + local nodename = under.name if minetest.get_item_group(nodename, "soil") < 2 then return diff --git a/farming/beetroot.lua b/farming/beetroot.lua new file mode 100644 index 0000000..1510a76 --- /dev/null +++ b/farming/beetroot.lua @@ -0,0 +1,85 @@ + +local S = farming.intllib + +-- beetroot +minetest.register_craftitem("farming:beetroot", { + description = S("Beetroot"), + inventory_image = "farming_beetroot.png", + groups = {food_beetroot = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:beetroot_1") + end, + on_use = minetest.item_eat(1), +}) + +-- beetroot soup +minetest.register_craftitem("farming:beetroot_soup", { + description = S("Beetroot Soup"), + inventory_image = "farming_beetroot_soup.png", + groups = {flammable = 2}, + on_use = minetest.item_eat(6, "farming:bowl"), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:beetroot_soup", + recipe = { + "group:food_beetroot", "group:food_beetroot", + "group:food_beetroot", "group:food_beetroot", + "group:food_beetroot", "group:food_beetroot","group:food_bowl" + } +}) + +-- red dye +minetest.register_craft({ + type = "shapeless", + output = "dye:red", + recipe = {"group:food_beetroot"}, +}) + +local crop_def = { + drawtype = "plantlike", + tiles = {"farming_beetroot_1.png"}, + paramtype = "light", +-- paramtype2 = "meshoptions", +-- place_param2 = 3, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, flora = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:beetroot_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_beetroot_2.png"} +minetest.register_node("farming:beetroot_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_beetroot_3.png"} +minetest.register_node("farming:beetroot_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_beetroot_4.png"} +minetest.register_node("farming:beetroot_4", table.copy(crop_def)) + +-- stage 5 +crop_def.tiles = {"farming_beetroot_5.png"} +crop_def.groups.growing = 0 +crop_def.drop = { + max_items = 4, items = { + {items = {'farming:beetroot'}, rarity = 1}, + {items = {'farming:beetroot'}, rarity = 2}, + {items = {'farming:beetroot'}, rarity = 3}, + {items = {'farming:beetroot'}, rarity = 4}, + } +} +minetest.register_node("farming:beetroot_5", table.copy(crop_def)) diff --git a/farming/blueberry.lua b/farming/blueberry.lua index 82ce7ff..f2f0147 100644 --- a/farming/blueberry.lua +++ b/farming/blueberry.lua @@ -5,6 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:blueberries", { description = S("Blueberries"), inventory_image = "farming_blueberries.png", + groups = {food_blueberries = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1") end, @@ -22,7 +23,7 @@ minetest.register_craftitem("farming:muffin_blueberry", { minetest.register_craft({ output = "farming:muffin_blueberry 2", recipe = { - {"farming:blueberries", "farming:bread", "farming:blueberries"}, + {"group:food_blueberries", "group:food_bread", "group:food_blueberries"}, } }) diff --git a/farming/carrot.lua b/farming/carrot.lua index 9cfcee0..0aefcfd 100644 --- a/farming/carrot.lua +++ b/farming/carrot.lua @@ -10,6 +10,7 @@ local S = farming.intllib minetest.register_craftitem("farming:carrot", { description = S("Carrot"), inventory_image = "farming_carrot.png", + groups = {food_carrot = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1") end, @@ -27,7 +28,7 @@ minetest.register_craft({ output = "farming:carrot_gold", recipe = { {"", "default:gold_lump", ""}, - {"default:gold_lump", "farming:carrot", "default:gold_lump"}, + {"default:gold_lump", "group:food_carrot", "default:gold_lump"}, {"", "default:gold_lump", ""}, } }) diff --git a/farming/chili.lua b/farming/chili.lua index ec2a1a9..9889162 100644 --- a/farming/chili.lua +++ b/farming/chili.lua @@ -5,6 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:chili_pepper", { description = S("Chili Pepper"), inventory_image = "farming_chili_pepper.png", + groups = {food_chili_pepper = 1, flammable = 4}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1") end, @@ -15,13 +16,16 @@ minetest.register_craftitem("farming:chili_pepper", { minetest.register_craftitem("farming:chili_bowl", { description = S("Bowl of Chili"), inventory_image = "farming_chili_bowl.png", - on_use = minetest.item_eat(8), + on_use = minetest.item_eat(8, "farming:bowl"), }) minetest.register_craft({ type = "shapeless", output = "farming:chili_bowl", - recipe = {"farming:chili_pepper", "farming:barley", "farming:tomato", "farming:beans"} + recipe = { + "group:food_chili_pepper", "group:food_barley", + "group:food_tomato", "group:food_beans", "group:food_bowl" + }, }) -- chili can be used for red dye diff --git a/farming/cocoa.lua b/farming/cocoa.lua index b394ab2..a8491ac 100644 --- a/farming/cocoa.lua +++ b/farming/cocoa.lua @@ -59,6 +59,7 @@ end minetest.register_craftitem("farming:cocoa_beans", { description = S("Cocoa Beans"), inventory_image = "farming_cocoa_beans.png", + groups = {food_cocoa = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1") end, @@ -81,7 +82,7 @@ minetest.register_craftitem("farming:cookie", { minetest.register_craft( { output = "farming:cookie 8", recipe = { - { "farming:wheat", "farming:cocoa_beans", "farming:wheat" }, + {"group:food_wheat", "group:food_cocoa", "group:food_wheat" }, } }) @@ -95,7 +96,7 @@ minetest.register_craftitem("farming:chocolate_dark", { minetest.register_craft( { output = "farming:chocolate_dark", recipe = { - { "farming:cocoa_beans", "farming:cocoa_beans", "farming:cocoa_beans" }, + {"group:food_cocoa", "group:food_cocoa", "group:food_cocoa"}, } }) @@ -124,25 +125,30 @@ local crop_def = { -- stage 1 minetest.register_node("farming:cocoa_1", table.copy(crop_def)) --- stage2 +-- stage 2 crop_def.tiles = {"farming_cocoa_2.png"} +minetest.register_node("farming:cocoa_2", table.copy(crop_def)) + +-- stage3 +crop_def.tiles = {"farming_cocoa_3.png"} crop_def.drop = { items = { {items = {'farming:cocoa_beans 1'}, rarity = 1}, } } -minetest.register_node("farming:cocoa_2", table.copy(crop_def)) +minetest.register_node("farming:cocoa_3", table.copy(crop_def)) --- stage 3 (final) -crop_def.tiles = {"farming_cocoa_3.png"} +-- stage 4 (final) +crop_def.tiles = {"farming_cocoa_4.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { {items = {'farming:cocoa_beans 2'}, rarity = 1}, {items = {'farming:cocoa_beans 1'}, rarity = 2}, + {items = {'farming:cocoa_beans 1'}, rarity = 4}, } } -minetest.register_node("farming:cocoa_3", table.copy(crop_def)) +minetest.register_node("farming:cocoa_4", table.copy(crop_def)) -- add random cocoa pods to jungle tree's minetest.register_on_generated(function(minp, maxp) @@ -180,7 +186,7 @@ minetest.register_on_generated(function(minp, maxp) --print ("Cocoa Pod added at " .. minetest.pos_to_string(pos)) minetest.swap_node(pos, { - name = "farming:cocoa_" .. tostring(math.random(1, 3)) + name = "farming:cocoa_" .. tostring(math.random(1, 4)) }) end diff --git a/farming/coffee.lua b/farming/coffee.lua index f9632d2..ab93d06 100644 --- a/farming/coffee.lua +++ b/farming/coffee.lua @@ -5,6 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:coffee_beans", { description = S("Coffee Beans"), inventory_image = "farming_coffee_beans.png", + groups = {food_coffee = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1") end, @@ -57,7 +58,7 @@ minetest.register_node("farming:coffee_cup", { minetest.register_craft( { output = "farming:coffee_cup", recipe = { - {"farming:drinking_cup", "farming:coffee_beans","bucket:bucket_water"}, + {"farming:drinking_cup", "group:food_coffee","bucket:bucket_water"}, }, replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}} }) diff --git a/farming/compatibility.lua b/farming/compatibility.lua index b7c906c..ccc46a5 100644 --- a/farming/compatibility.lua +++ b/farming/compatibility.lua @@ -1,3 +1,16 @@ +-- add food group to default apple and brown mushroom +minetest.override_item("default:apple", { + groups = {food_apple = 1, fleshy = 3, dig_immediate = 3, flammable = 2, + leafdecay = 3, leafdecay_drop = 1}, +}) + +if minetest.registered_nodes["flowers:mushroom_brown"] then +minetest.override_item("flowers:mushroom_brown", { + light_source = 1, + groups = {food_mushroom = 1, snappy = 3, attached_node = 1, flammable = 2}, +}) +end + -- is Ethereal mod installed? local eth = minetest.get_modpath("ethereal") or nil @@ -20,7 +33,7 @@ else type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2} }, - groups = {fleshy = 3, dig_immediate = 3, flammable = 2}, + groups = {food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2}, on_use = minetest.item_eat(2), sounds = default.node_sound_leaves_defaults(), }) @@ -68,7 +81,7 @@ else type = "fixed", fixed = {-0.2, -0.3, -0.2, 0.2, 0.2, 0.2} }, - groups = {fleshy = 3, dig_immediate = 3, flammable = 2}, + groups = {food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2}, on_use = minetest.item_eat(4), sounds = default.node_sound_leaves_defaults(), }) @@ -94,7 +107,6 @@ minetest.register_alias("farming:big_pumpkin_side", "air") minetest.register_alias("farming:big_pumpkin_corner", "air") minetest.register_alias("farming:big_pumpkin_top", "air") minetest.register_alias("farming:scarecrow", "farming:jackolantern") -minetest.register_alias("farming:scarecrow_bottom", "default:fence_wood") minetest.register_alias("farming:scarecrow_light", "farming:jackolantern_on") minetest.register_alias("farming:pumpkin_flour", "farming:pumpkin_dough") @@ -118,6 +130,7 @@ else description = "Strawberry", inventory_image = "strawberry.png", wield_image = "strawberry.png", + groups = {food_strawberry = 1, flammable = 2}, on_use = minetest.item_eat(1), }) diff --git a/farming/corn.lua b/farming/corn.lua index 1149a00..8afa16a 100644 --- a/farming/corn.lua +++ b/farming/corn.lua @@ -10,6 +10,7 @@ local S = farming.intllib minetest.register_craftitem("farming:corn", { description = S("Corn"), inventory_image = "farming_corn.png", + groups = {food_corn = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1") end, @@ -27,7 +28,7 @@ minetest.register_craft({ type = "cooking", cooktime = 10, output = "farming:corn_cob", - recipe = "farming:corn" + recipe = "group:food_corn" }) -- ethanol (thanks to JKMurray for this idea) @@ -51,8 +52,8 @@ minetest.register_node("farming:bottle_ethanol", { minetest.register_craft( { output = "farming:bottle_ethanol", recipe = { - { "vessels:glass_bottle", "farming:corn", "farming:corn"}, - { "farming:corn", "farming:corn", "farming:corn"}, + { "vessels:glass_bottle", "group:food_corn", "group:food_corn"}, + { "group:food_corn", "group:food_corn", "group:food_corn"}, } }) diff --git a/farming/cotton.lua b/farming/cotton.lua index bf0412e..7f893ec 100644 --- a/farming/cotton.lua +++ b/farming/cotton.lua @@ -146,5 +146,6 @@ minetest.register_node("farming:cotton_8", table.copy(crop_def)) farming.register_plant("farming:cotton", { description = "Cotton seed", inventory_image = "farming_cotton_seed.png", + groups = {flammable = 2}, steps = 8, })]] diff --git a/farming/cucumber.lua b/farming/cucumber.lua index eb29347..4e6981c 100644 --- a/farming/cucumber.lua +++ b/farming/cucumber.lua @@ -10,6 +10,7 @@ local S = farming.intllib minetest.register_craftitem("farming:cucumber", { description = S("Cucumber"), inventory_image = "farming_cucumber.png", + groups = {food_cucumber = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1") end, diff --git a/farming/donut.lua b/farming/donut.lua index be2e9b8..9b29d27 100644 --- a/farming/donut.lua +++ b/farming/donut.lua @@ -11,9 +11,9 @@ minetest.register_craftitem("farming:donut", { minetest.register_craft({ output = "farming:donut 3", recipe = { - {'', 'farming:wheat', ''}, - {'farming:wheat', 'farming:sugar', 'farming:wheat'}, - {'', 'farming:wheat', ''}, + {"", "group:food_wheat", ""}, + {"group:food_wheat", "group:food_sugar", "group:food_wheat"}, + {"", "group:food_wheat", ""}, } }) @@ -27,7 +27,7 @@ minetest.register_craftitem("farming:donut_chocolate", { minetest.register_craft({ output = "farming:donut_chocolate", recipe = { - {'farming:cocoa_beans'}, + {'group:food_cocoa'}, {'farming:donut'}, } }) @@ -51,31 +51,26 @@ minetest.register_craft({ minetest.register_craftitem("farming:porridge", { description = S("Porridge"), inventory_image = "farming_porridge.png", - on_use = minetest.item_eat(6), + on_use = minetest.item_eat(6, "farming:bowl"), }) minetest.after(0, function() + local fluid = "bucket:bucket_water" + local fluid_return = "bucket:bucket_water" + if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then + fluid = "group:food_milk" + fluid_return = "mobs:bucket_milk" + end minetest.register_craft({ - output = "farming:porridge", type = "shapeless", - recipe = { - "farming:barley", "farming:barley", "farming:wheat", - "farming:wheat", "mobs:bucket_milk" - }, - replacements = {{"mobs:bucket_milk", "bucket:bucket_empty"}} - }) -else - minetest.register_craft({ output = "farming:porridge", - type = "shapeless", recipe = { - "farming:barley", "farming:barley", "farming:wheat", - "farming:wheat", "bucket:bucket_water" + "group:food_barley", "group:food_barley", "group:food_wheat", + "group:food_wheat", "group:food_bowl", fluid }, - replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}} + replacements = {{fluid_return, "bucket:bucket_empty"}} }) - end end) diff --git a/farming/farming.conf_example b/farming/farming.conf_example index 7a08b24..2505054 100644 --- a/farming/farming.conf_example +++ b/farming/farming.conf_example @@ -12,7 +12,6 @@ farming.tomato = true farming.cucumber = true farming.corn = true farming.coffee = true -farming.coffee = true farming.melon = true farming.sugar = true farming.pumpkin = true @@ -29,7 +28,9 @@ farming.onion = true farming.garlic = true farming.pepper = true farming.pineapple = true +farming.peas = true +farming.beetroot = true farming.donuts = true --- rarety of crops on map, default is 0.006 (higher number = more crops) -farming.rarety = 0.006 +-- rarety of crops on map, default is 0.001 (higher number = more crops) +farming.rarety = 0.002 diff --git a/farming/garlic.lua b/farming/garlic.lua index ffbf3ec..52ae25f 100644 --- a/farming/garlic.lua +++ b/farming/garlic.lua @@ -11,6 +11,7 @@ local S = farming.intllib minetest.register_craftitem("farming:garlic_clove", { description = S("Garlic clove"), inventory_image = "crops_garlic_clove.png", + groups = {food_garlic_clove = 1, flammable = 3}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:garlic_1") end, @@ -21,7 +22,7 @@ minetest.register_craftitem("farming:garlic", { description = S("Garlic"), inventory_image = "crops_garlic.png", on_use = minetest.item_eat(1), - groups = {garlic = 1}, + groups = {food_garlic = 1, flammable = 3}, }) minetest.register_craft({ @@ -52,7 +53,7 @@ minetest.register_node("farming:garlic_braid", { "crops_garlic_braid_side.png^[transformFx","crops_garlic_braid_side.png", "crops_garlic_braid.png","crops_garlic_braid.png" }, - groups = {vessel = 1, dig_immediate = 3}, + groups = {vessel = 1, dig_immediate = 3, flammable = 3}, sounds = default.node_sound_leaves_defaults(), node_box = { type = "fixed", diff --git a/farming/grapes.lua b/farming/grapes.lua index baedb4e..9a6ab9e 100644 --- a/farming/grapes.lua +++ b/farming/grapes.lua @@ -60,6 +60,7 @@ minetest.register_craftitem("farming:grapes", { description = S("Grapes"), inventory_image = "farming_grapes.png", on_use = minetest.item_eat(2), + groups = {food_grapes = 1, flammable = 3}, on_place = function(itemstack, placer, pointed_thing) return place_grapes(itemstack, placer, pointed_thing, "farming:grapes_1") @@ -92,11 +93,32 @@ minetest.register_node("farming:trellis", { on_place = function(itemstack, placer, pointed_thing) - if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then + local pt = pointed_thing + + -- check if pointing at a node + if not pt or pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + + -- return if any of the nodes are not registered + if not minetest.registered_nodes[under.name] then + return + end + + -- am I right-clicking on something that has a custom on_place set? + -- thanks to Krock for helping with this issue :) + local def = minetest.registered_nodes[under.name] + if def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack) + end + + if minetest.is_protected(pt.under, placer:get_player_name()) then return end - local nodename = minetest.get_node(pointed_thing.under).name + local nodename = under.name if minetest.get_item_group(nodename, "soil") < 2 then return diff --git a/farming/grass.lua b/farming/grass.lua index f6f777b..9644254 100644 --- a/farming/grass.lua +++ b/farming/grass.lua @@ -1,5 +1,5 @@ -for i = 3, 5 do +for i = 4, 5 do -- Override default grass and have it drop Wheat Seeds diff --git a/farming/hemp.lua b/farming/hemp.lua index 29b6a42..34dd56d 100644 --- a/farming/hemp.lua +++ b/farming/hemp.lua @@ -39,7 +39,7 @@ minetest.register_node("farming:hemp_oil", { type = "fixed", fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} }, - groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, + groups = {food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1}, sounds = default.node_sound_glass_defaults(), }) @@ -94,6 +94,23 @@ minetest.register_craft( { replacements = {{ "bucket:bucket_river_water", "bucket:bucket_empty"}} }) +-- hemp block +minetest.register_node("farming:hemp_block", { + description = S("Hemp Block"), + tiles = {"farming_hemp_block.png"}, + paramtype = "light", + groups = {snappy = 1, oddly_breakable_by_hand = 1, flammable = 2} +}) + +minetest.register_craft( { + output = "farming:hemp_block", + recipe = { + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}, + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}, + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"} + }, +}) + -- paper minetest.register_craft( { output = "default:paper", diff --git a/farming/hoebomb.lua b/farming/hoebomb.lua new file mode 100644 index 0000000..05e939b --- /dev/null +++ b/farming/hoebomb.lua @@ -0,0 +1,149 @@ + +-- load support for intllib. +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + + +-- creative check +local creative_mode_cache = minetest.settings:get_bool("creative_mode") +function is_creative(name) + return creative_mode_cache or minetest.check_player_privs(name, {creative = true}) +end + + +-- hoe bomb function +local function hoe_area(pos, player) + + -- check for protection + if minetest.is_protected(pos, player:get_player_name()) then + minetest.record_protection_violation(pos, player:get_player_name()) + return + end + + local r = 5 -- radius + + -- remove flora (grass, flowers etc.) + local res = minetest.find_nodes_in_area( + {x = pos.x - r, y = pos.y - 1, z = pos.z - r}, + {x = pos.x + r, y = pos.y + 2, z = pos.z + r}, + {"group:flora"}) + + for n = 1, #res do + minetest.swap_node(res[n], {name = "air"}) + end + + -- replace dirt with tilled soil + res = nil + res = minetest.find_nodes_in_area_under_air( + {x = pos.x - r, y = pos.y - 1, z = pos.z - r}, + {x = pos.x + r, y = pos.y + 2, z = pos.z + r}, + {"group:soil"}) + + for n = 1, #res do + minetest.swap_node(res[n], {name = "farming:soil"}) + end +end + + +-- throwable hoe bomb +minetest.register_entity("farming:hoebomb_entity", { + physical = true, + visual = "sprite", + visual_size = {x = 1.0, y = 1.0}, + textures = {"farming_hoe_bomb.png"}, + collisionbox = {0,0,0,0,0,0}, + lastpos = {}, + player = "", + + on_step = function(self, dtime) + + if not self.player then + + self.object:remove() + + return + end + + local pos = self.object:get_pos() + + if self.lastpos.x ~= nil then + + local vel = self.object:getvelocity() + + -- only when potion hits something physical + if vel.x == 0 + or vel.y == 0 + or vel.z == 0 then + + if self.player ~= "" then + + -- round up coords to fix glitching through doors + self.lastpos = vector.round(self.lastpos) + + hoe_area(self.lastpos, self.player) + end + + self.object:remove() + + return + + end + end + + self.lastpos = pos + end +}) + + +-- actual throwing function +local function throw_potion(itemstack, player) + + local playerpos = player:get_pos() + + local obj = minetest.add_entity({ + x = playerpos.x, + y = playerpos.y + 1.5, + z = playerpos.z + }, "farming:hoebomb_entity") + + local dir = player:get_look_dir() + local velocity = 20 + + obj:setvelocity({ + x = dir.x * velocity, + y = dir.y * velocity, + z = dir.z * velocity + }) + + obj:setacceleration({ + x = dir.x * -3, + y = -9.5, + z = dir.z * -3 + }) + + obj:setyaw(player:get_look_yaw() + math.pi) + obj:get_luaentity().player = player +end + + +-- hoe bomb item +minetest.register_craftitem("farming:hoe_bomb", { + description = S("Hoe Bomb (use or throw on grassy areas to hoe land"), + inventory_image = "farming_hoe_bomb.png", + groups = {flammable = 2, not_in_creative_inventory = 1}, + on_use = function(itemstack, user, pointed_thing) + + if pointed_thing.type == "node" then + hoe_area(pointed_thing.above, user) + else + throw_potion(itemstack, user) + + if not is_creative(user:get_player_name()) then + + itemstack:take_item() + + return itemstack + end + end + end, +}) diff --git a/farming/hoes.lua b/farming/hoes.lua index 3dd14f1..eaacb29 100644 --- a/farming/hoes.lua +++ b/farming/hoes.lua @@ -20,14 +20,6 @@ farming.register_hoe = function(name, def) def.inventory_image = "unknown_item.png" end - if def.recipe == nil then - def.recipe = { - {"air","air",""}, - {"","group:stick",""}, - {"","group:stick",""} - } - end - if def.max_uses == nil then def.max_uses = 30 end @@ -38,16 +30,18 @@ farming.register_hoe = function(name, def) inventory_image = def.inventory_image, on_use = function(itemstack, user, pointed_thing) return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses) - end + end, + groups = def.groups, + sound = {breaks = "default_tool_breaks"}, }) -- Register its recipe - if def.material == nil then + if def.recipe then minetest.register_craft({ output = name:sub(2), recipe = def.recipe }) - else + elseif def.material then minetest.register_craft({ output = name:sub(2), recipe = { @@ -153,22 +147,22 @@ farming.register_hoe(":farming:hoe_steel", { farming.register_hoe(":farming:hoe_bronze", { description = S("Bronze Hoe"), inventory_image = "farming_tool_bronzehoe.png", - max_uses = 220, - material = "default:bronze_ingot" + max_uses = 500, + groups = {not_in_creative_inventory = 1}, }) farming.register_hoe(":farming:hoe_mese", { description = S("Mese Hoe"), inventory_image = "farming_tool_mesehoe.png", max_uses = 350, - material = "default:mese_crystal" + groups = {not_in_creative_inventory = 1}, }) farming.register_hoe(":farming:hoe_diamond", { description = S("Diamond Hoe"), inventory_image = "farming_tool_diamondhoe.png", max_uses = 500, - material = "default:diamond" + groups = {not_in_creative_inventory = 1}, }) -- Toolranks support diff --git a/farming/init.lua b/farming/init.lua index 407537d..33a9ca7 100644 --- a/farming/init.lua +++ b/farming/init.lua @@ -7,7 +7,7 @@ farming = {} farming.mod = "redo" -farming.version = "1.31" +farming.version = "1.33" farming.path = minetest.get_modpath("farming") farming.select = { type = "fixed", @@ -211,7 +211,7 @@ local function reg_plant_stages(plant_name, stage, force_last) end -register_plant_node = function(node) +local register_plant_node = function(node) local plant_name, stage = plant_name_stage(node) @@ -513,6 +513,7 @@ farming.register_plant = function(name, def) minetest.register_craftitem(":" .. mname .. ":" .. pname, { description = pname:gsub("^%l", string.upper), inventory_image = mname .. "_" .. pname .. ".png", + groups = def.groups or {flammable = 2}, }) -- Register growing steps @@ -554,8 +555,8 @@ farming.register_plant = function(name, def) waving = 1, tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"}, paramtype = "light", - paramtype2 = def.paramtype2 or nil, - place_param2 = def.place_param2 or nil, + paramtype2 = def.paramtype2, + place_param2 = def.place_param2, walkable = false, buildable_to = true, drop = drop, @@ -582,7 +583,6 @@ farming.tomato = true farming.cucumber = true farming.corn = true farming.coffee = true -farming.coffee = true farming.melon = true farming.sugar = true farming.pumpkin = true @@ -599,8 +599,10 @@ farming.garlic = true farming.onion = true farming.pepper = true farming.pineapple = true +farming.peas = true +farming.beetroot = true farming.donuts = true -farming.rarety = 0.006 +farming.rarety = 0.002 -- 0.006 -- Load new global settings if found inside mod folder @@ -625,6 +627,7 @@ end dofile(farming.path.."/soil.lua") dofile(farming.path.."/hoes.lua") dofile(farming.path.."/grass.lua") +dofile(farming.path.."/utensils.lua") -- default crops dofile(farming.path.."/wheat.lua") @@ -647,14 +650,17 @@ if farming.rhubarb then dofile(farming.path.."/rhubarb.lua") end if farming.beans then dofile(farming.path.."/beanpole.lua") end if farming.grapes then dofile(farming.path.."/grapes.lua") end if farming.barley then dofile(farming.path.."/barley.lua") end -if farming.chili then dofile(farming.path.."/chili.lua") end if farming.hemp then dofile(farming.path.."/hemp.lua") end -if farming.donuts then dofile(farming.path.."/donut.lua") end if farming.garlic then dofile(farming.path.."/garlic.lua") end if farming.onion then dofile(farming.path.."/onion.lua") end if farming.pepper then dofile(farming.path.."/pepper.lua") end if farming.pineapple then dofile(farming.path.."/pineapple.lua") end +if farming.peas then dofile(farming.path.."/pea.lua") end +if farming.beetroot then dofile(farming.path.."/beetroot.lua") end +if farming.chili then dofile(farming.path.."/chili.lua") end +if farming.donuts then dofile(farming.path.."/donut.lua") end dofile(farming.path.."/mapgen.lua") dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility +dofile(farming.path.."/hoebomb.lua") dofile(farming.path.."/lucky_block.lua") diff --git a/farming/locale/fr.po b/farming/locale/fr.po new file mode 100644 index 0000000..7b50640 --- /dev/null +++ b/farming/locale/fr.po @@ -0,0 +1,259 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-27 20:21+0200\n" +"PO-Revision-Date: 2018-03-27 22:16+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.7.1\n" +"Last-Translator: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: fr\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "Graine d'orge" + +#: barley.lua +msgid "Barley" +msgstr "Orge" + +#: beanpole.lua +msgid "Green Beans" +msgstr "Haricots verts" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "Tuteur pour haricots (placer sur le sol avant de planter des haricots)" + +#: blueberry.lua +msgid "Blueberries" +msgstr "Myrtilles" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "Gâteau aux myrtilles" + +#: carrot.lua +msgid "Carrot" +msgstr "Carotte" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "Carotte dorée" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "Fèves de chocolat" + +#: cocoa.lua +msgid "Cookie" +msgstr "Biscuit" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "Barre de chocolat noir" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "Grains de café" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "Tasse (vide)" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "Tasse de café froid" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "Tasse de café chaud" + +#: corn.lua +msgid "Corn" +msgstr "Maïs" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Épi de maïs" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "Bouteille de'éthanol" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "Graines de coton" + +#: cotton.lua +msgid "Cotton" +msgstr "Coton" + +#: cucumber.lua +msgid "Cucumber" +msgstr "Concombre" + +#: donut.lua +msgid "Donut" +msgstr "Beignet" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "Beignet au chocolat" + +#: donut.lua +msgid "Apple Donut" +msgstr "Beignet aux pommes" + +#: grapes.lua +msgid "Grapes" +msgstr "Raisins" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "Treillis (placer sur le sol avant de planter les raisins)" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "Graines de chanvre" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "Feuille de chanvre" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "Bouteille d'huile de chanvre" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "Fibre de chanvre" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "Corde de chanvre" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "Houe en bois" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "Houe en pierre" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "Houe en acier" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "Houe en bronze" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "Houe en mese" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "Houe en diamant" + +#: init.lua +msgid "Seed" +msgstr "Graine" + +#: melon.lua +msgid "Melon Slice" +msgstr "Tranche de melon" + +#: melon.lua +msgid "Melon" +msgstr "Melon" + +#: potato.lua +msgid "Potato" +msgstr "Pomme de terre" + +#: potato.lua +msgid "Baked Potato" +msgstr "Pomme de terre cuite" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Citrouille" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "Tranche de citrouille" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "Jack 'O Lantern (tapé pour allumer et éteindre)" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "Pain à la citrouille" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "Pâte à la citrouille" + +#: raspberry.lua +msgid "Raspberries" +msgstr "Framboises" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "Smoothie aux framboises" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "Rhubarbe" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "Tarte à la rhubarbe" + +#: soil.lua +msgid "Soil" +msgstr "Sol" + +#: soil.lua +msgid "Wet Soil" +msgstr "Sol humide" + +#: sugar.lua +msgid "Sugar" +msgstr "Sucre" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "Graine de blé" + +#: wheat.lua +msgid "Wheat" +msgstr "Blé" + +#: wheat.lua +msgid "Straw" +msgstr "Paille" + +#: wheat.lua +msgid "Flour" +msgstr "Farine" + +#: wheat.lua +msgid "Bread" +msgstr "Pain" diff --git a/farming/locale/ru.po b/farming/locale/ru.po new file mode 100644 index 0000000..607c96d --- /dev/null +++ b/farming/locale/ru.po @@ -0,0 +1,262 @@ +# Russian translation for farming mod. +# Copyright (C) 2018 +# This file is distributed under the same license as the farming package. +# codexp <codexp@gmx.net>, 2018. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 1.27\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-22 01:25+0100\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: Russian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "семена ячменя" + +#: barley.lua +msgid "Barley" +msgstr "ячмень" + +#: beanpole.lua +msgid "Green Beans" +msgstr "зеленая фасоль" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "жердь для бобовых (установите на почву перед посадкой бобовых)" + +#: blueberry.lua +msgid "Blueberries" +msgstr "голубика" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "кекс из голубики" + +#: carrot.lua +msgid "Carrot" +msgstr "морковь" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "золотая морковь" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "бобы какао" + +#: cocoa.lua +msgid "Cookie" +msgstr "печенье" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "плитка темного шоколада" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "кофе в зернах" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "чашка (пустая)" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "холодная чашка кофе" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "горячая чашка кофе" + +#: corn.lua +msgid "Corn" +msgstr "кукуруза" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "початок кукурузы" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "бутылка этилового спирта" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "семена хлопка" + +#: cotton.lua +msgid "Cotton" +msgstr "хлопок" + +#: cucumber.lua +msgid "Cucumber" +msgstr "огурец" + +#: donut.lua +msgid "Donut" +msgstr "пончик" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "шоколадный пончик" + +#: donut.lua +msgid "Apple Donut" +msgstr "яблочный пончик" + +#: grapes.lua +msgid "Grapes" +msgstr "виноград" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "решетка (поставьте на почву для посадки винограда)" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "семена конопли" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "листья конопли" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "бутылка конопляного масла" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "Пенька" + +#: hoes.lua +msgid "Hoe" +msgstr "мотыга" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "деревянная мотыга" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "каменная мотыга" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "стальная мотыга" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "бронзовая мотыга" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "магическая мотыга" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "алмазная мотыга" + +#: init.lua +msgid "Seed" +msgstr "семена" + +#: melon.lua +msgid "Melon Slice" +msgstr "ломтик арбуза" + +#: melon.lua +msgid "Melon" +msgstr "арбуз" + +#: potato.lua +msgid "Potato" +msgstr "картофель" + +#: potato.lua +msgid "Baked Potato" +msgstr "запеченный картофель" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "тыква" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "ломтик тыквы" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "светильник джека (удар для включения и отключения)" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "тыквенный хлеб" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "тыквенное тесто" + +#: raspberry.lua +msgid "Raspberries" +msgstr "малина" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "малиновый коктейль" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "ревень" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "пирог из ревеня" + +#: soil.lua +msgid "Soil" +msgstr "земля" + +#: soil.lua +msgid "Wet Soil" +msgstr "мокрая земля" + +#: sugar.lua +msgid "Sugar" +msgstr "сахар" + +#: tomato.lua +msgid "Tomato" +msgstr "помидор" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "" + +#: wheat.lua +msgid "Wheat" +msgstr "семена пшеницы" + +#: wheat.lua +msgid "Straw" +msgstr "солома" + +#: wheat.lua +msgid "Flour" +msgstr "мука" + +#: wheat.lua +msgid "Bread" +msgstr "хлеб" diff --git a/farming/lucky_block.lua b/farming/lucky_block.lua index 01b4c27..087cc2e 100644 --- a/farming/lucky_block.lua +++ b/farming/lucky_block.lua @@ -10,6 +10,7 @@ if minetest.get_modpath("lucky_block") then {"nod", "farming:jackolantern", 0}, {"tro", "farming:jackolantern_on"}, {"nod", "default:river_water_source", 1}, + {"tel"}, {"dro", {"farming:trellis", "farming:grapes"}, 5}, {"dro", {"farming:bottle_ethanol"}, 1}, {"nod", "farming:melon", 0}, @@ -17,5 +18,19 @@ if minetest.get_modpath("lucky_block") then {"dro", {"farming:hemp_leaf", "farming:hemp_fibre", "farming:seed_hemp"}, 5}, {"nod", "fire:permanent_flame", 1}, {"dro", {"farming:chili_pepper", "farming:chili_bowl"}, 5}, + {"dro", {"farming:bowl"}, 3}, + {"dro", {"farming:saucepan"}, 1}, + {"dro", {"farming:pot"}, 1}, + {"dro", {"farming:baking_tray"}, 1}, + {"dro", {"farming:skillet"}, 1}, + {"exp", 4}, + {"dro", {"farming:mortar_pestle"}, 1}, + {"dro", {"farming:cutting_board"}, 1}, + {"dro", {"farming:juicer"}, 1}, + {"dro", {"farming:mixing_bowl"}, 1}, + {"dro", {"farming:hoe_bronze"}, 1}, + {"dro", {"farming:hoe_mese"}, 1}, + {"dro", {"farming:hoe_diamond"}, 1}, + {"dro", {"farming:hoe_bomb"}, 10}, }) end diff --git a/farming/mapgen.lua b/farming/mapgen.lua index ffbfb67..2554a15 100644 --- a/farming/mapgen.lua +++ b/farming/mapgen.lua @@ -1,6 +1,6 @@ -- decoration function -local function register_plant(name, min, max, spawnby, num, enabled) +local function register_plant(name, min, max, spawnon, spawnby, num, enabled) if enabled ~= true then return @@ -8,7 +8,7 @@ local function register_plant(name, min, max, spawnby, num, enabled) minetest.register_decoration({ deco_type = "simple", - place_on = {"default:dirt_with_grass"}, + place_on = spawnon or {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0, @@ -28,31 +28,35 @@ end -- add crops to mapgen -register_plant("potato_3", 15, 40, "", -1, farming.potato) -register_plant("tomato_7", 5, 20, "", -1, farming.tomato) -register_plant("corn_7", 12, 22, "", -1, farming.corn) -register_plant("coffee_5", 20, 45, "", -1, farming.coffee) -register_plant("raspberry_4", 3, 10, "", -1, farming.raspberry) -register_plant("rhubarb_3", 3, 15, "", -1, farming.rhubarb) -register_plant("blueberry_4", 3, 10, "", -1, farming.blueberry) -register_plant("beanbush", 18, 35, "", -1, farming.beans) -register_plant("grapebush", 25, 45, "", -1, farming.grapes) -register_plant("onion_5", 5, 22, "", -1, farming.onion) -register_plant("garlic_5", 3, 30, "group:tree", 1, farming.garlic) +register_plant("potato_3", 15, 40, nil, "", -1, farming.potato) +register_plant("tomato_7", 5, 20, nil, "", -1, farming.tomato) +register_plant("corn_7", 12, 22, nil, "", -1, farming.corn) +register_plant("coffee_5", 20, 45, {"default:dirt_with_dry_grass", + "default:dirt_with_rainforest_litter"}, "", -1, farming.coffee) +register_plant("raspberry_4", 3, 10, nil, "", -1, farming.raspberry) +register_plant("rhubarb_3", 3, 15, nil, "", -1, farming.rhubarb) +register_plant("blueberry_4", 3, 10, nil, "", -1, farming.blueberry) +register_plant("beanbush", 18, 35, nil, "", -1, farming.beans) +register_plant("grapebush", 25, 45, nil, "", -1, farming.grapes) +register_plant("onion_5", 5, 22, nil, "", -1, farming.onion) +register_plant("garlic_5", 3, 30, nil, "group:tree", 1, farming.garlic) +register_plant("pea_5", 25, 50, nil, "", -1, farming.peas) +register_plant("beetroot_5", 1, 15, nil, "", -1, farming.beetroot) if minetest.get_mapgen_setting("mg_name") == "v6" then - register_plant("carrot_8", 1, 30, "group:water", 1, farming.carrot) - register_plant("cucumber_4", 1, 20, "group:water", 1, farming.cucumber) - register_plant("melon_8", 1, 20, "group:water", 1, farming.melon) - register_plant("pumpkin_8", 1, 20, "group:water", 1, farming.pumpkin) + register_plant("carrot_8", 1, 30, nil, "group:water", 1, farming.carrot) + register_plant("cucumber_4", 1, 20, nil, "group:water", 1, farming.cucumber) + register_plant("melon_8", 1, 20, nil, "group:water", 1, farming.melon) + register_plant("pumpkin_8", 1, 20, nil, "group:water", 1, farming.pumpkin) else -- v7 maps have a beach so plants growing near water is limited to 6 high - register_plant("carrot_8", 1, 6, "", -1, farming.carrot) - register_plant("cucumber_4", 1, 6, "", -1, farming.cucumber) - register_plant("melon_8", 1, 6, "", -1, farming.melon) - register_plant("pumpkin_8", 1, 6, "", -1, farming.pumpkin) + register_plant("carrot_8", 1, 15, nil, "", -1, farming.carrot) + register_plant("cucumber_4", 1, 10, nil, "", -1, farming.cucumber) + register_plant("melon_8", 1, 6, {"default:dirt_with_dry_grass", + "default:dirt_with_rainforest_litter"}, "", -1, farming.melon) + register_plant("pumpkin_8", 1, 6, nil, "", -1, farming.pumpkin) end if farming.hemp then @@ -68,8 +72,8 @@ minetest.register_decoration({ octaves = 3, persist = 0.6 }, - y_min = 5, - y_max = 35, + y_min = 3, + y_max = 45, decoration = "farming:hemp_7", spawn_by = "group:tree", num_spawn_by = 1, diff --git a/farming/melon.lua b/farming/melon.lua index e2f6564..2165558 100644 --- a/farming/melon.lua +++ b/farming/melon.lua @@ -5,6 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:melon_slice", { description = S("Melon Slice"), inventory_image = "farming_melon_slice.png", + groups = {food_melon_slice = 1, flammable = 3}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1") end, @@ -77,6 +78,9 @@ crop_def.description = S("Melon") crop_def.tiles = {"farming_melon_top.png", "farming_melon_top.png", "farming_melon_side.png"} crop_def.selection_box = {-.5, -.5, -.5, .5, .5, .5} crop_def.walkable = true -crop_def.groups = {snappy = 1, oddly_breakable_by_hand = 1, flammable = 2, plant = 1} +crop_def.groups = { + food_melon = 1, snappy = 1, oddly_breakable_by_hand = 1, + flammable = 2, plant = 1 +} crop_def.drop = "farming:melon_slice 9" minetest.register_node("farming:melon_8", table.copy(crop_def)) diff --git a/farming/onion.lua b/farming/onion.lua index bf8737a..21b5c2e 100644 --- a/farming/onion.lua +++ b/farming/onion.lua @@ -11,6 +11,7 @@ local S = farming.intllib minetest.register_craftitem("farming:onion", { description = S("Onion"), inventory_image = "crops_onion.png", + groups = {food_onion = 1, flammable = 3}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:onion_1") end, @@ -59,7 +60,7 @@ crop_def.drop = { max_items = 5, items = { {items = {'farming:onion'}, rarity = 1}, {items = {'farming:onion'}, rarity = 1}, - {items = {'farming:onion'}, rarity = 1}, + {items = {'farming:onion'}, rarity = 2}, {items = {'farming:onion'}, rarity = 2}, {items = {'farming:onion'}, rarity = 5}, } diff --git a/farming/pea.lua b/farming/pea.lua new file mode 100644 index 0000000..ef14dab --- /dev/null +++ b/farming/pea.lua @@ -0,0 +1,89 @@ + +local S = farming.intllib + +-- Textures for Pea crop and Peas were done by Andrey01 + +-- pea pod +minetest.register_craftitem("farming:pea_pod", { + description = S("Pea Pod"), + inventory_image = "farming_pea_pod.png", + groups = {food_pea_pod = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:pea_1") + end +}) + +minetest.register_craftitem("farming:peas", { + description = S("Peas"), + inventory_image = "farming_pea_peas.png", + groups = {food_peas = 1, flammable = 2}, + on_use = minetest.item_eat(1) +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:peas", + recipe = {"farming:pea_pod"} +}) + +-- pea soup +minetest.register_craftitem("farming:pea_soup", { + description = S("Pea Soup"), + inventory_image = "farming_pea_soup.png", + groups = {flammable = 2}, + on_use = minetest.item_eat(4, "farming:bowl"), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:pea_soup", + recipe = {"group:food_peas", "group:food_peas", "group:food_bowl"} +}) + +local crop_def = { + drawtype = "plantlike", + tiles = {"farming_pea_1.png"}, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, flora = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:pea_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_pea_2.png"} +minetest.register_node("farming:pea_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_pea_3.png"} +minetest.register_node("farming:pea_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_pea_4.png"} +minetest.register_node("farming:pea_4", table.copy(crop_def)) + +-- stage 5 +crop_def.tiles = {"farming_pea_5.png"} +crop_def.groups.growing = 0 +crop_def.drop = { + max_items = 5, items = { + {items = {'farming:pea_pod'}, rarity = 1}, + {items = {'farming:pea_pod'}, rarity = 2}, + {items = {'farming:pea_pod'}, rarity = 3}, + {items = {'farming:pea_pod'}, rarity = 4}, + {items = {'farming:pea_pod'}, rarity = 5}, + } +} +minetest.register_node("farming:pea_5", table.copy(crop_def)) diff --git a/farming/pepper.lua b/farming/pepper.lua index 3ce60cd..4831952 100644 --- a/farming/pepper.lua +++ b/farming/pepper.lua @@ -11,6 +11,7 @@ local S = farming.intllib minetest.register_craftitem("farming:peppercorn", { description = S("Peppercorn"), inventory_image = "crops_peppercorn.png", + groups = {food_peppercorn = 1, flammable = 3}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:pepper_1") end, @@ -21,13 +22,13 @@ minetest.register_craftitem("farming:pepper", { description = S("Pepper"), inventory_image = "crops_pepper.png", on_use = minetest.item_eat(2), - groups = {pepper = 1}, + groups = {food_pepper = 1, flammable = 3}, }) minetest.register_craft({ type = "shapeless", output = "farming:peppercorn", - recipe = { "farming:pepper" } + recipe = {"farming:pepper"} }) -- ground pepper @@ -38,7 +39,10 @@ minetest.register_node("farming:pepper_ground", { drawtype = "plantlike", paramtype = "light", tiles = {"crops_pepper_ground.png"}, - groups = {vessel = 1, pepper_ground = 1, dig_immediate = 3, attached_node = 1}, + groups = { + vessel = 1, food_pepper_ground = 1, + dig_immediate = 3, attached_node = 1 + }, sounds = default.node_sound_glass_defaults(), selection_box = { type = "fixed", @@ -49,7 +53,8 @@ minetest.register_node("farming:pepper_ground", { minetest.register_craft( { output = "farming:pepper_ground", type = "shapeless", - recipe = {"farming:peppercorn", "vessels:glass_bottle"} + recipe = {"group:food_peppercorn", "vessels:glass_bottle", "farming:mortar_pestle"}, + replacements = {{"farming:mortar_pestle", "farming:mortar_pestle"}}, }) -- crop definition @@ -92,8 +97,9 @@ crop_def.tiles = {"crops_pepper_plant_5.png"} crop_def.groups.growing = 0 crop_def.drop = { max_items = 2, items = { - {items = {'farming:pepper'}, rarity = 1}, + {items = {'farming:pepper 2'}, rarity = 1}, {items = {'farming:pepper'}, rarity = 2}, + {items = {'farming:pepper'}, rarity = 3}, } } minetest.register_node("farming:pepper_5", table.copy(crop_def)) diff --git a/farming/pineapple.lua b/farming/pineapple.lua index 2e7f5b7..6376f2f 100644 --- a/farming/pineapple.lua +++ b/farming/pineapple.lua @@ -24,20 +24,21 @@ minetest.register_node("farming:pineapple", { type = "fixed", fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27} }, - groups = {fleshy = 3, dig_immediate = 3, flammable = 2}, + groups = {food_pineapple = 1, fleshy = 3, dig_immediate = 3, flammable = 2}, }) -- pineapple minetest.register_craftitem("farming:pineapple_ring", { description = S("Pineapple Ring"), inventory_image = "farming_pineapple_ring.png", + groups = {food_pineapple_ring = 1, flammable = 2}, on_use = minetest.item_eat(1), }) minetest.register_craft( { output = "farming:pineapple_ring 5", type = "shapeless", - recipe = {"farming:pineapple"}, + recipe = {"group:food_pineapple"}, replacements = {{"farming:pineapple", "farming:pineapple_top"}} }) @@ -51,8 +52,21 @@ minetest.register_craftitem("farming:pineapple_juice", { minetest.register_craft({ output = "farming:pineapple_juice", type = "shapeless", - recipe = {"vessels:drinking_glass", "farming:pineapple_ring", - "farming:pineapple_ring", "farming:pineapple_ring"}, + recipe = {"vessels:drinking_glass", "group:food_pineapple_ring", + "group:food_pineapple_ring", "group:food_pineapple_ring", + "farming:juicer"}, + replacements = { + {"farming:juicer", "farming:juicer"}, + }, +}) + +minetest.register_craft({ + output = "farming:pineapple_juice 2", + type = "shapeless", + recipe = {"vessels:drinking_glass", "group:food_pineapple", "farming:juicer"}, + replacements = { + {"farming:juicer", "farming:juicer"}, + }, }) -- crop definition diff --git a/farming/potato.lua b/farming/potato.lua index be36905..a922b11 100644 --- a/farming/potato.lua +++ b/farming/potato.lua @@ -10,6 +10,7 @@ local S = farming.intllib minetest.register_craftitem("farming:potato", { description = S("Potato"), inventory_image = "farming_potato.png", + groups = {food_potato = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1") end, @@ -27,7 +28,7 @@ minetest.register_craft({ type = "cooking", cooktime = 10, output = "farming:baked_potato", - recipe = "farming:potato" + recipe = "group:food_potato" }) -- potato definition diff --git a/farming/pumpkin.lua b/farming/pumpkin.lua index 8bff778..d8e8ec6 100644 --- a/farming/pumpkin.lua +++ b/farming/pumpkin.lua @@ -14,7 +14,7 @@ minetest.register_node("farming:pumpkin", { "farming_pumpkin_side.png" }, groups = { - choppy = 1, oddly_breakable_by_hand = 1, + food_pumpkin = 1, choppy = 1, oddly_breakable_by_hand = 1, flammable = 2, plant = 1 }, drop = { @@ -29,6 +29,7 @@ minetest.register_node("farming:pumpkin", { minetest.register_craftitem("farming:pumpkin_slice", { description = S("Pumpkin Slice"), inventory_image = "farming_pumpkin_slice.png", + groups = {food_pumpkin_slice = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1") end, @@ -97,9 +98,34 @@ minetest.register_node("farming:jackolantern_on", { minetest.register_craft({ output = "farming:jackolantern", recipe = { - {"", "", ""}, - {"", "default:torch", ""}, - {"", "farming:pumpkin", ""}, + {"default:torch"}, + {"group:food_pumpkin"}, + } +}) + +--- wooden scarecrow base +minetest.register_node("farming:scarecrow_bottom", { + paramtype = "light", + sunlight_propagates = true, + paramtype2 = "facedir", + tiles = {"default_wood.png"}, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-1/16, -8/16, -1/16, 1/16, 8/16, 1/16}, + {-12/16, 4/16, -1/16, 12/16, 2/16, 1/16}, + }, + }, + groups = {snappy = 3, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:scarecrow_bottom", + recipe = { + {"", "group:stick", "",}, + {"group:stick", "group:stick", "group:stick",}, + {"", "group:stick", "",} } }) @@ -107,7 +133,8 @@ minetest.register_craft({ minetest.register_craftitem("farming:pumpkin_bread", { description = S("Pumpkin Bread"), inventory_image = "farming_pumpkin_bread.png", - on_use = minetest.item_eat(8) + on_use = minetest.item_eat(8), + groups = {food_bread = 1, flammable = 2}, }) minetest.register_craftitem("farming:pumpkin_dough", { @@ -118,7 +145,7 @@ minetest.register_craftitem("farming:pumpkin_dough", { minetest.register_craft({ output = "farming:pumpkin_dough", type = "shapeless", - recipe = {"farming:flour", "farming:pumpkin_slice", "farming:pumpkin_slice"} + recipe = {"group:food_flour", "group:food_pumpkin_slice", "group:food_pumpkin_slice"} }) minetest.register_craft({ diff --git a/farming/raspberry.lua b/farming/raspberry.lua index 384eb59..931d2ae 100644 --- a/farming/raspberry.lua +++ b/farming/raspberry.lua @@ -5,6 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:raspberries", { description = S("Raspberries"), inventory_image = "farming_raspberries.png", + groups = {food_raspberries = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1") end, @@ -22,7 +23,7 @@ minetest.register_craft({ output = "farming:smoothie_raspberry", recipe = { {"default:snow"}, - {"farming:raspberries"}, + {"group:food_raspberries"}, {"vessels:drinking_glass"}, } }) diff --git a/farming/rhubarb.lua b/farming/rhubarb.lua index 30e9fba..1fa897f 100644 --- a/farming/rhubarb.lua +++ b/farming/rhubarb.lua @@ -5,6 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:rhubarb", { description = S("Rhubarb"), inventory_image = "farming_rhubarb.png", + groups = {food_rhubarb = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1") end, @@ -21,10 +22,11 @@ minetest.register_craftitem("farming:rhubarb_pie", { minetest.register_craft({ output = "farming:rhubarb_pie", recipe = { - {"", "farming:sugar", ""}, - {"farming:rhubarb", "farming:rhubarb", "farming:rhubarb"}, - {"farming:wheat", "farming:wheat", "farming:wheat"}, - } + {"farming:baking_tray", "group:food_sugar", ""}, + {"group:food_rhubarb", "group:food_rhubarb", "group:food_rhubarb"}, + {"group:food_wheat", "group:food_wheat", "group:food_wheat"}, + }, + replacements = {{"farming:baking_tray", "farming:baking_tray"}} }) -- rhubarb definition diff --git a/farming/sugar.lua b/farming/sugar.lua index 012a987..bdaf698 100644 --- a/farming/sugar.lua +++ b/farming/sugar.lua @@ -6,6 +6,7 @@ local S = farming.intllib minetest.register_craftitem("farming:sugar", { description = S("Sugar"), inventory_image = "farming_sugar.png", + groups = {food_sugar = 1, flammable = 3}, }) minetest.register_craft({ @@ -25,7 +26,8 @@ minetest.register_node("farming:salt", { drawtype = "plantlike", paramtype = "light", tiles = {"farming_salt.png"}, - groups = {vessel = 1, salt = 1, dig_immediate = 3, attached_node = 1}, + groups = {food_salt = 1, vessel = 1, dig_immediate = 3, + attached_node = 1}, sounds = default.node_sound_glass_defaults(), selection_box = { type = "fixed", diff --git a/farming/textures/farming_baking_tray.png b/farming/textures/farming_baking_tray.png Binary files differnew file mode 100644 index 0000000..be1711c --- /dev/null +++ b/farming/textures/farming_baking_tray.png diff --git a/farming/textures/farming_beetroot.png b/farming/textures/farming_beetroot.png Binary files differnew file mode 100644 index 0000000..6a60168 --- /dev/null +++ b/farming/textures/farming_beetroot.png diff --git a/farming/textures/farming_beetroot_1.png b/farming/textures/farming_beetroot_1.png Binary files differnew file mode 100644 index 0000000..8b75e10 --- /dev/null +++ b/farming/textures/farming_beetroot_1.png diff --git a/farming/textures/farming_beetroot_2.png b/farming/textures/farming_beetroot_2.png Binary files differnew file mode 100644 index 0000000..9c1ce1e --- /dev/null +++ b/farming/textures/farming_beetroot_2.png diff --git a/farming/textures/farming_beetroot_3.png b/farming/textures/farming_beetroot_3.png Binary files differnew file mode 100644 index 0000000..0f28e5e --- /dev/null +++ b/farming/textures/farming_beetroot_3.png diff --git a/farming/textures/farming_beetroot_4.png b/farming/textures/farming_beetroot_4.png Binary files differnew file mode 100644 index 0000000..35f211b --- /dev/null +++ b/farming/textures/farming_beetroot_4.png diff --git a/farming/textures/farming_beetroot_5.png b/farming/textures/farming_beetroot_5.png Binary files differnew file mode 100644 index 0000000..c4b8957 --- /dev/null +++ b/farming/textures/farming_beetroot_5.png diff --git a/farming/textures/farming_beetroot_soup.png b/farming/textures/farming_beetroot_soup.png Binary files differnew file mode 100644 index 0000000..4df562e --- /dev/null +++ b/farming/textures/farming_beetroot_soup.png diff --git a/farming/textures/farming_bowl.png b/farming/textures/farming_bowl.png Binary files differnew file mode 100644 index 0000000..627c22e --- /dev/null +++ b/farming/textures/farming_bowl.png diff --git a/farming/textures/farming_bread_slice.png b/farming/textures/farming_bread_slice.png Binary files differnew file mode 100644 index 0000000..ff2714d --- /dev/null +++ b/farming/textures/farming_bread_slice.png diff --git a/farming/textures/farming_cocoa_1.png b/farming/textures/farming_cocoa_1.png Binary files differindex f887a1f..18fd362 100644 --- a/farming/textures/farming_cocoa_1.png +++ b/farming/textures/farming_cocoa_1.png diff --git a/farming/textures/farming_cocoa_2.png b/farming/textures/farming_cocoa_2.png Binary files differindex f0d3935..c304ee0 100644 --- a/farming/textures/farming_cocoa_2.png +++ b/farming/textures/farming_cocoa_2.png diff --git a/farming/textures/farming_cocoa_3.png b/farming/textures/farming_cocoa_3.png Binary files differindex 8eaf67e..d66b47d 100644 --- a/farming/textures/farming_cocoa_3.png +++ b/farming/textures/farming_cocoa_3.png diff --git a/farming/textures/farming_cocoa_4.png b/farming/textures/farming_cocoa_4.png Binary files differnew file mode 100644 index 0000000..990a8b4 --- /dev/null +++ b/farming/textures/farming_cocoa_4.png diff --git a/farming/textures/farming_cutting_board.png b/farming/textures/farming_cutting_board.png Binary files differnew file mode 100644 index 0000000..90b3f9c --- /dev/null +++ b/farming/textures/farming_cutting_board.png diff --git a/farming/textures/farming_hemp_block.png b/farming/textures/farming_hemp_block.png Binary files differnew file mode 100644 index 0000000..285a2cd --- /dev/null +++ b/farming/textures/farming_hemp_block.png diff --git a/farming/textures/farming_hoe_bomb.png b/farming/textures/farming_hoe_bomb.png Binary files differnew file mode 100644 index 0000000..e8db9b1 --- /dev/null +++ b/farming/textures/farming_hoe_bomb.png diff --git a/farming/textures/farming_juicer.png b/farming/textures/farming_juicer.png Binary files differnew file mode 100644 index 0000000..46265e4 --- /dev/null +++ b/farming/textures/farming_juicer.png diff --git a/farming/textures/farming_mixing_bowl.png b/farming/textures/farming_mixing_bowl.png Binary files differnew file mode 100644 index 0000000..e96edf0 --- /dev/null +++ b/farming/textures/farming_mixing_bowl.png diff --git a/farming/textures/farming_mortar_pestle.png b/farming/textures/farming_mortar_pestle.png Binary files differnew file mode 100644 index 0000000..abfeb9e --- /dev/null +++ b/farming/textures/farming_mortar_pestle.png diff --git a/farming/textures/farming_pea_1.png b/farming/textures/farming_pea_1.png Binary files differnew file mode 100644 index 0000000..eb48e36 --- /dev/null +++ b/farming/textures/farming_pea_1.png diff --git a/farming/textures/farming_pea_2.png b/farming/textures/farming_pea_2.png Binary files differnew file mode 100644 index 0000000..4db7551 --- /dev/null +++ b/farming/textures/farming_pea_2.png diff --git a/farming/textures/farming_pea_3.png b/farming/textures/farming_pea_3.png Binary files differnew file mode 100644 index 0000000..980d6ea --- /dev/null +++ b/farming/textures/farming_pea_3.png diff --git a/farming/textures/farming_pea_4.png b/farming/textures/farming_pea_4.png Binary files differnew file mode 100644 index 0000000..551eaf4 --- /dev/null +++ b/farming/textures/farming_pea_4.png diff --git a/farming/textures/farming_pea_5.png b/farming/textures/farming_pea_5.png Binary files differnew file mode 100644 index 0000000..907760d --- /dev/null +++ b/farming/textures/farming_pea_5.png diff --git a/farming/textures/farming_pea_peas.png b/farming/textures/farming_pea_peas.png Binary files differnew file mode 100644 index 0000000..d70b283 --- /dev/null +++ b/farming/textures/farming_pea_peas.png diff --git a/farming/textures/farming_pea_pod.png b/farming/textures/farming_pea_pod.png Binary files differnew file mode 100644 index 0000000..1c19c9f --- /dev/null +++ b/farming/textures/farming_pea_pod.png diff --git a/farming/textures/farming_pea_soup.png b/farming/textures/farming_pea_soup.png Binary files differnew file mode 100644 index 0000000..03753cf --- /dev/null +++ b/farming/textures/farming_pea_soup.png diff --git a/farming/textures/farming_pot.png b/farming/textures/farming_pot.png Binary files differnew file mode 100644 index 0000000..d28411d --- /dev/null +++ b/farming/textures/farming_pot.png diff --git a/farming/textures/farming_saucepan.png b/farming/textures/farming_saucepan.png Binary files differnew file mode 100644 index 0000000..2625d45 --- /dev/null +++ b/farming/textures/farming_saucepan.png diff --git a/farming/textures/farming_skillet.png b/farming/textures/farming_skillet.png Binary files differnew file mode 100644 index 0000000..60d26a1 --- /dev/null +++ b/farming/textures/farming_skillet.png diff --git a/farming/textures/farming_toast.png b/farming/textures/farming_toast.png Binary files differnew file mode 100644 index 0000000..8a4524e --- /dev/null +++ b/farming/textures/farming_toast.png diff --git a/farming/textures/farming_toast_sandwich.png b/farming/textures/farming_toast_sandwich.png Binary files differnew file mode 100644 index 0000000..c60ff5a --- /dev/null +++ b/farming/textures/farming_toast_sandwich.png diff --git a/farming/tomato.lua b/farming/tomato.lua index 1ed7870..53012a8 100644 --- a/farming/tomato.lua +++ b/farming/tomato.lua @@ -10,6 +10,7 @@ local S = farming.intllib minetest.register_craftitem("farming:tomato", { description = S("Tomato"), inventory_image = "farming_tomato.png", + groups = {food_tomato = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1") end, diff --git a/farming/utensils.lua b/farming/utensils.lua new file mode 100644 index 0000000..63a7de3 --- /dev/null +++ b/farming/utensils.lua @@ -0,0 +1,149 @@ + +local S = farming.intllib + +-- wooden bowl + +minetest.register_craftitem("farming:bowl", { + description = S("Wooden Bowl"), + inventory_image = "farming_bowl.png", + groups = {food_bowl = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:bowl 4", + recipe = { + {"group:wood", "", "group:wood"}, + {"", "group:wood", ""}, + } +}) + +-- saucepan + +minetest.register_craftitem("farming:saucepan", { + description = S("Saucepan"), + inventory_image = "farming_saucepan.png", + groups = {food_saucepan = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:saucepan", + recipe = { + {"default:steel_ingot", "", ""}, + {"", "group:stick", ""}, + } +}) + +-- cooking pot + +minetest.register_craftitem("farming:pot", { + description = S("Cooking Pot"), + inventory_image = "farming_pot.png", + groups = {food_pot = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:pot", + recipe = { + {"group:stick", "default:steel_ingot", "default:steel_ingot"}, + {"", "default:steel_ingot", "default:steel_ingot"}, + } +}) + +-- baking tray + +minetest.register_craftitem("farming:baking_tray", { + description = S("Baking Tray"), + inventory_image = "farming_baking_tray.png", + groups = {food_baking_tray = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:baking_tray", + recipe = { + {"default:clay_brick", "default:clay_brick", "default:clay_brick"}, + {"default:clay_brick", "", "default:clay_brick"}, + {"default:clay_brick", "default:clay_brick", "default:clay_brick"}, + } +}) + +-- skillet + +minetest.register_craftitem("farming:skillet", { + description = S("Skillet"), + inventory_image = "farming_skillet.png", + groups = {food_baking_tray = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:skillet", + recipe = { + {"default:steel_ingot", "", ""}, + {"", "default:steel_ingot", ""}, + {"", "", "group:stick"}, + } +}) + +-- mortar and pestle + +minetest.register_craftitem("farming:mortar_pestle", { + description = S("Mortar and Pestle"), + inventory_image = "farming_mortar_pestle.png", + groups = {food_mortar_pestle = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:mortar_pestle", + recipe = { + {"default:stone", "group:stick", "default:stone"}, + {"", "default:stone", ""}, + } +}) + +-- cutting board + +minetest.register_craftitem("farming:cutting_board", { + description = S("Cutting Board"), + inventory_image = "farming_cutting_board.png", + groups = {food_cutting_board = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:cutting_board", + recipe = { + {"default:steel_ingot", "", ""}, + {"", "group:stick", ""}, + {"", "", "group:wood"}, + } +}) + +-- juicer + +minetest.register_craftitem("farming:juicer", { + description = S("Juicer"), + inventory_image = "farming_juicer.png", + groups = {food_juicer = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:juicer", + recipe = { + {"", "default:stone", ""}, + {"default:stone", "", "default:stone"}, + } +}) + +-- glass mixing bowl + +minetest.register_craftitem("farming:mixing_bowl", { + description = S("Glass Mixing Bowl"), + inventory_image = "farming_mixing_bowl.png", + groups = {food_mixing_bowl = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:mixing_bowl", + recipe = { + {"default:glass", "group:stick", "default:glass"}, + {"", "default:glass", ""}, + } +}) diff --git a/farming/wheat.lua b/farming/wheat.lua index 79988b6..1b22723 100644 --- a/farming/wheat.lua +++ b/farming/wheat.lua @@ -23,7 +23,7 @@ minetest.register_node("farming:seed_wheat", { minetest.register_craftitem("farming:wheat", { description = S("Wheat"), inventory_image = "farming_wheat.png", - groups = {flammable = 4}, + groups = {food_wheat = 1, flammable = 4}, }) -- straw @@ -55,13 +55,17 @@ minetest.register_craft({ minetest.register_craftitem("farming:flour", { description = S("Flour"), inventory_image = "farming_flour.png", - groups = {flammable = 1}, + groups = {food_flour = 1, flammable = 1}, }) minetest.register_craft({ type = "shapeless", output = "farming:flour", - recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"} + recipe = { + "farming:wheat", "farming:wheat", "farming:wheat", + "farming:wheat", "farming:mortar_pestle" + }, + replacements = {{"farming:mortar_pestle", "farming:mortar_pestle"}}, }) -- bread @@ -69,7 +73,7 @@ minetest.register_craftitem("farming:bread", { description = S("Bread"), inventory_image = "farming_bread.png", on_use = minetest.item_eat(5), - groups = {flammable = 2}, + groups = {food_bread = 1, flammable = 2}, }) minetest.register_craft({ @@ -79,6 +83,53 @@ minetest.register_craft({ recipe = "farming:flour" }) +-- sliced bread +minetest.register_craftitem("farming:bread_slice", { + description = S("Sliced Bread"), + inventory_image = "farming_bread_slice.png", + on_use = minetest.item_eat(1), + groups = {food_bread_slice = 1, flammable = 2}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:bread_slice 5", + recipe = {"farming:bread", "group:food_cutting_board"}, + replacements = {{"farming:cutting_board", "farming:cutting_board"}}, +}) + +-- toast +minetest.register_craftitem("farming:toast", { + description = S("Toast"), + inventory_image = "farming_toast.png", + on_use = minetest.item_eat(1), + groups = {food_toast = 1, flammable = 2}, +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 3, + output = "farming:toast", + recipe = "farming:bread_slice" +}) + +-- toast sandwich +minetest.register_craftitem("farming:toast_sandwich", { + description = S("Toast Sandwich"), + inventory_image = "farming_toast_sandwich.png", + on_use = minetest.item_eat(4), + groups = {flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:toast_sandwich", + recipe = { + {"farming:bread_slice"}, + {"farming:toast"}, + {"farming:bread_slice"}, + } +}) + -- wheat definition local crop_def = { drawtype = "plantlike", diff --git a/homedecor/wardrobe.lua b/homedecor/wardrobe.lua index d0e3538..ef91ed8 100644 --- a/homedecor/wardrobe.lua +++ b/homedecor/wardrobe.lua @@ -6,6 +6,53 @@ local wd_cbox = { fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 } } +-- cache set_textures function (fallback to old version) +-- default.player_set_textures is deprecated and will be removed in future +local set_player_textures = + minetest.get_modpath("player_api") and player_api.set_textures + or default.player_set_textures + +local armor_mod_path = minetest.get_modpath("3d_armor") +local skins = {"male1", "male2", "male3", "male4", "male5"} +local default_skin = "character.png" + +function homedecor.get_player_skin(player) + local skin = player:get_attribute("homedecor:player_skin") + if not skin or skin == "" then + return default_skin, true + end + return skin, false +end + +function homedecor.set_player_skin(player, skin, save) + skin = skin or default_skin + if armor_mod_path then -- if 3D_armor's installed, let it set the skin + armor.textures[player:get_player_name()].skin = skin + armor:update_player_visuals(player) + else + set_player_textures(player, { skin }) + end + + if save then + if skin == default_skin then + skin = "default" + player:set_attribute("homedecor:player_skin", "") + else + player:set_attribute("homedecor:player_skin", skin) + end + if save == "player" then -- if player action + minetest.log("verbose", + S("player @1 sets skin to @2", player:get_player_name(), skin) .. + (armor_mod_path and ' [3d_armor]' or '') + ) + end + end +end + +function homedecor.unset_player_skin(player) + homedecor.set_player_skin(player, nil, true) +end + homedecor.register("wardrobe", { mesh = "homedecor_bedroom_wardrobe.obj", tiles = { @@ -27,7 +74,6 @@ homedecor.register("wardrobe", { }, on_construct = function(pos) local meta = minetest.get_meta(pos) - local skins = {"male1", "male2", "male3", "male4", "male5"} -- textures made by the Minetest community (mostly Calinou and Jordach) local clothes_strings = "" for i = 1,5 do @@ -37,6 +83,7 @@ homedecor.register("wardrobe", { end meta:set_string("formspec", "size[5.5,8.5]"..default.gui_bg..default.gui_bg_img..default.gui_slots.. "vertlabel[0,0.5;"..minetest.formspec_escape(S("Clothes")).."]".. + "button_exit[0,3.29;0.6,0.6;default;x]".. clothes_strings.. "vertlabel[0,5.2;"..minetest.formspec_escape(S("Storage")).."]".. "list[current_name;main;0.5,4.5;5,2;]".. @@ -44,26 +91,17 @@ homedecor.register("wardrobe", { "listring[]") end, on_receive_fields = function(pos, formname, fields, sender) - local skins = {"male1", "male2", "male3", "male4", "male5"} - local playerName = sender:get_player_name() - local armor_mod = minetest.get_modpath("3d_armor") + if fields.default then + homedecor.set_player_skin(sender, nil, "player") + return + end for i = 1,5 do if fields[skins[i]] then - if armor_mod then -- if 3D_armor's installed, let it set the skin - armor.textures[playerName].skin = "homedecor_clothes_"..skins[i]..".png" - armor:update_player_visuals(sender) - break - end - default.player_set_textures(sender, { "homedecor_clothes_"..skins[i]..".png" }) + homedecor.set_player_skin(sender, "homedecor_clothes_"..skins[i]..".png", "player") break elseif fields["fe"..skins[i]] then - if armor_mod then - armor.textures[playerName].skin = "homedecor_clothes_fe"..skins[i]..".png" - armor:update_player_visuals(sender) - break - end - default.player_set_textures(sender, { skin = "homedecor_clothes_fe"..skins[i]..".png" }) + homedecor.set_player_skin(sender, "homedecor_clothes_fe"..skins[i]..".png", "player") break end end @@ -72,3 +110,14 @@ homedecor.register("wardrobe", { minetest.register_alias("homedecor:wardrobe_bottom", "homedecor:wardrobe") minetest.register_alias("homedecor:wardrobe_top", "air") + +minetest.register_on_joinplayer(function(player) + local skin = player:get_attribute("homedecor:player_skin") + + if skin and skin ~= "" then + -- setting player skin on connect has no effect, so delay skin change + minetest.after(1, function(player, skin) + homedecor.set_player_skin(player, skin) + end, player, skin) + end +end) diff --git a/jumping/init.lua b/jumping/init.lua deleted file mode 100644 index 7937c63..0000000 --- a/jumping/init.lua +++ /dev/null @@ -1,74 +0,0 @@ -local trampolinebox = { - type = "fixed", - fixed = { - {-0.5, -0.2, -0.5, 0.5, 0, 0.5}, - - {-0.5, -0.5, -0.5, -0.4, -0.2, -0.4}, - { 0.4, -0.5, -0.5, 0.5, -0.2, -0.4}, - { 0.4, -0.5, 0.4, 0.5, -0.2, 0.5}, - {-0.5, -0.5, 0.4, -0.4, -0.2, 0.5}, - } -} - -local cushionbox = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.3, 0.5}, - } -} - -local trampoline_punch = function(pos, node) - local id = string.sub(node.name, #node.name) - id = id + 1 - if id == 7 then id = 1 end - minetest.add_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id}) -end - -for i = 1, 6 do - minetest.register_node("jumping:trampoline"..i, { - description = "Trampoline", - drawtype = "nodebox", - node_box = trampolinebox, - selection_box = trampolinebox, - paramtype = "light", - on_punch = trampoline_punch, - tiles = { - "jumping_trampoline_top.png", - "jumping_trampoline_bottom.png", - "jumping_trampoline_sides.png^jumping_trampoline_sides_overlay"..i..".png" - }, - groups = {dig_immediate=2, bouncy=20+i*20, fall_damage_add_percent=-70}, - }) -end - -minetest.register_node("jumping:cushion", { - description = "Cushion", - drawtype = "nodebox", - node_box = cushionbox, - selection_box = cushionbox, - paramtype = "light", - tiles = { - "jumping_cushion_tb.png", - "jumping_cushion_tb.png", - "jumping_cushion_sides.png" - }, - groups = {dig_immediate=2, disable_jump=1, fall_damage_add_percent=-100}, -}) - -minetest.register_craft({ - output = "jumping:trampoline1", - recipe = { - {"default:wood", "default:wood", "default:wood"}, - {"default:leaves", "default:leaves", "default:leaves"}, - {"default:stick", "default:stick", "default:stick"} - } -}) - -minetest.register_craft({ - output = "jumping:cushion", - recipe = { - {"default:leaves", "default:leaves", "default:leaves"}, - {"default:leaves", "default:leaves", "default:leaves"}, - {"default:stick", "default:stick", "default:stick"} - } -}) diff --git a/maptools/CHANGELOG.md b/maptools/CHANGELOG.md index 882b5e9..0830e62 100644 --- a/maptools/CHANGELOG.md +++ b/maptools/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -## [1.0.0] - 2017-02-19 +## 1.0.0 - 2017-02-19 - Initial versioned release. diff --git a/mesecons/settings.lua b/mesecons/settings.lua index 1ebbfde..0220707 100644 --- a/mesecons/settings.lua +++ b/mesecons/settings.lua @@ -1,15 +1,15 @@ -- SETTINGS function mesecon.setting(setting, default) if type(default) == "boolean" then - local read = minetest.setting_getbool("mesecon."..setting) + local read = minetest.settings:get_bool("mesecon."..setting) if read == nil then return default else return read end elseif type(default) == "string" then - return minetest.setting_get("mesecon."..setting) or default + return minetest.settings:get("mesecon."..setting) or default elseif type(default) == "number" then - return tonumber(minetest.setting_get("mesecon."..setting) or default) + return tonumber(minetest.settings:get("mesecon."..setting) or default) end end diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua index c53946d..428c78a 100644 --- a/mesecons_mvps/init.lua +++ b/mesecons_mvps/init.lua @@ -219,7 +219,7 @@ function mesecon.mvps_move_objects(pos, dir, nodestack, movefactor) movefactor = movefactor or 1 dir = vector.multiply(dir, movefactor) for id, obj in pairs(minetest.object_refs) do - local obj_pos = obj:get_pos() + local obj_pos = obj:getpos() local cbox = obj:get_properties().collisionbox local min_pos = vector.add(obj_pos, vector.new(cbox[1], cbox[2], cbox[3])) local max_pos = vector.add(obj_pos, vector.new(cbox[4], cbox[5], cbox[6])) diff --git a/moreblocks/CHANGELOG.md b/moreblocks/CHANGELOG.md index 817f6b9..2b9c5f2 100644 --- a/moreblocks/CHANGELOG.md +++ b/moreblocks/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Listring add for circular saw. +- Stairs+: New API function: + `stairsplus:register_custom_subset(subset, modname, subname, recipeitem, fields)` ### Fixed @@ -17,6 +19,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - The circular saw can no longer replace items from the player's inventory when it is full. +### Changed + +- New craft for: + - Stone Tile + - Circle Stone Bricks +- Stairs+: + - Move definitions to `stairsplus.defs` table in a separate file + - Move recipe definitions to `stairsplus.register_recipes` function in a separate file + ## [1.1.0] - 2017-10-04 ### Added @@ -37,7 +48,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Wool (all colors) - Other mods can now get a list of all the defined Stairs+ shapes -## [1.0.0] - 2017-02-19 +## 1.0.0 - 2017-02-19 - Initial versioned release. diff --git a/moreblocks/crafting.lua b/moreblocks/crafting.lua index b6432c7..3fb9830 100644 --- a/moreblocks/crafting.lua +++ b/moreblocks/crafting.lua @@ -94,11 +94,11 @@ minetest.register_craft({ }) minetest.register_craft({ - output = "moreblocks:circle_stone_bricks 8", + output = "moreblocks:circle_stone_bricks 5", recipe = { - {"default:stone", "default:stone", "default:stone"}, - {"default:stone", "", "default:stone"}, - {"default:stone", "default:stone", "default:stone"}, + {"", "default:stone", ""}, + {"default:stone", "default:coal_lump", "default:stone"}, + {"", "default:stone", ""}, } }) @@ -156,10 +156,11 @@ minetest.register_craft({ }) minetest.register_craft({ - output = "moreblocks:stone_tile 4", + output = "moreblocks:stone_tile 9", recipe = { - {"default:cobble", "default:cobble"}, - {"default:cobble", "default:cobble"}, + {"default:cobble", "default:cobble", "default:cobble"}, + {"default:cobble", "default:stone", "default:cobble"}, + {"default:cobble", "default:cobble", "default:cobble"}, } }) diff --git a/moreblocks/stairsplus/API.md b/moreblocks/stairsplus/API.md index 1011487..cd8d1a7 100644 --- a/moreblocks/stairsplus/API.md +++ b/moreblocks/stairsplus/API.md @@ -20,4 +20,63 @@ You will probably never want to use them directly: * `stairsplus:register_slab(modname, subname, recipeitem, fields)` * `stairsplus:register_panel(modname, subname, recipeitem, fields)` * `stairsplus:register_micro(modname, subname, recipeitem, fields)` +* `stairsplus:register_slope(modname, subname, recipeitem, fields)` +If you only want to register a subset of stairsplus nodes, +you can use the `stairsplus:register_custom_subset(subset, modname, subname, recipeitem, fields)` function. +The subset table should have the following format: + +```lua + local subset = { + { "micro", "" }, + { "micro", "_1" }, + { "micro", "_2" }, + { "micro", "_4" }, + { "micro", "_12" }, + { "micro", "_14" }, + { "micro", "_15" }, + { "panel", "" }, + { "panel", "_1" }, + { "panel", "_2" }, + { "panel", "_4" }, + { "panel", "_12" }, + { "panel", "_14" }, + { "panel", "_15" }, + { "slab", "" }, + { "slab", "_quarter" }, + { "slab", "_three_quarter" }, + { "slab", "_1" }, + { "slab", "_2" }, + { "slab", "_14" }, + { "slab", "_15" }, + { "slab", "_two_sides" }, + { "slab", "_three_sides" }, + { "slab", "_three_sides_u" }, + { "slope", "" }, + { "slope", "_half" }, + { "slope", "_half_raised" }, + { "slope", "_inner" }, + { "slope", "_inner_half" }, + { "slope", "_inner_half_raised" }, + { "slope", "_inner_cut" }, + { "slope", "_inner_cut_half" }, + { "slope", "_inner_cut_half_raised" }, + { "slope", "_outer" }, + { "slope", "_outer_half" }, + { "slope", "_outer_half_raised" }, + { "slope", "_outer_cut" }, + { "slope", "_outer_cut_half" }, + { "slope", "_outer_cut_half_raised" }, + { "slope", "_cut" }, + { "stair", "" }, + { "stair", "_half" }, + { "stair", "_right_half" }, + { "stair", "_inner" }, + { "stair", "_outer" }, + { "stair", "_alt" }, + { "stair", "_alt_1" }, + { "stair", "_alt_2" }, + { "stair", "_alt_4" }, + } +``` +You can remove entries as needed.
\ No newline at end of file diff --git a/moreblocks/stairsplus/common.lua b/moreblocks/stairsplus/common.lua new file mode 100644 index 0000000..a7134b2 --- /dev/null +++ b/moreblocks/stairsplus/common.lua @@ -0,0 +1,61 @@ +--[[ +More Blocks: registrations + +Copyright (c) 2011-2018 Hugo Locurcio and contributors. +Licensed under the zlib license. See LICENSE.md for more information. +--]] + +local S = moreblocks.intllib + + +stairsplus.register_single = function(category, alternate, info, modname, subname, recipeitem, fields) + local descriptions = { + ["micro"] = "Microblock", + ["slab"] = "Slab", + ["slope"] = "Slope", + ["panel"] = "Panel", + ["stair"] = "Stairs", + } + local def = {} + if category ~= "slab" then + def = table.copy(info) + end + + for k, v in pairs(fields) do + def[k] = v + end + def.drawtype = "nodebox" + if category == "slope" then + def.drawtype = "mesh" + end + def.paramtype = "light" + def.paramtype2 = def.paramtype2 or "facedir" + def.on_place = minetest.rotate_node + if category ~= "slab" then + def.description = S("%s " .. descriptions[category]):format(fields.description) + else + local desc_base = S("%s " .. descriptions[category]):format(fields.description) + if type(info) ~= "table" then + def.node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, (info/16)-0.5, 0.5}, + } + def.description = ("%s (%d/16)"):format(desc_base, info) + else + def.node_box = { + type = "fixed", + fixed = info, + } + def.description = desc_base .. alternate:gsub("_", " "):gsub("(%a)(%S*)", function(a, b) return a:upper() .. b end) + end + end + def.groups = stairsplus:prepare_groups(fields.groups) + if category == "stair" and alternate == "" then + def.groups.stair = 1 + end + if fields.drop and not (type(fields.drop) == "table") then + def.drop = modname.. ":" .. category .. "_" .. fields.drop .. alternate + end + minetest.register_node(":" ..modname.. ":" .. category .. "_" .. subname .. alternate, def) + stairsplus.register_recipes(category, alternate, modname, subname, recipeitem) +end
\ No newline at end of file diff --git a/moreblocks/stairsplus/custom.lua b/moreblocks/stairsplus/custom.lua new file mode 100644 index 0000000..e456f7c --- /dev/null +++ b/moreblocks/stairsplus/custom.lua @@ -0,0 +1,98 @@ +--[[ +More Blocks: microblock definitions + +Copyright (c) 2011-2018 Hugo Locurcio and contributors. +Licensed under the zlib license. See LICENSE.md for more information. +--]] + +local S = moreblocks.intllib + +--[[ +Subset table should have the following format: (You can remove entries as needed.) + +local subset = { + { "micro", "" }, + { "micro", "_1" }, + { "micro", "_2" }, + { "micro", "_4" }, + { "micro", "_12" }, + { "micro", "_14" }, + { "micro", "_15" }, + { "panel", "" }, + { "panel", "_1" }, + { "panel", "_2" }, + { "panel", "_4" }, + { "panel", "_12" }, + { "panel", "_14" }, + { "panel", "_15" }, + { "slab", "" }, + { "slab", "_quarter" }, + { "slab", "_three_quarter" }, + { "slab", "_1" }, + { "slab", "_2" }, + { "slab", "_14" }, + { "slab", "_15" }, + { "slab", "_two_sides" }, + { "slab", "_three_sides" }, + { "slab", "_three_sides_u" }, + { "slope", "" }, + { "slope", "_half" }, + { "slope", "_half_raised" }, + { "slope", "_inner" }, + { "slope", "_inner_half" }, + { "slope", "_inner_half_raised" }, + { "slope", "_inner_cut" }, + { "slope", "_inner_cut_half" }, + { "slope", "_inner_cut_half_raised" }, + { "slope", "_outer" }, + { "slope", "_outer_half" }, + { "slope", "_outer_half_raised" }, + { "slope", "_outer_cut" }, + { "slope", "_outer_cut_half" }, + { "slope", "_outer_cut_half_raised" }, + { "slope", "_cut" }, + { "stair", "" }, + { "stair", "_half" }, + { "stair", "_right_half" }, + { "stair", "_inner" }, + { "stair", "_outer" }, + { "stair", "_alt" }, + { "stair", "_alt_1" }, + { "stair", "_alt_2" }, + { "stair", "_alt_4" }, +} +--]] + +function register_custom_subset(subset, modname, subname, recipeitem, groups, images, description, drop, light) + stairsplus:register_custom_subset(subset, modname, subname, recipeitem, { + groups = groups, + tiles = images, + description = description, + drop = drop, + light_source = light, + sounds = default.node_sound_stone_defaults(), + }) +end + +function stairsplus:register_custom_subset_alias(subset, modname_old, subname_old, modname_new, subname_new) + local subset = table.copy(subset) + for k, v in pairs(subset) do + minetest.register_alias(modname_old .. ":" .. v[1] .. "_" .. subname_old .. v[2], modname_new .. ":" .. v[1] .. "_" .. subname_new .. v[2]) + end +end + +function stairsplus:register_custom_subset_alias_force(subset, modname_old, subname_old, modname_new, subname_new) + local subset = table.copy(subset) + for k, v in pairs(subset) do + minetest.register_alias_force(modname_old .. ":" .. v[1] .. "_" .. subname_old .. v[2], modname_new .. ":" .. v[1] .. "_" .. subname_new .. v[2]) + end +end + +function stairsplus:register_custom_subset(subset, modname, subname, recipeitem, fields) + local subset = table.copy(subset) + for k, v in pairs(subset) do + stairsplus.register_single(v[1], v[2], stairsplus.defs[v[1]][v[2]], modname, subname, recipeitem, fields) + end + + circular_saw.known_nodes[recipeitem] = {modname, subname} +end diff --git a/moreblocks/stairsplus/defs.lua b/moreblocks/stairsplus/defs.lua new file mode 100644 index 0000000..560b1f2 --- /dev/null +++ b/moreblocks/stairsplus/defs.lua @@ -0,0 +1,409 @@ +--[[ +More Blocks: registrations + +Copyright (c) 2011-2018 Hugo Locurcio and contributors. +Licensed under the zlib license. See LICENSE.md for more information. +--]] + + +local box_slope = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, + {-0.5, -0.25, -0.25, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0.5, 0.25, 0.5}, + {-0.5, 0.25, 0.25, 0.5, 0.5, 0.5} + } +} + +local box_slope_half = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, + {-0.5, -0.375, -0.25, 0.5, -0.25, 0.5}, + {-0.5, -0.25, 0, 0.5, -0.125, 0.5}, + {-0.5, -0.125, 0.25, 0.5, 0, 0.5}, + } +} + +local box_slope_half_raised = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5}, + {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5}, + {-0.5, 0.25, 0, 0.5, 0.375, 0.5}, + {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5}, + } +} + +--============================================================== + +local box_slope_inner = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, + {-0.5, -0.5, -0.25, 0.5, 0, 0.5}, + {-0.5, -0.5, -0.5, 0.25, 0, 0.5}, + {-0.5, 0, -0.5, 0, 0.25, 0.5}, + {-0.5, 0, 0, 0.5, 0.25, 0.5}, + {-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}, + {-0.5, 0.25, -0.5, -0.25, 0.5, 0.5}, + } +} + +local box_slope_inner_half = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, + {-0.5, -0.375, -0.25, 0.5, -0.25, 0.5}, + {-0.5, -0.375, -0.5, 0.25, -0.25, 0.5}, + {-0.5, -0.25, -0.5, 0, -0.125, 0.5}, + {-0.5, -0.25, 0, 0.5, -0.125, 0.5}, + {-0.5, -0.125, 0.25, 0.5, 0, 0.5}, + {-0.5, -0.125, -0.5, -0.25, 0, 0.5}, + } +} + +local box_slope_inner_half_raised = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5}, + {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5}, + {-0.5, 0.125, -0.5, 0.25, 0.25, 0.5}, + {-0.5, 0.25, -0.5, 0, 0.375, 0.5}, + {-0.5, 0.25, 0, 0.5, 0.375, 0.5}, + {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5}, + {-0.5, 0.375, -0.5, -0.25, 0.5, 0.5}, + } +} + +--============================================================== + +local box_slope_outer = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, + {-0.5, -0.25, -0.25, 0.25, 0, 0.5}, + {-0.5, 0, 0, 0, 0.25, 0.5}, + {-0.5, 0.25, 0.25, -0.25, 0.5, 0.5} + } +} + +local box_slope_outer_half = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, + {-0.5, -0.375, -0.25, 0.25, -0.25, 0.5}, + {-0.5, -0.25, 0, 0, -0.125, 0.5}, + {-0.5, -0.125, 0.25, -0.25, 0, 0.5} + } +} + +local box_slope_outer_half_raised = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5}, + {-0.5, 0.125, -0.25, 0.25, 0.25, 0.5}, + {-0.5, 0.25, 0, 0, 0.375, 0.5}, + {-0.5, 0.375, 0.25, -0.25, 0.5, 0.5} + } +} + +stairsplus.defs = { + ["micro"] = { + [""] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0, 0, 0.5}, + }, + }, + ["_1"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0, -0.4375, 0.5}, + }, + }, + ["_2"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0, -0.375, 0.5}, + }, + }, + ["_4"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0, -0.25, 0.5}, + }, + }, + ["_12"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0, 0.25, 0.5}, + }, + }, + ["_14"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0, 0.375, 0.5}, + }, + }, + ["_15"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0, 0.4375, 0.5}, + }, + } + }, + ["panel"] = { + [""] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5}, + }, + }, + ["_1"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0.5, -0.4375, 0.5}, + }, + }, + ["_2"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0.5, -0.375, 0.5}, + }, + }, + ["_4"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0.5, -0.25, 0.5}, + }, + }, + ["_12"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0.5, 0.25, 0.5}, + }, + }, + ["_14"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0.5, 0.375, 0.5}, + }, + }, + ["_15"] = { + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0.5, 0.4375, 0.5}, + }, + } + }, + ["slab"] = { + [""] = 8, + ["_quarter"] = 4, + ["_three_quarter"] = 12, + ["_1"] = 1, + ["_2"] = 2, + ["_14"] = 14, + ["_15"] = 15, + ["_two_sides"] = { + { -0.5, -0.5, -0.5, 0.5, -7/16, 7/16 }, + { -0.5, -0.5, 7/16, 0.5, 0.5, 0.5 } + }, + ["_three_sides"] = { + { -7/16, -0.5, -0.5, 0.5, -7/16, 7/16 }, + { -7/16, -0.5, 7/16, 0.5, 0.5, 0.5 }, + { -0.5, -0.5, -0.5, -7/16, 0.5, 0.5 } + }, + ["_three_sides_u"] = { + { -0.5, -0.5, -0.5, 0.5, 0.5, -7/16 }, + { -0.5, -0.5, -7/16, 0.5, -7/16, 7/16 }, + { -0.5, -0.5, 7/16, 0.5, 0.5, 0.5 } + } + }, + ["slope"] = { + [""] = { + mesh = "moreblocks_slope.obj", + collision_box = box_slope, + selection_box = box_slope, + + }, + ["_half"] = { + mesh = "moreblocks_slope_half.obj", + collision_box = box_slope_half, + selection_box = box_slope_half, + }, + ["_half_raised"] = { + mesh = "moreblocks_slope_half_raised.obj", + collision_box = box_slope_half_raised, + selection_box = box_slope_half_raised, + }, + + --============================================================== + + ["_inner"] = { + mesh = "moreblocks_slope_inner.obj", + collision_box = box_slope_inner, + selection_box = box_slope_inner, + }, + ["_inner_half"] = { + mesh = "moreblocks_slope_inner_half.obj", + collision_box = box_slope_inner_half, + selection_box = box_slope_inner_half, + }, + ["_inner_half_raised"] = { + mesh = "moreblocks_slope_inner_half_raised.obj", + collision_box = box_slope_inner_half_raised, + selection_box = box_slope_inner_half_raised, + }, + + --============================================================== + + ["_inner_cut"] = { + mesh = "moreblocks_slope_inner_cut.obj", + collision_box = box_slope_inner, + selection_box = box_slope_inner, + }, + ["_inner_cut_half"] = { + mesh = "moreblocks_slope_inner_cut_half.obj", + collision_box = box_slope_inner_half, + selection_box = box_slope_inner_half, + }, + ["_inner_cut_half_raised"] = { + mesh = "moreblocks_slope_inner_cut_half_raised.obj", + collision_box = box_slope_inner_half_raised, + selection_box = box_slope_inner_half_raised, + }, + + --============================================================== + + ["_outer"] = { + mesh = "moreblocks_slope_outer.obj", + collision_box = box_slope_outer, + selection_box = box_slope_outer, + }, + ["_outer_half"] = { + mesh = "moreblocks_slope_outer_half.obj", + collision_box = box_slope_outer_half, + selection_box = box_slope_outer_half, + }, + ["_outer_half_raised"] = { + mesh = "moreblocks_slope_outer_half_raised.obj", + collision_box = box_slope_outer_half_raised, + selection_box = box_slope_outer_half_raised, + }, + + --============================================================== + + ["_outer_cut"] = { + mesh = "moreblocks_slope_outer_cut.obj", + collision_box = box_slope_outer, + selection_box = box_slope_outer, + }, + ["_outer_cut_half"] = { + mesh = "moreblocks_slope_outer_cut_half.obj", + collision_box = box_slope_outer_half, + selection_box = box_slope_outer_half, + }, + ["_outer_cut_half_raised"] = { + mesh = "moreblocks_slope_outer_cut_half_raised.obj", + collision_box = box_slope_outer_half_raised, + selection_box = box_slope_outer_half_raised, + }, + ["_cut"] = { + mesh = "moreblocks_slope_cut.obj", + collision_box = box_slope_outer, + selection_box = box_slope_outer, + }, + }, + ["stair"] = { + [""] = { + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0.5, 0.5, 0.5}, + }, + }, + }, + ["_half"] = { + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0, 0, 0.5}, + {-0.5, 0, 0, 0, 0.5, 0.5}, + }, + }, + }, + ["_right_half"] = { + node_box = { + type = "fixed", + fixed = { + {0, -0.5, -0.5, 0.5, 0, 0.5}, + {0, 0, 0, 0.5, 0.5, 0.5}, + }, + }, + }, + ["_inner"] = { + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0.5, 0.5, 0.5}, + {-0.5, 0, -0.5, 0, 0.5, 0}, + }, + }, + }, + ["_outer"] = { + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0, 0.5, 0.5}, + }, + }, + }, + ["_alt"] = { + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0}, + {-0.5, 0, 0, 0.5, 0.5, 0.5}, + }, + }, + }, + ["_alt_1"] = { + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.0625, -0.5, 0.5, 0, 0}, + {-0.5, 0.4375, 0, 0.5, 0.5, 0.5}, + }, + }, + }, + ["_alt_2"] = { + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.125, -0.5, 0.5, 0, 0}, + {-0.5, 0.375, 0, 0.5, 0.5, 0.5}, + }, + }, + }, + ["_alt_4"] = { + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.25, -0.5, 0.5, 0, 0}, + {-0.5, 0.25, 0, 0.5, 0.5, 0.5}, + }, + }, + }, + }, +} + +for type,a in pairs(stairsplus.defs) do + for name,b in pairs(stairsplus.defs[type]) do + table.insert(stairsplus.shapes_list, { type .. "_", name }) + end +end
\ No newline at end of file diff --git a/moreblocks/stairsplus/init.lua b/moreblocks/stairsplus/init.lua index 5cd415c..4f3a17e 100644 --- a/moreblocks/stairsplus/init.lua +++ b/moreblocks/stairsplus/init.lua @@ -5,7 +5,7 @@ Copyright (c) 2011-2017 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] --- Nodes will be called <modname>:{stair,slab,panel,micro}_<subname> +-- Nodes will be called <modname>:{stair,slab,panel,micro,slope}_<subname> local modpath = minetest.get_modpath("moreblocks").. "/stairsplus" @@ -19,21 +19,6 @@ and minetest.settings:get_bool("creative_mode") then stairsplus.expect_infinite_stacks = true end -function stairsplus.copytable(orig) - local orig_type = type(orig) - local copy - if orig_type == 'table' then - copy = {} - for orig_key, orig_value in next, orig, nil do - copy[stairsplus.copytable(orig_key)] = stairsplus.copytable(orig_value) - end - setmetatable(copy, stairsplus.copytable(getmetatable(orig))) - else - copy = orig - end - return copy -end - function stairsplus:prepare_groups(groups) local result = {} if groups then @@ -85,9 +70,13 @@ end -- dofile(modpath.. "/aliases.lua") -- Not needed as of Q2 2013, uncomment to fix old maps. -- dofile(modpath.. "/conversion.lua") -- Not needed as of Q2 2013, uncomment to fix old maps. +dofile(modpath .. "/defs.lua") +dofile(modpath .. "/recipes.lua") +dofile(modpath .. "/common.lua") dofile(modpath .. "/stairs.lua") dofile(modpath .. "/slabs.lua") dofile(modpath .. "/slopes.lua") dofile(modpath .. "/panels.lua") dofile(modpath .. "/microblocks.lua") +dofile(modpath .. "/custom.lua") dofile(modpath .. "/registrations.lua") diff --git a/moreblocks/stairsplus/microblocks.lua b/moreblocks/stairsplus/microblocks.lua index 50d8487..22c20a3 100644 --- a/moreblocks/stairsplus/microblocks.lua +++ b/moreblocks/stairsplus/microblocks.lua @@ -20,138 +20,25 @@ function register_micro(modname, subname, recipeitem, groups, images, descriptio }) end -local microblocks_defs = { - [""] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0, 0, 0.5}, - }, - }, - ["_1"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0, -0.4375, 0.5}, - }, - }, - ["_2"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0, -0.375, 0.5}, - }, - }, - ["_4"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0, -0.25, 0.5}, - }, - }, - ["_12"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0, 0.25, 0.5}, - }, - }, - ["_14"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0, 0.375, 0.5}, - }, - }, - ["_15"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0, 0.4375, 0.5}, - }, - } -} - -for k,v in pairs(microblocks_defs) do - table.insert(stairsplus.shapes_list, { "micro_", k }) -end - function stairsplus:register_micro_alias(modname_old, subname_old, modname_new, subname_new) - local defs = stairsplus.copytable(microblocks_defs) + local defs = table.copy(stairsplus.defs["micro"]) for alternate, def in pairs(defs) do minetest.register_alias(modname_old .. ":micro_" .. subname_old .. alternate, modname_new .. ":micro_" .. subname_new .. alternate) end end function stairsplus:register_micro_alias_force(modname_old, subname_old, modname_new, subname_new) - local defs = stairsplus.copytable(microblocks_defs) + local defs = table.copy(stairsplus.defs["micro"]) for alternate, def in pairs(defs) do minetest.register_alias_force(modname_old .. ":micro_" .. subname_old .. alternate, modname_new .. ":micro_" .. subname_new .. alternate) end end function stairsplus:register_micro(modname, subname, recipeitem, fields) - local defs = stairsplus.copytable(microblocks_defs) - local desc = S("%s Microblock"):format(fields.description) + local defs = table.copy(stairsplus.defs["micro"]) for alternate, def in pairs(defs) do - for k, v in pairs(fields) do - def[k] = v - end - def.drawtype = "nodebox" - def.paramtype = "light" - def.paramtype2 = def.paramtype2 or "facedir" - def.on_place = minetest.rotate_node - def.groups = stairsplus:prepare_groups(fields.groups) - def.description = desc - if fields.drop and not (type(fields.drop) == "table") then - def.drop = modname.. ":micro_" ..fields.drop..alternate - end - minetest.register_node(":" ..modname.. ":micro_" ..subname..alternate, def) + stairsplus.register_single("micro", alternate, def, modname, subname, recipeitem, fields) end - minetest.register_alias(modname.. ":micro_" ..subname.. "_bottom", modname.. ":micro_" ..subname) circular_saw.known_nodes[recipeitem] = {modname, subname} - - -- Some saw-less recipes: - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":micro_" .. subname .. " 7", - recipe = {modname .. ":stair_" .. subname .. "_inner"}, - }) - - minetest.register_craft({ - output = modname .. ":micro_" .. subname .. " 6", - type = "shapeless", - recipe = {modname .. ":stair_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":micro_" .. subname .. " 5", - recipe = {modname .. ":stair_" .. subname .. "_outer"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":micro_" .. subname .. " 4", - recipe = {modname .. ":slab_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":micro_" .. subname .. " 4", - recipe = {modname .. ":stair_" .. subname .. "_alt"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":micro_" .. subname .. " 3", - recipe = {modname .. ":stair_" .. subname .. "_right_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":micro_" .. subname .. " 2", - recipe = {modname .. ":panel_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, - }) end diff --git a/moreblocks/stairsplus/panels.lua b/moreblocks/stairsplus/panels.lua index 98e77fd..ac641d8 100644 --- a/moreblocks/stairsplus/panels.lua +++ b/moreblocks/stairsplus/panels.lua @@ -20,118 +20,25 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio }) end -local panels_defs = { - [""] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5}, - }, - }, - ["_1"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0.5, -0.4375, 0.5}, - }, - }, - ["_2"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0.5, -0.375, 0.5}, - }, - }, - ["_4"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0.5, -0.25, 0.5}, - }, - }, - ["_12"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0.5, 0.25, 0.5}, - }, - }, - ["_14"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0.5, 0.375, 0.5}, - }, - }, - ["_15"] = { - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0.5, 0.4375, 0.5}, - }, - } -} - -for k,v in pairs(panels_defs) do - table.insert(stairsplus.shapes_list, { "panel_", k }) -end - function stairsplus:register_panel_alias(modname_old, subname_old, modname_new, subname_new) - local defs = stairsplus.copytable(panels_defs) + local defs = table.copy(stairsplus.defs["panel"]) for alternate, def in pairs(defs) do minetest.register_alias(modname_old .. ":panel_" .. subname_old .. alternate, modname_new .. ":panel_" .. subname_new .. alternate) end end function stairsplus:register_panel_alias_force(modname_old, subname_old, modname_new, subname_new) - local defs = stairsplus.copytable(panels_defs) + local defs = table.copy(stairsplus.defs["panel"]) for alternate, def in pairs(defs) do minetest.register_alias_force(modname_old .. ":panel_" .. subname_old .. alternate, modname_new .. ":panel_" .. subname_new .. alternate) end end function stairsplus:register_panel(modname, subname, recipeitem, fields) - local defs = stairsplus.copytable(panels_defs) - local desc = S("%s Panel"):format(fields.description) + local defs = table.copy(stairsplus.defs["panel"]) for alternate, def in pairs(defs) do - for k, v in pairs(fields) do - def[k] = v - end - def.drawtype = "nodebox" - def.paramtype = "light" - def.paramtype2 = def.paramtype2 or "facedir" - def.on_place = minetest.rotate_node - def.description = desc - def.groups = stairsplus:prepare_groups(fields.groups) - if fields.drop and not (type(fields.drop) == "table") then - def.drop = modname.. ":panel_" ..fields.drop..alternate - end - minetest.register_node(":" ..modname.. ":panel_" ..subname..alternate, def) + stairsplus.register_single("panel", alternate, def, modname, subname, recipeitem, fields) end - minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname) circular_saw.known_nodes[recipeitem] = {modname, subname} - - -- Some saw-less recipes: - - minetest.register_craft({ - output = modname .. ":panel_" .. subname .. " 12", - recipe = { - {recipeitem, ""}, - {recipeitem, recipeitem}, - }, - }) - - minetest.register_craft({ - output = modname .. ":panel_" .. subname .. " 12", - recipe = { - {"", recipeitem}, - {recipeitem, recipeitem}, - }, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":panel_" .. subname, - recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}, - }) end diff --git a/moreblocks/stairsplus/recipes.lua b/moreblocks/stairsplus/recipes.lua new file mode 100644 index 0000000..56fcf68 --- /dev/null +++ b/moreblocks/stairsplus/recipes.lua @@ -0,0 +1,443 @@ +--[[ +More Blocks: Stairs+ + +Copyright (c) 2011-2017 Hugo Locurcio and contributors. +Licensed under the zlib license. See LICENSE.md for more information. +--]] + + +stairsplus.register_recipes = function(category, alternate, modname, subname, recipeitem) + if category == "micro" and alternate == "" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":micro_" .. subname .. " 7", + recipe = {modname .. ":stair_" .. subname .. "_inner"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":micro_" .. subname .. " 6", + recipe = {modname .. ":stair_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":micro_" .. subname .. " 5", + recipe = {modname .. ":stair_" .. subname .. "_outer"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":micro_" .. subname .. " 4", + recipe = {modname .. ":slab_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":micro_" .. subname .. " 4", + recipe = {modname .. ":stair_" .. subname .. "_alt"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":micro_" .. subname .. " 3", + recipe = {modname .. ":stair_" .. subname .. "_right_half"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":micro_" .. subname .. " 2", + recipe = {modname .. ":panel_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, + }) + + minetest.register_alias(modname .. ":micro_" .. subname .. "_bottom", modname .. ":micro_" .. subname) + elseif category == "panel" and alternate == "" then + minetest.register_craft({ + output = modname .. ":panel_" .. subname .. " 12", + recipe = { + {recipeitem, ""}, + {recipeitem, recipeitem}, + }, + }) + + minetest.register_craft({ + output = modname .. ":panel_" .. subname .. " 12", + recipe = { + {"", recipeitem}, + {recipeitem, recipeitem}, + }, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":panel_" .. subname, + recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}, + }) + + minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname) + elseif category == "slab" then + if alternate == "" then + minetest.register_craft({ + output = modname .. ":slab_" .. subname .. " 6", + recipe = {{recipeitem, recipeitem, recipeitem}}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname, + recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, + }) + + -- uncomment this rule when conflict is no longer likely to happen + -- https://github.com/minetest/minetest/issues/2881 + -- minetest.register_craft({ + -- type = "shapeless", + -- output = modname .. ":slab_" .. subname, + -- recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}, + -- }) + + -- then remove these two + minetest.register_craft({ + output = modname .. ":slab_" .. subname, + recipe = {{modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}}, + }) + + minetest.register_craft({ + output = modname .. ":slab_" .. subname, + recipe = { + {modname .. ":panel_" .. subname}, + {modname .. ":panel_" .. subname}, + }, + }) + ------------------------------ + + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname .. " 3", + recipe = {modname .. ":stair_" .. subname, modname .. ":stair_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname, + recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname, + recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname, + recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname, + recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname, + recipe = {modname .. ":slope_" .. subname .. "_outer_half", modname .. ":slope_" .. subname .. "_inner_half"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname, + recipe = {modname .. ":slope_" .. subname .. "_outer_cut_half", modname .. ":slope_" .. subname .. "_inner_cut_half"}, + }) + elseif alternate == "_quarter" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slab_" .. subname .. "_three_quarter", modname .. ":slab_" .. subname .. "_quarter"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname .. "_quarter", + recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname .. "_quarter", + recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"}, + }) + elseif alternate == "_three_quarter" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname .. "_three_quarter", + recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname .. "_quarter"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname .. "_three_quarter", + recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname .. "_three_quarter", + recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"}, + }) + elseif alternate == "_2" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slab_" .. subname .. "_14", modname .. ":slab_" .. subname .. "_2"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname .. "_2", + recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"}, + }) + elseif alternate == "_14" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname .. "_14", + recipe = {modname .. ":slab_" .. subname .. "_three_quarter", modname .. ":slab_" .. subname .. "_2"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname .. "_14", + recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"}, + }) + elseif alternate == "_15" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slab_" .. subname .. "_15", modname .. ":slab_" .. subname .. "_1"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slab_" .. subname .. "_15", + recipe = {modname .. ":slab_" .. subname .. "_14", modname .. ":slab_" .. subname .. "_1"}, + }) + end + elseif category == "slope" then + if alternate == "" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slope_" .. subname, modname .. ":slope_" .. subname}, + }) + elseif alternate == "_half" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half_raised"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half", + modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"}, + }) + elseif alternate == "_outer" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slope_" .. subname .. "_outer", modname .. ":slope_" .. subname .. "_inner"}, + }) + elseif alternate == "_outer_half" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slope_" .. subname .. "_outer_half", modname .. ":slope_" .. subname .. "_inner_half_raised"}, + }) + elseif alternate == "_inner_half" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slope_" .. subname .. "_outer_half_raised", modname .. ":slope_" .. subname .. "_inner_half"}, + }) + elseif alternate == "_outer_cut" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slope_" .. subname .. "_outer_cut", modname .. ":slope_" .. subname .. "_inner_cut"}, + }) + elseif alternate == "_outer_cut_half" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slope_" .. subname .. "_outer_cut_half", modname .. ":slope_" .. subname .. "_inner_cut_half_raised"}, + }) + elseif alternate == "_cut" then + minetest.register_craft({ + type = "shapeless", + output = recipeitem, + recipe = {modname .. ":slope_" .. subname .. "_cut", modname .. ":slope_" .. subname .. "_cut"}, + }) + elseif alternate == "_half_raised" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slope_" .. subname .. "_half_raised", + recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half", + modname .. ":slope_" .. subname .. "_half"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slope_" .. subname .. "_half_raised", + recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_half"}, + }) + elseif alternate == "_inner_half_raised" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slope_" .. subname .. "_inner_half_raised", + recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_half"}, + }) + elseif alternate == "_outer_half_raised" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slope_" .. subname .. "_outer_half_raised", + recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_outer_half"}, + }) + elseif alternate == "_inner_cut_half_raised" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":slope_" .. subname .. "_inner_cut_half_raised", + recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_cut_half"}, + }) + end + elseif category == "stair" then + if alternate == "" then + minetest.register_craft({ + output = modname .. ":stair_" .. subname .. " 8", + recipe = { + {recipeitem, "", ""}, + {recipeitem, recipeitem, ""}, + {recipeitem, recipeitem, recipeitem}, + }, + }) + + minetest.register_craft({ + output = modname .. ":stair_" .. subname .. " 8", + recipe = { + {"", "", recipeitem}, + {"", recipeitem, recipeitem}, + {recipeitem, recipeitem, recipeitem}, + }, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":stair_" .. subname, + recipe = {modname .. ":panel_" .. subname, modname .. ":slab_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":stair_" .. subname, + recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":stair_" .. subname, + recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":stair_" .. subname, + recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}, + }) + elseif alternate == "_inner" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":stair_" .. subname .. "_inner", + recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, + }) + elseif alternate == "_outer" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":stair_" .. subname .. "_outer", + recipe = {modname .. ":micro_" .. subname, modname .. ":slab_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":stair_" .. subname .. "_outer", + recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, + }) + elseif alternate == "_half" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":stair_" .. subname .. "_half", + recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = modname .. ":stair_" .. subname .. "_half", + recipe = {modname .. ":panel_" .. subname, modname .. ":micro_" .. subname}, + }) + elseif alternate == "_right_half" then + minetest.register_craft({ + type = "shapeless", + output = modname .. ":stair_" .. subname .. "_right_half", + recipe = {modname .. ":stair_" .. subname .. "_half"}, + }) + elseif alternate == "_alt" then + minetest.register_craft({ -- See mirrored variation of the recipe below. + output = modname .. ":stair_" .. subname .. "_alt", + recipe = { + {modname .. ":panel_" .. subname, ""}, + {"" , modname .. ":panel_" .. subname}, + }, + }) + + minetest.register_craft({ -- Mirrored variation of the recipe above. + output = modname .. ":stair_" .. subname .. "_alt", + recipe = { + {"" , modname .. ":panel_" .. subname}, + {modname .. ":panel_" .. subname, ""}, + }, + }) + end + end +end
\ No newline at end of file diff --git a/moreblocks/stairsplus/slabs.lua b/moreblocks/stairsplus/slabs.lua index de7f031..3fa119e 100644 --- a/moreblocks/stairsplus/slabs.lua +++ b/moreblocks/stairsplus/slabs.lua @@ -20,235 +20,26 @@ function register_slab(modname, subname, recipeitem, groups, images, description }) end -local slabs_defs = { - [""] = 8, - ["_quarter"] = 4, - ["_three_quarter"] = 12, - ["_1"] = 1, - ["_2"] = 2, - ["_14"] = 14, - ["_15"] = 15, - ["_two_sides"] = { - { -0.5, -0.5, -0.5, 0.5, -7/16, 7/16 }, - { -0.5, -0.5, 7/16, 0.5, 0.5, 0.5 } - }, - ["_three_sides"] = { - { -7/16, -0.5, -0.5, 0.5, -7/16, 7/16 }, - { -7/16, -0.5, 7/16, 0.5, 0.5, 0.5 }, - { -0.5, -0.5, -0.5, -7/16, 0.5, 0.5 } - }, - ["_three_sides_u"] = { - { -0.5, -0.5, -0.5, 0.5, 0.5, -7/16 }, - { -0.5, -0.5, -7/16, 0.5, -7/16, 7/16 }, - { -0.5, -0.5, 7/16, 0.5, 0.5, 0.5 } - } -} - -for k,v in pairs(slabs_defs) do - table.insert(stairsplus.shapes_list, { "slab_", k }) -end - function stairsplus:register_slab_alias(modname_old, subname_old, modname_new, subname_new) - local defs = stairsplus.copytable(slabs_defs) + local defs = table.copy(stairsplus.defs["slab"]) for alternate, def in pairs(defs) do minetest.register_alias(modname_old .. ":slab_" .. subname_old .. alternate, modname_new .. ":slab_" .. subname_new .. alternate) end end function stairsplus:register_slab_alias_force(modname_old, subname_old, modname_new, subname_new) - local defs = stairsplus.copytable(slabs_defs) + local defs = table.copy(stairsplus.defs["slab"]) for alternate, def in pairs(defs) do minetest.register_alias_force(modname_old .. ":slab_" .. subname_old .. alternate, modname_new .. ":slab_" .. subname_new .. alternate) end end function stairsplus:register_slab(modname, subname, recipeitem, fields) - local defs = stairsplus.copytable(slabs_defs) + local defs = table.copy(stairsplus.defs["slab"]) local desc_base = S("%s Slab"):format(fields.description) for alternate, shape in pairs(defs) do - local def = {} - for k, v in pairs(fields) do - def[k] = v - end - if type(shape) ~= "table" then - def.node_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, (shape/16)-0.5, 0.5}, - } - def.description = ("%s (%d/16)"):format(desc_base, shape) - else - def.node_box = { - type = "fixed", - fixed = shape, - } - local desc_x = alternate:gsub("_", " ") - desc_x = desc_x:gsub("(%a)(%S*)", function(a, b) return a:upper() .. b end) - def.description = desc_base .. desc_x - end - - def.drawtype = "nodebox" - def.paramtype = "light" - def.paramtype2 = def.paramtype2 or "facedir" - def.on_place = minetest.rotate_node - def.groups = stairsplus:prepare_groups(fields.groups) - if alternate == "" then - def.groups.slab = 1 - end - if fields.drop and not (type(fields.drop) == "table") then - def.drop = modname.. ":slab_" .. fields.drop .. alternate - end - minetest.register_node(":" .. modname .. ":slab_" .. subname .. alternate, def) + stairsplus.register_single("slab", alternate, shape, modname, subname, recipeitem, fields) end circular_saw.known_nodes[recipeitem] = {modname, subname} - - -- Some saw-less recipes: - - minetest.register_craft({ - output = modname .. ":slab_" .. subname .. " 6", - recipe = {{recipeitem, recipeitem, recipeitem}}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname, - recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, - }) - - -- uncomment this rule when conflict is no longer likely to happen - -- https://github.com/minetest/minetest/issues/2881 - -- minetest.register_craft({ - -- type = "shapeless", - -- output = modname .. ":slab_" .. subname, - -- recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}, - -- }) - - -- then remove these two - minetest.register_craft({ - output = modname .. ":slab_" .. subname, - recipe = {{modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}}, - }) - - minetest.register_craft({ - output = modname .. ":slab_" .. subname, - recipe = { - {modname .. ":panel_" .. subname}, - {modname .. ":panel_" .. subname}, - }, - }) - ------------------------------ - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slab_" .. subname .. "_three_quarter", modname .. ":slab_" .. subname .. "_quarter"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slab_" .. subname .. "_14", modname .. ":slab_" .. subname .. "_2"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slab_" .. subname .. "_15", modname .. ":slab_" .. subname .. "_1"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname, - recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname, - recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname, - recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname .. "_quarter", - recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname .. "_quarter", - recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname .. "_2", - recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname .. "_three_quarter", - recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname .. "_quarter"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname .. "_three_quarter", - recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname .. "_three_quarter", - recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname .. "_14", - recipe = {modname .. ":slab_" .. subname .. "_three_quarter", modname .. ":slab_" .. subname .. "_2"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname .. "_14", - recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname .. "_15", - recipe = {modname .. ":slab_" .. subname .. "_14", modname .. ":slab_" .. subname .. "_1"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname .. " 3", - recipe = {modname .. ":stair_" .. subname, modname .. ":stair_" .. subname}, - }) end diff --git a/moreblocks/stairsplus/slopes.lua b/moreblocks/stairsplus/slopes.lua index 7d18b3d..7b82733 100644 --- a/moreblocks/stairsplus/slopes.lua +++ b/moreblocks/stairsplus/slopes.lua @@ -7,109 +7,6 @@ Licensed under the zlib license. See LICENSE.md for more information. local S = moreblocks.intllib -local box_slope = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, - {-0.5, -0.25, -0.25, 0.5, 0, 0.5}, - {-0.5, 0, 0, 0.5, 0.25, 0.5}, - {-0.5, 0.25, 0.25, 0.5, 0.5, 0.5} - } -} - -local box_slope_half = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, - {-0.5, -0.375, -0.25, 0.5, -0.25, 0.5}, - {-0.5, -0.25, 0, 0.5, -0.125, 0.5}, - {-0.5, -0.125, 0.25, 0.5, 0, 0.5}, - } -} - -local box_slope_half_raised = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5}, - {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5}, - {-0.5, 0.25, 0, 0.5, 0.375, 0.5}, - {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5}, - } -} - ---============================================================== - -local box_slope_inner = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, - {-0.5, -0.5, -0.25, 0.5, 0, 0.5}, - {-0.5, -0.5, -0.5, 0.25, 0, 0.5}, - {-0.5, 0, -0.5, 0, 0.25, 0.5}, - {-0.5, 0, 0, 0.5, 0.25, 0.5}, - {-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}, - {-0.5, 0.25, -0.5, -0.25, 0.5, 0.5}, - } -} - -local box_slope_inner_half = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, - {-0.5, -0.375, -0.25, 0.5, -0.25, 0.5}, - {-0.5, -0.375, -0.5, 0.25, -0.25, 0.5}, - {-0.5, -0.25, -0.5, 0, -0.125, 0.5}, - {-0.5, -0.25, 0, 0.5, -0.125, 0.5}, - {-0.5, -0.125, 0.25, 0.5, 0, 0.5}, - {-0.5, -0.125, -0.5, -0.25, 0, 0.5}, - } -} - -local box_slope_inner_half_raised = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5}, - {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5}, - {-0.5, 0.125, -0.5, 0.25, 0.25, 0.5}, - {-0.5, 0.25, -0.5, 0, 0.375, 0.5}, - {-0.5, 0.25, 0, 0.5, 0.375, 0.5}, - {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5}, - {-0.5, 0.375, -0.5, -0.25, 0.5, 0.5}, - } -} - ---============================================================== - -local box_slope_outer = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, - {-0.5, -0.25, -0.25, 0.25, 0, 0.5}, - {-0.5, 0, 0, 0, 0.25, 0.5}, - {-0.5, 0.25, 0.25, -0.25, 0.5, 0.5} - } -} - -local box_slope_outer_half = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, - {-0.5, -0.375, -0.25, 0.25, -0.25, 0.5}, - {-0.5, -0.25, 0, 0, -0.125, 0.5}, - {-0.5, -0.125, 0.25, -0.25, 0, 0.5} - } -} - -local box_slope_outer_half_raised = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5}, - {-0.5, 0.125, -0.25, 0.25, 0.25, 0.5}, - {-0.5, 0.25, 0, 0, 0.375, 0.5}, - {-0.5, 0.375, 0.25, -0.25, 0.5, 0.5} - } -} - -- Node will be called <modname>:slope_<subname> function register_slope(modname, subname, recipeitem, groups, images, description, drop, light) @@ -123,244 +20,25 @@ function register_slope(modname, subname, recipeitem, groups, images, descriptio }) end -local slopes_defs = { - [""] = { - mesh = "moreblocks_slope.obj", - collision_box = box_slope, - selection_box = box_slope, - - }, - ["_half"] = { - mesh = "moreblocks_slope_half.obj", - collision_box = box_slope_half, - selection_box = box_slope_half, - }, - ["_half_raised"] = { - mesh = "moreblocks_slope_half_raised.obj", - collision_box = box_slope_half_raised, - selection_box = box_slope_half_raised, - }, - - --============================================================== - - ["_inner"] = { - mesh = "moreblocks_slope_inner.obj", - collision_box = box_slope_inner, - selection_box = box_slope_inner, - }, - ["_inner_half"] = { - mesh = "moreblocks_slope_inner_half.obj", - collision_box = box_slope_inner_half, - selection_box = box_slope_inner_half, - }, - ["_inner_half_raised"] = { - mesh = "moreblocks_slope_inner_half_raised.obj", - collision_box = box_slope_inner_half_raised, - selection_box = box_slope_inner_half_raised, - }, - - --============================================================== - - ["_inner_cut"] = { - mesh = "moreblocks_slope_inner_cut.obj", - collision_box = box_slope_inner, - selection_box = box_slope_inner, - }, - ["_inner_cut_half"] = { - mesh = "moreblocks_slope_inner_cut_half.obj", - collision_box = box_slope_inner_half, - selection_box = box_slope_inner_half, - }, - ["_inner_cut_half_raised"] = { - mesh = "moreblocks_slope_inner_cut_half_raised.obj", - collision_box = box_slope_inner_half_raised, - selection_box = box_slope_inner_half_raised, - }, - - --============================================================== - - ["_outer"] = { - mesh = "moreblocks_slope_outer.obj", - collision_box = box_slope_outer, - selection_box = box_slope_outer, - }, - ["_outer_half"] = { - mesh = "moreblocks_slope_outer_half.obj", - collision_box = box_slope_outer_half, - selection_box = box_slope_outer_half, - }, - ["_outer_half_raised"] = { - mesh = "moreblocks_slope_outer_half_raised.obj", - collision_box = box_slope_outer_half_raised, - selection_box = box_slope_outer_half_raised, - }, - - --============================================================== - - ["_outer_cut"] = { - mesh = "moreblocks_slope_outer_cut.obj", - collision_box = box_slope_outer, - selection_box = box_slope_outer, - }, - ["_outer_cut_half"] = { - mesh = "moreblocks_slope_outer_cut_half.obj", - collision_box = box_slope_outer_half, - selection_box = box_slope_outer_half, - }, - ["_outer_cut_half_raised"] = { - mesh = "moreblocks_slope_outer_cut_half_raised.obj", - collision_box = box_slope_outer_half_raised, - selection_box = box_slope_outer_half_raised, - }, - ["_cut"] = { - mesh = "moreblocks_slope_cut.obj", - collision_box = box_slope_outer, - selection_box = box_slope_outer, - }, -} - -for k,v in pairs(slopes_defs) do - table.insert(stairsplus.shapes_list, { "slope_", k }) -end - function stairsplus:register_slope_alias(modname_old, subname_old, modname_new, subname_new) - local defs = stairsplus.copytable(slopes_defs) + local defs = table.copy(stairsplus.defs["slope"]) for alternate, def in pairs(defs) do minetest.register_alias(modname_old .. ":slope_" .. subname_old .. alternate, modname_new .. ":slope_" .. subname_new .. alternate) end end function stairsplus:register_slope_alias_force(modname_old, subname_old, modname_new, subname_new) - local defs = stairsplus.copytable(slopes_defs) + local defs = table.copy(stairsplus.defs["slope"]) for alternate, def in pairs(defs) do minetest.register_alias_force(modname_old .. ":slope_" .. subname_old .. alternate, modname_new .. ":slope_" .. subname_new .. alternate) end end function stairsplus:register_slope(modname, subname, recipeitem, fields) - local defs = stairsplus.copytable(slopes_defs) - local desc = S("%s Slope"):format(fields.description) + local defs = table.copy(stairsplus.defs["slope"]) for alternate, def in pairs(defs) do - for k, v in pairs(fields) do - def[k] = v - end - def.drawtype = "mesh" - def.paramtype = "light" - def.paramtype2 = def.paramtype2 or "facedir" - def.on_place = minetest.rotate_node - def.description = desc - def.groups = stairsplus:prepare_groups(fields.groups) - if fields.drop and not (type(fields.drop) == "table") then - def.drop = modname.. ":slope_" ..fields.drop..alternate - end - minetest.register_node(":" ..modname.. ":slope_" ..subname..alternate, def) + stairsplus.register_single("slope", alternate, def, modname, subname, recipeitem, fields) end circular_saw.known_nodes[recipeitem] = {modname, subname} - - -- Some saw-less recipes: - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slope_" .. subname, modname .. ":slope_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half_raised"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half", - modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slope_" .. subname .. "_outer", modname .. ":slope_" .. subname .. "_inner"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slope_" .. subname .. "_outer_half", modname .. ":slope_" .. subname .. "_inner_half_raised"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slope_" .. subname .. "_outer_half_raised", modname .. ":slope_" .. subname .. "_inner_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slope_" .. subname .. "_outer_cut", modname .. ":slope_" .. subname .. "_inner_cut"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slope_" .. subname .. "_outer_cut_half", modname .. ":slope_" .. subname .. "_inner_cut_half_raised"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = recipeitem, - recipe = {modname .. ":slope_" .. subname .. "_cut", modname .. ":slope_" .. subname .. "_cut"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname, - recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname, - recipe = {modname .. ":slope_" .. subname .. "_outer_half", modname .. ":slope_" .. subname .. "_inner_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slab_" .. subname, - recipe = {modname .. ":slope_" .. subname .. "_outer_cut_half", modname .. ":slope_" .. subname .. "_inner_cut_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slope_" .. subname .. "_half_raised", - recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half", - modname .. ":slope_" .. subname .. "_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slope_" .. subname .. "_half_raised", - recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slope_" .. subname .. "_inner_half_raised", - recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slope_" .. subname .. "_outer_half_raised", - recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_outer_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":slope_" .. subname .. "_inner_cut_half_raised", - recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_cut_half"}, - }) end diff --git a/moreblocks/stairsplus/stairs.lua b/moreblocks/stairsplus/stairs.lua index 815f7ac..5c38864 100644 --- a/moreblocks/stairsplus/stairs.lua +++ b/moreblocks/stairsplus/stairs.lua @@ -20,226 +20,25 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio }) end -local stairs_defs = { - [""] = { - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, - {-0.5, 0, 0, 0.5, 0.5, 0.5}, - }, - }, - }, - ["_half"] = { - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0, 0, 0.5}, - {-0.5, 0, 0, 0, 0.5, 0.5}, - }, - }, - }, - ["_right_half" ]= { - node_box = { - type = "fixed", - fixed = { - {0, -0.5, -0.5, 0.5, 0, 0.5}, - {0, 0, 0, 0.5, 0.5, 0.5}, - }, - }, - }, - ["_inner"] = { - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, - {-0.5, 0, 0, 0.5, 0.5, 0.5}, - {-0.5, 0, -0.5, 0, 0.5, 0}, - }, - }, - }, - ["_outer"] = { - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, - {-0.5, 0, 0, 0, 0.5, 0.5}, - }, - }, - }, - ["_alt"] = { - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0, 0}, - {-0.5, 0, 0, 0.5, 0.5, 0.5}, - }, - }, - }, - ["_alt_1"] = { - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.0625, -0.5, 0.5, 0, 0}, - {-0.5, 0.4375, 0, 0.5, 0.5, 0.5}, - }, - }, - }, - ["_alt_2"] = { - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.125, -0.5, 0.5, 0, 0}, - {-0.5, 0.375, 0, 0.5, 0.5, 0.5}, - }, - }, - }, - ["_alt_4"] = { - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.25, -0.5, 0.5, 0, 0}, - {-0.5, 0.25, 0, 0.5, 0.5, 0.5}, - }, - }, - }, -} - -for k,v in pairs(stairs_defs) do - table.insert(stairsplus.shapes_list, { "stair_", k }) -end - function stairsplus:register_stair_alias(modname_old, subname_old, modname_new, subname_new) - local defs = stairsplus.copytable(stairs_defs) + local defs = table.copy(stairsplus.defs["stair"]) for alternate, def in pairs(defs) do minetest.register_alias(modname_old .. ":stair_" .. subname_old .. alternate, modname_new .. ":stair_" .. subname_new .. alternate) end end function stairsplus:register_stair_alias_force(modname_old, subname_old, modname_new, subname_new) - local defs = stairsplus.copytable(stairs_defs) + local defs = table.copy(stairsplus.defs["stair"]) for alternate, def in pairs(defs) do minetest.register_alias_force(modname_old .. ":stair_" .. subname_old .. alternate, modname_new .. ":stair_" .. subname_new .. alternate) end end function stairsplus:register_stair(modname, subname, recipeitem, fields) - local defs = stairsplus.copytable(stairs_defs) - local desc = S("%s Stairs"):format(fields.description) + local defs = table.copy(stairsplus.defs["stair"]) for alternate, def in pairs(defs) do - for k, v in pairs(fields) do - def[k] = v - end - def.drawtype = "nodebox" - def.paramtype = "light" - def.paramtype2 = def.paramtype2 or "facedir" - def.on_place = minetest.rotate_node - def.description = desc - def.groups = stairsplus:prepare_groups(fields.groups) - if alternate == "" then - def.groups.stair = 1 - end - if fields.drop and not (type(fields.drop) == "table") then - def.drop = modname .. ":stair_" .. fields.drop .. alternate - end - minetest.register_node(":" .. modname .. ":stair_" .. subname .. alternate, def) + stairsplus.register_single("stair", alternate, def, modname, subname, recipeitem, fields) end circular_saw.known_nodes[recipeitem] = {modname, subname} - - -- Some saw-less recipes: - - minetest.register_craft({ - output = modname .. ":stair_" .. subname .. " 8", - recipe = { - {recipeitem, "", ""}, - {recipeitem, recipeitem, ""}, - {recipeitem, recipeitem, recipeitem}, - }, - }) - - minetest.register_craft({ - output = modname .. ":stair_" .. subname .. " 8", - recipe = { - {"", "", recipeitem}, - {"", recipeitem, recipeitem}, - {recipeitem, recipeitem, recipeitem}, - }, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":stair_" .. subname, - recipe = {modname .. ":panel_" .. subname, modname .. ":slab_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":stair_" .. subname, - recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":stair_" .. subname .. "_outer", - recipe = {modname .. ":micro_" .. subname, modname .. ":slab_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":stair_" .. subname .. "_half", - recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":stair_" .. subname .. "_half", - recipe = {modname .. ":panel_" .. subname, modname .. ":micro_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":stair_" .. subname .. "_right_half", - recipe = {modname .. ":stair_" .. subname .. "_half"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":stair_" .. subname, - recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":stair_" .. subname .. "_inner", - recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":stair_" .. subname .. "_outer", - recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, - }) - - minetest.register_craft({ - type = "shapeless", - output = modname .. ":stair_" .. subname, - recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}, - }) - - minetest.register_craft({ -- See mirrored variation of the recipe below. - output = modname .. ":stair_" .. subname .. "_alt", - recipe = { - {modname .. ":panel_" .. subname, ""}, - {"" , modname .. ":panel_" .. subname}, - }, - }) - - minetest.register_craft({ -- Mirrored variation of the recipe above. - output = modname .. ":stair_" .. subname .. "_alt", - recipe = { - {"" , modname .. ":panel_" .. subname}, - {modname .. ":panel_" .. subname, ""}, - }, - }) end diff --git a/moreores/CHANGELOG.md b/moreores/CHANGELOG.md index 15f9276..612b615 100644 --- a/moreores/CHANGELOG.md +++ b/moreores/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Handle tin which is now included in [Minetest Game](https://github.com/minetest/minetest_game). If it is detected, then the tin nodes and items from More Ores won't be registered. -## [1.0.0] - 2017-02-19 +## 1.0.0 - 2017-02-19 - Initial versioned release. diff --git a/moretrees/locale/es.txt b/moretrees/locale/es.txt new file mode 100644 index 0000000..510fa3f --- /dev/null +++ b/moretrees/locale/es.txt @@ -0,0 +1,100 @@ +# Traducido por Carlos Barraza + +### crafts.lua ### +Coconut Milk = Leche de Coco +Raw Coconut = Coco crudo +Acorn Muffin batter = Masa de Mollete de Bellota +Acorn Muffin = Mollete de Bellota +Roasted Spruce Cone Nuts = Cono de Picea Tostado +Roasted Pine Cone Nuts = Cono de Pino Tostado +Roasted Fir Cone Nuts = Cono de Abeto Tostado +Roasted Cedar Cone Nuts = Coco de Alamo Tostado +Date = Datilera +Date & nut snack = Datilera y Nueces +Date-nut cake batter = Pasta de torta de Datilera +Date-nut cake = Pastel de Datilera +Date-nut energy bar = Barra energetica de Datilera + +### date_palm.lua ### +Dates = Datilera +Date Stem = Tallo de Datilera +Date Flowers = Flores de Datilera + +### node_defs.lua ### +Beech Tree Trunk = Tronco de Arbol de Haya +Apple Tree Trunk = Tronco de Arbol de Manzana +Oak Tree Trunk = Tronco de Arbol de Roble +Giant Sequoia Trunk = Tronco de Sequoia Gigante +Birch Tree Trunk = Tronco de Arbol de Abedul +Palm Tree Trunk = Tronco de Palmera +Spruce Tree Trunk = Tronco de Arbol de Abeto +Willow Tree Trunk = Tronco de Arbol de Sauce +Rubber Tree Trunk = Tronco de Arbol de Arbol de Goma +Jungle Tree = Tronco de Arbol de Arbol de la Selva +Douglas Fir Trunk = Tronco de Arbol de Abeto de Douglas +Cedar Tree Trunk = Tronco de Arbol de Cedro +Date Palm Tree Trunk = Tronco de Palmera Datilera +Acacia Tree Trunk = Tronco de Arbol de Acacia +Poplar Tree Trunk = Tronco de Arbol de Alamo + +Beech Tree Planks = Madera de Arbol de Haya +Apple Tree Planks = Madera de Arbol de Manzana +Oak Tree Planks = Madera de Arbol de Roble +Giant Sequoia Planks = Madera de Sequoia Gigante +Birch Tree Planks = Madera de Arbol de Abedul +Palm Tree Planks = Madera de Palmera +Spruce Tree Planks = Madera de Arbol de Abeto +Willow Tree Planks = Madera de Arbol de Sauce +Rubber Tree Planks = Madera de Arbol de Arbol de Goma +Jungle Planks = Madera de Arbol de Arbol de la Selva +Douglas Fir Planks = Madera de Arbol de Abeto de Douglas +Cedar Tree Planks = Madera de Arbol de Cedro +Date Palm Tree Planks = Madera de Palmera Datilera +Acacia Tree Planks = Madera de Arbol de Acacia +Poplar Tree Planks = Madera de Arbol de Alamo + +Beech Tree Sapling = Retoño de Arbol de Haya +Apple Tree Sapling = Retoño de Arbol de Manzana +Oak Tree Sapling = Retoño de Arbol de Roble +Giant Sequoia Sapling = Retoño de Arbol de Sequoia Gigante +Birch Tree Sapling = Retoño de Arbol de Abedul +Palm Tree Sapling = Retoño de Palmera +Spruce Tree Sapling = Retoño de Arbol de Abeto +Willow Tree Sapling = Retoño de Arbol de Sauce +Rubber Tree Sapling = Retoño de Arbol de Arbol de Goma +Jungle Sapling = Retoño de Arbol de Arbol de la Selva +Douglas Fir Sapling = Retoño de Arbol de Abeto de Douglas +Cedar Tree Sapling = Retoño de Arbol de Cedro +Date Palm Tree Tree Sapling = Retoño de Palmera Datilera +Acacia Tree Sapling = Retoño de Arbol de Acacia +Poplar Tree Sapling = Retoño de Arbol de Alamo + +Beech Tree Leaves = Hojas de Arbol de Haya +Apple Tree Leaves = Hojas de Arbol de Manzana +Oak Tree Leaves = Hojas de Arbol de Roble +Giant Sequoia Leaves = Hojas de Sequoia Gigante +Birch Tree Leaves = Hojas de Arbol de Abedul +Palm Tree Leaves = Hojas de Palmera +Spruce Tree Leaves = Hojas de Arbol de Abeto +Willow Tree Leaves = Hojas de Arbol de Sauce +Rubber Tree Leaves = Hojas de Arbol de Arbol de Goma +Jungle Leaves = Hojas de Arbol de Arbol de la Selva +Douglas Fir Leaves = Hojas de Arbol de Abeto de Douglas +Cedar Tree Leaves = Hojas de Arbol de Cedro +Date Palm Tree Tree Leaves = Hojas de Palmera Datilera +Acacia Tree Leaves = Hojas de Arbol de Acacia +Poplar Tree Leaves = Hojas de Arbol de Alamo + +Acorn = Bellota +Coconut = Coco +Spruce Cone = Coco de Picea +Pine Cone = Coco de Pino +Fir Cone = Coco de Abeto +Cedar Cone = Coco de Alamo +Jungle Sapling = Retoño de Arbol de la Selva +Jungle Tree Leaves (Yellow) = Hojas de Arbol de la Selva (Amarilla) +Jungle Tree Leaves (Red) = Hojas de Arbol de la Selva (Roja) +Douglas Fir Leaves (Bright) = Hojas de Arbol de Abeto de Douglas (Brillante) +Rubber Tree Trunk (Empty) = Tronco de Arbol de Goma (Vacio) + +[Moretrees] Loaded (2013-02-11) = [Masarboles] Cargado diff --git a/moretrees/locale/fr.txt b/moretrees/locale/fr.txt new file mode 100644 index 0000000..12d856a --- /dev/null +++ b/moretrees/locale/fr.txt @@ -0,0 +1,74 @@ +# Traduction par Yoan31 +# + +### crafts.lua ### +Coconut Milk = Lait de Coco +Raw Coconut = Noix de Coco Crue +Acorn Muffin batter = Pate à Muffins au Gland +Acorn Muffin = Muffins au Gland +Roasted Spruce Cone Nuts = Noix de Cône de Sapin Roties +Roasted Pine Cone Nuts = Noix de Pomme de pin Roties +Roasted Fir Cone Nuts = Noix de Cône de Sapin Roties + +### node_defs.lua ### +Beech Tree Trunk = Tronc d'Arbre de Hêtre +Apple Tree Trunk = Tronc d'Arbre de Pommier +Oak Tree Trunk = Tronc d'Arbre de chêne +Giant Sequoia Trunk = Tronc d'Arbre de Séquoia Géant +Birch Tree Trunk = Tronc d'Arbre de bouleau +Palm Tree Trunk = Tronc d'Arbre de Palmier +Spruce Tree Trunk = Tronc d'Arbre d'Epicéa +Pine Tree Trunk = Tronc d'Arbre de Pin +Willow Tree Trunk = Tronc d'Arbre de Saule +Rubber Tree Trunk = Tronc d'Arbre a Caoutchouc +Jungle Tree Trunk = Tronc d'Arbre de la Jungle +Douglas Fir Trunk = Tronc de Sapin de Douglas +Beech Tree Planks = Planches de Hêtre +Apple Tree Planks = Planches de Pommier +Oak Tree Planks = Planches de Chêne +Giant Sequoia Planks = Planches de d'Arbre de Séquoia Géant +Birch Tree Planks = Planches d'Arbre de bouleau +Palm Tree Planks = Planches d'Arbre de Palmier +Spruce Tree Planks = Planches d'Arbre d'Epicéa +Pine Tree Planks = Planches d'Arbre de Pin +Willow Tree Planks = Planches d'Arbre de Saule +Rubber Tree Planks = Planches d'Arbre a Caoutchouc +Jungle Tree Planks = Planches d'Arbre de la Jungle +Douglas Fir Planks = Planches de Sapin de Douglas +Beech Tree Sapling = Pousse d'Arbre de Hêtre +Apple Tree Sapling = Pousse d'Arbre de Pommier +Oak Tree Sapling = Pousse d'Arbre de chêne +Giant Sequoia Sapling = Pousse d'Arbre de Séquoia Géant +Birch Tree Sapling = Pousse d'Arbre de bouleau +Palm Tree Sapling = Pousse d'Arbre de Palmier +Spruce Tree Sapling = Pousse d'Arbre d'Epicéa +Pine Tree Sapling = Pousse d'Arbre de Pin +Willow Tree Sapling = Pousse d'Arbre de Saule +Rubber Tree Sapling = Pousse d'Arbre a Caoutchouc +Jungle Tree Sapling = Pousse d'Arbre de la Jungle +Douglas Fir Sapling = Pousse de Sapin de Douglas +Beech Tree Leaves = Feuilles d'Arbre de Hêtre +Apple Tree Leaves = Feuilles d'Arbre de Pommier +Oak Tree Leaves = Feuilles d'Arbre de chêne +Giant Sequoia Leaves = Feuilles d'Arbre de Séquoia Géant +Birch Tree Leaves = Feuilles d'Arbre de bouleau +Palm Tree Leaves = Feuilles d'Arbre de Palmier +Spruce Tree Leaves = Feuilles d'Arbre d'Epicéa +Pine Tree Leaves = Feuilles d'Arbre de Pin +Willow Tree Leaves = Feuilles d'Arbre de Saule +Rubber Tree Leaves = Feuilles d'Arbre a Caoutchouc +Jungle Tree Leaves = Feuilles d'Arbre de la Jungle +Douglas Fir Leaves = Feuilles de Sapin de Douglas + +Acorn = Gland +Coconut = Noix de Coco +Spruce Cone = Cône de Sapin +Pine Cone = Pomme de Pin +Fir Cone = Pomme de Sapin +Jungle Sapling = Pousse d'Arbre de la Jungle +Jungle Tree Leaves (Yellow) = Feuille d'Arbre de la Jungle (Jaune) +Jungle Tree Leaves (Red) = Feuille d'Arbre de la Jungle (Rouge) +Douglas Fir Leaves (Bright) = Feuille de Sapin de Douglas (Brillant) +Rubber Tree Trunk (Empty) = Tronc d'Arbre en Caoutchouc (Vide) + +[Moretrees] Loaded (2013-02-11) = diff --git a/peaceful_npc/README.txt.md b/peaceful_npc/README.txt.md deleted file mode 100644 index f42f051..0000000 --- a/peaceful_npc/README.txt.md +++ /dev/null @@ -1,4 +0,0 @@ -peaceful_npc -============ - -Adds peaceful npcs. They do not attack you. They can jump and open doors unles the doors are locked. There is an automatic spawner. diff --git a/peaceful_npc/changelog.txt b/peaceful_npc/changelog.txt deleted file mode 100644 index 215429e..0000000 --- a/peaceful_npc/changelog.txt +++ /dev/null @@ -1,27 +0,0 @@ -===Changelog=== -1.8.5.2 plants_lib was renamed to biome_lib -1.8.5.1 fixed some bugs -1.8.5 adds a bunch. i have been editing this so much i forgot -1.8 idk -1.7.4 almost a complete rewrite -1.7.3 code reverted to 1.7.1 aka bug fix, singleplayer gets privs -1.7.2 singleplayer gets peacefulnpc privs by default, added config stuff -1.7.1 added textures, added aliases -1.7 fixed bug, spawner max=10 range=50, changed spawn method, added to spawn command can't spawn if 30 npc are within a 50 node radius -1.6.4 cant spawn > 20 with spawn command, index fix -1.6.3 need priv to use summoner -1.6.2 bug fix -1.6.1 added npc fence, spawn command, npc priv, they spawn rarer naturally -1.6 Fixed bug in post 62, added 4 textures, changed hp to 50, changed kill drop from mese crystal to mese block (so it is compatable with older games), added a compatable recipe for summoner and spawner (mese instead of crystals), changed mobspawnegg to npc summoner and it has a new texture -1.5.6 Added textures. -1.5.5 Made Tron purple, die in lava and water after 10 seconds, set hp to 40 -1.5 Added spawning and they die in water after a set amount of time. -1.4 Fixed bugs, added spawning, changed health to 25, made drop mese crystals, changed spawn limit to 10 -1.3 Added textures, Fixed a bug -1.2 Set limit for how many can be spawned around a spawner. -1.1 Added textures,changed recipes,made npcs drop a mese crystal fragment when killed, set npc health to 20 -1.0 The NPC Portal is now clear and does not look dark. -0.4 I added npc skins, changed the name Box O' NPCs to NPC Portal, changed the picture for NPC Portal, and fixed the spawn egg recipe -0.3 I don't know exactly but i did change something -0.2 The npc's don't attack anymore at night and i added a different texture for the npc spawner. -0.1 Initial release diff --git a/peaceful_npc/commands.lua b/peaceful_npc/commands.lua deleted file mode 100644 index ca3b7d3..0000000 --- a/peaceful_npc/commands.lua +++ /dev/null @@ -1,39 +0,0 @@ ---Spawn Command Function -function npc_command( command_name, npc_command_type, command_desc) - local function spawn_for_command(name, param) - local npcs_to_spawn = tonumber(param) or 1 - local player = minetest.get_player_by_name(name) - local pos = player:getpos() - local max_spawn = 20 - local max_surround_npc = 30 - local active_npc_count = table.getn(minetest.get_objects_inside_radius(pos, 50)) - if active_npc_count == nil then - active_npc_count = 0 - end - if npcs_to_spawn + active_npc_count > max_surround_npc then - minetest.chat_send_player(name, "There are too many NPCs around you.") - elseif npcs_to_spawn >= max_spawn + 1 then - minetest.chat_send_player(name, "The spawn limit is"..max_spawn) - else - for n = 1, npcs_to_spawn do - offsetx = math.random(-5,5) - offsety = math.random(2,4) - offsetz = math.random(-5,5) - minetest.add_entity({ x=pos.x+offsetx, y=pos.y+offsety, z=pos.z+offsetz }, ("peaceful_npc:npc_"..npc_command_type)) - end - end - end - - --Spawn command - minetest.register_chatcommand(command_name, { - description = command_desc, - privs = {peacefulnpc=true}, - func = spawn_for_command - }) -end - -npc_command( "summonnpc_fast", "fast", "Summons Fast NPCs") -npc_command( "summonnpc_def", "def", "Summon Default NPCs") -npc_command( "summonnpc_dwarf", "dwarf", "Summon Dwarf NPCs") - -print("Peaceful NPC commands.lua loaded! By jojoa1997!")
\ No newline at end of file diff --git a/peaceful_npc/depends.txt b/peaceful_npc/depends.txt deleted file mode 100644 index 3e3d281..0000000 --- a/peaceful_npc/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -default -biome_lib diff --git a/peaceful_npc/init.lua b/peaceful_npc/init.lua deleted file mode 100644 index 6f81405..0000000 --- a/peaceful_npc/init.lua +++ /dev/null @@ -1,21 +0,0 @@ ---Config -instakill_sword = false -mode_debug = false - ---Loads other files -dofile(minetest.get_modpath("peaceful_npc").."/npc/npc_def.lua") -dofile(minetest.get_modpath("peaceful_npc").."/npc/npc_fast.lua") -dofile(minetest.get_modpath("peaceful_npc").."/npc/npc_dwarf.lua") -dofile(minetest.get_modpath("peaceful_npc").."/commands.lua") -dofile(minetest.get_modpath("peaceful_npc").."/items.lua") -dofile(minetest.get_modpath("peaceful_npc").."/spawning.lua") -dofile(minetest.get_modpath("peaceful_npc").."/recipes.lua") - ---NPC Privilege -minetest.register_privilege("peacefulnpc", { description = "allows to use spawn command", give_to_singleplayer = true}) - ---Aliases -minetest.register_alias("peaceful_npc:npc", "peaceful_npc:npc_def") - - -print("Peaceful NPC loaded! By jojoa1997!") diff --git a/peaceful_npc/items.lua b/peaceful_npc/items.lua deleted file mode 100644 index f3a6828..0000000 --- a/peaceful_npc/items.lua +++ /dev/null @@ -1,184 +0,0 @@ ---Spawn code -function npc_spawner(pos, SPAWN_TYPE) - local MAX_NPC = 5 - local count = table.getn(minetest.get_objects_inside_radius(pos, 50)) - if count == nil then - count = 0 - end - - if count <= MAX_NPC then - minetest.add_entity({x=pos.x+math.random(-1,1),y=pos.y+math.random(2,3),z=pos.z+math.random(-1,1)}, SPAWN_TYPE) - end -end - ---Item Code for default npcs -minetest.register_node("peaceful_npc:summoner_npc_def", { - description = "Default NPC Summoner", - image = "peaceful_npc_npc_summoner_def.png", - inventory_image = "peaceful_npc_npc_summoner_def.png", - wield_image = "peaceful_npc_npc_summoner_def.png", - paramtype = "light", - tiles = {"peaceful_npc_spawnegg.png"}, - is_ground_content = true, - drawtype = "glasslike", - groups = {crumbly=3}, - selection_box = { - type = "fixed", - fixed = {0,0,0,0,0,0} - }, - sounds = default.node_sound_dirt_defaults(), - on_place = function(itemstack, placer, pointed) - local name = placer:get_player_name() - if (minetest.check_player_privs(name, {peacefulnpc=true})) then - pos = pointed.above - pos.y = pos.y + 1 - minetest.add_entity(pointed.above,"peaceful_npc:npc_def") - itemstack:take_item(1) - else - minetest.chat_send_player(name, "Nope! You need to have the peacefulnpc priv!") - end - return itemstack -end -}) - -minetest.register_node("peaceful_npc:spawner_npc_def", { - description = "Default NPC Portal", - drawtype = "glasslike", - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, - sounds = default.node_sound_glass_defaults(), - tiles = {"peaceful_npc_spawner_def.png"}, - sunlight_propagates = true, - paramtype = "light", - mesecons = {effector = { - action_on = function(pos) npc_spawner(pos, "peaceful_npc:npc_def") end, - }} -}) -minetest.register_abm({ - nodenames = {"peaceful_npc:spawner_npc_def"}, - interval = 20, - chance = 10, - action = function(pos) - npc_spawner(pos, "peaceful_npc:npc_def") - end, -}) - ---Item Code for fast npcs -minetest.register_node("peaceful_npc:summoner_npc_fast", { - description = "Fast NPC Summoner", - image = "peaceful_npc_npc_summoner_fast.png", - inventory_image = "peaceful_npc_npc_summoner_fast.png", - wield_image = "peaceful_npc_npc_summoner_fast.png", - paramtype = "light", - tiles = {"peaceful_npc_spawnegg.png"}, - is_ground_content = true, - drawtype = "glasslike", - groups = {crumbly=3}, - selection_box = { - type = "fixed", - fixed = {0,0,0,0,0,0} - }, - sounds = default.node_sound_dirt_defaults(), - on_place = function(itemstack, placer, pointed) - local name = placer:get_player_name() - if (minetest.check_player_privs(name, {peacefulnpc=true})) then - pos = pointed.above - pos.y = pos.y + 1 - minetest.add_entity(pointed.above,"peaceful_npc:npc_fast") - itemstack:take_item(1) - else - minetest.chat_send_player(name, "Nope! You need to have the peacefulnpc priv!") - end - return itemstack -end -}) - -minetest.register_node("peaceful_npc:spawner_npc_fast", { - description = "Fast NPC Portal", - drawtype = "glasslike", - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, - sounds = default.node_sound_glass_defaults(), - tiles = {"peaceful_npc_spawner_fast.png"}, - sunlight_propagates = true, - paramtype = "light", - mesecons = {effector = { - action_on = function(pos) npc_spawner(pos, "peaceful_npc:npc_fast") end, - }} -}) -minetest.register_abm({ - nodenames = {"peaceful_npc:spawner_npc_fast"}, - interval = 30, - chance = 10, - action = function(pos) - npc_spawner(pos, "peaceful_npc:npc_fast") - end, -}) - ---Item Code for dwarf npcs -minetest.register_node("peaceful_npc:summoner_npc_dwarf", { - description = "Dwarf NPC Summoner", - image = "peaceful_npc_npc_summoner_dwarf.png", - inventory_image = "peaceful_npc_npc_summoner_dwarf.png", - wield_image = "peaceful_npc_npc_summoner_dwarf.png", - paramtype = "light", - tiles = {"peaceful_npc_spawnegg.png"}, - is_ground_content = true, - drawtype = "glasslike", - groups = {crumbly=3}, - selection_box = { - type = "fixed", - fixed = {0,0,0,0,0,0} - }, - sounds = default.node_sound_dirt_defaults(), - on_place = function(itemstack, placer, pointed) - local name = placer:get_player_name() - if (minetest.check_player_privs(name, {peacefulnpc=true})) then - pos = pointed.above - pos.y = pos.y + 1 - minetest.add_entity(pointed.above,"peaceful_npc:npc_dwarf") - itemstack:take_item(1) - else - minetest.chat_send_player(name, "Nope! You need to have the peacefulnpc priv!") - end - return itemstack -end -}) - -minetest.register_node("peaceful_npc:spawner_npc_dwarf", { - description = "Dwarf NPC Portal", - drawtype = "glasslike", - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, - sounds = default.node_sound_glass_defaults(), - tiles = {"peaceful_npc_spawner_dwarf.png"}, - sunlight_propagates = true, - paramtype = "light", - mesecons = {effector = { - action_on = function(pos) npc_spawner(pos, "peaceful_npc:npc_dwarf") end, - }} -}) -minetest.register_abm({ - nodenames = {"peaceful_npc:spawner_npc_dwarf"}, - interval = 60, - chance = 10, - action = function(pos) - npc_spawner(pos, "peaceful_npc:npc_dwarf") - end, -}) - -if instakill_sword == true then - --Adds instakill sword - minetest.register_tool("peaceful_npc:sword_instakill", { - description = "Instakill Sword", - inventory_image = "default_tool_steelsword.png", - tool_capabilities = { - full_punch_interval = 0.1, - max_drop_level = 1, - groupcaps={ - fleshy={times={[1]=0.005, [2]=0.005, [3]=0.005}, uses=0, maxlevel=3}, - snappy={times={[2]=0.005, [3]=0.005}, uses=0, maxlevel=2}, - choppy={times={[3]=0.005}, uses=0, maxlevel=1} - }, - } - }) -end - -print("Peaceful NPC items.lua loaded! By jojoa1997!") diff --git a/peaceful_npc/models/archer.png b/peaceful_npc/models/archer.png Binary files differdeleted file mode 100644 index 756924e..0000000 --- a/peaceful_npc/models/archer.png +++ /dev/null diff --git a/peaceful_npc/models/builder.png b/peaceful_npc/models/builder.png Binary files differdeleted file mode 100644 index c6cf485..0000000 --- a/peaceful_npc/models/builder.png +++ /dev/null diff --git a/peaceful_npc/models/charmander.png b/peaceful_npc/models/charmander.png Binary files differdeleted file mode 100644 index 1bc123e..0000000 --- a/peaceful_npc/models/charmander.png +++ /dev/null diff --git a/peaceful_npc/models/clonetrooper.png b/peaceful_npc/models/clonetrooper.png Binary files differdeleted file mode 100644 index c5a261b..0000000 --- a/peaceful_npc/models/clonetrooper.png +++ /dev/null diff --git a/peaceful_npc/models/cool_girl.png b/peaceful_npc/models/cool_girl.png Binary files differdeleted file mode 100644 index 72c9153..0000000 --- a/peaceful_npc/models/cool_girl.png +++ /dev/null diff --git a/peaceful_npc/models/diamond_ninja.png b/peaceful_npc/models/diamond_ninja.png Binary files differdeleted file mode 100644 index a4d1e47..0000000 --- a/peaceful_npc/models/diamond_ninja.png +++ /dev/null diff --git a/peaceful_npc/models/dragon.png b/peaceful_npc/models/dragon.png Binary files differdeleted file mode 100644 index 259c0eb..0000000 --- a/peaceful_npc/models/dragon.png +++ /dev/null diff --git a/peaceful_npc/models/dwarf_commoner.png b/peaceful_npc/models/dwarf_commoner.png Binary files differdeleted file mode 100644 index 054bb00..0000000 --- a/peaceful_npc/models/dwarf_commoner.png +++ /dev/null diff --git a/peaceful_npc/models/dwarf_girl.png b/peaceful_npc/models/dwarf_girl.png Binary files differdeleted file mode 100644 index 4376d4e..0000000 --- a/peaceful_npc/models/dwarf_girl.png +++ /dev/null diff --git a/peaceful_npc/models/dwarf_king.png b/peaceful_npc/models/dwarf_king.png Binary files differdeleted file mode 100644 index 15502d9..0000000 --- a/peaceful_npc/models/dwarf_king.png +++ /dev/null diff --git a/peaceful_npc/models/dwarf_warrior.png b/peaceful_npc/models/dwarf_warrior.png Binary files differdeleted file mode 100644 index e588e98..0000000 --- a/peaceful_npc/models/dwarf_warrior.png +++ /dev/null diff --git a/peaceful_npc/models/gangnam_dude.png b/peaceful_npc/models/gangnam_dude.png Binary files differdeleted file mode 100644 index 761b56b..0000000 --- a/peaceful_npc/models/gangnam_dude.png +++ /dev/null diff --git a/peaceful_npc/models/golem.png b/peaceful_npc/models/golem.png Binary files differdeleted file mode 100644 index badfc00..0000000 --- a/peaceful_npc/models/golem.png +++ /dev/null diff --git a/peaceful_npc/models/hunter.png b/peaceful_npc/models/hunter.png Binary files differdeleted file mode 100644 index 8ec41ca..0000000 --- a/peaceful_npc/models/hunter.png +++ /dev/null diff --git a/peaceful_npc/models/ironknight.png b/peaceful_npc/models/ironknight.png Binary files differdeleted file mode 100644 index 77ca055..0000000 --- a/peaceful_npc/models/ironknight.png +++ /dev/null diff --git a/peaceful_npc/models/katniss.png b/peaceful_npc/models/katniss.png Binary files differdeleted file mode 100644 index 1b2d096..0000000 --- a/peaceful_npc/models/katniss.png +++ /dev/null diff --git a/peaceful_npc/models/kitty.png b/peaceful_npc/models/kitty.png Binary files differdeleted file mode 100644 index 1a4c864..0000000 --- a/peaceful_npc/models/kitty.png +++ /dev/null diff --git a/peaceful_npc/models/knightking.png b/peaceful_npc/models/knightking.png Binary files differdeleted file mode 100644 index 22b197b..0000000 --- a/peaceful_npc/models/knightking.png +++ /dev/null diff --git a/peaceful_npc/models/miner.png b/peaceful_npc/models/miner.png Binary files differdeleted file mode 100644 index 3892edb..0000000 --- a/peaceful_npc/models/miner.png +++ /dev/null diff --git a/peaceful_npc/models/ninja.png b/peaceful_npc/models/ninja.png Binary files differdeleted file mode 100644 index 957c290..0000000 --- a/peaceful_npc/models/ninja.png +++ /dev/null diff --git a/peaceful_npc/models/panda_girl.png b/peaceful_npc/models/panda_girl.png Binary files differdeleted file mode 100644 index cbb518f..0000000 --- a/peaceful_npc/models/panda_girl.png +++ /dev/null diff --git a/peaceful_npc/models/penguin_knight.png b/peaceful_npc/models/penguin_knight.png Binary files differdeleted file mode 100644 index cdd8da1..0000000 --- a/peaceful_npc/models/penguin_knight.png +++ /dev/null diff --git a/peaceful_npc/models/pikachu.png b/peaceful_npc/models/pikachu.png Binary files differdeleted file mode 100644 index d96526d..0000000 --- a/peaceful_npc/models/pikachu.png +++ /dev/null diff --git a/peaceful_npc/models/santa_bikini_girl.png b/peaceful_npc/models/santa_bikini_girl.png Binary files differdeleted file mode 100644 index a688f43..0000000 --- a/peaceful_npc/models/santa_bikini_girl.png +++ /dev/null diff --git a/peaceful_npc/models/squirtle.png b/peaceful_npc/models/squirtle.png Binary files differdeleted file mode 100644 index edc1781..0000000 --- a/peaceful_npc/models/squirtle.png +++ /dev/null diff --git a/peaceful_npc/models/tron.png b/peaceful_npc/models/tron.png Binary files differdeleted file mode 100644 index dd41ed2..0000000 --- a/peaceful_npc/models/tron.png +++ /dev/null diff --git a/peaceful_npc/models/warrior_panda.png b/peaceful_npc/models/warrior_panda.png Binary files differdeleted file mode 100644 index 799fd6e..0000000 --- a/peaceful_npc/models/warrior_panda.png +++ /dev/null diff --git a/peaceful_npc/models/witch.png b/peaceful_npc/models/witch.png Binary files differdeleted file mode 100644 index 6308eb5..0000000 --- a/peaceful_npc/models/witch.png +++ /dev/null diff --git a/peaceful_npc/models/wizard.png b/peaceful_npc/models/wizard.png Binary files differdeleted file mode 100644 index 603022b..0000000 --- a/peaceful_npc/models/wizard.png +++ /dev/null diff --git a/peaceful_npc/npc/npc_def.lua b/peaceful_npc/npc/npc_def.lua deleted file mode 100644 index 554911e..0000000 --- a/peaceful_npc/npc/npc_def.lua +++ /dev/null @@ -1,345 +0,0 @@ --- NPC max walk speed -walk_limit = 2 ---npc just walking around -chillaxin_speed = 1.5 --- Player animation speed -animation_speed = 30 - --- Player animation blending --- Note: This is currently broken due to a bug in Irrlicht, leave at 0 -animation_blend = 0 - --- Default player appearance -default_model_def = "character.b3d" -available_npc_textures_def = { - def_texture_1 = {"miner.png"}, - def_texture_2 = {"archer.png"}, - def_texture_3 = {"cool_girl.png"}, - def_texture_4 = {"builder.png"}, - def_texture_5 = {"panda_girl.png"} -} - --- Frame ranges for each player model -function npc_get_animations_def(model) - if model == "character.b3d" then - return { - stand_START = 0, - stand_END = 79, - sit_START = 81, - sit_END = 160, - lay_START = 162, - lay_END = 166, - walk_START = 168, - walk_END = 187, - mine_START = 189, - mine_END = 198, - walk_mine_START = 200, - walk_mine_END = 219 - } - end -end - -local npc_model = {} -local npc_anim = {} -local npc_sneak = {} -local ANIM_STAND = 1 -local ANIM_SIT = 2 -local ANIM_LAY = 3 -local ANIM_WALK = 4 -local ANIM_WALK_MINE = 5 -local ANIM_MINE = 6 - -function npc_update_visuals_def(self) - --local name = get_player_name() - visual = default_model_def - npc_anim = 0 -- Animation will be set further below immediately - --npc_sneak[name] = false - prop = { - mesh = default_model_def, - textures = default_textures, - textures = available_npc_textures_def["def_texture_"..math.random(1,5)], - visual_size = {x=1, y=1, z=1}, - } - self.object:set_properties(prop) -end - -NPC_ENTITY_DEF = { - physical = true, - collisionbox = {-0.3,-1.0,-0.3, 0.3,0.8,0.3}, - visual = "mesh", - mesh = "character.b3d", - textures = {"character.png"}, - npc_anim = 0, - timer = 0, - turn_timer = 0, - vec = 0, - yaw = 0, - yawwer = 0, - state = 1, - jump_timer = 0, - door_timer = 0, - attacker = "", - attacking_timer = 0 -} - -NPC_ENTITY_DEF.on_activate = function(self) - npc_update_visuals_def(self) - self.anim = npc_get_animations_def(visual) - self.object:set_animation({x=self.anim.stand_START,y=self.anim.stand_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_STAND - self.object:setacceleration({x=0,y=-10,z=0}) - self.state = 1 - self.object:set_hp(50) -end - -NPC_ENTITY_DEF.on_punch = function(self, puncher) - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 5)) do - if not object:is_player() then - if object:get_luaentity().name == "peaceful_npc:npc_def" then - object:get_luaentity().state = 3 - object:get_luaentity().attacker = puncher:get_player_name() - end - end - end - - if self.state ~= 3 then - self.state = 3 - self.attacker = puncher:get_player_name() - end - - if self.object:get_hp() == 0 then - local obj = minetest.add_item(self.object:getpos(), "default:stone_with_iron 10") - end -end - -NPC_ENTITY_DEF.on_step = function(self, dtime) - self.timer = self.timer + 0.01 - self.turn_timer = self.turn_timer + 0.01 - self.jump_timer = self.jump_timer + 0.01 - self.door_timer = self.door_timer + 0.01 - self.attacking_timer = self.attacking_timer + 0.01 - - local current_pos = self.object:getpos() - local current_node = minetest.get_node(current_pos) - if self.time_passed == nil then - self.time_passed = 0 - end - - self.time_passed = self.time_passed + dtime - - if self.time_passed >= 5 then - self.object:remove() - else - if current_node.name == "default:water_source" or - current_node.name == "default:water_flowing" or - current_node.name == "default:lava_source" or - current_node.name == "default:lava_flowing" - then - self.time_passed = self.time_passed + dtime - else - self.time_passed = 0 - end -end - - --collision detection prealpha - --[[ - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 2)) do - if object:is_player() then - compare1 = object:getpos() - compare2 = self.object:getpos() - newx = compare2.x - compare1.x - newz = compare2.z - compare1.z - print(newx) - print(newz) - self.object:setacceleration({x=newx,y=self.object:getacceleration().y,z=newz}) - elseif not object:is_player() then - if object:get_luaentity().name == "peaceful_npc:npc" then - print("moo") - end - end - end - ]]-- - - --set npc to hostile in night, and revert npc back to peaceful in daylight - if minetest.get_timeofday() >= 0 and minetest.get_timeofday() < 0.25 and self.state ~= 4 then - self.state = 4 - elseif minetest.get_timeofday() > 0.25 and self.state == 4 then - self.state = 1 - end - --if mob is not in attack or hostile mode, set mob to walking or standing - if self.state < 3 then - if self.timer > math.random(1,20) then - self.state = math.random(1,2) - self.timer = 0 - end - end - --STANDING - if self.state == 1 then - self.yawwer = true - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 3)) do - if object:is_player() then - self.yawwer = false - NPC = self.object:getpos() - PLAYER = object:getpos() - self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z} - self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2 - if PLAYER.x > NPC.x then - self.yaw = self.yaw + math.pi - end - self.yaw = self.yaw - 2 - self.object:setyaw(self.yaw) - end - end - - if self.turn_timer > math.random(1,4) and yawwer == true then - self.yaw = 360 * math.random() - self.object:setyaw(self.yaw) - self.turn_timer = 0 - end - self.object:setvelocity({x=0,y=self.object:getvelocity().y,z=0}) - if self.npc_anim ~= ANIM_STAND then - self.anim = npc_get_animations_def(visual) - self.object:set_animation({x=self.anim.stand_START,y=self.anim.stand_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_STAND - end - end - --WALKING - if self.state == 2 then - if self.present_timer == 1 then - minetest.add_item(self.object:getpos(),"default:coal_lump") - self.present_timer = 0 - end - if self.direction ~= nil then - self.object:setvelocity({x=self.direction.x*chillaxin_speed,y=self.object:getvelocity().y,z=self.direction.z*chillaxin_speed}) - end - if self.turn_timer > math.random(1,4) then - self.yaw = 360 * math.random() - self.object:setyaw(self.yaw) - self.turn_timer = 0 - self.direction = {x = math.sin(self.yaw)*-1, y = -10, z = math.cos(self.yaw)} - --self.object:setvelocity({x=self.direction.x,y=self.object:getvelocity().y,z=direction.z}) - --self.object:setacceleration(self.direction) - end - if self.npc_anim ~= ANIM_WALK then - self.anim = npc_get_animations_def(visual) - self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_WALK - end - --open a door [alpha] - if self.direction ~= nil then - if self.door_timer > 2 then - local is_a_door = minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name - if is_a_door == "doors:door_wood_t_1" then - minetest.punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}) - self.door_timer = 0 - end - local is_in_door = minetest.get_node(self.object:getpos()).name - if is_in_door == "doors:door_wood_t_1" then - minetest.punch_node(self.object:getpos()) - end - end - end - --jump - if self.direction ~= nil then - if self.jump_timer > 0.3 then - if minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then - self.object:setvelocity({x=self.object:getvelocity().x,y=5,z=self.object:getvelocity().z}) - self.jump_timer = 0 - end - end - end - end - --WANDERING CONSTANTLY AT NIGHT - if self.state == 4 then - if self.npc_anim ~= ANIM_WALK then - self.anim = npc_get_animations_def(visual) - self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_WALK - end - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 12)) do - if object:is_player() then - if object:get_hp() > 0 then - NPC = self.object:getpos() - PLAYER = object:getpos() - self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z} - self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2 - if PLAYER.x > NPC.x then - self.yaw = self.yaw + math.pi - end - self.yaw = self.yaw - 2 - self.object:setyaw(self.yaw) - self.direction = {x = math.sin(self.yaw)*-1, y = 0, z = math.cos(self.yaw)} - if self.direction ~= nil then - self.object:setvelocity({x=self.direction.x*2.5,y=self.object:getvelocity().y,z=self.direction.z*2.5}) - end - --jump over obstacles - if self.jump_timer > 0.3 then - if minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then - self.object:setvelocity({x=self.object:getvelocity().x,y=5,z=self.object:getvelocity().z}) - self.jump_timer = 0 - end - end - if self.direction ~= nil then - if self.door_timer > 2 then - local is_a_door = minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name - if is_a_door == "doors:door_wood_t_1" then - minetest.punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}) - self.door_timer = 0 - end - local is_in_door = minetest.get_node(self.object:getpos()).name - if is_in_door == "doors:door_wood_t_1" then - minetest.punch_node(self.object:getpos()) - end - end - end - --return - end - elseif not object:is_player() then - self.state = 1 - self.attacker = "" - end - end - if self.direction ~= nil then - self.object:setvelocity({x=self.direction.x,y=self.object:getvelocity().y,z=self.direction.z}) - end - if self.turn_timer > math.random(1,4) then - self.yaw = 360 * math.random() - self.object:setyaw(self.yaw) - self.turn_timer = 0 - self.direction = {x = math.sin(self.yaw)*-1, y = -10, z = math.cos(self.yaw)} - end - if self.npc_anim ~= ANIM_WALK then - self.anim = npc_get_animations_def(visual) - self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_WALK - end - --open a door [alpha] - if self.direction ~= nil then - if self.door_timer > 2 then - local is_a_door = minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name - if is_a_door == "doors:door_wood_t_1" then - --print("door") - minetest.punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}) - self.door_timer = 0 - end - local is_in_door = minetest.get_node(self.object:getpos()).name - --print(dump(is_in_door)) - if is_in_door == "doors:door_wood_t_1" then - minetest.punch_node(self.object:getpos()) - end - end - end - --jump - if self.direction ~= nil then - if self.jump_timer > 0.3 then - --print(dump(minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}))) - if minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then - self.object:setvelocity({x=self.object:getvelocity().x,y=2.5,z=self.object:getvelocity().z}) - self.jump_timer = 0 - end - end - end - end -end - -minetest.register_entity("peaceful_npc:npc_def", NPC_ENTITY_DEF) diff --git a/peaceful_npc/npc/npc_dwarf.lua b/peaceful_npc/npc/npc_dwarf.lua deleted file mode 100644 index c3841a1..0000000 --- a/peaceful_npc/npc/npc_dwarf.lua +++ /dev/null @@ -1,345 +0,0 @@ --- NPC max walk speed -walk_limit = 1 ---npc just walking around -chillaxin_speed = .5 --- Player animation speed -animation_speed = 15 - --- Player animation blending --- Note: This is currently broken due to a bug in Irrlicht, leave at 0 -animation_blend = 0 - --- Default player appearance -default_model_dwarf = "character.b3d" -available_npc_textures_dwarf = { - dwarf_texture_1 = {"dwarf_commoner.png"}, - dwarf_texture_2 = {"dwarf_girl.png"}, - dwarf_texture_3 = {"dwarf_king.png"}, - dwarf_texture_4 = {"dwarf_warrior.png"} -} - --- Frame ranges for each player model -function npc_get_animations_dwarf(model) - if model == "character.b3d" then - return { - stand_START = 0, - stand_END = 79, - sit_START = 81, - sit_END = 160, - lay_START = 162, - lay_END = 166, - walk_START = 168, - walk_END = 187, - mine_START = 189, - mine_END = 198, - walk_mine_START = 200, - walk_mine_END = 219 - } - end -end - -local npc_model = {} -local npc_anim = {} -local npc_sneak = {} -local ANIM_STAND = 1 -local ANIM_SIT = 2 -local ANIM_LAY = 3 -local ANIM_WALK = 4 -local ANIM_WALK_MINE = 5 -local ANIM_MINE = 6 - -function npc_update_visuals_dwarf(self) - --local name = get_player_name() - visual = default_model_dwarf - npc_anim = 0 -- Animation will be set further below immediately - --npc_sneak[name] = false - prop = { - mesh = default_model_dwarf, - textures = default_textures, - textures = available_npc_textures_dwarf["dwarf_texture_"..math.random(1,4)], - visual_size = {x=.5, y=.5, z=.5}, - } - self.object:set_properties(prop) -end - -NPC_ENTITY_DWARF = { - physical = true, - lightsource = 5, - collisionbox = {-0.15,-0.5,-0.15, 0.15,0.4,0.15}, - visual = "mesh", - mesh = "character.b3d", - textures = {"character.png"}, - npc_anim = 0, - timer = 0, - turn_timer = 0, - vec = 0, - yaw = 0, - yawwer = 0, - state = 1, - jump_timer = 0, - door_timer = 0, - attacker = "", - attacking_timer = 0 -} - -NPC_ENTITY_DWARF.on_activate = function(self) - npc_update_visuals_dwarf(self) - self.anim = npc_get_animations_dwarf(visual) - self.object:set_animation({x=self.anim.stand_START,y=self.anim.stand_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_STAND - self.object:setacceleration({x=0,y=-10,z=0}) - self.state = 1 - self.object:set_hp(75) -end - -NPC_ENTITY_DWARF.on_punch = function(self, puncher) - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 5)) do - if not object:is_player() then - if object:get_luaentity().name == "peaceful_npc:npc_dwarf" then - object:get_luaentity().state = 3 - object:get_luaentity().attacker = puncher:get_player_name() - end - end - end - - if self.state ~= 3 then - self.state = 3 - self.attacker = puncher:get_player_name() - end - - if self.object:get_hp() == 0 then - local obj = minetest.add_item(self.object:getpos(), "default:stone_with_mese 12") - end -end - -NPC_ENTITY_DWARF.on_step = function(self, dtime) - self.timer = self.timer + 0.01 - self.turn_timer = self.turn_timer + 0.01 - self.jump_timer = self.jump_timer + 0.01 - self.door_timer = self.door_timer + 0.01 - self.attacking_timer = self.attacking_timer + 0.01 - - local current_pos = self.object:getpos() - local current_node = minetest.get_node(current_pos) - if self.time_passed == nil then - self.time_passed = 0 - end - - self.time_passed = self.time_passed + dtime - - if self.time_passed >= 15 then - self.object:remove() - else - if current_node.name == "default:water_source" or - current_node.name == "default:water_flowing" or - current_node.name == "default:lava_source" or - current_node.name == "default:lava_flowing" - then - self.time_passed = self.time_passed + dtime - else - self.time_passed = 0 - end -end - - --collision detection prealpha - --[[ - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 2)) do - if object:is_player() then - compare1 = object:getpos() - compare2 = self.object:getpos() - newx = compare2.x - compare1.x - newz = compare2.z - compare1.z - print(newx) - print(newz) - self.object:setacceleration({x=newx,y=self.object:getacceleration().y,z=newz}) - elseif not object:is_player() then - if object:get_luaentity().name == "peaceful_npc:npc" then - print("moo") - end - end - end - ]]-- - - --set npc to hostile in night, and revert npc back to peaceful in daylight - if minetest.get_timeofday() >= 0 and minetest.get_timeofday() < 0.25 and self.state ~= 4 then - self.state = 4 - elseif minetest.get_timeofday() > 0.25 and self.state == 4 then - self.state = 1 - end - --if mob is not in attack or hostile mode, set mob to walking or standing - if self.state < 3 then - if self.timer > math.random(1,20) then - self.state = math.random(1,2) - self.timer = 0 - end - end - --STANDING - if self.state == 1 then - self.yawwer = true - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 3)) do - if object:is_player() then - self.yawwer = false - NPC = self.object:getpos() - PLAYER = object:getpos() - self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z} - self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2 - if PLAYER.x > NPC.x then - self.yaw = self.yaw + math.pi - end - self.yaw = self.yaw - 2 - self.object:setyaw(self.yaw) - end - end - - if self.turn_timer > math.random(1,4) and yawwer == true then - self.yaw = 360 * math.random() - self.object:setyaw(self.yaw) - self.turn_timer = 0 - end - self.object:setvelocity({x=0,y=self.object:getvelocity().y,z=0}) - if self.npc_anim ~= ANIM_STAND then - self.anim = npc_get_animations_dwarf(visual) - self.object:set_animation({x=self.anim.stand_START,y=self.anim.stand_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_STAND - end - end - --WALKING - if self.state == 2 then - if self.present_timer == 1 then - minetest.add_item(self.object:getpos(),"default:coal_lump") - self.present_timer = 0 - end - if self.direction ~= nil then - self.object:setvelocity({x=self.direction.x*chillaxin_speed,y=self.object:getvelocity().y,z=self.direction.z*chillaxin_speed}) - end - if self.turn_timer > math.random(1,4) then - self.yaw = 360 * math.random() - self.object:setyaw(self.yaw) - self.turn_timer = 0 - self.direction = {x = math.sin(self.yaw)*-1, y = -10, z = math.cos(self.yaw)} - --self.object:setvelocity({x=self.direction.x,y=self.object:getvelocity().y,z=direction.z}) - --self.object:setacceleration(self.direction) - end - if self.npc_anim ~= ANIM_WALK then - self.anim = npc_get_animations_dwarf(visual) - self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_WALK - end - --open a door [alpha] - if self.direction ~= nil then - if self.door_timer > 2 then - local is_a_door = minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name - if is_a_door == "doors:door_wood_t_1" then - minetest.punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}) - self.door_timer = 0 - end - local is_in_door = minetest.get_node(self.object:getpos()).name - if is_in_door == "doors:door_wood_t_1" then - minetest.punch_node(self.object:getpos()) - end - end - end - --jump - if self.direction ~= nil then - if self.jump_timer > 0.3 then - if minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then - self.object:setvelocity({x=self.object:getvelocity().x,y=2.5,z=self.object:getvelocity().z}) - self.jump_timer = 0 - end - end - end - end - --WANDERING CONSTANTLY AT NIGHT - if self.state == 4 then - if self.npc_anim ~= ANIM_WALK then - self.anim = npc_get_animations_dwarf(visual) - self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_WALK - end - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 12)) do - if object:is_player() then - if object:get_hp() > 0 then - NPC = self.object:getpos() - PLAYER = object:getpos() - self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z} - self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2 - if PLAYER.x > NPC.x then - self.yaw = self.yaw + math.pi - end - self.yaw = self.yaw - 2 - self.object:setyaw(self.yaw) - self.direction = {x = math.sin(self.yaw)*-1, y = 0, z = math.cos(self.yaw)} - if self.direction ~= nil then - self.object:setvelocity({x=self.direction.x*2.5,y=self.object:getvelocity().y,z=self.direction.z*2.5}) - end - --jump over obstacles - if self.jump_timer > 0.3 then - if minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then - self.object:setvelocity({x=self.object:getvelocity().x,y=5,z=self.object:getvelocity().z}) - self.jump_timer = 0 - end - end - if self.direction ~= nil then - if self.door_timer > 2 then - local is_a_door = minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name - if is_a_door == "doors:door_wood_t_1" then - minetest.punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}) - self.door_timer = 0 - end - local is_in_door = minetest.get_node(self.object:getpos()).name - if is_in_door == "doors:door_wood_t_1" then - minetest.punch_node(self.object:getpos()) - end - end - end - --return - end - elseif not object:is_player() then - self.state = 1 - self.attacker = "" - end - end - if self.direction ~= nil then - self.object:setvelocity({x=self.direction.x,y=self.object:getvelocity().y,z=self.direction.z}) - end - if self.turn_timer > math.random(1,4) then - self.yaw = 360 * math.random() - self.object:setyaw(self.yaw) - self.turn_timer = 0 - self.direction = {x = math.sin(self.yaw)*-1, y = -10, z = math.cos(self.yaw)} - end - if self.npc_anim ~= ANIM_WALK then - self.anim = npc_get_animations_dwarf(visual) - self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_WALK - end - --open a door [alpha] - if self.direction ~= nil then - if self.door_timer > 2 then - local is_a_door = minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name - if is_a_door == "doors:door_wood_t_1" then - --print("door") - minetest.punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}) - self.door_timer = 0 - end - local is_in_door = minetest.get_node(self.object:getpos()).name - --print(dump(is_in_door)) - if is_in_door == "doors:door_wood_t_1" then - minetest.punch_node(self.object:getpos()) - end - end - end - --jump - if self.direction ~= nil then - if self.jump_timer > 0.3 then - --print(dump(minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}))) - if minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then - self.object:setvelocity({x=self.object:getvelocity().x,y=5,z=self.object:getvelocity().z}) - self.jump_timer = 0 - end - end - end - end -end - -minetest.register_entity("peaceful_npc:npc_dwarf", NPC_ENTITY_DWARF) diff --git a/peaceful_npc/npc/npc_fast.lua b/peaceful_npc/npc/npc_fast.lua deleted file mode 100644 index 00e2141..0000000 --- a/peaceful_npc/npc/npc_fast.lua +++ /dev/null @@ -1,346 +0,0 @@ --- NPC max walk speed -walk_limit = 4 ---npc just walking around -chillaxin_speed = 3 --- Player animation speed -animation_speed = 40 - --- Player animation blending --- Note: This is currently broken due to a bug in Irrlicht, leave at 0 -animation_blend = 0 - --- Default player appearance -default_model = "character.b3d" -available_npc_textures_fast = { - fast_texture_1 = {"diamond_ninja.png"}, - fast_texture_2 = {"tron.png"}, - fast_texture_3 = {"ninja.png"}, - fast_texture_4 = {"hunter.png"}, - fast_texture_5 = {"dragon.png"} -} - --- Frame ranges for each player model -function npc_get_animations_fast(model) - if model == "character.b3d" then - return { - stand_START = 0, - stand_END = 79, - sit_START = 81, - sit_END = 160, - lay_START = 162, - lay_END = 166, - walk_START = 168, - walk_END = 187, - mine_START = 189, - mine_END = 198, - walk_mine_START = 200, - walk_mine_END = 219 - } - end -end - -local npc_model = {} -local npc_anim = {} -local npc_sneak = {} -local ANIM_STAND = 1 -local ANIM_SIT = 2 -local ANIM_LAY = 3 -local ANIM_WALK = 4 -local ANIM_WALK_MINE = 5 -local ANIM_MINE = 6 - -function npc_update_visuals_fast(self) - --local name = get_player_name() - visual = default_model - npc_anim = 0 -- Animation will be set further below immediately - --npc_sneak[name] = false - prop = { - mesh = default_model, - textures = default_textures, - textures = available_npc_textures_fast["fast_texture_"..math.random(1,5)], - visual_size = {x=.75, y=.75, z=.75}, - } - self.object:set_properties(prop) -end - -NPC_ENTITY_FAST = { - physical = true, - collisionbox = {-0.3,-0.8,-0.3, 0.3,0.6,0.3}, - visual = "mesh", - mesh = "character.b3d", - textures = {"character.png"}, - npc_anim = 0, - timer = 0, - turn_timer = 0, - vec = 0, - yaw = 0, - yawwer = 0, - state = 1, - jump_timer = 0, - door_timer = 0, - attacker = "", - attacking_timer = 0 -} - -NPC_ENTITY_FAST.on_activate = function(self) - npc_update_visuals_fast(self) - self.anim = npc_get_animations_fast(visual) - self.object:set_animation({x=self.anim.stand_START,y=self.anim.stand_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_STAND - self.object:setacceleration({x=0,y=-10,z=0}) - self.state = 1 - self.object:set_hp(40) -end - -NPC_ENTITY_FAST.on_punch = function(self, puncher) - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 5)) do - if not object:is_player() then - if object:get_luaentity().name == "peaceful_npc:npc_fast" then - object:get_luaentity().state = 3 - object:get_luaentity().attacker = puncher:get_player_name() - end - end - end - - if self.state ~= 3 then - self.state = 3 - self.attacker = puncher:get_player_name() - end - - if self.object:get_hp() == 0 then - local obj = minetest.add_item(self.object:getpos(), "default:stone_with_coal 5") - end -end - -NPC_ENTITY_FAST.on_step = function(self, dtime) - self.timer = self.timer + 0.01 - self.turn_timer = self.turn_timer + 0.01 - self.jump_timer = self.jump_timer + 0.01 - self.door_timer = self.door_timer + 0.01 - self.attacking_timer = self.attacking_timer + 0.01 - - local current_pos = self.object:getpos() - local current_node = minetest.get_node(current_pos) - if self.time_passed == nil then - self.time_passed = 0 - end - - self.time_passed = self.time_passed + dtime - - if self.time_passed >= 15 then - self.object:remove() - else - if current_node.name == "default:water_source" or - current_node.name == "default:water_flowing" or - current_node.name == "default:lava_source" or - current_node.name == "default:lava_flowing" - then - self.time_passed = self.time_passed + dtime - else - self.time_passed = 2 - end -end - - --collision detection prealpha - --[[ - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 2)) do - if object:is_player() then - compare1 = object:getpos() - compare2 = self.object:getpos() - newx = compare2.x - compare1.x - newz = compare2.z - compare1.z - print(newx) - print(newz) - self.object:setacceleration({x=newx,y=self.object:getacceleration().y,z=newz}) - elseif not object:is_player() then - if object:get_luaentity().name == "peaceful_npc:npc" then - print("moo") - end - end - end - ]]-- - - --set npc to hostile in night, and revert npc back to peaceful in daylight - if minetest.get_timeofday() >= 0 and minetest.get_timeofday() < 0.25 and self.state ~= 4 then - self.state = 4 - elseif minetest.get_timeofday() > 0.25 and self.state == 4 then - self.state = 1 - end - --if mob is not in attack or hostile mode, set mob to walking or standing - if self.state < 3 then - if self.timer > math.random(1,20) then - self.state = math.random(1,2) - self.timer = 0 - end - end - --STANDING - if self.state == 1 then - self.yawwer = true - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 3)) do - if object:is_player() then - self.yawwer = false - NPC = self.object:getpos() - PLAYER = object:getpos() - self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z} - self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2 - if PLAYER.x > NPC.x then - self.yaw = self.yaw + math.pi - end - self.yaw = self.yaw - 2 - self.object:setyaw(self.yaw) - end - end - - if self.turn_timer > math.random(1,4) and yawwer == true then - self.yaw = 360 * math.random() - self.object:setyaw(self.yaw) - self.turn_timer = 0 - end - self.object:setvelocity({x=0,y=self.object:getvelocity().y,z=0}) - if self.npc_anim ~= ANIM_STAND then - self.anim = npc_get_animations_def(visual) - self.object:set_animation({x=self.anim.stand_START,y=self.anim.stand_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_STAND - end - end - --WALKING - if self.state == 2 then - if self.present_timer == 1 then - minetest.add_item(self.object:getpos(),"default:coal_lump") - self.present_timer = 0 - end - if self.direction ~= nil then - self.object:setvelocity({x=self.direction.x*chillaxin_speed,y=self.object:getvelocity().y,z=self.direction.z*chillaxin_speed}) - end - if self.turn_timer > math.random(1,4) then - self.yaw = 360 * math.random() - self.object:setyaw(self.yaw) - self.turn_timer = 0 - self.direction = {x = math.sin(self.yaw)*-1, y = -10, z = math.cos(self.yaw)} - --self.object:setvelocity({x=self.direction.x,y=self.object:getvelocity().y,z=direction.z}) - --self.object:setacceleration(self.direction) - end - if self.npc_anim ~= ANIM_WALK then - self.anim = npc_get_animations_fast(visual) - self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_WALK - end - --open a door [alpha] - if self.direction ~= nil then - if self.door_timer > 2 then - local is_a_door = minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name - if is_a_door == "doors:door_wood_t_1" then - minetest.punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}) - self.door_timer = 0 - end - local is_in_door = minetest.get_node(self.object:getpos()).name - if is_in_door == "doors:door_wood_t_1" then - minetest.punch_node(self.object:getpos()) - end - end - end - --jump - if self.direction ~= nil then - if self.jump_timer > 0.3 then - if minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then - self.object:setvelocity({x=self.object:getvelocity().x,y=2.5,z=self.object:getvelocity().z}) - self.jump_timer = 0 - end - end - end - end - --WANDERING CONSTANTLY AT NIGHT - if self.state == 4 then - if self.npc_anim ~= ANIM_WALK then - self.anim = npc_get_animations_fast(visual) - self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_WALK - end - for _,object in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 12)) do - if object:is_player() then - if object:get_hp() > 0 then - NPC = self.object:getpos() - PLAYER = object:getpos() - self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z} - self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2 - if PLAYER.x > NPC.x then - self.yaw = self.yaw + math.pi - end - self.yaw = self.yaw - 2 - self.object:setyaw(self.yaw) - self.direction = {x = math.sin(self.yaw)*-1, y = 0, z = math.cos(self.yaw)} - if self.direction ~= nil then - self.object:setvelocity({x=self.direction.x*2.5,y=self.object:getvelocity().y,z=self.direction.z*2.5}) - end - --jump over obstacles - if self.jump_timer > 0.3 then - if minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then - self.object:setvelocity({x=self.object:getvelocity().x,y=5,z=self.object:getvelocity().z}) - self.jump_timer = 0 - end - end - if self.direction ~= nil then - if self.door_timer > 2 then - local is_a_door = minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name - if is_a_door == "doors:door_wood_t_1" then - minetest.punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}) - self.door_timer = 0 - end - local is_in_door = minetest.get_node(self.object:getpos()).name - if is_in_door == "doors:door_wood_t_1" then - minetest.punch_node(self.object:getpos()) - end - end - end - --return - end - elseif not object:is_player() then - self.state = 1 - self.attacker = "" - end - end - if self.direction ~= nil then - self.object:setvelocity({x=self.direction.x,y=self.object:getvelocity().y,z=self.direction.z}) - end - if self.turn_timer > math.random(1,4) then - self.yaw = 360 * math.random() - self.object:setyaw(self.yaw) - self.turn_timer = 0 - self.direction = {x = math.sin(self.yaw)*-1, y = -10, z = math.cos(self.yaw)} - end - if self.npc_anim ~= ANIM_WALK then - self.anim = npc_get_animations_fast(visual) - self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend) - self.npc_anim = ANIM_WALK - end - --open a door [alpha] - if self.direction ~= nil then - if self.door_timer > 2 then - local is_a_door = minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name - if is_a_door == "doors:door_wood_t_1" then - --print("door") - minetest.punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}) - self.door_timer = 0 - end - local is_in_door = minetest.get_node(self.object:getpos()).name - --print(dump(is_in_door)) - if is_in_door == "doors:door_wood_t_1" then - minetest.punch_node(self.object:getpos()) - end - end - end - --jump - if self.direction ~= nil then - if self.jump_timer > 0.3 then - --print(dump(minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}))) - if minetest.get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then - self.object:setvelocity({x=self.object:getvelocity().x,y=5,z=self.object:getvelocity().z}) - self.jump_timer = 0 - end - end - end - end -end - -minetest.register_entity("peaceful_npc:npc_fast", NPC_ENTITY_FAST) - diff --git a/peaceful_npc/recipes.lua b/peaceful_npc/recipes.lua deleted file mode 100644 index 72707d3..0000000 --- a/peaceful_npc/recipes.lua +++ /dev/null @@ -1,37 +0,0 @@ --- ---Crafts --- -function npc_recipes(spawn_type, summon_core) - minetest.register_craft({ - output = 'peaceful_npc:spawner_npc_'..spawn_type, - recipe = { - {'default:mese_block', 'default:glass', 'default:mese_block'}, - {'default:glass', 'peaceful_npc:summoner_npc_'..spawn_type, 'default:glass'}, - {'default:mese_block', 'default:glass', 'default:mese_block'}, - } - }) - - minetest.register_craft({ - output = 'peaceful_npc:summoner_npc_'..spawn_type, - recipe = { - {'default:mese_crystal', 'default:glass', 'default:mese_crystal'}, - {'default:glass', summon_core, 'default:glass'}, - {'default:mese_crystal', 'default:glass', 'default:mese_crystal'}, - } - }) - - minetest.register_craft({ - output = 'peaceful_npc:summoner_npc_'..spawn_type, - recipe = { - {'default:mese', 'default:glass', 'default:mese'}, - {'default:glass', summon_core, 'default:glass'}, - {'default:mese', 'default:glass', 'default:mese'}, - } - }) -end - -npc_recipes('def', 'default:steel_ingot') -npc_recipes('fast', 'default:cactus') -npc_recipes('dwarf', 'bucket:bucket_lava') - -print("Peaceful NPC recipes.lua loaded! By jojoa1997!")
\ No newline at end of file diff --git a/peaceful_npc/schematics/Gambit_village_house.we b/peaceful_npc/schematics/Gambit_village_house.we deleted file mode 100644 index 3e18402..0000000 --- a/peaceful_npc/schematics/Gambit_village_house.we +++ /dev/null @@ -1,268 +0,0 @@ -0 0 6 default:cobble 0 0 -0 0 7 stairs:stair_cobble 13 1 -0 0 8 default:cobble 0 0 -0 1 6 default:cobble 0 0 -0 1 8 default:cobble 0 0 -0 2 6 default:fence_wood 13 0 -0 2 8 default:fence_wood 13 0 -0 3 0 stairs:stair_wood 13 1 -0 3 1 stairs:stair_wood 13 1 -0 3 2 stairs:stair_wood 13 1 -0 3 3 stairs:stair_wood 13 1 -0 3 4 stairs:stair_wood 13 1 -0 3 5 stairs:stair_wood 13 1 -0 3 6 stairs:stair_wood 13 1 -0 3 7 stairs:stair_wood 13 1 -0 3 8 stairs:stair_wood 13 1 -0 3 9 stairs:stair_wood 13 1 -0 3 10 stairs:stair_wood 13 1 -1 0 1 default:tree 0 0 -1 0 2 default:fence_wood 12 0 -1 0 3 default:fence_wood 12 0 -1 0 4 default:fence_wood 12 0 -1 0 5 default:fence_wood 12 0 -1 0 6 default:tree 0 0 -1 0 7 default:cobble 0 0 -1 0 8 default:tree 0 0 -1 0 9 default:tree 0 0 -1 1 1 default:tree 0 0 -1 1 2 default:cobble 0 0 -1 1 3 default:cobble 0 0 -1 1 4 default:cobble 0 0 -1 1 5 default:cobble 0 0 -1 1 6 default:tree 0 0 -1 1 7 doors:door_wood_b_2 12 2 -1 1 8 default:tree 0 0 -1 1 9 default:tree 0 0 -1 2 1 default:tree 0 0 -1 2 2 default:wood 0 0 -1 2 3 default:glass 12 0 -1 2 4 default:wood 0 0 -1 2 5 default:wood 0 0 -1 2 6 default:tree 0 0 -1 2 7 doors:door_wood_t_2 12 2 -1 2 8 default:tree 0 0 -1 2 9 default:tree 0 0 -1 3 1 default:tree 0 0 -1 3 2 default:wood 0 0 -1 3 3 default:wood 0 0 -1 3 4 default:wood 0 0 -1 3 5 default:wood 0 0 -1 3 6 default:wood 0 0 -1 3 7 default:wood 0 0 -1 3 8 default:wood 0 0 -1 3 9 default:tree 0 0 -1 4 0 stairs:stair_wood 13 1 -1 4 1 stairs:stair_wood 13 1 -1 4 2 stairs:stair_wood 13 1 -1 4 3 stairs:stair_wood 13 1 -1 4 4 stairs:stair_wood 13 1 -1 4 5 stairs:stair_wood 13 1 -1 4 6 stairs:stair_wood 13 1 -1 4 7 stairs:stair_wood 13 1 -1 4 8 stairs:stair_wood 13 1 -1 4 9 stairs:stair_wood 13 1 -1 4 10 stairs:stair_wood 13 1 -2 0 1 default:fence_wood 12 0 -2 0 2 default:tree 0 0 -2 0 3 default:tree 0 0 -2 0 4 default:tree 0 0 -2 0 5 default:tree 0 0 -2 0 6 default:tree 0 0 -2 0 7 default:tree 0 0 -2 0 8 default:tree 0 0 -2 0 9 default:fence_wood 12 0 -2 1 1 default:cobble 0 0 -2 1 2 default:cobble 0 0 -2 1 3 default:furnace 0 3 -2 1 4 default:cobble 0 0 -2 1 5 default:cobble 0 0 -2 1 8 default:fence_wood 10 0 -2 1 9 default:cobble 0 0 -2 2 1 default:wood 0 0 -2 2 2 default:fence_wood 10 0 -2 2 4 default:fence_wood 10 0 -2 2 5 default:papyrus 9 0 -2 2 8 default:fence_wood 10 0 -2 2 9 default:wood 0 0 -2 3 1 default:wood 0 0 -2 3 2 stairs:slab_wood 9 0 -2 3 3 stairs:slab_wood 10 0 -2 3 4 stairs:slab_wood 9 0 -2 3 5 stairs:slab_wood 8 0 -2 3 6 stairs:slab_wood 9 0 -2 3 7 stairs:slab_wood 10 0 -2 3 8 stairs:slab_wood 9 0 -2 3 9 default:wood 0 0 -2 4 1 default:wood 0 0 -2 4 2 default:chest 0 3 -2 4 3 default:chest 0 3 -2 4 4 default:chest 0 3 -2 4 5 default:bookshelf 0 0 -2 4 6 default:bookshelf 0 0 -2 4 7 default:bookshelf 0 0 -2 4 8 default:bookshelf 0 0 -2 4 9 default:wood 0 0 -2 5 0 stairs:stair_wood 13 1 -2 5 1 stairs:stair_wood 13 1 -2 5 2 stairs:stair_wood 13 1 -2 5 3 stairs:stair_wood 13 1 -2 5 4 stairs:stair_wood 13 1 -2 5 5 stairs:stair_wood 13 1 -2 5 6 stairs:stair_wood 13 1 -2 5 7 stairs:stair_wood 13 1 -2 5 8 stairs:stair_wood 13 1 -2 5 9 stairs:stair_wood 13 1 -2 5 10 stairs:stair_wood 13 1 -3 0 1 default:fence_wood 12 0 -3 0 2 default:tree 0 0 -3 0 3 default:tree 0 0 -3 0 4 default:tree 0 0 -3 0 5 default:tree 0 0 -3 0 6 default:tree 0 0 -3 0 7 default:tree 0 0 -3 0 8 default:tree 0 0 -3 0 9 default:fence_wood 12 0 -3 1 1 default:cobble 0 0 -3 1 5 default:cobble 0 0 -3 1 9 default:cobble 0 0 -3 2 1 default:glass 12 0 -3 2 5 default:papyrus 9 0 -3 2 9 default:glass 12 0 -3 3 1 default:wood 0 0 -3 3 8 stairs:slab_wood 10 0 -3 3 9 default:wood 0 0 -3 4 1 default:wood 0 0 -3 4 8 default:bookshelf 0 0 -3 4 9 default:wood 0 0 -3 5 0 default:wood 0 0 -3 5 1 default:wood 0 0 -3 5 2 default:wood 0 0 -3 5 3 default:wood 0 0 -3 5 4 default:wood 0 0 -3 5 5 default:wood 0 0 -3 5 6 default:wood 0 0 -3 5 7 default:wood 0 0 -3 5 8 default:wood 0 0 -3 5 9 default:wood 0 0 -3 5 10 default:wood 0 0 -4 0 1 default:fence_wood 12 0 -4 0 2 default:tree 0 0 -4 0 3 default:tree 0 0 -4 0 4 default:tree 0 0 -4 0 5 default:tree 0 0 -4 0 6 default:tree 0 0 -4 0 7 default:tree 0 0 -4 0 8 default:tree 0 0 -4 0 9 default:fence_wood 12 0 -4 1 1 default:cobble 0 0 -4 1 9 default:cobble 0 0 -4 2 1 default:glass 12 0 -4 2 9 default:glass 12 0 -4 3 1 default:wood 0 0 -4 3 8 stairs:slab_wood 10 0 -4 3 9 default:wood 0 0 -4 4 1 default:wood 0 0 -4 4 8 default:bookshelf 0 0 -4 4 9 default:wood 0 0 -4 5 0 default:wood 0 0 -4 5 1 default:wood 0 0 -4 5 2 default:wood 0 0 -4 5 3 default:wood 0 0 -4 5 4 default:wood 0 0 -4 5 5 default:wood 0 0 -4 5 6 default:wood 0 0 -4 5 7 default:wood 0 0 -4 5 8 default:wood 0 0 -4 5 9 default:wood 0 0 -4 5 10 default:wood 0 0 -5 0 1 default:fence_wood 12 0 -5 0 2 default:tree 0 0 -5 0 3 default:tree 0 0 -5 0 4 default:tree 0 0 -5 0 5 default:tree 0 0 -5 0 6 default:tree 0 0 -5 0 7 default:tree 0 0 -5 0 8 default:tree 0 0 -5 0 9 default:fence_wood 12 0 -5 1 1 default:cobble 0 0 -5 1 8 default:fence_wood 9 0 -5 1 9 default:cobble 0 0 -5 2 1 default:wood 0 0 -5 2 8 default:fence_wood 10 0 -5 2 9 default:wood 0 0 -5 3 1 default:wood 0 0 -5 3 8 stairs:slab_wood 10 0 -5 3 9 default:wood 0 0 -5 4 1 default:wood 0 0 -5 4 8 default:bookshelf 0 0 -5 4 9 default:wood 0 0 -5 5 0 stairs:stair_wood 13 3 -5 5 1 stairs:stair_wood 13 3 -5 5 2 stairs:stair_wood 13 3 -5 5 3 stairs:stair_wood 13 3 -5 5 4 stairs:stair_wood 13 3 -5 5 5 stairs:stair_wood 13 3 -5 5 6 stairs:stair_wood 13 3 -5 5 7 stairs:stair_wood 13 3 -5 5 8 stairs:stair_wood 13 3 -5 5 9 stairs:stair_wood 13 3 -5 5 10 stairs:stair_wood 13 3 -6 0 1 default:tree 0 0 -6 0 2 default:fence_wood 12 0 -6 0 3 default:fence_wood 12 0 -6 0 4 default:fence_wood 12 0 -6 0 5 default:fence_wood 12 0 -6 0 6 default:fence_wood 12 0 -6 0 7 default:fence_wood 12 0 -6 0 8 default:fence_wood 12 0 -6 0 9 default:tree 0 0 -6 1 1 default:tree 0 0 -6 1 2 default:cobble 0 0 -6 1 3 default:cobble 0 0 -6 1 4 default:cobble 0 0 -6 1 5 default:cobble 0 0 -6 1 6 default:cobble 0 0 -6 1 7 default:cobble 0 0 -6 1 8 default:cobble 0 0 -6 1 9 default:tree 0 0 -6 2 1 default:tree 0 0 -6 2 2 default:wood 0 0 -6 2 3 default:glass 12 0 -6 2 4 default:wood 0 0 -6 2 5 default:glass 12 0 -6 2 6 default:wood 0 0 -6 2 7 default:glass 12 0 -6 2 8 default:wood 0 0 -6 2 9 default:tree 0 0 -6 3 1 default:tree 0 0 -6 3 2 default:wood 0 0 -6 3 3 default:wood 0 0 -6 3 4 default:wood 0 0 -6 3 5 default:wood 0 0 -6 3 6 default:wood 0 0 -6 3 7 default:wood 0 0 -6 3 8 default:wood 0 0 -6 3 9 default:tree 0 0 -6 4 0 stairs:stair_wood 13 3 -6 4 1 stairs:stair_wood 13 3 -6 4 2 stairs:stair_wood 13 3 -6 4 3 stairs:stair_wood 13 3 -6 4 4 stairs:stair_wood 13 3 -6 4 5 stairs:stair_wood 13 3 -6 4 6 stairs:stair_wood 13 3 -6 4 7 stairs:stair_wood 13 3 -6 4 8 stairs:stair_wood 13 3 -6 4 9 stairs:stair_wood 13 3 -6 4 10 stairs:stair_wood 13 3 -7 3 0 stairs:stair_wood 13 3 -7 3 1 stairs:stair_wood 13 3 -7 3 2 stairs:stair_wood 13 3 -7 3 3 stairs:stair_wood 13 3 -7 3 4 stairs:stair_wood 13 3 -7 3 5 stairs:stair_wood 13 3 -7 3 6 stairs:stair_wood 13 3 -7 3 7 stairs:stair_wood 13 3 -7 3 8 stairs:stair_wood 13 3 -7 3 9 stairs:stair_wood 13 3 -7 3 10 stairs:stair_wood 13 3
\ No newline at end of file diff --git a/peaceful_npc/schematics/npc_blacksmith.we b/peaceful_npc/schematics/npc_blacksmith.we deleted file mode 100644 index 27daeb1..0000000 --- a/peaceful_npc/schematics/npc_blacksmith.we +++ /dev/null @@ -1,275 +0,0 @@ -0 0 0 default:cobble 0 0 -0 0 1 default:cobble 0 0 -0 0 2 default:cobble 0 0 -0 0 3 default:cobble 0 0 -0 0 4 default:cobble 0 0 -0 0 5 default:cobble 0 0 -0 0 6 default:cobble 0 0 -0 0 7 default:cobble 0 0 -0 0 8 default:cobble 0 0 -0 0 9 default:cobble 0 0 -0 1 0 default:cobble 0 0 -0 1 1 default:cobble 0 0 -0 1 2 default:cobble 0 0 -0 1 3 default:cobble 0 0 -0 1 4 default:wood 0 0 -0 1 5 default:wood 0 0 -0 1 6 default:wood 0 0 -0 1 7 default:wood 0 0 -0 1 8 default:wood 0 0 -0 1 9 default:tree 0 0 -0 2 0 default:cobble 0 0 -0 2 1 default:cobble 0 0 -0 2 2 default:cobble 0 0 -0 2 3 default:cobble 0 0 -0 2 4 default:wood 0 0 -0 2 5 default:glass 29 0 -0 2 6 default:wood 0 0 -0 2 7 default:glass 13 0 -0 2 8 default:wood 0 0 -0 2 9 default:tree 0 0 -0 3 0 default:cobble 0 0 -0 3 1 default:cobble 0 0 -0 3 2 default:cobble 0 0 -0 3 3 default:cobble 0 0 -0 3 4 default:wood 0 0 -0 3 5 default:wood 0 0 -0 3 6 default:wood 0 0 -0 3 7 default:wood 0 0 -0 3 8 default:wood 0 0 -0 3 9 default:tree 0 0 -0 4 0 default:cobble 0 0 -0 4 1 default:cobble 0 0 -0 4 2 default:cobble 0 0 -0 4 3 default:cobble 0 0 -0 4 4 default:cobble 0 0 -0 4 5 default:cobble 0 0 -0 4 6 default:cobble 0 0 -0 4 7 default:cobble 0 0 -0 4 8 default:cobble 0 0 -0 4 9 default:tree 0 0 -0 5 0 stairs:slab_stone 93 0 -0 5 1 stairs:slab_stone 77 0 -0 5 2 stairs:slab_stone 61 0 -0 5 3 stairs:slab_stone 45 0 -0 5 4 stairs:slab_stone 29 0 -0 5 5 stairs:slab_stone 13 0 -0 5 6 stairs:slab_stone 13 0 -0 5 7 stairs:slab_stone 13 0 -0 5 8 stairs:slab_stone 13 0 -0 5 9 stairs:slab_stone 13 0 -1 0 0 default:cobble 0 0 -1 0 1 default:cobble 0 0 -1 0 2 default:cobble 0 0 -1 0 3 default:cobble 0 0 -1 0 4 default:cobble 0 0 -1 0 5 default:cobble 0 0 -1 0 6 default:cobble 0 0 -1 0 7 default:cobble 0 0 -1 0 8 default:cobble 0 0 -1 0 9 default:cobble 0 0 -1 1 0 default:cobble 0 0 -1 1 1 default:lava_source 0 0 -1 1 2 default:lava_source 0 0 -1 1 3 default:cobble 0 0 -1 1 4 default:chest 0 2 -1 1 7 stairs:stair_wood 11 0 -1 1 8 default:wood 0 0 -1 1 9 default:wood 0 0 -1 2 0 default:glass 189 0 -1 2 3 default:cobble 0 0 -1 2 9 default:wood 0 0 -1 3 0 default:cobble 0 0 -1 3 1 default:cobble 0 0 -1 3 2 default:cobble 0 0 -1 3 3 default:cobble 0 0 -1 3 9 default:wood 0 0 -1 4 0 default:cobble 0 0 -1 4 1 default:cobble 0 0 -1 4 2 default:cobble 0 0 -1 4 3 default:cobble 0 0 -1 4 4 default:cobble 0 0 -1 4 5 default:cobble 0 0 -1 4 6 default:cobble 0 0 -1 4 7 default:cobble 0 0 -1 4 8 default:cobble 0 0 -1 4 9 default:cobble 0 0 -1 5 0 stairs:slab_stone 109 0 -1 5 9 stairs:slab_stone 13 0 -2 0 0 default:cobble 0 0 -2 0 1 default:cobble 0 0 -2 0 2 default:cobble 0 0 -2 0 3 default:cobble 0 0 -2 0 4 default:cobble 0 0 -2 0 5 default:cobble 0 0 -2 0 6 default:cobble 0 0 -2 0 7 default:cobble 0 0 -2 0 8 default:cobble 0 0 -2 0 9 default:cobble 0 0 -2 1 0 default:cobble 0 0 -2 1 1 default:cobble 0 0 -2 1 2 default:cobble 0 0 -2 1 3 default:cobble 0 0 -2 1 7 default:fence_wood 10 0 -2 1 8 stairs:stair_wood 11 3 -2 1 9 default:wood 0 0 -2 2 0 default:glass 173 0 -2 2 3 default:cobble 0 0 -2 2 9 default:glass 13 0 -2 3 0 default:cobble 0 0 -2 3 1 default:cobble 0 0 -2 3 2 default:cobble 0 0 -2 3 3 default:cobble 0 0 -2 3 9 default:wood 0 0 -2 4 0 default:cobble 0 0 -2 4 1 default:cobble 0 0 -2 4 2 default:cobble 0 0 -2 4 3 default:cobble 0 0 -2 4 4 default:cobble 0 0 -2 4 5 default:cobble 0 0 -2 4 6 default:cobble 0 0 -2 4 7 default:cobble 0 0 -2 4 8 default:cobble 0 0 -2 4 9 default:cobble 0 0 -2 5 0 stairs:slab_stone 93 0 -2 5 9 stairs:slab_stone 13 0 -3 0 0 default:cobble 0 0 -3 0 1 default:cobble 0 0 -3 0 2 default:cobble 0 0 -3 0 3 default:cobble 0 0 -3 0 4 default:cobble 0 0 -3 0 5 default:cobble 0 0 -3 0 6 default:cobble 0 0 -3 0 7 default:cobble 0 0 -3 0 8 default:cobble 0 0 -3 0 9 default:cobble 0 0 -3 1 3 default:cobble 0 0 -3 1 4 default:wood 0 0 -3 1 5 default:wood 0 0 -3 1 9 default:wood 0 0 -3 2 3 default:furnace 0 0 -3 2 4 default:wood 0 0 -3 2 5 default:wood 0 0 -3 2 9 default:wood 0 0 -3 3 3 default:furnace 0 0 -3 3 4 default:wood 0 0 -3 3 5 default:wood 0 0 -3 3 9 default:wood 0 0 -3 4 0 default:cobble 0 0 -3 4 1 default:cobble 0 0 -3 4 2 default:cobble 0 0 -3 4 3 default:cobble 0 0 -3 4 4 default:cobble 0 0 -3 4 5 default:cobble 0 0 -3 4 6 default:cobble 0 0 -3 4 7 default:cobble 0 0 -3 4 8 default:cobble 0 0 -3 4 9 default:cobble 0 0 -3 5 0 stairs:slab_stone 77 0 -3 5 9 stairs:slab_stone 13 0 -4 0 0 default:cobble 0 0 -4 0 1 default:cobble 0 0 -4 0 2 default:cobble 0 0 -4 0 3 default:cobble 0 0 -4 0 4 default:cobble 0 0 -4 0 5 default:cobble 0 0 -4 0 6 default:cobble 0 0 -4 0 7 default:cobble 0 0 -4 0 8 default:cobble 0 0 -4 0 9 default:cobble 0 0 -4 1 6 default:wood 0 0 -4 1 9 default:wood 0 0 -4 2 6 default:wood 0 0 -4 2 9 default:glass 13 0 -4 3 6 default:wood 0 0 -4 3 9 default:wood 0 0 -4 4 0 default:cobble 0 0 -4 4 1 default:cobble 0 0 -4 4 2 default:cobble 0 0 -4 4 3 default:cobble 0 0 -4 4 4 default:cobble 0 0 -4 4 5 default:cobble 0 0 -4 4 6 default:cobble 0 0 -4 4 7 default:cobble 0 0 -4 4 8 default:cobble 0 0 -4 4 9 default:cobble 0 0 -4 5 0 stairs:slab_stone 61 0 -4 5 9 stairs:slab_stone 13 0 -5 0 0 default:cobble 0 0 -5 0 1 default:cobble 0 0 -5 0 2 default:cobble 0 0 -5 0 3 default:cobble 0 0 -5 0 4 default:cobble 0 0 -5 0 5 default:cobble 0 0 -5 0 6 default:cobble 0 0 -5 0 7 default:cobble 0 0 -5 0 8 default:cobble 0 0 -5 0 9 default:cobble 0 0 -5 1 1 default:stone 0 0 -5 1 9 default:wood 0 0 -5 2 9 default:wood 0 0 -5 3 6 default:wood 0 0 -5 3 9 default:wood 0 0 -5 4 0 default:cobble 0 0 -5 4 1 default:cobble 0 0 -5 4 2 default:cobble 0 0 -5 4 3 default:cobble 0 0 -5 4 4 default:cobble 0 0 -5 4 5 default:cobble 0 0 -5 4 6 default:cobble 0 0 -5 4 7 default:cobble 0 0 -5 4 8 default:cobble 0 0 -5 4 9 default:cobble 0 0 -5 5 0 stairs:slab_stone 45 0 -5 5 9 stairs:slab_stone 13 0 -6 0 0 default:cobble 0 0 -6 0 1 default:cobble 0 0 -6 0 2 default:cobble 0 0 -6 0 3 default:cobble 0 0 -6 0 4 default:cobble 0 0 -6 0 5 default:cobble 0 0 -6 0 6 default:cobble 0 0 -6 0 7 default:cobble 0 0 -6 0 8 default:cobble 0 0 -6 0 9 default:cobble 0 0 -6 1 0 default:fence_wood 93 0 -6 1 4 default:fence_wood 77 0 -6 1 6 default:tree 0 0 -6 1 7 default:wood 0 0 -6 1 8 default:wood 0 0 -6 1 9 default:tree 0 0 -6 2 0 default:fence_wood 109 0 -6 2 4 default:fence_wood 93 0 -6 2 6 default:tree 0 0 -6 2 7 default:wood 0 0 -6 2 8 default:wood 0 0 -6 2 9 default:tree 0 0 -6 3 0 default:fence_wood 93 0 -6 3 4 default:fence_wood 77 0 -6 3 6 default:tree 0 0 -6 3 7 default:wood 0 0 -6 3 8 default:wood 0 0 -6 3 9 default:tree 0 0 -6 4 0 default:cobble 0 0 -6 4 1 default:cobble 0 0 -6 4 2 default:cobble 0 0 -6 4 3 default:cobble 0 0 -6 4 4 default:cobble 0 0 -6 4 5 default:cobble 0 0 -6 4 6 default:tree 0 0 -6 4 7 default:cobble 0 0 -6 4 8 default:cobble 0 0 -6 4 9 default:tree 0 0 -6 5 0 stairs:slab_stone 29 0 -6 5 1 stairs:slab_stone 45 0 -6 5 2 stairs:slab_stone 45 0 -6 5 3 stairs:slab_stone 29 0 -6 5 4 stairs:slab_stone 13 0 -6 5 5 stairs:slab_stone 13 0 -6 5 6 stairs:slab_stone 13 0 -6 5 7 stairs:slab_stone 13 0 -6 5 8 stairs:slab_stone 13 0 -6 5 9 stairs:slab_stone 13 0 -7 0 1 stairs:stair_cobble 77 3 -7 0 2 stairs:stair_cobble 77 3 -7 0 3 stairs:stair_cobble 61 3
\ No newline at end of file diff --git a/peaceful_npc/spawning.lua b/peaceful_npc/spawning.lua deleted file mode 100644 index 8ce8f6f..0000000 --- a/peaceful_npc/spawning.lua +++ /dev/null @@ -1,86 +0,0 @@ ---Spawn function -function def_spawn(pos) - minetest.add_entity(pos, "peaceful_npc:npc_def") - print("want to spawn npc_def at "..dump(pos)) - if mode_debug == true then - minetest.chat_send_all("want to spawn npc_def at "..dump(pos)) - end -end - -function fast_spawn(pos) - minetest.add_entity(pos, "peaceful_npc:npc_fast") - print("want to spawn npc_fast at "..dump(pos)) - if mode_debug == true then - minetest.chat_send_all("want to spawn npc_fast at "..dump(pos)) - end -end - -function dwarf_spawn(pos) - minetest.add_entity(pos, "peaceful_npc:npc_dwarf") - print("want to spawn npc_dwarf at "..dump(pos)) - if mode_debug == true then - minetest.chat_send_all("want to spawn npc_dwarf at "..dump(pos)) - end -end - ---Mapgen biomes -plaingen_biome = { - surface = "default:dirt_with_grass", - avoid_nodes = {"group:liquid", "group:tree"}, - avoid_radius = 20, - rarity = 93, - max_count = 1, - min_elevation = -10, - max_elevation = 30, -} - -forestgen_biome = { - surface = {"group:tree", "default:leaves"}, - avoid_nodes = {"group:liquid"}, - avoid_radius = 10, - rarity = 96, - max_count = 1, - min_elevation = 20, - max_elevation = 50, -} - -beachgen_biome = { - surface = "default:sand", - avoid_nodes = {"group:liquid"}, - avoid_radius = 1, - rarity = 90, - max_count = 1, - min_elevation = 0, - max_elevation = 10, -} - -desertgen_biome = { - surface = { "default:desert_sand", "default:desert_stone"}, - avoid_nodes = {"group:liquid"}, - avoid_radius = 100, - rarity = 95, - max_count = 1, - min_elevation = 0, - max_elevation = 150, -} - -cavegen_biome = { - surface = { "default:stone_with_iron", "default:stone_with_coal", "default:stone_with_mese"}, - avoid_nodes = {"group:liquid"}, - avoid_radius = 5, - rarity = 98, - max_count = 1, - min_elevation = -500, - max_elevation = -50, - check_air = true, - spawn_replace_node = true, -} - ---spawn definers -biome_lib:register_generate_plant(plaingen_biome, "def_spawn") -biome_lib:register_generate_plant(forestgen_biome, "def_spawn") -biome_lib:register_generate_plant(beachgen_biome, "fast_spawn") -biome_lib:register_generate_plant(desertgen_biome, "fast_spawn") -biome_lib:register_generate_plant(cavegen_biome, "dwarf_spawn") - -print("Peaceful NPC spawning.lua loaded! By jojoa1997!")
\ No newline at end of file diff --git a/peaceful_npc/textures/peaceful_npc_npc_summoner_def.png b/peaceful_npc/textures/peaceful_npc_npc_summoner_def.png Binary files differdeleted file mode 100644 index 76932a9..0000000 --- a/peaceful_npc/textures/peaceful_npc_npc_summoner_def.png +++ /dev/null diff --git a/peaceful_npc/textures/peaceful_npc_npc_summoner_dwarf.png b/peaceful_npc/textures/peaceful_npc_npc_summoner_dwarf.png Binary files differdeleted file mode 100644 index 5ef7c3e..0000000 --- a/peaceful_npc/textures/peaceful_npc_npc_summoner_dwarf.png +++ /dev/null diff --git a/peaceful_npc/textures/peaceful_npc_npc_summoner_fast.png b/peaceful_npc/textures/peaceful_npc_npc_summoner_fast.png Binary files differdeleted file mode 100644 index 9034d90..0000000 --- a/peaceful_npc/textures/peaceful_npc_npc_summoner_fast.png +++ /dev/null diff --git a/peaceful_npc/textures/peaceful_npc_spawnegg.png b/peaceful_npc/textures/peaceful_npc_spawnegg.png Binary files differdeleted file mode 100644 index c2e8752..0000000 --- a/peaceful_npc/textures/peaceful_npc_spawnegg.png +++ /dev/null diff --git a/peaceful_npc/textures/peaceful_npc_spawner_def.png b/peaceful_npc/textures/peaceful_npc_spawner_def.png Binary files differdeleted file mode 100644 index 3be53b0..0000000 --- a/peaceful_npc/textures/peaceful_npc_spawner_def.png +++ /dev/null diff --git a/peaceful_npc/textures/peaceful_npc_spawner_dwarf.png b/peaceful_npc/textures/peaceful_npc_spawner_dwarf.png Binary files differdeleted file mode 100644 index 3a03bd4..0000000 --- a/peaceful_npc/textures/peaceful_npc_spawner_dwarf.png +++ /dev/null diff --git a/peaceful_npc/textures/peaceful_npc_spawner_fast.png b/peaceful_npc/textures/peaceful_npc_spawner_fast.png Binary files differdeleted file mode 100644 index 7fbc342..0000000 --- a/peaceful_npc/textures/peaceful_npc_spawner_fast.png +++ /dev/null diff --git a/peaceful_npc/todo.txt b/peaceful_npc/todo.txt deleted file mode 100644 index 9ce9868..0000000 --- a/peaceful_npc/todo.txt +++ /dev/null @@ -1 +0,0 @@ -i will be changeing the recipes to obsidian since it was added to minetest_game
\ No newline at end of file diff --git a/pipeworks/wielder.lua b/pipeworks/wielder.lua index b92176f..eb7931f 100644 --- a/pipeworks/wielder.lua +++ b/pipeworks/wielder.lua @@ -103,6 +103,8 @@ local function wielder_on(data, wielder_pos, wielder_node) get_look_dir = delay(vector.multiply(dir, -1)), get_look_pitch = delay(pitch), get_look_yaw = delay(yaw), + get_look_horizontal = delay(yaw), + get_look_vertical = delay(pitch), get_player_control = delay({ jump=false, right=false, left=false, LMB=false, RMB=false, sneak=data.sneak, aux1=false, down=false, up=false }), get_player_control_bits = delay(data.sneak and 64 or 0), get_player_name = delay(data.masquerade_as_owner and wielder_meta:get_string("owner") or ":pipeworks:"..minetest.pos_to_string(wielder_pos)), diff --git a/signs_lib/encoding.lua b/signs_lib/encoding.lua new file mode 100644 index 0000000..16e35fe --- /dev/null +++ b/signs_lib/encoding.lua @@ -0,0 +1,265 @@ +-- encoding borrowed from signs_lib mod of https://github.com/lord-server/lord + +local ansi_decode = { + [128] = "\208\130", + [129] = "\208\131", + [130] = "\226\128\154", + [131] = "\209\147", + [132] = "\226\128\158", + [133] = "\226\128\166", + [134] = "\226\128\160", + [135] = "\226\128\161", + [136] = "\226\130\172", + [137] = "\226\128\176", + [138] = "\208\137", + [139] = "\226\128\185", + [140] = "\208\138", + [141] = "\208\140", + [142] = "\208\139", + [143] = "\208\143", + [144] = "\209\146", + [145] = "\226\128\152", + [146] = "\226\128\153", + [147] = "\226\128\156", + [148] = "\226\128\157", + [149] = "\226\128\162", + [150] = "\226\128\147", + [151] = "\226\128\148", + [152] = "\194\152", + [153] = "\226\132\162", + [154] = "\209\153", + [155] = "\226\128\186", + [156] = "\209\154", + [157] = "\209\156", + [158] = "\209\155", + [159] = "\209\159", + [160] = "\194\160", + [161] = "\209\142", + [162] = "\209\158", + [163] = "\208\136", + [164] = "\194\164", + [165] = "\210\144", + [166] = "\194\166", + [167] = "\194\167", + [168] = "\208\129", + [169] = "\194\169", + [170] = "\208\132", + [171] = "\194\171", + [172] = "\194\172", + [173] = "\194\173", + [174] = "\194\174", + [175] = "\208\135", + [176] = "\194\176", + [177] = "\194\177", + [178] = "\208\134", + [179] = "\209\150", + [180] = "\210\145", + [181] = "\194\181", + [182] = "\194\182", + [183] = "\194\183", + [184] = "\209\145", + [185] = "\226\132\150", + [186] = "\209\148", + [187] = "\194\187", + [188] = "\209\152", + [189] = "\208\133", + [190] = "\209\149", + [191] = "\209\151" +} +local utf8_decode = { + [128] = { + [147] = "\150", + [148] = "\151", + [152] = "\145", + [153] = "\146", + [154] = "\130", + [156] = "\147", + [157] = "\148", + [158] = "\132", + [160] = "\134", + [161] = "\135", + [162] = "\149", + [166] = "\133", + [176] = "\137", + [185] = "\139", + [186] = "\155" + }, + [130] = {[172] = "\136"}, + [132] = {[150] = "\185", [162] = "\153"}, + [194] = { + [152] = "\152", + [160] = "\160", + [164] = "\164", + [166] = "\166", + [167] = "\167", + [169] = "\169", + [171] = "\171", + [172] = "\172", + [173] = "\173", + [174] = "\174", + [176] = "\176", + [177] = "\177", + [181] = "\181", + [182] = "\182", + [183] = "\183", + [187] = "\187" + }, + [208] = { + [129] = "\168", + [130] = "\128", + [131] = "\129", + [132] = "\170", + [133] = "\189", + [134] = "\178", + [135] = "\175", + [136] = "\163", + [137] = "\138", + [138] = "\140", + [139] = "\142", + [140] = "\141", + [143] = "\143", + [144] = "\192", + [145] = "\193", + [146] = "\194", + [147] = "\195", + [148] = "\196", + [149] = "\197", + [150] = "\198", + [151] = "\199", + [152] = "\200", + [153] = "\201", + [154] = "\202", + [155] = "\203", + [156] = "\204", + [157] = "\205", + [158] = "\206", + [159] = "\207", + [160] = "\208", + [161] = "\209", + [162] = "\210", + [163] = "\211", + [164] = "\212", + [165] = "\213", + [166] = "\214", + [167] = "\215", + [168] = "\216", + [169] = "\217", + [170] = "\218", + [171] = "\219", + [172] = "\220", + [173] = "\221", + [174] = "\222", + [175] = "\223", + [176] = "\224", + [177] = "\225", + [178] = "\226", + [179] = "\227", + [180] = "\228", + [181] = "\229", + [182] = "\230", + [183] = "\231", + [184] = "\232", + [185] = "\233", + [186] = "\234", + [187] = "\235", + [188] = "\236", + [189] = "\237", + [190] = "\238", + [191] = "\239" + }, + [209] = { + [128] = "\240", + [129] = "\241", + [130] = "\242", + [131] = "\243", + [132] = "\244", + [133] = "\245", + [134] = "\246", + [135] = "\247", + [136] = "\248", + [137] = "\249", + [138] = "\250", + [139] = "\251", + [140] = "\252", + [141] = "\253", + [142] = "\254", + [143] = "\255", + [144] = "\161", + [145] = "\184", + [146] = "\144", + [147] = "\131", + [148] = "\186", + [149] = "\190", + [150] = "\179", + [151] = "\191", + [152] = "\188", + [153] = "\154", + [154] = "\156", + [155] = "\158", + [156] = "\157", + [158] = "\162", + [159] = "\159" + }, + [210] = {[144] = "\165", [145] = "\180"} +} + +local nmdc = { + [36] = "$", + [124] = "|" +} + +function AnsiToUtf8(s) + local r, b = "" + for i = 1, s and s:len() or 0 do + b = s:byte(i) + if b < 128 then + r = r .. string.char(b) + else + if b > 239 then + r = r .. "\209" .. string.char(b - 112) + elseif b > 191 then + r = r .. "\208" .. string.char(b - 48) + elseif ansi_decode[b] then + r = r .. ansi_decode[b] + else + r = r .. "_" + end + end + end + return r +end + +function Utf8ToAnsi(s) + local a, j, r, b = 0, 0, "" + for i = 1, s and s:len() or 0 do + b = s:byte(i) + if b < 128 then + if nmdc[b] then + r = r .. nmdc[b] + else + r = r .. string.char(b) + end + elseif a == 2 then + a, j = a - 1, b + elseif a == 1 then + --if j == nil or b == nil then return r end + --print(j) + --print(b) + --local ansi = utf8_decode[j] + --if ansi == nil then return r end + --if ansi[b] == nil then return r end + if utf8_decode[j] then + if utf8_decode[j][b] then + a, r = a - 1, r .. utf8_decode[j][b] + end + end + elseif b == 226 then + a = 2 + elseif b == 194 or b == 208 or b == 209 or b == 210 then + j, a = b, 1 + else + r = r .. "_" + end + end + return r +end diff --git a/signs_lib/init.lua b/signs_lib/init.lua index 804a720..f5b39c7 100644 --- a/signs_lib/init.lua +++ b/signs_lib/init.lua @@ -16,8 +16,16 @@ local enable_colored_metal_signs = true local current_keyword = minetest.settings:get("interact_keyword") or "iaccept" signs_lib = {} +signs_lib.path = minetest.get_modpath(minetest.get_current_modname()) screwdriver = screwdriver or {} +-- Load support for intllib. +local S, NS = dofile(signs_lib.path .. "/intllib.lua") +signs_lib.gettext = S + +-- text encoding +dofile(signs_lib.path .. "/encoding.lua"); + signs_lib.wallmounted_rotate = function(pos, node, user, mode, new_param2) if mode ~= screwdriver.ROTATE_AXIS then return false end minetest.swap_node(pos, {name = node.name, param2 = (node.param2 + 1) % 6}) @@ -113,11 +121,6 @@ signs_lib.sign_post_model = { } } --- Load support for intllib. -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") -signs_lib.gettext = S - -- the list of standard sign nodes signs_lib.sign_node_list = { @@ -174,28 +177,48 @@ end -- CONSTANTS -local MP = minetest.get_modpath("signs_lib") - --- Used by `build_char_db' to locate the file. -local FONT_FMT = "%s/hdf_%02x.png" - --- Simple texture name for building text texture. -local FONT_FMT_SIMPLE = "hdf_%02x.png" - -- Path to the textures. -local TP = MP.."/textures" +local TP = signs_lib.path .. "/textures" +-- Font file formatter +local CHAR_FILE = "%s_%02x.png" +-- Fonts path +local CHAR_PATH = TP .. "/" .. CHAR_FILE + +-- Font name. +local font_name = "hdf" -- Lots of overkill here. KISS advocates, go away, shoo! ;) -- kaeza local PNG_HDR = string.char(0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A) +-- check if a file does exist +-- to avoid reopening file after checking again +-- pass TRUE as second argument +function file_exists(name, return_handle, mode) + mode = mode or "r"; + local f = io.open(name, mode) + if f ~= nil then + if (return_handle) then + return f + end + io.close(f) + return true + else + return false + end +end + -- Read the image size from a PNG file. -- Returns image_w, image_h. -- Only the LSB is read from each field! local function read_image_size(filename) - local f = io.open(filename, "rb") + local f = file_exists(filename, true, "rb") + -- file might not exist (don't crash the game) + if (not f) then + return 0, 0 + end f:seek("set", 0x0) - local hdr = f:read(8) + local hdr = f:read(string.len(PNG_HDR)) if hdr ~= PNG_HDR then f:close() return @@ -243,8 +266,8 @@ local function build_char_db() local total_width = 0 local char_count = 0 - for c = 32, 126 do - local w, h = read_image_size(FONT_FMT:format(TP, c)) + for c = 32, 255 do + local w, h = read_image_size(CHAR_PATH:format(font_name, c)) if w and h then local ch = string.char(c) charwidth[ch] = w @@ -308,6 +331,19 @@ local function fill_line(x, y, w, c) return table.concat(tex) end +-- make char texture file name +-- if texture file does not exist use fallback texture instead +local function char_tex(font_name, ch) + local c = ch:byte() + local exists, tex = file_exists(CHAR_PATH:format(font_name, c)) + if exists and c ~= 14 then + tex = CHAR_FILE:format(font_name, c) + else + tex = CHAR_FILE:format(font_name, 0x0) + end + return tex, exists +end + local function make_line_texture(line, lineno, pos) local width = 0 @@ -344,9 +380,9 @@ local function make_line_texture(line, lineno, pos) end if #chars < MAX_INPUT_CHARS then table.insert(chars, { - off=ch_offs, - tex=FONT_FMT_SIMPLE:format(c:byte()), - col=("%X"):format(cur_color), + off = ch_offs, + tex = char_tex(font_name, c), + col = ("%X"):format(cur_color), }) end ch_offs = ch_offs + w @@ -387,7 +423,10 @@ local function make_line_texture(line, lineno, pos) end table.insert(texture, (":%d,%d=%s"):format(xpos + ch.off, ypos, ch.tex)) end - table.insert(texture, (":%d,%d=hdf_20.png"):format(xpos + word.w, ypos)) + table.insert( + texture, + (":%d,%d="):format(xpos + word.w, ypos) .. char_tex(font_name, " ") + ) xpos = xpos + word.w + charwidth[" "] if xpos >= (SIGN_WIDTH + charwidth[" "]) then break end end @@ -413,10 +452,11 @@ end local function set_obj_text(obj, text, new, pos) local split = new and split_lines_and_words or split_lines_and_words_old + local text_ansi = Utf8ToAnsi(text) local n = minetest.registered_nodes[minetest.get_node(pos).name] local text_scale = (n and n.text_scale) or DEFAULT_TEXT_SCALE obj:set_properties({ - textures={make_sign_texture(split(text), pos)}, + textures={make_sign_texture(split(text_ansi), pos)}, visual_size = text_scale, }) end @@ -427,7 +467,7 @@ signs_lib.construct_sign = function(pos, locked) "formspec", "size[6,4]".. "textarea[0,-0.3;6.5,3;text;;${text}]".. - "button_exit[2,3.4;2,1;ok;Write]".. + "button_exit[2,3.4;2,1;ok;"..S("Write").."]".. "background[-0.5,-0.5;7,5;bg_signs_lib.jpg]") meta:set_string("infotext", "") end @@ -636,7 +676,7 @@ function signs_lib.receive_fields(pos, formname, fields, sender, lock) if fields and fields.text and fields.ok then minetest.log("action", S("@1 wrote \"@2\" to @3sign at @4", (sender:get_player_name() or ""), - fields.text, + fields.text:gsub('\\', '\\\\'):gsub("\n", "\\n"), lockstr, minetest.pos_to_string(pos) )) diff --git a/signs_lib/locale/de.po b/signs_lib/locale/de.po index 24f13a4..a2f4150 100644 --- a/signs_lib/locale/de.po +++ b/signs_lib/locale/de.po @@ -1,30 +1,35 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# German Translation for the signs_lib mod. +# Copyright (C) 2018 Vanessa Ezekowitz +# This file is distributed under the same license as the signs_lib package. +# Xanthin, 2017. +# CodeXP <codexp@gmx.net>, 2018. # msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-07-31 18:31+0200\n" -"PO-Revision-Date: 2017-07-31 18:35+0200\n" +"PO-Revision-Date: 2018-03-24 22:00+0100\n" +"Last-Translator: CodeXP <codexp@gmx.net>\n" "Language-Team: \n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.8.12\n" -"Last-Translator: Xanthin\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"Language: de\n" + +#: init.lua +msgid "Write" +msgstr "schreiben" #: init.lua msgid "Locked sign, owned by @1\n" -msgstr "" +msgstr "gesperrter Schild, gehört @1\n" #: init.lua msgid "locked " -msgstr "eingesperrt " +msgstr "gesperrt " #: init.lua #, fuzzy @@ -37,43 +42,43 @@ msgstr "Schild" #: init.lua msgid "Can edit all locked signs" -msgstr "" +msgstr "Kann alle gesperrte Schilder bearbeiten" #: init.lua msgid "Locked Sign" -msgstr "" +msgstr "gesperrter Schild" #: init.lua msgid "green" -msgstr "" +msgstr "grün" #: init.lua msgid "yellow" -msgstr "" +msgstr "gelb" #: init.lua msgid "red" -msgstr "" +msgstr "rot" #: init.lua msgid "white_red" -msgstr "" +msgstr "weißrot" #: init.lua msgid "white_black" -msgstr "" +msgstr "schwarzweiß" #: init.lua msgid "orange" -msgstr "" +msgstr "orange" #: init.lua msgid "blue" -msgstr "" +msgstr "blau" #: init.lua msgid "brown" -msgstr "" +msgstr "braun" #: init.lua msgid "Sign (@1, metal)" @@ -81,7 +86,7 @@ msgstr "Schild (@1, Metall)" #: init.lua msgid "Attempt to register unknown node as fence" -msgstr "" +msgstr "Versuch ein unbekanntes Element als Zaun zu registrieren" #: init.lua msgid "Registered @1 and @2" @@ -89,4 +94,4 @@ msgstr "Registrierte @1 und @2" #: init.lua msgid "[MOD] signs loaded" -msgstr "[MOD] signs geladen" +msgstr "[MOD] Schilder-Mod geladen" diff --git a/signs_lib/locale/ru.po b/signs_lib/locale/ru.po new file mode 100644 index 0000000..9cd01aa --- /dev/null +++ b/signs_lib/locale/ru.po @@ -0,0 +1,94 @@ +# Russian Translation for the signs_lib mod. +# Copyright (C) 2018 Vanessa Ezekowitz +# This file is distributed under the same license as the signs_lib package. +# CodeXP <codexp@gmx.net>, 2018. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: signs_lib\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-24 22:23+0100\n" +"PO-Revision-Date: \n" +"Last-Translator: CodeXP <codexp@gmx.net>\n" +"Language-Team: \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: init.lua +msgid "Write" +msgstr "записать" + +#: init.lua +msgid "Locked sign, owned by @1\n" +msgstr "защищенная табличка, пренадлежит @1\n" + +#: init.lua +msgid "locked " +msgstr "защищенный " + +#: init.lua +msgid "@1 wrote \"@2\" to @3sign at @4" +msgstr "@1 записал \"@2\" в @3sign на @4" + +#: init.lua +msgid "Sign" +msgstr "табличка" + +#: init.lua +msgid "Can edit all locked signs" +msgstr "Может редактировать все защищенные таблички" + +#: init.lua +msgid "Locked Sign" +msgstr "защищенная табличка" + +#: init.lua +msgid "green" +msgstr "зеленая" + +#: init.lua +msgid "yellow" +msgstr "желтая" + +#: init.lua +msgid "red" +msgstr "красная" + +#: init.lua +msgid "white_red" +msgstr "краснобелая" + +#: init.lua +msgid "white_black" +msgstr "чернобелая" + +#: init.lua +msgid "orange" +msgstr "оранжевая" + +#: init.lua +msgid "blue" +msgstr "синея" + +#: init.lua +msgid "brown" +msgstr "коричневая" + +#: init.lua +msgid "Sign (@1, metal)" +msgstr "Табличка (@1, металл)" + +#: init.lua +msgid "Attempt to register unknown node as fence" +msgstr "Попытка зарегистрировать неизвестный узел как забор" + +#: init.lua +msgid "Registered @1 and @2" +msgstr "Зарегистрировано @1 для @2" + +#: init.lua +msgid "[MOD] signs loaded" +msgstr "[MOD] мод табличек загружен" diff --git a/signs_lib/locale/template.pot b/signs_lib/locale/template.pot index 8a80e3c..e277437 100644 --- a/signs_lib/locale/template.pot +++ b/signs_lib/locale/template.pot @@ -1,23 +1,27 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# LANGUAGE Translation for the signs_lib mod. +# Copyright (C) 2018 Vanessa Ezekowitz +# This file is distributed under the same license as the signs_lib package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: signs_lib\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-31 18:00+0200\n" +"POT-Creation-Date: 2018-03-24 22:23+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: init.lua +msgid "Write" +msgstr "" + +#: init.lua msgid "Locked sign, owned by @1\n" msgstr "" diff --git a/signs_lib/textures/hdf_00.png b/signs_lib/textures/hdf_00.png Binary files differnew file mode 100644 index 0000000..ec762d5 --- /dev/null +++ b/signs_lib/textures/hdf_00.png diff --git a/signs_lib/textures/hdf_a8.png b/signs_lib/textures/hdf_a8.png Binary files differnew file mode 100644 index 0000000..75d1495 --- /dev/null +++ b/signs_lib/textures/hdf_a8.png diff --git a/signs_lib/textures/hdf_b8.png b/signs_lib/textures/hdf_b8.png Binary files differnew file mode 100644 index 0000000..c8215a1 --- /dev/null +++ b/signs_lib/textures/hdf_b8.png diff --git a/signs_lib/textures/hdf_b9.png b/signs_lib/textures/hdf_b9.png Binary files differnew file mode 100644 index 0000000..765437a --- /dev/null +++ b/signs_lib/textures/hdf_b9.png diff --git a/signs_lib/textures/hdf_c0.png b/signs_lib/textures/hdf_c0.png Binary files differnew file mode 100644 index 0000000..fe3e380 --- /dev/null +++ b/signs_lib/textures/hdf_c0.png diff --git a/signs_lib/textures/hdf_c1.png b/signs_lib/textures/hdf_c1.png Binary files differnew file mode 100644 index 0000000..f589c1c --- /dev/null +++ b/signs_lib/textures/hdf_c1.png diff --git a/signs_lib/textures/hdf_c2.png b/signs_lib/textures/hdf_c2.png Binary files differnew file mode 100644 index 0000000..ea6043a --- /dev/null +++ b/signs_lib/textures/hdf_c2.png diff --git a/signs_lib/textures/hdf_c3.png b/signs_lib/textures/hdf_c3.png Binary files differnew file mode 100644 index 0000000..1cc88a8 --- /dev/null +++ b/signs_lib/textures/hdf_c3.png diff --git a/signs_lib/textures/hdf_c4.png b/signs_lib/textures/hdf_c4.png Binary files differnew file mode 100644 index 0000000..1006dff --- /dev/null +++ b/signs_lib/textures/hdf_c4.png diff --git a/signs_lib/textures/hdf_c5.png b/signs_lib/textures/hdf_c5.png Binary files differnew file mode 100644 index 0000000..85c9b92 --- /dev/null +++ b/signs_lib/textures/hdf_c5.png diff --git a/signs_lib/textures/hdf_c6.png b/signs_lib/textures/hdf_c6.png Binary files differnew file mode 100644 index 0000000..7e5b16c --- /dev/null +++ b/signs_lib/textures/hdf_c6.png diff --git a/signs_lib/textures/hdf_c7.png b/signs_lib/textures/hdf_c7.png Binary files differnew file mode 100644 index 0000000..6303b0e --- /dev/null +++ b/signs_lib/textures/hdf_c7.png diff --git a/signs_lib/textures/hdf_c8.png b/signs_lib/textures/hdf_c8.png Binary files differnew file mode 100644 index 0000000..e8ece15 --- /dev/null +++ b/signs_lib/textures/hdf_c8.png diff --git a/signs_lib/textures/hdf_c9.png b/signs_lib/textures/hdf_c9.png Binary files differnew file mode 100644 index 0000000..d3dc073 --- /dev/null +++ b/signs_lib/textures/hdf_c9.png diff --git a/signs_lib/textures/hdf_ca.png b/signs_lib/textures/hdf_ca.png Binary files differnew file mode 100644 index 0000000..a940065 --- /dev/null +++ b/signs_lib/textures/hdf_ca.png diff --git a/signs_lib/textures/hdf_cb.png b/signs_lib/textures/hdf_cb.png Binary files differnew file mode 100644 index 0000000..fa96d93 --- /dev/null +++ b/signs_lib/textures/hdf_cb.png diff --git a/signs_lib/textures/hdf_cc.png b/signs_lib/textures/hdf_cc.png Binary files differnew file mode 100644 index 0000000..0c66142 --- /dev/null +++ b/signs_lib/textures/hdf_cc.png diff --git a/signs_lib/textures/hdf_cd.png b/signs_lib/textures/hdf_cd.png Binary files differnew file mode 100644 index 0000000..5677f03 --- /dev/null +++ b/signs_lib/textures/hdf_cd.png diff --git a/signs_lib/textures/hdf_ce.png b/signs_lib/textures/hdf_ce.png Binary files differnew file mode 100644 index 0000000..9314974 --- /dev/null +++ b/signs_lib/textures/hdf_ce.png diff --git a/signs_lib/textures/hdf_cf.png b/signs_lib/textures/hdf_cf.png Binary files differnew file mode 100644 index 0000000..fb6dee9 --- /dev/null +++ b/signs_lib/textures/hdf_cf.png diff --git a/signs_lib/textures/hdf_d0.png b/signs_lib/textures/hdf_d0.png Binary files differnew file mode 100644 index 0000000..74b0c17 --- /dev/null +++ b/signs_lib/textures/hdf_d0.png diff --git a/signs_lib/textures/hdf_d1.png b/signs_lib/textures/hdf_d1.png Binary files differnew file mode 100644 index 0000000..5197b0f --- /dev/null +++ b/signs_lib/textures/hdf_d1.png diff --git a/signs_lib/textures/hdf_d2.png b/signs_lib/textures/hdf_d2.png Binary files differnew file mode 100644 index 0000000..744f4eb --- /dev/null +++ b/signs_lib/textures/hdf_d2.png diff --git a/signs_lib/textures/hdf_d3.png b/signs_lib/textures/hdf_d3.png Binary files differnew file mode 100644 index 0000000..048856b --- /dev/null +++ b/signs_lib/textures/hdf_d3.png diff --git a/signs_lib/textures/hdf_d4.png b/signs_lib/textures/hdf_d4.png Binary files differnew file mode 100644 index 0000000..49e7b8c --- /dev/null +++ b/signs_lib/textures/hdf_d4.png diff --git a/signs_lib/textures/hdf_d5.png b/signs_lib/textures/hdf_d5.png Binary files differnew file mode 100644 index 0000000..f2df843 --- /dev/null +++ b/signs_lib/textures/hdf_d5.png diff --git a/signs_lib/textures/hdf_d6.png b/signs_lib/textures/hdf_d6.png Binary files differnew file mode 100644 index 0000000..8f77483 --- /dev/null +++ b/signs_lib/textures/hdf_d6.png diff --git a/signs_lib/textures/hdf_d7.png b/signs_lib/textures/hdf_d7.png Binary files differnew file mode 100644 index 0000000..20164b9 --- /dev/null +++ b/signs_lib/textures/hdf_d7.png diff --git a/signs_lib/textures/hdf_d8.png b/signs_lib/textures/hdf_d8.png Binary files differnew file mode 100644 index 0000000..72861b0 --- /dev/null +++ b/signs_lib/textures/hdf_d8.png diff --git a/signs_lib/textures/hdf_d9.png b/signs_lib/textures/hdf_d9.png Binary files differnew file mode 100644 index 0000000..497b45e --- /dev/null +++ b/signs_lib/textures/hdf_d9.png diff --git a/signs_lib/textures/hdf_da.png b/signs_lib/textures/hdf_da.png Binary files differnew file mode 100644 index 0000000..1c24540 --- /dev/null +++ b/signs_lib/textures/hdf_da.png diff --git a/signs_lib/textures/hdf_db.png b/signs_lib/textures/hdf_db.png Binary files differnew file mode 100644 index 0000000..e750c0e --- /dev/null +++ b/signs_lib/textures/hdf_db.png diff --git a/signs_lib/textures/hdf_dc.png b/signs_lib/textures/hdf_dc.png Binary files differnew file mode 100644 index 0000000..ce2e197 --- /dev/null +++ b/signs_lib/textures/hdf_dc.png diff --git a/signs_lib/textures/hdf_dd.png b/signs_lib/textures/hdf_dd.png Binary files differnew file mode 100644 index 0000000..bbb07bd --- /dev/null +++ b/signs_lib/textures/hdf_dd.png diff --git a/signs_lib/textures/hdf_de.png b/signs_lib/textures/hdf_de.png Binary files differnew file mode 100644 index 0000000..4c59047 --- /dev/null +++ b/signs_lib/textures/hdf_de.png diff --git a/signs_lib/textures/hdf_df.png b/signs_lib/textures/hdf_df.png Binary files differnew file mode 100644 index 0000000..7c29dde --- /dev/null +++ b/signs_lib/textures/hdf_df.png diff --git a/signs_lib/textures/hdf_e0.png b/signs_lib/textures/hdf_e0.png Binary files differnew file mode 100644 index 0000000..93d4b14 --- /dev/null +++ b/signs_lib/textures/hdf_e0.png diff --git a/signs_lib/textures/hdf_e1.png b/signs_lib/textures/hdf_e1.png Binary files differnew file mode 100644 index 0000000..7bf2382 --- /dev/null +++ b/signs_lib/textures/hdf_e1.png diff --git a/signs_lib/textures/hdf_e2.png b/signs_lib/textures/hdf_e2.png Binary files differnew file mode 100644 index 0000000..66b116a --- /dev/null +++ b/signs_lib/textures/hdf_e2.png diff --git a/signs_lib/textures/hdf_e3.png b/signs_lib/textures/hdf_e3.png Binary files differnew file mode 100644 index 0000000..5b0a418 --- /dev/null +++ b/signs_lib/textures/hdf_e3.png diff --git a/signs_lib/textures/hdf_e4.png b/signs_lib/textures/hdf_e4.png Binary files differnew file mode 100644 index 0000000..e3ec02d --- /dev/null +++ b/signs_lib/textures/hdf_e4.png diff --git a/signs_lib/textures/hdf_e5.png b/signs_lib/textures/hdf_e5.png Binary files differnew file mode 100644 index 0000000..09b431a --- /dev/null +++ b/signs_lib/textures/hdf_e5.png diff --git a/signs_lib/textures/hdf_e6.png b/signs_lib/textures/hdf_e6.png Binary files differnew file mode 100644 index 0000000..777b8cd --- /dev/null +++ b/signs_lib/textures/hdf_e6.png diff --git a/signs_lib/textures/hdf_e7.png b/signs_lib/textures/hdf_e7.png Binary files differnew file mode 100644 index 0000000..9da7dab --- /dev/null +++ b/signs_lib/textures/hdf_e7.png diff --git a/signs_lib/textures/hdf_e8.png b/signs_lib/textures/hdf_e8.png Binary files differnew file mode 100644 index 0000000..d7279ae --- /dev/null +++ b/signs_lib/textures/hdf_e8.png diff --git a/signs_lib/textures/hdf_e9.png b/signs_lib/textures/hdf_e9.png Binary files differnew file mode 100644 index 0000000..4d40313 --- /dev/null +++ b/signs_lib/textures/hdf_e9.png diff --git a/signs_lib/textures/hdf_ea.png b/signs_lib/textures/hdf_ea.png Binary files differnew file mode 100644 index 0000000..2533ec1 --- /dev/null +++ b/signs_lib/textures/hdf_ea.png diff --git a/signs_lib/textures/hdf_eb.png b/signs_lib/textures/hdf_eb.png Binary files differnew file mode 100644 index 0000000..4ef9129 --- /dev/null +++ b/signs_lib/textures/hdf_eb.png diff --git a/signs_lib/textures/hdf_ec.png b/signs_lib/textures/hdf_ec.png Binary files differnew file mode 100644 index 0000000..18e859b --- /dev/null +++ b/signs_lib/textures/hdf_ec.png diff --git a/signs_lib/textures/hdf_ed.png b/signs_lib/textures/hdf_ed.png Binary files differnew file mode 100644 index 0000000..edd951d --- /dev/null +++ b/signs_lib/textures/hdf_ed.png diff --git a/signs_lib/textures/hdf_ee.png b/signs_lib/textures/hdf_ee.png Binary files differnew file mode 100644 index 0000000..813e1f7 --- /dev/null +++ b/signs_lib/textures/hdf_ee.png diff --git a/signs_lib/textures/hdf_ef.png b/signs_lib/textures/hdf_ef.png Binary files differnew file mode 100644 index 0000000..f2f24d2 --- /dev/null +++ b/signs_lib/textures/hdf_ef.png diff --git a/signs_lib/textures/hdf_f0.png b/signs_lib/textures/hdf_f0.png Binary files differnew file mode 100644 index 0000000..697286c --- /dev/null +++ b/signs_lib/textures/hdf_f0.png diff --git a/signs_lib/textures/hdf_f1.png b/signs_lib/textures/hdf_f1.png Binary files differnew file mode 100644 index 0000000..01c1e64 --- /dev/null +++ b/signs_lib/textures/hdf_f1.png diff --git a/signs_lib/textures/hdf_f2.png b/signs_lib/textures/hdf_f2.png Binary files differnew file mode 100644 index 0000000..df2aaa3 --- /dev/null +++ b/signs_lib/textures/hdf_f2.png diff --git a/signs_lib/textures/hdf_f3.png b/signs_lib/textures/hdf_f3.png Binary files differnew file mode 100644 index 0000000..e09cf75 --- /dev/null +++ b/signs_lib/textures/hdf_f3.png diff --git a/signs_lib/textures/hdf_f4.png b/signs_lib/textures/hdf_f4.png Binary files differnew file mode 100644 index 0000000..2c0853b --- /dev/null +++ b/signs_lib/textures/hdf_f4.png diff --git a/signs_lib/textures/hdf_f5.png b/signs_lib/textures/hdf_f5.png Binary files differnew file mode 100644 index 0000000..fd21a81 --- /dev/null +++ b/signs_lib/textures/hdf_f5.png diff --git a/signs_lib/textures/hdf_f6.png b/signs_lib/textures/hdf_f6.png Binary files differnew file mode 100644 index 0000000..189a96f --- /dev/null +++ b/signs_lib/textures/hdf_f6.png diff --git a/signs_lib/textures/hdf_f7.png b/signs_lib/textures/hdf_f7.png Binary files differnew file mode 100644 index 0000000..87b2eca --- /dev/null +++ b/signs_lib/textures/hdf_f7.png diff --git a/signs_lib/textures/hdf_f8.png b/signs_lib/textures/hdf_f8.png Binary files differnew file mode 100644 index 0000000..3c195aa --- /dev/null +++ b/signs_lib/textures/hdf_f8.png diff --git a/signs_lib/textures/hdf_f9.png b/signs_lib/textures/hdf_f9.png Binary files differnew file mode 100644 index 0000000..9fb54ba --- /dev/null +++ b/signs_lib/textures/hdf_f9.png diff --git a/signs_lib/textures/hdf_fa.png b/signs_lib/textures/hdf_fa.png Binary files differnew file mode 100644 index 0000000..da72b46 --- /dev/null +++ b/signs_lib/textures/hdf_fa.png diff --git a/signs_lib/textures/hdf_fb.png b/signs_lib/textures/hdf_fb.png Binary files differnew file mode 100644 index 0000000..6cfd0fe --- /dev/null +++ b/signs_lib/textures/hdf_fb.png diff --git a/signs_lib/textures/hdf_fc.png b/signs_lib/textures/hdf_fc.png Binary files differnew file mode 100644 index 0000000..c8c6918 --- /dev/null +++ b/signs_lib/textures/hdf_fc.png diff --git a/signs_lib/textures/hdf_fd.png b/signs_lib/textures/hdf_fd.png Binary files differnew file mode 100644 index 0000000..9130ccd --- /dev/null +++ b/signs_lib/textures/hdf_fd.png diff --git a/signs_lib/textures/hdf_fe.png b/signs_lib/textures/hdf_fe.png Binary files differnew file mode 100644 index 0000000..5165296 --- /dev/null +++ b/signs_lib/textures/hdf_fe.png diff --git a/signs_lib/textures/hdf_ff.png b/signs_lib/textures/hdf_ff.png Binary files differnew file mode 100644 index 0000000..a1a1f10 --- /dev/null +++ b/signs_lib/textures/hdf_ff.png diff --git a/technic/machines/register/recipes.lua b/technic/machines/register/recipes.lua index d30fd4f..f9e2458 100644 --- a/technic/machines/register/recipes.lua +++ b/technic/machines/register/recipes.lua @@ -51,7 +51,7 @@ local function register_recipe(typename, data) end technic.recipes[typename].recipes[index] = recipe - if unified_inventory and technic.recipes[typename].output_size == 1 then + if have_ui and technic.recipes[typename].output_size == 1 then unified_inventory.register_craft({ type = typename, output = data.output, diff --git a/jumping/textures/jumping_cushion_sides.png b/textures/jumping_cushion_sides.png Binary files differindex 8c6de57..8c6de57 100644 --- a/jumping/textures/jumping_cushion_sides.png +++ b/textures/jumping_cushion_sides.png diff --git a/jumping/textures/jumping_cushion_tb.png b/textures/jumping_cushion_tb.png Binary files differindex 09b50e8..09b50e8 100644 --- a/jumping/textures/jumping_cushion_tb.png +++ b/textures/jumping_cushion_tb.png diff --git a/jumping/textures/jumping_trampoline_bottom.png b/textures/jumping_trampoline_bottom.png Binary files differindex cd9da65..cd9da65 100644 --- a/jumping/textures/jumping_trampoline_bottom.png +++ b/textures/jumping_trampoline_bottom.png diff --git a/jumping/textures/jumping_trampoline_sides.png b/textures/jumping_trampoline_sides.png Binary files differindex a5f3689..a5f3689 100644 --- a/jumping/textures/jumping_trampoline_sides.png +++ b/textures/jumping_trampoline_sides.png diff --git a/jumping/textures/jumping_trampoline_sides_overlay1.png b/textures/jumping_trampoline_sides_overlay1.png Binary files differindex aebcf05..aebcf05 100644 --- a/jumping/textures/jumping_trampoline_sides_overlay1.png +++ b/textures/jumping_trampoline_sides_overlay1.png diff --git a/jumping/textures/jumping_trampoline_sides_overlay2.png b/textures/jumping_trampoline_sides_overlay2.png Binary files differindex 74f43fa..74f43fa 100644 --- a/jumping/textures/jumping_trampoline_sides_overlay2.png +++ b/textures/jumping_trampoline_sides_overlay2.png diff --git a/jumping/textures/jumping_trampoline_sides_overlay3.png b/textures/jumping_trampoline_sides_overlay3.png Binary files differindex d619fcc..d619fcc 100644 --- a/jumping/textures/jumping_trampoline_sides_overlay3.png +++ b/textures/jumping_trampoline_sides_overlay3.png diff --git a/jumping/textures/jumping_trampoline_sides_overlay4.png b/textures/jumping_trampoline_sides_overlay4.png Binary files differindex f1679e6..f1679e6 100644 --- a/jumping/textures/jumping_trampoline_sides_overlay4.png +++ b/textures/jumping_trampoline_sides_overlay4.png diff --git a/jumping/textures/jumping_trampoline_sides_overlay5.png b/textures/jumping_trampoline_sides_overlay5.png Binary files differindex 2af894d..2af894d 100644 --- a/jumping/textures/jumping_trampoline_sides_overlay5.png +++ b/textures/jumping_trampoline_sides_overlay5.png diff --git a/jumping/textures/jumping_trampoline_sides_overlay6.png b/textures/jumping_trampoline_sides_overlay6.png Binary files differindex 3c2fa6e..3c2fa6e 100644 --- a/jumping/textures/jumping_trampoline_sides_overlay6.png +++ b/textures/jumping_trampoline_sides_overlay6.png diff --git a/jumping/textures/jumping_trampoline_top.png b/textures/jumping_trampoline_top.png Binary files differindex a927fdb..a927fdb 100644 --- a/jumping/textures/jumping_trampoline_top.png +++ b/textures/jumping_trampoline_top.png diff --git a/unifieddyes/init.lua b/unifieddyes/init.lua index 487ac01..51cc671 100644 --- a/unifieddyes/init.lua +++ b/unifieddyes/init.lua @@ -1044,6 +1044,7 @@ minetest.register_alias("dye:medium_orange", "dye:brown") minetest.register_alias("unifieddyes:black", "dye:black") minetest.register_alias("unifieddyes:dark_grey", "dye:dark_grey") +minetest.register_alias("unifieddyes:grey", "dye:grey") minetest.register_alias("unifieddyes:light_grey", "dye:light_grey") minetest.register_alias("unifieddyes:white", "dye:white") @@ -1067,6 +1068,7 @@ minetest.register_alias("unifieddyes:carbon_black", "dye:black") minetest.register_alias("unifieddyes:aqua", "unifieddyes:spring") minetest.register_alias("unifieddyes:skyblue", "unifieddyes:azure") minetest.register_alias("unifieddyes:redviolet", "unifieddyes:rose") +minetest.register_alias("unifieddyes:brown", "dye:brown") print(S("[UnifiedDyes] Loaded!")) diff --git a/unifieddyes/locale/es.txt b/unifieddyes/locale/es.txt new file mode 100644 index 0000000..7b46b48 --- /dev/null +++ b/unifieddyes/locale/es.txt @@ -0,0 +1,87 @@ +# Traducido por Carlos Barraza + +Lime Dye = Colorante Lima +Aqua Dye = Colorante Agua +Sky-blue Dye = Colorante Azul Cielo +Red-violet Dye = Colorante Rojo Violeta +Light Grey Dye = Colorante Gris Claro + +Dark Red Dye (low saturation) = Colorante Rojo Oscuro (baja saturación) +Dark Orange Dye (low saturation) = Colorante Naranja Oscuro (baja saturación) +Dark Yellow Dye (low saturation) = Colorante Amarillo Oscuro (baja saturación) +Dark Lime Dye (low saturation) = Colorante Lima Oscuro (baja saturación) +Dark Green Dye (low saturation) = Colorante Verde Oscuro (baja saturación) +Dark Aqua Dye (low saturation) = Colorante Agua Oscuro (baja saturación) +Dark Cyan Dye (low saturation) = Colorante Cian Oscuro (baja saturación) +Dark Sky-blue Dye (low saturation) = Colorante Azul Cielo Oscuro (baja saturación) +Dark Blue Dye (low saturation) = Colorante Azul Oscuro (baja saturación) +Dark Violet Dye (low saturation) = Colorante Violeta Oscuro (baja saturación) +Dark Magenta Dye (low saturation) = Colorante Magenta Oscuro (baja saturación) +Dark Red-violet Dye (low saturation) = Colorante Rojo Violeta Oscuro (baja saturación) + +Dark Red Dye = Colorante Rojo Oscuro +Dark Orange Dye = Colorante Naranja Oscuro +Dark Yellow Dye = Colorante Amarillo Oscuro +Dark Lime Dye = Colorante Lima Oscuro +Dark Green Dye = Colorante Verde Oscuro +Dark Aqua Dye = Colorante Agua Oscuro +Dark Cyan Dye = Colorante Cian Oscuro +Dark Sky-blue Dye = Colorante Azul Cielo Oscuro +Dark Blue Dye = Colorante Azul Oscuro +Dark Violet Dye = Colorante Violeta Oscuro +Dark Magenta Dye = Colorante Magenta Oscuro +Dark Red-violet Dye = Colorante Rojo Violeta Oscuro + +Medium Red Dye (low saturation) = Colorante Rojo Claro (baja saturación) +Medium Orange Dye (low saturation) = Colorante Naranja Claro (baja saturación) +Medium Yellow Dye (low saturation) = Colorante Amarillo Claro (baja saturación) +Medium Lime Dye (low saturation) = Colorante Lima Claro (baja saturación) +Medium Green Dye (low saturation) = Colorante Verde Claro (baja saturación) +Medium Aqua Dye (low saturation) = Colorante Agua Claro (baja saturación) +Medium Cyan Dye (low saturation) = Colorante Cian Claro (baja saturación) +Medium Sky-blue Dye (low saturation) = Colorante Azul Cielo Claro (baja saturación) +Medium Blue Dye (low saturation) = Colorante Azul Claro (baja saturación) +Medium Violet Dye (low saturation) = Colorante Violeta Claro (baja saturación) +Medium Magenta Dye (low saturation) = Colorante Magenta Claro (baja saturación) +Medium Red-violet Dye (low saturation) = Colorante Rojo Violeta Claro (baja saturación) + +Medium Red Dye = Colorante Rojo Claro +Medium Orange Dye = Colorante Naranja Claro +Medium Yellow Dye = Colorante Amarillo Claro +Medium Lime Dye = Colorante Lima Claro +Medium Green Dye = Colorante Verde Claro +Medium Aqua Dye = Colorante Agua Claro +Medium Cyan Dye = Colorante Cian Claro +Medium Sky-blue = Colorante Azul Cielo Claro +Medium Blue Dye = Colorante Azul Claro +Medium Violet Dye = Colorante Violeta Claro +Medium Magenta Dye = Colorante Magenta Claro +Medium Red-violet Dye = Colorante Rojo Violeta Claro + +Red Dye (low saturation) = Colorante Rojo (baja saturación) +Orange Dye (low saturation) = Colorante Naranja (baja saturación) +Yellow Dye (low saturation) = Colorante Amarillo (baja saturación) +Lime Dye (low saturation) = Colorante Lima (baja saturación) +Green Dye (low saturation) = Colorante Verde (baja saturación) +Aqua Dye (low saturation) = Colorante Agua (baja saturación) +Cyan Dye (low saturation) = Colorante Cian (baja saturación) +Sky-blue Dye (low saturation) = Colorante Azul Cielo (baja saturación) +Blue Dye (low saturation) = Colorante Azul (baja saturación) +Violet Dye (low saturation) = Colorante Violeta (baja saturación) +Magenta Dye (low saturation) = Colorante Magenta (baja saturación) +Red-violet Dye (low saturation) = Colorante Rojo Violeta (baja saturación) + +Red Dye = Colorante Rojo +Orange Dye = Colorante Naranja +Yellow Dye = Colorante Amarillo +Lime Dye = Colorante Lima +Green Dye = Colorante Verde +Aqua Dye = Colorante Agua +Cyan Dye = Colorante Cian +Sky-blue Dye = Colorante Azul Cielo +Blue Dye = Colorante Azul +Violet Dye = Colorante Violeta +Magenta Dye = Colorante Magenta +Red-violet Dye = Colorante Rojo Violeta + +[UnifiedDyes] Loaded! = [ColorantesUnificados] Cargado. |