diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1b5098a4f1..4c9bf3e384 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,17 +52,17 @@ Each mod must provide `mod.conf`. Each mod which add API functions should store functions inside a global table named like the mod. Public functions should not use self references but rather just access the table directly. Functions should be defined in this way: -``` +```lua function mcl_xyz.stuff(param) end ``` Insteed of this way: -``` +```lua mcl_xyz.stuff = function(param) end ``` Indentation must be unified, more likely with tabs. Time sensitive mods should make a local copy of most used API functions to improve performances. -``` +```lua local vector = vector local get_node = minetest.get_node ``` diff --git a/README.md b/README.md index aeab8ab1a6..034d381ab8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# (Currently in feature freeze) - # MineClone 2 An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. Developed by many people. Not developed or endorsed by Mojang AB. @@ -77,15 +75,16 @@ To install MineClone 2 (if you haven't already), move this directory into the “games” directory of your Minetest data directory. Consult the help of Minetest to learn more. -## Reporting bugs -Please report all bugs and missing Minecraft features here: +## Useful links +The MineClone2 repository is hosted at Mesehub. To contribute or report issues, head there. - - -## Chatting with the community -Join our discord server at: - - +* Mesehub: +* Discord: +* YouTube +* IRC: +* Matrix: +* Reddit: +* Minetest forums: ## Project description The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software. diff --git a/mods/CORE/_mcl_autogroup/init.lua b/mods/CORE/_mcl_autogroup/init.lua index ba8b659c00..e04fb2eac5 100644 --- a/mods/CORE/_mcl_autogroup/init.lua +++ b/mods/CORE/_mcl_autogroup/init.lua @@ -207,6 +207,10 @@ end function mcl_autogroup.can_harvest(nodename, toolname) local ndef = minetest.registered_nodes[nodename] + if not ndef then + return false + end + if minetest.get_item_group(nodename, "dig_immediate") >= 2 then return true end diff --git a/mods/HUD/mcl_credits/init.lua b/mods/HUD/mcl_credits/init.lua index 2943738753..235b2a3cbd 100644 --- a/mods/HUD/mcl_credits/init.lua +++ b/mods/HUD/mcl_credits/init.lua @@ -1,23 +1,26 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) + mcl_credits = { players = {}, } -mcl_credits.description = "A faithful Open Source clone of Minecraft" +mcl_credits.description = S("A faithful Open Source clone of Minecraft") -- Sub-lists are sorted by number of commits, but the list should not be rearranged (-> new contributors are just added at the end of the list) mcl_credits.people = { - {"Creator of MineClone", 0x0A9400, { + { S("Creator of MineClone"), 0x0A9400, { "davedevils", }}, - {"Creator of MineClone2", 0xFBF837, { + { S("Creator of MineClone2"), 0xFBF837, { "Wuzzy", }}, - {"Maintainers", 0xFF51D5, { + { S("Maintainers"), 0xFF51D5, { "Fleckenstein", "kay27", "oilboi", }}, - {"Developers", 0xF84355, { + { S("Developers"), 0xF84355, { "bzoss", "AFCMS", "epCode", @@ -30,7 +33,7 @@ mcl_credits.people = { "Code-Sploit", "NO11", }}, - {"Contributors", 0x52FF00, { + { S("Contributors"), 0x52FF00, { "Laurent Rocher", "HimbeerserverDE", "TechDudie", @@ -64,7 +67,7 @@ mcl_credits.people = { "NO11", "j45", }}, - {"Original Mod Authors", 0x343434, { + { S("Original Mod Authors"), 0x343434, { "Wuzzy", "Fleckenstein", "BlockMen", @@ -96,12 +99,12 @@ mcl_credits.people = { "jordan4ibanez", "paramat", }}, - {"3D Models", 0x0019FF, { + { S("3D Models"), 0x0019FF, { "22i", "tobyplowy", "epCode", }}, - {"Textures", 0xFF9705, { + { S("Textures"), 0xFF9705, { "XSSheep", "Wuzzy", "kingoscargames", @@ -110,7 +113,7 @@ mcl_credits.people = { "yutyo", "NO11", }}, - {"Translations", 0x00FF60, { + { S("Translations"), 0x00FF60, { "Wuzzy", "Rocher Laurent", "wuniversales", @@ -142,7 +145,7 @@ function mcl_credits.show(player) ids = { player:hud_add({ hud_elem_type = "image", - text = "menu_bg.png", + text = "credits_bg.png", position = {x = 0, y = 0}, alignment = {x = 1, y = 1}, scale = {x = -100, y = -100}, @@ -150,13 +153,22 @@ function mcl_credits.show(player) }), player:hud_add({ hud_elem_type = "text", - text = "Sneak to skip", + text = S("Sneak to skip"), position = {x = 1, y = 1}, alignment = {x = -1, y = -1}, offset = {x = -5, y = -5}, z_index = 1001, number = 0xFFFFFF, - }) + }), + player:hud_add({ + hud_elem_type = "text", + text = " "..S("Jump to speed up (additionally sprint)"), + position = {x = 0, y = 1}, + alignment = {x = 1, y = -1}, + offset = {x = -5, y = -5}, + z_index = 1002, + number = 0xFFFFFF, + }), }, } add_hud_element({ @@ -216,13 +228,22 @@ end) minetest.register_globalstep(function(dtime) for _, huds in pairs(mcl_credits.players) do local player = huds.player - if not huds.new and player:get_player_control().sneak then + local control = player:get_player_control() + if not huds.new and control.sneak then mcl_credits.hide(player) else local moving = {} local any for id, y in pairs(huds.moving) do y = y - 1 + + if control.jump then + y = y - 2 + if control.aux1 then + y = y - 5 + end + end + if y > -100 then if id == huds.icon then y = math.max(400, y) diff --git a/mods/HUD/mcl_credits/locale/mcl_credits.de.tr b/mods/HUD/mcl_credits/locale/mcl_credits.de.tr new file mode 100644 index 0000000000..6a38d18e62 --- /dev/null +++ b/mods/HUD/mcl_credits/locale/mcl_credits.de.tr @@ -0,0 +1,13 @@ +# textdomain: mcl_credits +3D Models=3D Modelle +A faithful Open Source clone of Minecraft=Ein treuer Open-Source-Klon von Minecraft +Contributors=Mitwirkende +Creator of MineClone=Schöpfer von MineClone +Creator of MineClone2=Schöpfer von MineClone2 +Developers=Entwickler +Jump to speed up (additionally sprint)=Springen, um zu beschleunigen (zusätzlich sprinten) +Maintainers=Betreuer +Original Mod Authors=Original-Mod-Autoren +Sneak to skip=Schleichen zum Überspringen +Textures=Texturen +Translations=Übersetzungen diff --git a/mods/HUD/mcl_credits/locale/template.txt b/mods/HUD/mcl_credits/locale/template.txt new file mode 100644 index 0000000000..3ee9fa56c2 --- /dev/null +++ b/mods/HUD/mcl_credits/locale/template.txt @@ -0,0 +1,14 @@ +# textdomain: mcl_credits +3D Models= +A faithful Open Source clone of Minecraft= +Contributors= +Creator of MineClone= +Creator of MineClone2= +Developers= +Jump to speed up (additionally sprint)= +Maintainers= +MineClone5= +Original Mod Authors= +Sneak to skip= +Textures= +Translations= diff --git a/mods/HUD/mcl_credits/textures/credits_bg.png b/mods/HUD/mcl_credits/textures/credits_bg.png new file mode 100644 index 0000000000..ad74cbd307 Binary files /dev/null and b/mods/HUD/mcl_credits/textures/credits_bg.png differ diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index 6eac1c329a..ff9cccf9e1 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -27,10 +27,9 @@ local function replace_enchanted_books(tbl) end end ---[[ Populate all the item tables. We only do this once. Note this mod must be -loaded after _mcl_autogroup for this to work, because it required certain -groups to be set. ]] -do +--[[ Populate all the item tables. We only do this once. Note this code must be +executed after loading all the other mods in order to work. ]] +minetest.register_on_mods_loaded(function() for name,def in pairs(minetest.registered_items) do if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then local function is_redstone(def) @@ -108,7 +107,7 @@ do table.sort(to_sort) replace_enchanted_books(to_sort) end -end +end) local function filter_item(name, description, lang, filter) local desc diff --git a/mods/HUD/mcl_inventory/mod.conf b/mods/HUD/mcl_inventory/mod.conf index 7585d9f709..10e6692659 100644 --- a/mods/HUD/mcl_inventory/mod.conf +++ b/mods/HUD/mcl_inventory/mod.conf @@ -1,6 +1,5 @@ name = mcl_inventory author = BlockMen description = Adds the player inventory and creative inventory. -depends = mcl_init, mcl_formspec, mcl_player -optional_depends = _mcl_autogroup, mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide - +depends = mcl_init, mcl_formspec, mcl_enchanting +optional_depends = mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide, mcl_player diff --git a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua index ee7f29016f..7c2c073939 100644 --- a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua @@ -129,8 +129,13 @@ local dispenserdef = { dropitem:set_count(1) local stack_id = stacks[r].stackpos local stackdef = stack:get_definition() + + if not stackdef then + return + end + local iname = stack:get_name() - local igroups = minetest.registered_items[iname].groups + local igroups = stackdef.groups --[===[ Dispense item ]===] diff --git a/mods/ITEMS/mcl_armor/mod.conf b/mods/ITEMS/mcl_armor/mod.conf index 9264e8362f..fad2e494c5 100644 --- a/mods/ITEMS/mcl_armor/mod.conf +++ b/mods/ITEMS/mcl_armor/mod.conf @@ -1,5 +1,5 @@ name = mcl_armor author = stu description = Adds craftable armor that is visible to other players. -depends = mcl_core, mcl_player, mcl_enchanting +depends = mcl_core, mcl_player, mcl_enchanting, mcl_damage optional_depends = mcl_fire, ethereal, bakedclay diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d b/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d index 95f763eab2..b3a943f467 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d and b/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend b/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend index a5626aaccb..a613eef893 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend and b/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d index 1b4205344e..4e17ee3410 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d and b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend index 828cd942cc..b0494efbff 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend and b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend differ diff --git a/mods/ITEMS/mcl_armor/player.lua b/mods/ITEMS/mcl_armor/player.lua index 9dba0773c2..48fdb381f8 100644 --- a/mods/ITEMS/mcl_armor/player.lua +++ b/mods/ITEMS/mcl_armor/player.lua @@ -25,6 +25,8 @@ mcl_player.player_register_model("mcl_armor_character.b3d", { sit_mount = {x=484, y=484}, die = {x=498, y=498}, fly = {x=502, y=581}, + bow_walk = {x=650, y=670}, + bow_sneak = {x=675, y=695}, }, }) @@ -55,6 +57,8 @@ mcl_player.player_register_model("mcl_armor_character_female.b3d", { sit_mount = {x=484, y=484}, die = {x=498, y=498}, fly = {x=502, y=581}, + bow_walk = {x=650, y=670}, + bow_sneak = {x=675, y=695}, }, }) diff --git a/mods/ITEMS/mcl_brewing/mod.conf b/mods/ITEMS/mcl_brewing/mod.conf index 2c27c979e7..0f6217f098 100644 --- a/mods/ITEMS/mcl_brewing/mod.conf +++ b/mods/ITEMS/mcl_brewing/mod.conf @@ -1,4 +1,4 @@ name = mcl_brewing author = bzoss depends = mcl_init, mcl_formspec, mcl_sounds, mcl_potions, mcl_mobitems -optional_depends = mcl_core, doc, screwdriver +optional_depends = mcl_core, doc, screwdriver, mesecons_mvps diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 6e1a977d93..eceb81c514 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -203,7 +203,8 @@ minetest.register_abm({ chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) for _,object in pairs(minetest.get_objects_inside_radius(pos, 0.9)) do - if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then + local entity = object:get_luaentity() + if entity and entity.name == "__builtin:item" then object:remove() end end diff --git a/mods/ITEMS/mcl_crafting_table/init.lua b/mods/ITEMS/mcl_crafting_table/init.lua index 58b46d6689..eae503eeb2 100644 --- a/mods/ITEMS/mcl_crafting_table/init.lua +++ b/mods/ITEMS/mcl_crafting_table/init.lua @@ -6,6 +6,7 @@ local text_color = "#313131" local itemslot_bg = mcl_formspec.get_itemslot_bg mcl_crafting_table = {} + function mcl_crafting_table.show_crafting_form(player) player:get_inventory():set_width("craft", 3) player:get_inventory():set_size("craft", 9) @@ -30,7 +31,6 @@ function mcl_crafting_table.show_crafting_form(player) ) end -local show_crafting_form = mcl_crafting_table.show_crafting_form --cache function for better performances minetest.register_node("mcl_crafting_table:crafting_table", { description = S("Crafting Table"), _tt_help = S("3×3 crafting grid"), @@ -43,7 +43,9 @@ minetest.register_node("mcl_crafting_table:crafting_table", { paramtype2 = "facedir", groups = {handy=1,axey=1, deco_block=1, material_wood=1,flammable=-1}, on_rightclick = function(pos, node, player, itemstack) - show_crafting_form(player) + if not player:get_player_control().sneak then + mcl_crafting_table.show_crafting_form(player) + end end, sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 2.5, diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index 6cf2f0014b..a3c7697410 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -212,6 +212,10 @@ minetest.register_globalstep(function(dtime) player_set_animation(player, "swim_walk_mine", animation_speed_mod) elseif not controls.sneak and head_in_water and is_sprinting == true then player_set_animation(player, "swim_walk", animation_speed_mod) + elseif string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB and controls.sneak then + player_set_animation(player, "bow_sneak", animation_speed_mod) + elseif string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB then + player_set_animation(player, "bow_walk", animation_speed_mod) elseif is_sprinting == true and get_mouse_button(player) == true and not controls.sneak and not head_in_water then player_set_animation(player, "run_walk_mine", animation_speed_mod) elseif get_mouse_button(player) == true and not controls.sneak then diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 1e1354ae0d..1f881d2b6d 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -51,6 +51,15 @@ local function player_collision(player) return {x,z} end +local function walking_player(player, control) + if control.up or control.down or control.left or control.right then + return true + else + return false + end +end + + -- converts yaw to degrees local function degrees(rad) return rad * 180.0 / math.pi @@ -217,8 +226,9 @@ minetest.register_globalstep(function(dtime) player_velocity_old = player:get_velocity() or player:get_player_velocity() + -- controls right and left arms pitch when shooting a bow - if string.find(wielded:get_name(), "mcl_bows:bow") and control.RMB and not control.LMB and not control.up and not control.down and not control.left and not control.right then + if string.find(wielded:get_name(), "mcl_bows:bow") and control.RMB then player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch+90,-30,pitch * -1 * .35)) player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3.5,5.785,0), vector.new(pitch+90,43,pitch * .35)) -- when punching diff --git a/mods/PLAYER/mcl_playerplus/mod.conf b/mods/PLAYER/mcl_playerplus/mod.conf index 6989957d77..b77c9e2e5e 100644 --- a/mods/PLAYER/mcl_playerplus/mod.conf +++ b/mods/PLAYER/mcl_playerplus/mod.conf @@ -1,5 +1,5 @@ name = mcl_playerplus author = TenPlus1 description = Adds some simple player-related gameplay effects: Hurt by touching a cactus, suffocation and more. -depends = mcl_init, mcl_core, mcl_particles, mcl_hunger, playerphysics, mcl_playerinfo, mcl_weather, mcl_spawn, mcl_enchanting, mcl_damage +depends = mcl_init, mcl_core, mcl_particles, mcl_hunger, playerphysics, mcl_playerinfo, mcl_weather, mcl_spawn, mcl_enchanting, mcl_damage, mcl_sprint