From ce49cd02ac5273a21a673329d28e4ceb32b5db34 Mon Sep 17 00:00:00 2001 From: epCode Date: Sat, 10 Apr 2021 15:41:50 -0700 Subject: [PATCH 1/7] make player collision box MUCH closer to MC --- mods/PLAYER/mcl_playerplus/init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index cbd93ada81..de346256fa 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -210,26 +210,26 @@ minetest.register_globalstep(function(dtime) if parent then local parent_yaw = degrees(parent:get_yaw()) - player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,1.8,0.35}, eye_height = 1.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) + player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,1.8,0.312}, eye_height = 1.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch, -limit_vel_yaw(yaw, parent_yaw) + parent_yaw, 0)) player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,0,0)) elseif controls.sneak then -- controls head pitch when sneaking player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+36,0,0)) -- sets eye height, and nametag color accordingly - player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,1.8,0.35}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 0, g = 225 }}) + player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,1.8,0.312}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 0, g = 225 }}) -- sneaking body conrols player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,0,0)) elseif get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 and is_sprinting(name) == true then -- set head pitch and yaw when swimming player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+90-degrees(dir_to_pitch(player_velocity)),player_vel_yaw - yaw,0)) -- sets eye height, and nametag color accordingly - player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 0.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) + player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,0.8,0.312}, eye_height = 0.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) -- control body bone when swimming player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(degrees(dir_to_pitch(player_velocity)) - 90,-player_vel_yaw + yaw + 180,0)) else -- sets eye height, and nametag color accordingly - player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,1.8,0.35}, eye_height = 1.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) + player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,1.8,0.312}, eye_height = 1.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch, player_vel_yaw - yaw, 0)) player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0, -player_vel_yaw + yaw, 0)) From 2313012f607e11283dcb1a2600eccc7b7a89a02c Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 11 Apr 2021 10:41:11 +0200 Subject: [PATCH 2/7] Fix #1528 --- mods/HUD/mcl_bossbars/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/HUD/mcl_bossbars/init.lua b/mods/HUD/mcl_bossbars/init.lua index a95d533ce1..b5bec1334b 100644 --- a/mods/HUD/mcl_bossbars/init.lua +++ b/mods/HUD/mcl_bossbars/init.lua @@ -60,7 +60,7 @@ function mcl_bossbars.add_bar(player, def, dynamic, priority) bar.id = last_id + 1 last_id = bar.id mcl_bossbars.static[bar.id] = bar - return id + return bar.id end end From af044e6a96fba49bd573eff01be751067403f0e3 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 11 Apr 2021 11:15:09 +0200 Subject: [PATCH 3/7] Bossbars: Add support for non-mob bosses --- mods/HUD/mcl_bossbars/init.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/mods/HUD/mcl_bossbars/init.lua b/mods/HUD/mcl_bossbars/init.lua index b5bec1334b..209d9a2c1c 100644 --- a/mods/HUD/mcl_bossbars/init.lua +++ b/mods/HUD/mcl_bossbars/init.lua @@ -76,16 +76,23 @@ function mcl_bossbars.update_bar(id, def, priority) old.priority = priority or old.priority end -function mcl_bossbars.update_boss(luaentity, name, color) - local object = luaentity.object +function mcl_bossbars.update_boss(object, name, color) + local props = object:get_luaentity() + if not props or not props._cmi_is_mob then + props = object:get_properties() + props.health = object:get_hp() + end + local bardef = { - text = luaentity.nametag, - percentage = math.floor(luaentity.health / luaentity.hp_max * 100), color = color, + text = props.nametag, + percentage = math.floor(props.health / props.hp_max * 100), } + if not bardef.text or bardef.text == "" then bardef.text = name end + local pos = object:get_pos() for _, player in pairs(minetest.get_connected_players()) do local d = vector.distance(pos, player:get_pos()) From 24f8f9166b0dbd6ce86e39dd7646fb2fb1f67877 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 11 Apr 2021 17:29:05 +0200 Subject: [PATCH 4/7] Fix #1528 --- mods/HUD/mcl_bossbars/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/HUD/mcl_bossbars/init.lua b/mods/HUD/mcl_bossbars/init.lua index 209d9a2c1c..08eb527bfb 100644 --- a/mods/HUD/mcl_bossbars/init.lua +++ b/mods/HUD/mcl_bossbars/init.lua @@ -65,7 +65,7 @@ function mcl_bossbars.add_bar(player, def, dynamic, priority) end function mcl_bossbars.remove_bar(id) - mcl_bossbars.static[id].bar.static = false + mcl_bossbars.static[id].bar.id = nil mcl_bossbars.static[id] = nil end From c0a31f0e9c0f90e7fac688f4e345d21466306d0d Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 11 Apr 2021 17:30:32 +0200 Subject: [PATCH 5/7] Fix #1535 --- mods/ENTITIES/mobs_mc/ender_dragon.lua | 2 +- mods/ENTITIES/mobs_mc/wither.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index db29b63ae4..a6f4042754 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -60,7 +60,7 @@ mobs:register_mob("mobs_mc:enderdragon", { }, ignores_nametag = true, do_custom = function(self) - mcl_bossbars.update_boss(self, "Ender Dragon", "light_purple") + mcl_bossbars.update_boss(self.object, "Ender Dragon", "light_purple") for _, obj in ipairs(minetest.get_objects_inside_radius(self.object:get_pos(), 80)) do local luaentity = obj:get_luaentity() if luaentity and luaentity.name == "mcl_end:crystal" then diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index 8e7f7eb95d..2d53cc547f 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -73,7 +73,7 @@ mobs:register_mob("mobs_mc:wither", { self.object:set_properties({textures={self.base_texture}}) self.armor = {undead = 80, fleshy = 80} end - mcl_bossbars.update_boss(self, "Wither", "dark_purple") + mcl_bossbars.update_boss(self.object, "Wither", "dark_purple") end, on_spawn = function(self) minetest.sound_play("mobs_mc_wither_spawn", {object=self.object, gain=1.0, max_hear_distance=64}) From 523a0c54d6ca9cc069d8ca767adf19596b4655f1 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Mon, 12 Apr 2021 14:54:14 +0200 Subject: [PATCH 6/7] Localize c_x and c_y in mcl_playerplus --- mods/PLAYER/mcl_playerplus/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index de346256fa..8c8b784b2a 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -156,7 +156,7 @@ minetest.register_globalstep(function(dtime) for _,player in pairs(get_connected_players()) do - c_x, c_y = unpack(player_collision(player)) + local c_x, c_y = unpack(player_collision(player)) if player:get_velocity().x + player:get_velocity().y < .5 and c_x + c_y > 0 then --minetest.chat_send_player(player:get_player_name(), "pushed at " .. c_x + c_y .. " parsecs.") From db5626fcb480a7ec3fcb1b2dd064cf8b14d2a260 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Mon, 12 Apr 2021 15:05:01 +0200 Subject: [PATCH 7/7] Revert "Make hoe dig some blocks faster" This reverts commit c1e295de5fbe09c2fa6973f14b48dd73b2405eb3. --- mods/ITEMS/mcl_core/init.lua | 1 - mods/ITEMS/mcl_core/nodes_trees.lua | 14 +------------- mods/ITEMS/mcl_farming/hoes.lua | 15 --------------- mods/ITEMS/mcl_farming/wheat.lua | 2 +- mods/ITEMS/mcl_nether/init.lua | 2 +- mods/ITEMS/mcl_ocean/kelp.lua | 2 +- mods/ITEMS/mcl_sponges/init.lua | 4 ++-- 7 files changed, 6 insertions(+), 34 deletions(-) diff --git a/mods/ITEMS/mcl_core/init.lua b/mods/ITEMS/mcl_core/init.lua index 897382e015..b1b2b9d35c 100644 --- a/mods/ITEMS/mcl_core/init.lua +++ b/mods/ITEMS/mcl_core/init.lua @@ -14,7 +14,6 @@ mcl_autogroup.register_diggroup("shearsy_wool") mcl_autogroup.register_diggroup("shearsy_cobweb") mcl_autogroup.register_diggroup("swordy") mcl_autogroup.register_diggroup("swordy_cobweb") -mcl_autogroup.register_diggroup("hoey") -- Load files local modpath = minetest.get_modpath("mcl_core") diff --git a/mods/ITEMS/mcl_core/nodes_trees.lua b/mods/ITEMS/mcl_core/nodes_trees.lua index 4af3eef34c..fd6641552a 100644 --- a/mods/ITEMS/mcl_core/nodes_trees.lua +++ b/mods/ITEMS/mcl_core/nodes_trees.lua @@ -268,19 +268,7 @@ local register_leaves = function(subname, description, longdesc, tiles, sapling, tiles = tiles, paramtype = "light", stack_max = 64, - groups = { - handy=1, - hoey=1, - shearsy=1, - swordy=1, - leafdecay=leafdecay_distance, - flammable=2, - leaves=1, - deco_block=1, - dig_by_piston=1, - fire_encouragement=30, - fire_flammability=60 - }, + groups = {handy=1,shearsy=1,swordy=1, leafdecay=leafdecay_distance, flammable=2, leaves=1, deco_block=1, dig_by_piston=1, fire_encouragement=30, fire_flammability=60}, drop = get_drops(0), _mcl_shears_drop = true, sounds = mcl_sounds.node_sound_leaves_defaults(), diff --git a/mods/ITEMS/mcl_farming/hoes.lua b/mods/ITEMS/mcl_farming/hoes.lua index db470b9992..e2e8342d78 100644 --- a/mods/ITEMS/mcl_farming/hoes.lua +++ b/mods/ITEMS/mcl_farming/hoes.lua @@ -78,9 +78,6 @@ minetest.register_tool("mcl_farming:hoe_wood", { }, _repair_material = "group:wood", _mcl_toollike_wield = true, - _mcl_diggroups = { - hoey = { speed = 2, level = 1, uses = 60 } - }, }) minetest.register_craft({ @@ -121,9 +118,6 @@ minetest.register_tool("mcl_farming:hoe_stone", { }, _repair_material = "mcl_core:cobble", _mcl_toollike_wield = true, - _mcl_diggroups = { - hoey = { speed = 4, level = 3, uses = 132 } - }, }) minetest.register_craft({ @@ -160,9 +154,6 @@ minetest.register_tool("mcl_farming:hoe_iron", { }, _repair_material = "mcl_core:iron_ingot", _mcl_toollike_wield = true, - _mcl_diggroups = { - hoey = { speed = 6, level = 4, uses = 251 } - }, }) minetest.register_craft({ @@ -205,9 +196,6 @@ minetest.register_tool("mcl_farming:hoe_gold", { }, _repair_material = "mcl_core:gold_ingot", _mcl_toollike_wield = true, - _mcl_diggroups = { - hoey = { speed = 12, level = 2, uses = 33 } - }, }) minetest.register_craft({ @@ -252,9 +240,6 @@ minetest.register_tool("mcl_farming:hoe_diamond", { }, _repair_material = "mcl_core:diamond", _mcl_toollike_wield = true, - _mcl_diggroups = { - hoey = { speed = 8, level = 5, uses = 1562 } - }, }) minetest.register_craft({ diff --git a/mods/ITEMS/mcl_farming/wheat.lua b/mods/ITEMS/mcl_farming/wheat.lua index e3ee79ead2..9a8a9f65eb 100644 --- a/mods/ITEMS/mcl_farming/wheat.lua +++ b/mods/ITEMS/mcl_farming/wheat.lua @@ -146,7 +146,7 @@ minetest.register_node("mcl_farming:hay_block", { paramtype2 = "facedir", is_ground_content = false, on_place = mcl_util.rotate_axis, - groups = {handy=1, hoey=1, flammable=2, fire_encouragement=60, fire_flammability=20, building_block=1, fall_damage_add_percent=-80}, + groups = {handy=1, flammable=2, fire_encouragement=60, fire_flammability=20, building_block=1, fall_damage_add_percent=-80}, sounds = mcl_sounds.node_sound_leaves_defaults(), on_rotate = on_rotate, _mcl_blast_resistance = 0.5, diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 4670547675..f4b203accb 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -176,7 +176,7 @@ minetest.register_node("mcl_nether:nether_wart_block", { stack_max = 64, tiles = {"mcl_nether_nether_wart_block.png"}, is_ground_content = false, - groups = {handy=1, hoey=1, building_block=1}, + groups = {handy=1, building_block=1}, sounds = mcl_sounds.node_sound_leaves_defaults( { footstep={name="default_dirt_footstep", gain=0.7}, diff --git a/mods/ITEMS/mcl_ocean/kelp.lua b/mods/ITEMS/mcl_ocean/kelp.lua index 9670943da6..15d155fc8f 100644 --- a/mods/ITEMS/mcl_ocean/kelp.lua +++ b/mods/ITEMS/mcl_ocean/kelp.lua @@ -779,7 +779,7 @@ minetest.register_node("mcl_ocean:dried_kelp_block", { description = S("Dried Kelp Block"), _doc_items_longdesc = S("A decorative block that serves as a great furnace fuel."), tiles = { "mcl_ocean_dried_kelp_top.png", "mcl_ocean_dried_kelp_bottom.png", "mcl_ocean_dried_kelp_side.png" }, - groups = { handy = 1, hoey = 1, building_block = 1, flammable = 2, fire_encouragement = 30, fire_flammability = 60 }, + groups = { handy = 1, building_block = 1, flammable = 2, fire_encouragement = 30, fire_flammability = 60 }, sounds = mcl_sounds.node_sound_leaves_defaults(), paramtype2 = "facedir", on_place = mcl_util.rotate_axis, diff --git a/mods/ITEMS/mcl_sponges/init.lua b/mods/ITEMS/mcl_sponges/init.lua index 75a99b0f13..aeacecd6f4 100644 --- a/mods/ITEMS/mcl_sponges/init.lua +++ b/mods/ITEMS/mcl_sponges/init.lua @@ -48,7 +48,7 @@ minetest.register_node("mcl_sponges:sponge", { buildable_to = false, stack_max = 64, sounds = mcl_sounds.node_sound_dirt_defaults(), - groups = {handy=1, hoey=1, building_block=1}, + groups = {handy=1, building_block=1}, on_place = function(itemstack, placer, pointed_thing) local pn = placer:get_player_name() if pointed_thing.type ~= "node" then @@ -136,7 +136,7 @@ minetest.register_node("mcl_sponges:sponge_wet", { buildable_to = false, stack_max = 64, sounds = mcl_sounds.node_sound_dirt_defaults(), - groups = {handy=1, hoey=1, building_block=1}, + groups = {handy=1, building_block=1}, on_place = place_wet_sponge, _mcl_blast_resistance = 0.6, _mcl_hardness = 0.6,