Merge remote-tracking branch 'refs/remotes/mclmaster/master'

Conflicts:
	mods/PLAYER/mcl_playerplus/init.lua
This commit is contained in:
Sumyjkl 2022-08-12 12:55:50 +10:00
commit c36fd90965
26 changed files with 541 additions and 176 deletions

View file

@ -24,6 +24,10 @@ local function is_ice(pos)
return is_group(pos, "ice")
end
local function is_fire(pos)
return is_group(pos, "set_on_fire")
end
local function get_sign(i)
if i == 0 then
return 0
@ -218,6 +222,10 @@ function boat.on_step(self, dtime, moveresult)
on_water = false
if not in_water and is_ice(waterp) then
on_ice = true
elseif is_fire({x=p.x, y=p.y-boat_y_offset, z=p.z}) then
boat.on_death(self, nil)
self.object:remove()
return
else
v_slowdown = 0.04
v_factor = 0.5

View file

@ -92,7 +92,8 @@ local function check_perch(self,dtime)
local n1 = minetest.get_node(vector.offset(p:get_pos(),0,-0.6,0)).name
local n2 = minetest.get_node(vector.offset(p:get_pos(),0,0,0)).name
local n3 = minetest.get_node(vector.offset(p:get_pos(),0,1,0)).name
if n1 == "air" or minetest.get_item_group(n2,"water") > 0 or minetest.get_item_group(n2,"lava") > 0 then
if ( n1 == "air" or minetest.get_item_group(n2,"water") > 0 or minetest.get_item_group(n2,"lava") > 0) and
not minetest.is_creative_enabled(p:get_player_name()) then
o:set_detach()
self.detach_timer = 0
return
@ -118,7 +119,7 @@ end
mcl_mobs:register_mob("mobs_mc:parrot", {
description = S("Parrot"),
type = "npc",
type = "passive",
spawn_class = "passive",
pathfinding = 1,
hp_min = 6,

View file

@ -2,6 +2,7 @@ local PARTICLES_COUNT_RAIN = tonumber(minetest.settings:get("mcl_weather_rain_pa
local PARTICLES_COUNT_THUNDER = tonumber(minetest.settings:get("mcl_weather_thunder_particles")) or 900
local get_connected_players = minetest.get_connected_players
local mgname = minetest.get_mapgen_setting("mg_name")
mcl_weather.rain = {
-- max rain particles created at time
@ -91,7 +92,7 @@ end
function mcl_weather.rain.add_player(player)
if mcl_weather.players[player:get_player_name()] == nil then
local player_meta = {}
player_meta.origin_sky = {player:get_sky()}
player_meta.origin_sky = {player:get_sky(true)}
mcl_weather.players[player:get_player_name()] = player_meta
update_sound[player:get_player_name()]=true
end

View file

@ -246,7 +246,7 @@ mcl_weather.skycolor = {
get_current_bg_color = function()
local players = mcl_weather.skycolor.utils.get_players(nil)
if players[1] then
return players[1]:get_sky()
return players[1]:get_sky(true).sky_color
end
return nil
end

View file

@ -106,7 +106,7 @@ local function info()
end
after(refresh_interval, info)
end
info()
minetest.after(0,info)
minetest.register_on_leaveplayer(function(p)
local name = p:get_player_name()

View file

@ -261,7 +261,7 @@ local dispenserdef = {
local item_entity = minetest.add_item(droppos, dropitem)
local drop_vel = vector.subtract(droppos, pos)
local speed = 3
item_entity:set_velocity(drop_vel * speed)
item_entity:set_velocity(vector.multiply(drop_vel,speed))
end
else
stack:take_item()
@ -278,7 +278,7 @@ local dispenserdef = {
local item_entity = minetest.add_item(droppos, dropitem)
local drop_vel = vector.subtract(droppos, pos)
local speed = 3
item_entity:set_velocity(drop_vel * speed)
item_entity:set_velocity(vector.multiply(drop_vel,speed))
stack:take_item()
inv:set_stack("main", stack_id, stack)
end

View file

@ -143,7 +143,7 @@ local dropperdef = {
local item_entity = minetest.add_item(droppos, dropitem)
local drop_vel = vector.subtract(droppos, pos)
local speed = 3
item_entity:set_velocity(drop_vel * speed)
item_entity:set_velocity(vector.multiply(drop_vel,speed))
stack:take_item()
inv:set_stack("main", stack_id, stack)
end

View file

@ -1,2 +1,3 @@
name = mcl_beacons
author=chmodsayshello
depends=mcl_formspec, mcl_init, mcl_wip, mesecons_mvps, mcl_core, mcl_sounds, awards, mcl_achievements, mcl_mobitems, mcl_nether

View file

@ -1,5 +1,6 @@
local S = minetest.get_translator(minetest.get_current_modname())
local minetest = minetest
local mod_doc = minetest.get_modpath("doc")
local mod_screwdriver = minetest.get_modpath("screwdriver")
@ -8,68 +9,93 @@ if minetest.get_modpath("mcl_armor") then
equip_armor = mcl_armor.equip_on_use
end
-- Heads system
mcl_heads = {}
local function addhead(name, texture, desc, longdesc, rangemob, rangefactor)
local on_rotate_floor, on_rotate_wall
if mod_screwdriver then
on_rotate_floor = function(pos, node, user, mode, new_param2)
-- rotations of head nodes within a quadrant (0° ≤ θ ≤ 90°)
mcl_heads.FLOOR_DEGREES = { [0]='', '22_5', '45', '67_5', }
-- box of head nodes
mcl_heads.FLOOR_BOX = { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, }
-- floor head node nodedef template ------------------------------------------------------------------------------------
--- node definition template for floor mod heads
mcl_heads.deftemplate_floor = {
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = mcl_heads.FLOOR_BOX,
},
groups = {
handy = 1,
armor = 1,
armor_head = 1,
non_combat_armor = 1,
non_combat_armor_head = 1,
head = 1,
deco_block = 1,
dig_by_piston = 1,
},
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
paramtype = "light",
paramtype2 = "facedir",
stack_max = 64,
sunlight_propagates = true,
sounds = mcl_sounds.node_sound_defaults{
footstep = {name="default_hard_footstep", gain=0.3},
},
is_ground_content = false,
_mcl_armor_element = "head",
_mcl_blast_resistance = 1,
_mcl_hardness = 1,
on_secondary_use = equip_armor,
}
mcl_heads.deftemplate_floor_angled = {
drawtype = "mesh",
selection_box = {
type = "fixed",
fixed = mcl_heads.FLOOR_BOX,
},
collision_box = {
type = "fixed",
fixed = mcl_heads.FLOOR_BOX,
},
groups = {
handy = 1,
head = 1,
deco_block = 1,
dig_by_piston = 1,
not_in_creative_inventory = 1,
},
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
paramtype = "light",
paramtype2 = "facedir",
stack_max = 64,
sunlight_propagates = true,
sounds = mcl_sounds.node_sound_defaults{
footstep = {name="default_hard_footstep", gain=0.3},
},
is_ground_content = false,
_doc_items_create_entry = false,
_mcl_blast_resistance = 1,
_mcl_hardness = 1,
}
function mcl_heads.deftemplate_floor.on_rotate(pos, node, user, mode, new_param2)
if mode == screwdriver.ROTATE_AXIS then
node.name = node.name .. "_wall"
node.param2 = minetest.dir_to_wallmounted(minetest.facedir_to_dir(node.param2))
minetest.set_node(pos, node)
return true
end
end
on_rotate_wall = function(pos, node, user, mode, new_param2)
if mode == screwdriver.ROTATE_AXIS then
node.name = string.sub(node.name, 1, string.len(node.name)-5)
node.param2 = minetest.dir_to_facedir(minetest.wallmounted_to_dir(node.param2))
minetest.set_node(pos, node)
return true
end
end
end
end
minetest.register_node("mcl_heads:"..name, {
description = desc,
_doc_items_longdesc = longdesc,
drawtype = "nodebox",
is_ground_content = false,
node_box = {
type = "fixed",
fixed = {
{ -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
},
},
groups = {handy = 1, armor = 1, armor_head = 1, non_combat_armor = 1, non_combat_armor_head = 1, head = 1, deco_block = 1, dig_by_piston = 1},
-- The head textures are based off the textures of an actual mob.
tiles = {
-- Note: bottom texture is overlaid over top texture to get rid of possible transparency.
-- This is required for skeleton skull and wither skeleton skull.
"[combine:16x16:-4,4="..texture, -- top
"([combine:16x16:-4,4="..texture..")^([combine:16x16:-12,4="..texture..")", -- bottom
"[combine:16x16:-12,0="..texture, -- left
"[combine:16x16:4,0="..texture, -- right
"[combine:16x16:-20,0="..texture, -- back
"[combine:16x16:-4,0="..texture, -- front
},
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
paramtype = "light",
stack_max = 64,
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
},
sounds = mcl_sounds.node_sound_defaults({
footstep = {name="default_hard_footstep", gain=0.3}
}),
on_place = function(itemstack, placer, pointed_thing)
function mcl_heads.deftemplate_floor.on_place(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
-- no interaction possible with entities, for now.
return itemstack
end
@ -78,7 +104,7 @@ local function addhead(name, texture, desc, longdesc, rangemob, rangefactor)
local def = minetest.registered_nodes[node.name]
if not def then return itemstack end
-- Call on_rightclick if the pointed node defines it
-- Allow pointed node's on_rightclick callback to override place.
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(under, node, placer, itemstack) or itemstack
@ -86,81 +112,184 @@ local function addhead(name, texture, desc, longdesc, rangemob, rangefactor)
end
local above = pointed_thing.above
local diff = {x = under.x - above.x, y = under.y - above.y, z = under.z - above.z}
local wdir = minetest.dir_to_wallmounted(diff)
local dir = {x = under.x - above.x, y = under.y - above.y, z = under.z - above.z}
local wdir = minetest.dir_to_wallmounted(dir)
local itemstring = itemstack:get_name()
local fakestack = ItemStack(itemstack)
--local idef = fakestack:get_definition()
local retval
if wdir == 0 or wdir == 1 then
return minetest.item_place(itemstack, placer, pointed_thing)
local placestack = ItemStack(itemstack)
-- place wall head node (elsewhere)
if wdir ~= 0 and wdir ~= 1 then
placestack:set_name(itemstring .."_wall")
itemstack = minetest.item_place(placestack, placer, pointed_thing, wdir)
-- place floor head node (floor and ceiling)
else
retval = fakestack:set_name("mcl_heads:"..name.."_wall")
local fdir = minetest.dir_to_facedir(dir)
-- determine the head node rotation based on player's yaw (in cw direction from North/Z+)
local yaw = math.pi*2 - placer:get_look_horizontal()
local rotation_level = math.min(math.max(math.round((yaw / (math.pi*2)) * 16), 0), 15)
placestack:set_name(itemstring ..mcl_heads.FLOOR_DEGREES[rotation_level % 4])
-- determine the head node face direction based on rotation level
fdir = math.floor(rotation_level / 4)
itemstack = minetest.item_place(placestack, placer, pointed_thing, fdir)
end
if not retval then
return itemstack
end
itemstack = minetest.item_place(fakestack, placer, pointed_thing, wdir)
-- restore item from angled and wall head nodes
itemstack:set_name(itemstring)
return itemstack
end,
on_secondary_use = equip_armor,
end
on_rotate = on_rotate_floor,
-- wall head node nodedef template -------------------------------------------------------------------------------------
_mcl_armor_mob_range_mob = rangemob,
_mcl_armor_mob_range_factor = rangefactor,
_mcl_armor_element = "head",
_mcl_armor_texture = "mcl_heads_" .. name .. ".png",
_mcl_blast_resistance = 1,
_mcl_hardness = 1,
})
minetest.register_node("mcl_heads:"..name.."_wall", {
_doc_items_create_entry = false,
--- node definition template for wall mod heads
mcl_heads.deftemplate_wall = {
drawtype = "nodebox",
is_ground_content = false,
node_box = {
type = "wallmounted",
wall_bottom = { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, },
wall_top = { -0.25, 0.0, -0.25, 0.25, 0.5, 0.25, },
wall_side = { -0.5, -0.25, -0.25, 0.0, 0.25, 0.25, },
},
groups = {handy=1, head=1, deco_block=1, dig_by_piston=1, not_in_creative_inventory=1},
-- The head textures are based off the textures of an actual mob.
tiles = {
{ name = "[combine:16x16:-4,-4="..texture, align_style = "world" }, -- front
{ name = "[combine:16x16:-20,-4="..texture, align_style = "world" }, -- back
{ name = "[combine:16x16:-8,-4="..texture, align_style = "world" }, -- left
{ name = "[combine:16x16:0,-4="..texture, align_style = "world" }, -- right
{ name = "([combine:16x16:-4,0="..texture..")^[transformR180", align_style = "node" }, -- top
{ name = "([combine:16x16:-4,8="..texture..")^([combine:16x16:-12,8="..texture..")", align_style = "node" }, -- bottom
groups = {
handy = 1,
head = 1,
deco_block = 1,
dig_by_piston = 1,
not_in_creative_inventory = 1,
},
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
paramtype = "light",
stack_max = 64,
paramtype2 = "wallmounted",
stack_max = 64,
sunlight_propagates = true,
walkable = true,
sounds = mcl_sounds.node_sound_defaults({
footstep = {name="default_hard_footstep", gain=0.3}
}),
drop = "mcl_heads:"..name,
on_rotate = on_rotate_wall,
sounds = mcl_sounds.node_sound_defaults{
footstep = {name="default_hard_footstep", gain=0.3},
},
is_ground_content = false,
_doc_items_create_entry = false,
_mcl_blast_resistance = 1,
_mcl_hardness = 1,
})
}
if mod_doc then
doc.add_entry_alias("nodes", "mcl_heads:" .. name, "nodes", "mcl_heads:" .. name .. "_wall")
function mcl_heads.deftemplate_wall.on_rotate(pos, node, user, mode, new_param2)
if mode == screwdriver.ROTATE_AXIS then
node.name = string.sub(node.name, 1, string.len(node.name)-5)
node.param2 = minetest.dir_to_facedir(minetest.wallmounted_to_dir(node.param2))
minetest.set_node(pos, node)
return true
end
end
-- Add heads
addhead("zombie", "mcl_heads_zombie_node.png", S("Zombie Head"), S("A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet, which reduces the detection range of zombies by 50%."), "mobs_mc:zombie", 0.5)
addhead("creeper", "mcl_heads_creeper_node.png", S("Creeper Head"), S("A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet, which reduces the detection range of creepers by 50%."), "mobs_mc:creeper", 0.5)
-- API functions -------------------------------------------------------------------------------------------------------
--- @class HeadDef
--- @field name string identifier for node
--- @field texture string armor texture for node
--- @field description string translated description
--- @field longdesc string translated doc description
--- @field range_mob string name of mob affected by range reduction
--- @field range_factor number factor of range reduction
--- registers a head
--- @param head_def HeadDef head node definition
function mcl_heads.register_head(head_def)
local name = "mcl_heads:" ..head_def.name
-- register the floor head node
minetest.register_node(name, table.update(table.copy(mcl_heads.deftemplate_floor), {
description = head_def.description,
_doc_items_longdesc = head_def.longdesc,
-- The head textures are based off the textures of an actual mob.
tiles = {
-- Note: bottom texture is overlaid over top texture to get rid of possible transparency.
-- This is required for skeleton skull and wither skeleton skull.
-- Note: -x coords go right per-pixel, -y coords go down per-pixel
"[combine:16x16:-36,4=" ..head_def.texture, -- top
"([combine:16x16:-36,4=" ..head_def.texture..")^([combine:16x16:-44,4="..head_def.texture..")", -- bottom
"[combine:16x16:-28,0=" ..head_def.texture, -- left
"[combine:16x16:-44,0=" ..head_def.texture, -- right
"[combine:16x16:-52,0=" ..head_def.texture, -- back
"[combine:16x16:-36,0=" ..head_def.texture, -- front
},
_mcl_armor_mob_range_mob = head_def.range_mob,
_mcl_armor_mob_range_factor = head_def.range_factor,
_mcl_armor_texture = head_def.texture
}))
-- register the angled floor head nodes
for i, d in ipairs(mcl_heads.FLOOR_DEGREES) do
minetest.register_node(name ..d, table.update(table.copy(mcl_heads.deftemplate_floor_angled), {
mesh = "mcl_heads_floor" ..d ..".obj",
tiles = { head_def.texture },
drop = name,
}))
end
-- register the wall head node
minetest.register_node(name .."_wall", table.update(table.copy(mcl_heads.deftemplate_wall), {
-- The head textures are based off the textures of an actual mob.
-- Note: -x coords go right per-pixel, -y coords go down per-pixel
tiles = {
{ name = "[combine:16x16:-36,-4=" ..head_def.texture, align_style = "world" }, -- front
{ name = "[combine:16x16:-52,-4="..head_def.texture, align_style = "world" }, -- back
{ name = "[combine:16x16:-40,-4=" ..head_def.texture, align_style = "world" }, -- right
{ name = "[combine:16x16:-32,-4=" ..head_def.texture, align_style = "world" }, -- left
{ name = "([combine:16x16:-36,0=" ..head_def.texture ..")^[transformR180", align_style = "node" }, -- top
-- Note: bottom texture is overlaid over top texture to get rid of possible transparency.
-- This is required for skeleton skull and wither skeleton skull.
{ name = "([combine:16x16:-36,0=" ..head_def.texture ..")^([combine:16x16:-44,8=" ..head_def.texture..")", align_style = "node" }, -- bottom
},
drop = name,
}))
end
-- initial heads -------------------------------------------------------------------------------------------------------
mcl_heads.register_head{
name = "zombie",
texture = "mcl_heads_zombie.png",
description = S("Zombie Head"),
longdesc = S("A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet, which reduces the detection range of zombies by 50%."),
range_mob = "mobs_mc:zombie",
range_factor = 0.5,
}
mcl_heads.register_head{
name = "creeper",
texture = "mcl_heads_creeper.png",
description = S("Creeper Head"),
longdesc = S("A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet, which reduces the detection range of creepers by 50%."),
range_mob = "mobs_mc:creeper",
range_factor = 0.5,
}
-- Original Minecraft name: “Head”
addhead("steve", "mcl_heads_steve_node.png", S("Human Head"), S("A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection."))
addhead("skeleton", "mcl_heads_skeleton_node.png", S("Skeleton Skull"), S("A skeleton skull is a small decorative block which resembles the skull of a skeleton. It can also be worn as a helmet, which reduces the detection range of skeletons by 50%."), "mobs_mc:skeleton", 0.5)
addhead("wither_skeleton", "mcl_heads_wither_skeleton_node.png", S("Wither Skeleton Skull"), S("A wither skeleton skull is a small decorative block which resembles the skull of a wither skeleton. It can also be worn as a helmet for fun, but does not offer any protection."))
mcl_heads.register_head{
name = "steve",
texture = "mcl_heads_steve.png",
description = S("Human Head"),
longdesc = S("A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection."),
}
mcl_heads.register_head{
name = "skeleton",
texture = "mcl_heads_skeleton.png",
description = S("Skeleton Skull"),
longdesc = S("A skeleton skull is a small decorative block which resembles the skull of a skeleton. It can also be worn as a helmet, which reduces the detection range of skeletons by 50%."),
range_mob = "mobs_mc:skeleton",
range_factor = 0.5,
}
mcl_heads.register_head{
name = "wither_skeleton",
texture = "mcl_heads_wither_skeleton.png",
description = S("Wither Skeleton Skull"),
longdesc = S("A wither skeleton skull is a small decorative block which resembles the skull of a wither skeleton. It can also be worn as a helmet for fun, but does not offer any protection."),
}

View file

@ -0,0 +1,42 @@
# Blender v2.93.9 OBJ File: 'mcl_heads_floor_0.blend'
# www.blender.org
mtllib mcl_heads_floor22_5.mtl
o Cube.001
v -0.326641 -0.500000 0.135299
v -0.326641 0.000000 0.135299
v -0.135299 -0.500000 -0.326641
v -0.135299 0.000000 -0.326641
v 0.135299 -0.500000 0.326641
v 0.135299 0.000000 0.326641
v 0.326641 -0.500000 -0.135299
v 0.326641 0.000000 -0.135299
vt 0.875000 0.500000
vt 0.875000 0.750000
vt 0.750000 0.750000
vt 0.750000 0.500000
vt 0.625000 0.750000
vt 0.625000 0.500000
vt 0.500000 0.750000
vt 0.500000 0.500000
vt 1.000000 0.500000
vt 1.000000 0.750000
vt 0.875000 0.750000
vt 0.875000 1.000000
vt 0.750000 1.000000
vt 0.750000 0.750000
vt 0.750000 1.000000
vt 0.625000 1.000000
vn -0.9239 0.0000 -0.3827
vn 0.3827 0.0000 -0.9239
vn 0.9239 0.0000 0.3827
vn -0.3827 0.0000 0.9239
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
usemtl Material.001
s off
f 1/1/1 2/2/1 4/3/1 3/4/1
f 3/4/2 4/3/2 8/5/2 7/6/2
f 7/6/3 8/5/3 6/7/3 5/8/3
f 5/9/4 6/10/4 2/2/4 1/1/4
f 3/11/5 7/12/5 5/13/5 1/14/5
f 8/5/6 4/3/6 2/15/6 6/16/6

View file

@ -0,0 +1,42 @@
# Blender v2.93.9 OBJ File: 'mcl_heads_floor_0.blend'
# www.blender.org
mtllib mcl_heads_floor45.mtl
o Cube.002
v -0.353553 -0.500000 0.000000
v -0.353553 0.000000 0.000000
v 0.000000 -0.500000 -0.353553
v 0.000000 0.000000 -0.353553
v 0.000000 -0.500000 0.353553
v 0.000000 0.000000 0.353553
v 0.353553 -0.500000 0.000000
v 0.353553 0.000000 0.000000
vt 0.875000 0.500000
vt 0.875000 0.750000
vt 0.750000 0.750000
vt 0.750000 0.500000
vt 0.625000 0.750000
vt 0.625000 0.500000
vt 0.500000 0.750000
vt 0.500000 0.500000
vt 1.000000 0.500000
vt 1.000000 0.750000
vt 0.875000 0.750000
vt 0.875000 1.000000
vt 0.750000 1.000000
vt 0.750000 0.750000
vt 0.750000 1.000000
vt 0.625000 1.000000
vn -0.7071 0.0000 -0.7071
vn 0.7071 0.0000 -0.7071
vn 0.7071 0.0000 0.7071
vn -0.7071 0.0000 0.7071
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
usemtl Material.002
s off
f 1/1/1 2/2/1 4/3/1 3/4/1
f 3/4/2 4/3/2 8/5/2 7/6/2
f 7/6/3 8/5/3 6/7/3 5/8/3
f 5/9/4 6/10/4 2/2/4 1/1/4
f 3/11/5 7/12/5 5/13/5 1/14/5
f 8/5/6 4/3/6 2/15/6 6/16/6

View file

@ -0,0 +1,42 @@
# Blender v2.93.9 OBJ File: 'mcl_heads_floor_0.blend'
# www.blender.org
mtllib mcl_heads_floor67_5.mtl
o Cube.003
v -0.326641 -0.500000 -0.135299
v -0.326641 0.000000 -0.135299
v 0.135299 -0.500000 -0.326641
v 0.135299 0.000000 -0.326641
v -0.135299 -0.500000 0.326641
v -0.135299 0.000000 0.326641
v 0.326641 -0.500000 0.135299
v 0.326641 0.000000 0.135299
vt 0.875000 0.500000
vt 0.875000 0.750000
vt 0.750000 0.750000
vt 0.750000 0.500000
vt 0.625000 0.750000
vt 0.625000 0.500000
vt 0.500000 0.750000
vt 0.500000 0.500000
vt 1.000000 0.500000
vt 1.000000 0.750000
vt 0.875000 0.750000
vt 0.875000 1.000000
vt 0.750000 1.000000
vt 0.750000 0.750000
vt 0.750000 1.000000
vt 0.625000 1.000000
vn -0.3827 0.0000 -0.9239
vn 0.9239 0.0000 -0.3827
vn 0.3827 0.0000 0.9239
vn -0.9239 0.0000 0.3827
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
usemtl Material.003
s off
f 1/1/1 2/2/1 4/3/1 3/4/1
f 3/4/2 4/3/2 8/5/2 7/6/2
f 7/6/3 8/5/3 6/7/3 5/8/3
f 5/9/4 6/10/4 2/2/4 1/1/4
f 3/11/5 7/12/5 5/13/5 1/14/5
f 8/5/6 4/3/6 2/15/6 6/16/6

Binary file not shown.

Before

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,5 +1,12 @@
mcl_structures.registered_structures = {}
local disabled_structures = minetest.settings:get("mcl_disabled_structures")
if disabled_structures then disabled_structures = disabled_structures:split(",")
else disabled_structures = {} end
function mcl_structures.is_disabled(structname)
if table.indexof(disabled_structures,structname) ~= -1 then return true end
end
function mcl_structures.fill_chests(p1,p2,loot,pr)
for it,lt in pairs(loot) do
@ -38,6 +45,88 @@ function mcl_structures.find_highest_y(pp)
return y
end
local function smooth_cube(nn,pos,plane,amnt)
local r = {}
local amnt = amnt or 9
table.sort(nn,function(a, b)
if false or plane then
return vector.distance(vector.new(pos.x,0,pos.z), vector.new(a.x,0,a.z)) < vector.distance(vector.new(pos.x,0,pos.z), vector.new(b.x,0,b.z))
else
return vector.distance(pos, a) < vector.distance(pos, b)
end
end)
for i=1,math.max(1,#nn-amnt) do table.insert(r,nn[i]) end
return r
end
local function find_ground(pos,nn,gn)
local r = 0
for _,v in pairs(nn) do
local p=vector.new(v)
repeat
local n = minetest.get_node(p).name
p = vector.offset(p,0,-1,0)
until not n or n == "mcl_core:bedrock" or n == "ignore" or n == gn
--minetest.log(tostring(pos.y - p.y))
if pos.y - p.y > r then r = pos.y - p.y end
end
return r
end
local function get_foundation_nodes(ground_p1,ground_p2,pos,sidelen,node_stone)
local replace = {"air","group:liquid","mcl_core:snow","group:tree","group:leaves","group:plant","grass_block","group:dirt"}
local depth = find_ground(pos,minetest.find_nodes_in_area(ground_p1,ground_p2,replace),node_stone)
local nn = smooth_cube(minetest.find_nodes_in_area(vector.offset(ground_p1,0,-1,0),vector.offset(ground_p2,0,-depth,0),replace),vector.offset(pos,0,-depth,0),true,sidelen * 64)
local stone = {}
local filler = {}
local top = {}
local dust = {}
for l,v in pairs(nn) do
if v.y == ground_p1.y - 1 then
table.insert(filler,v)
table.insert(top,vector.offset(v,0,1,0))
table.insert(dust,vector.offset(v,0,2,0))
elseif v.y < ground_p1.y -1 and v.y > ground_p2.y -4 then table.insert(filler,v)
elseif v.y < ground_p2.y - 3 and v.y > ground_p2.y -5 then
if math.random(3) == 1 then
table.insert(filler,v)
else
table.insert(stone,v)
end
else
table.insert(stone,v)
end
end
return stone,filler,top,dust
end
local function foundation(ground_p1,ground_p2,pos,sidelen)
local node_stone = "mcl_core:stone"
local node_filler = "mcl_core:dirt"
local node_top = "mcl_core:dirt_with_grass" or minetest.get_node(ground_p1).name
local node_dust = nil
if minetest.get_mapgen_setting("mg_name") ~= "v6" then
local b = minetest.registered_biomes[minetest.get_biome_name(minetest.get_biome_data(pos).biome)]
--minetest.log(dump(b.node_top))
if b then
if b.node_top then node_top = b.node_top end
if b.node_filler then node_filler = b.node_filler end
if b.node_stone then node_stone = b.node_stone end
if b.node_dust then node_dust = b.node_dust end
end
end
local stone,filler,top,dust = get_foundation_nodes(ground_p1,ground_p2,pos,sidelen,node_stone)
minetest.bulk_set_node(top,{name=node_top},node_stone)
if node_dust then
minetest.bulk_set_node(dust,{name=node_dust})
end
minetest.bulk_set_node(filler,{name=node_filler})
minetest.bulk_set_node(stone,{name=node_stone})
end
function mcl_structures.place_structure(pos, def, pr, blockseed)
if not def then return end
local logging = not def.terrain_feature
@ -55,28 +144,7 @@ function mcl_structures.place_structure(pos, def, pr, blockseed)
local solid = minetest.find_nodes_in_area(ground_p1,ground_p2,{"group:solid"})
if #solid < ( def.sidelen * def.sidelen ) then
if def.make_foundation then
local node_stone = "mcl_core:stone"
local node_filler = "mcl_core:dirt"
local node_top = "mcl_core:dirt_with_grass" or minetest.get_node(ground_p1).name
local node_dust = nil
if minetest.get_mapgen_setting("mg_name") ~= "v6" then
local b = minetest.registered_biomes[minetest.get_biome_name(minetest.get_biome_data(pos).biome)]
--minetest.log(dump(b.node_top))
if b then
if b.node_top then node_top = b.node_top end
if b.node_filler then node_filler = b.node_filler end
if b.node_stone then node_stone = b.node_stone end
if b.node_dust then node_dust = b.node_dust end
end
end
local replace = {"air","group:liquid","mcl_core:snow","group:tree","group:leaves"}
minetest.bulk_set_node(minetest.find_nodes_in_area(ground_p1,ground_p2,replace),{name=node_top})
if node_dust then
minetest.bulk_set_node(minetest.find_nodes_in_area(vector.offset(ground_p1,0,1,0),vector.offset(ground_p2,0,1,0),{"air"}),{name=node_dust})
end
minetest.bulk_set_node(minetest.find_nodes_in_area(vector.offset(ground_p1,0,-1,0),vector.offset(ground_p2,0,-4,0),replace),{name=node_filler})
minetest.bulk_set_node(minetest.find_nodes_in_area(vector.offset(ground_p1,0,-5,0),vector.offset(ground_p2,0,-30,0),replace),{name=node_stone})
foundation(vector.offset(pos,-def.sidelen/2 - 3,-1,-def.sidelen/2 - 3),vector.offset(pos,def.sidelen/2 + 3,-1,def.sidelen/2 + 3),pos,def.sidelen)
else
if logging then
minetest.log("warning","[mcl_structures] "..def.name.." at "..minetest.pos_to_string(pp).." not placed. No solid ground.")
@ -122,6 +190,7 @@ function mcl_structures.place_structure(pos, def, pr, blockseed)
end
function mcl_structures.register_structure(name,def,nospawn) --nospawn means it will be placed by another (non-nospawn) structure that contains it's structblock i.e. it will not be placed by mapgen directly
if mcl_structures.is_disabled(name) then return end
local structblock = "mcl_structures:structblock_"..name
local flags = "place_center_x, place_center_z, force_placement"
local y_offset = 0

View file

@ -16,11 +16,11 @@ local def = {
flags = "place_center_x, place_center_z, all_floors",
solid_ground = true,
make_foundation = true,
chunk_probability = 400,
chunk_probability = 800,
y_max = mcl_vars.mg_overworld_max,
y_min = 1,
sidelen = 10,
y_offset = -4,
y_offset = -5,
filenames = {
modpath.."/schematics/mcl_structures_ruined_portal_1.mts",
modpath.."/schematics/mcl_structures_ruined_portal_2.mts",

View file

@ -29,7 +29,7 @@ local function airtower(pos,tbl,h)
end
end
local function makelake(pos,size,liquid,placein,border,pr)
local function makelake(pos,size,liquid,placein,border,pr,noair)
local node_under = minetest.get_node(vector.offset(pos,0,-1,0))
local p1 = vector.offset(pos,-size,-1,-size)
local p2 = vector.offset(pos,size,-1,size)
@ -70,7 +70,7 @@ local function makelake(pos,size,liquid,placein,border,pr)
end
if border == nil or border == "mcl_core:dirt" then border = "mcl_core:dirt_with_grass" end
end
if an.name ~= liquid then
if not noair and an.name ~= liquid then
table.insert(br,pp)
if un.name ~= liquid then
airtower(pp,air,55)
@ -205,7 +205,28 @@ mcl_structures.register_structure("water_lake",{
y_max = mcl_vars.mg_overworld_max,
y_min = minetest.get_mapgen_setting("water_level"),
place_func = function(pos,def,pr)
return makelake(pos,5,"mcl_core:water_source",{"group:material_stone", "group:sand", "group:dirt","group:grass_block"},nil,pr)
return makelake(pos,5,"mcl_core:water_source",{"group:material_stone", "group:sand", "group:dirt","group:grass_block"},"mcl_core:dirt_with_grass",pr)
end
})
mcl_structures.register_structure("water_lake_mangrove_swamp",{
place_on = {"mcl_mud:mud"},
biomes = { "MangroveSwamp" },
terrain_feature = true,
noise_params = {
offset = 0,
scale = 0.0032,
spread = {x = 250, y = 250, z = 250},
seed = 6343241353,
octaves = 3,
persist = 0.001,
flags = "absvalue",
},
flags = "place_center_x, place_center_z, force_placement",
y_max = mcl_vars.mg_overworld_max,
y_min = minetest.get_mapgen_setting("water_level"),
place_func = function(pos,def,pr)
return makelake(pos,3,"mcl_core:water_source",{"group:material_stone", "group:sand", "group:dirt","group:grass_block","mcl_mud:mud"},"mcl_mud:mud",pr,true)
end
})

View file

@ -432,9 +432,15 @@ minetest.register_globalstep(function(dtime)
-- sets eye height, and nametag color accordingly
set_properties_conditional(player,{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
<<<<<<< HEAD
set_bone_position_conditional(player,"Body_Control", vector.new(0,6.3,0), vector.new((75-degrees(dir_to_pitch(player_velocity))) , -player_vel_yaw + yaw, 0))
elseif get_item_group(mcl_playerinfo[name].node_head, "opaque") == 0
and get_item_group(mcl_playerinfo[name].node_head_top, "opaque") == 0 then
=======
set_bone_position_conditional(player,"Body_Control", vector.new(0,6.3,0), vector.new(degrees(dir_to_pitch(player_velocity)) - 90,-player_vel_yaw + yaw + 180,0))
elseif get_item_group(mcl_playerinfo[name].node_head, "solid") == 0
and get_item_group(mcl_playerinfo[name].node_head_top, "solid") == 0 then
>>>>>>> master
-- sets eye height, and nametag color accordingly
is_swimming = false
set_properties_conditional(player,{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 }})

View file

@ -39,6 +39,9 @@ mcl_doTileDrops (Blocks have drops) bool true
# If enabled, TNT explosions destroy blocks.
mcl_tnt_griefing (TNT destroys blocks) bool true
# Comma separated list of disabled structure names
mcl_disabled_structures (Disabled structures) string
[Players]
# If enabled, players respawn at the bed they last lay on instead of normal
# spawn.