diff --git a/mods/3d_armor/3d_armor/README.txt b/mods/3d_armor/3d_armor/README.txt index 7dbe82d..b8980b5 100644 --- a/mods/3d_armor/3d_armor/README.txt +++ b/mods/3d_armor/3d_armor/README.txt @@ -160,6 +160,22 @@ Adds wear to a single armor itemstack, triggers `on_damage` callbacks and updates the necessary inventories. Also handles item destruction callbacks and so should NOT be called from `on_unequip` to avoid an infinite loop. +armor:remove_all(player) + +Removes all armors from the player's inventory without triggering any callback. + +armor:equip(player, armor_name) + +Equip the armor, removing the itemstack from the main inventory if there's one. + +armor:unequip(player, armor_name) + +Unequip the armor, adding the itemstack to the main inventory. + +armor:update_skin(player_name) + +Triggers a skin update with the same action as if a field with `skins_set` was submitted. + Item Callbacks: on_equip = func(player, index, stack) @@ -189,3 +205,8 @@ armor:register_on_update(function(player) print(player:get_player_name().." armor updated!") end) + +Note: + +The player physics modifications won't be applied via `set_physics_override` if `player_physics_locked` is set to 1 +in the respective player's meta. diff --git a/mods/3d_armor/3d_armor/api.lua b/mods/3d_armor/3d_armor/api.lua index 565a2a6..7dd1c4e 100644 --- a/mods/3d_armor/3d_armor/api.lua +++ b/mods/3d_armor/3d_armor/api.lua @@ -5,6 +5,7 @@ local skin_previews = {} local use_player_monoids = minetest.global_exists("player_monoids") local use_armor_monoid = minetest.global_exists("armor_monoid") local use_pova_mod = minetest.get_modpath("pova") +local use_playerphysics = minetest.global_exists("playerphysics") local armor_def = setmetatable({}, { __index = function() return setmetatable({ @@ -103,6 +104,19 @@ armor.config = { -- Armor Registration armor.register_armor = function(self, name, def) + def.on_secondary_use = function(itemstack, player) + return armor:equip(player, itemstack) + end + def.on_place = function(itemstack, player, pointed_thing) + if pointed_thing.type == "node" and player and not player:get_player_control().sneak then + local node = minetest.get_node(pointed_thing.under) + local ndef = minetest.registered_nodes[node.name] + if ndef and ndef.on_rightclick then + return ndef.on_rightclick(pointed_thing.under, node, player, itemstack, pointed_thing) + end + end + return armor:equip(player, itemstack) + end minetest.register_tool(name, def) end @@ -184,7 +198,7 @@ armor.set_player_armor = function(self, player) local state = 0 local count = 0 local material = {count=1} - local preview = armor:get_preview(player, name) + local preview = armor:get_preview(name) local texture = "3d_armor_trans.png" local physics = {} local attributes = {} @@ -286,7 +300,14 @@ armor.set_player_armor = function(self, player) end player:set_armor_groups(groups) end - if use_player_monoids then + if use_playerphysics then + playerphysics.remove_physics_factor(player, "speed", "3d_armor:physics") + playerphysics.remove_physics_factor(player, "jump", "3d_armor:physics") + playerphysics.remove_physics_factor(player, "gravity", "3d_armor:physics") + playerphysics.add_physics_factor(player, "speed", "3d_armor:physics", physics.speed) + playerphysics.add_physics_factor(player, "jump", "3d_armor:physics", physics.jump) + playerphysics.add_physics_factor(player, "gravity", "3d_armor:physics", physics.gravity) + elseif use_player_monoids then player_monoids.speed:add_change(player, physics.speed, "3d_armor:physics") player_monoids.jump:add_change(player, physics.jump, @@ -302,7 +323,10 @@ armor.set_player_armor = function(self, player) }) pova.do_override(player) else - player:set_physics_override(physics) + local player_physics_locked = player:get_meta():get_int("player_physics_locked") + if player_physics_locked == nil or player_physics_locked == 0 then + player:set_physics_override(physics) + end end self.textures[name].armor = texture self.textures[name].preview = preview @@ -406,11 +430,69 @@ armor.damage = function(self, player, index, stack, use) end end -armor.get_player_skin = function(self, player, name) - local meta = player:get_meta() - if player:get_meta():get_string("gender") == "female" then - return "female.png" +armor.get_weared_armor_elements = function(self, player) + local name, inv = self:get_valid_player(player, "[get_weared_armor]") + local weared_armor = {} + if not name then + return end + for i=1, inv:get_size("armor") do + local item_name = inv:get_stack("armor", i):get_name() + local element = self:get_element(item_name) + if element ~= nil then + weared_armor[element] = item_name + end + end + return weared_armor +end + +armor.equip = function(self, player, itemstack) + local name, armor_inv = self:get_valid_player(player, "[equip]") + local weared_armor = self:get_weared_armor_elements(player) + local armor_element = self:get_element(itemstack:get_name()) + if name and armor_element then + if weared_armor[armor_element] ~= nil then + self:unequip(player, armor_element) + end + armor_inv:add_item("armor", itemstack:take_item()) + self:set_player_armor(player) + self:save_armor_inventory(player) + end + return itemstack +end + +armor.unequip = function(self, player, armor_element) + local name, armor_inv = self:get_valid_player(player, "[unequip]") + local weared_armor = self:get_weared_armor_elements(player) + if not name or not weared_armor[armor_element] then + return + end + local itemstack = armor_inv:remove_item("armor", ItemStack(weared_armor[armor_element])) + minetest.after(0, function() + local inv = player:get_inventory() + if inv:room_for_item("main", itemstack) then + inv:add_item("main", itemstack) + else + minetest.add_item(player:get_pos(), itemstack) + end + end) + self:set_player_armor(player) + self:save_armor_inventory(player) +end + +armor.remove_all = function(self, player) + local name, inv = self:get_valid_player(player, "[remove_all]") + if not name then + return + end + inv:set_list("armor", {}) + self:set_player_armor(player) + self:save_armor_inventory(player) +end + +armor.get_player_skin = function(self, name) + local player = minetest.get_player_by_name(name) + local meta = player:get_meta() if (self.skin_mod == "skins" or self.skin_mod == "simple_skins") and skins.skins[name] then return skins.skins[name]..".png" elseif self.skin_mod == "u_skins" and u_skins.u_skins[name] then @@ -418,7 +500,21 @@ armor.get_player_skin = function(self, player, name) elseif self.skin_mod == "wardrobe" and wardrobe.playerSkins and wardrobe.playerSkins[name] then return wardrobe.playerSkins[name] end - return armor.default_skin..".png" + if player:get_meta():get_string("gender") == "female" then + return "female.png" + else + return "character.png" + end +end + +armor.update_skin = function(self, name) + minetest.after(0, function() + local pplayer = minetest.get_player_by_name(name) + if pplayer then + self.textures[name].skin = self:get_player_skin(name) + self:set_player_armor(pplayer) + end + end) end armor.add_preview = function(self, preview) diff --git a/mods/3d_armor/3d_armor/init.lua b/mods/3d_armor/3d_armor/init.lua index 9ab8356..c3e83ae 100644 --- a/mods/3d_armor/3d_armor/init.lua +++ b/mods/3d_armor/3d_armor/init.lua @@ -246,7 +246,7 @@ local function init_player_armor(initplayer) for group, _ in pairs(armor.registered_groups) do armor.def[name].groups[group] = 0 end - local skin = armor:get_player_skin(initplayer, name) + local skin = armor:get_player_skin(name) armor.textures[name] = { skin = skin, armor = "3d_armor_trans.png", @@ -311,14 +311,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local player_name = player:get_player_name() for field, _ in pairs(fields) do if string.find(field, "skins_set") then - minetest.after(0, function() - local pplayer = minetest.get_player_by_name(player_name) - if player then - local skin = armor:get_player_skin(player, name) - armor.textures[name].skin = skin - armor:set_player_armor(pplayer) - end - end) + armor:update_skin(player_name) end end end) diff --git a/mods/3d_armor/3d_armor/locale/3d_armor.it.tr b/mods/3d_armor/3d_armor/locale/3d_armor.it.tr index 446f57d..d8be62e 100644 --- a/mods/3d_armor/3d_armor/locale/3d_armor.it.tr +++ b/mods/3d_armor/3d_armor/locale/3d_armor.it.tr @@ -3,9 +3,9 @@ ### api.lua ### -3d_armor: Detached armor inventory is nil @1=3d_armor: L'inventario staccato dell'armatura è nullo @1 -3d_armor: Player name is nil @1=3d_armor: Il nome della/del gicatrice/tore è nullo @1 -3d_armor: Player reference is nil @1=3d_armor: Il riferimento alla/al giocatrice/tore è nullo @1 +3d_armor: Detached armor inventory is nil @1=3d_armor: L'inventario separato dell'armatura è nullo @1 +3d_armor: Player name is nil @1=3d_armor: Il nome dell'utente è nullo @1 +3d_armor: Player reference is nil @1=3d_armor: Il riferimento all'utente è nullo @1 ### armor.lua ### @@ -37,10 +37,10 @@ Mithril Boots=Stivali di mithril Mithril Chestplate=Corazza di mithril Mithril Helmet=Elmo di mithril Mithril Leggings=Gambali di mithril -Steel Boots=Stivali di acciaio -Steel Chestplate=Corazza di acciaio -Steel Helmet=Elmo di acciaio -Steel Leggings=Gambali di acciaio +Steel Boots=Stivali d'acciaio +Steel Chestplate=Corazza d'acciaio +Steel Helmet=Elmo d'acciaio +Steel Leggings=Gambali d'acciaio Wood Boots=Stivali di legno Wood Chestplate=Corazza di legno Wood Helmet=Elmo di legno @@ -48,28 +48,28 @@ Wood Leggings=Gambali di legno ### init.lua ### -3d_armor: Failed to initialize player=3d_armor: Inizializzazione della/del giocatrice/tore fallita +3d_armor: Failed to initialize player=3d_armor: Inizializzazione dell'utente fallita Fire=Fuoco Heal=Guarigione Level=Livello Radiation=Radiazione -Your @1 got destroyed!=Il/i vostro/i @1 è/sono stato/i distrutto/i! -Your @1 is almost broken!= +Your @1 got destroyed!=@1 in frantumi! +Your @1 is almost broken!=@1 quasi in frantumi! [3d_armor] Fire Nodes disabled=[3d_armor] Nodi fuoco disabilitati ##### not used anymore ##### -3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mod caricato ma inutilizzato. +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mod caricata ma inutilizzata. Back=Indietro Armor=Armatura -3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mod caricato ma inutilizzato. +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mod caricata ma inutilizzata. Armor stand top=Parte superiore del supporto per armatura Armor stand=Supporto per armatura Armor Stand=Supporto per armatura Locked Armor stand=Supporto per armatura chiuso a chiave Armor Stand (owned by @1)=Supporto per armatura (di proprietà di @1) -3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mod caricato ma inutilizzato. +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mod caricata ma inutilizzata. 3d Armor=Armatura 3D Armor not initialized!=Armatura non inizializzata! Admin Shield=Scudo dell'amministratrice/tore @@ -77,7 +77,7 @@ Wooden Shield=Scudo di legno Enhanced Wood Shield=Scudo di legno migliorato Cactus Shield=Scudo di cactus Enhanced Cactus Shield=Scudo di cactus migliorato -Steel Shield=Scudo di acciaio +Steel Shield=Scudo d'acciaio Bronze Shield=Scudo di bronzo Diamond Shield=Scudo di diamante Gold Shield=Scudo d'oro diff --git a/mods/cool_trees/birch/init.lua b/mods/cool_trees/birch/init.lua index dbfec46..94c629d 100644 --- a/mods/cool_trees/birch/init.lua +++ b/mods/cool_trees/birch/init.lua @@ -86,20 +86,36 @@ end -- Decoration -- +local place_on +local biomes +local offset +local scale + +if minetest.get_modpath("rainf") then + place_on = "rainf:meadow" + biomes = "rainf" + offset = 0.01 + scale = 0.001 +else + place_on = "default:dirt_with_grass" + biomes = "grassland" + offset = 0.008 + scale = 0.001 +end minetest.register_decoration({ deco_type = "schematic", - place_on = {"rainf:meadow"}, + place_on = {place_on}, sidelen = 16, noise_params = { - offset = 0.01, - scale = 0.001, + offset = offset, + scale = scale, spread = {x = 255, y = 255, z = 255}, seed = 32, octaves = 3, persist = 0.67 }, - biomes = {"rainf"}, + biomes = {biomes}, y_min = 1, y_max = 80, schematic = birch.birchtree, @@ -252,3 +268,20 @@ if minetest.get_modpath("bonemeal") ~= nil then {"birch:sapling", grow_new_birch_tree, "soil"}, }) end + +--Door + +if minetest.get_modpath("doors") ~= nil then + doors.register("door_birch_wood", { + tiles = {{ name = "birch_door_wood.png", backface_culling = true }}, + description = S("Birch Wood Door"), + inventory_image = "birch_item_wood.png", + groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + recipe = { + {"birch:wood", "birch:wood"}, + {"birch:wood", "birch:wood"}, + {"birch:wood", "birch:wood"}, + } + }) +end + diff --git a/mods/cool_trees/birch/locale/birch.es.tr b/mods/cool_trees/birch/locale/birch.es.tr index acfb3e8..863c2f5 100644 --- a/mods/cool_trees/birch/locale/birch.es.tr +++ b/mods/cool_trees/birch/locale/birch.es.tr @@ -7,4 +7,5 @@ Birch Tree Stair=Escaleras de abedul Birch Tree Slab=Losa de abedul Inner Birch Tree Stair=Escaleras de abedul interior Outer Birch Tree Stair=Escaleras de abedul exterior -Birch Slab=Losa de abedul \ No newline at end of file +Birch Slab=Losa de abedul +Birch Wood Door=Puerta de abedul diff --git a/mods/cool_trees/birch/mod.conf b/mods/cool_trees/birch/mod.conf index 5c39f7c..90369b2 100644 --- a/mods/cool_trees/birch/mod.conf +++ b/mods/cool_trees/birch/mod.conf @@ -1,4 +1,4 @@ name = birch description = Birch Tree for Grassland -depends = rainf, default -optional_depends = stairs, bonemeal +depends = default +optional_depends = stairs, bonemeal, rainf, doors diff --git a/mods/cool_trees/birch/textures/birch_door_wood.png b/mods/cool_trees/birch/textures/birch_door_wood.png new file mode 100644 index 0000000..4076136 Binary files /dev/null and b/mods/cool_trees/birch/textures/birch_door_wood.png differ diff --git a/mods/cool_trees/birch/textures/birch_item_wood.png b/mods/cool_trees/birch/textures/birch_item_wood.png new file mode 100644 index 0000000..ebabd22 Binary files /dev/null and b/mods/cool_trees/birch/textures/birch_item_wood.png differ diff --git a/mods/cool_trees/chestnuttree/init.lua b/mods/cool_trees/chestnuttree/init.lua index 6d8a713..8c88c40 100644 --- a/mods/cool_trees/chestnuttree/init.lua +++ b/mods/cool_trees/chestnuttree/init.lua @@ -67,19 +67,37 @@ end -- if mg_name ~= "v6" and mg_name ~= "singlenode" then + + local place_on + local biomes + local offset + local scale + + if minetest.get_modpath("rainf") then + place_on = "rainf:meadow" + biomes = "rainf" + offset = 0.0008 + scale = 0.00004 + else + place_on = "default:dirt_with_grass" + biomes = "grassland" + offset = 0.00005 + scale = 0.00004 + end + minetest.register_decoration({ deco_type = "schematic", - place_on = {"rainf:meadow"}, + place_on = {place_on}, sidelen = 16, noise_params = { - offset = 0.0008, - scale = 0.00004, + offset = offset, + scale = scale, spread = {x = 250, y = 250, z = 250}, seed = 278, octaves = 3, persist = 0.66 }, - biomes = {"rainf"}, + biomes = {biomes}, y_min = 1, y_max = 80, schematic = modpath.."/schematics/chestnuttree.mts", @@ -232,3 +250,19 @@ if minetest.get_modpath("bonemeal") ~= nil then {"chestnuttree:sapling", grow_new_chestnuttree_tree, "soil"}, }) end + +--Door + +if minetest.get_modpath("doors") ~= nil then + doors.register("door_chestnut_wood", { + tiles = {{ name = "chesnuttree_door_wood.png", backface_culling = true }}, + description = S("Chestnut Wood Door"), + inventory_image = "chestnuttree_item_wood.png", + groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + recipe = { + {"chestnuttree:wood", "chestnuttree:wood"}, + {"chestnuttree:wood", "chestnuttree:wood"}, + {"chestnuttree:wood", "chestnuttree:wood"}, + } + }) +end diff --git a/mods/cool_trees/chestnuttree/locale/chestnuttree.es.tr b/mods/cool_trees/chestnuttree/locale/chestnuttree.es.tr index 285a653..ecc7f74 100644 --- a/mods/cool_trees/chestnuttree/locale/chestnuttree.es.tr +++ b/mods/cool_trees/chestnuttree/locale/chestnuttree.es.tr @@ -8,4 +8,5 @@ Chestnut Tree Slab=Losa de castaño Chestnut Tree Stair=Escalera de castaño Chestnut Tree Sapling=Retoño de castaño Chestnut Tree Trunk=Madera de castaño -Chestnut Tree Wood=Tablas de castaño \ No newline at end of file +Chestnut Tree Wood=Tablas de castaño +Chestnut Wood Door=Puerta de castaño diff --git a/mods/cool_trees/chestnuttree/mod.conf b/mods/cool_trees/chestnuttree/mod.conf index 0ca0a8c..9acd343 100644 --- a/mods/cool_trees/chestnuttree/mod.conf +++ b/mods/cool_trees/chestnuttree/mod.conf @@ -1,4 +1,4 @@ name = chestnuttree description = Chesnut Tree for Grassland -depends = rainf, default -optional_depends = stairs, bonemeal +depends = default +optional_depends = stairs, bonemeal, rainf, doors diff --git a/mods/cool_trees/chestnuttree/textures/chesnuttree_door_wood.png b/mods/cool_trees/chestnuttree/textures/chesnuttree_door_wood.png new file mode 100644 index 0000000..87339d3 Binary files /dev/null and b/mods/cool_trees/chestnuttree/textures/chesnuttree_door_wood.png differ diff --git a/mods/cool_trees/chestnuttree/textures/chestnuttree_item_wood.png b/mods/cool_trees/chestnuttree/textures/chestnuttree_item_wood.png new file mode 100644 index 0000000..f7c6dd7 Binary files /dev/null and b/mods/cool_trees/chestnuttree/textures/chestnuttree_item_wood.png differ diff --git a/mods/cool_trees/clementinetree/init.lua b/mods/cool_trees/clementinetree/init.lua index 44d401b..3b1524b 100644 --- a/mods/cool_trees/clementinetree/init.lua +++ b/mods/cool_trees/clementinetree/init.lua @@ -213,3 +213,20 @@ if minetest.get_modpath("bonemeal") ~= nil then {"clementinetree:sapling", grow_new_clementinetree_tree, "soil"}, }) end + + +--Door + +if minetest.get_modpath("doors") ~= nil then + doors.register("door_clementinetree_wood", { + tiles = {{ name = "clementinetree_door_wood.png", backface_culling = true }}, + description = S("Clementine Wood Door"), + inventory_image = "clementinetree_item_wood.png", + groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + recipe = { + {"clementinetree:wood", "clementinetree:wood"}, + {"clementinetree:wood", "clementinetree:wood"}, + {"clementinetree:wood", "clementinetree:wood"}, + } + }) +end diff --git a/mods/cool_trees/clementinetree/locale/clementinetree.es.tr b/mods/cool_trees/clementinetree/locale/clementinetree.es.tr index c627a35..09787a0 100644 --- a/mods/cool_trees/clementinetree/locale/clementinetree.es.tr +++ b/mods/cool_trees/clementinetree/locale/clementinetree.es.tr @@ -7,4 +7,5 @@ Clementine Tree Slab=Losa de clementinero Clementine Tree Stair=Escalera de clementinero Clementine Tree Sapling=Retoño de clementinero Clementine Tree Trunk=Madera de clementinero -Clementine Tree Wood=Tablas de clementinero +Clementine Tree Wood=Tablas de clementinero +Clementine Wood Door=Puerta de clementinero diff --git a/mods/cool_trees/clementinetree/mod.conf b/mods/cool_trees/clementinetree/mod.conf index eb3b581..0e48d93 100644 --- a/mods/cool_trees/clementinetree/mod.conf +++ b/mods/cool_trees/clementinetree/mod.conf @@ -1,4 +1,4 @@ name = clementinetree description = Clementine Tree for Decidious Forest depends = default -optional_depends = stairs, bonemeal +optional_depends = stairs, bonemeal, doors diff --git a/mods/cool_trees/clementinetree/textures/clementinetree_door_wood.png b/mods/cool_trees/clementinetree/textures/clementinetree_door_wood.png new file mode 100644 index 0000000..1d3ac59 Binary files /dev/null and b/mods/cool_trees/clementinetree/textures/clementinetree_door_wood.png differ diff --git a/mods/cool_trees/clementinetree/textures/clementinetree_item_wood.png b/mods/cool_trees/clementinetree/textures/clementinetree_item_wood.png new file mode 100644 index 0000000..df6836f Binary files /dev/null and b/mods/cool_trees/clementinetree/textures/clementinetree_item_wood.png differ diff --git a/mods/cool_trees/hollytree/init.lua b/mods/cool_trees/hollytree/init.lua index eb14056..d551747 100644 --- a/mods/cool_trees/hollytree/init.lua +++ b/mods/cool_trees/hollytree/init.lua @@ -25,19 +25,37 @@ end -- if mg_name ~= "v6" and mg_name ~= "singlenode" then + + local place_on + local biomes + local offset + local scale + + if minetest.get_modpath("rainf") then + place_on = "rainf:meadow" + biomes = "rainf" + offset = 0.0008 + scale = 0.00005 + else + place_on = "default:dirt_with_grass" + biomes = "grassland" + offset = 0.00008 + scale = 0.00005 + end + minetest.register_decoration({ deco_type = "schematic", - place_on = {"rainf:meadow"}, + place_on = {place_on}, sidelen = 16, noise_params = { - offset = 0.0008, - scale = 0.00005, + offset = offset, + scale = scale, spread = {x = 250, y = 250, z = 250}, seed = 789, octaves = 3, persist = 0.66 }, - biomes = {"rainf"}, + biomes = {biomes}, y_min = 1, y_max = 32, schematic = modpath.."/schematics/hollytree.mts", diff --git a/mods/cool_trees/hollytree/mod.conf b/mods/cool_trees/hollytree/mod.conf index 033ebd8..ce3e173 100644 --- a/mods/cool_trees/hollytree/mod.conf +++ b/mods/cool_trees/hollytree/mod.conf @@ -1,4 +1,4 @@ name = hollytree description = Hollytree -depends = rainf, default -optional_depends = stairs, bonemeal +depends = default +optional_depends = stairs, bonemeal, rainf diff --git a/mods/cool_trees/larch/init.lua b/mods/cool_trees/larch/init.lua index 942cc45..0a12200 100644 --- a/mods/cool_trees/larch/init.lua +++ b/mods/cool_trees/larch/init.lua @@ -214,3 +214,20 @@ if minetest.get_modpath("bonemeal") ~= nil then {"larch:sapling", grow_new_larch_tree, "soil"}, }) end + +--Door + +if minetest.get_modpath("doors") ~= nil then + doors.register("door_larch_wood", { + tiles = {{ name = "larch_door_wood.png", backface_culling = true }}, + description = S("Larch Wood Door"), + inventory_image = "larch_item_wood.png", + groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + recipe = { + {"larch:wood", "larch:wood"}, + {"larch:wood", "larch:wood"}, + {"larch:wood", "larch:wood"}, + } + }) +end + diff --git a/mods/cool_trees/larch/locale/larch.es.tr b/mods/cool_trees/larch/locale/larch.es.tr index 065abe3..1f7d96a 100644 --- a/mods/cool_trees/larch/locale/larch.es.tr +++ b/mods/cool_trees/larch/locale/larch.es.tr @@ -2,4 +2,8 @@ Larch Sapling=Retoño de alerce Larch Trunk=Madera de alerce Larch Wood=Tablas de alerce -Larch Leaves=Hojas de alerce \ No newline at end of file +Larch Leaves=Hojas de alerce +Larch Tree Outer Stair=Escalera exterior de alerce +Larch Tree Slab=Losa de alerce +Larch Stair=Escalera de alerce +Larch Wood Door=Puerta de alerce diff --git a/mods/cool_trees/larch/mod.conf b/mods/cool_trees/larch/mod.conf index a6af376..d174ef5 100644 --- a/mods/cool_trees/larch/mod.conf +++ b/mods/cool_trees/larch/mod.conf @@ -1,3 +1,3 @@ name = larch description = Larch Tree -optional_depends = stairs, bonemeal +optional_depends = stairs, bonemeal, doors diff --git a/mods/cool_trees/larch/textures/larch_door_wood.png b/mods/cool_trees/larch/textures/larch_door_wood.png new file mode 100644 index 0000000..6cbc1ff Binary files /dev/null and b/mods/cool_trees/larch/textures/larch_door_wood.png differ diff --git a/mods/cool_trees/larch/textures/larch_item_wood.png b/mods/cool_trees/larch/textures/larch_item_wood.png new file mode 100644 index 0000000..c3894b0 Binary files /dev/null and b/mods/cool_trees/larch/textures/larch_item_wood.png differ diff --git a/mods/cool_trees/mahogany/mod.conf b/mods/cool_trees/mahogany/mod.conf index 450bb42..daddcbe 100644 --- a/mods/cool_trees/mahogany/mod.conf +++ b/mods/cool_trees/mahogany/mod.conf @@ -1,4 +1,4 @@ name = mahogany description = Mahogany Tree for Rainforest Biome depends = default -optional_depends = stairs, bonemeal +optional_depends = stairs, bonemeal, rainf diff --git a/mods/cool_trees/maple/init.lua b/mods/cool_trees/maple/init.lua index 607aac7..841090a 100644 --- a/mods/cool_trees/maple/init.lua +++ b/mods/cool_trees/maple/init.lua @@ -26,19 +26,32 @@ end -- if mg_name ~= "v6" and mg_name ~= "singlenode" then + + if minetest.get_modpath("rainf") then + place_on = "rainf:meadow" + biomes = "rainf" + offset = 0.0005 + scale = 0.0002 + else + place_on = "default:dirt_with_grass" + biomes = "grassland" + offset = 0.0002 + scale = 0.0002 + end + minetest.register_decoration({ deco_type = "schematic", - place_on = {"rainf:meadow"}, + place_on = {place_on}, sidelen = 16, noise_params = { - offset = 0.0005, - scale = 0.0002, + offset = offset, + scale = scale, spread = {x = 250, y = 250, z = 250}, seed = 3462, octaves = 3, persist = 0.66 }, - biomes = {"rainf"}, + biomes = {biomes}, y_min = 1, y_max = 62, schematic = modpath.."/schematics/maple.mts", @@ -192,3 +205,21 @@ if minetest.get_modpath("bonemeal") ~= nil then {"maple:sapling", grow_new_maple_tree, "soil"}, }) end + +--Door + +if minetest.get_modpath("doors") ~= nil then + doors.register("door_maple_wood", { + tiles = {{ name = "maple_door_wood.png", backface_culling = true }}, + description = S("Maple Wood Door"), + inventory_image = "maple_item_wood.png", + groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + recipe = { + {"maple:wood", "maple:wood"}, + {"maple:wood", "maple:wood"}, + {"maple:wood", "maple:wood"}, + } + }) +end + + diff --git a/mods/cool_trees/maple/locale/maple.es.tr b/mods/cool_trees/maple/locale/maple.es.tr index 4d22a6c..d445612 100644 --- a/mods/cool_trees/maple/locale/maple.es.tr +++ b/mods/cool_trees/maple/locale/maple.es.tr @@ -7,3 +7,4 @@ Maple Stair=Escaleras de arce Inner Maple Stair=Escaleras de arce Outer Maple Stair=Escaleras de arce Maple Slab=Losa de arce +Maple Wood Door=Puerta de arce diff --git a/mods/cool_trees/maple/mod.conf b/mods/cool_trees/maple/mod.conf index 4604e5e..b1e2fe3 100644 --- a/mods/cool_trees/maple/mod.conf +++ b/mods/cool_trees/maple/mod.conf @@ -1,4 +1,4 @@ name = maple description = Maple Tree -depends = rainf, default -optional_depends = stairs, bonemeal +depends = default +optional_depends = stairs, bonemeal, rainf, doors diff --git a/mods/cool_trees/maple/textures/maple_door_wood.png b/mods/cool_trees/maple/textures/maple_door_wood.png new file mode 100644 index 0000000..01fbad1 Binary files /dev/null and b/mods/cool_trees/maple/textures/maple_door_wood.png differ diff --git a/mods/cool_trees/maple/textures/maple_item_wood.png b/mods/cool_trees/maple/textures/maple_item_wood.png new file mode 100644 index 0000000..54152e1 Binary files /dev/null and b/mods/cool_trees/maple/textures/maple_item_wood.png differ diff --git a/mods/cool_trees/oak/init.lua b/mods/cool_trees/oak/init.lua index f2315f9..3eeb299 100644 --- a/mods/cool_trees/oak/init.lua +++ b/mods/cool_trees/oak/init.lua @@ -51,19 +51,32 @@ end -- if mg_name ~= "v6" and mg_name ~= "singlenode" then + + if minetest.get_modpath("rainf") then + place_on = "rainf:meadow" + biomes = "rainf" + offset = 0.0008 + scale = 0.00004 + else + place_on = "default:dirt_with_grass" + biomes = "grassland" + offset = 0.0008 + scale = 0.00004 + end + minetest.register_decoration({ deco_type = "schematic", - place_on = {"rainf:meadow"}, + place_on = {place_on}, sidelen = 16, noise_params = { - offset = 0.0008, - scale = 0.00004, + offset = offset, + scale = scale, spread = {x = 250, y = 250, z = 250}, seed = 6431, octaves = 3, persist = 0.66 }, - biomes = {"rainf"}, + biomes = {biomes}, y_min = 1, y_max = 80, schematic = modpath.."/schematics/oak.mts", @@ -216,3 +229,17 @@ if minetest.get_modpath("bonemeal") ~= nil then {"oak:sapling", grow_new_oak_tree, "soil"}, }) end + +if minetest.get_modpath("doors") ~= nil then + doors.register("door_oak_wood", { + tiles = {{ name = "oak_door_wood.png", backface_culling = true }}, + description = S("Oak Wood Door"), + inventory_image = "oak_item_wood.png", + groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + recipe = { + {"oak:wood", "oak:wood"}, + {"oak:wood", "oak:wood"}, + {"oak:wood", "oak:wood"}, + } + }) +end diff --git a/mods/cool_trees/oak/locale/oak.es.tr b/mods/cool_trees/oak/locale/oak.es.tr index 881428c..854ce49 100644 --- a/mods/cool_trees/oak/locale/oak.es.tr +++ b/mods/cool_trees/oak/locale/oak.es.tr @@ -8,3 +8,4 @@ Oak Leaves=Hojas de roble Oak Outer Stair=Escalera exterior de roble Oak Slab=Losa de roble Oak Stair=Escalera de roble +Oak Wood Door=Puerta de roble diff --git a/mods/cool_trees/oak/mod.conf b/mods/cool_trees/oak/mod.conf index b819a21..ccc3995 100644 --- a/mods/cool_trees/oak/mod.conf +++ b/mods/cool_trees/oak/mod.conf @@ -1,4 +1,4 @@ name = oak description = Oak Tree -depends = rainf, default -optional_depends = stairs, bonemeal +depends = default +optional_depends = stairs, bonemeal, rainf, doors diff --git a/mods/cool_trees/oak/textures/oak_door_wood.png b/mods/cool_trees/oak/textures/oak_door_wood.png new file mode 100644 index 0000000..2c7871b Binary files /dev/null and b/mods/cool_trees/oak/textures/oak_door_wood.png differ diff --git a/mods/cool_trees/oak/textures/oak_item_wood.png b/mods/cool_trees/oak/textures/oak_item_wood.png new file mode 100644 index 0000000..281d717 Binary files /dev/null and b/mods/cool_trees/oak/textures/oak_item_wood.png differ diff --git a/mods/minetest_game/beds/functions.lua b/mods/minetest_game/beds/functions.lua index 019c123..1e12a7d 100644 --- a/mods/minetest_game/beds/functions.lua +++ b/mods/minetest_game/beds/functions.lua @@ -81,6 +81,21 @@ local function lay_down(player, pos, bed_pos, state, skip) -- lay down else + + -- Check if bed is occupied + for _, other_pos in pairs(beds.bed_position) do + if vector.distance(bed_pos, other_pos) < 0.1 then + minetest.chat_send_player(name, S("This bed is already occupied!")) + return false + end + end + + -- Check if player is moving + if vector.length(player:get_player_velocity()) > 0.001 then + minetest.chat_send_player(name, S("You have to stop moving before going to bed!")) + return false + end + beds.pos[name] = pos beds.bed_position[name] = bed_pos beds.player[name] = 1 @@ -230,6 +245,19 @@ minetest.register_on_leaveplayer(function(player) end end) +minetest.register_on_dieplayer(function(player) + local name = player:get_player_name() + local in_bed = beds.player + local pos = player:get_pos() + local yaw = get_look_yaw(pos) + + if in_bed[name] then + lay_down(player, nil, pos, false) + player:set_look_horizontal(yaw) + player:set_pos(pos) + end +end) + minetest.register_on_player_receive_fields(function(player, formname, fields) if formname ~= "beds_form" then return @@ -256,3 +284,4 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end end end) + diff --git a/mods/minetest_game/butterflies/init.lua b/mods/minetest_game/butterflies/init.lua index 650e7da..49240ee 100644 --- a/mods/minetest_game/butterflies/init.lua +++ b/mods/minetest_game/butterflies/init.lua @@ -62,8 +62,8 @@ for i in ipairs (butter_list) do minetest.register_node("butterflies:hidden_butterfly_"..name, { drawtype = "airlike", - inventory_image = "butterflies_butterfly_"..name..".png", - wield_image = "butterflies_butterfly_"..name..".png", + inventory_image = "butterflies_butterfly_"..name..".png^default_invisible_node_overlay.png", + wield_image = "butterflies_butterfly_"..name..".png^default_invisible_node_overlay.png", paramtype = "light", sunlight_propagates = true, walkable = false, diff --git a/mods/minetest_game/default/README.txt b/mods/minetest_game/default/README.txt index 6655d0e..c98d735 100644 --- a/mods/minetest_game/default/README.txt +++ b/mods/minetest_game/default/README.txt @@ -264,32 +264,17 @@ Glass breaking sounds (CC BY 3.0): 3: http://www.freesound.org/people/lsprice/sounds/88808/ Mito551 (sounds) (CC BY-SA 3.0): - default_dig_choppy.ogg - default_dig_cracky.ogg - default_dig_crumbly.1.ogg - default_dig_crumbly.2.ogg + default_dig_crumbly.*.ogg default_dig_dig_immediate.ogg default_dig_oddly_breakable_by_hand.ogg - default_dug_node.1.ogg - default_dug_node.2.ogg + default_dug_node.*.ogg default_grass_footstep.1.ogg default_grass_footstep.2.ogg default_grass_footstep.3.ogg - default_gravel_footstep.1.ogg - default_gravel_footstep.2.ogg - default_gravel_footstep.3.ogg - default_gravel_footstep.4.ogg - default_grass_footstep.1.ogg - default_place_node.1.ogg - default_place_node.2.ogg - default_place_node.3.ogg - default_place_node_hard.1.ogg - default_place_node_hard.2.ogg - default_hard_footstep.1.ogg - default_hard_footstep.2.ogg - default_hard_footstep.3.ogg - default_sand_footstep.1.ogg - default_sand_footstep.2.ogg + default_gravel_footstep.*.ogg + default_place_node.*.ogg + default_place_node_hard.*.ogg + default_glass_footstep.ogg default_wood_footstep.1.ogg default_wood_footstep.2.ogg default_dirt_footstep.1.ogg @@ -301,8 +286,8 @@ Metal sounds: - https://www.freesound.org/people/yadronoff/sounds/320397/ default_dug_metal.*.ogg - Iwan Gabovitch - qubodup - CC0 - http://opengameart.org/users/qubodup - default_metal_footstep.*.ogg - Ottomaani138 - CC0 - - https://www.freesound.org/people/Ottomaani138/sounds/232692/ + default_metal_footstep.*.ogg - (CC0 1.0) - CC0 1.0 + - https://freesound.org/people/mypantsfelldown/sounds/398937/ default_place_node_metal.*.ogg - Ogrebane - CC0 - http://opengameart.org/content/wood-and-metal-sound-effects-volume-2 @@ -340,6 +325,39 @@ sonictechtonic (CC BY 3.0): https://www.freesound.org/people/sonictechtonic/sounds/241872/ player_damage.ogg +Sheyvan (CC0 1.0): +https://freesound.org/people/Sheyvan/sounds/476113/ + default_dig_choppy.*.ogg + +lolamadeus (CC0 1.0): +https://freesound.org/people/lolamadeus/sounds/179341/ + default_gravel_dig.*.ogg + default_gravel_dug.*.ogg + +Benboncan (CC BY 3.0): +https://freesound.org/people/Benboncan/sounds/71823/ + default_dig_cracky.*.ogg + +Erdie (CC BY 3.0): +https://freesound.org/people/Erdie/sounds/41579/ + default_hard_footstep.*.ogg + +worthahep88 (CC0 1.0): +https://freesound.org/people/worthahep88/sounds/319224/ + default_sand_footstep.*.ogg + +dheming (CC BY 3.0): +https://freesound.org/people/dheming/sounds/268023/ + default_ice_dig.*.ogg + +InspectorJ (CC BY 3.0): +https://freesound.org/people/InspectorJ/sounds/416967/ + default_ice_footstep.*.ogg + +Angel_Perez_Grandi (CC BY 3.0): +https://freesound.org/people/Angel_Perez_Grandi/sounds/49190/ + default_ice_dug.ogg + iankath (CC0 1.0) https://freesound.org/people/iankath/sounds/173991/ default_furnace_active.ogg diff --git a/mods/minetest_game/default/crafting.lua b/mods/minetest_game/default/crafting.lua index 62081bd..1cdb930 100644 --- a/mods/minetest_game/default/crafting.lua +++ b/mods/minetest_game/default/crafting.lua @@ -300,15 +300,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:mese_post_light 3", - recipe = { - {"", "default:glass", ""}, - {"default:mese_crystal", "default:mese_crystal", "default:mese_crystal"}, - {"", "group:wood", ""}, - } -}) - minetest.register_craft({ output = "default:obsidian", recipe = { diff --git a/mods/minetest_game/default/functions.lua b/mods/minetest_game/default/functions.lua index 3dd7a00..41a943b 100644 --- a/mods/minetest_game/default/functions.lua +++ b/mods/minetest_game/default/functions.lua @@ -38,9 +38,9 @@ end function default.node_sound_sand_defaults(table) table = table or {} table.footstep = table.footstep or - {name = "default_sand_footstep", gain = 0.12} + {name = "default_sand_footstep", gain = 0.05} table.dug = table.dug or - {name = "default_sand_footstep", gain = 0.24} + {name = "default_sand_footstep", gain = 0.15} table.place = table.place or {name = "default_place_node", gain = 1.0} default.node_sound_defaults(table) @@ -50,9 +50,11 @@ end function default.node_sound_gravel_defaults(table) table = table or {} table.footstep = table.footstep or - {name = "default_gravel_footstep", gain = 0.4} + {name = "default_gravel_footstep", gain = 0.1} + table.dig = table.dig or + {name = "default_gravel_dig", gain = 0.35} table.dug = table.dug or - {name = "default_gravel_footstep", gain = 1.0} + {name = "default_gravel_dug", gain = 1.0} table.place = table.place or {name = "default_place_node", gain = 1.0} default.node_sound_defaults(table) @@ -93,6 +95,18 @@ function default.node_sound_glass_defaults(table) return table end +function default.node_sound_ice_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_ice_footstep", gain = 0.3} + table.dig = table.dig or + {name = "default_ice_dig", gain = 0.5} + table.dug = table.dug or + {name = "default_ice_dug", gain = 0.5} + default.node_sound_defaults(table) + return table +end + function default.node_sound_metal_defaults(table) table = table or {} table.footstep = table.footstep or @@ -421,6 +435,51 @@ function default.register_fence_rail(name, def) minetest.register_node(name, def) end +-- +-- Mese post registration helper +-- + +function default.register_mesepost(name, def) + minetest.register_craft({ + output = name .. " 4", + recipe = { + {'', 'default:glass', ''}, + {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'}, + {'', def.material, ''}, + } + }) + + local post_texture = def.texture .. "^default_mese_post_light_side.png^[makealpha:0,0,0" + local post_texture_dark = def.texture .. "^default_mese_post_light_side_dark.png^[makealpha:0,0,0" + -- Allow almost everything to be overridden + local default_fields = { + wield_image = post_texture, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-2 / 16, -8 / 16, -2 / 16, 2 / 16, 8 / 16, 2 / 16}, + }, + }, + paramtype = "light", + tiles = {def.texture, def.texture, post_texture_dark, post_texture_dark, post_texture, post_texture}, + light_source = default.LIGHT_MAX, + sunlight_propagates = true, + is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + } + for k, v in pairs(default_fields) do + if def[k] == nil then + def[k] = v + end + end + + def.texture = nil + def.material = nil + + minetest.register_node(name, def) +end -- -- Leafdecay diff --git a/mods/minetest_game/default/furnace.lua b/mods/minetest_game/default/furnace.lua index b63a869..d5703cd 100644 --- a/mods/minetest_game/default/furnace.lua +++ b/mods/minetest_game/default/furnace.lua @@ -318,6 +318,10 @@ minetest.register_node("default:furnace", { -- start timer function, it will sort out whether furnace can burn or not. minetest.get_node_timer(pos):start(1.0) end, + on_metadata_inventory_take = function(pos) + -- check whether the furnace is empty or not. + minetest.get_node_timer(pos):start(1.0) + end, on_blast = function(pos) local drops = {} default.get_inventory_drops(pos, "src", drops) diff --git a/mods/minetest_game/default/item_entity.lua b/mods/minetest_game/default/item_entity.lua index d9bf7b1..25fb832 100644 --- a/mods/minetest_game/default/item_entity.lua +++ b/mods/minetest_game/default/item_entity.lua @@ -74,5 +74,5 @@ local item = { } -- set defined item as new __builtin:item, with the old one as fallback table -setmetatable(item, builtin_item) +setmetatable(item, { __index = builtin_item }) minetest.register_entity(":__builtin:item", item) diff --git a/mods/minetest_game/default/locale/default.zh_CN.tr b/mods/minetest_game/default/locale/default.zh_CN.tr index ddd9471..4694b3c 100644 --- a/mods/minetest_game/default/locale/default.zh_CN.tr +++ b/mods/minetest_game/default/locale/default.zh_CN.tr @@ -59,15 +59,18 @@ Silver Sandstone Block=银砂岩方块 Obsidian=黑曜石 Obsidian Brick=黑曜石砖 Obsidian Block=黑曜石方块 -Dirt=土 -Dirt with Grass=带草的土 -Dirt with Grass and Footsteps=带草的土及脚印 -Dirt with Dry Grass=带干草的土 -Dirt with Snow=带雪的土 + +Dirt=土方块 +Dirt with Grass=草方块 +Dirt with Grass and Footsteps=草方块及脚印 +Dirt with Dry Grass=干草土方块 +Dirt with Snow=雪土方块 Dirt with Rainforest Litter=雨林腐土 Dirt with Coniferous Litter=针叶林腐土 -Dry Dirt=干土 -Dry Dirt with Dry Grass=干土和干草 +Savanna Dirt=草原土 +Dirt with Savanna Grass=草原草方块 +Savanna Dirt with Savanna Grass=草原草方块(草原土) + Permafrost=多年冻土 Permafrost with Stones=带石头的多年冻土 Permafrost with Moss=生苔的多年冻土 @@ -174,7 +177,13 @@ Glass=玻璃 Obsidian Glass=黑曜石玻璃 Brick Block=砖方块 Mese Lamp=黄石灯 -Mese Post Light=黄石柱灯 + +Apple Wood Mese Post Light=苹果木黄石灯柱 +Acacia Wood Mese Post Light=金合欢木黄石灯柱 +Aspen Wood Mese Post Light=白杨木黄石灯柱 +Jungle Wood Mese Post Light=丛林木黄石灯柱 +Pine Wood Mese Post Light=松木黄石灯柱 + Cloud=云 Wooden Pickaxe=木镐 Stone Pickaxe=石镐 diff --git a/mods/minetest_game/default/locale/default.zh_TW.tr b/mods/minetest_game/default/locale/default.zh_TW.tr index 6b06b8a..5512832 100644 --- a/mods/minetest_game/default/locale/default.zh_TW.tr +++ b/mods/minetest_game/default/locale/default.zh_TW.tr @@ -59,15 +59,18 @@ Silver Sandstone Block=銀砂岩方塊 Obsidian=黑曜石 Obsidian Brick=黑曜石磚 Obsidian Block=黑曜石方塊 -Dirt=土 -Dirt with Grass=帶草的土 -Dirt with Grass and Footsteps=帶草的土及腳印 -Dirt with Dry Grass=帶乾草的土 -Dirt with Snow=帶雪的土 + +Dirt=土方塊 +Dirt with Grass=草方塊 +Dirt with Grass and Footsteps=草方塊及腳印 +Dirt with Dry Grass=乾草土方塊 +Dirt with Snow=雪土方塊 Dirt with Rainforest Litter=雨林腐土 Dirt with Coniferous Litter=針葉林腐土 -Dry Dirt=乾土 -Dry Dirt with Dry Grass=乾土和乾草 +Savanna Dirt=草原土 +Dirt with Savanna Grass=草原草方塊 +Savanna Dirt with Savanna Grass=草原草方塊(草原土) + Permafrost=多年凍土 Permafrost with Stones=帶石頭的多年凍土 Permafrost with Moss=生苔的多年凍土 @@ -174,7 +177,13 @@ Glass=玻璃 Obsidian Glass=黑曜石玻璃 Brick Block=磚方塊 Mese Lamp=黃石燈 -Mese Post Light=黃石柱燈 + +Apple Wood Mese Post Light=蘋果木黃石燈柱 +Acacia Wood Mese Post Light=金合歡木黃石燈柱 +Aspen Wood Mese Post Light=白楊木黃石燈柱 +Jungle Wood Mese Post Light=叢林木黃石燈柱 +Pine Wood Mese Post Light=松木黃石燈柱 + Cloud=雲 Wooden Pickaxe=木鎬 Stone Pickaxe=石鎬 diff --git a/mods/minetest_game/default/nodes.lua b/mods/minetest_game/default/nodes.lua index 6c6ce28..2646fcf 100644 --- a/mods/minetest_game/default/nodes.lua +++ b/mods/minetest_game/default/nodes.lua @@ -221,6 +221,10 @@ default:brick default:meselamp default:mese_post_light +default:mese_post_light_acacia_wood +default:mese_post_light_junglewood +default:mese_post_light_pine_wood +default:mese_post_light_aspen_wood Misc ---- @@ -656,7 +660,7 @@ minetest.register_node("default:ice", { is_ground_content = false, paramtype = "light", groups = {cracky = 3, cools_lava = 1, slippery = 3}, - sounds = default.node_sound_glass_defaults(), + sounds = default.node_sound_ice_defaults(), }) -- Mapgen-placed ice with 'is ground content = true' to contain tunnels @@ -667,7 +671,7 @@ minetest.register_node("default:cave_ice", { groups = {cracky = 3, cools_lava = 1, slippery = 3, not_in_creative_inventory = 1}, drop = "default:ice", - sounds = default.node_sound_glass_defaults(), + sounds = default.node_sound_ice_defaults(), }) -- @@ -792,6 +796,8 @@ minetest.register_node("default:apple", { minetest.register_node("default:apple_mark", { description = S("Apple Marker"), + inventory_image = "default_apple.png^default_invisible_node_overlay.png", + wield_image = "default_apple.png^default_invisible_node_overlay.png", drawtype = "airlike", paramtype = "light", sunlight_propagates = true, @@ -1588,6 +1594,7 @@ end minetest.register_node("default:fern_1", { description = S("Fern"), drawtype = "plantlike", + visual_scale = 0.8, waving = 1, tiles = {"default_fern_1.png"}, inventory_image = "default_fern_1.png", @@ -1617,7 +1624,7 @@ for i = 2, 3 do description = S("Fern"), drawtype = "plantlike", waving = 1, - visual_scale = 2, + visual_scale = 1.0, tiles = {"default_fern_" .. i .. ".png"}, inventory_image = "default_fern_" .. i .. ".png", wield_image = "default_fern_" .. i .. ".png", @@ -1708,7 +1715,6 @@ minetest.register_node("default:bush_stem", { minetest.register_node("default:bush_leaves", { description = S("Bush Leaves"), drawtype = "allfaces_optional", - waving = 1, tiles = {"default_leaves_simple.png"}, paramtype = "light", groups = {snappy = 3, flammable = 2, leaves = 1}, @@ -1762,7 +1768,6 @@ minetest.register_node("default:bush_sapling", { minetest.register_node("default:blueberry_bush_leaves_with_berries", { description = S("Blueberry Bush Leaves with Berries"), drawtype = "allfaces_optional", - waving = 1, tiles = {"default_blueberry_bush_leaves.png^default_blueberry_overlay.png"}, paramtype = "light", groups = {snappy = 3, flammable = 2, leaves = 1, dig_immediate = 3}, @@ -1779,7 +1784,6 @@ minetest.register_node("default:blueberry_bush_leaves_with_berries", { minetest.register_node("default:blueberry_bush_leaves", { description = S("Blueberry Bush Leaves"), drawtype = "allfaces_optional", - waving = 1, tiles = {"default_blueberry_bush_leaves.png"}, paramtype = "light", groups = {snappy = 3, flammable = 2, leaves = 1}, @@ -1858,7 +1862,6 @@ minetest.register_node("default:acacia_bush_stem", { minetest.register_node("default:acacia_bush_leaves", { description = S("Acacia Bush Leaves"), drawtype = "allfaces_optional", - waving = 1, tiles = {"default_acacia_leaves_simple.png"}, paramtype = "light", groups = {snappy = 3, flammable = 2, leaves = 1}, @@ -1929,7 +1932,6 @@ minetest.register_node("default:pine_bush_stem", { minetest.register_node("default:pine_bush_needles", { description = S("Pine Bush Needles"), drawtype = "allfaces_optional", - waving = 1, tiles = {"default_pine_needles.png"}, paramtype = "light", groups = {snappy = 3, flammable = 2, leaves = 1}, @@ -1980,6 +1982,7 @@ minetest.register_node("default:pine_bush_sapling", { end, }) + minetest.register_node("default:sand_with_kelp", { description = S("Kelp"), drawtype = "plantlike_rooted", @@ -2873,25 +2876,34 @@ minetest.register_node("default:meselamp", { light_source = default.LIGHT_MAX, }) -minetest.register_node("default:mese_post_light", { - description = S("Mese Post Light"), - tiles = {"default_mese_post_light_top.png", "default_mese_post_light_top.png", - "default_mese_post_light_side_dark.png", "default_mese_post_light_side_dark.png", - "default_mese_post_light_side.png", "default_mese_post_light_side.png"}, - wield_image = "default_mese_post_light_side.png", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-2 / 16, -8 / 16, -2 / 16, 2 / 16, 8 / 16, 2 / 16}, - }, - }, - paramtype = "light", - light_source = default.LIGHT_MAX, - sunlight_propagates = true, - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - sounds = default.node_sound_wood_defaults(), +default.register_mesepost("default:mese_post_light", { + description = S("Apple Wood Mese Post Light"), + texture = "default_fence_wood.png", + material = "default:wood", +}) + +default.register_mesepost("default:mese_post_light_acacia", { + description = S("Acacia Wood Mese Post Light"), + texture = "default_fence_acacia_wood.png", + material = "default:acacia_wood", +}) + +default.register_mesepost("default:mese_post_light_junglewood", { + description = S("Jungle Wood Mese Post Light"), + texture = "default_fence_junglewood.png", + material = "default:junglewood", +}) + +default.register_mesepost("default:mese_post_light_pine_wood", { + description = S("Pine Wood Mese Post Light"), + texture = "default_fence_pine_wood.png", + material = "default:pine_wood", +}) + +default.register_mesepost("default:mese_post_light_aspen_wood", { + description = S("Aspen Wood Mese Post Light"), + texture = "default_fence_aspen_wood.png", + material = "default:aspen_wood", }) -- diff --git a/mods/minetest_game/default/sounds/default_dig_choppy.1.ogg b/mods/minetest_game/default/sounds/default_dig_choppy.1.ogg new file mode 100644 index 0000000..95fa6d4 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_dig_choppy.1.ogg differ diff --git a/mods/minetest_game/default/sounds/default_dig_choppy.2.ogg b/mods/minetest_game/default/sounds/default_dig_choppy.2.ogg new file mode 100644 index 0000000..5d3a044 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_dig_choppy.2.ogg differ diff --git a/mods/minetest_game/default/sounds/default_dig_choppy.3.ogg b/mods/minetest_game/default/sounds/default_dig_choppy.3.ogg new file mode 100644 index 0000000..2bb0ace Binary files /dev/null and b/mods/minetest_game/default/sounds/default_dig_choppy.3.ogg differ diff --git a/mods/minetest_game/default/sounds/default_dig_cracky.1.ogg b/mods/minetest_game/default/sounds/default_dig_cracky.1.ogg new file mode 100644 index 0000000..ffced27 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_dig_cracky.1.ogg differ diff --git a/mods/minetest_game/default/sounds/default_dig_cracky.2.ogg b/mods/minetest_game/default/sounds/default_dig_cracky.2.ogg new file mode 100644 index 0000000..d9e8010 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_dig_cracky.2.ogg differ diff --git a/mods/minetest_game/default/sounds/default_dig_cracky.3.ogg b/mods/minetest_game/default/sounds/default_dig_cracky.3.ogg new file mode 100644 index 0000000..7d19d40 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_dig_cracky.3.ogg differ diff --git a/mods/minetest_game/default/sounds/default_gravel_dig.1.ogg b/mods/minetest_game/default/sounds/default_gravel_dig.1.ogg new file mode 100644 index 0000000..baf8fca Binary files /dev/null and b/mods/minetest_game/default/sounds/default_gravel_dig.1.ogg differ diff --git a/mods/minetest_game/default/sounds/default_gravel_dig.2.ogg b/mods/minetest_game/default/sounds/default_gravel_dig.2.ogg new file mode 100644 index 0000000..e0c0c50 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_gravel_dig.2.ogg differ diff --git a/mods/minetest_game/default/sounds/default_gravel_dug.1.ogg b/mods/minetest_game/default/sounds/default_gravel_dug.1.ogg new file mode 100644 index 0000000..1303433 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_gravel_dug.1.ogg differ diff --git a/mods/minetest_game/default/sounds/default_gravel_dug.2.ogg b/mods/minetest_game/default/sounds/default_gravel_dug.2.ogg new file mode 100644 index 0000000..ee5ed33 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_gravel_dug.2.ogg differ diff --git a/mods/minetest_game/default/sounds/default_gravel_dug.3.ogg b/mods/minetest_game/default/sounds/default_gravel_dug.3.ogg new file mode 100644 index 0000000..add4c54 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_gravel_dug.3.ogg differ diff --git a/mods/minetest_game/default/sounds/default_hard_footstep.1.ogg b/mods/minetest_game/default/sounds/default_hard_footstep.1.ogg index 1748bc5..0a08efa 100644 Binary files a/mods/minetest_game/default/sounds/default_hard_footstep.1.ogg and b/mods/minetest_game/default/sounds/default_hard_footstep.1.ogg differ diff --git a/mods/minetest_game/default/sounds/default_hard_footstep.2.ogg b/mods/minetest_game/default/sounds/default_hard_footstep.2.ogg index fe39fd7..be52a87 100644 Binary files a/mods/minetest_game/default/sounds/default_hard_footstep.2.ogg and b/mods/minetest_game/default/sounds/default_hard_footstep.2.ogg differ diff --git a/mods/minetest_game/default/sounds/default_hard_footstep.3.ogg b/mods/minetest_game/default/sounds/default_hard_footstep.3.ogg index 5030e06..a342787 100644 Binary files a/mods/minetest_game/default/sounds/default_hard_footstep.3.ogg and b/mods/minetest_game/default/sounds/default_hard_footstep.3.ogg differ diff --git a/mods/minetest_game/default/sounds/default_ice_dig.1.ogg b/mods/minetest_game/default/sounds/default_ice_dig.1.ogg new file mode 100644 index 0000000..97399c8 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_ice_dig.1.ogg differ diff --git a/mods/minetest_game/default/sounds/default_ice_dig.2.ogg b/mods/minetest_game/default/sounds/default_ice_dig.2.ogg new file mode 100644 index 0000000..8a5da11 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_ice_dig.2.ogg differ diff --git a/mods/minetest_game/default/sounds/default_ice_dig.3.ogg b/mods/minetest_game/default/sounds/default_ice_dig.3.ogg new file mode 100644 index 0000000..765fb9b Binary files /dev/null and b/mods/minetest_game/default/sounds/default_ice_dig.3.ogg differ diff --git a/mods/minetest_game/default/sounds/default_ice_dug.ogg b/mods/minetest_game/default/sounds/default_ice_dug.ogg new file mode 100644 index 0000000..ae37673 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_ice_dug.ogg differ diff --git a/mods/minetest_game/default/sounds/default_ice_footstep.1.ogg b/mods/minetest_game/default/sounds/default_ice_footstep.1.ogg new file mode 100644 index 0000000..c235f1e Binary files /dev/null and b/mods/minetest_game/default/sounds/default_ice_footstep.1.ogg differ diff --git a/mods/minetest_game/default/sounds/default_ice_footstep.2.ogg b/mods/minetest_game/default/sounds/default_ice_footstep.2.ogg new file mode 100644 index 0000000..61d2c99 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_ice_footstep.2.ogg differ diff --git a/mods/minetest_game/default/sounds/default_ice_footstep.3.ogg b/mods/minetest_game/default/sounds/default_ice_footstep.3.ogg new file mode 100644 index 0000000..2ecbb43 Binary files /dev/null and b/mods/minetest_game/default/sounds/default_ice_footstep.3.ogg differ diff --git a/mods/minetest_game/default/sounds/default_metal_footstep.1.ogg b/mods/minetest_game/default/sounds/default_metal_footstep.1.ogg index 841286b..49fe89b 100644 Binary files a/mods/minetest_game/default/sounds/default_metal_footstep.1.ogg and b/mods/minetest_game/default/sounds/default_metal_footstep.1.ogg differ diff --git a/mods/minetest_game/default/sounds/default_metal_footstep.2.ogg b/mods/minetest_game/default/sounds/default_metal_footstep.2.ogg index aa61ed3..878711d 100644 Binary files a/mods/minetest_game/default/sounds/default_metal_footstep.2.ogg and b/mods/minetest_game/default/sounds/default_metal_footstep.2.ogg differ diff --git a/mods/minetest_game/default/sounds/default_metal_footstep.3.ogg b/mods/minetest_game/default/sounds/default_metal_footstep.3.ogg index 4cc1ca4..2a566a8 100644 Binary files a/mods/minetest_game/default/sounds/default_metal_footstep.3.ogg and b/mods/minetest_game/default/sounds/default_metal_footstep.3.ogg differ diff --git a/mods/minetest_game/default/sounds/default_sand_footstep.1.ogg b/mods/minetest_game/default/sounds/default_sand_footstep.1.ogg index 65b68c7..b92feab 100644 Binary files a/mods/minetest_game/default/sounds/default_sand_footstep.1.ogg and b/mods/minetest_game/default/sounds/default_sand_footstep.1.ogg differ diff --git a/mods/minetest_game/default/sounds/default_sand_footstep.2.ogg b/mods/minetest_game/default/sounds/default_sand_footstep.2.ogg index 57f35f3..6bc5da3 100644 Binary files a/mods/minetest_game/default/sounds/default_sand_footstep.2.ogg and b/mods/minetest_game/default/sounds/default_sand_footstep.2.ogg differ diff --git a/mods/minetest_game/default/sounds/default_sand_footstep.3.ogg b/mods/minetest_game/default/sounds/default_sand_footstep.3.ogg new file mode 100644 index 0000000..880306f Binary files /dev/null and b/mods/minetest_game/default/sounds/default_sand_footstep.3.ogg differ diff --git a/mods/minetest_game/default/textures/default_amethyst_block.png b/mods/minetest_game/default/textures/default_amethyst_block.png new file mode 100644 index 0000000..76f3134 Binary files /dev/null and b/mods/minetest_game/default/textures/default_amethyst_block.png differ diff --git a/mods/minetest_game/default/textures/default_amethyst_gem.png b/mods/minetest_game/default/textures/default_amethyst_gem.png new file mode 100644 index 0000000..bfd6c3d Binary files /dev/null and b/mods/minetest_game/default/textures/default_amethyst_gem.png differ diff --git a/mods/minetest_game/default/textures/default_invisible_node_overlay.png b/mods/minetest_game/default/textures/default_invisible_node_overlay.png new file mode 100644 index 0000000..7fc8806 Binary files /dev/null and b/mods/minetest_game/default/textures/default_invisible_node_overlay.png differ diff --git a/mods/minetest_game/default/textures/default_mese_post_light_side.png b/mods/minetest_game/default/textures/default_mese_post_light_side.png old mode 100755 new mode 100644 index 8581f13..a94e8b1 Binary files a/mods/minetest_game/default/textures/default_mese_post_light_side.png and b/mods/minetest_game/default/textures/default_mese_post_light_side.png differ diff --git a/mods/minetest_game/default/textures/default_mese_post_light_side_dark.png b/mods/minetest_game/default/textures/default_mese_post_light_side_dark.png old mode 100755 new mode 100644 index 8581f13..9098314 Binary files a/mods/minetest_game/default/textures/default_mese_post_light_side_dark.png and b/mods/minetest_game/default/textures/default_mese_post_light_side_dark.png differ diff --git a/mods/minetest_game/doors/init.lua b/mods/minetest_game/doors/init.lua index 2048a64..16acb36 100644 --- a/mods/minetest_game/doors/init.lua +++ b/mods/minetest_game/doors/init.lua @@ -78,6 +78,8 @@ end -- nodes from being placed in the top half of the door. minetest.register_node("doors:hidden", { description = S("Hidden Door Segment"), + inventory_image = "doors_hidden_segment.png^default_invisible_node_overlay.png", + wield_image = "doors_hidden_segment.png^default_invisible_node_overlay.png", drawtype = "airlike", paramtype = "light", paramtype2 = "facedir", @@ -431,6 +433,7 @@ function doors.register(name, def) def.sunlight_propagates = true def.walkable = true def.is_ground_content = false + use_texture_alpha = true def.buildable_to = false def.selection_box = {type = "fixed", fixed = {-1/2,-1/2,-1/2,1/2,3/2,-6/16}} def.collision_box = {type = "fixed", fixed = {-1/2,-1/2,-1/2,1/2,3/2,-6/16}} diff --git a/mods/minetest_game/doors/locale/doors.zh_CN.tr b/mods/minetest_game/doors/locale/doors.zh_CN.tr index 5294558..50f38c0 100644 --- a/mods/minetest_game/doors/locale/doors.zh_CN.tr +++ b/mods/minetest_game/doors/locale/doors.zh_CN.tr @@ -11,7 +11,7 @@ You do not own this trapdoor.=这个活板门不属于你所有。 a locked trapdoor=一扇已上锁的活板门 Wooden Trapdoor=木活板门 Steel Trapdoor=铁活板门 -Apple Wood Fence Gate=用苹果树做的木栅栏门 +Apple Wood Fence Gate=苹果木栅栏门 Acacia Wood Fence Gate=相思木栅栏门 Jungle Wood Fence Gate=丛林木栅栏门 Pine Wood Fence Gate=松木栅栏门 diff --git a/mods/minetest_game/doors/locale/doors.zh_TW.tr b/mods/minetest_game/doors/locale/doors.zh_TW.tr index 47959ee..81e06fc 100644 --- a/mods/minetest_game/doors/locale/doors.zh_TW.tr +++ b/mods/minetest_game/doors/locale/doors.zh_TW.tr @@ -11,7 +11,7 @@ You do not own this trapdoor.=這個活板門不屬於你所有。 a locked trapdoor=一扇已上鎖的活板門 Wooden Trapdoor=木活板門 Steel Trapdoor=鐵活板門 -Apple Wood Fence Gate=用蘋果樹做的木柵欄門 +Apple Wood Fence Gate=蘋果木柵欄門 Acacia Wood Fence Gate=相思木柵欄門 Jungle Wood Fence Gate=叢林木柵欄門 Pine Wood Fence Gate=松木柵欄門 diff --git a/mods/minetest_game/doors/textures/doors_hidden_segment.png b/mods/minetest_game/doors/textures/doors_hidden_segment.png new file mode 100644 index 0000000..b3b6f34 Binary files /dev/null and b/mods/minetest_game/doors/textures/doors_hidden_segment.png differ diff --git a/mods/minetest_game/fireflies/init.lua b/mods/minetest_game/fireflies/init.lua index 1c533a1..0d70630 100644 --- a/mods/minetest_game/fireflies/init.lua +++ b/mods/minetest_game/fireflies/init.lua @@ -54,8 +54,8 @@ minetest.register_node("fireflies:firefly", { minetest.register_node("fireflies:hidden_firefly", { description = S("Hidden Firefly"), drawtype = "airlike", - inventory_image = "fireflies_firefly.png", - wield_image = "fireflies_firefly.png", + inventory_image = "fireflies_firefly.png^default_invisible_node_overlay.png", + wield_image = "fireflies_firefly.png^default_invisible_node_overlay.png", paramtype = "light", sunlight_propagates = true, walkable = false, diff --git a/mods/minetest_game/game.conf b/mods/minetest_game/game.conf new file mode 100644 index 0000000..7c8ac2c --- /dev/null +++ b/mods/minetest_game/game.conf @@ -0,0 +1,3 @@ +name = Minetest Game +author = Minetest +description = A basic exploration, mining, crafting and building sandbox game with no NPCs, monsters or animals. Minetest Game is usually used with mods added and many mods are available for this game. Reliably maintained by Minetest Engine core developers. diff --git a/mods/minetest_game/game_api.txt b/mods/minetest_game/game_api.txt new file mode 100644 index 0000000..bddf7e2 --- /dev/null +++ b/mods/minetest_game/game_api.txt @@ -0,0 +1,1084 @@ +Minetest Game API +================= +GitHub Repo: https://github.com/minetest/minetest_game + + +Introduction +------------ + +The Minetest Game game offers multiple new possibilities in addition to the Minetest engine's built-in API, +allowing you to add new plants to farming mod, buckets for new liquids, new stairs and custom panes. +For information on the Minetest API, visit https://github.com/minetest/minetest/blob/master/doc/lua_api.txt +Please note: + + * [XYZ] refers to a section the Minetest API + * [#ABC] refers to a section in this document + * [pos] refers to a position table `{x = -5, y = 0, z = 200}` + + +Bucket API +---------- + +The bucket API allows registering new types of buckets for non-default liquids. + + bucket.register_liquid( + "default:lava_source", -- name of the source node + "default:lava_flowing", -- name of the flowing node + "bucket:bucket_lava", -- name of the new bucket item (or nil if liquid is not takeable) + "bucket_lava.png", -- texture of the new bucket item (ignored if itemname == nil) + "Lava Bucket", -- text description of the bucket item + {lava_bucket = 1}, -- groups of the bucket item, OPTIONAL + false -- force-renew, OPTIONAL. Force the liquid source to renew if it has + -- a source neighbour, even if defined as 'liquid_renewable = false'. + -- Needed to avoid creating holes in sloping rivers. + ) + +The filled bucket item is returned to the player that uses an empty bucket pointing to the given liquid source. +When punching with an empty bucket pointing to an entity or a non-liquid node, the on_punch of the entity or node will be triggered. + + +Beds API +-------- + + beds.register_bed( + "beds:bed", -- Bed name + def -- See [#Bed definition] + ) + + * `beds.can_dig(bed_pos)` Returns a boolean whether the bed at `bed_pos` may be dug + * `beds.read_spawns() ` Returns a table containing players respawn positions + * `beds.kick_players()` Forces all players to leave bed + * `beds.skip_night()` Sets world time to morning and saves respawn position of all players currently sleeping + +### Bed definition + + { + description = "Simple Bed", + inventory_image = "beds_bed.png", + wield_image = "beds_bed.png", + tiles = { + bottom = {'Tile definition'}, -- the tiles of the bottom part of the bed. + top = {Tile definition} -- the tiles of the bottom part of the bed. + }, + nodebox = { + bottom = 'regular nodebox', -- bottom part of bed (see [Node boxes]) + top = 'regular nodebox', -- top part of bed (see [Node boxes]) + }, + selectionbox = 'regular nodebox', -- for both nodeboxes (see [Node boxes]) + recipe = { -- Craft recipe + {"group:wool", "group:wool", "group:wool"}, + {"group:wood", "group:wood", "group:wood"} + } + } + + +Bones API +--------- + +An ordered list of listnames (default: "main", "craft") of the player inventory, +that will be placed into bones or dropped on player death can be looked up or changed +in `bones.player_inventory_lists`. + +e.g. `table.insert(bones.player_inventory_lists, "backpack")` + + +Creative API +------------ + +Use `creative.register_tab(name, title, items)` to add a tab with filtered items. +For example, + + creative.register_tab("tools", "Tools", minetest.registered_tools) + +is used to show all tools. Name is used in the sfinv page name, title is the +human readable title. + +Creative provides `creative.is_enabled_for(name)`, which is identical in +functionality to the engine's `minetest.creative_is_enabled(name)`. +Its use is deprecated and it should also not be overriden. + +The contents of `creative.formspec_add` is appended to every creative inventory +page. Mods can use it to add additional formspec elements onto the default +creative inventory formspec to be drawn after each update. + +Group overrides can be used for any registered item, node or tool. Use one of +the groups stated below to pick which category it will appear in. + + node = 1 -- Appears in the Nodes category + tool = 1 -- Appears in the Tools category + craftitem = 1 -- Appears in the Items category + + +Chests API +---------- + +The chests API allows the creation of chests, which have their own inventories for holding items. + +`default.chest.get_chest_formspec(pos)` + + * Returns a formspec for a specific chest. + * `pos` Location of the chest node, e.g `{x = 1, y = 1, z = 1}` + +`default.chest.chest_lid_obstructed(pos)` + + * Returns a boolean depending on whether or not a chest has its top obstructed by a solid node. + * `pos` Location of the chest node, e.g `{x = 1, y = 1, z = 1}` + +`default.chest.chest_lid_close(pn)` + + * Closes the chest that a player is currently looking in. + * `pn` The name of the player whose chest is going to be closed + +`default.chest.open_chests` + + * A table indexed by player name to keep track of who opened what chest. + * Key: The name of the player. + * Value: A table containing information about the chest the player is looking at. + e.g `{ pos = {1, 1, 1}, sound = null, swap = "default:chest" }` + +`default.chest.register_chest(name, def)` + + * Registers new chest + * `name` Name for chest e.g. "default:chest" + * `def` See [#Chest Definition] + +### Chest Definition + + description = "Chest", + tiles = { + "default_chest_top.png", + "default_chest_top.png", + "default_chest_side.png", + "default_chest_side.png", + "default_chest_front.png", + "default_chest_inside.png" + }, -- Textures which are applied to the chest model. + sounds = default.node_sound_wood_defaults(), + sound_open = "default_chest_open", + sound_close = "default_chest_close", + groups = {choppy = 2, oddly_breakable_by_hand = 2}, + protected = false, -- If true, only placer can modify chest. + + +Doors API +--------- + +The doors mod allows modders to register custom doors and trapdoors. + +`doors.registered_doors[name] = Door definition` + * Table of registered doors, indexed by door name + +`doors.registered_trapdoors[name] = Trapdoor definition` + * Table of registered trap doors, indexed by trap door name + +`doors.register_door(name, def)` + + * Registers new door + * `name` Name for door + * `def` See [#Door definition] + +`doors.register_trapdoor(name, def)` + + * Registers new trapdoor + * `name` Name for trapdoor + * `def` See [#Trapdoor definition] + +`doors.register_fencegate(name, def)` + + * Registers new fence gate + * `name` Name for fence gate + * `def` See [#Fence gate definition] + +`doors.get(pos)` + + * `pos` A position as a table, e.g `{x = 1, y = 1, z = 1}` + * Returns an ObjectRef to a door, or nil if the position does not contain a door + + ### Methods + + :open(player) -- Open the door object, returns if door was opened + :close(player) -- Close the door object, returns if door was closed + :toggle(player) -- Toggle the door state, returns if state was toggled + :state() -- returns the door state, true = open, false = closed + + the "player" parameter can be omitted in all methods. If passed then + the usual permission checks will be performed to make sure the player + has the permissions needed to open this door. If omitted then no + permission checks are performed. + +`doors.door_toggle(pos, node, clicker)` + + * Toggle door open or shut + * `pos` Position of the door + * `node` Node definition + * `clicker` Player definition for the player that clicked on the door + +### Door definition + + description = "Door description", + inventory_image = "mod_door_inv.png", + groups = {choppy = 2}, + tiles = {"mod_door.png"}, -- UV map. + -- The front and back of the door must be identical in appearence as they swap on + -- open/close. + recipe = craftrecipe, + sounds = default.node_sound_wood_defaults(), -- optional + sound_open = sound play for open door, -- optional + sound_close = sound play for close door, -- optional + protected = false, -- If true, only placer can open the door (locked for others) + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + -- optional function containing the on_rightclick callback, defaults to a doors.door_toggle-wrapper + +### Trapdoor definition + + description = "Trapdoor description", + inventory_image = "mod_trapdoor_inv.png", + groups = {choppy = 2}, + tile_front = "doors_trapdoor.png", -- the texture for the front and back of the trapdoor + tile_side = "doors_trapdoor_side.png", + -- The texture for the four sides of the trapdoor. + -- The texture should have the trapdoor side drawn twice, in the lowest and highest + -- 1/8ths of the texture, both upright. The area between is not used. + -- The lower 1/8th will be used for the closed trapdoor, the higher 1/8th will be used + -- for the open trapdoor. + sounds = default.node_sound_wood_defaults(), -- optional + sound_open = sound play for open door, -- optional + sound_close = sound play for close door, -- optional + protected = false, -- If true, only placer can open the door (locked for others) + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + -- function containing the on_rightclick callback + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + -- function containing the on_rightclick callback + +### Fence gate definition + + description = "Wooden Fence Gate", + texture = "default_wood.png", -- `backface_culling` will automatically be + -- set to `true` if not specified. + material = "default:wood", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = default.node_sound_wood_defaults(), -- optional + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + -- function containing the on_rightclick callback + + +Dungeon Loot API +---------------- + +The mod that places chests with loot in dungeons provides an API to register additional loot. + +`dungeon_loot.register(def)` + + * Registers one or more loot items + * `def` Can be a single [#Loot definition] or a list of them + +`dungeon_loot.registered_loot` + + * Table of all registered loot, not to be modified manually + +### Loot definition + + name = "item:name", + chance = 0.5, + -- ^ chance value from 0.0 to 1.0 that the item will appear in the chest when chosen + -- Due to an extra step in the selection process, 0.5 does not(!) mean that + -- on average every second chest will have this item + count = {1, 4}, + -- ^ table with minimum and maximum amounts of this item + -- optional, defaults to always single item + y = {-32768, -512}, + -- ^ table with minimum and maximum heights this item can be found at + -- optional, defaults to no height restrictions + types = {"desert"}, + -- ^ table with types of dungeons this item can be found in + -- supported types: "normal" (the cobble/mossycobble one), "sandstone" + -- "desert" and "ice" + -- optional, defaults to no type restrictions + + +Fence API +--------- + +Allows creation of new fences with "fencelike" drawtype. + +`default.register_fence(name, item definition)` + + Registers a new fence. Custom fields texture and material are required, as + are name and description. The rest is optional. You can pass most normal + nodedef fields here except drawtype. The fence group will always be added + for this node. + +### fence definition + + name = "default:fence_wood", + description = "Wooden Fence", + texture = "default_wood.png", + material = "default:wood", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + + +Walls API +--------- + +The walls API allows easy addition of stone auto-connecting wall nodes. + +walls.register(name, desc, texture, mat, sounds) +^ name = "walls:stone_wall". Node name. +^ desc = "A Stone wall" +^ texture = "default_stone.png" +^ mat = "default:stone". Used to auto-generate crafting recipe. +^ sounds = sounds: see [#Default sounds] + + +Farming API +----------- + +The farming API allows you to easily register plants and hoes. + +`farming.register_hoe(name, hoe definition)` + * Register a new hoe, see [#hoe definition] + +`farming.register_plant(name, Plant definition)` + * Register a new growing plant, see [#Plant definition] + +`farming.registered_plants[name] = definition` + * Table of registered plants, indexed by plant name + +### Hoe Definition + + + { + description = "", -- Description for tooltip + inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image + max_uses = 30, -- Uses until destroyed + material = "", -- Material for recipes + recipe = { -- Craft recipe, if material isn't used + {"air", "air", "air"}, + {"", "group:stick"}, + {"", "group:stick"}, + } + } + +### Plant definition + + { + description = "", -- Description of seed item + harvest_description = "", -- Description of harvest item + -- (optional, derived automatically if not provided) + inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image + steps = 8, -- How many steps the plant has to grow, until it can be harvested + -- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber) + minlight = 13, -- Minimum light to grow + maxlight = default.LIGHT_MAX -- Maximum light to grow + } + + +Fire API +-------- + +Add group flammable when registering a node to make fire seek for it. +Add it to an item to make it burn up when dropped in lava or fire. +New node def property: + +`on_burn(pos)` + + * Called when fire attempts to remove a burning node. + * `pos` Position of the burning node. + + `on_ignite(pos, igniter)` + + * Called when Flint and steel (or a mod defined ignitor) is used on a node. + Defining it may prevent the default action (spawning flames) from triggering. + * `pos` Position of the ignited node. + * `igniter` Player that used the tool, when available. + + +Give Initial Stuff API +---------------------- + +`give_initial_stuff.give(player)` + +^ Give initial stuff to "player" + +`give_initial_stuff.add(stack)` + +^ Add item to the initial stuff +^ Stack can be an ItemStack or a item name eg: "default:dirt 99" +^ Can be called after the game has loaded + +`give_initial_stuff.clear()` + +^ Removes all items from the initial stuff +^ Can be called after the game has loaded + +`give_initial_stuff.get_list()` + +^ returns list of item stacks + +`give_initial_stuff.set_list(list)` + +^ List of initial items with numeric indices. + +`give_initial_stuff.add_from_csv(str)` + +^ str is a comma separated list of initial stuff +^ Adds items to the list of items to be given + + +Player API +---------- + +The player API can register player models and update the player's appearance. + +* `player_api.register_model(name, def)` + * Register a new model to be used by players + * `name`: model filename such as "character.x", "foo.b3d", etc. + * `def`: see [#Model definition] + * Saved to player_api.registered_models + +* `player_api.registered_models[name]` + * Get a model's definition + * `name`: model filename + * See [#Model definition] + +* `player_api.set_model(player, model_name)` + * Change a player's model + * `player`: PlayerRef + * `model_name`: model registered with player_api.register_model() + +* `player_api.set_animation(player, anim_name, speed)` + * Applies an animation to a player + * `player`: PlayerRef + * `anim_name`: name of the animation + * `speed`: frames per second. If nil, the default from the model def is used + +* `player_api.set_textures(player, textures)` + * Sets player textures + * `player`: PlayerRef + * `textures`: array of textures. If nil, the default from the model def is used + +* `player_api.get_animation(player)` + * Returns a table containing fields `model`, `textures` and `animation` + * Any of the fields of the returned table may be nil + * `player`: PlayerRef + +* `player_api.player_attached` + * A table that maps a player name to a boolean + * If the value for a given player is set to true, the default player animations + (walking, digging, ...) will no longer be updated, and knockback from damage is + prevented for that player + * Example of usage: A mod sets a player's value to true when attached to a vehicle + +### Model Definition + + { + animation_speed = 30, -- Default animation speed, in FPS + textures = {"character.png", }, -- Default array of textures + visual_size = {x = 1, y = 1}, -- Used to scale the model + animations = { + -- = {x = , y = }, + foo = {x = 0, y = 19}, + bar = {x = 20, y = 39}, + -- ... + }, + collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, -- In nodes from feet position + stepheight = 0.6, -- In nodes + eye_height = 1.47, -- In nodes above feet position + } + + +TNT API +------- + +`tnt.register_tnt(definition)` + +^ Register a new type of tnt. + + * `name` The name of the node. If no prefix is given `tnt` is used. + * `description` A description for your TNT. + * `radius` The radius within which the TNT can destroy nodes. The default is 3. + * `damage_radius` The radius within which the TNT can damage players and mobs. By default it is twice the `radius`. + * `sound` The sound played when explosion occurs. By default it is `tnt_explode`. + * `disable_drops` Disable drops. By default it is set to false. + * `ignore_protection` Don't check `minetest.is_protected` before removing a node. + * `ignore_on_blast` Don't call `on_blast` even if a node has one. + * `tiles` Textures for node + * `side` Side tiles. By default the name of the tnt with a suffix of `_side.png`. + * `top` Top tile. By default the name of the tnt with a suffix of `_top.png`. + * `bottom` Bottom tile. By default the name of the tnt with a suffix of `_bottom.png`. + * `burning` Top tile when lit. By default the name of the tnt with a suffix of `_top_burning_animated.png". + +`tnt.boom(position[, definition])` + +^ Create an explosion. + +* `position` The center of explosion. +* `definition` The TNT definion as passed to `tnt.register` with the following addition: + * `explode_center` false by default which removes TNT node on blast, when true will explode center node. + +`tnt.burn(position, [nodename])` + +^ Ignite node at position, triggering its `on_ignite` callback (see fire mod). +If no such callback exists, fallback to turn tnt group nodes to their +"_burning" variant. + nodename isn't required unless already known. + +To make dropping items from node inventories easier, you can use the +following helper function from 'default': + +default.get_inventory_drops(pos, inventory, drops) + +^ Return drops from node inventory "inventory" in drops. + +* `pos` - the node position +* `inventory` - the name of the inventory (string) +* `drops` - an initialized list + +The function returns no values. The drops are returned in the `drops` +parameter, and drops is not reinitialized so you can call it several +times in a row to add more inventory items to it. + + +`on_blast` callbacks: + +Both nodedefs and entitydefs can provide an `on_blast()` callback + +`nodedef.on_blast(pos, intensity)` +^ Allow drop and node removal overriding +* `pos` - node position +* `intensity` - TNT explosion measure. larger or equal to 1.0 +^ Should return a list of drops (e.g. {"default:stone"}) +^ Should perform node removal itself. If callback exists in the nodedef +^ then the TNT code will not destroy this node. + +`entitydef.on_blast(luaobj, damage)` +^ Allow TNT effects on entities to be overridden +* `luaobj` - LuaEntityRef of the entity +* `damage` - suggested HP damage value +^ Should return a list of (bool do_damage, bool do_knockback, table drops) +* `do_damage` - if true then TNT mod wil damage the entity +* `do_knockback` - if true then TNT mod will knock the entity away +* `drops` - a list of drops, e.g. {"wool:red"} + + +Screwdriver API +--------------- + +The screwdriver API allows you to control a node's behaviour when a screwdriver is used on it. +To use it, add the `on_screwdriver` function to the node definition. + +`on_rotate(pos, node, user, mode, new_param2)` + + * `pos` Position of the node that the screwdriver is being used on + * `node` that node + * `user` The player who used the screwdriver + * `mode` screwdriver.ROTATE_FACE or screwdriver.ROTATE_AXIS + * `new_param2` the new value of param2 that would have been set if on_rotate wasn't there + * return value: false to disallow rotation, nil to keep default behaviour, true to allow + it but to indicate that changed have already been made (so the screwdriver will wear out) + * use `on_rotate = false` to always disallow rotation + * use `on_rotate = screwdriver.rotate_simple` to allow only face rotation + + +Sethome API +----------- + +The sethome API adds three global functions to allow mods to read a players home position, +set a players home position and teleport a player to home position. + +`sethome.get(name)` + + * `name` Player who's home position you wish to get + * return value: false if no player home coords exist, position table if true + +`sethome.set(name, pos)` + + * `name` Player who's home position you wish to set + * `pos` Position table containing coords of home position + * return value: false if unable to set and save new home position, otherwise true + +`sethome.go(name)` + + * `name` Player you wish to teleport to their home position + * return value: false if player cannot be sent home, otherwise true + + +Sfinv API +--------- + +It is recommended that you read this link for a good introduction to the +sfinv API by its author: https://rubenwardy.com/minetest_modding_book/en/chapters/sfinv.html + +### sfinv Methods + +**Pages** + +* sfinv.set_page(player, pagename) - changes the page +* sfinv.get_page(player) - get the current page name. Will never return nil +* sfinv.get_homepage_name(player) - get the page name of the first page to show to a player +* sfinv.register_page(name, def) - register a page, see section below +* sfinv.override_page(name, def) - overrides fields of an page registered with register_page. + * Note: Page must already be defined, (opt)depend on the mod defining it. +* sfinv.set_player_inventory_formspec(player) - (re)builds page formspec + and calls set_inventory_formspec(). +* sfinv.get_formspec(player, context) - builds current page's formspec + +**Contexts** + +* sfinv.get_or_create_context(player) - gets the player's context +* sfinv.set_context(player, context) + +**Theming** + +* sfinv.make_formspec(player, context, content, show_inv, size) - adds a theme to a formspec + * show_inv, defaults to false. Whether to show the player's main inventory + * size, defaults to `size[8,8.6]` if not specified +* sfinv.get_nav_fs(player, context, nav, current_idx) - creates tabheader or "" + +### sfinv Members + +* pages - table of pages[pagename] = def +* pages_unordered - array table of pages in order of addition (used to build navigation tabs). +* contexts - contexts[playername] = player_context +* enabled - set to false to disable. Good for inventory rehaul mods like unified inventory + +### Context + +A table with these keys: + +* page - current page name +* nav - a list of page names +* nav_titles - a list of page titles +* nav_idx - current nav index (in nav and nav_titles) +* any thing you want to store + * sfinv will clear the stored data on log out / log in + +### sfinv.register_page + +sfinv.register_page(name, def) + +def is a table containing: + +* `title` - human readable page name (required) +* `get(self, player, context)` - returns a formspec string. See formspec variables. (required) +* `is_in_nav(self, player, context)` - return true to show in the navigation (the tab header, by default) +* `on_player_receive_fields(self, player, context, fields)` - on formspec submit. +* `on_enter(self, player, context)` - called when the player changes pages, usually using the tabs. +* `on_leave(self, player, context)` - when leaving this page to go to another, called before other's on_enter + +### get formspec + +Use sfinv.make_formspec to apply a layout: + + return sfinv.make_formspec(player, context, [[ + list[current_player;craft;1.75,0.5;3,3;] + list[current_player;craftpreview;5.75,1.5;1,1;] + image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270] + listring[current_player;main] + listring[current_player;craft] + image[0,4.25;1,1;gui_hb_bg.png] + image[1,4.25;1,1;gui_hb_bg.png] + image[2,4.25;1,1;gui_hb_bg.png] + image[3,4.25;1,1;gui_hb_bg.png] + image[4,4.25;1,1;gui_hb_bg.png] + image[5,4.25;1,1;gui_hb_bg.png] + image[6,4.25;1,1;gui_hb_bg.png] + image[7,4.25;1,1;gui_hb_bg.png] + ]], true) + +See above (methods section) for more options. + +### Customising themes + +Simply override this function to change the navigation: + + function sfinv.get_nav_fs(player, context, nav, current_idx) + return "navformspec" + end + +And override this function to change the layout: + + function sfinv.make_formspec(player, context, content, show_inv, size) + local tmp = { + size or "size[8,8.6]", + theme_main, + sfinv.get_nav_fs(player, context, context.nav_titles, context.nav_idx), + content + } + if show_inv then + tmp[4] = theme_inv + end + return table.concat(tmp, "") + end + + +Stairs API +---------- + +The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those +delivered with Minetest Game, to keep them compatible with other mods. + +`stairs.register_stair(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers a stair + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + +`stairs.register_slab(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers a slab + * `subname`: Basically the material name (e.g. cobble) used for the slab name. Nodename pattern: "stairs:slab_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble" + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the slab's definition + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + +`stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds, worldaligntex, full_description)` + + * Registers an inner corner stair + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_inner_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition with "Inner" prepended + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + * `full_description`: Overrides the description, bypassing string concatenation. This is useful for translation. (optional) + +`stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds, worldaligntex, full_description)` + + * Registers an outer corner stair + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_outer_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition with "Outer" prepended + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + * `full_description`: Overrides the description, bypassing string concatenation. This is useful for translation. (optional) + +``` +stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, + sounds, worldaligntex, desc_stair_inner, desc_stair_outer) +``` + + * A wrapper for stairs.register_stair, stairs.register_slab, stairs.register_stair_inner, stairs.register_stair_outer + * Uses almost the same arguments as stairs.register_stair + * `desc_stair`: Description for stair nodes. For corner stairs 'Inner' or 'Outer' will be prefixed unless + `desc_stair_inner` or `desc_stair_outer` are specified, which are used instead. + * `desc_slab`: Description for slab node + * `desc_stair_inner`: Description for inner stair node + * `desc_stair_outer`: Description for outer stair node + + +Xpanes API +---------- + +Creates panes that automatically connect to each other + +`xpanes.register_pane(subname, def)` + + * `subname`: used for nodename. Result: "xpanes:subname" and "xpanes:subname_{2..15}" + * `def`: See [#Pane definition] + +### Pane definition + + { + textures = { + "texture for front and back", + (unused), + "texture for the 4 edges" + }, -- More tiles aren't supported + groups = {group = rating}, -- Uses the known node groups, see [Known damage and digging time defining groups] + sounds = SoundSpec, -- See [#Default sounds] + recipe = {{"","","","","","","","",""}}, -- Recipe field only + use_texture_alpha = true, -- Optional boolean (default: `false`) for colored glass panes + } + + +Raillike definitions +-------------------- + +The following nodes use the group `connect_to_raillike` and will only connect to +raillike nodes within this group and the same group value. +Use `minetest.raillike_group()` to get the group value. + +| Node type | Raillike group name +|-----------------------|--------------------- +| default:rail | "rail" +| tnt:gunpowder | "gunpowder" +| tnt:gunpowder_burning | "gunpowder" + +Example: +If you want to add a new rail type and want it to connect with default:rail, +add `connect_to_raillike=minetest.raillike_group("rail")` into the `groups` table +of your node. + + +Default sounds +-------------- + +Sounds inside the default table can be used within the sounds field of node definitions. + + * `default.node_sound_defaults()` + * `default.node_sound_stone_defaults()` + * `default.node_sound_dirt_defaults()` + * `default.node_sound_sand_defaults()` + * `default.node_sound_wood_defaults()` + * `default.node_sound_leaves_defaults()` + * `default.node_sound_glass_defaults()` + * `default.node_sound_metal_defaults()` + + +Default constants +----------------- + +`default.LIGHT_MAX` The maximum light level (see [Node definition] light_source) + + +GUI and formspecs +----------------- + +`default.get_hotbar_bg(x, y)` + + * Get the hotbar background as string, containing the formspec elements + * x: Horizontal position in the formspec + * y: Vertical position in the formspec + +`default.gui_bg` + + * Deprecated, remove from mods. + +`default.gui_bg_img` + + * Deprecated, remove from mods. + +`default.gui_slots` + + * Deprecated, remove from mods. + +`default.gui_survival_form` + + * Entire formspec for the survival inventory + +`default.get_furnace_active_formspec(fuel_percent, item_percent)` + + * Get the active furnace formspec using the defined GUI elements + * fuel_percent: Percent of how much the fuel is used + * item_percent: Percent of how much the item is cooked + +`default.get_furnace_inactive_formspec()` + + * Get the inactive furnace formspec using the defined GUI elements + + +Leafdecay +--------- + +To enable leaf decay for leaves when a tree is cut down by a player, +register the tree with the default.register_leafdecay(leafdecaydef) +function. + +If `param2` of any registered node is ~= 0, the node will always be +preserved. Thus, if the player places a node of that kind, you will +want to set `param2 = 1` or so. + +The function `default.after_place_leaves` can be set as +`after_place_node of a node` to set param2 to 1 if the player places +the node (should not be used for nodes that use param2 otherwise +(e.g. facedir)). + +If the node is in the `leafdecay_drop` group then it will always be +dropped as an item. + +`default.register_leafdecay(leafdecaydef)` + +`leafdecaydef` is a table, with following members: + { + trunks = {"default:tree"}, -- nodes considered trunks + leaves = {"default:leaves", "default:apple"}, + -- nodes considered for removal + radius = 3, -- radius to consider for searching + } + +Note: all the listed nodes in `trunks` have their `on_after_destruct` +callback overridden. All the nodes listed in `leaves` have their +`on_timer` callback overridden. + + +Dyes +---- + +Minetest Game dyes are registered with: + + groups = {dye = 1, color_ = 1}, + +To make recipes that will work with dyes from many mods, define them using the +dye group and the color groups. + +Dye color groups: + + * `color_white` + * `color_grey` + * `color_dark_grey` + * `color_black` + * `color_red` + * `color_pink` + * `color_orange` + * `color_brown` + * `color_yellow` + * `color_green` + * `color_dark_green` + * `color_blue` + * `color_cyan` + * `color_violet` + * `color_magenta` + +Example of one shapeless recipe using the dye group and a color group: + + minetest.register_craft({ + type = "shapeless", + output = ":item_yellow", + recipe = {":item_no_color", "group:dye,color_yellow"}, + }) + + +Trees +----- + + * `default.grow_tree(pos, is_apple_tree)` + * Grows a mgv6 tree or apple tree at pos + + * `default.grow_jungle_tree(pos)` + * Grows a mgv6 jungletree at pos + + * `default.grow_pine_tree(pos)` + * Grows a mgv6 pinetree at pos + + * `default.grow_new_apple_tree(pos)` + * Grows a new design apple tree at pos + + * `default.grow_new_jungle_tree(pos)` + * Grows a new design jungle tree at pos + + * `default.grow_new_pine_tree(pos)` + * Grows a new design pine tree at pos + + * `default.grow_new_snowy_pine_tree(pos)` + * Grows a new design snowy pine tree at pos + + * `default.grow_new_acacia_tree(pos)` + * Grows a new design acacia tree at pos + + * `default.grow_new_aspen_tree(pos)` + * Grows a new design aspen tree at pos + + * `default.grow_bush(pos)` + * Grows a bush at pos + + * `default.grow_acacia_bush(pos)` + * Grows an acaia bush at pos + + * `default.grow_pine_bush(pos)` + * Grows a pine bush at pos + + * `default.grow_blueberry_bush(pos)` + * Grows a blueberry bush at pos + + +Carts +----- + + carts.register_rail( + "mycarts:myrail", -- Rail name + nodedef, -- standard nodedef + railparams -- rail parameter struct (optional) + ) + + railparams = { + on_step(obj, dtime), -- Event handler called when + -- cart is on rail + acceleration, -- integer acceleration factor (negative + -- values to brake) + } + + The event handler is called after all default calculations + are made, so the custom on_step handler can override things + like speed, acceleration, player attachment. The handler will + likely be called many times per second, so the function needs + to make sure that the event is handled properly. + + +Key API +------- + +The key API allows mods to add key functionality to nodes that have +ownership or specific permissions. Using the API will make it so +that a node owner can use skeleton keys on their nodes to create keys +for that node in that location, and give that key to other players, +allowing them some sort of access that they otherwise would not have +due to node protection. + +To make your new nodes work with the key API, you need to register +two callback functions in each nodedef: + + +`on_key_use(pos, player)` + * Is called when a player right-clicks (uses) a normal key on your + * node. + * `pos` - position of the node + * `player` - PlayerRef + * return value: none, ignored + +The `on_key_use` callback should validate that the player is wielding +a key item with the right key meta secret. If needed the code should +deny access to the node functionality. + +If formspecs are used, the formspec callbacks should duplicate these +checks in the metadata callback functions. + + +`on_skeleton_key_use(pos, player, newsecret)` + + * Is called when a player right-clicks (uses) a skeleton key on your + * node. + * `pos` - position of the node + * `player` - PlayerRef + * `newsecret` - a secret value(string) + * return values: + * `secret` - `nil` or the secret value that unlocks the door + * `name` - a string description of the node ("a locked chest") + * `owner` - name of the node owner + +The `on_skeleton_key_use` function should validate that the player has +the right permissions to make a new key for the item. The newsecret +value is useful if the node has no secret value. The function should +store this secret value somewhere so that in the future it may compare +key secrets and match them to allow access. If a node already has a +secret value, the function should return that secret value instead +of the newsecret value. The secret value stored for the node should +not be overwritten, as this would invalidate existing keys. + +Aside from the secret value, the function should retun a descriptive +name for the node and the owner name. The return values are all +encoded in the key that will be given to the player in replacement +for the wielded skeleton key. + +if `nil` is returned, it is assumed that the wielder did not have +permissions to create a key for this node, and no key is created. + +`default.register_craft_metadata_copy(ingredient, result)` +---------------------------------------------------------- + +This function registers a shapeless recipe that takes `ingredient` +and `result` as input and outputs `result`. + +The metadata of the input `result` is copied to the output `result`. diff --git a/mods/minetest_game/mtg_craftguide/README.md b/mods/minetest_game/mtg_craftguide/README.md new file mode 100644 index 0000000..9c4ed7a --- /dev/null +++ b/mods/minetest_game/mtg_craftguide/README.md @@ -0,0 +1,25 @@ +Minetest Game mod: mtg_craftguide +================================= + +Adds a "Recipes" tab to the inventory. Click an item to see it's recipes. +Click again to show usages. + +Based on [craftguide](https://github.com/minetest-mods/craftguide). + +Authors of media +---------------- + +paramat (CC BY-SA 3.0): + +* craftguide_clear_icon.png +* craftguide_next_icon.png +* craftguide_prev_icon.png +* craftguide_search_icon.png + +Neuromancer (CC BY-SA 3.0): + +* craftguide_furnace.png + +Wuzzy (CC BY-SA 3.0): + +* craftguide_shapeless.png diff --git a/mods/minetest_game/mtg_craftguide/init.lua b/mods/minetest_game/mtg_craftguide/init.lua new file mode 100644 index 0000000..e20b168 --- /dev/null +++ b/mods/minetest_game/mtg_craftguide/init.lua @@ -0,0 +1,432 @@ +local S = minetest.get_translator("mtg_craftguide") +local esc = minetest.formspec_escape + +local player_data = {} +local init_items = {} +local recipes_cache = {} +local usages_cache = {} + +local group_stereotypes = { + dye = "dye:white", + wool = "wool:white", + coal = "default:coal_lump", + vessel = "vessels:glass_bottle", + flower = "flowers:dandelion_yellow" +} + +local group_names = { + coal = S("Any coal"), + sand = S("Any sand"), + wool = S("Any wool"), + stick = S("Any stick"), + vessel = S("Any vessel"), + wood = S("Any wood planks"), + stone = S("Any kind of stone block"), + + ["color_red,flower"] = S("Any red flower"), + ["color_blue,flower"] = S("Any blue flower"), + ["color_black,flower"] = S("Any black flower"), + ["color_green,flower"] = S("Any green flower"), + ["color_white,flower"] = S("Any white flower"), + ["color_orange,flower"] = S("Any orange flower"), + ["color_violet,flower"] = S("Any violet flower"), + ["color_yellow,flower"] = S("Any yellow flower"), + + ["color_red,dye"] = S("Any red dye"), + ["color_blue,dye"] = S("Any blue dye"), + ["color_cyan,dye"] = S("Any cyan dye"), + ["color_grey,dye"] = S("Any grey dye"), + ["color_pink,dye"] = S("Any pink dye"), + ["color_black,dye"] = S("Any black dye"), + ["color_brown,dye"] = S("Any brown dye"), + ["color_green,dye"] = S("Any green dye"), + ["color_white,dye"] = S("Any white dye"), + ["color_orange,dye"] = S("Any orange dye"), + ["color_violet,dye"] = S("Any violet dye"), + ["color_yellow,dye"] = S("Any yellow dye"), + ["color_magenta,dye"] = S("Any magenta dye"), + ["color_dark_grey,dye"] = S("Any dark grey dye"), + ["color_dark_green,dye"] = S("Any dark green dye") +} + +local function table_replace(t, val, new) + for k, v in pairs(t) do + if v == val then + t[k] = new + end + end +end + +local function extract_groups(str) + if str:sub(1, 6) == "group:" then + return str:sub(7):split() + end + return nil +end + +local function item_has_groups(item_groups, groups) + for _, group in ipairs(groups) do + if not item_groups[group] then + return false + end + end + return true +end + +local function groups_to_item(groups) + if #groups == 1 then + local group = groups[1] + if group_stereotypes[group] then + return group_stereotypes[group] + elseif minetest.registered_items["default:"..group] then + return "default:"..group + end + end + + for name, def in pairs(minetest.registered_items) do + if item_has_groups(def.groups, groups) then + return name + end + end + + return ":unknown" +end + +local function get_craftable_recipes(output) + local recipes = minetest.get_all_craft_recipes(output) + if not recipes then + return nil + end + + for i = #recipes, 1, -1 do + for _, item in pairs(recipes[i].items) do + local groups = extract_groups(item) + if groups then + item = groups_to_item(groups) + end + if not minetest.registered_items[item] then + table.remove(recipes, i) + break + end + end + end + + if #recipes > 0 then + return recipes + end +end + +local function show_item(def) + return def.groups.not_in_craft_guide ~= 1 and def.description ~= "" +end + +local function cache_usages(recipe) + local added = {} + for _, item in pairs(recipe.items) do + if not added[item] then + local groups = extract_groups(item) + if groups then + for name, def in pairs(minetest.registered_items) do + if not added[name] and show_item(def) + and item_has_groups(def.groups, groups) then + local usage = table.copy(recipe) + table_replace(usage.items, item, name) + usages_cache[name] = usages_cache[name] or {} + table.insert(usages_cache[name], usage) + added[name] = true + end + end + elseif show_item(minetest.registered_items[item]) then + usages_cache[item] = usages_cache[item] or {} + table.insert(usages_cache[item], recipe) + end + added[item] = true + end + end +end + +minetest.register_on_mods_loaded(function() + for name, def in pairs(minetest.registered_items) do + if show_item(def) then + local recipes = get_craftable_recipes(name) + if recipes then + recipes_cache[name] = recipes + for _, recipe in ipairs(recipes) do + cache_usages(recipe) + end + end + end + end + for name, def in pairs(minetest.registered_items) do + if recipes_cache[name] or usages_cache[name] then + table.insert(init_items, name) + end + end + table.sort(init_items) +end) + +local function coords(i, cols) + return i % cols, math.floor(i / cols) +end + +local function is_fuel(item) + return minetest.get_craft_result({method="fuel", items={item}}).time > 0 +end + +local function item_button_fs(fs, x, y, item, element_name, groups) + table.insert(fs, ("item_image_button[%s,%s;1.05,1.05;%s;%s;%s]") + :format(x, y, item, element_name, groups and "\n"..esc(S("G")) or "")) + + local tooltip + if groups then + table.sort(groups) + tooltip = group_names[table.concat(groups, ",")] + if not tooltip then + local groupstr = {} + for _, group in ipairs(groups) do + table.insert(groupstr, minetest.colorize("yellow", group)) + end + groupstr = table.concat(groupstr, ", ") + tooltip = S("Any item belonging to the group(s): @1", groupstr) + end + elseif is_fuel(item) then + local itemdef = minetest.registered_items[item:match("%S*")] + local desc = itemdef and itemdef.description or S("Unknown Item") + tooltip = desc.."\n"..minetest.colorize("orange", S("Fuel")) + end + if tooltip then + table.insert(fs, ("tooltip[%s;%s]"):format(element_name, esc(tooltip))) + end +end + +local function recipe_fs(fs, data) + local recipe = data.recipes[data.rnum] + local width = recipe.width + local cooktime, shapeless + + if recipe.method == "cooking" then + cooktime, width = width, 1 + elseif width == 0 then + shapeless = true + if #recipe.items == 1 then + width = 1 + elseif #recipe.items <= 4 then + width = 2 + else + width = 3 + end + end + + table.insert(fs, ("label[5.5,1;%s]"):format(esc(data.show_usages + and S("Usage @1 of @2", data.rnum, #data.recipes) + or S("Recipe @1 of @2", data.rnum, #data.recipes)))) + + if #data.recipes > 1 then + table.insert(fs, + "image_button[5.5,1.6;0.8,0.8;craftguide_prev_icon.png;recipe_prev;]".. + "image_button[6.2,1.6;0.8,0.8;craftguide_next_icon.png;recipe_next;]".. + "tooltip[recipe_prev;"..esc(S("Previous recipe")).."]".. + "tooltip[recipe_next;"..esc(S("Next recipe")).."]") + end + + local rows = math.ceil(table.maxn(recipe.items) / width) + if width > 3 or rows > 3 then + table.insert(fs, ("label[0,1;%s]") + :format(esc(S("Recipe is too big to be displayed.")))) + return + end + + local base_x = 3 - width + local base_y = rows == 1 and 1 or 0 + + for i, item in pairs(recipe.items) do + local x, y = coords(i - 1, width) + + local groups = extract_groups(item) + if groups then + item = groups_to_item(groups) + end + item_button_fs(fs, base_x + x, base_y + y, item, item, groups) + end + + if shapeless or recipe.method == "cooking" then + table.insert(fs, ("image[3.2,0.5;0.5,0.5;craftguide_%s.png]") + :format(shapeless and "shapeless" or "furnace")) + local tooltip = shapeless and S("Shapeless") or + S("Cooking time: @1", minetest.colorize("yellow", cooktime)) + table.insert(fs, "tooltip[3.2,0.5;0.5,0.5;"..esc(tooltip).."]") + end + table.insert(fs, "image[3,1;1,1;sfinv_crafting_arrow.png]") + + item_button_fs(fs, 4, 1, recipe.output, recipe.output:match("%S*")) +end + +local function get_formspec(player) + local name = player:get_player_name() + local data = player_data[name] + data.pagemax = math.max(1, math.ceil(#data.items / 32)) + + local fs = {} + table.insert(fs, + "style_type[item_image_button;padding=2]".. + "field[0.3,4.2;2.8,1.2;filter;;"..esc(data.filter).."]".. + "label[5.8,4.15;"..minetest.colorize("yellow", data.pagenum).." / ".. + data.pagemax.."]".. + "image_button[2.63,4.05;0.8,0.8;craftguide_search_icon.png;search;]".. + "image_button[3.25,4.05;0.8,0.8;craftguide_clear_icon.png;clear;]".. + "image_button[5,4.05;0.8,0.8;craftguide_prev_icon.png;prev;]".. + "image_button[7.25,4.05;0.8,0.8;craftguide_next_icon.png;next;]".. + "tooltip[search;"..esc(S("Search")).."]".. + "tooltip[clear;"..esc(S("Reset")).."]".. + "tooltip[prev;"..esc(S("Previous page")).."]".. + "tooltip[next;"..esc(S("Next page")).."]".. + "field_close_on_enter[filter;false]") + + if #data.items == 0 then + table.insert(fs, "label[3,2;"..esc(S("No items to show.")).."]") + else + local first_item = (data.pagenum - 1) * 32 + for i = first_item, first_item + 31 do + local item = data.items[i + 1] + if not item then + break + end + local x, y = coords(i % 32, 8) + item_button_fs(fs, x, y, item, item) + end + end + + table.insert(fs, "container[0,5.6]") + if data.recipes then + recipe_fs(fs, data) + elseif data.prev_item then + table.insert(fs, ("label[2,1;%s]"):format(esc(data.show_usages + and S("No usages.").."\n"..S("Click again to show recipes.") + or S("No recipes.").."\n"..S("Click again to show usages.")))) + end + table.insert(fs, "container_end[]") + + return table.concat(fs) +end + +local function imatch(str, filter) + return str:lower():find(filter, 1, true) ~= nil +end + +local function execute_search(data) + local filter = data.filter + if filter == "" then + data.items = init_items + return + end + data.items = {} + + for _, item in ipairs(init_items) do + local def = minetest.registered_items[item] + local desc = def and minetest.get_translated_string(data.lang_code, def.description) + + if imatch(item, filter) or desc and imatch(desc, filter) then + table.insert(data.items, item) + end + end +end + +local function on_receive_fields(player, fields) + local name = player:get_player_name() + local data = player_data[name] + + if fields.clear then + data.filter = "" + data.pagenum = 1 + data.prev_item = nil + data.recipes = nil + data.items = init_items + return true + + elseif fields.key_enter_field == "filter" or fields.search then + local new = fields.filter:lower() + if data.filter == new then + return + end + data.filter = new + data.pagenum = 1 + execute_search(data) + return true + + elseif fields.prev or fields.next then + if data.pagemax == 1 then + return + end + data.pagenum = data.pagenum + (fields.next and 1 or -1) + if data.pagenum > data.pagemax then + data.pagenum = 1 + elseif data.pagenum == 0 then + data.pagenum = data.pagemax + end + return true + + elseif fields.recipe_next or fields.recipe_prev then + data.rnum = data.rnum + (fields.recipe_next and 1 or -1) + if data.rnum > #data.recipes then + data.rnum = 1 + elseif data.rnum == 0 then + data.rnum = #data.recipes + end + return true + + else + local item + for field in pairs(fields) do + if field:find(":") then + item = field + break + end + end + if not item then + return + end + + if item == data.prev_item then + data.show_usages = not data.show_usages + else + data.show_usages = nil + end + if data.show_usages then + data.recipes = usages_cache[item] + else + data.recipes = recipes_cache[item] + end + data.prev_item = item + data.rnum = 1 + return true + end +end + +minetest.register_on_joinplayer(function(player) + local name = player:get_player_name() + local info = minetest.get_player_information(name) + + player_data[name] = { + filter = "", + pagenum = 1, + items = init_items, + lang_code = info.lang_code + } +end) + +minetest.register_on_leaveplayer(function(player) + local name = player:get_player_name() + player_data[name] = nil +end) + +sfinv.register_page("mtg_craftguide:craftguide", { + title = esc(S("Recipes")), + get = function(self, player, context) + return sfinv.make_formspec(player, context, get_formspec(player)) + end, + on_player_receive_fields = function(self, player, context, fields) + if on_receive_fields(player, fields) then + sfinv.set_player_inventory_formspec(player) + end + end +}) diff --git a/mods/minetest_game/mtg_craftguide/license.txt b/mods/minetest_game/mtg_craftguide/license.txt new file mode 100644 index 0000000..8d28c5c --- /dev/null +++ b/mods/minetest_game/mtg_craftguide/license.txt @@ -0,0 +1,63 @@ +License of source code +---------------------- + +The MIT License (MIT) + +Copyright (C) 2015-2019 Jean-Patrick Guerrero and contributors. +Copyright (C) 2020 pauloue + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +Licenses of media (textures) +---------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) + +Copyright (C) 2018 paramat +Copyright (C) Neuromancer +Copyright (C) 2017 Wuzzy + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/mods/minetest_game/mtg_craftguide/locale/mtg_craftguide.fr.tr b/mods/minetest_game/mtg_craftguide/locale/mtg_craftguide.fr.tr new file mode 100644 index 0000000..d43d66c --- /dev/null +++ b/mods/minetest_game/mtg_craftguide/locale/mtg_craftguide.fr.tr @@ -0,0 +1,41 @@ +# textdomain: mtg_craftguide + + +### init.lua ### + +Any black dye=Quelconque colorant noir +Any black flower=Quelconque fleur noire +Any blue dye=Quelconque colorant bleu +Any blue flower=Quelconque fleur bleue +Any brown dye=Quelconque colorant marron +Any coal=Quelconque charbon +Any cyan dye=Quelconque colorant bleu ciel +Any dark green dye=Quelconque colorant vert foncé +Any dark grey dye=Quelconque colorant gris foncé +Any green dye=Quelconque colorant vert +Any green flower=Quelconque fleur verte +Any grey dye=Quelconque colorant gris +Any item belonging to the group(s): @1=Tout item appartenant au(x) groupe(s) : @1 +Any kind of stone block=Quelconque roche +Any magenta dye=Quelconque colorant magenta +Any orange dye=Quelconque colorant orange +Any orange flower=Quelconque fleur orange +Any pink dye=Quelconque colorant rose +Any red dye=Quelconque colorant rouge +Any red flower=Quelconque fleur rouge +Any sand=Quelconque sable +Any stick=Quelconque bâton +Any vessel=Quelconque couvert +Any violet dye=Quelconque colorant violet +Any violet flower=Quelconque fleur violette +Any white dye=Quelconque colorant blanc +Any white flower=Quelconque fleur blanche +Any wood planks=Quelconques planches de bois +Any wool=Quelconque laine +Any yellow dye=Quelconque colorant jaune +Any yellow flower=Quelconque fleur jaune +Cooking time: @1=Temps de cuisson : @1 +Recipe @1 of @2=Recette @1 sur @2 +Recipes=Recettes +Shapeless=Sans forme +Usage @1 of @2=Usage @1 sur @2 diff --git a/mods/minetest_game/mtg_craftguide/locale/template.txt b/mods/minetest_game/mtg_craftguide/locale/template.txt new file mode 100644 index 0000000..aec2126 --- /dev/null +++ b/mods/minetest_game/mtg_craftguide/locale/template.txt @@ -0,0 +1,57 @@ +# textdomain: mtg_craftguide + + +### init.lua ### + +Any black dye= +Any black flower= +Any blue dye= +Any blue flower= +Any brown dye= +Any coal= +Any cyan dye= +Any dark green dye= +Any dark grey dye= +Any green dye= +Any green flower= +Any grey dye= +Any item belonging to the group(s): @1= +Any kind of stone block= +Any magenta dye= +Any orange dye= +Any orange flower= +Any pink dye= +Any red dye= +Any red flower= +Any sand= +Any stick= +Any vessel= +Any violet dye= +Any violet flower= +Any white dye= +Any white flower= +Any wood planks= +Any wool= +Any yellow dye= +Any yellow flower= +Click again to show recipes.= +Click again to show usages.= +Cooking time: @1= +Fuel= +# Label for group ingredients +G= +Next page= +Next recipe= +No items to show.= +No recipes.= +No usages.= +Previous page= +Previous recipe= +Recipe @1 of @2= +Recipe is too big to be displayed.= +Recipes= +Reset= +Search= +Shapeless= +Unknown Item= +Usage @1 of @2= diff --git a/mods/minetest_game/mtg_craftguide/mod.conf b/mods/minetest_game/mtg_craftguide/mod.conf new file mode 100644 index 0000000..3b2d975 --- /dev/null +++ b/mods/minetest_game/mtg_craftguide/mod.conf @@ -0,0 +1,3 @@ +name = mtg_craftguide +description = Minetest Game mod: mtg_craftguide +depends = sfinv diff --git a/mods/minetest_game/mtg_craftguide/textures/craftguide_clear_icon.png b/mods/minetest_game/mtg_craftguide/textures/craftguide_clear_icon.png new file mode 100644 index 0000000..1a0e513 Binary files /dev/null and b/mods/minetest_game/mtg_craftguide/textures/craftguide_clear_icon.png differ diff --git a/mods/minetest_game/mtg_craftguide/textures/craftguide_furnace.png b/mods/minetest_game/mtg_craftguide/textures/craftguide_furnace.png new file mode 100644 index 0000000..60d1a61 Binary files /dev/null and b/mods/minetest_game/mtg_craftguide/textures/craftguide_furnace.png differ diff --git a/mods/minetest_game/mtg_craftguide/textures/craftguide_next_icon.png b/mods/minetest_game/mtg_craftguide/textures/craftguide_next_icon.png new file mode 100644 index 0000000..266c9ba Binary files /dev/null and b/mods/minetest_game/mtg_craftguide/textures/craftguide_next_icon.png differ diff --git a/mods/minetest_game/mtg_craftguide/textures/craftguide_prev_icon.png b/mods/minetest_game/mtg_craftguide/textures/craftguide_prev_icon.png new file mode 100644 index 0000000..c807296 Binary files /dev/null and b/mods/minetest_game/mtg_craftguide/textures/craftguide_prev_icon.png differ diff --git a/mods/minetest_game/mtg_craftguide/textures/craftguide_search_icon.png b/mods/minetest_game/mtg_craftguide/textures/craftguide_search_icon.png new file mode 100644 index 0000000..1c374ca Binary files /dev/null and b/mods/minetest_game/mtg_craftguide/textures/craftguide_search_icon.png differ diff --git a/mods/minetest_game/mtg_craftguide/textures/craftguide_shapeless.png b/mods/minetest_game/mtg_craftguide/textures/craftguide_shapeless.png new file mode 100644 index 0000000..51d8ce5 Binary files /dev/null and b/mods/minetest_game/mtg_craftguide/textures/craftguide_shapeless.png differ diff --git a/mods/minetest_game/player_api/README.txt b/mods/minetest_game/player_api/README.txt index 0f6a0b8..37afadf 100644 --- a/mods/minetest_game/player_api/README.txt +++ b/mods/minetest_game/player_api/README.txt @@ -13,13 +13,11 @@ Various Minetest developers and contributors (LGPLv2.1+) Authors of media (textures, models and sounds) ---------------------------------------------- -stujones11 (CC BY-SA 3.0): +Original model by MirceaKitsune (CC BY-SA 3.0). +Various alterations and fixes by kilbith, sofar, xunto, Rogier-5, TeTpaAka, Desour, +stujones11, An0n3m0us (CC BY-SA 3.0): character.b3d - character.blend -- Both derived from a model by MirceaKitsune (CC BY-SA 3.0) - -An0n3m0us (CC BY-SA 3.0): - character.b3d - character.blend -- Player animation improvement + character.blend Jordach (CC BY-SA 3.0): character.png diff --git a/mods/minetest_game/player_api/api.lua b/mods/minetest_game/player_api/api.lua index 1884754..3ec0bfe 100644 --- a/mods/minetest_game/player_api/api.lua +++ b/mods/minetest_game/player_api/api.lua @@ -107,7 +107,7 @@ function player_api.set_textures(player, textures) local model = models[player_model[name]] local model_textures = model and model.textures or nil player_textures[name] = textures or model_textures - player:set_properties({textures = textures or model_textures,}) + player:set_properties({textures = textures or model_textures}) end function player_api.set_animation(player, anim_name, speed) @@ -129,6 +129,8 @@ minetest.register_on_leaveplayer(function(player) player_model[name] = nil player_anim[name] = nil player_textures[name] = nil + player_sneak[name] = nil + player_api.player_attached[name] = nil end) -- Localize for better performance. @@ -219,6 +221,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local gender_model = player_api.get_gender_model(gender) player_api.set_model(player, gender_model) if minetest.get_modpath("3d_armor")~=nil then + local player_name = player:get_player_name() + if gender == "male" then + armor.default_skin = "character.png" + armor.textures[player_name].skin = "character.png" + else + armor.default_skin = "female.png" + armor.textures[player_name].skin = "female.png" + end player_api.set_textures(player, models[gender_model].textures) end end) diff --git a/mods/minetest_game/player_api/init.lua b/mods/minetest_game/player_api/init.lua index e0ede25..6b6f760 100644 --- a/mods/minetest_game/player_api/init.lua +++ b/mods/minetest_game/player_api/init.lua @@ -5,7 +5,7 @@ dofile(minetest.get_modpath("player_api") .. "/api.lua") -- Default player appearance player_api.register_model("character.b3d", { animation_speed = 30, - textures = {"character.png", }, + textures = {"character.png"}, animations = { -- Standard animations. stand = {x = 0, y = 79}, diff --git a/mods/minetest_game/player_api/license.txt b/mods/minetest_game/player_api/license.txt index dac0408..bdc4315 100644 --- a/mods/minetest_game/player_api/license.txt +++ b/mods/minetest_game/player_api/license.txt @@ -2,8 +2,8 @@ License of source code ---------------------- GNU Lesser General Public License, version 2.1 -Copyright (C) 2011-2018 celeron55, Perttu Ahola -Copyright (C) 2011-2018 Various Minetest developers and contributors +Copyright (C) 2011 celeron55, Perttu Ahola +Copyright (C) 2011 Various Minetest developers and contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; @@ -19,8 +19,15 @@ Licenses of media (textures, models and sounds) ----------------------------------------------- Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -Copyright (C) 2011-2018 celeron55, Perttu Ahola -Copyright (C) 2012-2018 Jordach +Copyright (C) 2011 celeron55, Perttu Ahola +Copyright (C) 2012 MirceaKitsune +Copyright (C) 2012 Jordach +Copyright (C) 2015 kilbith +Copyright (C) 2016 sofar +Copyright (C) 2016 xunto +Copyright (C) 2016 Rogier-5 +Copyright (C) 2017 TeTpaAka +Copyright (C) 2017 Desour Copyright (C) 2018 stujones11 Copyright (C) 2019 An0n3m0us diff --git a/mods/minetest_game/stairs/init.lua b/mods/minetest_game/stairs/init.lua index bba6e62..317ee4c 100644 --- a/mods/minetest_game/stairs/init.lua +++ b/mods/minetest_game/stairs/init.lua @@ -468,13 +468,14 @@ end -- Nodes will be called stairs:{stair,slab}_ function stairs.register_stair_and_slab(subname, recipeitem, groups, images, - desc_stair, desc_slab, sounds, worldaligntex) + desc_stair, desc_slab, sounds, worldaligntex, + desc_stair_inner, desc_stair_outer) stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds, worldaligntex) - stairs.register_stair_inner(subname, recipeitem, groups, images, desc_stair, - sounds, worldaligntex) - stairs.register_stair_outer(subname, recipeitem, groups, images, desc_stair, - sounds, worldaligntex) + stairs.register_stair_inner(subname, recipeitem, groups, images, + desc_stair, sounds, worldaligntex, desc_stair_inner) + stairs.register_stair_outer(subname, recipeitem, groups, images, + desc_stair, sounds, worldaligntex, desc_stair_outer) stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds, worldaligntex) end @@ -854,7 +855,7 @@ my_register_stair_and_slab( {"default_ice.png"}, "Ice Stair", "Ice Slab", - default.node_sound_glass_defaults(), + default.node_sound_ice_defaults(), true ) diff --git a/mods/minetest_game/tnt/init.lua b/mods/minetest_game/tnt/init.lua index ae28191..cc71b9f 100644 --- a/mods/minetest_game/tnt/init.lua +++ b/mods/minetest_game/tnt/init.lua @@ -429,6 +429,8 @@ end minetest.register_node("tnt:boom", { drawtype = "airlike", + inventory_image = "tnt_boom.png", + wield_image = "tnt_boom.png", light_source = default.LIGHT_MAX, walkable = false, drop = "", diff --git a/mods/rainf/init.lua b/mods/rainf/init.lua index 2e996eb..630c533 100644 --- a/mods/rainf/init.lua +++ b/mods/rainf/init.lua @@ -13,13 +13,20 @@ else water_type= "default:water_source" end +local dirt_type +if minetest.get_modpath("swaz")~=nil then + dirt_type = "swaz:silt" +else + dirt_type = "rainf:dirt" +end + -- Register Biomes minetest.register_biome({ name = "temperate_rainforest", node_top = "rainf:meadow", depth_top = 1, - node_filler = "swaz:silt", + node_filler = dirt_type, depth_filler = 3, node_riverbed = "default:sand", depth_riverbed = 2, @@ -60,13 +67,22 @@ minetest.register_node("rainf:meadow_with_mud", { description = S("Meadow with Mud"), tiles = {"rainf_meadow_with_mud.png", "rainf_dirt.png", "rainf_dirt.png"}, - groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1}, + groups = {crumbly = 3}, drop = "swaz:mud", sounds = default.node_sound_dirt_defaults({ footstep = {name = "default_grass_footstep", gain = 0.25}, }), }) +minetest.register_node("rainf:dirt", { + description = S("Dirt"), + tiles = {"rainf_dirt.png",}, + groups = {crumbly = 3, soil = 1}, + sounds = default.node_sound_dirt_defaults({ + footstep = {name = "default_grass_footstep", gain = 0.25}, + }), +}) + minetest.register_node("rainf:granite", { description = S("Granite"), tiles = {"rainf_granite.png"}, @@ -530,7 +546,7 @@ if mg_name ~= "v6" and mg_name ~= "singlenode" then y_max = 1000, place_offset_y = -2, spawn_by = "rainf:meadow_with_mud", - num_spawn_by = 5, + num_spawn_by = 6, flags = "place_center_x, place_center_z, force_placement", rotation = "random", }) @@ -827,3 +843,50 @@ if minetest.get_modpath("stairs")~=nil then default.node_sound_stone_defaults() ) end + +--Farming Support + +if minetest.get_modpath("farming")~=nil then + + minetest.override_item("rainf:meadow", { + soil = { + base = "rainf:meadow", + dry = "rainf:soil", + wet = "rainf:soil_wet" + } + }) + + minetest.override_item("rainf:blossom_meadow", { + soil = { + base = "rainf:blossom_meadow", + dry = "rainf:soil", + wet = "rainf:soil_wet" + } + }) + + minetest.register_node("rainf:soil", { + description = S("Soil"), + tiles = {"rainf_dirt.png^farming_soil.png", "rainf_dirt.png"}, + drop = "rainf:dirt", + groups = {crumbly=3, not_in_creative_inventory=1, soil=2, grassland = 1, field = 1}, + sounds = default.node_sound_dirt_defaults(), + soil = { + base = "rainf:dirt", + dry = "rainf:soil", + wet = "rainf:soil_wet" + } + }) + + minetest.register_node("rainf:soil_wet", { + description = S("Wet Soil"), + tiles = {"rainf_dirt.png^farming_soil_wet.png", "rainf_dirt.png"}, + drop = "rainf:dirt", + groups = {crumbly=3, not_in_creative_inventory=1, soil=3, wet = 1, grassland = 1, field = 1}, + sounds = default.node_sound_dirt_defaults(), + soil = { + base = "rainf:dirt", + dry = "rainf:soil", + wet = "rainf:soil_wet" + } + }) +end diff --git a/mods/rainf/locale/rainf.es.tr b/mods/rainf/locale/rainf.es.tr index e4a6731..91fd449 100644 --- a/mods/rainf/locale/rainf.es.tr +++ b/mods/rainf/locale/rainf.es.tr @@ -1,7 +1,10 @@ # textdomain: rainf Meadow=Pradera Blossom Meadow=Pradera florida +Soil=Tierra de cultivo +Wet Soil=Tierra de cultivo húmeda Meadow with Mud=Pradera con barro +Dirt=Tierra Granite=Granito Pink Granite=Granito rosa Pink Granite with Moss=Granito rosa con musgo diff --git a/mods/rainf/mod.conf b/mods/rainf/mod.conf index 3bad120..39dd9c2 100644 --- a/mods/rainf/mod.conf +++ b/mods/rainf/mod.conf @@ -1,3 +1,3 @@ name = rainf depends = default -optional_depends = stairs +optional_depends = stairs, farming diff --git a/mods/swaz/init.lua b/mods/swaz/init.lua index 9a63144..65d7cb0 100644 --- a/mods/swaz/init.lua +++ b/mods/swaz/init.lua @@ -11,29 +11,32 @@ minetest.register_biome({ depth_filler = 3, node_riverbed = "default:sand", depth_riverbed = 2, + node_water = "swaz:water_source", + depth_water_top = 5, node_water_top = "swaz:water_source", - depth_water_top = 1, node_stone = "swaz:limestone", - y_max = 25, + y_max = 7, y_min = 1, heat_point = 80, humidity_point = 89, + vertical_blend = 0, }) minetest.register_biome({ name = "swampz_shore", - node_top = "default:dirt", + node_top = "swaz:mud", depth_top = 1, - node_filler = "default:dirt", + node_filler = "swaz:mud", depth_filler = 3, node_riverbed = "default:sand", depth_riverbed = 2, + node_water = "swaz:water_source", + depth_water_top = 5, node_water_top = "swaz:water_source", - depth_water_top = 1, y_max = 0, - y_min = -1, - heat_point = 60, - humidity_point = 68, + y_min = -5, + heat_point = 79, + humidity_point = 90, vertical_blend = 0, }) @@ -71,7 +74,7 @@ minetest.register_node("swaz:mud_with_moss", { tiles = {"swaz_moss.png", "swaz_mud.png", {name = "swaz_mud.png^swaz_mud_with_moss_side.png", tileable_vertical = false}}, - groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1}, + groups = {crumbly = 3, soil = 1}, drop = "swaz:mud", sounds = default.node_sound_dirt_defaults({ footstep = {name = "default_grass_footstep", gain = 0.25}, @@ -111,7 +114,7 @@ minetest.register_node("swaz:water_source", { }, }, }, - alpha = 191, + alpha = 212, paramtype = "light", walkable = false, pointable = false, @@ -124,7 +127,7 @@ minetest.register_node("swaz:water_source", { liquid_alternative_flowing = "swaz:water_flowing", liquid_alternative_source = "swaz:water_source", liquid_viscosity = 1, - post_effect_color = {a = 103, r = 30, g = 60, b = 90}, + post_effect_color = {a = 191, r = 30, g = 60, b = 90}, groups = {water = 3, liquid = 3, cools_lava = 1}, sounds = default.node_sound_water_defaults(), }) @@ -156,7 +159,7 @@ minetest.register_node("swaz:water_flowing", { }, }, }, - alpha = 191, + alpha = 212, paramtype = "light", paramtype2 = "flowingliquid", walkable = false, @@ -170,7 +173,7 @@ minetest.register_node("swaz:water_flowing", { liquid_alternative_flowing = "swaz:water_flowing", liquid_alternative_source = "swaz:water_source", liquid_viscosity = 1, - post_effect_color = {a = 103, r = 30, g = 60, b = 90}, + post_effect_color = {a = 191, r = 30, g = 90, b = 90}, groups = {water = 3, liquid = 3, not_in_creative_inventory = 1, cools_lava = 1}, sounds = default.node_sound_water_defaults(), @@ -319,7 +322,7 @@ if mg_name ~= "v6" and mg_name ~= "singlenode" then y_max = 1000, place_offset_y = -2, spawn_by = "swaz:water_source", - num_spawn_by = 4, + num_spawn_by = 6, flags = "place_center_x, place_center_z, force_placement", rotation = "random", }) @@ -710,3 +713,42 @@ if minetest.get_modpath("stairs")~=nil then default.node_sound_stone_defaults() ) end + +--Farming Support + +if minetest.get_modpath("farming")~=nil then + + minetest.override_item("swaz:silt_with_grass", { + soil = { + base = "default:silt_with_grass", + dry = "swaz:soil", + wet = "swaz:soil_wet" + } + }) + + minetest.register_node("swaz:soil", { + description = S("Soil"), + tiles = {"swaz_silt.png^farming_soil.png", "swaz_silt.png"}, + drop = "swaz:silt", + groups = {crumbly=3, not_in_creative_inventory=1, soil=2, grassland = 1, field = 1}, + sounds = default.node_sound_dirt_defaults(), + soil = { + base = "swaz:silt", + dry = "swaz:soil", + wet = "swaz:soil_wet" + } + }) + + minetest.register_node("swaz:soil_wet", { + description = S("Wet Soil"), + tiles = {"swaz_silt.png^farming_soil_wet.png", "swaz_silt.png"}, + drop = "swaz:silt", + groups = {crumbly=3, not_in_creative_inventory=1, soil=3, wet = 1, grassland = 1, field = 1}, + sounds = default.node_sound_dirt_defaults(), + soil = { + base = "swaz:silt", + dry = "swaz:soil", + wet = "swaz:soil_wet" + } + }) +end diff --git a/mods/swaz/locale/swaz.es.tr b/mods/swaz/locale/swaz.es.tr index c446cdb..d7a8b93 100644 --- a/mods/swaz/locale/swaz.es.tr +++ b/mods/swaz/locale/swaz.es.tr @@ -3,6 +3,8 @@ Limestone=Piedra caliza Mud=Barro Mud with Moss=Barro musgoso Silt=Limo +Soil=Tierra de cultivo +Wet Soil=Tierra de cultivo húmeda Silt with Grass=Limo con hierba Muddy Water Source=Fuente de agua pantanosa Flowing Muddy Water=Flujo de agua pantanosa diff --git a/mods/swaz/mod.conf b/mods/swaz/mod.conf index 7bd002c..932ff38 100644 --- a/mods/swaz/mod.conf +++ b/mods/swaz/mod.conf @@ -1,3 +1,3 @@ name = swaz depends = default, flowers, baldcypress, willow, farming, dye -optional_depends = stairs, basic_materials +optional_depends = stairs, basic_materials, farming