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

This commit is contained in:
kay27 2021-03-19 20:49:49 +04:00
commit 45f2a26f1c
17 changed files with 98 additions and 84 deletions

View File

@ -33,10 +33,10 @@ mgvalleys_spflags = noaltitude_chill,noaltitude_dry,nohumid_rivers,vary_river_de
keepInventory = false
# Performance settings
dedicated_server_step = 0.001
abm_interval = 0.25
max_objects_per_block = 4096
max_packets_per_iteration = 10096
# dedicated_server_step = 0.001
# abm_interval = 0.25
# max_objects_per_block = 4096
# max_packets_per_iteration = 10096
# Clientmodding to support official client
enable_client_modding = true

View File

@ -117,6 +117,10 @@ function mcl_burning.damage(obj)
end
function mcl_burning.set_on_fire(obj, burn_time, reason)
if obj:get_hp() < 0 then
return
end
local luaentity = obj:get_luaentity()
if luaentity and luaentity.fire_resistant then
return
@ -145,7 +149,7 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
end
if old_burn_time <= burn_time then
local sound_id = mcl_burning.get(obj, "int", "sound_id")
--[[local sound_id = mcl_burning.get(obj, "int", "sound_id")
if sound_id == 0 then
sound_id = minetest.sound_play("fire_fire", {
object = obj,
@ -153,7 +157,7 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
max_hear_distance = 16,
loop = true,
}) + 1
end
end]]--
local hud_id
if obj:is_player() then
@ -163,7 +167,7 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
hud_elem_type = "image",
position = {x = 0.5, y = 0.5},
scale = {x = -100, y = -100},
text = "fire_basic_flame.png",
text = "mcl_burning_hud_flame_animated.png",
z_index = 1000,
}) + 1
end
@ -171,7 +175,7 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
mcl_burning.set(obj, "float", "burn_time", burn_time)
mcl_burning.set(obj, "string", "reason", reason)
mcl_burning.set(obj, "int", "hud_id", hud_id)
mcl_burning.set(obj, "int", "sound_id", sound_id)
--mcl_burning.set(obj, "int", "sound_id", sound_id)
local fire_entity = minetest.add_entity(obj:get_pos(), "mcl_burning:fire")
local minp, maxp = mcl_burning.get_collisionbox(obj)
@ -194,8 +198,8 @@ end
function mcl_burning.extinguish(obj)
if mcl_burning.is_burning(obj) then
local sound_id = mcl_burning.get(obj, "int", "sound_id") - 1
minetest.sound_stop(sound_id)
--local sound_id = mcl_burning.get(obj, "int", "sound_id") - 1
--minetest.sound_stop(sound_id)
if obj:is_player() then
local hud_id = mcl_burning.get(obj, "int", "hud_id") - 1
@ -206,7 +210,7 @@ function mcl_burning.extinguish(obj)
mcl_burning.set(obj, "float", "burn_time")
mcl_burning.set(obj, "float", "damage_timer")
mcl_burning.set(obj, "int", "hud_id")
mcl_burning.set(obj, "int", "sound_id")
--mcl_burning.set(obj, "int", "sound_id")
end
end

View File

