Compare commits

..

10 Commits

77 changed files with 503 additions and 968 deletions

View File

@ -26,10 +26,12 @@ mcl_vars.tool_wield_scale = { x = 1.8, y = 1.8, z = 1 }
-- Mapgen variables
local mg_name = minetest.get_mapgen_setting("mg_name")
local minecraft_height_limit = 256
local minecraft_height_limit = 320
local superflat = mg_name == "flat" and minetest.get_mapgen_setting("mcl_superflat_classic") == "true"
local singlenode = mg_name == "singlenode"
local convert_old_bedrock = minetest.settings:get_bool("mcl_convert_old_bedrock", true)
-- Calculate mapgen_edge_min/mapgen_edge_max
mcl_vars.chunksize = math.max(1, tonumber(minetest.get_mapgen_setting("chunksize")) or 5)
mcl_vars.MAP_BLOCKSIZE = math.max(1, minetest.MAP_BLOCKSIZE or 16)
@ -99,7 +101,10 @@ if not superflat and not singlenode then
]]
-- Overworld
mcl_vars.mg_overworld_min = -62
local mg_overworld_min_default = -128
mcl_vars.mg_overworld_min_old = -62
mcl_vars.mg_overworld_min = tonumber(minetest.settings:get("mcl_overworld_min")) or mg_overworld_min_default
mcl_vars.mg_overworld_max_official = mcl_vars.mg_overworld_min + minecraft_height_limit
mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min
mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min + 4
@ -108,7 +113,8 @@ if not superflat and not singlenode then
mcl_vars.mg_bedrock_is_rough = true
elseif singlenode then
mcl_vars.mg_overworld_min = -66
mcl_vars.mg_overworld_min_old = -66
mcl_vars.mg_overworld_min = -130
mcl_vars.mg_overworld_max_official = mcl_vars.mg_overworld_min + minecraft_height_limit
mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min
mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min
@ -262,3 +268,57 @@ function mcl_vars.get_node(p, force, us_timeout)
return node
-- it still can return "ignore", LOL, even if force = true, but only after time out
end
-- Abm to update from old mapgen depth to new. potentially affects a lot of nodes inducing lag.
-- Also it will not generate ores or bedrock pattern.
local adjacents = {
vector.new(1,0,0),
vector.new(0,1,0),
vector.new(0,0,1),
vector.new(-1,0,0),
vector.new(0,-1,0),
vector.new(0,0,-1),
}
local function register_abms()
minetest.register_abm({
label = "Replace bedrock from old bedrock layer and air/void below to deepslate",
name = ":mcl_mapgen_core:replace_old_void",
nodenames = { "mcl_core:void" },
chance = 1,
interval = 5,
min_y = mcl_vars.mg_bedrock_overworld_max,
max_y = mcl_vars.mg_overworld_min_old,
action = function(p)
minetest.log("void")
if p.y > mcl_vars.mg_overworld_min_old - 5 then
minetest.bulk_set_node(minetest.find_nodes_in_area(vector.new(p.x-5,mcl_vars.mg_overworld_min_old-5,p.z-5),vector.new(p.x+5,mcl_vars.mg_overworld_min_old,p.z+5),{"mcl_core:void"}),{name="mcl_deepslate:deepslate"})
else
minetest.after(0,function(p)
if minetest.get_node(p).name == "mcl_core:void" then
minetest.delete_area(p,p)
end
end,p)
end
end
})
minetest.register_abm({
label = "Replace bedrock from old bedrock layer and air/void below to deepslate",
name = ":mcl_mapgen_core:replace_old_bedrock",
nodenames = { "mcl_core:bedrock" },
chance = 5,
interval = 5,
min_y = mcl_vars.mg_overworld_min_old,
max_y = mcl_vars.mg_overworld_min_old + 4,
action = function(p)
minetest.log("bedr")
if minetest.find_node_near(p,24,{"mcl_core:void"}) then
return
end
minetest.bulk_set_node(minetest.find_nodes_in_area(vector.new(p.x-5,mcl_vars.mg_overworld_min_old-1,p.z-5),vector.new(p.x+5,mcl_vars.mg_overworld_min_old+5,p.z+5),{"mcl_core:bedrock",}),{name="mcl_deepslate:deepslate"})
end
})
end
if convert_old_bedrock then
register_abms()
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 B

View File

@ -610,95 +610,3 @@ function mcl_util.get_pointed_thing(player, liquid)
end
end
end
-- This following part is 2 wrapper functions + helpers for
-- object:set_bones
-- and player:set_properties preventing them from being resent on
-- every globalstep when they have not changed.
local function roundN(n, d)
if type(n) ~= "number" then return n end
local m = 10^d
return math.floor(n * m + 0.5) / m
end
local function close_enough(a,b)
local rt=true
if type(a) == "table" and type(b) == "table" then
for k,v in pairs(a) do
if roundN(v,2) ~= roundN(b[k],2) then
rt=false
break
end
end
else
rt = roundN(a,2) == roundN(b,2)
end
return rt
end
local function props_changed(props,oldprops)
local changed=false
local p={}
for k,v in pairs(props) do
if not close_enough(v,oldprops[k]) then
p[k]=v
changed=true
end
end
return changed,p
end
--tests for roundN
local test_round1=15
local test_round2=15.00199999999
local test_round3=15.00111111
local test_round4=15.00999999
assert(roundN(test_round1,2)==roundN(test_round1,2))
assert(roundN(test_round1,2)==roundN(test_round2,2))
assert(roundN(test_round1,2)==roundN(test_round3,2))
assert(roundN(test_round1,2)~=roundN(test_round4,2))
-- tests for close_enough
local test_cb = {-0.35,0,-0.35,0.35,0.8,0.35} --collisionboxes
local test_cb_close = {-0.351213,0,-0.35,0.35,0.8,0.351212}
local test_cb_diff = {-0.35,0,-1.35,0.35,0.8,0.35}
local test_eh = 1.65 --eye height
local test_eh_close = 1.65123123
local test_eh_diff = 1.35
local test_nt = { r = 225, b = 225, a = 225, g = 225 } --nametag
local test_nt_diff = { r = 225, b = 225, a = 0, g = 225 }
assert(close_enough(test_cb,test_cb_close))
assert(not close_enough(test_cb,test_cb_diff))
assert(close_enough(test_eh,test_eh_close))
assert(not close_enough(test_eh,test_eh_diff))
assert(not close_enough(test_nt,test_nt_diff)) --no floats involved here
--tests for properties_changed
local test_properties_set1={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 }}
local test_properties_set2={collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}
local test_p1,_=props_changed(test_properties_set1,test_properties_set1)
local test_p2,_=props_changed(test_properties_set1,test_properties_set2)
assert(not test_p1)
assert(test_p2)
function mcl_util.set_properties(obj,props)
local changed,p=props_changed(props,obj:get_properties())
if changed then
obj:set_properties(p)
end
end
function mcl_util.set_bone_position(obj,b,p,r) --bone,position,rotation
local oldp,oldr=obj:get_bone_position(b)
if vector.equals(vector.round(oldp),vector.round(p)) and vector.equals(vector.round(oldr),vector.round(r)) then
return
end
obj:set_bone_position(b,p,r)
end

View File

@ -36,7 +36,7 @@ end
-- nil, "void"
function mcl_worlds.y_to_layer(y)
if y >= mcl_vars.mg_overworld_min then
return y - mcl_vars.mg_overworld_min, "overworld"
return y - mcl_vars.mg_overworld_min_old, "overworld"
elseif y >= mcl_vars.mg_nether_min and y <= mcl_vars.mg_nether_max+128 then
return y - mcl_vars.mg_nether_min, "nether"
elseif y >= mcl_vars.mg_end_min and y <= mcl_vars.mg_end_max then
@ -62,7 +62,7 @@ local pos_to_dimension = mcl_worlds.pos_to_dimension
-- mc_dimension is one of "overworld", "nether", "end" (default: "overworld").
function mcl_worlds.layer_to_y(layer, mc_dimension)
if mc_dimension == "overworld" or mc_dimension == nil then
return layer + mcl_vars.mg_overworld_min
return layer + mcl_vars.mg_overworld_min_old
elseif mc_dimension == "nether" then
return layer + mcl_vars.mg_nether_min
elseif mc_dimension == "end" then

View File

@ -1,5 +1,3 @@
local enable_damage = minetest.settings:get_bool("enable_damage")
function mcl_burning.get_storage(obj)
return obj:is_player() and mcl_burning.storage[obj] or obj:get_luaentity()
end
@ -79,7 +77,7 @@ end
-- The effective burn duration is modified by obj's armor protection.
-- If obj was already burning, its burn duration is updated if the current
-- duration is less than burn_time.
-- If obj is dead, fireproof or enable_damage is disabled, this function does nothing.
-- If obj is dead, fireproof or a creative player, this function does nothing.
--
function mcl_burning.set_on_fire(obj, burn_time)
if obj:get_hp() < 0 then
@ -91,9 +89,8 @@ function mcl_burning.set_on_fire(obj, burn_time)
return
end
if obj:is_player() and not enable_damage then
if obj:is_player() and minetest.is_creative_enabled(obj:get_player_name()) then
burn_time = 0
return
else
local max_fire_prot_lvl = 0
local inv = mcl_util.get_inventory(obj)

View File

