Merge remote-tracking branch 'origin/master' into mineclone5

This commit is contained in:
kay27 2021-07-13 01:00:03 +04:00
commit 56a82d5a82
23 changed files with 118 additions and 54 deletions

@ -1,5 +1,3 @@
# (Currently in feature freeze)
# MineClone 2 # MineClone 2
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
Developed by many people. Not developed or endorsed by Mojang AB. 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 “games” directory of your Minetest data directory. Consult the help of
Minetest to learn more. Minetest to learn more.
## Reporting bugs ## Useful links
Please report all bugs and missing Minecraft features here: The MineClone2 repository is hosted at Mesehub. To contribute or report issues, head there.
<https://git.minetest.land/MineClone2/MineClone2/issues> * Mesehub: <https://git.minetest.land/MineClone2/MineClone2>
* Discord: <https://discord.gg/xE4z8EEpDC>
## Chatting with the community * YouTube <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A>
Join our discord server at: * IRC: <https://web.libera.chat/#mineclone2>
* Matrix: <https://app.element.io/#/room/#mc2:matrix.org>
<https://discord.gg/xE4z8EEpDC> * Reddit: <https://www.reddit.com/r/MineClone2/>
* Minetest forums: <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
## Project description ## Project description
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software. The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.

@ -207,6 +207,10 @@ end
function mcl_autogroup.can_harvest(nodename, toolname) function mcl_autogroup.can_harvest(nodename, toolname)
local ndef = minetest.registered_nodes[nodename] local ndef = minetest.registered_nodes[nodename]
if not ndef then
return false
end
if minetest.get_item_group(nodename, "dig_immediate") >= 2 then if minetest.get_item_group(nodename, "dig_immediate") >= 2 then
return true return true
end end

@ -19,7 +19,10 @@ local function deal_falling_damage(self, dtime)
end end
self._hit = self._hit or {} self._hit = self._hit or {}
for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
if mcl_util.get_hp(obj) > 0 and not self._hit[obj] then local entity = obj:get_luaentity()
if entity and entity.name == "__builtin:item" then
obj:remove()
elseif mcl_util.get_hp(obj) > 0 and not self._hit[obj] then
self._hit[obj] = true self._hit[obj] = true
local way = self._startpos.y - pos.y local way = self._startpos.y - pos.y
local damage = (way - 1) * 2 local damage = (way - 1) * 2

@ -155,7 +155,7 @@ end
local custom_crafts, craft_types = {}, {} local custom_crafts, craft_types = {}, {}
function mcl_craftguide.register_craft_type(name, def) function mcl_craftguide.register_craft_type(name, def)
local func = "mcl_craftguide.register_craft_guide(): " local func = "mcl_craftguide.register_craft_type(): "
assert(name, func .. "'name' field missing") assert(name, func .. "'name' field missing")
assert(def.description, func .. "'description' field missing") assert(def.description, func .. "'description' field missing")
assert(def.icon, func .. "'icon' field missing") assert(def.icon, func .. "'icon' field missing")