@ -450,7 +450,7 @@ mobs:spawn_specific("mobs_mc:donkey", mobs_mc.spawn.grassland_savanna, {"air"},
-- spawn eggs
mobs:register_egg("mobs_mc:horse", S("Horse"), "mobs_mc_spawn_icon_horse.png", 0)
--mobs:register_egg("mobs_mc:skeleton_horse", S("Skeleton Horse"), "mobs_mc_spawn_icon_horse_skeleton.png", 0)
mobs:register_egg("mobs_mc:skeleton_horse", S("Skeleton Horse"), "mobs_mc_spawn_icon_horse_skeleton.png", 0)
--mobs:register_egg("mobs_mc:zombie_horse", S("Zombie Horse"), "mobs_mc_spawn_icon_horse_zombie.png", 0)
mobs:register_egg("mobs_mc:donkey", S("Donkey"), "mobs_mc_spawn_icon_donkey.png", 0)
mobs:register_egg("mobs_mc:mule", S("Mule"), "mobs_mc_spawn_icon_mule.png", 0)

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -960,7 +960,7 @@ mobs:register_mob("mobs_mc:villager", {
"mobs_mc_villager_smith.png", --hat
},
},
visual_size = {x=3, y=3},
visual_size = {x=2.75, y=2.75},
makes_footstep_sound = true,
walk_velocity = 1.2,
run_velocity = 2.4,

View File

@ -28,7 +28,7 @@ mobs:register_mob("mobs_mc:evoker", {
"blank.png", --no hat
-- TODO: Attack glow
} },
visual_size = {x=3, y=3},
visual_size = {x=2.75, y=2.75},
makes_footstep_sound = true,
damage = 6,
walk_velocity = 0.2,

View File

@ -36,7 +36,7 @@ mobs:register_mob("mobs_mc:illusioner", {
-- TODO: more sounds
distance = 16,
},
visual_size = {x=3, y=3},
visual_size = {x=2.75, y=2.75},
walk_velocity = 0.6,
run_velocity = 2,
jump = true,

View File

@ -30,7 +30,7 @@ mobs:register_mob("mobs_mc:vindicator", {
-- TODO: Glow when attacking (mobs_mc_vindicator.png)
},
},
visual_size = {x=3, y=3},
visual_size = {x=2.75, y=2.75},
makes_footstep_sound = true,
damage = 13,
reach = 2,

View File

@ -45,7 +45,7 @@ mobs:register_mob("mobs_mc:villager_zombie", {
{"mobs_mc_zombie_smith.png"},
{"mobs_mc_zombie_villager.png"}
},
visual_size = {x=3, y=3},
visual_size = {x=2.75, y=2.75},
makes_footstep_sound = true,
damage = 3,
reach = 2,

View File

@ -25,7 +25,7 @@ mobs:register_mob("mobs_mc:witch", {
textures = {
{"mobs_mc_witch.png"},
},
visual_size = {x=3, y=3},
visual_size = {x=2.75, y=2.75},
makes_footstep_sound = true,
damage = 2,
reach = 2,

View File

@ -149,8 +149,8 @@ armor.set_player_armor = function(self, player)
if level then
local texture = def.texture or item:gsub("%:", "_")
local enchanted_addition = (mcl_enchanting.is_enchanted(item) and mcl_enchanting.overlay or "")
table.insert(textures, texture..".png"..enchanted_addition)
preview = "player.png^[opacity:0^"..texture.."_preview.png"..enchanted_addition..""..(preview and "^"..preview or "")
table.insert(textures, "("..texture..".png"..enchanted_addition..")")
preview = "(player.png^[opacity:0^"..texture.."_preview.png"..enchanted_addition..")"..(preview and "^"..preview or "")
armor_level = armor_level + level
items = items + 1
mcl_armor_points = mcl_armor_points + (def.groups["mcl_armor_points"] or 0)

View File

@ -337,8 +337,8 @@ ARROW_ENTITY.on_step = function(self, dtime)
minetest.sound_play({name="mcl_bows_hit_other", gain=0.3}, {pos=self.object:get_pos(), max_hear_distance=16}, true)
end
end
mcl_burning.extinguish(self.object)
if not obj:is_player() then
mcl_burning.extinguish(self.object)
self.object:remove()
end
return

View File

@ -85,14 +85,15 @@ minetest.register_craftitem("mcl_end:crystal", {
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
local pos = minetest.get_pointed_thing_position(pointed_thing)
local node = minetest.get_node(pos).name
local node = minetest.get_node(pos)
local node_name = node.name
if placer and not placer:get_player_control().sneak then
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
if minetest.registered_nodes[node_name] and minetest.registered_nodes[node_name].on_rightclick then
return minetest.registered_nodes[node_name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
end
end
if find_crystal(pos) then return itemstack end
if node == "mcl_core:obsidian" or node == "mcl_core:bedrock" then
if node_name == "mcl_core:obsidian" or node_name == "mcl_core:bedrock" then
if not minetest.is_creative_enabled(placer:get_player_name()) then
itemstack:take_item()
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -33,6 +33,53 @@ local dir_to_pitch = function(dir)
return -math.atan2(-dir.y, xz)
end
local player_vel_yaws = {}
function limit_vel_yaw(player_vel_yaw, yaw)
if player_vel_yaw < 0 then
player_vel_yaw = player_vel_yaw + 360
end
if yaw < 0 then
yaw = yaw + 360
end
if math.abs(player_vel_yaw - yaw) > 40 then
local player_vel_yaw_nm, yaw_nm = player_vel_yaw, yaw
if player_vel_yaw > yaw then
player_vel_yaw_nm = player_vel_yaw - 360
else
yaw_nm = yaw - 360
end
if math.abs(player_vel_yaw_nm - yaw_nm) > 40 then
local diff = math.abs(player_vel_yaw - yaw)
if diff > 180 and diff < 185 or diff < 180 and diff > 175 then
player_vel_yaw = yaw
elseif diff < 180 then
if player_vel_yaw < yaw then
player_vel_yaw = yaw - 40
else
player_vel_yaw = yaw + 40
end
else
if player_vel_yaw < yaw then
player_vel_yaw = yaw + 40
else
player_vel_yaw = yaw - 40
end
end
end
end
if player_vel_yaw < 0 then
player_vel_yaw = player_vel_yaw + 360
elseif player_vel_yaw > 360 then
player_vel_yaw = player_vel_yaw - 360
end
return player_vel_yaw
end
local pitch, name, node_stand, node_stand_below, node_head, node_feet, pos
minetest.register_globalstep(function(dtime)
@ -45,19 +92,20 @@ minetest.register_globalstep(function(dtime)
local controls = player:get_player_control()
name = player:get_player_name()
local meta = player:get_meta()
local player_velocity = player:get_velocity() or player:get_player_velocity()
-- controls head bone
local pitch = degrees(player:get_look_vertical()) * -1
local yaw = degrees(player:get_look_horizontal()) * -1
local pitch = - degrees(player:get_look_vertical())
local yaw = degrees(player:get_look_horizontal())
local player_vel_yaw = 0
if degrees(dir_to_yaw(player_velocity)) == 0 then
yaw = 0
else
player_vel_yaw = degrees(dir_to_yaw(player_velocity))
local player_vel_yaw = degrees(dir_to_yaw(player_velocity))
if player_vel_yaw == 0 then
player_vel_yaw = player_vel_yaws[name] or yaw
end
player_vel_yaw = limit_vel_yaw(player_vel_yaw, yaw)
player_vel_yaws[name] = player_vel_yaw
-- controls right and left arms pitch when shooting a bow or punching
if string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB and not controls.LMB and not controls.up and not controls.down and not controls.left and not controls.right then
@ -80,42 +128,30 @@ minetest.register_globalstep(function(dtime)
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 player:get_attach() == nil 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)),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)),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 }})
-- 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 + yaw + 180,0))
elseif player:get_attach() == nil then
-- 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 }})
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
-- controls head and Body_Control bones while moving backwards
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch,yaw - player_vel_yaw * -1,0))
player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,player_vel_yaw * -1 - yaw,0))
else
-- controls head and Body_Control bones while moving forwards
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch,yaw - player_vel_yaw * -1 + 180,0))
player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,player_vel_yaw * -1 - yaw + 180,0))
end
else
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch,0,0))
player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,0,0))
end
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))
else
local attached = player:get_attach(parent)
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.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, -limit_vel_yaw(yaw, attached_yaw) + attached_yaw, 0))
player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,0,0))
end
if mcl_playerplus_internal[name].jump_cooldown > 0 then
mcl_playerplus_internal[name].jump_cooldown = mcl_playerplus_internal[name].jump_cooldown - dtime
end
if player:get_player_control().jump and mcl_playerplus_internal[name].jump_cooldown <= 0 then
if controls.jump and mcl_playerplus_internal[name].jump_cooldown <= 0 then
pos = player:get_pos()

