Update various

This commit is contained in:
epCode 2021-02-10 18:54:33 -08:00
parent 507e17200c
commit 3f9bd759b5
23 changed files with 140 additions and 55 deletions

View File

@ -11,7 +11,7 @@ function mobs:spawn_abm_check(pos, node, name)
elseif is_forbidden_node(pos, node) or is_forbidden_node(vector.add(pos, vector.new(0, 1, 0))) then
return true
-- Spawn on opaque or liquid nodes
elseif minetest.get_item_group(node.name, "opaque") ~= 0 or minetest.registered_nodes[node.name].liquidtype ~= "none" then
elseif minetest.get_item_group(node.name, "opaque") ~= 0 or minetest.registered_nodes[node.name].liquidtype ~= "none" or node.name == "mcl_core:grass_path" then
return false
end

View File

@ -25,7 +25,7 @@ local carpets = {
}
mobs:register_mob("mobs_mc:llama", {
type = "animal",
type = "monster",
spawn_class = "passive",
hp_min = 15,
hp_max = 30,
@ -84,8 +84,11 @@ mobs:register_mob("mobs_mc:llama", {
},
follow = mobs_mc.follow.llama,
view_range = 16,
attack_type = "dogshoot",
arrow = "mobs_mc:llama_spit",
shoot_interval = 1.5,
shoot_offset = .5,
do_custom = function(self, dtime)
-- set needed values if not already present
if not self.v2 then
self.v2 = 0
@ -216,6 +219,32 @@ mobs:register_mob("mobs_mc:llama", {
})
mobs:register_arrow("mobs_mc:llama_spit", {
visual = "sprite",
visual_size = {x = 0.3, y = 0.3},
textures = {"mobs_mc_spit.png"},
velocity = 30,
-- Direct hit, no fire... just plenty of pain
hit_player = function(self, player)
if rawget(_G, "armor") and armor.last_damage_types then
armor.last_damage_types[player:get_player_name()] = "llama_spit"
end
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 1, knockback = 10},
}, nil)
end,
hit_mob = function(self, mob)
mob:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 1, knockback = 10},
}, nil)
end,
})
--spawn
mobs:spawn_specific("mobs_mc:llama", mobs_mc.spawn.savanna, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 15000, 5, mobs_mc.spawn_height.water+15, mobs_mc.spawn_height.overworld_max)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

View File