@ -42,7 +42,7 @@ local function register_drop(liquid, glow, sound, nodes, interval, chance)
--with longer abm cycles
table.shuffle(nn)
for i=1,math.random(#nn) do
if minetest.get_item_group(minetest.get_node(vector.offset(nn[i], 0, 1, 0)).name, liquid) ~= 0
if nn[i] and minetest.get_item_group(minetest.get_node(vector.offset(nn[i], 0, 1, 0)).name, liquid) ~= 0
and minetest.get_node(vector.offset(nn[i], 0, -1, 0)).name == "air" then
make_drop(nn[i],liquid,sound,interval)
end

View File

@ -16,29 +16,6 @@ local CRAMMING_DAMAGE = 3
-- Localize
local S = minetest.get_translator("mcl_mobs")
local function shortest_term_of_yaw_rotatoin(self, rot_origin, rot_target, nums)
if not rot_origin or not rot_target then
return
end
rot_origin = math.deg(rot_origin)
rot_target = math.deg(rot_target)
if math.abs(rot_target - rot_origin) < 180 then
return rot_target - rot_origin
else
if (rot_target - rot_origin) > 0 then
return 360-(rot_target - rot_origin)
else
return (rot_target - rot_origin)+360
end
end
end
-- Invisibility mod check
mcl_mobs.invis = {}
@ -84,13 +61,6 @@ if minetest.settings:get_bool("only_peaceful_mobs", false) then
end)
end
local function dir_to_pitch(dir)
--local dir2 = vector.normalize(dir)
local xz = math.abs(dir.x) + math.abs(dir.z)
return -math.atan2(-dir.y, xz)
end
-- pathfinding settings
local enable_pathfinding = true
local stuck_timeout = 3 -- how long before mob gets stuck in place and starts searching
@ -332,57 +302,25 @@ local function update_roll(self)
end
-- set and return valid yaw
local set_yaw = function(self, yaw, delay, dtime)
if self.noyaw then return end
if self._kb_turn then
self._turn_to = yaw
end
--clamp our yaw to a 360 range
if math.deg(self.object:get_yaw()) > 360 then
self.object:set_yaw(math.rad(10))
elseif math.deg(self.object:get_yaw()) < 0 then
self.object:set_yaw(math.rad(350))
if true then
self.object:set_yaw(yaw)
return yaw
end
--calculate the shortest way to turn to find our target
local target_shortest_path = shortest_term_of_yaw_rotatoin(self, self.object:get_yaw(), yaw, true)
--turn in the shortest path possible toward our target. if we are attacking, don't dance.
if math.abs(target_shortest_path) > 100 and (self.attack and self.attack:get_pos() or self.following and self.following:get_pos()) then
if self.following then
target_shortest_path = shortest_term_of_yaw_rotatoin(self, self.object:get_yaw(), minetest.dir_to_yaw(vector.direction(self.object:get_pos(), self.following:get_pos())), true)
else
target_shortest_path = shortest_term_of_yaw_rotatoin(self, self.object:get_yaw(), minetest.dir_to_yaw(vector.direction(self.object:get_pos(), self.attack:get_pos())), true)
end
end
local ddtime = 0.05 --set_tick_rate
if dtime then
ddtime = dtime
end
if math.abs(target_shortest_path) > 280*ddtime then
if target_shortest_path > 0 then
self.object:set_yaw(self.object:get_yaw()+3.6*ddtime)
else
self.object:set_yaw(self.object:get_yaw()-3.6*ddtime)
end
if not yaw or yaw ~= yaw then
yaw = 0
end
delay = delay or 0
yaw = self.object:get_yaw()
if delay == 0 then
if self.shaking and dtime then
yaw = yaw + (random() * 2 - 1) * 5 * dtime
end
self.object:set_yaw(yaw)
update_roll(self)
return yaw
end
@ -467,10 +405,6 @@ local set_animation = function(self, anim, fixed_frame)
return
end
if self.jockey then
anim = "jockey"
end
if flight_check(self) and self.fly and anim == "walk" then anim = "fly" end
self._current_animation = self._current_animation or ""
@ -1969,6 +1903,7 @@ end
-- find someone to attack
local monster_attack = function(self)
if not damage_enabled
or minetest.is_creative_enabled("")
or self.passive ~= false
or self.state == "attack"
or day_docile(self) then
@ -3370,13 +3305,6 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
elseif luaentity and luaentity._knockback then
kb = kb + luaentity._knockback
end
--self._kb_turn = false
self._turn_to=self.object:get_yaw()+0.85
minetest.after(0.2, function()
if self and self.object then
self._kb_turn = true
end
end)
self.object:set_velocity({
x = dir.x * kb,
@ -3463,11 +3391,6 @@ end
local mob_detach_child = function(self, child)
if self.detach_child then
if self.detach_child(self, child) then
return
end
end
if self.driver == child then
self.driver = nil
end
@ -3740,9 +3663,6 @@ local mob_step = function(self, dtime)
end
-- smooth rotation by ThomasMonroe314
if self._turn_to then
set_yaw(self, self._turn_to, .1)
end
if self.delay and self.delay > 0 then
@ -3786,66 +3706,6 @@ local mob_step = function(self, dtime)
-- end rotation
if self.head_swivel and type(self.head_swivel) == "string" then
local oldp,oldr = self.object:get_bone_position(self.head_swivel)
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 10)) do
if obj:is_player() and not self.attack or obj:get_luaentity() and obj:get_luaentity().name == self.name and self ~= obj:get_luaentity() then
if not self._locked_object then
if math.random(5000/self.curiosity) == 1 then
self._locked_object = obj
end
else
if math.random(10000/self.curiosity) == 1 then
self._locked_object = nil
end
end
end
end
if self.attack then
self._locked_object = self.attack
end
if self._locked_object and (self._locked_object:is_player() or self._locked_object:get_luaentity()) and self._locked_object:get_hp() > 0 then
local _locked_object_eye_height = 1.5
if self._locked_object:get_luaentity() then
_locked_object_eye_height = self._locked_object:get_luaentity().head_eye_height
end
if self._locked_object:is_player() then
_locked_object_eye_height = self._locked_object:get_properties().eye_height
end
local self_rot = self.object:get_rotation()
if self.object:get_attach() then
self_rot = self.object:get_attach():get_rotation()
end
local player_pos = self._locked_object:get_pos()
local direction_player = vector.direction(vector.add(self.object:get_pos(), vector.new(0, self.head_eye_height*.7, 0)), vector.add(player_pos, vector.new(0, _locked_object_eye_height, 0)))
local mob_yaw = math.deg(-(-(self_rot.y)-(-minetest.dir_to_yaw(direction_player))))+self.head_yaw_offset
local mob_pitch = math.deg(-dir_to_pitch(direction_player))*self.head_pitch_multiplier
if (mob_yaw < -60 or mob_yaw > 60) and not (self.attack and self.type == "monster") then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.multiply(oldr, 0.9))
elseif self.attack and self.type == "monster" then
if self.head_yaw == "y" then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(mob_pitch, mob_yaw, 0))
elseif self.head_yaw == "z" then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(mob_pitch, 0, -mob_yaw))
end
else
if self.head_yaw == "y" then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, ((mob_yaw-oldr.y)*.3)+oldr.y, 0))
elseif self.head_yaw == "z" then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, 0, -(((mob_yaw-oldr.y)*.3)+oldr.y)*3))
end
end
elseif not self._locked_object and math.abs(oldr.y) > 3 and math.abs(oldr.x) < 3 then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.multiply(oldr, 0.9))
else
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(0,0,0))
end
end
-- run custom function (defined in mob lua file)
if self.do_custom then
@ -4086,14 +3946,6 @@ end
minetest.register_entity(name, {
use_texture_alpha = def.use_texture_alpha,
head_swivel = def.head_swivel or nil, -- bool to activate this function
head_yaw_offset = def.head_yaw_offset or 0, -- for wonkey model bones
head_pitch_multiplier = def.head_pitch_multiplier or 1, --for inverted pitch
bone_eye_height = def.bone_eye_height or 1.4, -- head bone offset
head_eye_height = def.head_eye_height or def.bone_eye_height or 0, -- how hight aproximatly the mobs head is fromm the ground to tell the mob how high to look up at the player
curiosity = def.curiosity or 1, -- how often mob will look at player on idle
head_yaw = def.head_yaw or "y", -- axis to rotate head on
horrizonatal_head_height = def.horrizonatal_head_height or 0,
stepheight = def.stepheight or 0.6,
name = name,
description = def.description,
@ -4106,7 +3958,6 @@ minetest.register_entity(name, {
on_die = def.on_die,
spawn_small_alternative = def.spawn_small_alternative,
do_custom = def.do_custom,
detach_child = def.detach_child,
jump_height = def.jump_height or 4, -- was 6
rotate = math.rad(def.rotate or 0), -- 0=front, 90=side, 180=back, 270=side2
lifetimer = def.lifetimer or 57.73,

View File

@ -26,12 +26,6 @@ mcl_mobs:register_mob("mobs_mc:blaze", {
rotate = -180,
visual = "mesh",
mesh = "mobs_mc_blaze.b3d",
head_swivel = "head.control",
bone_eye_height = 4,
head_eye_height = 3.5,
curiosity = 10,
head_yaw_offset = 180,
head_pitch_multiplier=-1,
textures = {
{"mobs_mc_blaze.png"},
},

View File

@ -20,13 +20,6 @@ mcl_mobs:register_mob("mobs_mc:chicken", {
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.69, 0.2},
runaway = true,
floats = 1,
head_swivel = "head.control",
bone_eye_height = 4,
head_eye_height = 1.5,
horrizonatal_head_height = -.3,
curiosity = 10,
head_yaw="z",
visual_size = {x=1,y=1},
visual = "mesh",
mesh = "mobs_mc_chicken.b3d",
textures = {

View File

@ -17,12 +17,6 @@ local cow_def = {
"mobs_mc_cow.png",
"blank.png",
}, },
head_swivel = "head.control",
bone_eye_height = 10,
head_eye_height = 1.1,
horrizonatal_head_height=-1.8,
curiosity = 2,
head_yaw="z",
makes_footstep_sound = true,
walk_velocity = 1,
drops = {

View File

@ -21,9 +21,6 @@ mcl_mobs:register_mob("mobs_mc:creeper", {
pathfinding = 1,
visual = "mesh",
mesh = "mobs_mc_creeper.b3d",
head_swivel = "Head_Control",
bone_eye_height = 2.35,
curiosity = 2,
textures = {
{"mobs_mc_creeper.png",
"mobs_mc_empty.png"},

View File

@ -42,7 +42,6 @@ minetest.register_entity("mobs_mc:ender_eyes", {
})
local S = minetest.get_translator("mobs_mc")
local enable_damage = minetest.settings:get_bool("enable_damage")
local telesound = function(pos, is_source)
local snd
@ -264,8 +263,8 @@ mcl_mobs:register_mob("mobs_mc:enderman", {
end
end
if not spider_eyes then
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.top", vector.new(0,2.54,-1.99), vector.new(90,0,180))
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.top", vector.new(1,2.54,-1.99), vector.new(90,0,180))
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.low", vector.new(0,3.25,-1.98), vector.new(90,0,180))
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.low", vector.new(1,3.25,-1.98), vector.new(90,0,180))
end
end,
sounds = {
@ -413,7 +412,7 @@ mcl_mobs:register_mob("mobs_mc:enderman", {
-- self:teleport(nil)
-- self.state = ""
--else
if self.attack ~= nil and enable_damage then
if self.attack ~= nil and not minetest.settings:get_bool("creative_mode") then
self.state = 'attack'
end
--end

View File

@ -22,9 +22,6 @@ mcl_mobs:register_mob("mobs_mc:iron_golem", {
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.69, 0.7},
visual = "mesh",
mesh = "mobs_mc_iron_golem.b3d",
head_swivel = "head.control",
bone_eye_height = 3.38,
curiosity = 10,
textures = {
{"mobs_mc_iron_golem.png"},
},

View File

@ -58,14 +58,6 @@ mcl_mobs:register_mob("mobs_mc:llama", {
shoot_offset = 1, --3.5 *would* be a good value visually but it somehow messes with the projectiles trajectory
spawn_in_group_min = 4,
spawn_in_group = 6,
head_swivel = "head.control",
bone_eye_height = 11,
head_eye_height = 3,
horrizonatal_head_height=0,
curiosity = 60,
head_yaw = "z",
hp_min = 15,
hp_max = 30,
xp_min = 1,

View File

@ -36,12 +36,6 @@ local ocelot = {
hp_max = 10,
xp_min = 1,
xp_max = 3,
head_swivel = "head.control",
bone_eye_height = 6.2,
head_eye_height = 0.4,
horrizonatal_head_height=-0,
head_yaw="z",
curiosity = 4,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.69, 0.3},
visual = "mesh",
mesh = "mobs_mc_cat.b3d",

View File

@ -135,10 +135,6 @@ mcl_mobs:register_mob("mobs_mc:parrot", {
hp_max = 6,
xp_min = 1,
xp_max = 3,
head_swivel = "head.control",
bone_eye_height = 1.1,
horrizonatal_head_height=0,
curiosity = 10,
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
visual = "mesh",
mesh = "mobs_mc_parrot.b3d",

View File

@ -18,12 +18,6 @@ mcl_mobs:register_mob("mobs_mc:pig", {
"mobs_mc_pig.png", -- base
"blank.png", -- saddle
}},
head_swivel = "head.control",
bone_eye_height = 7.5,
head_eye_height = 0.8,
horrizonatal_head_height=-1,
curiosity = 3,
head_yaw="z",
makes_footstep_sound = true,
walk_velocity = 1,
run_velocity = 3,

View File

@ -24,12 +24,6 @@ mcl_mobs:register_mob("mobs_mc:polar_bear", {
textures = {
{"mobs_mc_polarbear.png"},
},
head_swivel = "head.control",
bone_eye_height = 2.6,
head_eye_height = 1,
horrizonatal_head_height = 0,
curiosity = 20,
head_yaw="z",
visual_size = {x=3.0, y=3.0},
makes_footstep_sound = true,
damage = 6,

View File

@ -15,12 +15,7 @@ local rabbit = {
xp_min = 1,
xp_max = 3,
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2},
head_swivel = "head.control",
bone_eye_height = 2,
head_eye_height = 0.5,
horrizonatal_head_height = -.3,
curiosity = 20,
head_yaw="z",
visual = "mesh",
mesh = "mobs_mc_rabbit.b3d",
textures = {

View File

@ -61,12 +61,7 @@ mcl_mobs:register_mob("mobs_mc:sheep", {
xp_min = 1,
xp_max = 3,
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.29, 0.45},
head_swivel = "head.control",
bone_eye_height = 3.3,
head_eye_height = 1.1,
horrizonatal_head_height=-.7,
curiosity = 6,
head_yaw="z",
visual = "mesh",
mesh = "mobs_mc_sheepfur.b3d",
textures = { sheep_texture("unicolor_white") },

View File

@ -25,15 +25,13 @@ local skeleton = {
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3},
pathfinding = 1,
group_attack = true,
head_swivel = "Head_Control",
bone_eye_height = 2.38,
curiosity = 6,
visual = "mesh",
mesh = "mobs_mc_skeleton.b3d",
textures = { {
"mcl_bows_bow_0.png", -- bow
"mobs_mc_skeleton.png", -- skeleton
} },
visual_size = {x=1, y=1},
makes_footstep_sound = true,
textures = {
{
@ -80,27 +78,11 @@ local skeleton = {
run_speed = 30,
shoot_start = 70,
shoot_end = 90,
jockey_start = 172,
jockey_end = 172,
die_start = 160,
die_end = 170,
die_speed = 15,
die_loop = false,
},
jock = "mobs_mc:spider",
on_spawn = function(self)
self.jockey = false
if math.random(100) == 1 then -- 1% like from MCwiki
self.jockey = true
local jock = minetest.add_entity(self.object:get_pos(), "mobs_mc:spider")
jock:get_luaentity().docile_by_day = false
self.object:set_attach(jock, "", vector.new(0,0,0), vector.new(0,0,0))
end
return true
end,
on_detach=function(self, parent)
self.jockey = false
end,
ignited_by_sunlight = true,
view_range = 16,
fear_height = 4,
@ -108,9 +90,6 @@ local skeleton = {
arrow = "mcl_bows:arrow_entity",
shoot_arrow = function(self, pos, dir)
if mod_bows then
if self.attack then
self.object:set_yaw(minetest.dir_to_yaw(vector.direction(self.object:get_pos(), self.attack:get_pos())))
end
-- 2-4 damage per arrow
local dmg = math.max(4, math.random(2, 8))
mcl_bows.shoot_arrow("mcl_bows:arrow", pos, dir, self.object:get_yaw(), self.object, nil, dmg)

View File

@ -24,14 +24,11 @@ mcl_mobs:register_mob("mobs_mc:witherskeleton", {
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2.39, 0.35},
visual = "mesh",
mesh = "mobs_mc_witherskeleton.b3d",
head_swivel = "head.control",
bone_eye_height = 2.38,
curiosity = 60,
textures = {
{
"mobs_mc_empty.png", -- armor
"default_tool_stonesword.png", -- sword
"mobs_mc_wither_skeleton.png", -- wither skeleton
"default_tool_stonesword.png", -- sword
}
},
visual_size = {x=1.2, y=1.2},

View File

@ -14,7 +14,7 @@ local S = minetest.get_translator("mobs_mc")
minetest.register_entity("mobs_mc:spider_eyes", {
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
visual_size = {x=1.01/3, y=1.01/3},
visual_size = {x=1.01, y=1.01},
textures = {
"mobs_mc_spider_eyes.png",
},
@ -44,7 +44,6 @@ local spider = {
xp_max = 5,
armor = {fleshy = 100, arthropod = 100},
on_spawn = function(self)
self.object:set_properties({visual_size={x=1,y=1}})
local spider_eyes=false
for n = 1, #self.object:get_children() do
local obj = self.object:get_children()[n]
@ -56,25 +55,13 @@ local spider = {
minetest.add_entity(self.object:get_pos(), "mobs_mc:spider_eyes"):set_attach(self.object, "body.head", vector.new(0,-0.98,2), vector.new(90,180,180))
end
end,
on_die=function(self)
if self.object:get_children() and self.object:get_children()[1] then
self.object:get_children()[1]:set_detach()
end
end,
detach_child=function(self, child)
child:get_luaentity().jockey = false
end,
head_swivel = "Head_Control",
bone_eye_height = 1,
curiosity = 10,
head_yaw="z",
collisionbox = {-0.7, -0.01, -0.7, 0.7, 0.89, 0.7},
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
textures = {
{"mobs_mc_spider.png"},
},
visual_size = {x=1, y=1},
visual_size = {x=3, y=3},
makes_footstep_sound = false,
sounds = {
random = "mobs_mc_spider_random",

View File

@ -1235,10 +1235,6 @@ mcl_mobs:register_mob("mobs_mc:villager", {
spawn_class = "passive",
hp_min = 20,
hp_max = 20,
head_swivel = "head.control",
bone_eye_height = 6.3,
head_eye_height = 2.2,
curiosity = 10,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
visual = "mesh",
mesh = "mobs_mc_villager.b3d",

View File

@ -21,10 +21,6 @@ mcl_mobs:register_mob("mobs_mc:evoker", {
hp_max = 24,
xp_min = 10,
xp_max = 10,
head_swivel = "head.control",
bone_eye_height = 6.3,
head_eye_height = 2.2,
curiosity = 10,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.95, 0.4},
visual = "mesh",
mesh = "mobs_mc_villager.b3d",

View File

@ -33,10 +33,6 @@ mcl_mobs:register_mob("mobs_mc:illusioner", {
"mobs_mc_illusionist.png", --hat
"mcl_bows_bow.png",
}, },
head_swivel = "head.control",
bone_eye_height = 2.2,
head_eye_height = 2.2,
curiosity = 10,
sounds = {
-- TODO: more sounds
distance = 16,

View File

@ -23,10 +23,6 @@ mcl_mobs:register_mob("mobs_mc:vindicator", {
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
visual = "mesh",
mesh = "mobs_mc_vindicator.b3d",
head_swivel = "head.control",
bone_eye_height = 2.2,
head_eye_height = 2.2,
curiosity = 10,
textures = {
{
"mobs_mc_vindicator.png",

View File

@ -39,16 +39,13 @@ mcl_mobs:register_mob("mobs_mc:villager_zombie", {
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
visual = "mesh",
mesh = "mobs_mc_villager_zombie.b3d",
head_swivel = "Head_Control",
bone_eye_height = 2.35,
curiosity = 2,
textures = {
{"mobs_mc_zombie_butcher.png"},
{"mobs_mc_zombie_farmer.png"},
{"mobs_mc_zombie_librarian.png"},
{"mobs_mc_zombie_priest.png"},
{"mobs_mc_zombie_smith.png"},
{"mobs_mc_zombie_villager.png"},
{"mobs_mc_empty.png", "mobs_mc_zombie_butcher.png", "mobs_mc_empty.png"},
{"mobs_mc_empty.png", "mobs_mc_zombie_farmer.png", "mobs_mc_empty.png"},
{"mobs_mc_empty.png", "mobs_mc_zombie_librarian.png", "mobs_mc_empty.png"},
{"mobs_mc_empty.png", "mobs_mc_zombie_priest.png", "mobs_mc_empty.png"},
{"mobs_mc_empty.png", "mobs_mc_zombie_smith.png", "mobs_mc_empty.png"},
{"mobs_mc_empty.png", "mobs_mc_zombie_villager.png", "mobs_mc_empty.png"},
},
visual_size = {x=2.75, y=2.75},
makes_footstep_sound = true,

View File

@ -26,12 +26,6 @@ local wolf = {
{"mobs_mc_wolf.png"},
},
makes_footstep_sound = true,
head_swivel = "head.control",
bone_eye_height = 3.5,
head_eye_height = 1.1,
horrizonatal_head_height=0,
curiosity = 3,
head_yaw="z",
sounds = {
attack = "mobs_mc_wolf_bark",
war_cry = "mobs_mc_wolf_growl",

View File

@ -53,11 +53,6 @@ local zombie = {
hp_max = 20,
xp_min = 5,
xp_max = 5,
head_swivel = "head.control",
bone_eye_height = 6.3,
head_eye_height = 2.2,
curiosity = 7,
head_pitch_multiplier=-1,
breath_max = -1,
armor = {undead = 90, fleshy = 90},
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.8, 0.3},
@ -67,6 +62,7 @@ local zombie = {
{
"mobs_mc_empty.png", -- armor
"mobs_mc_zombie.png", -- texture
"mobs_mc_empty.png", -- wielded_item
}
},
makes_footstep_sound = true,
@ -111,6 +107,7 @@ baby_zombie.description = S("Baby Zombie")
baby_zombie.collisionbox = {-0.25, -0.01, -0.25, 0.25, 1, 0.25}
baby_zombie.xp_min = 12
baby_zombie.xp_max = 12
baby_zombie.visual_size = {x = 1 / 2, y = 1 / 2}
baby_zombie.walk_velocity = 1.2
baby_zombie.run_velocity = 2.4
baby_zombie.child = 1
@ -132,6 +129,7 @@ husk.textures = {
{
"mobs_mc_empty.png", -- armor
"mobs_mc_husk.png", -- texture
"mobs_mc_empty.png", -- wielded_item
}
}
husk.ignited_by_sunlight = false
@ -146,8 +144,9 @@ mcl_mobs:register_mob("mobs_mc:husk", husk)
local baby_husk = table.copy(baby_zombie)
baby_husk.description = S("Baby Husk")
baby_husk.textures = {{
"mobs_mc_empty.png", -- wielded_item
"mobs_mc_empty.png", -- armor
"mobs_mc_husk.png", -- texture
"mobs_mc_empty.png", -- wielded_item
}}
baby_husk.ignited_by_sunlight = false
baby_husk.sunlight_damage = 0

View File

@ -25,17 +25,13 @@ local pigman = {
group_attack = { "mobs_mc:pigman", "mobs_mc:baby_pigman" },
damage = 9,
reach = 2,
head_swivel = "head.control",
bone_eye_height = 2.4,
head_eye_height = 1.4,
curiosity = 15,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
visual = "mesh",
mesh = "mobs_mc_zombie_pigman.b3d",
textures = { {
"mobs_mc_zombie_pigman.png", --pigman
"blank.png", --baby
"default_tool_goldsword.png", --sword
"mobs_mc_zombie_pigman.png", --pigman
} },
visual_size = {x=3, y=3},
sounds = {

View File

@ -217,7 +217,7 @@ function awards.unlock(name, award)
-- Get award
minetest.log("action", name.." has gotten award "..award)
minetest.chat_send_all(S("@1 has made the advancement @2", name, minetest.colorize(mcl_colors.GREEN, "[" .. (awdef.title or award) .. "]")))
minetest.chat_send_all(S("@1 has made the achievement @2", name, minetest.colorize(mcl_colors.GREEN, "[" .. (awdef.title or award) .. "]")))
data.unlocked[award] = award
awards.save()
@ -257,13 +257,9 @@ function awards.unlock(name, award)
local custom_announce = awdef.custom_announce
if not custom_announce then
if awdef.secret then
custom_announce = S("Secret Advancement Made:")
elseif awdef.type == "Goal" then
custom_announce = S("Goal Completed:")
elseif awdef.type == "Challenge" then
custom_announce = S("Challenge Completed:")
custom_announce = S("Secret achievement gotten:")
else
custom_announce = S("Advancement Made:")
custom_announce = S("Achievement gotten:")
end
end
@ -287,13 +283,9 @@ function awards.unlock(name, award)
elseif awards.show_mode == "chat" then
local chat_announce
if awdef.secret == true then
chat_announce = S("Secret Advancement Made: @1")
elseif awdef.type == "Goal" then
chat_announce = S("Goal Completed: @1")
elseif awdef.type == "Challenge" then
chat_announce = S("Challenge Completed: @1")
chat_announce = S("Secret achievement gotten: @1")
else
chat_announce = S("Advancement Made: @1")
chat_announce = S("Achievement gotten: @1")
end
-- use the chat console to send it
minetest.chat_send_player(name, string.format(chat_announce, title))
@ -314,13 +306,9 @@ function awards.unlock(name, award)
})
local hud_announce
if awdef.secret == true then
hud_announce = S("Secret Advancement Made!")
elseif awdef.type == "Goal" then
hud_announce = S("Goal Completed!")
elseif awdef.type == "Challenge" then
hud_announce = S("Challenge Completed!")
hud_announce = S("Secret achievement gotten!")
else
hud_announce = S("Advancement Made!")
hud_announce = S("Achievement gotten!")
end
local two = player:hud_add({
hud_elem_type = "text",
@ -401,10 +389,10 @@ function awards.getFormspec(name, to, sid)
local def = awards.def[item.name]
if def and def.secret and not item.got then
formspec = formspec .. "label[1,2.75;"..minetest.formspec_escape(S("(Secret Advancement)")).."]"..
formspec = formspec .. "label[1,2.75;"..minetest.formspec_escape(S("(Secret achievement)")).."]"..
"image[1,0;3,3;awards_unknown.png]"
if def and def.description then
formspec = formspec .. "textarea[0.25,3.25;4.8,1.7;;"..minetest.formspec_escape(S("Make this advancement to find out what it is."))..";]"
formspec = formspec .. "textarea[0.25,3.25;4.8,1.7;;"..minetest.formspec_escape(S("Get this achievement to find out what it is."))..";]"
end
else
local title = item.name
@ -462,7 +450,7 @@ function awards.getFormspec(name, to, sid)
first = false
if def.secret and not award.got then
formspec = formspec .. "#707070" .. minetest.formspec_escape(S("(Secret Advancement)"))
formspec = formspec .. "#707070" .. minetest.formspec_escape(S("(Secret Award)"))
else
local title = award.name
if def and def.title then

View File

@ -18,7 +18,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
minetest.register_chatcommand("awards", {
params = S("[c|clear|disable|enable]"),
description = S("Show, clear, disable or enable your advancements."),
description = S("Show, clear, disable or enable your achievements"),
func = function(name, param)
if param == "clear" then
if awards.player(name).disabled ~= nil then
@ -30,10 +30,10 @@ minetest.register_chatcommand("awards", {
end
elseif param == "disable" then
awards.disable(name)
minetest.chat_send_player(name, S("You have disabled your advancements."))
minetest.chat_send_player(name, S("You have disabled your achievements."))
elseif param == "enable" then
awards.enable(name)
minetest.chat_send_player(name, S("You have enabled your advancements."))
minetest.chat_send_player(name, S("You have enabled your achievements."))
elseif param == "c" then
if awards.player(name).disabled ~= nil then
minetest.chat_send_player(name, S("Awards are disabled, enable them first by using /awards enable!"))
@ -50,16 +50,16 @@ minetest.register_chatcommand("awards", {
end
})
minetest.register_privilege("advancements", {
description = S("Can give advancements to any player"),
minetest.register_privilege("achievements", {
description = S("Can give achievements to any player"),
give_to_singleplayer = false,
give_to_admin = false,
})
minetest.register_chatcommand("advancement", {
params = S("(grant <player> (<advancement> | all)) | list"),
privs = { advancements = true },
description = S("Give advancement to player or list all advancements"),
minetest.register_chatcommand("achievement", {
params = S("(grant <player> (<achievement> | all)) | list"),
privs = { achievements = true },
description = S("Give achievement to player or list all achievements"),
func = function(name, param)
if param == "list" then
local list = {}
@ -92,7 +92,7 @@ minetest.register_chatcommand("advancement", {
awards.unlock(playername, achievement)
return true, S("Done.")
else
return false, S("Advancement “@1” does not exist.", achievement)
return false, S("Achievement “@1” does not exist.", achievement)
end
end
})

View File

@ -11,9 +11,9 @@
(Secret Award)=
<achievement ID>=
<name>=
Advancement Made!=
Advancement Made:=
Advancement: @1=
Achievement gotten!=
Achievement gotten:=
Achievement gotten: @1=
Achievement not found.=
All your awards and statistics have been cleared. You can now start again.=
Awards=
@ -27,16 +27,16 @@ Join the game.=
List awards in chat (deprecated)=
Place a block: @1=
Place blocks: @1×@2=
Secret Advancement Made!=
Secret Advancement Made:=
Secret Advancement Made: @1=
Secret achievement gotten!=
Secret achievement gotten:=
Secret achievement gotten: @1=
Show details of an achievement=
Show, clear, disable or enable your advancements.=
Make this advancement to find out what it is.=
Show, clear, disable or enable your achievements=
Get this achievement to find out what it is.=
Write @1 chat messages.=
Write something in chat.=
You have disabled your advancements.=
You have enabled your advancements.=
You have disabled your achievements.=
You have enabled your achievements.=
You have not gotten any awards.=
You've disabled awards. Type /awards enable to reenable.=
[c|clear|disable|enable]=
@ -49,22 +49,16 @@ Place @1 block(s).=
Dig @1 block(s).=
Eat @1 item(s).=
Craft @1 item(s).=
Can give advancements to any player=
(grant <player> (<advancement> | all)) | list=
Give advancement to player or list all advancements=
Can give achievements to any player=
(grant <player> (<achievement> | all)) | list=
Give achievement to player or list all achievements=
@1 (@2)=
Invalid syntax.=
Invalid action.=
Player is not online.=
Done.=
Advancement “@1” does not exist.=
@1 has made the advancement @2=
Achievement “@1” does not exist.=
@1 has made the achievement @2=
Mine a block: @1=
Mine blocks: @1×@2=
Awards are disabled, enable them first by using /awards enable!=
Goal Completed:=
Goal Completed!=
Goal Completed: @1=
Challenge Completed:=
Challenge Completed!=
Challenge Completed: @1=

View File

@ -15,9 +15,7 @@ awards.register_achievement("mcl_buildWorkBench", {
type = "craft",
item = "mcl_crafting_table:crafting_table",
target = 1
},
type = "Advancement",
group = "Overworld",
}
})
awards.register_achievement("mcl:buildPickaxe", {
title = S("Time to Mine!"),
@ -27,9 +25,7 @@ awards.register_achievement("mcl:buildPickaxe", {
type = "craft",
item = "mcl_tools:pick_wood",
target = 1
},
type = "Advancement",
group = "Overworld",
}
})
awards.register_achievement("mcl:buildFurnace", {
title = S("Hot Topic"),
@ -39,9 +35,7 @@ awards.register_achievement("mcl:buildFurnace", {
type = "craft",
item = "mcl_furnaces:furnace",
target = 1
},
type = "Advancement",
group = "Overworld",
}
})
awards.register_achievement("mcl:buildHoe", {
title = S("Time to Farm!"),
@ -51,9 +45,7 @@ awards.register_achievement("mcl:buildHoe", {
type = "craft",
item = "mcl_farming:hoe_wood",
target = 1
},
type = "Advancement",
group = "Husbandry",
}
})
awards.register_achievement("mcl:makeBread", {
title = S("Bake Bread"),
@ -63,9 +55,7 @@ awards.register_achievement("mcl:makeBread", {
type = "craft",
item = "mcl_farming:bread",
target = 1
},
type = "Advancement",
group = "Husbandry",
}
})
awards.register_achievement("mcl:bakeCake", {
@ -76,9 +66,7 @@ awards.register_achievement("mcl:bakeCake", {
type = "craft",
item = "mcl_cake:cake",
target = 1
},
type = "Advancement",
group = "Husbandry",
}
})
awards.register_achievement("mcl:buildBetterPickaxe", {
title = S("Getting an Upgrade"),
@ -89,9 +77,7 @@ awards.register_achievement("mcl:buildBetterPickaxe", {
type = "craft",
item = "mcl_tools:pick_stone",
target = 1
},
type = "Advancement",
group = "Overworld",
}
})
awards.register_achievement("mcl:buildSword", {
title = S("Time to Strike!"),
@ -101,9 +87,7 @@ awards.register_achievement("mcl:buildSword", {
type = "craft",
item = "mcl_tools:sword_wood",
target = 1
},
type = "Advancement",
group = "Adventure",
}
})
awards.register_achievement("mcl:bookcase", {
@ -114,9 +98,7 @@ awards.register_achievement("mcl:bookcase", {
type = "craft",
item = "mcl_books:bookshelf",
target = 1
},
type = "Advancement",
group = "Overworld",
}
})
awards.register_achievement("mcl:buildIronPickaxe", {
@ -127,9 +109,7 @@ awards.register_achievement("mcl:buildIronPickaxe", {
type = "craft",
item = "mcl_tools:pick_iron",
target = 1
},
type = "Advancement",
group = "Overworld",
}
})
-- Item pickup achievements: These are awarded when picking up a certain item.
@ -138,61 +118,46 @@ awards.register_achievement("mcl:diamonds", {
title = S("DIAMONDS!"),
description = S("Pick up a diamond from the floor."),
icon = "mcl_core_diamond_ore.png",
type = "Advancement",
})
awards.register_achievement("mcl:blazeRod", {
title = S("Into Fire"),
description = S("Pick up a blaze rod from the floor."),
icon = "mcl_mobitems_blaze_rod.png",
type = "Advancement",
group = "Nether",
})
awards.register_achievement("mcl:killCow", {
title = S("Cow Tipper"),
description = S("Pick up leather from the floor.\nHint: Cows and some other animals have a chance to drop leather, when killed."),
icon = "mcl_mobitems_leather.png",
type = "Advancement",
group = "Adventure",
})
awards.register_achievement("mcl:mineWood", {
title = S("Getting Wood"),
description = S("Pick up a wood item from the ground.\nHint: Punch a tree trunk until it pops out as an item."),
icon = "default_tree.png",
type = "Advancement",
group = "Overworld",
})
awards.register_achievement("mcl:whosCuttingOnions", {
title = S("Who is Cutting Onions?"),
description = S("Pick up a crying obsidian from the floor."),
icon = "default_obsidian.png^mcl_core_crying_obsidian.png",
type = "Advancement",
group = "Nether",
})
awards.register_achievement("mcl:hiddenInTheDepths", {
title = S("Hidden in the Depths"),
description = S("Pick up an Ancient Debris from the floor."),
icon = "mcl_nether_ancient_debris_side.png",
type = "Advancement",
group = "Nether",
})
awards.register_achievement("mcl:PickUpDragonEgg", {
title = S("The Next Generation"),
description = S("Hold the Dragon Egg.\nHint: Pick up the egg from the ground and have it in your inventory."),
icon = "mcl_end_dragon_egg.png",
type = "Goal",
group = "End",
})
awards.register_achievement("mcl:skysTheLimit", {
title = S("Sky's the Limit"),
description = S("Find the elytra and prepare to fly above and beyond!"),
icon = "mcl_armor_inv_elytra.png",
type = "Goal",
group = "End",
}) -- TODO: Make also unlock when moved to inventory, not just picking up from ground
-- Smelting achivements: These are awarded when picking up an item from a furnace
@ -201,15 +166,11 @@ awards.register_achievement("mcl:acquireIron", {
title = S("Aquire Hardware"),
description = S("Take an iron ingot from a furnace's output slot.\nHint: To smelt an iron ingot, put a fuel (like coal) and iron ore into a furnace."),
icon = "default_steel_ingot.png",
type = "Advancement",
group = "Overworld",
})
awards.register_achievement("mcl:cookFish", {
title = S("Delicious Fish"),
description = S("Take a cooked fish from a furnace.\nHint: Use a fishing rod to catch a fish and cook it in a furnace."),
icon = "mcl_fishing_fish_cooked.png",
type = "Advancement",
group = "Husbandry",
})
-- Other achievements triggered outside of mcl_achievements
@ -219,8 +180,6 @@ awards.register_achievement("mcl:onARail", {
title = S("On A Rail"),
description = S("Travel by minecart for at least 1000 meters from your starting point in a single ride."),
icon = "default_rail.png",
type = "Challenge",
group = "Adventure",
})
-- Triggered in mcl_bows
@ -230,8 +189,6 @@ awards.register_achievement("mcl:snipeSkeleton", {
-- TODO: The range should be 50, not 20. Nerfed because of reduced bow range
description = S("Hit a skeleton, wither skeleton or stray by bow and arrow from a distance of at least 20 meters."),
icon = "mcl_bows_bow.png",
type = "Challenge",
group = "Adventure",
})
-- Triggered in mcl_portals
@ -239,24 +196,18 @@ awards.register_achievement("mcl:buildNetherPortal", {
title = S("We Need to Go Deeper"),
description = S("Use obsidian and a fire starter to construct a Nether portal."),
icon = "mcl_fire_flint_and_steel.png",
type = "Advancement",
group = "Overworld",
})
awards.register_achievement("mcl:enterEndPortal", {
title = S("The End?"),
description = S("Or the beginning?\nHint: Enter an end portal."),
icon = "mcl_end_end_stone.png",
type = "Advancement",
group = "Overworld",
})
awards.register_achievement("mcl:theNether", {
title = S("The Nether"),
description = S("Bring summer clothes.\nHint: Enter the Nether."),
icon = "mcl_nether_netherrack.png",
type = "Advancement",
group = "Nether",
})
-- Triggered in mcl_totems
@ -264,8 +215,6 @@ awards.register_achievement("mcl:postMortal", {
title = S("Postmortal"),
description = S("Use a Totem of Undying to cheat death."),
icon = "mcl_totems_totem.png",
type = "Goal",
group = "Adventure",
})
-- Triggered in mcl_beds
@ -273,16 +222,12 @@ awards.register_achievement("mcl:sweetDreams", {
title = S("Sweet Dreams"),
description = S("Sleep in a bed to change your respawn point."),
icon = "mcl_beds_bed_red_inv.png",
type = "Advancement",
group = "Adventure",
})
awards.register_achievement("mcl:notQuiteNineLives", {
title = S('Not Quite "Nine" Lives'),
description = S("Charge a Respawn Anchor to the maximum."),
icon = "respawn_anchor_side4.png",
type = "Advancement",
group = "Nether",
})
-- Triggered in mobs_mc
@ -290,32 +235,24 @@ awards.register_achievement("mcl:whatAdeal", {
title = S("What A Deal!"),
description = S("Successfully trade with a Villager."),
icon = "mcl_core_emerald.png",
type = "Advancement",
group = "Adventure",
})
awards.register_achievement("mcl:tacticalFishing", {
title = S("Tactical Fishing"),
description = S("Catch a fish... without a fishing rod!"),
icon = "pufferfish_bucket.png",
type = "Advancement",
group = "Husbandry",
})
awards.register_achievement("mcl:witheringHeights", {
title = S("Withering Heights"),
description = S("Summon the wither from the dead."),
icon = "mcl_mobitems_nether_star.png",
type = "Advancement",
group = "Nether",
})
awards.register_achievement("mcl:freeTheEnd", {
title = S("Free the End"),
description = S("Kill the ender dragon. Good Luck!"),
icon = "(spawn_egg.png^[multiply:#252525)^(spawn_egg_overlay.png^[multiply:#b313c9)", -- TODO: Dragon Head Icon
type = "Advancement",
group = "End",
})
-- Triggered in mcl_fishing
@ -323,8 +260,6 @@ awards.register_achievement("mcl:fishyBusiness", {
title = S("Fishy Business"),
description = S("Catch a fish.\nHint: Catch a fish, salmon, clownfish, or pufferfish."),
icon = "mcl_fishing_fishing_rod.png",
type = "Advancement",
group = "Husbandry",
})
-- Triggered in mcl_compass
@ -332,8 +267,6 @@ awards.register_achievement("mcl:countryLode", {
title = S("Country Lode,\nTake Me Home"),
description = S("Use a compass on a Lodestone."),
icon = "lodestone_side4.png",
type = "Advancement",
group = "Nether",
})
-- Triggered in mcl_smithing_table
@ -341,8 +274,6 @@ awards.register_achievement("mcl:seriousDedication", {
title = S("Serious Dedication"),
description = S("Use a Netherite Ingot to upgrade a hoe, and then completely reevaluate your life choices."),
icon = "farming_tool_netheritehoe.png",
type = "Challenge",
group = "Husbandry",
})
-- Triggered in mcl_brewing
@ -350,8 +281,6 @@ awards.register_achievement("mcl:localBrewery", {
title = S("Local Brewery"),
description = S("Brew a Potion.\nHint: Take a potion or glass bottle out of the brewing stand."),
icon = "mcl_potions_potion_overlay.png^[colorize:#F82423:"..tostring(127).."^mcl_potions_potion_bottle.png",
type = "Advancement",
group = "Nether",
})
-- Triggered in mcl_enchanting
@ -359,8 +288,6 @@ awards.register_achievement("mcl:enchanter", {
title = S("Enchanter"),
description = S("Enchant an item using an Enchantment Table."),
icon = "mcl_enchanting_book_enchanted.png",
type = "Advancement",
group = "Overworld",
})
--Triggered in mcl_beacons
@ -368,16 +295,12 @@ awards.register_achievement("mcl:beacon", {
title = S("Bring Home the Beacon"),
description = S("Use a beacon."),
icon = "beacon_achievement_icon.png",
type = "Advancement",
group = "Nether",
})
awards.register_achievement("mcl:maxed_beacon", {
title = S("Beaconator"),
description = S("Use a fully powered beacon."),
icon = "beacon_achievement_icon.png",
type = "Goal",
group = "Nether",
})
-- Triggered in mcl_end
@ -385,8 +308,6 @@ awards.register_achievement("mcl:theEndAgain", {
title = S("The End... Again..."),
description = S("Respawn the Ender Dragon."),
icon = "mcl_end_crystal_item.png",
type = "Goal",
group = "End",
})
-- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)
@ -470,20 +391,14 @@ awards.register_achievement("mcl:stoneAge", {
title = S("Stone Age"),
description = S("Mine a stone with new pickaxe."),
icon = "default_cobble.png",
type = "Advancement",
group = "Overworld",
})
awards.register_achievement("mcl:hotStuff", {
title = S("Hot Stuff"),
description = S("Put lava in a bucket."),
icon = "bucket_lava.png",
type = "Advancement",
group = "Overworld",
})
awards.register_achievement("mcl:obsidian", {
title = S("Ice Bucket Challenge"),
description = S("Obtain an obsidian block."),
icon = "default_obsidian.png",
type = "Advancement",
group = "Overworld",
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -392,7 +392,7 @@ function mcl_inventory.set_creative_formspec(player, start_i, pagenum, inv_size,
-- Achievements button
"image_button[9,3;1,1;mcl_achievements_button.png;__mcl_achievements;]" ..
--"style_type[image_button;border=;bgimg=;bgimg_pressed=]" ..
"tooltip[__mcl_achievements;"..F(S("Advancements")) .. "]" ..
"tooltip[__mcl_achievements;"..F(S("Achievements")) .. "]" ..
-- Switch stack size button
"image_button[9,4;1,1;default_apple.png;__switch_stack;]" ..

View File

@ -119,7 +119,7 @@ local function set_inventory(player, armor_change_only)
form = form ..
-- Achievements button
"image_button[7,3;1,1;mcl_achievements_button.png;__mcl_achievements;]" ..
"tooltip[__mcl_achievements;" .. F(S("Advancements")) .. "]" ..
"tooltip[__mcl_achievements;" .. F(S("Achievements")) .. "]" ..
-- For shortcuts
"listring[current_player;main]" ..
@ -208,6 +208,7 @@ end
--Insta "digging" nodes in gamemode-creative
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
if not puncher or not puncher:is_player() then return end
if minetest.is_creative_enabled() then return end
local name = puncher:get_player_name()
if not minetest.is_creative_enabled(name) then return end
if pointed_thing.type ~= "node" then return end
@ -254,13 +255,10 @@ minetest.register_chatcommand("gamemode",{
privs = { server = true },
func = function(n,param)
-- Full input validation ( just for @erlehmann <3 )
local p
local p = minetest.get_player_by_name(n)
local args = param:split(" ")
if args[2] ~= nil then
p = minetest.get_player_by_name(args[2])
n = args[2]
else
p = minetest.get_player_by_name(n)
end
if not p then
return false, S("Player not online")
@ -270,7 +268,6 @@ minetest.register_chatcommand("gamemode",{
elseif args[1] ~= nil then
mcl_inventory.player_set_gamemode(p,args[1])
end
--Result message - show effective game mode
local gm = p:get_meta():get_string("gamemode")
if gm == "" then gm = gamemodes[1] end

View File

@ -2,7 +2,7 @@
Recipe book=
Help=
Select player skin=
Advancements=
Achievements=
Building Blocks=
Decoration Blocks=
Redstone=

View File

@ -70,8 +70,8 @@ minetest.register_globalstep(function(dtime)
hud_elem_type = "image",
position = position,
offset = offset,
scale = {x = 0.46875, y = 0.46875},
text = "mcl_offhand_slot.png" .. "^[resize:" .. max_offhand_px .. "x" .. max_offhand_px,
scale = {x = 2.75, y = 2.75},
text = "mcl_offhand_slot.png",
z_index = 0,
})
end
@ -80,7 +80,7 @@ minetest.register_globalstep(function(dtime)
hud_elem_type = "image",
position = position,
offset = offset,
scale = {x = 0.375, y = 0.375},
scale = {x = 0.4, y = 0.4},
text = item_texture,
z_index = 1,
})

View File

@ -11,10 +11,8 @@
--Note that the table storing timeouts use playername as index insteed of player objects (faster)
--This is intended in order to speedup the process of removing HUD elements the the timeout is up
---@type table<string, table<ObjectRef, any>>
local huds_idx = {}
---@type table<string, table<string, number>>
local hud_hide_timeouts = {}
hud_hide_timeouts.title = {}
@ -26,19 +24,17 @@ huds_idx.subtitle = {}
huds_idx.actionbar = {}
mcl_title = {}
mcl_title.defaults = { fadein = 10, stay = 70, fadeout = 20 }
mcl_title.defaults = {fadein = 10, stay = 70, fadeout = 20}
mcl_title.layout = {}
mcl_title.layout.title = { position = { x = 0.5, y = 0.5 }, alignment = { x = 0, y = -1.3 }, size = 7 }
mcl_title.layout.subtitle = { position = { x = 0.5, y = 0.5 }, alignment = { x = 0, y = 1.7 }, size = 4 }
mcl_title.layout.actionbar = { position = { x = 0.5, y = 1 }, alignment = { x = 0, y = 0 }, size = 1 }
mcl_title.layout.title = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = -1.3}, size = 7}
mcl_title.layout.subtitle = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = 1.7}, size = 4}
mcl_title.layout.actionbar = {position = {x = 0.5, y = 1}, alignment = {x = 0, y = 0}, size = 1}
local get_color = mcl_util.get_color
--local string = string
local pairs = pairs
---@param gametick integer
---@return number?
local function gametick_to_secondes(gametick)
if gametick then
return gametick / 20
@ -48,10 +44,7 @@ local function gametick_to_secondes(gametick)
end
--https://github.com/minetest/minetest/blob/b3b075ea02034306256b486dd45410aa765f035a/doc/lua_api.txt#L8477
---@param bold? boolean
---@param italic? boolean
---@return integer
--[[
local function style_to_bits(bold, italic)
if bold then
if italic then
@ -67,11 +60,9 @@ local function style_to_bits(bold, italic)
end
end
end
]]
local no_style = style_to_bits(false, false)
---PARAMS SYSTEM
---@type table<ObjectRef, {stay: integer}>
--PARAMS SYSTEM
local player_params = {}
minetest.register_on_joinplayer(function(player)
@ -87,8 +78,8 @@ minetest.register_on_joinplayer(function(player)
position = mcl_title.layout.title.position,
alignment = mcl_title.layout.title.alignment,
text = "",
style = no_style,
size = { x = mcl_title.layout.title.size },
--style = 0,
size = {x = mcl_title.layout.title.size},
number = hex_color,
z_index = 100,
})
@ -97,19 +88,19 @@ minetest.register_on_joinplayer(function(player)
position = mcl_title.layout.subtitle.position,
alignment = mcl_title.layout.subtitle.alignment,
text = "",
style = no_style,
size = { x = mcl_title.layout.subtitle.size },
--style = 0,
size = {x = mcl_title.layout.subtitle.size},
number = hex_color,
z_index = 100,
})
huds_idx.actionbar[player] = player:hud_add({
hud_elem_type = "text",
position = mcl_title.layout.actionbar.position,
offset = { x = 0, y = -210 },
offset = {x = 0, y = -210},
alignment = mcl_title.layout.actionbar.alignment,
style = no_style,
--style = 0,
text = "",
size = { x = mcl_title.layout.actionbar.size },
size = {x = mcl_title.layout.actionbar.size},
number = hex_color,
z_index = 100,
})
@ -132,8 +123,6 @@ minetest.register_on_leaveplayer(function(player)
hud_hide_timeouts.actionbar[playername] = nil
end)
---@param player ObjectRef
---@param data {stay: integer}
function mcl_title.params_set(player, data)
player_params[player] = {
stay = data.stay or mcl_title.defaults.stay,
@ -142,18 +131,12 @@ function mcl_title.params_set(player, data)
}
end
---@param player ObjectRef
---@return {stay: integer}
function mcl_title.params_get(player)
return player_params[player]
end
--API FUNCTIONS
---@param player ObjectRef
---@param type '"title"'|'"subtitle"'|'"actionbar"'
---@param data {text: string, color: string, stay: integer, bold: boolean, italic: boolean}
---@return boolean
function mcl_title.set(player, type, data)
if not data.color then
data.color = "white"
@ -166,25 +149,20 @@ function mcl_title.set(player, type, data)
player:hud_change(huds_idx[type][player], "text", data.text)
player:hud_change(huds_idx[type][player], "number", hex_color)
-- Apply bold and italic
player:hud_change(huds_idx[type][player], "style", style_to_bits(data.bold, data.italic))
hud_hide_timeouts[type][player:get_player_name()] = gametick_to_secondes(data.stay) or
gametick_to_secondes(mcl_title.params_get(player).stay)
--apply bold and italic
--player:hud_change(huds_idx[type][player], "style", style_to_bits(data.bold, data.italic))
hud_hide_timeouts[type][player:get_player_name()] = gametick_to_secondes(data.stay) or gametick_to_secondes(mcl_title.params_get(player).stay)
return true
end
---@param player ObjectRef?
---@param type '"title"'|'"subtitle"'|'"actionbar"'
function mcl_title.remove(player, type)
if player then
player:hud_change(huds_idx[type][player], "text", "")
player:hud_change(huds_idx[type][player], "style", no_style)
--player:hud_change(huds_idx[type][player], "style", 0) --no styling
end
end
---@param player ObjectRef
function mcl_title.clear(player)
mcl_title.remove(player, "title")
mcl_title.remove(player, "subtitle")
@ -201,7 +179,6 @@ minetest.register_globalstep(function(dtime)
subtitle = {},
actionbar = {},
}
for element, content in pairs(hud_hide_timeouts) do
for name, timeout in pairs(content) do
timeout = timeout - dtime
@ -213,95 +190,47 @@ minetest.register_globalstep(function(dtime)
end
end
end
hud_hide_timeouts = new_timeouts
end)
--DEBUG STUFF!!
--TODO:Proper /title command that can send the title to other players.
--These commands are just for debugging right now.
local dbg_msg = "Note that these are just debug commands right now. e.g. the title is only sent to he player issuing the command. Proper /title commands will be added in the future."
--[[
minetest.register_chatcommand("title", {
privs = { debug = true },
func = function(name, param)
local player = minetest.get_player_by_name(name)
if player then
mcl_title.set(player, "title", { text = param, color = "gold", bold = true, italic = true })
return true, dbg_msg
else
return false, dbg_msg
end
mcl_title.set(player, "title", {text=param, color="gold", bold=true, italic=true})
end,
})
minetest.register_chatcommand("subtitle", {
privs = { debug = true },
func = function(name, param)
local player = minetest.get_player_by_name(name)
if player then
mcl_title.set(player, "subtitle", { text = param, color = "gold" })
return true, dbg_msg
else
return false, dbg_msg
end
mcl_title.set(player, "subtitle", {text=param, color="gold"})
end,
})
minetest.register_chatcommand("actionbar", {
privs = { debug = true },
func = function(name, param)
local player = minetest.get_player_by_name(name)
if player then
mcl_title.set(player, "actionbar", { text = param, color = "gold", bold = true, italic = true })
return true, dbg_msg
else
return false, dbg_msg
end
mcl_title.set(player, "actionbar", {text=param, color="gold"})
end,
})
minetest.register_chatcommand("title_timeout", {
privs = { debug = true },
minetest.register_chatcommand("timeout", {
func = function(name, param)
local player = minetest.get_player_by_name(name)
if player then
mcl_title.params_set(player, { stay = 600 })
return true, dbg_msg
else
return false, dbg_msg
end
mcl_title.params_set(player, {stay = 600})
end,
})
minetest.register_chatcommand("title_all", {
privs = { debug = true },
minetest.register_chatcommand("all", {
func = function(name, param)
local player = minetest.get_player_by_name(name)
if player then
mcl_title.params_set(player, { stay = 600 })
mcl_title.set(player, "title", { text = param, color = "gold" })
mcl_title.set(player, "subtitle", { text = param, color = "gold" })
mcl_title.set(player, "actionbar", { text = param, color = "gold" })
return true, dbg_msg
else
return false, dbg_msg
end
end,
})
minetest.register_chatcommand("title_all_styles", {
privs = { debug = true },
func = function(name, param)
local player = minetest.get_player_by_name(name)
if player then
mcl_title.params_set(player, { stay = 600 })
mcl_title.set(player, "title", { text = param, color = "gold" })
mcl_title.set(player, "subtitle", { text = param, color = "gold", bold = true })
mcl_title.set(player, "actionbar", { text = param, color = "gold", italic = true })
return true, dbg_msg
else
return false, dbg_msg
end
mcl_title.params_set(player, {stay = 600})
mcl_title.set(player, "title", {text=param, color="gold"})
mcl_title.set(player, "subtitle", {text=param, color="gold"})
mcl_title.set(player, "actionbar", {text=param, color="gold"})
end,
})
]]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 141 B

View File

@ -342,7 +342,6 @@ mcl_torches.register_torch({
groups = {dig_immediate = 3, deco_block = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
particles = true,
flame_type = 2,
})
minetest.register_craft({

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -155,17 +155,10 @@ function mcl_doors:register_door(name, def)
end
local left_node = minetest.get_node(pt_left)
local mirrored = false
local door_dir = 1
if left_node.name:sub(1, #name) == name then
mirrored = true
door_dir = 2
p2 = left_node.param2
end
-- Set door nodes
minetest.set_node(pt, {name=name.."_b_"..door_dir, param2=p2})
minetest.set_node(pt2, {name=name.."_t_"..door_dir, param2=p2})
minetest.set_node(pt, {name=name.."_b_1", param2=p2})
minetest.set_node(pt2, {name=name.."_t_1", param2=p2})
if def.sounds and def.sounds.place then
minetest.sound_play(def.sounds.place, {pos=pt}, true)
@ -181,7 +174,7 @@ function mcl_doors:register_door(name, def)
local meta1 = minetest_get_meta(pt)
local meta2 = minetest_get_meta(pt2)
-- save mirror state for the correct door
if mirrored then
if left_node.name:sub(1, #name) == name then
meta1:set_int("is_mirrored", 1)
meta2:set_int("is_mirrored", 1)
end

View File

@ -2,18 +2,8 @@ local S = minetest.get_translator(minetest.get_current_modname())
local has_doc = minetest.get_modpath("doc")
mcl_flowerpots = {}
---@type table<string, string>
mcl_flowerpots.registered_pots = {}
---@type nodebox
local pot_box = {
type = "fixed",
fixed = {
{ -0.1875, -0.5, -0.1875, 0.1875, -0.125, 0.1875 },
},
}
minetest.register_node("mcl_flowerpots:flower_pot", {
description = S("Flower Pot"),
_tt_help = S("Can hold a small flower or plant"),
@ -24,16 +14,23 @@ minetest.register_node("mcl_flowerpots:flower_pot", {
tiles = {
"mcl_flowerpots_flowerpot.png",
},
use_texture_alpha = "clip",
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
visual_scale = 0.5,
wield_image = "mcl_flowerpots_flowerpot_inventory.png",
wield_scale = {x=1.0, y=1.0, z=1.0},
paramtype = "light",
sunlight_propagates = true,
selection_box = pot_box,
collision_box = pot_box,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
collision_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
is_ground_content = false,
inventory_image = "mcl_flowerpots_flowerpot_inventory.png",
groups = { dig_immediate = 3, deco_block = 1, attached_node = 1, dig_by_piston = 1, flower_pot = 1 },
groups = {dig_immediate=3, deco_block=1, attached_node=1, dig_by_piston=1, flower_pot=1},
sounds = mcl_sounds.node_sound_stone_defaults(),
on_rightclick = function(pos, node, clicker, itemstack)
local name = clicker:get_player_name()
@ -43,7 +40,7 @@ minetest.register_node("mcl_flowerpots:flower_pot", {
end
local item = clicker:get_wielded_item():get_name()
if mcl_flowerpots.registered_pots[item] then
minetest.swap_node(pos, { name = "mcl_flowerpots:flower_pot_" .. mcl_flowerpots.registered_pots[item] })
minetest.swap_node(pos, {name="mcl_flowerpots:flower_pot_"..mcl_flowerpots.registered_pots[item]})
if not minetest.is_creative_enabled(clicker:get_player_name()) then
itemstack:take_item()
end
@ -54,32 +51,37 @@ minetest.register_node("mcl_flowerpots:flower_pot", {
minetest.register_craft({
output = "mcl_flowerpots:flower_pot",
recipe = {
{ "mcl_core:brick", "", "mcl_core:brick" },
{ "", "mcl_core:brick", "" },
{ "", "", "" },
},
{"mcl_core:brick", "", "mcl_core:brick"},
{"", "mcl_core:brick", ""},
{"", "", ""},
}
})
---@param name string
---@param def {name: string, desc: string, image: string}
function mcl_flowerpots.register_potted_flower(name, def)
mcl_flowerpots.registered_pots[name] = def.name
minetest.register_node(":mcl_flowerpots:flower_pot_" .. def.name, {
description = def.desc .. " " .. S("Flower Pot"),
minetest.register_node(":mcl_flowerpots:flower_pot_"..def.name, {
description = def.desc.." "..S("Flower Pot"),
_doc_items_create_entry = false,
drawtype = "mesh",
mesh = "flowerpot.obj",
tiles = {
"[combine:32x32:0,0=mcl_flowerpots_flowerpot.png:0,0=" .. def.image,
"[combine:32x32:0,0=mcl_flowerpots_flowerpot.png:0,0="..def.image,
},
use_texture_alpha = "clip",
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
visual_scale = 0.5,
wield_scale = {x=1.0, y=1.0, z=1.0},
paramtype = "light",
sunlight_propagates = true,
selection_box = pot_box,
collision_box = pot_box,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
collision_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
is_ground_content = false,
groups = { dig_immediate = 3, attached_node = 1, dig_by_piston = 1, not_in_creative_inventory = 1, flower_pot = 2 },
groups = {dig_immediate=3, attached_node=1, dig_by_piston=1, not_in_creative_inventory=1, flower_pot=2},
sounds = mcl_sounds.node_sound_stone_defaults(),
on_rightclick = function(pos, item, clicker)
local player_name = clicker:get_player_name()
@ -87,41 +89,46 @@ function mcl_flowerpots.register_potted_flower(name, def)
minetest.record_protection_violation(pos, player_name)
return
end
minetest.add_item(vector.offset(pos, 0, 0.5, 0), name)
minetest.set_node(pos, { name = "mcl_flowerpots:flower_pot" })
minetest.add_item({x=pos.x, y=pos.y+0.5, z=pos.z}, name)
minetest.set_node(pos, {name="mcl_flowerpots:flower_pot"})
end,
drop = {
items = {
{ items = { "mcl_flowerpots:flower_pot", name } },
},
{ items = { "mcl_flowerpots:flower_pot", name } }
}
},
})
-- Add entry alias for the Help
if has_doc then
doc.add_entry_alias("nodes", "mcl_flowerpots:flower_pot", "nodes", "mcl_flowerpots:flower_pot_" .. name)
doc.add_entry_alias("nodes", "mcl_flowerpots:flower_pot", "nodes", "mcl_flowerpots:flower_pot_"..name)
end
end
---@param name string
---@param def {name: string, desc: string, image: string}
function mcl_flowerpots.register_potted_cube(name, def)
mcl_flowerpots.registered_pots[name] = def.name
minetest.register_node(":mcl_flowerpots:flower_pot_" .. def.name, {
description = def.desc .. " " .. S("Flower Pot"),
minetest.register_node(":mcl_flowerpots:flower_pot_"..def.name, {
description = def.desc.." "..S("Flower Pot"),
_doc_items_create_entry = false,
drawtype = "mesh",
mesh = "flowerpot_with_long_cube.obj",
tiles = {
def.image,
},
use_texture_alpha = "clip",
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
visual_scale = 0.5,
wield_scale = {x=1.0, y=1.0, z=1.0},
paramtype = "light",
sunlight_propagates = true,
selection_box = pot_box,
collision_box = pot_box,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
collision_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
is_ground_content = false,
groups = { dig_immediate = 3, attached_node = 1, dig_by_piston = 1, not_in_creative_inventory = 1, flower_pot = 2 },
groups = {dig_immediate=3, attached_node=1, dig_by_piston=1, not_in_creative_inventory=1, flower_pot=2},
sounds = mcl_sounds.node_sound_stone_defaults(),
on_rightclick = function(pos, item, clicker)
local player_name = ""
@ -132,18 +139,18 @@ function mcl_flowerpots.register_potted_cube(name, def)
minetest.record_protection_violation(pos, player_name)
return
end
minetest.add_item(vector.offset(pos, 0, 0.5, 0), name)
minetest.set_node(pos, { name = "mcl_flowerpots:flower_pot" })
minetest.add_item({x=pos.x, y=pos.y+0.5, z=pos.z}, name)
minetest.set_node(pos, {name="mcl_flowerpots:flower_pot"})
end,
drop = {
items = {
{ items = { "mcl_flowerpots:flower_pot", name } },
},
{ items = { "mcl_flowerpots:flower_pot", name } }
}
},
})
-- Add entry alias for the Help
if has_doc then
doc.add_entry_alias("nodes", "mcl_flowerpots:flower_pot", "nodes", "mcl_flowerpots:flower_pot_" .. def.name)
doc.add_entry_alias("nodes", "mcl_flowerpots:flower_pot", "nodes", "mcl_flowerpots:flower_pot_"..def.name)
end
end

View File

@ -1,7 +1,7 @@
local S = minetest.get_translator(minetest.get_current_modname())
local mt_sound_play = minetest.sound_play
local spread_to = {"mcl_core:stone","mcl_core:dirt","mcl_core:sand","mcl_core:dirt_with_grass","group:grass_block","mcl_core:andesite","mcl_core:diorite","mcl_core:granite","mcl_core:mycelium","group:dirt","mcl_end:end_stone","mcl_nether:netherrack","mcl_blackstone:basalt","mcl_nether:soul_sand","mcl_blackstone:soul_soil","mcl_crimson:warped_nylium","mcl_crimson:crimson_nylium","mcl_core:gravel"}
local spread_to = {"mcl_core:stone","mcl_core:dirt","mcl_core:sand","mcl_core:dirt_with_grass","group:grass_block","mcl_core:andesite","mcl_core:diorite","mcl_core:granite","mcl_core:mycelium","group:dirt","mcl_end:end_stone","mcl_nether:netherrack","mcl_blackstone:basalt","mcl_nether:soul_sand","mcl_blackstone:soul_soil","mcl_crimson:warped_nylium","mcl_crimson:crimson_nylium","mcl_core:gravel","mcl_deepslate:deepslate","mcl_deepslate:tuff"}
local sounds = {
footstep = {name = "mcl_sculk_block", },

View File

@ -5,7 +5,6 @@
local eat = minetest.item_eat(6, "mcl_core:bowl") --6 hunger points, player receives mcl_core:bowl after eating
local flower_effect = {
[ "mcl_flowers:allium" ] = "fire_resistance",
[ "mcl_flowers:tulip_white" ] = "poison",
[ "mcl_flowers:blue_orchid" ] = "hunger",
[ "mcl_flowers:dandelion" ] = "hunger",
@ -15,10 +14,6 @@ local flower_effect = {
}
local effects = {
[ "fire_resistance" ] = function(itemstack, placer, pointed_thing)
mcl_potions.fire_resistance_func(placer, 1, 4)
return eat(itemstack, placer, pointed_thing)
end,
[ "poison" ] = function(itemstack, placer, pointed_thing)
mcl_potions.poison_func(placer, 1, 12)
return eat(itemstack, placer, pointed_thing)
@ -82,7 +77,6 @@ minetest.register_craftitem("mcl_sus_stew:stew",{
inventory_image = "sus_stew.png",
stack_max = 1,
on_place = eat_stew,
on_secondary_use = eat_stew,
groups = { food = 2, eatable = 4, can_eat_when_full = 1, not_in_creative_inventory=1,},
_mcl_saturation = 7.2,
})
@ -99,12 +93,6 @@ minetest.register_alias("mcl_sus_stew:night_vision_stew", "mcl_sus_stew:stew")
-- ______________
--_________________________________________/ Crafts \________________________________
minetest.register_craft({
type = "shapeless",
output = "mcl_sus_stew:stew",
recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:allium"},
})
minetest.register_craft({
type = "shapeless",
output = "mcl_sus_stew:stew",

View File

@ -1,3 +1,3 @@
name = mcl_sus_stew
author = chmodsayshello, cora
author = chmodsayshello
depends = mcl_core, mcl_mushrooms, mcl_flowers, mcl_potions, mcl_hunger

View File

@ -1,5 +1,3 @@
local flame_texture = {"mcl_particles_flame.png", "mcl_particles_soul_fire_flame.png"}
local smoke_pdef = {
amount = 0.5,
maxexptime = 2.0,
@ -11,8 +9,7 @@ local smoke_pdef = {
maxrelpos = { x = 1/16, y = 0.06, z = 1/16 },
}
local function spawn_flames_floor(pos, flame_type)
local function spawn_flames_floor(pos)
-- Flames
mcl_particles.add_node_particlespawner(pos, {
amount = 8,
@ -25,14 +22,14 @@ local function spawn_flames_floor(pos, flame_type)
maxexptime = 0.6,
minsize = 0.7,
maxsize = 2,
texture = flame_texture[flame_type],
texture = "mcl_particles_flame.png",
glow = minetest.registered_nodes[minetest.get_node(pos).name].light_source,
}, "low")
-- Smoke
mcl_particles.spawn_smoke(pos, "torch", smoke_pdef)
end
local function spawn_flames_wall(pos, flame_type)
local function spawn_flames_wall(pos)
--local minrelpos, maxrelpos
local node = minetest.get_node(pos)
local dir = minetest.wallmounted_to_dir(node.param2)
@ -40,17 +37,17 @@ local function spawn_flames_wall(pos, flame_type)
local smoke_pdef = table.copy(smoke_pdef)
if dir.x < 0 then
smoke_pdef.minrelpos = { x = -0.38, y = 0.24, z = -0.1 }
smoke_pdef.maxrelpos = { x = -0.2, y = 0.34, z = 0.1 }
smoke_pdef.minrelpos = { x = -0.38, y = 0.04, z = -0.1 }
smoke_pdef.maxrelpos = { x = -0.2, y = 0.14, z = 0.1 }
elseif dir.x > 0 then
smoke_pdef.minrelpos = { x = 0.2, y = 0.24, z = -0.1 }
smoke_pdef.maxrelpos = { x = 0.38, y = 0.34, z = 0.1 }
smoke_pdef.minrelpos = { x = 0.2, y = 0.04, z = -0.1 }
smoke_pdef.maxrelpos = { x = 0.38, y = 0.14, z = 0.1 }
elseif dir.z < 0 then
smoke_pdef.minrelpos = { x = -0.1, y = 0.24, z = -0.38 }
smoke_pdef.maxrelpos = { x = 0.1, y = 0.34, z = -0.2 }
smoke_pdef.minrelpos = { x = -0.1, y = 0.04, z = -0.38 }
smoke_pdef.maxrelpos = { x = 0.1, y = 0.14, z = -0.2 }
elseif dir.z > 0 then
smoke_pdef.minrelpos = { x = -0.1, y = 0.24, z = 0.2 }
smoke_pdef.maxrelpos = { x = 0.1, y = 0.34, z = 0.38 }
smoke_pdef.minrelpos = { x = -0.1, y = 0.04, z = 0.2 }
smoke_pdef.maxrelpos = { x = 0.1, y = 0.14, z = 0.38 }
else
return
end
@ -68,25 +65,13 @@ local function spawn_flames_wall(pos, flame_type)
maxexptime = 0.6,
minsize = 0.7,
maxsize = 2,
texture = flame_texture[flame_type],
texture = "mcl_particles_flame.png",
glow = minetest.registered_nodes[node.name].light_source,
}, "low")
-- Smoke
mcl_particles.spawn_smoke(pos, "torch", smoke_pdef)
end
local function set_flames(pos, flame_type, attached_to)
if attached_to == "wall" then
return function(pos)
spawn_flames_wall(pos, flame_type)
end
end
return function(pos)
spawn_flames_floor(pos, flame_type)
end
end
local function remove_flames(pos)
mcl_particles.delete_node_particlespawners(pos)
end
@ -139,7 +124,6 @@ function mcl_torches.register_torch(def)
def.light = def.light or minetest.LIGHT_MAX
def.mesh_floor = def.mesh_floor or "mcl_torches_torch_floor.obj"
def.mesh_wall = def.mesh_wall or "mcl_torches_torch_wall.obj"
def.flame_type = def.flame_type or 1
local groups = def.groups or {}
@ -149,7 +133,6 @@ function mcl_torches.register_torch(def)
groups.dig_by_water = 1
groups.destroy_by_lava_flow = 1
groups.dig_by_piston = 1
groups.flame_type = def.flame_type or 1
local floordef = {
description = def.description,
@ -162,6 +145,7 @@ function mcl_torches.register_torch(def)
inventory_image = def.icon,
wield_image = def.icon,
tiles = def.tiles,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
@ -173,7 +157,8 @@ function mcl_torches.register_torch(def)
drop = def.drop or itemstring,
selection_box = {
type = "wallmounted",
wall_bottom = {-2/16, -0.5, -2/16, 2/16, 1/16, 2/16},
wall_top = {-1/16, -1/16, -1/16, 1/16, 0.5, 1/16},
wall_bottom = {-1/16, -0.5, -1/16, 1/16, 1/16, 1/16},
},
sounds = def.sounds,
node_placement_prediction = "",
@ -226,7 +211,7 @@ function mcl_torches.register_torch(def)
return itemstack
end,
on_rotate = false,
on_construct = def.particles and set_flames(pos, def.flame_type, "floor"),
on_construct = def.particles and spawn_flames_floor,
on_destruct = def.particles and remove_flames,
}
minetest.register_node(itemstring, floordef)
@ -238,6 +223,7 @@ function mcl_torches.register_torch(def)
drawtype = "mesh",
mesh = def.mesh_wall,
tiles = def.tiles,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
@ -248,11 +234,13 @@ function mcl_torches.register_torch(def)
drop = def.drop or itemstring,
selection_box = {
type = "wallmounted",
wall_side = {-0.5, -0.3, -0.1, -0.2, 0.325, 0.1},
wall_top = {-0.1, -0.1, -0.1, 0.1, 0.5, 0.1},
wall_bottom = {-0.1, -0.5, -0.1, 0.1, 0.1, 0.1},
wall_side = {-0.5, -0.5, -0.1, -0.2, 0.1, 0.1},
},
sounds = def.sounds,
on_rotate = false,
on_construct = def.particles and set_flames(pos, def.flame_type, "wall"),
on_construct = def.particles and spawn_flames_wall,
on_destruct = def.particles and remove_flames,
}
minetest.register_node(itemstring_wall, walldef)
@ -271,9 +259,9 @@ minetest.register_lbm({
action = function(pos, node)
local torch_group = minetest.get_item_group(node.name, "torch")
if torch_group == 1 then
spawn_flames_floor(pos, minetest.get_item_group(node.name, "flame_type"))
spawn_flames_floor(pos)
elseif torch_group == 2 then
spawn_flames_wall(pos, minetest.get_item_group(node.name, "flame_type"))
spawn_flames_wall(pos)
end
end,
})

View File

@ -1,72 +1,29 @@
# Blender 3.3.1
# Blender v2.76 (sub 0) OBJ File: 'torch_on_floor_node.blend'
# www.blender.org
mtllib mcl_torches_torch_floor.mtl
o cube.004
v -0.062500 0.437500 -0.500000
v -0.062500 -0.562500 -0.500000
v -0.062500 0.437500 0.500000
v -0.062500 -0.562500 0.500000
o torch_Cube_Cube.001_Cube_Cube.001_Material.001
v 0.062500 0.062500 0.062500
v 0.062500 0.062500 -0.062500
v 0.062500 -0.562500 0.062500
v 0.062500 -0.562500 -0.062500
v -0.062500 0.062500 -0.062500
v -0.062500 0.062500 0.062500
v -0.062500 -0.562500 -0.062500
v -0.062500 -0.562500 0.062500
v 0.500000 0.437500 0.062500
v 0.500000 -0.562500 0.062500
v -0.500000 0.437500 0.062500
v -0.500000 -0.562500 0.062500
v 0.500000 0.437500 -0.062500
v 0.500000 -0.562500 -0.062500
v -0.500000 0.437500 -0.062500
v -0.500000 -0.562500 -0.062500
v 0.062500 0.437500 -0.500000
v 0.062500 -0.562500 -0.500000
v 0.062500 0.437500 0.500000
v 0.062500 -0.562500 0.500000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
v -0.062500 -0.500000 0.062500
v 0.062500 -0.500000 0.062500
v 0.062500 -0.500000 -0.062500
v -0.062500 -0.500000 -0.062500
vt 0.562500 0.500000
vt 0.562500 0.625000
vt 0.562500 0.125000
vt 0.562500 0.000063
vt 0.437500 0.625000
vt 0.437500 0.500000
vt 0.437500 0.000063
vt 0.437500 0.000000
vt 0.562500 0.000000
vt 0.562500 0.125000
vt 0.437500 0.125000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
s 0
usemtl m_0.002
f 3/3/1 4/4/1 1/1/1
f 4/4/1 2/2/1 1/1/1
f 9/9/2 10/10/2 6/6/2
f 10/10/2 5/5/2 6/6/2
f 12/12/3 11/11/3 7/7/3
f 11/11/3 8/8/3 7/7/3
f 13/13/4 14/14/4 15/15/4
f 14/14/4 16/16/4 15/15/4
f 19/19/5 20/20/5 17/17/5
f 20/20/5 18/18/5 17/17/5
f 21/21/6 22/22/6 23/23/6
f 22/22/6 24/24/6 23/23/6
vn 0.000000 1.000000 0.000000
vn 0.000000 0.000000 -1.000000
vn 1.000000 0.000000 0.000000
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
f 5/5/1 6/6/1 7/7/1 8/8/1
f 1/2/2 6/6/2 5/5/2 4/3/2
f 2/3/3 1/2/3 6/6/3 7/5/3
f 3/2/2 2/3/2 7/5/2 8/6/2
f 4/3/3 5/5/3 8/6/3 3/2/3

View File

@ -1,72 +1,29 @@
# Blender 3.3.1
# Blender v2.76 (sub 0) OBJ File: 'torch_on_wall_node.blend'
# www.blender.org
mtllib mcl_torches_torch_wall.mtl
o cube
v -0.062500 -0.198340 0.273825
v -0.062500 -0.313825 0.321660
v -0.062500 -0.437517 -0.303600
v -0.062500 -0.553002 -0.255765
v 0.062500 -0.313825 0.321660
v 0.062500 -0.198340 0.273825
v 0.062500 -0.553002 -0.255765
v 0.062500 -0.437517 -0.303600
v -0.500000 -0.054833 0.620280
v -0.500000 -0.437517 -0.303600
v 0.500000 -0.054834 0.620280
v 0.500000 -0.437517 -0.303600
v -0.500000 -0.170318 0.668115
v -0.500000 -0.553002 -0.255765
v 0.500000 -0.170318 0.668115
v 0.500000 -0.553002 -0.255765
v -0.062500 -0.574516 0.835539
v -0.062500 -0.957199 -0.088340
v -0.062500 0.349364 0.452856
v -0.062500 -0.033320 -0.471024
v 0.062500 -0.574516 0.835539
v 0.062500 -0.957199 -0.088340
v 0.062500 0.349364 0.452856
v 0.062500 -0.033320 -0.471024
vn -0.0000 0.3827 0.9239
vn -0.0000 -0.3827 -0.9239
vn -0.0000 -0.9239 0.3827
vn -0.0000 0.9239 -0.3827
vn 1.0000 -0.0000 -0.0000
vn -1.0000 -0.0000 -0.0000
o torch_wall_Cube_Cube.001_Cube_Cube.001_Material.001
v 0.062469 -0.303502 0.086070
v 0.062469 -0.195248 0.023570
v -0.062531 -0.195248 0.023570
v -0.062531 -0.303502 0.086070
v -0.062531 -0.584752 -0.401070
v 0.062469 -0.584752 -0.401070
v 0.062469 -0.476498 -0.463570
v -0.062531 -0.476498 -0.463570
vt 0.562500 0.500000
vt 0.562500 0.625000
vt 0.562500 0.125000
vt 0.562500 0.000063
vt 0.437500 0.625000
vt 0.437500 0.500000
vt 0.437500 0.000063
vt 0.437500 0.000000
vt 0.562500 0.000000
vt 0.562500 0.125000
vt 0.437500 0.125000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
s 0
usemtl m_0.001
f 5/5/1 6/6/1 2/2/1
f 6/6/1 1/1/1 2/2/1
f 8/8/2 7/7/2 3/3/2
f 7/7/2 4/4/2 3/3/2
f 9/9/3 10/10/3 11/11/3
f 10/10/3 12/12/3 11/11/3
f 15/15/4 16/16/4 13/13/4
f 16/16/4 14/14/4 13/13/4
f 17/17/5 18/18/5 19/19/5
f 18/18/5 20/20/5 19/19/5
f 23/23/6 24/24/6 21/21/6
f 24/24/6 22/22/6 21/21/6
vn 0.000000 0.500000 0.866000
vn 0.000000 0.866000 -0.500000
vn 1.000000 -0.000000 0.000000
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
f 5/5/1 6/6/1 7/7/1 8/8/1
f 1/2/2 6/6/2 5/5/2 4/3/2
f 2/3/3 1/2/3 6/6/3 7/5/3
f 3/2/2 2/3/2 7/5/2 8/6/2
f 4/3/3 5/5/3 8/6/3 3/2/3

View File

@ -15,7 +15,6 @@ mcl_torches.register_torch({
groups = {dig_immediate = 3, deco_block = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
particles = true,
flame_type = 1,
})
minetest.register_craft({

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 197 B

View File

@ -1095,7 +1095,6 @@ local function register_biomes()
_mcl_palette_index = 22,
})
-- Savanna
minetest.register_biome({
name = "Savanna",
@ -1489,6 +1488,33 @@ local function register_biomes()
_mcl_palette_index = 29,
})
minetest.register_biome({
name = "DeepDark",
node_top = "mcl_sculk:sculk",
depth_top = 1,
node_filler = "mcl_deepslate:deepslate",
node_riverbed = "mcl_deepslate:deepslate",
depth_riverbed = 1,
node_stone = "mcl_deepslate:deepslate",
y_min = mcl_vars.mg_overworld_min,
y_max = mcl_vars.mg_overworld_min_old,
humidity_point = 0,
heat_point = 60,
vertical_blend = 8,
_mcl_biome_type = "hot",
_mcl_palette_index = 21,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"group:material_stone","mcl_deepslate:deepslate"},
sidelen = 16,
fill_ratio = 10,
biomes = { "DeepDark" },
decoration = "mcl_sculk:sculk",
flags = "all_floors",
param2 = 0,
})
-- Add deep ocean and underground biomes automatically.
for i=1, #overworld_biomes do
local biome = overworld_biomes[i]
@ -1517,11 +1543,21 @@ local function register_biomes()
name = biome .. "_underground",
heat_point = minetest.registered_biomes[biome].heat_point,
humidity_point = minetest.registered_biomes[biome].humidity_point,
y_min = mcl_vars.mg_overworld_min,
y_min = mcl_vars.mg_overworld_min_old,
y_max = DEEP_OCEAN_MIN - 1,
_mcl_biome_type = minetest.registered_biomes[biome]._mcl_biome_type,
_mcl_palette_index = minetest.registered_biomes[biome]._mcl_palette_index,
})
minetest.register_biome({
name = biome .. "_deep_underground",
heat_point = minetest.registered_biomes[biome].heat_point,
humidity_point = minetest.registered_biomes[biome].humidity_point,
node_stone = "mcl_deepslate:deepslate",
y_min = mcl_vars.mg_overworld_min,
y_max = mcl_vars.mg_overworld_min_old,
_mcl_biome_type = minetest.registered_biomes[biome]._mcl_biome_type,
_mcl_palette_index = minetest.registered_biomes[biome]._mcl_palette_index,
})
end
end
@ -2753,6 +2789,16 @@ local function register_coral_decos(ck)
end
local function register_decorations()
--Deep Dark
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_sculk:sculk"},
sidelen = 16,
fill_ratio = 0.1,
decoration = "mcl_sculk:catalyst",
biomes = {"DeepDark"},
flags = "all_floors",
})
-- Coral Reefs
for k,_ in pairs(corals) do
register_coral_decos(k)

View File

@ -127,7 +127,6 @@ minetest.register_ore({
}
})
minetest.register_ore({
ore_type = "blob",
ore = "mcl_deepslate:deepslate",
@ -135,7 +134,7 @@ minetest.register_ore({
clust_scarcity = 200,
clust_num_ores = 100,
clust_size = 10,
y_min = deepslate_min,
y_min = mcl_vars.mg_overworld_min_old,
y_max = deepslate_max,
noise_params = {
offset = 0,
@ -396,7 +395,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then
clust_num_ores = 4,
clust_size = 3,
y_min = mcl_vars.mg_overworld_min,
y_max = mcl_worlds.layer_to_y(12),
y_max = mcl_worlds.layer_to_y(-5),
})
minetest.register_ore({
ore_type = "scatter",
@ -406,7 +405,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then
clust_num_ores = 2,
clust_size = 2,
y_min = mcl_vars.mg_overworld_min,
y_max = mcl_worlds.layer_to_y(12),
y_max = mcl_worlds.layer_to_y(-15),
})
minetest.register_ore({
ore_type = "scatter",
@ -693,9 +692,9 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then
{ "iron", 830, 5, 3, deepslate_min, deepslate_max },
{ "gold", 4775, 5, 3, deepslate_min, deepslate_max },
{ "gold", 6560, 7, 3, deepslate_min, deepslate_max },
{ "diamond", 10000, 4, 3, deepslate_min, mcl_worlds.layer_to_y(12) },
{ "diamond", 5000, 2, 3, deepslate_min, mcl_worlds.layer_to_y(12) },
{ "diamond", 10000, 8, 3, deepslate_min, mcl_worlds.layer_to_y(12) },
{ "diamond", 10000, 4, 3, deepslate_min, mcl_worlds.layer_to_y(-12) },
{ "diamond", 5000, 2, 3, deepslate_min, mcl_worlds.layer_to_y(-12) },
{ "diamond", 10000, 8, 3, deepslate_min, mcl_worlds.layer_to_y(-5) },
{ "diamond", 20000, 1, 1, mcl_worlds.layer_to_y(13), mcl_worlds.layer_to_y(15) },
{ "diamond", 20000, 2, 2, mcl_worlds.layer_to_y(13), mcl_worlds.layer_to_y(15) },
{ "redstone", 500, 4, 3, deepslate_min, mcl_worlds.layer_to_y(13) },

View File

@ -49,7 +49,7 @@ local function init_strongholds()
if superflat then
y = mcl_vars.mg_bedrock_overworld_max + 3
else
y = pr:next(mcl_vars.mg_bedrock_overworld_max+1, mcl_vars.mg_overworld_min+48)
y = pr:next(-50, -30)
end
local pos = { x = math.cos(angle) * dist, y = y, z = math.sin(angle) * dist }
pos = vector.round(pos)

View File

@ -121,8 +121,98 @@ end
local node_stand, node_stand_below, node_head, node_feet, node_head_top
local is_swimming
local set_bone_position_conditional = mcl_util.set_bone_position
local set_properties_conditional = mcl_util.set_properties
-- This following part is 2 wrapper functions for player:set_bones
-- and player:set_properties preventing them from being resent on
-- every globalstep when they have not changed.
local function roundN(n, d)
if type(n) ~= "number" then return n end
local m = 10^d
return math.floor(n * m + 0.5) / m
end
local function close_enough(a,b)
local rt=true
if type(a) == "table" and type(b) == "table" then
for k,v in pairs(a) do
if roundN(v,2) ~= roundN(b[k],2) then
rt=false
break
end
end
else
rt = roundN(a,2) == roundN(b,2)
end
return rt
end
local function props_changed(props,oldprops)
local changed=false
local p={}
for k,v in pairs(props) do
if not close_enough(v,oldprops[k]) then
p[k]=v
changed=true
end
end
return changed,p
end
--tests for roundN
local test_round1=15
local test_round2=15.00199999999
local test_round3=15.00111111
local test_round4=15.00999999
assert(roundN(test_round1,2)==roundN(test_round1,2))
assert(roundN(test_round1,2)==roundN(test_round2,2))
assert(roundN(test_round1,2)==roundN(test_round3,2))
assert(roundN(test_round1,2)~=roundN(test_round4,2))
-- tests for close_enough
local test_cb = {-0.35,0,-0.35,0.35,0.8,0.35} --collisionboxes
local test_cb_close = {-0.351213,0,-0.35,0.35,0.8,0.351212}
local test_cb_diff = {-0.35,0,-1.35,0.35,0.8,0.35}
local test_eh = 1.65 --eye height
local test_eh_close = 1.65123123
local test_eh_diff = 1.35
local test_nt = { r = 225, b = 225, a = 225, g = 225 } --nametag
local test_nt_diff = { r = 225, b = 225, a = 0, g = 225 }
assert(close_enough(test_cb,test_cb_close))
assert(not close_enough(test_cb,test_cb_diff))
assert(close_enough(test_eh,test_eh_close))
assert(not close_enough(test_eh,test_eh_diff))
assert(not close_enough(test_nt,test_nt_diff)) --no floats involved here
--tests for properties_changed
local test_properties_set1={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 }}
local test_properties_set2={collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}
local test_p1,_=props_changed(test_properties_set1,test_properties_set1)
local test_p2,_=props_changed(test_properties_set1,test_properties_set2)
assert(not test_p1)
assert(test_p2)
local function set_properties_conditional(player,props)
local changed,p=props_changed(props,player:get_properties())
if changed then
player:set_properties(p)
end
end
local function set_bone_position_conditional(player,b,p,r) --bone,position,rotation
local oldp,oldr=player:get_bone_position(b)
if vector.equals(vector.round(oldp),vector.round(p)) and vector.equals(vector.round(oldr),vector.round(r)) then
return
end
player:set_bone_position(b,p,r)
end
local function get_overall_velocity(vector)
local v = math.sqrt(vector.x^2 + vector.y^2 + vector.z^2)
@ -605,6 +695,9 @@ end)
-- Don't change HP if the player falls in the water or through End Portal:
mcl_damage.register_modifier(function(obj, damage, reason)
if reason.type == "fall" then
if minetest.is_creative_enabled(obj:get_player_name()) then
return 0
end
local pos = obj:get_pos()
local node = minetest.get_node(pos)
local velocity = obj:get_velocity() or obj:get_player_velocity() or {x=0,y=-10,z=0}

View File

@ -136,6 +136,9 @@ mcl_default_shadow_intensity (Default shadow intensity) float 0.33 0.0 1.0
# See also: https://github.com/minetest/minetest/issues/95
mcl_translucent_ice (Translucent ice) bool false
# Overworld min deep (default: -128)
mcl_overworld_min (Overworld min deep) int -128 -25000 -62
# Whether to generate fallen logs in some biomes.
# They might not always look pretty and have strange overhangs.
mcl_generate_fallen_logs (Generate fallen logs) bool false