1
0
Fork 0

Add in chicken head code with additional pitch modifier

This commit is contained in:
jordan4ibanez 2021-04-25 20:08:45 -04:00
parent f57c4709ac
commit ac85230938
5 changed files with 24 additions and 2 deletions

View File

@ -393,6 +393,7 @@ function mobs:register_mob(name, def)
--this part controls the visual of the head --this part controls the visual of the head
head_bone_pos_y = def.head_bone_pos_y or 3.6, head_bone_pos_y = def.head_bone_pos_y or 3.6,
head_bone_pos_z = def.head_bone_pos_z or -0.6, head_bone_pos_z = def.head_bone_pos_z or -0.6,
head_pitch_modifier = def.head_pitch_modifier or 0,
--these variables are switches in case the model --these variables are switches in case the model
--moves the wrong way --moves the wrong way

View File

@ -97,6 +97,10 @@ mobs.do_head_logic = function(self,dtime)
head_pitch = minetest.dir_to_yaw(vector.new(vector.distance(vector.new(pos.x,0,pos.z),vector.new(look_at.x,0,look_at.z)),0,pos.y-look_at.y))+(math.pi/2) head_pitch = minetest.dir_to_yaw(vector.new(vector.distance(vector.new(pos.x,0,pos.z),vector.new(look_at.x,0,look_at.z)),0,pos.y-look_at.y))+(math.pi/2)
end end
if self.head_pitch_modifier then
head_pitch = head_pitch + self.head_pitch_modifier
end
if self.swap_y_with_x then if self.swap_y_with_x then
self.object:set_bone_position("head", bone_pos, vector_new(degrees(head_pitch),degrees(head_yaw),0)) self.object:set_bone_position("head", bone_pos, vector_new(degrees(head_pitch),degrees(head_yaw),0))
else else

View File

@ -110,6 +110,21 @@ mobs:register_mob("mobs_mc:chicken", {
}, true) }, true)
end, end,
--head code
has_head = true,
head_bone = "head",
swap_y_with_x = false,
reverse_head_yaw = false,
head_bone_pos_y = 1.675,
head_bone_pos_z = 0,
head_height_offset = 0.55,
head_direction_offset = 0.0925,
head_pitch_modifier = -math.pi/2,
--end head code
}) })
--spawn --spawn

View File

@ -97,6 +97,7 @@ local cow_def = {
head_height_offset = 1.0525, head_height_offset = 1.0525,
head_direction_offset = 0.5, head_direction_offset = 0.5,
head_pitch_modifier = 0,
--end head code --end head code
} }

View File

@ -65,6 +65,7 @@ mobs:register_mob("mobs_mc:creeper", {
head_height_offset = 1.1, head_height_offset = 1.1,
head_direction_offset = 0, head_direction_offset = 0,
head_pitch_modifier = 0,
--end head code --end head code
-- Force-ignite creeper with flint and steel and explode after 1.5 seconds. -- Force-ignite creeper with flint and steel and explode after 1.5 seconds.