@ -1067,7 +1067,7 @@ mobs:register_mob("mobs_mc:villager", {
mobs:spawn_specific("mobs_mc:villager", mobs_mc.spawn.village, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 8000, 4, mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific("mobs_mc:villager", mobs_mc.spawn.village, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 20, 4, mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:villager", S("Villager"), "mobs_mc_spawn_icon_villager.png", 0)

View File

@ -225,6 +225,7 @@ mobs_mc.override.spawn = {
nether_fortress = { "mcl_nether:nether_brick", "mcl_nether:netherrack" },
nether_portal = { mobs_mc.override.items.nether_portal },
wolf = { mobs_mc.override.items.grass_block, "mcl_core:dirt", "mcl_core:dirt_with_grass_snow", "mcl_core:snow", "mcl_core:snowblock", "mcl_core:podzol" },
village = { "mcl_villages:stonebrickcarved", "mcl_core:grass_path", "mcl_core:sandstonesmooth2" },
}
-- This table contains important spawn height references for the mob spawn height.

View File

@ -330,22 +330,27 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
inv_bg = "crafting_inventory_creative_survival.png"
-- Show armor and player image
local img, img_player
if mod_player then
img_player = mcl_player.player_get_preview(player)
local player_preview
if minetest.settings:get_bool("3d_player_preview", true) then
player_preview = mcl_player.get_player_formspec_model(player, 3.9, 1.4, 1.2333, 2.4666, "")
else
img_player = "player.png"
end
img = img_player
local player_preview = "image[3.9,1.4;1.2333,2.4666;"..img.."]"
if show_armor and armor.textures[playername] and armor.textures[playername].preview then
img = armor.textures[playername].preview
local s1 = img:find("character_preview")
if s1 ~= nil then
s1 = img:sub(s1+21)
img = img_player..s1
local img, img_player
if mod_player then
img_player = mcl_player.player_get_preview(player)
else
img_player = "player.png"
end
img = img_player
player_preview = "image[3.9,1.4;1.2333,2.4666;"..img.."]"
if show_armor and armor.textures[playername] and armor.textures[playername].preview then
img = armor.textures[playername].preview
local s1 = img:find("character_preview")
if s1 ~= nil then
s1 = img:sub(s1+21)
img = img_player..s1
end
player_preview = "image[3.9,1.4;1.2333,2.4666;"..img.."]"
end
end
-- Background images for armor slots (hide if occupied)

View File

@ -64,22 +64,27 @@ local function set_inventory(player, armor_change_only)
local player_name = player:get_player_name()
-- Show armor and player image
local img, img_player
if mod_player then
img_player = mcl_player.player_get_preview(player)
local player_preview
if minetest.settings:get_bool("3d_player_preview", true) then
player_preview = mcl_player.get_player_formspec_model(player, 1.0, 0.0, 2.25, 4.5, "")
else
img_player = "player.png"
end
img = img_player
local player_preview = "image[0.6,0.2;2,4;"..img.."]"
if show_armor and armor.textures[player_name] and armor.textures[player_name].preview then
img = armor.textures[player_name].preview
local s1 = img:find("character_preview")
if s1 ~= nil then
s1 = img:sub(s1+21)
img = img_player..s1
local img, img_player
if mod_player then
img_player = mcl_player.player_get_preview(player)
else
img_player = "player.png"
end
img = img_player
player_preview = "image[0.6,0.2;2,4;"..img.."]"
if show_armor and armor.textures[player_name] and armor.textures[player_name].preview then
img = armor.textures[player_name].preview
local s1 = img:find("character_preview")
if s1 ~= nil then
s1 = img:sub(s1+21)
img = img_player..s1
end
player_preview = "image[1.1,0.2;2,4;"..img.."]"
end
player_preview = "image[1.1,0.2;2,4;"..img.."]"
end
local armor_slots = {"helmet", "chestplate", "leggings", "boots"}

Binary file not shown.

Binary file not shown.

View File

@ -188,6 +188,7 @@ function settlements.place_schematics(settlement_info, pr)
local schem_lua = minetest.serialize_schematic(building,
"lua",
{lua_use_comments = false, lua_num_indent_spaces = 0}).." return(schematic)"
schem_lua = schem_lua:gsub("mcl_core:stonebrickcarved", "mcl_villages:stonebrickcarved")
-- replace material
if replace_wall then
--Note, block substitution isn't matching node names exactly; so nodes that are to be substituted that have the same prefixes cause bugs.

View File

@ -13,18 +13,24 @@ dofile(settlements.modpath.."/paths.lua")
settlements_in_world = settlements.load()
settlements.grundstellungen()
--[[ Disable custom node spawning.
--
-- register block for npc spawn
--
minetest.register_node("settlements:junglewood", {
description = "special junglewood floor",
tiles = {"default_junglewood.png"},
groups = {choppy=3, wood=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("mcl_villages:stonebrickcarved", {
description = ("Chiseled Stone Village Bricks"),
_doc_items_longdesc = doc.sub.items.temp.build,
tiles = {"mcl_core_stonebrick_carved.png"},
stack_max = 64,
drop = "mcl_core:stonebrickcarved",
groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1},
sounds = mcl_sounds.node_sound_stone_defaults(),
is_ground_content = false,
_mcl_blast_resistance = 6,
_mcl_hardness = 1.5,
})
--]]
--[[ Enable for testing, but use MineClone2's own spawn code if/when merging.

View File

@ -13,14 +13,14 @@ end
--generate a node for every skin
for _,texture in pairs(list) do
-- This is a fake node that should never be placed in the world
minetest.register_node("mcl_meshhand:"..texture, {
minetest.register_node("mcl_meshhand:"..texture.."shield", {
description = "",
tiles = {texture..".png"},
visual_scale = 1,
wield_scale = {x=1,y=1,z=1},
paramtype = "light",
drawtype = "mesh",
mesh = "mcl_meshhand.b3d",
mesh = "mcl_meshhand_shield.b3d",
-- Prevent construction
node_placement_prediction = "",
on_construct = function(pos)
@ -34,6 +34,29 @@ for _,texture in pairs(list) do
groups = { dig_immediate = 3, not_in_creative_inventory = 1 },
range = def.range,
})
minetest.register_node("mcl_meshhand:"..texture, {
description = "",
tiles = {texture..".png"},
visual_scale = 1,
wield_scale = {x=1,y=1,z=1},
paramtype = "light",
drawtype = "mesh",
mesh = "mcl_meshhand.b3d",
-- Prevent construction
node_placement_prediction = "",
on_construct = function(pos)
minetest.log("error", "[mcl_meshhand] Trying to construct mcl_meshhand:"..texture.." at "..minetest.pos_to_string(pos))
minetest.remove_node(pos)
end,
drop = "",
on_drop = function()
return ""
end,
groups = { dig_immediate = 3, not_in_creative_inventory = 1 },
range = def.range,
})
end
if has_mcl_skins == true then

View File

@ -93,6 +93,13 @@ function mcl_player.player_get_preview(player)
end
end
function mcl_player.get_player_formspec_model(player, x, y, w, h, fsname)
local name = player:get_player_name()
local model = player_model[name]
local anim = models[model].animations[player_anim[name]]
return "model[" .. x .. "," .. y .. ";" .. w .. "," .. h .. ";" .. fsname .. ";" .. model .. ";" .. table.concat(player_textures[name], ",") .. ";0," .. 180 .. ";false;false;" .. anim.x .. "," .. anim.y .. "]"
end
function mcl_player.player_set_animation(player, anim_name, speed)
local name = player:get_player_name()
if player_anim[name] == anim_name then

Binary file not shown.

Before

Width:  |  Height:  |  Size: 626 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 850 B

View File

@ -26,29 +26,34 @@ minetest.register_globalstep(function(dtime)
-- controls head bone
pitch = degrees(player:get_look_vertical()) * -1
if controls.LMB then
if string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB and not controls.up and not controls.down and not controls.left and not controls.right 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_Left_Pitch_Control", vector.new(3.5,5.785,0), vector.new(pitch+90,43,pitch * .35))
elseif controls.LMB then
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch,0,0))
player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0))
else
player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0))
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(0,0,0))
end
if controls.sneak and player:get_attach() == nil 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({eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 0, g = 225 }})
-- 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({eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 0, g = 225 }})
elseif minetest.get_item_group(mcl_playerinfo[name].node_stand, "water") ~= 0 then
-- controls head pitch when swiming
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+90,0,0))
-- sets eye height, and nametag color accordingly
player:set_properties({eye_height = 1.65, nametag_color = { r = 225, b = 225, a = 225, g = 225 }})
elseif minetest.get_item_group(mcl_playerinfo[name].node_stand, "water") ~= 0 and player:get_attach() == nil then
-- controls head pitch when swiming
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+90,0,0))
-- sets eye height, and nametag color accordingly
player:set_properties({eye_height = 1.65, nametag_color = { r = 225, b = 225, a = 225, g = 225 }})
else
-- controls head pitch when not sneaking
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch,0,0))
-- sets eye height, and nametag color accordingly
player:set_properties({eye_height = 1.65, nametag_color = { r = 225, b = 225, a = 225, g = 225 }})
-- controls head pitch when not sneaking
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch,0,0))
-- sets eye height, and nametag color accordingly
player:set_properties({eye_height = 1.65, nametag_color = { r = 225, b = 225, a = 225, g = 225 }})
end
if mcl_playerplus_internal[name].jump_cooldown > 0 then

View File

@ -94,6 +94,9 @@ fire_animation_frames (Fire Animation Frames) int 8
# Whether to animate chests when open / close
animated_chests (Animated chests) bool true
# Whether to preview the player in inventory in 3D (requires Minetest 5.4)
3d_player_preview (3D Player preview) bool true
[Experimental]
# Whether ice is translucent. If disabled, ice is fully opaque.
#