diff --git a/mods-apply-world.mt-regenerate-from-config-file b/mods-apply-world.mt-regenerate-from-config-file index 44cf6d14..b57ec6a5 100755 --- a/mods-apply-world.mt-regenerate-from-config-file +++ b/mods-apply-world.mt-regenerate-from-config-file @@ -15,6 +15,7 @@ echo "pgsql_player_connection = host=127.0.0.1 user=minetest password=$psql_mine echo "pgsql_auth_connection = host=127.0.0.1 user=minetest password=$psql_minetest_user_password dbname=minetest_auth" >> /home/minetest/.minetest/worlds/world/world.mt echo " +load_mod_interact = false load_mod_wieldview = true load_mod_shields = true load_mod_3d_armor_ui = true @@ -22,6 +23,58 @@ load_mod_3d_armor = true load_mod_3d_armor_sfinv = true load_mod_3d_armor_ip = true load_mod_3d_armor_stand = true +load_mod_unified_inventory = true +load_mod_xdecor = true +load_mod_xban2 = true +load_mod_workbench = true +load_mod_vehicle_mash = true +load_mod_unifiedbricks = true +load_mod_ts_workshop = true +load_mod_ts_paper = true +load_mod_moreores = true +load_mod_throwing_arrows = true +load_mod_drinks = true +load_mod_carpets = true +load_mod_enchanting = true +load_mod_ghost = true +load_mod_computer = true +load_mod_castle_masonry = true +load_mod_mymillwork = true +load_mod_stained_glass = true +load_mod_jukebox = true +load_mod_crops = true +load_mod_mysheetmetal = true +load_mod_mywoodslopes = true +load_mod_cake = true +load_mod_throwing = true +load_mod_letters = true +load_mod_lib_mount = true +load_mod_moreblocks = true +load_mod_chicken = true +load_mod_creatures = true +load_mod_oerrki = true +load_mod_mycorners = true +load_mod_zombie = true +load_mod_mtfoods = true +load_mod_chat2 = true +load_mod_mydeck = true +load_mod_mywalls = true +load_mod_mymasonhammer = true +load_mod_mypaths = true +load_mod_trash_can = true +load_mod_myroofs = true +load_mod_ropes = true +load_mod_playeranim = true +load_mod_signs_api = true +load_mod_sheep = true +load_mod_skinsdb = true +load_mod_stargate = true +load_mod_ts_furniture = true +load_mod_ts_doors = true +load_mod_unifieddyes = true +load_mod_font_api = true +load_mod_display_api = true +load_mod_basic_materials = true " >> /home/minetest/.minetest/worlds/world/world.mt chown minetest:minetest /home/minetest/ -cR diff --git a/mods-download b/mods-download index 4be88b17..6ae8921a 100755 --- a/mods-download +++ b/mods-download @@ -2,6 +2,57 @@ rm -rf mods mkdir mods cd mods -git clone --depth 1 --branch version-0.4.14 https://github.com/minetest-mods/3d_armor.git +git clone --depth 1 --branch master https://github.com/minetest-mods/3d_armor.git +git clone --depth 1 --branch master https://github.com/minetest-mods/unified_inventory.git +git clone --depth 1 --branch master https://github.com/minetest-mods/unifiedbricks.git +git clone --depth 1 --branch master https://github.com/minetest-mods/moreblocks.git +git clone --depth 1 --branch master https://github.com/minetest-mods/moreores.git +git clone --depth 1 --branch master https://github.com/minetest-mods/mywalls.git +git clone --depth 1 --branch master https://github.com/minetest-mods/xdecor.git +git clone --depth 1 --branch master https://github.com/minetest-mods/vehicle_mash.git +# for lib_mount exists branch called rotation_fix, lib_mount is needed for vehicle_mash +git clone --depth 1 --branch master https://github.com/minetest-mods/lib_mount.git +git clone --depth 1 --branch master https://github.com/minetest-mods/workbench.git +git clone --depth 1 --branch master https://github.com/minetest-mods/ts_furniture.git +git clone --depth 1 --branch master https://github.com/minetest-mods/playeranim.git +git clone --depth 1 --branch master https://github.com/minetest-mods/skinsdb.git +git clone --depth 1 --branch master https://github.com/minetest-mods/castle_masonry.git +git clone --depth 1 --branch master https://github.com/minetest-mods/mob-engine.git +git clone --depth 1 --branch master https://github.com/minetest-mods/letters.git +git clone --depth 1 --branch master https://github.com/minetest-mods/ts_doors.git +git clone --depth 1 --branch master https://github.com/minetest-mods/trash_can.git +git clone --depth 1 --branch master https://github.com/minetest-mods/throwing_arrows.git +git clone --depth 1 --branch master https://github.com/minetest-mods/throwing.git +git clone --depth 1 --branch master https://github.com/minetest-mods/stained_glass.git +git clone --depth 1 --branch master https://github.com/minetest-mods/xban2.git +git clone --depth 1 --branch master https://github.com/minetest-mods/ropes.git +git clone --depth 1 --branch master https://github.com/minetest-mods/drinks.git +git clone --depth 1 --branch master https://github.com/minetest-mods/cake.git +git clone --depth 1 --branch master https://github.com/minetest-mods/jukebox.git +git clone --depth 1 --branch master https://github.com/minetest-mods/carpets.git +git clone --depth 1 --branch master https://github.com/minetest-mods/chat2.git +git clone --depth 1 --branch master https://github.com/minetest-mods/mymillwork.git +git clone --depth 1 --branch master https://github.com/minetest-mods/signs_api.git +git clone --depth 1 --branch master https://github.com/minetest-mods/crops.git +git clone --depth 1 --branch master https://github.com/minetest-mods/computer.git +git clone --depth 1 --branch master https://github.com/minetest-mods/mtfoods.git +git clone --depth 1 --branch master https://github.com/minetest-mods/mysheetmetal.git +git clone --depth 1 --branch master https://github.com/minetest-mods/ts_workshop.git +git clone --depth 1 --branch master https://github.com/minetest-mods/myroofs.git +git clone --depth 1 --branch master https://github.com/minetest-mods/ts_paper.git +git clone --depth 1 --branch master https://github.com/minetest-mods/mydeck.git +git clone --depth 1 --branch master https://github.com/minetest-mods/enchanting.git +git clone --depth 1 --branch master https://github.com/minetest-mods/interact.git +git clone --depth 1 --branch master https://github.com/minetest-mods/stargate.git +git clone --depth 1 --branch master https://github.com/minetest-mods/mypaths.git +git clone --depth 1 --branch master https://github.com/minetest-mods/mycorners.git +git clone --depth 1 --branch master https://github.com/minetest-mods/mymasonhammer.git +git clone --depth 1 --branch master https://github.com/minetest-mods/mywoodslopes.git +git clone --depth 1 --branch master https://github.com/minetest-mods/display_api.git +git clone --depth 1 --branch master https://github.com/minetest-mods/font_api.git +git clone --depth 1 --branch master https://gitlab.com/VanessaE/unifieddyes.git +git clone --depth 1 --branch master https://gitlab.com/VanessaE/basic_materials.git rm */.git -rf +rm */.gitignore -f +rm */.gitattributes -f rm */.github -rf diff --git a/mods/3d_armor/.gitignore b/mods/3d_armor/.gitignore deleted file mode 100644 index ba96b081..00000000 --- a/mods/3d_armor/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -## Generic ignorable patterns and files -*~ -.*.swp -*bak* -tags -*.vim -armor.conf - -## Eclipse project files & directories -.project -.settings diff --git a/mods/3d_armor/.luacheckrc b/mods/3d_armor/.luacheckrc index b01ed8e1..88349afc 100644 --- a/mods/3d_armor/.luacheckrc +++ b/mods/3d_armor/.luacheckrc @@ -4,7 +4,6 @@ unused_args = false globals = { "wieldview", "armor", - "armor_i18n", "inventory_plus" } @@ -21,7 +20,6 @@ read_globals = { "default", "minetest", "unified_inventory", - "intllib", "wardrobe", "player_monoids", "armor_monoid", diff --git a/mods/3d_armor/3d_armor/README.txt b/mods/3d_armor/3d_armor/README.txt index 7dbe82d0..b8980b57 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 87c979c3..34f0bc65 100644 --- a/mods/3d_armor/3d_armor/api.lua +++ b/mods/3d_armor/3d_armor/api.lua @@ -1,5 +1,5 @@ -- support for i18n -local S = armor_i18n.gettext +local S = minetest.get_translator(minetest.get_current_modname()) local skin_previews = {} local use_player_monoids = minetest.global_exists("player_monoids") @@ -74,7 +74,8 @@ armor = { on_destroy = {}, }, migrate_old_inventory = true, - version = "0.4.13", + version = "0.4.13", + get_translator = S } armor.config = { @@ -102,6 +103,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 @@ -301,7 +315,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 @@ -405,6 +422,66 @@ armor.damage = function(self, player, index, stack, use) end end +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) if (self.skin_mod == "skins" or self.skin_mod == "simple_skins") and skins.skins[name] then return skins.skins[name]..".png" @@ -416,6 +493,16 @@ armor.get_player_skin = function(self, name) return armor.default_skin..".png" 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) skin_previews[preview] = true end diff --git a/mods/3d_armor/3d_armor/armor.lua b/mods/3d_armor/3d_armor/armor.lua index 171ce032..f7912393 100644 --- a/mods/3d_armor/3d_armor/armor.lua +++ b/mods/3d_armor/3d_armor/armor.lua @@ -1,5 +1,5 @@ -- support for i18n -local S = armor_i18n.gettext +local S = armor.get_translator armor:register_armor("3d_armor:helmet_admin", { description = S("Admin Helmet"), diff --git a/mods/3d_armor/3d_armor/depends.txt b/mods/3d_armor/3d_armor/depends.txt index a33755db..855baa91 100644 --- a/mods/3d_armor/3d_armor/depends.txt +++ b/mods/3d_armor/3d_armor/depends.txt @@ -5,4 +5,3 @@ pova? fire? ethereal? bakedclay? -intllib? diff --git a/mods/3d_armor/3d_armor/init.lua b/mods/3d_armor/3d_armor/init.lua index e83bc10e..4844a999 100644 --- a/mods/3d_armor/3d_armor/init.lua +++ b/mods/3d_armor/3d_armor/init.lua @@ -5,15 +5,11 @@ local last_punch_time = {} local pending_players = {} local timer = 0 --- support for i18n -armor_i18n = { } -armor_i18n.gettext, armor_i18n.ngettext = dofile(modpath.."/intllib.lua") +dofile(modpath.."/api.lua") -- local functions -local S = armor_i18n.gettext local F = minetest.formspec_escape - -dofile(modpath.."/api.lua") +local S = armor.get_translator -- integration test if minetest.settings:get_bool("enable_3d_armor_integration_test") then @@ -299,14 +295,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(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.es.tr b/mods/3d_armor/3d_armor/locale/3d_armor.es.tr new file mode 100644 index 00000000..ab46c030 --- /dev/null +++ b/mods/3d_armor/3d_armor/locale/3d_armor.es.tr @@ -0,0 +1,107 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: La armadura desconectada es nula @1 +3d_armor: Player name is nil @1=3d_armor: El nombre del jugador es nulo @1 +3d_armor: Player reference is nil @1=3d_armor: La referencia del jugador es nula @1 + +### armor.lua ### + +Admin Boots=Botas de admin +Admin Chestplate=Peto de admin +Admin Helmet=Casco de admin +Admin Leggings=Polainas de admin +Bronze Boots=Botas de bronce +Bronze Chestplate=Peto de bronce +Bronze Helmet=Casco de bronce +Bronze Leggings=Polainas de bronce +Cactus Boots=Botas de cactus +Cactus Chestplate=Peto de cactus +Cactus Helmet=Casco de cactus +Cactus Leggings=Polainas de cactus +Crystal Boots=Botas de cristal +Crystal Chestplate=Peto de cristal +Crystal Helmet=Casco de cristal +Crystal Leggings=Polainas de cristal +Diamond Boots=Botas de diamante +Diamond Chestplate=Peto de diamante +Diamond Helmet=Casco de diamante +Diamond Leggings=Polainas de diamante +Gold Boots=Botas de oro +Gold Chestplate=Peto de oro +Gold Helmet=Casco de oro +Gold Leggings=Polainas de oro +Mithril Boots=Botas de mitrilo +Mithril Chestplate=Peto de mitrilo +Mithril Helmet=Casco de mitrilo +Mithril Leggings=Polainas de mitrilo +Steel Boots=Botas de acero +Steel Chestplate=Peto de acero +Steel Helmet=Casco de acero +Steel Leggings=Polainas de acero +Wood Boots=Botas de madera +Wood Chestplate=Peto de madera +Wood Helmet=Casco de madera +Wood Leggings=Polainas de madera + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: Fallo en la inicialización del jugador +Fire=Fuego +Heal=Salud +Level=Nivel +Radiation=Radiación +Your @1 got destroyed!=¡Tu @1 fue destruído! +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled=[3d_armor] Nodos de fuego desabilitados + + +##### not used anymore ##### + +3d_armor: Player inventory is nil @1=3d_armor: El inventario del jugador es nulo @1 +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mod cargado, pero sin ser usado. +Back=Volver +Armor=Armadura +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mod cargado, pero sin ser usado. +Armor stand top=Parte arriba maniquí armadura +Armor stand=Maniquí para armadura +Armor Stand=Maniquí para armadura +Locked Armor stand=Maniquí para armadura (bloqueado) +Armor Stand (owned by @1)=Maniquí para armadura (propiedad de @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mod cargado, pero sin ser usado. +3d Armor=Armadura 3d +Armor not initialized!=¡Armadura no inicializada! +hazmat_suit: Mod loaded but unused.=hazmat_suit: Mod cargado, pero sin ser usado. +Hazmat Helmet=Casco de hazmat +Hazmat Chestplate=Peto de hazmat +Hazmat Sleeve=Manga de hazmat +Hazmat Leggins=Polainas de hazmat +Hazmat Boots=Botas de hazmat +Hazmat Suit=Traje de hazmat +Admin Shield=Escudo de admin +Wooden Shield=Escudo de madera +Enhanced Wood Shield=Escudo de madera mejorado +Cactus Shield=Escudo de cactus +Enhanced Cactus Shield=Escudo de cactus mejorado +Steel Shield=Escudo de acero +Bronze Shield=Escudo de bronce +Diamond Shield=Escudo de diamante +Gold Shield=Escudo de oro +Mithril Shield=Escudo de mitrilo +Crystal Shield=Escudo de cristal +technic_armor: Mod loaded but unused.=technic_armor: Mod cargado, pero no usado. +Lead=Plomo +Brass=Latón +Cast Iron=Hierro fundido +Carbon Steel=Acero carbono +Stainless Steel=Acero inoxidable +Tin=Estaño +Silver=Plata +Helmet=Casco +Chestplate=Peto +Leggins=Polainas +Boots=Botas +Shield=Escudo +@1 @2=@2 de @1 diff --git a/mods/3d_armor/3d_armor/locale/3d_armor.fr.tr b/mods/3d_armor/3d_armor/locale/3d_armor.fr.tr new file mode 100644 index 00000000..849a0f13 --- /dev/null +++ b/mods/3d_armor/3d_armor/locale/3d_armor.fr.tr @@ -0,0 +1,58 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor : Inventaire détaché pour l'armure non trouvé @1 +3d_armor: Player name is nil @1=3d_armor : Nom du joueur non trouvé @1 +3d_armor: Player reference is nil @1=3d_armor : Référence au joueur non trouvée @1 + +### armor.lua ### + +Admin Boots=Bottes d'admin +Admin Chestplate=Cuirasse d'admin +Admin Helmet=Casque d'admin +Admin Leggings=Jambières d'admin +Bronze Boots=Bottes en bronze +Bronze Chestplate=Cuirasse en bronze +Bronze Helmet=Casque en bronze +Bronze Leggings=Jambières en bronze +Cactus Boots=Bottes en cactus +Cactus Chestplate=Cuirasse en cactus +Cactus Helmet=Casque en cactus +Cactus Leggings=Jambières en cactus +Crystal Boots=Bottes en cristal +Crystal Chestplate=Cuirasse en cristal +Crystal Helmet=Casque en cristal +Crystal Leggings=Jambières en cristal +Diamond Boots=Bottes en diamant +Diamond Chestplate=Cuirasse en diamant +Diamond Helmet=Casque en diamant +Diamond Leggings=Jambières en diamant +Gold Boots=Bottes en or +Gold Chestplate=Cuirasse en or +Gold Helmet=Casque en or +Gold Leggings=Jambières en or +Mithril Boots=Bottes en mithril +Mithril Chestplate=Cuirasse en mithril +Mithril Helmet=Casque en mithril +Mithril Leggings=Jambières en mithril +Steel Boots=Bottes en acier +Steel Chestplate=Cuirasse en acier +Steel Helmet=Casque en acier +Steel Leggings=Jambières en acier +Wood Boots=Bottes en bois +Wood Chestplate=Cuirasse en bois +Wood Helmet=Casque en bois +Wood Leggings=Jambières en bois + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor : Impossible d'initialiser le joueur +Fire=Fire +Heal=Soins +Level=Niveau +Radiation=Radiation +Your @1 got destroyed!=Une partie de votre armure a été détruite : @1 ! +Your @1 is almost broken!=Une partie de votre armure est presque détruite : @1 ! +[3d_armor] Fire Nodes disabled=[3d_armor] Nœuds de type feu désactivés diff --git a/mods/3d_armor/3d_armor/locale/3d_armor.it.tr b/mods/3d_armor/3d_armor/locale/3d_armor.it.tr new file mode 100644 index 00000000..d8be62e9 --- /dev/null +++ b/mods/3d_armor/3d_armor/locale/3d_armor.it.tr @@ -0,0 +1,85 @@ +# textdomain: 3d_armor + + +### api.lua ### + +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 ### + +Admin Boots=Stivali dell'amministratrice/tore +Admin Chestplate=Corazza dell'amministratrice/tore +Admin Helmet=Elmo dell'amministratrice/tore +Admin Leggings=Gambali dell'amministratrice/tore +Bronze Boots=Stivali di bronzo +Bronze Chestplate=Corazza di bronzo +Bronze Helmet=Elmo di bronzo +Bronze Leggings=Gambali di bronzo +Cactus Boots=Stivali di cactus +Cactus Chestplate=Corazza di cactus +Cactus Helmet=Elmo di cactus +Cactus Leggings=Gambali di cactus +Crystal Boots=Stivali di cristallo +Crystal Chestplate=Corazza di cristallo +Crystal Helmet=Elmo di cristallo +Crystal Leggings=Gambali di cristallo +Diamond Boots=Stivali di diamante +Diamond Chestplate=Corazza di diamante +Diamond Helmet=Elmo di diamante +Diamond Leggings=Gambali di diamante +Gold Boots=Stivali d'oro +Gold Chestplate=Corazza d'oro +Gold Helmet=Elmo d'oro +Gold Leggings=Gambali d'oro +Mithril Boots=Stivali di mithril +Mithril Chestplate=Corazza di mithril +Mithril Helmet=Elmo di mithril +Mithril Leggings=Gambali di mithril +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 +Wood Leggings=Gambali di legno + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: Inizializzazione dell'utente fallita +Fire=Fuoco +Heal=Guarigione +Level=Livello +Radiation=Radiazione +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 caricata ma inutilizzata. +Back=Indietro +Armor=Armatura +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 caricata ma inutilizzata. +3d Armor=Armatura 3D +Armor not initialized!=Armatura non inizializzata! +Admin Shield=Scudo dell'amministratrice/tore +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 d'acciaio +Bronze Shield=Scudo di bronzo +Diamond Shield=Scudo di diamante +Gold Shield=Scudo d'oro +Mithril Shield=Scudo di mithril +Crystal Shield=Scudo di cristallo diff --git a/mods/3d_armor/3d_armor/locale/3d_armor.ms.tr b/mods/3d_armor/3d_armor/locale/3d_armor.ms.tr new file mode 100644 index 00000000..b76dd613 --- /dev/null +++ b/mods/3d_armor/3d_armor/locale/3d_armor.ms.tr @@ -0,0 +1,85 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: Inventori perisai terpisah tiada nilai @1 +3d_armor: Player name is nil @1=3d_armor: Nama pemain tiada nilai @1 +3d_armor: Player reference is nil @1=3d_armor: Rujukan pemain tiada nilai @1 + +### armor.lua ### + +Admin Boots=But Pentadbir +Admin Chestplate=Perisai Dada Pentadbir +Admin Helmet=Helmet Pentadbir +Admin Leggings=Perisai Kaki Pentadbir +Bronze Boots=But Gangsa +Bronze Chestplate=Perisai Dada Gangsa +Bronze Helmet=Helmet Gangsa +Bronze Leggings=Perisai Kaki Gangsa +Cactus Boots=But Kaktus +Cactus Chestplate=Perisai Dada Kaktus +Cactus Helmet=Helmet Kaktus +Cactus Leggings=Perisai Kaki Kaktus +Crystal Boots=But Kristal +Crystal Chestplate=Perisai Dada Kristal +Crystal Helmet=Helmet Kristal +Crystal Leggings=Perisai Kaki Kristal +Diamond Boots=But Intan +Diamond Chestplate=Perisai Dada Intan +Diamond Helmet=Helmet Intan +Diamond Leggings=Perisai Kaki Intan +Gold Boots=But Emas +Gold Chestplate=Perisai Dada Emas +Gold Helmet=Helmet Emas +Gold Leggings=Perisai Kaki Emas +Mithril Boots=But Mithril +Mithril Chestplate=Perisai Dada Mithril +Mithril Helmet=Helmet Mithril +Mithril Leggings=Perisai Kaki Mithril +Steel Boots=But Keluli +Steel Chestplate=Perisai Dada Keluli +Steel Helmet=Helmet Keluli +Steel Leggings=Perisai Kaki Keluli +Wood Boots=But Kayu +Wood Chestplate=Perisai Dada Kayu +Wood Helmet=Helmet Kayu +Wood Leggings=Perisai Kaki Kayu + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: Gagal mengasalkan pemain +Fire=Api +Heal=Pulih +Level=Tahap +Radiation=Radiasi +Your @1 got destroyed!=@1 anda telah musnah! +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled=[3d_armor] Nod-nod Api dilumpuhkan + + +##### not used anymore ##### + +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mods dimuatkan tetapi tidak digunakan. +Back=Kembali +Armor=Perisai +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mods dimuatkan tetapi tidak digunakan. +Armor stand top=Bhg atas dirian perisai +Armor stand=Dirian perisai +Armor Stand=Dirian Perisai +Locked Armor stand=Dirian perisai Berkunci +Armor Stand (owned by @1)=Dirian Perisai (milik @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mods dimuatkan tetapi tidak digunakan. +3d Armor=Perisai 3d +Armor not initialized!=Perisai tidak diasalkan! +Admin Shield=Perisai Pegang Pentadbir +Wooden Shield=Perisai Pegang Kayu +Enhanced Wood Shield=Perisai Pegang Kayu Kukuh +Cactus Shield=Perisai Pegang Kaktus +Enhanced Cactus Shield=Perisai Pegang Kaktus Kukuh +Steel Shield=Perisai Pegang Keluli +Bronze Shield=Perisai Pegang Gangsa +Diamond Shield=Perisai Pegang Intan +Gold Shield=Perisai Pegang Emas +Mithril Shield=Perisai Pegang Mithril +Crystal Shield=Perisai Pegang Kristal diff --git a/mods/3d_armor/3d_armor/locale/3d_armor.pt.tr b/mods/3d_armor/3d_armor/locale/3d_armor.pt.tr new file mode 100644 index 00000000..8fc689d0 --- /dev/null +++ b/mods/3d_armor/3d_armor/locale/3d_armor.pt.tr @@ -0,0 +1,85 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: Inventario avulso de armadura é nulo @1 +3d_armor: Player name is nil @1=3d_armor: Nome de jogador é nulo @1 +3d_armor: Player reference is nil @1=3d_armor: Referência Jogador é nula @1 + +### armor.lua ### + +Admin Boots=Botas de Administrador +Admin Chestplate=Peitoral de Administrador +Admin Helmet=Capacete de Administrador +Admin Leggings=Calças de Administrador +Bronze Boots=Botas de Bronze +Bronze Chestplate=Peitoral de Bronze +Bronze Helmet=Capacete de Bronze +Bronze Leggings=Calças de Bronze +Cactus Boots=Botas de Madeira +Cactus Chestplate=Peitoral de Cacto +Cactus Helmet=Capacete de Cacto +Cactus Leggings=Calças de Cacto +Crystal Boots=Botas de Cristal +Crystal Chestplate=Peitoral de Cristal +Crystal Helmet=Capacete de Cristal +Crystal Leggings=Calças de Cristal +Diamond Boots=Botas de Diamante +Diamond Chestplate=Peitoral de Diamante +Diamond Helmet=Capacete de Diamante +Diamond Leggings=Calças de Diamante +Gold Boots=Botas de Ouro +Gold Chestplate=Peitoral de Ouro +Gold Helmet=Capacete de Ouro +Gold Leggings=Calças de Ouro +Mithril Boots=Botas de Mithril +Mithril Chestplate=Peitoral de Mithril +Mithril Helmet=Capacete de Mithril +Mithril Leggings=Calças de Mithril +Steel Boots=Botas de Aço +Steel Chestplate=Peitoral de Aço +Steel Helmet=Capacete de Aço +Steel Leggings=Calças de Aço +Wood Boots=Botas de Madeira +Wood Chestplate=Peitoral de Madeira +Wood Helmet=Capacete de Madeira +Wood Leggings=Calças de Madeira + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: Falha ao inicializar jogador +Fire=Fogo +Heal=Saúde +Level=Nível +Radiation=Radiação +Your @1 got destroyed!=@1 foi destruído(a)! +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled=[3d_armor] Nodes de gofo desabilitados + + +##### not used anymore ##### + +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mod carregado mas inoperante. +Back=Voltar +Armor=Armadura +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mod carregado mas inoperante. +Armor stand top=Topo de estande de armadura +Armor stand=Estande de armadura +Armor Stand=Estande de Armadura +Locked Armor stand=Estande de Armadura Trancada +Armor Stand (owned by @1)=Estande de Armadura (pertente a @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mod carregado mas inoperante. +3d Armor=3d Armor +Armor not initialized!=Armadura não inicializada! +Admin Shield=Escudo de Administrador +Wooden Shield=Escudo de Madeira +Enhanced Wood Shield=Escudo de Madeira Melhorado +Cactus Shield=Escudo de Cacto +Enhanced Cactus Shield=Escudo de Cacto Melhorado +Steel Shield=Escudo de Aço +Bronze Shield=Escudo de Bronze +Diamond Shield=Escudo de Diamante +Gold Shield=Escudo de Ouro +Mithril Shield=Escudo de Mithril +Crystal Shield=Escudo de Cristal diff --git a/mods/3d_armor/3d_armor/locale/3d_armor.pt_BR.tr b/mods/3d_armor/3d_armor/locale/3d_armor.pt_BR.tr new file mode 100644 index 00000000..8fc689d0 --- /dev/null +++ b/mods/3d_armor/3d_armor/locale/3d_armor.pt_BR.tr @@ -0,0 +1,85 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: Inventario avulso de armadura é nulo @1 +3d_armor: Player name is nil @1=3d_armor: Nome de jogador é nulo @1 +3d_armor: Player reference is nil @1=3d_armor: Referência Jogador é nula @1 + +### armor.lua ### + +Admin Boots=Botas de Administrador +Admin Chestplate=Peitoral de Administrador +Admin Helmet=Capacete de Administrador +Admin Leggings=Calças de Administrador +Bronze Boots=Botas de Bronze +Bronze Chestplate=Peitoral de Bronze +Bronze Helmet=Capacete de Bronze +Bronze Leggings=Calças de Bronze +Cactus Boots=Botas de Madeira +Cactus Chestplate=Peitoral de Cacto +Cactus Helmet=Capacete de Cacto +Cactus Leggings=Calças de Cacto +Crystal Boots=Botas de Cristal +Crystal Chestplate=Peitoral de Cristal +Crystal Helmet=Capacete de Cristal +Crystal Leggings=Calças de Cristal +Diamond Boots=Botas de Diamante +Diamond Chestplate=Peitoral de Diamante +Diamond Helmet=Capacete de Diamante +Diamond Leggings=Calças de Diamante +Gold Boots=Botas de Ouro +Gold Chestplate=Peitoral de Ouro +Gold Helmet=Capacete de Ouro +Gold Leggings=Calças de Ouro +Mithril Boots=Botas de Mithril +Mithril Chestplate=Peitoral de Mithril +Mithril Helmet=Capacete de Mithril +Mithril Leggings=Calças de Mithril +Steel Boots=Botas de Aço +Steel Chestplate=Peitoral de Aço +Steel Helmet=Capacete de Aço +Steel Leggings=Calças de Aço +Wood Boots=Botas de Madeira +Wood Chestplate=Peitoral de Madeira +Wood Helmet=Capacete de Madeira +Wood Leggings=Calças de Madeira + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: Falha ao inicializar jogador +Fire=Fogo +Heal=Saúde +Level=Nível +Radiation=Radiação +Your @1 got destroyed!=@1 foi destruído(a)! +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled=[3d_armor] Nodes de gofo desabilitados + + +##### not used anymore ##### + +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mod carregado mas inoperante. +Back=Voltar +Armor=Armadura +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mod carregado mas inoperante. +Armor stand top=Topo de estande de armadura +Armor stand=Estande de armadura +Armor Stand=Estande de Armadura +Locked Armor stand=Estande de Armadura Trancada +Armor Stand (owned by @1)=Estande de Armadura (pertente a @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mod carregado mas inoperante. +3d Armor=3d Armor +Armor not initialized!=Armadura não inicializada! +Admin Shield=Escudo de Administrador +Wooden Shield=Escudo de Madeira +Enhanced Wood Shield=Escudo de Madeira Melhorado +Cactus Shield=Escudo de Cacto +Enhanced Cactus Shield=Escudo de Cacto Melhorado +Steel Shield=Escudo de Aço +Bronze Shield=Escudo de Bronze +Diamond Shield=Escudo de Diamante +Gold Shield=Escudo de Ouro +Mithril Shield=Escudo de Mithril +Crystal Shield=Escudo de Cristal diff --git a/mods/3d_armor/3d_armor/locale/3d_armor.ru.tr b/mods/3d_armor/3d_armor/locale/3d_armor.ru.tr new file mode 100644 index 00000000..b817c79e --- /dev/null +++ b/mods/3d_armor/3d_armor/locale/3d_armor.ru.tr @@ -0,0 +1,85 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: Отдельный инвентарь брони является nil @1 +3d_armor: Player name is nil @1=3d_armor: Имя игрока является nil @1 +3d_armor: Player reference is nil @1=3d_armor: Ссылка игрока является nil @1 + +### armor.lua ### + +Admin Boots=ботинки админа +Admin Chestplate=бронежилет админа +Admin Helmet=шлем админа +Admin Leggings=гамаши админа +Bronze Boots=бронзовые ботинки +Bronze Chestplate=бронзовый бронежилет +Bronze Helmet=бронзовый шлем +Bronze Leggings=бронзовые гамаши +Cactus Boots=кактусовые ботинки +Cactus Chestplate=кактусовый бронежилет +Cactus Helmet=кактусовый шлем +Cactus Leggings=кактусовые гамаши +Crystal Boots=кристалловые ботинки +Crystal Chestplate=кристалловый бронежилет +Crystal Helmet=кристалловый шлем +Crystal Leggings=кристалловые гамаши +Diamond Boots=алмазные ботинки +Diamond Chestplate=алмазный бронежилет +Diamond Helmet=алмазный шлем +Diamond Leggings=алмазные гамаши +Gold Boots=золотые ботинки +Gold Chestplate=золотой бронежилет +Gold Helmet=золотой шлем +Gold Leggings=золотые гамаши +Mithril Boots=мифриловые ботинки +Mithril Chestplate=мифриловый бронежилет +Mithril Helmet=мифриловый шлем +Mithril Leggings=мифриловые гамаши +Steel Boots=стальные ботинки +Steel Chestplate=стальной бронежилет +Steel Helmet=стальной шлем +Steel Leggings=стальные гамаши +Wood Boots=деревянные ботинки +Wood Chestplate=деревянный бронежилет +Wood Helmet=деревянный шлем +Wood Leggings=деревянные гамаши + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: не смог подготовить игрока +Fire=огонь +Heal=исцеление +Level=уровень +Radiation=излучение +Your @1 got destroyed!=твой(и) @1 был(и) разрушен(ы)! +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled=[3d_armor] блоки огня отключены + + +##### not used anymore ##### + +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: мод загружен но не используется. +Back=назад +Armor=бронь +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: мод загружен но не используется. +Armor stand top=стойка для брони (верх) +Armor stand=стойка для брони +Armor Stand=стойка для брони +Locked Armor stand=защищенная стойка для брони +Armor Stand (owned by @1)=стойка для брони (принадлежит @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: мод загружен но не используется. +3d Armor=3D бронь +Armor not initialized!=бронь не подготовлена! +Admin Shield=щит админа +Wooden Shield=деревянный щит +Enhanced Wood Shield=улучшенный деревянный щит +Cactus Shield=кактусный щит +Enhanced Cactus Shield=улучшенный кактусный щит +Steel Shield=стальной щит +Bronze Shield=бронзовый щит +Diamond Shield=алмазный щит +Gold Shield=золотой щит +Mithril Shield=мифриловый щит +Crystal Shield=кристалловый щит diff --git a/mods/3d_armor/3d_armor/locale/es.po b/mods/3d_armor/3d_armor/locale/es.po deleted file mode 100644 index 8eeaf6ef..00000000 --- a/mods/3d_armor/3d_armor/locale/es.po +++ /dev/null @@ -1,384 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-06 18:20+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player name is nil @1" -msgstr "3d_armor: El nombre del jugador es nulo @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player inventory is nil @1" -msgstr "3d_armor: El inventario del jugador es nulo @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Detached armor inventory is nil @1" -msgstr "3d_armor: La armadura desconectada es nula @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player reference is nil @1" -msgstr "3d_armor: La referencia del jugador es nula @1" - -#: ../3d_armor/armor.lua -msgid "Admin Helmet" -msgstr "Casco de admin" - -#: ../3d_armor/armor.lua -msgid "Admin Chestplate" -msgstr "Peto de admin" - -#: ../3d_armor/armor.lua -msgid "Admin Leggings" -msgstr "Polainas de admin" - -#: ../3d_armor/armor.lua -msgid "Admin Boots" -msgstr "Botas de admin" - -#: ../3d_armor/armor.lua -msgid "Wood Helmet" -msgstr "Casco de madera" - -#: ../3d_armor/armor.lua -msgid "Wood Chestplate" -msgstr "Peto de madera" - -#: ../3d_armor/armor.lua -msgid "Wood Leggings" -msgstr "Polainas de madera" - -#: ../3d_armor/armor.lua -msgid "Wood Boots" -msgstr "Botas de madera" - -#: ../3d_armor/armor.lua -msgid "Cactus Helmet" -msgstr "Casco de cactus" - -#: ../3d_armor/armor.lua -msgid "Cactus Chestplate" -msgstr "Peto de cactus" - -#: ../3d_armor/armor.lua -msgid "Cactus Leggings" -msgstr "Polainas de cactus" - -#: ../3d_armor/armor.lua -msgid "Cactus Boots" -msgstr "Botas de cactus" - -#: ../3d_armor/armor.lua -msgid "Steel Helmet" -msgstr "Casco de acero" - -#: ../3d_armor/armor.lua -msgid "Steel Chestplate" -msgstr "Peto de acero" - -#: ../3d_armor/armor.lua -msgid "Steel Leggings" -msgstr "Polainas de acero" - -#: ../3d_armor/armor.lua -msgid "Steel Boots" -msgstr "Botas de acero" - -#: ../3d_armor/armor.lua -msgid "Bronze Helmet" -msgstr "Casco de bronce" - -#: ../3d_armor/armor.lua -msgid "Bronze Chestplate" -msgstr "Peto de bronce" - -#: ../3d_armor/armor.lua -msgid "Bronze Leggings" -msgstr "Polainas de bronce" - -#: ../3d_armor/armor.lua -msgid "Bronze Boots" -msgstr "Botas de bronce" - -#: ../3d_armor/armor.lua -msgid "Diamond Helmet" -msgstr "Casco de diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Chestplate" -msgstr "Peto de diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Leggings" -msgstr "Polainas de diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Boots" -msgstr "Botas de diamante" - -#: ../3d_armor/armor.lua -msgid "Gold Helmet" -msgstr "Casco de oro" - -#: ../3d_armor/armor.lua -msgid "Gold Chestplate" -msgstr "Peto de oro" - -#: ../3d_armor/armor.lua -msgid "Gold Leggings" -msgstr "Polainas de oro" - -#: ../3d_armor/armor.lua -msgid "Gold Boots" -msgstr "Botas de oro" - -#: ../3d_armor/armor.lua -msgid "Mithril Helmet" -msgstr "Casco de mitrilo" - -#: ../3d_armor/armor.lua -msgid "Mithril Chestplate" -msgstr "Peto de mitrilo" - -#: ../3d_armor/armor.lua -msgid "Mithril Leggings" -msgstr "Polainas de mitrilo" - -#: ../3d_armor/armor.lua -msgid "Mithril Boots" -msgstr "Botas de mitrilo" - -#: ../3d_armor/armor.lua -msgid "Crystal Helmet" -msgstr "Casco de cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Chestplate" -msgstr "Peto de cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Leggings" -msgstr "Polainas de cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Boots" -msgstr "Botas de cristal" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Radiation" -msgstr "Radiación" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Level" -msgstr "Nivel" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Heal" -msgstr "Salud" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Fire" -msgstr "Fuego" - -#: ../3d_armor/init.lua -msgid "Your @1 got destroyed!" -msgstr "¡Tu @1 fue destruído!" - -#: ../3d_armor/init.lua -msgid "3d_armor: Failed to initialize player" -msgstr "3d_armor: Fallo en la inicialización del jugador" - -#: ../3d_armor/init.lua -msgid "[3d_armor] Fire Nodes disabled" -msgstr "[3d_armor] Nodos de fuego desabilitados" - -#: ../3d_armor_ip/init.lua -msgid "3d_armor_ip: Mod loaded but unused." -msgstr "3d_armor_ip: Mod cargado, pero sin ser usado." - -#: ../3d_armor_ip/init.lua -msgid "Back" -msgstr "Volver" - -#: ../3d_armor_ip/init.lua ../3d_armor_sfinv/init.lua ../3d_armor_ui/init.lua -msgid "Armor" -msgstr "Armadura" - -#: ../3d_armor_sfinv/init.lua -msgid "3d_armor_sfinv: Mod loaded but unused." -msgstr "3d_armor_sfinv: Mod cargado, pero sin ser usado." - -#: ../3d_armor_stand/init.lua -msgid "Armor stand top" -msgstr "Parte arriba maniquí armadura" - -#: ../3d_armor_stand/init.lua -msgid "Armor stand" -msgstr "Maniquí para armadura" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand" -msgstr "Maniquí para armadura" - -#: ../3d_armor_stand/init.lua -msgid "Locked Armor stand" -msgstr "Maniquí para armadura (bloqueado)" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand (owned by @1)" -msgstr "Maniquí para armadura (propiedad de @1)" - -#: ../3d_armor_ui/init.lua -msgid "3d_armor_ui: Mod loaded but unused." -msgstr "3d_armor_ui: Mod cargado, pero sin ser usado." - -#: ../3d_armor_ui/init.lua -msgid "3d Armor" -msgstr "Armadura 3d" - -#: ../3d_armor_ui/init.lua -msgid "Armor not initialized!" -msgstr "¡Armadura no inicializada!" - -#: ../hazmat_suit/init.lua -msgid "hazmat_suit: Mod loaded but unused." -msgstr "hazmat_suit: Mod cargado, pero sin ser usado." - -#: ../hazmat_suit/init.lua -msgid "Hazmat Helmet" -msgstr "Casco de hazmat" - -#: ../hazmat_suit/init.lua -msgid "Hazmat Chestplate" -msgstr "Peto de hazmat" - -#: ../hazmat_suit/init.lua -msgid "Hazmat Sleeve" -msgstr "Manga de hazmat" - -#: ../hazmat_suit/init.lua -msgid "Hazmat Leggins" -msgstr "Polainas de hazmat" - -#: ../hazmat_suit/init.lua -msgid "Hazmat Boots" -msgstr "Botas de hazmat" - -#: ../hazmat_suit/init.lua -msgid "Hazmat Suit" -msgstr "Traje de hazmat" - -#: ../shields/init.lua -msgid "Admin Shield" -msgstr "Escudo de admin" - -#: ../shields/init.lua -msgid "Wooden Shield" -msgstr "Escudo de madera" - -#: ../shields/init.lua -msgid "Enhanced Wood Shield" -msgstr "Escudo de madera mejorado" - -#: ../shields/init.lua -msgid "Cactus Shield" -msgstr "Escudo de cactus" - -#: ../shields/init.lua -msgid "Enhanced Cactus Shield" -msgstr "Escudo de cactus mejorado" - -#: ../shields/init.lua -msgid "Steel Shield" -msgstr "Escudo de acero" - -#: ../shields/init.lua -msgid "Bronze Shield" -msgstr "Escudo de bronce" - -#: ../shields/init.lua -msgid "Diamond Shield" -msgstr "Escudo de diamante" - -#: ../shields/init.lua -msgid "Gold Shield" -msgstr "Escudo de oro" - -#: ../shields/init.lua -msgid "Mithril Shield" -msgstr "Escudo de mitrilo" - -#: ../shields/init.lua -msgid "Crystal Shield" -msgstr "Escudo de cristal" - -#: ../technic_armor/init.lua -msgid "technic_armor: Mod loaded but unused." -msgstr "technic_armor: Mod cargado, pero no usado." - -#: ../technic_armor/init.lua -msgid "Lead" -msgstr "Plomo" - -#: ../technic_armor/init.lua -msgid "Brass" -msgstr "Latón" - -#: ../technic_armor/init.lua -msgid "Cast Iron" -msgstr "Hierro fundido" - -#: ../technic_armor/init.lua -msgid "Carbon Steel" -msgstr "Acero carbono" - -#: ../technic_armor/init.lua -msgid "Stainless Steel" -msgstr "Acero inoxidable" - -#: ../technic_armor/init.lua -msgid "Tin" -msgstr "Estaño" - -#: ../technic_armor/init.lua -msgid "Silver" -msgstr "Plata" - -#: ../technic_armor/init.lua -msgid "Helmet" -msgstr "Casco" - -#: ../technic_armor/init.lua -msgid "Chestplate" -msgstr "Peto" - -#: ../technic_armor/init.lua -msgid "Leggins" -msgstr "Polainas" - -#: ../technic_armor/init.lua -msgid "Boots" -msgstr "Botas" - -#: ../technic_armor/init.lua -msgid "Shield" -msgstr "Escudo" - -#. Translators: @1 stands for material and @2 for part of the armor, so that you could use a conjunction if in your language part name comes first then material (e.g. in french 'Silver Boots' is translated in 'Bottes en argent' by using '@2 en @1' as translated string) -#: ../technic_armor/init.lua -msgid "@1 @2" -msgstr "@2 de @1" diff --git a/mods/3d_armor/3d_armor/locale/fr.po b/mods/3d_armor/3d_armor/locale/fr.po deleted file mode 100644 index f2d258f4..00000000 --- a/mods/3d_armor/3d_armor/locale/fr.po +++ /dev/null @@ -1,295 +0,0 @@ -# French translation for 3D ARMOR MOD -# Copyright (C) 2018 by Stuart Jones -# This file is distributed under the same license as the 3D ARMOR MOD package. -# fat115 , 2017. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-23 21:24+0200\n" -"PO-Revision-Date: 2018-07-23 21:30+0200\n" -"Last-Translator: fat115 \n" -"Language-Team: \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.12\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player reference is nil @1" -msgstr "3d_armor : Référence au joueur non trouvée @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player name is nil @1" -msgstr "3d_armor : Nom du joueur non trouvé @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Detached armor inventory is nil @1" -msgstr "3d_armor : Inventaire détaché pour l'armure non trouvé @1" - -#: ../3d_armor/armor.lua -msgid "Admin Helmet" -msgstr "Casque d'admin" - -#: ../3d_armor/armor.lua -msgid "Admin Chestplate" -msgstr "Cuirasse d'admin" - -#: ../3d_armor/armor.lua -msgid "Admin Leggings" -msgstr "Jambières d'admin" - -#: ../3d_armor/armor.lua -msgid "Admin Boots" -msgstr "Bottes d'admin" - -#: ../3d_armor/armor.lua -msgid "Wood Helmet" -msgstr "Casque en bois" - -#: ../3d_armor/armor.lua -msgid "Wood Chestplate" -msgstr "Cuirasse en bois" - -#: ../3d_armor/armor.lua -msgid "Wood Leggings" -msgstr "Jambières en bois" - -#: ../3d_armor/armor.lua -msgid "Wood Boots" -msgstr "Bottes en bois" - -#: ../3d_armor/armor.lua -msgid "Cactus Helmet" -msgstr "Casque en cactus" - -#: ../3d_armor/armor.lua -msgid "Cactus Chestplate" -msgstr "Cuirasse en cactus" - -#: ../3d_armor/armor.lua -msgid "Cactus Leggings" -msgstr "Jambières en cactus" - -#: ../3d_armor/armor.lua -msgid "Cactus Boots" -msgstr "Bottes en cactus" - -#: ../3d_armor/armor.lua -msgid "Steel Helmet" -msgstr "Casque en acier" - -#: ../3d_armor/armor.lua -msgid "Steel Chestplate" -msgstr " = Cuirasse en acier" - -#: ../3d_armor/armor.lua -msgid "Steel Leggings" -msgstr "Jambières en acier" - -#: ../3d_armor/armor.lua -msgid "Steel Boots" -msgstr "Bottes en acier" - -#: ../3d_armor/armor.lua -msgid "Bronze Helmet" -msgstr "Casque en bronze" - -#: ../3d_armor/armor.lua -msgid "Bronze Chestplate" -msgstr "Cuirasse en bronze" - -#: ../3d_armor/armor.lua -msgid "Bronze Leggings" -msgstr "Jambières en bronze" - -#: ../3d_armor/armor.lua -msgid "Bronze Boots" -msgstr "Bottes en bronze" - -#: ../3d_armor/armor.lua -msgid "Diamond Helmet" -msgstr "Casque en diamant" - -#: ../3d_armor/armor.lua -msgid "Diamond Chestplate" -msgstr "Cuirasse en diamant" - -#: ../3d_armor/armor.lua -msgid "Diamond Leggings" -msgstr "Jambières en diamant" - -#: ../3d_armor/armor.lua -msgid "Diamond Boots" -msgstr "Bottes en diamant" - -#: ../3d_armor/armor.lua -msgid "Gold Helmet" -msgstr "Casque en or" - -#: ../3d_armor/armor.lua -msgid "Gold Chestplate" -msgstr "Cuirasse en or" - -#: ../3d_armor/armor.lua -msgid "Gold Leggings" -msgstr "Jambières en or" - -#: ../3d_armor/armor.lua -msgid "Gold Boots" -msgstr "Bottes en or" - -#: ../3d_armor/armor.lua -msgid "Mithril Helmet" -msgstr "Casque en mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Chestplate" -msgstr "Cuirasse en mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Leggings" -msgstr "Jambières en mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Boots" -msgstr "Bottes en mithril" - -#: ../3d_armor/armor.lua -msgid "Crystal Helmet" -msgstr "Casque en cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Chestplate" -msgstr "Cuirasse en cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Leggings" -msgstr "Jambières en cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Boots" -msgstr "Bottes en cristal" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Radiation" -msgstr "Radiation" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Level" -msgstr "Niveau" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Heal" -msgstr "Soins" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Fire" -msgstr "Fire" - -#: ../3d_armor/init.lua -msgid "Your @1 got destroyed!" -msgstr "Une partie de votre armure a été détruite : @1 !" - -#: ../3d_armor/init.lua -msgid "3d_armor: Failed to initialize player" -msgstr "3d_armor : Impossible d'initialiser le joueur" - -#: ../3d_armor/init.lua -msgid "[3d_armor] Fire Nodes disabled" -msgstr "[3d_armor] Noeuds de type feu désactivés" - -#: ../3d_armor_ip/init.lua -msgid "3d_armor_ip: Mod loaded but unused." -msgstr "3d_armor_ip : Mod chargé mais inutilisé." - -#: ../3d_armor_ip/init.lua -msgid "Back" -msgstr "Retour" - -#: ../3d_armor_ip/init.lua ../3d_armor_sfinv/init.lua ../3d_armor_ui/init.lua -msgid "Armor" -msgstr "Armure" - -#: ../3d_armor_sfinv/init.lua -msgid "3d_armor_sfinv: Mod loaded but unused." -msgstr "3d_armor_sfinv : Mod chargé mais inutilisé." - -#: ../3d_armor_stand/init.lua -msgid "Armor stand top" -msgstr "Haut de support d'armure" - -#: ../3d_armor_stand/init.lua -msgid "Armor stand" -msgstr "Support d'armure" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand" -msgstr "Support d'armure" - -#: ../3d_armor_stand/init.lua -msgid "Locked Armor stand" -msgstr "Support d'armure verrouillé" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand (owned by @1)" -msgstr "Support d'armure (propriété de @1)" - -#: ../3d_armor_ui/init.lua -msgid "3d_armor_ui: Mod loaded but unused." -msgstr "3d_armor_ui : Mod chargé mais inutilisé." - -#: ../3d_armor_ui/init.lua -msgid "3d Armor" -msgstr "Armure 3d" - -#: ../3d_armor_ui/init.lua -msgid "Armor not initialized!" -msgstr "Armure non initialisée !" - -#: ../shields/init.lua -msgid "Admin Shield" -msgstr "Bouclier d'admin" - -#: ../shields/init.lua -msgid "Wooden Shield" -msgstr "Bouclier en bois" - -#: ../shields/init.lua -msgid "Enhanced Wood Shield" -msgstr "Bouclier en bois amélioré" - -#: ../shields/init.lua -msgid "Cactus Shield" -msgstr "Bouclier en cactus" - -#: ../shields/init.lua -msgid "Enhanced Cactus Shield" -msgstr "Bouclier en cactus amélioré" - -#: ../shields/init.lua -msgid "Steel Shield" -msgstr "Bouclier en acier" - -#: ../shields/init.lua -msgid "Bronze Shield" -msgstr "Bouclier en bronze" - -#: ../shields/init.lua -msgid "Diamond Shield" -msgstr "Bouclier en diamant" - -#: ../shields/init.lua -msgid "Gold Shield" -msgstr "Bouclier en or" - -#: ../shields/init.lua -msgid "Mithril Shield" -msgstr "Bouclier en mithril" - -#: ../shields/init.lua -msgid "Crystal Shield" -msgstr "Bouclier en cristal" diff --git a/mods/3d_armor/3d_armor/locale/it.po b/mods/3d_armor/3d_armor/locale/it.po deleted file mode 100644 index 5d6f46b9..00000000 --- a/mods/3d_armor/3d_armor/locale/it.po +++ /dev/null @@ -1,295 +0,0 @@ -# Italian translation for 3D ARMOR MOD -# Copyright (C) 2018 by Stuart Jones -# This file is distributed under the same license as the 3D ARMOR MOD package. -# Hamlet , 2017. -# -msgid "" -msgstr "" -"Project-Id-Version: Italian localization file for the 3D Armor module\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-23 21:24+0200\n" -"PO-Revision-Date: 2018-07-23 21:30+0200\n" -"Last-Translator: H4mlet \n" -"Language-Team: ITALIANO\n" -"Language: it\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 1.6.10\n" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player reference is nil @1" -msgstr "3d_armor: Il riferimento alla/al giocatrice/tore è nullo @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player name is nil @1" -msgstr "3d_armor: Il nome della/del gicatrice/tore è nullo @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Detached armor inventory is nil @1" -msgstr "3d_armor: L'inventario staccato dell'armatura è nullo @1" - -#: ../3d_armor/armor.lua -msgid "Admin Helmet" -msgstr "Elmo dell'amministratrice/tore" - -#: ../3d_armor/armor.lua -msgid "Admin Chestplate" -msgstr "Corazza dell'amministratrice/tore" - -#: ../3d_armor/armor.lua -msgid "Admin Leggings" -msgstr "Gambali dell'amministratrice/tore" - -#: ../3d_armor/armor.lua -msgid "Admin Boots" -msgstr "Stivali dell'amministratrice/tore" - -#: ../3d_armor/armor.lua -msgid "Wood Helmet" -msgstr "Elmo di legno" - -#: ../3d_armor/armor.lua -msgid "Wood Chestplate" -msgstr "Corazza di legno" - -#: ../3d_armor/armor.lua -msgid "Wood Leggings" -msgstr "Gambali di legno" - -#: ../3d_armor/armor.lua -msgid "Wood Boots" -msgstr "Stivali di legno" - -#: ../3d_armor/armor.lua -msgid "Cactus Helmet" -msgstr "Elmo di cactus" - -#: ../3d_armor/armor.lua -msgid "Cactus Chestplate" -msgstr "Corazza di cactus" - -#: ../3d_armor/armor.lua -msgid "Cactus Leggings" -msgstr "Gambali di cactus" - -#: ../3d_armor/armor.lua -msgid "Cactus Boots" -msgstr "Stivali di cactus" - -#: ../3d_armor/armor.lua -msgid "Steel Helmet" -msgstr "Elmo di acciaio" - -#: ../3d_armor/armor.lua -msgid "Steel Chestplate" -msgstr "Corazza di acciaio" - -#: ../3d_armor/armor.lua -msgid "Steel Leggings" -msgstr "Gambali di acciaio" - -#: ../3d_armor/armor.lua -msgid "Steel Boots" -msgstr "Stivali di acciaio" - -#: ../3d_armor/armor.lua -msgid "Bronze Helmet" -msgstr "Elmo di bronzo" - -#: ../3d_armor/armor.lua -msgid "Bronze Chestplate" -msgstr "Corazza di bronzo" - -#: ../3d_armor/armor.lua -msgid "Bronze Leggings" -msgstr "Gambali di bronzo" - -#: ../3d_armor/armor.lua -msgid "Bronze Boots" -msgstr "Stivali di bronzo" - -#: ../3d_armor/armor.lua -msgid "Diamond Helmet" -msgstr "Elmo di diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Chestplate" -msgstr "Corazza di diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Leggings" -msgstr "Gambali di diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Boots" -msgstr "Stivali di diamante" - -#: ../3d_armor/armor.lua -msgid "Gold Helmet" -msgstr "Elmo d'oro" - -#: ../3d_armor/armor.lua -msgid "Gold Chestplate" -msgstr "Corazza d'oro" - -#: ../3d_armor/armor.lua -msgid "Gold Leggings" -msgstr "Gambali d'oro" - -#: ../3d_armor/armor.lua -msgid "Gold Boots" -msgstr "Stivali d'oro" - -#: ../3d_armor/armor.lua -msgid "Mithril Helmet" -msgstr "Elmo di mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Chestplate" -msgstr "Corazza di mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Leggings" -msgstr "Gambali di mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Boots" -msgstr "Stivali di mithril" - -#: ../3d_armor/armor.lua -msgid "Crystal Helmet" -msgstr "Elmo di cristallo" - -#: ../3d_armor/armor.lua -msgid "Crystal Chestplate" -msgstr "Corazza di cristallo" - -#: ../3d_armor/armor.lua -msgid "Crystal Leggings" -msgstr "Gambali di cristallo" - -#: ../3d_armor/armor.lua -msgid "Crystal Boots" -msgstr "Stivali di cristallo" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Radiation" -msgstr "Radiazione" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Level" -msgstr "Livello" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Heal" -msgstr "Guarigione" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Fire" -msgstr "Fuoco" - -#: ../3d_armor/init.lua -msgid "Your @1 got destroyed!" -msgstr "Il/i vostro/i @1 è/sono stato/i distrutto/i!" - -#: ../3d_armor/init.lua -msgid "3d_armor: Failed to initialize player" -msgstr "3d_armor: Inizializzazione della/del giocatrice/tore fallita" - -#: ../3d_armor/init.lua -msgid "[3d_armor] Fire Nodes disabled" -msgstr "[3d_armor] Nodi fuoco disabilitati" - -#: ../3d_armor_ip/init.lua -msgid "3d_armor_ip: Mod loaded but unused." -msgstr "3d_armor_ip: Mod caricato ma inutilizzato." - -#: ../3d_armor_ip/init.lua -msgid "Back" -msgstr "Indietro" - -#: ../3d_armor_ip/init.lua ../3d_armor_sfinv/init.lua ../3d_armor_ui/init.lua -msgid "Armor" -msgstr "Armatura" - -#: ../3d_armor_sfinv/init.lua -msgid "3d_armor_sfinv: Mod loaded but unused." -msgstr "3d_armor_sfinv: Mod caricato ma inutilizzato." - -#: ../3d_armor_stand/init.lua -msgid "Armor stand top" -msgstr "Parte superiore del supporto per armatura" - -#: ../3d_armor_stand/init.lua -msgid "Armor stand" -msgstr "Supporto per armatura" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand" -msgstr "Supporto per armatura" - -#: ../3d_armor_stand/init.lua -msgid "Locked Armor stand" -msgstr "Supporto per armatura chiuso a chiave" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand (owned by @1)" -msgstr "Supporto per armatura (di proprietà di @1)" - -#: ../3d_armor_ui/init.lua -msgid "3d_armor_ui: Mod loaded but unused." -msgstr "3d_armor_ui: Mod caricato ma inutilizzato." - -#: ../3d_armor_ui/init.lua -msgid "3d Armor" -msgstr "Armatura 3D" - -#: ../3d_armor_ui/init.lua -msgid "Armor not initialized!" -msgstr "Armatura non inizializzata!" - -#: ../shields/init.lua -msgid "Admin Shield" -msgstr "Scudo dell'amministratrice/tore" - -#: ../shields/init.lua -msgid "Wooden Shield" -msgstr "Scudo di legno" - -#: ../shields/init.lua -msgid "Enhanced Wood Shield" -msgstr "Scudo di legno migliorato" - -#: ../shields/init.lua -msgid "Cactus Shield" -msgstr "Scudo di cactus" - -#: ../shields/init.lua -msgid "Enhanced Cactus Shield" -msgstr "Scudo di cactus migliorato" - -#: ../shields/init.lua -msgid "Steel Shield" -msgstr "Scudo di acciaio" - -#: ../shields/init.lua -msgid "Bronze Shield" -msgstr "Scudo di bronzo" - -#: ../shields/init.lua -msgid "Diamond Shield" -msgstr "Scudo di diamante" - -#: ../shields/init.lua -msgid "Gold Shield" -msgstr "Scudo d'oro" - -#: ../shields/init.lua -msgid "Mithril Shield" -msgstr "Scudo di mithril" - -#: ../shields/init.lua -msgid "Crystal Shield" -msgstr "Scudo di cristallo" diff --git a/mods/3d_armor/3d_armor/locale/ms.po b/mods/3d_armor/3d_armor/locale/ms.po deleted file mode 100644 index 518e4380..00000000 --- a/mods/3d_armor/3d_armor/locale/ms.po +++ /dev/null @@ -1,296 +0,0 @@ -# Malay translation for 3D ARMOR MOD -# Copyright (C) 2018 by Stuart Jones -# This file is distributed under the same license as the 3D ARMOR MOD package. -# MuhdNurHidayat (MNH48) , 2018. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-23 21:21+0200\n" -"PO-Revision-Date: 2018-07-23 21:30+0200\n" -"Last-Translator: MuhdNurHidayat (MNH48) \n" -"Language-Team: \n" -"Language: ms\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.6\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player reference is nil @1" -msgstr "3d_armor: Rujukan pemain tiada nilai @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player name is nil @1" -msgstr "3d_armor: Nama pemain tiada nilai @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Detached armor inventory is nil @1" -msgstr "3d_armor: Inventori perisai terpisah tiada nilai @1" - -#: ../3d_armor/armor.lua -msgid "Admin Helmet" -msgstr "Helmet Pentadbir" - -#: ../3d_armor/armor.lua -msgid "Admin Chestplate" -msgstr "Perisai Dada Pentadbir" - -#: ../3d_armor/armor.lua -msgid "Admin Leggings" -msgstr "Perisai Kaki Pentadbir" - -#: ../3d_armor/armor.lua -msgid "Admin Boots" -msgstr "But Pentadbir" - -#: ../3d_armor/armor.lua -msgid "Wood Helmet" -msgstr "Helmet Kayu" - -#: ../3d_armor/armor.lua -msgid "Wood Chestplate" -msgstr "Perisai Dada Kayu" - -#: ../3d_armor/armor.lua -msgid "Wood Leggings" -msgstr "Perisai Kaki Kayu" - -#: ../3d_armor/armor.lua -msgid "Wood Boots" -msgstr "But Kayu" - -#: ../3d_armor/armor.lua -msgid "Cactus Helmet" -msgstr "Helmet Kaktus" - -#: ../3d_armor/armor.lua -msgid "Cactus Chestplate" -msgstr "Perisai Dada Kaktus" - -#: ../3d_armor/armor.lua -msgid "Cactus Leggings" -msgstr "Perisai Kaki Kaktus" - -#: ../3d_armor/armor.lua -msgid "Cactus Boots" -msgstr "But Kaktus" - -#: ../3d_armor/armor.lua -msgid "Steel Helmet" -msgstr "Helmet Keluli" - -#: ../3d_armor/armor.lua -msgid "Steel Chestplate" -msgstr "Perisai Dada Keluli" - -#: ../3d_armor/armor.lua -msgid "Steel Leggings" -msgstr "Perisai Kaki Keluli" - -#: ../3d_armor/armor.lua -msgid "Steel Boots" -msgstr "But Keluli" - -#: ../3d_armor/armor.lua -msgid "Bronze Helmet" -msgstr "Helmet Gangsa" - -#: ../3d_armor/armor.lua -msgid "Bronze Chestplate" -msgstr "Perisai Dada Gangsa" - -#: ../3d_armor/armor.lua -msgid "Bronze Leggings" -msgstr "Perisai Kaki Gangsa" - -#: ../3d_armor/armor.lua -msgid "Bronze Boots" -msgstr "But Gangsa" - -# 'Diamond' should be translated as 'intan' because the more common word 'berlian' is only specifically used for the gemstone diamond. -#: ../3d_armor/armor.lua -msgid "Diamond Helmet" -msgstr "Helmet Intan" - -#: ../3d_armor/armor.lua -msgid "Diamond Chestplate" -msgstr "Perisai Dada Intan" - -#: ../3d_armor/armor.lua -msgid "Diamond Leggings" -msgstr "Perisai Kaki Intan" - -#: ../3d_armor/armor.lua -msgid "Diamond Boots" -msgstr "But Intan" - -#: ../3d_armor/armor.lua -msgid "Gold Helmet" -msgstr "Helmet Emas" - -#: ../3d_armor/armor.lua -msgid "Gold Chestplate" -msgstr "Perisai Dada Emas" - -#: ../3d_armor/armor.lua -msgid "Gold Leggings" -msgstr "Perisai Kaki Emas" - -#: ../3d_armor/armor.lua -msgid "Gold Boots" -msgstr "But Emas" - -#: ../3d_armor/armor.lua -msgid "Mithril Helmet" -msgstr "Helmet Mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Chestplate" -msgstr "Perisai Dada Mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Leggings" -msgstr "Perisai Kaki Mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Boots" -msgstr "But Mithril" - -#: ../3d_armor/armor.lua -msgid "Crystal Helmet" -msgstr "Helmet Kristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Chestplate" -msgstr "Perisai Dada Kristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Leggings" -msgstr "Perisai Kaki Kristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Boots" -msgstr "But Kristal" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Radiation" -msgstr "Radiasi" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Level" -msgstr "Tahap" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Heal" -msgstr "Pulih" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Fire" -msgstr "Api" - -#: ../3d_armor/init.lua -msgid "Your @1 got destroyed!" -msgstr "@1 anda telah musnah!" - -#: ../3d_armor/init.lua -msgid "3d_armor: Failed to initialize player" -msgstr "3d_armor: Gagal mengasalkan pemain" - -#: ../3d_armor/init.lua -msgid "[3d_armor] Fire Nodes disabled" -msgstr "[3d_armor] Nod-nod Api dilumpuhkan" - -#: ../3d_armor_ip/init.lua -msgid "3d_armor_ip: Mod loaded but unused." -msgstr "3d_armor_ip: Mods dimuatkan tetapi tidak digunakan." - -#: ../3d_armor_ip/init.lua -msgid "Back" -msgstr "Kembali" - -#: ../3d_armor_ip/init.lua ../3d_armor_sfinv/init.lua ../3d_armor_ui/init.lua -msgid "Armor" -msgstr "Perisai" - -#: ../3d_armor_sfinv/init.lua -msgid "3d_armor_sfinv: Mod loaded but unused." -msgstr "3d_armor_sfinv: Mods dimuatkan tetapi tidak digunakan." - -#: ../3d_armor_stand/init.lua -msgid "Armor stand top" -msgstr "Bhg atas dirian perisai" - -#: ../3d_armor_stand/init.lua -msgid "Armor stand" -msgstr "Dirian perisai" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand" -msgstr "Dirian Perisai" - -#: ../3d_armor_stand/init.lua -msgid "Locked Armor stand" -msgstr "Dirian perisai Berkunci" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand (owned by @1)" -msgstr "Dirian Perisai (milik @1)" - -#: ../3d_armor_ui/init.lua -msgid "3d_armor_ui: Mod loaded but unused." -msgstr "3d_armor_ui: Mods dimuatkan tetapi tidak digunakan." - -#: ../3d_armor_ui/init.lua -msgid "3d Armor" -msgstr "Perisai 3d" - -#: ../3d_armor_ui/init.lua -msgid "Armor not initialized!" -msgstr "Perisai tidak diasalkan!" - -#: ../shields/init.lua -msgid "Admin Shield" -msgstr "Perisai Pegang Pentadbir" - -#: ../shields/init.lua -msgid "Wooden Shield" -msgstr "Perisai Pegang Kayu" - -#: ../shields/init.lua -msgid "Enhanced Wood Shield" -msgstr "Perisai Pegang Kayu Kukuh" - -#: ../shields/init.lua -msgid "Cactus Shield" -msgstr "Perisai Pegang Kaktus" - -#: ../shields/init.lua -msgid "Enhanced Cactus Shield" -msgstr "Perisai Pegang Kaktus Kukuh" - -#: ../shields/init.lua -msgid "Steel Shield" -msgstr "Perisai Pegang Keluli" - -#: ../shields/init.lua -msgid "Bronze Shield" -msgstr "Perisai Pegang Gangsa" - -#: ../shields/init.lua -msgid "Diamond Shield" -msgstr "Perisai Pegang Intan" - -#: ../shields/init.lua -msgid "Gold Shield" -msgstr "Perisai Pegang Emas" - -#: ../shields/init.lua -msgid "Mithril Shield" -msgstr "Perisai Pegang Mithril" - -#: ../shields/init.lua -msgid "Crystal Shield" -msgstr "Perisai Pegang Kristal" diff --git a/mods/3d_armor/3d_armor/locale/pt.po b/mods/3d_armor/3d_armor/locale/pt.po deleted file mode 100644 index 01666372..00000000 --- a/mods/3d_armor/3d_armor/locale/pt.po +++ /dev/null @@ -1,295 +0,0 @@ -# LANGUAGE translation for 3D ARMOR MOD -# Copyright (C) 2018 by Stuart Jones -# This file is distributed under the same license as the 3D ARMOR MOD package. -# BrunoMine , 2018. -# -msgid "" -msgstr "" -"Project-Id-Version: 3d_armor\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-23 21:24+0200\n" -"PO-Revision-Date: 2018-11-08 13:12-0200\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.6\n" -"Last-Translator: BrunoMine \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"Language: pt\n" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player reference is nil @1" -msgstr "3d_armor: Referência Jogador é nula @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player name is nil @1" -msgstr "3d_armor: Nome de jogador é nulo @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Detached armor inventory is nil @1" -msgstr "3d_armor: Inventario avulso de armadura é nulo @1" - -#: ../3d_armor/armor.lua -msgid "Admin Helmet" -msgstr "Capacete de Administrador" - -#: ../3d_armor/armor.lua -msgid "Admin Chestplate" -msgstr "Peitoral de Administrador" - -#: ../3d_armor/armor.lua -msgid "Admin Leggings" -msgstr "Calças de Administrador" - -#: ../3d_armor/armor.lua -msgid "Admin Boots" -msgstr "Botas de Administrador" - -#: ../3d_armor/armor.lua -msgid "Wood Helmet" -msgstr "Capacete de Madeira" - -#: ../3d_armor/armor.lua -msgid "Wood Chestplate" -msgstr "Peitoral de Madeira" - -#: ../3d_armor/armor.lua -msgid "Wood Leggings" -msgstr "Calças de Madeira" - -#: ../3d_armor/armor.lua -msgid "Wood Boots" -msgstr "Botas de Madeira" - -#: ../3d_armor/armor.lua -msgid "Cactus Helmet" -msgstr "Capacete de Cacto" - -#: ../3d_armor/armor.lua -msgid "Cactus Chestplate" -msgstr "Peitoral de Cacto" - -#: ../3d_armor/armor.lua -msgid "Cactus Leggings" -msgstr "Calças de Cacto" - -#: ../3d_armor/armor.lua -msgid "Cactus Boots" -msgstr "Botas de Madeira" - -#: ../3d_armor/armor.lua -msgid "Steel Helmet" -msgstr "Capacete de Aço" - -#: ../3d_armor/armor.lua -msgid "Steel Chestplate" -msgstr "Peitoral de Aço" - -#: ../3d_armor/armor.lua -msgid "Steel Leggings" -msgstr "Calças de Aço" - -#: ../3d_armor/armor.lua -msgid "Steel Boots" -msgstr "Botas de Aço" - -#: ../3d_armor/armor.lua -msgid "Bronze Helmet" -msgstr "Capacete de Bronze" - -#: ../3d_armor/armor.lua -msgid "Bronze Chestplate" -msgstr "Peitoral de Bronze" - -#: ../3d_armor/armor.lua -msgid "Bronze Leggings" -msgstr "Calças de Bronze" - -#: ../3d_armor/armor.lua -msgid "Bronze Boots" -msgstr "Botas de Bronze" - -#: ../3d_armor/armor.lua -msgid "Diamond Helmet" -msgstr "Capacete de Diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Chestplate" -msgstr "Peitoral de Diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Leggings" -msgstr "Calças de Diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Boots" -msgstr "Botas de Diamante" - -#: ../3d_armor/armor.lua -msgid "Gold Helmet" -msgstr "Capacete de Ouro" - -#: ../3d_armor/armor.lua -msgid "Gold Chestplate" -msgstr "Peitoral de Ouro" - -#: ../3d_armor/armor.lua -msgid "Gold Leggings" -msgstr "Calças de Ouro" - -#: ../3d_armor/armor.lua -msgid "Gold Boots" -msgstr "Botas de Ouro" - -#: ../3d_armor/armor.lua -msgid "Mithril Helmet" -msgstr "Capacete de Mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Chestplate" -msgstr "Peitoral de Mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Leggings" -msgstr "Calças de Mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Boots" -msgstr "Botas de Mithril" - -#: ../3d_armor/armor.lua -msgid "Crystal Helmet" -msgstr "Capacete de Cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Chestplate" -msgstr "Peitoral de Cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Leggings" -msgstr "Calças de Cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Boots" -msgstr "Botas de Cristal" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Radiation" -msgstr "Radiação" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Level" -msgstr "Nível" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Heal" -msgstr "Saúde" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Fire" -msgstr "Fogo" - -#: ../3d_armor/init.lua -msgid "Your @1 got destroyed!" -msgstr "@1 foi destruído(a)!" - -#: ../3d_armor/init.lua -msgid "3d_armor: Failed to initialize player" -msgstr "3d_armor: Falha ao inicializar jogador" - -#: ../3d_armor/init.lua -msgid "[3d_armor] Fire Nodes disabled" -msgstr "[3d_armor] Nodes de gofo desabilitados" - -#: ../3d_armor_ip/init.lua -msgid "3d_armor_ip: Mod loaded but unused." -msgstr "3d_armor_ip: Mod carregado mas inoperante." - -#: ../3d_armor_ip/init.lua -msgid "Back" -msgstr "Voltar" - -#: ../3d_armor_ip/init.lua ../3d_armor_sfinv/init.lua ../3d_armor_ui/init.lua -msgid "Armor" -msgstr "Armadura" - -#: ../3d_armor_sfinv/init.lua -msgid "3d_armor_sfinv: Mod loaded but unused." -msgstr "3d_armor_sfinv: Mod carregado mas inoperante." - -#: ../3d_armor_stand/init.lua -msgid "Armor stand top" -msgstr "Topo de estande de armadura" - -#: ../3d_armor_stand/init.lua -msgid "Armor stand" -msgstr "Estande de armadura" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand" -msgstr "Estande de Armadura" - -#: ../3d_armor_stand/init.lua -msgid "Locked Armor stand" -msgstr "Estande de Armadura Trancada" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand (owned by @1)" -msgstr "Estande de Armadura (pertente a @1)" - -#: ../3d_armor_ui/init.lua -msgid "3d_armor_ui: Mod loaded but unused." -msgstr "3d_armor_ui: Mod carregado mas inoperante." - -#: ../3d_armor_ui/init.lua -msgid "3d Armor" -msgstr "3d Armor" - -#: ../3d_armor_ui/init.lua -msgid "Armor not initialized!" -msgstr "Armadura não inicializada!" - -#: ../shields/init.lua -msgid "Admin Shield" -msgstr "Escudo de Administrador" - -#: ../shields/init.lua -msgid "Wooden Shield" -msgstr "Escudo de Madeira" - -#: ../shields/init.lua -msgid "Enhanced Wood Shield" -msgstr "Escudo de Madeira Melhorado" - -#: ../shields/init.lua -msgid "Cactus Shield" -msgstr "Escudo de Cacto" - -#: ../shields/init.lua -msgid "Enhanced Cactus Shield" -msgstr "Escudo de Cacto Melhorado" - -#: ../shields/init.lua -msgid "Steel Shield" -msgstr "Escudo de Aço" - -#: ../shields/init.lua -msgid "Bronze Shield" -msgstr "Escudo de Bronze" - -#: ../shields/init.lua -msgid "Diamond Shield" -msgstr "Escudo de Diamante" - -#: ../shields/init.lua -msgid "Gold Shield" -msgstr "Escudo de Ouro" - -#: ../shields/init.lua -msgid "Mithril Shield" -msgstr "Escudo de Mithril" - -#: ../shields/init.lua -msgid "Crystal Shield" -msgstr "Escudo de Cristal" diff --git a/mods/3d_armor/3d_armor/locale/pt_BR.po b/mods/3d_armor/3d_armor/locale/pt_BR.po deleted file mode 100644 index b429d113..00000000 --- a/mods/3d_armor/3d_armor/locale/pt_BR.po +++ /dev/null @@ -1,295 +0,0 @@ -# LANGUAGE translation for 3D ARMOR MOD -# Copyright (C) 2018 by Stuart Jones -# This file is distributed under the same license as the 3D ARMOR MOD package. -# BrunoMine , 2018. -# -msgid "" -msgstr "" -"Project-Id-Version: 3d_armor\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-23 21:24+0200\n" -"PO-Revision-Date: 2018-11-08 13:12-0200\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.6\n" -"Last-Translator: BrunoMine \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"Language: pt_BR\n" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player reference is nil @1" -msgstr "3d_armor: Referência Jogador é nula @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player name is nil @1" -msgstr "3d_armor: Nome de jogador é nulo @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Detached armor inventory is nil @1" -msgstr "3d_armor: Inventario avulso de armadura é nulo @1" - -#: ../3d_armor/armor.lua -msgid "Admin Helmet" -msgstr "Capacete de Administrador" - -#: ../3d_armor/armor.lua -msgid "Admin Chestplate" -msgstr "Peitoral de Administrador" - -#: ../3d_armor/armor.lua -msgid "Admin Leggings" -msgstr "Calças de Administrador" - -#: ../3d_armor/armor.lua -msgid "Admin Boots" -msgstr "Botas de Administrador" - -#: ../3d_armor/armor.lua -msgid "Wood Helmet" -msgstr "Capacete de Madeira" - -#: ../3d_armor/armor.lua -msgid "Wood Chestplate" -msgstr "Peitoral de Madeira" - -#: ../3d_armor/armor.lua -msgid "Wood Leggings" -msgstr "Calças de Madeira" - -#: ../3d_armor/armor.lua -msgid "Wood Boots" -msgstr "Botas de Madeira" - -#: ../3d_armor/armor.lua -msgid "Cactus Helmet" -msgstr "Capacete de Cacto" - -#: ../3d_armor/armor.lua -msgid "Cactus Chestplate" -msgstr "Peitoral de Cacto" - -#: ../3d_armor/armor.lua -msgid "Cactus Leggings" -msgstr "Calças de Cacto" - -#: ../3d_armor/armor.lua -msgid "Cactus Boots" -msgstr "Botas de Madeira" - -#: ../3d_armor/armor.lua -msgid "Steel Helmet" -msgstr "Capacete de Aço" - -#: ../3d_armor/armor.lua -msgid "Steel Chestplate" -msgstr "Peitoral de Aço" - -#: ../3d_armor/armor.lua -msgid "Steel Leggings" -msgstr "Calças de Aço" - -#: ../3d_armor/armor.lua -msgid "Steel Boots" -msgstr "Botas de Aço" - -#: ../3d_armor/armor.lua -msgid "Bronze Helmet" -msgstr "Capacete de Bronze" - -#: ../3d_armor/armor.lua -msgid "Bronze Chestplate" -msgstr "Peitoral de Bronze" - -#: ../3d_armor/armor.lua -msgid "Bronze Leggings" -msgstr "Calças de Bronze" - -#: ../3d_armor/armor.lua -msgid "Bronze Boots" -msgstr "Botas de Bronze" - -#: ../3d_armor/armor.lua -msgid "Diamond Helmet" -msgstr "Capacete de Diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Chestplate" -msgstr "Peitoral de Diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Leggings" -msgstr "Calças de Diamante" - -#: ../3d_armor/armor.lua -msgid "Diamond Boots" -msgstr "Botas de Diamante" - -#: ../3d_armor/armor.lua -msgid "Gold Helmet" -msgstr "Capacete de Ouro" - -#: ../3d_armor/armor.lua -msgid "Gold Chestplate" -msgstr "Peitoral de Ouro" - -#: ../3d_armor/armor.lua -msgid "Gold Leggings" -msgstr "Calças de Ouro" - -#: ../3d_armor/armor.lua -msgid "Gold Boots" -msgstr "Botas de Ouro" - -#: ../3d_armor/armor.lua -msgid "Mithril Helmet" -msgstr "Capacete de Mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Chestplate" -msgstr "Peitoral de Mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Leggings" -msgstr "Calças de Mithril" - -#: ../3d_armor/armor.lua -msgid "Mithril Boots" -msgstr "Botas de Mithril" - -#: ../3d_armor/armor.lua -msgid "Crystal Helmet" -msgstr "Capacete de Cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Chestplate" -msgstr "Peitoral de Cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Leggings" -msgstr "Calças de Cristal" - -#: ../3d_armor/armor.lua -msgid "Crystal Boots" -msgstr "Botas de Cristal" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Radiation" -msgstr "Radiação" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Level" -msgstr "Nível" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Heal" -msgstr "Saúde" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Fire" -msgstr "Fogo" - -#: ../3d_armor/init.lua -msgid "Your @1 got destroyed!" -msgstr "@1 foi destruído(a)!" - -#: ../3d_armor/init.lua -msgid "3d_armor: Failed to initialize player" -msgstr "3d_armor: Falha ao inicializar jogador" - -#: ../3d_armor/init.lua -msgid "[3d_armor] Fire Nodes disabled" -msgstr "[3d_armor] Nodes de gofo desabilitados" - -#: ../3d_armor_ip/init.lua -msgid "3d_armor_ip: Mod loaded but unused." -msgstr "3d_armor_ip: Mod carregado mas inoperante." - -#: ../3d_armor_ip/init.lua -msgid "Back" -msgstr "Voltar" - -#: ../3d_armor_ip/init.lua ../3d_armor_sfinv/init.lua ../3d_armor_ui/init.lua -msgid "Armor" -msgstr "Armadura" - -#: ../3d_armor_sfinv/init.lua -msgid "3d_armor_sfinv: Mod loaded but unused." -msgstr "3d_armor_sfinv: Mod carregado mas inoperante." - -#: ../3d_armor_stand/init.lua -msgid "Armor stand top" -msgstr "Topo de estande de armadura" - -#: ../3d_armor_stand/init.lua -msgid "Armor stand" -msgstr "Estande de armadura" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand" -msgstr "Estande de Armadura" - -#: ../3d_armor_stand/init.lua -msgid "Locked Armor stand" -msgstr "Estande de Armadura Trancada" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand (owned by @1)" -msgstr "Estande de Armadura (pertente a @1)" - -#: ../3d_armor_ui/init.lua -msgid "3d_armor_ui: Mod loaded but unused." -msgstr "3d_armor_ui: Mod carregado mas inoperante." - -#: ../3d_armor_ui/init.lua -msgid "3d Armor" -msgstr "3d Armor" - -#: ../3d_armor_ui/init.lua -msgid "Armor not initialized!" -msgstr "Armadura não inicializada!" - -#: ../shields/init.lua -msgid "Admin Shield" -msgstr "Escudo de Administrador" - -#: ../shields/init.lua -msgid "Wooden Shield" -msgstr "Escudo de Madeira" - -#: ../shields/init.lua -msgid "Enhanced Wood Shield" -msgstr "Escudo de Madeira Melhorado" - -#: ../shields/init.lua -msgid "Cactus Shield" -msgstr "Escudo de Cacto" - -#: ../shields/init.lua -msgid "Enhanced Cactus Shield" -msgstr "Escudo de Cacto Melhorado" - -#: ../shields/init.lua -msgid "Steel Shield" -msgstr "Escudo de Aço" - -#: ../shields/init.lua -msgid "Bronze Shield" -msgstr "Escudo de Bronze" - -#: ../shields/init.lua -msgid "Diamond Shield" -msgstr "Escudo de Diamante" - -#: ../shields/init.lua -msgid "Gold Shield" -msgstr "Escudo de Ouro" - -#: ../shields/init.lua -msgid "Mithril Shield" -msgstr "Escudo de Mithril" - -#: ../shields/init.lua -msgid "Crystal Shield" -msgstr "Escudo de Cristal" diff --git a/mods/3d_armor/3d_armor/locale/ru.po b/mods/3d_armor/3d_armor/locale/ru.po deleted file mode 100644 index 4beee8a0..00000000 --- a/mods/3d_armor/3d_armor/locale/ru.po +++ /dev/null @@ -1,294 +0,0 @@ -# Russian translation for 3D ARMOR MOD -# Copyright (C) 2018 by Stuart Jones -# This file is distributed under the same license as the 3D ARMOR MOD package. -# CodeXP , 2018. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: 3d_armor\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-23 21:21+0200\n" -"PO-Revision-Date: 2018-07-23 21:30+0200\n" -"Last-Translator: CodeXP \n" -"Language-Team: \n" -"Language: ru\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player reference is nil @1" -msgstr "3d_armor: Ссылка игрока является nil @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player name is nil @1" -msgstr "3d_armor: Имя игрока является nil @1" - -#: ../3d_armor/api.lua -msgid "3d_armor: Detached armor inventory is nil @1" -msgstr "3d_armor: Отдельный инвентарь брони является nil @1" - -#: ../3d_armor/armor.lua -msgid "Admin Helmet" -msgstr "шлем админа" - -#: ../3d_armor/armor.lua -msgid "Admin Chestplate" -msgstr "бронежилет админа" - -#: ../3d_armor/armor.lua -msgid "Admin Leggings" -msgstr "гамаши админа" - -#: ../3d_armor/armor.lua -msgid "Admin Boots" -msgstr "ботинки админа" - -#: ../3d_armor/armor.lua -msgid "Wood Helmet" -msgstr "деревянный шлем" - -#: ../3d_armor/armor.lua -msgid "Wood Chestplate" -msgstr "деревянный бронежилет" - -#: ../3d_armor/armor.lua -msgid "Wood Leggings" -msgstr "деревянные гамаши" - -#: ../3d_armor/armor.lua -msgid "Wood Boots" -msgstr "деревянные ботинки" - -#: ../3d_armor/armor.lua -msgid "Cactus Helmet" -msgstr "кактусовый шлем" - -#: ../3d_armor/armor.lua -msgid "Cactus Chestplate" -msgstr "кактусовый бронежилет" - -#: ../3d_armor/armor.lua -msgid "Cactus Leggings" -msgstr "кактусовые гамаши" - -#: ../3d_armor/armor.lua -msgid "Cactus Boots" -msgstr "кактусовые ботинки" - -#: ../3d_armor/armor.lua -msgid "Steel Helmet" -msgstr "стальной шлем" - -#: ../3d_armor/armor.lua -msgid "Steel Chestplate" -msgstr "стальной бронежилет" - -#: ../3d_armor/armor.lua -msgid "Steel Leggings" -msgstr "стальные гамаши" - -#: ../3d_armor/armor.lua -msgid "Steel Boots" -msgstr "стальные ботинки" - -#: ../3d_armor/armor.lua -msgid "Bronze Helmet" -msgstr "бронзовый шлем" - -#: ../3d_armor/armor.lua -msgid "Bronze Chestplate" -msgstr "бронзовый бронежилет" - -#: ../3d_armor/armor.lua -msgid "Bronze Leggings" -msgstr "бронзовые гамаши" - -#: ../3d_armor/armor.lua -msgid "Bronze Boots" -msgstr "бронзовые ботинки" - -#: ../3d_armor/armor.lua -msgid "Diamond Helmet" -msgstr "алмазный шлем" - -#: ../3d_armor/armor.lua -msgid "Diamond Chestplate" -msgstr "алмазный бронежилет" - -#: ../3d_armor/armor.lua -msgid "Diamond Leggings" -msgstr "алмазные гамаши" - -#: ../3d_armor/armor.lua -msgid "Diamond Boots" -msgstr "алмазные ботинки" - -#: ../3d_armor/armor.lua -msgid "Gold Helmet" -msgstr "золотой шлем" - -#: ../3d_armor/armor.lua -msgid "Gold Chestplate" -msgstr "золотой бронежилет" - -#: ../3d_armor/armor.lua -msgid "Gold Leggings" -msgstr "золотые гамаши" - -#: ../3d_armor/armor.lua -msgid "Gold Boots" -msgstr "золотые ботинки" - -#: ../3d_armor/armor.lua -msgid "Mithril Helmet" -msgstr "мифриловый шлем" - -#: ../3d_armor/armor.lua -msgid "Mithril Chestplate" -msgstr "мифриловый бронежилет" - -#: ../3d_armor/armor.lua -msgid "Mithril Leggings" -msgstr "мифриловые гамаши" - -#: ../3d_armor/armor.lua -msgid "Mithril Boots" -msgstr "мифриловые ботинки" - -#: ../3d_armor/armor.lua -msgid "Crystal Helmet" -msgstr "кристалловый шлем" - -#: ../3d_armor/armor.lua -msgid "Crystal Chestplate" -msgstr "кристалловый бронежилет" - -#: ../3d_armor/armor.lua -msgid "Crystal Leggings" -msgstr "кристалловые гамаши" - -#: ../3d_armor/armor.lua -msgid "Crystal Boots" -msgstr "кристалловые ботинки" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Radiation" -msgstr "излучение" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Level" -msgstr "уровень" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Heal" -msgstr "исцеление" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Fire" -msgstr "огонь" - -#: ../3d_armor/init.lua -msgid "Your @1 got destroyed!" -msgstr "твой(и) @1 был(и) разрушен(ы)!" - -#: ../3d_armor/init.lua -msgid "3d_armor: Failed to initialize player" -msgstr "3d_armor: не смог подготовить игрока" - -#: ../3d_armor/init.lua -msgid "[3d_armor] Fire Nodes disabled" -msgstr "[3d_armor] блоки огня отключены" - -#: ../3d_armor_ip/init.lua -msgid "3d_armor_ip: Mod loaded but unused." -msgstr "3d_armor_ip: мод загружен но не используется." - -#: ../3d_armor_ip/init.lua -msgid "Back" -msgstr "назад" - -#: ../3d_armor_ip/init.lua ../3d_armor_sfinv/init.lua ../3d_armor_ui/init.lua -msgid "Armor" -msgstr "бронь" - -#: ../3d_armor_sfinv/init.lua -msgid "3d_armor_sfinv: Mod loaded but unused." -msgstr "3d_armor_sfinv: мод загружен но не используется." - -#: ../3d_armor_stand/init.lua -msgid "Armor stand top" -msgstr "стойка для брони (верх)" - -#: ../3d_armor_stand/init.lua -msgid "Armor stand" -msgstr "стойка для брони" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand" -msgstr "стойка для брони" - -#: ../3d_armor_stand/init.lua -msgid "Locked Armor stand" -msgstr "защищенная стойка для брони" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand (owned by @1)" -msgstr "стойка для брони (принадлежит @1)" - -#: ../3d_armor_ui/init.lua -msgid "3d_armor_ui: Mod loaded but unused." -msgstr "3d_armor_ui: мод загружен но не используется." - -#: ../3d_armor_ui/init.lua -msgid "3d Armor" -msgstr "3D бронь" - -#: ../3d_armor_ui/init.lua -msgid "Armor not initialized!" -msgstr "бронь не подготовлена!" - -#: ../shields/init.lua -msgid "Admin Shield" -msgstr "щит админа" - -#: ../shields/init.lua -msgid "Wooden Shield" -msgstr "деревянный щит" - -#: ../shields/init.lua -msgid "Enhanced Wood Shield" -msgstr "улучшенный деревянный щит" - -#: ../shields/init.lua -msgid "Cactus Shield" -msgstr "кактусный щит" - -#: ../shields/init.lua -msgid "Enhanced Cactus Shield" -msgstr "улучшенный кактусный щит" - -#: ../shields/init.lua -msgid "Steel Shield" -msgstr "стальной щит" - -#: ../shields/init.lua -msgid "Bronze Shield" -msgstr "бронзовый щит" - -#: ../shields/init.lua -msgid "Diamond Shield" -msgstr "алмазный щит" - -#: ../shields/init.lua -msgid "Gold Shield" -msgstr "золотой щит" - -#: ../shields/init.lua -msgid "Mithril Shield" -msgstr "мифриловый щит" - -#: ../shields/init.lua -msgid "Crystal Shield" -msgstr "кристалловый щит" diff --git a/mods/3d_armor/3d_armor/locale/template.pot b/mods/3d_armor/3d_armor/locale/template.pot deleted file mode 100644 index 0b0222c6..00000000 --- a/mods/3d_armor/3d_armor/locale/template.pot +++ /dev/null @@ -1,294 +0,0 @@ -# LANGUAGE translation for 3D ARMOR MOD -# Copyright (C) 2018 by Stuart Jones -# This file is distributed under the same license as the 3D ARMOR MOD package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-23 21:24+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player reference is nil @1" -msgstr "" - -#: ../3d_armor/api.lua -msgid "3d_armor: Player name is nil @1" -msgstr "" - -#: ../3d_armor/api.lua -msgid "3d_armor: Detached armor inventory is nil @1" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Admin Helmet" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Admin Chestplate" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Admin Leggings" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Admin Boots" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Wood Helmet" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Wood Chestplate" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Wood Leggings" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Wood Boots" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Cactus Helmet" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Cactus Chestplate" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Cactus Leggings" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Cactus Boots" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Steel Helmet" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Steel Chestplate" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Steel Leggings" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Steel Boots" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Bronze Helmet" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Bronze Chestplate" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Bronze Leggings" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Bronze Boots" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Diamond Helmet" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Diamond Chestplate" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Diamond Leggings" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Diamond Boots" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Gold Helmet" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Gold Chestplate" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Gold Leggings" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Gold Boots" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Mithril Helmet" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Mithril Chestplate" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Mithril Leggings" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Mithril Boots" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Crystal Helmet" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Crystal Chestplate" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Crystal Leggings" -msgstr "" - -#: ../3d_armor/armor.lua -msgid "Crystal Boots" -msgstr "" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Radiation" -msgstr "" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Level" -msgstr "" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Heal" -msgstr "" - -#: ../3d_armor/init.lua ../3d_armor_ui/init.lua -msgid "Fire" -msgstr "" - -#: ../3d_armor/init.lua -msgid "Your @1 got destroyed!" -msgstr "" - -#: ../3d_armor/init.lua -msgid "3d_armor: Failed to initialize player" -msgstr "" - -#: ../3d_armor/init.lua -msgid "[3d_armor] Fire Nodes disabled" -msgstr "" - -#: ../3d_armor_ip/init.lua -msgid "3d_armor_ip: Mod loaded but unused." -msgstr "" - -#: ../3d_armor_ip/init.lua -msgid "Back" -msgstr "" - -#: ../3d_armor_ip/init.lua ../3d_armor_sfinv/init.lua ../3d_armor_ui/init.lua -msgid "Armor" -msgstr "" - -#: ../3d_armor_sfinv/init.lua -msgid "3d_armor_sfinv: Mod loaded but unused." -msgstr "" - -#: ../3d_armor_stand/init.lua -msgid "Armor stand top" -msgstr "" - -#: ../3d_armor_stand/init.lua -msgid "Armor stand" -msgstr "" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand" -msgstr "" - -#: ../3d_armor_stand/init.lua -msgid "Locked Armor stand" -msgstr "" - -#: ../3d_armor_stand/init.lua -msgid "Armor Stand (owned by @1)" -msgstr "" - -#: ../3d_armor_ui/init.lua -msgid "3d_armor_ui: Mod loaded but unused." -msgstr "" - -#: ../3d_armor_ui/init.lua -msgid "3d Armor" -msgstr "" - -#: ../3d_armor_ui/init.lua -msgid "Armor not initialized!" -msgstr "" - -#: ../shields/init.lua -msgid "Admin Shield" -msgstr "" - -#: ../shields/init.lua -msgid "Wooden Shield" -msgstr "" - -#: ../shields/init.lua -msgid "Enhanced Wood Shield" -msgstr "" - -#: ../shields/init.lua -msgid "Cactus Shield" -msgstr "" - -#: ../shields/init.lua -msgid "Enhanced Cactus Shield" -msgstr "" - -#: ../shields/init.lua -msgid "Steel Shield" -msgstr "" - -#: ../shields/init.lua -msgid "Bronze Shield" -msgstr "" - -#: ../shields/init.lua -msgid "Diamond Shield" -msgstr "" - -#: ../shields/init.lua -msgid "Gold Shield" -msgstr "" - -#: ../shields/init.lua -msgid "Mithril Shield" -msgstr "" - -#: ../shields/init.lua -msgid "Crystal Shield" -msgstr "" diff --git a/mods/3d_armor/3d_armor/locale/template.txt b/mods/3d_armor/3d_armor/locale/template.txt new file mode 100644 index 00000000..cedd538d --- /dev/null +++ b/mods/3d_armor/3d_armor/locale/template.txt @@ -0,0 +1,58 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1= +3d_armor: Player name is nil @1= +3d_armor: Player reference is nil @1= + +### armor.lua ### + +Admin Boots= +Admin Chestplate= +Admin Helmet= +Admin Leggings= +Bronze Boots= +Bronze Chestplate= +Bronze Helmet= +Bronze Leggings= +Cactus Boots= +Cactus Chestplate= +Cactus Helmet= +Cactus Leggings= +Crystal Boots= +Crystal Chestplate= +Crystal Helmet= +Crystal Leggings= +Diamond Boots= +Diamond Chestplate= +Diamond Helmet= +Diamond Leggings= +Gold Boots= +Gold Chestplate= +Gold Helmet= +Gold Leggings= +Mithril Boots= +Mithril Chestplate= +Mithril Helmet= +Mithril Leggings= +Steel Boots= +Steel Chestplate= +Steel Helmet= +Steel Leggings= +Wood Boots= +Wood Chestplate= +Wood Helmet= +Wood Leggings= + +### init.lua ### + +3d_armor: Failed to initialize player= +Fire= +Heal= +Level= +Radiation= +Your @1 got destroyed!= +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled= diff --git a/mods/3d_armor/3d_armor/mod.conf b/mods/3d_armor/3d_armor/mod.conf index 56f79738..311adb5c 100644 --- a/mods/3d_armor/3d_armor/mod.conf +++ b/mods/3d_armor/3d_armor/mod.conf @@ -1,4 +1,4 @@ name = 3d_armor depends = default -optional_depends = player_monoids, armor_monoid, pova, fire, ethereal, bakedclay, intllib +optional_depends = player_monoids, armor_monoid, pova, fire, ethereal, bakedclay description = Adds craftable armor that is visible to other players. diff --git a/mods/3d_armor/3d_armor_ip/init.lua b/mods/3d_armor/3d_armor_ip/init.lua index 7701a707..f0612004 100644 --- a/mods/3d_armor/3d_armor_ip/init.lua +++ b/mods/3d_armor/3d_armor_ip/init.lua @@ -1,5 +1,5 @@ -- support for i18n -local S = armor_i18n.gettext +local S = minetest.get_translator(minetest.get_current_modname()) local F = minetest.formspec_escape if not minetest.global_exists("inventory_plus") then diff --git a/mods/3d_armor/3d_armor_ip/locale/3d_armor_ip.fr.tr b/mods/3d_armor/3d_armor_ip/locale/3d_armor_ip.fr.tr new file mode 100644 index 00000000..5f540b12 --- /dev/null +++ b/mods/3d_armor/3d_armor_ip/locale/3d_armor_ip.fr.tr @@ -0,0 +1,8 @@ +# textdomain: 3d_armor_ip + + +### init.lua ### + +3d_armor_ip: Mod loaded but unused.=3d_armor_ip : Mod chargé mais inutilisé. +Armor=Armure +Back=Retour diff --git a/mods/3d_armor/3d_armor_ip/locale/template.txt b/mods/3d_armor/3d_armor_ip/locale/template.txt new file mode 100644 index 00000000..133bce8d --- /dev/null +++ b/mods/3d_armor/3d_armor_ip/locale/template.txt @@ -0,0 +1,8 @@ +# textdomain: 3d_armor_ip + + +### init.lua ### + +3d_armor_ip: Mod loaded but unused.= +Armor= +Back= diff --git a/mods/3d_armor/3d_armor_sfinv/init.lua b/mods/3d_armor/3d_armor_sfinv/init.lua index a9371278..830ebbcb 100644 --- a/mods/3d_armor/3d_armor_sfinv/init.lua +++ b/mods/3d_armor/3d_armor_sfinv/init.lua @@ -1,5 +1,5 @@ -- support for i18n -local S = armor_i18n.gettext +local S = minetest.get_translator(minetest.get_current_modname()) if not minetest.global_exists("sfinv") then minetest.log("warning", S("3d_armor_sfinv: Mod loaded but unused.")) diff --git a/mods/3d_armor/3d_armor_sfinv/locale/3d_armor_sfinv.fr.tr b/mods/3d_armor/3d_armor_sfinv/locale/3d_armor_sfinv.fr.tr new file mode 100644 index 00000000..f25bd115 --- /dev/null +++ b/mods/3d_armor/3d_armor_sfinv/locale/3d_armor_sfinv.fr.tr @@ -0,0 +1,7 @@ +# textdomain: 3d_armor_sfinv + + +### init.lua ### + +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv : Mod chargé mais inutilisé. +Armor=Armure diff --git a/mods/3d_armor/3d_armor_sfinv/locale/template.txt b/mods/3d_armor/3d_armor_sfinv/locale/template.txt new file mode 100644 index 00000000..a3f01b5c --- /dev/null +++ b/mods/3d_armor/3d_armor_sfinv/locale/template.txt @@ -0,0 +1,7 @@ +# textdomain: 3d_armor_sfinv + + +### init.lua ### + +3d_armor_sfinv: Mod loaded but unused.= +Armor= diff --git a/mods/3d_armor/3d_armor_stand/init.lua b/mods/3d_armor/3d_armor_stand/init.lua index ab4549b7..743ab3ad 100644 --- a/mods/3d_armor/3d_armor_stand/init.lua +++ b/mods/3d_armor/3d_armor_stand/init.lua @@ -1,5 +1,5 @@ -- support for i18n -local S = armor_i18n.gettext +local S = minetest.get_translator(minetest.get_current_modname()) local armor_stand_formspec = "size[8,7]" .. default.gui_bg .. diff --git a/mods/3d_armor/3d_armor_stand/locale/3d_armor_stand.fr.tr b/mods/3d_armor/3d_armor_stand/locale/3d_armor_stand.fr.tr new file mode 100644 index 00000000..7d4cd381 --- /dev/null +++ b/mods/3d_armor/3d_armor_stand/locale/3d_armor_stand.fr.tr @@ -0,0 +1,10 @@ +# textdomain: 3d_armor_stand + + +### init.lua ### + +Armor Stand=Support d'armure +Armor Stand (owned by @1)=Support d'armure (propriété de @1) +Armor stand=Support d'armure +Armor stand top=Haut de support d'armure +Locked Armor stand=Support d'armure verrouillé diff --git a/mods/3d_armor/3d_armor_stand/locale/template.txt b/mods/3d_armor/3d_armor_stand/locale/template.txt new file mode 100644 index 00000000..25befcb7 --- /dev/null +++ b/mods/3d_armor/3d_armor_stand/locale/template.txt @@ -0,0 +1,10 @@ +# textdomain: 3d_armor_stand + + +### init.lua ### + +Armor Stand= +Armor Stand (owned by @1)= +Armor stand= +Armor stand top= +Locked Armor stand= diff --git a/mods/3d_armor/3d_armor_ui/init.lua b/mods/3d_armor/3d_armor_ui/init.lua index 41eec7bb..2a6f6548 100644 --- a/mods/3d_armor/3d_armor_ui/init.lua +++ b/mods/3d_armor/3d_armor_ui/init.lua @@ -1,5 +1,5 @@ -- support for i18n -local S = armor_i18n.gettext +local S = minetest.get_translator(minetest.get_current_modname()) local F = minetest.formspec_escape local has_technic = minetest.get_modpath("technic") ~= nil diff --git a/mods/3d_armor/3d_armor_ui/locale/3d_armor_ui.fr.tr b/mods/3d_armor/3d_armor_ui/locale/3d_armor_ui.fr.tr new file mode 100644 index 00000000..b7538f6c --- /dev/null +++ b/mods/3d_armor/3d_armor_ui/locale/3d_armor_ui.fr.tr @@ -0,0 +1,13 @@ +# textdomain: 3d_armor_ui + + +### init.lua ### + +3d Armor=Armure 3d +3d_armor_ui: Mod loaded but unused.=3d_armor_ui : Mod chargé mais inutilisé. +Armor=Armure +Armor not initialized!=Armure non initialisée ! +Fire=Feu +Heal=Soins +Level=Niveau +Radiation=Radiation diff --git a/mods/3d_armor/3d_armor_ui/locale/template.txt b/mods/3d_armor/3d_armor_ui/locale/template.txt new file mode 100644 index 00000000..be95c086 --- /dev/null +++ b/mods/3d_armor/3d_armor_ui/locale/template.txt @@ -0,0 +1,13 @@ +# textdomain: 3d_armor_ui + + +### init.lua ### + +3d Armor= +3d_armor_ui: Mod loaded but unused.= +Armor= +Armor not initialized!= +Fire= +Heal= +Level= +Radiation= diff --git a/mods/3d_armor/shields/init.lua b/mods/3d_armor/shields/init.lua index 754b0935..4def1c54 100644 --- a/mods/3d_armor/shields/init.lua +++ b/mods/3d_armor/shields/init.lua @@ -1,5 +1,5 @@ -- support for i18n -local S = armor_i18n.gettext +local S = minetest.get_translator(minetest.get_current_modname()) local disable_sounds = minetest.settings:get_bool("shields_disable_sounds") local function play_sound_effect(player, name) diff --git a/mods/3d_armor/shields/locale/shields.fr.tr b/mods/3d_armor/shields/locale/shields.fr.tr new file mode 100644 index 00000000..730c9bf2 --- /dev/null +++ b/mods/3d_armor/shields/locale/shields.fr.tr @@ -0,0 +1,16 @@ +# textdomain: shields + + +### init.lua ### + +Admin Shield=Bouclier d'admin +Bronze Shield=Bouclier en bronze +Cactus Shield=Bouclier en cactus +Crystal Shield=Bouclier en cristal +Diamond Shield=Bouclier en diamant +Enhanced Cactus Shield=Bouclier en cactus amélioré +Enhanced Wood Shield=Bouclier en bois amélioré +Gold Shield=Bouclier en or +Mithril Shield=Bouclier en mithril +Steel Shield=Bouclier en acier +Wooden Shield=Bouclier en bois diff --git a/mods/3d_armor/shields/locale/template.txt b/mods/3d_armor/shields/locale/template.txt new file mode 100644 index 00000000..ecaffd7b --- /dev/null +++ b/mods/3d_armor/shields/locale/template.txt @@ -0,0 +1,16 @@ +# textdomain: shields + + +### init.lua ### + +Admin Shield= +Bronze Shield= +Cactus Shield= +Crystal Shield= +Diamond Shield= +Enhanced Cactus Shield= +Enhanced Wood Shield= +Gold Shield= +Mithril Shield= +Steel Shield= +Wooden Shield= diff --git a/mods/3d_armor/wieldview/README.txt b/mods/3d_armor/wieldview/README.txt index ffa5ef0c..3a8b6406 100644 --- a/mods/3d_armor/wieldview/README.txt +++ b/mods/3d_armor/wieldview/README.txt @@ -21,3 +21,7 @@ Wield image transformation: To apply a simple transformation to the item in hand, add the group “wieldview_transform” to the item definition. The group rating equals one of the numbers used for the [transform texture modifier of the Lua API. + +Disabling the feature in-game: If you want to hide the wielded item +you can add an INT metadata to the player called "show_wielded_item" and set +it to 2 (any other value will show the wielded item again). diff --git a/mods/3d_armor/wieldview/init.lua b/mods/3d_armor/wieldview/init.lua index 7f68732d..f0edeacb 100644 --- a/mods/3d_armor/wieldview/init.lua +++ b/mods/3d_armor/wieldview/init.lua @@ -54,6 +54,9 @@ wieldview.update_wielded_item = function(self, player) return end if self.wielded_item[name] then + if player:get_meta():get_int("show_wielded_item") == 2 then + item = "" + end if self.wielded_item[name] == item then return end diff --git a/mods/basic_materials/.luacheckrc b/mods/basic_materials/.luacheckrc new file mode 100644 index 00000000..55879b03 --- /dev/null +++ b/mods/basic_materials/.luacheckrc @@ -0,0 +1,30 @@ +std = "lua51+minetest" +unused_args = false +allow_defined_top = true +max_line_length = 999 + +stds.minetest = { + read_globals = { + "DIR_DELIM", + "minetest", + "core", + "dump", + "vector", + "nodeupdate", + "VoxelManip", + "VoxelArea", + "PseudoRandom", + "ItemStack", + "default", + table = { + fields = { + "copy", + }, + }, + } +} + +read_globals = { + "default", + "moreores", +} diff --git a/mods/basic_materials/LICENSE b/mods/basic_materials/LICENSE new file mode 100644 index 00000000..c5885ae9 --- /dev/null +++ b/mods/basic_materials/LICENSE @@ -0,0 +1,600 @@ +License for code: LGPL 3.0 +License for media and all other assets: CC-by-SA 4.0 + +############################################################################### + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + +############################################################################### + +Attribution-ShareAlike 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-ShareAlike 4.0 International Public +License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-ShareAlike 4.0 International Public License ("Public +License"). To the extent this Public License may be interpreted as a +contract, You are granted the Licensed Rights in consideration of Your +acceptance of these terms and conditions, and the Licensor grants You +such rights in consideration of benefits the Licensor receives from +making the Licensed Material available under these terms and +conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. BY-SA Compatible License means a license listed at + creativecommons.org/compatiblelicenses, approved by Creative + Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + e. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name + of a Creative Commons Public License. The License Elements of this + Public License are Attribution and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + i. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + k. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + l. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + m. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. Additional offer from the Licensor -- Adapted Material. + Every recipient of Adapted Material from You + automatically receives an offer from the Licensor to + exercise the Licensed Rights in the Adapted Material + under the conditions of the Adapter's License You apply. + + c. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + b. ShareAlike. + + In addition to the conditions in Section 3(a), if You Share + Adapted Material You produce, the following conditions also apply. + + 1. The Adapter's License You apply must be a Creative Commons + license with the same License Elements, this version or + later, or a BY-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the + Adapter's License You apply. You may satisfy this condition + in any reasonable manner based on the medium, means, and + context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms + or conditions on, or apply any Effective Technological + Measures to, Adapted Material that restrict exercise of the + rights granted under the Adapter's License You apply. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material, + + including for purposes of Section 3(b); and + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/mods/basic_materials/electrical-electronic.lua b/mods/basic_materials/electrical-electronic.lua new file mode 100644 index 00000000..91fac4e3 --- /dev/null +++ b/mods/basic_materials/electrical-electronic.lua @@ -0,0 +1,86 @@ +-- Translation support +local S = minetest.get_translator("basic_materials") + +-- items + +minetest.register_craftitem("basic_materials:silicon", { + description = S("Silicon lump"), + inventory_image = "basic_materials_silicon.png", +}) + +minetest.register_craftitem("basic_materials:ic", { + description = S("Simple Integrated Circuit"), + inventory_image = "basic_materials_ic.png", +}) + +minetest.register_craftitem("basic_materials:motor", { + description = S("Simple Motor"), + inventory_image = "basic_materials_motor.png", +}) + +minetest.register_craftitem("basic_materials:heating_element", { + description = S("Heating element"), + inventory_image = "basic_materials_heating_element.png", +}) + +minetest.register_craftitem("basic_materials:energy_crystal_simple", { + description = S("Simple energy crystal"), + inventory_image = "basic_materials_energy_crystal.png", +}) + +-- crafts + +minetest.register_craft( { + output = "mesecons_materials:silicon 4", + recipe = { + { "default:sand", "default:sand" }, + { "default:sand", "default:steel_ingot" }, + }, +}) + +minetest.register_craft( { + output = "basic_materials:ic 4", + recipe = { + { "mesecons_materials:silicon", "mesecons_materials:silicon" }, + { "mesecons_materials:silicon", "default:copper_ingot" }, + }, +}) + +minetest.register_craft( { + output = "basic_materials:motor 2", + recipe = { + { "default:mese_crystal_fragment", "basic_materials:copper_wire", "basic_materials:plastic_sheet" }, + { "default:copper_ingot", "default:steel_ingot", "default:steel_ingot" }, + { "default:mese_crystal_fragment", "basic_materials:copper_wire", "basic_materials:plastic_sheet" } + }, + replacements = { + { "basic_materials:copper_wire", "basic_materials:empty_spool" }, + { "basic_materials:copper_wire", "basic_materials:empty_spool" }, + } +}) + +minetest.register_craft( { + output = "basic_materials:heating_element 2", + recipe = { + { "default:copper_ingot", "default:mese_crystal_fragment", "default:copper_ingot" } + }, +}) + +minetest.register_craft({ + --type = "shapeless", + output = "basic_materials:energy_crystal_simple 2", + recipe = { + { "default:mese_crystal_fragment", "default:torch", "default:mese_crystal_fragment" }, + { "default:diamond", "default:gold_ingot", "default:diamond" } + }, +}) + +-- aliases + +minetest.register_alias("homedecor:ic", "basic_materials:ic") +minetest.register_alias("homedecor:motor", "basic_materials:motor") +minetest.register_alias("technic:motor", "basic_materials:motor") +minetest.register_alias("homedecor:heating_element", "basic_materials:heating_element") +minetest.register_alias("homedecor:power_crystal", "basic_materials:energy_crystal_simple") + +minetest.register_alias_force("mesecons_materials:silicon", "basic_materials:silicon") diff --git a/mods/basic_materials/init.lua b/mods/basic_materials/init.lua new file mode 100644 index 00000000..348c0598 --- /dev/null +++ b/mods/basic_materials/init.lua @@ -0,0 +1,15 @@ +-- Basic materials mod +-- by Vanessa Dannenberg + +-- This mod supplies all those little random craft items that everyone always +-- seems to need, such as metal bars (ala rebar), plastic, wire, and so on. + +local modpath = minetest.get_modpath("basic_materials") + +basic_materials = {} +basic_materials.mod = { author = "Vanessa Dannenberg" } + +dofile(modpath.."/metals.lua") +dofile(modpath.."/plastics.lua") +dofile(modpath.."/electrical-electronic.lua") +dofile(modpath.."/misc.lua") diff --git a/mods/basic_materials/locale/basic_materials.de.tr b/mods/basic_materials/locale/basic_materials.de.tr new file mode 100644 index 00000000..e661fcd8 --- /dev/null +++ b/mods/basic_materials/locale/basic_materials.de.tr @@ -0,0 +1,33 @@ +# textdomain: basic_materials +Silicon lump=Silikonklumpen +Simple Integrated Circuit=einfacher Integrierter Schaltkreis +Simple Motor=einfacher Motor +Heating element=Heizelement +Simple energy crystal=einfacher Energiekristall + +Spool of steel wire=Spule mit Stahldraht +Spool of copper wire=Spule mit Kupferdraht +Spool of silver wire=Spule mit Silberdraht +Spool of gold wire=Spule mit Golddraht +Steel Strip=Stahlstreifen +Copper Strip=Kupferstreifen +Steel Bar=Stahlstab +Chainlinks (brass)=Messing-Kettenglieder +Chainlinks (steel)=Stahl-Kettenglieder +Brass Ingot=Messingbarren +Steel gear=Stahlzahnrad +Padlock=Vorhängeschloss +Chain (steel, hanging)=Stahlkette +Chain (brass, hanging)=Messingkette +Brass Block=Messingblock + +Oil extract=raffiniertes Öl +Unprocessed paraffin=unbearbeitetes Paraffin +Uncooked Terracotta Base=ungebranntes Terrakotta +Wet Cement=nasser Zement +Cement=Zement +Concrete Block=Betonblock + +Plastic sheet=Kunststoffplatte +Plastic strips=Kunststoffstreifen +Empty wire spool=leere Drahtspule diff --git a/mods/basic_materials/locale/basic_materials.fr.tr b/mods/basic_materials/locale/basic_materials.fr.tr new file mode 100644 index 00000000..0bebf79d --- /dev/null +++ b/mods/basic_materials/locale/basic_materials.fr.tr @@ -0,0 +1,33 @@ +# textdomain: basic_materials +Silicon lump=Morceau de silicium +Simple Integrated Circuit=Circuit intégré simple +Simple Motor=Moteur simple +Heating element=Élément chauffant +Simple energy crystal=Cristal d’énergie simple + +Spool of steel wire=Bobine de fil d’acier +Spool of copper wire=Bobine de fil de cuivre +Spool of silver wire=Bobine de fil d’argent +Spool of gold wire=Bobine de fil d’or +Steel Strip=Bande de acier +Copper Strip=Bande de cuivre +Steel Bar=Barre d’acier +Chainlinks (brass)=Maillon en laiton +Chainlinks (steel)=Maillon en acier +Brass Ingot=Lingot de laiton +Steel gear=Rouage en acier +Padlock=Cadenas +Chain (steel, hanging)=Chaine en acier +Chain (brass, hanging)=Chaine en laiton +Brass Block=Bloc de laiton + +Oil extract=Extrait d’huile +Unprocessed paraffin=Paraffine non transformée +Uncooked Terracotta Base=Argile crue +Wet Cement=Ciment humide +Cement=Ciment +Concrete Block=Bloc de béton + +Plastic sheet=Morceau de plastique +Plastic strips=Bande de plastique +Empty wire spool=Bobine de fil vide diff --git a/mods/basic_materials/locale/basic_materials.ru.tr b/mods/basic_materials/locale/basic_materials.ru.tr new file mode 100644 index 00000000..85e9c0cf --- /dev/null +++ b/mods/basic_materials/locale/basic_materials.ru.tr @@ -0,0 +1,33 @@ +# textdomain: basic_materials +Silicon lump=Кусок Кремния +Simple Integrated Circuit=Микросхема +Simple Motor=Мотор +Heating element=Нить Накала +Simple energy crystal=Энергетический Кристалл + +Spool of steel wire=Катушка Стальной Проволоки +Spool of copper wire=Катушка Медной Проволоки +Spool of silver wire=Катушка Серебрянной Проволоки +Spool of gold wire=Катушка Золотой Проволоки +Steel Strip=Стальная Полоса +Copper Strip=Медная Полоса +Steel Bar=Стальной Прут +Chainlinks (brass)=Латунные Звенья +Chainlinks (steel)=Стальные Звенья +Brass Ingot=Латунный Брусок +Steel gear=Стальная Шестерня +Padlock=Навесной Замок +Chain (steel, hanging)=Стальная Цепь +Chain (brass, hanging)=Латунная Цепь +Brass Block=Латунный Блок + +Oil extract=Масляный Экстракт +Unprocessed paraffin=Необработанный Парафин +Uncooked Terracotta Base=Ком Мокрого Терракота +Wet Cement=Ком Мокрого Цемента +Cement=Цемент +Concrete Block=Железобетон + +Plastic sheet=Пластиковый Лист +Plastic strips=Пластиковая Полоса +Empty wire spool=Пустая Катушка diff --git a/mods/basic_materials/metals.lua b/mods/basic_materials/metals.lua new file mode 100644 index 00000000..0a3243b0 --- /dev/null +++ b/mods/basic_materials/metals.lua @@ -0,0 +1,300 @@ +-- Translation support +local S = minetest.get_translator("basic_materials") + +-- items + +minetest.register_craftitem("basic_materials:steel_wire", { + description = S("Spool of steel wire"), + groups = { wire = 1 }, + inventory_image = "basic_materials_steel_wire.png" +}) + +minetest.register_craftitem("basic_materials:copper_wire", { + description = S("Spool of copper wire"), + groups = { wire = 1 }, + inventory_image = "basic_materials_copper_wire.png" +}) + +minetest.register_craftitem("basic_materials:silver_wire", { + description = S("Spool of silver wire"), + groups = { wire = 1 }, + inventory_image = "basic_materials_silver_wire.png" +}) + +minetest.register_craftitem("basic_materials:gold_wire", { + description = S("Spool of gold wire"), + groups = { wire = 1 }, + inventory_image = "basic_materials_gold_wire.png" +}) + +minetest.register_craftitem("basic_materials:steel_strip", { + description = S("Steel Strip"), + groups = { strip = 1 }, + inventory_image = "basic_materials_steel_strip.png" +}) + +minetest.register_craftitem("basic_materials:copper_strip", { + description = S("Copper Strip"), + groups = { strip = 1 }, + inventory_image = "basic_materials_copper_strip.png" +}) + +minetest.register_craftitem("basic_materials:steel_bar", { + description = S("Steel Bar"), + inventory_image = "basic_materials_steel_bar.png", +}) + +minetest.register_craftitem("basic_materials:chainlink_brass", { + description = S("Chainlinks (brass)"), + groups = { chainlinks = 1 }, + inventory_image = "basic_materials_chainlink_brass.png" +}) + +minetest.register_craftitem("basic_materials:chainlink_steel", { + description = S("Chainlinks (steel)"), + groups = { chainlinks = 1 }, + inventory_image = "basic_materials_chainlink_steel.png" +}) + +minetest.register_craftitem("basic_materials:brass_ingot", { + description = S("Brass Ingot"), + inventory_image = "basic_materials_brass_ingot.png", +}) + +minetest.register_craftitem("basic_materials:gear_steel", { + description = S("Steel gear"), + inventory_image = "basic_materials_gear_steel.png" +}) + +minetest.register_craftitem("basic_materials:padlock", { + description = S("Padlock"), + inventory_image = "basic_materials_padlock.png" +}) + +-- nodes + +local chains_sbox = { + type = "fixed", + fixed = { -0.1, -0.5, -0.1, 0.1, 0.5, 0.1 } +} + +minetest.register_node("basic_materials:chain_steel", { + description = S("Chain (steel, hanging)"), + drawtype = "mesh", + mesh = "basic_materials_chains.obj", + tiles = {"basic_materials_chain_steel.png"}, + walkable = false, + climbable = true, + sunlight_propagates = true, + paramtype = "light", + inventory_image = "basic_materials_chain_steel_inv.png", + groups = {cracky=3}, + selection_box = chains_sbox, +}) + +minetest.register_node("basic_materials:chain_brass", { + description = S("Chain (brass, hanging)"), + drawtype = "mesh", + mesh = "basic_materials_chains.obj", + tiles = {"basic_materials_chain_brass.png"}, + walkable = false, + climbable = true, + sunlight_propagates = true, + paramtype = "light", + inventory_image = "basic_materials_chain_brass_inv.png", + groups = {cracky=3}, + selection_box = chains_sbox, +}) + +minetest.register_node("basic_materials:brass_block", { + description = S("Brass Block"), + tiles = { "basic_materials_brass_block.png" }, + is_ground_content = false, + groups = {cracky=1, level=2}, + sounds = default.node_sound_metal_defaults() +}) + +-- crafts + +minetest.register_craft( { + output = "basic_materials:copper_wire 2", + type = "shapeless", + recipe = { + "default:copper_ingot", + "basic_materials:empty_spool", + "basic_materials:empty_spool", + }, +}) + +minetest.register_craft( { + output = "basic_materials:silver_wire 2", + type = "shapeless", + recipe = { + "moreores:silver_ingot", + "basic_materials:empty_spool", + "basic_materials:empty_spool", + }, +}) + +minetest.register_craft( { + output = "basic_materials:gold_wire 2", + type = "shapeless", + recipe = { + "default:gold_ingot", + "basic_materials:empty_spool", + "basic_materials:empty_spool", + }, +}) + +minetest.register_craft( { + output = "basic_materials:steel_wire 2", + type = "shapeless", + recipe = { + "default:steel_ingot", + "basic_materials:empty_spool", + "basic_materials:empty_spool", + }, +}) + +minetest.register_craft( { + output = "basic_materials:steel_strip 12", + recipe = { + { "", "default:steel_ingot", "" }, + { "default:steel_ingot", "", "" }, + }, +}) + +minetest.register_craft( { + output = "basic_materials:copper_strip 12", + recipe = { + { "", "default:copper_ingot", "" }, + { "default:copper_ingot", "", "" }, + }, +}) + +minetest.register_craft( { + output = "basic_materials:steel_bar 6", + recipe = { + { "", "", "default:steel_ingot" }, + { "", "default:steel_ingot", "" }, + { "default:steel_ingot", "", "" }, + }, +}) + +minetest.register_craft( { + output = "basic_materials:padlock 2", + recipe = { + { "basic_materials:steel_bar" }, + { "default:steel_ingot" }, + { "default:steel_ingot" }, + }, +}) + +minetest.register_craft({ + output = "basic_materials:chainlink_steel 12", + recipe = { + {"", "default:steel_ingot", "default:steel_ingot"}, + { "default:steel_ingot", "", "default:steel_ingot" }, + { "default:steel_ingot", "default:steel_ingot", "" }, + }, +}) + +minetest.register_craft({ + output = "basic_materials:chainlink_brass 12", + recipe = { + {"", "basic_materials:brass_ingot", "basic_materials:brass_ingot"}, + { "basic_materials:brass_ingot", "", "basic_materials:brass_ingot" }, + { "basic_materials:brass_ingot", "basic_materials:brass_ingot", "" }, + }, +}) + +minetest.register_craft({ + output = 'basic_materials:chain_steel 2', + recipe = { + {"basic_materials:chainlink_steel"}, + {"basic_materials:chainlink_steel"}, + {"basic_materials:chainlink_steel"} + } +}) + +minetest.register_craft({ + output = 'basic_materials:chain_brass 2', + recipe = { + {"basic_materials:chainlink_brass"}, + {"basic_materials:chainlink_brass"}, + {"basic_materials:chainlink_brass"} + } +}) + +minetest.register_craft( { + output = "basic_materials:gear_steel 6", + recipe = { + { "", "default:steel_ingot", "" }, + { "default:steel_ingot","basic_materials:chainlink_steel", "default:steel_ingot" }, + { "", "default:steel_ingot", "" } + }, +}) + +minetest.register_craft( { + type = "shapeless", + output = "basic_materials:brass_ingot 3", + recipe = { + "default:copper_ingot", + "default:copper_ingot", + "moreores:silver_ingot", + }, +}) + +if not minetest.get_modpath("moreores") then + -- Without moreores, there still should be a way to create brass. + minetest.register_craft( { + output = "basic_materials:brass_ingot 9", + recipe = { + {"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"}, + {"default:gold_ingot", "default:copper_ingot", "default:gold_ingot"}, + {"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"}, + }, + }) +end + +minetest.register_craft( { + type = "shapeless", + output = "basic_materials:brass_ingot 9", + recipe = { "basic_materials:brass_block" }, +}) + +minetest.register_craft( { + output = "basic_materials:brass_block", + recipe = { + { "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" }, + { "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" }, + { "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" }, + }, +}) + +-- aliases + +minetest.register_alias("homedecor:copper_wire", "basic_materials:copper_wire") +minetest.register_alias("technic:fine_copper_wire", "basic_materials:copper_wire") +minetest.register_alias("technic:fine_silver_wire", "basic_materials:silver_wire") +minetest.register_alias("technic:fine_gold_wire", "basic_materials:gold_wire") + +minetest.register_alias("homedecor:steel_wire", "basic_materials:steel_wire") + +minetest.register_alias("homedecor:brass_ingot", "basic_materials:brass_ingot") +minetest.register_alias("technic:brass_ingot", "basic_materials:brass_ingot") +minetest.register_alias("technic:brass_block", "basic_materials:brass_block") + +minetest.register_alias("homedecor:copper_strip", "basic_materials:copper_strip") +minetest.register_alias("homedecor:steel_strip", "basic_materials:steel_strip") + +minetest.register_alias_force("glooptest:chainlink", "basic_materials:chainlink_steel") +minetest.register_alias_force("homedecor:chainlink_steel", "basic_materials:chainlink_steel") +minetest.register_alias("homedecor:chainlink_brass", "basic_materials:chainlink_brass") +minetest.register_alias("chains:chain", "basic_materials:chain_steel") +minetest.register_alias("chains:chain_brass", "basic_materials:chain_brass") + +minetest.register_alias("pipeworks:gear", "basic_materials:gear_steel") + +minetest.register_alias("technic:rebar", "basic_materials:steel_bar") + diff --git a/mods/basic_materials/misc.lua b/mods/basic_materials/misc.lua new file mode 100644 index 00000000..00128972 --- /dev/null +++ b/mods/basic_materials/misc.lua @@ -0,0 +1,126 @@ +-- Translation support +local S = minetest.get_translator("basic_materials") + +-- items + +minetest.register_craftitem("basic_materials:oil_extract", { + description = S("Oil extract"), + inventory_image = "basic_materials_oil_extract.png", +}) + +minetest.register_craftitem("basic_materials:paraffin", { + description = S("Unprocessed paraffin"), + inventory_image = "basic_materials_paraffin.png", +}) + +minetest.register_craftitem("basic_materials:terracotta_base", { + description = S("Uncooked Terracotta Base"), + inventory_image = "basic_materials_terracotta_base.png", +}) + +minetest.register_craftitem("basic_materials:wet_cement", { + description = S("Wet Cement"), + inventory_image = "basic_materials_wet_cement.png", +}) + +-- nodes + +minetest.register_node("basic_materials:cement_block", { + description = S("Cement"), + tiles = {"basic_materials_cement_block.png"}, + is_ground_content = true, + groups = {cracky=2}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("basic_materials:concrete_block", { + description = S("Concrete Block"), + tiles = {"basic_materials_concrete_block.png",}, + groups = {cracky=1, level=2, concrete=1}, + sounds = default.node_sound_stone_defaults(), +}) + +-- crafts + +minetest.register_craft({ + type = "shapeless", + output = "basic_materials:oil_extract 2", + recipe = { + "group:leaves", + "group:leaves", + "group:leaves", + "group:leaves", + "group:leaves", + "group:leaves" + } +}) + +minetest.register_craft({ + type = "cooking", + output = "basic_materials:paraffin", + recipe = "basic_materials:oil_extract", +}) + +minetest.register_craft({ + type = "fuel", + recipe = "basic_materials:oil_extract", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "basic_materials:paraffin", + burntime = 30, +}) + +minetest.register_craft( { + type = "shapeless", + output = "basic_materials:terracotta_base 8", + recipe = { + "bucket:bucket_water", + "default:clay_lump", + "default:gravel", + }, + replacements = { {"bucket:bucket_water", "bucket:bucket_empty"}, }, +}) + +minetest.register_craft({ + type = "shapeless", + output = "basic_materials:wet_cement 3", + recipe = { + "default:dirt", + "dye:dark_grey", + "dye:dark_grey", + "dye:dark_grey", + "bucket:bucket_water" + }, + replacements = {{'bucket:bucket_water', 'bucket:bucket_empty'},}, +}) + +minetest.register_craft({ + type = "cooking", + output = "basic_materials:cement_block", + recipe = "basic_materials:wet_cement", + cooktime = 8 +}) + +minetest.register_craft({ + output = 'basic_materials:concrete_block 6', + recipe = { + {'group:sand', 'basic_materials:wet_cement', 'default:gravel'}, + {'basic_materials:steel_bar', 'basic_materials:wet_cement', 'basic_materials:steel_bar'}, + {'default:gravel', 'basic_materials:wet_cement', 'group:sand'}, + } +}) + +-- aliases + +minetest.register_alias("homedecor:oil_extract", "basic_materials:oil_extract") +minetest.register_alias("homedecor:paraffin", "basic_materials:paraffin") +minetest.register_alias("homedecor:plastic_base", "basic_materials:paraffin") +minetest.register_alias("homedecor:terracotta_base", "basic_materials:terracotta_base") + +minetest.register_alias("gloopblocks:wet_cement", "basic_materials:wet_cement") +minetest.register_alias("gloopblocks:cement", "basic_materials:cement_block") + +minetest.register_alias("technic:concrete", "basic_materials:concrete_block") diff --git a/mods/basic_materials/mod.conf b/mods/basic_materials/mod.conf new file mode 100644 index 00000000..7234bfe9 --- /dev/null +++ b/mods/basic_materials/mod.conf @@ -0,0 +1,4 @@ +name = basic_materials +depends = default +optional_depends = moreores +min_minetest_version = 5.2.0 diff --git a/mods/basic_materials/models/basic_materials_chains.obj b/mods/basic_materials/models/basic_materials_chains.obj new file mode 100644 index 00000000..78724c98 --- /dev/null +++ b/mods/basic_materials/models/basic_materials_chains.obj @@ -0,0 +1,881 @@ +# Blender v2.73 (sub 0) OBJ File: 'chains.blend' +# www.blender.org +o Torus.016_Torus +v 0.000000 -0.429978 0.000002 +v 0.000000 -0.401109 0.055211 +v -0.014044 -0.391975 0.048870 +v -0.014044 -0.423304 0.000002 +v -0.009826 -0.379748 0.040970 +v -0.009826 -0.406012 0.000002 +v 0.009826 -0.379748 0.040970 +v 0.009826 -0.406012 0.000002 +v 0.014044 -0.391975 0.048870 +v 0.014044 -0.423304 0.000002 +v 0.000000 -0.316336 0.080195 +v -0.014044 -0.316336 0.069112 +v -0.009826 -0.316336 0.057941 +v 0.009826 -0.316336 0.057941 +v 0.014044 -0.316336 0.069112 +v 0.000000 -0.231564 0.055211 +v -0.014044 -0.240700 0.048870 +v -0.009826 -0.252925 0.040970 +v 0.009826 -0.252925 0.040970 +v 0.014044 -0.240700 0.048870 +v 0.000000 -0.202695 0.000002 +v -0.014044 -0.209368 0.000002 +v -0.009826 -0.226661 0.000002 +v 0.009826 -0.226661 0.000002 +v 0.014044 -0.209368 0.000002 +v 0.000000 -0.231564 -0.055206 +v -0.014044 -0.240700 -0.048868 +v -0.009826 -0.252925 -0.040967 +v 0.009826 -0.252925 -0.040967 +v 0.014044 -0.240700 -0.048865 +v 0.000000 -0.316336 -0.080190 +v -0.014044 -0.316336 -0.069108 +v -0.009826 -0.316336 -0.057936 +v 0.009826 -0.316336 -0.057936 +v 0.014044 -0.316336 -0.069108 +v 0.000000 -0.400361 -0.055206 +v -0.014044 -0.391975 -0.048868 +v -0.009826 -0.379748 -0.040967 +v 0.009826 -0.379748 -0.040967 +v 0.014044 -0.391975 -0.048868 +v 0.000000 -0.262249 0.000002 +v -0.061672 -0.233381 0.000002 +v -0.054590 -0.224245 -0.012569 +v 0.000000 -0.255577 -0.012569 +v -0.045765 -0.212018 -0.008794 +v 0.000000 -0.238285 -0.008794 +v -0.045765 -0.212018 0.008798 +v 0.000000 -0.238285 0.008798 +v -0.054590 -0.224245 0.012574 +v 0.000000 -0.255577 0.012574 +v -0.089582 -0.148609 0.000002 +v -0.077200 -0.148609 -0.012569 +v -0.064722 -0.148609 -0.008794 +v -0.064722 -0.148609 0.008799 +v -0.077200 -0.148609 0.012574 +v -0.061672 -0.063837 0.000002 +v -0.054590 -0.072971 -0.012569 +v -0.045765 -0.085198 -0.008794 +v -0.045765 -0.085198 0.008799 +v -0.054590 -0.072971 0.012574 +v 0.000000 -0.034967 0.000002 +v 0.000000 -0.041641 -0.012569 +v 0.000000 -0.058933 -0.008794 +v 0.000000 -0.058933 0.008799 +v 0.000000 -0.041641 0.012574 +v 0.061672 -0.063837 0.000002 +v 0.054590 -0.072971 -0.012569 +v 0.045765 -0.085198 -0.008794 +v 0.045765 -0.085198 0.008799 +v 0.054590 -0.072971 0.012574 +v 0.089582 -0.148609 0.000002 +v 0.077200 -0.148609 -0.012569 +v 0.064722 -0.148609 -0.008794 +v 0.064722 -0.148609 0.008799 +v 0.077200 -0.148609 0.012574 +v 0.061672 -0.232631 0.000002 +v 0.054590 -0.224245 -0.012569 +v 0.045765 -0.212018 -0.008794 +v 0.045765 -0.212018 0.008798 +v 0.054590 -0.224245 0.012574 +v 0.000000 0.073316 0.000002 +v 0.061672 0.102183 0.000002 +v 0.054590 0.111319 0.012574 +v 0.000000 0.079988 0.012574 +v 0.045765 0.123546 0.008799 +v 0.000000 0.097280 0.008799 +v 0.045765 0.123546 -0.008794 +v 0.000000 0.097280 -0.008794 +v 0.054590 0.111319 -0.012569 +v 0.000000 0.079988 -0.012569 +v 0.089582 0.186956 0.000002 +v 0.077200 0.186956 0.012574 +v 0.064722 0.186956 0.008799 +v 0.064722 0.186956 -0.008794 +v 0.077200 0.186956 -0.012569 +v 0.061672 0.271728 0.000002 +v 0.054590 0.262594 0.012574 +v 0.045765 0.250367 0.008799 +v 0.045765 0.250367 -0.008794 +v 0.054590 0.262594 -0.012569 +v 0.000000 0.300597 0.000002 +v 0.000000 0.293923 0.012574 +v 0.000000 0.276631 0.008799 +v 0.000000 0.276631 -0.008794 +v 0.000000 0.293923 -0.012569 +v -0.061672 0.271728 0.000002 +v -0.054590 0.262594 0.012574 +v -0.045765 0.250367 0.008799 +v -0.045765 0.250367 -0.008794 +v -0.054590 0.262594 -0.012569 +v -0.089582 0.186956 0.000002 +v -0.077200 0.186956 0.012574 +v -0.064722 0.186956 0.008799 +v -0.064722 0.186956 -0.008794 +v -0.077200 0.186956 -0.012569 +v -0.061672 0.102931 0.000002 +v -0.054590 0.111319 0.012574 +v -0.045765 0.123546 0.008799 +v -0.045765 0.123546 -0.008794 +v -0.054590 0.111319 -0.012569 +v 0.000000 -0.095037 0.000002 +v 0.000000 -0.066168 -0.055206 +v 0.014044 -0.057034 -0.048868 +v 0.014044 -0.088363 0.000002 +v 0.009826 -0.044807 -0.040967 +v 0.009826 -0.071071 0.000002 +v -0.009826 -0.044807 -0.040967 +v -0.009826 -0.071071 0.000002 +v -0.014044 -0.057034 -0.048868 +v -0.014044 -0.088363 0.000002 +v 0.000000 0.018605 -0.080190 +v 0.014044 0.018605 -0.069108 +v 0.009826 0.018605 -0.057936 +v -0.009826 0.018605 -0.057936 +v -0.014044 0.018605 -0.069108 +v 0.000000 0.103377 -0.055206 +v 0.014044 0.094243 -0.048868 +v 0.009826 0.082016 -0.040967 +v -0.009826 0.082016 -0.040967 +v -0.014044 0.094243 -0.048868 +v 0.000000 0.132246 0.000002 +v 0.014044 0.125572 0.000002 +v 0.009826 0.108280 0.000002 +v -0.009826 0.108280 0.000002 +v -0.014044 0.125572 0.000002 +v 0.000000 0.103377 0.055211 +v 0.014044 0.094243 0.048870 +v 0.009826 0.082016 0.040970 +v -0.009826 0.082016 0.040970 +v -0.014044 0.094243 0.048870 +v 0.000000 0.018605 0.080195 +v 0.014044 0.018605 0.069112 +v 0.009826 0.018605 0.057941 +v -0.009826 0.018605 0.057941 +v -0.014044 0.018605 0.069112 +v 0.000000 -0.065420 0.055211 +v 0.014044 -0.057032 0.048870 +v 0.009826 -0.044807 0.040970 +v -0.009826 -0.044807 0.040970 +v -0.014044 -0.057032 0.048870 +v 0.000000 -0.598329 0.000002 +v 0.061672 -0.569460 0.000002 +v 0.054590 -0.560326 0.012574 +v 0.000000 -0.591655 0.012574 +v 0.045765 -0.548099 0.008798 +v 0.000000 -0.574363 0.008798 +v 0.045765 -0.548099 -0.008794 +v 0.000000 -0.574363 -0.008794 +v 0.054590 -0.560326 -0.012569 +v 0.000000 -0.591655 -0.012569 +v 0.089582 -0.484687 0.000002 +v 0.077200 -0.484687 0.012574 +v 0.064722 -0.484687 0.008798 +v 0.064722 -0.484687 -0.008794 +v 0.077200 -0.484687 -0.012569 +v 0.061672 -0.399915 0.000002 +v 0.054590 -0.409051 0.012574 +v 0.045765 -0.421278 0.008798 +v 0.045765 -0.421278 -0.008794 +v 0.054590 -0.409051 -0.012569 +v 0.000000 -0.371048 0.000002 +v 0.000000 -0.377719 0.012574 +v 0.000000 -0.395012 0.008798 +v 0.000000 -0.395012 -0.008794 +v 0.000000 -0.377719 -0.012569 +v -0.061672 -0.399915 0.000002 +v -0.054590 -0.409051 0.012574 +v -0.045765 -0.421278 0.008798 +v -0.045765 -0.421278 -0.008794 +v -0.054590 -0.409051 -0.012569 +v -0.089582 -0.484687 0.000002 +v -0.077200 -0.484687 0.012574 +v -0.064722 -0.484687 0.008798 +v -0.064722 -0.484687 -0.008794 +v -0.077200 -0.484687 -0.012569 +v -0.061672 -0.568712 0.000002 +v -0.054590 -0.560326 0.012574 +v -0.045765 -0.548099 0.008798 +v -0.045765 -0.548099 -0.008794 +v -0.054590 -0.560326 -0.012569 +v 0.000000 0.241043 0.000002 +v 0.000000 0.269910 0.055211 +v -0.014044 0.279047 0.048870 +v -0.014044 0.247717 0.000002 +v -0.009826 0.291274 0.040970 +v -0.009826 0.265007 0.000002 +v 0.009826 0.291274 0.040970 +v 0.009826 0.265007 0.000002 +v 0.014044 0.279047 0.048870 +v 0.014044 0.247717 0.000002 +v 0.000000 0.354683 0.080195 +v -0.014044 0.354683 0.069112 +v -0.009826 0.354683 0.057941 +v 0.009826 0.354683 0.057941 +v 0.014044 0.354683 0.069112 +v 0.000000 0.439455 0.055211 +v -0.014044 0.430321 0.048870 +v -0.009826 0.418094 0.040970 +v 0.009826 0.418094 0.040970 +v 0.014044 0.430321 0.048870 +v 0.000000 0.468325 0.000002 +v -0.014044 0.461651 0.000002 +v -0.009826 0.444361 0.000002 +v 0.009826 0.444361 0.000002 +v 0.014044 0.461651 0.000002 +v 0.000000 0.439455 -0.055206 +v -0.014044 0.430321 -0.048868 +v -0.009826 0.418094 -0.040967 +v 0.009826 0.418094 -0.040967 +v 0.014044 0.430321 -0.048868 +v 0.000000 0.354683 -0.080190 +v -0.014044 0.354683 -0.069108 +v -0.009826 0.354683 -0.057936 +v 0.009826 0.354683 -0.057936 +v 0.014044 0.354683 -0.069108 +v 0.000000 0.270661 -0.055206 +v -0.014044 0.279047 -0.048868 +v -0.009826 0.291274 -0.040967 +v 0.009826 0.291274 -0.040967 +v 0.014044 0.279047 -0.048868 +vt 0.187500 0.125000 +vt 0.250000 0.125000 +vt 0.250000 0.187500 +vt 0.187500 0.187500 +vt 0.250000 0.250000 +vt 0.187500 0.250000 +vt 0.250000 0.312500 +vt 0.187500 0.312500 +vt 0.250000 0.375000 +vt 0.187500 0.375000 +vt 0.187500 0.062500 +vt 0.250000 0.062500 +vt 0.312500 0.125000 +vt 0.312500 0.187500 +vt 0.312500 0.250000 +vt 0.312500 0.312500 +vt 0.312500 0.375000 +vt 0.312500 0.062500 +vt 0.375000 0.125000 +vt 0.375000 0.187500 +vt 0.375000 0.250000 +vt 0.375000 0.312500 +vt 0.375000 0.375000 +vt 0.375000 0.062500 +vt 0.437500 0.125000 +vt 0.437500 0.187500 +vt 0.437500 0.250000 +vt 0.437500 0.312500 +vt 0.437500 0.375000 +vt 0.437500 0.062500 +vt 0.500000 0.125000 +vt 0.500000 0.187500 +vt 0.500000 0.250000 +vt 0.500000 0.312500 +vt 0.500000 0.375000 +vt 0.500000 0.062500 +vt -0.000000 0.125000 +vt 0.062500 0.125000 +vt 0.062500 0.187500 +vt -0.000000 0.187500 +vt 0.062500 0.250000 +vt -0.000000 0.250000 +vt 0.062500 0.312500 +vt -0.000000 0.312500 +vt 0.062500 0.375000 +vt -0.000000 0.375000 +vt -0.000000 0.062500 +vt 0.062500 0.062500 +vt 0.125000 0.125000 +vt 0.125000 0.187500 +vt 0.125000 0.250000 +vt 0.125000 0.312500 +vt 0.125000 0.375000 +vt 0.125000 0.062500 +vt 0.750000 0.625000 +vt 0.812500 0.625000 +vt 0.812500 0.687500 +vt 0.750000 0.687500 +vt 0.750000 0.375000 +vt 0.812500 0.375000 +vt 0.812500 0.437500 +vt 0.750000 0.437500 +vt 0.812500 0.500000 +vt 0.750000 0.500000 +vt 0.812500 0.562500 +vt 0.750000 0.562500 +vt 0.875000 0.625000 +vt 0.875000 0.687500 +vt 0.875000 0.375000 +vt 0.875000 0.437500 +vt 0.875000 0.500000 +vt 0.875000 0.562500 +vt 0.937500 0.625000 +vt 0.937500 0.687500 +vt 0.937500 0.375000 +vt 0.937500 0.437500 +vt 0.937500 0.500000 +vt 0.937500 0.562500 +vt 1.000000 0.625000 +vt 1.000000 0.687500 +vt 1.000000 0.375000 +vt 1.000000 0.437500 +vt 1.000000 0.500000 +vt 1.000000 0.562500 +vt 0.500000 0.625000 +vt 0.562500 0.625000 +vt 0.562500 0.687500 +vt 0.500000 0.687500 +vt 0.562500 0.375000 +vt 0.562500 0.437500 +vt 0.500000 0.437500 +vt 0.562500 0.500000 +vt 0.500000 0.500000 +vt 0.562500 0.562500 +vt 0.500000 0.562500 +vt 0.625000 0.625000 +vt 0.625000 0.687500 +vt 0.625000 0.375000 +vt 0.625000 0.437500 +vt 0.625000 0.500000 +vt 0.625000 0.562500 +vt 0.687500 0.625000 +vt 0.687500 0.687500 +vt 0.687500 0.375000 +vt 0.687500 0.437500 +vt 0.687500 0.500000 +vt 0.687500 0.562500 +vt 0.250000 0.625000 +vt 0.312500 0.625000 +vt 0.312500 0.687500 +vt 0.250000 0.687500 +vt 0.312500 0.437500 +vt 0.250000 0.437500 +vt 0.312500 0.500000 +vt 0.250000 0.500000 +vt 0.312500 0.562500 +vt 0.250000 0.562500 +vt 0.375000 0.625000 +vt 0.375000 0.687500 +vt 0.375000 0.437500 +vt 0.375000 0.500000 +vt 0.375000 0.562500 +vt 0.437500 0.625000 +vt 0.437500 0.687500 +vt 0.437500 0.437500 +vt 0.437500 0.500000 +vt 0.437500 0.562500 +vt -0.000000 0.625000 +vt 0.062500 0.625000 +vt 0.062500 0.687500 +vt -0.000000 0.687500 +vt 0.062500 0.437500 +vt -0.000000 0.437500 +vt 0.062500 0.500000 +vt -0.000000 0.500000 +vt 0.062500 0.562500 +vt -0.000000 0.562500 +vt 0.125000 0.625000 +vt 0.125000 0.687500 +vt 0.125000 0.437500 +vt 0.125000 0.500000 +vt 0.125000 0.562500 +vt 0.187500 0.625000 +vt 0.187500 0.687500 +vt 0.187500 0.437500 +vt 0.187500 0.500000 +vt 0.187500 0.562500 +vt 0.687500 0.750000 +vt 0.750000 0.750000 +vt 0.750000 0.812500 +vt 0.687500 0.812500 +vt 0.750000 0.875000 +vt 0.687500 0.875000 +vt 0.750000 0.937500 +vt 0.687500 0.937500 +vt 0.750000 1.000000 +vt 0.687500 1.000000 +vt 0.812500 0.750000 +vt 0.812500 0.812500 +vt 0.812500 0.875000 +vt 0.812500 0.937500 +vt 0.812500 1.000000 +vt 0.875000 0.750000 +vt 0.875000 0.812500 +vt 0.875000 0.875000 +vt 0.875000 0.937500 +vt 0.875000 1.000000 +vt 0.937500 0.750000 +vt 0.937500 0.812500 +vt 0.937500 0.875000 +vt 0.937500 0.937500 +vt 0.937500 1.000000 +vt 1.000000 0.750000 +vt 1.000000 0.812500 +vt 1.000000 0.875000 +vt 1.000000 0.937500 +vt 1.000000 1.000000 +vt 0.500000 0.750000 +vt 0.562500 0.750000 +vt 0.562500 0.812500 +vt 0.500000 0.812500 +vt 0.562500 0.875000 +vt 0.500000 0.875000 +vt 0.562500 0.937500 +vt 0.500000 0.937500 +vt 0.562500 1.000000 +vt 0.500000 1.000000 +vt 0.625000 0.750000 +vt 0.625000 0.812500 +vt 0.625000 0.875000 +vt 0.625000 0.937500 +vt 0.625000 1.000000 +vt 0.750000 0.312500 +vt 0.812500 0.312500 +vt 0.750000 0.062500 +vt 0.812500 0.062500 +vt 0.812500 0.125000 +vt 0.750000 0.125000 +vt 0.812500 0.187500 +vt 0.750000 0.187500 +vt 0.812500 0.250000 +vt 0.750000 0.250000 +vt 0.875000 0.312500 +vt 0.875000 0.062500 +vt 0.875000 0.125000 +vt 0.875000 0.187500 +vt 0.875000 0.250000 +vt 0.937500 0.312500 +vt 0.937500 0.062500 +vt 0.937500 0.125000 +vt 0.937500 0.187500 +vt 0.937500 0.250000 +vt 1.000000 0.312500 +vt 1.000000 0.062500 +vt 1.000000 0.125000 +vt 1.000000 0.187500 +vt 1.000000 0.250000 +vt 0.562500 0.312500 +vt 0.562500 0.062500 +vt 0.562500 0.125000 +vt 0.562500 0.187500 +vt 0.562500 0.250000 +vt 0.625000 0.312500 +vt 0.625000 0.062500 +vt 0.625000 0.125000 +vt 0.625000 0.187500 +vt 0.625000 0.250000 +vt 0.687500 0.312500 +vt 0.687500 0.062500 +vt 0.687500 0.125000 +vt 0.687500 0.187500 +vt 0.687500 0.250000 +vt 0.250000 0.937500 +vt 0.312500 0.937500 +vt 0.312500 1.000000 +vt 0.250000 1.000000 +vt 0.312500 0.750000 +vt 0.250000 0.750000 +vt 0.312500 0.812500 +vt 0.250000 0.812500 +vt 0.312500 0.875000 +vt 0.250000 0.875000 +vt 0.375000 0.937500 +vt 0.375000 1.000000 +vt 0.375000 0.750000 +vt 0.375000 0.812500 +vt 0.375000 0.875000 +vt 0.437500 0.937500 +vt 0.437500 1.000000 +vt 0.437500 0.750000 +vt 0.437500 0.812500 +vt 0.437500 0.875000 +vt 0.000000 0.937500 +vt 0.062500 0.937500 +vt 0.062500 1.000000 +vt 0.000000 1.000000 +vt 0.062500 0.750000 +vt 0.000000 0.750000 +vt 0.062500 0.812500 +vt 0.000000 0.812500 +vt 0.062500 0.875000 +vt 0.000000 0.875000 +vt 0.125000 0.937500 +vt 0.125000 1.000000 +vt 0.125000 0.750000 +vt 0.125000 0.812500 +vt 0.125000 0.875000 +vt 0.187500 0.937500 +vt 0.187500 1.000000 +vt 0.187500 0.750000 +vt 0.187500 0.812500 +vt 0.187500 0.875000 +vn 0.000000 -1.000000 -0.004800 +vn 0.000000 -0.657400 0.753500 +vn -0.898300 -0.248500 0.362300 +vn -0.863600 -0.504100 -0.003400 +vn -0.661500 0.421500 -0.620200 +vn -0.746000 0.665900 0.000000 +vn 0.661500 0.421500 -0.620200 +vn 0.746000 0.665900 0.000000 +vn 0.898300 -0.248500 0.362300 +vn 0.863600 -0.504100 -0.003400 +vn 0.000000 0.000000 1.000000 +vn -0.925200 0.000000 0.379500 +vn -0.617100 0.000000 -0.786900 +vn 0.617100 0.000000 -0.786900 +vn 0.925200 0.000000 0.379500 +vn 0.000000 0.657400 0.753500 +vn -0.898300 0.248400 0.362300 +vn -0.661500 -0.421500 -0.620200 +vn 0.661500 -0.421500 -0.620200 +vn 0.898300 0.248400 0.362300 +vn 0.000000 1.000000 0.000000 +vn -0.866100 0.499800 0.000000 +vn -0.746000 -0.665900 0.000000 +vn 0.746000 -0.665900 0.000000 +vn 0.866100 0.499800 0.000000 +vn 0.000000 0.657400 -0.753500 +vn -0.898300 0.248400 -0.362400 +vn -0.661600 -0.421500 0.620200 +vn 0.661500 -0.421500 0.620200 +vn 0.898300 0.248400 -0.362300 +vn 0.000000 -0.000900 -1.000000 +vn -0.924600 -0.000600 -0.380700 +vn -0.617100 0.000000 0.786900 +vn 0.617100 0.000000 0.786900 +vn 0.924700 -0.000600 -0.380700 +vn 0.000000 -0.650300 -0.759600 +vn -0.895600 -0.254600 -0.364800 +vn -0.661600 0.421500 0.620200 +vn 0.661600 0.421500 0.620200 +vn 0.895600 -0.254600 -0.364800 +vn 0.004900 -1.000000 0.000000 +vn -0.729700 -0.683800 0.000000 +vn -0.324500 -0.256300 -0.910500 +vn 0.003300 -0.475500 -0.879700 +vn 0.578700 0.436200 -0.689100 +vn 0.000000 0.666600 -0.745400 +vn 0.578700 0.436200 0.689100 +vn 0.000000 0.666600 0.745400 +vn -0.324500 -0.256300 0.910500 +vn 0.003300 -0.475500 0.879700 +vn -1.000000 0.000000 0.000000 +vn -0.359600 0.000000 -0.933100 +vn 0.756400 0.000000 -0.654100 +vn 0.756400 0.000000 0.654100 +vn -0.359600 0.000000 0.933100 +vn -0.729700 0.683700 0.000000 +vn -0.324500 0.256300 -0.910500 +vn 0.578700 -0.436200 -0.689100 +vn 0.578700 -0.436200 0.689100 +vn -0.324500 0.256300 0.910500 +vn 0.000000 0.470900 -0.882200 +vn 0.000000 -0.666600 -0.745400 +vn 0.000000 -0.666600 0.745400 +vn 0.000000 0.470900 0.882200 +vn 0.729700 0.683700 0.000000 +vn 0.324500 0.256300 -0.910500 +vn -0.578700 -0.436200 -0.689100 +vn -0.578700 -0.436200 0.689100 +vn 0.324500 0.256300 0.910500 +vn 1.000000 -0.001100 0.000000 +vn 0.361000 -0.000700 -0.932600 +vn -0.756400 0.000000 -0.654100 +vn -0.756400 0.000000 0.654100 +vn 0.361000 -0.000700 0.932600 +vn 0.736100 -0.676800 0.000000 +vn 0.327100 -0.263100 -0.907600 +vn -0.578700 0.436200 -0.689100 +vn -0.578700 0.436200 0.689100 +vn 0.327100 -0.263100 0.907600 +vn -0.004900 -1.000000 0.000000 +vn 0.729700 -0.683800 0.000000 +vn 0.324500 -0.256300 0.910500 +vn -0.003300 -0.475400 0.879700 +vn 0.324500 -0.256300 -0.910500 +vn -0.003300 -0.475400 -0.879700 +vn 1.000000 0.000000 0.000000 +vn 0.359600 0.000000 0.933100 +vn 0.359600 0.000000 -0.933100 +vn -1.000000 -0.001100 0.000000 +vn -0.361000 -0.000700 0.932600 +vn -0.361000 -0.000700 -0.932600 +vn -0.736100 -0.676800 0.000000 +vn -0.327100 -0.263100 0.907600 +vn -0.327100 -0.263100 -0.907600 +vn 0.000000 -1.000000 0.004800 +vn 0.000000 -0.657400 -0.753500 +vn 0.898300 -0.248500 -0.362400 +vn 0.863600 -0.504100 0.003400 +vn -0.898300 -0.248500 -0.362400 +vn -0.863600 -0.504100 0.003400 +vn 0.000000 0.000000 -1.000000 +vn 0.925200 0.000000 -0.379500 +vn -0.925200 0.000000 -0.379500 +vn 0.898300 0.248500 -0.362400 +vn 0.661600 -0.421500 0.620200 +vn -0.898300 0.248500 -0.362400 +vn 0.898300 0.248500 0.362300 +vn -0.898300 0.248500 0.362300 +vn 0.000000 -0.000900 1.000000 +vn 0.924700 -0.000600 0.380700 +vn -0.924700 -0.000600 0.380700 +vn 0.000000 -0.650300 0.759600 +vn 0.895600 -0.254600 0.364700 +vn -0.895600 -0.254600 0.364700 +vn 0.729700 -0.683700 0.000000 +vn 0.729700 0.683800 0.000000 +vn -0.729700 0.683800 0.000000 +vn -0.898300 -0.248400 0.362300 +vn -0.863600 -0.504100 -0.003500 +vn 0.898300 -0.248400 0.362300 +vn 0.863600 -0.504100 -0.003500 +vn -0.661500 -0.421500 0.620200 +vn 0.924600 -0.000600 -0.380700 +vn -0.661500 0.421500 0.620200 +vn 0.661500 0.421500 0.620200 +s 1 +f 1/1/1 2/2/2 3/3/3 4/4/4 +f 4/4/4 3/3/3 5/5/5 6/6/6 +f 6/6/6 5/5/5 7/7/7 8/8/8 +f 8/8/8 7/7/7 9/9/9 10/10/10 +f 1/1/1 10/11/10 9/12/9 2/2/2 +f 2/2/2 11/13/11 12/14/12 3/3/3 +f 3/3/3 12/14/12 13/15/13 5/5/5 +f 5/5/5 13/15/13 14/16/14 7/7/7 +f 7/7/7 14/16/14 15/17/15 9/9/9 +f 9/12/9 15/18/15 11/13/11 2/2/2 +f 11/13/11 16/19/16 17/20/17 12/14/12 +f 12/14/12 17/20/17 18/21/18 13/15/13 +f 13/15/13 18/21/18 19/22/19 14/16/14 +f 14/16/14 19/22/19 20/23/20 15/17/15 +f 15/18/15 20/24/20 16/19/16 11/13/11 +f 16/19/16 21/25/21 22/26/22 17/20/17 +f 17/20/17 22/26/22 23/27/23 18/21/18 +f 18/21/18 23/27/23 24/28/24 19/22/19 +f 19/22/19 24/28/24 25/29/25 20/23/20 +f 20/24/20 25/30/25 21/25/21 16/19/16 +f 21/25/21 26/31/26 27/32/27 22/26/22 +f 22/26/22 27/32/27 28/33/28 23/27/23 +f 23/27/23 28/33/28 29/34/29 24/28/24 +f 24/28/24 29/34/29 30/35/30 25/29/25 +f 25/30/25 30/36/30 26/31/26 21/25/21 +f 26/37/26 31/38/31 32/39/32 27/40/27 +f 27/40/27 32/39/32 33/41/33 28/42/28 +f 28/42/28 33/41/33 34/43/34 29/44/29 +f 29/44/29 34/43/34 35/45/35 30/46/30 +f 30/47/30 35/48/35 31/38/31 26/37/26 +f 31/38/31 36/49/36 37/50/37 32/39/32 +f 32/39/32 37/50/37 38/51/38 33/41/33 +f 33/41/33 38/51/38 39/52/39 34/43/34 +f 34/43/34 39/52/39 40/53/40 35/45/35 +f 35/48/35 40/54/40 36/49/36 31/38/31 +f 36/49/36 1/1/1 4/4/4 37/50/37 +f 37/50/37 4/4/4 6/6/6 38/51/38 +f 38/51/38 6/6/6 8/8/8 39/52/39 +f 39/52/39 8/8/8 10/10/10 40/53/40 +f 1/1/1 36/49/36 40/54/40 10/11/10 +f 41/55/41 42/56/42 43/57/43 44/58/44 +f 44/59/44 43/60/43 45/61/45 46/62/46 +f 46/62/46 45/61/45 47/63/47 48/64/48 +f 48/64/48 47/63/47 49/65/49 50/66/50 +f 41/55/41 50/66/50 49/65/49 42/56/42 +f 42/56/42 51/67/51 52/68/52 43/57/43 +f 43/60/43 52/69/52 53/70/53 45/61/45 +f 45/61/45 53/70/53 54/71/54 47/63/47 +f 47/63/47 54/71/54 55/72/55 49/65/49 +f 49/65/49 55/72/55 51/67/51 42/56/42 +f 51/67/51 56/73/56 57/74/57 52/68/52 +f 52/69/52 57/75/57 58/76/58 53/70/53 +f 53/70/53 58/76/58 59/77/59 54/71/54 +f 54/71/54 59/77/59 60/78/60 55/72/55 +f 55/72/55 60/78/60 56/73/56 51/67/51 +f 56/73/56 61/79/21 62/80/61 57/74/57 +f 57/75/57 62/81/61 63/82/62 58/76/58 +f 58/76/58 63/82/62 64/83/63 59/77/59 +f 59/77/59 64/83/63 65/84/64 60/78/60 +f 60/78/60 65/84/64 61/79/21 56/73/56 +f 61/85/21 66/86/65 67/87/66 62/88/61 +f 62/35/61 67/89/66 68/90/67 63/91/62 +f 63/91/62 68/90/67 69/92/68 64/93/63 +f 64/93/63 69/92/68 70/94/69 65/95/64 +f 65/95/64 70/94/69 66/86/65 61/85/21 +f 66/86/65 71/96/70 72/97/71 67/87/66 +f 67/89/66 72/98/71 73/99/72 68/90/67 +f 68/90/67 73/99/72 74/100/73 69/92/68 +f 69/92/68 74/100/73 75/101/74 70/94/69 +f 70/94/69 75/101/74 71/96/70 66/86/65 +f 71/96/70 76/102/75 77/103/76 72/97/71 +f 72/98/71 77/104/76 78/105/77 73/99/72 +f 73/99/72 78/105/77 79/106/78 74/100/73 +f 74/100/73 79/106/78 80/107/79 75/101/74 +f 75/101/74 80/107/79 76/102/75 71/96/70 +f 76/102/75 41/55/41 44/58/44 77/103/76 +f 77/104/76 44/59/44 46/62/46 78/105/77 +f 78/105/77 46/62/46 48/64/48 79/106/78 +f 79/106/78 48/64/48 50/66/50 80/107/79 +f 41/55/41 76/102/75 80/107/79 50/66/50 +f 81/108/80 82/109/81 83/110/82 84/111/83 +f 84/9/83 83/17/82 85/112/78 86/113/48 +f 86/113/48 85/112/78 87/114/77 88/115/46 +f 88/115/46 87/114/77 89/116/84 90/117/85 +f 81/108/80 90/117/85 89/116/84 82/109/81 +f 82/109/81 91/118/86 92/119/87 83/110/82 +f 83/17/82 92/23/87 93/120/73 85/112/78 +f 85/112/78 93/120/73 94/121/72 87/114/77 +f 87/114/77 94/121/72 95/122/88 89/116/84 +f 89/116/84 95/122/88 91/118/86 82/109/81 +f 91/118/86 96/123/65 97/124/69 92/119/87 +f 92/23/87 97/29/69 98/125/68 93/120/73 +f 93/120/73 98/125/68 99/126/67 94/121/72 +f 94/121/72 99/126/67 100/127/66 95/122/88 +f 95/122/88 100/127/66 96/123/65 91/118/86 +f 96/123/65 101/85/21 102/88/64 97/124/69 +f 97/29/69 102/35/64 103/91/63 98/125/68 +f 98/125/68 103/91/63 104/93/62 99/126/67 +f 99/126/67 104/93/62 105/95/61 100/127/66 +f 100/127/66 105/95/61 101/85/21 96/123/65 +f 101/128/21 106/129/56 107/130/60 102/131/64 +f 102/46/64 107/45/60 108/132/59 103/133/63 +f 103/133/63 108/132/59 109/134/58 104/135/62 +f 104/135/62 109/134/58 110/136/57 105/137/61 +f 105/137/61 110/136/57 106/129/56 101/128/21 +f 106/129/56 111/138/89 112/139/90 107/130/60 +f 107/45/60 112/53/90 113/140/54 108/132/59 +f 108/132/59 113/140/54 114/141/53 109/134/58 +f 109/134/58 114/141/53 115/142/91 110/136/57 +f 110/136/57 115/142/91 111/138/89 106/129/56 +f 111/138/89 116/143/92 117/144/93 112/139/90 +f 112/53/90 117/10/93 118/145/47 113/140/54 +f 113/140/54 118/145/47 119/146/45 114/141/53 +f 114/141/53 119/146/45 120/147/94 115/142/91 +f 115/142/91 120/147/94 116/143/92 111/138/89 +f 116/143/92 81/108/80 84/111/83 117/144/93 +f 117/10/93 84/9/83 86/113/48 118/145/47 +f 118/145/47 86/113/48 88/115/46 119/146/45 +f 119/146/45 88/115/46 90/117/85 120/147/94 +f 81/108/80 116/143/92 120/147/94 90/117/85 +f 121/148/95 122/149/96 123/150/97 124/151/98 +f 124/151/98 123/150/97 125/152/39 126/153/8 +f 126/153/8 125/152/39 127/154/38 128/155/6 +f 128/155/6 127/154/38 129/156/99 130/157/100 +f 121/148/95 130/103/100 129/58/99 122/149/96 +f 122/149/96 131/158/101 132/159/102 123/150/97 +f 123/150/97 132/159/102 133/160/34 125/152/39 +f 125/152/39 133/160/34 134/161/33 127/154/38 +f 127/154/38 134/161/33 135/162/103 129/156/99 +f 129/58/99 135/57/103 131/158/101 122/149/96 +f 131/158/101 136/163/26 137/164/104 132/159/102 +f 132/159/102 137/164/104 138/165/105 133/160/34 +f 133/160/34 138/165/105 139/166/28 134/161/33 +f 134/161/33 139/166/28 140/167/106 135/162/103 +f 135/57/103 140/68/106 136/163/26 131/158/101 +f 136/163/26 141/168/21 142/169/25 137/164/104 +f 137/164/104 142/169/25 143/170/24 138/165/105 +f 138/165/105 143/170/24 144/171/23 139/166/28 +f 139/166/28 144/171/23 145/172/22 140/167/106 +f 140/68/106 145/74/22 141/168/21 136/163/26 +f 141/168/21 146/173/16 147/174/107 142/169/25 +f 142/169/25 147/174/107 148/175/19 143/170/24 +f 143/170/24 148/175/19 149/176/18 144/171/23 +f 144/171/23 149/176/18 150/177/108 145/172/22 +f 145/74/22 150/80/108 146/173/16 141/168/21 +f 146/178/16 151/179/109 152/180/110 147/181/107 +f 147/181/107 152/180/110 153/182/14 148/183/19 +f 148/183/19 153/182/14 154/184/13 149/185/18 +f 149/185/18 154/184/13 155/186/111 150/187/108 +f 150/88/108 155/87/111 151/179/109 146/178/16 +f 151/179/109 156/188/112 157/189/113 152/180/110 +f 152/180/110 157/189/113 158/190/7 153/182/14 +f 153/182/14 158/190/7 159/191/5 154/184/13 +f 154/184/13 159/191/5 160/192/114 155/186/111 +f 155/87/111 160/97/114 156/188/112 151/179/109 +f 156/188/112 121/148/95 124/151/98 157/189/113 +f 157/189/113 124/151/98 126/153/8 158/190/7 +f 158/190/7 126/153/8 128/155/6 159/191/5 +f 159/191/5 128/155/6 130/157/100 160/192/114 +f 121/148/95 156/188/112 160/97/114 130/103/100 +f 161/193/80 162/194/115 163/60/82 164/59/83 +f 164/195/83 163/196/82 165/197/78 166/198/48 +f 166/198/48 165/197/78 167/199/77 168/200/46 +f 168/200/46 167/199/77 169/201/84 170/202/85 +f 161/193/80 170/202/85 169/201/84 162/194/115 +f 162/194/115 171/203/86 172/69/87 163/60/82 +f 163/196/82 172/204/87 173/205/73 165/197/78 +f 165/197/78 173/205/73 174/206/72 167/199/77 +f 167/199/77 174/206/72 175/207/88 169/201/84 +f 169/201/84 175/207/88 171/203/86 162/194/115 +f 171/203/86 176/208/116 177/75/69 172/69/87 +f 172/204/87 177/209/69 178/210/68 173/205/73 +f 173/205/73 178/210/68 179/211/67 174/206/72 +f 174/206/72 179/211/67 180/212/66 175/207/88 +f 175/207/88 180/212/66 176/208/116 171/203/86 +f 176/208/116 181/213/21 182/81/64 177/75/69 +f 177/209/69 182/214/64 183/215/63 178/210/68 +f 178/210/68 183/215/63 184/216/62 179/211/67 +f 179/211/67 184/216/62 185/217/61 180/212/66 +f 180/212/66 185/217/61 181/213/21 176/208/116 +f 181/34/21 186/218/117 187/89/60 182/35/64 +f 182/36/64 187/219/60 188/220/59 183/31/63 +f 183/31/63 188/220/59 189/221/58 184/32/62 +f 184/32/62 189/221/58 190/222/57 185/33/61 +f 185/33/61 190/222/57 186/218/117 181/34/21 +f 186/218/117 191/223/89 192/98/90 187/89/60 +f 187/219/60 192/224/90 193/225/54 188/220/59 +f 188/220/59 193/225/54 194/226/53 189/221/58 +f 189/221/58 194/226/53 195/227/91 190/222/57 +f 190/222/57 195/227/91 191/223/89 186/218/117 +f 191/223/89 196/228/92 197/104/93 192/98/90 +f 192/224/90 197/229/93 198/230/47 193/225/54 +f 193/225/54 198/230/47 199/231/45 194/226/53 +f 194/226/53 199/231/45 200/232/94 195/227/91 +f 195/227/91 200/232/94 196/228/92 191/223/89 +f 196/228/92 161/193/80 164/59/83 197/104/93 +f 197/229/93 164/195/83 166/198/48 198/230/47 +f 198/230/47 166/198/48 168/200/46 199/231/45 +f 199/231/45 168/200/46 170/202/85 200/232/94 +f 161/193/80 196/228/92 200/232/94 170/202/85 +f 201/233/1 202/234/2 203/235/118 204/236/119 +f 204/111/119 203/110/118 205/237/5 206/238/6 +f 206/238/6 205/237/5 207/239/7 208/240/8 +f 208/240/8 207/239/7 209/241/120 210/242/121 +f 201/233/1 210/242/121 209/241/120 202/234/2 +f 202/234/2 211/243/11 212/244/12 203/235/118 +f 203/110/118 212/119/12 213/245/13 205/237/5 +f 205/237/5 213/245/13 214/246/14 207/239/7 +f 207/239/7 214/246/14 215/247/15 209/241/120 +f 209/241/120 215/247/15 211/243/11 202/234/2 +f 211/243/11 216/248/16 217/249/108 212/244/12 +f 212/119/12 217/124/108 218/250/18 213/245/13 +f 213/245/13 218/250/18 219/251/19 214/246/14 +f 214/246/14 219/251/19 220/252/107 215/247/15 +f 215/247/15 220/252/107 216/248/16 211/243/11 +f 216/248/16 221/185/21 222/187/22 217/249/108 +f 217/124/108 222/88/22 223/178/23 218/250/18 +f 218/250/18 223/178/23 224/181/24 219/251/19 +f 219/251/19 224/181/24 225/183/25 220/252/107 +f 220/252/107 225/183/25 221/185/21 216/248/16 +f 221/253/21 226/254/26 227/255/106 222/256/22 +f 222/131/22 227/130/106 228/257/122 223/258/23 +f 223/258/23 228/257/122 229/259/29 224/260/24 +f 224/260/24 229/259/29 230/261/104 225/262/25 +f 225/262/25 230/261/104 226/254/26 221/253/21 +f 226/254/26 231/263/31 232/264/32 227/255/106 +f 227/130/106 232/139/32 233/265/33 228/257/122 +f 228/257/122 233/265/33 234/266/34 229/259/29 +f 229/259/29 234/266/34 235/267/123 230/261/104 +f 230/261/104 235/267/123 231/263/31 226/254/26 +f 231/263/31 236/268/36 237/269/37 232/264/32 +f 232/139/32 237/144/37 238/270/124 233/265/33 +f 233/265/33 238/270/124 239/271/125 234/266/34 +f 234/266/34 239/271/125 240/272/40 235/267/123 +f 235/267/123 240/272/40 236/268/36 231/263/31 +f 236/268/36 201/233/1 204/236/119 237/269/37 +f 237/144/37 204/111/119 206/238/6 238/270/124 +f 238/270/124 206/238/6 208/240/8 239/271/125 +f 239/271/125 208/240/8 210/242/121 240/272/40 +f 201/233/1 236/268/36 240/272/40 210/242/121 diff --git a/mods/basic_materials/plastics.lua b/mods/basic_materials/plastics.lua new file mode 100644 index 00000000..e29af53e --- /dev/null +++ b/mods/basic_materials/plastics.lua @@ -0,0 +1,56 @@ +-- Translation support +local S = minetest.get_translator("basic_materials") + +-- items + +minetest.register_craftitem("basic_materials:plastic_sheet", { + description = S("Plastic sheet"), + inventory_image = "basic_materials_plastic_sheet.png", +}) + +minetest.register_craftitem("basic_materials:plastic_strip", { + description = S("Plastic strips"), + groups = { strip = 1 }, + inventory_image = "basic_materials_plastic_strip.png", +}) + +minetest.register_craftitem("basic_materials:empty_spool", { + description = S("Empty wire spool"), + inventory_image = "basic_materials_empty_spool.png" +}) + +-- crafts + +minetest.register_craft({ + type = "cooking", + output = "basic_materials:plastic_sheet", + recipe = "basic_materials:paraffin", +}) + +minetest.register_craft({ + type = "fuel", + recipe = "basic_materials:plastic_sheet", + burntime = 30, +}) + +minetest.register_craft( { + output = "basic_materials:plastic_strip 9", + recipe = { + { "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" } + }, +}) + +minetest.register_craft( { + output = "basic_materials:empty_spool 3", + recipe = { + { "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }, + { "", "basic_materials:plastic_sheet", "" }, + { "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" } + }, +}) + +-- aliases + +minetest.register_alias("homedecor:plastic_sheeting", "basic_materials:plastic_sheet") +minetest.register_alias("homedecor:plastic_strips", "basic_materials:plastic_strip") +minetest.register_alias("homedecor:empty_spool", "basic_materials:empty_spool") diff --git a/mods/basic_materials/textures/basic_materials_brass_block.png b/mods/basic_materials/textures/basic_materials_brass_block.png new file mode 100644 index 00000000..c9378000 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_brass_block.png differ diff --git a/mods/basic_materials/textures/basic_materials_brass_ingot.png b/mods/basic_materials/textures/basic_materials_brass_ingot.png new file mode 100644 index 00000000..0bd030a3 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_brass_ingot.png differ diff --git a/mods/basic_materials/textures/basic_materials_cement_block.png b/mods/basic_materials/textures/basic_materials_cement_block.png new file mode 100644 index 00000000..6d30f477 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_cement_block.png differ diff --git a/mods/basic_materials/textures/basic_materials_chain_brass.png b/mods/basic_materials/textures/basic_materials_chain_brass.png new file mode 100644 index 00000000..e2fb20db Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_chain_brass.png differ diff --git a/mods/basic_materials/textures/basic_materials_chain_brass_inv.png b/mods/basic_materials/textures/basic_materials_chain_brass_inv.png new file mode 100644 index 00000000..8c2d554d Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_chain_brass_inv.png differ diff --git a/mods/basic_materials/textures/basic_materials_chain_steel.png b/mods/basic_materials/textures/basic_materials_chain_steel.png new file mode 100644 index 00000000..29af8dbd Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_chain_steel.png differ diff --git a/mods/basic_materials/textures/basic_materials_chain_steel_inv.png b/mods/basic_materials/textures/basic_materials_chain_steel_inv.png new file mode 100644 index 00000000..c552f7b4 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_chain_steel_inv.png differ diff --git a/mods/basic_materials/textures/basic_materials_chainlink_brass.png b/mods/basic_materials/textures/basic_materials_chainlink_brass.png new file mode 100644 index 00000000..9a1ad87e Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_chainlink_brass.png differ diff --git a/mods/basic_materials/textures/basic_materials_chainlink_steel.png b/mods/basic_materials/textures/basic_materials_chainlink_steel.png new file mode 100644 index 00000000..d7132c32 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_chainlink_steel.png differ diff --git a/mods/basic_materials/textures/basic_materials_concrete_block.png b/mods/basic_materials/textures/basic_materials_concrete_block.png new file mode 100644 index 00000000..5dd0d660 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_concrete_block.png differ diff --git a/mods/basic_materials/textures/basic_materials_copper_strip.png b/mods/basic_materials/textures/basic_materials_copper_strip.png new file mode 100644 index 00000000..22e572a1 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_copper_strip.png differ diff --git a/mods/basic_materials/textures/basic_materials_copper_wire.png b/mods/basic_materials/textures/basic_materials_copper_wire.png new file mode 100644 index 00000000..9df9f366 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_copper_wire.png differ diff --git a/mods/basic_materials/textures/basic_materials_empty_spool.png b/mods/basic_materials/textures/basic_materials_empty_spool.png new file mode 100644 index 00000000..017a94fd Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_empty_spool.png differ diff --git a/mods/basic_materials/textures/basic_materials_energy_crystal.png b/mods/basic_materials/textures/basic_materials_energy_crystal.png new file mode 100644 index 00000000..f1c28e80 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_energy_crystal.png differ diff --git a/mods/basic_materials/textures/basic_materials_gear_steel.png b/mods/basic_materials/textures/basic_materials_gear_steel.png new file mode 100644 index 00000000..584f9a51 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_gear_steel.png differ diff --git a/mods/basic_materials/textures/basic_materials_gold_wire.png b/mods/basic_materials/textures/basic_materials_gold_wire.png new file mode 100644 index 00000000..781de7b1 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_gold_wire.png differ diff --git a/mods/basic_materials/textures/basic_materials_heating_element.png b/mods/basic_materials/textures/basic_materials_heating_element.png new file mode 100644 index 00000000..42e00b7a Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_heating_element.png differ diff --git a/mods/basic_materials/textures/basic_materials_ic.png b/mods/basic_materials/textures/basic_materials_ic.png new file mode 100644 index 00000000..4c888945 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_ic.png differ diff --git a/mods/basic_materials/textures/basic_materials_motor.png b/mods/basic_materials/textures/basic_materials_motor.png new file mode 100644 index 00000000..f19ec0a0 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_motor.png differ diff --git a/mods/basic_materials/textures/basic_materials_oil_extract.png b/mods/basic_materials/textures/basic_materials_oil_extract.png new file mode 100644 index 00000000..e34623d0 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_oil_extract.png differ diff --git a/mods/basic_materials/textures/basic_materials_padlock.png b/mods/basic_materials/textures/basic_materials_padlock.png new file mode 100644 index 00000000..b05b7ef7 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_padlock.png differ diff --git a/mods/basic_materials/textures/basic_materials_paraffin.png b/mods/basic_materials/textures/basic_materials_paraffin.png new file mode 100644 index 00000000..77d2bbd1 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_paraffin.png differ diff --git a/mods/basic_materials/textures/basic_materials_plastic_sheet.png b/mods/basic_materials/textures/basic_materials_plastic_sheet.png new file mode 100644 index 00000000..034dcc2f Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_plastic_sheet.png differ diff --git a/mods/basic_materials/textures/basic_materials_plastic_strip.png b/mods/basic_materials/textures/basic_materials_plastic_strip.png new file mode 100644 index 00000000..1318dfc0 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_plastic_strip.png differ diff --git a/mods/basic_materials/textures/basic_materials_silicon.png b/mods/basic_materials/textures/basic_materials_silicon.png new file mode 100644 index 00000000..847b366c Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_silicon.png differ diff --git a/mods/basic_materials/textures/basic_materials_silver_wire.png b/mods/basic_materials/textures/basic_materials_silver_wire.png new file mode 100644 index 00000000..a38a45ea Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_silver_wire.png differ diff --git a/mods/basic_materials/textures/basic_materials_steel_bar.png b/mods/basic_materials/textures/basic_materials_steel_bar.png new file mode 100644 index 00000000..0673b6ee Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_steel_bar.png differ diff --git a/mods/basic_materials/textures/basic_materials_steel_strip.png b/mods/basic_materials/textures/basic_materials_steel_strip.png new file mode 100644 index 00000000..6384dc83 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_steel_strip.png differ diff --git a/mods/basic_materials/textures/basic_materials_steel_wire.png b/mods/basic_materials/textures/basic_materials_steel_wire.png new file mode 100644 index 00000000..0c96c8f3 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_steel_wire.png differ diff --git a/mods/basic_materials/textures/basic_materials_terracotta_base.png b/mods/basic_materials/textures/basic_materials_terracotta_base.png new file mode 100644 index 00000000..9f04aad5 Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_terracotta_base.png differ diff --git a/mods/basic_materials/textures/basic_materials_wet_cement.png b/mods/basic_materials/textures/basic_materials_wet_cement.png new file mode 100644 index 00000000..6a7fbf1b Binary files /dev/null and b/mods/basic_materials/textures/basic_materials_wet_cement.png differ diff --git a/mods/cake/LICENSE b/mods/cake/LICENSE new file mode 100644 index 00000000..51c4064e --- /dev/null +++ b/mods/cake/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 MrIbby + +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. diff --git a/mods/cake/README.md b/mods/cake/README.md new file mode 100644 index 00000000..599b07c8 --- /dev/null +++ b/mods/cake/README.md @@ -0,0 +1,15 @@ +# Minetest 5.0+ mod: cake +Adds delicious cakes to Minetest! + +## License +Copyright (c) 2015 MrIbby +- Code in licensed under the MIT license, see [LICENSE](LICENSE) for details. + +### Authors and licenses of textures +- TenPlus1 (WTFPL): + - `cake.png` + - `cake_bottom.png`, derivative + - `cake_inner.png`, derivative + - `cake_side.png`, derivative + - `cake_sugar.png` + - `cake_top.png`, derivative diff --git a/mods/cake/init.lua b/mods/cake/init.lua new file mode 100644 index 00000000..885e91ea --- /dev/null +++ b/mods/cake/init.lua @@ -0,0 +1,147 @@ +local throwable_cake = false + +-- CAKE -- + +local S = minetest.get_translator("cake") + +local sizes = {-0.4375, -0.3125, -0.1875, -0.0625, 0.0625, 0.1875, 0.3125} + +for i, size in ipairs(sizes) do + local slice = i - 1 + local name + local description + local drop + local tiles + + if slice == 0 then + name = "cake:cake" + description = S("Cake") + drop = nil + tiles = {"cake_top.png", "cake_bottom.png", "cake_side.png"} + else + name = "cake:cake_"..slice + drop = '' + tiles = {"cake_top.png", "cake_bottom.png", "cake_side.png", "cake_inner.png", "cake_side.png", "cake_side.png"} + end + + minetest.register_node(name, { + description = description, + drop = drop, + drawtype = "nodebox", + tiles = tiles, + inventory_image = "cake.png", + wield_image = "cake.png", + paramtype = "light", + is_ground_content = false, + groups = {crumbly=3}, + --sounds = sounds, + node_box = { + type = "fixed", + fixed = { + {size, -0.5, -0.4375, 0.4375, 0, 0.4375}, + } + }, + on_rightclick = function(pos, node, clicker) + clicker:set_hp(clicker:get_hp() + 1) + + if i < #sizes then + minetest.swap_node(pos, {name="cake:cake_"..i}) + else + minetest.remove_node(pos) + end + end, + }) +end + +if not minetest.get_modpath("food") then + minetest.register_craftitem("cake:sugar", { + description = S("Sugar"), + inventory_image = "cake_sugar.png", + groups = {food_sugar=1} + }) + + minetest.register_craft({ + type = "shapeless", + output = "cake:sugar", + recipe = {"default:papyrus"} + }) +else + minetest.register_alias("cake:sugar", "food:sugar") +end + +minetest.register_craft({ + type = "shapeless", + output = "cake:cake", + recipe = {"farming:flour", "group:water_bucket", "group:food_sugar", "group:food_sugar"}, + replacements = { + {"group:water_bucket", "bucket:bucket_empty"}, + + -- Not needed >0.4.13 + {"bucket:bucket_water", "bucket:bucket_empty"}, + {"bucket:bucket_river_water", "bucket:bucket_empty"} + } +}) + +-- THROWABLE CAKE -- + +minetest.register_entity("cake:cake_entity", { + physical = false, + timer = 0, + textures = {"cake.png"}, + lastpos = {}, + collisionbox = {0,0,0,0,0,0}, + on_step = function(self, dtime) + self.timer=self.timer+dtime + local pos = self.object:getpos() + local node = minetest.get_node(pos) + + if self.timer>0.2 then + local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + for k, obj in pairs(objs) do + if obj:get_luaentity() == nil or obj:get_luaentity().name ~= "cake:cake_entity" and obj:get_luaentity().name ~= "__builtin:item" then + obj:set_hp(obj:get_hp() + 7) + self.object:remove() + end + end + end + + if self.lastpos.x~=nil then + if node.name ~= "air" then + minetest.add_item(self.lastpos, 'cake:cake') + self.object:remove() + end + end + self.lastpos={x=pos.x, y=pos.y, z=pos.z} + end, +}) + +if throwable_cake then + minetest.override_item("cake:cake", { + on_use = function(itemstack, player, pointed_thing) + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end + local playerpos = player:getpos() + local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, "cake:cake_entity") + local dir = player:get_look_dir() + obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19}) + obj:setacceleration({x=dir.x*-3, y=-10, z=dir.z*-3}) + obj:setyaw(player:get_look_yaw()+math.pi) + return itemstack + end, + }) +end + +-- CAKE AWARD -- +if minetest.get_modpath("awards") then + awards.register_achievement("award_the_lie", { + title = S("The Lie"), + description = S("Craft a cake"), + icon = "cake.png", + trigger = { + type = "craft", + item = "cake:cake", + target = 1 + } + }) +end diff --git a/mods/cake/locale/cake.be.tr b/mods/cake/locale/cake.be.tr new file mode 100644 index 00000000..6005de86 --- /dev/null +++ b/mods/cake/locale/cake.be.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake= +Craft a cake= +Sugar=Цукар +The Lie= diff --git a/mods/cake/locale/cake.ca.tr b/mods/cake/locale/cake.ca.tr new file mode 100644 index 00000000..121ece75 --- /dev/null +++ b/mods/cake/locale/cake.ca.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Pastís +Craft a cake= +Sugar=Sucre +The Lie= diff --git a/mods/cake/locale/cake.cs.tr b/mods/cake/locale/cake.cs.tr new file mode 100644 index 00000000..9567b570 --- /dev/null +++ b/mods/cake/locale/cake.cs.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake= +Craft a cake= +Sugar=Cukr +The Lie= diff --git a/mods/cake/locale/cake.da.tr b/mods/cake/locale/cake.da.tr new file mode 100644 index 00000000..20e7324c --- /dev/null +++ b/mods/cake/locale/cake.da.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake= +Craft a cake= +Sugar=Sukker +The Lie= diff --git a/mods/cake/locale/cake.de.tr b/mods/cake/locale/cake.de.tr new file mode 100644 index 00000000..beaabb40 --- /dev/null +++ b/mods/cake/locale/cake.de.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Kuchen +Craft a cake= +Sugar=Zucker +The Lie= diff --git a/mods/cake/locale/cake.eo.tr b/mods/cake/locale/cake.eo.tr new file mode 100644 index 00000000..5e6c16b2 --- /dev/null +++ b/mods/cake/locale/cake.eo.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Kuko +Craft a cake= +Sugar=Sukero +The Lie= diff --git a/mods/cake/locale/cake.es.tr b/mods/cake/locale/cake.es.tr new file mode 100644 index 00000000..68e7f6e5 --- /dev/null +++ b/mods/cake/locale/cake.es.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Pastel +Craft a cake= +Sugar=Azúcar +The Lie= diff --git a/mods/cake/locale/cake.et.tr b/mods/cake/locale/cake.et.tr new file mode 100644 index 00000000..7855421e --- /dev/null +++ b/mods/cake/locale/cake.et.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Kook +Craft a cake= +Sugar=Suhkrud +The Lie= diff --git a/mods/cake/locale/cake.fr.tr b/mods/cake/locale/cake.fr.tr new file mode 100644 index 00000000..c15121e5 --- /dev/null +++ b/mods/cake/locale/cake.fr.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Gâteau +Craft a cake=Préparez un gâteau +Sugar=Sucre +The Lie=Le mensonge diff --git a/mods/cake/locale/cake.he.tr b/mods/cake/locale/cake.he.tr new file mode 100644 index 00000000..ce23d583 --- /dev/null +++ b/mods/cake/locale/cake.he.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=עוגה +Craft a cake= +Sugar=סוכר +The Lie= diff --git a/mods/cake/locale/cake.hu.tr b/mods/cake/locale/cake.hu.tr new file mode 100644 index 00000000..ee8b170f --- /dev/null +++ b/mods/cake/locale/cake.hu.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake= +Craft a cake= +Sugar=Cukor +The Lie= diff --git a/mods/cake/locale/cake.id.tr b/mods/cake/locale/cake.id.tr new file mode 100644 index 00000000..47f35877 --- /dev/null +++ b/mods/cake/locale/cake.id.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Bolu +Craft a cake= +Sugar=Gula +The Lie= diff --git a/mods/cake/locale/cake.ja.tr b/mods/cake/locale/cake.ja.tr new file mode 100644 index 00000000..35281c54 --- /dev/null +++ b/mods/cake/locale/cake.ja.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=ケーキ +Craft a cake= +Sugar=砂糖 +The Lie= diff --git a/mods/cake/locale/cake.jbo.tr b/mods/cake/locale/cake.jbo.tr new file mode 100644 index 00000000..dfbe967d --- /dev/null +++ b/mods/cake/locale/cake.jbo.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake= +Craft a cake= +Sugar=sakta +The Lie= diff --git a/mods/cake/locale/cake.ko.tr b/mods/cake/locale/cake.ko.tr new file mode 100644 index 00000000..825cd3bf --- /dev/null +++ b/mods/cake/locale/cake.ko.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=케이크 +Craft a cake= +Sugar=설탕 +The Lie= diff --git a/mods/cake/locale/cake.lt.tr b/mods/cake/locale/cake.lt.tr new file mode 100644 index 00000000..579498c8 --- /dev/null +++ b/mods/cake/locale/cake.lt.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake= +Craft a cake= +Sugar=Cukrus +The Lie= diff --git a/mods/cake/locale/cake.ms.tr b/mods/cake/locale/cake.ms.tr new file mode 100644 index 00000000..f74db939 --- /dev/null +++ b/mods/cake/locale/cake.ms.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Kek +Craft a cake= +Sugar=Gula +The Lie= diff --git a/mods/cake/locale/cake.nl.tr b/mods/cake/locale/cake.nl.tr new file mode 100644 index 00000000..1312f12b --- /dev/null +++ b/mods/cake/locale/cake.nl.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Taart +Craft a cake= +Sugar=Suiker +The Lie= diff --git a/mods/cake/locale/cake.pl.tr b/mods/cake/locale/cake.pl.tr new file mode 100644 index 00000000..456d193c --- /dev/null +++ b/mods/cake/locale/cake.pl.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Ciasto +Craft a cake= +Sugar=Cukier +The Lie= diff --git a/mods/cake/locale/cake.pt.tr b/mods/cake/locale/cake.pt.tr new file mode 100644 index 00000000..cbf7fc68 --- /dev/null +++ b/mods/cake/locale/cake.pt.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Bolo +Craft a cake= +Sugar=Açúcar +The Lie= diff --git a/mods/cake/locale/cake.ro.tr b/mods/cake/locale/cake.ro.tr new file mode 100644 index 00000000..252c3dd9 --- /dev/null +++ b/mods/cake/locale/cake.ro.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Prăjitură +Craft a cake= +Sugar=Zahăr +The Lie= diff --git a/mods/cake/locale/cake.ru.tr b/mods/cake/locale/cake.ru.tr new file mode 100644 index 00000000..6a3971fd --- /dev/null +++ b/mods/cake/locale/cake.ru.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Пирожное +Craft a cake= +Sugar=Сахар +The Lie= diff --git a/mods/cake/locale/cake.sl.tr b/mods/cake/locale/cake.sl.tr new file mode 100644 index 00000000..6a7cec39 --- /dev/null +++ b/mods/cake/locale/cake.sl.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake= +Craft a cake= +Sugar=Sladkor +The Lie= diff --git a/mods/cake/locale/cake.sv.tr b/mods/cake/locale/cake.sv.tr new file mode 100644 index 00000000..24632fd2 --- /dev/null +++ b/mods/cake/locale/cake.sv.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Kaka +Craft a cake= +Sugar=Socker +The Lie= diff --git a/mods/cake/locale/cake.sw.tr b/mods/cake/locale/cake.sw.tr new file mode 100644 index 00000000..9b813a46 --- /dev/null +++ b/mods/cake/locale/cake.sw.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Keki +Craft a cake= +Sugar=Sukari +The Lie= diff --git a/mods/cake/locale/cake.tr.tr b/mods/cake/locale/cake.tr.tr new file mode 100644 index 00000000..584da024 --- /dev/null +++ b/mods/cake/locale/cake.tr.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Pasta +Craft a cake= +Sugar=Şeker +The Lie= diff --git a/mods/cake/locale/cake.uk.tr b/mods/cake/locale/cake.uk.tr new file mode 100644 index 00000000..1e6eced2 --- /dev/null +++ b/mods/cake/locale/cake.uk.tr @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake=Тістечко +Craft a cake= +Sugar=Цукор +The Lie= diff --git a/mods/cake/locale/template.txt b/mods/cake/locale/template.txt new file mode 100644 index 00000000..25745230 --- /dev/null +++ b/mods/cake/locale/template.txt @@ -0,0 +1,9 @@ +# textdomain: cake + + +### init.lua ### + +Cake= +Craft a cake= +Sugar= +The Lie= diff --git a/mods/cake/mod.conf b/mods/cake/mod.conf new file mode 100644 index 00000000..b61d4ba7 --- /dev/null +++ b/mods/cake/mod.conf @@ -0,0 +1,4 @@ +name = cake +description = Adds delicious cakes to Minetest! +depends = bucket, farming +optional_depends = awards, food diff --git a/mods/cake/screenshot.png b/mods/cake/screenshot.png new file mode 100644 index 00000000..3307068a Binary files /dev/null and b/mods/cake/screenshot.png differ diff --git a/mods/cake/textures/cake.png b/mods/cake/textures/cake.png new file mode 100644 index 00000000..22c70d4a Binary files /dev/null and b/mods/cake/textures/cake.png differ diff --git a/mods/cake/textures/cake_bottom.png b/mods/cake/textures/cake_bottom.png new file mode 100644 index 00000000..84d8ad39 Binary files /dev/null and b/mods/cake/textures/cake_bottom.png differ diff --git a/mods/cake/textures/cake_inner.png b/mods/cake/textures/cake_inner.png new file mode 100644 index 00000000..f1d0b52b Binary files /dev/null and b/mods/cake/textures/cake_inner.png differ diff --git a/mods/cake/textures/cake_side.png b/mods/cake/textures/cake_side.png new file mode 100644 index 00000000..87902d1d Binary files /dev/null and b/mods/cake/textures/cake_side.png differ diff --git a/mods/cake/textures/cake_sugar.png b/mods/cake/textures/cake_sugar.png new file mode 100644 index 00000000..5cb7fa01 Binary files /dev/null and b/mods/cake/textures/cake_sugar.png differ diff --git a/mods/cake/textures/cake_top.png b/mods/cake/textures/cake_top.png new file mode 100644 index 00000000..764566f2 Binary files /dev/null and b/mods/cake/textures/cake_top.png differ diff --git a/mods/carpets/LICENSE b/mods/carpets/LICENSE new file mode 100644 index 00000000..8000a6fa --- /dev/null +++ b/mods/carpets/LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library 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; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random + Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/mods/carpets/README.md b/mods/carpets/README.md new file mode 100644 index 00000000..9d6700cc --- /dev/null +++ b/mods/carpets/README.md @@ -0,0 +1,15 @@ +# Carpets mod for minetest + +This mod adds 15 colorized wool carpets to the minetest. + +![](https://github.com/bell07/minetest-carpets/blob/master/screenshot.png) + +Maintained version, based on https://forum.minetest.net/viewtopic.php?t=15459 and https://forum.minetest.net/viewtopic.php?f=11&t=11637 + +License: LGPL-2.1+. + +The mod provides an api to register more carpets using template nodes +Example: +```lua +carpets.register('default:dirt', {description=S('Carpet dirt')}) -- registers carpet looks like dirt +``` diff --git a/mods/carpets/api.lua b/mods/carpets/api.lua new file mode 100644 index 00000000..5f1baca3 --- /dev/null +++ b/mods/carpets/api.lua @@ -0,0 +1,56 @@ +local carpet_proto = { + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.45, 0.5} + }, + groups = { + snappy = 2, + flammable = 3, + oddly_breakable_by_hand = 3, + choppy = 2, + carpet = 1, + } +} + +-- Register the carpet and recipe using material +-- material - already registered material item the textures and sounds applied from +-- def - optional additional - or overriding data passed to minetest.register_node() +carpets = {} + +function carpets.register(material, def) + local node = table.copy(carpet_proto) + if def then + for k,v in pairs(def) do + node[k] = v + end + end + + local material_def = minetest.registered_nodes[material] + node.description = node.description or material_def.description.." Carpet" + node.sounds = table.copy(node.sounds or material_def.sounds or default.node_sound_defaults()) + node.groups = table.copy(node.groups) + + if node.tiles then + node.tiles = table.copy(node.tiles) + elseif material_def.tiles[6] then + node.tiles = {material_def.tiles[6]} + else + node.tiles = table.copy(material_def.tiles) + end + + local name = "carpet:" .. (node.name or material:gsub(":", "_")) + node.name = nil + + minetest.register_node(":" .. name, node) + + minetest.register_craft({ + output = name .. " 32", + recipe = { + {"group:wool", "group:wool", "group:wool"}, + {"group:wool", material, "group:wool"} + } + }) +end diff --git a/mods/carpets/init.lua b/mods/carpets/init.lua new file mode 100644 index 00000000..45eb5d2f --- /dev/null +++ b/mods/carpets/init.lua @@ -0,0 +1,26 @@ +local modpath = minetest.get_modpath(minetest.get_current_modname()) +local S = minetest.get_translator("carpets") +dofile(modpath .. "/api.lua") + +if minetest.get_modpath("wool") then + local nodes = { + {name="wool:black", description=S("Black Carpet")}, + {name="wool:blue", description=S("Blue Carpet")}, + {name="wool:brown", description=S("Brown Carpet")}, + {name="wool:cyan", description=S("Cyan Carpet")}, + {name="wool:dark_green", description=S("Dark Green Carpet")}, + {name="wool:dark_grey", description=S("Dark Grey Carpet")}, + {name="wool:green", description=S("Green Carpet")}, + {name="wool:grey", description=S("Grey Carpet")}, + {name="wool:magenta", description=S("Magenta Carpet")}, + {name="wool:orange", description=S("Orange Carpet")}, + {name="wool:pink", description=S("Pink Carpet")}, + {name="wool:red", description=S("Red Carpet")}, + {name="wool:violet", description=S("Violet Carpet")}, + {name="wool:white", description=S("White Carpet")}, + {name="wool:yellow", description=S("Yellow Carpet")}, + } + for _, node in ipairs(nodes) do + carpets.register(node.name, {description=node.description}) + end +end diff --git a/mods/carpets/locale/carpets.fr.tr b/mods/carpets/locale/carpets.fr.tr new file mode 100644 index 00000000..c1b1c6d6 --- /dev/null +++ b/mods/carpets/locale/carpets.fr.tr @@ -0,0 +1,20 @@ +# textdomain: carpets + + +### init.lua ### + +Black Carpet=Tapis noir +Blue Carpet=Tapis bleu +Brown Carpet=Tapis marron +Cyan Carpet=Tapis cyan +Dark Green Carpet=Tapis vert foncé +Dark Grey Carpet=Tapis gris foncé +Green Carpet=Tapis vert +Grey Carpet=Tapis gris +Magenta Carpet=Tapis magenta +Orange Carpet=Tapis orange +Pink Carpet=Tapis rose +Red Carpet=Tapis rouge +Violet Carpet=Tapis violet +White Carpet=Tapis blanc +Yellow Carpet=Tapis jaune diff --git a/mods/carpets/locale/template.txt b/mods/carpets/locale/template.txt new file mode 100644 index 00000000..292224a5 --- /dev/null +++ b/mods/carpets/locale/template.txt @@ -0,0 +1,20 @@ +# textdomain: carpets + + +### init.lua ### + +Black Carpet= +Blue Carpet= +Brown Carpet= +Cyan Carpet= +Dark Green Carpet= +Dark Grey Carpet= +Green Carpet= +Grey Carpet= +Magenta Carpet= +Orange Carpet= +Pink Carpet= +Red Carpet= +Violet Carpet= +White Carpet= +Yellow Carpet= diff --git a/mods/carpets/mod.conf b/mods/carpets/mod.conf new file mode 100644 index 00000000..5540f748 --- /dev/null +++ b/mods/carpets/mod.conf @@ -0,0 +1,3 @@ +name = carpets +description = Adds 16 colorized wool carpets to the minetest. +optional_depends = wool diff --git a/mods/carpets/screenshot.png b/mods/carpets/screenshot.png new file mode 100644 index 00000000..e9d876ea Binary files /dev/null and b/mods/carpets/screenshot.png differ diff --git a/mods/castle_masonry/LICENSE b/mods/castle_masonry/LICENSE new file mode 100644 index 00000000..5c3c583c --- /dev/null +++ b/mods/castle_masonry/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Minetest Mods Team + +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. diff --git a/mods/castle_masonry/README.md b/mods/castle_masonry/README.md new file mode 100644 index 00000000..0a6c5520 --- /dev/null +++ b/mods/castle_masonry/README.md @@ -0,0 +1,38 @@ +## Castle Masonry + +by: Philipbenr, DanDuncombe, FaceDeer + +Licence: MIT + +This is a mod all about creating castles and castle dungeons. Many of the nodes are used for the outer-walls or dungeons. + +Contains: + +* Walls, Corner-walls, +* Castlestone Stairs, Slabs, and Pillars +* Arrowslits and embrasures +* Rubble (to fill the interior of thick castle walls) +* Murder holes and machicolations +* Pillars and crossbraces +* Roof slate +* Paving stone +* Dungeon stone + +Mod settings can allow for the basic castle masonry forms to be made for the following material types (all optional): + +* Cobble +* Desert stone +* Desert stone brick +* Sandstone +* Sandstone brick +* Desert Sandstone +* Desert Sandstone brick +* Silver Sandstone +* Silver Sandstone brick +* Stone +* Stone brick +* Castle wall +* Wood +* Snow +* Ice +* Obsidian Brick diff --git a/mods/castle_masonry/arrow_slits.lua b/mods/castle_masonry/arrow_slits.lua new file mode 100644 index 00000000..24050691 --- /dev/null +++ b/mods/castle_masonry/arrow_slits.lua @@ -0,0 +1,178 @@ + +-- Used for localization, choose either built-in or intllib. + +local MP, S, NS = nil + +if (minetest.get_modpath("intllib") == nil) then + S = minetest.get_translator("castle_masonry") + +else + -- internationalization boilerplate + MP = minetest.get_modpath(minetest.get_current_modname()) + S, NS = dofile(MP.."/intllib.lua") + +end + + +castle_masonry.register_arrowslit = function(material) + local composition_def, burn_time, tile, desc = castle_masonry.get_material_properties(material) + local mod_name = minetest.get_current_modname() + + -- Node Definition + minetest.register_node(mod_name..":arrowslit_"..material.name, { + drawtype = "nodebox", + description = S("@1 Arrowslit", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.375, 0.5, -0.0625, 0.375, 0.3125}, + {0.0625, -0.375, 0.5, 0.5, 0.375, 0.3125}, + {-0.5, 0.375, 0.5, 0.5, 0.5, 0.3125}, + {-0.5, -0.5, 0.5, 0.5, -0.375, 0.3125}, + {0.25, -0.5, 0.3125, 0.5, 0.5, 0.125}, + {-0.5, -0.5, 0.3125, -0.25, 0.5, 0.125}, + }, + }, + }) + + minetest.register_node(mod_name..":arrowslit_"..material.name.."_cross", { + drawtype = "nodebox", + description = S("@1 Arrowslit with Cross", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.125, 0.5, -0.0625, 0.375, 0.3125}, + {0.0625, -0.125, 0.5, 0.5, 0.375, 0.3125}, + {-0.5, 0.375, 0.5, 0.5, 0.5, 0.3125}, + {-0.5, -0.5, 0.5, 0.5, -0.375, 0.3125}, + {0.0625, -0.375, 0.5, 0.5, -0.25, 0.3125}, + {-0.5, -0.375, 0.5, -0.0625, -0.25, 0.3125}, + {-0.5, -0.25, 0.5, -0.1875, -0.125, 0.3125}, + {0.1875, -0.25, 0.5, 0.5, -0.125, 0.3125}, + {0.25, -0.5, 0.3125, 0.5, 0.5, 0.125}, + {-0.5, -0.5, 0.3125, -0.25, 0.5, 0.125}, + }, + }, + }) + + minetest.register_node(mod_name..":arrowslit_"..material.name.."_hole", { + drawtype = "nodebox", + description = S("@1 Arrowslit with Hole", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.375, 0.5, -0.125, 0.375, 0.3125}, + {0.125, -0.375, 0.5, 0.5, 0.375, 0.3125}, + {-0.5, -0.5, 0.5, 0.5, -0.375, 0.3125}, + {0.0625, -0.125, 0.5, 0.125, 0.375, 0.3125}, + {-0.125, -0.125, 0.5, -0.0625, 0.375, 0.3125}, + {-0.5, 0.375, 0.5, 0.5, 0.5, 0.3125}, + {0.25, -0.5, 0.3125, 0.5, 0.5, 0.125}, + {-0.5, -0.5, 0.3125, -0.25, 0.5, 0.125}, + }, + }, + }) + + minetest.register_node(mod_name..":arrowslit_"..material.name.."_embrasure", { + drawtype = "nodebox", + description = S("@1 Embrasure", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.25, -0.5, 0.375, -0.125, 0.5, 0.5}, + {0.125, -0.5, 0.375, 0.25, 0.5, 0.5}, + {0.25, -0.5, 0.25, 0.5, 0.5, 0.5}, + {0.375, -0.5, 0.125, 0.5, 0.5, 0.25}, + {-0.5, -0.5, 0.25, -0.25, 0.5, 0.5}, + {-0.5, -0.5, 0.125, -0.375, 0.5, 0.25}, + }, + }, + }) + + minetest.register_craft({ + output = mod_name..":arrowslit_"..material.name.." 6", + recipe = { + {material.craft_material,"", material.craft_material}, + {material.craft_material,"", material.craft_material}, + {material.craft_material,"", material.craft_material} }, + }) + + minetest.register_craft({ + output = mod_name..":arrowslit_"..material.name.."_cross", + recipe = { + {mod_name..":arrowslit_"..material.name} }, + }) + minetest.register_craft({ + output = mod_name..":arrowslit_"..material.name.."_hole", + recipe = { + {mod_name..":arrowslit_"..material.name.."_cross"} }, + }) + minetest.register_craft({ + output = mod_name..":arrowslit_"..material.name.."_embrasure", + recipe = { + {mod_name..":arrowslit_"..material.name.."_hole"} }, + }) + minetest.register_craft({ + output = mod_name..":arrowslit_"..material.name, + recipe = { + {mod_name..":arrowslit_"..material.name.."_embrasure"} }, + }) + + if burn_time > 0 then + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":arrowslit_"..material.name, + burntime = burn_time, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":arrowslit_"..material.name.."_cross", + burntime = burn_time, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":arrowslit_"..material.name.."_hole", + burntime = burn_time, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":arrowslit_"..material.name.."_embrasure", + burntime = burn_time, + }) + end +end + + +castle_masonry.register_arrowslit_alias = function(old_mod_name, old_material_name, new_mod_name, new_material_name) + minetest.register_alias(old_mod_name..":arrowslit_"..old_material_name, new_mod_name..":arrowslit_"..new_material_name) + minetest.register_alias(old_mod_name..":arrowslit_"..old_material_name.."_cross", new_mod_name..":arrowslit_"..new_material_name.."_cross") + minetest.register_alias(old_mod_name..":arrowslit_"..old_material_name.."_hole", new_mod_name..":arrowslit_"..new_material_name.."_hole") + minetest.register_alias(old_mod_name..":arrowslit_"..old_material_name.."_embrasure", new_mod_name..":arrowslit_"..new_material_name.."_embrasure") +end + +castle_masonry.register_arrowslit_alias_force = function(old_mod_name, old_material_name, new_mod_name, new_material_name) + minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name, new_mod_name..":arrowslit_"..new_material_name) + minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name.."_cross", new_mod_name..":arrowslit_"..new_material_name.."_cross") + minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name.."_hole", new_mod_name..":arrowslit_"..new_material_name.."_hole") + minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name.."_embrasure", new_mod_name..":arrowslit_"..new_material_name.."_embrasure") +end diff --git a/mods/castle_masonry/i18n.py b/mods/castle_masonry/i18n.py new file mode 100644 index 00000000..957804a9 --- /dev/null +++ b/mods/castle_masonry/i18n.py @@ -0,0 +1,218 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Script to generate the template file and update the translation files. +# Copy the script into the mod or modpack root folder and run it there. +# +# Copyright (C) 2019 Joachim Stolberg +# LGPLv2.1+ + +from __future__ import print_function +import os, fnmatch, re, shutil, errno + +#group 2 will be the string, groups 1 and 3 will be the delimiters (" or ') +#See https://stackoverflow.com/questions/46967465/regex-match-text-in-either-single-or-double-quote +#TODO: support [[]] delimiters +pattern_lua = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*(["\'])((?:\\\1|(?:(?!\1)).)*)(\1)[\s,\)]', re.DOTALL) + +# Handles "concatenation" .. " of strings" +pattern_concat = re.compile(r'["\'][\s]*\.\.[\s]*["\']', re.DOTALL) + +pattern_tr = re.compile(r'(.+?[^@])=(.+)') +pattern_name = re.compile(r'^name[ ]*=[ ]*([^ \n]*)') +pattern_tr_filename = re.compile(r'\.tr$') +pattern_po_language_code = re.compile(r'(.*)\.po$') + +#attempt to read the mod's name from the mod.conf file. Returns None on failure +def get_modname(folder): + try: + with open(folder + "mod.conf", "r", encoding='utf-8') as mod_conf: + for line in mod_conf: + match = pattern_name.match(line) + if match: + return match.group(1) + except FileNotFoundError: + pass + return None + +#If there are already .tr files in /locale, returns a list of their names +def get_existing_tr_files(folder): + out = [] + for root, dirs, files in os.walk(folder + 'locale/'): + for name in files: + if pattern_tr_filename.search(name): + out.append(name) + return out + +# A series of search and replaces that massage a .po file's contents into +# a .tr file's equivalent +def process_po_file(text): + # The first three items are for unused matches + text = re.sub(r'#~ msgid "', "", text) + text = re.sub(r'"\n#~ msgstr ""\n"', "=", text) + text = re.sub(r'"\n#~ msgstr "', "=", text) + # comment lines + text = re.sub(r'#.*\n', "", text) + # converting msg pairs into "=" pairs + text = re.sub(r'msgid "', "", text) + text = re.sub(r'"\nmsgstr ""\n"', "=", text) + text = re.sub(r'"\nmsgstr "', "=", text) + # various line breaks and escape codes + text = re.sub(r'"\n"', "", text) + text = re.sub(r'"\n', "\n", text) + text = re.sub(r'\\"', '"', text) + text = re.sub(r'\\n', '@n', text) + # remove header text + text = re.sub(r'=Project-Id-Version:.*\n', "", text) + # remove double-spaced lines + text = re.sub(r'\n\n', '\n', text) + return text + +# Go through existing .po files and, if a .tr file for that language +# *doesn't* exist, convert it and create it. +# The .tr file that results will subsequently be reprocessed so +# any "no longer used" strings will be preserved. +# Note that "fuzzy" tags will be lost in this process. +def process_po_files(folder, modname): + for root, dirs, files in os.walk(folder + 'locale/'): + for name in files: + code_match = pattern_po_language_code.match(name) + if code_match == None: + continue + language_code = code_match.group(1) + tr_name = modname + "." + language_code + ".tr" + tr_file = os.path.join(root, tr_name) + if os.path.exists(tr_file): + print(tr_name + " already exists, ignoring " + name) + continue + fname = os.path.join(root, name) + with open(fname, "r", encoding='utf-8') as po_file: + print("Importing translations from " + name) + text = process_po_file(po_file.read()) + with open(tr_file, "wt", encoding='utf-8') as tr_out: + tr_out.write(text) + +# from https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python/600612#600612 +# Creates a directory if it doesn't exist, silently does +# nothing if it already exists +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: raise + +# Writes a template.txt file +def write_template(templ_file, lkeyStrings): + lOut = [] + lkeyStrings.sort() + for s in lkeyStrings: + lOut.append("%s=" % s) + mkdir_p(os.path.dirname(templ_file)) + with open(templ_file, "wt", encoding='utf-8') as template_file: + template_file.write("\n".join(lOut)) + +# Gets all translatable strings from a lua file +def read_lua_file_strings(lua_file): + lOut = [] + with open(lua_file, encoding='utf-8') as text_file: + text = text_file.read() + text = re.sub(pattern_concat, "", text) + for s in pattern_lua.findall(text): + s = s[1] + s = re.sub(r'"\.\.\s+"', "", s) + s = re.sub("@[^@=0-9]", "@@", s) + s = s.replace('\\"', '"') + s = s.replace("\\'", "'") + s = s.replace("\n", "@n") + s = s.replace("\\n", "@n") + s = s.replace("=", "@=") + lOut.append(s) + return lOut + +# Gets strings from an existing translation file +def import_tr_file(tr_file): + dOut = {} + if os.path.exists(tr_file): + with open(tr_file, "r", encoding='utf-8') as existing_file : + for line in existing_file.readlines(): + s = line.strip() + if s == "" or s[0] == "#": + continue + match = pattern_tr.match(s) + if match: + dOut[match.group(1)] = match.group(2) + return dOut + +# Walks all lua files in the mod folder, collects translatable strings, +# and writes it to a template.txt file +def generate_template(folder): + lOut = [] + for root, dirs, files in os.walk(folder): + for name in files: + if fnmatch.fnmatch(name, "*.lua"): + fname = os.path.join(root, name) + found = read_lua_file_strings(fname) + print(fname + ": " + str(len(found)) + " translatable strings") + lOut.extend(found) + lOut = list(set(lOut)) + lOut.sort() + if len(lOut) == 0: + return None + templ_file = folder + "locale/template.txt" + write_template(templ_file, lOut) + return lOut + +# Updates an existing .tr file, copying the old one to a ".old" file +def update_tr_file(lNew, mod_name, tr_file): + print("updating " + tr_file) + lOut = ["# textdomain: %s\n" % mod_name] + + #TODO only make a .old if there are actual changes from the old file + if os.path.exists(tr_file): + shutil.copyfile(tr_file, tr_file+".old") + + dOld = import_tr_file(tr_file) + for key in lNew: + val = dOld.get(key, "") + lOut.append("%s=%s" % (key, val)) + lOut.append("##### not used anymore #####") + for key in dOld: + if key not in lNew: + lOut.append("%s=%s" % (key, dOld[key])) + with open(tr_file, "w", encoding='utf-8') as new_tr_file: + new_tr_file.write("\n".join(lOut)) + +# Updates translation files for the mod in the given folder +def update_mod(folder): + modname = get_modname(folder) + if modname is not None: + process_po_files(folder, modname) + print("Updating translations for " + modname) + data = generate_template(folder) + if data == None: + print("No translatable strings found in " + modname) + else: + for tr_file in get_existing_tr_files(folder): + update_tr_file(data, modname, folder + "locale/" + tr_file) + else: + print("Unable to find modname in folder " + folder) + +def update_folder(folder): + is_modpack = os.path.exists(folder+"modpack.txt") or os.path.exists(folder+"modpack.conf") + if is_modpack: + subfolders = [f.path for f in os.scandir(folder) if f.is_dir()] + for subfolder in subfolders: + update_mod(subfolder + "/") + else: + update_mod(folder) + print("Done.") + + +update_folder("./") + +# Runs this script on each sub-folder in the parent folder. +# I'm using this for testing this script on all installed mods. +#for modfolder in [f.path for f in os.scandir("../") if f.is_dir()]: +# update_folder(modfolder + "/") diff --git a/mods/castle_masonry/init.lua b/mods/castle_masonry/init.lua new file mode 100644 index 00000000..600a44fc --- /dev/null +++ b/mods/castle_masonry/init.lua @@ -0,0 +1,162 @@ +castle_masonry = {} + +local MP = minetest.get_modpath(minetest.get_current_modname()) +dofile(MP.."/pillars.lua") +dofile(MP.."/arrow_slits.lua") +dofile(MP.."/murder_holes.lua") +dofile(MP.."/stone_wall.lua") +dofile(MP.."/paving.lua") + + +-- Used for localization, choose either built-in or intllib. + +local S, NS = nil + +if (minetest.get_modpath("intllib") == nil) then + S = minetest.get_translator("castle_masonry") + +else + -- internationalization boilerplate + S, NS = dofile(MP.."/intllib.lua") + +end + + +local read_setting = function(name, default) + local setting = minetest.settings:get_bool(name) + if setting == nil then return default end + return setting +end + +-- Material definition: +-- { +-- name=, -- the name that will be part of the resulting node names +-- desc=, -- Player-facing name of the material +-- tile=, -- Optional - the texture tile to use for the resulting blocks (can be a single texture or a table, as a normal node definition's tile def). If not set this will be taken from the material it's made out of. +-- craft_material=, -- What source block is used to craft these blocks. +-- composition_material=, -- Optional, this will override the properties of the product with a specific material. Useful if you want to use a group for the craft material (eg, "group:wood") +--} + +castle_masonry.materials = {} +if read_setting("castle_masonry_stonewall", true) then + table.insert(castle_masonry.materials, {name="stonewall", desc=S("Stonewall"), tile="castle_stonewall.png", craft_material="castle_masonry:stonewall"}) +end +if read_setting("castle_masonry_cobble", true) then + table.insert(castle_masonry.materials, {name="cobble", desc=S("Cobble"), tile="default_cobble.png", craft_material="default:cobble"}) +end +if read_setting("castle_masonry_stonebrick", true) then + table.insert(castle_masonry.materials, {name="stonebrick", desc=S("Stonebrick"), tile="default_stone_brick.png", craft_material="default:stonebrick"}) +end +if read_setting("castle_masonry_sandstonebrick", true) then + table.insert(castle_masonry.materials, {name="sandstonebrick", desc=S("Sandstone Brick"), tile="default_sandstone_brick.png", craft_material="default:sandstonebrick"}) +end +if read_setting("castle_masonry_desertstonebrick", true) then + table.insert(castle_masonry.materials, {name="desertstonebrick", desc=S("Desert Stone Brick"), tile="default_desert_stone_brick.png", craft_material="default:desert_stonebrick"}) +end +if read_setting("castle_masonry_desertsandstonebrick", true) then + table.insert(castle_masonry.materials, {name="desertsandstonebrick", desc=S("Desert Sandstone Brick"), tile="default_desert_sandstone_brick.png", craft_material="default:desert_sandstone_brick"}) +end +if read_setting("castle_masonry_silversandstonebrick", true) then + table.insert(castle_masonry.materials, {name="silversandstonebrick", desc=S("Silver Sandstone Brick"), tile="default_silver_sandstone_brick.png", craft_material="default:silver_sandstone_brick"}) +end +if read_setting("castle_masonry_stone", true) then + table.insert(castle_masonry.materials, {name="stone", desc=S("Stone"), tile="default_stone.png", craft_material="default:stone"}) +end +if read_setting("castle_masonry_sandstone", true) then + table.insert(castle_masonry.materials, {name="sandstone", desc=S("Sandstone"), tile="default_sandstone.png", craft_material="default:sandstone"}) +end +if read_setting("castle_masonry_desertstone", true) then + table.insert(castle_masonry.materials, {name="desertstone", desc=S("Desert Stone"), tile="default_desert_stone.png", craft_material="default:desert_stone"}) +end +if read_setting("castle_masonry_desertsandstone", true) then + table.insert(castle_masonry.materials, {name="desertsandstone", desc=S("Desert Sandstone"), tile="default_desert_sandstone.png", craft_material="default:desert_sandstone"}) +end +if read_setting("castle_masonry_silversandstone", true) then + table.insert(castle_masonry.materials, {name="silversandstone", desc=S("Silver Sandstone"), tile="default_silver_sandstone.png", craft_material="default:silver_sandstone"}) +end +if read_setting("castle_masonry_wood", false) then + table.insert(castle_masonry.materials, {name="wood", desc=S("Wood"), tile="default_wood.png", craft_material="group:wood", composition_material="default:wood"}) +end +if read_setting("castle_masonry_ice", false) then + table.insert(castle_masonry.materials, {name="ice", desc=S("Ice"), tile="default_ice.png", craft_material="default:ice"}) +end +if read_setting("castle_masonry_snow", false) then + table.insert(castle_masonry.materials, {name="snow", desc=S("Snow"), tile="default_snow.png", craft_material="default:snow"}) +end +if read_setting("castle_masonry_obsidianbrick", false) then + table.insert(castle_masonry.materials, {name="obsidianbrick", desc=S("Obsidian Brick"), tile="default_obsidian_brick.png", craft_material="default:obsidianbrick"}) +end + +castle_masonry.get_material_properties = function(material) + local composition_def + local burn_time + if material.composition_material ~= nil then + composition_def = minetest.registered_nodes[material.composition_material] + burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.composition_material)}}).time + else + composition_def = minetest.registered_nodes[material.craft_material] + burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.craft_material)}}).time + end + + local tiles = material.tile + if tiles == nil then + tiles = composition_def.tile + elseif type(tiles) == "string" then + tiles = {tiles} + end + + local desc = material.desc + if desc == nil then + desc = composition_def.description + end + + return composition_def, burn_time, tiles, desc +end + + +if read_setting("castle_masonry_pillar", true) then + for _, material in pairs(castle_masonry.materials) do + castle_masonry.register_pillar(material) + end +end + +if read_setting("castle_masonry_arrowslit", true) then + for _, material in pairs(castle_masonry.materials) do + castle_masonry.register_arrowslit(material) + end +end + +if read_setting("castle_masonry_murderhole", true) then + for _, material in pairs(castle_masonry.materials) do + castle_masonry.register_murderhole(material) + end +end + +minetest.register_alias("castle:pillars_bottom", "castle_masonry:pillars_stonewall_bottom") +minetest.register_alias("castle:pillars_top", "castle_masonry:pillars_stonewall_top") +minetest.register_alias("castle:pillars_middle", "castle_masonry:pillars_stonewall_middle") +minetest.register_alias("castle:arrowslit", "castle_masonry:arrowslit_stonewall") +minetest.register_alias("castle:arrowslit_hole", "castle_masonry:arrowslit_stonewall_hole") +minetest.register_alias("castle:arrowslit_cross", "castle_masonry:arrowslit_stonewall_cross") + +for _, material in pairs(castle_masonry.materials) do + castle_masonry.register_murderhole_alias("castle", material.name, "castle_masonry", material.name) + castle_masonry.register_pillar_alias("castle", material.name, "castle_masonry", material.name) + + -- Arrowslit upgrade has special handling because the castle mod arrow slit is reversed relative to current build-from-inside standard + local lbm_def = { + name = "castle_masonry:arrowslit_flip_front_to_back"..material.name, + nodenames = { + "castle:arrowslit_"..material.name, + "castle:arrowslit_"..material.name.."_cross", + "castle:arrowslit_"..material.name.."_hole", + }, + action = function(pos, node) + local flip_front_to_back = {[0]=2, 3, 0, 1, 6, 7, 4, 5, 10, 7, 8, 9, 14, 15, 12, 13, 18, 19, 16, 17, 22, 23, 20, 21} + node.param2 = flip_front_to_back[node.param2] + node.name = "castle_masonry" .. string.sub(node.name, 7, -1) + minetest.swap_node(pos, node) + end + } + minetest.register_lbm(lbm_def) +end diff --git a/mods/3d_armor/3d_armor/intllib.lua b/mods/castle_masonry/intllib.lua similarity index 100% rename from mods/3d_armor/3d_armor/intllib.lua rename to mods/castle_masonry/intllib.lua diff --git a/mods/castle_masonry/locale/castle_masonry.es.tr b/mods/castle_masonry/locale/castle_masonry.es.tr new file mode 100644 index 00000000..01a9561d --- /dev/null +++ b/mods/castle_masonry/locale/castle_masonry.es.tr @@ -0,0 +1,50 @@ +# textdomain: castle_masonry + +@1 Arrowslit=Aspillera de @1 +@1 Arrowslit with Cross=Aspillera con Crus de @1 +@1 Arrowslit with Hole=Aspillera con Agujero de @1 +@1 Crossbrace=Viga de @1 +@1 Embrasure=Aféizar de @1 +@1 Extended Crossbrace=Viga Extendida de @1 +@1 Half Pillar Base=Base de Medio Pilar de @1 +@1 Half Pillar Middle=Medio del Medio Pilar de @1 +@1 Half Pillar Top=Parte Superior de Medio Pilar @1 +@1 Machicolation=Matacán de @1 +@1 Murder Hole=Agujero de @1 +@1 Pillar Base=Base de Pilar de @1 +@1 Pillar Middle=Medio Pilar de @1 +@1 Pillar Top=Parte Superior de Pilar de @1 +Castle Corner=Esquina de Castillo +Castle Pavement Slab=Pavimento de Castillo +Castle Pavement Stair=Escalera de Castillo Pavimentada +Castle Rubble=Escombros de Castillo +Castle Rubble Slab=Losa de Escombro de Castillo +Castle Rubble Stair=Escalera de Escombro de Castillo +Castle Stonewall Slab=Losa de Pared de Castillo +Castle Stonewall Stair=Escalera de Pared de Castillo +Castle Wall=Pared de Castillo +Cobble=Adoquín +Desert Sandstone=Piedra del Desierto +Desert Sandstone Brick=Ladrillo de Piedra del Desierto +Desert Stone=Piedra del Desierto +Desert Stone Brick=Ladrillo de Piedra del Desierto +Dungeon Stone=Piedra de Mazmorra +Dungeon Stone Slab=Losa de Piedra de Mazmorra +Dungeon Stone Stair=Escalera de Piedra de Mazmorra +Ice=Hielo +Obsidian Brick=Ladrillo de Obsidiana +Pavement Brick=Ladrillo Pavimentado +Paving Stone=Piedra Pavimentada +Roof Slates=Pizarras de Techo +Rubble=Escombros +Sandstone=Arenisca +Sandstone Brick=Ladrillo de Arenisca +Silver Sandstone=Arenisca +Silver Sandstone Brick=Ladrillo de Arenisca +Snow=Nieve +Stone=Piedra +Stone Wall=Pared de Piedra +Stonebrick=Ladrillo de Piedra +Stonewall=Pared de piedra +Wood=Madera +##### not used anymore ##### \ No newline at end of file diff --git a/mods/castle_masonry/locale/castle_masonry.fr.tr b/mods/castle_masonry/locale/castle_masonry.fr.tr new file mode 100644 index 00000000..4889e2ff --- /dev/null +++ b/mods/castle_masonry/locale/castle_masonry.fr.tr @@ -0,0 +1,50 @@ +# textdomain: castle_masonry + +@1 Arrowslit=Meurtrière en @1 +@1 Arrowslit with Cross=Meurtrière en croix en @1 +@1 Arrowslit with Hole=Meurtrière avec trou en @1 +@1 Crossbrace=Travers en @1 +@1 Embrasure=Embrasure en @1 +@1 Extended Crossbrace=Travers entendu en @1 +@1 Half Pillar Base=Base de demi pilier en @1 +@1 Half Pillar Middle=Milieu de demi pilier en @1 +@1 Half Pillar Top=Haut de demi pilier en @1 +@1 Machicolation=Machicoulis en @1 +@1 Murder Hole=Trou en @1 +@1 Pillar Base=Base de pilier en @1 +@1 Pillar Middle=Milieu de pilier en @1 +@1 Pillar Top=Haut de pilier en @1 +Castle Corner=Angle de chateau +Castle Pavement Slab=Dalle de chateau pavé +Castle Pavement Stair=Escaliers de chateau pavé +Castle Rubble=Gravats de chateau +Castle Rubble Slab=Dalle en gravats de chateau +Castle Rubble Stair=Escalier en gravats de chateau +Castle Stonewall Slab=Dalle en pierre brune +Castle Stonewall Stair=Escalier en pierre brune +Castle Wall=Pierre brune +Cobble=Pavé +Desert Sandstone=Pierre du désert +Desert Sandstone Brick=Brique de pierre du désert +Desert Stone=Pierre du désert +Desert Stone Brick=Brique de pierre du désert +Dungeon Stone=Pierre de dongeon +Dungeon Stone Slab=Dalle en pierre de dongeon +Dungeon Stone Stair=Escalier en pierre de dongeon +Ice=Glace +Obsidian Brick=Brique d'obsidienne +Pavement Brick=Brique de pavage +Paving Stone=Pierre de pavage +Roof Slates=Toiture en ardoise +Rubble=Décombre +Sandstone=Grès +Sandstone Brick=Brique de grès +Silver Sandstone=Grès +Silver Sandstone Brick=Brique de grès +Snow=Neige +Stone=Pierre +Stone Wall=Mur de pierre +Stonebrick=Brique de pierre +Stonewall=Pierre brune +Wood=Bois +##### not used anymore ##### \ No newline at end of file diff --git a/mods/castle_masonry/locale/castle_masonry.it.tr b/mods/castle_masonry/locale/castle_masonry.it.tr new file mode 100644 index 00000000..d7e28663 --- /dev/null +++ b/mods/castle_masonry/locale/castle_masonry.it.tr @@ -0,0 +1,50 @@ +# textdomain: castle_masonry + +@1 Arrowslit=Feritoia per frecce di @1 +@1 Arrowslit with Cross=Feritoia a croce per frecce di @1 +@1 Arrowslit with Hole=Feritoia a foro per frecce di @1 +@1 Crossbrace=Costolone di @1 +@1 Embrasure=Feritoia di @1 +@1 Extended Crossbrace=Costolone esteso di @1 +@1 Half Pillar Base=Mezza base della colonna di @1 +@1 Half Pillar Middle=Mezzo fusto della colonna di @1 +@1 Half Pillar Top=Mezzo capitello di @1 +@1 Machicolation=Caditoia di @1 +@1 Murder Hole=Buca assassina di @1 +@1 Pillar Base=Base della colonna di @1 +@1 Pillar Middle=Fusto della colonna di @1 +@1 Pillar Top=Capitello di @1 +Castle Corner=Angolo del castello +Castle Pavement Slab=Lastra pavimentale del castello +Castle Pavement Stair=Scala pavimentale del castello +Castle Rubble=Detriti del castello +Castle Rubble Slab=Lastra del castello in detriti +Castle Rubble Stair=Scala del castello in detriti +Castle Stonewall Slab=Lastra del castello in muro di pietra +Castle Stonewall Stair=Scala del castello in muro di pietra +Castle Wall=Muro del castello +Cobble=ciottoli +Desert Sandstone=arenaria del deserto +Desert Sandstone Brick=mattone d'arenaria del deserto +Desert Stone=pietra del deserto +Desert Stone Brick=mattone di pietra del deserto +Dungeon Stone=Pietra del sotterraneo +Dungeon Stone Slab=Lastra di pietra del sotterraneo +Dungeon Stone Stair=Scala di pietra del sotterraneo +Ice=ghiaccio +Obsidian Brick=mattone d'ossidiana +Pavement Brick=Mattone pavimentale +Paving Stone=Pietra pavimentale +Roof Slates=Tegole d'ardesia +Rubble=Detriti +Sandstone=arenaria +Sandstone Brick=mattone d'arenaria del deserto +Silver Sandstone=arenaria argentata +Silver Sandstone Brick=mattone d'arenaria argentata +Snow=neve +Stone=pietra +Stone Wall=Muro di pietra +Stonebrick=mattone di pietra +Stonewall=muro di pietra +Wood=legno +##### not used anymore ##### \ No newline at end of file diff --git a/mods/castle_masonry/locale/es.po b/mods/castle_masonry/locale/es.po new file mode 100644 index 00000000..d7023e88 --- /dev/null +++ b/mods/castle_masonry/locale/es.po @@ -0,0 +1,210 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-12 13:31+0100\n" +"PO-Revision-Date: 2017-04-28 15:23-0400\n" +"Last-Translator: Carlos Barraza\n" +"Language-Team: Español\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: arrow_slits.lua +msgid "@1 Arrowslit" +msgstr "Aspillera de @1" + +#: arrow_slits.lua +msgid "@1 Arrowslit with Cross" +msgstr "Aspillera con Crus de @1" + +#: arrow_slits.lua +msgid "@1 Arrowslit with Hole" +msgstr "Aspillera con Agujero de @1" + +#: arrow_slits.lua +msgid "@1 Embrasure" +msgstr "Aféizar de @1 " + +#: init.lua +msgid "Stonewall" +msgstr "Pared de piedra" + +#: init.lua +msgid "Cobble" +msgstr "Adoquín" + +#: init.lua +msgid "Stonebrick" +msgstr "Ladrillo de Piedra" + +#: init.lua +msgid "Sandstone Brick" +msgstr "Ladrillo de Arenisca" + +#: init.lua +msgid "Desert Stone Brick" +msgstr "Ladrillo de Piedra del Desierto" + +#: init.lua +#, fuzzy +msgid "Desert Sandstone Brick" +msgstr "Ladrillo de Piedra del Desierto" + +#: init.lua +#, fuzzy +msgid "Silver Sandstone Brick" +msgstr "Ladrillo de Arenisca" + +#: init.lua +msgid "Stone" +msgstr "Piedra" + +#: init.lua +msgid "Sandstone" +msgstr "Arenisca" + +#: init.lua +msgid "Desert Stone" +msgstr "Piedra del Desierto" + +#: init.lua +#, fuzzy +msgid "Desert Sandstone" +msgstr "Piedra del Desierto" + +#: init.lua +#, fuzzy +msgid "Silver Sandstone" +msgstr "Arenisca" + +#: init.lua +msgid "Wood" +msgstr "Madera" + +#: init.lua +msgid "Ice" +msgstr "Hielo" + +#: init.lua +msgid "Snow" +msgstr "Nieve" + +#: init.lua +msgid "Obsidian Brick" +msgstr "Ladrillo de Obsidiana" + +#: murder_holes.lua +msgid "@1 Murder Hole" +msgstr "Agujero de @1" + +#: murder_holes.lua +msgid "@1 Machicolation" +msgstr "Matacán de @1" + +#: paving.lua +msgid "Paving Stone" +msgstr "Piedra Pavimentada" + +#: paving.lua +msgid "Pavement Brick" +msgstr "Ladrillo Pavimentado" + +#: paving.lua +msgid "Castle Pavement Stair" +msgstr "Escalera de Castillo Pavimentada" + +#: paving.lua +msgid "Castle Pavement Slab" +msgstr "Pavimento de Castillo" + +#: paving.lua +msgid "Roof Slates" +msgstr "Pizarras de Techo" + +#: pillars.lua +msgid "@1 Pillar Base" +msgstr "Base de Pilar de @1" + +#: pillars.lua +msgid "@1 Half Pillar Base" +msgstr "Base de Medio Pilar de @1" + +#: pillars.lua +msgid "@1 Pillar Top" +msgstr "Parte Superior de Pilar de @1" + +#: pillars.lua +msgid "@1 Half Pillar Top" +msgstr "Parte Superior de Medio Pilar @1" + +#: pillars.lua +msgid "@1 Pillar Middle" +msgstr "Medio Pilar de @1" + +#: pillars.lua +msgid "@1 Half Pillar Middle" +msgstr "Medio del Medio Pilar de @1" + +#: pillars.lua +msgid "@1 Crossbrace" +msgstr "Viga de @1" + +#: pillars.lua +msgid "@1 Extended Crossbrace" +msgstr "Viga Extendida de @1" + +#: stone_wall.lua +msgid "Castle Wall" +msgstr "Pared de Castillo" + +#: stone_wall.lua +msgid "Castle Rubble" +msgstr "Escombros de Castillo" + +#: stone_wall.lua +msgid "Castle Corner" +msgstr "Esquina de Castillo" + +#: stone_wall.lua +msgid "Stone Wall" +msgstr "Pared de Piedra" + +#: stone_wall.lua +msgid "Rubble" +msgstr "Escombros" + +#: stone_wall.lua +msgid "Castle Stonewall Stair" +msgstr "Escalera de Pared de Castillo" + +#: stone_wall.lua +msgid "Castle Stonewall Slab" +msgstr "Losa de Pared de Castillo" + +#: stone_wall.lua +msgid "Castle Rubble Stair" +msgstr "Escalera de Escombro de Castillo" + +#: stone_wall.lua +msgid "Castle Rubble Slab" +msgstr "Losa de Escombro de Castillo" + +#: stone_wall.lua +msgid "Dungeon Stone" +msgstr "Piedra de Mazmorra" + +#: stone_wall.lua +msgid "Dungeon Stone Stair" +msgstr "Escalera de Piedra de Mazmorra" + +#: stone_wall.lua +msgid "Dungeon Stone Slab" +msgstr "Losa de Piedra de Mazmorra" diff --git a/mods/castle_masonry/locale/fr.po b/mods/castle_masonry/locale/fr.po new file mode 100644 index 00000000..008fdfc6 --- /dev/null +++ b/mods/castle_masonry/locale/fr.po @@ -0,0 +1,210 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-12 13:31+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: arrow_slits.lua +msgid "@1 Arrowslit" +msgstr "Meurtrière en @1" + +#: arrow_slits.lua +msgid "@1 Arrowslit with Cross" +msgstr "Meurtrière en croix en @1" + +#: arrow_slits.lua +msgid "@1 Arrowslit with Hole" +msgstr "Meurtrière avec trou en @1" + +#: arrow_slits.lua +msgid "@1 Embrasure" +msgstr "Embrasure en @1" + +#: init.lua +msgid "Stonewall" +msgstr "Pierre brune" + +#: init.lua +msgid "Cobble" +msgstr "Pavé" + +#: init.lua +msgid "Stonebrick" +msgstr "Brique de pierre" + +#: init.lua +msgid "Sandstone Brick" +msgstr "Brique de grès" + +#: init.lua +msgid "Desert Stone Brick" +msgstr "Brique de pierre du désert" + +#: init.lua +#, fuzzy +msgid "Desert Sandstone Brick" +msgstr "Brique de pierre du désert" + +#: init.lua +#, fuzzy +msgid "Silver Sandstone Brick" +msgstr "Brique de grès" + +#: init.lua +msgid "Stone" +msgstr "Pierre" + +#: init.lua +msgid "Sandstone" +msgstr "Grès" + +#: init.lua +msgid "Desert Stone" +msgstr "Pierre du désert" + +#: init.lua +#, fuzzy +msgid "Desert Sandstone" +msgstr "Pierre du désert" + +#: init.lua +#, fuzzy +msgid "Silver Sandstone" +msgstr "Grès" + +#: init.lua +msgid "Wood" +msgstr "Bois" + +#: init.lua +msgid "Ice" +msgstr "Glace" + +#: init.lua +msgid "Snow" +msgstr "Neige" + +#: init.lua +msgid "Obsidian Brick" +msgstr "Brique d'obsidienne" + +#: murder_holes.lua +msgid "@1 Murder Hole" +msgstr "Trou en @1" + +#: murder_holes.lua +msgid "@1 Machicolation" +msgstr "Machicoulis en @1" + +#: paving.lua +msgid "Paving Stone" +msgstr "Pierre de pavage" + +#: paving.lua +msgid "Pavement Brick" +msgstr "Brique de pavage" + +#: paving.lua +msgid "Castle Pavement Stair" +msgstr "Escaliers de chateau pavé" + +#: paving.lua +msgid "Castle Pavement Slab" +msgstr "Dalle de chateau pavé" + +#: paving.lua +msgid "Roof Slates" +msgstr "Toiture en ardoise" + +#: pillars.lua +msgid "@1 Pillar Base" +msgstr "Base de pilier en @1" + +#: pillars.lua +msgid "@1 Half Pillar Base" +msgstr "Base de demi pilier en @1" + +#: pillars.lua +msgid "@1 Pillar Top" +msgstr "Haut de pilier en @1" + +#: pillars.lua +msgid "@1 Half Pillar Top" +msgstr "Haut de demi pilier en @1" + +#: pillars.lua +msgid "@1 Pillar Middle" +msgstr "Milieu de pilier en @1" + +#: pillars.lua +msgid "@1 Half Pillar Middle" +msgstr "Milieu de demi pilier en @1" + +#: pillars.lua +msgid "@1 Crossbrace" +msgstr "Travers en @1" + +#: pillars.lua +msgid "@1 Extended Crossbrace" +msgstr "Travers entendu en @1" + +#: stone_wall.lua +msgid "Castle Wall" +msgstr "Pierre brune" + +#: stone_wall.lua +msgid "Castle Rubble" +msgstr "Gravats de chateau" + +#: stone_wall.lua +msgid "Castle Corner" +msgstr "Angle de chateau" + +#: stone_wall.lua +msgid "Stone Wall" +msgstr "Mur de pierre" + +#: stone_wall.lua +msgid "Rubble" +msgstr "Décombre" + +#: stone_wall.lua +msgid "Castle Stonewall Stair" +msgstr "Escalier en pierre brune" + +#: stone_wall.lua +msgid "Castle Stonewall Slab" +msgstr "Dalle en pierre brune" + +#: stone_wall.lua +msgid "Castle Rubble Stair" +msgstr "Escalier en gravats de chateau" + +#: stone_wall.lua +msgid "Castle Rubble Slab" +msgstr "Dalle en gravats de chateau" + +#: stone_wall.lua +msgid "Dungeon Stone" +msgstr "Pierre de dongeon" + +#: stone_wall.lua +msgid "Dungeon Stone Stair" +msgstr "Escalier en pierre de dongeon" + +#: stone_wall.lua +msgid "Dungeon Stone Slab" +msgstr "Dalle en pierre de dongeon" diff --git a/mods/castle_masonry/locale/it.po b/mods/castle_masonry/locale/it.po new file mode 100644 index 00000000..cbbc766b --- /dev/null +++ b/mods/castle_masonry/locale/it.po @@ -0,0 +1,207 @@ +# ITALIAN LOCALE FILE FOR THE CASTLE MASONRY MODULE +# Copyright (C) 2017 Philipbenr And DanDuncombe +# This file is distributed under the same license as the CASTLE MASONRY package. +# Hamlet <54187342+h4ml3t@users.noreply.github.com> 2017, 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: Castle Masonry\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-12 12:13+0100\n" +"PO-Revision-Date: 2019-11-12 12:24+0100\n" +"Last-Translator: Hamlet <54187342+h4ml3t@users.noreply.github.com>\n" +"Language-Team: \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.2.1\n" + +#: arrow_slits.lua +msgid "@1 Arrowslit" +msgstr "Feritoia per frecce di @1" + +#: arrow_slits.lua +msgid "@1 Arrowslit with Cross" +msgstr "Feritoia a croce per frecce di @1" + +#: arrow_slits.lua +msgid "@1 Arrowslit with Hole" +msgstr "Feritoia a foro per frecce di @1" + +#: arrow_slits.lua +msgid "@1 Embrasure" +msgstr "Feritoia di @1" + +#: init.lua +msgid "Stonewall" +msgstr "muro di pietra" + +#: init.lua +msgid "Cobble" +msgstr "ciottoli" + +#: init.lua +msgid "Stonebrick" +msgstr "mattone di pietra" + +#: init.lua +msgid "Sandstone Brick" +msgstr "mattone d'arenaria del deserto" + +#: init.lua +msgid "Desert Stone Brick" +msgstr "mattone di pietra del deserto" + +#: init.lua +msgid "Desert Sandstone Brick" +msgstr "mattone d'arenaria del deserto" + +#: init.lua +msgid "Silver Sandstone Brick" +msgstr "mattone d'arenaria argentata" + +#: init.lua +msgid "Stone" +msgstr "pietra" + +#: init.lua +msgid "Sandstone" +msgstr "arenaria" + +#: init.lua +msgid "Desert Stone" +msgstr "pietra del deserto" + +#: init.lua +msgid "Desert Sandstone" +msgstr "arenaria del deserto" + +#: init.lua +msgid "Silver Sandstone" +msgstr "arenaria argentata" + +#: init.lua +msgid "Wood" +msgstr "legno" + +#: init.lua +msgid "Ice" +msgstr "ghiaccio" + +#: init.lua +msgid "Snow" +msgstr "neve" + +#: init.lua +msgid "Obsidian Brick" +msgstr "mattone d'ossidiana" + +#: murder_holes.lua +msgid "@1 Murder Hole" +msgstr "Buca assassina di @1" + +#: murder_holes.lua +msgid "@1 Machicolation" +msgstr "Caditoia di @1" + +#: paving.lua +msgid "Paving Stone" +msgstr "Pietra pavimentale" + +#: paving.lua +msgid "Pavement Brick" +msgstr "Mattone pavimentale" + +#: paving.lua +msgid "Castle Pavement Stair" +msgstr "Scala pavimentale del castello" + +#: paving.lua +msgid "Castle Pavement Slab" +msgstr "Lastra pavimentale del castello" + +#: paving.lua +msgid "Roof Slates" +msgstr "Tegole d'ardesia" + +#: pillars.lua +msgid "@1 Pillar Base" +msgstr "Base della colonna di @1" + +#: pillars.lua +msgid "@1 Half Pillar Base" +msgstr "Mezza base della colonna di @1" + +#: pillars.lua +msgid "@1 Pillar Top" +msgstr "Capitello di @1" + +#: pillars.lua +msgid "@1 Half Pillar Top" +msgstr "Mezzo capitello di @1" + +#: pillars.lua +msgid "@1 Pillar Middle" +msgstr "Fusto della colonna di @1" + +#: pillars.lua +msgid "@1 Half Pillar Middle" +msgstr "Mezzo fusto della colonna di @1" + +#: pillars.lua +msgid "@1 Crossbrace" +msgstr "Costolone di @1" + +#: pillars.lua +msgid "@1 Extended Crossbrace" +msgstr "Costolone esteso di @1" + +#: stone_wall.lua +msgid "Castle Wall" +msgstr "Muro del castello" + +#: stone_wall.lua +msgid "Castle Rubble" +msgstr "Detriti del castello" + +#: stone_wall.lua +msgid "Castle Corner" +msgstr "Angolo del castello" + +#: stone_wall.lua +msgid "Stone Wall" +msgstr "Muro di pietra" + +#: stone_wall.lua +msgid "Rubble" +msgstr "Detriti" + +#: stone_wall.lua +msgid "Castle Stonewall Stair" +msgstr "Scala del castello in muro di pietra" + +#: stone_wall.lua +msgid "Castle Stonewall Slab" +msgstr "Lastra del castello in muro di pietra" + +#: stone_wall.lua +msgid "Castle Rubble Stair" +msgstr "Scala del castello in detriti" + +#: stone_wall.lua +msgid "Castle Rubble Slab" +msgstr "Lastra del castello in detriti" + +#: stone_wall.lua +msgid "Dungeon Stone" +msgstr "Pietra del sotterraneo" + +#: stone_wall.lua +msgid "Dungeon Stone Stair" +msgstr "Scala di pietra del sotterraneo" + +#: stone_wall.lua +msgid "Dungeon Stone Slab" +msgstr "Lastra di pietra del sotterraneo" diff --git a/mods/castle_masonry/locale/template.pot b/mods/castle_masonry/locale/template.pot new file mode 100644 index 00000000..cc402876 --- /dev/null +++ b/mods/castle_masonry/locale/template.pot @@ -0,0 +1,206 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-12 13:31+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: arrow_slits.lua +msgid "@1 Arrowslit" +msgstr "" + +#: arrow_slits.lua +msgid "@1 Arrowslit with Cross" +msgstr "" + +#: arrow_slits.lua +msgid "@1 Arrowslit with Hole" +msgstr "" + +#: arrow_slits.lua +msgid "@1 Embrasure" +msgstr "" + +#: init.lua +msgid "Stonewall" +msgstr "" + +#: init.lua +msgid "Cobble" +msgstr "" + +#: init.lua +msgid "Stonebrick" +msgstr "" + +#: init.lua +msgid "Sandstone Brick" +msgstr "" + +#: init.lua +msgid "Desert Stone Brick" +msgstr "" + +#: init.lua +msgid "Desert Sandstone Brick" +msgstr "" + +#: init.lua +msgid "Silver Sandstone Brick" +msgstr "" + +#: init.lua +msgid "Stone" +msgstr "" + +#: init.lua +msgid "Sandstone" +msgstr "" + +#: init.lua +msgid "Desert Stone" +msgstr "" + +#: init.lua +msgid "Desert Sandstone" +msgstr "" + +#: init.lua +msgid "Silver Sandstone" +msgstr "" + +#: init.lua +msgid "Wood" +msgstr "" + +#: init.lua +msgid "Ice" +msgstr "" + +#: init.lua +msgid "Snow" +msgstr "" + +#: init.lua +msgid "Obsidian Brick" +msgstr "" + +#: murder_holes.lua +msgid "@1 Murder Hole" +msgstr "" + +#: murder_holes.lua +msgid "@1 Machicolation" +msgstr "" + +#: paving.lua +msgid "Paving Stone" +msgstr "" + +#: paving.lua +msgid "Pavement Brick" +msgstr "" + +#: paving.lua +msgid "Castle Pavement Stair" +msgstr "" + +#: paving.lua +msgid "Castle Pavement Slab" +msgstr "" + +#: paving.lua +msgid "Roof Slates" +msgstr "" + +#: pillars.lua +msgid "@1 Pillar Base" +msgstr "" + +#: pillars.lua +msgid "@1 Half Pillar Base" +msgstr "" + +#: pillars.lua +msgid "@1 Pillar Top" +msgstr "" + +#: pillars.lua +msgid "@1 Half Pillar Top" +msgstr "" + +#: pillars.lua +msgid "@1 Pillar Middle" +msgstr "" + +#: pillars.lua +msgid "@1 Half Pillar Middle" +msgstr "" + +#: pillars.lua +msgid "@1 Crossbrace" +msgstr "" + +#: pillars.lua +msgid "@1 Extended Crossbrace" +msgstr "" + +#: stone_wall.lua +msgid "Castle Wall" +msgstr "" + +#: stone_wall.lua +msgid "Castle Rubble" +msgstr "" + +#: stone_wall.lua +msgid "Castle Corner" +msgstr "" + +#: stone_wall.lua +msgid "Stone Wall" +msgstr "" + +#: stone_wall.lua +msgid "Rubble" +msgstr "" + +#: stone_wall.lua +msgid "Castle Stonewall Stair" +msgstr "" + +#: stone_wall.lua +msgid "Castle Stonewall Slab" +msgstr "" + +#: stone_wall.lua +msgid "Castle Rubble Stair" +msgstr "" + +#: stone_wall.lua +msgid "Castle Rubble Slab" +msgstr "" + +#: stone_wall.lua +msgid "Dungeon Stone" +msgstr "" + +#: stone_wall.lua +msgid "Dungeon Stone Stair" +msgstr "" + +#: stone_wall.lua +msgid "Dungeon Stone Slab" +msgstr "" diff --git a/mods/castle_masonry/locale/template.txt b/mods/castle_masonry/locale/template.txt new file mode 100644 index 00000000..2827637e --- /dev/null +++ b/mods/castle_masonry/locale/template.txt @@ -0,0 +1,49 @@ +# textdomain:castle_masonry + +@1 Arrowslit= +@1 Arrowslit with Cross= +@1 Arrowslit with Hole= +@1 Embrasure= +Stonewall= +Cobble= +Stonebrick= +Sandstone Brick= +Desert Stone Brick= +Desert Sandstone Brick= +Silver Sandstone Brick= +Stone= +Sandstone= +Desert Stone= +Desert Sandstone= +Silver Sandstone= +Wood= +Ice= +Snow= +Obsidian Brick= +@1 Murder Hole= +@1 Machicolation= +Paving Stone= +Pavement Brick= +Castle Pavement Stair= +Castle Pavement Slab= +Roof Slates= +@1 Pillar Base= +@1 Half Pillar Base= +@1 Pillar Top= +@1 Half Pillar Top= +@1 Pillar Middle= +@1 Half Pillar Middle= +@1 Crossbrace= +@1 Extended Crossbrace= +Castle Wall= +Castle Rubble= +Castle Corner= +Stone Wall= +Rubble= +Castle Stonewall Stair= +Castle Stonewall Slab= +Castle Rubble Stair= +Castle Rubble Slab= +Dungeon Stone= +Dungeon Stone Stair= +Dungeon Stone Slab= diff --git a/mods/castle_masonry/mod.conf b/mods/castle_masonry/mod.conf new file mode 100644 index 00000000..7ae9c986 --- /dev/null +++ b/mods/castle_masonry/mod.conf @@ -0,0 +1,7 @@ +name = castle_masonry +depends = default +optional_depends = moreblocks, stairs, building_blocks, asphalt, streets, intllib +description = """ +This is a mod all about creating castles and castle dungeons. +Many of the nodes are used for the outer-walls or dungeons. +""" \ No newline at end of file diff --git a/mods/castle_masonry/murder_holes.lua b/mods/castle_masonry/murder_holes.lua new file mode 100644 index 00000000..cb7bfe65 --- /dev/null +++ b/mods/castle_masonry/murder_holes.lua @@ -0,0 +1,102 @@ + +-- Used for localization, choose either built-in or intllib. + +local MP, S, NS = nil + +if (minetest.get_modpath("intllib") == nil) then + S = minetest.get_translator("castle_masonry") + +else + -- internationalization boilerplate + MP = minetest.get_modpath(minetest.get_current_modname()) + S, NS = dofile(MP.."/intllib.lua") + +end + +------------------------------------------------------------------------------------- + +castle_masonry.register_murderhole = function(material) + local composition_def, burn_time, tile, desc = castle_masonry.get_material_properties(material) + local mod_name = minetest.get_current_modname() + + -- Node Definition + minetest.register_node(mod_name..":hole_"..material.name, { + drawtype = "nodebox", + description = S("@1 Murder Hole", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-8/16,-8/16,-8/16,-4/16,8/16,8/16}, + {4/16,-8/16,-8/16,8/16,8/16,8/16}, + {-4/16,-8/16,-8/16,4/16,8/16,-4/16}, + {-4/16,-8/16,8/16,4/16,8/16,4/16}, + }, + }, + }) + + minetest.register_node(mod_name..":machicolation_"..material.name, { + drawtype = "nodebox", + description = S("@1 Machicolation", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.5, 0, -0.5, 0.5, 0.5, 0}, + {-0.5, -0.5, 0, -0.25, 0.5, 0.5}, + {0.25, -0.5, 0, 0.5, 0.5, 0.5}, + }, + }, + }) + + minetest.register_craft({ + output = mod_name..":hole_"..material.name.." 4", + recipe = { + {"",material.craft_material, "" }, + {material.craft_material,"", material.craft_material}, + {"",material.craft_material, ""} + }, + }) + + minetest.register_craft({ + output = mod_name..":machicolation_"..material.name, + type="shapeless", + recipe = {mod_name..":hole_"..material.name}, + }) + minetest.register_craft({ + output = mod_name..":hole_"..material.name, + type="shapeless", + recipe = {mod_name..":machicolation_"..material.name}, + }) + + if burn_time > 0 then + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":hole_"..material.name, + burntime = burn_time, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":machicolation_"..material.name, + burntime = burn_time, + }) + end +end + +castle_masonry.register_murderhole_alias = function(old_mod_name, old_material_name, new_mod_name, new_material_name) + minetest.register_alias(old_mod_name..":hole_"..old_material_name, new_mod_name..":hole_"..new_material_name) + minetest.register_alias(old_mod_name..":machicolation_"..old_material_name, new_mod_name..":machicolation_"..new_material_name) +end + +castle_masonry.register_murderhole_alias_force = function(old_mod_name, old_material_name, new_mod_name, new_material_name) + minetest.register_alias_force(old_mod_name..":hole_"..old_material_name, new_mod_name..":hole_"..new_material_name) + minetest.register_alias_force(old_mod_name..":machicolation_"..old_material_name, new_mod_name..":machicolation_"..new_material_name) +end \ No newline at end of file diff --git a/mods/castle_masonry/paving.lua b/mods/castle_masonry/paving.lua new file mode 100644 index 00000000..8eb35aa3 --- /dev/null +++ b/mods/castle_masonry/paving.lua @@ -0,0 +1,121 @@ +minetest.register_alias("castle:pavement", "castle_masonry:pavement_brick") +minetest.register_alias("castle:pavement_brick", "castle_masonry:pavement_brick") +minetest.register_alias("castle:roofslate", "castle_masonry:roofslate") + + +-- Used for localization, choose either built-in or intllib. + +local MP, S, NS = nil + +if (minetest.get_modpath("intllib") == nil) then + S = minetest.get_translator("castle_masonry") + +else + -- internationalization boilerplate + MP = minetest.get_modpath(minetest.get_current_modname()) + S, NS = dofile(MP.."/intllib.lua") + +end + + +minetest.register_node("castle_masonry:pavement_brick", { + description = S("Paving Stone"), + drawtype = "normal", + tiles = {"castle_pavement_brick.png"}, + groups = {cracky=2}, + paramtype = "light", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_craft({ + output = "castle_masonry:pavement_brick 4", + recipe = { + {"default:stone", "default:cobble"}, + {"default:cobble", "default:stone"}, + } +}) + + +if minetest.get_modpath("moreblocks") then + stairsplus:register_all("castle_masonry", "pavement_brick", "castle_masonry:pavement_brick", { + description = S("Pavement Brick"), + tiles = {"castle_pavement_brick.png"}, + groups = {cracky=2, not_in_creative_inventory=1}, + sounds = default.node_sound_stone_defaults(), + sunlight_propagates = true, + }) + stairsplus:register_alias_all("castle", "pavement_brick", "castle_masonry", "pavement_brick") +elseif minetest.get_modpath("stairs") then + stairs.register_stair_and_slab("pavement_brick", "castle_masonry:pavement_brick", + {cracky=2}, + {"castle_pavement_brick.png"}, + S("Castle Pavement Stair"), + S("Castle Pavement Slab"), + default.node_sound_stone_defaults() + ) +end + + +minetest.register_node("castle_masonry:roofslate", { + drawtype = "raillike", + description = S("Roof Slates"), + inventory_image = "castle_slate.png", + paramtype = "light", + walkable = false, + tiles = {'castle_slate.png'}, + climbable = true, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, + }, + groups = {cracky=3,attached_node=1}, + sounds = default.node_sound_glass_defaults(), +}) + +local mod_building_blocks = minetest.get_modpath("building_blocks") +local mod_streets = minetest.get_modpath("streets") or minetest.get_modpath("asphalt") + +if mod_building_blocks then + minetest.register_craft({ + output = "castle_masonry:roofslate 4", + recipe = { + { "building_blocks:Tar" , "default:gravel" }, + { "default:gravel", "building_blocks:Tar" } + } + }) + + minetest.register_craft( { + output = "castle_masonry:roofslate 4", + recipe = { + { "default:gravel", "building_blocks:Tar" }, + { "building_blocks:Tar" , "default:gravel" } + } + }) +end + +if mod_streets then + minetest.register_craft( { + output = "castle_masonry:roofslate 4", + recipe = { + { "streets:asphalt" , "default:gravel" }, + { "default:gravel", "streets:asphalt" } + } + }) + + minetest.register_craft( { + output = "castle_masonry:roofslate 4", + recipe = { + { "default:gravel", "streets:asphalt" }, + { "streets:asphalt" , "default:gravel" } + } + }) +end + +if not (mod_building_blocks or mod_streets) then + minetest.register_craft({ + type = "cooking", + output = "castle_masonry:roofslate", + recipe = "default:gravel", + }) + +end diff --git a/mods/castle_masonry/pillars.lua b/mods/castle_masonry/pillars.lua new file mode 100644 index 00000000..13b7c15d --- /dev/null +++ b/mods/castle_masonry/pillars.lua @@ -0,0 +1,326 @@ + +-- Used for localization, choose either built-in or intllib. + +local MP, S, NS = nil + +if (minetest.get_modpath("intllib") == nil) then + S = minetest.get_translator("castle_masonry") + +else + -- internationalization boilerplate + MP = minetest.get_modpath(minetest.get_current_modname()) + S, NS = dofile(MP.."/intllib.lua") + +end + + +castle_masonry.register_pillar = function(material) + local composition_def, burn_time, tile, desc = castle_masonry.get_material_properties(material) + local crossbrace_connectable_groups = {} + for group, val in pairs(composition_def.groups) do + crossbrace_connectable_groups[group] = val + end + crossbrace_connectable_groups.crossbrace_connectable = 1 + + local mod_name = minetest.get_current_modname() + + -- Node Definition + minetest.register_node(mod_name..":pillar_"..material.name.."_bottom", { + drawtype = "nodebox", + description = S("@1 Pillar Base", desc), + tiles = tile, + groups = crossbrace_connectable_groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.5,-0.5,0.5,-0.375,0.5}, + {-0.375,-0.375,-0.375,0.375,-0.125,0.375}, + {-0.25,-0.125,-0.25,0.25,0.5,0.25}, + }, + }, + }) + + minetest.register_node(mod_name..":pillar_"..material.name.."_bottom_half", { + drawtype = "nodebox", + description = S("@1 Half Pillar Base", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0, 0.5, -0.375, 0.5}, + {-0.375, -0.375, 0.125, 0.375, -0.125, 0.5}, + {-0.25, -0.125, 0.25, 0.25, 0.5, 0.5}, + }, + }, + }) + + minetest.register_node(mod_name..":pillar_"..material.name.."_top", { + drawtype = "nodebox", + description = S("@1 Pillar Top", desc), + tiles = tile, + groups = crossbrace_connectable_groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.5,0.3125,-0.5,0.5,0.5,0.5}, + {-0.375,0.0625,-0.375,0.375,0.3125,0.375}, + {-0.25,-0.5,-0.25,0.25,0.0625,0.25}, + }, + }, + }) + + minetest.register_node(mod_name..":pillar_"..material.name.."_top_half", { + drawtype = "nodebox", + description = S("@1 Half Pillar Top", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.5, 0.3125, 0, 0.5, 0.5, 0.5}, + {-0.375, 0.0625, 0.125, 0.375, 0.3125, 0.5}, + {-0.25, -0.5, 0.25, 0.25, 0.0625, 0.5}, + }, + }, + }) + + minetest.register_node(mod_name..":pillar_"..material.name.."_middle", { + drawtype = "nodebox", + description = S("@1 Pillar Middle", desc), + tiles = tile, + groups = crossbrace_connectable_groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.25,-0.5,-0.25,0.25,0.5,0.25}, + }, + }, + }) + + minetest.register_node(mod_name..":pillar_"..material.name.."_middle_half", { + drawtype = "nodebox", + description = S("@1 Half Pillar Middle", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.25, -0.5, 0.25, 0.25, 0.5, 0.5}, + }, + }, + }) + + minetest.register_node(mod_name..":pillar_"..material.name.."_crossbrace", + { + drawtype = "nodebox", + description = S("@1 Crossbrace", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "connected", + fixed = {-0.25,0.25,-0.25,0.25,0.5,0.25}, + connect_front = {-0.25,0.25,-0.75,0.25,0.5,-0.25}, -- -Z + connect_left = {-0.25,0.25,-0.25,-0.75,0.5,0.25}, -- -X + connect_back = {-0.25,0.25,0.25,0.25,0.5,0.75}, -- +Z + connect_right = {0.25,0.25,-0.25,0.75,0.5,0.25}, -- +X + }, + connects_to = { + mod_name..":pillar_"..material.name.."_crossbrace", + mod_name..":pillar_"..material.name.."_extended_crossbrace", + "group:crossbrace_connectable"}, + connect_sides = { "front", "left", "back", "right" }, + }) + + minetest.register_node(mod_name..":pillar_"..material.name.."_extended_crossbrace", + { + drawtype = "nodebox", + description = S("@1 Extended Crossbrace", desc), + tiles = tile, + groups = composition_def.groups, + sounds = composition_def.sounds, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = {-1.25,0.25,-0.25,1.25,0.5,0.25}, + }, + }) + + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_bottom 4", + recipe = { + {"",material.craft_material,""}, + {"",material.craft_material,""}, + {material.craft_material,material.craft_material,material.craft_material} }, + }) + + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_top 4", + recipe = { + {material.craft_material,material.craft_material,material.craft_material}, + {"",material.craft_material,""}, + {"",material.craft_material,""} }, + }) + + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_middle 2", + recipe = { + {material.craft_material}, + {material.craft_material}, + {material.craft_material} }, + }) + + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_crossbrace 10", + recipe = { + {material.craft_material,"",material.craft_material}, + {"",material.craft_material,""}, + {material.craft_material,"",material.craft_material} }, + }) + + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_middle_half 2", + type="shapeless", + recipe = {mod_name..":pillar_"..material.name.."_middle"}, + }) + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_middle", + type="shapeless", + recipe = {mod_name..":pillar_"..material.name.."_middle_half", mod_name..":pillar_"..material.name.."_middle_half"}, + }) + + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_top_half 2", + type="shapeless", + recipe = {mod_name..":pillar_"..material.name.."_top"}, + }) + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_top", + type="shapeless", + recipe = {mod_name..":pillar_"..material.name.."_top_half", mod_name..":pillar_"..material.name.."_top_half"}, + }) + + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_bottom_half 2", + type="shapeless", + recipe = {mod_name..":pillar_"..material.name.."_bottom"}, + }) + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_bottom", + type="shapeless", + recipe = {mod_name..":pillar_"..material.name.."_bottom_half", mod_name..":pillar_"..material.name.."_bottom_half"}, + }) + + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_extended_crossbrace", + type="shapeless", + recipe = {mod_name..":pillar_"..material.name.."_crossbrace"}, + }) + + minetest.register_craft({ + output = mod_name..":pillar_"..material.name.."_crossbrace", + type="shapeless", + recipe = {mod_name..":pillar_"..material.name.."_extended_crossbrace"}, + }) + + if burn_time > 0 then + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":pillar_"..material.name.."_top", + burntime = burn_time*5/4, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":pillar_"..material.name.."_top_half", + burntime = burn_time*5/8, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":pillar_"..material.name.."_bottom", + burntime = burn_time*5/4, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":pillar_"..material.name.."_bottom_half", + burntime = burn_time*5/8, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":pillar_"..material.name.."_middle", + burntime = burn_time*6/4, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":pillar_"..material.name.."_middle_half", + burntime = burn_time*6/8, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":pillar_"..material.name.."_crossbrace", + burntime = burn_time*5/10, + }) + minetest.register_craft({ + type = "fuel", + recipe = mod_name..":pillar_"..material.name.."_extended_crossbrace", + burntime = burn_time*5/10, + }) + end + +end + +-- The original castle mod had "pillars_", plural, which didn't match the arrowslit and murderhole standard. +castle_masonry.register_pillar_alias = function(old_mod_name, old_material_name, new_mod_name, new_material_name) + minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_bottom", new_mod_name..":pillar_"..new_material_name.."_bottom") + minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_bottom_half", new_mod_name..":pillar_"..new_material_name.."_bottom_half") + minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_crossbrace", new_mod_name..":pillar_"..new_material_name.."_crossbrace") + minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_middle", new_mod_name..":pillar_"..new_material_name.."_middle") + minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_middle_half", new_mod_name..":pillar_"..new_material_name.."_middle_half") + minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_top", new_mod_name..":pillar_"..new_material_name.."_top") + minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_top_half", new_mod_name..":pillar_"..new_material_name.."_top_half") + minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_bottom", new_mod_name..":pillar_"..new_material_name.."_bottom") + minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_bottom_half", new_mod_name..":pillar_"..new_material_name.."_bottom_half") + minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_crossbrace", new_mod_name..":pillar_"..new_material_name.."_crossbrace") + minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_middle", new_mod_name..":pillar_"..new_material_name.."_middle") + minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_middle_half", new_mod_name..":pillar_"..new_material_name.."_middle_half") + minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_top", new_mod_name..":pillar_"..new_material_name.."_top") + minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_top_half", new_mod_name..":pillar_"..new_material_name.."_top_half") +end + +castle_masonry.register_arrowslit_alias_force = function(old_mod_name, old_material_name, new_mod_name, new_material_name) + minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_bottom", new_mod_name..":pillar_"..new_material_name.."_bottom") + minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_bottom_half", new_mod_name..":pillar_"..new_material_name.."_bottom_half") + minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_crossbrace", new_mod_name..":pillar_"..new_material_name.."_crossbrace") + minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_middle", new_mod_name..":pillar_"..new_material_name.."_middle") + minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_middle_half", new_mod_name..":pillar_"..new_material_name.."_middle_half") + minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_top", new_mod_name..":pillar_"..new_material_name.."_top") + minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_top_half", new_mod_name..":pillar_"..new_material_name.."_top_half") + minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_bottom", new_mod_name..":pillar_"..new_material_name.."_bottom") + minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_bottom_half", new_mod_name..":pillar_"..new_material_name.."_bottom_half") + minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_crossbrace", new_mod_name..":pillar_"..new_material_name.."_crossbrace") + minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_middle", new_mod_name..":pillar_"..new_material_name.."_middle") + minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_middle_half", new_mod_name..":pillar_"..new_material_name.."_middle_half") + minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_top", new_mod_name..":pillar_"..new_material_name.."_top") + minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_top_half", new_mod_name..":pillar_"..new_material_name.."_top_half") +end \ No newline at end of file diff --git a/mods/castle_masonry/screenshot.png b/mods/castle_masonry/screenshot.png new file mode 100644 index 00000000..2dd9cd80 Binary files /dev/null and b/mods/castle_masonry/screenshot.png differ diff --git a/mods/castle_masonry/settingtypes.txt b/mods/castle_masonry/settingtypes.txt new file mode 100644 index 00000000..ca58fb86 --- /dev/null +++ b/mods/castle_masonry/settingtypes.txt @@ -0,0 +1,24 @@ +[Materials] + +castle_masonry_stonewall (Stonewall) bool true +castle_masonry_cobble (Cobble) bool true +castle_masonry_stonebrick (Stone Brick) bool true +castle_masonry_sandstonebrick (Sandstone Brick) bool true +castle_masonry_desertstonebrick (Desert Stone Brick) bool true +castle_masonry_desertsandstonebrick (Desert Sandstone Brick) bool true +castle_masonry_silversandstonebrick (Silver Sandstone Brick) bool true +castle_masonry_stone (Stone) bool true +castle_masonry_sandstone (Sandstone) bool true +castle_masonry_desertstone (Desert Stone) bool true +castle_masonry_desertsandstone (Desert Sandstone) bool true +castle_masonry_silversandstone (Silver Sandstone) bool true +castle_masonry_wood (Wood) bool false +castle_masonry_ice (Ice) bool false +castle_masonry_snow (Snow) bool false +castle_masonry_obsidianbrick (Obsidian Brick) bool false + +[Forms] + +castle_masonry_pillar (Pillars) bool true +castle_masonry_arrowslit (Arrow slits) bool true +castle_masonry_murderhole (Murder holes and machicolations) bool true diff --git a/mods/castle_masonry/stone_wall.lua b/mods/castle_masonry/stone_wall.lua new file mode 100644 index 00000000..ce4c9244 --- /dev/null +++ b/mods/castle_masonry/stone_wall.lua @@ -0,0 +1,172 @@ + +-- Used for localization, choose either built-in or intllib. + +local MP, S, NS = nil + +if (minetest.get_modpath("intllib") == nil) then + S = minetest.get_translator("castle_masonry") + +else + -- internationalization boilerplate + MP = minetest.get_modpath(minetest.get_current_modname()) + S, NS = dofile(MP.."/intllib.lua") + +end + + +minetest.register_alias("castle:stonewall", "castle_masonry:stonewall") +minetest.register_alias("castle:dungeon_stone", "castle_masonry:dungeon_stone") +minetest.register_alias("castle:rubble", "castle_masonry:rubble") +minetest.register_alias("castle:stonewall_corner", "castle_masonry:stonewall_corner") + +minetest.register_node("castle_masonry:stonewall", { + description = S("Castle Wall"), + drawtype = "normal", + tiles = {"castle_stonewall.png"}, + paramtype = "light", + drop = "castle_masonry:stonewall", + groups = {cracky=3}, + sunlight_propagates = false, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("castle_masonry:rubble", { + description = S("Castle Rubble"), + drawtype = "normal", + tiles = {"castle_rubble.png"}, + paramtype = "light", + groups = {crumbly=3,falling_node=1}, + sounds = default.node_sound_gravel_defaults(), +}) + +minetest.register_craft({ + output = "castle_masonry:stonewall", + recipe = { + {"default:cobble"}, + {"default:desert_stone"}, + } +}) + +minetest.register_craft({ + output = "castle_masonry:rubble", + recipe = { + {"castle_masonry:stonewall"}, + } +}) + +minetest.register_craft({ + output = "castle_masonry:rubble 2", + recipe = { + {"default:gravel"}, + {"default:desert_stone"}, + } +}) + +minetest.register_node("castle_masonry:stonewall_corner", { + drawtype = "normal", + paramtype = "light", + paramtype2 = "facedir", + description = S("Castle Corner"), + tiles = {"castle_corner_stonewall_tb.png^[transformR90", + "castle_corner_stonewall_tb.png^[transformR180", + "castle_corner_stonewall1.png", + "castle_stonewall.png", + "castle_stonewall.png", + "castle_corner_stonewall2.png"}, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_craft({ + output = "castle_masonry:stonewall_corner", + recipe = { + {"", "castle_masonry:stonewall"}, + {"castle_masonry:stonewall", "default:sandstone"}, + } +}) + +if minetest.get_modpath("moreblocks") then + stairsplus:register_all("castle_masonry", "stonewall", "castle_masonry:stonewall", { + description = S("Stone Wall"), + tiles = {"castle_stonewall.png"}, + groups = {cracky=3, not_in_creative_inventory=1}, + sounds = default.node_sound_stone_defaults(), + sunlight_propagates = true, + }) + + stairsplus:register_all("castle_masonry", "rubble", "castle_masonry:rubble", { + description = S("Rubble"), + tiles = {"castle_rubble.png"}, + groups = {cracky=3, not_in_creative_inventory=1}, + sounds = default.node_sound_gravel_defaults(), + sunlight_propagates = true, + }) + + stairsplus:register_alias_all("castle", "stonewall", "castle_masonry", "stonewall") + stairsplus:register_alias_all("castle", "rubble", "castle_masonry", "rubble") + +elseif minetest.get_modpath("stairs") then + stairs.register_stair_and_slab("stonewall", "castle_masonry:stonewall", + {cracky=3}, + {"castle_stonewall.png"}, + S("Castle Stonewall Stair"), + S("Castle Stonewall Slab"), + default.node_sound_stone_defaults() + ) + + stairs.register_stair_and_slab("rubble", "castle_masonry:rubble", + {cracky=3}, + {"castle_rubble.png"}, + S("Castle Rubble Stair"), + S("Castle Rubble Slab"), + default.node_sound_stone_defaults() + ) +end + +-------------------------------------------------------------------------------------------------------------- + +minetest.register_node("castle_masonry:dungeon_stone", { + description = S("Dungeon Stone"), + drawtype = "normal", + tiles = {"castle_dungeon_stone.png"}, + groups = {cracky=2}, + paramtype = "light", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_craft({ + output = "castle_masonry:dungeon_stone 2", + recipe = { + {"default:stonebrick", "default:obsidian"}, + } +}) + +minetest.register_craft({ + output = "castle_masonry:dungeon_stone 2", + recipe = { + {"default:stonebrick"}, + {"default:obsidian"}, + } +}) + + +if minetest.get_modpath("moreblocks") then + stairsplus:register_all("castle_masonry", "dungeon_stone", "castle_masonry:dungeon_stone", { + description = S("Dungeon Stone"), + tiles = {"castle_dungeon_stone.png"}, + groups = {cracky=2, not_in_creative_inventory=1}, + sounds = default.node_sound_stone_defaults(), + sunlight_propagates = true, + }) + + stairsplus:register_alias_all("castle", "dungeon_stone", "castle_masonry", "dungeon_stone") + +elseif minetest.get_modpath("stairs") then + stairs.register_stair_and_slab("dungeon_stone", "castle_masonry:dungeon_stone", + {cracky=2}, + {"castle_dungeon_stone.png"}, + S("Dungeon Stone Stair"), + S("Dungeon Stone Slab"), + default.node_sound_stone_defaults() + ) +end \ No newline at end of file diff --git a/mods/castle_masonry/textures/LICENSE.txt b/mods/castle_masonry/textures/LICENSE.txt new file mode 100644 index 00000000..306be333 --- /dev/null +++ b/mods/castle_masonry/textures/LICENSE.txt @@ -0,0 +1,21 @@ +-------------------------------------------- + +License Textures: Philipner - CC-BY-SA 3.0 + +-castle_corner_stonewall_tb.png +-castle_corner_stonewall1.png +-castle_corner_stonewall2.png + +-------------------------------------------- + +16 px textures based on Castle mod +original textures by Philipner + +License Textures: Napiophelios - CC-BY-SA 3.0 + +-castle_pavement_brick.png +-castle_rubble.png +-castle_slate.png +-castle_stonewall.png + +-------------------------------------------- diff --git a/mods/castle_masonry/textures/castle_corner_stonewall1.png b/mods/castle_masonry/textures/castle_corner_stonewall1.png new file mode 100644 index 00000000..0a9c0914 Binary files /dev/null and b/mods/castle_masonry/textures/castle_corner_stonewall1.png differ diff --git a/mods/castle_masonry/textures/castle_corner_stonewall2.png b/mods/castle_masonry/textures/castle_corner_stonewall2.png new file mode 100644 index 00000000..8c9d8e9d Binary files /dev/null and b/mods/castle_masonry/textures/castle_corner_stonewall2.png differ diff --git a/mods/castle_masonry/textures/castle_corner_stonewall_tb.png b/mods/castle_masonry/textures/castle_corner_stonewall_tb.png new file mode 100644 index 00000000..1b0e02d0 Binary files /dev/null and b/mods/castle_masonry/textures/castle_corner_stonewall_tb.png differ diff --git a/mods/castle_masonry/textures/castle_dungeon_stone.png b/mods/castle_masonry/textures/castle_dungeon_stone.png new file mode 100644 index 00000000..6a2c1541 Binary files /dev/null and b/mods/castle_masonry/textures/castle_dungeon_stone.png differ diff --git a/mods/castle_masonry/textures/castle_pavement_brick.png b/mods/castle_masonry/textures/castle_pavement_brick.png new file mode 100644 index 00000000..4c2da4d1 Binary files /dev/null and b/mods/castle_masonry/textures/castle_pavement_brick.png differ diff --git a/mods/castle_masonry/textures/castle_rubble.png b/mods/castle_masonry/textures/castle_rubble.png new file mode 100644 index 00000000..47881187 Binary files /dev/null and b/mods/castle_masonry/textures/castle_rubble.png differ diff --git a/mods/castle_masonry/textures/castle_slate.png b/mods/castle_masonry/textures/castle_slate.png new file mode 100644 index 00000000..a7de1ea9 Binary files /dev/null and b/mods/castle_masonry/textures/castle_slate.png differ diff --git a/mods/castle_masonry/textures/castle_stonewall.png b/mods/castle_masonry/textures/castle_stonewall.png new file mode 100644 index 00000000..9c261894 Binary files /dev/null and b/mods/castle_masonry/textures/castle_stonewall.png differ diff --git a/mods/chat2/LICENSE b/mods/chat2/LICENSE new file mode 100755 index 00000000..5f2dd7fc --- /dev/null +++ b/mods/chat2/LICENSE @@ -0,0 +1,505 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +(This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.) + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This library 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; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random + Hacker. + + {signature of Ty Coon}, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/mods/chat2/README.md b/mods/chat2/README.md new file mode 100755 index 00000000..99ab1232 --- /dev/null +++ b/mods/chat2/README.md @@ -0,0 +1,7 @@ +# chat2 +Mod for Minetest game. Complements game built-in chat or replaces it. + +Higlight some messages in different colors - nearby talk, PM messages, messages with your name in it, shouts(!). +Also can show all regular chat messages (use "/chat2 *" command) +Switch on/off (use "/chat2" command) +Old messages dissapear after some time diff --git a/mods/chat2/depends.txt b/mods/chat2/depends.txt new file mode 100644 index 00000000..0e52e305 --- /dev/null +++ b/mods/chat2/depends.txt @@ -0,0 +1,2 @@ +chat_anticurse? +chat_antiflood? \ No newline at end of file diff --git a/mods/chat2/description.txt b/mods/chat2/description.txt new file mode 100644 index 00000000..45fd3fd0 --- /dev/null +++ b/mods/chat2/description.txt @@ -0,0 +1 @@ +Complements game built-in chat or replaces it. \ No newline at end of file diff --git a/mods/chat2/init.lua b/mods/chat2/init.lua new file mode 100755 index 00000000..1e45c3cb --- /dev/null +++ b/mods/chat2/init.lua @@ -0,0 +1,343 @@ +--[[ +Minetest 0.4.16+ mod: chat2 +chat2 is mod for Minetest, created by Andrey. It's purpose is to improve or replace game built-in chat: + + + Higlight some messages in different colors - nearby talk, PM messages, messages with your name in it, shouts(!) + + Also can show all regular chat messages (use "/chat2 *" command) + + Switch on/off (use "/chat2" command) + + Old messages dissapear after some time + - Problems with unicode symbols on some clients + +This mod is Free and Open Source Software, released under the GNU LGPLv2.1 or later. +I used this mod:https://github.com/vegasd/minetest-mods/blob/master/kmchat/init.lua as example for how to use hud api. +--]] + +chat2 = {} +chat2.speedlimit = {} +chat2.lastmessagetimes = {} --minetest.get_gametime() +chat2.users = {} +chat2.additionalfilters = {} --additional words set by player, which need to be higligted +chat2.firsthud = {} --to be able to use previously set huds +chat2.messages_on_screen = 11 +chat2.chat_width = 100 --symbols +chat2.position_x = 0.01 +chat2.position_y = 0.92 +chat2.line_distance = 15 --it depends on client, 15 is ok for where i have tested. + +chat2.add_message = function(player, new_text, new_color) + local temp_text + local temp_color + local hud + local name = player:get_player_name() + local firsthud = chat2.firsthud[name] + if not player then + minetest.log("action", "Player "..name.." - chat2 player error") + end + if (not chat2.firsthud[name]) or (not player:hud_get(chat2.firsthud[name]) ) then + minetest.log("action", "Player "..name.." - chat2 no hud yet error") + return + end + + for id = firsthud, (firsthud + chat2.messages_on_screen - 1) do + hud = player:hud_get(id) + if hud and hud.name == "chat2" then + temp_text = hud.text + temp_color = hud.number + player:hud_change(id, "number", new_color) + player:hud_change(id, "text", new_text) + new_text = temp_text + new_color = temp_color + end + end +end + +chat2.send_message = function(player, message, color) + local line1 = nil --allow message to span at most to three lines. more is not ok for public chat. + local line2 = nil + local line3 = nil + local symbols = '' + for i = 1, #message do + if + string.byte(message, i) == 32 and --is space symbol + string.len(symbols) > (chat2.chat_width - 8) and --space have priority for breaking lines + ( + not line1 or + not line2 or + not line3 + ) + then + if not line1 then + line1 = symbols + symbols = '' + elseif not line2 then + line2 = symbols + symbols = '' + elseif not line3 then + line3 = symbols + symbols = '' + end + elseif + (string.byte(message, i) < 128 or string.byte(message, i) >= 192) and --is ascii or first byte of unicode + string.len(symbols) > (chat2.chat_width - 1) and + ( + not line1 or + not line2 or + not line3 + ) + then + if not line1 then + line1 = symbols + symbols = '' + elseif not line2 then + line2 = symbols + symbols = '' + elseif not line3 then + line3 = symbols + symbols = '' + end + elseif line1 and line2 and line3 then --stop when all three lines filled + break + end + symbols = symbols..message:sub(i,i) + end + + if not line1 and symbols then --when message is shorten than line + line1 = symbols + elseif not line2 and symbols then --when message is shorten than line + line2 = symbols + elseif not line3 and symbols then --when message is shorten than line + line3 = symbols + end + + if line1 then + chat2.add_message(player, line1, color) + end + if line2 then + chat2.add_message(player, line2, color) + end + if line3 then + chat2.add_message(player, line3, color) + end + + if message ~= '' then + chat2.lastmessagetimes[player:get_player_name()] = minetest.get_gametime() + end +end + +minetest.register_on_joinplayer(function(player) + minetest.after(2, function(player) + local name = player:get_player_name() + for i = 1, chat2.messages_on_screen do + local hud_id = player:hud_add({ + hud_elem_type = "text", + text = "", + position = {x = chat2.position_x, y = chat2.position_y}, + name = "chat2", + scale = {x=500, y=50}, + number = 0xCCCCCC, + alignment = {x=1, y=0}, + offset = {x=0, y= -i * chat2.line_distance} + }) + if not chat2.firsthud[name] then + chat2.firsthud[name] = hud_id + end + end + chat2.users[name] = 1 + chat2.send_message(player, 'chat2 activated! Use /chat2 command to switch it off/on. Use /chat2 * to see all chat here.', 0xDDAA55) + chat2.lastmessagetimes[name] = minetest.get_gametime() + end, player) +end) + +minetest.register_on_leaveplayer(function(player) + local name = player:get_player_name() + chat2.lastmessagetimes[name] = nil + chat2.users[name] = nil + chat2.firsthud[name] = nil +end) + +minetest.register_on_chat_message(function(name, message) + + local fmt = nil + local color = nil + local submes = nil + local player = minetest.get_player_by_name(name) + local players = minetest.get_connected_players() + + if chat2.speedlimit[name]==nil then + chat2.speedlimit[name] = true + else + return + end + + submes = string.match(message, "^/(.+)") + if submes then + return + end + + submes = string.match(message, "^!(.+)") + if submes then + fmt = "<%s> %s" + color = 0xFF0000 + minetest.log("action", "chat2 !:"..string.format(fmt, name, submes)) + end + + local senderpos = player:get_pos() + for i = 1, #players do + local fmt_p = fmt + local color_p = color + local submes_p = submes + local name_p = players[i]:get_player_name() + + --if not submes_p and chat2.users[name_p] and string.find(message, name_p, 1, true) ~= nil then + if not submes_p and chat2.users[name_p] and string.find( string.lower(message), string.lower(name_p), 1, true) ~= nil then + fmt_p = "<%s> %s" + color_p = 0x00FF00 + submes_p = message + end + + if not submes_p and chat2.users[name_p] and chat2.additionalfilters[name_p] then + local additionalfound = false + for n = 1, #chat2.additionalfilters[name_p] do + --if additionalfound or name == chat2.additionalfilters[name_p][n] or string.find(message, chat2.additionalfilters[name_p][n], 1, true) ~= nil then + if additionalfound or name == chat2.additionalfilters[name_p][n] or string.find( string.lower(message), string.lower(chat2.additionalfilters[name_p][n]), 1, true) ~= nil then + additionalfound = true + end + end + if additionalfound then + fmt_p = "<%s> %s" + color_p = 0x55FF55 + submes_p = message + end + end + + if not submes_p and chat2.users[name_p] and name_p ~= name then + recieverpos = players[i]:get_pos() + if vector.distance(senderpos, recieverpos) < 12 then + fmt_p = "<%s> %s" + color_p = 0x88FFFF + submes_p = message + end + end + + if not submes_p and chat2.users[name_p] == 2 then + fmt_p = "<%s> %s" + color_p = 0xFFFFFF + submes_p = message + end + + if submes_p and chat2.users[name_p] then + chat2.send_message(players[i], string.format(fmt_p, name, submes_p), color_p) + end + end + + return +end) + +if minetest.chatcommands["msg"] then + local old_command = minetest.chatcommands["msg"].func + minetest.chatcommands["msg"].func = function(name, param) + local sendto, message = param:match("^(%S+)%s(.+)$") + + -- Check if old /msg was succeful + local result, msg = old_command(name, param) + + if sendto and message and chat2.users[sendto] then + local player = minetest.get_player_by_name(sendto) + local sender = minetest.get_player_by_name(name) + if result and player and sender then + chat2.send_message(player, string.format("<%s> %s", name, message), 0xFF00FF) + chat2.send_message(sender, string.format("<%s> %s", name, message), 0xF000F0) + minetest.log("action", "chat2 msg:"..string.format("<%s> %s", name, message)) + end + + end + return result, msg + end +end + +minetest.register_chatcommand("chat2", { + params = "", + description = "Turn chat2 off/on or add words to monitor or use /chat2 * to see all chat here", + privs = {shout = true}, + func = function(name, param) + local player = minetest.get_player_by_name(name) + if not player then + return false, "chat2: Player not found." + end + + if chat2.users[name] == nil and param and #param > 0 then + minetest.chat_send_player(name, 'First, please turn chat2 on.') + return + end + + if param == "*" then + if chat2.users[name] == 1 then + chat2.users[name] = 2 + minetest.chat_send_player(name, 'chat2 - receiving all') + minetest.log("action", "chat2: receiving all "..name) + else + chat2.users[name] = 1 + minetest.chat_send_player(name, 'chat2 - receiving only special messages') + minetest.log("action", "chat2: receiving only special messages "..name) + end + return + end + + --user add additional search strings + if param and #param > 0 then + local parameters = {} + if chat2.additionalfilters[name] and #chat2.additionalfilters[name] > 0 and #chat2.additionalfilters[name] < 14 then + parameters = chat2.additionalfilters[name] + end + for s in string.gmatch(param, "%g+") do + parameters[#parameters+1] = s:sub(0, 20) + end + if #parameters > 0 and #parameters < 15 then + chat2.additionalfilters[name] = parameters + minetest.chat_send_player(name, 'chat2 parameters set') + else + chat2.additionalfilters[name] = nil + minetest.chat_send_player(name, 'chat2 parameters removed(too mutch)') + end + return + end + + if chat2.users[name] ~= nil then + for i = 1, chat2.messages_on_screen do + chat2.send_message(player, '', 0x000000) + end + chat2.lastmessagetimes[name] = nil + chat2.users[name] = nil + else + minetest.chat_send_player(name, 'chat2 activated! Use /chat2 command if you want to switch it off.') + chat2.send_message(player, 'chat2 activated!', 0xDDAA55) + chat2.lastmessagetimes[name] = minetest.get_gametime() + chat2.users[name] = 1 + end + end, +}) + +-- every 3 seconds clean speedlimit +local timer = 0 +minetest.register_globalstep(function(dtime) + timer = timer + dtime; + if timer >= 3 then + chat2.speedlimit = {} + timer = 0 + + --clean chat + local players = minetest.get_connected_players() + for i = 1, #players do + local name = players[i]:get_player_name() + if + chat2.lastmessagetimes[name] and + (minetest.get_gametime() - chat2.lastmessagetimes[name]) > 90 + then + chat2.send_message(players[i], '', 0x000000) + if (minetest.get_gametime() - chat2.lastmessagetimes[name]) > (90 + chat2.messages_on_screen * 3) then + chat2.lastmessagetimes[name] = nil + end + end + end + end +end) diff --git a/mods/chat2/mod.conf b/mods/chat2/mod.conf new file mode 100755 index 00000000..6f976ce5 --- /dev/null +++ b/mods/chat2/mod.conf @@ -0,0 +1,3 @@ +name = chat2 +optional_depends = chat_anticurse, chat_antiflood +description = Complements game built-in chat or replaces it. \ No newline at end of file diff --git a/mods/computer/CHANGES.txt b/mods/computer/CHANGES.txt new file mode 100644 index 00000000..b9b455c3 --- /dev/null +++ b/mods/computer/CHANGES.txt @@ -0,0 +1,38 @@ +version 0.2.3: + - Added animated router front + - Added all crafts for new items + +version 0.2.2: + - Added printer + - Added server + +version 0.2.1: + - Added modern tower pc + - Added wifi router + - Added flatscreen LCD and keyboard + +Version 0.2.0: + - Added recipes. + - Partly re-written. + - Removed original baby tower (seemed out of place). + - You can now turn devices on and off by right-clicking. + - Mod is now on github. + +Version 0.1.4: + - Added Admiral 64 & 128 (Commodore 64 & 128 lookalikes) + +Version 0.1.3: + - Added SX Spectre (Sinclair ZX Spectrum lookalike) + - Added Pony SlayStation 2 (Sony PlayStation lookalike) + - Minor fixes to textures. + +Version 0.1.2: + - Nodes now use the node box as selection box. + - Added Pony SlayStation (Sony PlayStation lookalike) + - Added Pony Vanio (Sony VAIO lookalike...err...just a generic laptop) + +Version 0.1.1: + - Added SheFriend SOO (Amiga 500 lookalike) + +Version 0.1.0: + - Initial Version only a baby tower. diff --git a/mods/computer/LICENSE.txt b/mods/computer/LICENSE.txt new file mode 100644 index 00000000..1dc9f2f4 --- /dev/null +++ b/mods/computer/LICENSE.txt @@ -0,0 +1,15 @@ + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2012 Diego Martínez + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/mods/computer/README.txt b/mods/computer/README.txt new file mode 100644 index 00000000..6d6c7dcf --- /dev/null +++ b/mods/computer/README.txt @@ -0,0 +1,61 @@ + +Decorative Computers Mod for Minetest +by Diego Martínez + +How to install: +Unzip the archive an place it in minetest-base-directory/mods/minetest/ +if you have a windows client or a linux run-in-place client. If you have +a linux system-wide instalation place it in ~/.minetest/mods/minetest/. +If you want to install this mod only in one world create the folder +worldmods/ in your worlddirectory. +For further information or help see: +http://wiki.minetest.com/wiki/Installing_Mods + +How to use the mod: +For now just use creative mode or the `/give' or `/giveme' chat commands + to get the items. + +These are the items currently defined by this mod: + +computer:printer (printer scanner combo) +computer:server (rack server) +computer:tower (modern type) +computer:monitor (LCD with keyboard) +computer:router (wifi type) +computer:babytower +computer:shefriendSOO +computer:slaystation +computer:vanio +computer:spectre +computer:slaystation2 +computer:admiral64 +computer:admiral128 + +There's also a `computer:computer' alias to `computer:babytower'. + +License: +Sourcecode: WTFPL (see below) +Graphics: WTFPL (see below) + +Thanks to all the people in the forums and the #minetest IRC channel for + their support and suggestions; in no particular order: + OldCoder, Josh, tonyka, VanessaE, davidpace, Jordach, and all the other + sirs/madammes that I forgot to mention (sorry, please remind me if it + was you ;) ). + +See also: +http://minetest.net/ + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2012 Diego Martínez + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/mods/computer/TODO.txt b/mods/computer/TODO.txt new file mode 100644 index 00000000..e1e57524 --- /dev/null +++ b/mods/computer/TODO.txt @@ -0,0 +1,29 @@ + +TO-DO List: + +- New Nodes: + + - Computers: + - Mainframe (well me have a rackserver now) + - My Computer :P + + - Peripherals: + - Scanner ( well we have a printer/scanner combo now) + + - Consoles: + - NES + - SNES + - DC + + - Handhelds + - GB/C + - GBA + - Calculator + - Smartphone + +- Animated screens + +- Implement some kind of games (take code from `tetris' mod?). [It would be + nice if Minetest provided a "canvas" GUI widget :)]. + +- Get more suggestions :) diff --git a/mods/computer/computers.lua b/mods/computer/computers.lua new file mode 100644 index 00000000..7a736bd5 --- /dev/null +++ b/mods/computer/computers.lua @@ -0,0 +1,588 @@ + +-- Amiga 500 lookalike +-- Fun fact: "Amiga" is spanish for "female friend" ("Amigo" is for male); +-- that's why this computer was named "She Friend". +computer.register("computer:shefriendSOO", { + description = "SheFriendSOO"; + tiles_off = { front=true; }; + node_box = computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 17, 32, 32, 12 }, -- Monitor Screen + { 3, 3, 29, 26, 26, 3 }, -- Monitor Tube + { 0, 0, 0, 32, 4, 17 }, -- Keyboard + }); +}); + +-- Some generic laptop. Sony VAIO came to mind when thinking about a name :) +-- Fun fact: "Vanio" sounds like "baño" ("bathroom" in spanish, pronounced +-- as something like "bah-nee-oh") +computer.register("computer:vanio", { + description = "Pony Vanio"; + tiles_off = { front=true; top=true; left=true; right=true; back=true; }; + node_box = computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 4, 32, 3, 24 }, -- Keyboard + { 0, 3, 25, 32, 21, 3 }, -- Screen + }); + node_box_off = computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 4, 32, 3, 24 }, -- Keyboard + { 0, 3, 4, 32, 3, 24 }, -- Screen + }); +}); + +-- Sony PlayStation lookalike +-- Fun fact: Swapping the first letters gives valid words :) +-- Pony SureiSutteshun!!! +computer.register("computer:slaystation", { + description = "Pony SlayStation"; + tiles_off = { top=true; }; + node_box = computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 11, 32, 6, 21 }, -- Console + { 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip + { 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip + { 5, 0, 4, 5, 2, 5 }, -- Controller 1 Center + { 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip + { 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip + { 22, 0, 4, 5, 2, 5 }, -- Controller 2 Center + }); +}); + +-- Sony PlayStation 2 lookalike +-- Fun fact: Swapping the first letters gives valid words :) +-- Pony SureiSutteshun!!! +computer.register("computer:slaystation2", { + description = "Pony SlayStation 2"; + tiles_off = { front=true; }; + node_box = computer.pixelnodebox(32, { + -- X Y Z W H L + { 2, 2, 11, 28, 3, 19 }, -- Console (Upper part) + { 2, 0, 11, 26, 2, 19 }, -- Console (Lower part) + { 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip + { 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip + { 5, 0, 1, 5, 2, 8 }, -- Controller 1 Center + { 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip + { 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip + { 22, 0, 1, 5, 2, 8 }, -- Controller 2 Center + }); +}); + +-- Sinclair ZX Spectrum lookalike +computer.register("computer:specter", { + description = "SX Specter"; + tiles_off = { }; + node_box = computer.pixelnodebox(32, { + -- X Y Z W H L + { 3, 0, 0, 26, 4, 17 }, -- Keyboard + { 18, 0, 18, 12, 6, 14 }, -- Tape Player + }); +}); + +-- Nintendo Wii lookalike. +computer.register("computer:wee", { + description = "Nientiendo Wee"; + tiles_off = { front=true; }; + node_box = computer.pixelnodebox(32, { + -- X Y Z W H L + { 11, 0, 3, 10, 6, 26 }, -- Base + { 12, 6, 4, 8, 22, 24 }, -- Top + }); +}); + +-- Apple iPad lookalike. +computer.register_handheld("computer:piepad", { + description = "Snapple Piepad"; +}); + +-- Commodore 64 lookalike +computer.register("computer:admiral64", { + description = "Admiral64"; + tiles_off = { }; + node_box = computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 0, 32, 4, 18 }, -- Keyboard + }); +}); + +-- Commodore 128 lookalike +computer.register("computer:admiral128", { + description = "Admiral128"; + tiles_off = { }; + node_box = computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 0, 32, 4, 27 }, -- Keyboard + }); +}); + +--------------------------------------------------------------------------------- +----------------------------added by crazyginger72------------------------------- +--------------------------------------------------------------------------------- + + + +-- Generic Flat Screen LCD (16x9) with keyboard + minetest.register_node("computer:monitor_on", { + description = "Monitor and keyboard", + tiles = {"computer_monitor_t.png","computer_monitor_bt.png", + "computer_monitor_l.png","computer_monitor_r.png", + "computer_monitor_b.png","computer_monitor_f_desktop.png"}, --"computer_monitor_f_on.png"}, --till i get a boot abm inplace + --inventory_image = + paramtype = "light", + light_source = 4, + paramtype2 = "facedir", + walkable = false, + is_ground_content = true, + groups = {crumbly=3,not_in_creative_inventory=1}, + --sounds = default.node_sound_dirt_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + drop = 'computer:monitor' , + on_rightclick = function ( pos, node, clicker, itemstack) + node.name = "computer:monitor"; + minetest.set_node(pos, node); + nodeupdate(pos) + end +}) + + minetest.register_node("computer:monitor_bios", { + description = "Monitor and keyboard", + tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png","computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_bios.png"}, + --inventory_image = + paramtype = "light", + light_source = 4, + paramtype2 = "facedir", + walkable = false, + is_ground_content = true, + groups = {crumbly=3,not_in_creative_inventory=1}, + --sounds = default.node_sound_dirt_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + drop = 'computer:monitor' , +}) + + minetest.register_node("computer:monitor_loading", { + description = "Monitor and keyboard", + tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png","computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_loading.png"}, + --inventory_image = + paramtype = "light", + light_source = 4, + paramtype2 = "facedir", + walkable = false, + is_ground_content = true, + groups = {crumbly=3,not_in_creative_inventory=1}, + --sounds = default.node_sound_dirt_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + drop = 'computer:monitor' , +}) + + minetest.register_node("computer:monitor_login", { + description = "Monitor and keyboard", + tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png","computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_login.png"}, + --inventory_image = + paramtype = "light", + light_source = 4, + paramtype2 = "facedir", + walkable = false, + is_ground_content = true, + groups = {crumbly=3,not_in_creative_inventory=1}, + --sounds = default.node_sound_dirt_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + drop = 'computer:monitor' , +}) + + minetest.register_node("computer:monitor_desktop", { + description = "Monitor and keyboard", + tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png","computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_desktop.png"}, + --inventory_image = + paramtype = "light", + light_source = 4, + paramtype2 = "facedir", + walkable = false, + is_ground_content = true, + groups = {crumbly=3,not_in_creative_inventory=1}, + --sounds = default.node_sound_dirt_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + drop = 'computer:monitor' , +}) + + minetest.register_node("computer:monitor", { + description = "Monitor and keyboard", + tiles = {"computer_monitor_t_off.png","computer_monitor_bt.png","computer_monitor_l.png","computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_off.png"}, + --inventory_image = + paramtype = "light", + light_source = 4, + paramtype2 = "facedir", + walkable = false, + is_ground_content = true, + groups = {crumbly=3}, + --sounds = default.node_sound_dirt_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116}, + {-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5}, + {-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698}, + {-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125}, + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125}, + {-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375}, + }, + }, + drop = 'computer:monitor' , + + on_rightclick = function ( pos, node, clicker, itemstack) + node.name = "computer:monitor_on"; + minetest.set_node(pos, node); + nodeupdate(pos) + end + +}) + +--WIFI Router (linksys look-a-like) + + minetest.register_node("computer:router", { + description = "WIFI Router", + tiles = {"computer_router_t.png","computer_router_bt.png","computer_router_l.png","computer_router_r.png","computer_router_b.png",{name="computer_router_f_animated.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}},}, --"computer_router_f.png"}, + --inventory_image = + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + is_ground_content = true, + groups = {crumbly=3}, + --sounds = default.node_sound_dirt_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.25, -0.5, -0.0625, 0.25, -0.375, 0.3125}, + {-0.1875, -0.4375, 0.3125, -0.125, -0.1875, 0.375}, + {0.125, -0.4375, 0.3125, 0.1875, -0.1875, 0.375}, + {-0.0625, -0.4375, 0.3125, 0.0625, -0.25, 0.375}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.5, -0.0625, 0.25, -0.375, 0.3125}, + {-0.1875, -0.4375, 0.3125, -0.125, -0.1875, 0.375}, + {0.125, -0.4375, 0.3125, 0.1875, -0.1875, 0.375}, + {-0.0625, -0.4375, 0.3125, 0.0625, -0.25, 0.375}, + }, + }, +}) + +--Modern PC Tower + + minetest.register_node("computer:tower_on", { + description = "Computer Tower", + tiles = {"computer_tower_t.png","computer_tower_bt.png","computer_tower_l.png","computer_tower_r.png","computer_tower_b.png","computer_tower_f_on.png"}, + --inventory_image = + paramtype = "light", + paramtype2 = "facedir", + walkable = true, + is_ground_content = true, + groups = {crumbly=3,not_in_creative_inventory=1}, + --sounds = default.node_sound_dirt_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.1875, -0.5, -0.3125, 0.1875, 0.3125, 0.4375}, + {-0.1875, -0.5, -0.353774, 0.1875, 0, -0.0625}, + {-0.1875, 0.247641, -0.353774, 0.1875, 0.3125, 0.1875}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.1875, -0.5, -0.3125, 0.1875, 0.3125, 0.4375}, + }, + }, + drop = 'computer:tower' , + + on_rightclick = function ( pos, node, clicker, itemstack) + node.name = "computer:tower"; + minetest.set_node(pos, node); + nodeupdate(pos) + end +}) + + minetest.register_node("computer:tower", { + description = "Computer Tower", + tiles = {"computer_tower_t.png","computer_tower_bt.png","computer_tower_l.png","computer_tower_r.png","computer_tower_b.png","computer_tower_f_off.png"}, + --inventory_image = + paramtype = "light", + paramtype2 = "facedir", + walkable = true, + is_ground_content = true, + groups = {crumbly=3}, + --sounds = default.node_sound_dirt_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.1875, -0.5, -0.3125, 0.1875, 0.3125, 0.4375}, + {-0.1875, -0.5, -0.353774, 0.1875, 0, -0.0625}, + {-0.1875, 0.247641, -0.353774, 0.1875, 0.3125, 0.1875}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.1875, -0.5, -0.3125, 0.1875, 0.3125, 0.4375}, + }, + }, + on_rightclick = function ( pos, node, clicker, itemstack) + node.name = "computer:tower_on"; + minetest.set_node(pos, node); + nodeupdate(pos) + end +}) + +-- Printer/scaner combo + +minetest.register_node("computer:printer", { + description = "Printer Scaner Combo", + tiles = {"computer_printer_t.png","computer_printer_bt.png","computer_printer_l.png","computer_printer_r.png","computer_printer_b.png","computer_printer_f.png"}, + --inventory_image = + paramtype = "light", + paramtype2 = "facedir", + walkable = true, + is_ground_content = true, + groups = {crumbly=3}, + --sounds = default.node_sound_dirt_defaults(), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.4375, -0.3125, -0.125, 0.4375, -0.0625, 0.375}, + {-0.4375, -0.5, -0.125, 0.4375, -0.4375, 0.375}, + {-0.4375, -0.5, -0.125, -0.25, -0.0625, 0.375}, + {0.25, -0.5, -0.125, 0.4375, -0.0625, 0.375}, + {-0.4375, -0.5, -0.0625, 0.4375, -0.0625, 0.375}, + {-0.375, -0.4375, 0.25, 0.375, -0.0625, 0.4375}, + {-0.25, -0.25, 0.4375, 0.25, 0.0625, 0.5}, + {-0.25, -0.481132, -0.3125, 0.25, -0.4375, 0}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.4375, -0.3125, -0.125, 0.4375, -0.0625, 0.375}, + {-0.4375, -0.5, -0.125, 0.4375, -0.4375, 0.375}, + {-0.4375, -0.5, -0.125, -0.25, -0.0625, 0.375}, + {0.25, -0.5, -0.125, 0.4375, -0.0625, 0.375}, + {-0.4375, -0.5, -0.0625, 0.4375, -0.0625, 0.375}, + {-0.375, -0.4375, 0.25, 0.375, -0.0625, 0.4375}, + {-0.25, -0.25, 0.4375, 0.25, 0.0625, 0.5}, + {-0.25, -0.481132, -0.3125, 0.25, -0.4375, 0}, + }, + }, +}) + +--Rack Server + +minetest.register_node("computer:server", { + drawtype = "nodebox", + description = "Rack Server", + tiles = { + 'computer_server_t.png', + 'computer_server_bt.png', + 'computer_server_l.png', + 'computer_server_r.png', + 'computer_server_bt.png', + 'computer_server_f_off.png' + }, + inventory_image = "computer_server_inv.png", + sunlight_propagates = false, + paramtype = "light", + paramtype2 = "facedir", + walkable = true, + groups = { snappy = 3 }, + + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375}, + }, + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375}, + }, + --drop = 'computer:server', + sounds = default.node_sound_wood_defaults(), + on_rightclick = function ( pos, node, clicker, itemstack) + node.name = "computer:server_on"; + minetest.set_node(pos, node); + nodeupdate(pos) + end, + on_place = function(itemstack, placer, pointed_thing) + local pos = pointed_thing.above + if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then + minetest.chat_send_player( placer:get_player_name(), "Not enough vertical space to place a server!" ) + return + end + return minetest.item_place(itemstack, placer, pointed_thing) + end, + + + +}) + +minetest.register_node("computer:server_on", { + drawtype = "nodebox", + description = "Rack Server", + tiles = { + 'computer_server_t.png', + 'computer_server_bt.png', + 'computer_server_r.png', + 'computer_server_l.png', + 'computer_server_bt.png', + 'computer_server_f_on.png', + }, + inventory_image = "computer_server_inv.png", + sunlight_propagates = false, + paramtype = "light", + paramtype2 = "facedir", + walkable = true, + groups = { snappy = 3,not_in_creative_inventory=1 }, + + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375}, + }, + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375}, + }, + + sounds = default.node_sound_wood_defaults(), + drop = 'computer:server', + on_rightclick = function ( pos, node, clicker, itemstack) + node.name = "computer:server"; + minetest.set_node(pos, node); + nodeupdate(pos) + end , + +}) + + diff --git a/mods/computer/depends.txt b/mods/computer/depends.txt new file mode 100644 index 00000000..4ad96d51 --- /dev/null +++ b/mods/computer/depends.txt @@ -0,0 +1 @@ +default diff --git a/mods/computer/description.txt b/mods/computer/description.txt new file mode 100644 index 00000000..80ea8aed --- /dev/null +++ b/mods/computer/description.txt @@ -0,0 +1 @@ +Decorative computers for Minetest diff --git a/mods/computer/fusrodah/_.lua b/mods/computer/fusrodah/_.lua new file mode 100644 index 00000000..974e8176 --- /dev/null +++ b/mods/computer/fusrodah/_.lua @@ -0,0 +1,4 @@ + +local name = "foo:bar" +local modname = name:gsub(":.*", "") +print(modname) diff --git a/mods/computer/fusrodah/craft-grid.png b/mods/computer/fusrodah/craft-grid.png new file mode 100644 index 00000000..9624300e Binary files /dev/null and b/mods/computer/fusrodah/craft-grid.png differ diff --git a/mods/computer/fusrodah/init.lua.old b/mods/computer/fusrodah/init.lua.old new file mode 100644 index 00000000..28cfa140 --- /dev/null +++ b/mods/computer/fusrodah/init.lua.old @@ -0,0 +1,83 @@ + +-- Copyright (C) 2012-2013 Diego Martínez +-- License is WTFPL (see README.txt). + +local MODNAME = "computer"; + +if (computer ~= nil) then + error("some other mod defined computer"); +end + +computer = { }; + +--[[ computer.pixelnodebox: + | + | Helper to create node boxes. + | + | Parameters: + | size Resolution of the `boxes'. + | boxes The shape of the object. + | + | Return Value: + | The new nodebox, ready to be assigned to `nodedef.node_box'. + ]] +computer.pixelnodebox = function ( size, boxes ) + local fixed = { }; + local i, box; + for i, box in ipairs(boxes) do + local x, y, z, w, h, l = unpack(box); + fixed[#fixed + 1] = { + (x / size) - 0.5, + (y / size) - 0.5, + (z / size) - 0.5, + ((x + w) / size) - 0.5, + ((y + h) / size) - 0.5, + ((z + l) / size) - 0.5, + }; + end + return { + type = "fixed"; + fixed = fixed; + }; +end + +--[[ computer.register: + | + | Helper to register a new computer node. + | + | Parameters: + | name Short ID string used as the object name. + | desc Description of the object for the inventory. + | nodebox The shape of the object. Also used as selection. + | + | Return Value: + | None. + ]] +computer.register = function ( name, desc, nodebox ) + + local TEXPFX = MODNAME.."_"..name.."_"; + + minetest.register_node(MODNAME..":"..name, { + drawtype = "nodebox"; + paramtype = "light"; + paramtype2 = "facedir"; + description = desc; + groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2 }; + tiles = { + TEXPFX.."top.png", + TEXPFX.."bottom.png", + TEXPFX.."right.png", + TEXPFX.."left.png", + TEXPFX.."back.png", + TEXPFX.."front.png" + }; + node_box = nodebox; + selection_box = nodebox; + }); + +end + +local MODPATH = minetest.get_modpath(MODNAME); +dofile(MODPATH.."/nodes.lua"); +dofile(MODPATH.."/miscitems.lua"); +dofile(MODPATH.."/recipes.lua"); diff --git a/mods/computer/fusrodah/nodes.lua b/mods/computer/fusrodah/nodes.lua new file mode 100644 index 00000000..fd046e3b --- /dev/null +++ b/mods/computer/fusrodah/nodes.lua @@ -0,0 +1,99 @@ + +-- Copyright (C) 2012-2013 Diego Martínez +-- License is WTFPL (see README.txt). + +-- Just a generic Baby Tower, modeled somewhat after my old Dell cabinet +-- (an Intel Celeron @ 233MHz, with 160MB of ram and 4GB of disk; good +-- old times). +computer.register("babytower", "Baby Tower", + computer.pixelnodebox(16, { + -- X Y Z W H L + { 1, 5, 6, 14, 11, 6 }, -- Monitor Screen + { 3, 7, 12, 10, 7, 4 }, -- Monitor Tube + { 0, 0, 6, 16, 5, 10 }, -- CPU + { 0, 0, 0, 12, 1, 5 }, -- Keyboard + { 13, 0, 0, 3, 3, 5 }, -- Mouse + }) +); + +-- Amiga 500 lookalike +-- Fun fact: "Amiga" is spanish for "female friend" ("Amigo" is for male); +-- that's why this computer was named "She Friend". +computer.register("shefriendSOO", "SheFriend SOO", + computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 17, 32, 32, 12 }, -- Monitor Screen + { 3, 3, 29, 26, 26, 3 }, -- Monitor Tube + { 0, 0, 0, 32, 4, 17 }, -- Keyboard + }) +); + +-- Sony PlayStation lookalike +-- Fun fact: Swapping the first letters gives valid words :) +-- Pony SureiSutteshun!!! +computer.register("slaystation", "Pony SlayStation", + computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 11, 32, 6, 21 }, -- Console + { 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip + { 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip + { 5, 0, 4, 5, 2, 5 }, -- Controller 1 Center + { 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip + { 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip + { 22, 0, 4, 5, 2, 5 }, -- Controller 2 Center + }) +); + +-- Some generic laptop. Sony VAIO came to mind when thinking about a name :) +-- Fun fact: "Vanio" sounds like "baño" ("bathroom" in spanish, pronounced +-- as something like "bah-nee-oh") +computer.register("vanio", "Pony Vanio", + computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 4, 32, 3, 24 }, -- Keyboard + { 0, 3, 25, 32, 21, 3 }, -- Screen + }) +); + +-- Sinclair ZX Spectrum lookalike +computer.register("spectre", "SX Spectre", + computer.pixelnodebox(32, { + -- X Y Z W H L + { 3, 0, 0, 26, 4, 17 }, -- Keyboard + { 18, 0, 18, 12, 6, 14 }, -- Tape Player + }) +); + +-- Sony PlayStation 2 lookalike +computer.register("slaystation2", "Pony SlayStation 2", + computer.pixelnodebox(32, { + -- X Y Z W H L + { 2, 2, 11, 28, 3, 19 }, -- Console (Upper part) + { 2, 0, 11, 26, 2, 19 }, -- Console (Lower part) + { 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip + { 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip + { 5, 0, 1, 5, 2, 8 }, -- Controller 1 Center + { 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip + { 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip + { 22, 0, 1, 5, 2, 8 }, -- Controller 2 Center + }) +); + +-- Commodore 64 lookalike +computer.register("admiral64", "Admiral 64", + computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 0, 32, 4, 18 }, -- Keyboard + }) +); + +-- Commodore 128 lookalike +computer.register("admiral128", "Admiral 128", + computer.pixelnodebox(32, { + -- X Y Z W H L + { 0, 0, 0, 32, 4, 27 }, -- Keyboard + }) +); + +-- Old node name +minetest.register_alias("computer:computer", "computer:babytower"); diff --git a/mods/computer/init.lua b/mods/computer/init.lua new file mode 100644 index 00000000..2c85e7e7 --- /dev/null +++ b/mods/computer/init.lua @@ -0,0 +1,105 @@ + +computer = { }; + +computer.register = function ( name, def ) + local nodename = name; + if (name:sub(1, 1) == ":") then name = name:sub(2); end + local modname, basename = name:match("^([^:]+):(.*)"); + local TEXPFX = modname.."_"..basename.."_"; + local ONSTATE = modname..":"..basename; + local OFFSTATE = modname..":"..basename.."_off"; + local def = def; + minetest.register_node(ONSTATE, { + drawtype = "nodebox"; + paramtype = "light"; + paramtype2 = "facedir"; + description = def.description; + groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2 }; + tiles = { + TEXPFX.."tp.png", + TEXPFX.."bt.png", + TEXPFX.."rt.png", + TEXPFX.."lt.png", + TEXPFX.."bk.png", + TEXPFX.."ft.png", + }; + node_box = def.node_box; + selection_box = def.node_box; + on_rightclick = function ( pos, node, clicker, itemstack) + if (def.on_turn_off) then + if (def.on_turn_off(pos, node, clicker, itemstack)) then return; end + end + node.name = OFFSTATE; + minetest.env:set_node(pos, node); + nodeupdate(pos); + end; + }); + minetest.register_node(OFFSTATE, { + drawtype = "nodebox"; + paramtype = "light"; + paramtype2 = "facedir"; + groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2, + not_in_creative_inventory=1 }; + tiles = { + (TEXPFX.."tp"..(def.tiles_off.top and "_off" or "")..".png"), + (TEXPFX.."bt"..(def.tiles_off.bottom and "_off" or "")..".png"), + (TEXPFX.."rt"..(def.tiles_off.right and "_off" or "")..".png"), + (TEXPFX.."lt"..(def.tiles_off.left and "_off" or "")..".png"), + (TEXPFX.."bk"..(def.tiles_off.back and "_off" or "")..".png"), + (TEXPFX.."ft"..(def.tiles_off.front and "_off" or "")..".png"), + }; + node_box = def.node_box_off or def.node_box; + selection_box = def.node_box_off or def.node_box; + on_rightclick = function ( pos, node, clicker, itemstack) + if (def.on_turn_on) then + if (def.on_turn_on(pos, node, clicker, itemstack)) then return; end + end + node.name = ONSTATE; + minetest.env:set_node(pos, node); + nodeupdate(pos); + end; + drop = ONSTATE; + }); +end + +computer.register_handheld = function ( name, def ) + local nodename = name; + if (name:sub(1, 1) == ":") then name = name:sub(2); end + local modname, basename = name:match("^([^:]+):(.*)"); + local TEXPFX = modname.."_"..basename.."_inv"; + local ONSTATE = modname..":"..basename; + local OFFSTATE = modname..":"..basename.."_off"; + local on_use = def.on_use; + minetest.register_craftitem(ONSTATE, { + description = def.description; + inventory_image = TEXPFX..".png"; + wield_image = TEXPFX..".png"; + }); +end + +computer.pixelnodebox = function ( size, boxes ) + local fixed = { }; + local i, box; + for i, box in ipairs(boxes) do + local x, y, z, w, h, l = unpack(box); + fixed[#fixed + 1] = { + (x / size) - 0.5, + (y / size) - 0.5, + (z / size) - 0.5, + ((x + w) / size) - 0.5, + ((y + h) / size) - 0.5, + ((z + l) / size) - 0.5, + }; + end + return { + type = "fixed"; + fixed = fixed; + }; +end + +local MODPATH = minetest.get_modpath("computer"); +dofile(MODPATH.."/computers.lua"); +dofile(MODPATH.."/miscitems.lua"); +dofile(MODPATH.."/recipes.lua"); + + diff --git a/mods/computer/locale/es.txt b/mods/computer/locale/es.txt new file mode 100644 index 00000000..db6fdcb4 --- /dev/null +++ b/mods/computer/locale/es.txt @@ -0,0 +1,6 @@ + +# Language: Español +# Author: Diego Martínez + +Plastic sheet = Placa de Plastico +Unprocessed Plastic base = Base de Plastico No Procesada diff --git a/mods/computer/locale/pt.txt b/mods/computer/locale/pt.txt new file mode 100644 index 00000000..8308618d --- /dev/null +++ b/mods/computer/locale/pt.txt @@ -0,0 +1,5 @@ +# Language: Português do Brasil +# Author: Caio Roberto + +Plastic sheet = Placa de Plástico +Unprocessed Plastic base = Base de Plástico Não Processada diff --git a/mods/computer/miscitems.lua b/mods/computer/miscitems.lua new file mode 100644 index 00000000..7ce63de5 --- /dev/null +++ b/mods/computer/miscitems.lua @@ -0,0 +1,77 @@ + +-- Copyright (C) 2012-2013 Diego Martínez +-- License is WTFPL (see README.txt). + +-- This file defines some items in order to not have to depend on other mods. + +-- Boilerplate to support localized strings if intllib mod is installed. +local S; +if (minetest.get_modpath("intllib")) then + dofile(minetest.get_modpath("intllib").."/intllib.lua"); + S = intllib.Getter(minetest.get_current_modname()); +else + S = function ( s ) return s; end +end + +if (not minetest.get_modpath("homedecor")) then + + minetest.register_craftitem(":homedecor:plastic_sheeting", { + description = S("Plastic sheet"), + inventory_image = "homedecor_plastic_sheeting.png", + }) + + minetest.register_craftitem(":homedecor:plastic_base", { + description = S("Unprocessed Plastic base"), + wield_image = "homedecor_plastic_base.png", + inventory_image = "homedecor_plastic_base_inv.png", + }) + + minetest.register_craft({ + type = "shapeless", + output = 'homedecor:plastic_base 6', + recipe = { "default:junglegrass", + "default:junglegrass", + "default:junglegrass" + } + }) + + minetest.register_craft({ + type = "shapeless", + output = 'homedecor:plastic_base 3', + recipe = { "default:dry_shrub", + "default:dry_shrub", + "default:dry_shrub" + }, + }) + + minetest.register_craft({ + type = "shapeless", + output = 'homedecor:plastic_base 4', + recipe = { "default:leaves", + "default:leaves", + "default:leaves", + "default:leaves", + "default:leaves", + "default:leaves" + } + }) + + minetest.register_craft({ + type = "cooking", + output = "homedecor:plastic_sheeting", + recipe = "homedecor:plastic_base", + }) + + minetest.register_craft({ + type = 'fuel', + recipe = 'homedecor:plastic_base', + burntime = 30, + }) + + minetest.register_craft({ + type = 'fuel', + recipe = 'homedecor:plastic_sheeting', + burntime = 30, + }) + +end -- not homedecor diff --git a/mods/computer/mod.conf b/mods/computer/mod.conf new file mode 100644 index 00000000..a800d6a1 --- /dev/null +++ b/mods/computer/mod.conf @@ -0,0 +1 @@ +name = computer diff --git a/mods/computer/recipes.lua b/mods/computer/recipes.lua new file mode 100644 index 00000000..cc8f0e10 --- /dev/null +++ b/mods/computer/recipes.lua @@ -0,0 +1,118 @@ + +-- Copyright (C) 2012-2013 Diego Martínez +-- License is WTFPL (see README.txt). + +minetest.register_craft({ + output = "computer:shefriendSOO"; + recipe = { + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", }, + { "homedecor:plastic_sheeting", "default:glass", "homedecor:plastic_sheeting", }, + { "homedecor:plastic_sheeting", "default:wood", "homedecor:plastic_sheeting", }, + }; +}); + +minetest.register_craft({ + output = "computer:slaystation"; + recipe = { + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", }, + { "homedecor:plastic_sheeting", "default:wood", "homedecor:plastic_sheeting", }, + }; +}); + +minetest.register_craft({ + output = "computer:vanio"; + recipe = { + { "homedecor:plastic_sheeting", "", "", }, + { "default:glass", "", "" }, + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", }, + }; +}); + +minetest.register_craft({ + output = "computer:specter"; + recipe = { + { "", "", "homedecor:plastic_sheeting", }, + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", }, + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", }, + }; +}); + +minetest.register_craft({ + output = "computer:slaystation2"; + recipe = { + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", }, + { "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", }, + }; +}); + +minetest.register_craft({ + output = "computer:admiral64"; + recipe = { + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", }, + { "default:wood", "default:wood", "default:wood", }, + }; +}); + +minetest.register_craft({ + output = "computer:admiral128"; + recipe = { + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot", }, + }; +}); + +--new stuff + +minetest.register_craft({ + output = "computer:monitor"; + recipe = { + { "homedecor:plastic_sheeting", "default:glass","", }, + { "homedecor:plastic_sheeting", "default:glass","", }, + { "homedecor:plastic_sheeting", "default:mese_crystal_fragment", "homedecor:plastic_sheeting", }, + }; +}); + +minetest.register_craft({ + output = "computer:router"; + recipe = { + { "default:steel_ingot","","", }, + { "default:steel_ingot" ,"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", }, + { "default:mese_crystal_fragment","homedecor:plastic_sheeting", "homedecor:plastic_sheeting", }, + }; +}); + +minetest.register_craft({ + output = "computer:tower"; + recipe = { + { "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", }, + { "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", }, + { "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", }, + }; +}); + +minetest.register_craft({ + output = "computer:printer"; + recipe = { + { "homedecor:plastic_sheeting", "default:steel_ingot","", }, + { "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", }, + { "homedecor:plastic_sheeting", "default:coal_lump", "homedecor:plastic_sheeting", }, + }; +}); + +minetest.register_craft({ + output = "computer:printer"; + recipe = { + { "homedecor:plastic_sheeting", "default:steel_ingot","", }, + { "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", }, + { "homedecor:plastic_sheeting", "dye:black", "homedecor:plastic_sheeting", }, + }; +}); + +minetest.register_craft({ + output = "computer:server"; + recipe = { + { "computer:tower", "computer:tower", "computer:tower", }, + { "computer:tower", "computer:tower", "computer:tower", }, + { "computer:tower", "computer:tower", "computer:tower", }, + }; +}); diff --git a/mods/computer/textures/computer_admiral128_bk.png b/mods/computer/textures/computer_admiral128_bk.png new file mode 100644 index 00000000..488ec1d0 Binary files /dev/null and b/mods/computer/textures/computer_admiral128_bk.png differ diff --git a/mods/computer/textures/computer_admiral128_bt.png b/mods/computer/textures/computer_admiral128_bt.png new file mode 100644 index 00000000..73d1f2a0 Binary files /dev/null and b/mods/computer/textures/computer_admiral128_bt.png differ diff --git a/mods/computer/textures/computer_admiral128_ft.png b/mods/computer/textures/computer_admiral128_ft.png new file mode 100644 index 00000000..dc6a3bc7 Binary files /dev/null and b/mods/computer/textures/computer_admiral128_ft.png differ diff --git a/mods/computer/textures/computer_admiral128_lt.png b/mods/computer/textures/computer_admiral128_lt.png new file mode 100644 index 00000000..07f112cc Binary files /dev/null and b/mods/computer/textures/computer_admiral128_lt.png differ diff --git a/mods/computer/textures/computer_admiral128_rt.png b/mods/computer/textures/computer_admiral128_rt.png new file mode 100644 index 00000000..bf8052d1 Binary files /dev/null and b/mods/computer/textures/computer_admiral128_rt.png differ diff --git a/mods/computer/textures/computer_admiral128_tp.png b/mods/computer/textures/computer_admiral128_tp.png new file mode 100644 index 00000000..e3788a4f Binary files /dev/null and b/mods/computer/textures/computer_admiral128_tp.png differ diff --git a/mods/computer/textures/computer_admiral64_bk.png b/mods/computer/textures/computer_admiral64_bk.png new file mode 100644 index 00000000..b10bb38d Binary files /dev/null and b/mods/computer/textures/computer_admiral64_bk.png differ diff --git a/mods/computer/textures/computer_admiral64_bt.png b/mods/computer/textures/computer_admiral64_bt.png new file mode 100644 index 00000000..fc50758b Binary files /dev/null and b/mods/computer/textures/computer_admiral64_bt.png differ diff --git a/mods/computer/textures/computer_admiral64_ft.png b/mods/computer/textures/computer_admiral64_ft.png new file mode 100644 index 00000000..51f40e6c Binary files /dev/null and b/mods/computer/textures/computer_admiral64_ft.png differ diff --git a/mods/computer/textures/computer_admiral64_lt.png b/mods/computer/textures/computer_admiral64_lt.png new file mode 100644 index 00000000..1332a134 Binary files /dev/null and b/mods/computer/textures/computer_admiral64_lt.png differ diff --git a/mods/computer/textures/computer_admiral64_rt.png b/mods/computer/textures/computer_admiral64_rt.png new file mode 100644 index 00000000..c89353f3 Binary files /dev/null and b/mods/computer/textures/computer_admiral64_rt.png differ diff --git a/mods/computer/textures/computer_admiral64_tp.png b/mods/computer/textures/computer_admiral64_tp.png new file mode 100644 index 00000000..da1fcdd9 Binary files /dev/null and b/mods/computer/textures/computer_admiral64_tp.png differ diff --git a/mods/computer/textures/computer_monitor_b.png b/mods/computer/textures/computer_monitor_b.png new file mode 100644 index 00000000..a79fb66f Binary files /dev/null and b/mods/computer/textures/computer_monitor_b.png differ diff --git a/mods/computer/textures/computer_monitor_bt.png b/mods/computer/textures/computer_monitor_bt.png new file mode 100644 index 00000000..467f0300 Binary files /dev/null and b/mods/computer/textures/computer_monitor_bt.png differ diff --git a/mods/computer/textures/computer_monitor_btdl.png b/mods/computer/textures/computer_monitor_btdl.png new file mode 100644 index 00000000..53e26ea7 Binary files /dev/null and b/mods/computer/textures/computer_monitor_btdl.png differ diff --git a/mods/computer/textures/computer_monitor_f_bios.png b/mods/computer/textures/computer_monitor_f_bios.png new file mode 100644 index 00000000..c6864160 Binary files /dev/null and b/mods/computer/textures/computer_monitor_f_bios.png differ diff --git a/mods/computer/textures/computer_monitor_f_desktop.png b/mods/computer/textures/computer_monitor_f_desktop.png new file mode 100644 index 00000000..4154d752 Binary files /dev/null and b/mods/computer/textures/computer_monitor_f_desktop.png differ diff --git a/mods/computer/textures/computer_monitor_f_dl.png b/mods/computer/textures/computer_monitor_f_dl.png new file mode 100644 index 00000000..ce07c83c Binary files /dev/null and b/mods/computer/textures/computer_monitor_f_dl.png differ diff --git a/mods/computer/textures/computer_monitor_f_loading.png b/mods/computer/textures/computer_monitor_f_loading.png new file mode 100644 index 00000000..eb1d227d Binary files /dev/null and b/mods/computer/textures/computer_monitor_f_loading.png differ diff --git a/mods/computer/textures/computer_monitor_f_login.png b/mods/computer/textures/computer_monitor_f_login.png new file mode 100644 index 00000000..30062708 Binary files /dev/null and b/mods/computer/textures/computer_monitor_f_login.png differ diff --git a/mods/computer/textures/computer_monitor_f_off.png b/mods/computer/textures/computer_monitor_f_off.png new file mode 100644 index 00000000..5d2a6b5f Binary files /dev/null and b/mods/computer/textures/computer_monitor_f_off.png differ diff --git a/mods/computer/textures/computer_monitor_f_on.png b/mods/computer/textures/computer_monitor_f_on.png new file mode 100644 index 00000000..e5cbf21b Binary files /dev/null and b/mods/computer/textures/computer_monitor_f_on.png differ diff --git a/mods/computer/textures/computer_monitor_l.png b/mods/computer/textures/computer_monitor_l.png new file mode 100644 index 00000000..35418570 Binary files /dev/null and b/mods/computer/textures/computer_monitor_l.png differ diff --git a/mods/computer/textures/computer_monitor_r.png b/mods/computer/textures/computer_monitor_r.png new file mode 100644 index 00000000..9d38ab75 Binary files /dev/null and b/mods/computer/textures/computer_monitor_r.png differ diff --git a/mods/computer/textures/computer_monitor_t.png b/mods/computer/textures/computer_monitor_t.png new file mode 100644 index 00000000..fd6286f2 Binary files /dev/null and b/mods/computer/textures/computer_monitor_t.png differ diff --git a/mods/computer/textures/computer_monitor_t_off.png b/mods/computer/textures/computer_monitor_t_off.png new file mode 100644 index 00000000..525fd489 Binary files /dev/null and b/mods/computer/textures/computer_monitor_t_off.png differ diff --git a/mods/computer/textures/computer_monitor_tdl.png b/mods/computer/textures/computer_monitor_tdl.png new file mode 100644 index 00000000..742f1192 Binary files /dev/null and b/mods/computer/textures/computer_monitor_tdl.png differ diff --git a/mods/computer/textures/computer_piepad_inv.png b/mods/computer/textures/computer_piepad_inv.png new file mode 100644 index 00000000..21d956aa Binary files /dev/null and b/mods/computer/textures/computer_piepad_inv.png differ diff --git a/mods/computer/textures/computer_piepad_inv_off.png b/mods/computer/textures/computer_piepad_inv_off.png new file mode 100644 index 00000000..f261b3d5 Binary files /dev/null and b/mods/computer/textures/computer_piepad_inv_off.png differ diff --git a/mods/computer/textures/computer_printer_b.png b/mods/computer/textures/computer_printer_b.png new file mode 100644 index 00000000..9b454801 Binary files /dev/null and b/mods/computer/textures/computer_printer_b.png differ diff --git a/mods/computer/textures/computer_printer_bt.png b/mods/computer/textures/computer_printer_bt.png new file mode 100644 index 00000000..a497c4a2 Binary files /dev/null and b/mods/computer/textures/computer_printer_bt.png differ diff --git a/mods/computer/textures/computer_printer_f.png b/mods/computer/textures/computer_printer_f.png new file mode 100644 index 00000000..8623aaa8 Binary files /dev/null and b/mods/computer/textures/computer_printer_f.png differ diff --git a/mods/computer/textures/computer_printer_l.png b/mods/computer/textures/computer_printer_l.png new file mode 100644 index 00000000..013d5e48 Binary files /dev/null and b/mods/computer/textures/computer_printer_l.png differ diff --git a/mods/computer/textures/computer_printer_r.png b/mods/computer/textures/computer_printer_r.png new file mode 100644 index 00000000..f73fe7e0 Binary files /dev/null and b/mods/computer/textures/computer_printer_r.png differ diff --git a/mods/computer/textures/computer_printer_t.png b/mods/computer/textures/computer_printer_t.png new file mode 100644 index 00000000..fd59245e Binary files /dev/null and b/mods/computer/textures/computer_printer_t.png differ diff --git a/mods/computer/textures/computer_router_b.png b/mods/computer/textures/computer_router_b.png new file mode 100644 index 00000000..e21e55cd Binary files /dev/null and b/mods/computer/textures/computer_router_b.png differ diff --git a/mods/computer/textures/computer_router_bt.png b/mods/computer/textures/computer_router_bt.png new file mode 100644 index 00000000..39c8aebf Binary files /dev/null and b/mods/computer/textures/computer_router_bt.png differ diff --git a/mods/computer/textures/computer_router_f.png b/mods/computer/textures/computer_router_f.png new file mode 100644 index 00000000..5173f1e5 Binary files /dev/null and b/mods/computer/textures/computer_router_f.png differ diff --git a/mods/computer/textures/computer_router_f_animated.png b/mods/computer/textures/computer_router_f_animated.png new file mode 100644 index 00000000..cd78ede4 Binary files /dev/null and b/mods/computer/textures/computer_router_f_animated.png differ diff --git a/mods/computer/textures/computer_router_l.png b/mods/computer/textures/computer_router_l.png new file mode 100644 index 00000000..82f36d4e Binary files /dev/null and b/mods/computer/textures/computer_router_l.png differ diff --git a/mods/computer/textures/computer_router_r.png b/mods/computer/textures/computer_router_r.png new file mode 100644 index 00000000..8a2b3f93 Binary files /dev/null and b/mods/computer/textures/computer_router_r.png differ diff --git a/mods/computer/textures/computer_router_t.png b/mods/computer/textures/computer_router_t.png new file mode 100644 index 00000000..cf2e16ac Binary files /dev/null and b/mods/computer/textures/computer_router_t.png differ diff --git a/mods/computer/textures/computer_server_bt.png b/mods/computer/textures/computer_server_bt.png new file mode 100644 index 00000000..6f83d6f7 Binary files /dev/null and b/mods/computer/textures/computer_server_bt.png differ diff --git a/mods/computer/textures/computer_server_f_off.png b/mods/computer/textures/computer_server_f_off.png new file mode 100644 index 00000000..f682de62 Binary files /dev/null and b/mods/computer/textures/computer_server_f_off.png differ diff --git a/mods/computer/textures/computer_server_f_on.png b/mods/computer/textures/computer_server_f_on.png new file mode 100644 index 00000000..09886751 Binary files /dev/null and b/mods/computer/textures/computer_server_f_on.png differ diff --git a/mods/computer/textures/computer_server_inv.png b/mods/computer/textures/computer_server_inv.png new file mode 100644 index 00000000..88609d88 Binary files /dev/null and b/mods/computer/textures/computer_server_inv.png differ diff --git a/mods/computer/textures/computer_server_l.png b/mods/computer/textures/computer_server_l.png new file mode 100644 index 00000000..92fb45b9 Binary files /dev/null and b/mods/computer/textures/computer_server_l.png differ diff --git a/mods/computer/textures/computer_server_r.png b/mods/computer/textures/computer_server_r.png new file mode 100644 index 00000000..b9d49ee5 Binary files /dev/null and b/mods/computer/textures/computer_server_r.png differ diff --git a/mods/computer/textures/computer_server_t.png b/mods/computer/textures/computer_server_t.png new file mode 100644 index 00000000..1de44996 Binary files /dev/null and b/mods/computer/textures/computer_server_t.png differ diff --git a/mods/computer/textures/computer_shefriendSOO_bk.png b/mods/computer/textures/computer_shefriendSOO_bk.png new file mode 100644 index 00000000..4f179b69 Binary files /dev/null and b/mods/computer/textures/computer_shefriendSOO_bk.png differ diff --git a/mods/computer/textures/computer_shefriendSOO_bt.png b/mods/computer/textures/computer_shefriendSOO_bt.png new file mode 100644 index 00000000..a052328f Binary files /dev/null and b/mods/computer/textures/computer_shefriendSOO_bt.png differ diff --git a/mods/computer/textures/computer_shefriendSOO_ft.png b/mods/computer/textures/computer_shefriendSOO_ft.png new file mode 100644 index 00000000..b4e1f3ae Binary files /dev/null and b/mods/computer/textures/computer_shefriendSOO_ft.png differ diff --git a/mods/computer/textures/computer_shefriendSOO_ft_off.png b/mods/computer/textures/computer_shefriendSOO_ft_off.png new file mode 100644 index 00000000..3295bf20 Binary files /dev/null and b/mods/computer/textures/computer_shefriendSOO_ft_off.png differ diff --git a/mods/computer/textures/computer_shefriendSOO_lt.png b/mods/computer/textures/computer_shefriendSOO_lt.png new file mode 100644 index 00000000..193850d2 Binary files /dev/null and b/mods/computer/textures/computer_shefriendSOO_lt.png differ diff --git a/mods/computer/textures/computer_shefriendSOO_rt.png b/mods/computer/textures/computer_shefriendSOO_rt.png new file mode 100644 index 00000000..7fd2f3ab Binary files /dev/null and b/mods/computer/textures/computer_shefriendSOO_rt.png differ diff --git a/mods/computer/textures/computer_shefriendSOO_tp.png b/mods/computer/textures/computer_shefriendSOO_tp.png new file mode 100644 index 00000000..0c34c88e Binary files /dev/null and b/mods/computer/textures/computer_shefriendSOO_tp.png differ diff --git a/mods/computer/textures/computer_slaystation2_bk.png b/mods/computer/textures/computer_slaystation2_bk.png new file mode 100644 index 00000000..a7af9b8b Binary files /dev/null and b/mods/computer/textures/computer_slaystation2_bk.png differ diff --git a/mods/computer/textures/computer_slaystation2_bt.png b/mods/computer/textures/computer_slaystation2_bt.png new file mode 100644 index 00000000..bac0f75f Binary files /dev/null and b/mods/computer/textures/computer_slaystation2_bt.png differ diff --git a/mods/computer/textures/computer_slaystation2_ft.png b/mods/computer/textures/computer_slaystation2_ft.png new file mode 100644 index 00000000..364059a3 Binary files /dev/null and b/mods/computer/textures/computer_slaystation2_ft.png differ diff --git a/mods/computer/textures/computer_slaystation2_ft_off.png b/mods/computer/textures/computer_slaystation2_ft_off.png new file mode 100644 index 00000000..6d06d574 Binary files /dev/null and b/mods/computer/textures/computer_slaystation2_ft_off.png differ diff --git a/mods/computer/textures/computer_slaystation2_lt.png b/mods/computer/textures/computer_slaystation2_lt.png new file mode 100644 index 00000000..5fe035bd Binary files /dev/null and b/mods/computer/textures/computer_slaystation2_lt.png differ diff --git a/mods/computer/textures/computer_slaystation2_rt.png b/mods/computer/textures/computer_slaystation2_rt.png new file mode 100644 index 00000000..c0958c86 Binary files /dev/null and b/mods/computer/textures/computer_slaystation2_rt.png differ diff --git a/mods/computer/textures/computer_slaystation2_tp.png b/mods/computer/textures/computer_slaystation2_tp.png new file mode 100644 index 00000000..273ed877 Binary files /dev/null and b/mods/computer/textures/computer_slaystation2_tp.png differ diff --git a/mods/computer/textures/computer_slaystation_bk.png b/mods/computer/textures/computer_slaystation_bk.png new file mode 100644 index 00000000..d3da3bf3 Binary files /dev/null and b/mods/computer/textures/computer_slaystation_bk.png differ diff --git a/mods/computer/textures/computer_slaystation_bt.png b/mods/computer/textures/computer_slaystation_bt.png new file mode 100644 index 00000000..0bd1a469 Binary files /dev/null and b/mods/computer/textures/computer_slaystation_bt.png differ diff --git a/mods/computer/textures/computer_slaystation_ft.png b/mods/computer/textures/computer_slaystation_ft.png new file mode 100644 index 00000000..03541062 Binary files /dev/null and b/mods/computer/textures/computer_slaystation_ft.png differ diff --git a/mods/computer/textures/computer_slaystation_lt.png b/mods/computer/textures/computer_slaystation_lt.png new file mode 100644 index 00000000..ed698ae9 Binary files /dev/null and b/mods/computer/textures/computer_slaystation_lt.png differ diff --git a/mods/computer/textures/computer_slaystation_rt.png b/mods/computer/textures/computer_slaystation_rt.png new file mode 100644 index 00000000..06b40ccb Binary files /dev/null and b/mods/computer/textures/computer_slaystation_rt.png differ diff --git a/mods/computer/textures/computer_slaystation_tp.png b/mods/computer/textures/computer_slaystation_tp.png new file mode 100644 index 00000000..eace2884 Binary files /dev/null and b/mods/computer/textures/computer_slaystation_tp.png differ diff --git a/mods/computer/textures/computer_slaystation_tp_off.png b/mods/computer/textures/computer_slaystation_tp_off.png new file mode 100644 index 00000000..6fa3b7ed Binary files /dev/null and b/mods/computer/textures/computer_slaystation_tp_off.png differ diff --git a/mods/computer/textures/computer_specter_bk.png b/mods/computer/textures/computer_specter_bk.png new file mode 100644 index 00000000..503a2e32 Binary files /dev/null and b/mods/computer/textures/computer_specter_bk.png differ diff --git a/mods/computer/textures/computer_specter_bt.png b/mods/computer/textures/computer_specter_bt.png new file mode 100644 index 00000000..c33a0b35 Binary files /dev/null and b/mods/computer/textures/computer_specter_bt.png differ diff --git a/mods/computer/textures/computer_specter_ft.png b/mods/computer/textures/computer_specter_ft.png new file mode 100644 index 00000000..c4ca02e6 Binary files /dev/null and b/mods/computer/textures/computer_specter_ft.png differ diff --git a/mods/computer/textures/computer_specter_lt.png b/mods/computer/textures/computer_specter_lt.png new file mode 100644 index 00000000..73b8d4d7 Binary files /dev/null and b/mods/computer/textures/computer_specter_lt.png differ diff --git a/mods/computer/textures/computer_specter_rt.png b/mods/computer/textures/computer_specter_rt.png new file mode 100644 index 00000000..50996af0 Binary files /dev/null and b/mods/computer/textures/computer_specter_rt.png differ diff --git a/mods/computer/textures/computer_specter_tp.png b/mods/computer/textures/computer_specter_tp.png new file mode 100644 index 00000000..0d5a92da Binary files /dev/null and b/mods/computer/textures/computer_specter_tp.png differ diff --git a/mods/computer/textures/computer_tower_b.png b/mods/computer/textures/computer_tower_b.png new file mode 100644 index 00000000..12b9598a Binary files /dev/null and b/mods/computer/textures/computer_tower_b.png differ diff --git a/mods/computer/textures/computer_tower_bt.png b/mods/computer/textures/computer_tower_bt.png new file mode 100644 index 00000000..fc9fd029 Binary files /dev/null and b/mods/computer/textures/computer_tower_bt.png differ diff --git a/mods/computer/textures/computer_tower_f_off.png b/mods/computer/textures/computer_tower_f_off.png new file mode 100644 index 00000000..d4f2d75b Binary files /dev/null and b/mods/computer/textures/computer_tower_f_off.png differ diff --git a/mods/computer/textures/computer_tower_f_on.png b/mods/computer/textures/computer_tower_f_on.png new file mode 100644 index 00000000..a01bc7f9 Binary files /dev/null and b/mods/computer/textures/computer_tower_f_on.png differ diff --git a/mods/computer/textures/computer_tower_l.png b/mods/computer/textures/computer_tower_l.png new file mode 100644 index 00000000..308fb46d Binary files /dev/null and b/mods/computer/textures/computer_tower_l.png differ diff --git a/mods/computer/textures/computer_tower_r.png b/mods/computer/textures/computer_tower_r.png new file mode 100644 index 00000000..95be5fe6 Binary files /dev/null and b/mods/computer/textures/computer_tower_r.png differ diff --git a/mods/computer/textures/computer_tower_t.png b/mods/computer/textures/computer_tower_t.png new file mode 100644 index 00000000..ee970418 Binary files /dev/null and b/mods/computer/textures/computer_tower_t.png differ diff --git a/mods/computer/textures/computer_vanio_bk.png b/mods/computer/textures/computer_vanio_bk.png new file mode 100644 index 00000000..50fabf59 Binary files /dev/null and b/mods/computer/textures/computer_vanio_bk.png differ diff --git a/mods/computer/textures/computer_vanio_bk_off.png b/mods/computer/textures/computer_vanio_bk_off.png new file mode 100644 index 00000000..8a2d0745 Binary files /dev/null and b/mods/computer/textures/computer_vanio_bk_off.png differ diff --git a/mods/computer/textures/computer_vanio_bt.png b/mods/computer/textures/computer_vanio_bt.png new file mode 100644 index 00000000..33b630ae Binary files /dev/null and b/mods/computer/textures/computer_vanio_bt.png differ diff --git a/mods/computer/textures/computer_vanio_ft.png b/mods/computer/textures/computer_vanio_ft.png new file mode 100644 index 00000000..bdc943cb Binary files /dev/null and b/mods/computer/textures/computer_vanio_ft.png differ diff --git a/mods/computer/textures/computer_vanio_ft_off.png b/mods/computer/textures/computer_vanio_ft_off.png new file mode 100644 index 00000000..8a2d0745 Binary files /dev/null and b/mods/computer/textures/computer_vanio_ft_off.png differ diff --git a/mods/computer/textures/computer_vanio_lt.png b/mods/computer/textures/computer_vanio_lt.png new file mode 100644 index 00000000..0bc3d68c Binary files /dev/null and b/mods/computer/textures/computer_vanio_lt.png differ diff --git a/mods/computer/textures/computer_vanio_lt_off.png b/mods/computer/textures/computer_vanio_lt_off.png new file mode 100644 index 00000000..8a2d0745 Binary files /dev/null and b/mods/computer/textures/computer_vanio_lt_off.png differ diff --git a/mods/computer/textures/computer_vanio_rt.png b/mods/computer/textures/computer_vanio_rt.png new file mode 100644 index 00000000..014015eb Binary files /dev/null and b/mods/computer/textures/computer_vanio_rt.png differ diff --git a/mods/computer/textures/computer_vanio_rt_off.png b/mods/computer/textures/computer_vanio_rt_off.png new file mode 100644 index 00000000..8a2d0745 Binary files /dev/null and b/mods/computer/textures/computer_vanio_rt_off.png differ diff --git a/mods/computer/textures/computer_vanio_tp.png b/mods/computer/textures/computer_vanio_tp.png new file mode 100644 index 00000000..61144dca Binary files /dev/null and b/mods/computer/textures/computer_vanio_tp.png differ diff --git a/mods/computer/textures/computer_vanio_tp_off.png b/mods/computer/textures/computer_vanio_tp_off.png new file mode 100644 index 00000000..641704f4 Binary files /dev/null and b/mods/computer/textures/computer_vanio_tp_off.png differ diff --git a/mods/computer/textures/computer_wee_bk.png b/mods/computer/textures/computer_wee_bk.png new file mode 100644 index 00000000..78bca440 Binary files /dev/null and b/mods/computer/textures/computer_wee_bk.png differ diff --git a/mods/computer/textures/computer_wee_bt.png b/mods/computer/textures/computer_wee_bt.png new file mode 100644 index 00000000..19f80ee7 Binary files /dev/null and b/mods/computer/textures/computer_wee_bt.png differ diff --git a/mods/computer/textures/computer_wee_ft.png b/mods/computer/textures/computer_wee_ft.png new file mode 100644 index 00000000..ca58d7e7 Binary files /dev/null and b/mods/computer/textures/computer_wee_ft.png differ diff --git a/mods/computer/textures/computer_wee_ft_off.png b/mods/computer/textures/computer_wee_ft_off.png new file mode 100644 index 00000000..4d50cc03 Binary files /dev/null and b/mods/computer/textures/computer_wee_ft_off.png differ diff --git a/mods/computer/textures/computer_wee_lt.png b/mods/computer/textures/computer_wee_lt.png new file mode 100644 index 00000000..57157639 Binary files /dev/null and b/mods/computer/textures/computer_wee_lt.png differ diff --git a/mods/computer/textures/computer_wee_rt.png b/mods/computer/textures/computer_wee_rt.png new file mode 100644 index 00000000..57157639 Binary files /dev/null and b/mods/computer/textures/computer_wee_rt.png differ diff --git a/mods/computer/textures/computer_wee_tp.png b/mods/computer/textures/computer_wee_tp.png new file mode 100644 index 00000000..ae658fc9 Binary files /dev/null and b/mods/computer/textures/computer_wee_tp.png differ diff --git a/mods/computer/textures/homedecor_plastic_base.png b/mods/computer/textures/homedecor_plastic_base.png new file mode 100644 index 00000000..4d0e3f25 Binary files /dev/null and b/mods/computer/textures/homedecor_plastic_base.png differ diff --git a/mods/computer/textures/homedecor_plastic_base_inv.png b/mods/computer/textures/homedecor_plastic_base_inv.png new file mode 100644 index 00000000..3a02005d Binary files /dev/null and b/mods/computer/textures/homedecor_plastic_base_inv.png differ diff --git a/mods/computer/textures/homedecor_plastic_sheeting.png b/mods/computer/textures/homedecor_plastic_sheeting.png new file mode 100644 index 00000000..810ea2aa Binary files /dev/null and b/mods/computer/textures/homedecor_plastic_sheeting.png differ diff --git a/mods/computer/textures/unused/computer_babytower_back.png b/mods/computer/textures/unused/computer_babytower_back.png new file mode 100644 index 00000000..711649a2 Binary files /dev/null and b/mods/computer/textures/unused/computer_babytower_back.png differ diff --git a/mods/computer/textures/unused/computer_babytower_bottom.png b/mods/computer/textures/unused/computer_babytower_bottom.png new file mode 100644 index 00000000..711649a2 Binary files /dev/null and b/mods/computer/textures/unused/computer_babytower_bottom.png differ diff --git a/mods/computer/textures/unused/computer_babytower_front.png b/mods/computer/textures/unused/computer_babytower_front.png new file mode 100644 index 00000000..6bbbdd1b Binary files /dev/null and b/mods/computer/textures/unused/computer_babytower_front.png differ diff --git a/mods/computer/textures/unused/computer_babytower_left.png b/mods/computer/textures/unused/computer_babytower_left.png new file mode 100644 index 00000000..711649a2 Binary files /dev/null and b/mods/computer/textures/unused/computer_babytower_left.png differ diff --git a/mods/computer/textures/unused/computer_babytower_right.png b/mods/computer/textures/unused/computer_babytower_right.png new file mode 100644 index 00000000..711649a2 Binary files /dev/null and b/mods/computer/textures/unused/computer_babytower_right.png differ diff --git a/mods/computer/textures/unused/computer_babytower_top.png b/mods/computer/textures/unused/computer_babytower_top.png new file mode 100644 index 00000000..f7ff21b1 Binary files /dev/null and b/mods/computer/textures/unused/computer_babytower_top.png differ diff --git a/mods/computer/textures/unused/computer_computer_front_old.png b/mods/computer/textures/unused/computer_computer_front_old.png new file mode 100644 index 00000000..6cff1c17 Binary files /dev/null and b/mods/computer/textures/unused/computer_computer_front_old.png differ diff --git a/mods/computer/textures/unused/computer_computer_top_old.png b/mods/computer/textures/unused/computer_computer_top_old.png new file mode 100644 index 00000000..422ad94f Binary files /dev/null and b/mods/computer/textures/unused/computer_computer_top_old.png differ diff --git a/mods/computer/textures/unused/computer_shefriendSOO_ (copia).png b/mods/computer/textures/unused/computer_shefriendSOO_ (copia).png new file mode 100644 index 00000000..711649a2 Binary files /dev/null and b/mods/computer/textures/unused/computer_shefriendSOO_ (copia).png differ diff --git a/mods/computer/textures/unused/computer_spectre_back.png b/mods/computer/textures/unused/computer_spectre_back.png new file mode 100644 index 00000000..83263db8 Binary files /dev/null and b/mods/computer/textures/unused/computer_spectre_back.png differ diff --git a/mods/computer/textures/unused/computer_spectre_bottom.png b/mods/computer/textures/unused/computer_spectre_bottom.png new file mode 100644 index 00000000..439e9d4a Binary files /dev/null and b/mods/computer/textures/unused/computer_spectre_bottom.png differ diff --git a/mods/computer/textures/unused/computer_spectre_front.png b/mods/computer/textures/unused/computer_spectre_front.png new file mode 100644 index 00000000..82193601 Binary files /dev/null and b/mods/computer/textures/unused/computer_spectre_front.png differ diff --git a/mods/computer/textures/unused/computer_spectre_left.png b/mods/computer/textures/unused/computer_spectre_left.png new file mode 100644 index 00000000..69e4e08b Binary files /dev/null and b/mods/computer/textures/unused/computer_spectre_left.png differ diff --git a/mods/computer/textures/unused/computer_spectre_right.png b/mods/computer/textures/unused/computer_spectre_right.png new file mode 100644 index 00000000..4030e9be Binary files /dev/null and b/mods/computer/textures/unused/computer_spectre_right.png differ diff --git a/mods/computer/textures/unused/computer_spectre_top.png b/mods/computer/textures/unused/computer_spectre_top.png new file mode 100644 index 00000000..96220a06 Binary files /dev/null and b/mods/computer/textures/unused/computer_spectre_top.png differ diff --git a/mods/crops/.luacheckrc b/mods/crops/.luacheckrc new file mode 100644 index 00000000..15eed666 --- /dev/null +++ b/mods/crops/.luacheckrc @@ -0,0 +1,15 @@ +unused_args = false +allow_defined_top = true + +read_globals = { + "DIR_DELIM", + "minetest", "core", + "dump", + "vector", "nodeupdate", + "VoxelManip", "VoxelArea", + "PseudoRandom", "ItemStack", + "intllib", + "default", + table = { fields = { "copy", "getn" } } +} + diff --git a/mods/crops/LICENSE b/mods/crops/LICENSE new file mode 100644 index 00000000..e6576937 --- /dev/null +++ b/mods/crops/LICENSE @@ -0,0 +1,38 @@ + +Crops - a minetest mod that adds more farming crops + +See spdx.org/licenses to see what the License Identifiers used below mean. + +=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ + +All source code (lua): + (C) Auke Kok + LGPL-2.0+ + +All textures, models: + (C) Auke Kok + CC-BY-SA-3.0 + +Translations: + - de.po + (C) 2017 LNJ + LGPL-2.0+ + +Sounds: + - crops_watercan_splash* + http://freesound.org/people/junggle/sounds/27361/ + http://profiles.google.com/jun66le + CC-BY-3.0 + - crops_watercan_entering.ogg + http://freesound.org/people/Quistard/sounds/166824/ + CC-BY-3.0 + - crops_flies.ogg + http://www.freesound.org/people/galeku/sounds/46938/ + CC0-1.0 + - crops_watercan_watering.ogg + http://www.freesound.org/people/Eakoontz/sounds/151736/ + CC0-1.0 + +* Sounds edited with audacity + +=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ diff --git a/mods/crops/Makefile b/mods/crops/Makefile new file mode 100644 index 00000000..25868446 --- /dev/null +++ b/mods/crops/Makefile @@ -0,0 +1,10 @@ + +PROJECT = crops +all: release + +release: + VERSION=`git describe --tags`; \ + git archive --format zip --output "$(PROJECT)-$${VERSION}.zip" --prefix=$(PROJECT)/ master + +poupdate: + ../intllib/tools/xgettext.sh *.lua diff --git a/mods/crops/cooking.lua b/mods/crops/cooking.lua new file mode 100644 index 00000000..1d58bf2f --- /dev/null +++ b/mods/crops/cooking.lua @@ -0,0 +1,75 @@ + +--[[ + +Copyright (C) 2015 - Auke Kok + +"crops" 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; either version 2.1 +of the license, or (at your option) any later version. + +--]] + +-- +-- cooking recipes that don't go directly with any of the +-- crops in this mod - either these combine them in new +-- ways or use other items +-- + +-- Intllib +local S = crops.intllib + +minetest.register_craftitem("crops:unbaked_clay_bowl", { + description = S("Unbaked clay bowl"), + inventory_image = "crops_unbaked_clay_bowl.png", +}) + +minetest.register_craft({ + output = "crops:unbaked_clay_bowl", + recipe = { + { "", "", "" }, + { "default:clay_lump", "", "default:clay_lump" }, + { "", "default:clay_lump", "" } + } +}) + +minetest.register_craftitem("crops:clay_bowl", { + description = S("Clay bowl"), + inventory_image = "crops_clay_bowl.png", + groups = { food_bowl=1 } +}) + +minetest.register_craft({ + type = "cooking", + output = "crops:clay_bowl", + recipe = "crops:unbaked_clay_bowl" +}) + +minetest.register_craftitem("crops:vegetable_stew", { + description = S("Bowl of vegetable stew"), + inventory_image = "crops_bowl_vegetable_stew.png", + groups = { eatable=1 }, + on_use = minetest.item_eat(8, "crops:clay_bowl"), +}) + +minetest.register_craft({ + type = "cooking", + output = "crops:vegetable_stew", + recipe = "crops:uncooked_vegetable_stew" +}) + +minetest.register_craftitem("crops:uncooked_vegetable_stew", { + description = S("Bowl of uncooked vegetable stew"), + inventory_image = "crops_bowl_uncooked_vegetable_stew.png", + groups = { eatable=1 }, + on_use = minetest.item_eat(2, "crops:clay_bowl") +}) + +minetest.register_craft({ + output = "crops:uncooked_vegetable_stew", + recipe = { + { "", "", "" }, + { "crops:green_bean", "crops:potato", "crops:tomato" }, + { "", "group:food_bowl", "" } + } +}) diff --git a/mods/crops/corn.lua b/mods/crops/corn.lua new file mode 100644 index 00000000..15dc886b --- /dev/null +++ b/mods/crops/corn.lua @@ -0,0 +1,347 @@ + +--[[ + +Copyright (C) 2015 - Auke Kok + +"crops" 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; either version 2.1 +of the license, or (at your option) any later version. + +--]] + +-- Intllib +local S = crops.intllib + +minetest.register_node("crops:corn", { + description = S("Corn"), + inventory_image = "crops_corn.png", + wield_image = "crops_corn.png", + tiles = { "crops_corn_base_seed.png" }, + drawtype = "plantlike", + paramtype2 = "meshoptions", + waving = 1, + sunlight_propagates = true, + use_texture_alpha = true, + walkable = true, + paramtype = "light", + node_placement_prediction = "crops:corn_base_seed", + groups = { snappy=3,flammable=3,flora=1,attached_node=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + + on_place = function(itemstack, placer, pointed_thing) + local under = minetest.get_node(pointed_thing.under) + if minetest.get_item_group(under.name, "soil") <= 1 then + return + end + crops.plant(pointed_thing.above, {name="crops:corn_base_seed", param2 = 3}) + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end + return itemstack + end +}) + +minetest.register_craftitem("crops:corn_cob", { + description = S("Corn Cob"), + inventory_image = "crops_corn_cob.png", +}) + +minetest.register_craft({ + type = "shapeless", + output = "crops:corn", + recipe = { "crops:corn_cob" } +}) + +minetest.register_craftitem("crops:corn_on_the_cob", { + description = S("Corn on the Cob"), + inventory_image = "crops_corn_on_the_cob.png", + on_use = minetest.item_eat(1) +}) + +minetest.register_craft({ + type = "cooking", + output = "crops:corn_on_the_cob", + recipe = "crops:corn_cob" +}) + +minetest.register_node("crops:corn_base_seed", { + visual = "mesh", + description = S("Corn plant"), + drawtype = "plantlike", + paramtype2 = "meshoptions", + waving = 1, + tiles = { "crops_corn_base_seed.png" }, + use_texture_alpha = true, + walkable = false, + sunlight_propagates = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.3, 0.5} + } +}) + +minetest.register_abm({ + nodenames = { "crops:corn_base_seed" }, + neighbors = { "group:soil" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + minetest.swap_node(pos, { name = "crops:corn_base_1", param2 = 3 }) + end +}) + +minetest.register_node("crops:corn_base_1", { + visual = "mesh", + description = S("Corn plant"), + drawtype = "plantlike", + paramtype2 = "meshoptions", + tiles = { "crops_corn_base_1.png" }, + waving = 1, + use_texture_alpha = true, + walkable = false, + sunlight_propagates = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_abm({ + nodenames = { "crops:corn_base_1" }, + neighbors = { "group:soil" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + if not minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then + return + end + minetest.swap_node(pos, { name = "crops:corn_base_2", param2 = 3 }) + local above = {x = pos.x, y = pos.y + 1, z = pos.z} + minetest.set_node(above , { name = "crops:corn_top_1", param2 = 3 }) + local meta = minetest.get_meta(above) + meta:set_int("crops_top_half", 1) + end +}) + +minetest.register_node("crops:corn_base_2", { + description = S("Corn plant"), + drawtype = "plantlike", + paramtype2 = "meshoptions", + tiles = { "crops_corn_base_2.png" }, + use_texture_alpha = true, + walkable = false, + sunlight_propagates = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + on_dig = function(pos, node, digger) + local above = {x = pos.x, y = pos.y + 1, z = pos.z} + if minetest.get_node(above).name == "crops:corn_top_1" or minetest.get_node(above).name == "crops:corn_top_2" then + minetest.remove_node(above) + minetest.remove_node(pos) + return + end + if not minetest.get_node(above).name == "crops:corn_top_3" then + minetest.remove_node(pos) + end + + local meta = minetest.get_meta(pos) + local damage = meta:get_int("crops_damage") + local drops = {} + -- 0 - 2-4 + -- 50 - 2-3 + -- 100 - 1-1 + for i = 1,math.random(2 - (damage / 100), 4 - (3 * (damage / 100))) do + table.insert(drops, ('crops:corn_cob')) + end + minetest.set_node(pos, { name = "crops:corn_base_3", param2 = 3 }) + minetest.set_node(above, { name = "crops:corn_top_4", param2 = 3 }) + core.handle_node_drops(above, drops, digger) + end +}) + +minetest.register_node("crops:corn_base_3", { + description = S("Corn plant"), + drawtype = "plantlike", + paramtype2 = "meshoptions", + tiles = { "crops_corn_base_3.png" }, + use_texture_alpha = true, + walkable = false, + sunlight_propagates = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + on_dig = function(pos, node, digger) + local above = {x = pos.x, y = pos.y + 1, z = pos.z} + if minetest.get_node(above).name == "crops:corn_top_4" then + minetest.remove_node(above) + end + minetest.remove_node(pos) + end +}) + +minetest.register_node("crops:corn_top_1", { + description = S("Corn plant"), + drawtype = "plantlike", + paramtype2 = "meshoptions", + tiles = { "crops_corn_base_1.png" }, + waving = 1, + use_texture_alpha = true, + walkable = false, + sunlight_propagates = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + on_dig = function(pos, node, digger) + local below = {x = pos.x, y = pos.y - 1, z = pos.z} + if not minetest.get_node(below).name == "crops:base_2" then + return + end + minetest.remove_node(below) + minetest.remove_node(pos) + end +}) + +minetest.register_abm({ + nodenames = { "crops:corn_top_1" }, + neighbors = { "crops:corn_base_2" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if minetest.get_node_light(pos, nil) < crops.settings.light then + return + end + minetest.swap_node(pos, { name = "crops:corn_top_2", param2 = 3 }) + end +}) + +minetest.register_node("crops:corn_top_2", { + description = S("Corn plant"), + drawtype = "plantlike", + paramtype2 = "meshoptions", + tiles = { "crops_corn_top_1.png" }, + waving = 1, + use_texture_alpha = true, + walkable = false, + sunlight_propagates = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + + on_dig = function(pos, node, digger) + local below = {x = pos.x, y = pos.y - 1, z = pos.z} + if not minetest.get_node(below).name == "crops:base_2" then + return + end + minetest.remove_node(below) + minetest.remove_node(pos) + end +}) + +minetest.register_abm({ + nodenames = { "crops:corn_top_2" }, + neighbors = { "crops:corn_base_2" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + -- we don't call crops.grow here otherwise there would be 2 abm's hitting + -- this stack, and dmg needs to be applied to the bottom part + if minetest.get_node_light(pos, nil) < crops.settings.light then + return + end + minetest.swap_node(pos, { name = "crops:corn_top_3", param2 = 3 }) + end +}) + +minetest.register_node("crops:corn_top_3", { + description = S("Corn plant"), + drawtype = "plantlike", + paramtype2 = "meshoptions", + tiles = { "crops_corn_top_2.png" }, + waving = 1, + use_texture_alpha = true, + walkable = false, + sunlight_propagates = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + + on_dig = function(pos, node, digger) + local below = { x = pos.x, y = pos.y - 1, z = pos.z } + local meta = minetest.get_meta(below) + local damage = meta:get_int("crops_damage") + local drops = {} + -- 0 - 2-4 + -- 50 - 2-3 + -- 100 - 1-1 + for i = 1,math.random(2 - (damage / 100), 4 - (3 * (damage / 100))) do + table.insert(drops, ('crops:corn_cob')) + end + crops.die(below) + core.handle_node_drops(pos, drops, digger) + end +}) + +minetest.register_node("crops:corn_top_4", { + description = S("Corn plant"), + drawtype = "plantlike", + paramtype2 = "meshoptions", + tiles = { "crops_corn_top_3.png" }, + waving = 1, + use_texture_alpha = true, + walkable = false, + sunlight_propagates = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + + on_dig = function(pos, node, digger) + local below = {x = pos.x, y = pos.y - 1, z = pos.z} + if minetest.get_node(below).name == "crops:corn_base_3" then + minetest.remove_node(below) + end + minetest.remove_node(pos) + end +}) + +crops.corn_die = function(pos) + minetest.set_node(pos, { name = "crops:corn_base_3", param2 = 3 }) + local above = {x = pos.x, y = pos.y + 1, z = pos.z} + minetest.set_node(above, { name = "crops:corn_top_4", param2 = 3 }) +end + +local properties = { + die = crops.corn_die, + waterstart = 40, + wateruse = 1, + night = 5, + soak = 60, + soak_damage = 75, + wither = 10, + wither_damage = 5, + doublesize = true, +} + +crops.register({ name = "crops:corn_base_seed", properties = properties }) +crops.register({ name = "crops:corn_base_1", properties = properties }) +crops.register({ name = "crops:corn_base_2", properties = properties }) +crops.register({ name = "crops:corn_base_3", properties = properties }) + diff --git a/mods/crops/crops_settings.txt b/mods/crops/crops_settings.txt new file mode 100644 index 00000000..ac97802c --- /dev/null +++ b/mods/crops/crops_settings.txt @@ -0,0 +1,10 @@ + +-- +-- crops_settings.txt +-- +-- These are the default difficulty settings for the crops mod. You can uncomment +-- the "easy" or "difficult" settings if you wish, or come up with your own values. +-- + +-- Valid values are "easy", "normal", and "difficult" +crops.difficulty = "normal" diff --git a/mods/crops/depends.txt b/mods/crops/depends.txt new file mode 100644 index 00000000..657056ab --- /dev/null +++ b/mods/crops/depends.txt @@ -0,0 +1,3 @@ +default +farming +intllib? diff --git a/mods/crops/description.txt b/mods/crops/description.txt new file mode 100644 index 00000000..8b85a22a --- /dev/null +++ b/mods/crops/description.txt @@ -0,0 +1,5 @@ +This mod expands the basic set of farming-related crops that minetest_game offers. It adds melons, potatoes, tomatoes, green beans and corn. The mod also implements plant humidity - you will have to water plants to make sure they're not dried out, or make sure they don't get over-watered. + +Mod specific settings can be changed in the "crops_settings.txt" file in the world folder. + +For more information, go to: http://goo.gl/wf0XLh diff --git a/mods/crops/init.lua b/mods/crops/init.lua new file mode 100644 index 00000000..0e5e4aaf --- /dev/null +++ b/mods/crops/init.lua @@ -0,0 +1,385 @@ + +--[[ + +Copyright (C) 2015 - Auke Kok + +"crops" 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; either version 2.1 +of the license, or (at your option) any later version. + +--]] + +crops = {} +crops.plants = {} +crops.settings = {} + +local settings = {} +settings.easy = { + chance = 4, + interval = 30, + light = 8, + watercan = 25, + watercan_max = 90, + watercan_uses = 20, + damage_chance = 8, + damage_interval = 30, + damage_tick_min = 0, + damage_tick_max = 1, + damage_max = 25, + hydration = false, +} +settings.normal = { + chance = 8, + interval = 30, + light = 10, + watercan = 25, + watercan_max = 90, + watercan_uses = 20, + damage_chance = 8, + damage_interval = 30, + damage_tick_min = 0, + damage_tick_max = 5, + damage_max = 50, + hydration = true, +} +settings.difficult = { + chance = 16, + interval = 30, + light = 13, + watercan = 25, + watercan_max = 100, + watercan_uses = 20, + damage_chance = 4, + damage_interval = 30, + damage_tick_min = 3, + damage_tick_max = 7, + damage_max = 100, + hydration = true, +} + + +local worldpath = minetest.get_worldpath() +local modpath = minetest.get_modpath(minetest.get_current_modname()) + +-- Load support for intllib. +local S, _ = dofile(modpath .. "/intllib.lua") +crops.intllib = S + + +dofile(modpath .. "/crops_settings.txt") + +if io.open(worldpath .. "/crops_settings.txt", "r") == nil then + io.input(modpath .. "/crops_settings.txt") + io.output(worldpath .. "/crops_settings.txt") + + local size = 4096 + while true do + local buf = io.read(size) + if not buf then + io.close() + break + end + io.write(buf) + end +else + dofile(worldpath .. "/crops_settings.txt") +end + +if not crops.difficulty then + crops.difficulty = "normal" + minetest.log("error", "[crops] "..S("Defaulting to \"normal\" difficulty settings")) +end +crops.settings = settings[crops.difficulty] +if not crops.settings then + minetest.log("error", "[crops] "..S("Defaulting to \"normal\" difficulty settings")) + crops.settings = settings.normal +end +if crops.settings.hydration then + minetest.log("action", "[crops] "..S("Hydration and dehydration mechanics are enabled.")) +end + +local find_plant = function(node) + for i = 1,table.getn(crops.plants) do + if crops.plants[i].name == node.name then + return crops.plants[i] + end + end + minetest.log("error", "[crops] "..S("Unable to find plant \"@1\" in crops table", node.name)) + return nil +end + +crops.register = function(plantdef) + table.insert(crops.plants, plantdef) +end + +crops.plant = function(pos, node) + minetest.set_node(pos, node) + local meta = minetest.get_meta(pos) + local plant = find_plant(node) + meta:set_int("crops_water", math.max(plant.properties.waterstart, 1)) + meta:set_int("crops_damage", 0) +end + +crops.can_grow = function(pos) + if minetest.get_node_light(pos) < crops.settings.light then + return false + end + local node = minetest.get_node(pos) + local plant = find_plant(node) + if not plant then + return false + end + local meta = minetest.get_meta(pos) + if crops.settings.hydration then + local water = meta:get_int("crops_water") + if water < plant.properties.wither or water > plant.properties.soak then + if math.random(0,1) == 0 then + return false + end + end + -- growing costs water! + meta:set_int("crops_water", math.max(1, water - 10)) + end + + -- damaged plants are less likely to grow + local damage = meta:get_int("crops_damage") + if not damage == 0 then + if math.random(math.min(50, damage), 100) > 75 then + return false + end + end + + -- allow the plant to grow + return true +end + +crops.particles = function(pos, flag) + if flag == 0 then + -- wither (0) + minetest.add_particlespawner({ + amount = 1 * crops.settings.interval, + time = crops.settings.interval, + minpos = { x = pos.x - 0.4, y = pos.y - 0.4, z = pos.z - 0.4 }, + maxpos = { x = pos.x + 0.4, y = pos.y + 0.4, z = pos.z + 0.4 }, + minvel = { x = 0, y = 0.2, z = 0 }, + maxvel = { x = 0, y = 0.4, z = 0 }, + minacc = { x = 0, y = 0, z = 0 }, + maxacc = { x = 0, y = 0.2, z = 0 }, + minexptime = 3, + maxexptime = 5, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "crops_wither.png", + vertical = true, + }) + elseif flag == 1 then + -- soak (1) + minetest.add_particlespawner({ + amount = 8 * crops.settings.interval, + time = crops.settings.interval, + minpos = { x = pos.x - 0.4, y = pos.y - 0.4, z = pos.z - 0.4 }, + maxpos = { x = pos.x + 0.4, y = pos.y - 0.4, z = pos.z + 0.4 }, + minvel = { x = -0.04, y = 0, z = -0.04 }, + maxvel = { x = 0.04, y = 0, z = 0.04 }, + minacc = { x = 0, y = 0, z = 0 }, + maxacc = { x = 0, y = 0, z = 0 }, + minexptime = 3, + maxexptime = 5, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "crops_soak.png", + vertical = false, + }) + elseif flag == 2 then + -- watering (2) + minetest.add_particlespawner({ + amount = 30, + time = 3, + minpos = { x = pos.x - 0.4, y = pos.y - 0.4, z = pos.z - 0.4 }, + maxpos = { x = pos.x + 0.4, y = pos.y + 0.4, z = pos.z + 0.4 }, + minvel = { x = 0, y = 0.0, z = 0 }, + maxvel = { x = 0, y = 0.0, z = 0 }, + minacc = { x = 0, y = -9.81, z = 0 }, + maxacc = { x = 0, y = -9.81, z = 0 }, + minexptime = 2, + maxexptime = 2, + minsize = 1, + maxsize = 3, + collisiondetection = false, + texture = "crops_watering.png", + vertical = true, + }) + else + -- withered/rotting (3) + minetest.add_particlespawner({ + amount = 20, + time = 30, + minpos = { x = pos.x + 0.3, y = pos.y - 0.5, z = pos.z - 0.5 }, + maxpos = { x = pos.x + 0.5, y = pos.y + 0.5, z = pos.z + 0.5 }, + minvel = { x = -0.6, y = -0.1, z = -0.2 }, + maxvel = { x = -0.4, y = 0.1, z = 0.2 }, + minacc = { x = 0.4, y = 0, z = -0.1 }, + maxacc = { x = 0.5, y = 0, z = 0.1 }, + minexptime = 2, + maxexptime = 4, + minsize = 1, + maxsize = 1, + collisiondetection = false, + texture = "crops_flies.png", + vertical = true, + }) + minetest.add_particlespawner({ + amount = 20, + time = 30, + minpos = { x = pos.x - 0.3, y = pos.y - 0.5, z = pos.z - 0.5 }, + maxpos = { x = pos.x - 0.5, y = pos.y + 0.5, z = pos.z + 0.5 }, + minvel = { x = 0.6, y = -0.1, z = -0.2 }, + maxvel = { x = 0.4, y = 0.1, z = 0.2 }, + minacc = { x = -0.4, y = 0, z = -0.1 }, + maxacc = { x = -0.5, y = 0, z = 0.1 }, + minexptime = 2, + maxexptime = 4, + minsize = 1, + maxsize = 1, + collisiondetection = false, + texture = "crops_flies.png", + vertical = true, + }) + minetest.add_particlespawner({ + amount = 20, + time = 30, + minpos = { x = pos.x - 0.5, y = pos.y - 0.5, z = pos.z + 0.3 }, + maxpos = { x = pos.x + 0.5, y = pos.y + 0.5, z = pos.z + 0.5 }, + minvel = { z = -0.6, y = -0.1, x = -0.2 }, + maxvel = { z = -0.4, y = 0.1, x = 0.2 }, + minacc = { z = 0.4, y = 0, x = -0.1 }, + maxacc = { z = 0.5, y = 0, x = 0.1 }, + minexptime = 2, + maxexptime = 4, + minsize = 1, + maxsize = 1, + collisiondetection = false, + texture = "crops_flies.png", + vertical = true, + }) + minetest.add_particlespawner({ + amount = 20, + time = 30, + minpos = { x = pos.x - 0.5, y = pos.y - 0.5, z = pos.z - 0.3 }, + maxpos = { x = pos.x + 0.5, y = pos.y + 0.5, z = pos.z - 0.5 }, + minvel = { z = 0.6, y = -0.1, x = -0.2 }, + maxvel = { z = 0.4, y = 0.1, x = 0.2 }, + minacc = { z = -0.4, y = 0, x = -0.1 }, + maxacc = { z = -0.5, y = 0, x = 0.1 }, + minexptime = 2, + maxexptime = 4, + minsize = 1, + maxsize = 1, + collisiondetection = false, + texture = "crops_flies.png", + vertical = true, + }) + end +end + +crops.die = function(pos) + crops.particles(pos, 3) + local node = minetest.get_node(pos) + local plant = find_plant(node) + plant.properties.die(pos) + minetest.sound_play("crops_flies", {pos=pos, gain=0.8}) +end + +if crops.settings.hydration then + dofile(modpath .. "/tools.lua") +end + +-- crop nodes, crafts, craftitems +dofile(modpath .. "/melon.lua") +dofile(modpath .. "/pumpkin.lua") +dofile(modpath .. "/corn.lua") +dofile(modpath .. "/tomato.lua") +dofile(modpath .. "/potato.lua") +dofile(modpath .. "/polebean.lua") + +local nodenames = {} +for i = 1,table.getn(crops.plants) do + table.insert(nodenames, crops.plants[i].name) +end + +-- water handling code +if crops.settings.hydration then + minetest.register_abm({ + nodenames = nodenames, + interval = crops.settings.damage_interval, + chance = crops.settings.damage_chance, + action = function(pos, node, active_object_count, active_object_count_wider) + local meta = minetest.get_meta(pos) + local water = meta:get_int("crops_water") + local damage = meta:get_int("crops_damage") + + -- get plant specific data + local plant = find_plant(node) + if plant == nil then + return + end + + -- increase water for nearby water sources + local f = minetest.find_node_near(pos, 1, {"default:water_source", "default:water_flowing"}) + if not f == nil then + water = math.min(100, water + 2) + else + f = minetest.find_node_near(pos, 2, {"default:water_source", "default:water_flowing"}) + if not f == nil then + water = math.min(100, water + 1) + end + end + + if minetest.get_node_light(pos, nil) < plant.properties.night then + -- compensate for light: at night give some water back to the plant + water = math.min(100, water + 1) + else + -- dry out the plant + water = math.max(1, water - plant.properties.wateruse) + end + + meta:set_int("crops_water", water) + + -- for convenience, copy water attribute to top half + if not plant.properties.doublesize == nil and plant.properties.doublesize then + local above = { x = pos.x, y = pos.y + 1, z = pos.z} + local abovemeta = minetest.get_meta(above) + abovemeta:set_int("crops_water", water) + end + + if water <= plant.properties.wither_damage then + crops.particles(pos, 0) + damage = damage + math.random(crops.settings.damage_tick_min, crops.settings.damage_tick_max) + elseif water <= plant.properties.wither then + crops.particles(pos, 0) + return + elseif water >= plant.properties.soak_damage then + crops.particles(pos, 1) + damage = damage + math.random(crops.settings.damage_tick_min, crops.settings.damage_tick_max) + elseif water >= plant.properties.soak then + crops.particles(pos, 1) + return + end + meta:set_int("crops_damage", math.min(crops.settings.damage_max, damage)) + + -- is it dead? + if damage >= 100 then + crops.die(pos) + end + end + }) +end + +-- cooking recipes that mix craftitems +dofile(modpath .. "/cooking.lua") +dofile(modpath .. "/mapgen.lua") + +minetest.log("action", "[crops] "..S("Loaded!")) diff --git a/mods/crops/intllib.lua b/mods/crops/intllib.lua new file mode 100644 index 00000000..c7af2c2b --- /dev/null +++ b/mods/crops/intllib.lua @@ -0,0 +1,44 @@ +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/crops/locale/de.po b/mods/crops/locale/de.po new file mode 100644 index 00000000..f533cb0a --- /dev/null +++ b/mods/crops/locale/de.po @@ -0,0 +1,152 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-30 08:37+0200\n" +"PO-Revision-Date: 2017-02-20 16:54-0300\n" +"Last-Translator: LNJ2\n" +"Language-Team: German\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cooking.lua +msgid "Unbaked clay bowl" +msgstr "Ungebackene Lehmschale" + +#: cooking.lua +msgid "Clay bowl" +msgstr "Lehmschale" + +#: cooking.lua +msgid "Bowl of vegetable stew" +msgstr "Schale voll Gemseeintopf" + +#: cooking.lua +msgid "Bowl of uncooked vegetable stew" +msgstr "Schale voll mit roher Gemseeintopf" + +#: corn.lua +msgid "Corn" +msgstr "Mais" + +#: corn.lua +msgid "Corn Cob" +msgstr "Maiskolben" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Gebackener Maiskolben" + +#: corn.lua +msgid "Corn plant" +msgstr "Maispflanze" + +#: init.lua +msgid "Defaulting to \"normal\" difficulty settings" +msgstr "Benutze standard Schwierigkeitsgrad \"normal\"" + +#: init.lua +msgid "Hydration and dehydration mechanics are enabled." +msgstr "Hydrierungs- und Dehydrierungsmechaniken sind aktiviert." + +#: init.lua +#, fuzzy +msgid "Unable to find plant \"@1\" in crops table" +msgstr "Konnte Pflanze \"@1\" nicht in der Tabelle finden" + +#: init.lua +msgid "Loaded!" +msgstr "" + +#: melon.lua +msgid "Melon seed" +msgstr "Melonensamen" + +#: melon.lua +msgid "Melon plant" +msgstr "Melonenpflanze" + +#: melon.lua +msgid "Melon slice" +msgstr "Melonenscheibe" + +#: melon.lua +msgid "Melon" +msgstr "Melone" + +#: polebean.lua +msgid "Green Bean" +msgstr "Grne Bohne" + +#: polebean.lua +msgid "Beanpoles" +msgstr "Bohnenstangen" + +#: polebean.lua +msgid "Green bean seed" +msgstr "Samen einer Grnen Bohne" + +#: polebean.lua +msgid "Green Bean plant" +msgstr "Grne Bohnenpflanze" + +#: potato.lua +msgid "Potato eyes" +msgstr "Kartoffelaugen" + +#: potato.lua +msgid "Potato plant" +msgstr "Kartoffelpflanze" + +#: potato.lua +msgid "Potato" +msgstr "Kartoffel" + +#: potato.lua +msgid "Soil with potatoes" +msgstr "Acker mit Kartoffeln" + +#: pumpkin.lua +msgid "Pumpkin seed" +msgstr "Krbissamen" + +#: pumpkin.lua +msgid "Pumpkin plant" +msgstr "Krbispflanze" + +#: pumpkin.lua +msgid "Roasted pumpkin" +msgstr "Gersteter Krbis" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Krbis" + +#: tomato.lua +msgid "Tomato seed" +msgstr "Tomatensamen" + +#: tomato.lua +msgid "Tomato plant" +msgstr "Tomatenpflanze" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: tools.lua +msgid "Watering Can" +msgstr "Giekanne" + +#: tools.lua +msgid "Hydrometer" +msgstr "Hydrometer" diff --git a/mods/crops/locale/es.po b/mods/crops/locale/es.po new file mode 100644 index 00000000..6f0802bf --- /dev/null +++ b/mods/crops/locale/es.po @@ -0,0 +1,151 @@ +# Spanish translations for PACKAGE package +# Traducciones al español para el paquete PACKAGE. +# Copyright (C) 2017 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Diego Martínez , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-30 08:37+0200\n" +"PO-Revision-Date: 2017-02-20 16:54-0300\n" +"Last-Translator: Diego Martínez \n" +"Language-Team: Spanish\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cooking.lua +msgid "Unbaked clay bowl" +msgstr "Tazón de arcilla sin cocer" + +#: cooking.lua +msgid "Clay bowl" +msgstr "Tazón de arcilla" + +#: cooking.lua +msgid "Bowl of vegetable stew" +msgstr "Tazón de sopa de vegetales" + +#: cooking.lua +msgid "Bowl of uncooked vegetable stew" +msgstr "Tazón de sopa de vegetales sin cocer" + +#: corn.lua +msgid "Corn" +msgstr "Maíz" + +#: corn.lua +msgid "Corn Cob" +msgstr "Elote" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Maíz en mazorca" + +#: corn.lua +msgid "Corn plant" +msgstr "Planta de maíz" + +#: init.lua +msgid "Defaulting to \"normal\" difficulty settings" +msgstr "Se usará la dificultad \"normal\" por defecto" + +#: init.lua +msgid "Hydration and dehydration mechanics are enabled." +msgstr "Mecánica de hidratación y deshidratación activada." + +#: init.lua +msgid "Unable to find plant \"@1\" in crops table" +msgstr "No se pudo encontrar la planta \"@1\" en la tabla de cosechas" + +#: init.lua +msgid "Loaded!" +msgstr "¡Cargado!" + +#: melon.lua +msgid "Melon seed" +msgstr "Semilla de sandía" + +#: melon.lua +msgid "Melon plant" +msgstr "Planta de sandía" + +#: melon.lua +msgid "Melon slice" +msgstr "Trozo de sandía" + +#: melon.lua +msgid "Melon" +msgstr "Sandía" + +#: polebean.lua +msgid "Green Bean" +msgstr "Frijol verde" + +#: polebean.lua +msgid "Beanpoles" +msgstr "Poste para frijoles" + +#: polebean.lua +msgid "Green bean seed" +msgstr "Semilla de frijoles verdes" + +#: polebean.lua +msgid "Green Bean plant" +msgstr "Planta de frijoles verdes" + +#: potato.lua +msgid "Potato eyes" +msgstr "Ojos de patata" + +#: potato.lua +msgid "Potato plant" +msgstr "Planta de patata" + +#: potato.lua +msgid "Potato" +msgstr "Patata" + +#: potato.lua +msgid "Soil with potatoes" +msgstr "Suelo con patatas" + +#: pumpkin.lua +msgid "Pumpkin seed" +msgstr "Semillas de calabaza" + +#: pumpkin.lua +msgid "Pumpkin plant" +msgstr "Planta de calabaza" + +#: pumpkin.lua +msgid "Roasted pumpkin" +msgstr "Calabaza asada" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Calabaza" + +#: tomato.lua +msgid "Tomato seed" +msgstr "Semilla de tomate" + +#: tomato.lua +msgid "Tomato plant" +msgstr "Planta de tomate" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: tools.lua +msgid "Watering Can" +msgstr "Regadera" + +#: tools.lua +msgid "Hydrometer" +msgstr "Hidrómetro" diff --git a/mods/crops/locale/fr.po b/mods/crops/locale/fr.po new file mode 100644 index 00000000..04cfc138 --- /dev/null +++ b/mods/crops/locale/fr.po @@ -0,0 +1,151 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-30 08:37+0200\n" +"PO-Revision-Date: 2017-04-30 08:48+0200\n" +"Last-Translator: fat115 \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.12\n" + +#: cooking.lua +msgid "Unbaked clay bowl" +msgstr "Bol en argile crue" + +#: cooking.lua +msgid "Clay bowl" +msgstr "Bol en terre cuite" + +#: cooking.lua +msgid "Bowl of vegetable stew" +msgstr "Bol de soupe de légumes" + +#: cooking.lua +msgid "Bowl of uncooked vegetable stew" +msgstr "Bol de soupe de légumes non-cuite" + +#: corn.lua +msgid "Corn" +msgstr "Maïs" + +#: corn.lua +msgid "Corn Cob" +msgstr "Épi de maïs" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Épi de maïs grillé" + +#: corn.lua +msgid "Corn plant" +msgstr "Plant de Maïs" + +#: init.lua +msgid "Defaulting to \"normal\" difficulty settings" +msgstr "Réglage par défaut : \"normal\"" + +#: init.lua +msgid "Hydration and dehydration mechanics are enabled." +msgstr "Les mécanismes d'hydratation et de déshydratation sont activés." + +#: init.lua +msgid "Unable to find plant \"@1\" in crops table" +msgstr "Impossible de trouver la plante \"@1\" dans le tableau crops" + +#: init.lua +msgid "Loaded!" +msgstr "Chargé !" + +#: melon.lua +msgid "Melon seed" +msgstr "Graine de Pastèque" + +#: melon.lua +msgid "Melon plant" +msgstr "Pied de Pastèque" + +#: melon.lua +msgid "Melon slice" +msgstr "Tranche de Pastèque" + +#: melon.lua +msgid "Melon" +msgstr "Pastèque" + +#: polebean.lua +msgid "Green Bean" +msgstr "Haricot vert" + +#: polebean.lua +msgid "Beanpoles" +msgstr "Tuteur pour haricots" + +#: polebean.lua +msgid "Green bean seed" +msgstr "Graine de haricot vert" + +#: polebean.lua +msgid "Green Bean plant" +msgstr "Plant de haricot vert" + +#: potato.lua +msgid "Potato eyes" +msgstr "Yeux de pomme de terre" + +#: potato.lua +msgid "Potato plant" +msgstr "Plant de pomme de terre" + +#: potato.lua +msgid "Potato" +msgstr "Pomme de terre" + +#: potato.lua +msgid "Soil with potatoes" +msgstr "Terre labourée avec pommes de terres" + +#: pumpkin.lua +msgid "Pumpkin seed" +msgstr "Graines de citrouille" + +#: pumpkin.lua +msgid "Pumpkin plant" +msgstr "Plant de citrouille" + +#: pumpkin.lua +msgid "Roasted pumpkin" +msgstr "Citrouille grillée" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Citrouille" + +#: tomato.lua +msgid "Tomato seed" +msgstr "Graines de tomate" + +#: tomato.lua +msgid "Tomato plant" +msgstr "Pied de tomate" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: tools.lua +msgid "Watering Can" +msgstr "Arrosoir" + +#: tools.lua +msgid "Hydrometer" +msgstr "Hydromètre" diff --git a/mods/crops/locale/it.po b/mods/crops/locale/it.po new file mode 100644 index 00000000..c82e9733 --- /dev/null +++ b/mods/crops/locale/it.po @@ -0,0 +1,151 @@ +# ITALIAN LOCALE FOR THE CROPS MODULE +# Copyright (C) 2017 Auke Kok +# This file is distributed under the same license as the CROPS package. +# Hamlet , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: crops module's Italian translation\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-20 17:17-0300\n" +"PO-Revision-Date: 2017-08-17 22:03+0100\n" +"Last-Translator: H4mlet \n" +"Language-Team: ITALIANO\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.6.10\n" + +#: melon.lua +msgid "Melon seed" +msgstr "Seme di anguria" + +#: melon.lua +msgid "Melon plant" +msgstr "Pianta di anguria" + +#: melon.lua +msgid "Melon slice" +msgstr "Fetta di anguria" + +#: melon.lua +msgid "Melon" +msgstr "Anguria" + +#: tomato.lua +msgid "Tomato seed" +msgstr "Seme di pomodoro" + +#: tomato.lua +msgid "Tomato plant" +msgstr "Pianta di pomodoro" + +#: tomato.lua +msgid "Tomato" +msgstr "Pomodoro" + +#: polebean.lua +msgid "Green Bean" +msgstr "Fagiolo verde" + +#: polebean.lua +msgid "Beanpoles" +msgstr "Palo per fagioli" + +#: polebean.lua +msgid "Green bean seed" +msgstr "Seme di fagiolo verde" + +#: polebean.lua +msgid "Green Bean plant" +msgstr "Pianta di fagiolo verde" + +#: tools.lua +msgid "Watering Can" +msgstr "Innaffiatoio" + +#: tools.lua +msgid "Hydrometer" +msgstr "Idrometro" + +#: pumpkin.lua +msgid "Pumpkin seed" +msgstr "Seme di zucca" + +#: pumpkin.lua +msgid "Pumpkin plant" +msgstr "Pianta di zucca" + +#: pumpkin.lua +msgid "Roasted pumpkin" +msgstr "Zucca arrostita" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Zucca" + +#: init.lua +msgid "Defaulting to \"normal\" difficulty settings" +msgstr "Utilizzo delle impostazioni di difficoltà \"normal\"" + +#: init.lua +msgid "Hydration and dehydration mechanics are enabled." +msgstr "Le meccaniche di idratazione e disidratazione sono abilitate." + +#: init.lua +msgid "Unable to find plant \"@1\" in crops table" +msgstr "Impossibile trovare la pianta \"@1\" nella tabella delle messi" + +#: init.lua +msgid "Loaded!" +msgstr "Caricato!" + +#: potato.lua +msgid "Potato eyes" +msgstr "Germogli di patata" + +#: potato.lua +msgid "Potato plant" +msgstr "Pianta di patata" + +#: potato.lua +msgid "Potato" +msgstr "Patata" + +#: potato.lua +msgid "Soil with potatoes" +msgstr "Terreno con patate" + +#: cooking.lua +msgid "Unbaked clay bowl" +msgstr "Ciotola di argilla cruda" + +#: cooking.lua +msgid "Clay bowl" +msgstr "Ciotola di argilla" + +#: cooking.lua +msgid "Bowl of vegetable stew" +msgstr "Ciotola di stufato vegetale" + +#: cooking.lua +msgid "Bowl of uncooked vegetable stew" +msgstr "Ciotola di stufato vegetale crudo" + +#: corn.lua +msgid "Corn" +msgstr "Granoturco" + +#: corn.lua +msgid "Corn Cob" +msgstr "Pannocchia" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Pannocchia arrostita" + +#: corn.lua +msgid "Corn plant" +msgstr "Pianta di granoturco" diff --git a/mods/crops/locale/pt.po b/mods/crops/locale/pt.po new file mode 100644 index 00000000..ecfe6d41 --- /dev/null +++ b/mods/crops/locale/pt.po @@ -0,0 +1,150 @@ +# Portuguese translation for Crops mod. +# Copyright (C) 2017 +# This file is distributed under the same license as the PACKAGE package. +# BrunoMine , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-20 17:17-0300\n" +"PO-Revision-Date: 2017-08-17 17:54-0300\n" +"Last-Translator: BrunoMine \n" +"Language-Team: \n" +"Language: Portuguese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: melon.lua +msgid "Melon seed" +msgstr "Semente de Melancia" + +#: melon.lua +msgid "Melon plant" +msgstr "Planta de Melancia" + +#: melon.lua +msgid "Melon slice" +msgstr "Pedaço de Melancia" + +#: melon.lua +msgid "Melon" +msgstr "Melancia" + +#: tomato.lua +msgid "Tomato seed" +msgstr "Semente de Tomate" + +#: tomato.lua +msgid "Tomato plant" +msgstr "Planta de Tomate" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: polebean.lua +msgid "Green Bean" +msgstr "Feijao Verde" + +#: polebean.lua +msgid "Beanpoles" +msgstr "Apoio de Feijao" + +#: polebean.lua +msgid "Green bean seed" +msgstr "Semente de Feijao Verde" + +#: polebean.lua +msgid "Green Bean plant" +msgstr "Planta de Feijao Verde" + +#: tools.lua +msgid "Watering Can" +msgstr "Regador" + +#: tools.lua +msgid "Hydrometer" +msgstr "Hydrometro" + +#: pumpkin.lua +msgid "Pumpkin seed" +msgstr "Semente de Abobora" + +#: pumpkin.lua +msgid "Pumpkin plant" +msgstr "Planta de Abobora" + +#: pumpkin.lua +msgid "Roasted pumpkin" +msgstr "Abobora Assada" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Abobora" + +#: init.lua +msgid "Defaulting to \"normal\" difficulty settings" +msgstr "Padrao para configuraçoes de dificuldade \"normal\"" + +#: init.lua +msgid "Hydration and dehydration mechanics are enabled." +msgstr "Mecanica de hidrataçao e desidrataçao esta habilitada." + +#: init.lua +msgid "Unable to find plant \"@1\" in crops table" +msgstr "Impossivel encontrar a planta \"@1\" na tabela de culturas" + +#: init.lua +msgid "Loaded!" +msgstr "Carregado!" + +#: potato.lua +msgid "Potato eyes" +msgstr "Raizes de Batata" + +#: potato.lua +msgid "Potato plant" +msgstr "Planta de Batata" + +#: potato.lua +msgid "Potato" +msgstr "Batata" + +#: potato.lua +msgid "Soil with potatoes" +msgstr "Solo com Batatas" + +#: cooking.lua +msgid "Unbaked clay bowl" +msgstr "Tigela de Barro Fresco" + +#: cooking.lua +msgid "Clay bowl" +msgstr "Tigela de Barro" + +#: cooking.lua +msgid "Bowl of vegetable stew" +msgstr "Tigela de Ensopado de Vegetais" + +#: cooking.lua +msgid "Bowl of uncooked vegetable stew" +msgstr "Tigela de Vegetais Crus" + +#: corn.lua +msgid "Corn" +msgstr "Milho" + +#: corn.lua +msgid "Corn Cob" +msgstr "Espiga de Milho" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Milho na Espiga" + +#: corn.lua +msgid "Corn plant" +msgstr "Planta de Milho" diff --git a/mods/crops/locale/template.pot b/mods/crops/locale/template.pot new file mode 100644 index 00000000..d8eb19c9 --- /dev/null +++ b/mods/crops/locale/template.pot @@ -0,0 +1,150 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-30 08:37+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cooking.lua +msgid "Unbaked clay bowl" +msgstr "" + +#: cooking.lua +msgid "Clay bowl" +msgstr "" + +#: cooking.lua +msgid "Bowl of vegetable stew" +msgstr "" + +#: cooking.lua +msgid "Bowl of uncooked vegetable stew" +msgstr "" + +#: corn.lua +msgid "Corn" +msgstr "" + +#: corn.lua +msgid "Corn Cob" +msgstr "" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "" + +#: corn.lua +msgid "Corn plant" +msgstr "" + +#: init.lua +msgid "Defaulting to \"normal\" difficulty settings" +msgstr "" + +#: init.lua +msgid "Hydration and dehydration mechanics are enabled." +msgstr "" + +#: init.lua +msgid "Unable to find plant \"@1\" in crops table" +msgstr "" + +#: init.lua +msgid "Loaded!" +msgstr "" + +#: melon.lua +msgid "Melon seed" +msgstr "" + +#: melon.lua +msgid "Melon plant" +msgstr "" + +#: melon.lua +msgid "Melon slice" +msgstr "" + +#: melon.lua +msgid "Melon" +msgstr "" + +#: polebean.lua +msgid "Green Bean" +msgstr "" + +#: polebean.lua +msgid "Beanpoles" +msgstr "" + +#: polebean.lua +msgid "Green bean seed" +msgstr "" + +#: polebean.lua +msgid "Green Bean plant" +msgstr "" + +#: potato.lua +msgid "Potato eyes" +msgstr "" + +#: potato.lua +msgid "Potato plant" +msgstr "" + +#: potato.lua +msgid "Potato" +msgstr "" + +#: potato.lua +msgid "Soil with potatoes" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin seed" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin plant" +msgstr "" + +#: pumpkin.lua +msgid "Roasted pumpkin" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "" + +#: tomato.lua +msgid "Tomato seed" +msgstr "" + +#: tomato.lua +msgid "Tomato plant" +msgstr "" + +#: tomato.lua +msgid "Tomato" +msgstr "" + +#: tools.lua +msgid "Watering Can" +msgstr "" + +#: tools.lua +msgid "Hydrometer" +msgstr "" diff --git a/mods/crops/mapgen.lua b/mods/crops/mapgen.lua new file mode 100644 index 00000000..24607ad9 --- /dev/null +++ b/mods/crops/mapgen.lua @@ -0,0 +1,48 @@ + +local mg_name = minetest.get_mapgen_setting("mg_name") +if mg_name ~= "v6" and mg_name ~= "singlenode" then + minetest.register_decoration({ + deco_type = "simple", + place_on = { "default:dirt_with_grass" }, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.02, + spread = {x = 200, y = 200, z = 200}, + seed = 90459126, + octaves = 3, + persist = 0.6 + }, + biomes = {"grassland", "deciduous_forest", "coniferous_forest"}, + y_min = 1, + y_max = 31000, + decoration = "crops:melon_plant_4" + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = { "default:dirt_with_grass" }, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.02, + spread = {x = 200, y = 200, z = 200}, + seed = 26294592, + octaves = 3, + persist = 0.6 + }, + biomes = {"deciduous_forest", "coniferous_forest", "tundra"}, + y_min = 1, + y_max = 31000, + decoration = "crops:pumpkin_plant_4" + }) +end + +-- drop potatoes when digging in dirt +minetest.override_item("default:dirt_with_grass", { + drop = { + items = { + { items = {'default:dirt'}}, + { items = {'crops:potato'}, rarity = 500 } + } + } +}) diff --git a/mods/crops/melon.lua b/mods/crops/melon.lua new file mode 100644 index 00000000..696b108d --- /dev/null +++ b/mods/crops/melon.lua @@ -0,0 +1,249 @@ + +--[[ + +Copyright (C) 2015 - Auke Kok + +"crops" 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; either version 2.1 +of the license, or (at your option) any later version. + +--]] + +-- Intllib +local S = crops.intllib + +local faces = { + [1] = { x = -1, z = 0, r = 3, o = 1, m = 14 }, + [2] = { x = 1, z = 0, r = 1, o = 3, m = 16 }, + [3] = { x = 0, z = -1, r = 2, o = 0, m = 5 }, + [4] = { x = 0, z = 1, r = 0, o = 2, m = 11 } +} + +minetest.register_node("crops:melon_seed", { + description = S("Melon seed"), + inventory_image = "crops_melon_seed.png", + wield_image = "crops_melon_seed.png", + tiles = { "crops_melon_plant_1.png" }, + drawtype = "plantlike", + waving = 1, + sunlight_propagates = false, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + node_placement_prediction = "crops:melon_plant_1", + groups = { snappy=3,flammable=3,flora=1,attached_node=1 }, + + on_place = function(itemstack, placer, pointed_thing) + local under = minetest.get_node(pointed_thing.under) + if minetest.get_item_group(under.name, "soil") <= 1 then + return + end + crops.plant(pointed_thing.above, {name="crops:melon_plant_1"}) + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end + return itemstack + end +}) + +for stage = 1, 6 do +minetest.register_node("crops:melon_plant_" .. stage , { + description = S("Melon plant"), + tiles = { "crops_melon_plant_" .. stage .. ".png" }, + drawtype = "plantlike", + waving = 1, + sunlight_propagates = true, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 }, + drop = "crops:melon_seed", + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.5 + (((math.min(stage, 4)) + 1) / 5), 0.5} + } +}) +end + +minetest.register_node("crops:melon_plant_5_attached", { + visual = "mesh", + mesh = "crops_plant_extra_face.obj", + description = S("Melon plant"), + tiles = { "crops_melon_stem.png", "crops_melon_plant_4.png" }, + drawtype = "mesh", + paramtype2 = "facedir", + sunlight_propagates = true, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 }, + drop = "crops:melon_seed", + sounds = default.node_sound_leaves_defaults(), +}) + + +minetest.register_craftitem("crops:melon_slice", { + description = S("Melon slice"), + inventory_image = "crops_melon_slice.png", + on_use = minetest.item_eat(1) +}) + +minetest.register_craft({ + type = "shapeless", + output = "crops:melon_seed", + recipe = { "crops:melon_slice" } +}) + +-- +-- the melon "block" +-- +minetest.register_node("crops:melon", { + description = S("Melon"), + tiles = { + "crops_melon_top.png", + "crops_melon_bottom.png", + "crops_melon.png", + }, + sunlight_propagates = false, + use_texture_alpha = false, + walkable = true, + groups = { snappy=3, flammable=3, oddly_breakable_by_hand=2 }, + paramtype2 = "facedir", + drop = {}, + sounds = default.node_sound_wood_defaults({ + dig = { name = "default_dig_oddly_breakable_by_hand" }, + dug = { name = "default_dig_choppy" } + }), + on_dig = function(pos, node, digger) + for face = 1, 4 do + local s = { x = pos.x + faces[face].x, y = pos.y, z = pos.z + faces[face].z } + local n = minetest.get_node(s) + if n.name == "crops:melon_plant_5_attached" then + -- make sure it was actually attached to this stem + if n.param2 == faces[face].o then + minetest.swap_node(s, { name = "crops:melon_plant_4" }) + end + end + end + local meta = minetest.get_meta(pos) + local damage = meta:get_int("crops_damage") + local drops = {} + -- 0 dmg - 3-5 + -- 50 dmg - 2-3 + -- 100 dmg - 1-1 + for i = 1,math.random(3 - (2 * (damage / 100)), 5 - (4 * (damage / 100))) do + table.insert(drops, ('crops:melon_slice')) + end + core.handle_node_drops(pos, drops, digger) + minetest.remove_node(pos) + end +}) + +-- +-- grows a plant to mature size +-- +minetest.register_abm({ + nodenames = { "crops:melon_plant_1", "crops:melon_plant_2", "crops:melon_plant_3","crops:melon_plant_4" }, + neighbors = { "group:soil" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + local n = string.gsub(node.name, "4", "5") + n = string.gsub(n, "3", "4") + n = string.gsub(n, "2", "3") + n = string.gsub(n, "1", "2") + minetest.swap_node(pos, { name = n }) + end +}) + +-- +-- grows a melon +-- +minetest.register_abm({ + nodenames = { "crops:melon_plant_5" }, + neighbors = { "group:soil" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + for face = 1, 4 do + local t = { x = pos.x + faces[face].x, y = pos.y, z = pos.z + faces[face].z } + if minetest.get_node(t).name == "crops:melon" then + return + end + end + local r = math.random(1, 4) + local t = { x = pos.x + faces[r].x, y = pos.y, z = pos.z + faces[r].z } + local n = minetest.get_node(t) + if n.name == "ignore" then + return + end + + if minetest.registered_nodes[minetest.get_node({ x = t.x, y = t.y - 1, z = t.z }).name].walkable == false then + return + end + + if minetest.registered_nodes[n.name].drawtype == "plantlike" or + minetest.registered_nodes[n.name].groups.flora == 1 or + n.name == "air" then + minetest.swap_node(pos, {name = "crops:melon_plant_5_attached", param2 = faces[r].r}) + minetest.set_node(t, {name = "crops:melon", param2 = faces[r].m}) + local meta = minetest.get_meta(pos) + local damage = meta:get_int("crops_damage") + local water = meta:get_int("crops_water") + -- growing a melon costs 25 water! + meta:set_int("crops_water", math.max(0, water - 25)) + meta = minetest.get_meta(t) + -- reflect plants' damage in the melon yield + meta:set_int("crops_damage", damage) + end + end +}) + +-- +-- return a melon to a normal one if there is no melon attached, so it can +-- grow a new melon again +-- +minetest.register_abm({ + nodenames = { "crops:melon_plant_5_attached" }, + interval = crops.settings.interval, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + for face = 1, 4 do + local t = { x = pos.x + faces[face].x, y = pos.y, z = pos.z + faces[face].z } + if minetest.get_node(t).name == "crops:melon" then + return + end + end + minetest.swap_node(pos, {name = "crops:melon_plant_4" }) + end +}) + +crops.melon_die = function(pos) + minetest.set_node(pos, { name = "crops:melon_plant_6" }) +end + +local properties = { + die = crops.melon_die, + waterstart = 20, + wateruse = 1, + night = 5, + soak = 80, + soak_damage = 90, + wither = 20, + wither_damage = 10, +} + +crops.register({ name = "crops:melon_plant_1", properties = properties }) +crops.register({ name = "crops:melon_plant_2", properties = properties }) +crops.register({ name = "crops:melon_plant_3", properties = properties }) +crops.register({ name = "crops:melon_plant_4", properties = properties }) +crops.register({ name = "crops:melon_plant_5", properties = properties }) +crops.register({ name = "crops:melon_plant_5_attached", properties = properties }) diff --git a/mods/crops/mod.conf b/mods/crops/mod.conf new file mode 100644 index 00000000..7f7691ae --- /dev/null +++ b/mods/crops/mod.conf @@ -0,0 +1 @@ +name = crops diff --git a/mods/crops/models/crops_plant_extra_face.obj b/mods/crops/models/crops_plant_extra_face.obj new file mode 100644 index 00000000..fd22dd72 --- /dev/null +++ b/mods/crops/models/crops_plant_extra_face.obj @@ -0,0 +1,49 @@ +# Blender v2.60 (sub 0) OBJ File: 'p1.blend' +# www.blender.org +mtllib crops_plant_extra_face.mtl +o Mesh_Stem_Stem +v -0.000000 0.500000 0.500000 +v 0.000000 -0.500000 0.500000 +v 0.000000 -0.500000 -0.500000 +v -0.000000 0.500000 -0.500000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vn 1.000000 0.000000 -0.000000 +g Mesh_Stem_Stem_Material.002 +usemtl Material.002 +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +o Mesh_Plant_Plant +v 0.359670 -0.500000 0.347329 +v 0.359670 0.500000 0.347329 +v -0.359670 0.500000 -0.347329 +v -0.359670 -0.500000 -0.347329 +v -0.347329 -0.500000 0.359670 +v -0.347329 0.500000 0.359670 +v 0.347329 0.500000 -0.359670 +v 0.347329 -0.500000 -0.359670 +v 0.359670 -0.500000 0.347329 +v -0.359670 -0.500000 -0.347329 +v -0.359670 0.500000 -0.347329 +v 0.359670 0.500000 0.347329 +v -0.347329 -0.500000 0.359670 +v 0.347329 -0.500000 -0.359670 +v 0.347329 0.500000 -0.359670 +v -0.347329 0.500000 0.359670 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vn -0.694658 0.000000 0.719340 +vn -0.719340 -0.000000 -0.694658 +vn 0.694658 -0.000000 -0.719340 +vn 0.719340 0.000000 0.694658 +g Mesh_Plant_Plant_Material.001 +usemtl Material.001 +s off +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 9/5/3 10/6/3 11/7/3 12/8/3 +f 13/5/4 14/8/4 15/7/4 16/6/4 +f 17/5/5 18/8/5 19/7/5 20/6/5 diff --git a/mods/crops/polebean.lua b/mods/crops/polebean.lua new file mode 100644 index 00000000..afe8fb11 --- /dev/null +++ b/mods/crops/polebean.lua @@ -0,0 +1,309 @@ + +--[[ + +Copyright (C) 2015 - Auke Kok + +"crops" 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; either version 2.1 +of the license, or (at your option) any later version. + +--]] + +-- Intllib +local S = crops.intllib + +minetest.register_craft({ + output = "crops:beanpoles", + recipe = { + {'', '', ''}, + {'default:stick', '', 'default:stick'}, + {'default:stick', '', 'default:stick'}, + } +}) + +minetest.register_craftitem("crops:green_bean", { + description = S("Green Bean"), + inventory_image = "crops_green_bean.png", + on_use = minetest.item_eat(1) +}) + +minetest.register_craft({ + type = "shapeless", + output = "crops:green_bean_seed", + recipe = { "crops:green_bean" } +}) + +local function crops_beanpole_on_dig(pos, node, digger) + local bottom + local bottom_n + local top + local top_n + local drops = {} + + if node.name == "crops:beanpole_base" or + node.name == "crops:beanpole_plant_base_1" or + node.name == "crops:beanpole_plant_base_2" or + node.name == "crops:beanpole_plant_base_3" or --grown tall enough for top section + node.name == "crops:beanpole_plant_base_4" or --flowering + node.name == "crops:beanpole_plant_base_5" or --ripe + node.name == "crops:beanpole_plant_base_6" --harvested + then + bottom = pos + bottom_n = node + top = { x = pos.x, y = pos.y + 1, z = pos.z } + top_n = minetest.get_node(top) + elseif node.name == "crops:beanpole_top" or + node.name == "crops:beanpole_plant_top_1" or + node.name == "crops:beanpole_plant_top_2" or --flowering + node.name == "crops:beanpole_plant_top_3" or --ripe + node.name == "crops:beanpole_plant_top_4" --harvested + then + top = pos + top_n = node + bottom = { x = pos.x, y = pos.y - 1, z = pos.z } + bottom_n = minetest.get_node(bottom) + else + -- ouch, this shouldn't happen + print("beanpole on_dig falsely attached to: " .. pos.x .. "," .. pos.y .. "," .. pos.z) + return + end + + if bottom_n.name == "crops:beanpole_base" and top_n.name == "crops:beanpole_top" then + -- bare beanpole + table.insert(drops, "crops:beanpoles") + minetest.remove_node(bottom) + minetest.remove_node(top) + elseif ( + bottom_n.name == "crops:beanpole_plant_base_1" or + bottom_n.name == "crops:beanpole_plant_base_2" or + bottom_n.name == "crops:beanpole_plant_base_3" or + bottom_n.name == "crops:beanpole_plant_base_4" + ) and ( + top_n.name == "crops:beanpole_top" or + top_n.name == "crops:beanpole_plant_top_1" or + top_n.name == "crops:beanpole_plant_top_2" + ) then + -- non-ripe + for i = 1,4 do + table.insert(drops, "default:stick") + end + minetest.set_node(bottom, { name = "crops:beanpole_base"}) + minetest.set_node(top, { name = "crops:beanpole_top"}) + elseif bottom_n.name == "crops:beanpole_plant_base_5" and top_n.name == "crops:beanpole_plant_top_3" then + -- ripe beanpole + local meta = minetest.get_meta(bottom) + local damage = meta:get_int("crops_damage") + -- 0 - 3-7 + -- 50 - 2-4 + -- 100 - 1-1 + for i = 1,math.random(3 - (2 * (damage / 100)),7 - (6 * (damage / 100))) do + table.insert(drops, "crops:green_bean") + end + crops.die(bottom) + elseif bottom_n.name == "crops:beanpole_plant_base_6" and top_n.name == "crops:beanpole_plant_top_4" then + -- harvested beans + for i = 1,math.random(3,4) do + table.insert(drops, "default:stick") + end + minetest.remove_node(bottom) + minetest.remove_node(top) + else + -- ouch, this shouldn't happen + print("beanpole on_dig can't handle blocks at to: " .. + bottom.x .. "," .. bottom.y .. "," .. bottom.z .. + " and " .. top.x .. "," .. top.y .. "," .. top.z) + print("removing a " .. node.name .. " at " .. + pos.x .. "," .. pos.y .. "," .. pos.z) + minetest.remove_node(pos) + return + end + + core.handle_node_drops(pos, drops, digger) +end + +minetest.register_node("crops:beanpole_base", { + description = "", + drawtype = "plantlike", + tiles = { "crops_beanpole_base.png" }, + use_texture_alpha = true, + walkable = true, + sunlight_propagates = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + on_dig = crops_beanpole_on_dig, +}) + +minetest.register_node("crops:beanpole_top", { + description = "", + drawtype = "plantlike", + tiles = { "crops_beanpole_top.png" }, + use_texture_alpha = true, + walkable = true, + sunlight_propagates = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + on_dig = crops_beanpole_on_dig, +}) + +minetest.register_node("crops:beanpoles", { + description = S("Beanpoles"), + inventory_image = "crops_beanpole_top.png", + wield_image = "crops_beanpole_top.png", + tiles = { "crops_beanpole_base.png" }, + drawtype = "plantlike", + sunlight_propagates = true, + use_texture_alpha = true, + paramtype = "light", + groups = { snappy=3,flammable=3,flora=1,attached_node=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + node_placement_prediction = "crops:beanpole_base", + + on_place = function(itemstack, placer, pointed_thing) + local under = minetest.get_node(pointed_thing.under) + if minetest.get_item_group(under.name, "soil") <= 1 then + return + end + local top = { x = pointed_thing.above.x, y = pointed_thing.above.y + 1, z = pointed_thing.above.z } + if not minetest.get_node(top).name == "air" then + return + end + minetest.set_node(pointed_thing.above, {name="crops:beanpole_base"}) + minetest.set_node(top, {name="crops:beanpole_top"}) + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end + return itemstack + end +}) + +minetest.register_craftitem("crops:green_bean_seed", { + description = S("Green bean seed"), + inventory_image = "crops_green_bean_seed.png", + wield_image = "crops_green_bean_seed.png", + node_placement_prediction = "", -- disabled, prediction assumes pointed_think.above! + + on_place = function(itemstack, placer, pointed_thing) + local under = minetest.get_node(pointed_thing.under) + if under.name == "crops:beanpole_base" then + crops.plant(pointed_thing.under, {name="crops:beanpole_plant_base_1"}) + local above = { x = pointed_thing.under.x, y = pointed_thing.under.y + 1, z = pointed_thing.under.z} + local meta = minetest.get_meta(above) + meta:set_int("crops_top_half", 1) + elseif under.name == "crops:beanpole_top" then + local below = { x = pointed_thing.under.x, y = pointed_thing.under.y - 1, z = pointed_thing.under.z } + if minetest.get_node(below).name == "crops:beanpole_base" then + crops.plant(below, {name="crops:beanpole_plant_base_1"}) + local meta = minetest.get_meta(pointed_thing.under) + meta:set_int("crops_top_half", 1) + else + return + end + else + return + end + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end + return itemstack + end +}) + +for stage = 1,6 do +minetest.register_node("crops:beanpole_plant_base_" .. stage, { + description = S("Green Bean plant"), + tiles = { "crops_beanpole_plant_base_" .. stage .. ".png" }, + drawtype = "plantlike", + sunlight_propagates = true, + use_texture_alpha = true, + paramtype = "light", + walkable = false, + groups = { snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + on_dig = crops_beanpole_on_dig +}) +end + +for stage = 1,4 do +minetest.register_node("crops:beanpole_plant_top_" .. stage, { + description = S("Green Bean plant"), + tiles = { "crops_beanpole_plant_top_" .. stage .. ".png" }, + drawtype = "plantlike", + sunlight_propagates = true, + use_texture_alpha = true, + paramtype = "light", + walkable = true, + groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + on_dig = crops_beanpole_on_dig +}) +end + +minetest.register_abm({ + nodenames = { + "crops:beanpole_plant_base_1", + "crops:beanpole_plant_base_2", + "crops:beanpole_plant_base_3", + "crops:beanpole_plant_base_4" + }, + interval = crops.settings.interval, + chance = crops.settings.chance, + neighbors = { "group:soil" }, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + if node.name == "crops:beanpole_plant_base_1" then + minetest.swap_node(pos, { name = "crops:beanpole_plant_base_2"}) + elseif node.name == "crops:beanpole_plant_base_2" then + minetest.swap_node(pos, { name = "crops:beanpole_plant_base_3"}) + elseif node.name == "crops:beanpole_plant_base_3" then + local apos = {x = pos.x, y = pos.y + 1, z = pos.z} + local above = minetest.get_node(apos) + if above.name == "crops:beanpole_top" then + minetest.set_node(apos, { name = "crops:beanpole_plant_top_1" }) + local meta = minetest.get_meta(apos) + meta:set_int("crops_top_half", 1) + elseif above.name == "crops:beanpole_plant_top_1" then + minetest.swap_node(pos, { name = "crops:beanpole_plant_base_4" }) + minetest.swap_node(apos, { name = "crops:beanpole_plant_top_2" }) + end + elseif node.name == "crops:beanpole_plant_base_4" then + local apos = {x = pos.x, y = pos.y + 1, z = pos.z} + minetest.swap_node(pos, { name = "crops:beanpole_plant_base_5" }) + minetest.swap_node(apos, { name = "crops:beanpole_plant_top_3" }) + end + end +}) + +crops.beanpole_die = function(pos) + minetest.set_node(pos, { name = "crops:beanpole_plant_base_6" }) + local above = {x = pos.x, y = pos.y + 1, z = pos.z} + minetest.set_node(above, { name = "crops:beanpole_plant_top_4" }) +end + +local properties = { + die = crops.beanpole_die, + waterstart = 30, + wateruse = 1, + night = 5, + soak = 60, + soak_damage = 75, + wither = 25, + wither_damage = 15, + doublesize = true, +} + +crops.register({ name = "crops:beanpole_plant_base_1", properties = properties }) +crops.register({ name = "crops:beanpole_plant_base_2", properties = properties }) +crops.register({ name = "crops:beanpole_plant_base_3", properties = properties }) +crops.register({ name = "crops:beanpole_plant_base_4", properties = properties }) +crops.register({ name = "crops:beanpole_plant_base_5", properties = properties }) + diff --git a/mods/crops/potato.lua b/mods/crops/potato.lua new file mode 100644 index 00000000..6f5130af --- /dev/null +++ b/mods/crops/potato.lua @@ -0,0 +1,196 @@ + +--[[ + +Copyright (C) 2015 - Auke Kok + +"crops" 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; either version 2.1 +of the license, or (at your option) any later version. + +--]] + +-- Intllib +local S = crops.intllib + +minetest.register_node("crops:potato_eyes", { + description = S("Potato eyes"), + inventory_image = "crops_potato_eyes.png", + wield_image = "crops_potato_eyes.png", + tiles = { "crops_potato_plant_1.png" }, + drawtype = "plantlike", + paramtype2 = "meshoptions", + waving = 1, + sunlight_propagates = false, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + node_placement_prediction = "crops:potato_plant_1", + groups = { snappy=3,flammable=3,flora=1,attached_node=1 }, + selection_box = { + type = "fixed", + fixed = {-0.45, -0.5, -0.45, 0.45, -0.4, 0.45} + }, + + on_place = function(itemstack, placer, pointed_thing) + local under = minetest.get_node(pointed_thing.under) + if minetest.get_item_group(under.name, "soil") <= 1 then + return + end + crops.plant(pointed_thing.above, {name="crops:potato_plant_1", param2 = 3}) + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end + return itemstack + end +}) + +for stage = 1, 5 do +minetest.register_node("crops:potato_plant_" .. stage , { + description = S("Potato plant"), + tiles = { "crops_potato_plant_" .. stage .. ".png" }, + drawtype = "plantlike", + paramtype2 = "meshoptions", + waving = 1, + sunlight_propagates = true, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.45, -0.5, -0.45, 0.45, -0.6 + (((math.min(stage, 4)) + 1) / 5), 0.45} + } +}) +end + +minetest.register_craftitem("crops:potato", { + description = S("Potato"), + inventory_image = "crops_potato.png", + on_use = minetest.item_eat(1) +}) + +minetest.register_craft({ + type = "shapeless", + output = "crops:potato_eyes", + recipe = { "crops:potato" } +}) + +-- +-- the potatoes "block" +-- +minetest.register_node("crops:soil_with_potatoes", { + description = S("Soil with potatoes"), + tiles = { "default_dirt.png^crops_potato_soil.png", "default_dirt.png" }, + sunlight_propagates = false, + use_texture_alpha = false, + walkable = true, + groups = { snappy=3, flammable=3, oddly_breakable_by_hand=2, soil=1 }, + paramtype2 = "facedir", + drop = {max_items = 5, items = { + { items = {'crops:potato'}, rarity = 1 }, + { items = {'crops:potato'}, rarity = 1 }, + { items = {'crops:potato'}, rarity = 1 }, + { items = {'crops:potato'}, rarity = 2 }, + { items = {'crops:potato'}, rarity = 5 }, + }}, + sounds = default.node_sound_dirt_defaults(), + on_dig = function(pos, node, digger) + local drops = {} + -- damage 0 = drops 3-5 + -- damage 50 = drops 1-3 + -- damage 100 = drops 0-1 + local meta = minetest.get_meta(pos) + local damage = meta:get_int("crops_damage") + for i = 1, math.random(3 - (3 * damage / 100), 5 - (4 * (damage / 100))) do + table.insert(drops, "crops:potato") + end + core.handle_node_drops(pos, drops, digger) + minetest.set_node(pos, { name = "farming:soil" }) + local above = { x = pos.x, y = pos.y + 1, z = pos.z } + if minetest.get_node(above).name == "crops:potato_plant_4" then + minetest.set_node(above, { name = "air" }) + end + end +}) + +-- +-- grows a plant to mature size +-- +minetest.register_abm({ + nodenames = { "crops:potato_plant_1", "crops:potato_plant_2", "crops:potato_plant_3" }, + neighbors = { "group:soil" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + local below = { x = pos.x, y = pos.y - 1, z = pos.z } + if not minetest.registered_nodes[minetest.get_node(below).name].groups.soil then + return + end + local meta = minetest.get_meta(pos) + local damage = meta:get_int("crops_damage") + if damage == 100 then + crops.die(pos) + return + end + local n = string.gsub(node.name, "3", "4") + n = string.gsub(n, "2", "3") + n = string.gsub(n, "1", "2") + minetest.swap_node(pos, { name = n, param2 = 3 }) + end +}) + +-- +-- grows the final potatoes in the soil beneath +-- +minetest.register_abm({ + nodenames = { "crops:potato_plant_4" }, + neighbors = { "group:soil" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + local below = { x = pos.x, y = pos.y - 1, z = pos.z } + if not minetest.registered_nodes[minetest.get_node(below).name].groups.soil then + return + end + local meta = minetest.get_meta(pos) + local damage = meta:get_int("crops_damage") + minetest.set_node(below, { name = "crops:soil_with_potatoes" }) + meta = minetest.get_meta(below) + meta:set_int("crops_damage", damage) + end +}) + +crops.potato_die = function(pos) + minetest.set_node(pos, { name = "crops:potato_plant_5", param2 = 3 }) + local below = { x = pos.x, y = pos.y - 1, z = pos.z } + local node = minetest.get_node(below) + if node.name == "crops:soil_with_potatoes" then + local meta = minetest.get_meta(below) + meta:set_int("crops_damage", 100) + end +end + +local properties = { + die = crops.potato_die, + waterstart = 30, + wateruse = 1, + night = 5, + soak = 80, + soak_damage = 90, + wither = 20, + wither_damage = 10, +} + +crops.register({ name = "crops:potato_plant_1", properties = properties }) +crops.register({ name = "crops:potato_plant_2", properties = properties }) +crops.register({ name = "crops:potato_plant_3", properties = properties }) +crops.register({ name = "crops:potato_plant_4", properties = properties }) diff --git a/mods/crops/pumpkin.lua b/mods/crops/pumpkin.lua new file mode 100644 index 00000000..a64757dc --- /dev/null +++ b/mods/crops/pumpkin.lua @@ -0,0 +1,260 @@ + +--[[ + +Copyright (C) 2015 - Auke Kok + +"crops" 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; either version 2.1 +of the license, or (at your option) any later version. + +--]] + +-- Intllib +local S = crops.intllib + +local faces = { + [1] = { x = -1, z = 0, r = 3, o = 1, m = 14 }, + [2] = { x = 1, z = 0, r = 1, o = 3, m = 16 }, + [3] = { x = 0, z = -1, r = 2, o = 0, m = 5 }, + [4] = { x = 0, z = 1, r = 0, o = 2, m = 11 } +} + +minetest.register_node("crops:pumpkin_seed", { + description = S("Pumpkin seed"), + inventory_image = "crops_pumpkin_seed.png", + wield_image = "crops_pumpkin_seed.png", + tiles = { "crops_pumpkin_plant_1.png" }, + drawtype = "plantlike", + waving = 1, + sunlight_propagates = false, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + node_placement_prediction = "crops:pumpkin_plant_1", + groups = { snappy=3,flammable=3,flora=1,attached_node=1 }, + + on_place = function(itemstack, placer, pointed_thing) + local under = minetest.get_node(pointed_thing.under) + if minetest.get_item_group(under.name, "soil") <= 1 then + return + end + crops.plant(pointed_thing.above, {name="crops:pumpkin_plant_1"}) + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end + return itemstack + end +}) + +for stage = 1, 6 do +minetest.register_node("crops:pumpkin_plant_" .. stage , { + description = S("Pumpkin plant"), + tiles = { "crops_pumpkin_plant_" .. stage .. ".png" }, + drawtype = "plantlike", + waving = 1, + sunlight_propagates = true, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 }, + drop = "crops:pumpkin_seed", + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.5 + (((math.min(stage, 4)) + 1) / 5), 0.5} + } +}) +end + +minetest.register_node("crops:pumpkin_plant_5_attached", { + visual = "mesh", + mesh = "crops_plant_extra_face.obj", + description = S("Pumpkin plant"), + tiles = { "crops_pumpkin_stem.png", "crops_pumpkin_plant_4.png" }, + drawtype = "mesh", + paramtype2 = "facedir", + sunlight_propagates = true, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 }, + drop = "crops:pumpkin_seed", + sounds = default.node_sound_leaves_defaults(), +}) + + +minetest.register_craftitem("crops:roasted_pumpkin", { + description = S("Roasted pumpkin"), + inventory_image = "crops_roasted_pumpkin.png", + on_use = minetest.item_eat(2) +}) + +minetest.register_craft({ + type = "shapeless", + output = "crops:pumpkin_seed", + recipe = { "crops:pumpkin" } +}) + +minetest.register_craft({ + type = "cooking", + output = "crops:roasted_pumpkin", + recipe = "crops:pumpkin" +}) + +-- +-- the pumpkin "block" +-- +minetest.register_node("crops:pumpkin", { + description = S("Pumpkin"), + tiles = { + "crops_pumpkin_top.png", + "crops_pumpkin_bottom.png", + "crops_pumpkin.png" + }, + sunlight_propagates = false, + use_texture_alpha = false, + walkable = true, + groups = { snappy=3, flammable=3, oddly_breakable_by_hand=2 }, + paramtype2 = "facedir", + sounds = default.node_sound_wood_defaults({ + dig = { name = "default_dig_oddly_breakable_by_hand" }, + dug = { name = "default_dig_choppy" } + }), + after_dig_node = function(pos, node) + for face = 1, 4 do + local s = { x = pos.x + faces[face].x, y = pos.y, z = pos.z + faces[face].z } + local n = minetest.get_node(s) + if n.name == "crops:pumpkin_plant_5_attached" then + -- make sure it was actually attached to this stem + if n.param2 == faces[face].o then + minetest.swap_node(s, { name = "crops:pumpkin_plant_4" }) + end + end + end + end +}) + +-- +-- grows a plant to mature size +-- +minetest.register_abm({ + nodenames = { "crops:pumpkin_plant_1", "crops:pumpkin_plant_2", "crops:pumpkin_plant_3","crops:pumpkin_plant_4" }, + neighbors = { "group:soil" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + local n = string.gsub(node.name, "4", "5") + n = string.gsub(n, "3", "4") + n = string.gsub(n, "2", "3") + n = string.gsub(n, "1", "2") + minetest.swap_node(pos, { name = n }) + end +}) + +-- +-- grows a pumpkin +-- +minetest.register_abm({ + nodenames = { "crops:pumpkin_plant_5" }, + neighbors = { "group:soil" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + for face = 1, 4 do + local t = { x = pos.x + faces[face].x, y = pos.y, z = pos.z + faces[face].z } + if minetest.get_node(t).name == "crops:pumpkin" then + return + end + end + local r = math.random(1, 4) + local t = { x = pos.x + faces[r].x, y = pos.y, z = pos.z + faces[r].z } + local n = minetest.get_node(t) + if n.name == "ignore" then + return + end + + if minetest.registered_nodes[minetest.get_node({ x = t.x, y = t.y - 1, z = t.z }).name].walkable == false then + return + end + + if minetest.registered_nodes[n.name].drawtype == "plantlike" or + minetest.registered_nodes[n.name].groups.flora == 1 or + n.name == "air" then + minetest.set_node(t, {name = "crops:pumpkin", param2 = faces[r].m}) + + local meta = minetest.get_meta(pos) + local ttl = meta:get_int("crops_pumpkin_ttl") + local damage = meta:get_int("crops_damage") + if ttl == 0 then + -- damage 0 - regrows 3-4 + -- damage 50 - drops 1-2 + -- damage 100 - drops 0-1 + ttl = math.random(3 - (3 * (damage / 100)), 4 - (3 * (damage / 100))) + end + if ttl > 1 then + minetest.swap_node(pos, {name = "crops:pumpkin_plant_5_attached", param2 = faces[r].r}) + meta:set_int("crops_pumpkin_ttl", ttl - 1) + else + crops.die(pos) + end + local water = meta:get_int("crops_water") + -- growing a pumpkin costs 25 water! + meta:set_int("crops_water", math.max(0, water - 25)) + end + end +}) + +-- +-- return a pumpkin to a normal one if there is no pumpkin attached, so it can +-- grow a new pumpkin again +-- +minetest.register_abm({ + nodenames = { "crops:pumpkin_plant_5_attached" }, + interval = crops.settings.interval, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + for face = 1, 4 do + local t = { x = pos.x + faces[face].x, y = pos.y, z = pos.z + faces[face].z } + if minetest.get_node(t).name == "crops:pumpkin" then + return + end + end + local meta = minetest.get_meta(pos) + local ttl = meta:get_int("crops_pumpkin_ttl") + if ttl > 1 then + minetest.swap_node(pos, { name = "crops:pumpkin_plant_4" }) + meta:set_int("crops_pumpkin_ttl", ttl) + else + crops.die(pos) + end + end +}) + +crops.pumpkin_die = function(pos) + minetest.set_node(pos, { name = "crops:pumpkin_plant_6" }) +end + +local properties = { + die = crops.pumpkin_die, + waterstart = 40, + wateruse = 1, + night = 5, + soak = 80, + soak_damage = 90, + wither = 10, + wither_damage = 5, +} + +crops.register({ name = "crops:pumpkin_plant_1", properties = properties }) +crops.register({ name = "crops:pumpkin_plant_2", properties = properties }) +crops.register({ name = "crops:pumpkin_plant_3", properties = properties }) +crops.register({ name = "crops:pumpkin_plant_4", properties = properties }) +crops.register({ name = "crops:pumpkin_plant_5", properties = properties }) +crops.register({ name = "crops:pumpkin_plant_5_attached", properties = properties }) diff --git a/mods/crops/readme.md b/mods/crops/readme.md new file mode 100644 index 00000000..6d623427 --- /dev/null +++ b/mods/crops/readme.md @@ -0,0 +1,162 @@ +## Crops - more farming crops mod for minetest + +Copyright (C) 2015 - Auke Kok + +This minetest mod expands the basic set of farming-related crops that +`minetest_game` offers. A list of crops/crafts is below. + +## Configuration + +A default configuration file, `crops_settings.txt` will be added +to your world folder that contains suggested `easy`, `normal` (the +default) and `difficult` settings for this mod. You can currently tune +the ABM interval/chance, and required light level for plant growth. + +## Hydration mechanic + +This feature is disabled in the `easy` setting. + +Plants need water. Plants need more water when they grow. This mod +implements mechanics of plant hydration and what happens when you +over-water or not water your plants properly: Plants may wither or +soak, and if they wither/soak too much, the plant will get damaged. + +You can see that plants are under stress visually. When a plant +withers, there will be particles that are steam/smoke-like floating +upwards from the plant. When a plant is over-watered, water bubbles +can be seen at the plant base. These are implemented as particles. + +In the default difficulty settings, plants don't accrue enough damage +to kill the plant. But at difficult settings, withering will end up +resulting in plant death, or the loss of crop entirely. At default +settings, plants will yield significantly less harvest if not taken +care of! So if you do decide to not water your plants, make sure you +don't let them sit around for days and harvest them as soon as they +are ripe to limit the effects. + +Environment factors can influence hydration: nearby water, night time +moisture. And of course, the watering can. The watering can holds +20 watering charges, and it takes 3-4 charges to water a plant from +completely dry to maximum wetness. Some plants will want more water, +some will do better with less, so make sure you use a hydrometer to +measure plant humidity. Recipes for the watering can and hydrometer +are listed below. + +## Plants + +1. Melons and pumpkins + +Melon plants grow from melon seeds. Once a plant is mature (there +are 5 stages) it will spawn a melon block adjacent to the plant. +The melon block can be harvested by punching, and yields 3-5 +melon slices. The melon slice can be crafted to a melon seed. + +Pumpkins grow from pumpkin seeds, and are harvested to yield a +pumpkin block. Each block can be cooked to yield one or more +roast pumpkin chunks, which can be eaten. You can also craft +the blocks to seeds. A pumpkin plant will only yield limited amounts +of pumpkins. After a while they automatically wither. + +2. Corn. + +Corn plants are 2 blocks high, and yield corn cobs. These can be +cooked to corn-on-the-cob, or processed to make corn seed (corn +kernels, basically). + +Digging a mature plant yields the corn cob. A harvested corn plant +"wilts", and needs to be dug away to make the land usable, or can +be left as ornamental 2-block plant. Digging either top or bottom +block works in all cases. + +3. Tomatoes. + +Tomatoes appear to work simple enough, until you harvest them +the first time: The plant stays! However, after the 3rd to 5th +harvest, the plant wilts and needs to be removed, since no more +tomatoes will grow on the plant. Per harvest you can get 1-2 +tomatoes only. You can craft the tomatoes to tomato seeds, as +expected. + +4. Potatoes. + +The plants themselves don't drop anything. Only if the plant matures +can you dig potatoes from the soil. If you can reach the soil from the +side you can save yourself one dig by digging the soil as that will +remove the plant from the top, but otherwise you need to dig twice: +once to remove the plant, once to dig out the potatoes. + +You get 3-5 potatoes. Each potato gives one (set of) "potato eyes" +which are the clones that can grow back to potatoes. Be careful not +to dig the plant when there's flowers! You have to wait until the soil +below shows potatoes. It's fairly easy to see the difference, though. + +5. Green Beans + +These green beans are unnaturally green, but there's so many +of them that grow on a vine! Sadly, these beans don't grow beans +unsupported, so you stick some sticks together to make a beanpole, +something like this way: + +empty empty empty +stick empty stick +stick empty stick + +There, that should help the viney bean plant to grow to 2 meters +high. It has remarkable purple flowers, that pop all over the plant +just before the beans grow. + +Sadly, once the beans are picked, this plant turns into an unusable +mess that makes it hard for the next plant to grow on the beanpole, +so you salvage the beanpole's sticks after harvesting in order to +make more beanpoles again. It's a bit of work, but worth it, these +beans are delicious! + + +## Cooking / Crafting + +The corn cobs can be cooked directly to make Corn-on-the-Cob. + +This mod includes a bowl recipe. The bowl is made from clay lumps, +which results in an unbaked clay bowl that needs to be baked in an +oven to be usable: + +empty empty empty +clay_lump empty clay_lump +empty clay_lump empty + +Pumpkin blocks can be cooked whole, and yield roasted pumpkin. It's +okay as food, but it takes a lot of work. + +You can fill these bowls (or any group:food_bowl) with vegetables to +craft an uncooked vegetable stew: + +empty empty empty +grean_beans potato tomato +empty clay_bowl empty + +The uncooked vegetable stew obviously needs to be cooked as well in +an oven. The resulting Vegetable Stew bowl gives a lot of hears back, +which is worth the effort. + +The watering can can be made as follows: + +steel_ingot empty empty +steel_ingot empty steel_ingot +empty steel_ingot empty + +To fill the watering can, left click any block of water. To use, +left click a plant. The damage bar on the icon indicates the fill +level of the watering can. + +The hydrometer can be crafted like this: + +mese_crystal_fragment empty empty +empty steel_ingot empty +empty empty steel_ingot + +Left-click any plant with the hydrometer, and the charge bar indicates +the humidity level of the plant: a dry plant will have 0% humidity +and be a small red bar or no bar at all, and a soaked plant will +have a full green bar. Be careful though! Some plants prefer to be +at mid-level (yellow) instead of full wetness! + diff --git a/mods/crops/screenshot.png b/mods/crops/screenshot.png new file mode 100644 index 00000000..3cbf879b Binary files /dev/null and b/mods/crops/screenshot.png differ diff --git a/mods/crops/sounds/crops_flies.ogg b/mods/crops/sounds/crops_flies.ogg new file mode 100644 index 00000000..b5d39414 Binary files /dev/null and b/mods/crops/sounds/crops_flies.ogg differ diff --git a/mods/crops/sounds/crops_watercan_entering.ogg b/mods/crops/sounds/crops_watercan_entering.ogg new file mode 100644 index 00000000..68212bc8 Binary files /dev/null and b/mods/crops/sounds/crops_watercan_entering.ogg differ diff --git a/mods/crops/sounds/crops_watercan_splash_big.ogg b/mods/crops/sounds/crops_watercan_splash_big.ogg new file mode 100644 index 00000000..19c4b5e3 Binary files /dev/null and b/mods/crops/sounds/crops_watercan_splash_big.ogg differ diff --git a/mods/crops/sounds/crops_watercan_splash_quiet.ogg b/mods/crops/sounds/crops_watercan_splash_quiet.ogg new file mode 100644 index 00000000..9518e17e Binary files /dev/null and b/mods/crops/sounds/crops_watercan_splash_quiet.ogg differ diff --git a/mods/crops/sounds/crops_watercan_splash_small.ogg b/mods/crops/sounds/crops_watercan_splash_small.ogg new file mode 100644 index 00000000..7c02b3ee Binary files /dev/null and b/mods/crops/sounds/crops_watercan_splash_small.ogg differ diff --git a/mods/crops/sounds/crops_watercan_watering.ogg b/mods/crops/sounds/crops_watercan_watering.ogg new file mode 100644 index 00000000..f1fc2d57 Binary files /dev/null and b/mods/crops/sounds/crops_watercan_watering.ogg differ diff --git a/mods/crops/textures/crops_beanpole_base.png b/mods/crops/textures/crops_beanpole_base.png new file mode 100644 index 00000000..f9f60734 Binary files /dev/null and b/mods/crops/textures/crops_beanpole_base.png differ diff --git a/mods/crops/textures/crops_beanpole_plant_base_1.png b/mods/crops/textures/crops_beanpole_plant_base_1.png new file mode 100644 index 00000000..905c4aa1 Binary files /dev/null and b/mods/crops/textures/crops_beanpole_plant_base_1.png differ diff --git a/mods/crops/textures/crops_beanpole_plant_base_2.png b/mods/crops/textures/crops_beanpole_plant_base_2.png new file mode 100644 index 00000000..fa7b4215 Binary files /dev/null and b/mods/crops/textures/crops_beanpole_plant_base_2.png differ diff --git a/mods/crops/textures/crops_beanpole_plant_base_3.png b/mods/crops/textures/crops_beanpole_plant_base_3.png new file mode 100644 index 00000000..a3678c2c Binary files /dev/null and b/mods/crops/textures/crops_beanpole_plant_base_3.png differ diff --git a/mods/crops/textures/crops_beanpole_plant_base_4.png b/mods/crops/textures/crops_beanpole_plant_base_4.png new file mode 100644 index 00000000..cdc87ea5 Binary files /dev/null and b/mods/crops/textures/crops_beanpole_plant_base_4.png differ diff --git a/mods/crops/textures/crops_beanpole_plant_base_5.png b/mods/crops/textures/crops_beanpole_plant_base_5.png new file mode 100644 index 00000000..99d65289 Binary files /dev/null and b/mods/crops/textures/crops_beanpole_plant_base_5.png differ diff --git a/mods/crops/textures/crops_beanpole_plant_base_6.png b/mods/crops/textures/crops_beanpole_plant_base_6.png new file mode 100644 index 00000000..291bd947 Binary files /dev/null and b/mods/crops/textures/crops_beanpole_plant_base_6.png differ diff --git a/mods/crops/textures/crops_beanpole_plant_top_1.png b/mods/crops/textures/crops_beanpole_plant_top_1.png new file mode 100644 index 00000000..c6b9086a Binary files /dev/null and b/mods/crops/textures/crops_beanpole_plant_top_1.png differ diff --git a/mods/crops/textures/crops_beanpole_plant_top_2.png b/mods/crops/textures/crops_beanpole_plant_top_2.png new file mode 100644 index 00000000..ed9629d6 Binary files /dev/null and b/mods/crops/textures/crops_beanpole_plant_top_2.png differ diff --git a/mods/crops/textures/crops_beanpole_plant_top_3.png b/mods/crops/textures/crops_beanpole_plant_top_3.png new file mode 100644 index 00000000..4b340c51 Binary files /dev/null and b/mods/crops/textures/crops_beanpole_plant_top_3.png differ diff --git a/mods/crops/textures/crops_beanpole_plant_top_4.png b/mods/crops/textures/crops_beanpole_plant_top_4.png new file mode 100644 index 00000000..29be63b6 Binary files /dev/null and b/mods/crops/textures/crops_beanpole_plant_top_4.png differ diff --git a/mods/crops/textures/crops_beanpole_top.png b/mods/crops/textures/crops_beanpole_top.png new file mode 100644 index 00000000..5416a605 Binary files /dev/null and b/mods/crops/textures/crops_beanpole_top.png differ diff --git a/mods/crops/textures/crops_bowl_uncooked_vegetable_stew.png b/mods/crops/textures/crops_bowl_uncooked_vegetable_stew.png new file mode 100644 index 00000000..d2baa9b0 Binary files /dev/null and b/mods/crops/textures/crops_bowl_uncooked_vegetable_stew.png differ diff --git a/mods/crops/textures/crops_bowl_vegetable_stew.png b/mods/crops/textures/crops_bowl_vegetable_stew.png new file mode 100644 index 00000000..20796825 Binary files /dev/null and b/mods/crops/textures/crops_bowl_vegetable_stew.png differ diff --git a/mods/crops/textures/crops_clay_bowl.png b/mods/crops/textures/crops_clay_bowl.png new file mode 100644 index 00000000..e45a6ba8 Binary files /dev/null and b/mods/crops/textures/crops_clay_bowl.png differ diff --git a/mods/crops/textures/crops_corn.png b/mods/crops/textures/crops_corn.png new file mode 100644 index 00000000..a24dd14b Binary files /dev/null and b/mods/crops/textures/crops_corn.png differ diff --git a/mods/crops/textures/crops_corn_base_1.png b/mods/crops/textures/crops_corn_base_1.png new file mode 100644 index 00000000..ccf95cba Binary files /dev/null and b/mods/crops/textures/crops_corn_base_1.png differ diff --git a/mods/crops/textures/crops_corn_base_2.png b/mods/crops/textures/crops_corn_base_2.png new file mode 100644 index 00000000..893a831a Binary files /dev/null and b/mods/crops/textures/crops_corn_base_2.png differ diff --git a/mods/crops/textures/crops_corn_base_3.png b/mods/crops/textures/crops_corn_base_3.png new file mode 100644 index 00000000..367e993a Binary files /dev/null and b/mods/crops/textures/crops_corn_base_3.png differ diff --git a/mods/crops/textures/crops_corn_base_seed.png b/mods/crops/textures/crops_corn_base_seed.png new file mode 100644 index 00000000..fe545428 Binary files /dev/null and b/mods/crops/textures/crops_corn_base_seed.png differ diff --git a/mods/crops/textures/crops_corn_cob.png b/mods/crops/textures/crops_corn_cob.png new file mode 100644 index 00000000..9cd5aa95 Binary files /dev/null and b/mods/crops/textures/crops_corn_cob.png differ diff --git a/mods/crops/textures/crops_corn_on_the_cob.png b/mods/crops/textures/crops_corn_on_the_cob.png new file mode 100644 index 00000000..04894fd1 Binary files /dev/null and b/mods/crops/textures/crops_corn_on_the_cob.png differ diff --git a/mods/crops/textures/crops_corn_top_1.png b/mods/crops/textures/crops_corn_top_1.png new file mode 100644 index 00000000..f3cef38d Binary files /dev/null and b/mods/crops/textures/crops_corn_top_1.png differ diff --git a/mods/crops/textures/crops_corn_top_2.png b/mods/crops/textures/crops_corn_top_2.png new file mode 100644 index 00000000..94317eb0 Binary files /dev/null and b/mods/crops/textures/crops_corn_top_2.png differ diff --git a/mods/crops/textures/crops_corn_top_3.png b/mods/crops/textures/crops_corn_top_3.png new file mode 100644 index 00000000..fd8ea719 Binary files /dev/null and b/mods/crops/textures/crops_corn_top_3.png differ diff --git a/mods/crops/textures/crops_flies.png b/mods/crops/textures/crops_flies.png new file mode 100644 index 00000000..b047a615 Binary files /dev/null and b/mods/crops/textures/crops_flies.png differ diff --git a/mods/crops/textures/crops_green_bean.png b/mods/crops/textures/crops_green_bean.png new file mode 100644 index 00000000..eb1ad666 Binary files /dev/null and b/mods/crops/textures/crops_green_bean.png differ diff --git a/mods/crops/textures/crops_green_bean_seed.png b/mods/crops/textures/crops_green_bean_seed.png new file mode 100644 index 00000000..f9c94591 Binary files /dev/null and b/mods/crops/textures/crops_green_bean_seed.png differ diff --git a/mods/crops/textures/crops_hydrometer.png b/mods/crops/textures/crops_hydrometer.png new file mode 100644 index 00000000..65e17328 Binary files /dev/null and b/mods/crops/textures/crops_hydrometer.png differ diff --git a/mods/crops/textures/crops_melon.png b/mods/crops/textures/crops_melon.png new file mode 100644 index 00000000..bb05024a Binary files /dev/null and b/mods/crops/textures/crops_melon.png differ diff --git a/mods/crops/textures/crops_melon_bottom.png b/mods/crops/textures/crops_melon_bottom.png new file mode 100644 index 00000000..432219d3 Binary files /dev/null and b/mods/crops/textures/crops_melon_bottom.png differ diff --git a/mods/crops/textures/crops_melon_plant_1.png b/mods/crops/textures/crops_melon_plant_1.png new file mode 100644 index 00000000..798c10d5 Binary files /dev/null and b/mods/crops/textures/crops_melon_plant_1.png differ diff --git a/mods/crops/textures/crops_melon_plant_2.png b/mods/crops/textures/crops_melon_plant_2.png new file mode 100644 index 00000000..bc0dd6e8 Binary files /dev/null and b/mods/crops/textures/crops_melon_plant_2.png differ diff --git a/mods/crops/textures/crops_melon_plant_3.png b/mods/crops/textures/crops_melon_plant_3.png new file mode 100644 index 00000000..5d06c294 Binary files /dev/null and b/mods/crops/textures/crops_melon_plant_3.png differ diff --git a/mods/crops/textures/crops_melon_plant_4.png b/mods/crops/textures/crops_melon_plant_4.png new file mode 100644 index 00000000..9195c335 Binary files /dev/null and b/mods/crops/textures/crops_melon_plant_4.png differ diff --git a/mods/crops/textures/crops_melon_plant_5.png b/mods/crops/textures/crops_melon_plant_5.png new file mode 100644 index 00000000..9b24d8bc Binary files /dev/null and b/mods/crops/textures/crops_melon_plant_5.png differ diff --git a/mods/crops/textures/crops_melon_plant_6.png b/mods/crops/textures/crops_melon_plant_6.png new file mode 100644 index 00000000..f08c5142 Binary files /dev/null and b/mods/crops/textures/crops_melon_plant_6.png differ diff --git a/mods/crops/textures/crops_melon_seed.png b/mods/crops/textures/crops_melon_seed.png new file mode 100644 index 00000000..4322de52 Binary files /dev/null and b/mods/crops/textures/crops_melon_seed.png differ diff --git a/mods/crops/textures/crops_melon_slice.png b/mods/crops/textures/crops_melon_slice.png new file mode 100644 index 00000000..0931eef8 Binary files /dev/null and b/mods/crops/textures/crops_melon_slice.png differ diff --git a/mods/crops/textures/crops_melon_stem.png b/mods/crops/textures/crops_melon_stem.png new file mode 100644 index 00000000..7ab2c02d Binary files /dev/null and b/mods/crops/textures/crops_melon_stem.png differ diff --git a/mods/crops/textures/crops_melon_top.png b/mods/crops/textures/crops_melon_top.png new file mode 100644 index 00000000..a3384b88 Binary files /dev/null and b/mods/crops/textures/crops_melon_top.png differ diff --git a/mods/crops/textures/crops_potato.png b/mods/crops/textures/crops_potato.png new file mode 100644 index 00000000..c0d6d8a8 Binary files /dev/null and b/mods/crops/textures/crops_potato.png differ diff --git a/mods/crops/textures/crops_potato_eyes.png b/mods/crops/textures/crops_potato_eyes.png new file mode 100644 index 00000000..e45d5f80 Binary files /dev/null and b/mods/crops/textures/crops_potato_eyes.png differ diff --git a/mods/crops/textures/crops_potato_plant_1.png b/mods/crops/textures/crops_potato_plant_1.png new file mode 100644 index 00000000..8d481f4a Binary files /dev/null and b/mods/crops/textures/crops_potato_plant_1.png differ diff --git a/mods/crops/textures/crops_potato_plant_2.png b/mods/crops/textures/crops_potato_plant_2.png new file mode 100644 index 00000000..061ad4dd Binary files /dev/null and b/mods/crops/textures/crops_potato_plant_2.png differ diff --git a/mods/crops/textures/crops_potato_plant_3.png b/mods/crops/textures/crops_potato_plant_3.png new file mode 100644 index 00000000..a0593a69 Binary files /dev/null and b/mods/crops/textures/crops_potato_plant_3.png differ diff --git a/mods/crops/textures/crops_potato_plant_4.png b/mods/crops/textures/crops_potato_plant_4.png new file mode 100644 index 00000000..9e29b5a3 Binary files /dev/null and b/mods/crops/textures/crops_potato_plant_4.png differ diff --git a/mods/crops/textures/crops_potato_plant_5.png b/mods/crops/textures/crops_potato_plant_5.png new file mode 100644 index 00000000..29092230 Binary files /dev/null and b/mods/crops/textures/crops_potato_plant_5.png differ diff --git a/mods/crops/textures/crops_potato_soil.png b/mods/crops/textures/crops_potato_soil.png new file mode 100644 index 00000000..cb471ca4 Binary files /dev/null and b/mods/crops/textures/crops_potato_soil.png differ diff --git a/mods/crops/textures/crops_pumpkin.png b/mods/crops/textures/crops_pumpkin.png new file mode 100644 index 00000000..ac5f86da Binary files /dev/null and b/mods/crops/textures/crops_pumpkin.png differ diff --git a/mods/crops/textures/crops_pumpkin_bottom.png b/mods/crops/textures/crops_pumpkin_bottom.png new file mode 100644 index 00000000..5a901889 Binary files /dev/null and b/mods/crops/textures/crops_pumpkin_bottom.png differ diff --git a/mods/crops/textures/crops_pumpkin_plant_1.png b/mods/crops/textures/crops_pumpkin_plant_1.png new file mode 100644 index 00000000..1a333214 Binary files /dev/null and b/mods/crops/textures/crops_pumpkin_plant_1.png differ diff --git a/mods/crops/textures/crops_pumpkin_plant_2.png b/mods/crops/textures/crops_pumpkin_plant_2.png new file mode 100644 index 00000000..1131783e Binary files /dev/null and b/mods/crops/textures/crops_pumpkin_plant_2.png differ diff --git a/mods/crops/textures/crops_pumpkin_plant_3.png b/mods/crops/textures/crops_pumpkin_plant_3.png new file mode 100644 index 00000000..d7497a55 Binary files /dev/null and b/mods/crops/textures/crops_pumpkin_plant_3.png differ diff --git a/mods/crops/textures/crops_pumpkin_plant_4.png b/mods/crops/textures/crops_pumpkin_plant_4.png new file mode 100644 index 00000000..9dc781a5 Binary files /dev/null and b/mods/crops/textures/crops_pumpkin_plant_4.png differ diff --git a/mods/crops/textures/crops_pumpkin_plant_5.png b/mods/crops/textures/crops_pumpkin_plant_5.png new file mode 100644 index 00000000..144f5e23 Binary files /dev/null and b/mods/crops/textures/crops_pumpkin_plant_5.png differ diff --git a/mods/crops/textures/crops_pumpkin_plant_6.png b/mods/crops/textures/crops_pumpkin_plant_6.png new file mode 100644 index 00000000..ff46604f Binary files /dev/null and b/mods/crops/textures/crops_pumpkin_plant_6.png differ diff --git a/mods/crops/textures/crops_pumpkin_seed.png b/mods/crops/textures/crops_pumpkin_seed.png new file mode 100644 index 00000000..bf4fb052 Binary files /dev/null and b/mods/crops/textures/crops_pumpkin_seed.png differ diff --git a/mods/crops/textures/crops_pumpkin_stem.png b/mods/crops/textures/crops_pumpkin_stem.png new file mode 100644 index 00000000..db6d1b61 Binary files /dev/null and b/mods/crops/textures/crops_pumpkin_stem.png differ diff --git a/mods/crops/textures/crops_pumpkin_top.png b/mods/crops/textures/crops_pumpkin_top.png new file mode 100644 index 00000000..9972a630 Binary files /dev/null and b/mods/crops/textures/crops_pumpkin_top.png differ diff --git a/mods/crops/textures/crops_roasted_pumpkin.png b/mods/crops/textures/crops_roasted_pumpkin.png new file mode 100644 index 00000000..42ff0f0e Binary files /dev/null and b/mods/crops/textures/crops_roasted_pumpkin.png differ diff --git a/mods/crops/textures/crops_soak.png b/mods/crops/textures/crops_soak.png new file mode 100644 index 00000000..39311c42 Binary files /dev/null and b/mods/crops/textures/crops_soak.png differ diff --git a/mods/crops/textures/crops_tomato.png b/mods/crops/textures/crops_tomato.png new file mode 100644 index 00000000..aa9a5247 Binary files /dev/null and b/mods/crops/textures/crops_tomato.png differ diff --git a/mods/crops/textures/crops_tomato_plant_1.png b/mods/crops/textures/crops_tomato_plant_1.png new file mode 100644 index 00000000..b562784e Binary files /dev/null and b/mods/crops/textures/crops_tomato_plant_1.png differ diff --git a/mods/crops/textures/crops_tomato_plant_2.png b/mods/crops/textures/crops_tomato_plant_2.png new file mode 100644 index 00000000..eff9ab66 Binary files /dev/null and b/mods/crops/textures/crops_tomato_plant_2.png differ diff --git a/mods/crops/textures/crops_tomato_plant_3.png b/mods/crops/textures/crops_tomato_plant_3.png new file mode 100644 index 00000000..c8ebbba3 Binary files /dev/null and b/mods/crops/textures/crops_tomato_plant_3.png differ diff --git a/mods/crops/textures/crops_tomato_plant_4.png b/mods/crops/textures/crops_tomato_plant_4.png new file mode 100644 index 00000000..bc6ced34 Binary files /dev/null and b/mods/crops/textures/crops_tomato_plant_4.png differ diff --git a/mods/crops/textures/crops_tomato_plant_5.png b/mods/crops/textures/crops_tomato_plant_5.png new file mode 100644 index 00000000..9e7cf829 Binary files /dev/null and b/mods/crops/textures/crops_tomato_plant_5.png differ diff --git a/mods/crops/textures/crops_tomato_plant_6.png b/mods/crops/textures/crops_tomato_plant_6.png new file mode 100644 index 00000000..9203705e Binary files /dev/null and b/mods/crops/textures/crops_tomato_plant_6.png differ diff --git a/mods/crops/textures/crops_tomato_seed.png b/mods/crops/textures/crops_tomato_seed.png new file mode 100644 index 00000000..f32d3f28 Binary files /dev/null and b/mods/crops/textures/crops_tomato_seed.png differ diff --git a/mods/crops/textures/crops_unbaked_clay_bowl.png b/mods/crops/textures/crops_unbaked_clay_bowl.png new file mode 100644 index 00000000..15bdfabb Binary files /dev/null and b/mods/crops/textures/crops_unbaked_clay_bowl.png differ diff --git a/mods/crops/textures/crops_watering.png b/mods/crops/textures/crops_watering.png new file mode 100644 index 00000000..e06226e6 Binary files /dev/null and b/mods/crops/textures/crops_watering.png differ diff --git a/mods/crops/textures/crops_watering_can.png b/mods/crops/textures/crops_watering_can.png new file mode 100644 index 00000000..2e57dc05 Binary files /dev/null and b/mods/crops/textures/crops_watering_can.png differ diff --git a/mods/crops/textures/crops_wither.png b/mods/crops/textures/crops_wither.png new file mode 100644 index 00000000..edb591a6 Binary files /dev/null and b/mods/crops/textures/crops_wither.png differ diff --git a/mods/crops/tomato.lua b/mods/crops/tomato.lua new file mode 100644 index 00000000..f70d9143 --- /dev/null +++ b/mods/crops/tomato.lua @@ -0,0 +1,201 @@ + +--[[ + +Copyright (C) 2015 - Auke Kok + +"crops" 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; either version 2.1 +of the license, or (at your option) any later version. + +--]] + +-- Intllib +local S = crops.intllib + +minetest.register_node("crops:tomato_seed", { + description = S("Tomato seed"), + inventory_image = "crops_tomato_seed.png", + wield_image = "crops_tomato_seed.png", + tiles = { "crops_tomato_plant_1.png" }, + drawtype = "plantlike", + paramtype2 = "meshoptions", + waving = 1, + sunlight_propagates = true, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + node_placement_prediction = "crops:tomato_plant_1", + groups = { snappy=3,flammable=3,flora=1,attached_node=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + + on_place = function(itemstack, placer, pointed_thing) + local under = minetest.get_node(pointed_thing.under) + if minetest.get_item_group(under.name, "soil") <= 1 then + return + end + crops.plant(pointed_thing.above, {name="crops:tomato_plant_1", param2 = 1}) + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end + return itemstack + end +}) + +for stage = 1, 4 do +minetest.register_node("crops:tomato_plant_" .. stage , { + description = S("Tomato plant"), + tiles = { "crops_tomato_plant_" .. stage .. ".png" }, + drawtype = "plantlike", + paramtype2 = "meshoptions", + waving = 1, + sunlight_propagates = true, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.45, -0.5, -0.45, 0.45, -0.6 + (((math.min(stage, 4)) + 1) / 5), 0.45} + } +}) +end + +minetest.register_node("crops:tomato_plant_5" , { + description = S("Tomato plant"), + tiles = { "crops_tomato_plant_5.png" }, + drawtype = "plantlike", + paramtype2 = "meshoptions", + waving = 1, + sunlight_propagates = true, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.45, -0.5, -0.45, 0.45, 0.45, 0.45} + }, + on_dig = function(pos, node, digger) + local drops = {} + for i = 1, math.random(1, 2) do + table.insert(drops, "crops:tomato") + end + core.handle_node_drops(pos, drops, digger) + + local meta = minetest.get_meta(pos) + local ttl = meta:get_int("crops_tomato_ttl") + if ttl > 1 then + minetest.swap_node(pos, { name = "crops:tomato_plant_4", param2 = 1}) + meta:set_int("crops_tomato_ttl", ttl - 1) + else + crops.die(pos) + end + end +}) + +minetest.register_node("crops:tomato_plant_6", { + description = S("Tomato plant"), + tiles = { "crops_tomato_plant_6.png" }, + drawtype = "plantlike", + paramtype2 = "meshoptions", + waving = 1, + sunlight_propagates = true, + use_texture_alpha = true, + walkable = false, + paramtype = "light", + groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 }, + drop = {}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.45, -0.5, -0.45, 0.45, 0.45, 0.45} + }, +}) + +minetest.register_craftitem("crops:tomato", { + description = S("Tomato"), + inventory_image = "crops_tomato.png", + on_use = minetest.item_eat(1) +}) + +minetest.register_craft({ + type = "shapeless", + output = "crops:tomato_seed", + recipe = { "crops:tomato" } +}) + +-- +-- grows a plant to mature size +-- +minetest.register_abm({ + nodenames = { "crops:tomato_plant_1", "crops:tomato_plant_2", "crops:tomato_plant_3" }, + neighbors = { "group:soil" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + local n = string.gsub(node.name, "4", "5") + n = string.gsub(n, "3", "4") + n = string.gsub(n, "2", "3") + n = string.gsub(n, "1", "2") + minetest.swap_node(pos, { name = n, param2 = 1 }) + end +}) + +-- +-- grows a tomato +-- +minetest.register_abm({ + nodenames = { "crops:tomato_plant_4" }, + neighbors = { "group:soil" }, + interval = crops.settings.interval, + chance = crops.settings.chance, + action = function(pos, node, active_object_count, active_object_count_wider) + if not crops.can_grow(pos) then + return + end + local meta = minetest.get_meta(pos) + local ttl = meta:get_int("crops_tomato_ttl") + local damage = meta:get_int("crops_damage") + if ttl == 0 then + -- damage 0 - drops 4-6 + -- damage 50 - drops 2-3 + -- damage 100 - drops 0-1 + ttl = math.random(4 - (4 * (damage / 100)), 6 - (5 * (damage / 100))) + end + if ttl > 1 then + minetest.swap_node(pos, { name = "crops:tomato_plant_5", param2 = 1 }) + meta:set_int("crops_tomato_ttl", ttl) + else + crops.die(pos) + end + end +}) + +crops.tomato_die = function(pos) + minetest.set_node(pos, { name = "crops:tomato_plant_6", param2 = 1 }) +end + +local properties = { + die = crops.tomato_die, + waterstart = 19, + wateruse = 1, + night = 5, + soak = 80, + soak_damage = 90, + wither = 20, + wither_damage = 10, +} +crops.register({ name = "crops:tomato_plant_1", properties = properties }) +crops.register({ name = "crops:tomato_plant_2", properties = properties }) +crops.register({ name = "crops:tomato_plant_3", properties = properties }) +crops.register({ name = "crops:tomato_plant_4", properties = properties }) +crops.register({ name = "crops:tomato_plant_5", properties = properties }) diff --git a/mods/crops/tools.lua b/mods/crops/tools.lua new file mode 100644 index 00000000..c6f9ee96 --- /dev/null +++ b/mods/crops/tools.lua @@ -0,0 +1,125 @@ +--[[ + +Copyright (C) 2015 - Auke Kok + +"crops" 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; either version 2.1 +of the license, or (at your option) any later version. + +--]] + +-- Intllib +local S = crops.intllib + +minetest.register_tool("crops:watering_can", { + description = S("Watering Can"), + inventory_image = "crops_watering_can.png", + liquids_pointable = true, + range = 2.5, + stack_max = 1, + wear = 65535, + tool_capabilities = {}, + on_use = function(itemstack, user, pointed_thing) + local pos = pointed_thing.under + local ppos = pos + if not pos then + return itemstack + end + -- filling it up? + local wear = itemstack:get_wear() + if minetest.get_item_group(minetest.get_node(pos).name, "water") >= 3 then + if wear ~= 1 then + minetest.sound_play("crops_watercan_entering", {pos=pos, gain=0.8}) + minetest.after(math.random()/2, function(p) + if math.random(2) == 1 then + minetest.sound_play("crops_watercan_splash_quiet", {pos=p, gain=0.1}) + end + if math.random(3) == 1 then + minetest.after(math.random()/2, function(pp) + minetest.sound_play("crops_watercan_splash_small", {pos=pp, gain=0.7}) + end, p) + end + if math.random(3) == 1 then + minetest.after(math.random()/2, function(pp) + minetest.sound_play("crops_watercan_splash_big", {pos=pp, gain=0.7}) + end, p) + end + end, pos) + itemstack:set_wear(1) + end + return itemstack + end + -- using it on a top-half part of a plant? + local meta = minetest.get_meta(pos) + if meta:get_int("crops_top_half") == 1 then + meta = minetest.get_meta({x=pos.x, y=pos.y-1, z=pos.z}) + end + -- using it on a plant? + local water = meta:get_int("crops_water") + if water < 1 then + return itemstack + end + -- empty? + if wear == 65534 then + return itemstack + end + crops.particles(ppos, 2) + minetest.sound_play("crops_watercan_watering", {pos=pos, gain=0.8}) + water = math.min(water + crops.settings.watercan, crops.settings.watercan_max) + meta:set_int("crops_water", water) + + if not minetest.settings:get_bool("creative_mode") then + itemstack:set_wear(math.min(65534, wear + (65535 / crops.settings.watercan_uses))) + end + return itemstack + end, +}) + +minetest.register_tool("crops:hydrometer", { + description = S("Hydrometer"), + inventory_image = "crops_hydrometer.png", + liquids_pointable = false, + range = 2.5, + stack_max = 1, + tool_capabilities = { + }, + on_use = function(itemstack, user, pointed_thing) + local pos = pointed_thing.under + if not pos then + return itemstack + end + -- doublesize plant? + local meta = minetest.get_meta(pos) + if meta:get_int("crops_top_half") == 1 then + meta = minetest.get_meta({x=pos.x, y=pos.y-1, z=pos.z}) + end + + -- using it on a plant? + local water = meta:get_int("crops_water") + if water == nil then + itemstack:set_wear(65534) + return itemstack + end + itemstack:set_wear(65535 - ((65534 / 100) * water)) + return itemstack + end, +}) + +minetest.register_craft({ + output = "crops:watering_can", + recipe = { + { "default:steel_ingot", "", "" }, + { "default:steel_ingot", "", "default:steel_ingot" }, + { "", "default:steel_ingot", "" }, + }, +}) + +minetest.register_craft({ + output = "crops:hydrometer", + recipe = { + { "default:mese_crystal_fragment", "", "" }, + { "", "default:steel_ingot", "" }, + { "", "", "default:steel_ingot" }, + }, +}) diff --git a/mods/crops/tools/updatepo.sh b/mods/crops/tools/updatepo.sh new file mode 100755 index 00000000..b1bac47f --- /dev/null +++ b/mods/crops/tools/updatepo.sh @@ -0,0 +1,23 @@ +#! /bin/bash + +# To create a new translation: +# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot + +cd "$(dirname "${BASH_SOURCE[0]}")/.."; + +# Extract translatable strings. +xgettext --from-code=UTF-8 \ + --keyword=S \ + --keyword=NS:1,2 \ + --keyword=N_ \ + --sort-by-file \ + --add-comments='Translators:' \ + --add-location=file \ + -o locale/template.pot \ + $(find . -name '*.lua') + +# Update translations. +find locale -name '*.po' | while read -r file; do + echo $file + msgmerge --update $file locale/template.pot; +done diff --git a/mods/display_api/API.md b/mods/display_api/API.md new file mode 100644 index 00000000..2dfff213 --- /dev/null +++ b/mods/display_api/API.md @@ -0,0 +1,92 @@ +# Display API +This document describes Display API. Display API allows to add a dynamic display on a node. Display API limits node rotations. For wallmounted, only vertical positionning is available. For facedir, only first four position are availabel (those with default axis). + +## Provided methods +### update\_entities +**display\_api.update\_entities(pos)** + +This method triggers entities update for the display node at pos. Actual entity update is made by `on_display_update` callback associated to the entity. + +`pos`: Position of the node +### register\_display\_entity +**display\_api.register\_display\_entity(entity_name)** + +This is a helper to register entities used for display. + +`entity_name`: Name of the entity to register. + +## Provided callback implementations +### on_place +**display\_api.on\_place(itemstack, placer, pointed\_thing)** + +`on_place` node callback implementation. Display nodes should have this callback (avoid placement of horizontal display node). +### on_construct +**display\_api.on\_construct(pos)** + +`on_construct` node callback implementation. Display nodes should have this callback (creates, places and updates display entities on node construction). +### on_destruct +**display\_api.on_destruct(pos)** + +`on_destruct` node callback implementation. Display nodes should have this callback (removes display entities on node destruction). +### on_rotate +**display\_api.on\_rotate(pos, node, user, mode, new_param2)** + +`on_rotate` node callback implementation. Display nodes should have this callback (restricts rotations and rotates display entities associated with node). +### on_activate +**display\_api.on_activate(entity, staticdata)** + +`On_activate` entity callback implementation for display entities. No need of this method if display entities have been registered using `register_display_entity` (callback is already set). + +## Howto register a display node +* Register display entities with `register_display_entity` + +* Register node with : + - `on_place`, `on_construct`, `on_destruct` and `on_rotate` callbacks using display_api callbacks.\ + - `display_api` group. This will make this node have their entities updated as soon as the mapblock is loaded (Useful after /clearobjects).\ + - a `display_entities` field in node definition containing a entity name indexed table. See below for description of each display_entities fields.\ + +### Display_entities fields +`on_display_update` is a callback in charge of setting up entity texture. If not set, entity will have no texture and will be displayed as unknown item.\ +`depth`, `right` and `top`: Entity position regarding to node facedir/wallmounted main axis.\ +Values for these fields can be any number between -1.5 and 1.5 (default value is 0). Position 0,0,0 is the center of the node.\ +`depth` goes from front (-0.5) to rear (0.5), `top` goes from bottom (-0.5) to top (0.5) and `right` goes from left (-0.5) to right (0.5).\ +`yaw`: Entity yaw in radians, regarding to main axis. Default is 0, aligned to node face. + +In order to avoid flickering text, it's better to have text a little behind node surface. A good spacing value is given by `display_api.entity_spacing` variable. + +### Example + + display_api.register_display_entity("mymod:entity1") + display_api.register_display_entity("mymod:entity2") + + function my_display_update1(pos, objref) + objref:set_properties({ textures= {"mytexture1.png"}, + visual_size = {x=1, y=1} }) + end + + function my_display_update2(pos, objref) + objref:set_properties({ textures= {"mytexture2.png"}, +                         visual_size = {x=1, y=1} }) + end + + minetest.register_node("mymod:test_display_node", { + ... + paramtype2 = "facedir", + ... + groups = { display_api = 1, ... }, + ... + display_entities = { + ["mymod:entity1"] = { + depth = 0.3, + on_display_update = my_display_update1 }, + ["mymod:entity1"] = { + depth = 0.2, top = 0.1, + on_display_update = my_display_update2 }, + }, + ... + on_place = display_api.on_place, + on_construct = display_api.on_construct, + on_destruct = display_api.on_destruct, + on_rotate = display_api.on_rotate, + ... + }) diff --git a/mods/display_api/LICENSE.txt b/mods/display_api/LICENSE.txt new file mode 100644 index 00000000..341c30bd --- /dev/null +++ b/mods/display_api/LICENSE.txt @@ -0,0 +1,166 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + diff --git a/mods/display_api/README.md b/mods/display_api/README.md new file mode 100644 index 00000000..73acdf97 --- /dev/null +++ b/mods/display_api/README.md @@ -0,0 +1,34 @@ +# Display API + +This library's purpose is to ease creation of nodes with one or more displays on sides. For example, signs and clocks. Display can be dynamic and/or different for each node instance. + +**Limitations**: This lib uses entities to draw display. This means display has to be vertical (and "upside up") on Minetest before version 5.0. + +**Dependancies**:default + +**License**: LGPLv2 + +**API**: See [API.md](https://github.com/pyrollo/display_modpack/blob/master/display_api/API.md) document please. + +For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums. + +## Deprecation notice (for modders) + +### December 2018 +Following objects are deprecated, shows a warning in log when used: +* `display_modpack_node` group (use `display_api` group instead); +* `display_lib_node` group (use `display_api` group instead); +* `display_lib` global table (use `display_api` global table instead); + +These objects will be removed in the future. + +## Change log +### 2019-03-14 +- __dispay_api__: Display API now detects automatically whenr rotation restrictions have to be applied. + +### 2019-03-09 +- __display_api__: Display nodes can be rotated in every directions (if running Minetest 5 or above). +- __display_api__: New setting to restrict rotations to Minetest 0.4 abilities (restriction enabled by default). + +### 2018-12-14 +- __display_api__: New `yaw` attributes, entities can now have different angles with node. diff --git a/mods/display_api/copyright.txt b/mods/display_api/copyright.txt new file mode 100644 index 00000000..e242c7c7 --- /dev/null +++ b/mods/display_api/copyright.txt @@ -0,0 +1,5 @@ +Code by Pierre-Yves Rollo (pyrollo) +Contributors: +(gpcf): Compatibility with signs lib +(Thomas--S): Fix /clearobjects bug +(12Me21): on_place and on_rotate improvements diff --git a/mods/display_api/depends.txt b/mods/display_api/depends.txt new file mode 100644 index 00000000..e69de29b diff --git a/mods/display_api/deprecation.lua b/mods/display_api/deprecation.lua new file mode 100644 index 00000000..b041f6fa --- /dev/null +++ b/mods/display_api/deprecation.lua @@ -0,0 +1,78 @@ +--[[ + display_api mod for Minetest - Library to add dynamic display + capabilities to nodes + (c) Pierre-Yves Rollo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--]] + +-- Deprecation + +function deprecated_group(deprecated_group, replacement_group) + for name, ndef in pairs(minetest.registered_nodes) do + if ndef.groups and ndef.groups[deprecated_group] then + minetest.log("warning", string.format( + 'Node %s belongs to deprecated "%s" group which should be replaced with new "%s" group.', + name, deprecated_group, replacement_group)) + end + end +end + +function deprecated_global_table(deprecated_global_name, replacement_global_name) + assert(type(deprecated_global_name) == 'string', "deprecated_global_name should be a string.") + assert(type(replacement_global_name) == 'string', "replacement_global_name should be a string.") + assert(deprecated_global_name ~= '', "deprecated_global_name should not be empty.") + assert(replacement_global_name ~= '', "replacement_global_name should not be empty.") + assert(rawget(_G, deprecated_global_name) == nil, "deprecated global does not exist.") + if _G[replacement_global_name] == nil then + minetest.log('warning', string.format( + 'Replacement global "%s" does not exists.', replacement_global_name)) + return + end + local meta = { + deprecated = deprecated_global_name, + replacement = replacement_global_name, + __index = function(table, key) + local meta = getmetatable(table) + local dbg = debug.getinfo(2, "lS") + minetest.log("warning", string.format( + 'Accessing deprecated "%s" table, "%s" should be used instead (%s:%d).', + meta.deprecated, meta.replacement, (dbg.short_src or 'unknown'), + (dbg.currentline or 0))) + return _G[meta.replacement][key] + end, + __newindex = function(table, key, value) + local meta = getmetatable(table) + local dbg = debug.getinfo(2, "lS") + minetest.log("warning", string.format( + 'Accessing deprecated "%s" table, "%s" should be used instead (%s:%d).', + meta.deprecated, meta.replacement, (dbg.short_src or 'unknown'), + (dbg.currentline or 0))) + _G[meta.replacement][key]=value + end, + } + rawset(_G, deprecated_global_name, {}) + setmetatable(_G[deprecated_global_name], meta) +end + + +-- deprecated(1) -- December 2018 - Deprecation of groups display_modpack_node and display_lib_node +-- Group to be removed from display API register_lbm +minetest.after(0, function() + deprecated_group("display_modpack_node", "display_api") + deprecated_group("display_lib_node", "display_api") +end) + +-- deprecated(2) -- December 2018 - Deprecation of display_lib +deprecated_global_table('display_lib', 'display_api') diff --git a/mods/display_api/display.lua b/mods/display_api/display.lua new file mode 100644 index 00000000..fa7c8549 --- /dev/null +++ b/mods/display_api/display.lua @@ -0,0 +1,325 @@ +--[[ + display_api mod for Minetest - Library to add dynamic display + capabilities to nodes + (c) Pierre-Yves Rollo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--]] + +-- Prefered gap between node and entity +-- Entity positionment is up to mods but it is a good practice to use this +-- variable as spacing between entity and node +display_api.entity_spacing = 0.002 + +-- Maximum entity position relative to the node pos +local max_entity_pos = 1.5 + +local wallmounted_rotations = { + [0]={x=1, y=0, z=0}, [1]={x=3, y=0, z=0}, + [2]={x=0, y=3, z=0}, [3]={x=0, y=1, z=0}, + [4]={x=0, y=0, z=0}, [5]={x=0, y=2, z=0}, + [6]={x=1, y=0, z=0}, [7]={x=1, y=1, z=1}, +} + +local facedir_rotations = { + [ 0]={x=0, y=0, z=0}, [ 1]={x=0, y=3, z=0}, + [ 2]={x=0, y=2, z=0}, [ 3]={x=0, y=1, z=0}, + [ 4]={x=3, y=0, z=0}, [ 5]={x=0, y=3, z=3}, + [ 6]={x=1, y=0, z=2}, [ 7]={x=0, y=1, z=1}, + [ 8]={x=1, y=0, z=0}, [ 9]={x=0, y=3, z=1}, + [10]={x=3, y=0, z=2}, [11]={x=0, y=1, z=3}, + [12]={x=0, y=0, z=1}, [13]={x=3, y=0, z=1}, + [14]={x=2, y=0, z=1}, [15]={x=1, y=0, z=1}, + [16]={x=0, y=0, z=3}, [17]={x=1, y=0, z=3}, + [18]={x=2, y=0, z=3}, [19]={x=3, y=0, z=3}, + [20]={x=0, y=0, z=2}, [21]={x=0, y=1, z=2}, + [22]={x=0, y=2, z=2}, [23]={x=0, y=3, z=2}, +} + +-- Compute other useful values depending on wallmounted and facedir param +local wallmounted_values = {} +local facedir_values = {} + +local function compute_values(r) + local function rx(v) return { x=v.x, y=v.z, z=-v.y} end + local function ry(v) return { x=-v.z, y=v.y, z=v.x} end + local function rz(v) return { x=v.y, y=-v.x, z=v.z} end + + local d = { x = 0, y = 0, z = 1 } + local w = { x = 1, y = 0, z = 0 } + local h = { x = 0, y = 1, z = 0 } + + -- Important to keep z rotation first (not same results) + for _ = 1, r.z do d, w, h = rz(d), rz(w), rz(h) end + for _ = 1, r.x do d, w, h = rx(d), rx(w), rx(h) end + for _ = 1, r.y do d, w, h = ry(d), ry(w), ry(h) end + + return { + rotation=r, depth=d, width=w, height=h, + restricted=(r.x==0 and r.z==0) } +end + +for i, r in pairs(facedir_rotations) do + facedir_values[i] = compute_values(r) +end + +for i, r in pairs(wallmounted_rotations) do + wallmounted_values[i] = compute_values(r) +end + +-- Detect rotation restriction +local rotation_restricted = nil +minetest.register_entity('display_api:dummy_entity', { + collisionbox = { 0, 0, 0, 0, 0, 0 }, + visual = "upright_sprite", + textures = {} }) + +function display_api.is_rotation_restricted() + if rotation_restricted == nil then + local objref = minetest.add_entity( + {x=0, y=0, z=0}, 'display_api:dummy_entity') + if objref then + rotation_restricted = objref.set_rotation == nil + objref:remove() + end + end + return rotation_restricted +end + +-- Clip position property to maximum entity position + +local function clip_pos_prop(posprop) + if posprop then + return math.max(-max_entity_pos, math.min(max_entity_pos, posprop)) + else + return 0 + end +end + +-- Get values needed for orientation computation of node + +local function get_orientation_values(node) + local ndef = minetest.registered_nodes[node.name] + + if ndef then + local paramtype2 = ndef.paramtype2 + if paramtype2 == "wallmounted" or paramtype2 == "colorwallmounted" then + return wallmounted_values[node.param2 % 8] + elseif paramtype2 == "facedir" or paramtype2 == "colorfacedir" then + return facedir_values[node.param2 % 32] + else + -- No orientation or unknown orientation type + return facedir_values[0] + end + end +end + +-- Gets the display entities attached with a node. +-- Add missing and remove duplicates + +local function get_display_objrefs(pos, create) + local objrefs = {} + local ndef = minetest.registered_nodes[minetest.get_node(pos).name] + if ndef and ndef.display_entities then + for _, objref in + ipairs(minetest.get_objects_inside_radius(pos, max_entity_pos)) do + local entity = objref:get_luaentity() + if entity and ndef.display_entities[entity.name] and + entity.nodepos and vector.equals(pos, entity.nodepos) then + if objrefs[entity.name] then + objref:remove() -- Remove duplicates + else + objrefs[entity.name] = objref + end + end + end + if create then + -- Add missing + for name, _ in pairs(ndef.display_entities) do + if not objrefs[name] then + objrefs[name] = minetest.add_entity(pos, name, + minetest.serialize({ nodepos = pos })) + end + end + end + end + return objrefs +end + +--- Force entity update : position and texture +function display_api.update_entities(pos) + + local node = minetest.get_node(pos) + local ndef = minetest.registered_nodes[node.name] + local ov = get_orientation_values(node) + if not ndef or not ov then + return + end + + for _, objref in pairs(get_display_objrefs(pos, true)) do + local edef = ndef.display_entities[objref:get_luaentity().name] + local depth = clip_pos_prop(edef.depth) + local right = clip_pos_prop(edef.right) + local top = clip_pos_prop(edef.top) + + objref:set_pos({ + x = pos.x + ov.depth.x*depth + ov.width.x*right - ov.height.x*top, + y = pos.y + ov.depth.y*depth + ov.width.y*right - ov.height.y*top, + z = pos.z + ov.depth.z*depth + ov.width.z*right - ov.height.z*top, + }) + + if objref.set_rotation then + objref:set_rotation({ + x = ov.rotation.x*math.pi/2, + y = ov.rotation.y*math.pi/2 + (edef.yaw or 0), + z = ov.rotation.z*math.pi/2, + }) + else + if ov.rotation.x ~=0 or ov.rotation.y ~= 0 then + minetest.log("warning", string.format( + "[display_api] unable to rotate correctly entity for node at %s without set_rotation method.", + minetest.pos_to_string(pos))) + end + objref:set_yaw(ov.rotation.y*math.pi/2 + (edef.yaw or 0)) + end + + -- Call on_display_update callback of a node for one of its display entities + if edef.on_display_update then + edef.on_display_update(pos, objref) + end + end +end + +--- On_activate callback for display_api entities. Calls on_display_update callbacks +--- of corresponding node for each entity. +function display_api.on_activate(entity, staticdata) + if entity then + if string.sub(staticdata, 1, string.len("return")) == "return" then + local data = minetest.deserialize(staticdata) + if data and type(data) == "table" then + entity.nodepos = data.nodepos + end + entity.object:set_armor_groups({immortal=1}) + end + + if entity.nodepos then + local node = minetest.get_node(entity.nodepos) + local ndef = minetest.registered_nodes[node.name] + if ndef and ndef.display_entities then + local edef = ndef.display_entities[entity.name] + if edef then + -- Call on_display_update callback of the entity to build texture + if edef.on_display_update then + edef.on_display_update(entity.nodepos, entity.object) + end + return + end + end + end + -- If we got here, this display entity is buggy and should be removed + entity.object:remove() + end +end + +--- On_place callback for display_api items. +-- Does nothing more than preventing node from being placed on ceiling or ground +-- TODO:When MT<5 is not in use anymore, simplify this +function display_api.on_place(itemstack, placer, pointed_thing, override_param2) + local ndef = itemstack:get_definition() + local dir = { + x = pointed_thing.under.x - pointed_thing.above.x, + y = pointed_thing.under.y - pointed_thing.above.y, + z = pointed_thing.under.z - pointed_thing.above.z, + } + + local rotation_restriction = display_api.is_rotation_restricted() + + if rotation_restriction then + -- If item is not placed on a wall, use the player's view direction instead + if dir.x == 0 and dir.z == 0 then + dir = placer:get_look_dir() + end + dir.y = 0 + end + + local param2 = 0 + if ndef then + if ndef.paramtype2 == "wallmounted" or + ndef.paramtype2 == "colorwallmounted" then + param2 = minetest.dir_to_wallmounted(dir) + + elseif ndef.paramtype2 == "facedir" or + ndef.paramtype2 == "colorfacedir" then + param2 = minetest.dir_to_facedir(dir, not rotation_restriction) + end + end + return minetest.item_place(itemstack, placer, pointed_thing, + param2 + (override_param2 or 0)) +end + +--- On_construct callback for display_api items. +-- Creates entities and update them. +function display_api.on_construct(pos) + display_api.update_entities(pos) +end + +--- On_destruct callback for display_api items. +-- Removes entities. +function display_api.on_destruct(pos) + for _, objref in pairs(get_display_objrefs(pos)) do + objref:remove() + end +end + +-- On_rotate (screwdriver) callback for display_api items. Prevents invalid +-- rotations and reorients entities. +function display_api.on_rotate(pos, node, user, _, new_param2) + node.param2 = new_param2 + local ov = get_orientation_values(node) + if not ov then + return + end + + if ov.restricted or not display_api.is_rotation_restricted() then + minetest.swap_node(pos, node) + display_api.update_entities(pos) + return true + else + return false + end +end + +--- Creates display entity with some fields and the on_activate callback +function display_api.register_display_entity(entity_name) + if not minetest.registered_entities[entity_name] then + minetest.register_entity(':'..entity_name, { + collisionbox = { 0, 0, 0, 0, 0, 0 }, + visual = "upright_sprite", + textures = {}, + on_activate = display_api.on_activate, + get_staticdata = function(self) + return minetest.serialize({ nodepos = self.nodepos }) + end, + }) + end +end + +minetest.register_lbm({ + label = "Update display_api entities", + name = "display_api:update_entities", + run_at_every_load = true, + nodenames = {"group:display_api", + "group:display_modpack_node", "group:display_lib_node"}, -- See deprecated(1) + action = function(pos, node) display_api.update_entities(pos) end, +}) diff --git a/mods/display_api/init.lua b/mods/display_api/init.lua new file mode 100644 index 00000000..f1e54e89 --- /dev/null +++ b/mods/display_api/init.lua @@ -0,0 +1,31 @@ +--[[ + display_api mod for Minetest - Library to add dynamic display + capabilities to nodes + (c) Pierre-Yves Rollo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--]] + +-- Global variables +------------------- + +display_api = {} +display_api.name = minetest.get_current_modname() +display_api.path = minetest.get_modpath(display_api.name) + +-- Inclusions +------------- + +dofile(display_api.path.."/display.lua") +dofile(display_api.path.."/deprecation.lua") diff --git a/mods/display_api/mod.conf b/mods/display_api/mod.conf new file mode 100644 index 00000000..d0b1da7c --- /dev/null +++ b/mods/display_api/mod.conf @@ -0,0 +1,2 @@ +name=display_api +description=A library for adding dynamic textures on nodes diff --git a/mods/drinks/blends/drinks.blend b/mods/drinks/blends/drinks.blend new file mode 100644 index 00000000..ca05a067 Binary files /dev/null and b/mods/drinks/blends/drinks.blend differ diff --git a/mods/drinks/depends.txt b/mods/drinks/depends.txt new file mode 100644 index 00000000..f28d1a64 --- /dev/null +++ b/mods/drinks/depends.txt @@ -0,0 +1,13 @@ +bucket +default +vessels +stairs +hunger? +thirsty? +plantlife? +farming_plus? +crops? +farming? +minetest_doc_modpack? +fruits? +ethereal? diff --git a/mods/drinks/description.txt b/mods/drinks/description.txt new file mode 100644 index 00000000..75420af1 --- /dev/null +++ b/mods/drinks/description.txt @@ -0,0 +1 @@ +This mod adds a juice press and two juice storage containers. Most fruits and several veggies can be juiced. The resulting drinks can be 'ate' to gain health, or if you are using the thirsty mod, to regain hydration. diff --git a/mods/drinks/drink_machines.lua b/mods/drinks/drink_machines.lua new file mode 100644 index 00000000..81602e26 --- /dev/null +++ b/mods/drinks/drink_machines.lua @@ -0,0 +1,614 @@ +--Craft Recipes + +minetest.register_craft({ + output = 'drinks:juice_press', + recipe = { + {'default:stick', 'default:steel_ingot', 'default:stick'}, + {'default:stick', 'bucket:bucket_empty', 'default:stick'}, + {'stairs:slab_wood', 'stairs:slab_wood', 'vessels:drinking_glass'}, + } +}) + +minetest.register_craft({ + output = 'drinks:liquid_barrel', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + {'stairs:slab_wood', '', 'stairs:slab_wood'}, + } +}) + +minetest.register_craft({ + output = 'drinks:liquid_silo', + recipe = { + {'drinks:liquid_barrel'}, + {'drinks:liquid_barrel'}, + {'drinks:liquid_barrel'} + } +}) + +local press_idle_formspec = + 'size[8,7]'.. + 'label[1.5,0;Organic juice is just a squish away.]' .. + 'label[4.3,.75;Put fruit here ->]'.. + 'label[3.5,1.75;Put container here ->]'.. + 'label[0.2,1.8;4 fruits to a glass,]'.. + 'label[0.2,2.1;8 fruits to a bottle,]'.. + 'label[0.2,2.4;16 fruits to a bucket.]'.. + 'button[1,1;2,1;press;Start Juicing]'.. + 'list[current_name;src;6.5,.5;1,1;]'.. + 'list[current_name;dst;6.5,1.5;1,1;]'.. + 'list[current_player;main;0,3;8,4;]' + +local press_running_formspec = + 'size[8,7]'.. + 'label[1.5,0;Organic juice coming right up.]' .. + 'label[4.3,.75;Put fruit here ->]'.. + 'label[3.5,1.75;Put container here ->]'.. + 'label[0.2,1.8;4 fruits to a glass,]'.. + 'label[0.2,2.1;8 fruits to a bottle,]'.. + 'label[0.2,2.4;16 fruits to a bucket.]'.. + 'button[1,1;2,1;press;Start Juicing]'.. + 'list[current_name;src;6.5,.5;1,1;]'.. + 'list[current_name;dst;6.5,1.5;1,1;]'.. + 'list[current_player;main;0,3;8,4;]' + +local press_error_formspec = + 'size[8,7]'.. + 'label[1.5,0;You need to add more fruit.]' .. + 'label[4.3,.75;Put fruit here ->]'.. + 'label[3.5,1.75;Put container here ->]'.. + 'label[0.2,1.8;4 fruits to a glass,]'.. + 'label[0.2,2.1;8 fruits to a bottle,]'.. + 'label[0.2,2.4;16 fruits to a bucket.]'.. + 'button[1,1;2,1;press;Start Juicing]'.. + 'list[current_name;src;6.5,.5;1,1;]'.. + 'list[current_name;dst;6.5,1.5;1,1;]'.. + 'list[current_player;main;0,3;8,4;]' + +minetest.register_node('drinks:juice_press', { + description = 'Juice Press', + _doc_items_longdesc = "A machine for creating drinks out of various fruits and vegetables.", + _doc_items_usagehelp = "Right-click the press to access inventory and begin juicing.", + drawtype = 'mesh', + mesh = 'drinks_press.obj', + tiles = {name='drinks_press.png'}, + groups = {choppy=2, dig_immediate=2,}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-.5, -.5, -.5, .5, .5, .5}, + }, + collision_box = { + type = 'fixed', + fixed = {-.5, -.5, -.5, .5, .5, .5}, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('main', 8*4) + inv:set_size('src', 1) + inv:set_size('dst', 1) + meta:set_string('infotext', 'Empty Juice Press') + meta:set_string('formspec', press_idle_formspec) + end, + on_receive_fields = function(pos, formname, fields, sender) + if fields ['press'] then + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + local instack = inv:get_stack("src", 1) + local fruitstack = instack:get_name() + local mod, fruit = fruitstack:match("([^:]+):([^:]+)") + if drinks.juiceable[fruit] then + if string.find(fruit, '_') then + local fruit, junk = fruit:match('([^_]+)_([^_]+)') + meta:set_string('fruit', fruit) + else + meta:set_string('fruit', fruit) + end + local outstack = inv:get_stack("dst", 1) + local vessel = outstack:get_name() + if vessel == 'vessels:drinking_glass' then + if instack:get_count() >= 4 then + meta:set_string('container', 'jcu_') + meta:set_string('fruitnumber', 4) + meta:set_string('infotext', 'Juicing...') + meta:set_string('formspec', press_running_formspec) + timer:start(4) + else + meta:set_string('infotext', 'You need more fruit.') + meta:set_string('formspec', press_error_formspec) + end + elseif vessel == 'vessels:glass_bottle' then + if instack:get_count() >= 8 then + meta:set_string('container', 'jbo_') + meta:set_string('fruitnumber', 8) + meta:set_string('infotext', 'Juicing...') + meta:set_string('formspec', press_running_formspec) + timer:start(8) + else + meta:set_string('infotext', 'You need more fruit.') + meta:set_string('formspec', press_error_formspec) + end + elseif vessel == 'vessels:steel_bottle' then + if instack:get_count() >= 8 then + meta:set_string('container', 'jsb_') + meta:set_string('fruitnumber', 8) + meta:set_string('infotext', 'Juicing...') + meta:set_string('formspec', press_running_formspec) + timer:start(8) + else + meta:set_string('infotext', 'You need more fruit.') + meta:set_string('formspec', press_error_formspec) + end + elseif vessel == 'bucket:bucket_empty' then + if instack:get_count() >= 16 then + meta:set_string('container', 'jbu_') + meta:set_string('fruitnumber', 16) + meta:set_string('infotext', 'Juicing...') + meta:set_string('formspec', press_running_formspec) + timer:start(16) + else + meta:set_string('infotext', 'You need more fruit.') + meta:set_string('formspec', press_error_formspec) + end + elseif vessel == 'default:papyrus' then + if instack:get_count() >= 2 then + local under_node = {x=pos.x, y=pos.y-1, z=pos.z} + local under_node_name = minetest.get_node_or_nil(under_node) + local under_node_2 = {x=pos.x, y=pos.y-2, z=pos.z} + local under_node_name_2 = minetest.get_node_or_nil(under_node_2) + if under_node_name.name == 'drinks:liquid_barrel' then + local meta_u = minetest.get_meta(under_node) + local stored_fruit = meta_u:get_string('fruit') + if fruit == stored_fruit or stored_fruit == 'empty' then + meta:set_string('container', 'tube') + meta:set_string('fruitnumber', 2) + meta:set_string('infotext', 'Juicing...') + meta_u:set_string('fruit', fruit) + timer:start(4) + else + meta:set_string('infotext', "You can't mix juices.") + end + elseif under_node_name_2.name == 'drinks:liquid_silo' then + local meta_u = minetest.get_meta(under_node_2) + local stored_fruit = meta_u:get_string('fruit') + if fruit == stored_fruit or stored_fruit == 'empty' then + meta:set_string('container', 'tube') + meta:set_string('fruitnumber', 2) + meta:set_string('infotext', 'Juicing...') + meta_u:set_string('fruit', fruit) + timer:start(4) + else + meta:set_string('infotext', "You can't mix juices.") + end + else + meta:set_string('infotext', 'You need more fruit.') + meta:set_string('formspec', press_error_formspec) + end + end + end + end + end + end, + on_timer = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local container = meta:get_string('container') + local instack = inv:get_stack("src", 1) + local outstack = inv:get_stack("dst", 1) + local fruit = meta:get_string('fruit') + local fruitnumber = tonumber(meta:get_string('fruitnumber')) + if container == 'tube' then + local timer = minetest.get_node_timer(pos) + local under_node = {x=pos.x, y=pos.y-1, z=pos.z} + local under_node_name = minetest.get_node_or_nil(under_node) + local under_node_2 = {x=pos.x, y=pos.y-2, z=pos.z} + local under_node_name_2 = minetest.get_node_or_nil(under_node_2) + if under_node_name.name == 'drinks:liquid_barrel' then + local meta_u = minetest.get_meta(under_node) + local fullness = tonumber(meta_u:get_string('fullness')) + instack:take_item(tonumber(fruitnumber)) + inv:set_stack('src', 1, instack) + if fullness + 2 > 128 then + timer:stop() + meta:set_string('infotext', 'Barrel is full of juice.') + return + else + local fullness = fullness + 2 + meta_u:set_string('fullness', fullness) + meta_u:set_string('infotext', (math.floor((fullness/128)*100))..' % full of '..fruit..' juice.') + meta_u:set_string('formspec', drinks.liquid_storage_formspec(fruit, fullness, 128)) + if instack:get_count() >= 2 then + timer:start(4) + else + meta:set_string('infotext', 'You need more fruit.') + end + end + elseif under_node_name_2.name == 'drinks:liquid_silo' then + local meta_u = minetest.get_meta(under_node_2) + local fullness = tonumber(meta_u:get_string('fullness')) + instack:take_item(tonumber(fruitnumber)) + inv:set_stack('src', 1, instack) + if fullness + 2 > 256 then + timer:stop() + meta:set_string('infotext', 'Silo is full of juice.') + return + else + local fullness = fullness + 2 + meta_u:set_string('fullness', fullness) + meta_u:set_string('infotext', (math.floor((fullness/256)*100))..' % full of '..fruit..' juice.') + meta_u:set_string('formspec', drinks.liquid_storage_formspec(fruit, fullness, 256)) + if instack:get_count() >= 2 then + timer:start(4) + else + meta:set_string('infotext', 'You need more fruit.') + end + end + end + else + meta:set_string('infotext', 'Collect your juice.') + meta:set_string('formspec', press_idle_formspec) + instack:take_item(tonumber(fruitnumber)) + inv:set_stack('src', 1, instack) + inv:set_stack('dst', 1 ,'drinks:'..container..fruit) + end + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + local timer = minetest.get_node_timer(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + timer:stop() + meta:set_string('infotext', 'Ready for more juicing.') + meta:set_string('formspec', press_idle_formspec) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + meta:set_string('infotext', 'Ready for juicing.') + end, + can_dig = function(pos) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + if inv:is_empty("src") and + inv:is_empty("dst") then + return true + else + return false + end + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + if listname == 'dst' then + if stack:get_name() == ('bucket:bucket_empty') then + return 1 + elseif stack:get_name() == ('vessels:drinking_glass') then + return 1 + elseif stack:get_name() == ('vessels:glass_bottle') then + return 1 + elseif stack:get_name() == ('vessels:steel_bottle') then + return 1 + elseif stack:get_name() == ('default:papyrus') then + return 1 + else + return 0 + end + else + return 99 + end + end, +}) + +function drinks.drinks_liquid_sub(liq_vol, ves_typ, ves_vol, pos, able_to_fill, leftover_count, outputstack) + local meta = minetest.get_meta(pos) + local fullness = tonumber(meta:get_string('fullness')) + local fruit = meta:get_string('fruit') + local fruit_name = meta:get_string('fruit_name') + local inv = meta:get_inventory() + local fullness = fullness - (liq_vol*able_to_fill) + meta:set_string('fullness', fullness) + meta:set_string('infotext', (math.floor((fullness/ves_vol)*100))..' % full of '..fruit_name..' juice.') + if ves_vol == 128 then + meta:set_string('formspec', drinks.liquid_storage_formspec(fruit_name, fullness, 128)) + elseif ves_vol == 256 then + meta:set_string('formspec', drinks.liquid_storage_formspec(fruit_name, fullness, 256)) + end + if ves_typ == 'jcu' or ves_typ == 'jbo' or ves_typ == 'jsb' or ves_typ == 'jbu' then + inv:set_stack('dst', 1, 'drinks:'..ves_typ..'_'..fruit..' '..able_to_fill) + inv:set_stack('src', 1, outputstack..' '..leftover_count) + elseif ves_typ == 'thirsty:bronze_canteen' then + inv:set_stack('dst', 1, {name="thirsty:bronze_canteen", count=1, wear=60, metadata=""}) + elseif ves_typ == 'thirsty:steel_canteen' then + inv:set_stack('dst', 1, {name="thirsty:steel_canteen", count=1, wear=40, metadata=""}) + end +end + +function drinks.drinks_liquid_avail_sub(liq_vol, ves_typ, ves_vol, outputstack, pos, count) + local meta = minetest.get_meta(pos) + local fullness = tonumber(meta:get_string('fullness')) + if fullness - (liq_vol*count) < 0 then + local able_to_fill = math.floor(fullness/liq_vol) + local leftover_count = count - able_to_fill + drinks.drinks_liquid_sub(liq_vol, ves_typ, ves_vol, pos, able_to_fill, leftover_count, outputstack) + elseif fullness - (liq_vol*count) >= 0 then + drinks.drinks_liquid_sub(liq_vol, ves_typ, ves_vol, pos, count, 0, outputstack) + end +end + +function drinks.drinks_liquid_add(liq_vol, ves_typ, ves_vol, pos, inputcount, leftover_count, inputstack) + local meta = minetest.get_meta(pos) + local fullness = tonumber(meta:get_string('fullness')) + local fruit = meta:get_string('fruit') + local fruit_name = meta:get_string('fruit_name') + local inv = meta:get_inventory() + local fullness = fullness + (liq_vol*inputcount) + meta:set_string('fullness', fullness) + inv:set_stack('src', 1, ves_typ..' '..inputcount) + inv:set_stack('dst', 1, inputstack..' '..leftover_count) + meta:set_string('infotext', (math.floor((fullness/ves_vol)*100))..' % full of '..fruit_name..' juice.') + if ves_vol == 256 then + meta:set_string('formspec', drinks.liquid_storage_formspec(fruit_name, fullness, 256)) + elseif ves_vol == 128 then + meta:set_string('formspec', drinks.liquid_storage_formspec(fruit_name, fullness, 128)) + end +end + +function drinks.drinks_liquid_avail_add(liq_vol, ves_typ, ves_vol, pos, inputstack, inputcount) + local meta = minetest.get_meta(pos) + local fullness = tonumber(meta:get_string('fullness')) + if fullness + (liq_vol*inputcount) > ves_vol then + local avail_ves_vol = ves_vol - fullness + local can_empty = math.floor(avail_ves_vol/liq_vol) + local leftover_count = inputcount - can_empty + drinks.drinks_liquid_add(liq_vol, ves_typ, ves_vol, pos, can_empty, leftover_count, inputstack) + elseif fullness + (liq_vol*inputcount) <= ves_vol then + drinks.drinks_liquid_add(liq_vol, ves_typ, ves_vol, pos, inputcount, 0, inputstack) + end +end + +function drinks.drinks_barrel(pos, inputstack, inputcount) + local meta = minetest.get_meta(pos) + local vessel = string.sub(inputstack, 8, 10) + drinks.drinks_liquid_avail_add(drinks.shortname[vessel].size, drinks.shortname[vessel].name, 128, pos, inputstack, inputcount) +end + +function drinks.drinks_silo(pos, inputstack, inputcount) + local meta = minetest.get_meta(pos) + local vessel = string.sub(inputstack, 8, 10) + drinks.drinks_liquid_avail_add(drinks.shortname[vessel].size, drinks.shortname[vessel].name, 256, pos, inputstack, inputcount) +end + +minetest.register_node('drinks:liquid_barrel', { + description = 'Barrel of Liquid', + _doc_items_longdesc = "A node that provides a simple way to store juice.", + _doc_items_usagehelp = "Add or remove liquids from the barrel using buckets, bottles, or cups.", + drawtype = 'mesh', + mesh = 'drinks_liquid_barrel.obj', + tiles = {name='drinks_barrel.png'}, + groups = {choppy=2, dig_immediate=2,}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-.5, -.5, -.5, .5, .5, .5}, + }, + collision_box = { + type = 'fixed', + fixed = {-.5, -.5, -.5, .5, .5, .5}, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('main', 8*4) + inv:set_size('src', 1) + inv:set_size('dst', 1) + meta:set_string('fullness', 0) + meta:set_string('fruit', 'empty') + meta:set_string('infotext', 'Empty Drink Barrel') + meta:set_string('formspec', 'size[8,8]'.. + 'label[0,0;Fill with the drink of your choice,]'.. + 'label[0,.4;you can only add more of the same type of drink.]'.. + 'label[4.5,1.2;Add liquid ->]'.. + 'label[.75,1.75;The barrel is empty]'.. + 'label[4.5,2.25;Take liquid ->]'.. + 'label[2,3.2;(This empties the barrel completely)]'.. + 'button[0,3;2,1;purge;Purge]'.. + 'list[current_name;src;6.5,1;1,1;]'.. + 'list[current_name;dst;6.5,2;1,1;]'.. + 'list[current_player;main;0,4;8,5;]') + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local instack = inv:get_stack('src', 1) + local outstack = inv:get_stack('dst', 1) + local outputstack = outstack:get_name() + local inputstack = instack:get_name() + local outputcount = outstack:get_count() + local inputcount = instack:get_count() + local fruit = string.sub(inputstack, 12, -1) + local fruit_in = meta:get_string('fruit') + if fruit_in == 'empty' then + meta:set_string('fruit', fruit) + local fruit_name = minetest.registered_nodes[instack:get_name()] + meta:set_string('fruit_name', string.lower(fruit_name.juice_type)) + local vessel = string.sub(inputstack, 8, 10) + drinks.drinks_barrel(pos, inputstack, inputcount) + end + if fruit == fruit_in then + local vessel = string.sub(inputstack, 8, 10) + drinks.drinks_barrel(pos, inputstack, inputcount) + end + if drinks.longname[outputstack] then + drinks.drinks_liquid_avail_sub(drinks.longname[outputstack].size, drinks.longname[outputstack].name, 128, outputstack, pos, outputcount) + end + end, + on_receive_fields = function(pos, formname, fields, sender) + if fields['purge'] then + local meta = minetest.get_meta(pos) + local fullness = 0 + local fruit_name = 'no' + meta:set_string('fullness', 0) + meta:set_string('fruit', 'empty') + meta:set_string('infotext', 'Empty Drink Barrel') + meta:set_string('formspec', drinks.liquid_storage_formspec(fruit_name, fullness, 128)) + end + end, + can_dig = function(pos) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + if inv:is_empty("src") and + inv:is_empty("dst") and + tonumber(meta:get_string('fullness')) == 0 then + return true + else + return false + end + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if listname == 'src' then --adding liquid + local inputstack = stack:get_name() + local inputcount = stack:get_count() + local valid = string.sub(inputstack, 1, 8) + if valid == 'drinks:j' then + return inputcount + else + return 0 + end + elseif listname == 'dst' then --removing liquid + --make sure there is a liquid to remove + local juice = meta:get_string('fruit') + if juice ~= 'empty' then + local inputstack = stack:get_name() + local inputcount = stack:get_count() + local valid = string.sub(inputstack, 1, 7) + if valid == 'vessels' or valid == 'bucket:' then + return inputcount + else + return 0 + end + else + return 0 + end + end + end, +}) + +minetest.register_node('drinks:liquid_silo', { + description = 'Silo of Liquid', + _doc_items_longdesc = "A node that provides a simple way to store juice.", + _doc_items_usagehelp = "Add or remove liquids from the silo using buckets, bottles, or cups.", + drawtype = 'mesh', + mesh = 'drinks_silo.obj', + tiles = {name='drinks_silo.png'}, + groups = {choppy=2, dig_immediate=2,}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-.5, -.5, -.5, .5, 1.5, .5}, + }, + collision_box = { + type = 'fixed', + fixed = {-.5, -.5, -.5, .5, 1.5, .5}, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('main', 8*4) + inv:set_size('src', 1) + inv:set_size('dst', 1) + meta:set_string('fullness', 0) + meta:set_string('fruit', 'empty') + meta:set_string('infotext', 'Empty Drink Silo') + meta:set_string('formspec', 'size[8,8]'.. + 'label[0,0;Fill with the drink of your choice,]'.. + 'label[0,.4;you can only add more of the same type of drink.]'.. + 'label[4.5,1.2;Add liquid ->]'.. + 'label[.75,1.75;The Silo is empty]'.. + 'label[4.5,2.25;Take liquid ->]'.. + 'label[2,3.2;(This empties the silo completely)]'.. + 'button[0,3;2,1;purge;Purge]'.. + 'list[current_name;src;6.5,1;1,1;]'.. + 'list[current_name;dst;6.5,2;1,1;]'.. + 'list[current_player;main;0,4;8,5;]') + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local instack = inv:get_stack("src", 1) + local outstack = inv:get_stack('dst', 1) + local outputstack = outstack:get_name() + local inputstack = instack:get_name() + local outputcount = outstack:get_count() + local inputcount = instack:get_count() + local fruit = string.sub(inputstack, 12, -1) + local fruit_in = meta:get_string('fruit') + if fruit_in == 'empty' then + meta:set_string('fruit', fruit) + local fruit_name = minetest.registered_nodes[instack:get_name()] + meta:set_string('fruit_name', string.lower(fruit_name.juice_type)) + local vessel = string.sub(inputstack, 8, 10) + drinks.drinks_silo(pos, inputstack, inputcount) + end + if fruit == fruit_in then + local vessel = string.sub(inputstack, 8, 10) + drinks.drinks_silo(pos, inputstack, inputcount) + end + if drinks.longname[outputstack] then + drinks.drinks_liquid_avail_sub(drinks.longname[outputstack].size, drinks.longname[outputstack].name, 256, outputstack, pos, outputcount) + end + end, + on_receive_fields = function(pos, formname, fields, sender) + if fields['purge'] then + local meta = minetest.get_meta(pos) + local fullness = 0 + local fruit_name = 'no' + meta:set_string('fullness', 0) + meta:set_string('fruit', 'empty') + meta:set_string('infotext', 'Empty Drink Silo') + meta:set_string('formspec', drinks.liquid_storage_formspec(fruit_name, fullness, 256)) + end + end, + can_dig = function(pos) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + if inv:is_empty("src") and + inv:is_empty("dst") and + tonumber(meta:get_string('fullness')) == 0 then + return true + else + return false + end + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if listname == 'src' then --adding liquid + local inputstack = stack:get_name() + local inputcount = stack:get_count() + local valid = string.sub(inputstack, 1, 8) + if valid == 'drinks:j' then + return inputcount + else + return 0 + end + elseif listname == 'dst' then --removing liquid + --make sure there is liquid to take_item + local juice = meta:get_string('fruit') + if juice ~= 'empty' then + local inputstack = stack:get_name() + local inputcount = stack:get_count() + local valid = string.sub(inputstack, 1, 7) + if valid == 'vessels' or valid == 'bucket:' then + return inputcount + else + return 0 + end + else + return 0 + end + end + end, +}) diff --git a/mods/drinks/drinks.lua b/mods/drinks/drinks.lua new file mode 100644 index 00000000..7de692f4 --- /dev/null +++ b/mods/drinks/drinks.lua @@ -0,0 +1,65 @@ +--Parse Table +for i in ipairs (drinks.drink_table) do + local desc = drinks.drink_table[i][1] + local craft = drinks.drink_table[i][2] + local color = drinks.drink_table[i][3] + local health = drinks.drink_table[i][4] + health = health or 1 + -- The color of the drink is all done in code, so we don't need to have multiple images. + +--Actual Node registration +minetest.register_node('drinks:jbu_'..desc..'', { + description = 'Bucket of '..craft..' Juice', + drawtype = "plantlike", + tiles = {'bucket.png^(drinks_bucket_contents.png^[colorize:'..color..':200)'}, + inventory_image = 'bucket.png^(drinks_bucket_contents.png^[colorize:'..color..':200)', + wield_image = 'bucket.png^(drinks_bucket_contents.png^[colorize:'..color..':200)', + paramtype = "light", + juice_type = craft, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, drink = 1}, + sounds = default.node_sound_defaults(), +}) + +drinks.register_item('drinks:jcu_'..desc, 'vessels:drinking_glass', { + description = 'Cup of '..craft..' Juice', + groups = {drink=1}, + juice_type = craft, + inventory_image = 'drinks_glass_contents.png^[colorize:'..color..':200^drinks_drinking_glass.png', + on_use = function(itemstack, user, pointed_thing) + thirsty.drink(user, 4, 20) + local eat_func = minetest.item_eat(health, 'vessels:drinking_glass') + return eat_func(itemstack, user, pointed_thing) + end, +}) + +drinks.register_item('drinks:jbo_'..desc, 'vessels:glass_bottle',{ + description = 'Bottle of '..craft..' Juice', + groups = {drink = 1}, + juice_type = craft, + inventory_image = 'drinks_bottle_contents.png^[colorize:'..color..':200^drinks_glass_bottle.png', + on_use = function(itemstack, user, pointed_thing) + thirsty.drink(user, 8, 20) + local eat_func = minetest.item_eat((health*2), 'vessels:glass_bottle') + return eat_func(itemstack, user, pointed_thing) + end, +}) + +drinks.register_item('drinks:jsb_'..desc, 'vessels:steel_bottle',{ + description = 'Heavy Steel Bottle ('..craft..' Juice)', + groups = {drink = 1}, + juice_type = craft, + inventory_image = 'vessels_steel_bottle.png', + on_use = function(itemstack, user, pointed_thing) + thirsty.drink(user, 8, 20) + local eat_func = minetest.item_eat((health*2), 'vessels:steel_bottle') + return eat_func(itemstack, user, pointed_thing) + end, +}) + +end diff --git a/mods/drinks/drinks2.lua b/mods/drinks/drinks2.lua new file mode 100644 index 00000000..a59444d1 --- /dev/null +++ b/mods/drinks/drinks2.lua @@ -0,0 +1,61 @@ +-- This code is for if Thirst isn't enabled. +--Parse Table +for i in ipairs (drinks.drink_table) do + local desc = drinks.drink_table[i][1] + local craft = drinks.drink_table[i][2] + local color = drinks.drink_table[i][3] + local health = drinks.drink_table[i][4] + health = health or 1 + +--Actual Node registration +minetest.register_node('drinks:jbu_'..desc..'', { + description = 'Bucket of '..craft..' Juice', + drawtype = "plantlike", + tiles = {'bucket.png^(drinks_bucket_contents.png^[colorize:'..color..':200)'}, + inventory_image = 'bucket.png^(drinks_bucket_contents.png^[colorize:'..color..':200)', + wield_image = 'bucket.png^(drinks_bucket_contents.png^[colorize:'..color..':200)', + paramtype = "light", + juice_type = craft, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, drink = 1}, + sounds = default.node_sound_defaults(), +}) + +drinks.register_item( 'drinks:jcu_'..desc, 'vessels:drinking_glass', { + description = 'Cup of '..craft..' Juice', + juice_type = craft, + inventory_image = 'drinks_glass_contents.png^[colorize:'..color..':200^drinks_drinking_glass.png', + on_use = function(itemstack, user, pointed_thing) + local eat_func = minetest.item_eat(health, 'vessels:drinking_glass') + return eat_func(itemstack, user, pointed_thing) + end, +}) + +drinks.register_item( 'drinks:jbo_'..desc, 'vessels:glass_bottle', { + description = 'Bottle of '..craft..' Juice', + groups = {drink=1}, + juice_type = craft, + inventory_image = 'drinks_bottle_contents.png^[colorize:'..color..':200^drinks_glass_bottle.png', + on_use = function(itemstack, user, pointed_thing) + local eat_func = minetest.item_eat((health*2), 'vessels:glass_bottle') + return eat_func(itemstack, user, pointed_thing) + end, +}) + +drinks.register_item( 'drinks:jsb_'..desc, 'vessels:steel_bottle', { + description = 'Heavy Steel Bottle ('..craft..' Juice)', + groups = {drink=1}, + juice_type = craft, + inventory_image = 'vessels_steel_bottle.png', + on_use = function(itemstack, user, pointed_thing) + local eat_func = minetest.item_eat((health*2), 'vessels:steel_bottle') + return eat_func(itemstack, user, pointed_thing) + end, +}) + +end diff --git a/mods/drinks/formspecs.lua b/mods/drinks/formspecs.lua new file mode 100644 index 00000000..43bf3904 --- /dev/null +++ b/mods/drinks/formspecs.lua @@ -0,0 +1,16 @@ +function drinks.liquid_storage_formspec(fruit_name, fullness, max) + local formspec = + 'size[8,8]'.. + 'label[0,0;Fill with the drink of your choice,]'.. + 'label[0,.4;you can only add more of the same type of drink.]'.. + 'label[4.5,1.2;Add liquid ->]'.. + 'label[.5,1.2;Storing '..fruit_name..' juice.]'.. + 'label[.5,1.65;Holding '..(fullness/2)..' of '..(max/2)..' cups.]'.. + 'label[4.5,2.25;Take liquid ->]'.. + 'label[2,3.2;(This empties the container completely)]'.. + 'button[0,3;2,1;purge;Purge]'.. + 'list[current_name;src;6.5,1;1,1;]'.. + 'list[current_name;dst;6.5,2;1,1;]'.. + 'list[current_player;main;0,4;8,5;]' + return formspec +end diff --git a/mods/drinks/init.lua b/mods/drinks/init.lua new file mode 100644 index 00000000..987c341c --- /dev/null +++ b/mods/drinks/init.lua @@ -0,0 +1,216 @@ +-- mod support (moreblocks/technic_worldgen) +local slab_str = "stairs:slab_wood" + +function applyModSupport() + local moreblocks_found = false + local technic_worldgen = false + + local modnames = minetest.get_modnames() + + for i, name in ipairs(modnames) do + -- minetest.log("[Mod] " .. name) + if name == "moreblocks" then + moreblocks_found = true + end + + if name == "technic_worldgen" then + technic_worldgen = true + end + end + + if moreblocks_found == true and technic_worldgen == true then + minetest.log("applying patch to mod " .. minetest.get_current_modname()) + minetest.log("converting '" .. slab_str .. "' to 'moreblocks:slab_wood'") + slab_str = "moreblocks:slab_wood" + end +end +--applyModSupport() + +--Craft Recipes + +-- added mod-support +minetest.register_craft({ + output = 'drinks:juice_press', + recipe = { + {'default:stick', 'default:steel_ingot', 'default:stick'}, + {'default:stick', 'bucket:bucket_empty', 'default:stick'}, + {slab_str, slab_str, 'vessels:drinking_glass'}, + } +}) + +-- added mod-support +minetest.register_craft({ + output = 'drinks:liquid_barrel', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + {slab_str, '', slab_str}, + } +}) + +drinks = { +drink_table = {}, +juiceable = {}, +shortname = { + ['jcu'] = {size = 2, name = 'vessels:drinking_glass'}, + ['jbo'] = {size = 4, name = 'vessels:glass_bottle'}, + ['jsb'] = {size = 4, name = 'vessels:steel_bottle'}, + ['jbu'] = {size = 16, name = 'bucket:bucket_empty'} +}, +longname = { + ['vessels:drinking_glass'] = {size = 2, name = 'jcu'}, + ['vessels:glass_bottle'] = {size = 4, name = 'jbo'}, + ['vessels:steel_bottle'] = {size = 4, name = 'jsb'}, + ['bucket:bucket_empty'] = {size = 16, name = 'jbu'}, + ['thirsty:steel_canteen'] = {size = 20, name = 'thirsty:steel_canteen'}, + ['thirsty:bronze_canteen'] = {size = 30, name = 'thirsty:bronze_canteen'}, +}, +} + + +-- Honestly not needed for default, but used as an example to add support to other mods. +-- Basically to use this all you need to do is add the name of the fruit to make juiceable (see line 14 for example) +-- Add the new fruit to a table like I've done in line 16. +-- The table should follow this scheme: internal name, Displayed name, colorize code. +-- Check out the drinks.lua file for more info how how the colorize code is used. + +if minetest.get_modpath('default') then + drinks.juiceable['apple'] = true -- Name of fruit to make juiceable. + drinks.juiceable['cactus'] = true + drinks.juiceable['blueberries'] = true + table.insert(drinks.drink_table, {'apple', 'Apple', '#ecff56'}) + table.insert(drinks.drink_table, {'cactus', 'Cactus', '#96F97B'}) + table.insert(drinks.drink_table, {'blueberries', 'Blueberry', '#521dcb'}) +end + +if minetest.get_modpath('bushes_classic') then + drinks.juiceable['blackberry'] = true + drinks.juiceable['blueberry'] = true + drinks.juiceable['gooseberry'] = true + drinks.juiceable['raspberry'] = true + drinks.juiceable['strawberry'] = true + table.insert(drinks.drink_table, {'blackberry', 'Blackberry', '#581845'}) + table.insert(drinks.drink_table, {'blueberry', 'Blueberry', '#521dcb'}) + table.insert(drinks.drink_table, {'gooseberry', 'Gooseberry', '#9cf57c'}) + table.insert(drinks.drink_table, {'raspberry', 'Raspberry', '#C70039'}) + table.insert(drinks.drink_table, {'strawberry', 'Strawberry', '#ff3636'}) +end + +if minetest.get_modpath('farming_plus') then + drinks.juiceable['banana'] = true + drinks.juiceable['melon'] = true + drinks.juiceable['lemon_item'] = true + drinks.juiceable['orange_item'] = true + drinks.juiceable['peach_item'] = true + drinks.juiceable['rhubarb_item'] = true + drinks.juiceable['tomato_item'] = true + drinks.juiceable['strawberry_item'] = true + drinks.juiceable['raspberry_item'] = true + table.insert(drinks.drink_table, {'banana', 'Banana', '#eced9f'}) + table.insert(drinks.drink_table, {'lemon', 'Lemon', '#feffaa'}) + table.insert(drinks.drink_table, {'melon', 'Melon', '#ef4646'}) + table.insert(drinks.drink_table, {'orange', 'Orange', '#ffc417'}) + table.insert(drinks.drink_table, {'peach', 'Peach', '#f2bc1e'}) + table.insert(drinks.drink_table, {'rhubarb', 'Rhubarb', '#fb8461'}) + table.insert(drinks.drink_table, {'tomato', 'Tomato', '#d03a0e'}) + table.insert(drinks.drink_table, {'strawberry', 'Strawberry', '#ff3636'}) + table.insert(drinks.drink_table, {'raspberry', 'Raspberry', '#C70039'}) +end + +if minetest.get_modpath('crops') then + drinks.juiceable['melon'] = true + drinks.juiceable['melon_slice'] = true + drinks.juiceable['tomato'] = true + drinks.juiceable['pumpkin'] = true + table.insert(drinks.drink_table, {'melon', 'Melon', '#ef4646'}) + table.insert(drinks.drink_table, {'tomato', 'Tomato', '#d03a0e'}) + table.insert(drinks.drink_table, {'pumpkin', 'Pumpkin', '#ffc04c'}) +end + +if minetest.get_modpath('farming') then + drinks.juiceable['melon_8'] = true + drinks.juiceable['melon_slice'] = true + drinks.juiceable['tomato'] = true + drinks.juiceable['carrot'] = true + drinks.juiceable['cucumber'] = true + drinks.juiceable['grapes'] = true + drinks.juiceable['pumpkin_8'] = true + drinks.juiceable['pumpkin_slice'] = true + drinks.juiceable['raspberries'] = true + drinks.juiceable['rhubarb'] = true + drinks.juiceable['blueberries'] = true + drinks.juiceable['pineapple'] = true + drinks.juiceable['pineapple_ring'] = true + table.insert(drinks.drink_table, {'melon', 'Melon', '#ef4646'}) + table.insert(drinks.drink_table, {'tomato', 'Tomato', '#990000'}) + table.insert(drinks.drink_table, {'carrot', 'Carrot', '#ed9121'}) + table.insert(drinks.drink_table, {'cucumber', 'Cucumber', '#73af59'}) + table.insert(drinks.drink_table, {'grapes', 'Grape', '#b20056'}) + table.insert(drinks.drink_table, {'pumpkin', 'Pumpkin', '#ffc04c'}) + table.insert(drinks.drink_table, {'raspberries', 'Raspberry', '#C70039'}) + table.insert(drinks.drink_table, {'rhubarb', 'Rhubarb', '#fb8461'}) + table.insert(drinks.drink_table, {'blueberries', 'Blueberry', '#521dcb'}) + table.insert(drinks.drink_table, {'pineapple', 'Pineapple', '#dcd611'}) + minetest.register_alias_force('farming:carrot_juice', 'drinks:jcu_carrot') + minetest.register_alias_force('farming:pineapple_juice', 'drinks:jcu_pineapple') +end + +if minetest.get_modpath('fruit') then + drinks.juiceable['pear'] = true + drinks.juiceable['plum'] = true + drinks.juiceable['peach'] = true + drinks.juiceable['orange'] = true + table.insert(drinks.drink_table, {'pear', 'Pear', '#ecff56'}) + table.insert(drinks.drink_table, {'plum', 'Plum', '#8e4585'}) + table.insert(drinks.drink_table, {'peach', 'Peach', '#f2bc1e'}) + table.insert(drinks.drink_table, {'orange', 'Orange', '#ffc417'}) +end + +if minetest.get_modpath('ethereal') then + drinks.juiceable['banana'] = true + drinks.juiceable['coconut'] = true + drinks.juiceable['coconut_slice'] = true + drinks.juiceable['orange'] = true + drinks.juiceable['strawberry'] = true + table.insert(drinks.drink_table, {'banana', 'Banana', '#eced9f'}) + table.insert(drinks.drink_table, {'coconut', 'Coconut', '#ffffff'}) + table.insert(drinks.drink_table, {'orange', 'Orange', '#ffc417'}) + table.insert(drinks.drink_table, {'strawberry', 'Strawberry', '#ff3636'}) +end + +-- replace craftitem to node definition +-- use existing node as template (e.g. 'vessel:glass_bottle') +drinks.register_item = function( name, template, def ) + local template_def = minetest.registered_nodes[template] + if template_def then + local drinks_def = table.copy(template_def) + + -- replace/add values + for k,v in pairs(def) do + if k == "groups" then + -- special handling for groups: merge instead replace + for g,n in pairs(v) do + drinks_def[k][g] = n + end + else + drinks_def[k]=v + end + end + + if def.inventory_image then + drinks_def.wield_image = drinks_def.inventory_image + drinks_def.tiles = { drinks_def.inventory_image } + end + + minetest.register_node( name, drinks_def ) + end +end + + +if minetest.get_modpath('thirsty') then + dofile(minetest.get_modpath('drinks')..'/drinks.lua') +else + dofile(minetest.get_modpath('drinks')..'/drinks2.lua') +end +dofile(minetest.get_modpath('drinks')..'/drink_machines.lua') +dofile(minetest.get_modpath('drinks')..'/formspecs.lua') diff --git a/mods/drinks/license.txt b/mods/drinks/license.txt new file mode 100644 index 00000000..49b202cb --- /dev/null +++ b/mods/drinks/license.txt @@ -0,0 +1,16 @@ +Textures are licensed under CC by SA 3.0 Nathan Salapat + +The drinking glass textures are modified from the vessels mod where it is licensed as; +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2012-2016 Vanessa Ezekowitz +Copyright (C) 2016 Thomas-S + +The bucket textures are modified from the bucket mod where it is licensed as; +(CC BY-SA 3.0) celeron55 + +Code is licensed MIT, +Copyright 2019 Nathan Salapat + +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. diff --git a/mods/drinks/mod.conf b/mods/drinks/mod.conf new file mode 100644 index 00000000..d0c47df4 --- /dev/null +++ b/mods/drinks/mod.conf @@ -0,0 +1,7 @@ +name = drinks +depends= bucket,default,vessels,stairs +description = Adds a juice press and two juice storage containers. Most fruits and several veggies can be juiced. The resulting drinks can be 'ate' to gain health, or if you are using the thirsty mod, to regain hydration. +author = Nathan, Napiophelios +optional_depends = hunger,thirsty,plantlife,farming_plus,crops,farming,minetest_doc_modpack,fruits,ethereal +release = 1004 +title = Drinks diff --git a/mods/drinks/models/drinks_liquid_barrel.obj b/mods/drinks/models/drinks_liquid_barrel.obj new file mode 100644 index 00000000..4a67ef45 --- /dev/null +++ b/mods/drinks/models/drinks_liquid_barrel.obj @@ -0,0 +1,385 @@ +# Blender v2.78 (sub 0) OBJ File: 'drinks.blend' +# www.blender.org +o Barrel_Cylinder.001 +v -0.406507 -0.168381 0.450000 +v -0.406507 -0.168381 -0.400000 +v -0.168381 -0.406507 0.450000 +v -0.168381 -0.406507 -0.400000 +v 0.168381 -0.406507 0.450000 +v 0.168381 -0.406507 -0.400000 +v 0.406507 -0.168381 0.450000 +v 0.406507 -0.168381 -0.400000 +v 0.406507 0.168381 0.450000 +v 0.406507 0.168381 -0.400000 +v 0.168381 0.406507 0.450000 +v 0.168381 0.406507 -0.400000 +v -0.168381 0.406507 0.450000 +v -0.168381 0.406507 -0.400000 +v -0.406507 0.168381 0.450000 +v -0.406507 0.168381 -0.400000 +v -0.447158 -0.185219 0.350000 +v -0.447158 -0.185219 -0.300000 +v -0.185219 -0.447158 -0.300000 +v -0.185219 -0.447158 0.350000 +v 0.185219 -0.447158 -0.300000 +v 0.185219 -0.447158 0.350000 +v 0.447158 -0.185219 -0.300000 +v 0.447158 -0.185219 0.350000 +v 0.447158 0.185219 -0.300000 +v 0.447158 0.185219 0.350000 +v 0.185219 0.447158 -0.300000 +v 0.185219 0.447158 0.350000 +v -0.185219 0.447158 -0.300000 +v -0.185219 0.447158 0.350000 +v -0.447158 0.185219 -0.300000 +v -0.447158 0.185219 0.350000 +v 0.500000 -0.400000 0.350000 +v 0.500000 -0.500000 0.350000 +v -0.500000 -0.400000 0.350000 +v -0.500000 -0.500000 0.350000 +v -0.000000 -0.300000 0.350000 +v 0.000000 -0.500000 0.350000 +v 0.500000 -0.400000 0.250000 +v 0.500000 -0.500000 0.250000 +v -0.500000 -0.400000 0.250000 +v -0.500000 -0.500000 0.250000 +v 0.000000 -0.300000 0.250000 +v 0.000000 -0.500000 0.250000 +v 0.500000 -0.400000 -0.200000 +v 0.500000 -0.500000 -0.200000 +v -0.500000 -0.400000 -0.200000 +v -0.500000 -0.500000 -0.200000 +v 0.000000 -0.300000 -0.200000 +v 0.000000 -0.500000 -0.200000 +v 0.500000 -0.400000 -0.300000 +v 0.500000 -0.500000 -0.300000 +v -0.500000 -0.400000 -0.300000 +v -0.500000 -0.500000 -0.300000 +v 0.000000 -0.300000 -0.300000 +v 0.000000 -0.500000 -0.300000 +v -0.073585 0.436096 0.000000 +v -0.091981 0.482086 0.000000 +v -0.052032 0.436096 -0.052032 +v -0.065041 0.482086 -0.065041 +v -0.000000 0.436096 -0.073585 +v -0.000000 0.482086 -0.091981 +v 0.052032 0.436096 -0.052032 +v 0.065041 0.482086 -0.065041 +v 0.073585 0.436096 0.000000 +v 0.091981 0.482086 0.000000 +v 0.052032 0.436096 0.052032 +v 0.065041 0.482086 0.065041 +v -0.000000 0.436096 0.073585 +v -0.000000 0.482086 0.091981 +v -0.052032 0.436096 0.052032 +v -0.065041 0.482086 0.065041 +v 0.028284 -0.396726 -0.471686 +v 0.028284 -0.373432 -0.384753 +v -0.050000 -0.345485 -0.392241 +v -0.050000 -0.368778 -0.479174 +v -0.035355 -0.379635 -0.383090 +v -0.035355 -0.402929 -0.470024 +v 0.000000 -0.393781 -0.379300 +v 0.000000 -0.417075 -0.466233 +v 0.035355 -0.379635 -0.383090 +v 0.035355 -0.402929 -0.470024 +v 0.050000 -0.345485 -0.392241 +v 0.050000 -0.368778 -0.479174 +v 0.000000 -0.408042 -0.468654 +v 0.000000 -0.384749 -0.381720 +v -0.028284 -0.396726 -0.471686 +v -0.028284 -0.373432 -0.384753 +v -0.040000 -0.369405 -0.479006 +v -0.040000 -0.346112 -0.392073 +v 0.040000 -0.346112 -0.392073 +v 0.040000 -0.369405 -0.479006 +vt 1.0000 0.9193 +vt 0.9874 1.0000 +vt 0.7357 1.0000 +vt 0.7232 0.9193 +vt 0.8500 0.9193 +vt 0.8374 1.0000 +vt 0.5857 1.0000 +vt 0.5731 0.9193 +vt 0.8849 0.9193 +vt 0.8724 1.0000 +vt 0.6207 1.0000 +vt 0.6081 0.9193 +vt 0.6234 0.9193 +vt 0.6360 1.0000 +vt 0.8876 1.0000 +vt 0.9002 0.9193 +vt 0.8078 0.9193 +vt 0.7952 1.0000 +vt 0.5436 1.0000 +vt 0.5310 0.9193 +vt 0.5401 0.9193 +vt 0.5526 1.0000 +vt 0.8043 1.0000 +vt 0.8169 0.9193 +vt 0.0000 0.3716 +vt 0.0646 0.1942 +vt 0.2357 0.1145 +vt 0.4130 0.1791 +vt 0.4928 0.3502 +vt 0.4282 0.5276 +vt 0.2571 0.6073 +vt 0.0797 0.5427 +vt 0.9614 0.9193 +vt 0.9488 1.0000 +vt 0.6971 1.0000 +vt 0.6845 0.9193 +vt 0.6518 0.9193 +vt 0.6643 1.0000 +vt 0.9160 1.0000 +vt 0.9286 0.9193 +vt 0.0000 0.1969 +vt 0.1032 0.0388 +vt 0.2879 0.0000 +vt 0.4460 0.1032 +vt 0.4848 0.2879 +vt 0.3816 0.4460 +vt 0.1969 0.4848 +vt 0.0388 0.3816 +vt 0.6643 0.3529 +vt 0.6518 0.4335 +vt 0.9286 0.4335 +vt 0.9160 0.3529 +vt 0.9488 0.3529 +vt 0.9614 0.4335 +vt 0.6845 0.4335 +vt 0.6971 0.3529 +vt 0.5526 0.3529 +vt 0.5401 0.4335 +vt 0.8169 0.4335 +vt 0.8043 0.3529 +vt 0.7952 0.3529 +vt 0.8078 0.4335 +vt 0.5310 0.4335 +vt 0.5436 0.3529 +vt 0.6360 0.3529 +vt 0.6234 0.4335 +vt 0.9002 0.4335 +vt 0.8876 0.3529 +vt 0.8724 0.3529 +vt 0.8849 0.4335 +vt 0.6081 0.4335 +vt 0.6207 0.3529 +vt 0.8374 0.3529 +vt 0.8500 0.4335 +vt 0.5731 0.4335 +vt 0.5857 0.3529 +vt 0.9874 0.3529 +vt 1.0000 0.4335 +vt 0.7232 0.4335 +vt 0.7357 0.3529 +vt 0.2562 0.8343 +vt 0.4617 0.8366 +vt 0.4691 0.8792 +vt 0.2563 0.9163 +vt 0.0501 0.8371 +vt 0.0428 0.8798 +vt 0.2556 0.7954 +vt 0.2555 0.7134 +vt 0.4690 0.7499 +vt 0.4617 0.7926 +vt 0.0501 0.7930 +vt 0.0426 0.7505 +vt 0.2283 0.8520 +vt 0.4369 0.8520 +vt 0.4369 0.8937 +vt 0.2283 0.8937 +vt 0.0197 0.8520 +vt 0.0197 0.8937 +vt 0.5058 0.8366 +vt 0.5058 0.7926 +vt 0.0060 0.8371 +vt 0.0060 0.7930 +vt 0.2502 0.9083 +vt 0.4557 0.9106 +vt 0.4632 0.9532 +vt 0.2503 0.9902 +vt 0.0441 0.9111 +vt 0.0368 0.9538 +vt 0.2496 0.8693 +vt 0.2495 0.7873 +vt 0.4630 0.8238 +vt 0.4557 0.8665 +vt 0.0441 0.8670 +vt 0.0367 0.8244 +vt 0.2224 0.9347 +vt 0.4310 0.9347 +vt 0.4310 0.9764 +vt 0.2224 0.9764 +vt 0.0138 0.9347 +vt 0.0138 0.9764 +vt 0.4998 0.9106 +vt 0.4998 0.8665 +vt 0.0000 0.9111 +vt 0.0000 0.8670 +vt 0.6949 0.1977 +vt 0.6590 0.1885 +vt 0.6791 0.1399 +vt 0.7110 0.1588 +vt 0.7110 0.1210 +vt 0.6590 0.0913 +vt 0.6949 0.0821 +vt 0.6682 0.0554 +vt 0.6104 0.0711 +vt 0.6293 0.0393 +vt 0.5915 0.0393 +vt 0.5618 0.0913 +vt 0.5526 0.0554 +vt 0.5259 0.0821 +vt 0.5417 0.1399 +vt 0.5098 0.1210 +vt 0.5098 0.1588 +vt 0.5618 0.1885 +vt 0.5259 0.1977 +vt 0.6104 0.2086 +vt 0.5526 0.2244 +vt 0.5915 0.2405 +vt 0.6293 0.2405 +vt 0.6682 0.2244 +vt 0.8644 0.0660 +vt 0.8658 0.0729 +vt 0.8425 0.0797 +vt 0.8369 0.0733 +vt 0.9516 0.0062 +vt 0.9428 0.0724 +vt 0.9155 0.0655 +vt 0.9235 0.0025 +vt 0.8900 0.0645 +vt 0.8927 0.0000 +vt 1.0000 0.1215 +vt 0.9945 0.1279 +vt 0.9374 0.0787 +vt 0.8611 0.0000 +vt 0.8901 0.0702 +vt 0.8287 0.0027 +vt 0.7853 0.1303 +vt 0.7796 0.1239 +vt 0.8684 0.1399 +vt 0.8488 0.1414 +vt 0.8881 0.1398 +vt 0.9081 0.1412 +vt 0.9142 0.0724 +vt 0.9302 0.1436 +vn -0.6551 -0.6551 -0.3766 +vn 0.0000 -0.9264 -0.3766 +vn 0.6551 -0.6551 -0.3766 +vn 0.9264 0.0000 -0.3766 +vn 0.6551 0.6551 -0.3766 +vn -0.0000 0.9264 -0.3766 +vn 0.0000 0.0000 -1.0000 +vn -0.6551 0.6551 -0.3766 +vn -0.9264 0.0000 -0.3766 +vn -0.0000 -0.0000 1.0000 +vn -0.9264 0.0000 0.3766 +vn -1.0000 0.0000 -0.0000 +vn -0.6551 0.6551 0.3766 +vn -0.7071 0.7071 -0.0000 +vn -0.0000 0.9264 0.3766 +vn -0.0000 1.0000 -0.0000 +vn 0.6551 0.6551 0.3766 +vn 0.7071 0.7071 0.0000 +vn 0.9264 0.0000 0.3766 +vn 1.0000 0.0000 0.0000 +vn 0.6551 -0.6551 0.3766 +vn 0.7071 -0.7071 0.0000 +vn 0.0000 -0.9264 0.3766 +vn 0.0000 -1.0000 0.0000 +vn -0.6551 -0.6551 0.3766 +vn -0.7071 -0.7071 -0.0000 +vn -0.1961 0.9806 -0.0000 +vn 0.1961 0.9806 -0.0000 +vn -0.8666 -0.3466 -0.3590 +vn -0.3590 -0.3466 -0.8666 +vn 0.3590 -0.3466 -0.8666 +vn 0.8666 -0.3466 -0.3590 +vn 0.8666 -0.3466 0.3590 +vn 0.3590 -0.3466 0.8666 +vn -0.3590 -0.3466 0.8666 +vn -0.8666 -0.3466 0.3590 +vn 0.0000 -0.2588 -0.9659 +vn -0.9239 -0.3696 0.0990 +vn -0.3827 -0.8924 0.2391 +vn 0.0648 0.9639 -0.2583 +vn 0.3827 -0.8924 0.2391 +vn 0.9239 -0.3696 0.0990 +vn -0.0648 0.9639 -0.2583 +vn -0.9239 0.3696 -0.0990 +vn -0.3827 0.8924 -0.2391 +vn 0.3827 0.8924 -0.2391 +vn 0.9239 0.3696 -0.0990 +g Barrel_Cylinder.001_None +s off +f 18/1/1 2/2/1 4/3/1 19/4/1 +f 19/5/2 4/6/2 6/7/2 21/8/2 +f 21/9/3 6/10/3 8/11/3 23/12/3 +f 23/13/4 8/14/4 10/15/4 25/16/4 +f 25/17/5 10/18/5 12/19/5 27/20/5 +f 27/21/6 12/22/6 14/23/6 29/24/6 +f 4/25/7 2/26/7 16/27/7 14/28/7 12/29/7 10/30/7 8/31/7 6/32/7 +f 29/33/8 14/34/8 16/35/8 31/36/8 +f 31/37/9 16/38/9 2/39/9 18/40/9 +f 1/41/10 3/42/10 5/43/10 7/44/10 9/45/10 11/46/10 13/47/10 15/48/10 +f 15/49/11 32/50/11 17/51/11 1/52/11 +f 32/50/12 31/37/12 18/40/12 17/51/12 +f 13/53/13 30/54/13 32/55/13 15/56/13 +f 30/54/14 29/33/14 31/36/14 32/55/14 +f 11/57/15 28/58/15 30/59/15 13/60/15 +f 28/58/16 27/21/16 29/24/16 30/59/16 +f 9/61/17 26/62/17 28/63/17 11/64/17 +f 26/62/18 25/17/18 27/20/18 28/63/18 +f 7/65/19 24/66/19 26/67/19 9/68/19 +f 24/66/20 23/13/20 25/16/20 26/67/20 +f 5/69/21 22/70/21 24/71/21 7/72/21 +f 22/70/22 21/9/22 23/12/22 24/71/22 +f 3/73/23 20/74/23 22/75/23 5/76/23 +f 20/74/24 19/5/24 21/8/24 22/75/24 +f 1/77/25 17/78/25 20/79/25 3/80/25 +f 17/78/26 18/1/26 19/4/26 20/79/26 +f 37/81/10 35/82/10 36/83/10 38/84/10 +f 33/85/10 37/81/10 38/84/10 34/86/10 +f 43/87/7 44/88/7 42/89/7 41/90/7 +f 39/91/7 40/92/7 44/88/7 43/87/7 +f 35/82/27 37/81/27 43/87/27 41/90/27 +f 38/93/24 36/94/24 42/95/24 44/96/24 +f 37/81/28 33/85/28 39/91/28 43/87/28 +f 34/97/24 38/93/24 44/96/24 40/98/24 +f 36/99/12 35/82/12 41/90/12 42/100/12 +f 33/85/20 34/101/20 40/102/20 39/91/20 +f 49/103/10 47/104/10 48/105/10 50/106/10 +f 45/107/10 49/103/10 50/106/10 46/108/10 +f 55/109/7 56/110/7 54/111/7 53/112/7 +f 51/113/7 52/114/7 56/110/7 55/109/7 +f 47/104/27 49/103/27 55/109/27 53/112/27 +f 50/115/24 48/116/24 54/117/24 56/118/24 +f 49/103/28 45/107/28 51/113/28 55/109/28 +f 46/119/24 50/115/24 56/118/24 52/120/24 +f 48/121/12 47/104/12 53/112/12 54/122/12 +f 45/107/20 46/123/20 52/124/20 51/113/20 +f 57/125/29 58/126/29 60/127/29 59/128/29 +f 59/129/30 60/127/30 62/130/30 61/131/30 +f 61/132/31 62/130/31 64/133/31 63/134/31 +f 63/135/32 64/133/32 66/136/32 65/137/32 +f 65/138/33 66/136/33 68/139/33 67/140/33 +f 67/141/34 68/139/34 70/142/34 69/143/34 +f 60/127/16 58/126/16 72/144/16 70/142/16 68/139/16 66/136/16 64/133/16 62/130/16 +f 69/145/35 70/142/35 72/144/35 71/146/35 +f 71/147/36 72/144/36 58/126/36 57/148/36 +f 82/149/37 73/150/37 92/151/37 84/152/37 +f 75/153/38 76/154/38 78/155/38 77/156/38 +f 77/156/39 78/155/39 80/157/39 79/158/39 +f 75/159/40 90/160/40 89/161/40 76/154/40 +f 79/158/41 80/157/41 82/149/41 81/162/41 +f 80/157/37 85/163/37 73/150/37 82/149/37 +f 81/162/42 82/149/42 84/152/42 83/164/42 +f 84/152/43 92/151/43 91/165/43 83/166/43 +f 74/167/44 91/168/44 92/151/44 73/150/44 +f 86/169/45 74/167/45 73/150/45 85/163/45 +f 88/170/46 86/169/46 85/163/46 87/171/46 +f 78/155/37 87/171/37 85/163/37 80/157/37 +f 90/172/47 88/170/47 87/171/47 89/161/47 +f 76/154/37 89/161/37 87/171/37 78/155/37 diff --git a/mods/drinks/models/drinks_press.obj b/mods/drinks/models/drinks_press.obj new file mode 100644 index 00000000..4265ffc3 --- /dev/null +++ b/mods/drinks/models/drinks_press.obj @@ -0,0 +1,427 @@ +# Blender v2.78 (sub 0) OBJ File: 'drinks.blend' +# www.blender.org +o Press_Cube.001 +v 0.490000 -0.450000 0.030000 +v 0.490000 0.400000 0.030000 +v 0.490000 -0.450000 0.130000 +v 0.490000 0.400000 0.130000 +v 0.350000 -0.450000 0.030000 +v 0.350000 0.400000 0.030000 +v 0.350000 -0.450000 0.130000 +v 0.350000 0.400000 0.130000 +v -0.490000 -0.450000 0.130000 +v -0.490000 0.400000 0.130000 +v -0.490000 -0.450000 0.030000 +v -0.490000 0.400000 0.030000 +v -0.350000 -0.450000 0.130000 +v -0.350000 0.400000 0.130000 +v -0.350000 -0.450000 0.030000 +v -0.350000 0.400000 0.030000 +v 0.500000 0.370000 -0.000000 +v -0.500000 0.370000 -0.000000 +v 0.500000 0.370000 0.160000 +v -0.500000 0.370000 0.160000 +v 0.500000 0.230000 -0.000000 +v -0.500000 0.230000 -0.000000 +v 0.500000 0.230000 0.160000 +v -0.500000 0.230000 0.160000 +v -0.286937 0.050000 0.080000 +v -0.202895 0.050000 -0.122895 +v -0.330000 -0.450000 0.080000 +v -0.330000 0.050000 0.080000 +v -0.233345 -0.450000 -0.153345 +v -0.233345 0.050000 -0.153345 +v 0.000000 -0.450000 -0.250000 +v 0.000000 0.050000 -0.250000 +v 0.233345 -0.450000 -0.153345 +v 0.233345 0.050000 -0.153345 +v 0.330000 -0.450000 0.080000 +v 0.330000 0.050000 0.080000 +v 0.233345 -0.450000 0.313345 +v 0.233345 0.050000 0.313345 +v -0.000000 -0.450000 0.410000 +v -0.000000 0.050000 0.410000 +v -0.233345 -0.450000 0.313345 +v -0.233345 0.050000 0.313345 +v 0.000000 0.050000 -0.206937 +v 0.202895 0.050000 -0.122895 +v 0.286937 0.050000 0.080000 +v 0.202895 0.050000 0.282895 +v -0.000000 0.050000 0.366937 +v -0.202895 0.050000 0.282895 +v -0.286937 -0.033841 0.080000 +v -0.202895 -0.033841 0.282895 +v -0.000000 -0.033841 0.366937 +v 0.202895 -0.033841 0.282895 +v 0.286937 -0.033841 0.080000 +v 0.202895 -0.033841 -0.122895 +v 0.000000 -0.033841 -0.206937 +v -0.202895 -0.033841 -0.122895 +v 0.300000 -0.500000 0.400000 +v 0.400000 -0.500000 -0.400000 +v -0.300000 -0.500000 0.400000 +v -0.400000 -0.500000 -0.400000 +v -0.000000 -0.500000 0.500000 +v 0.500000 -0.500000 0.080000 +v 0.000000 -0.500000 -0.500000 +v -0.500000 -0.500000 0.080000 +v -0.000000 -0.500000 0.080000 +v 0.300000 -0.450000 0.400000 +v 0.400000 -0.450000 -0.400000 +v -0.300000 -0.450000 0.400000 +v -0.400000 -0.450000 -0.400000 +v -0.000000 -0.450000 0.500000 +v 0.500000 -0.450000 0.080000 +v 0.000000 -0.450000 -0.500000 +v -0.500000 -0.450000 0.080000 +v -0.000000 -0.450000 0.080000 +v -0.280783 0.000000 0.080000 +v -0.198544 0.000000 -0.118544 +v 0.000000 0.000000 -0.200783 +v 0.198544 0.000000 -0.118544 +v 0.280783 0.000000 0.080000 +v 0.198544 0.000000 0.278544 +v -0.000000 0.000000 0.360783 +v -0.198544 0.000000 0.278544 +v -0.241395 0.372715 -0.123119 +v 0.259946 0.372715 0.258765 +v -0.025000 -0.005792 0.080000 +v -0.025000 0.449165 0.080000 +v -0.017678 -0.005792 0.062322 +v -0.017678 0.449165 0.062322 +v -0.000000 -0.005792 0.055000 +v -0.000000 0.449165 0.055000 +v 0.017678 -0.005792 0.062322 +v 0.017678 0.449165 0.062322 +v 0.025000 -0.005792 0.080000 +v 0.025000 0.449165 0.080000 +v 0.017678 -0.005792 0.097678 +v 0.017678 0.449165 0.097678 +v -0.000000 -0.005792 0.105000 +v -0.000000 0.449165 0.105000 +v -0.017678 -0.005792 0.097678 +v -0.017678 0.449165 0.097678 +v 0.273063 0.394363 0.241544 +v -0.228277 0.394363 -0.140340 +v 0.273063 0.424977 0.241544 +v -0.228277 0.424978 -0.140340 +v 0.259946 0.446625 0.258765 +v -0.241395 0.446625 -0.123119 +v 0.241395 0.446625 0.283119 +v -0.259946 0.446625 -0.098765 +v 0.228277 0.424977 0.300340 +v -0.273063 0.424977 -0.081544 +v 0.228277 0.394363 0.300340 +v -0.273063 0.394363 -0.081544 +v 0.241395 0.372715 0.283119 +v -0.259946 0.372715 -0.098765 +vt 1.0000 0.8133 +vt 0.5747 0.8133 +vt 0.5747 0.7632 +vt 1.0000 0.7632 +vt 0.5747 0.6932 +vt 1.0000 0.6932 +vt 0.5747 0.6431 +vt 1.0000 0.6431 +vt 1.0000 0.8833 +vt 0.5747 0.8833 +vt 0.3063 0.3026 +vt 0.4945 0.0006 +vt 0.7460 0.2422 +vt 0.6556 0.5216 +vt 0.5246 0.8833 +vt 0.5246 0.8133 +vt 0.5246 0.8414 +vt 0.9500 0.8414 +vt 0.9500 0.8914 +vt 0.5246 0.8914 +vt 0.9500 0.9615 +vt 0.5246 0.9615 +vt 0.5246 0.7213 +vt 0.9500 0.7213 +vt 0.9500 0.7713 +vt 0.5246 0.7713 +vt 0.0533 0.1441 +vt 0.2265 0.0006 +vt 1.0000 0.8914 +vt 1.0000 0.9615 +vt 0.9472 0.7427 +vt 0.5705 0.7427 +vt 0.5705 0.6824 +vt 0.9472 0.6824 +vt 0.5705 0.6296 +vt 0.9472 0.6296 +vt 0.9472 0.8557 +vt 0.5705 0.8557 +vt 0.5705 0.7954 +vt 0.9472 0.7954 +vt 1.0000 0.8557 +vt 1.0000 0.7954 +vt 0.5177 0.8557 +vt 0.5177 0.7954 +vt 0.7652 0.5368 +vt 0.9836 0.5368 +vt 0.9836 0.6201 +vt 0.7652 0.6201 +vt 0.7488 0.4972 +vt 1.0000 0.4972 +vt 0.9836 0.5368 +vt 0.7652 0.5368 +vt 1.0000 0.0000 +vt 1.0000 0.4972 +vt 0.7488 0.4972 +vt 0.7488 0.0000 +vt 0.9836 0.6201 +vt 0.7652 0.6201 +vt 0.9836 0.5368 +vt 0.7652 0.5368 +vt 1.0000 0.0000 +vt 1.0000 0.4972 +vt 0.7488 0.4972 +vt 0.7488 0.0000 +vt 0.7652 0.5368 +vt 0.9836 0.5368 +vt 0.9836 0.6201 +vt 0.7652 0.6201 +vt 0.7488 0.4972 +vt 1.0000 0.4972 +vt 0.9836 0.5368 +vt 0.7652 0.5368 +vt 1.0000 0.0000 +vt 0.7488 0.0000 +vt 0.7652 0.5368 +vt 0.9836 0.5368 +vt 0.9836 0.6201 +vt 0.7652 0.6201 +vt 0.9836 0.5368 +vt 0.7652 0.5368 +vt 1.0000 0.0000 +vt 1.0000 0.4972 +vt 0.7488 0.4972 +vt 0.7488 0.0000 +vt 0.9836 0.6201 +vt 0.7652 0.6201 +vt 0.7488 0.4972 +vt 1.0000 0.4972 +vt 1.0000 0.0000 +vt 0.7488 0.0000 +vt 0.1181 0.6046 +vt 0.4448 0.7254 +vt 0.7488 0.4972 +vt 1.0000 0.4972 +vt 0.9836 0.5368 +vt 0.7652 0.5368 +vt 1.0000 0.0000 +vt 0.7488 0.0000 +vt 0.9836 0.6201 +vt 0.7652 0.6201 +vt 1.0000 0.0000 +vt 1.0000 0.4972 +vt 0.7488 0.4972 +vt 0.7488 0.0000 +vt 0.9836 0.6201 +vt 0.7652 0.6201 +vt 1.0000 0.0000 +vt 0.7488 0.0000 +vt 0.0006 0.3630 +vt 0.9836 0.6201 +vt 0.7652 0.6201 +vt 0.3057 0.3020 +vt 0.6550 0.5209 +vt 0.4442 0.7248 +vt 0.1174 0.6040 +vt 0.0527 0.1434 +vt 0.0000 0.3624 +vt 0.4939 0.0000 +vt 0.7453 0.2416 +vt 0.2259 0.0000 +vt 0.4840 0.9815 +vt 0.6645 0.9816 +vt 0.6645 1.0000 +vt 0.4840 0.9999 +vt 0.1389 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.9816 +vt 0.1389 0.9816 +vt 0.5106 1.0000 +vt 0.3717 1.0000 +vt 0.3717 0.9816 +vt 0.5106 0.9816 +vt 0.0000 0.9814 +vt 0.1805 0.9814 +vt 0.1805 0.9998 +vt 0.0000 0.9998 +vt 0.3323 0.9815 +vt 0.3322 0.9999 +vt 0.2553 1.0000 +vt 0.2553 0.9816 +vt 0.2489 0.4939 +vt 0.1374 0.3825 +vt 0.1374 0.2249 +vt 0.2489 0.1134 +vt 0.4065 0.1134 +vt 0.5180 0.2249 +vt 0.5180 0.3825 +vt 0.4065 0.4939 +vt 0.9532 0.8586 +vt 0.9418 0.8699 +vt 0.9258 0.8699 +vt 0.9145 0.8586 +vt 0.9145 0.8425 +vt 0.9258 0.8312 +vt 0.9418 0.8312 +vt 0.9532 0.8425 +vt 0.0160 0.8312 +vt 0.4121 0.8312 +vt 0.4121 0.8479 +vt 0.0160 0.8479 +vt 0.5843 0.8425 +vt 0.5843 0.8586 +vt 0.4121 0.8645 +vt 0.0160 0.8645 +vt 0.5843 0.9548 +vt 0.9145 0.9548 +vt 0.9145 0.9709 +vt 0.5843 0.9709 +vt 0.4121 0.8812 +vt 0.0160 0.8812 +vt 0.5843 0.9388 +vt 0.9145 0.9388 +vt 0.4121 0.8978 +vt 0.0160 0.8978 +vt 0.5569 0.8699 +vt 0.5456 0.8586 +vt 0.5456 0.8425 +vt 0.5569 0.8312 +vt 0.5730 0.8312 +vt 0.5730 0.8699 +vt 0.5843 0.9227 +vt 0.9145 0.9227 +vt 0.0160 0.7646 +vt 0.4121 0.7646 +vt 0.4121 0.7812 +vt 0.0160 0.7812 +vt 0.5843 0.8746 +vt 0.9145 0.8746 +vt 0.9145 0.8907 +vt 0.5843 0.8907 +vt 0.5843 0.9067 +vt 0.9145 0.9067 +vt 0.4121 0.7979 +vt 0.0160 0.7979 +vt 0.4523 0.7646 +vt 0.4523 0.7812 +vt 0.4405 0.7930 +vt 0.4239 0.7930 +vt 0.4239 0.7528 +vt 0.4405 0.7528 +vt 0.4121 0.8145 +vt 0.0160 0.8145 +vn 1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 0.0000 -1.0000 -0.0000 +vn 0.0000 1.0000 0.0000 +vn -0.9239 0.0000 0.3827 +vn -0.9239 0.0000 -0.3827 +vn -0.3827 0.0000 0.9239 +vn -0.3827 0.0000 -0.9239 +vn 0.3827 0.0000 -0.9239 +vn 0.9239 0.0000 -0.3827 +vn 0.3827 0.0000 0.9239 +vn 0.9239 0.0000 0.3827 +vn -0.9790 0.0000 -0.2040 +vn 0.8480 0.0000 0.5300 +vn -0.8480 0.0000 0.5300 +vn 0.9790 0.0000 -0.2040 +vn 0.2425 0.0000 -0.9701 +vn -0.3162 0.0000 0.9487 +vn -0.2425 0.0000 -0.9701 +vn 0.3162 0.0000 0.9487 +vn -0.7955 -0.0000 -0.6060 +vn -0.6060 -0.0000 0.7955 +vn -0.4285 0.7071 0.5625 +vn 0.7955 -0.0000 0.6060 +vn 0.4285 0.7071 -0.5625 +vn 0.6060 -0.0000 -0.7955 +vn 0.4285 -0.7071 -0.5625 +vn -0.4285 -0.7071 0.5625 +g Press_Cube.001_None +s off +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 3/4/2 4/3/2 8/5/2 7/6/2 +f 7/6/3 8/5/3 6/7/3 5/8/3 +f 5/9/4 6/10/4 2/2/4 1/1/4 +f 65/11/5 64/12/5 60/13/5 63/14/5 +f 8/15/6 4/16/6 2/2/6 6/10/6 +f 9/17/3 10/18/3 12/19/3 11/20/3 +f 11/20/4 12/19/4 16/21/4 15/22/4 +f 15/23/1 16/24/1 14/25/1 13/26/1 +f 13/26/2 14/25/2 10/18/2 9/17/2 +f 61/27/5 59/28/5 64/12/5 65/11/5 +f 16/21/6 12/19/6 10/29/6 14/30/6 +f 17/31/6 18/32/6 20/33/6 19/34/6 +f 19/34/2 20/33/2 24/35/2 23/36/2 +f 23/37/5 24/38/5 22/39/5 21/40/5 +f 21/40/4 22/39/4 18/32/4 17/31/4 +f 19/41/1 23/37/1 21/40/1 17/42/1 +f 24/38/3 20/43/3 18/44/3 22/39/3 +f 45/45/7 44/46/7 54/47/7 53/48/7 +f 34/49/6 32/50/6 43/51/6 44/52/6 +f 27/53/8 28/54/8 30/55/8 29/56/8 +f 44/52/9 43/51/9 55/57/9 54/58/9 +f 30/55/6 28/54/6 25/59/6 26/60/6 +f 29/61/10 30/62/10 32/63/10 31/64/10 +f 46/65/8 45/66/8 53/67/8 52/68/8 +f 40/69/6 38/70/6 46/71/6 47/72/6 +f 31/73/11 32/50/11 34/49/11 33/74/11 +f 48/75/11 47/76/11 51/77/11 50/78/11 +f 32/63/6 30/62/6 26/79/6 43/80/6 +f 33/81/12 34/82/12 36/83/12 35/84/12 +f 43/80/13 26/79/13 56/85/13 55/86/13 +f 38/87/6 36/88/6 45/66/6 46/65/6 +f 35/89/14 36/88/14 38/87/14 37/90/14 +f 62/91/5 65/11/5 63/14/5 58/92/5 +f 28/93/6 42/94/6 48/95/6 25/96/6 +f 37/97/13 38/70/13 40/69/13 39/98/13 +f 36/83/6 34/82/6 44/46/6 45/45/6 +f 47/72/10 46/71/10 52/99/10 51/100/10 +f 39/101/9 40/102/9 42/103/9 41/104/9 +f 26/60/14 25/59/14 49/105/14 56/106/14 +f 42/103/6 40/102/6 47/76/6 48/75/6 +f 41/107/7 42/94/7 28/93/7 27/108/7 +f 57/109/5 61/27/5 65/11/5 62/91/5 +f 25/96/12 48/95/12 50/110/12 49/111/12 +f 74/112/6 72/113/6 69/114/6 73/115/6 +f 70/116/6 74/112/6 73/115/6 68/117/6 +f 71/118/6 67/119/6 72/113/6 74/112/6 +f 66/120/6 71/118/6 74/112/6 70/116/6 +f 60/121/15 64/122/15 73/123/15 69/124/15 +f 57/125/16 62/126/16 71/127/16 66/128/16 +f 64/129/17 59/130/17 68/131/17 73/132/17 +f 62/133/18 58/134/18 67/135/18 71/136/18 +f 58/134/19 63/137/19 72/138/19 67/135/19 +f 59/130/20 61/139/20 70/140/20 68/131/20 +f 63/137/21 60/121/21 69/124/21 72/138/21 +f 61/139/22 57/125/22 66/128/22 70/140/22 +f 75/141/6 82/142/6 81/143/6 80/144/6 79/145/6 78/146/6 77/147/6 76/148/6 +f 102/149/23 83/150/23 114/151/23 112/152/23 110/153/23 108/154/23 106/155/23 104/156/23 +f 85/157/8 86/158/8 88/159/8 87/160/8 +f 109/161/24 110/153/24 112/152/24 111/162/24 +f 87/160/10 88/159/10 90/163/10 89/164/10 +f 107/165/25 108/166/25 110/167/25 109/168/25 +f 89/164/11 90/163/11 92/169/11 91/170/11 +f 105/171/6 106/172/6 108/166/6 107/165/6 +f 91/170/12 92/169/12 94/173/12 93/174/12 +f 84/175/26 101/176/26 103/177/26 105/178/26 107/179/26 109/161/26 111/162/26 113/180/26 +f 103/181/27 104/182/27 106/172/27 105/171/27 +f 93/183/14 94/184/14 96/185/14 95/186/14 +f 113/187/5 114/188/5 83/189/5 84/190/5 +f 101/191/28 102/192/28 104/182/28 103/181/28 +f 95/186/13 96/185/13 98/193/13 97/194/13 +f 88/195/6 86/196/6 100/197/6 98/198/6 96/185/6 94/184/6 92/199/6 90/200/6 +f 84/190/29 83/189/29 102/192/29 101/191/29 +f 97/194/9 98/193/9 100/201/9 99/202/9 +f 111/162/30 112/152/30 114/188/30 113/187/30 +f 99/202/7 100/201/7 86/158/7 85/157/7 diff --git a/mods/drinks/models/drinks_silo.obj b/mods/drinks/models/drinks_silo.obj new file mode 100644 index 00000000..d31e98b1 --- /dev/null +++ b/mods/drinks/models/drinks_silo.obj @@ -0,0 +1,449 @@ +# Blender v2.78 (sub 2) OBJ File: 'drinks.blend' +# www.blender.org +o Sphere_Sphere.001 +v 0.355973 -0.470000 -0.283179 +v 0.355973 0.000000 -0.283179 +v 0.285262 -0.470000 -0.353890 +v 0.285262 0.000000 -0.353890 +v 0.426684 -0.470000 -0.353890 +v 0.426684 0.000000 -0.353890 +v 0.355973 -0.470000 -0.424601 +v 0.355973 0.000000 -0.424601 +v 0.256978 -0.480000 -0.353890 +v 0.355973 -0.480000 -0.254895 +v 0.355973 -0.480000 -0.452885 +v 0.454968 -0.480000 -0.353890 +v 0.256978 -0.500000 -0.353890 +v 0.355973 -0.500000 -0.254895 +v 0.355973 -0.500000 -0.452885 +v 0.454968 -0.500000 -0.353890 +v 0.355973 0.030000 -0.283179 +v 0.285262 0.030000 -0.353890 +v 0.296242 0.036360 -0.364870 +v 0.366953 0.036360 -0.294159 +v -0.285262 -0.470000 -0.353890 +v -0.285262 0.000000 -0.353890 +v -0.355973 -0.470000 -0.283179 +v -0.355973 0.000000 -0.283179 +v -0.355973 -0.470000 -0.424601 +v -0.355973 0.000000 -0.424601 +v -0.426684 -0.470000 -0.353890 +v -0.426684 0.000000 -0.353890 +v -0.355973 -0.480000 -0.254895 +v -0.256978 -0.480000 -0.353890 +v -0.454968 -0.480000 -0.353890 +v -0.355973 -0.480000 -0.452885 +v -0.355973 -0.500000 -0.254895 +v -0.256978 -0.500000 -0.353890 +v -0.454968 -0.500000 -0.353890 +v -0.355973 -0.500000 -0.452885 +v -0.285262 0.030000 -0.353890 +v -0.355973 0.030000 -0.283179 +v -0.366953 0.036360 -0.294159 +v -0.296242 0.036360 -0.364870 +v 0.285262 -0.470000 0.358056 +v 0.285262 0.000000 0.358056 +v 0.355973 -0.470000 0.287346 +v 0.355973 0.000000 0.287346 +v 0.355973 -0.470000 0.428767 +v 0.355973 0.000000 0.428767 +v 0.426684 -0.470000 0.358056 +v 0.426684 0.000000 0.358056 +v 0.355973 -0.480000 0.259061 +v 0.256978 -0.480000 0.358056 +v 0.454968 -0.480000 0.358056 +v 0.355973 -0.480000 0.457051 +v 0.355973 -0.500000 0.259061 +v 0.256978 -0.500000 0.358056 +v 0.454968 -0.500000 0.358056 +v 0.355973 -0.500000 0.457051 +v 0.285262 0.030000 0.358056 +v 0.355973 0.030000 0.287346 +v 0.366953 0.036360 0.298326 +v 0.296242 0.036360 0.369036 +v -0.355973 -0.470000 0.287346 +v -0.355973 0.000000 0.287346 +v -0.285263 -0.470000 0.358056 +v -0.285263 0.000000 0.358056 +v -0.426684 -0.470000 0.358056 +v -0.426684 0.000000 0.358056 +v -0.355973 -0.470000 0.428767 +v -0.355973 0.000000 0.428767 +v -0.256978 -0.480000 0.358056 +v -0.355973 -0.480000 0.259061 +v -0.355973 -0.480000 0.457051 +v -0.454968 -0.480000 0.358056 +v -0.256978 -0.500000 0.358056 +v -0.355973 -0.500000 0.259061 +v -0.355973 -0.500000 0.457051 +v -0.454968 -0.500000 0.358056 +v -0.355973 0.030000 0.287346 +v -0.285263 0.030000 0.358056 +v -0.296242 0.036360 0.369036 +v -0.366953 0.036360 0.298326 +v 0.298674 1.404509 -0.123715 +v 0.483264 -0.154509 -0.200174 +v 0.000000 -0.350000 0.000000 +v 0.298674 1.404509 0.123715 +v 0.483264 1.154508 0.200174 +v 0.483264 -0.154509 0.200174 +v 0.298674 -0.304509 0.123715 +v 0.123715 1.404509 0.298674 +v 0.200175 1.154508 0.483264 +v 0.200175 -0.154509 0.483264 +v 0.123715 -0.304509 0.298674 +v -0.123715 1.404509 0.298674 +v -0.200174 1.154508 0.483264 +v -0.200174 -0.154509 0.483264 +v -0.123715 -0.304509 0.298674 +v -0.298674 1.404509 0.123715 +v -0.483264 1.154508 0.200175 +v -0.483264 -0.154509 0.200175 +v -0.298673 -0.304509 0.123715 +v -0.000000 1.500000 0.000000 +v -0.298674 1.404509 -0.123715 +v -0.483264 1.154508 -0.200174 +v -0.483264 -0.154509 -0.200174 +v -0.298673 -0.304509 -0.123715 +v -0.123715 1.404509 -0.298674 +v -0.200174 1.154508 -0.483264 +v -0.200174 -0.154509 -0.483264 +v -0.123715 -0.304509 -0.298673 +v 0.123715 1.404509 -0.298674 +v 0.200175 1.154508 -0.483264 +v 0.200175 -0.154509 -0.483264 +v 0.123715 -0.304509 -0.298673 +v 0.483264 1.154508 -0.200174 +v 0.298673 -0.304509 -0.123715 +vt 1.000000 0.008414 +vt 0.978921 0.399028 +vt 0.894297 0.383031 +vt 0.916891 0.003929 +vt 0.822710 0.352283 +vt 0.834561 0.000001 +vt 0.760707 0.354848 +vt 0.739397 0.000000 +vt 0.689594 0.414136 +vt 0.642691 0.007416 +vt 0.756477 0.490620 +vt 0.709526 0.588101 +vt 0.670960 0.596854 +vt 0.740550 0.468871 +vt 0.849070 0.402909 +vt 0.749567 0.419582 +vt 0.853240 0.441198 +vt 0.727002 0.453325 +vt 0.854930 0.419425 +vt 0.924304 0.516307 +vt 0.847709 0.465468 +vt 0.944476 0.505392 +vt 0.932660 0.620289 +vt 0.957582 0.639217 +vt 0.963235 0.492572 +vt 0.982975 0.636506 +vt 0.651986 0.586137 +vt 0.974085 0.425479 +vt 0.885915 0.409359 +vt 0.712088 0.441124 +vt 1.000000 0.008414 +vt 0.978921 0.399028 +vt 0.894297 0.383031 +vt 0.916891 0.003929 +vt 0.822710 0.352283 +vt 0.834561 0.000001 +vt 0.760707 0.354848 +vt 0.739397 0.000000 +vt 0.689594 0.414136 +vt 0.642691 0.007416 +vt 0.756477 0.490620 +vt 0.709526 0.588101 +vt 0.670960 0.596854 +vt 0.740550 0.468871 +vt 0.849070 0.402909 +vt 0.749567 0.419582 +vt 0.853240 0.441198 +vt 0.727002 0.453325 +vt 0.854930 0.419425 +vt 0.924304 0.516307 +vt 0.847709 0.465468 +vt 0.944476 0.505392 +vt 0.932660 0.620289 +vt 0.957582 0.639217 +vt 0.963235 0.492572 +vt 0.982975 0.636506 +vt 0.651986 0.586137 +vt 0.974085 0.425479 +vt 0.885915 0.409359 +vt 0.712088 0.441124 +vt 1.000000 0.008414 +vt 0.978921 0.399028 +vt 0.894297 0.383031 +vt 0.916891 0.003929 +vt 0.822710 0.352283 +vt 0.834561 0.000001 +vt 0.760707 0.354848 +vt 0.739397 0.000000 +vt 0.689594 0.414136 +vt 0.642691 0.007416 +vt 0.756477 0.490620 +vt 0.709526 0.588101 +vt 0.670960 0.596854 +vt 0.740550 0.468871 +vt 0.849070 0.402909 +vt 0.749567 0.419582 +vt 0.853240 0.441198 +vt 0.727002 0.453325 +vt 0.854930 0.419425 +vt 0.924304 0.516307 +vt 0.847709 0.465468 +vt 0.944476 0.505392 +vt 0.932660 0.620289 +vt 0.957582 0.639217 +vt 0.963235 0.492572 +vt 0.982975 0.636506 +vt 0.651986 0.586137 +vt 0.974085 0.425479 +vt 0.885915 0.409359 +vt 0.712088 0.441124 +vt 1.000000 0.008414 +vt 0.978921 0.399028 +vt 0.894297 0.383031 +vt 0.916891 0.003929 +vt 0.822710 0.352283 +vt 0.834561 0.000001 +vt 0.760707 0.354848 +vt 0.739397 0.000000 +vt 0.689594 0.414136 +vt 0.642691 0.007416 +vt 0.756477 0.490620 +vt 0.709526 0.588101 +vt 0.670960 0.596854 +vt 0.740550 0.468871 +vt 0.849070 0.402909 +vt 0.749567 0.419582 +vt 0.853240 0.441198 +vt 0.727002 0.453325 +vt 0.854930 0.419425 +vt 0.924304 0.516307 +vt 0.847709 0.465468 +vt 0.944476 0.505392 +vt 0.932660 0.620289 +vt 0.957582 0.639217 +vt 0.963235 0.492572 +vt 0.982975 0.636506 +vt 0.651986 0.586137 +vt 0.974085 0.425479 +vt 0.885915 0.409359 +vt 0.712088 0.441124 +vt 0.350770 0.992591 +vt 0.308827 0.883889 +vt 0.384778 0.836945 +vt 0.470279 0.909152 +vt 0.776139 0.791890 +vt 0.748838 0.668985 +vt 0.838661 0.688066 +vt 0.613361 0.001953 +vt 0.613361 0.501732 +vt 0.460509 0.501732 +vt 0.460509 0.001953 +vt 0.293637 0.753973 +vt 0.741714 0.572150 +vt 0.892517 0.611056 +vt 0.980498 0.736300 +vt 0.891124 0.758070 +vt 0.414908 0.760781 +vt 0.526265 0.770946 +vt 0.307657 0.501732 +vt 0.307657 0.001953 +vt 0.963601 0.886471 +vt 0.883457 0.843656 +vt 0.392837 0.683662 +vt 0.488453 0.624099 +vt 0.154805 0.501732 +vt 0.154805 0.001953 +vt 0.851929 0.986328 +vt 0.821052 0.901634 +vt 0.327901 0.636527 +vt 0.367274 0.529625 +vt 0.001953 0.501732 +vt 0.001953 0.001953 +vt 0.703139 0.986328 +vt 0.736320 0.903076 +vt 0.246988 0.639780 +vt 0.211521 0.529625 +vt 0.613472 0.002064 +vt 0.613472 0.501843 +vt 0.460620 0.501842 +vt 0.460620 0.002064 +vt 0.592690 0.888063 +vt 0.672296 0.847742 +vt 0.184525 0.693546 +vt 0.086511 0.626896 +vt 0.307768 0.501842 +vt 0.307768 0.002064 +vt 0.574219 0.742591 +vt 0.660933 0.763134 +vt 0.168400 0.777459 +vt 0.045236 0.783554 +vt 0.154916 0.501842 +vt 0.154916 0.002064 +vt 0.651237 0.619072 +vt 0.709912 0.688420 +vt 0.209836 0.861318 +vt 0.104223 0.939033 +vt 0.002064 0.501842 +vt 0.002064 0.002064 +vn -0.7071 0.0000 0.7071 +vn -0.7071 0.0000 -0.7071 +vn 0.7071 0.0000 -0.7071 +vn 0.7071 0.0000 0.7071 +vn 0.3162 0.8944 0.3162 +vn 0.2796 0.9185 -0.2796 +vn -0.3162 0.8944 -0.3162 +vn -0.3162 0.8944 0.3162 +vn 0.3162 0.8944 -0.3162 +vn -0.2796 0.9185 -0.2796 +vn 0.2796 0.9185 0.2796 +vn -0.2796 0.9185 0.2796 +vn 0.8045 0.5940 0.0000 +vn 0.1506 -0.9886 0.0000 +vn 1.0000 0.0000 -0.0000 +vn 0.3045 0.9525 0.0000 +vn 0.6306 -0.7761 -0.0000 +vn 0.4459 -0.7761 0.4459 +vn 0.5688 0.5940 0.5688 +vn 0.1065 -0.9886 0.1065 +vn 0.2153 0.9525 0.2153 +vn 0.0000 -0.7761 0.6306 +vn 0.0000 0.5940 0.8045 +vn 0.0000 -0.9886 0.1506 +vn 0.0000 -0.0000 1.0000 +vn 0.0000 0.9525 0.3045 +vn -0.4459 -0.7761 0.4459 +vn -0.5688 0.5940 0.5688 +vn -0.1065 -0.9886 0.1065 +vn -0.2153 0.9525 0.2153 +vn -0.6306 -0.7761 0.0000 +vn -0.8045 0.5940 0.0000 +vn -0.1506 -0.9886 0.0000 +vn -1.0000 0.0000 0.0000 +vn -0.3045 0.9525 0.0000 +vn -0.4459 -0.7761 -0.4459 +vn -0.5688 0.5940 -0.5688 +vn -0.1065 -0.9886 -0.1065 +vn -0.2153 0.9525 -0.2153 +vn -0.0000 -0.7761 -0.6306 +vn -0.0000 0.5940 -0.8045 +vn -0.0000 -0.9886 -0.1506 +vn -0.0000 0.0000 -1.0000 +vn -0.0000 0.9525 -0.3045 +vn 0.4459 -0.7761 -0.4459 +vn 0.5688 0.5940 -0.5688 +vn 0.1065 -0.9886 -0.1065 +vn 0.2153 0.9525 -0.2153 +g Sphere_Sphere.001_None +s off +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 3/4/2 4/3/2 8/5/2 7/6/2 +f 7/6/3 8/5/3 6/7/3 5/8/3 +f 5/8/4 6/7/4 2/9/4 1/10/4 +f 5/11/5 1/12/5 10/13/5 12/14/5 +f 6/7/6 8/5/6 19/15/6 20/16/6 +f 11/17/3 12/14/3 16/18/3 15/19/3 +f 3/20/7 7/21/7 11/17/7 9/22/7 +f 1/23/8 3/20/8 9/22/8 10/24/8 +f 7/21/9 5/11/9 12/14/9 11/17/9 +f 10/24/1 9/22/1 13/25/1 14/26/1 +f 12/14/4 10/13/4 14/27/4 16/18/4 +f 9/22/2 11/17/2 15/19/2 13/25/2 +f 4/3/1 2/2/1 17/28/1 18/29/1 +f 2/9/4 6/7/4 20/16/4 17/30/4 +f 8/5/2 4/3/2 18/29/2 19/15/2 +f 21/31/4 22/32/4 24/33/4 23/34/4 +f 23/34/1 24/33/1 28/35/1 27/36/1 +f 27/36/2 28/35/2 26/37/2 25/38/2 +f 25/38/3 26/37/3 22/39/3 21/40/3 +f 25/41/9 21/42/9 30/43/9 32/44/9 +f 26/37/10 28/35/10 39/45/10 40/46/10 +f 31/47/2 32/44/2 36/48/2 35/49/2 +f 23/50/8 27/51/8 31/47/8 29/52/8 +f 21/53/5 23/50/5 29/52/5 30/54/5 +f 27/51/7 25/41/7 32/44/7 31/47/7 +f 30/54/4 29/52/4 33/55/4 34/56/4 +f 32/44/3 30/43/3 34/57/3 36/48/3 +f 29/52/1 31/47/1 35/49/1 33/55/1 +f 24/33/4 22/32/4 37/58/4 38/59/4 +f 22/39/3 26/37/3 40/46/3 37/60/3 +f 28/35/1 24/33/1 38/59/1 39/45/1 +f 41/61/2 42/62/2 44/63/2 43/64/2 +f 43/64/3 44/63/3 48/65/3 47/66/3 +f 47/66/4 48/65/4 46/67/4 45/68/4 +f 45/68/1 46/67/1 42/69/1 41/70/1 +f 45/71/8 41/72/8 50/73/8 52/74/8 +f 46/67/11 48/65/11 59/75/11 60/76/11 +f 51/77/4 52/74/4 56/78/4 55/79/4 +f 43/80/9 47/81/9 51/77/9 49/82/9 +f 41/83/7 43/80/7 49/82/7 50/84/7 +f 47/81/5 45/71/5 52/74/5 51/77/5 +f 50/84/2 49/82/2 53/85/2 54/86/2 +f 52/74/1 50/73/1 54/87/1 56/78/1 +f 49/82/3 51/77/3 55/79/3 53/85/3 +f 44/63/2 42/62/2 57/88/2 58/89/2 +f 42/69/1 46/67/1 60/76/1 57/90/1 +f 48/65/3 44/63/3 58/89/3 59/75/3 +f 61/91/3 62/92/3 64/93/3 63/94/3 +f 63/94/4 64/93/4 68/95/4 67/96/4 +f 67/96/1 68/95/1 66/97/1 65/98/1 +f 65/98/2 66/97/2 62/99/2 61/100/2 +f 65/101/7 61/102/7 70/103/7 72/104/7 +f 66/97/12 68/95/12 79/105/12 80/106/12 +f 71/107/1 72/104/1 76/108/1 75/109/1 +f 63/110/5 67/111/5 71/107/5 69/112/5 +f 61/113/9 63/110/9 69/112/9 70/114/9 +f 67/111/8 65/101/8 72/104/8 71/107/8 +f 70/114/3 69/112/3 73/115/3 74/116/3 +f 72/104/2 70/103/2 74/117/2 76/108/2 +f 69/112/4 71/107/4 75/109/4 73/115/4 +f 64/93/3 62/92/3 77/118/3 78/119/3 +f 62/99/2 66/97/2 80/106/2 77/120/2 +f 68/95/4 64/93/4 78/119/4 79/105/4 +f 113/121/13 81/122/13 84/123/13 85/124/13 +f 83/125/14 114/126/14 87/127/14 +f 82/128/15 113/129/15 85/130/15 86/131/15 +f 81/122/16 100/132/16 84/123/16 +f 114/126/17 82/133/17 86/134/17 87/127/17 +f 87/127/18 86/134/18 90/135/18 91/136/18 +f 85/124/19 84/123/19 88/137/19 89/138/19 +f 83/125/20 87/127/20 91/136/20 +f 86/131/4 85/130/4 89/139/4 90/140/4 +f 84/123/21 100/132/21 88/137/21 +f 91/136/22 90/135/22 94/141/22 95/142/22 +f 89/138/23 88/137/23 92/143/23 93/144/23 +f 83/125/24 91/136/24 95/142/24 +f 90/140/25 89/139/25 93/145/25 94/146/25 +f 88/137/26 100/132/26 92/143/26 +f 95/142/27 94/141/27 98/147/27 99/148/27 +f 93/144/28 92/143/28 96/149/28 97/150/28 +f 83/125/29 95/142/29 99/148/29 +f 94/146/1 93/145/1 97/151/1 98/152/1 +f 92/143/30 100/132/30 96/149/30 +f 99/148/31 98/147/31 103/153/31 104/154/31 +f 97/150/32 96/149/32 101/155/32 102/156/32 +f 83/125/33 99/148/33 104/154/33 +f 98/157/34 97/158/34 102/159/34 103/160/34 +f 96/149/35 100/132/35 101/155/35 +f 104/154/36 103/153/36 107/161/36 108/162/36 +f 102/156/37 101/155/37 105/163/37 106/164/37 +f 83/125/38 104/154/38 108/162/38 +f 103/160/2 102/159/2 106/165/2 107/166/2 +f 101/155/39 100/132/39 105/163/39 +f 108/162/40 107/161/40 111/167/40 112/168/40 +f 106/164/41 105/163/41 109/169/41 110/170/41 +f 83/125/42 108/162/42 112/168/42 +f 107/166/43 106/165/43 110/171/43 111/172/43 +f 105/163/44 100/132/44 109/169/44 +f 112/168/45 111/167/45 82/173/45 114/174/45 +f 110/170/46 109/169/46 81/175/46 113/176/46 +f 83/125/47 112/168/47 114/174/47 +f 111/172/3 110/171/3 113/177/3 82/178/3 +f 109/169/48 100/132/48 81/175/48 diff --git a/mods/drinks/readme.md b/mods/drinks/readme.md new file mode 100644 index 00000000..d3b0c689 --- /dev/null +++ b/mods/drinks/readme.md @@ -0,0 +1,3 @@ +This mod aims to add more drinks to the world, and be easily expanded to support other mods that have fruits and veggies. + +There is optional support for the thirsty mod, if you have it installed drinking juices will fill your hydration. diff --git a/mods/drinks/screenshot.png b/mods/drinks/screenshot.png new file mode 100644 index 00000000..32633d39 Binary files /dev/null and b/mods/drinks/screenshot.png differ diff --git a/mods/drinks/textures/drinks_barrel.png b/mods/drinks/textures/drinks_barrel.png new file mode 100644 index 00000000..bb1ed318 Binary files /dev/null and b/mods/drinks/textures/drinks_barrel.png differ diff --git a/mods/drinks/textures/drinks_barrel_hi.png b/mods/drinks/textures/drinks_barrel_hi.png new file mode 100644 index 00000000..09b6412f Binary files /dev/null and b/mods/drinks/textures/drinks_barrel_hi.png differ diff --git a/mods/drinks/textures/drinks_bottle_contents.png b/mods/drinks/textures/drinks_bottle_contents.png new file mode 100644 index 00000000..8456e9f7 Binary files /dev/null and b/mods/drinks/textures/drinks_bottle_contents.png differ diff --git a/mods/drinks/textures/drinks_bucket_contents.png b/mods/drinks/textures/drinks_bucket_contents.png new file mode 100644 index 00000000..badf5947 Binary files /dev/null and b/mods/drinks/textures/drinks_bucket_contents.png differ diff --git a/mods/drinks/textures/drinks_drinking_glass.png b/mods/drinks/textures/drinks_drinking_glass.png new file mode 100644 index 00000000..8a722add Binary files /dev/null and b/mods/drinks/textures/drinks_drinking_glass.png differ diff --git a/mods/drinks/textures/drinks_glass_bottle.png b/mods/drinks/textures/drinks_glass_bottle.png new file mode 100644 index 00000000..c4654d0f Binary files /dev/null and b/mods/drinks/textures/drinks_glass_bottle.png differ diff --git a/mods/drinks/textures/drinks_glass_contents.png b/mods/drinks/textures/drinks_glass_contents.png new file mode 100644 index 00000000..24902027 Binary files /dev/null and b/mods/drinks/textures/drinks_glass_contents.png differ diff --git a/mods/drinks/textures/drinks_press.png b/mods/drinks/textures/drinks_press.png new file mode 100644 index 00000000..65d831b1 Binary files /dev/null and b/mods/drinks/textures/drinks_press.png differ diff --git a/mods/drinks/textures/drinks_press_hi.png b/mods/drinks/textures/drinks_press_hi.png new file mode 100644 index 00000000..4fe609b5 Binary files /dev/null and b/mods/drinks/textures/drinks_press_hi.png differ diff --git a/mods/drinks/textures/drinks_silo.png b/mods/drinks/textures/drinks_silo.png new file mode 100644 index 00000000..24965fef Binary files /dev/null and b/mods/drinks/textures/drinks_silo.png differ diff --git a/mods/drinks/textures/drinks_silo_hi.png b/mods/drinks/textures/drinks_silo_hi.png new file mode 100644 index 00000000..c8513d3b Binary files /dev/null and b/mods/drinks/textures/drinks_silo_hi.png differ diff --git a/mods/enchanting/.luacheckrc b/mods/enchanting/.luacheckrc new file mode 100644 index 00000000..a21bce1f --- /dev/null +++ b/mods/enchanting/.luacheckrc @@ -0,0 +1,7 @@ +unused_args = false +allow_defined_top = true + +read_globals = { + "minetest", + "default", +} diff --git a/mods/enchanting/LICENSE b/mods/enchanting/LICENSE new file mode 100644 index 00000000..c36855e0 --- /dev/null +++ b/mods/enchanting/LICENSE @@ -0,0 +1,685 @@ ++----------------------------------------------------------------------+ +| Copyright (c) 2015-2016 kilbith | +| | +| Code: GPL version 3 | +| Textures: WTFPL (credits: Gambit) | +| Sounds: | +| - xdecor_enchanting.ogg - by Timbre - CC BY-SA-NC | +| freesound.org/people/Timbre/sounds/221683/ | ++----------------------------------------------------------------------+ + + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/mods/enchanting/README.md b/mods/enchanting/README.md new file mode 100644 index 00000000..f373b3bb --- /dev/null +++ b/mods/enchanting/README.md @@ -0,0 +1,9 @@ +## Enchanting ## + +##### A mod adding a Minecraft-inspired Enchantment Table to Minetest. ##### +##### 3 enchants are proposed for the default tools, and 2 enchants for the armors from [3d_armor](https://github.com/stujones11/minetest-3d_armor). ##### + +##### This mod is originating from [X-Decor](https://github.com/kilbith/xdecor). ##### + +![Preview](https://lut.im/oWfKNfxAA4/n9jqwFpJOdUdo8yT.png) +![Preview2](http://i.imgur.com/X9MkQzV.png) diff --git a/mods/enchanting/depends.txt b/mods/enchanting/depends.txt new file mode 100644 index 00000000..452e8057 --- /dev/null +++ b/mods/enchanting/depends.txt @@ -0,0 +1,3 @@ +default +3d_armor? +xdecor? diff --git a/mods/enchanting/description.txt b/mods/enchanting/description.txt new file mode 100644 index 00000000..84da8b8b --- /dev/null +++ b/mods/enchanting/description.txt @@ -0,0 +1 @@ +A mod adding a Minecraft-inspired Enchantment Table to Minetest. diff --git a/mods/enchanting/init.lua b/mods/enchanting/init.lua new file mode 100644 index 00000000..8a30b22f --- /dev/null +++ b/mods/enchanting/init.lua @@ -0,0 +1,331 @@ +screwdriver = screwdriver or {} +local ceil, abs, random = math.ceil, math.abs, math.random + +-- Cost in Mese crystal(s) for enchanting. +local mese_cost = 1 + +-- Force of the enchantments. +local enchanting = { + uses = 1.2, -- Durability + times = 0.1, -- Efficiency + damages = 1, -- Sharpness + strength = 1.2, -- Armor strength (3d_armor only) + speed = 0.2, -- Player speed (3d_armor only) + jump = 0.2 -- Player jumping (3d_armor only) +} + +local function cap(S) return S:gsub("^%l", string.upper) end +local function to_percent(orig_value, final_value) + return abs(ceil(((final_value - orig_value) / orig_value) * 100)) +end + +function enchanting:get_tooltip(enchant, orig_caps, fleshy) + local bonus = {durable=0, efficiency=0, damages=0} + if orig_caps then + bonus.durable = to_percent(orig_caps.uses, orig_caps.uses * enchanting.uses) + local sum_caps_times = 0 + for i=1, #orig_caps.times do + sum_caps_times = sum_caps_times + orig_caps.times[i] + end + local average_caps_time = sum_caps_times / #orig_caps.times + bonus.efficiency = to_percent(average_caps_time, average_caps_time - enchanting.times) + end + if fleshy then + bonus.damages = to_percent(fleshy, fleshy + enchanting.damages) + end + + local specs = { -- not finished, to complete + durable = {"#00baff", " (+"..bonus.durable.."%)"}, + fast = {"#74ff49", " (+"..bonus.efficiency.."%)"}, + sharp = {"#ffff00", " (+"..bonus.damages.."%)"}, + strong = {"#ff3d3d", ""}, + speed = {"#fd5eff", ""} + } + return minetest.colorize and + minetest.colorize(specs[enchant][1], + "\n"..cap(enchant)..specs[enchant][2]) or + "\n"..cap(enchant)..specs[enchant][2] +end + + +function enchanting.formspec(pos, num) + local meta = minetest.get_meta(pos) + local formspec = [[ size[9,9;] + bgcolor[#080808BB;true] + background[0,0;9,9;ench_ui.png] + list[context;tool;0.9,2.9;1,1;] + list[context;mese;2,2.9;1,1;] + list[current_player;main;0.5,4.5;8,4;] + image[2,2.9;1,1;mese_layout.png] + tooltip[sharp;Your weapon inflicts more damages] + tooltip[durable;Your tool last longer] + tooltip[fast;Your tool digs faster] + tooltip[strong;Your armor is more resistant] + tooltip[speed;Your speed is increased] ]] + ..default.gui_slots..default.get_hotbar_bg(0.5,4.5) + + local enchant_buttons = { + [[ image_button[3.9,0.85;4,0.92;bg_btn.png;fast;Efficiency] + image_button[3.9,1.77;4,1.12;bg_btn.png;durable;Durability] ]], + "image_button[3.9,0.85;4,0.92;bg_btn.png;strong;Strength]", + "image_button[3.9,2.9;4,0.92;bg_btn.png;sharp;Sharpness]", + [[ image_button[3.9,0.85;4,0.92;bg_btn.png;strong;Strength] + image_button[3.9,1.77;4,1.12;bg_btn.png;speed;Speed] ]] + } + + formspec = formspec..(enchant_buttons[num] or "") + meta:set_string("formspec", formspec) +end + +function enchanting.on_put(pos, listname, _, stack) + if listname == "tool" then + local stackname = stack:get_name() + local tool_groups = { + "axe, pick, shovel", + "chestplate, leggings, helmet", + "sword", "boots" + } + + for idx, tools in pairs(tool_groups) do + if tools:find(stackname:match(":(%w+)")) then + enchanting.formspec(pos, idx) + end + end + end +end + +function enchanting.fields(pos, _, fields, sender) + if not next(fields) or fields.quit then + return + end + local inv = minetest.get_meta(pos):get_inventory() + local tool = inv:get_stack("tool", 1) + local mese = inv:get_stack("mese", 1) + local orig_wear = tool:get_wear() + local mod, name = tool:get_name():match("(.*):(.*)") + local enchanted_tool = (mod or "")..":enchanted_"..(name or "").."_"..next(fields) + + if mese:get_count() >= mese_cost and minetest.registered_tools[enchanted_tool] then + minetest.sound_play("xdecor_enchanting", {to_player=sender:get_player_name(), gain=0.8}) + tool:replace(enchanted_tool) + tool:add_wear(orig_wear) + mese:take_item(mese_cost) + inv:set_stack("mese", 1, mese) + inv:set_stack("tool", 1, tool) + end +end + +function enchanting.dig(pos) + local inv = minetest.get_meta(pos):get_inventory() + return inv:is_empty("tool") and inv:is_empty("mese") +end + +local function allowed(tool) + if not tool then return false end + for item in pairs(minetest.registered_tools) do + if item:find("enchanted_"..tool) then return true end + end + return false +end + +function enchanting.put(_, listname, _, stack) + local item = stack:get_name():match("[^:]+$") + if listname == "mese" and item == "mese_crystal" then + return stack:get_count() + elseif listname == "tool" and allowed(item) then + return 1 + end + return 0 +end + +function enchanting.on_take(pos, listname) + if listname == "tool" then enchanting.formspec(pos, nil) end +end + +function enchanting.construct(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Enchantment Table") + enchanting.formspec(pos, nil) + + local inv = meta:get_inventory() + inv:set_size("tool", 1) + inv:set_size("mese", 1) + + minetest.add_entity({x=pos.x, y=pos.y+0.85, z=pos.z}, "xdecor:book_open") + local timer = minetest.get_node_timer(pos) + timer:start(5.0) +end + +function enchanting.destruct(pos) + for _, obj in pairs(minetest.get_objects_inside_radius(pos, 0.9)) do + if obj and obj:get_luaentity() and + obj:get_luaentity().name == "xdecor:book_open" then + obj:remove() break + end + end +end + +function enchanting.timer(pos) + local num = #minetest.get_objects_inside_radius(pos, 0.9) + if num == 0 then + minetest.add_entity({x=pos.x, y=pos.y+0.85, z=pos.z}, "xdecor:book_open") + end + + local minp = {x=pos.x-2, y=pos.y, z=pos.z-2} + local maxp = {x=pos.x+2, y=pos.y+1, z=pos.z+2} + local bookshelves = minetest.find_nodes_in_area(minp, maxp, "default:bookshelf") + if #bookshelves == 0 then return true end + + local bookshelf_pos = bookshelves[random(1, #bookshelves)] + local x = pos.x - bookshelf_pos.x + local y = bookshelf_pos.y - pos.y + local z = pos.z - bookshelf_pos.z + + if tostring(x..z):find(2) then + minetest.add_particle({ + pos = bookshelf_pos, + velocity = {x=x, y=2-y, z=z}, + acceleration = {x=0, y=-2.2, z=0}, + expirationtime = 1, + size = 2, + texture = "xdecor_glyph"..random(1,18)..".png" + }) + end + return true +end + +minetest.register_node(":xdecor:enchantment_table", { + description = "Enchantment Table", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"enchtable_top.png", "enchtable_bottom.png", + "enchtable_side.png", "enchtable_side.png", + "enchtable_side.png", "enchtable_side.png"}, + groups = {cracky=1, level=1}, + sounds = default.node_sound_stone_defaults(), + on_rotate = screwdriver.rotate_simple, + can_dig = enchanting.dig, + on_timer = enchanting.timer, + on_construct = enchanting.construct, + on_destruct = enchanting.destruct, + on_receive_fields = enchanting.fields, + on_metadata_inventory_put = enchanting.on_put, + on_metadata_inventory_take = enchanting.on_take, + allow_metadata_inventory_put = enchanting.put, + allow_metadata_inventory_move = function() return 0 end +}) + +minetest.register_entity(":xdecor:book_open", { + visual = "sprite", + visual_size = {x=0.75, y=0.75}, + collisionbox = {0}, + physical = false, + textures = {"book_open.png"}, + on_activate = function(self) + local pos = self.object:getpos() + local pos_under = {x=pos.x, y=pos.y-1, z=pos.z} + + if minetest.get_node(pos_under).name ~= "xdecor:enchantment_table" then + self.object:remove() + end + end +}) + +minetest.register_craft({ + output = "xdecor:enchantment_table", + recipe = { + {"", "default:book", ""}, + {"default:diamond", "default:obsidian", "default:diamond"}, + {"default:obsidian", "default:obsidian", "default:obsidian"} + } +}) + +function enchanting:register_tools(mod, def) + for tool in pairs(def.tools) do + for material in def.materials:gmatch("[%w_]+") do + for enchant in def.tools[tool].enchants:gmatch("[%w_]+") do + local original_tool = minetest.registered_tools[mod..":"..tool.."_"..material] + if not original_tool then break end + + if original_tool.tool_capabilities then + local original_damage_groups = original_tool.tool_capabilities.damage_groups + local original_groupcaps = original_tool.tool_capabilities.groupcaps + local groupcaps = table.copy(original_groupcaps) + local fleshy = original_damage_groups.fleshy + local full_punch_interval = original_tool.tool_capabilities.full_punch_interval + local max_drop_level = original_tool.tool_capabilities.max_drop_level + local group = next(original_groupcaps) + + if enchant == "durable" then + groupcaps[group].uses = ceil(original_groupcaps[group].uses * enchanting.uses) + elseif enchant == "fast" then + for i, time in pairs(original_groupcaps[group].times) do + groupcaps[group].times[i] = time - enchanting.times + end + elseif enchant == "sharp" then + fleshy = fleshy + enchanting.damages + end + + minetest.register_tool(":"..mod..":enchanted_"..tool.."_"..material.."_"..enchant, { + description = "Enchanted "..cap(material).." "..cap(tool).. + self:get_tooltip(enchant, original_groupcaps[group], fleshy), + inventory_image = original_tool.inventory_image.."^[colorize:violet:50", + wield_image = original_tool.wield_image, + groups = {not_in_creative_inventory=1}, + tool_capabilities = { + groupcaps = groupcaps, damage_groups = {fleshy = fleshy}, + full_punch_interval = full_punch_interval, max_drop_level = max_drop_level + } + }) + end + + if mod == "3d_armor" then + local original_armor_groups = original_tool.groups + local armorcaps = {} + armorcaps.not_in_creative_inventory = 1 + + for armor_group, value in pairs(original_armor_groups) do + if enchant == "strong" then + armorcaps[armor_group] = ceil(value * enchanting.strength) + elseif enchant == "speed" then + armorcaps[armor_group] = value + armorcaps.physics_speed = enchanting.speed + armorcaps.physics_jump = enchanting.jump + end + end + + minetest.register_tool(":"..mod..":enchanted_"..tool.."_"..material.."_"..enchant, { + description = "Enchanted "..cap(material).." "..cap(tool).. + self:get_tooltip(enchant), + inventory_image = original_tool.inventory_image, + texture = "3d_armor_"..tool.."_"..material, + wield_image = original_tool.wield_image, + groups = armorcaps, + wear = 0 + }) + end + end + end + end +end + +enchanting:register_tools("default", { + materials = "steel, bronze, mese, diamond", + tools = { + axe = {enchants = "durable, fast"}, + pick = {enchants = "durable, fast"}, + shovel = {enchants = "durable, fast"}, + sword = {enchants = "sharp"} + } +}) + +enchanting:register_tools("3d_armor", { + materials = "steel, bronze, gold, diamond", + tools = { + boots = {enchants = "strong, speed"}, + chestplate = {enchants = "strong"}, + helmet = {enchants = "strong"}, + leggings = {enchants = "strong"} + } +}) + diff --git a/mods/enchanting/mod.conf b/mods/enchanting/mod.conf new file mode 100644 index 00000000..777e5c7f --- /dev/null +++ b/mods/enchanting/mod.conf @@ -0,0 +1 @@ +name = enchanting diff --git a/mods/enchanting/screenshot.png b/mods/enchanting/screenshot.png new file mode 100644 index 00000000..eb3d0839 Binary files /dev/null and b/mods/enchanting/screenshot.png differ diff --git a/mods/enchanting/sounds/xdecor_enchanting.ogg b/mods/enchanting/sounds/xdecor_enchanting.ogg new file mode 100644 index 00000000..882e9ee2 Binary files /dev/null and b/mods/enchanting/sounds/xdecor_enchanting.ogg differ diff --git a/mods/enchanting/textures/bg_btn.png b/mods/enchanting/textures/bg_btn.png new file mode 100644 index 00000000..990a7884 Binary files /dev/null and b/mods/enchanting/textures/bg_btn.png differ diff --git a/mods/enchanting/textures/book_open.png b/mods/enchanting/textures/book_open.png new file mode 100644 index 00000000..508e8085 Binary files /dev/null and b/mods/enchanting/textures/book_open.png differ diff --git a/mods/enchanting/textures/ench_ui.png b/mods/enchanting/textures/ench_ui.png new file mode 100644 index 00000000..1413b7b7 Binary files /dev/null and b/mods/enchanting/textures/ench_ui.png differ diff --git a/mods/enchanting/textures/enchtable_bottom.png b/mods/enchanting/textures/enchtable_bottom.png new file mode 100644 index 00000000..781be5c8 Binary files /dev/null and b/mods/enchanting/textures/enchtable_bottom.png differ diff --git a/mods/enchanting/textures/enchtable_side.png b/mods/enchanting/textures/enchtable_side.png new file mode 100644 index 00000000..c03654d2 Binary files /dev/null and b/mods/enchanting/textures/enchtable_side.png differ diff --git a/mods/enchanting/textures/enchtable_top.png b/mods/enchanting/textures/enchtable_top.png new file mode 100644 index 00000000..3a3f703b Binary files /dev/null and b/mods/enchanting/textures/enchtable_top.png differ diff --git a/mods/enchanting/textures/mese_layout.png b/mods/enchanting/textures/mese_layout.png new file mode 100644 index 00000000..02d62480 Binary files /dev/null and b/mods/enchanting/textures/mese_layout.png differ diff --git a/mods/enchanting/textures/xdecor_glyph1.png b/mods/enchanting/textures/xdecor_glyph1.png new file mode 100644 index 00000000..a5ac3f55 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph1.png differ diff --git a/mods/enchanting/textures/xdecor_glyph10.png b/mods/enchanting/textures/xdecor_glyph10.png new file mode 100644 index 00000000..d002147f Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph10.png differ diff --git a/mods/enchanting/textures/xdecor_glyph11.png b/mods/enchanting/textures/xdecor_glyph11.png new file mode 100644 index 00000000..c9cd9ff5 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph11.png differ diff --git a/mods/enchanting/textures/xdecor_glyph12.png b/mods/enchanting/textures/xdecor_glyph12.png new file mode 100644 index 00000000..dc5dd1d2 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph12.png differ diff --git a/mods/enchanting/textures/xdecor_glyph13.png b/mods/enchanting/textures/xdecor_glyph13.png new file mode 100644 index 00000000..45c6d5a6 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph13.png differ diff --git a/mods/enchanting/textures/xdecor_glyph14.png b/mods/enchanting/textures/xdecor_glyph14.png new file mode 100644 index 00000000..68623878 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph14.png differ diff --git a/mods/enchanting/textures/xdecor_glyph15.png b/mods/enchanting/textures/xdecor_glyph15.png new file mode 100644 index 00000000..0db3a9ea Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph15.png differ diff --git a/mods/enchanting/textures/xdecor_glyph16.png b/mods/enchanting/textures/xdecor_glyph16.png new file mode 100644 index 00000000..d10a72b7 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph16.png differ diff --git a/mods/enchanting/textures/xdecor_glyph17.png b/mods/enchanting/textures/xdecor_glyph17.png new file mode 100644 index 00000000..2b374e88 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph17.png differ diff --git a/mods/enchanting/textures/xdecor_glyph18.png b/mods/enchanting/textures/xdecor_glyph18.png new file mode 100644 index 00000000..e762e350 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph18.png differ diff --git a/mods/enchanting/textures/xdecor_glyph2.png b/mods/enchanting/textures/xdecor_glyph2.png new file mode 100644 index 00000000..eb1e74fb Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph2.png differ diff --git a/mods/enchanting/textures/xdecor_glyph3.png b/mods/enchanting/textures/xdecor_glyph3.png new file mode 100644 index 00000000..e82145e5 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph3.png differ diff --git a/mods/enchanting/textures/xdecor_glyph4.png b/mods/enchanting/textures/xdecor_glyph4.png new file mode 100644 index 00000000..e93f2383 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph4.png differ diff --git a/mods/enchanting/textures/xdecor_glyph5.png b/mods/enchanting/textures/xdecor_glyph5.png new file mode 100644 index 00000000..f0635bf2 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph5.png differ diff --git a/mods/enchanting/textures/xdecor_glyph6.png b/mods/enchanting/textures/xdecor_glyph6.png new file mode 100644 index 00000000..c93976cf Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph6.png differ diff --git a/mods/enchanting/textures/xdecor_glyph7.png b/mods/enchanting/textures/xdecor_glyph7.png new file mode 100644 index 00000000..1e4ff024 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph7.png differ diff --git a/mods/enchanting/textures/xdecor_glyph8.png b/mods/enchanting/textures/xdecor_glyph8.png new file mode 100644 index 00000000..2f2b86c1 Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph8.png differ diff --git a/mods/enchanting/textures/xdecor_glyph9.png b/mods/enchanting/textures/xdecor_glyph9.png new file mode 100644 index 00000000..4b3e366d Binary files /dev/null and b/mods/enchanting/textures/xdecor_glyph9.png differ diff --git a/mods/font_api/API.md b/mods/font_api/API.md new file mode 100644 index 00000000..80b11212 --- /dev/null +++ b/mods/font_api/API.md @@ -0,0 +1,201 @@ +# Font API +This document describes Font API. Font API creates textures for font display on entities. + +## Settings +### default_font +Name of the font to be used when no font is given. The font should be registered. + +If no default\_font given or if default\_font given but not registered, the first registered font will be used as default. + +## Use font_api with display_api (to display text on nodes) +### Base setup +Font_api offers a direct integration with display_api to display text on nodes. + +First of all, create a display node with an entity. +To do this, refer to API.md in display_api mod, in particular "Howto register a display node". + +The only requirement then is to connect the `on_display_update` callback of the display entity to `font_api.on_display_update`: + +``` +minetest.register_node("mymod:test_text_node", { + ... + paramtype2 = "facedir", + ... + groups = { display_api = 1, ... }, + ... + display_entities = { + ["mymod:text"] = { + depth = -0.5 - display_api.entity_spacing, + on_display_update = font_api.on_display_update }, + } + ... + on_place = display_api.on_place, + on_construct = display_api.on_construct, + on_destruct = display_api.on_destruct, + on_rotate = display_api.on_rotate, + ... +}) +``` + +At this step, your node already displays text form "display_text" (by default) node meta. If you want to store your text into another meta data field, add a `meta_text` field to display entity definition. + +But it uses defaults (default font, default size, default color). Likely you need something more. + +### Style your text +Font style and size can be chosen by adding some more entries to the display_entities definition table. + +#### Font size +Font size can be defined in various ways (maybe more in the future). +Start with a number of lines, and font_api will make it fit to the entity size. + * `maxlines` or `lines`: Number of maximum lines of text to be displayed. The font height will be adjusted accordingly. + +Then specify the char width. Two methods available: + * `aspect_ratio`: Defines the aspect ratio of chars. Works with all fonts. Should not be used if `columns` is specified. + * `columns`: Only if using a fixed width font, specifies the number of columns to display. + +#### Font style + * `font_name`: name of the font to use. Should correspond to a registered font (from a font mod). If not specified or font not found, default font is used. + * `color`: color to be used (default black). + * `halign`: Horizontal alignment: "left", "center" or "right" (default "center"). + * `valign`: Vertical alignement: "top", "middle" or "bottom" (default "middle"). + +### Example +Using blue //botic// font, three lines height, aligned top left. Text stored in "text" node meta. +``` +minetest.register_node("mymod:test_text_node", { + ... + ... + display_entities = { + ["mymod:text"] = { + depth = -0.5 - display_api.entity_spacing, + on_display_update = font_api.on_display_update + meta_text = "text", + font_name = "botic", + color = "#0000FF", + maxlines = 3, + aspect_ratio = 0.5, + halign = "left", + valign = "top", + }, + } + ... +}) +``` +## Provided methods +### font_api.get_default_font_name() +Returns de default font name. + +### font_api.register_font(font_name, font_def) +Register a new font. + * `font_name`: Name of the font to register. If registering different sizes of the same font, add size in the font name (e.g. times_10, times_12...). + * `font_def`: Font definition table (see **Font definition table** below). + +### font_api.on_display_update(pos, objref) +Standard on_display_update entity callback. + * `pos`: Node position + * `objref`: Object reference of entity + +Node should have a corresponding display_entity with size, resolution and maxlines fields and optionally halign, valign and color fields. + +## Font definition table +Font definition table used by **font_api.register_font** and **font\_api.Font:new** may/can contain following elements: + +* `height` (required): Font height in pixels (all font textures should have the same height) . +* `widths` (required): Array of character widths in pixels, indexed by UTF codepoints. +* `margintop` (optional): Margin (in texture pixels) added on top of each char texture. +* `marginbottom` (optional): Margin (in texture pixels) added at bottom of each char texture. +* `linespacing` (optional): Spacing (in texture pixels) between each lines. + +`margintop`, `marginbottom` and `linespacing` can be negative numbers (default 0) and are to be used to adjust various font styles to each other. + +Font attributes around a single char:\ +![Font attributes on a char](doc/font.svg) + +Font attributes effects on several lines:\ +![Font attributes on lines](doc/lines.svg) + +#### Additional requirements + +Font must have a char 0 which will be used to display any unknown char. + +All textures corresponding to the indexes in widths array should be present in textures directory with a name matching the pattern : + +> font\_**{font_name}**_**{utf_code}**.png + +**{font\_name}**: Name of the font as given in the first argument + +**{utf\_code}**: UTF code of the char in 4 hexadecimal digits + +Example : font_courrier_0041.png is for the "A" char in the "courrier" font. + +To ease that declaration (specially to build the **widths** array), a shell is provided to build a {font\_name}.lua file from the texture files (see provided tools). + +## Provided tools + +Still in early stage of development, these tools are helpers to create font mods. + +### make_font_texture.sh + +This scripts takes a .ttf file as input and create one .png file per char, that can be used as font texture. Launch it from your future font mod directory. + +__Advice__ + +This script works much better with pixels font, providing the correct height. There is no antialiasing at all, vector fonts and bad heights gives very ugly results. + +__Syntax__ + +**make\_font\_texture.sh {fontfile} {fontname} {fontsize}** + +**{fontfile}**: A TTF font file to use to create textures. +**{fontname}**: The font name to be used in font_api (should be simple, with no spaces). +**{fontsize}**: Font height to be rendered. + +### make_font_lua.sh + +This script analyses textures in textures directory and creates a font\_{font\_name}.lua files with a call to register_font with images information. Launch it from your future font mod directory. + +Once the font\_{font\_name}.lua created, it can be included by a init.lua file or directly renamed to init.lua if you are creating a simple font mod. + +__Syntax__ + +**make\_font_lua.sh {fontname}** + +**{fontname}**: The font name to be used in font_api (same as given to make\_font\_texture.sh) + +### An exemple generating a font mod + + mkdir font_myfont + cd font_myfont + //tools/make_font_texture.sh myfont.ttf myfont 12 + //tools/make_font_lua.sh myfont + mv font_myfont.lua init.lua + +## Font class +A font usable with font API. This class is supposed to be for internal use but who knows. + +### font\_api.Font:new(def) +Create a new font object. + * `def` is a table containing font definition. See **Font definition table** above. + +### font:get_char_width(codepoint) +Returns the width of char `codepoint` in texture pixels. + * `codepoint`: Unicode codepoint of char. + +### font:get_height(nb_of_lines) +Returns line(s) height. Takes care of top and bottom margins and line spacing. + * `nb_of_lines`: Number of lines in the text. + +### font:get_width(line) +Returns the width of a text line. Beware, if line contains any new line char, they are ignored. + * `line`: Line of text which the width will be computed. + +### font:renter(text, texturew, textureh, style) +Builds texture for a multiline colored text. + * `text`: Text to be rendered. + * `texturew`: Width of the texture (extra text will be truncated). + * `textureh`: Height of the texture (extra text will be truncated). + * `style`: A table with style indications: + - `lines` or `maxlines`: Maximum number of lines (default none). + - `halign`: Horizontal text align: "left"/"center"/"right" (default "center") + - `valign`: Vertical text align: "top"/"middle"/"bottom" (default "middle") + - `color`: Color of the text (default black) diff --git a/mods/font_api/LICENSE.txt b/mods/font_api/LICENSE.txt new file mode 100644 index 00000000..341c30bd --- /dev/null +++ b/mods/font_api/LICENSE.txt @@ -0,0 +1,166 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + diff --git a/mods/font_api/README.md b/mods/font_api/README.md new file mode 100644 index 00000000..ff1dd980 --- /dev/null +++ b/mods/font_api/README.md @@ -0,0 +1,31 @@ +# Font API + +A library for rendernig text on textures (to be used with display_api for sign creation). + +**Dependancies**: default + +**License**: LGPL + +(Default font taken from VanessaE's homedecor/signs_lib, originally under WTFPL) + +**API**: See [API.md](https://github.com/pyrollo/display_modpack/blob/master/font_api/API.md) document please. + +For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=13563) at the Minetest forums. + +## Extra fonts + +You can add fonts by installing fonts mod. Be aware that each font comes with numerous textures. This can result in slowing media downloading and/or client display. + +Font mods can be found here: + + * [Metro](https://github.com/pyrollo/display_modpack/tree/master/font_metro): A multipurpose font with many chars (uppercase, lowercase and accentuated latin letters, usual signs, cyrillic and greek letters). + * [OldWizard](https://github.com/pyrollo/font_oldwizard): An old style gothic font. + * [Botic](https://github.com/pyrollo/font_botic): A scifi style font. + + ## Deprecation notice (for modders) + + ### December 2018 + Following object is deprecate, shows a warning in log when used: + * `font_lib` global table (use `font_api` global table instead); + + This object will be removed in the future. diff --git a/mods/font_api/copyright.txt b/mods/font_api/copyright.txt new file mode 100644 index 00000000..ceb54466 --- /dev/null +++ b/mods/font_api/copyright.txt @@ -0,0 +1,3 @@ +Code by Pierre-Yves Rollo (pyrollo) +Contributors: +Andrzej Pieńkowski (apienk): Unicode support and tool for creating texturess diff --git a/mods/font_api/depends.txt b/mods/font_api/depends.txt new file mode 100644 index 00000000..88fa963c --- /dev/null +++ b/mods/font_api/depends.txt @@ -0,0 +1 @@ +display_api? diff --git a/mods/font_api/deprecation.lua b/mods/font_api/deprecation.lua new file mode 100644 index 00000000..1ffed115 --- /dev/null +++ b/mods/font_api/deprecation.lua @@ -0,0 +1,59 @@ +--[[ + font_api mod for Minetest - Library creating textures with fonts and text + (c) Pierre-Yves Rollo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--]] + +-- Deprecation + +function deprecated_global_table(deprecated_global_name, replacement_global_name) + assert(type(deprecated_global_name) == 'string', "deprecated_global_name should be a string.") + assert(type(replacement_global_name) == 'string', "replacement_global_name should be a string.") + assert(deprecated_global_name ~= '', "deprecated_global_name should not be empty.") + assert(replacement_global_name ~= '', "replacement_global_name should not be empty.") + assert(rawget(_G, deprecated_global_name) == nil, "deprecated global does not exist.") + if _G[replacement_global_name] == nil then + minetest.log('warning', string.format( + 'Replacement global "%s" does not exists.', replacement_global_name)) + return + end + local meta = { + deprecated = deprecated_global_name, + replacement = replacement_global_name, + __index = function(table, key) + local meta = getmetatable(table) + local dbg = debug.getinfo(2, "lS") + minetest.log("warning", string.format( + 'Accessing deprecated "%s" table, "%s" should be used instead (%s:%d).', + meta.deprecated, meta.replacement, (dbg.short_src or 'unknown'), + (dbg.currentline or 0))) + return _G[meta.replacement][key] + end, + __newindex = function(table, key, value) + local meta = getmetatable(table) + local dbg = debug.getinfo(2, "lS") + minetest.log("warning", string.format( + 'Accessing deprecated "%s" table, "%s" should be used instead (%s:%d).', + meta.deprecated, meta.replacement, (dbg.short_src or 'unknown'), + (dbg.currentline or 0))) + _G[meta.replacement][key]=value + end, + } + rawset(_G, deprecated_global_name, {}) + setmetatable(_G[deprecated_global_name], meta) +end + +-- deprecated(2) -- December 2018 - Deprecation of font_lib +deprecated_global_table('font_lib', 'font_api') diff --git a/mods/font_api/display_api.lua b/mods/font_api/display_api.lua new file mode 100644 index 00000000..51a396db --- /dev/null +++ b/mods/font_api/display_api.lua @@ -0,0 +1,76 @@ +--[[ + font_api mod for Minetest - Library creating textures with fonts and text + (c) Pierre-Yves Rollo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--]] +-- Integration with display API + +if minetest.get_modpath("display_api") then + --- Standard on_display_update entity callback. + -- Node should have properly configured display_entity. + -- @param pos Node position + -- @param objref Object reference of entity + + font_api.on_display_update = function (pos, objref) + local meta = minetest.get_meta(pos) + local ndef = minetest.registered_nodes[minetest.get_node(pos).name] + local entity = objref:get_luaentity() + + if not entity or not ndef.display_entities[entity.name] then + return + end + + local def = ndef.display_entities[entity.name] + local font = font_api.get_font(meta:get_string("font") ~= "" + and meta:get_string("font") or def.font_name) + + local text = meta:get_string(def.meta_text or "display_text") + + -- Compute entity resolution accroding to given attributes + local texturew, textureh + textureh = font:get_height(def.lines or def.maxlines or 1) + + if def.columns then + if font.fixedwidth then + texturew = def.columns * font.fixedwidth + if def.aspect_ratio then + minetest.log('warning', "[font_api] 'aspect_ratio' ignored because 'columns' is specified") + end + else + minetest.log('warning', "[font_api] 'columns' ignored because '"..font.name.."' is not a fixed width font.") + end + end + + if not texturew then + if not def.aspect_ratio then + minetest.log('warning', "[font_api] No 'aspect_ratio' specified, using default 1.") + end + texturew = textureh * def.size.x / def.size.y / (def.aspect_ratio or 1) + end + + objref:set_properties({ + textures={ font:render(text, texturew, textureh, { + lines = def.maxlines or def.lines, + halign = def.halign, + valign = def.valign, + color = def.color} ) }, + visual_size = def.size, + }) + end +else + font_api.on_display_update = function (pos, objref) + minetest.log('error', '[font_api] font_api.on_display_update called but display_api mod not enabled.') + end +end diff --git a/mods/font_api/doc/font.svg b/mods/font_api/doc/font.svg new file mode 100644 index 00000000..e4e8757f --- /dev/null +++ b/mods/font_api/doc/font.svg @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + Texture Height + + Texture Width + + + + MarginTop + Margin Bottom + + Line Height + + + diff --git a/mods/font_api/doc/lines.svg b/mods/font_api/doc/lines.svg new file mode 100644 index 00000000..f75880fd --- /dev/null +++ b/mods/font_api/doc/lines.svg @@ -0,0 +1,544 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + Line Height + + + Text Height + Line Spacing + + + + + + + + + diff --git a/mods/font_api/fallbacks.lua b/mods/font_api/fallbacks.lua new file mode 100644 index 00000000..da3ff03d --- /dev/null +++ b/mods/font_api/fallbacks.lua @@ -0,0 +1,175 @@ +--[[ + font_api mod for Minetest - Library creating textures with fonts and text + (c) Pierre-Yves Rollo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--]] + +-- This is the unicode char fallback map. If a char is not present in +-- font, this maps indicates which char to try to use instead next. + +return { + -- Lowercase chars + ['a'] = 'A', ['b'] = 'B', ['c'] = 'C', ['d'] = 'D', + ['e'] = 'E', ['f'] = 'F', ['g'] = 'G', ['h'] = 'H', + ['i'] = 'I', ['j'] = 'J', ['k'] = 'K', ['l'] = 'L', + ['m'] = 'M', ['n'] = 'N', ['o'] = 'O', ['p'] = 'P', + ['q'] = 'Q', ['r'] = 'R', ['s'] = 'S', ['t'] = 'T', + ['u'] = 'U', ['v'] = 'V', ['w'] = 'W', ['x'] = 'X', + ['y'] = 'Y', ['z'] = 'Z', + + -- Special + ['¢'] = 'c', ['£'] = 'L', ['¥'] = 'Y', ['€'] = 'E', + ['©'] = '(C)', ['®'] = '(R)', ['™'] = 'TM', + ['ª'] = 'a', ['º'] = 'o', + ['«'] = '"', ['»'] = '"', ['´'] = '\'', + ['¹'] = '1', ['²'] = '2', ['³'] = '3', + ['µ'] = 'u', ['¤'] = 'o', + ['¼'] = '1/4', ['½'] = '1/2', ['¾'] = '3/4', + ['⅛'] = '1/8', ['⅜'] = '3/8', ['⅝'] = '5/8', ['⅞'] = '7/8', + ['¿'] = '?', + + -- Upper case accents + ['À'] = 'A', ['Á'] = 'A', ['Â'] = 'A', ['Ã'] = 'A', + ['Ä'] = 'A', ['Å'] = 'A', + ['Æ'] = 'AE', ['Ç'] = 'C', + ['È'] = 'E', ['É'] = 'E', ['Ê'] = 'E', ['Ë'] = 'E', + ['Ì'] = 'I', ['Í'] = 'I', ['Î'] = 'I', ['Ï'] = 'I', + ['Ð'] = 'D', ['Ñ'] = 'N', + ['Ò'] = 'O', ['Ó'] = 'O', ['Ô'] = 'O', ['Õ'] = 'O', + ['Ö'] = 'O', ['Ø'] = 'O', + ['Ú'] = 'U', ['Ù'] = 'U', ['Û'] = 'U', ['Ü'] = 'U', + ['×'] = 'x', ['Ý'] = 'Y', + + -- Lower case accents + ['à'] = 'a', ['à'] = 'a', ['á'] = 'a', ['â'] = 'a', + ['ã'] = 'a', ['ä'] = 'a', ['å'] = 'a', + ['æ'] = 'ae', ['ç'] = 'c', + ['è'] = 'e', ['é'] = 'e', ['ê'] = 'e', ['ë'] = 'e', + ['ì'] = 'i', ['í'] = 'i', ['î'] = 'i', ['ï'] = 'i', + ['ð'] = 'd', ['ñ'] = 'n', + ['ò'] = 'o', ['ó'] = 'o', ['ô'] = 'o', ['õ'] = 'o', + ['ö'] = 'o', ['ø'] = 'o', + ['ù'] = 'u', ['ú'] = 'u', ['û'] = 'u', ['ü'] = 'u', + ['ý'] = 'y', ['ÿ'] = 'y', + + -- Extended latin A + + ['Ā'] = 'A', ['ā'] = 'a', ['Ă'] = 'A', ['ă'] = 'a', + ['Ą'] = 'A', ['ą'] = 'a', ['Ć'] = 'C', ['ć'] = 'c', + ['Ĉ'] = 'C', ['ĉ'] = 'c', ['Ċ'] = 'C', ['ċ'] = 'c', + ['Č'] = 'C', ['č'] = 'c', ['Ď'] = 'D', ['ď'] = 'd', + ['Đ'] = 'D', ['đ'] = 'd', ['Ē'] = 'E', ['ē'] = 'e', + ['Ĕ'] = 'E', ['ĕ'] = 'e', ['Ė'] = 'E', ['ė'] = 'e', + ['Ę'] = 'E', ['ę'] = 'e', ['Ě'] = 'E', ['ě'] = 'e', + ['Ĝ'] = 'G', ['Ğ'] = 'G', ['ğ'] = 'g', ['ĝ'] = 'g', + ['Ġ'] = 'G', ['ġ'] = 'g', ['Ģ'] = 'G', ['ģ'] = 'g', + ['Ĥ'] = 'H', ['ĥ'] = 'h', ['Ħ'] = 'H', ['ħ'] = 'h', + ['Ĩ'] = 'I', ['ĩ'] = 'i', ['Ī'] = 'I', ['ī'] = 'i', + ['Ĭ'] = 'I', ['ĭ'] = 'i', ['Į'] = 'I', ['į'] = 'i', + ['ı'] = 'i', ['İ'] = 'I', ['IJ'] = 'IJ', ['ij'] = 'ij', + ['Ĵ'] = 'J', ['ĵ'] = 'j', ['ķ'] = 'k', ['Ķ'] = 'K', + ['ĸ'] = 'k', + ['Ĺ'] = 'L', ['ĺ'] = 'l', ['Ļ'] = 'L', ['ļ'] = 'l', + ['Ľ'] = 'L', ['ľ'] = 'l', ['Ŀ'] = 'L', ['ŀ'] = 'l', + ['Ł'] = 'L', ['ł'] = 'l', ['Ń'] = 'N', ['ń'] = 'n', + ['Ņ'] = 'N', ['ņ'] = 'n', ['Ň'] = 'N', ['ň'] = 'n', + ['ʼn'] = 'n', ['Ŋ'] = 'n', ['ŋ'] = 'n', + ['Ō'] = 'O', ['ō'] = 'o', ['Ŏ'] = 'O', ['ŏ'] = 'o', + ['ő'] = 'o', ['Ő'] = 'O', ['œ'] = 'oe', ['Œ'] = 'OE', + ['Ŕ'] = 'R', ['ŕ'] = 'r', ['Ŗ'] = 'R', ['ŗ'] = 'r', + ['Ř'] = 'R', ['ř'] = 'r', ['Ś'] = 'S', ['ś'] = 's', + ['Ŝ'] = 'S', ['ŝ'] = 's', ['Ş'] = 'S', ['ş'] = 's', + ['Š'] = 'S', ['š'] = 's', ['Ţ'] = 'T', ['ţ'] = 't', + ['ť'] = 't', ['Ŧ'] = 'T', ['Ť'] = 'T', ['ŧ'] = 't', + ['Ũ'] = 'U', ['ũ'] = 'u', ['Ū'] = 'U', ['ū'] = 'u', + ['Ŭ'] = 'U', ['ŭ'] = 'u', ['Ů'] = 'U', ['ů'] = 'u', + ['Ű'] = 'U', ['ű'] = 'u', ['Ų'] = 'U', ['ų'] = 'u', + ['Ŵ'] = 'W', ['ŵ'] = 'w', ['Ŷ'] = 'Y', ['ŷ'] = 'y', + ['Ÿ'] = 'Y', + ['Ź'] = 'Z', ['ź'] = 'z', ['Ż'] = 'Z', ['ż'] = 'z', + ['Ž'] = 'Z', ['ž'] = 'z', ['ſ'] = 's', + + -- Extended latin B + ['ƀ'] = 'b', ['Ɓ'] = 'B', ['Ƃ'] = 'B', ['ƃ'] = 'b', + ['Ɔ'] = 'O', + ['Ƈ'] = 'C', ['ƈ'] = 'c', ['Ɖ'] = 'D', ['Ɗ'] = 'D', + ['Ƌ'] = 'D', ['ƌ'] = 'd', ['Ǝ'] = 'E', ['Ə'] = 'e', + ['Ɛ'] = 'E', + ['Ƒ'] = 'F', ['ƒ'] = 'f', ['Ɠ'] = 'G', + ['ƕ'] = 'hv', ['Ɨ'] = 'I', ['Ƙ'] = 'K', ['ƙ'] = 'k', + ['ƚ'] = 'l', ['Ɯ'] = 'M', ['Ɲ'] = 'N', ['ƞ'] = 'n', + ['Ɵ'] = 'O', + ['Ơ'] = 'O', ['ơ'] = 'o', ['Ƣ'] = 'OI', ['ƣ'] = 'oi', + ['Ƥ'] = 'P', ['ƥ'] = 'p', ['Ʀ'] = 'YR', + ['Ƨ'] = 'S', ['ƨ'] = 's', ['ƫ'] = 't', + ['Ƭ'] = 'T', ['ƭ'] = 't', ['Ʈ'] = 'T', + ['Ư'] = 'U', ['ư'] = 'u', ['Ʋ'] = 'V', + ['Ƴ'] = 'Y', ['ƴ'] = 'y', ['Ƶ'] = 'Z', ['ƶ'] = 'z', + ['ƻ'] = '2', ['Ƽ'] = '5', ['ƽ'] = '5', + ['DŽ'] = 'DZ', ['Dž'] = 'Dz', ['dž'] = 'dz', + ['LJ'] = 'LJ', ['Lj'] = 'Lj', ['lj'] = 'lj', + ['NJ'] = 'NJ', ['Nj'] = 'Nj', ['nj'] = 'nj', + ['Ǎ'] = 'A', ['ǎ'] = 'a', ['Ǐ'] = 'I', ['ǐ'] = 'i', + ['Ǒ'] = 'O', ['ǒ'] = 'o', ['Ǔ'] = 'U', ['ǔ'] = 'u', + ['Ǖ'] = 'U', ['ǖ'] = 'u', ['Ǘ'] = 'U', ['ǘ'] = 'u', + ['Ǚ'] = 'U', ['ǚ'] = 'u', ['Ǜ'] = 'U', ['ǜ'] = 'u', + ['ǝ'] = 'e', + ['Ǟ'] = 'A', ['ǟ'] = 'a', ['Ǡ'] = 'A', ['ǡ'] = 'a', + ['Ǣ'] = 'Æ', ['ǣ'] = 'æ', ['Ǥ'] = 'G', ['ǥ'] = 'g', + ['Ǧ'] = 'G', ['ǧ'] = 'g', ['Ǩ'] = 'K', ['ǩ'] = 'k', + ['Ǫ'] = 'Q', ['ǫ'] = 'q', ['Ǭ'] = 'Q', ['ǭ'] = 'q', + ['ǰ'] = 'J', + ['DZ'] = 'DZ', ['Dz'] = 'Dz', ['dz'] = 'dz', + ['Ǵ'] = 'G', ['ǵ'] = 'g', ['Ƕ'] = 'H', + ['Ǹ'] = 'N', ['ǹ'] = 'n', ['Ǻ'] = 'A', ['ǻ'] = 'a', + ['Ǽ'] = 'Æ', ['ǽ'] = 'æ', ['Ǿ'] = 'Ø', ['ǿ'] = 'ø', + ['Ȁ'] = 'A', ['ȁ'] = 'a', ['Ȃ'] = 'A', ['ȃ'] = 'a', + ['Ȅ'] = 'E', ['ȅ'] = 'e', ['Ȇ'] = 'E', ['ȇ'] = 'e', + ['Ȉ'] = 'I', ['ȉ'] = 'i', ['Ȋ'] = 'I', ['ȋ'] = 'i', + ['Ȍ'] = 'O', ['ȍ'] = 'o', ['Ȏ'] = 'O', ['ȏ'] = 'o', + ['Ȑ'] = 'R', ['ȑ'] = 'r', ['Ȓ'] = 'R', ['ȓ'] = 'r', + ['Ȕ'] = 'U', ['ȕ'] = 'u', ['Ȗ'] = 'U', ['ȗ'] = 'u', + ['Ș'] = 'S', ['ș'] = 's', ['Ț'] = 'T', ['ț'] = 't', + ['Ȟ'] = 'H', ['ȟ'] = 'h', ['Ƞ'] = 'N', + ['ȡ'] = 'd', + ['Ȣ'] = 'OU', ['ȣ'] = 'ou', ['Ȥ'] = 'Z', ['ȥ'] = 'z', + ['Ȧ'] = 'A', ['ȧ'] = 'a', ['Ȩ'] = 'E', ['ȩ'] = 'e', + ['Ȫ'] = 'O', ['ȫ'] = 'o', ['Ȭ'] = 'O', ['ȭ'] = 'o', + ['Ȯ'] = 'O', ['ȯ'] = 'o', ['Ȱ'] = 'O', ['ȱ'] = 'o', + ['Ȳ'] = 'Y', ['ȳ'] = 'y', ['ȴ'] = 'l', + ['ȵ'] = 'n', ['ȶ'] = 't', ['ȷ'] = 'j', + ['ȸ'] = 'db', ['ȹ'] = 'qp', ['Ⱥ'] = 'A', + ['Ȼ'] = 'C', ['ȼ'] = 'c', ['Ƚ'] = 'L', + ['Ⱦ'] = 'T', ['ȿ'] = 's', ['ɀ'] = 'z', + ['Ƀ'] = 'B', ['Ʉ'] = 'U', ['Ʌ'] = 'V', + ['Ɇ'] = 'E', ['ɇ'] = 'e', ['Ɉ'] = 'J', ['ɉ'] = 'j', + ['Ɋ'] = 'Q', ['ɋ'] = 'q', ['Ɍ'] = 'R', ['ɍ'] = 'r', + ['Ɏ'] = 'Y', ['ɏ'] = 'y', ['ɐ'] = 'a', + ['ɓ'] = 'b', ['ɔ'] = 'o', + ['ɕ'] = 'c', ['ɖ'] = 'd', ['ɗ'] = 'd', + ['ɘ'] = 'e', ['ə'] = 'e', ['ɚ'] = 'e', + ['ɛ'] = 'e', ['ɜ'] = 'e', ['ɝ'] = 'e', ['ɞ'] = 'e', + ['ɟ'] = 'j', + ['ɠ'] = 'g', ['ɡ'] = 'g', ['ɢ'] = 'G', + ['ɥ'] = 'h', ['ɦ'] = 'h', ['ɧ'] = 'h', + ['ɨ'] = 'i', ['ɪ'] = 'I', + ['ɫ'] = 'l', ['ɬ'] = 'l', ['ɭ'] = 'l', + ['ɮ'] = 'lz', + ['ɯ'] = 'm', ['ɰ'] = 'm', ['ɱ'] = 'm', + ['ɲ'] = 'n', ['ɳ'] = 'n', ['ɴ'] = 'N', + ['ɵ'] = 'o', ['ɶ'] = 'Œ', + ['ɹ'] = 'r', ['ɺ'] = 'r', ['ɻ'] = 'r', + ['ɼ'] = 'r', ['ɽ'] = 'r', ['ɾ'] = 'r', ['ɿ'] = 'r', +} diff --git a/mods/font_api/font.lua b/mods/font_api/font.lua new file mode 100644 index 00000000..5794867f --- /dev/null +++ b/mods/font_api/font.lua @@ -0,0 +1,274 @@ +--[[ + font_api mod for Minetest - Library creating textures with fonts and text + (c) Pierre-Yves Rollo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--]] + +-- Fallback table +local fallbacks = dofile(font_api.path.."/fallbacks.lua") + +-- Local functions +------------------ + +-- Returns number of UTF8 bytes of the first char of the string +local function get_char_bytes(str) + local msb = str:byte(1) + if msb ~= nil then + if msb < 0x80 then return 1 end + if msb >= 0xF0 then return 4 end + if msb >= 0xE0 then return 3 end + if msb >= 0xC2 then return 2 end + end +end + +-- Returns the unicode codepoint of the first char of the string +local function char_to_codepoint(str) + local bytes = get_char_bytes(str) + if bytes == 1 then + return str:byte(1) + elseif bytes == 2 and str:byte(2) ~= nil then + return (str:byte(1) - 0xC2) * 0x40 + + str:byte(2) + elseif bytes == 3 and str:byte(2) ~= nil and str:byte(3) ~= nil then + return (str:byte(1) - 0xE0) * 0x1000 + + str:byte(2) % 0x40 * 0x40 + + str:byte(3) % 0x40 + elseif bytes == 4 and str:byte(2) ~= nil and str:byte(3) ~= nil + and str:byte(4) ~= nil then -- Not tested + return (str:byte(1) - 0xF0) * 0x40000 + + str:byte(2) % 0x40 * 0x1000 + + str:byte(3) % 0x40 * 0x40 + + str:byte(4) % 0x40 + end +end + +-------------------------------------------------------------------------------- +--- Font class + +local Font = {} +font_api.Font = Font + +function Font:new(def) + + if type(def) ~= "table" then + minetest.log("error", + "[font_api] Font definition must be a table.") + return nil + end + + if def.height == nil or def.height <= 0 then + minetest.log("error", + "[font_api] Font definition must have a positive height.") + return nil + end + + if type(def.widths) ~= "table" then + minetest.log("error", + "[font_api] Font definition must have a widths array.") + return nil + end + + if def.widths[0] == nil then + minetest.log("error", + "[font_api] Font must have a char with codepoint 0 (=unknown char).") + return nil + end + + local font = table.copy(def) + setmetatable(font, self) + self.__index = self + + -- Check if fixedwidth + for codepoint, width in pairs(font.widths) do + font.fixedwidth = font.fixedwidth or width + if width ~= font.fixedwidth then + font.fixedwidth = nil + break + end + end + + return font +end + +--- Gets the next char of a text +-- @return Codepoint of first char, +-- @return Remaining string without this first char + +function Font:get_next_char(text) + local bytes = get_char_bytes(text) + + if bytes == nil then + minetest.log("warning", + "[font_api] Encountered a non UTF char, not displaying text.") + return nil, '' + end + + local codepoint = char_to_codepoint(text) + + if codepoint == nil then + minetest.log("warning", + "[font_api] Encountered a non UTF char, not displaying text.") + return nil, '' + end + + -- Fallback mechanism + if self.widths[codepoint] == nil then + local char = text:sub(1, bytes) + + if fallbacks[char] then + return self:get_next_char(fallbacks[char]..text:sub(bytes+1)) + else + return 0, text:sub(bytes+1) -- Ultimate fallback + end + else + return codepoint, text:sub(bytes+1) + end +end + +--- Returns the width of a given char +-- @param char : codepoint of the char +-- @return Char width +function Font:get_char_width(codepoint) + if self.fixedwidth then + return self.fixedwidth + elseif self.widths[codepoint] then + return self.widths[codepoint] + else + return self.widths[0] + end +end + +--- Text height for multiline text including margins and line spacing +-- @param nb_of_lines : number of text lines (default 1) +-- @return Text height + +function Font:get_height(nb_of_lines) + if nb_of_lines == nil then nb_of_lines = 1 end + + if nb_of_lines > 0 then + return + ( + (self.height or 0) + + (self.margintop or 0) + + (self.marginbottom or 0) + ) * nb_of_lines + + (self.linespacing or 0) * (nb_of_lines -1) + else + return nb_of_lines == 0 and 0 or nil + end +end + +--- Computes text width for a given text (ignores new lines) +-- @param line Line of text which the width will be computed. +-- @return Text width + +function Font:get_width(line) + local codepoint + local width = 0 + line = line or '' + + while line ~= "" do + codepoint, line = self:get_next_char(line) + if codepoint == nil then return 0 end -- UTF Error + width = width + self:get_char_width(codepoint) + end + + return width +end + +--- Legacy make_text_texture method (replaced by "render" - Dec 2018) + +function Font:make_text_texture(text, texturew, textureh, maxlines, + halign, valign, color) + return self:render(text, texturew, textureh, { + lines = maxlines, + valign = valign, + halign = halign, + color = color + }) +end + +--- Render text with the font in a view +-- @param text Text to be rendered +-- @param texturew Width (in pixels) of the texture (extra text will be truncated) +-- @param textureh Height (in pixels) of the texture (extra text will be truncated) +-- @param style Style of the rendering: +-- - lines: maximum number of text lines (if text is limited) +-- - halign: horizontal align ("left"/"center"/"right") +-- - valign: vertical align ("top"/"center"/"bottom") +-- - color: color of the text ("#rrggbb") +-- @return Texture string + +function Font:render(text, texturew, textureh, style) + local style = style or {} + + -- Split text into lines (and limit to style.lines # of lines) + local lines = {} + local pos = 1 + local found, line + repeat + found = string.find(text, "\n", pos) or (#text + 1) + line = string.sub(text, pos, found - 1) + lines[#lines + 1] = { text = line, width = self:get_width(line) } + pos = found + 1 + until (style.lines and (#lines >= style.lines)) or (pos > (#text + 1)) + + if not #lines then + return "" + end + + local x, y, codepoint + local texture = "" + local textheight = self:get_height(#lines) + + if style.valign == "top" then + y = 0 + elseif style.valign == "bottom" then + y = textureh - textheight + else + y = (textureh - textheight) / 2 + end + + y = y + (self.margintop or 0) + + for _, line in pairs(lines) do + if style.halign == "left" then + x = 0 + elseif style.halign == "right" then + x = texturew - line.width + else + x = (texturew - line.width) / 2 + end + + while line.text ~= '' do + codepoint, line.text = self:get_next_char(line.text) + if codepoint == nil then return '' end -- UTF Error + + -- Add image only if it is visible (at least partly) + if x + self.widths[codepoint] >= 0 and x <= texturew then + texture = texture.. + string.format(":%d,%d=font_%s_%04x.png", x, y, self.name, codepoint) + end + x = x + self.widths[codepoint] + end + + y = y + self:get_height() + (self.linespacing or 0) + end + texture = string.format("[combine:%dx%d", texturew, textureh)..texture + if style.color then + texture = texture.."^[colorize:"..style.color + end + return texture +end diff --git a/mods/font_api/fontform.lua b/mods/font_api/fontform.lua new file mode 100644 index 00000000..b7e6724d --- /dev/null +++ b/mods/font_api/fontform.lua @@ -0,0 +1,166 @@ +--[[ + font_api mod for Minetest - Library creating textures with fonts and text + (c) Pierre-Yves Rollo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--]] + +local modname = minetest.get_current_modname() + +local contexts = {} + +minetest.register_on_leaveplayer(function(player) + if minetest.is_player(player) then + contexts[player:get_player_name()] = nil + end +end) + +local function get_context(playername) + if not contexts[playername] then + contexts[playername] = { playername = playername } + end + return contexts[playername] +end + +-- Show node formspec functions +local function show_node_formspec(playername, pos) + local meta = minetest.get_meta(pos) + + -- Decontextualize formspec + local fs = meta:get_string('formspec') + + if not fs then + return + end + + -- Change context and currrent_name references to nodemeta references + -- Change context and currrent_name references to nodemeta references + local nodemeta = string.format("nodemeta:%i,%i,%i", pos.x, pos.y ,pos.z) + fs = fs:gsub("current_name", nodemeta) + fs = fs:gsub("context", nodemeta) + + -- Change all ${} to their corresponding metadata values + local s, e + repeat + s, e = fs:find('%${.*}') + if s and e then + fs = fs:sub(1, s-1).. + minetest.formspec_escape(meta:get_string(fs:sub(s+2,e-1))).. + fs:sub(e+1) + end + until s == nil + + local context = get_context(playername) + context.node_pos = pos + + -- Find node on_receive_fields + local ndef = minetest.registered_nodes[minetest.get_node(pos).name] + if ndef and ndef.on_receive_fields then + context.on_receive_fields = ndef.on_receive_fields + end + + -- Show formspec + minetest.show_formspec(playername, modname..':context_formspec', fs) +end + +minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname ~= modname..':context_formspec' then + return + end + + if not minetest.is_player(player) then + return true + end + + local context = get_context(player:get_player_name()) + if context.on_receive_fields then + context.on_receive_fields(context.pos, '', fields, player) + end + return true +end) + +-- Specific functions + +local function show_font_formspec(playername) + local context = get_context(playername) + local fonts = {} + for name, _ in pairs(font_api.registered_fonts) do + fonts[#fonts+1] = name + end + table.sort(fonts) + + local fs = string.format( + "size[4,%s]%s%s%sbutton_exit[0,%s;4,1;cancel;Cancel]", + #fonts + 0.8, default.gui_bg, default.gui_bg_img, default.gui_slots, + #fonts) + + for line = 1, #fonts do + local font = font_api.get_font(fonts[line]) + local texture = font:make_text_texture(font.name, font:get_height()*5, + font:get_height()*1.2, 1, "center", "top", "#fff") + fs = string.format( + "%simage[0.1,%s;4.5,0.8;%s]button_exit[0,%s;4,1;font_%s;]", + fs, line-0.9, texture, line-1, font.name) + end + minetest.show_formspec(context.playername, modname..':font_list', fs) +end + +minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname ~= modname..':font_list' then + return + end + + if not minetest.is_player(player) then + return true + end + + local playername = player:get_player_name() + local context = get_context(playername) + + if not context.pos + or minetest.is_protected(context.pos, playername) then + return true + end + + if fields.quit == 'true' then + for name, _ in pairs(font_api.registered_fonts) do + if fields['font_'..name] then + local meta = minetest.get_meta(context.pos) + meta:set_string("font", name) + display_api.update_entities(context.pos) + end + end + + if context.callback and type(context.callback) == "function" then + -- Using after to avoid the "double close" bug + minetest.after(0, context.callback, playername, context.pos) + else + -- Using after to avoid the "double close" bug + minetest.after(0, show_node_formspec, playername, context.pos) + end + end + return true +end) + +-- @param player Player viewing the form +-- @param pos Node pos +-- @param callback function(playername, pos) to be called on form close +function font_api.show_font_list(player, pos, callback) + if minetest.is_player(player) then + local context = get_context(player:get_player_name()) + context.pos = pos + context.callback = callback + show_font_formspec(player:get_player_name()) + end +end diff --git a/mods/font_api/init.lua b/mods/font_api/init.lua new file mode 100644 index 00000000..c5858f40 --- /dev/null +++ b/mods/font_api/init.lua @@ -0,0 +1,35 @@ +--[[ + font_api mod for Minetest - Library creating textures with fonts and text + (c) Pierre-Yves Rollo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--]] + +-- Global variables +------------------- + +font_api = {} +font_api.name = minetest.get_current_modname() +font_api.path = minetest.get_modpath(font_api.name) + +-- Inclusions +------------- + +dofile(font_api.path.."/font.lua") +dofile(font_api.path.."/registry.lua") +dofile(font_api.path.."/fontform.lua") +if minetest.get_modpath("display_api") then + dofile(font_api.path.."/display_api.lua") +end +dofile(font_api.path.."/deprecation.lua") diff --git a/mods/font_api/mod.conf b/mods/font_api/mod.conf new file mode 100644 index 00000000..1aaccc0d --- /dev/null +++ b/mods/font_api/mod.conf @@ -0,0 +1,3 @@ +name=font_api +description=A library for rendernig text on textures +optional_depends=display_api diff --git a/mods/font_api/registry.lua b/mods/font_api/registry.lua new file mode 100644 index 00000000..e1836755 --- /dev/null +++ b/mods/font_api/registry.lua @@ -0,0 +1,160 @@ +--[[ + font_api mod for Minetest - Library creating textures with fonts and text + (c) Pierre-Yves Rollo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--]] + +-- Global variables +------------------- + +font_api.registered_fonts = {} +font_api.registered_fonts_number = 0 + +-- Local variables +------------------ + +local default_font = false + +-- Local functions +------------------ + +-- Gets a default (settings or fist font) +local function get_default_font() + -- First call + if default_font == false then + default_font = nil + + -- First, try with settings + local settings_font = minetest.settings:get("default_font") + + if settings_font ~= nil and settings_font ~= "" then + default_font = font_api.registered_fonts[settings_font] + + if default_font == nil then + minetest.log("warning", "Default font in settings (\"".. + settings_font.."\") is not registered.") + end + end + + -- If failed, choose first font without default = false + if default_font == nil then + for _, font in pairs(font_api.registered_fonts) do + if font.default then + default_font = font + break + end + end + end + + -- If failed, chose first font + if default_font == nil then + for _, font in pairs(font_api.registered_fonts) do + default_font = font + break + end + end + + -- Error, no font registered + if default_font == nil then + minetest.log("error", + "No font registred, unable to choose a default font.") + end + end + + return default_font +end + +--- Returns font object to be used according to font_name +-- @param font_name: Name of the font +-- @return Font object if font found (or default font) + +function font_api.get_font(font_name) + local font = font_api.registered_fonts[font_name] + + if font == nil then + local message + + if font_name == nil then + message = "No font given" + else + message = "Font \""..font_name.."\" unregistered" + end + + font = get_default_font() + + if font ~= nil then + minetest.log("info", message..", using font \""..font.name.."\".") + end + end + + return font +end + +-- API functions +---------------- + +--- Returns de default font name +-- @return Default font name + +function font_api.get_default_font_name() + return get_default_font().name +end + +--- Register a new font +-- Textures corresponding to the font should be named after following patern : +-- font__.png +-- : name of the font +-- : 4 digit hexadecimal unicode of the char +-- @param font_name Name of the font to register +-- If registering different sizes of the same font, add size in the font name +-- (e.g. times_10, times_12...). +-- @param def font definition. A associative array with following keys : +-- @key default True (by default) if this font may be used as default font +-- @key height (mandatory) Height in pixels of all font textures +-- @key widths (mandatory) Array of character widths in pixels, indexed by +-- UTF codepoints +-- @key margintop (optional) Margin (in texture pixels) added on top of each +-- char texture. +-- @key marginbottom (optional) dded at bottom of each char texture. +-- @key linespacing (optional) Spacing (in texture pixels) between each lines. +-- margintop, marginbottom and linespacing can be negative numbers (default 0) +-- and are to be used to adjust various font styles to each other. + +-- TODO: Add something to remove common accent if not defined in font + +function font_api.register_font(font_name, font_def) + + if font_api.registered_fonts[font_name] ~= nil then + minetest.log("error", "Font \""..font_name.."\" already registered.") + return + end + + local font = font_api.Font:new(font_def) + + if font == nil then + minetest.log("error", "Unable to register font \""..font_name.."\".") + return + end + + font.name = font_name + font_api.registered_fonts[font_name] = font + font_api.registered_fonts_number = font_api.registered_fonts_number + 1 + + -- Force to choose again default font + -- (allows use of fonts registered after start) + default_font = false + + minetest.log("action", "New font registered in font_api: "..font_name..".") +end diff --git a/mods/font_api/settingtypes.txt b/mods/font_api/settingtypes.txt new file mode 100644 index 00000000..d1111598 --- /dev/null +++ b/mods/font_api/settingtypes.txt @@ -0,0 +1 @@ +default_font(Default font) string diff --git a/mods/font_api/textures/font_api_center.png b/mods/font_api/textures/font_api_center.png new file mode 100644 index 00000000..967db6ad Binary files /dev/null and b/mods/font_api/textures/font_api_center.png differ diff --git a/mods/font_api/textures/font_api_font.png b/mods/font_api/textures/font_api_font.png new file mode 100644 index 00000000..e4503385 Binary files /dev/null and b/mods/font_api/textures/font_api_font.png differ diff --git a/mods/font_api/textures/font_api_left.png b/mods/font_api/textures/font_api_left.png new file mode 100644 index 00000000..727410bd Binary files /dev/null and b/mods/font_api/textures/font_api_left.png differ diff --git a/mods/font_api/textures/font_api_right.png b/mods/font_api/textures/font_api_right.png new file mode 100644 index 00000000..16401d30 Binary files /dev/null and b/mods/font_api/textures/font_api_right.png differ diff --git a/mods/font_api/tools/make_font_lua.sh b/mods/font_api/tools/make_font_lua.sh new file mode 100755 index 00000000..e8583604 --- /dev/null +++ b/mods/font_api/tools/make_font_lua.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +scriptname=$(basename $0) +identify="identify" + +usage() { + echo "Usage: $0 fontname" + echo "fontname: The name of the font. Must correspond to existing texture/font__????.png files" +} + +if [ $# -ne 1 ] +then + usage + exit 1 +fi + +font_name=$1 + +for f in textures/font_${font_name}_????.png +do + if [[ $f =~ textures/font_${font_name}_([0-9a-fA-F]{4}).png ]] + then + code=$((16#${BASH_REMATCH[1]})) + size=$(identify $f | cut -d " " -f 3) + w=$(echo $size | cut -d "x" -f 1) + h=$(echo $size | cut -d "x" -f 2) + + if [ -z "$font_height" ] + then + font_height=$h + else + if [ $font_height -ne $h ] + then + echo "Error : $f as height of $h pixels, previous textures have a height of $font_height pixels. All textures should have the same height." + fi + fi + + if [ -z "$font_widths" ] + then + font_widths="[$code]=$w" + else + font_widths="$font_widths, [$code]=$w" + fi + fi +done + +echo "--[[ + +$luafile generated by $scriptname $(LANG=en_US date) + +--]] + +font_api.register_font( + '$font_name', + { + height = $font_height, + widths = { + $font_widths + }, + } +); +" > font_$font_name.lua + +if grep -q font_api depends.txt &>/dev/null +then + echo "font_api already in depends.txt." +else + echo "adding font_api to depends.txt." + echo "font_api" >> depends.txt +fi + diff --git a/mods/font_api/tools/make_font_textures.sh b/mods/font_api/tools/make_font_textures.sh new file mode 100755 index 00000000..4a3191c8 --- /dev/null +++ b/mods/font_api/tools/make_font_textures.sh @@ -0,0 +1,111 @@ +#!/bin/bash + +# This program generates a bitmap font for font_api mod for Minetest game. +# (c) Andrzej Pieńkowski +# (c) Pierre-Yves Rollo +# License: GPL + +usage() { + echo "Usage: $0 fontfile fontname fontsize" + echo "fontfile: A TTF font file to use to create textures." + echo "fontname: The font name to be used in font_api (should be simple, with no spaces)." + echo "fontsize: Font height to be rendered." +} + +if [ $# -ne 3 ] +then + usage + exit 1 +fi + +fontfile=$1 +fontname=$2 +fontsize=$3 + +if [ ! -r "$fontfile" ] +then + echo "$fontfile not readable." + exit 1 +fi + +# check imagemagick +hash convert &>/dev/null +if [ $? -eq 1 ]; then + echo -e "Error: This program requires convert from ImageMagick! Please install it by typing 'sudo apt-get install imagemagick' in terminal." + abort=1 +fi + +# check ttx +hash ttx &>/dev/null +if [ $? -eq 1 ]; then + echo -e "Error: This program requires ttx from FontTools! Please install it by typing 'sudo apt-get install fonttools' in terminal." + abort=1 +fi + +if [ $abort ] +then + exit 1 +fi + +generate() { + for i in $(seq $((0x$1)) $((0x$2))) + do + if echo "$codepoints" | grep -qi $(printf "0x%x" $i) + then + hex=$(printf "%04x" $i) + echo -e "Generating textures/font_${fontname}_$hex.png file for \"\\U$hex\" char." + if [[ "$hex" == "005c" ]] # Backslash char + then + convert -background none -fill black -font "$fontfile" -pointsize $fontsize label:"\\\\" -colorspace gray -channel alpha -threshold 50% textures/font_${fontname}_$hex.png + else + convert -background none -fill black -font "$fontfile" -pointsize $fontsize label:"$(echo -en "\\U$hex")" -colorspace gray -channel alpha -threshold 50% textures/font_${fontname}_$hex.png + fi + fi + done +} + +mkdir textures + +# Reads all available code points in the font. +codepoints=$(ttx -o - "$fontfile" | grep " + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/mods/jukebox/README.md b/mods/jukebox/README.md new file mode 100644 index 00000000..0c77e910 --- /dev/null +++ b/mods/jukebox/README.md @@ -0,0 +1,94 @@ +# Minetest mod "Jukebox" +Version: 2.0 + +## License of source code +- Copyright (C) 2013 BlockMen +- Copyright (C) 2015-2016 LNJ +- Copyright (C) 2016 Rui + +``` + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + +Copyright (C) 2004 Sam Hocevar + +Everyone is permitted to copy and distribute verbatim or modified +copies of this license document, and changing it is allowed as long +as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. +``` + + +## License of textures +(by Authors) + +- BlockMen (WTFPL): + - `jukebox_disc_*.png` (added coulors by lightonflux) + + +## License of music: CC0 +The authors are (freesound.org): +- cheesepuff (song1) +- geerterig (song2) +- rap2h (song3) +- keffstay (song4) +- usedtobe (song5) +- zagi2 (song6) + + + +## Notice +This mod is only useable with Minetest 5.0 or above! + + +## Description +In the Jukebox plus mod you've got 9 different music discs. + +You can add music by copy your ogg file to the sounds folder and renaming them to e.g. this: +`jukebox_disc_2.0.ogg` +But pay attention that the sounds have to be mono, else you can hear the music all over the world. + +There are 9 discs so there are the sound files `jukebox_disc_1.*.ogg` to `jukebox_disc_9.*.ogg`. +The small star can be replaced by the numbers 0 to 9. + +So you can have up to 9x10 (90) songs! + + +## Using the mod +To use the jukebox, you have to craft one. You need 8 wood and 1 mese crystal to craft it following way: + +``` +wood wood wood +wood mese crystal wood +wood wood wood +``` + +Just rightclick with a music disc in your hand on the jukebox and it will play a random song from this disc. +To stop the music rightclick the box again and it will drop the music disc. + + +## API Documentation +The jukebox mod offers a simple API to register new discs. See here how to use it: + +```lua +jukebox.register_disc("mymod:new_disc", { + description = "New Disc", + -- ^ The item description + inventory_image = "mymod_new_disc.png", + -- ^ The disc image / texture + music_name = "mymod_new_disc", + -- ^ This is the sound that'll be played if you insert the disc + + -- if you want to you can add here more options as in minetest.register_craftitem (except stack_max) +}) +``` + + + +## Links +- [Forum Topic](https://forum.minetest.net/viewtopic.php?id=13505) +- [GitHub](https://github.com/minetest-mods/jukebox) diff --git a/mods/jukebox/init.lua b/mods/jukebox/init.lua new file mode 100644 index 00000000..d3920bca --- /dev/null +++ b/mods/jukebox/init.lua @@ -0,0 +1,156 @@ +local S = minetest.get_translator("jukebox") + +jukebox = {} +jukebox.registered_discs = {} + +function jukebox.register_disc(name, def) + def.stack_max = 1 + + local music_name = def.music_name + def.music_name = nil + + minetest.register_craftitem(":" .. name, def) + + jukebox.registered_discs[name] = music_name +end + +-- +-----------+ +-- | The Box | +-- +-----------+ + + +local handlers = {} + +minetest.register_node("jukebox:box", { + description = S("Jukebox"), + paramtype2 = "facedir", + stack_max = 1, + tiles = { + "jukebox_top.png", "default_wood.png", "jukebox_side.png", + "jukebox_side.png", "jukebox_front.png", "jukebox_front.png" + }, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("main", 1) + end, + + on_destruct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + if inv:is_empty("main") then return end + + local drop_pos = minetest.find_node_near(pos, 1, "air") + if not drop_pos then drop_pos = {x = pos.x, y = pos.y + 1, z = pos.z} end + + minetest.add_item(drop_pos, inv:get_stack("main", 1)) + inv:remove_item("main", inv:get_stack("main", 1)) + + local pos_string = minetest.pos_to_string(pos) + + if handlers[pos_string] then + minetest.sound_stop(handlers[pos_string]) + end + end, + + on_rightclick = function(pos, node, clicker, itemstack) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + local pos_string = minetest.pos_to_string(pos) + + if inv:is_empty("main") then + local item_name = itemstack:get_name() + local music_name = jukebox.registered_discs[item_name] + + if not music_name then return end + + inv:set_stack("main", 1, itemstack:take_item()) + + local handle = minetest.sound_play(music_name, { + pos = pos, + gain = 0.5, + max_hear_distance = 25, + loop = true + }) + + handlers[pos_string] = handle + + meta:set_string("music_name", music_name) -- for LBM + else + local drop_pos = minetest.find_node_near(pos, 1, "air") + if not drop_pos then drop_pos = {x = pos.x, y = pos.y + 1, z = pos.z} end + + minetest.add_item(drop_pos, inv:get_stack("main", 1)) + inv:remove_item("main", inv:get_stack("main", 1)) + + if handlers[pos_string] then + minetest.sound_stop(handlers[pos_string]) + end + end + end +}) + +minetest.register_lbm({ + name = "jukebox:resume_playing", + nodenames = "jukebox:box", + action = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + local pos_string = minetest.pos_to_string(pos) + + if inv:is_empty("main") then return end + if handlers[pos_string] then return end + + local music_name = meta:get_string("music_name") + local handle = minetest.sound_play(music_name, { + pos = pos, + gain = 0.5, + max_hear_distance = 25, + loop = true + }) + + handlers[pos_string] = handle + end +}) + +minetest.register_craft({ + output = "jukebox:box", + recipe = { + {"group:wood", "group:wood", "group:wood"}, + {"group:wood", "default:mese_crystal", "group:wood"}, + {"group:wood", "group:wood", "group:wood"} + } +}) + +-- +---------+ +-- | Discs | +-- +---------+ + +for i = 1, 9 do + local item_name = "jukebox:disc_" .. i + local description = S("Music Disc @1", i) + local inventory_image = "jukebox_disc_" .. i .. ".png" + local music_name = "jukebox_disc_" .. i + + jukebox.register_disc(item_name, { + description = description, + inventory_image = inventory_image, + music_name = music_name + }) +end + +minetest.register_craft({ + output = "jukebox:disc_1", + recipe = { + {"", "default:coal_lump", ""}, + {"default:coal_lump", "default:gold_lump", "default:coal_lump"}, + {"", "default:coal_lump", ""} + } +}) + diff --git a/mods/jukebox/locale/jukebox.be.tr b/mods/jukebox/locale/jukebox.be.tr new file mode 100644 index 00000000..0469bca9 --- /dev/null +++ b/mods/jukebox/locale/jukebox.be.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Музычны аўтамат +Music Disc @1=Музычны дыск @1 diff --git a/mods/jukebox/locale/jukebox.cs.tr b/mods/jukebox/locale/jukebox.cs.tr new file mode 100644 index 00000000..b20484d2 --- /dev/null +++ b/mods/jukebox/locale/jukebox.cs.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Jukebox +Music Disc @1=Hudební disk @1 diff --git a/mods/jukebox/locale/jukebox.de.tr b/mods/jukebox/locale/jukebox.de.tr new file mode 100644 index 00000000..c3dc6f58 --- /dev/null +++ b/mods/jukebox/locale/jukebox.de.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Musikbox +Music Disc @1=Schallplatte @1 diff --git a/mods/jukebox/locale/jukebox.fr.tr b/mods/jukebox/locale/jukebox.fr.tr new file mode 100644 index 00000000..e58c9462 --- /dev/null +++ b/mods/jukebox/locale/jukebox.fr.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Juke-box +Music Disc @1=Disque de musique @1 diff --git a/mods/jukebox/locale/jukebox.id.tr b/mods/jukebox/locale/jukebox.id.tr new file mode 100644 index 00000000..480e481c --- /dev/null +++ b/mods/jukebox/locale/jukebox.id.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Kotak Musik +Music Disc @1=Cakram Musik @1 diff --git a/mods/jukebox/locale/jukebox.it.tr b/mods/jukebox/locale/jukebox.it.tr new file mode 100644 index 00000000..c47a4e0f --- /dev/null +++ b/mods/jukebox/locale/jukebox.it.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Jukebox +Music Disc @1=Disco musicale @1 diff --git a/mods/jukebox/locale/jukebox.ja.tr b/mods/jukebox/locale/jukebox.ja.tr new file mode 100644 index 00000000..989043e3 --- /dev/null +++ b/mods/jukebox/locale/jukebox.ja.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=ジュークボックス +Music Disc @1=音楽ディスク @1 diff --git a/mods/jukebox/locale/jukebox.ms.tr b/mods/jukebox/locale/jukebox.ms.tr new file mode 100644 index 00000000..e8508e36 --- /dev/null +++ b/mods/jukebox/locale/jukebox.ms.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Peti Lagu +Music Disc @1=Disk Lagu @1 diff --git a/mods/jukebox/locale/jukebox.nb.tr b/mods/jukebox/locale/jukebox.nb.tr new file mode 100644 index 00000000..0091d5bd --- /dev/null +++ b/mods/jukebox/locale/jukebox.nb.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Musikkboks +Music Disc @1=Musikkplate @1 diff --git a/mods/jukebox/locale/jukebox.nl.tr b/mods/jukebox/locale/jukebox.nl.tr new file mode 100644 index 00000000..f814e266 --- /dev/null +++ b/mods/jukebox/locale/jukebox.nl.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Jukebox +Music Disc @1=Muziek Disk @1 diff --git a/mods/jukebox/locale/jukebox.pl.tr b/mods/jukebox/locale/jukebox.pl.tr new file mode 100644 index 00000000..7d6890d2 --- /dev/null +++ b/mods/jukebox/locale/jukebox.pl.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Szafa grająca +Music Disc @1=Płyta diff --git a/mods/jukebox/locale/jukebox.pt.tr b/mods/jukebox/locale/jukebox.pt.tr new file mode 100644 index 00000000..295495e7 --- /dev/null +++ b/mods/jukebox/locale/jukebox.pt.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Vitrola +Music Disc @1=Disco de Música @1 diff --git a/mods/jukebox/locale/jukebox.ru.tr b/mods/jukebox/locale/jukebox.ru.tr new file mode 100644 index 00000000..f26e760a --- /dev/null +++ b/mods/jukebox/locale/jukebox.ru.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Музыкальный автомат +Music Disc @1=Музыкальный диск @1 diff --git a/mods/jukebox/locale/jukebox.tr.tr b/mods/jukebox/locale/jukebox.tr.tr new file mode 100644 index 00000000..e8dc375b --- /dev/null +++ b/mods/jukebox/locale/jukebox.tr.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=Müzik Kutusu +Music Disc @1=Müzik Diski @1 diff --git a/mods/jukebox/locale/jukebox.zh_Hans.tr b/mods/jukebox/locale/jukebox.zh_Hans.tr new file mode 100644 index 00000000..2fe1d56e --- /dev/null +++ b/mods/jukebox/locale/jukebox.zh_Hans.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox=点唱机 +Music Disc @1=音乐光盘 @1 diff --git a/mods/jukebox/locale/jukebox.zh_Hant.tr b/mods/jukebox/locale/jukebox.zh_Hant.tr new file mode 100644 index 00000000..596d393f --- /dev/null +++ b/mods/jukebox/locale/jukebox.zh_Hant.tr @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox= +Music Disc @1= diff --git a/mods/jukebox/locale/template.txt b/mods/jukebox/locale/template.txt new file mode 100644 index 00000000..596d393f --- /dev/null +++ b/mods/jukebox/locale/template.txt @@ -0,0 +1,7 @@ +# textdomain: jukebox + + +### init.lua ### + +Jukebox= +Music Disc @1= diff --git a/mods/jukebox/mod.conf b/mods/jukebox/mod.conf new file mode 100644 index 00000000..19c06435 --- /dev/null +++ b/mods/jukebox/mod.conf @@ -0,0 +1,4 @@ +name = jukebox +description = A mod that adds a jukebox with nine different discs. There is also an API to register new discs. +depends = default + diff --git a/mods/jukebox/sounds/jukebox_disc_1.1.ogg b/mods/jukebox/sounds/jukebox_disc_1.1.ogg new file mode 100644 index 00000000..21063e87 Binary files /dev/null and b/mods/jukebox/sounds/jukebox_disc_1.1.ogg differ diff --git a/mods/jukebox/sounds/jukebox_disc_1.2.ogg b/mods/jukebox/sounds/jukebox_disc_1.2.ogg new file mode 100644 index 00000000..362ca749 Binary files /dev/null and b/mods/jukebox/sounds/jukebox_disc_1.2.ogg differ diff --git a/mods/jukebox/sounds/jukebox_disc_1.3.ogg b/mods/jukebox/sounds/jukebox_disc_1.3.ogg new file mode 100644 index 00000000..c4d9854b Binary files /dev/null and b/mods/jukebox/sounds/jukebox_disc_1.3.ogg differ diff --git a/mods/jukebox/sounds/jukebox_disc_1.4.ogg b/mods/jukebox/sounds/jukebox_disc_1.4.ogg new file mode 100644 index 00000000..376c7456 Binary files /dev/null and b/mods/jukebox/sounds/jukebox_disc_1.4.ogg differ diff --git a/mods/jukebox/sounds/jukebox_disc_1.5.ogg b/mods/jukebox/sounds/jukebox_disc_1.5.ogg new file mode 100644 index 00000000..054e61da Binary files /dev/null and b/mods/jukebox/sounds/jukebox_disc_1.5.ogg differ diff --git a/mods/jukebox/sounds/jukebox_disc_1.6.ogg b/mods/jukebox/sounds/jukebox_disc_1.6.ogg new file mode 100644 index 00000000..69a68bff Binary files /dev/null and b/mods/jukebox/sounds/jukebox_disc_1.6.ogg differ diff --git a/mods/jukebox/textures/jukebox_disc_1.png b/mods/jukebox/textures/jukebox_disc_1.png new file mode 100644 index 00000000..f63ae250 Binary files /dev/null and b/mods/jukebox/textures/jukebox_disc_1.png differ diff --git a/mods/jukebox/textures/jukebox_disc_2.png b/mods/jukebox/textures/jukebox_disc_2.png new file mode 100644 index 00000000..4be0526d Binary files /dev/null and b/mods/jukebox/textures/jukebox_disc_2.png differ diff --git a/mods/jukebox/textures/jukebox_disc_3.png b/mods/jukebox/textures/jukebox_disc_3.png new file mode 100644 index 00000000..100151e8 Binary files /dev/null and b/mods/jukebox/textures/jukebox_disc_3.png differ diff --git a/mods/jukebox/textures/jukebox_disc_4.png b/mods/jukebox/textures/jukebox_disc_4.png new file mode 100644 index 00000000..6d44f1af Binary files /dev/null and b/mods/jukebox/textures/jukebox_disc_4.png differ diff --git a/mods/jukebox/textures/jukebox_disc_5.png b/mods/jukebox/textures/jukebox_disc_5.png new file mode 100644 index 00000000..bcbc4d10 Binary files /dev/null and b/mods/jukebox/textures/jukebox_disc_5.png differ diff --git a/mods/jukebox/textures/jukebox_disc_6.png b/mods/jukebox/textures/jukebox_disc_6.png new file mode 100644 index 00000000..a8e5e35d Binary files /dev/null and b/mods/jukebox/textures/jukebox_disc_6.png differ diff --git a/mods/jukebox/textures/jukebox_disc_7.png b/mods/jukebox/textures/jukebox_disc_7.png new file mode 100644 index 00000000..6cae207b Binary files /dev/null and b/mods/jukebox/textures/jukebox_disc_7.png differ diff --git a/mods/jukebox/textures/jukebox_disc_8.png b/mods/jukebox/textures/jukebox_disc_8.png new file mode 100644 index 00000000..83c0deb3 Binary files /dev/null and b/mods/jukebox/textures/jukebox_disc_8.png differ diff --git a/mods/jukebox/textures/jukebox_disc_9.png b/mods/jukebox/textures/jukebox_disc_9.png new file mode 100644 index 00000000..7fb81e3d Binary files /dev/null and b/mods/jukebox/textures/jukebox_disc_9.png differ diff --git a/mods/jukebox/textures/jukebox_front.png b/mods/jukebox/textures/jukebox_front.png new file mode 100644 index 00000000..4eca5aa3 Binary files /dev/null and b/mods/jukebox/textures/jukebox_front.png differ diff --git a/mods/jukebox/textures/jukebox_side.png b/mods/jukebox/textures/jukebox_side.png new file mode 100644 index 00000000..ff61c6db Binary files /dev/null and b/mods/jukebox/textures/jukebox_side.png differ diff --git a/mods/jukebox/textures/jukebox_top.png b/mods/jukebox/textures/jukebox_top.png new file mode 100644 index 00000000..82ee05d1 Binary files /dev/null and b/mods/jukebox/textures/jukebox_top.png differ diff --git a/mods/letters/Readme.md b/mods/letters/Readme.md new file mode 100644 index 00000000..5b5ad5ae --- /dev/null +++ b/mods/letters/Readme.md @@ -0,0 +1,60 @@ +## Letters: A mod for Minetest! + +The majority of this code was taken (and altered significantly) from Calinou's [Moreblocks mod](https://forum.minetest.net/viewtopic.php?t=509). It is designed to add letters in all different materials. Code is licensed under the zlib license, textures under the CC BY-SA license. + +The Letter Cutter textures use parts of the default wood and tree textures made by Blockmen and Cisoun respectively. + +#### Allowing letters to be made from nodes: + +Use this code to allow blocks to have letters registered from them: +```lua +letters.register_letters(modname, subname, from_node, description, tiles, def) +``` +- Modname is the mod that the node belongs to. +- Subname is the actual name of the node. +- From_node is the node that the letters will be crafted from (Usually modname:subname). +- Description is the description of the node. +- Tiles defines the image that will be used with the node. +- Def (optional) may contain additional node definition parameters. Some might be overwritten to make the letters look and work as intended. + +For example, if I wanted to register marble, from the mod darkage, this is the code I would use: +```lua +letters.register_letters("darkage", "marble", "darkage:marble", "Marble", "darkage_marble.png") +``` +Add letters with unifieddye. +```lua +letters.register_letters("darkage", + "marble", + "darkage:marble", + "Marble", + "darkage_marble.png", + { + paramtype2 = "colorwallmounted", + palette = "unifieddyes_palette_colorwallmounted.png", + groups = { + not_in_creative_inventory = 1, + not_in_craft_guide = 1, + oddly_breakable_by_hand = 1, + attached_node = 1, + ud_param2_colorable = 1 + } + } +) +``` +You will need to add letters as a dependency to your mod, or include the registrations is the code: +```lua +if minetest.get_modpath("letters") then + letters.register_letters("darkage", "marble", "darkage:marble", "Marble", "darkage_marble.png") + --ect ect... +end +``` + +Most of the default nodes have already been registered, and I have added/will add mods I like, as an optional dependancy. + +*This mod is fairly stable, and shouldn't crash, but be warned that it is in its early stages of development, and so things may change considerably* + + +**Screenshots!** +![Screenshot](https://imgrush.com/4BvHPHl70F9F.png) +![Another screenshot!](https://imgrush.com/tuOkRXixvFHY.png) + diff --git a/mods/letters/depends.txt b/mods/letters/depends.txt new file mode 100644 index 00000000..03cd6c57 --- /dev/null +++ b/mods/letters/depends.txt @@ -0,0 +1,3 @@ +default +darkage? +colouredstonebricks? diff --git a/mods/letters/description.txt b/mods/letters/description.txt new file mode 100644 index 00000000..a266ce25 --- /dev/null +++ b/mods/letters/description.txt @@ -0,0 +1 @@ +Adds a letter cutting tool with letter "signlike" nodes. diff --git a/mods/letters/init.lua b/mods/letters/init.lua new file mode 100644 index 00000000..935655be --- /dev/null +++ b/mods/letters/init.lua @@ -0,0 +1,647 @@ +letters = { + {"al", "au", "a", "A"}, + {"bl", "bu", "b", "B"}, + {"cl", "cu", "c", "C"}, + {"dl", "du", "d", "D"}, + {"el", "eu", "e", "E"}, + {"fl", "fu", "f", "F"}, + {"gl", "gu", "g", "G"}, + {"hl", "hu", "h", "H"}, + {"il", "iu", "i", "I"}, + {"jl", "ju", "j", "J"}, + {"kl", "ku", "k", "K"}, + {"ll", "lu", "l", "L"}, + {"ml", "mu", "m", "M"}, + {"nl", "nu", "n", "N"}, + {"ol", "ou", "o", "O"}, + {"pl", "pu", "p", "P"}, + {"ql", "qu", "q", "Q"}, + {"rl", "ru", "r", "R"}, + {"sl", "su", "s", "S"}, + {"tl", "tu", "t", "T"}, + {"ul", "uu", "u", "U"}, + {"vl", "vu", "v", "V"}, + {"wl", "wu", "w", "W"}, + {"xl", "xu", "x", "X"}, + {"yl", "yu", "y", "Y"}, + {"zl", "zu", "z", "Z"}, +} + +letters_reversed = {} + +for i, t in ipairs(letters) do + letters_reversed[t[3]] = i +end + +letter_cutter = {} +letter_cutter.known_nodes = {} + +letter_cutter.show_item_list = dofile( + minetest.get_modpath(minetest.get_current_modname())..'/itemlist.lua') + +function letters.register_letters(modname, subname, from_node, description, tiles, def) + + def = def and table.copy(def) or {} + + --default node + def.drawtype = "signlike" + def.paramtype = "light" + def.paramtype2 = def.paramtype2 or "wallmounted" + def.sunlight_propagates = true + def.is_ground_content = false + def.walkable = false + def.selection_box = { + type = "wallmounted" + --wall_top = + --wall_bottom = + --wall_side = + } + def.groups = def.groups or { + not_in_creative_inventory = 1, + not_in_craft_guide = 1, + oddly_breakable_by_hand = 1, + attached_node = 1 + } + def.legacy_wallmounted = false + + + for _, row in ipairs(letters) do + + def = table.copy(def) + def.description = description.. " " ..row[3] + def.inventory_image = tiles.. "^letters_" ..row[1].. "_overlay.png^[makealpha:255,126,126" + def.wield_image = def.inventory_image + def.tiles = {def.inventory_image} + + minetest.register_node(":" ..modname..":"..subname.. "_letter_" ..row[1],def) + + def = table.copy(def) + def.description = description.. " " ..row[4] + def.inventory_image = tiles.. "^letters_" ..row[2].. "_overlay.png^[makealpha:255,126,126" + def.wield_image = def.inventory_image + def.tiles = {def.inventory_image} + + minetest.register_node(":" ..modname..":"..subname.. "_letter_" ..row[2], def) + + --[[minetest.register_craft({ + output = from_node, + recipe = { + {modname..":"..name, modname..":"..name, modname..":"..name}, + {modname..":"..name, modname..":"..name, modname..":"..name}, + {modname..":"..name, modname..":"..name, modname..":"..name}, + }, + })--]] + end + letter_cutter.known_nodes[from_node] = {modname, subname} +end + +cost = 0.110 + +letter_cutter.names_lower = { + {"letter_al"}, + {"letter_bl"}, + {"letter_cl"}, + {"letter_dl"}, + {"letter_el"}, + {"letter_fl"}, + {"letter_gl"}, + {"letter_hl"}, + {"letter_il"}, + {"letter_jl"}, + {"letter_kl"}, + {"letter_ll"}, + {"letter_ml"}, + {"letter_nl"}, + {"letter_ol"}, + {"letter_pl"}, + {"letter_ql"}, + {"letter_rl"}, + {"letter_sl"}, + {"letter_tl"}, + {"letter_ul"}, + {"letter_vl"}, + {"letter_wl"}, + {"letter_xl"}, + {"letter_yl"}, + {"letter_zl"}, +} + +letter_cutter.names_upper = { + {"letter_au"}, + {"letter_bu"}, + {"letter_cu"}, + {"letter_du"}, + {"letter_eu"}, + {"letter_fu"}, + {"letter_gu"}, + {"letter_hu"}, + {"letter_iu"}, + {"letter_ju"}, + {"letter_ku"}, + {"letter_lu"}, + {"letter_mu"}, + {"letter_nu"}, + {"letter_ou"}, + {"letter_pu"}, + {"letter_qu"}, + {"letter_ru"}, + {"letter_su"}, + {"letter_tu"}, + {"letter_uu"}, + {"letter_vu"}, + {"letter_wu"}, + {"letter_xu"}, + {"letter_yu"}, + {"letter_zu"}, +} + +function letter_cutter:get_output_inv_lower(modname, subname, amount, max) + + local list = {} + if amount < 1 then + return list + end + + for i, t in ipairs(letter_cutter.names_lower) do + table.insert(list, modname .. ":" .. subname .. "_" .. t[1] + .. " " .. math.min(math.floor(amount/cost), max)) + end + return list +end + +function letter_cutter:get_output_inv_upper(modname, subname, amount, max) + + local list = {} + if amount < 1 then + return list + end + + for i, t in ipairs(letter_cutter.names_upper) do + table.insert(list, modname .. ":" .. subname .. "_" .. t[1] + .. " " .. math.min(math.floor(amount/cost), max)) + end + return list +end + +function letter_cutter:reset_lower(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + inv:set_list("input", {}) + inv:set_list("output", {}) + meta:set_int("anz", 0) + + meta:set_string("infotext", + "Letter Cutter (Lower) is empty (owned by ".. + meta:get_string("owner")..")") +end + +function letter_cutter:reset_upper(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + inv:set_list("input", {}) + inv:set_list("output", {}) + meta:set_int("anz", 0) + + meta:set_string("infotext", + "Letter Cutter (Upper) is empty (owned by ".. + meta:get_string("owner")..")") +end + +function letter_cutter:update_inventory_lower(pos, amount) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + amount = meta:get_int("anz") + amount + + if amount < 1 then -- If the last block is taken out. + self:reset_lower(pos) + return + end + + local stack = inv:get_stack("input", 1) + if stack:is_empty() then + self:reset_lower(pos) + return + + end + local node_name = stack:get_name() or "" + local name_parts = letter_cutter.known_nodes[node_name] or "" + local modname = name_parts[1] or "" + local material = name_parts[2] or "" + + inv:set_list("input", { + node_name.. " " .. math.floor(amount) + }) + + -- Display: + inv:set_list("output", + self:get_output_inv_lower(modname, material, amount, + meta:get_int("max_offered"))) + -- Store how many microblocks are available: + meta:set_int("anz", amount) + + meta:set_string("infotext", + "Letter Cutter (Lower) is working (owned by ".. + meta:get_string("owner")..")") +end + +function letter_cutter:update_inventory_upper(pos, amount) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + amount = meta:get_int("anz") + amount + + if amount < 1 then -- If the last block is taken out. + self:reset_upper(pos) + return + end + + local stack = inv:get_stack("input", 1) + if stack:is_empty() then + self:reset_upper(pos) + return + + end + local node_name = stack:get_name() or "" + local name_parts = letter_cutter.known_nodes[node_name] or "" + local modname = name_parts[1] or "" + local material = name_parts[2] or "" + + inv:set_list("input", { + node_name.. " " .. math.floor(amount) + }) + + -- Display: + inv:set_list("output", + self:get_output_inv_upper(modname, material, amount, + meta:get_int("max_offered"))) + -- Store how many microblocks are available: + meta:set_int("anz", amount) + + meta:set_string("infotext", + "Letter Cutter (Upper) is working (owned by ".. + meta:get_string("owner")..")") +end + + +function letter_cutter.allow_metadata_inventory_move( + pos, from_list, from_index, to_list, to_index, count, player) + return 0 +end + + +-- Only input- and recycle-slot are intended as input slots: +function letter_cutter.allow_metadata_inventory_put( + pos, listname, index, stack, player) + -- The player is not allowed to put something in there: + if listname == "output" then + return 0 + end + + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stackname = stack:get_name() + local count = stack:get_count() + + -- Only accept certain blocks as input which are known to be craftable into stairs: + if listname == "input" then + if not inv:is_empty("input") and + inv:get_stack("input", index):get_name() ~= stackname then + return 0 + end + for name, t in pairs(letter_cutter.known_nodes) do + if name == stackname and inv:room_for_item("input", stack) then + return count + end + end + return 0 + end +end + +function letter_cutter.on_metadata_inventory_put_lower( + pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stackname = stack:get_name() + local count = stack:get_count() + + if listname == "input" then + letter_cutter:update_inventory_lower(pos, count) + end +end + +function letter_cutter.on_metadata_inventory_put_upper( + pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stackname = stack:get_name() + local count = stack:get_count() + + if listname == "input" then + letter_cutter:update_inventory_upper(pos, count) + end +end + +function letter_cutter.on_metadata_inventory_take_lower( + pos, listname, index, stack, player) + if listname == "output" then + -- We do know how much each block at each position costs: + letter_cutter:update_inventory_lower(pos, 8 * -cost) + elseif listname == "input" then + -- Each normal (= full) block taken costs 8 microblocks: + letter_cutter:update_inventory_lower(pos, 8 * -stack:get_count()) + end + -- The recycle field plays no role here since it is processed immediately. +end + +function letter_cutter.on_metadata_inventory_take_upper( + pos, listname, index, stack, player) + if listname == "output" then + -- We do know how much each block at each position costs: + letter_cutter:update_inventory_upper(pos, 8 * -cost) + elseif listname == "input" then + -- Each normal (= full) block taken costs 8 microblocks: + letter_cutter:update_inventory_upper(pos, 8 * -stack:get_count()) + end + -- The recycle field plays no role here since it is processed immediately. +end + +function letter_cutter.remove_from_input(pos, origname, count) + local node = minetest.get_node(pos) + local meta = minetest.get_meta(pos) + + local cutterinv = meta:get_inventory() + + local removed = cutterinv:remove_item("input", origname .. " " .. tostring(count)) + if node.name == "letters:letter_cutter_upper" then + letter_cutter:update_inventory_upper(pos, -removed:get_count()) + else + letter_cutter:update_inventory_lower(pos, -removed:get_count()) + end +end + +gui_slots = "listcolors[#606060AA;#808080;#101010;#202020;#FFF]" + +local function update_cutter_formspec(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", "size[11,9]" ..gui_slots.. + "label[0,0;Input\nmaterial]" .. + "list[current_name;input;1.5,0;1,1;]" .. + "list[current_name;output;2.8,0;8,4;]" .. + "button[0,1;2.5,1;itemlist;Cuttable materials]" .. + "list[current_player;main;1.5,5;8,4;]" .. + "field[0.5,4.3;3,1;text;Enter text;${text}]" .. + "button[3.5,4;2,1;make_text;Make text]" .. + "label[5.5,4.2;" .. minetest.formspec_escape(meta:get_string("message")) .. "]") +end + +local function cut_from_text(pos, input_text, player) + local playername = player:get_player_name() + + local node = minetest.get_node(pos) + local meta = minetest.get_meta(pos) + + local cutterinv = meta:get_inventory() + local cutterinput = cutterinv:get_list("input") + local cuttercount = cutterinput[1]:get_count() + + if cuttercount < 1 then + meta:set_string("message", "No materials.") + update_cutter_formspec(pos) + return + end + + local origname = cutterinput[1]:get_name() + + local playerinv = player:get_inventory() + local playermain = playerinv:get_list("main") + + meta:set_string("text", input_text) + + local totalcost = 0 + local throwawayinv = minetest.create_detached_inventory("letter_cutter:throwaway", {}, playername) + + throwawayinv:set_size("main", playerinv:get_size("main")) + throwawayinv:set_list("main", playerinv:get_list("main")) + + for i = 1, #input_text do + local char = input_text:sub(i, i) + + if char:match("[%u%l]") then + local isupper = char == char:upper() + local charset = isupper and letter_cutter.names_upper or letter_cutter.names_lower + local lettername = origname .. "_" .. charset[letters_reversed[char:lower()]][1] + + if cuttercount < totalcost + cost then + meta:set_string("message", "Not enough materials.") + update_cutter_formspec(pos) + + minetest.remove_detached_inventory("letter_cutter:throwaway") + return + end + + if lettername and not throwawayinv:room_for_item("main", lettername) then + meta:set_string("message", "Not enough room.") + update_cutter_formspec(pos) + + minetest.remove_detached_inventory("letter_cutter:throwaway") + return + end + + totalcost = totalcost + cost + + throwawayinv:add_item("main", lettername) + end + end + + meta:set_string("message", "Successfully added letters to inventory.") + update_cutter_formspec(pos) + + letter_cutter.remove_from_input(pos, origname, tostring(math.ceil(totalcost))) + playerinv:set_list("main", throwawayinv:get_list("main")) + + minetest.remove_detached_inventory("letter_cutter:throwaway") +end + +function letter_cutter.on_construct_lower(pos) + local meta = minetest.get_meta(pos) + update_cutter_formspec(pos) + + meta:set_int("anz", 0) -- No microblocks inside yet. + meta:set_string("max_offered", 9) -- How many items of this kind are offered by default? + meta:set_string("infotext", "Letter Cutter (Lower) is empty") + + meta:set_string("text", "") + meta:set_string("message", "") + + local inv = meta:get_inventory() + inv:set_size("input", 1) -- Input slot for full blocks of material x. + inv:set_size("output", 4*8) -- 4x8 versions of stair-parts of material x. + + letter_cutter:reset_lower(pos) +end + +function letter_cutter.on_construct_upper(pos) + local meta = minetest.get_meta(pos) + update_cutter_formspec(pos) + + meta:set_int("anz", 0) -- No microblocks inside yet. + meta:set_string("max_offered", 9) -- How many items of this kind are offered by default? + meta:set_string("infotext", "Letter Cutter (Upper) is empty") + + meta:set_string("text", "") + meta:set_string("message", "") + + local inv = meta:get_inventory() + inv:set_size("input", 1) -- Input slot for full blocks of material x. + inv:set_size("output", 4*8) -- 4x8 versions of stair-parts of material x. + + letter_cutter:reset_upper(pos) +end + + +function letter_cutter.can_dig(pos,player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if not inv:is_empty("input") then + return false + end + return true +end + +function letter_cutter.on_receive_fields(pos, formname, fields, sender) + if fields.itemlist then + local list = {} + for name, t in pairs(letter_cutter.known_nodes) do + list[#list+1] = name + end + letter_cutter.show_item_list(sender, 'Cuttable materials', list, pos) + return + end + + if fields.make_text and fields.text then + cut_from_text(pos, fields.text, sender) + return + end +end + +minetest.register_node("letters:letter_cutter_lower", { + description = "Lower Case Leter Cutter", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.4375, -0.5, -0.4375, -0.3125, 0.125, -0.3125}, -- NodeBox1 + {-0.4375, -0.5, 0.3125, -0.3125, 0.125, 0.4375}, -- NodeBox2 + {0.3125, -0.5, 0.3125, 0.4375, 0.125, 0.4375}, -- NodeBox3 + {0.3125, -0.5, -0.4375, 0.4375, 0.125, -0.3125}, -- NodeBox4 + {-0.5, 0.0625, -0.5, 0.5, 0.25, 0.5}, -- NodeBox5 + {-0.125, 0.25, 0.125, 0.125, 0.3125, 0.1875}, -- NodeBox6 + {0.125, 0.25, 0.0625, 0.1875, 0.3125, 0.125}, -- NodeBox7 + {0.1875, 0.25, -0.1875, 0.25, 0.3125, 0.1875}, -- NodeBox8 + {-0.1875, 0.25, 0.0625, -0.125, 0.3125, 0.125}, -- NodeBox9 + {-0.25, 0.25, -0.1875, -0.1875, 0.3125, 0.0625}, -- NodeBox10 + {-0.1875, 0.25, -0.25, -0.125, 0.3125, -0.1875}, -- NodeBox11 + {-0.125, 0.25, -0.3125, 0.125, 0.3125, -0.25}, -- NodeBox12 + {0.125, 0.25, -0.25, 0.375, 0.3125, -0.1875}, -- NodeBox13 + {0.3125, 0.25, -0.1875, 0.375, 0.3125, -0.125}, -- NodeBox14 + }, + }, + tiles = {"letters_letter_cutter_lower_top.png", + "default_tree.png", + "letters_letter_cutter_side.png"}, + paramtype = "light", + sunlight_propagates = true, + paramtype2 = "facedir", + groups = {choppy = 2,oddly_breakable_by_hand = 2}, + sounds = default.node_sound_wood_defaults(), + on_construct = letter_cutter.on_construct_lower, + can_dig = letter_cutter.can_dig, + -- Set the owner of this circular saw. + after_place_node = function(pos, placer) + local meta = minetest.get_meta(pos) + local owner = placer and placer:get_player_name() or "" + meta:set_string("owner", owner) + meta:set_string("infotext", + "Letter Cutter (Lower) is empty (owned by " + ..meta:get_string("owner")..")") + end, + allow_metadata_inventory_move = letter_cutter.allow_metadata_inventory_move, + -- Only input- and recycle-slot are intended as input slots: + allow_metadata_inventory_put = letter_cutter.allow_metadata_inventory_put, + -- Taking is allowed from all slots (even the internal microblock slot). Moving is forbidden. + -- Putting something in is slightly more complicated than taking anything because we have to make sure it is of a suitable material: + on_metadata_inventory_put = letter_cutter.on_metadata_inventory_put_lower, + on_metadata_inventory_take = letter_cutter.on_metadata_inventory_take_lower, + on_receive_fields = letter_cutter.on_receive_fields, +}) + +minetest.register_craft({ + output = "letters:letter_cutter_lower", + recipe = { + {"default:tree", "default:tree", "default:tree"}, + {"default:wood", "default:steel_ingot", "default:wood"}, + {"default:tree", "", "default:tree"}, + }, +}) + +minetest.register_node("letters:letter_cutter_upper", { + description = "Upper Case Leter Cutter", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.4375, -0.5, -0.4375, -0.3125, 0.125, -0.3125}, -- NodeBox1 + {-0.4375, -0.5, 0.3125, -0.3125, 0.125, 0.4375}, -- NodeBox2 + {0.3125, -0.5, 0.3125, 0.4375, 0.125, 0.4375}, -- NodeBox3 + {0.3125, -0.5, -0.4375, 0.4375, 0.125, -0.3125}, -- NodeBox4 + {-0.5, 0.0625, -0.5, 0.5, 0.25, 0.5}, -- NodeBox5 + {0.1875, 0.25, -0.125, 0.125, 0.3125, -0.3125}, -- NodeBox6 + {0.125, 0.25, 0.125, 0.0625, 0.3125, -0.125}, -- NodeBox7 + {0.0625, 0.25, 0.3125, -0.0625, 0.3125, 0.0625}, -- NodeBox8 + {-0.0625, 0.25, 0.125, -0.125, 0.3125, -0.125}, -- NodeBox9 + {-0.125, 0.25, -0.125, -0.1875, 0.3125, -0.3125}, -- NodeBox10 + {0.125, 0.25, -0.125, -0.125, 0.3125, -0.1875}, -- NodeBox11 + }, + }, + tiles = {"letters_letter_cutter_upper_top.png", + "default_tree.png", + "letters_letter_cutter_side.png"}, + paramtype = "light", + sunlight_propagates = true, + paramtype2 = "facedir", + groups = {choppy = 2,oddly_breakable_by_hand = 2}, + sounds = default.node_sound_wood_defaults(), + on_construct = letter_cutter.on_construct_upper, + can_dig = letter_cutter.can_dig, + -- Set the owner of this circular saw. + after_place_node = function(pos, placer) + local meta = minetest.get_meta(pos) + local owner = placer and placer:get_player_name() or "" + meta:set_string("owner", owner) + meta:set_string("infotext", + "Letter Cutter (Upper) is empty (owned by " + ..meta:get_string("owner")..")") + end, + allow_metadata_inventory_move = letter_cutter.allow_metadata_inventory_move, + -- Only input- and recycle-slot are intended as input slots: + allow_metadata_inventory_put = letter_cutter.allow_metadata_inventory_put, + -- Taking is allowed from all slots (even the internal microblock slot). Moving is forbidden. + -- Putting something in is slightly more complicated than taking anything because we have to make sure it is of a suitable material: + on_metadata_inventory_put = letter_cutter.on_metadata_inventory_put_upper, + on_metadata_inventory_take = letter_cutter.on_metadata_inventory_take_upper, + on_receive_fields = letter_cutter.on_receive_fields, +}) + +minetest.register_craft({ + output = "letters:letter_cutter_upper", + recipe = { + {"default:tree", "default:tree", "default:tree"}, + {"default:wood", "default:steel_ingot", "default:wood"}, + {"default:tree", "default:steel_ingot", "default:tree"}, + }, +}) + +dofile(minetest.get_modpath("letters").."/registrations.lua") diff --git a/mods/letters/itemlist.lua b/mods/letters/itemlist.lua new file mode 100644 index 00000000..16723ef3 --- /dev/null +++ b/mods/letters/itemlist.lua @@ -0,0 +1,212 @@ +--[[ The item list dialog can only be displayed from within a node formspec. +To open the item list dialog, add a do_file : + +local show_item_list = dofile( + minetest.get_modpath(minetest.get_current_modname())..'/itemlist.lua') + +... + +-- From your on_receive_field, call : +show_item_list(player, title, item_list, pos_context) + +player: player name or object +title: title to be displayed at the top of the dialog +item_list: a list of item names +pos_context: position of the context node (node that openned the formspec) +]]-- + +-- Formspec style + +local style={ + linesize = 0.9, -- Line height + colsize = 4, -- Column width + lines = 8, -- Number of lines of items displayed + cols = 3, -- Number of columns of items displayed +} + +local modname = minetest.get_current_modname() + +local contexts = {} + +local function get_player_name(player) + if type(player) == 'string' then + return player + end + if minetest.is_player(player) then + return player:get_player_name() + end + minetest.log('warning', '['..modname..'] get_player_name could not identify player.') +end + +minetest.register_on_leaveplayer(function(player) + local playername = get_player_name(player) + if playername then + contexts[playername] = nil + end +end) + +local function get_context(player) + local playername = get_player_name(player) + if playername then + if not contexts[playername] then + contexts[playername] = { playername = playername } + end + return contexts[playername] + end +end + +-- Show node formspec functions +local function show_node_formspec(playername, pos) + local meta = minetest.get_meta(pos) + + -- Decontextualize formspec + local fs = meta:get_string('formspec') + + -- Change context and currrent_name references to nodemeta references + local nodemeta = string.format("nodemeta:%i,%i,%i", pos.x, pos.y ,pos.z) + fs = fs:gsub("current_name", nodemeta) + fs = fs:gsub("context", nodemeta) + + -- Change all ${} to their corresponding metadata values + local s, e + repeat + s, e = fs:find('%${.*}') + if s and e then + fs = fs:sub(1, s-1).. + minetest.formspec_escape(meta:get_string(fs:sub(s+2,e-1))).. + fs:sub(e+1) + end + until s == nil + + -- Find node on_receive_fields + local ndef = minetest.registered_nodes[minetest.get_node(pos).name] + + local context = get_context(playername) + context.node_pos = pos + + if ndef and ndef.on_receive_fields then + context.on_receive_fields = ndef.on_receive_fields + end + + -- Show formspec + minetest.show_formspec(playername, modname..':context_formspec', fs) +end + +minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname == modname..':context_formspec' then + local context = get_context(player) + if context == nil then + return + end + + if context.on_receive_fields then + context.on_receive_fields(context.node_pos, '', fields, player) + end + end +end) + +-- Specific functions + +local function get_nb_of_pages(context) + return math.ceil((#context.items + 1) / (style.lines * style.cols)) +end + +local function item_list_prepare(item_list) + local list = {} + for _, name in ipairs(item_list) do + local ndef = minetest.registered_items[name] + if ndef then + list[#list+1] = ndef + end + end + table.sort(list, function(a,b) return a.description < b.description end) + return list +end + +local function show_item_list_formspec(player) + local context = get_context(player) + if context == nil then + return + end + + local parts = {} + parts[#parts + 1] = string.format( + "size[%f,%f]%s%s%slabel[1,0;%s]button_exit[%f,%f;2,1;close;Close]", + (style.colsize * style.cols), (style.linesize * style.lines + 1.3), + default.gui_bg, default.gui_bg_img, default.gui_slots, context.title, + (style.colsize * style.cols - 2), (style.linesize * style.lines + 0.7)) + + local nb_of_pages = get_nb_of_pages(context) + local right = style.colsize * style.cols + + if nb_of_pages > 1 then + parts[#parts + 1] = string.format("label[%f,0;Page %d of %d]", + (right - 4), context.page, nb_of_pages) + end + + if context.page > 1 then + parts[#parts + 1] = string.format("button[%f,-0.2;1,1;prev;<]", (right - 2)) + end + + if context.page < nb_of_pages then + parts[#parts + 1] = string.format("button[%f,-0.2;1,1;next;>]", (right - 1)) + end + + local index = (style.lines * style.cols) * (context.page - 1) + + for col = 1, style.cols do + local x = (col - 1) * style.colsize + for line = 1, style.lines do + index = index + 1 + local y = line * style.linesize + if context.items[index] then + parts[#parts + 1] = string.format( + "item_image[%f,%f;1,1;%s]label[%f,%f;%s]", + x, y - 0.2, context.items[index].name, x + 1, y, + (context.items[index].description or context.items[index].name)) + end + end + end + minetest.show_formspec( + context.playername, modname..':item_list', table.concat(parts)) +end + +minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname ~= modname..':item_list' then + return + end + + local context = get_context(player) + if context == nil then + return + end + + if fields.next and context.page < get_nb_of_pages(context) then + context.page = context.page + 1 + show_item_list_formspec(context.playername) + end + if fields.prev and context.page > 1 then + context.page = context.page - 1 + show_item_list_formspec(context.playername) + end + if fields.quit == 'true' then + if context.node_pos then + -- Using after to avoid the "double close" bug + minetest.after(0, show_node_formspec, get_player_name(player), + context.node_pos) + end + end +end) + +-- Only exposed function - Entry point + +local function show_item_list(player, title, item_list, pos_context) + local context = get_context(player) + context.items = item_list_prepare(item_list) + context.title = title + context.node_pos = pos_context + context.page = 1 + show_item_list_formspec(player) +end + +return show_item_list diff --git a/mods/letters/license.txt b/mods/letters/license.txt new file mode 100644 index 00000000..7e08c78d --- /dev/null +++ b/mods/letters/license.txt @@ -0,0 +1,17 @@ +Copyright (c) 2011-2014, Calinou and contributers to moreblocks, Amaz. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. diff --git a/mods/letters/mod.conf b/mods/letters/mod.conf new file mode 100644 index 00000000..95e68515 --- /dev/null +++ b/mods/letters/mod.conf @@ -0,0 +1 @@ +name = letters diff --git a/mods/letters/registrations.lua b/mods/letters/registrations.lua new file mode 100644 index 00000000..f36253a4 --- /dev/null +++ b/mods/letters/registrations.lua @@ -0,0 +1,71 @@ +local default_nodes = { + {"stone", "stone"}, + {"cobble", "cobble",}, + {"mossycobble", "mossycobble"}, + {"brick", "brick"}, + {"sandstone", "sandstone" }, + {"steelblock", "steel_block"}, + {"goldblock", "gold_block"}, + {"copperblock", "copper_block"}, + {"bronzeblock", "bronze_block"}, + {"diamondblock", "diamond_block"}, + {"desert_stone", "desert_stone"}, + {"desert_cobble", "desert_cobble"}, + {"tree", "tree"}, + {"wood", "wood"}, + {"jungletree", "jungletree"}, + {"junglewood", "junglewood"}, + {"obsidian", "obsidian"}, + {"stonebrick", "stone_brick"}, + {"desert_stonebrick", "desert_stone_brick"}, + {"sandstonebrick", "sandstone_brick"}, + {"obsidianbrick", "obsidian_brick"}, + {"pine_tree", "pine_tree"}, + {"pine_wood", "pine_wood"}, +} + +for _, row in pairs(default_nodes) do + local nodename = "default:" ..row[1] + local ndef = minetest.registered_nodes[nodename] + local texture = "default_" ..row[2].. ".png" + letters.register_letters("default", row[1], nodename, ndef.description, texture) +end + + +if minetest.get_modpath("darkage") then + letters.register_letters("darkage", "marble", "darkage:marble", "Marble", "darkage_marble.png") + letters.register_letters("darkage", "basalt", "darkage:basalt", "Basalt", "darkage_basalt.png") + letters.register_letters("darkage", "serpentine", "darkage:serpentine", "Serpentine", "darkage_serpentine.png") + letters.register_letters("darkage", "ors", "darkage:ors", "Old Red Sandstone", "darkage_ors.png") + letters.register_letters("darkage", "schist", "darkage:schist", "Schist", "darkage_schist.png") + letters.register_letters("darkage", "slate", "darkage:slate", "Slate", "darkage_slate.png") + letters.register_letters("darkage", "gneiss", "darkage:gneiss", "Gneiss", "darkage_gneiss.png") + letters.register_letters("darkage", "chalk", "darkage:chalk", "Chalk", "darkage_chalk.png") + letters.register_letters("darkage", "ors_cobble", "darkage:ors_cobble", "Old Red Sandstone Cobble", "darkage_ors_brick.png") + letters.register_letters("darkage", "slate_cobble", "darkage:slate_cobble", "Slate Cobble", "darkage_slate_brick.png") + letters.register_letters("darkage", "gneiss_cobble", "darkage:gneiss_cobble", "Gneiss Cobble", "darkage_gneiss_brick.png") + letters.register_letters("darkage", "basalt_cobble", "darkage:basalt_cobble", "Basalt Cobble", "darkage_basalt_brick.png") + letters.register_letters("darkage", "straw", "darkage:straw", "Straw", "darkage_straw.png") + letters.register_letters("darkage", "straw_bale", "darkage:straw_bale", "Straw Bale", "darkage_straw_bale.png") + letters.register_letters("darkage", "stone_brick", "darkage:stone_brick", "Stone Brick", "darkage_stone_brick.png") + letters.register_letters("darkage", "marble_tile", "darkage:marble_tile", "Marble Tile", "darkage_marble_tile.png") + letters.register_letters("darkage", "slate_tile", "darkage:slate_tile", "Slate Tile", "darkage_slate_tile.png") +end + +if minetest.get_modpath("colouredstonebricks") then + letters.register_letters("colouredstonebricks", "black", "colouredstonebricks:black", "Black", "colouredstonebricks_black.png") + letters.register_letters("colouredstonebricks", "cyan", "colouredstonebricks:cyan", "Cyan", "colouredstonebricks_cyan.png") + letters.register_letters("colouredstonebricks", "brown", "colouredstonebricks:brown", "Brown", "colouredstonebricks_brown.png") + letters.register_letters("colouredstonebricks", "dark_blue", "colouredstonebricks:dark_blue", "Dark Blue", "colouredstonebricks_dark_blue.png") + letters.register_letters("colouredstonebricks", "dark_green", "colouredstonebricks:dark_green", "Dark Green", "colouredstonebricks_dark_green.png") + letters.register_letters("colouredstonebricks", "dark_grey", "colouredstonebricks:dark_grey", "Dark Gey", "colouredstonebricks_dark_grey.png") + letters.register_letters("colouredstonebricks", "dark_pink", "colouredstonebricks:dark_pink", "Dark Pink", "colouredstonebricks_dark_pink.png") + letters.register_letters("colouredstonebricks", "green", "colouredstonebricks:green", "Green", "colouredstonebricks_green.png") + letters.register_letters("colouredstonebricks", "grey", "colouredstonebricks:grey", "Grey", "colouredstonebricks_grey.png") + letters.register_letters("colouredstonebricks", "orange", "colouredstonebricks:orange", "Orange", "colouredstonebricks_orange.png") + letters.register_letters("colouredstonebricks", "pink", "colouredstonebricks:pink", "Pink", "colouredstonebricks_pink.png") + letters.register_letters("colouredstonebricks", "purple", "colouredstonebricks:purple", "Purple", "colouredstonebricks_purple.png") + letters.register_letters("colouredstonebricks", "red", "colouredstonebricks:red", "Red", "colouredstonebricks_red.png") + letters.register_letters("colouredstonebricks", "white", "colouredstonebricks:white", "White", "colouredstonebricks_white.png") + letters.register_letters("colouredstonebricks", "yellow", "colouredstonebricks:yellow", "Yellow", "colouredstonebricks_yellow.png") +end diff --git a/mods/letters/screenshot.png b/mods/letters/screenshot.png new file mode 100644 index 00000000..50491647 Binary files /dev/null and b/mods/letters/screenshot.png differ diff --git a/mods/letters/textures/letters_al_overlay.png b/mods/letters/textures/letters_al_overlay.png new file mode 100644 index 00000000..3d016f9b Binary files /dev/null and b/mods/letters/textures/letters_al_overlay.png differ diff --git a/mods/letters/textures/letters_au_overlay.png b/mods/letters/textures/letters_au_overlay.png new file mode 100644 index 00000000..7421c68b Binary files /dev/null and b/mods/letters/textures/letters_au_overlay.png differ diff --git a/mods/letters/textures/letters_bl_overlay.png b/mods/letters/textures/letters_bl_overlay.png new file mode 100644 index 00000000..c2087572 Binary files /dev/null and b/mods/letters/textures/letters_bl_overlay.png differ diff --git a/mods/letters/textures/letters_bu_overlay.png b/mods/letters/textures/letters_bu_overlay.png new file mode 100644 index 00000000..1017b424 Binary files /dev/null and b/mods/letters/textures/letters_bu_overlay.png differ diff --git a/mods/letters/textures/letters_cl_overlay.png b/mods/letters/textures/letters_cl_overlay.png new file mode 100644 index 00000000..8f01b5df Binary files /dev/null and b/mods/letters/textures/letters_cl_overlay.png differ diff --git a/mods/letters/textures/letters_cu_overlay.png b/mods/letters/textures/letters_cu_overlay.png new file mode 100644 index 00000000..42cf86b2 Binary files /dev/null and b/mods/letters/textures/letters_cu_overlay.png differ diff --git a/mods/letters/textures/letters_dl_overlay.png b/mods/letters/textures/letters_dl_overlay.png new file mode 100644 index 00000000..50203b8b Binary files /dev/null and b/mods/letters/textures/letters_dl_overlay.png differ diff --git a/mods/letters/textures/letters_du_overlay.png b/mods/letters/textures/letters_du_overlay.png new file mode 100644 index 00000000..0e171f93 Binary files /dev/null and b/mods/letters/textures/letters_du_overlay.png differ diff --git a/mods/letters/textures/letters_el_overlay.png b/mods/letters/textures/letters_el_overlay.png new file mode 100644 index 00000000..f1e8bcfd Binary files /dev/null and b/mods/letters/textures/letters_el_overlay.png differ diff --git a/mods/letters/textures/letters_eu_overlay.png b/mods/letters/textures/letters_eu_overlay.png new file mode 100644 index 00000000..7d7cd15f Binary files /dev/null and b/mods/letters/textures/letters_eu_overlay.png differ diff --git a/mods/letters/textures/letters_fl_overlay.png b/mods/letters/textures/letters_fl_overlay.png new file mode 100644 index 00000000..199d7afd Binary files /dev/null and b/mods/letters/textures/letters_fl_overlay.png differ diff --git a/mods/letters/textures/letters_fu_overlay.png b/mods/letters/textures/letters_fu_overlay.png new file mode 100644 index 00000000..62888d69 Binary files /dev/null and b/mods/letters/textures/letters_fu_overlay.png differ diff --git a/mods/letters/textures/letters_gl_overlay.png b/mods/letters/textures/letters_gl_overlay.png new file mode 100644 index 00000000..74891186 Binary files /dev/null and b/mods/letters/textures/letters_gl_overlay.png differ diff --git a/mods/letters/textures/letters_gu_overlay.png b/mods/letters/textures/letters_gu_overlay.png new file mode 100644 index 00000000..b981d36e Binary files /dev/null and b/mods/letters/textures/letters_gu_overlay.png differ diff --git a/mods/letters/textures/letters_hl_overlay.png b/mods/letters/textures/letters_hl_overlay.png new file mode 100644 index 00000000..00c42b6c Binary files /dev/null and b/mods/letters/textures/letters_hl_overlay.png differ diff --git a/mods/letters/textures/letters_hu_overlay.png b/mods/letters/textures/letters_hu_overlay.png new file mode 100644 index 00000000..6a8b0563 Binary files /dev/null and b/mods/letters/textures/letters_hu_overlay.png differ diff --git a/mods/letters/textures/letters_il_overlay.png b/mods/letters/textures/letters_il_overlay.png new file mode 100644 index 00000000..f6361122 Binary files /dev/null and b/mods/letters/textures/letters_il_overlay.png differ diff --git a/mods/letters/textures/letters_iu_overlay.png b/mods/letters/textures/letters_iu_overlay.png new file mode 100644 index 00000000..cf0b32b7 Binary files /dev/null and b/mods/letters/textures/letters_iu_overlay.png differ diff --git a/mods/letters/textures/letters_jl_overlay.png b/mods/letters/textures/letters_jl_overlay.png new file mode 100644 index 00000000..ee508e30 Binary files /dev/null and b/mods/letters/textures/letters_jl_overlay.png differ diff --git a/mods/letters/textures/letters_ju_overlay.png b/mods/letters/textures/letters_ju_overlay.png new file mode 100644 index 00000000..5c556ae9 Binary files /dev/null and b/mods/letters/textures/letters_ju_overlay.png differ diff --git a/mods/letters/textures/letters_kl_overlay.png b/mods/letters/textures/letters_kl_overlay.png new file mode 100644 index 00000000..5fa338fa Binary files /dev/null and b/mods/letters/textures/letters_kl_overlay.png differ diff --git a/mods/letters/textures/letters_ku_overlay.png b/mods/letters/textures/letters_ku_overlay.png new file mode 100644 index 00000000..acb0776b Binary files /dev/null and b/mods/letters/textures/letters_ku_overlay.png differ diff --git a/mods/letters/textures/letters_letter_cutter_lower_top.png b/mods/letters/textures/letters_letter_cutter_lower_top.png new file mode 100644 index 00000000..cfa37e3b Binary files /dev/null and b/mods/letters/textures/letters_letter_cutter_lower_top.png differ diff --git a/mods/letters/textures/letters_letter_cutter_side.png b/mods/letters/textures/letters_letter_cutter_side.png new file mode 100644 index 00000000..af8bd661 Binary files /dev/null and b/mods/letters/textures/letters_letter_cutter_side.png differ diff --git a/mods/letters/textures/letters_letter_cutter_upper_top.png b/mods/letters/textures/letters_letter_cutter_upper_top.png new file mode 100644 index 00000000..3686d72a Binary files /dev/null and b/mods/letters/textures/letters_letter_cutter_upper_top.png differ diff --git a/mods/letters/textures/letters_ll_overlay.png b/mods/letters/textures/letters_ll_overlay.png new file mode 100644 index 00000000..93594249 Binary files /dev/null and b/mods/letters/textures/letters_ll_overlay.png differ diff --git a/mods/letters/textures/letters_lu_overlay.png b/mods/letters/textures/letters_lu_overlay.png new file mode 100644 index 00000000..a295b216 Binary files /dev/null and b/mods/letters/textures/letters_lu_overlay.png differ diff --git a/mods/letters/textures/letters_ml_overlay.png b/mods/letters/textures/letters_ml_overlay.png new file mode 100644 index 00000000..64f48445 Binary files /dev/null and b/mods/letters/textures/letters_ml_overlay.png differ diff --git a/mods/letters/textures/letters_mu_overlay.png b/mods/letters/textures/letters_mu_overlay.png new file mode 100644 index 00000000..f2c45589 Binary files /dev/null and b/mods/letters/textures/letters_mu_overlay.png differ diff --git a/mods/letters/textures/letters_nl_overlay.png b/mods/letters/textures/letters_nl_overlay.png new file mode 100644 index 00000000..c88d14cc Binary files /dev/null and b/mods/letters/textures/letters_nl_overlay.png differ diff --git a/mods/letters/textures/letters_nu_overlay.png b/mods/letters/textures/letters_nu_overlay.png new file mode 100644 index 00000000..e0279957 Binary files /dev/null and b/mods/letters/textures/letters_nu_overlay.png differ diff --git a/mods/letters/textures/letters_ol_overlay.png b/mods/letters/textures/letters_ol_overlay.png new file mode 100644 index 00000000..93b90b3d Binary files /dev/null and b/mods/letters/textures/letters_ol_overlay.png differ diff --git a/mods/letters/textures/letters_ou_overlay.png b/mods/letters/textures/letters_ou_overlay.png new file mode 100644 index 00000000..58306f0b Binary files /dev/null and b/mods/letters/textures/letters_ou_overlay.png differ diff --git a/mods/letters/textures/letters_pl_overlay.png b/mods/letters/textures/letters_pl_overlay.png new file mode 100644 index 00000000..9fd84743 Binary files /dev/null and b/mods/letters/textures/letters_pl_overlay.png differ diff --git a/mods/letters/textures/letters_pu_overlay.png b/mods/letters/textures/letters_pu_overlay.png new file mode 100644 index 00000000..af791df1 Binary files /dev/null and b/mods/letters/textures/letters_pu_overlay.png differ diff --git a/mods/letters/textures/letters_ql_overlay.png b/mods/letters/textures/letters_ql_overlay.png new file mode 100644 index 00000000..b6b34da0 Binary files /dev/null and b/mods/letters/textures/letters_ql_overlay.png differ diff --git a/mods/letters/textures/letters_qu_overlay.png b/mods/letters/textures/letters_qu_overlay.png new file mode 100644 index 00000000..2c1ce112 Binary files /dev/null and b/mods/letters/textures/letters_qu_overlay.png differ diff --git a/mods/letters/textures/letters_rl_overlay.png b/mods/letters/textures/letters_rl_overlay.png new file mode 100644 index 00000000..2da46138 Binary files /dev/null and b/mods/letters/textures/letters_rl_overlay.png differ diff --git a/mods/letters/textures/letters_ru_overlay.png b/mods/letters/textures/letters_ru_overlay.png new file mode 100644 index 00000000..60760459 Binary files /dev/null and b/mods/letters/textures/letters_ru_overlay.png differ diff --git a/mods/letters/textures/letters_sl_overlay.png b/mods/letters/textures/letters_sl_overlay.png new file mode 100644 index 00000000..05606f58 Binary files /dev/null and b/mods/letters/textures/letters_sl_overlay.png differ diff --git a/mods/letters/textures/letters_su_overlay.png b/mods/letters/textures/letters_su_overlay.png new file mode 100644 index 00000000..173f47a7 Binary files /dev/null and b/mods/letters/textures/letters_su_overlay.png differ diff --git a/mods/letters/textures/letters_tl_overlay.png b/mods/letters/textures/letters_tl_overlay.png new file mode 100644 index 00000000..e08f9e29 Binary files /dev/null and b/mods/letters/textures/letters_tl_overlay.png differ diff --git a/mods/letters/textures/letters_tu_overlay.png b/mods/letters/textures/letters_tu_overlay.png new file mode 100644 index 00000000..c5882b8b Binary files /dev/null and b/mods/letters/textures/letters_tu_overlay.png differ diff --git a/mods/letters/textures/letters_ul_overlay.png b/mods/letters/textures/letters_ul_overlay.png new file mode 100644 index 00000000..b1f2972e Binary files /dev/null and b/mods/letters/textures/letters_ul_overlay.png differ diff --git a/mods/letters/textures/letters_uu_overlay.png b/mods/letters/textures/letters_uu_overlay.png new file mode 100644 index 00000000..6bde37d7 Binary files /dev/null and b/mods/letters/textures/letters_uu_overlay.png differ diff --git a/mods/letters/textures/letters_vl_overlay.png b/mods/letters/textures/letters_vl_overlay.png new file mode 100644 index 00000000..117ea914 Binary files /dev/null and b/mods/letters/textures/letters_vl_overlay.png differ diff --git a/mods/letters/textures/letters_vu_overlay.png b/mods/letters/textures/letters_vu_overlay.png new file mode 100644 index 00000000..acfa3ea1 Binary files /dev/null and b/mods/letters/textures/letters_vu_overlay.png differ diff --git a/mods/letters/textures/letters_wl_overlay.png b/mods/letters/textures/letters_wl_overlay.png new file mode 100644 index 00000000..08a0412e Binary files /dev/null and b/mods/letters/textures/letters_wl_overlay.png differ diff --git a/mods/letters/textures/letters_wu_overlay.png b/mods/letters/textures/letters_wu_overlay.png new file mode 100644 index 00000000..394cd57f Binary files /dev/null and b/mods/letters/textures/letters_wu_overlay.png differ diff --git a/mods/letters/textures/letters_xl_overlay.png b/mods/letters/textures/letters_xl_overlay.png new file mode 100644 index 00000000..bd0975ae Binary files /dev/null and b/mods/letters/textures/letters_xl_overlay.png differ diff --git a/mods/letters/textures/letters_xu_overlay.png b/mods/letters/textures/letters_xu_overlay.png new file mode 100644 index 00000000..fd644f66 Binary files /dev/null and b/mods/letters/textures/letters_xu_overlay.png differ diff --git a/mods/letters/textures/letters_yl_overlay.png b/mods/letters/textures/letters_yl_overlay.png new file mode 100644 index 00000000..14cc2d80 Binary files /dev/null and b/mods/letters/textures/letters_yl_overlay.png differ diff --git a/mods/letters/textures/letters_yu_overlay.png b/mods/letters/textures/letters_yu_overlay.png new file mode 100644 index 00000000..824f0e7a Binary files /dev/null and b/mods/letters/textures/letters_yu_overlay.png differ diff --git a/mods/letters/textures/letters_zl_overlay.png b/mods/letters/textures/letters_zl_overlay.png new file mode 100644 index 00000000..35ffd95e Binary files /dev/null and b/mods/letters/textures/letters_zl_overlay.png differ diff --git a/mods/letters/textures/letters_zu_overlay.png b/mods/letters/textures/letters_zu_overlay.png new file mode 100644 index 00000000..157ab130 Binary files /dev/null and b/mods/letters/textures/letters_zu_overlay.png differ diff --git a/mods/lib_mount/README.txt b/mods/lib_mount/README.txt new file mode 100644 index 00000000..95165879 --- /dev/null +++ b/mods/lib_mount/README.txt @@ -0,0 +1,7 @@ + +Minetest mod: lib_mount +======================= +by blert2112 + +Based on the Boats mod by: PilzAdam. +License of source code: WTFPL diff --git a/mods/lib_mount/depends.txt b/mods/lib_mount/depends.txt new file mode 100644 index 00000000..4c209364 --- /dev/null +++ b/mods/lib_mount/depends.txt @@ -0,0 +1,2 @@ +default +mobs? diff --git a/mods/lib_mount/init.lua b/mods/lib_mount/init.lua new file mode 100644 index 00000000..8b7fd816 --- /dev/null +++ b/mods/lib_mount/init.lua @@ -0,0 +1,331 @@ + +local enable_crash = true +local crash_threshold = 6.5 -- ignored if enable_crash=false + +------------------------------------------------------------------------------ + +local mobs_redo = false +if minetest.get_modpath("mobs") then + if mobs.mod and mobs.mod == "redo" then + mobs_redo = true + end +end + +-- +-- Helper functions +-- + +--local function is_group(pos, group) +-- local nn = minetest.get_node(pos).name +-- return minetest.get_item_group(nn, group) ~= 0 +--end + +local function node_is(pos) + local node = minetest.get_node(pos) + if node.name == "air" then + return "air" + end + if minetest.get_item_group(node.name, "liquid") ~= 0 then + return "liquid" + end + if minetest.get_item_group(node.name, "walkable") ~= 0 then + return "walkable" + end + return "other" +end + +local function get_sign(i) + i = i or 0 + if i == 0 then + return 0 + else + return i / math.abs(i) + end +end + +local function get_velocity(v, yaw, y) + local x = -math.sin(yaw) * v + local z = math.cos(yaw) * v + return {x = x, y = y, z = z} +end + +local function get_v(v) + return math.sqrt(v.x ^ 2 + v.z ^ 2) +end + +local function force_detach(player) + local attached_to = player:get_attach() + if attached_to then + local entity = attached_to:get_luaentity() + if entity.driver and entity.driver == player then + entity.driver = nil + elseif entity.passenger and entity.passenger == player then + entity.passenger = nil + end + player:set_detach() + default.player_attached[player:get_player_name()] = false + player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0}) + end +end + +------------------------------------------------------------------------------- + + +minetest.register_on_leaveplayer(function(player) + force_detach(player) +end) + +minetest.register_on_shutdown(function() + local players = minetest.get_connected_players() + for i = 1,#players do + force_detach(players[i]) + end +end) + +minetest.register_on_dieplayer(function(player) + force_detach(player) + return true +end) + +------------------------------------------------------------------------------- + + +lib_mount = {} + +function lib_mount.attach(entity, player, is_passenger) + local attach_at, eye_offset = {}, {} + + if not entity.player_rotation then + entity.player_rotation = {x=0, y=0, z=0} + end + + local rot_view = 0 + if entity.player_rotation.y == 90 then + rot_view = math.pi/2 + end + + if is_passenger == true then + if not entity.passenger_attach_at then + entity.passenger_attach_at = {x=0, y=0, z=0} + end + if not entity.passenger_eye_offset then + entity.passenger_eye_offset = {x=0, y=0, z=0} + end + attach_at = entity.passenger_attach_at + eye_offset = entity.passenger_eye_offset + entity.passenger = player + else + if not entity.driver_attach_at then + entity.driver_attach_at = {x=0, y=0, z=0} + end + if not entity.driver_eye_offset then + entity.driver_eye_offset = {x=0, y=0, z=0} + end + attach_at = entity.driver_attach_at + eye_offset = entity.driver_eye_offset + entity.driver = player + end + + force_detach(player) + + player:set_attach(entity.object, "", attach_at, entity.player_rotation) + default.player_attached[player:get_player_name()] = true + player:set_eye_offset(eye_offset, {x=0, y=0, z=0}) + minetest.after(0.2, function() + default.player_set_animation(player, "sit" , 30) + end) + player:set_look_yaw(entity.object:getyaw() - rot_view) +end + +function lib_mount.detach(player, offset) + force_detach(player) + default.player_set_animation(player, "stand" , 30) + local pos = player:getpos() + pos = {x = pos.x + offset.x, y = pos.y + 0.2 + offset.y, z = pos.z + offset.z} + minetest.after(0.1, function() + player:setpos(pos) + end) +end + +local aux_timer = 0 + +function lib_mount.drive(entity, dtime, is_mob, moving_anim, stand_anim, jump_height, can_fly) + aux_timer = aux_timer + dtime + + if can_fly and can_fly == true then + jump_height = 0 + end + + local rot_steer, rot_view = math.pi/2, 0 + if entity.player_rotation.y == 90 then + rot_steer, rot_view = 0, math.pi/2 + end + + local acce_y = 0 + + local velo = entity.object:getvelocity() + entity.v = get_v(velo) * get_sign(entity.v) + + -- process controls + if entity.driver then + local ctrl = entity.driver:get_player_control() + if ctrl.aux1 then + if aux_timer >= 0.2 then + entity.mouselook = not entity.mouselook + aux_timer = 0 + end + end + if ctrl.up then + if get_sign(entity.v) >= 0 then + entity.v = entity.v + entity.accel/10 + else + entity.v = entity.v + entity.braking/10 + end + elseif ctrl.down then + if entity.max_speed_reverse == 0 and entity.v == 0 then return end + if get_sign(entity.v) < 0 then + entity.v = entity.v - entity.accel/10 + else + entity.v = entity.v - entity.braking/10 + end + end + if entity.mouselook then + if ctrl.left then + entity.object:setyaw(entity.object:getyaw()+get_sign(entity.v)*math.rad(1+dtime)*entity.turn_spd) + elseif ctrl.right then + entity.object:setyaw(entity.object:getyaw()-get_sign(entity.v)*math.rad(1+dtime)*entity.turn_spd) + end + else + entity.object:setyaw(entity.driver:get_look_yaw() - rot_steer) + end + if ctrl.jump then + if jump_height > 0 and velo.y == 0 then + velo.y = velo.y + (jump_height * 3) + 1 + acce_y = acce_y + (acce_y * 3) + 1 + end + if can_fly and can_fly == true then + velo.y = velo.y + 1 + acce_y = acce_y + 1 + end + end + if ctrl.sneak then + if can_fly and can_fly == true then + velo.y = velo.y - 1 + acce_y = acce_y - 1 + end + end + end + + -- if not moving then set animation and return + if entity.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then + if is_mob and mobs_redo == true then + if stand_anim and stand_anim ~= nil then + set_animation(entity, stand_anim) + end + end + return + end + + -- set animation + if is_mob and mobs_redo == true then + if moving_anim and moving_anim ~= nil then + set_animation(entity, moving_anim) + end + end + + -- Stop! + local s = get_sign(entity.v) + entity.v = entity.v - 0.02 * s + if s ~= get_sign(entity.v) then + entity.object:setvelocity({x=0, y=0, z=0}) + entity.v = 0 + return + end + + -- enforce speed limit forward and reverse + local max_spd = entity.max_speed_reverse + if get_sign(entity.v) >= 0 then + max_spd = entity.max_speed_forward + end + if math.abs(entity.v) > max_spd then + entity.v = entity.v - get_sign(entity.v) + end + + -- Set position, velocity and acceleration + local p = entity.object:getpos() + local new_velo = {x=0, y=0, z=0} + local new_acce = {x=0, y=-9.8, z=0} + + p.y = p.y - 0.5 + local ni = node_is(p) + local v = entity.v + if ni == "air" then + if can_fly == true then + new_acce.y = 0 + end + elseif ni == "liquid" then + if entity.terrain_type == 2 or entity.terrain_type == 3 then + new_acce.y = 0 + p.y = p.y + 1 + if node_is(p) == "liquid" then + if velo.y >= 5 then + velo.y = 5 + elseif velo.y < 0 then + new_acce.y = 20 + else + new_acce.y = 5 + end + else + if math.abs(velo.y) < 1 then + local pos = entity.object:getpos() + pos.y = math.floor(pos.y) + 0.5 + entity.object:setpos(pos) + velo.y = 0 + end + end + else + v = v*0.25 + end +-- elseif ni == "walkable" then +-- v = 0 +-- new_acce.y = 1 + end + + new_velo = get_velocity(v, entity.object:getyaw() - rot_view, velo.y) + new_acce.y = new_acce.y + acce_y + + entity.object:setvelocity(new_velo) + entity.object:setacceleration(new_acce) + + -- CRASH! + if enable_crash then + local intensity = entity.v2 - v + if intensity >= crash_threshold then + if is_mob then + entity.object:set_hp(entity.object:get_hp() - intensity) + else + if entity.driver then + local drvr = entity.driver + lib_mount.detach(drvr, {x=0, y=0, z=0}) + drvr:setvelocity(new_velo) + drvr:set_hp(drvr:get_hp() - intensity) + end + if entity.passenger then + local pass = entity.passenger + lib_mount.detach(pass, {x=0, y=0, z=0}) + pass:setvelocity(new_velo) + pass:set_hp(pass:get_hp() - intensity) + end + local pos = entity.object:getpos() + minetest.add_item(pos, entity.drop_on_destroy) + entity.removed = true + -- delay remove to ensure player is detached + minetest.after(0.1, function() + entity.object:remove() + end) + end + end + end + + entity.v2 = v +end diff --git a/mods/mob-engine/API.txt b/mods/mob-engine/API.txt new file mode 100644 index 00000000..d16d8e3d --- /dev/null +++ b/mods/mob-engine/API.txt @@ -0,0 +1,202 @@ +Creatures MOB-Engine API +------------------------ + +creatures.register_mob(#Creature definition) + -registers a mob at MOB-Engine; returns true when sucessfull + +creatures.rnd(chance_table) + -returns a weighted random table element; chance_sum of table must be 1 + ^ example: creatures.rnd({elem1 = {chance = 0.7}, {elem2 = {chance = 0.3}}) + +creatures.compare_pos(pos1, pos2) + -returns true if pos1 == pos2 + +creatures.findTarget(search_obj, pos, radius, search_type, mob_name, xray, no_count) + -returns table of found objects (as ObjectRef) and boolean player_near + ^ search_obj is searching object; can be nil + ^ pos is starting position for search radius + ^ radius for searching in blocks/node + ^ search_type that specifies returned object requirements + ^ "all" -- returns every object except dropped Items + ^ "hostile" -- returns every object(creature) that has hostile setting or is player + ^ ignores "mob_type" if specified + ^ "nonhostile" -- returns every object that is not hostile or player + ^ "player" -- returns all players + ^ "mates" -- returns all objects(creatures) that are of same kind + ^ requires "mob_type" specifies + ^ mob_type specifies creature that is ignored or searched, depending on search_type + ^ xray allows searching through blocks/nodes (default == false) + ^ no_count skips collecting loop and returns just the boolean player_near + ^ table is empty + +creatures.dropItems(pos, drops) + -drops items at position pos + ^ pos where to drop Items + ^ drops table in #ItemDrops format + + +#ItemDrops +---------- +{ + { + , -- e.g. "default:wood" + , -- either a or table in format {min = , max = }; optional + -- "chance = ": between 0.0 and 1.0 + }, +} + +Example: +Will drop with a chance of 30% 1 to 3 items of type "default:wood" +and with a chance of 100% 2 items of type "default:stone" +{ + {"default:wood", {min = 1, max = 3}, chance = 0.3}, + {"default:stone", 2} +} + + +#Creature definition +-------------------- +{ + name = "", -- e.g. "creatures:sheep" + stats = { + hp = 1, -- 1 HP = "1/2 player heart" + hostile = false, -- is mob hostile (required for mode "attack") + lifetime = 300, -- after which time mob despawns, in seconds + dies_when_tamed = false, -- stop despawn when tamed + can_jump = 1, -- height in nodes + can_swim = false, -- can mob swim or will it drown + can_fly = false, -- allows to fly (requires mode "fly") and disable step sounds + can_burn = false, -- takes damage of lava + can_panic = false, -- runs fast around when hit (requires mode "walk") + has_falldamage = false, -- deals damage if falling more than 3 blocks + has_kockback = false, -- get knocked back when hit + sneaky = false, -- disables step sounds + light = {min, max}, -- which light level will burn creature (requires can_burn = true) + }, + + modes = { + idle = {chance = , duration =