@ -1,23 +1,26 @@
local modname = minetest.get_current_modname()
local S = minetest.get_translator(modname)
mcl_credits = { mcl_credits = {
players = {}, 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) -- 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 = { mcl_credits.people = {
{"Creator of MineClone", 0x0A9400, { { S("Creator of MineClone"), 0x0A9400, {
"davedevils", "davedevils",
}}, }},
{"Creator of MineClone2", 0xFBF837, { { S("Creator of MineClone2"), 0xFBF837, {
"Wuzzy", "Wuzzy",
}}, }},
{"Maintainers", 0xFF51D5, { { S("Maintainers"), 0xFF51D5, {
"Fleckenstein", "Fleckenstein",
"kay27", "kay27",
"oilboi", "oilboi",
}}, }},
{"Developers", 0xF84355, { { S("Developers"), 0xF84355, {
"bzoss", "bzoss",
"AFCMS", "AFCMS",
"epCode", "epCode",
@ -30,7 +33,7 @@ mcl_credits.people = {
"Code-Sploit", "Code-Sploit",
"NO11", "NO11",
}}, }},
{"Contributors", 0x52FF00, { { S("Contributors"), 0x52FF00, {
"Laurent Rocher", "Laurent Rocher",
"HimbeerserverDE", "HimbeerserverDE",
"TechDudie", "TechDudie",
@ -64,7 +67,7 @@ mcl_credits.people = {
"NO11", "NO11",
"j45", "j45",
}}, }},
{"Original Mod Authors", 0x343434, { { S("Original Mod Authors"), 0x343434, {
"Wuzzy", "Wuzzy",
"Fleckenstein", "Fleckenstein",
"BlockMen", "BlockMen",
@ -96,12 +99,12 @@ mcl_credits.people = {
"jordan4ibanez", "jordan4ibanez",
"paramat", "paramat",
}}, }},
{"3D Models", 0x0019FF, { { S("3D Models"), 0x0019FF, {
"22i", "22i",
"tobyplowy", "tobyplowy",
"epCode", "epCode",
}}, }},
{"Textures", 0xFF9705, { { S("Textures"), 0xFF9705, {
"XSSheep", "XSSheep",
"Wuzzy", "Wuzzy",
"kingoscargames", "kingoscargames",
@ -110,7 +113,7 @@ mcl_credits.people = {
"yutyo", "yutyo",
"NO11", "NO11",
}}, }},
{"Translations", 0x00FF60, { { S("Translations"), 0x00FF60, {
"Wuzzy", "Wuzzy",
"Rocher Laurent", "Rocher Laurent",
"wuniversales", "wuniversales",
@ -142,7 +145,7 @@ function mcl_credits.show(player)
ids = { ids = {
player:hud_add({ player:hud_add({
hud_elem_type = "image", hud_elem_type = "image",
text = "menu_bg.png", text = "credits_bg.png",
position = {x = 0, y = 0}, position = {x = 0, y = 0},
alignment = {x = 1, y = 1}, alignment = {x = 1, y = 1},
scale = {x = -100, y = -100}, scale = {x = -100, y = -100},
@ -150,13 +153,22 @@ function mcl_credits.show(player)
}), }),
player:hud_add({ player:hud_add({
hud_elem_type = "text", hud_elem_type = "text",
text = "Sneak to skip", text = S("Sneak to skip"),
position = {x = 1, y = 1}, position = {x = 1, y = 1},
alignment = {x = -1, y = -1}, alignment = {x = -1, y = -1},
offset = {x = -5, y = -5}, offset = {x = -5, y = -5},
z_index = 1001, z_index = 1001,
number = 0xFFFFFF, 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({ add_hud_element({
@ -216,13 +228,22 @@ end)
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
for _, huds in pairs(mcl_credits.players) do for _, huds in pairs(mcl_credits.players) do
local player = huds.player 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) mcl_credits.hide(player)
else else
local moving = {} local moving = {}
local any local any
for id, y in pairs(huds.moving) do for id, y in pairs(huds.moving) do
y = y - 1 y = y - 1
if control.jump then
y = y - 2
if control.aux1 then
y = y - 5
end
end
if y > -100 then if y > -100 then
if id == huds.icon then if id == huds.icon then
y = math.max(400, y) y = math.max(400, y)

@ -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

@ -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=

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

@ -27,10 +27,9 @@ local function replace_enchanted_books(tbl)
end end
end end
--[[ Populate all the item tables. We only do this once. Note this mod must be --[[ Populate all the item tables. We only do this once. Note this code must be
loaded after _mcl_autogroup for this to work, because it required certain executed after loading all the other mods in order to work. ]]
groups to be set. ]] minetest.register_on_mods_loaded(function()
do
for name,def in pairs(minetest.registered_items) do 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 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) local function is_redstone(def)
@ -108,7 +107,7 @@ do
table.sort(to_sort) table.sort(to_sort)
replace_enchanted_books(to_sort) replace_enchanted_books(to_sort)
end end
end end)
local function filter_item(name, description, lang, filter) local function filter_item(name, description, lang, filter)
local desc local desc

@ -1,6 +1,5 @@
name = mcl_inventory name = mcl_inventory
author = BlockMen author = BlockMen
description = Adds the player inventory and creative inventory. description = Adds the player inventory and creative inventory.
depends = mcl_init, mcl_formspec, mcl_player depends = mcl_init, mcl_formspec, mcl_enchanting
optional_depends = _mcl_autogroup, mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide optional_depends = mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide, mcl_player

@ -129,8 +129,13 @@ local dispenserdef = {
dropitem:set_count(1) dropitem:set_count(1)
local stack_id = stacks[r].stackpos local stack_id = stacks[r].stackpos
local stackdef = stack:get_definition() local stackdef = stack:get_definition()
if not stackdef then
return
end
local iname = stack:get_name() local iname = stack:get_name()
local igroups = minetest.registered_items[iname].groups local igroups = stackdef.groups
--[===[ Dispense item ]===] --[===[ Dispense item ]===]

@ -25,6 +25,8 @@ mcl_player.player_register_model("mcl_armor_character.b3d", {
sit_mount = {x=484, y=484}, sit_mount = {x=484, y=484},
die = {x=498, y=498}, die = {x=498, y=498},
fly = {x=502, y=581}, 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}, sit_mount = {x=484, y=484},
die = {x=498, y=498}, die = {x=498, y=498},
fly = {x=502, y=581}, fly = {x=502, y=581},
bow_walk = {x=650, y=670},
bow_sneak = {x=675, y=695},
}, },
}) })

@ -573,7 +573,7 @@ for colorid, colortab in pairs(mcl_banners.colors) do
end, end,
}) })
if mod_mcl_core and minetest.get_modpath("mcl_wool") then if mod_mcl_core and minetest.get_modpath("mcl_wool") and pattern_name == "" then
minetest.register_craft({ minetest.register_craft({
output = itemstring, output = itemstring,
recipe = { recipe = {

@ -8,9 +8,6 @@ local N = function(s) return s end
-- Maximum number of layers which can be put on a banner by crafting. -- Maximum number of layers which can be put on a banner by crafting.
local max_layers_crafting = 12 local max_layers_crafting = 12
-- Maximum number of layers when banner includes a gradient (workaround, see below).
local max_layers_gradient = 3
-- Max. number lines in the descriptions for the banner layers. -- Max. number lines in the descriptions for the banner layers.
-- This is done to avoid huge tooltips. -- This is done to avoid huge tooltips.
local max_layer_lines = 6 local max_layer_lines = 6
@ -398,16 +395,6 @@ local function banner_pattern_craft(itemstack, player, old_craft_grid, craft_inv
if #layers >= max_layers_crafting then if #layers >= max_layers_crafting then
return ItemStack("") return ItemStack("")
end end
-- Lower layer limit when banner includes any gradient.
-- Workaround to circumvent Minetest bug (https://github.com/minetest/minetest/issues/6210)
-- TODO: Remove this restriction when bug #6210 is fixed.
if #layers >= max_layers_gradient then
for l=1, #layers do
if layers[l].pattern == "gradient" or layers[l].pattern == "gradient_up" then
return ItemStack("")
end
end
end
local matching_pattern local matching_pattern
local max_i = player:get_inventory():get_size("craft") local max_i = player:get_inventory():get_size("craft")

@ -1041,7 +1041,7 @@ for i=1,8 do
drop = "mcl_throwing:snowball "..(i+1), drop = "mcl_throwing:snowball "..(i+1),
_mcl_blast_resistance = 0.1, _mcl_blast_resistance = 0.1,
_mcl_hardness = 0.1, _mcl_hardness = 0.1,
_mcl_silk_touch_drop = {"mcl_core:snow " .. (i+1)}, _mcl_silk_touch_drop = {"mcl_core:snow " .. i},
}) })
end end

@ -6,6 +6,7 @@ local text_color = "#313131"
local itemslot_bg = mcl_formspec.get_itemslot_bg local itemslot_bg = mcl_formspec.get_itemslot_bg
mcl_crafting_table = {} mcl_crafting_table = {}
function mcl_crafting_table.show_crafting_form(player) function mcl_crafting_table.show_crafting_form(player)
player:get_inventory():set_width("craft", 3) player:get_inventory():set_width("craft", 3)
player:get_inventory():set_size("craft", 9) player:get_inventory():set_size("craft", 9)
@ -30,7 +31,6 @@ function mcl_crafting_table.show_crafting_form(player)
) )
end end
local show_crafting_form = mcl_crafting_table.show_crafting_form --cache function for better performances
minetest.register_node("mcl_crafting_table:crafting_table", { minetest.register_node("mcl_crafting_table:crafting_table", {
description = S("Crafting Table"), description = S("Crafting Table"),
_tt_help = S("3×3 crafting grid"), _tt_help = S("3×3 crafting grid"),
@ -43,7 +43,9 @@ minetest.register_node("mcl_crafting_table:crafting_table", {
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {handy=1,axey=1, deco_block=1, material_wood=1,flammable=-1}, groups = {handy=1,axey=1, deco_block=1, material_wood=1,flammable=-1},
on_rightclick = function(pos, node, player, itemstack) 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, end,
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5, _mcl_blast_resistance = 2.5,

@ -7,7 +7,7 @@ Blast Protection=Protection contre les explosions
Reduces explosion damage and knockback.=Réduit les dégâts d'explosion et de recul. Reduces explosion damage and knockback.=Réduit les dégâts d'explosion et de recul.
Channeling=Canalisation Channeling=Canalisation
Channels a bolt of lightning toward a target. Works only during thunderstorms and if target is unobstructed with opaque blocks.=Canalise un éclair vers une cible. Fonctionne uniquement pendant les orages et si la cible n'est pas obstruée par des blocs opaques. Channels a bolt of lightning toward a target. Works only during thunderstorms and if target is unobstructed with opaque blocks.=Canalise un éclair vers une cible. Fonctionne uniquement pendant les orages et si la cible n'est pas obstruée par des blocs opaques.
Curse of Binding=Malédiction du lien éterne Curse of Binding=Malédiction du lien éternel
Item cannot be removed from armor slots except due to death, breaking or in Creative Mode.=L'objet ne peut pas être retiré des emplacements d'armure sauf en cas de mort, de rupture ou en mode créatif. Item cannot be removed from armor slots except due to death, breaking or in Creative Mode.=L'objet ne peut pas être retiré des emplacements d'armure sauf en cas de mort, de rupture ou en mode créatif.
Curse of Vanishing=Malédiction de disparition Curse of Vanishing=Malédiction de disparition
Item destroyed on death.=Objet détruit à la mort. Item destroyed on death.=Objet détruit à la mort.

@ -212,6 +212,10 @@ minetest.register_globalstep(function(dtime)
player_set_animation(player, "swim_walk_mine", animation_speed_mod) player_set_animation(player, "swim_walk_mine", animation_speed_mod)
elseif not controls.sneak and head_in_water and is_sprinting == true then elseif not controls.sneak and head_in_water and is_sprinting == true then
player_set_animation(player, "swim_walk", animation_speed_mod) 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 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) player_set_animation(player, "run_walk_mine", animation_speed_mod)
elseif get_mouse_button(player) == true and not controls.sneak then elseif get_mouse_button(player) == true and not controls.sneak then

@ -51,6 +51,15 @@ local function player_collision(player)
return {x,z} return {x,z}
end 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 -- converts yaw to degrees
local function degrees(rad) local function degrees(rad)
return rad * 180.0 / math.pi return rad * 180.0 / math.pi
@ -219,8 +228,9 @@ minetest.register_globalstep(function(dtime)
player_velocity_old = player:get_velocity() or player:get_player_velocity() player_velocity_old = player:get_velocity() or player:get_player_velocity()
-- controls right and left arms pitch when shooting a bow -- 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_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)) player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3.5,5.785,0), vector.new(pitch+90,43,pitch * .35))
-- when punching -- when punching