View File

@ -72,7 +72,7 @@ minetest.register_on_joinplayer(function(player)
minetest.after(0, function(player)
wieldview:update_wielded_item(player)
local itementity = minetest.add_entity(player:get_pos(), "wieldview:wieldnode")
itementity:set_attach(player, "Hand_Right", vector.new(0, 0, 0), vector.new(15, 45, 0))
itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(90, 0, 45))
itementity:get_luaentity().wielder = name
end, player)
end)

View File

@ -1,37 +1,10 @@
-- Wielded Item Transformations - http://dev.minetest.net/texture
wieldview.transform = {
["mcl_core:torch"]="R270",
["mesecons_torch:mesecon_torch_on"]="R270",
["mcl_core:sapling"]="R270",
["mcl_core:junglesapling"]="R270",
["mcl_core:darksapling"]="R270",
["mcl_core:acaciasapling"]="R270",
["mcl_core:birchsapling"]="R270",
["mcl_core:sprucesapling"]="R270",
["mcl_core:deadbush"]="R270",
["mcl_flowers:dandelion"]="R270",
["mcl_flowers:tulip_orange"]="R270",
["mcl_flowers:tulip_white"]="R270",
["mcl_flowers:tulip_pink"]="R270",
["mcl_flowers:tulip_red"]="R270",
["mcl_flowers:allium"]="R270",
["mcl_flowers:azure_bluet"]="R270",
["mcl_flowers:poppy"]="R270",
["mcl_flowers:blue_orchid"]="R270",
["mcl_flowers:oxeye_daisy"]="R270",
["mcl_flowers:fern"]="R270",
["mcl_flowers:tallgrass"]="R270",
["mcl_potions:glass_bottle"]="R270",
["mcl_potions:water"]="R270",
["mcl_potions:awkward"]="R270",
["mcl_potions:thick"]="R270",
["mcl_potions:mundane"]="R270",
["screwdriver:screwdriver"]="R270",
["screwdriver:screwdriver1"]="R270",
["screwdriver:screwdriver2"]="R270",
["screwdriver:screwdriver3"]="R270",
["screwdriver:screwdriver4"]="R270",
["screwdriver:screwdriver"]="R90",
["screwdriver:screwdriver1"]="R90",
["screwdriver:screwdriver2"]="R90",
["screwdriver:screwdriver3"]="R90",
["screwdriver:screwdriver4"]="R90",
}