This commit is contained in:
AFCMS 2021-03-12 10:02:03 +01:00
commit 81167b4431
4 changed files with 28 additions and 17 deletions

View File

@ -751,10 +751,10 @@ local check_for_death = function(self, cause, cmi_cause)
-- play damage sound if health was reduced and make mob flash red. -- play damage sound if health was reduced and make mob flash red.
if damaged then if damaged then
add_texture_mod(self, "^[colorize:#FF000040") add_texture_mod(self, "^[colorize:red:130")
minetest.after(.2, function(self) minetest.after(.2, function(self)
if self and self.object then if self and self.object then
remove_texture_mod(self, "^[colorize:#FF000040") remove_texture_mod(self, "^[colorize:red:130")
end end
end, self) end, self)
mob_sound(self, "damage") mob_sound(self, "damage")

View File

@ -60,10 +60,9 @@ function mcl_flowers.register_simple_flower(name, def)
if not def.drop then def.drop = newname end if not def.drop then def.drop = newname end
mcl_flowers.registered_simple_flowers[newname] = { mcl_flowers.registered_simple_flowers[newname] = {
name=name, name=name,
desc=def.desc, desc=desc,
pot_desc=def.pot_desc, image=image,
image=def.image, simple_selection_box=simple_selection_box,
selection_box=def.selection_box,
} }
minetest.register_node(newname, { minetest.register_node(newname, {
description = def.desc, description = def.desc,

View File

@ -590,23 +590,36 @@ function mcl_potions.make_invisible(player, toggle)
local is_player = player:is_player() local is_player = player:is_player()
local entity = player:get_luaentity() local entity = player:get_luaentity()
local playername = player:get_player_name()
local skin_file = ""
if toggle then -- hide player if toggle then -- hide player
if player:is_player() then skin_file = "mobs_mc_empty.png"
EF.invisible[player].old_size = player:get_properties().visual_size
elseif entity then if entity then
EF.invisible[player].old_size = entity.visual_size EF.invisible[player].old_size = entity.visual_size
else -- if not a player or entity, do nothing elseif not player:is_player() then -- if not a player or entity, do nothing
return return
end end
player:set_properties({visual_size = {x = 0, y = 0}}) if minetest.get_modpath("mcl_armor") and player:is_player() then
armor.textures[playername].skin = skin_file
armor:update_player_visuals(player)
elseif not player:is_player() and minetest.get_modpath("mcl_armor") or not player:is_player() and not minetest.get_modpath("mcl_armor") then
player:set_properties({visual_size = {x = 0, y = 0}})
end
player:set_nametag_attributes({color = {a = 0}}) player:set_nametag_attributes({color = {a = 0}})
elseif EF.invisible[player] then -- show player elseif EF.invisible[player] then -- show player
player:set_properties({visual_size = EF.invisible[player].old_size}) if minetest.get_modpath("mcl_armor") and player:is_player() then
skin_file = mcl_skins.skins[playername] .. ".png"
armor.textures[playername].skin = skin_file
armor:update_player_visuals(player)
elseif not player:is_player() and minetest.get_modpath("mcl_armor") or not player:is_player() and not minetest.get_modpath("mcl_armor") then
player:set_properties({visual_size = EF.invisible[player].old_size})
end
player:set_nametag_attributes({color = {r = 255, g = 255, b = 255, a = 255}}) player:set_nametag_attributes({color = {r = 255, g = 255, b = 255, a = 255}})
end end
@ -999,4 +1012,3 @@ function mcl_potions._extinguish_nearby_fire(pos, radius)
end end
return exting return exting
end end

View File

@ -66,13 +66,13 @@ minetest.register_globalstep(function(dtime)
-- set head pitch and yaw when swimming -- 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)),yaw - player_vel_yaw * -1,0)) player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+90-degrees(dir_to_pitch(player_velocity)),yaw - player_vel_yaw * -1,0))
-- sets eye height, and nametag color accordingly -- 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.65, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) 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 }})
-- control body bone when swimming -- 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 * -1 - yaw + 180,0)) player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(degrees(dir_to_pitch(player_velocity)) - 90,player_vel_yaw * -1 - yaw + 180,0))
elseif player:get_attach() == nil then elseif player:get_attach() == nil then
-- sets eye height, and nametag color accordingly -- 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.65, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) 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 }})
if player_velocity.x > 0.35 or player_velocity.z > 0.35 or player_velocity.x < -0.35 or player_velocity.z < -0.35 then if player_velocity.x > 0.35 or player_velocity.z > 0.35 or player_velocity.x < -0.35 or player_velocity.z < -0.35 then
if player_vel_yaw * -1 - yaw < 90 or player_vel_yaw * -1 - yaw > 270 then if player_vel_yaw * -1 - yaw < 90 or player_vel_yaw * -1 - yaw > 270 then
@ -91,7 +91,7 @@ minetest.register_globalstep(function(dtime)
else else
local attached = player:get_attach(parent) local attached = player:get_attach(parent)
local attached_yaw = degrees(attached:get_yaw()) local attached_yaw = degrees(attached:get_yaw())
player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,1.8,0.35}, eye_height = 1.65, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) 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_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch,degrees(player:get_look_horizontal()) * -1 + attached_yaw,0)) player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch,degrees(player:get_look_horizontal()) * -1 + attached_yaw,0))
player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,0,0)) player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,0,0))
end end