Compare commits
37 Commits
Author | SHA1 | Date |
---|---|---|
|
e80ce4b758 | |
|
51e43f7efc | |
|
dc0ca59534 | |
|
e35e949833 | |
|
0b0a48fd10 | |
|
1b6df20c0c | |
|
8930f9da45 | |
|
aa2693795d | |
|
23ec60fff0 | |
|
fec0dae4ca | |
|
8cd093afa9 | |
|
9cf5b2a9f6 | |
|
8a63e90e4a | |
|
a16e8f0403 | |
|
090c5b086a | |
|
c500dc98f9 | |
|
4a086db4c5 | |
|
ef980f2ea0 | |
|
0c21abf28a | |
|
78f1a81d1f | |
|
0a33c5b5df | |
|
f9f74d2af7 | |
|
d43494e3b7 | |
|
2a9d704293 | |
|
e294466029 | |
|
a1919b572a | |
|
24c03c2d32 | |
|
2fa2f7cbf9 | |
|
aea899a569 | |
|
36427d5aef | |
|
3e9cb597e6 | |
|
ba6dfc7368 | |
|
52ac8ffd43 | |
|
3686d9a79d | |
|
d71d1c4b82 | |
|
0c4edbc4ac | |
|
5719637ee7 |
After Width: | Height: | Size: 144 B |
|
@ -1,3 +1,5 @@
|
||||||
|
local enable_damage = minetest.settings:get_bool("enable_damage")
|
||||||
|
|
||||||
function mcl_burning.get_storage(obj)
|
function mcl_burning.get_storage(obj)
|
||||||
return obj:is_player() and mcl_burning.storage[obj] or obj:get_luaentity()
|
return obj:is_player() and mcl_burning.storage[obj] or obj:get_luaentity()
|
||||||
end
|
end
|
||||||
|
@ -77,7 +79,7 @@ end
|
||||||
-- The effective burn duration is modified by obj's armor protection.
|
-- The effective burn duration is modified by obj's armor protection.
|
||||||
-- If obj was already burning, its burn duration is updated if the current
|
-- If obj was already burning, its burn duration is updated if the current
|
||||||
-- duration is less than burn_time.
|
-- duration is less than burn_time.
|
||||||
-- If obj is dead, fireproof or a creative player, this function does nothing.
|
-- If obj is dead, fireproof or enable_damage is disabled, this function does nothing.
|
||||||
--
|
--
|
||||||
function mcl_burning.set_on_fire(obj, burn_time)
|
function mcl_burning.set_on_fire(obj, burn_time)
|
||||||
if obj:get_hp() < 0 then
|
if obj:get_hp() < 0 then
|
||||||
|
@ -89,8 +91,9 @@ function mcl_burning.set_on_fire(obj, burn_time)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if obj:is_player() and minetest.is_creative_enabled(obj:get_player_name()) then
|
if obj:is_player() and not enable_damage then
|
||||||
burn_time = 0
|
burn_time = 0
|
||||||
|
return
|
||||||
else
|
else
|
||||||
local max_fire_prot_lvl = 0
|
local max_fire_prot_lvl = 0
|
||||||
local inv = mcl_util.get_inventory(obj)
|
local inv = mcl_util.get_inventory(obj)
|
||||||
|
|
|
@ -16,6 +16,29 @@ local CRAMMING_DAMAGE = 3
|
||||||
-- Localize
|
-- Localize
|
||||||
local S = minetest.get_translator("mcl_mobs")
|
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
|
-- Invisibility mod check
|
||||||
mcl_mobs.invis = {}
|
mcl_mobs.invis = {}
|
||||||
|
|
||||||
|
@ -309,25 +332,57 @@ local function update_roll(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- set and return valid yaw
|
-- set and return valid yaw
|
||||||
|
|
||||||
|
|
||||||
local set_yaw = function(self, yaw, delay, dtime)
|
local set_yaw = function(self, yaw, delay, dtime)
|
||||||
|
|
||||||
|
|
||||||
if self.noyaw then return end
|
if self.noyaw then return end
|
||||||
if true then
|
|
||||||
self.object:set_yaw(yaw)
|
if self._kb_turn then
|
||||||
return yaw
|
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))
|
||||||
end
|
end
|
||||||
|
|
||||||
if not yaw or yaw ~= yaw then
|
--calculate the shortest way to turn to find our target
|
||||||
yaw = 0
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
delay = delay or 0
|
delay = delay or 0
|
||||||
|
|
||||||
|
yaw = self.object:get_yaw()
|
||||||
|
|
||||||
if delay == 0 then
|
if delay == 0 then
|
||||||
if self.shaking and dtime then
|
if self.shaking and dtime then
|
||||||
yaw = yaw + (random() * 2 - 1) * 5 * dtime
|
yaw = yaw + (random() * 2 - 1) * 5 * dtime
|
||||||
end
|
end
|
||||||
self.object:set_yaw(yaw)
|
|
||||||
update_roll(self)
|
update_roll(self)
|
||||||
return yaw
|
return yaw
|
||||||
end
|
end
|
||||||
|
@ -412,6 +467,10 @@ local set_animation = function(self, anim, fixed_frame)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.jockey then
|
||||||
|
anim = "jockey"
|
||||||
|
end
|
||||||
|
|
||||||
if flight_check(self) and self.fly and anim == "walk" then anim = "fly" end
|
if flight_check(self) and self.fly and anim == "walk" then anim = "fly" end
|
||||||
|
|
||||||
self._current_animation = self._current_animation or ""
|
self._current_animation = self._current_animation or ""
|
||||||
|
@ -1910,7 +1969,6 @@ end
|
||||||
-- find someone to attack
|
-- find someone to attack
|
||||||
local monster_attack = function(self)
|
local monster_attack = function(self)
|
||||||
if not damage_enabled
|
if not damage_enabled
|
||||||
or minetest.is_creative_enabled("")
|
|
||||||
or self.passive ~= false
|
or self.passive ~= false
|
||||||
or self.state == "attack"
|
or self.state == "attack"
|
||||||
or day_docile(self) then
|
or day_docile(self) then
|
||||||
|
@ -3312,6 +3370,13 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
||||||
elseif luaentity and luaentity._knockback then
|
elseif luaentity and luaentity._knockback then
|
||||||
kb = kb + luaentity._knockback
|
kb = kb + luaentity._knockback
|
||||||
end
|
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({
|
self.object:set_velocity({
|
||||||
x = dir.x * kb,
|
x = dir.x * kb,
|
||||||
|
@ -3398,6 +3463,11 @@ end
|
||||||
|
|
||||||
local mob_detach_child = function(self, child)
|
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
|
if self.driver == child then
|
||||||
self.driver = nil
|
self.driver = nil
|
||||||
end
|
end
|
||||||
|
@ -3670,6 +3740,9 @@ local mob_step = function(self, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- smooth rotation by ThomasMonroe314
|
-- 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
|
if self.delay and self.delay > 0 then
|
||||||
|
|
||||||
|
@ -3743,6 +3816,9 @@ local mob_step = function(self, dtime)
|
||||||
_locked_object_eye_height = self._locked_object:get_properties().eye_height
|
_locked_object_eye_height = self._locked_object:get_properties().eye_height
|
||||||
end
|
end
|
||||||
local self_rot = self.object:get_rotation()
|
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 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 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_yaw = math.deg(-(-(self_rot.y)-(-minetest.dir_to_yaw(direction_player))))+self.head_yaw_offset
|
||||||
|
@ -4030,6 +4106,7 @@ minetest.register_entity(name, {
|
||||||
on_die = def.on_die,
|
on_die = def.on_die,
|
||||||
spawn_small_alternative = def.spawn_small_alternative,
|
spawn_small_alternative = def.spawn_small_alternative,
|
||||||
do_custom = def.do_custom,
|
do_custom = def.do_custom,
|
||||||
|
detach_child = def.detach_child,
|
||||||
jump_height = def.jump_height or 4, -- was 6
|
jump_height = def.jump_height or 4, -- was 6
|
||||||
rotate = math.rad(def.rotate or 0), -- 0=front, 90=side, 180=back, 270=side2
|
rotate = math.rad(def.rotate or 0), -- 0=front, 90=side, 180=back, 270=side2
|
||||||
lifetimer = def.lifetimer or 57.73,
|
lifetimer = def.lifetimer or 57.73,
|
||||||
|
|
|
@ -42,6 +42,7 @@ minetest.register_entity("mobs_mc:ender_eyes", {
|
||||||
})
|
})
|
||||||
|
|
||||||
local S = minetest.get_translator("mobs_mc")
|
local S = minetest.get_translator("mobs_mc")
|
||||||
|
local enable_damage = minetest.settings:get_bool("enable_damage")
|
||||||
|
|
||||||
local telesound = function(pos, is_source)
|
local telesound = function(pos, is_source)
|
||||||
local snd
|
local snd
|
||||||
|
@ -412,7 +413,7 @@ mcl_mobs:register_mob("mobs_mc:enderman", {
|
||||||
-- self:teleport(nil)
|
-- self:teleport(nil)
|
||||||
-- self.state = ""
|
-- self.state = ""
|
||||||
--else
|
--else
|
||||||
if self.attack ~= nil and not minetest.settings:get_bool("creative_mode") then
|
if self.attack ~= nil and enable_damage then
|
||||||
self.state = 'attack'
|
self.state = 'attack'
|
||||||
end
|
end
|
||||||
--end
|
--end
|
||||||
|
|
|
@ -34,7 +34,6 @@ local skeleton = {
|
||||||
"mcl_bows_bow_0.png", -- bow
|
"mcl_bows_bow_0.png", -- bow
|
||||||
"mobs_mc_skeleton.png", -- skeleton
|
"mobs_mc_skeleton.png", -- skeleton
|
||||||
} },
|
} },
|
||||||
visual_size = {x=1, y=1},
|
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
textures = {
|
textures = {
|
||||||
{
|
{
|
||||||
|
@ -81,11 +80,27 @@ local skeleton = {
|
||||||
run_speed = 30,
|
run_speed = 30,
|
||||||
shoot_start = 70,
|
shoot_start = 70,
|
||||||
shoot_end = 90,
|
shoot_end = 90,
|
||||||
|
jockey_start = 172,
|
||||||
|
jockey_end = 172,
|
||||||
die_start = 160,
|
die_start = 160,
|
||||||
die_end = 170,
|
die_end = 170,
|
||||||
die_speed = 15,
|
die_speed = 15,
|
||||||
die_loop = false,
|
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,
|
ignited_by_sunlight = true,
|
||||||
view_range = 16,
|
view_range = 16,
|
||||||
fear_height = 4,
|
fear_height = 4,
|
||||||
|
@ -93,6 +108,9 @@ local skeleton = {
|
||||||
arrow = "mcl_bows:arrow_entity",
|
arrow = "mcl_bows:arrow_entity",
|
||||||
shoot_arrow = function(self, pos, dir)
|
shoot_arrow = function(self, pos, dir)
|
||||||
if mod_bows then
|
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
|
-- 2-4 damage per arrow
|
||||||
local dmg = math.max(4, math.random(2, 8))
|
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)
|
mcl_bows.shoot_arrow("mcl_bows:arrow", pos, dir, self.object:get_yaw(), self.object, nil, dmg)
|
||||||
|
|
|
@ -14,7 +14,7 @@ local S = minetest.get_translator("mobs_mc")
|
||||||
minetest.register_entity("mobs_mc:spider_eyes", {
|
minetest.register_entity("mobs_mc:spider_eyes", {
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_spider.b3d",
|
mesh = "mobs_mc_spider.b3d",
|
||||||
visual_size = {x=1.01, y=1.01},
|
visual_size = {x=1.01/3, y=1.01/3},
|
||||||
textures = {
|
textures = {
|
||||||
"mobs_mc_spider_eyes.png",
|
"mobs_mc_spider_eyes.png",
|
||||||
},
|
},
|
||||||
|
@ -44,6 +44,7 @@ local spider = {
|
||||||
xp_max = 5,
|
xp_max = 5,
|
||||||
armor = {fleshy = 100, arthropod = 100},
|
armor = {fleshy = 100, arthropod = 100},
|
||||||
on_spawn = function(self)
|
on_spawn = function(self)
|
||||||
|
self.object:set_properties({visual_size={x=1,y=1}})
|
||||||
local spider_eyes=false
|
local spider_eyes=false
|
||||||
for n = 1, #self.object:get_children() do
|
for n = 1, #self.object:get_children() do
|
||||||
local obj = self.object:get_children()[n]
|
local obj = self.object:get_children()[n]
|
||||||
|
@ -55,6 +56,14 @@ 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))
|
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
|
||||||
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",
|
head_swivel = "Head_Control",
|
||||||
bone_eye_height = 1,
|
bone_eye_height = 1,
|
||||||
curiosity = 10,
|
curiosity = 10,
|
||||||
|
@ -65,7 +74,7 @@ local spider = {
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_spider.png"},
|
{"mobs_mc_spider.png"},
|
||||||
},
|
},
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=1, y=1},
|
||||||
makes_footstep_sound = false,
|
makes_footstep_sound = false,
|
||||||
sounds = {
|
sounds = {
|
||||||
random = "mobs_mc_spider_random",
|
random = "mobs_mc_spider_random",
|
||||||
|
|
|
@ -111,7 +111,6 @@ baby_zombie.description = S("Baby Zombie")
|
||||||
baby_zombie.collisionbox = {-0.25, -0.01, -0.25, 0.25, 1, 0.25}
|
baby_zombie.collisionbox = {-0.25, -0.01, -0.25, 0.25, 1, 0.25}
|
||||||
baby_zombie.xp_min = 12
|
baby_zombie.xp_min = 12
|
||||||
baby_zombie.xp_max = 12
|
baby_zombie.xp_max = 12
|
||||||
baby_zombie.visual_size = {x = 1 / 2, y = 1 / 2}
|
|
||||||
baby_zombie.walk_velocity = 1.2
|
baby_zombie.walk_velocity = 1.2
|
||||||
baby_zombie.run_velocity = 2.4
|
baby_zombie.run_velocity = 2.4
|
||||||
baby_zombie.child = 1
|
baby_zombie.child = 1
|
||||||
|
|
|
@ -217,7 +217,7 @@ function awards.unlock(name, award)
|
||||||
|
|
||||||
-- Get award
|
-- Get award
|
||||||
minetest.log("action", name.." has gotten award "..award)
|
minetest.log("action", name.." has gotten award "..award)
|
||||||
minetest.chat_send_all(S("@1 has made the achievement @2", name, minetest.colorize(mcl_colors.GREEN, "[" .. (awdef.title or award) .. "]")))
|
minetest.chat_send_all(S("@1 has made the advancement @2", name, minetest.colorize(mcl_colors.GREEN, "[" .. (awdef.title or award) .. "]")))
|
||||||
data.unlocked[award] = award
|
data.unlocked[award] = award
|
||||||
awards.save()
|
awards.save()
|
||||||
|
|
||||||
|
@ -257,9 +257,13 @@ function awards.unlock(name, award)
|
||||||
local custom_announce = awdef.custom_announce
|
local custom_announce = awdef.custom_announce
|
||||||
if not custom_announce then
|
if not custom_announce then
|
||||||
if awdef.secret then
|
if awdef.secret then
|
||||||
custom_announce = S("Secret achievement gotten:")
|
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:")
|
||||||
else
|
else
|
||||||
custom_announce = S("Achievement gotten:")
|
custom_announce = S("Advancement Made:")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -283,9 +287,13 @@ function awards.unlock(name, award)
|
||||||
elseif awards.show_mode == "chat" then
|
elseif awards.show_mode == "chat" then
|
||||||
local chat_announce
|
local chat_announce
|
||||||
if awdef.secret == true then
|
if awdef.secret == true then
|
||||||
chat_announce = S("Secret achievement gotten: @1")
|
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")
|
||||||
else
|
else
|
||||||
chat_announce = S("Achievement gotten: @1")
|
chat_announce = S("Advancement Made: @1")
|
||||||
end
|
end
|
||||||
-- use the chat console to send it
|
-- use the chat console to send it
|
||||||
minetest.chat_send_player(name, string.format(chat_announce, title))
|
minetest.chat_send_player(name, string.format(chat_announce, title))
|
||||||
|
@ -306,9 +314,13 @@ function awards.unlock(name, award)
|
||||||
})
|
})
|
||||||
local hud_announce
|
local hud_announce
|
||||||
if awdef.secret == true then
|
if awdef.secret == true then
|
||||||
hud_announce = S("Secret achievement gotten!")
|
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!")
|
||||||
else
|
else
|
||||||
hud_announce = S("Achievement gotten!")
|
hud_announce = S("Advancement Made!")
|
||||||
end
|
end
|
||||||
local two = player:hud_add({
|
local two = player:hud_add({
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
|
@ -389,10 +401,10 @@ function awards.getFormspec(name, to, sid)
|
||||||
local def = awards.def[item.name]
|
local def = awards.def[item.name]
|
||||||
|
|
||||||
if def and def.secret and not item.got then
|
if def and def.secret and not item.got then
|
||||||
formspec = formspec .. "label[1,2.75;"..minetest.formspec_escape(S("(Secret achievement)")).."]"..
|
formspec = formspec .. "label[1,2.75;"..minetest.formspec_escape(S("(Secret Advancement)")).."]"..
|
||||||
"image[1,0;3,3;awards_unknown.png]"
|
"image[1,0;3,3;awards_unknown.png]"
|
||||||
if def and def.description then
|
if def and def.description then
|
||||||
formspec = formspec .. "textarea[0.25,3.25;4.8,1.7;;"..minetest.formspec_escape(S("Get this achievement to find out what it is."))..";]"
|
formspec = formspec .. "textarea[0.25,3.25;4.8,1.7;;"..minetest.formspec_escape(S("Make this advancement to find out what it is."))..";]"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local title = item.name
|
local title = item.name
|
||||||
|
@ -450,7 +462,7 @@ function awards.getFormspec(name, to, sid)
|
||||||
first = false
|
first = false
|
||||||
|
|
||||||
if def.secret and not award.got then
|
if def.secret and not award.got then
|
||||||
formspec = formspec .. "#707070" .. minetest.formspec_escape(S("(Secret Award)"))
|
formspec = formspec .. "#707070" .. minetest.formspec_escape(S("(Secret Advancement)"))
|
||||||
else
|
else
|
||||||
local title = award.name
|
local title = award.name
|
||||||
if def and def.title then
|
if def and def.title then
|
||||||
|
|
|
@ -18,7 +18,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
|
|
||||||
minetest.register_chatcommand("awards", {
|
minetest.register_chatcommand("awards", {
|
||||||
params = S("[c|clear|disable|enable]"),
|
params = S("[c|clear|disable|enable]"),
|
||||||
description = S("Show, clear, disable or enable your achievements"),
|
description = S("Show, clear, disable or enable your advancements."),
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if param == "clear" then
|
if param == "clear" then
|
||||||
if awards.player(name).disabled ~= nil then
|
if awards.player(name).disabled ~= nil then
|
||||||
|
@ -30,10 +30,10 @@ minetest.register_chatcommand("awards", {
|
||||||
end
|
end
|
||||||
elseif param == "disable" then
|
elseif param == "disable" then
|
||||||
awards.disable(name)
|
awards.disable(name)
|
||||||
minetest.chat_send_player(name, S("You have disabled your achievements."))
|
minetest.chat_send_player(name, S("You have disabled your advancements."))
|
||||||
elseif param == "enable" then
|
elseif param == "enable" then
|
||||||
awards.enable(name)
|
awards.enable(name)
|
||||||
minetest.chat_send_player(name, S("You have enabled your achievements."))
|
minetest.chat_send_player(name, S("You have enabled your advancements."))
|
||||||
elseif param == "c" then
|
elseif param == "c" then
|
||||||
if awards.player(name).disabled ~= nil then
|
if awards.player(name).disabled ~= nil then
|
||||||
minetest.chat_send_player(name, S("Awards are disabled, enable them first by using /awards enable!"))
|
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
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_privilege("achievements", {
|
minetest.register_privilege("advancements", {
|
||||||
description = S("Can give achievements to any player"),
|
description = S("Can give advancements to any player"),
|
||||||
give_to_singleplayer = false,
|
give_to_singleplayer = false,
|
||||||
give_to_admin = false,
|
give_to_admin = false,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("achievement", {
|
minetest.register_chatcommand("advancement", {
|
||||||
params = S("(grant <player> (<achievement> | all)) | list"),
|
params = S("(grant <player> (<advancement> | all)) | list"),
|
||||||
privs = { achievements = true },
|
privs = { advancements = true },
|
||||||
description = S("Give achievement to player or list all achievements"),
|
description = S("Give advancement to player or list all advancements"),
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if param == "list" then
|
if param == "list" then
|
||||||
local list = {}
|
local list = {}
|
||||||
|
@ -92,7 +92,7 @@ minetest.register_chatcommand("achievement", {
|
||||||
awards.unlock(playername, achievement)
|
awards.unlock(playername, achievement)
|
||||||
return true, S("Done.")
|
return true, S("Done.")
|
||||||
else
|
else
|
||||||
return false, S("Achievement “@1” does not exist.", achievement)
|
return false, S("Advancement “@1” does not exist.", achievement)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
(Secret Award)=
|
(Secret Award)=
|
||||||
<achievement ID>=
|
<achievement ID>=
|
||||||
<name>=
|
<name>=
|
||||||
Achievement gotten!=
|
Advancement Made!=
|
||||||
Achievement gotten:=
|
Advancement Made:=
|
||||||
Achievement gotten: @1=
|
Advancement: @1=
|
||||||
Achievement not found.=
|
Achievement not found.=
|
||||||
All your awards and statistics have been cleared. You can now start again.=
|
All your awards and statistics have been cleared. You can now start again.=
|
||||||
Awards=
|
Awards=
|
||||||
|
@ -27,16 +27,16 @@ Join the game.=
|
||||||
List awards in chat (deprecated)=
|
List awards in chat (deprecated)=
|
||||||
Place a block: @1=
|
Place a block: @1=
|
||||||
Place blocks: @1×@2=
|
Place blocks: @1×@2=
|
||||||
Secret achievement gotten!=
|
Secret Advancement Made!=
|
||||||
Secret achievement gotten:=
|
Secret Advancement Made:=
|
||||||
Secret achievement gotten: @1=
|
Secret Advancement Made: @1=
|
||||||
Show details of an achievement=
|
Show details of an achievement=
|
||||||
Show, clear, disable or enable your achievements=
|
Show, clear, disable or enable your advancements.=
|
||||||
Get this achievement to find out what it is.=
|
Make this advancement to find out what it is.=
|
||||||
Write @1 chat messages.=
|
Write @1 chat messages.=
|
||||||
Write something in chat.=
|
Write something in chat.=
|
||||||
You have disabled your achievements.=
|
You have disabled your advancements.=
|
||||||
You have enabled your achievements.=
|
You have enabled your advancements.=
|
||||||
You have not gotten any awards.=
|
You have not gotten any awards.=
|
||||||
You've disabled awards. Type /awards enable to reenable.=
|
You've disabled awards. Type /awards enable to reenable.=
|
||||||
[c|clear|disable|enable]=
|
[c|clear|disable|enable]=
|
||||||
|
@ -49,16 +49,22 @@ Place @1 block(s).=
|
||||||
Dig @1 block(s).=
|
Dig @1 block(s).=
|
||||||
Eat @1 item(s).=
|
Eat @1 item(s).=
|
||||||
Craft @1 item(s).=
|
Craft @1 item(s).=
|
||||||
Can give achievements to any player=
|
Can give advancements to any player=
|
||||||
(grant <player> (<achievement> | all)) | list=
|
(grant <player> (<advancement> | all)) | list=
|
||||||
Give achievement to player or list all achievements=
|
Give advancement to player or list all advancements=
|
||||||
@1 (@2)=
|
@1 (@2)=
|
||||||
Invalid syntax.=
|
Invalid syntax.=
|
||||||
Invalid action.=
|
Invalid action.=
|
||||||
Player is not online.=
|
Player is not online.=
|
||||||
Done.=
|
Done.=
|
||||||
Achievement “@1” does not exist.=
|
Advancement “@1” does not exist.=
|
||||||
@1 has made the achievement @2=
|
@1 has made the advancement @2=
|
||||||
Mine a block: @1=
|
Mine a block: @1=
|
||||||
Mine blocks: @1×@2=
|
Mine blocks: @1×@2=
|
||||||
Awards are disabled, enable them first by using /awards enable!=
|
Awards are disabled, enable them first by using /awards enable!=
|
||||||
|
Goal Completed:=
|
||||||
|
Goal Completed!=
|
||||||
|
Goal Completed: @1=
|
||||||
|
Challenge Completed:=
|
||||||
|
Challenge Completed!=
|
||||||
|
Challenge Completed: @1=
|
||||||
|
|
|
@ -15,7 +15,9 @@ awards.register_achievement("mcl_buildWorkBench", {
|
||||||
type = "craft",
|
type = "craft",
|
||||||
item = "mcl_crafting_table:crafting_table",
|
item = "mcl_crafting_table:crafting_table",
|
||||||
target = 1
|
target = 1
|
||||||
}
|
},
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:buildPickaxe", {
|
awards.register_achievement("mcl:buildPickaxe", {
|
||||||
title = S("Time to Mine!"),
|
title = S("Time to Mine!"),
|
||||||
|
@ -25,7 +27,9 @@ awards.register_achievement("mcl:buildPickaxe", {
|
||||||
type = "craft",
|
type = "craft",
|
||||||
item = "mcl_tools:pick_wood",
|
item = "mcl_tools:pick_wood",
|
||||||
target = 1
|
target = 1
|
||||||
}
|
},
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:buildFurnace", {
|
awards.register_achievement("mcl:buildFurnace", {
|
||||||
title = S("Hot Topic"),
|
title = S("Hot Topic"),
|
||||||
|
@ -35,7 +39,9 @@ awards.register_achievement("mcl:buildFurnace", {
|
||||||
type = "craft",
|
type = "craft",
|
||||||
item = "mcl_furnaces:furnace",
|
item = "mcl_furnaces:furnace",
|
||||||
target = 1
|
target = 1
|
||||||
}
|
},
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:buildHoe", {
|
awards.register_achievement("mcl:buildHoe", {
|
||||||
title = S("Time to Farm!"),
|
title = S("Time to Farm!"),
|
||||||
|
@ -45,7 +51,9 @@ awards.register_achievement("mcl:buildHoe", {
|
||||||
type = "craft",
|
type = "craft",
|
||||||
item = "mcl_farming:hoe_wood",
|
item = "mcl_farming:hoe_wood",
|
||||||
target = 1
|
target = 1
|
||||||
}
|
},
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Husbandry",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:makeBread", {
|
awards.register_achievement("mcl:makeBread", {
|
||||||
title = S("Bake Bread"),
|
title = S("Bake Bread"),
|
||||||
|
@ -55,7 +63,9 @@ awards.register_achievement("mcl:makeBread", {
|
||||||
type = "craft",
|
type = "craft",
|
||||||
item = "mcl_farming:bread",
|
item = "mcl_farming:bread",
|
||||||
target = 1
|
target = 1
|
||||||
}
|
},
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Husbandry",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:bakeCake", {
|
awards.register_achievement("mcl:bakeCake", {
|
||||||
|
@ -66,7 +76,9 @@ awards.register_achievement("mcl:bakeCake", {
|
||||||
type = "craft",
|
type = "craft",
|
||||||
item = "mcl_cake:cake",
|
item = "mcl_cake:cake",
|
||||||
target = 1
|
target = 1
|
||||||
}
|
},
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Husbandry",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:buildBetterPickaxe", {
|
awards.register_achievement("mcl:buildBetterPickaxe", {
|
||||||
title = S("Getting an Upgrade"),
|
title = S("Getting an Upgrade"),
|
||||||
|
@ -77,7 +89,9 @@ awards.register_achievement("mcl:buildBetterPickaxe", {
|
||||||
type = "craft",
|
type = "craft",
|
||||||
item = "mcl_tools:pick_stone",
|
item = "mcl_tools:pick_stone",
|
||||||
target = 1
|
target = 1
|
||||||
}
|
},
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:buildSword", {
|
awards.register_achievement("mcl:buildSword", {
|
||||||
title = S("Time to Strike!"),
|
title = S("Time to Strike!"),
|
||||||
|
@ -87,7 +101,9 @@ awards.register_achievement("mcl:buildSword", {
|
||||||
type = "craft",
|
type = "craft",
|
||||||
item = "mcl_tools:sword_wood",
|
item = "mcl_tools:sword_wood",
|
||||||
target = 1
|
target = 1
|
||||||
}
|
},
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Adventure",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:bookcase", {
|
awards.register_achievement("mcl:bookcase", {
|
||||||
|
@ -98,7 +114,9 @@ awards.register_achievement("mcl:bookcase", {
|
||||||
type = "craft",
|
type = "craft",
|
||||||
item = "mcl_books:bookshelf",
|
item = "mcl_books:bookshelf",
|
||||||
target = 1
|
target = 1
|
||||||
}
|
},
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:buildIronPickaxe", {
|
awards.register_achievement("mcl:buildIronPickaxe", {
|
||||||
|
@ -109,7 +127,9 @@ awards.register_achievement("mcl:buildIronPickaxe", {
|
||||||
type = "craft",
|
type = "craft",
|
||||||
item = "mcl_tools:pick_iron",
|
item = "mcl_tools:pick_iron",
|
||||||
target = 1
|
target = 1
|
||||||
}
|
},
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Item pickup achievements: These are awarded when picking up a certain item.
|
-- Item pickup achievements: These are awarded when picking up a certain item.
|
||||||
|
@ -118,46 +138,61 @@ awards.register_achievement("mcl:diamonds", {
|
||||||
title = S("DIAMONDS!"),
|
title = S("DIAMONDS!"),
|
||||||
description = S("Pick up a diamond from the floor."),
|
description = S("Pick up a diamond from the floor."),
|
||||||
icon = "mcl_core_diamond_ore.png",
|
icon = "mcl_core_diamond_ore.png",
|
||||||
|
type = "Advancement",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:blazeRod", {
|
awards.register_achievement("mcl:blazeRod", {
|
||||||
title = S("Into Fire"),
|
title = S("Into Fire"),
|
||||||
description = S("Pick up a blaze rod from the floor."),
|
description = S("Pick up a blaze rod from the floor."),
|
||||||
icon = "mcl_mobitems_blaze_rod.png",
|
icon = "mcl_mobitems_blaze_rod.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Nether",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:killCow", {
|
awards.register_achievement("mcl:killCow", {
|
||||||
title = S("Cow Tipper"),
|
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."),
|
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",
|
icon = "mcl_mobitems_leather.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Adventure",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:mineWood", {
|
awards.register_achievement("mcl:mineWood", {
|
||||||
title = S("Getting Wood"),
|
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."),
|
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",
|
icon = "default_tree.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:whosCuttingOnions", {
|
awards.register_achievement("mcl:whosCuttingOnions", {
|
||||||
title = S("Who is Cutting Onions?"),
|
title = S("Who is Cutting Onions?"),
|
||||||
description = S("Pick up a crying obsidian from the floor."),
|
description = S("Pick up a crying obsidian from the floor."),
|
||||||
icon = "default_obsidian.png^mcl_core_crying_obsidian.png",
|
icon = "default_obsidian.png^mcl_core_crying_obsidian.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Nether",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:hiddenInTheDepths", {
|
awards.register_achievement("mcl:hiddenInTheDepths", {
|
||||||
title = S("Hidden in the Depths"),
|
title = S("Hidden in the Depths"),
|
||||||
description = S("Pick up an Ancient Debris from the floor."),
|
description = S("Pick up an Ancient Debris from the floor."),
|
||||||
icon = "mcl_nether_ancient_debris_side.png",
|
icon = "mcl_nether_ancient_debris_side.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Nether",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:PickUpDragonEgg", {
|
awards.register_achievement("mcl:PickUpDragonEgg", {
|
||||||
title = S("The Next Generation"),
|
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."),
|
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",
|
icon = "mcl_end_dragon_egg.png",
|
||||||
|
type = "Goal",
|
||||||
|
group = "End",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:skysTheLimit", {
|
awards.register_achievement("mcl:skysTheLimit", {
|
||||||
title = S("Sky's the Limit"),
|
title = S("Sky's the Limit"),
|
||||||
description = S("Find the elytra and prepare to fly above and beyond!"),
|
description = S("Find the elytra and prepare to fly above and beyond!"),
|
||||||
icon = "mcl_armor_inv_elytra.png",
|
icon = "mcl_armor_inv_elytra.png",
|
||||||
|
type = "Goal",
|
||||||
|
group = "End",
|
||||||
}) -- TODO: Make also unlock when moved to inventory, not just picking up from ground
|
}) -- 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
|
-- Smelting achivements: These are awarded when picking up an item from a furnace
|
||||||
|
@ -166,11 +201,15 @@ awards.register_achievement("mcl:acquireIron", {
|
||||||
title = S("Aquire Hardware"),
|
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."),
|
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",
|
icon = "default_steel_ingot.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:cookFish", {
|
awards.register_achievement("mcl:cookFish", {
|
||||||
title = S("Delicious Fish"),
|
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."),
|
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",
|
icon = "mcl_fishing_fish_cooked.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Husbandry",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Other achievements triggered outside of mcl_achievements
|
-- Other achievements triggered outside of mcl_achievements
|
||||||
|
@ -180,6 +219,8 @@ awards.register_achievement("mcl:onARail", {
|
||||||
title = S("On A Rail"),
|
title = S("On A Rail"),
|
||||||
description = S("Travel by minecart for at least 1000 meters from your starting point in a single ride."),
|
description = S("Travel by minecart for at least 1000 meters from your starting point in a single ride."),
|
||||||
icon = "default_rail.png",
|
icon = "default_rail.png",
|
||||||
|
type = "Challenge",
|
||||||
|
group = "Adventure",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mcl_bows
|
-- Triggered in mcl_bows
|
||||||
|
@ -189,6 +230,8 @@ awards.register_achievement("mcl:snipeSkeleton", {
|
||||||
-- TODO: The range should be 50, not 20. Nerfed because of reduced bow range
|
-- 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."),
|
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",
|
icon = "mcl_bows_bow.png",
|
||||||
|
type = "Challenge",
|
||||||
|
group = "Adventure",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mcl_portals
|
-- Triggered in mcl_portals
|
||||||
|
@ -196,18 +239,24 @@ awards.register_achievement("mcl:buildNetherPortal", {
|
||||||
title = S("We Need to Go Deeper"),
|
title = S("We Need to Go Deeper"),
|
||||||
description = S("Use obsidian and a fire starter to construct a Nether portal."),
|
description = S("Use obsidian and a fire starter to construct a Nether portal."),
|
||||||
icon = "mcl_fire_flint_and_steel.png",
|
icon = "mcl_fire_flint_and_steel.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:enterEndPortal", {
|
awards.register_achievement("mcl:enterEndPortal", {
|
||||||
title = S("The End?"),
|
title = S("The End?"),
|
||||||
description = S("Or the beginning?\nHint: Enter an end portal."),
|
description = S("Or the beginning?\nHint: Enter an end portal."),
|
||||||
icon = "mcl_end_end_stone.png",
|
icon = "mcl_end_end_stone.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:theNether", {
|
awards.register_achievement("mcl:theNether", {
|
||||||
title = S("The Nether"),
|
title = S("The Nether"),
|
||||||
description = S("Bring summer clothes.\nHint: Enter the Nether."),
|
description = S("Bring summer clothes.\nHint: Enter the Nether."),
|
||||||
icon = "mcl_nether_netherrack.png",
|
icon = "mcl_nether_netherrack.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Nether",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mcl_totems
|
-- Triggered in mcl_totems
|
||||||
|
@ -215,6 +264,8 @@ awards.register_achievement("mcl:postMortal", {
|
||||||
title = S("Postmortal"),
|
title = S("Postmortal"),
|
||||||
description = S("Use a Totem of Undying to cheat death."),
|
description = S("Use a Totem of Undying to cheat death."),
|
||||||
icon = "mcl_totems_totem.png",
|
icon = "mcl_totems_totem.png",
|
||||||
|
type = "Goal",
|
||||||
|
group = "Adventure",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mcl_beds
|
-- Triggered in mcl_beds
|
||||||
|
@ -222,12 +273,16 @@ awards.register_achievement("mcl:sweetDreams", {
|
||||||
title = S("Sweet Dreams"),
|
title = S("Sweet Dreams"),
|
||||||
description = S("Sleep in a bed to change your respawn point."),
|
description = S("Sleep in a bed to change your respawn point."),
|
||||||
icon = "mcl_beds_bed_red_inv.png",
|
icon = "mcl_beds_bed_red_inv.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Adventure",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:notQuiteNineLives", {
|
awards.register_achievement("mcl:notQuiteNineLives", {
|
||||||
title = S('Not Quite "Nine" Lives'),
|
title = S('Not Quite "Nine" Lives'),
|
||||||
description = S("Charge a Respawn Anchor to the maximum."),
|
description = S("Charge a Respawn Anchor to the maximum."),
|
||||||
icon = "respawn_anchor_side4.png",
|
icon = "respawn_anchor_side4.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Nether",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mobs_mc
|
-- Triggered in mobs_mc
|
||||||
|
@ -235,24 +290,32 @@ awards.register_achievement("mcl:whatAdeal", {
|
||||||
title = S("What A Deal!"),
|
title = S("What A Deal!"),
|
||||||
description = S("Successfully trade with a Villager."),
|
description = S("Successfully trade with a Villager."),
|
||||||
icon = "mcl_core_emerald.png",
|
icon = "mcl_core_emerald.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Adventure",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:tacticalFishing", {
|
awards.register_achievement("mcl:tacticalFishing", {
|
||||||
title = S("Tactical Fishing"),
|
title = S("Tactical Fishing"),
|
||||||
description = S("Catch a fish... without a fishing rod!"),
|
description = S("Catch a fish... without a fishing rod!"),
|
||||||
icon = "pufferfish_bucket.png",
|
icon = "pufferfish_bucket.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Husbandry",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:witheringHeights", {
|
awards.register_achievement("mcl:witheringHeights", {
|
||||||
title = S("Withering Heights"),
|
title = S("Withering Heights"),
|
||||||
description = S("Summon the wither from the dead."),
|
description = S("Summon the wither from the dead."),
|
||||||
icon = "mcl_mobitems_nether_star.png",
|
icon = "mcl_mobitems_nether_star.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Nether",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:freeTheEnd", {
|
awards.register_achievement("mcl:freeTheEnd", {
|
||||||
title = S("Free the End"),
|
title = S("Free the End"),
|
||||||
description = S("Kill the ender dragon. Good Luck!"),
|
description = S("Kill the ender dragon. Good Luck!"),
|
||||||
icon = "(spawn_egg.png^[multiply:#252525)^(spawn_egg_overlay.png^[multiply:#b313c9)", -- TODO: Dragon Head Icon
|
icon = "(spawn_egg.png^[multiply:#252525)^(spawn_egg_overlay.png^[multiply:#b313c9)", -- TODO: Dragon Head Icon
|
||||||
|
type = "Advancement",
|
||||||
|
group = "End",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mcl_fishing
|
-- Triggered in mcl_fishing
|
||||||
|
@ -260,6 +323,8 @@ awards.register_achievement("mcl:fishyBusiness", {
|
||||||
title = S("Fishy Business"),
|
title = S("Fishy Business"),
|
||||||
description = S("Catch a fish.\nHint: Catch a fish, salmon, clownfish, or pufferfish."),
|
description = S("Catch a fish.\nHint: Catch a fish, salmon, clownfish, or pufferfish."),
|
||||||
icon = "mcl_fishing_fishing_rod.png",
|
icon = "mcl_fishing_fishing_rod.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Husbandry",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mcl_compass
|
-- Triggered in mcl_compass
|
||||||
|
@ -267,6 +332,8 @@ awards.register_achievement("mcl:countryLode", {
|
||||||
title = S("Country Lode,\nTake Me Home"),
|
title = S("Country Lode,\nTake Me Home"),
|
||||||
description = S("Use a compass on a Lodestone."),
|
description = S("Use a compass on a Lodestone."),
|
||||||
icon = "lodestone_side4.png",
|
icon = "lodestone_side4.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Nether",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mcl_smithing_table
|
-- Triggered in mcl_smithing_table
|
||||||
|
@ -274,6 +341,8 @@ awards.register_achievement("mcl:seriousDedication", {
|
||||||
title = S("Serious Dedication"),
|
title = S("Serious Dedication"),
|
||||||
description = S("Use a Netherite Ingot to upgrade a hoe, and then completely reevaluate your life choices."),
|
description = S("Use a Netherite Ingot to upgrade a hoe, and then completely reevaluate your life choices."),
|
||||||
icon = "farming_tool_netheritehoe.png",
|
icon = "farming_tool_netheritehoe.png",
|
||||||
|
type = "Challenge",
|
||||||
|
group = "Husbandry",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mcl_brewing
|
-- Triggered in mcl_brewing
|
||||||
|
@ -281,6 +350,8 @@ awards.register_achievement("mcl:localBrewery", {
|
||||||
title = S("Local Brewery"),
|
title = S("Local Brewery"),
|
||||||
description = S("Brew a Potion.\nHint: Take a potion or glass bottle out of the brewing stand."),
|
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",
|
icon = "mcl_potions_potion_overlay.png^[colorize:#F82423:"..tostring(127).."^mcl_potions_potion_bottle.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Nether",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mcl_enchanting
|
-- Triggered in mcl_enchanting
|
||||||
|
@ -288,6 +359,8 @@ awards.register_achievement("mcl:enchanter", {
|
||||||
title = S("Enchanter"),
|
title = S("Enchanter"),
|
||||||
description = S("Enchant an item using an Enchantment Table."),
|
description = S("Enchant an item using an Enchantment Table."),
|
||||||
icon = "mcl_enchanting_book_enchanted.png",
|
icon = "mcl_enchanting_book_enchanted.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
|
|
||||||
--Triggered in mcl_beacons
|
--Triggered in mcl_beacons
|
||||||
|
@ -295,12 +368,16 @@ awards.register_achievement("mcl:beacon", {
|
||||||
title = S("Bring Home the Beacon"),
|
title = S("Bring Home the Beacon"),
|
||||||
description = S("Use a beacon."),
|
description = S("Use a beacon."),
|
||||||
icon = "beacon_achievement_icon.png",
|
icon = "beacon_achievement_icon.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Nether",
|
||||||
})
|
})
|
||||||
|
|
||||||
awards.register_achievement("mcl:maxed_beacon", {
|
awards.register_achievement("mcl:maxed_beacon", {
|
||||||
title = S("Beaconator"),
|
title = S("Beaconator"),
|
||||||
description = S("Use a fully powered beacon."),
|
description = S("Use a fully powered beacon."),
|
||||||
icon = "beacon_achievement_icon.png",
|
icon = "beacon_achievement_icon.png",
|
||||||
|
type = "Goal",
|
||||||
|
group = "Nether",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Triggered in mcl_end
|
-- Triggered in mcl_end
|
||||||
|
@ -308,6 +385,8 @@ awards.register_achievement("mcl:theEndAgain", {
|
||||||
title = S("The End... Again..."),
|
title = S("The End... Again..."),
|
||||||
description = S("Respawn the Ender Dragon."),
|
description = S("Respawn the Ender Dragon."),
|
||||||
icon = "mcl_end_crystal_item.png",
|
icon = "mcl_end_crystal_item.png",
|
||||||
|
type = "Goal",
|
||||||
|
group = "End",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)
|
-- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)
|
||||||
|
@ -391,14 +470,20 @@ awards.register_achievement("mcl:stoneAge", {
|
||||||
title = S("Stone Age"),
|
title = S("Stone Age"),
|
||||||
description = S("Mine a stone with new pickaxe."),
|
description = S("Mine a stone with new pickaxe."),
|
||||||
icon = "default_cobble.png",
|
icon = "default_cobble.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:hotStuff", {
|
awards.register_achievement("mcl:hotStuff", {
|
||||||
title = S("Hot Stuff"),
|
title = S("Hot Stuff"),
|
||||||
description = S("Put lava in a bucket."),
|
description = S("Put lava in a bucket."),
|
||||||
icon = "bucket_lava.png",
|
icon = "bucket_lava.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
awards.register_achievement("mcl:obsidian", {
|
awards.register_achievement("mcl:obsidian", {
|
||||||
title = S("Ice Bucket Challenge"),
|
title = S("Ice Bucket Challenge"),
|
||||||
description = S("Obtain an obsidian block."),
|
description = S("Obtain an obsidian block."),
|
||||||
icon = "default_obsidian.png",
|
icon = "default_obsidian.png",
|
||||||
|
type = "Advancement",
|
||||||
|
group = "Overworld",
|
||||||
})
|
})
|
||||||
|
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -392,7 +392,7 @@ function mcl_inventory.set_creative_formspec(player, start_i, pagenum, inv_size,
|
||||||
-- Achievements button
|
-- Achievements button
|
||||||
"image_button[9,3;1,1;mcl_achievements_button.png;__mcl_achievements;]" ..
|
"image_button[9,3;1,1;mcl_achievements_button.png;__mcl_achievements;]" ..
|
||||||
--"style_type[image_button;border=;bgimg=;bgimg_pressed=]" ..
|
--"style_type[image_button;border=;bgimg=;bgimg_pressed=]" ..
|
||||||
"tooltip[__mcl_achievements;"..F(S("Achievements")) .. "]" ..
|
"tooltip[__mcl_achievements;"..F(S("Advancements")) .. "]" ..
|
||||||
|
|
||||||
-- Switch stack size button
|
-- Switch stack size button
|
||||||
"image_button[9,4;1,1;default_apple.png;__switch_stack;]" ..
|
"image_button[9,4;1,1;default_apple.png;__switch_stack;]" ..
|
||||||
|
|
|
@ -119,7 +119,7 @@ local function set_inventory(player, armor_change_only)
|
||||||
form = form ..
|
form = form ..
|
||||||
-- Achievements button
|
-- Achievements button
|
||||||
"image_button[7,3;1,1;mcl_achievements_button.png;__mcl_achievements;]" ..
|
"image_button[7,3;1,1;mcl_achievements_button.png;__mcl_achievements;]" ..
|
||||||
"tooltip[__mcl_achievements;" .. F(S("Achievements")) .. "]" ..
|
"tooltip[__mcl_achievements;" .. F(S("Advancements")) .. "]" ..
|
||||||
|
|
||||||
-- For shortcuts
|
-- For shortcuts
|
||||||
"listring[current_player;main]" ..
|
"listring[current_player;main]" ..
|
||||||
|
@ -208,7 +208,6 @@ end
|
||||||
--Insta "digging" nodes in gamemode-creative
|
--Insta "digging" nodes in gamemode-creative
|
||||||
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
|
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
|
||||||
if not puncher or not puncher:is_player() then return end
|
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()
|
local name = puncher:get_player_name()
|
||||||
if not minetest.is_creative_enabled(name) then return end
|
if not minetest.is_creative_enabled(name) then return end
|
||||||
if pointed_thing.type ~= "node" then return end
|
if pointed_thing.type ~= "node" then return end
|
||||||
|
@ -255,10 +254,13 @@ minetest.register_chatcommand("gamemode",{
|
||||||
privs = { server = true },
|
privs = { server = true },
|
||||||
func = function(n,param)
|
func = function(n,param)
|
||||||
-- Full input validation ( just for @erlehmann <3 )
|
-- Full input validation ( just for @erlehmann <3 )
|
||||||
local p = minetest.get_player_by_name(n)
|
local p
|
||||||
local args = param:split(" ")
|
local args = param:split(" ")
|
||||||
if args[2] ~= nil then
|
if args[2] ~= nil then
|
||||||
p = minetest.get_player_by_name(args[2])
|
p = minetest.get_player_by_name(args[2])
|
||||||
|
n = args[2]
|
||||||
|
else
|
||||||
|
p = minetest.get_player_by_name(n)
|
||||||
end
|
end
|
||||||
if not p then
|
if not p then
|
||||||
return false, S("Player not online")
|
return false, S("Player not online")
|
||||||
|
@ -268,6 +270,7 @@ minetest.register_chatcommand("gamemode",{
|
||||||
elseif args[1] ~= nil then
|
elseif args[1] ~= nil then
|
||||||
mcl_inventory.player_set_gamemode(p,args[1])
|
mcl_inventory.player_set_gamemode(p,args[1])
|
||||||
end
|
end
|
||||||
|
|
||||||
--Result message - show effective game mode
|
--Result message - show effective game mode
|
||||||
local gm = p:get_meta():get_string("gamemode")
|
local gm = p:get_meta():get_string("gamemode")
|
||||||
if gm == "" then gm = gamemodes[1] end
|
if gm == "" then gm = gamemodes[1] end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Recipe book=
|
Recipe book=
|
||||||
Help=
|
Help=
|
||||||
Select player skin=
|
Select player skin=
|
||||||
Achievements=
|
Advancements=
|
||||||
Building Blocks=
|
Building Blocks=
|
||||||
Decoration Blocks=
|
Decoration Blocks=
|
||||||
Redstone=
|
Redstone=
|
||||||
|
|
|
@ -11,8 +11,10 @@
|
||||||
--Note that the table storing timeouts use playername as index insteed of player objects (faster)
|
--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
|
--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 = {}
|
local huds_idx = {}
|
||||||
|
|
||||||
|
---@type table<string, table<string, number>>
|
||||||
local hud_hide_timeouts = {}
|
local hud_hide_timeouts = {}
|
||||||
|
|
||||||
hud_hide_timeouts.title = {}
|
hud_hide_timeouts.title = {}
|
||||||
|
@ -24,17 +26,19 @@ huds_idx.subtitle = {}
|
||||||
huds_idx.actionbar = {}
|
huds_idx.actionbar = {}
|
||||||
|
|
||||||
mcl_title = {}
|
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 = {}
|
||||||
mcl_title.layout.title = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = -1.3}, size = 7}
|
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.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.actionbar = { position = { x = 0.5, y = 1 }, alignment = { x = 0, y = 0 }, size = 1 }
|
||||||
|
|
||||||
local get_color = mcl_util.get_color
|
local get_color = mcl_util.get_color
|
||||||
|
|
||||||
--local string = string
|
--local string = string
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
|
|
||||||
|
---@param gametick integer
|
||||||
|
---@return number?
|
||||||
local function gametick_to_secondes(gametick)
|
local function gametick_to_secondes(gametick)
|
||||||
if gametick then
|
if gametick then
|
||||||
return gametick / 20
|
return gametick / 20
|
||||||
|
@ -44,7 +48,10 @@ local function gametick_to_secondes(gametick)
|
||||||
end
|
end
|
||||||
|
|
||||||
--https://github.com/minetest/minetest/blob/b3b075ea02034306256b486dd45410aa765f035a/doc/lua_api.txt#L8477
|
--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)
|
local function style_to_bits(bold, italic)
|
||||||
if bold then
|
if bold then
|
||||||
if italic then
|
if italic then
|
||||||
|
@ -60,9 +67,11 @@ local function style_to_bits(bold, italic)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
]]
|
|
||||||
|
|
||||||
--PARAMS SYSTEM
|
local no_style = style_to_bits(false, false)
|
||||||
|
|
||||||
|
---PARAMS SYSTEM
|
||||||
|
---@type table<ObjectRef, {stay: integer}>
|
||||||
local player_params = {}
|
local player_params = {}
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
@ -78,8 +87,8 @@ minetest.register_on_joinplayer(function(player)
|
||||||
position = mcl_title.layout.title.position,
|
position = mcl_title.layout.title.position,
|
||||||
alignment = mcl_title.layout.title.alignment,
|
alignment = mcl_title.layout.title.alignment,
|
||||||
text = "",
|
text = "",
|
||||||
--style = 0,
|
style = no_style,
|
||||||
size = {x = mcl_title.layout.title.size},
|
size = { x = mcl_title.layout.title.size },
|
||||||
number = hex_color,
|
number = hex_color,
|
||||||
z_index = 100,
|
z_index = 100,
|
||||||
})
|
})
|
||||||
|
@ -88,19 +97,19 @@ minetest.register_on_joinplayer(function(player)
|
||||||
position = mcl_title.layout.subtitle.position,
|
position = mcl_title.layout.subtitle.position,
|
||||||
alignment = mcl_title.layout.subtitle.alignment,
|
alignment = mcl_title.layout.subtitle.alignment,
|
||||||
text = "",
|
text = "",
|
||||||
--style = 0,
|
style = no_style,
|
||||||
size = {x = mcl_title.layout.subtitle.size},
|
size = { x = mcl_title.layout.subtitle.size },
|
||||||
number = hex_color,
|
number = hex_color,
|
||||||
z_index = 100,
|
z_index = 100,
|
||||||
})
|
})
|
||||||
huds_idx.actionbar[player] = player:hud_add({
|
huds_idx.actionbar[player] = player:hud_add({
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
position = mcl_title.layout.actionbar.position,
|
position = mcl_title.layout.actionbar.position,
|
||||||
offset = {x = 0, y = -210},
|
offset = { x = 0, y = -210 },
|
||||||
alignment = mcl_title.layout.actionbar.alignment,
|
alignment = mcl_title.layout.actionbar.alignment,
|
||||||
--style = 0,
|
style = no_style,
|
||||||
text = "",
|
text = "",
|
||||||
size = {x = mcl_title.layout.actionbar.size},
|
size = { x = mcl_title.layout.actionbar.size },
|
||||||
number = hex_color,
|
number = hex_color,
|
||||||
z_index = 100,
|
z_index = 100,
|
||||||
})
|
})
|
||||||
|
@ -123,6 +132,8 @@ minetest.register_on_leaveplayer(function(player)
|
||||||
hud_hide_timeouts.actionbar[playername] = nil
|
hud_hide_timeouts.actionbar[playername] = nil
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
---@param player ObjectRef
|
||||||
|
---@param data {stay: integer}
|
||||||
function mcl_title.params_set(player, data)
|
function mcl_title.params_set(player, data)
|
||||||
player_params[player] = {
|
player_params[player] = {
|
||||||
stay = data.stay or mcl_title.defaults.stay,
|
stay = data.stay or mcl_title.defaults.stay,
|
||||||
|
@ -131,12 +142,18 @@ function mcl_title.params_set(player, data)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param player ObjectRef
|
||||||
|
---@return {stay: integer}
|
||||||
function mcl_title.params_get(player)
|
function mcl_title.params_get(player)
|
||||||
return player_params[player]
|
return player_params[player]
|
||||||
end
|
end
|
||||||
|
|
||||||
--API FUNCTIONS
|
--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)
|
function mcl_title.set(player, type, data)
|
||||||
if not data.color then
|
if not data.color then
|
||||||
data.color = "white"
|
data.color = "white"
|
||||||
|
@ -149,20 +166,25 @@ function mcl_title.set(player, type, data)
|
||||||
player:hud_change(huds_idx[type][player], "text", data.text)
|
player:hud_change(huds_idx[type][player], "text", data.text)
|
||||||
player:hud_change(huds_idx[type][player], "number", hex_color)
|
player:hud_change(huds_idx[type][player], "number", hex_color)
|
||||||
|
|
||||||
--apply bold and italic
|
-- Apply bold and italic
|
||||||
--player:hud_change(huds_idx[type][player], "style", style_to_bits(data.bold, data.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)
|
||||||
|
|
||||||
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
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param player ObjectRef?
|
||||||
|
---@param type '"title"'|'"subtitle"'|'"actionbar"'
|
||||||
function mcl_title.remove(player, type)
|
function mcl_title.remove(player, type)
|
||||||
if player then
|
if player then
|
||||||
player:hud_change(huds_idx[type][player], "text", "")
|
player:hud_change(huds_idx[type][player], "text", "")
|
||||||
--player:hud_change(huds_idx[type][player], "style", 0) --no styling
|
player:hud_change(huds_idx[type][player], "style", no_style)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param player ObjectRef
|
||||||
function mcl_title.clear(player)
|
function mcl_title.clear(player)
|
||||||
mcl_title.remove(player, "title")
|
mcl_title.remove(player, "title")
|
||||||
mcl_title.remove(player, "subtitle")
|
mcl_title.remove(player, "subtitle")
|
||||||
|
@ -179,6 +201,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
subtitle = {},
|
subtitle = {},
|
||||||
actionbar = {},
|
actionbar = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
for element, content in pairs(hud_hide_timeouts) do
|
for element, content in pairs(hud_hide_timeouts) do
|
||||||
for name, timeout in pairs(content) do
|
for name, timeout in pairs(content) do
|
||||||
timeout = timeout - dtime
|
timeout = timeout - dtime
|
||||||
|
@ -190,47 +213,95 @@ minetest.register_globalstep(function(dtime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
hud_hide_timeouts = new_timeouts
|
hud_hide_timeouts = new_timeouts
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
--DEBUG STUFF!!
|
--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", {
|
minetest.register_chatcommand("title", {
|
||||||
|
privs = { debug = true },
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
mcl_title.set(player, "title", {text=param, color="gold", bold=true, italic=true})
|
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
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("subtitle", {
|
minetest.register_chatcommand("subtitle", {
|
||||||
|
privs = { debug = true },
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
mcl_title.set(player, "subtitle", {text=param, color="gold"})
|
if player then
|
||||||
|
mcl_title.set(player, "subtitle", { text = param, color = "gold" })
|
||||||
|
return true, dbg_msg
|
||||||
|
else
|
||||||
|
return false, dbg_msg
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("actionbar", {
|
minetest.register_chatcommand("actionbar", {
|
||||||
|
privs = { debug = true },
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
mcl_title.set(player, "actionbar", {text=param, color="gold"})
|
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
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("timeout", {
|
minetest.register_chatcommand("title_timeout", {
|
||||||
|
privs = { debug = true },
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
mcl_title.params_set(player, {stay = 600})
|
if player then
|
||||||
|
mcl_title.params_set(player, { stay = 600 })
|
||||||
|
return true, dbg_msg
|
||||||
|
else
|
||||||
|
return false, dbg_msg
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("all", {
|
minetest.register_chatcommand("title_all", {
|
||||||
|
privs = { debug = true },
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
mcl_title.params_set(player, {stay = 600})
|
if player then
|
||||||
mcl_title.set(player, "title", {text=param, color="gold"})
|
mcl_title.params_set(player, { stay = 600 })
|
||||||
mcl_title.set(player, "subtitle", {text=param, color="gold"})
|
mcl_title.set(player, "title", { text = param, color = "gold" })
|
||||||
mcl_title.set(player, "actionbar", {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
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
]]
|
|
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 5.6 KiB |
|
@ -342,6 +342,7 @@ mcl_torches.register_torch({
|
||||||
groups = {dig_immediate = 3, deco_block = 1},
|
groups = {dig_immediate = 3, deco_block = 1},
|
||||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||||
particles = true,
|
particles = true,
|
||||||
|
flame_type = 2,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 239 B |
|
@ -155,10 +155,17 @@ function mcl_doors:register_door(name, def)
|
||||||
end
|
end
|
||||||
|
|
||||||
local left_node = minetest.get_node(pt_left)
|
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
|
-- Set door nodes
|
||||||
minetest.set_node(pt, {name=name.."_b_1", param2=p2})
|
minetest.set_node(pt, {name=name.."_b_"..door_dir, param2=p2})
|
||||||
minetest.set_node(pt2, {name=name.."_t_1", param2=p2})
|
minetest.set_node(pt2, {name=name.."_t_"..door_dir, param2=p2})
|
||||||
|
|
||||||
if def.sounds and def.sounds.place then
|
if def.sounds and def.sounds.place then
|
||||||
minetest.sound_play(def.sounds.place, {pos=pt}, true)
|
minetest.sound_play(def.sounds.place, {pos=pt}, true)
|
||||||
|
@ -174,7 +181,7 @@ function mcl_doors:register_door(name, def)
|
||||||
local meta1 = minetest_get_meta(pt)
|
local meta1 = minetest_get_meta(pt)
|
||||||
local meta2 = minetest_get_meta(pt2)
|
local meta2 = minetest_get_meta(pt2)
|
||||||
-- save mirror state for the correct door
|
-- save mirror state for the correct door
|
||||||
if left_node.name:sub(1, #name) == name then
|
if mirrored then
|
||||||
meta1:set_int("is_mirrored", 1)
|
meta1:set_int("is_mirrored", 1)
|
||||||
meta2:set_int("is_mirrored", 1)
|
meta2:set_int("is_mirrored", 1)
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,8 +2,18 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
local has_doc = minetest.get_modpath("doc")
|
local has_doc = minetest.get_modpath("doc")
|
||||||
|
|
||||||
mcl_flowerpots = {}
|
mcl_flowerpots = {}
|
||||||
|
|
||||||
|
---@type table<string, string>
|
||||||
mcl_flowerpots.registered_pots = {}
|
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", {
|
minetest.register_node("mcl_flowerpots:flower_pot", {
|
||||||
description = S("Flower Pot"),
|
description = S("Flower Pot"),
|
||||||
_tt_help = S("Can hold a small flower or plant"),
|
_tt_help = S("Can hold a small flower or plant"),
|
||||||
|
@ -14,23 +24,16 @@ minetest.register_node("mcl_flowerpots:flower_pot", {
|
||||||
tiles = {
|
tiles = {
|
||||||
"mcl_flowerpots_flowerpot.png",
|
"mcl_flowerpots_flowerpot.png",
|
||||||
},
|
},
|
||||||
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
|
use_texture_alpha = "clip",
|
||||||
visual_scale = 0.5,
|
visual_scale = 0.5,
|
||||||
wield_image = "mcl_flowerpots_flowerpot_inventory.png",
|
wield_image = "mcl_flowerpots_flowerpot_inventory.png",
|
||||||
wield_scale = {x=1.0, y=1.0, z=1.0},
|
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
selection_box = {
|
selection_box = pot_box,
|
||||||
type = "fixed",
|
collision_box = pot_box,
|
||||||
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,
|
is_ground_content = false,
|
||||||
inventory_image = "mcl_flowerpots_flowerpot_inventory.png",
|
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(),
|
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||||
on_rightclick = function(pos, node, clicker, itemstack)
|
on_rightclick = function(pos, node, clicker, itemstack)
|
||||||
local name = clicker:get_player_name()
|
local name = clicker:get_player_name()
|
||||||
|
@ -40,7 +43,7 @@ minetest.register_node("mcl_flowerpots:flower_pot", {
|
||||||
end
|
end
|
||||||
local item = clicker:get_wielded_item():get_name()
|
local item = clicker:get_wielded_item():get_name()
|
||||||
if mcl_flowerpots.registered_pots[item] then
|
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
|
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
|
@ -51,37 +54,32 @@ minetest.register_node("mcl_flowerpots:flower_pot", {
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "mcl_flowerpots:flower_pot",
|
output = "mcl_flowerpots:flower_pot",
|
||||||
recipe = {
|
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)
|
function mcl_flowerpots.register_potted_flower(name, def)
|
||||||
mcl_flowerpots.registered_pots[name] = def.name
|
mcl_flowerpots.registered_pots[name] = def.name
|
||||||
minetest.register_node(":mcl_flowerpots:flower_pot_"..def.name, {
|
minetest.register_node(":mcl_flowerpots:flower_pot_" .. def.name, {
|
||||||
description = def.desc.." "..S("Flower Pot"),
|
description = def.desc .. " " .. S("Flower Pot"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "flowerpot.obj",
|
mesh = "flowerpot.obj",
|
||||||
tiles = {
|
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 = minetest.features.use_texture_alpha_string_modes and "clip" or true,
|
use_texture_alpha = "clip",
|
||||||
visual_scale = 0.5,
|
visual_scale = 0.5,
|
||||||
wield_scale = {x=1.0, y=1.0, z=1.0},
|
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
selection_box = {
|
selection_box = pot_box,
|
||||||
type = "fixed",
|
collision_box = pot_box,
|
||||||
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,
|
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(),
|
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||||
on_rightclick = function(pos, item, clicker)
|
on_rightclick = function(pos, item, clicker)
|
||||||
local player_name = clicker:get_player_name()
|
local player_name = clicker:get_player_name()
|
||||||
|
@ -89,46 +87,41 @@ function mcl_flowerpots.register_potted_flower(name, def)
|
||||||
minetest.record_protection_violation(pos, player_name)
|
minetest.record_protection_violation(pos, player_name)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
minetest.add_item({x=pos.x, y=pos.y+0.5, z=pos.z}, name)
|
minetest.add_item(vector.offset(pos, 0, 0.5, 0), name)
|
||||||
minetest.set_node(pos, {name="mcl_flowerpots:flower_pot"})
|
minetest.set_node(pos, { name = "mcl_flowerpots:flower_pot" })
|
||||||
end,
|
end,
|
||||||
drop = {
|
drop = {
|
||||||
items = {
|
items = {
|
||||||
{ items = { "mcl_flowerpots:flower_pot", name } }
|
{ items = { "mcl_flowerpots:flower_pot", name } },
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
-- Add entry alias for the Help
|
-- Add entry alias for the Help
|
||||||
if has_doc then
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param name string
|
||||||
|
---@param def {name: string, desc: string, image: string}
|
||||||
function mcl_flowerpots.register_potted_cube(name, def)
|
function mcl_flowerpots.register_potted_cube(name, def)
|
||||||
mcl_flowerpots.registered_pots[name] = def.name
|
mcl_flowerpots.registered_pots[name] = def.name
|
||||||
minetest.register_node(":mcl_flowerpots:flower_pot_"..def.name, {
|
minetest.register_node(":mcl_flowerpots:flower_pot_" .. def.name, {
|
||||||
description = def.desc.." "..S("Flower Pot"),
|
description = def.desc .. " " .. S("Flower Pot"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "flowerpot_with_long_cube.obj",
|
mesh = "flowerpot_with_long_cube.obj",
|
||||||
tiles = {
|
tiles = {
|
||||||
def.image,
|
def.image,
|
||||||
},
|
},
|
||||||
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
|
use_texture_alpha = "clip",
|
||||||
visual_scale = 0.5,
|
visual_scale = 0.5,
|
||||||
wield_scale = {x=1.0, y=1.0, z=1.0},
|
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
selection_box = {
|
selection_box = pot_box,
|
||||||
type = "fixed",
|
collision_box = pot_box,
|
||||||
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,
|
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(),
|
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||||
on_rightclick = function(pos, item, clicker)
|
on_rightclick = function(pos, item, clicker)
|
||||||
local player_name = ""
|
local player_name = ""
|
||||||
|
@ -139,18 +132,18 @@ function mcl_flowerpots.register_potted_cube(name, def)
|
||||||
minetest.record_protection_violation(pos, player_name)
|
minetest.record_protection_violation(pos, player_name)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
minetest.add_item({x=pos.x, y=pos.y+0.5, z=pos.z}, name)
|
minetest.add_item(vector.offset(pos, 0, 0.5, 0), name)
|
||||||
minetest.set_node(pos, {name="mcl_flowerpots:flower_pot"})
|
minetest.set_node(pos, { name = "mcl_flowerpots:flower_pot" })
|
||||||
end,
|
end,
|
||||||
drop = {
|
drop = {
|
||||||
items = {
|
items = {
|
||||||
{ items = { "mcl_flowerpots:flower_pot", name } }
|
{ items = { "mcl_flowerpots:flower_pot", name } },
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
-- Add entry alias for the Help
|
-- Add entry alias for the Help
|
||||||
if has_doc then
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local flame_texture = {"mcl_particles_flame.png", "mcl_particles_soul_fire_flame.png"}
|
||||||
|
|
||||||
local smoke_pdef = {
|
local smoke_pdef = {
|
||||||
amount = 0.5,
|
amount = 0.5,
|
||||||
maxexptime = 2.0,
|
maxexptime = 2.0,
|
||||||
|
@ -9,7 +11,8 @@ local smoke_pdef = {
|
||||||
maxrelpos = { x = 1/16, y = 0.06, z = 1/16 },
|
maxrelpos = { x = 1/16, y = 0.06, z = 1/16 },
|
||||||
}
|
}
|
||||||
|
|
||||||
local function spawn_flames_floor(pos)
|
local function spawn_flames_floor(pos, flame_type)
|
||||||
|
|
||||||
-- Flames
|
-- Flames
|
||||||
mcl_particles.add_node_particlespawner(pos, {
|
mcl_particles.add_node_particlespawner(pos, {
|
||||||
amount = 8,
|
amount = 8,
|
||||||
|
@ -22,14 +25,14 @@ local function spawn_flames_floor(pos)
|
||||||
maxexptime = 0.6,
|
maxexptime = 0.6,
|
||||||
minsize = 0.7,
|
minsize = 0.7,
|
||||||
maxsize = 2,
|
maxsize = 2,
|
||||||
texture = "mcl_particles_flame.png",
|
texture = flame_texture[flame_type],
|
||||||
glow = minetest.registered_nodes[minetest.get_node(pos).name].light_source,
|
glow = minetest.registered_nodes[minetest.get_node(pos).name].light_source,
|
||||||
}, "low")
|
}, "low")
|
||||||
-- Smoke
|
-- Smoke
|
||||||
mcl_particles.spawn_smoke(pos, "torch", smoke_pdef)
|
mcl_particles.spawn_smoke(pos, "torch", smoke_pdef)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function spawn_flames_wall(pos)
|
local function spawn_flames_wall(pos, flame_type)
|
||||||
--local minrelpos, maxrelpos
|
--local minrelpos, maxrelpos
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local dir = minetest.wallmounted_to_dir(node.param2)
|
local dir = minetest.wallmounted_to_dir(node.param2)
|
||||||
|
@ -37,17 +40,17 @@ local function spawn_flames_wall(pos)
|
||||||
local smoke_pdef = table.copy(smoke_pdef)
|
local smoke_pdef = table.copy(smoke_pdef)
|
||||||
|
|
||||||
if dir.x < 0 then
|
if dir.x < 0 then
|
||||||
smoke_pdef.minrelpos = { x = -0.38, y = 0.04, z = -0.1 }
|
smoke_pdef.minrelpos = { x = -0.38, y = 0.24, z = -0.1 }
|
||||||
smoke_pdef.maxrelpos = { x = -0.2, y = 0.14, z = 0.1 }
|
smoke_pdef.maxrelpos = { x = -0.2, y = 0.34, z = 0.1 }
|
||||||
elseif dir.x > 0 then
|
elseif dir.x > 0 then
|
||||||
smoke_pdef.minrelpos = { x = 0.2, y = 0.04, z = -0.1 }
|
smoke_pdef.minrelpos = { x = 0.2, y = 0.24, z = -0.1 }
|
||||||
smoke_pdef.maxrelpos = { x = 0.38, y = 0.14, z = 0.1 }
|
smoke_pdef.maxrelpos = { x = 0.38, y = 0.34, z = 0.1 }
|
||||||
elseif dir.z < 0 then
|
elseif dir.z < 0 then
|
||||||
smoke_pdef.minrelpos = { x = -0.1, y = 0.04, z = -0.38 }
|
smoke_pdef.minrelpos = { x = -0.1, y = 0.24, z = -0.38 }
|
||||||
smoke_pdef.maxrelpos = { x = 0.1, y = 0.14, z = -0.2 }
|
smoke_pdef.maxrelpos = { x = 0.1, y = 0.34, z = -0.2 }
|
||||||
elseif dir.z > 0 then
|
elseif dir.z > 0 then
|
||||||
smoke_pdef.minrelpos = { x = -0.1, y = 0.04, z = 0.2 }
|
smoke_pdef.minrelpos = { x = -0.1, y = 0.24, z = 0.2 }
|
||||||
smoke_pdef.maxrelpos = { x = 0.1, y = 0.14, z = 0.38 }
|
smoke_pdef.maxrelpos = { x = 0.1, y = 0.34, z = 0.38 }
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -65,13 +68,25 @@ local function spawn_flames_wall(pos)
|
||||||
maxexptime = 0.6,
|
maxexptime = 0.6,
|
||||||
minsize = 0.7,
|
minsize = 0.7,
|
||||||
maxsize = 2,
|
maxsize = 2,
|
||||||
texture = "mcl_particles_flame.png",
|
texture = flame_texture[flame_type],
|
||||||
glow = minetest.registered_nodes[node.name].light_source,
|
glow = minetest.registered_nodes[node.name].light_source,
|
||||||
}, "low")
|
}, "low")
|
||||||
-- Smoke
|
-- Smoke
|
||||||
mcl_particles.spawn_smoke(pos, "torch", smoke_pdef)
|
mcl_particles.spawn_smoke(pos, "torch", smoke_pdef)
|
||||||
end
|
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)
|
local function remove_flames(pos)
|
||||||
mcl_particles.delete_node_particlespawners(pos)
|
mcl_particles.delete_node_particlespawners(pos)
|
||||||
end
|
end
|
||||||
|
@ -124,6 +139,7 @@ function mcl_torches.register_torch(def)
|
||||||
def.light = def.light or minetest.LIGHT_MAX
|
def.light = def.light or minetest.LIGHT_MAX
|
||||||
def.mesh_floor = def.mesh_floor or "mcl_torches_torch_floor.obj"
|
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.mesh_wall = def.mesh_wall or "mcl_torches_torch_wall.obj"
|
||||||
|
def.flame_type = def.flame_type or 1
|
||||||
|
|
||||||
local groups = def.groups or {}
|
local groups = def.groups or {}
|
||||||
|
|
||||||
|
@ -133,6 +149,7 @@ function mcl_torches.register_torch(def)
|
||||||
groups.dig_by_water = 1
|
groups.dig_by_water = 1
|
||||||
groups.destroy_by_lava_flow = 1
|
groups.destroy_by_lava_flow = 1
|
||||||
groups.dig_by_piston = 1
|
groups.dig_by_piston = 1
|
||||||
|
groups.flame_type = def.flame_type or 1
|
||||||
|
|
||||||
local floordef = {
|
local floordef = {
|
||||||
description = def.description,
|
description = def.description,
|
||||||
|
@ -145,7 +162,6 @@ function mcl_torches.register_torch(def)
|
||||||
inventory_image = def.icon,
|
inventory_image = def.icon,
|
||||||
wield_image = def.icon,
|
wield_image = def.icon,
|
||||||
tiles = def.tiles,
|
tiles = def.tiles,
|
||||||
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
|
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "wallmounted",
|
paramtype2 = "wallmounted",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
|
@ -157,8 +173,7 @@ function mcl_torches.register_torch(def)
|
||||||
drop = def.drop or itemstring,
|
drop = def.drop or itemstring,
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "wallmounted",
|
type = "wallmounted",
|
||||||
wall_top = {-1/16, -1/16, -1/16, 1/16, 0.5, 1/16},
|
wall_bottom = {-2/16, -0.5, -2/16, 2/16, 1/16, 2/16},
|
||||||
wall_bottom = {-1/16, -0.5, -1/16, 1/16, 1/16, 1/16},
|
|
||||||
},
|
},
|
||||||
sounds = def.sounds,
|
sounds = def.sounds,
|
||||||
node_placement_prediction = "",
|
node_placement_prediction = "",
|
||||||
|
@ -211,7 +226,7 @@ function mcl_torches.register_torch(def)
|
||||||
return itemstack
|
return itemstack
|
||||||
end,
|
end,
|
||||||
on_rotate = false,
|
on_rotate = false,
|
||||||
on_construct = def.particles and spawn_flames_floor,
|
on_construct = def.particles and set_flames(pos, def.flame_type, "floor"),
|
||||||
on_destruct = def.particles and remove_flames,
|
on_destruct = def.particles and remove_flames,
|
||||||
}
|
}
|
||||||
minetest.register_node(itemstring, floordef)
|
minetest.register_node(itemstring, floordef)
|
||||||
|
@ -223,7 +238,6 @@ function mcl_torches.register_torch(def)
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = def.mesh_wall,
|
mesh = def.mesh_wall,
|
||||||
tiles = def.tiles,
|
tiles = def.tiles,
|
||||||
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
|
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "wallmounted",
|
paramtype2 = "wallmounted",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
|
@ -234,13 +248,11 @@ function mcl_torches.register_torch(def)
|
||||||
drop = def.drop or itemstring,
|
drop = def.drop or itemstring,
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "wallmounted",
|
type = "wallmounted",
|
||||||
wall_top = {-0.1, -0.1, -0.1, 0.1, 0.5, 0.1},
|
wall_side = {-0.5, -0.3, -0.1, -0.2, 0.325, 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,
|
sounds = def.sounds,
|
||||||
on_rotate = false,
|
on_rotate = false,
|
||||||
on_construct = def.particles and spawn_flames_wall,
|
on_construct = def.particles and set_flames(pos, def.flame_type, "wall"),
|
||||||
on_destruct = def.particles and remove_flames,
|
on_destruct = def.particles and remove_flames,
|
||||||
}
|
}
|
||||||
minetest.register_node(itemstring_wall, walldef)
|
minetest.register_node(itemstring_wall, walldef)
|
||||||
|
@ -259,9 +271,9 @@ minetest.register_lbm({
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
local torch_group = minetest.get_item_group(node.name, "torch")
|
local torch_group = minetest.get_item_group(node.name, "torch")
|
||||||
if torch_group == 1 then
|
if torch_group == 1 then
|
||||||
spawn_flames_floor(pos)
|
spawn_flames_floor(pos, minetest.get_item_group(node.name, "flame_type"))
|
||||||
elseif torch_group == 2 then
|
elseif torch_group == 2 then
|
||||||
spawn_flames_wall(pos)
|
spawn_flames_wall(pos, minetest.get_item_group(node.name, "flame_type"))
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,29 +1,72 @@
|
||||||
# Blender v2.76 (sub 0) OBJ File: 'torch_on_floor_node.blend'
|
# Blender 3.3.1
|
||||||
# www.blender.org
|
# www.blender.org
|
||||||
o torch_Cube_Cube.001_Cube_Cube.001_Material.001
|
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
|
||||||
v 0.062500 0.062500 0.062500
|
v 0.062500 0.062500 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.062500 0.062500 -0.062500
|
v -0.062500 0.062500 -0.062500
|
||||||
v -0.062500 0.062500 0.062500
|
v -0.062500 0.062500 0.062500
|
||||||
v -0.062500 -0.500000 0.062500
|
v -0.062500 -0.562500 -0.062500
|
||||||
v 0.062500 -0.500000 0.062500
|
v -0.062500 -0.562500 0.062500
|
||||||
v 0.062500 -0.500000 -0.062500
|
v 0.500000 0.437500 0.062500
|
||||||
v -0.062500 -0.500000 -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
|
||||||
vt 0.562500 0.500000
|
vt 0.562500 0.500000
|
||||||
vt 0.562500 0.625000
|
vt 0.562500 0.625000
|
||||||
|
vt 0.562500 0.125000
|
||||||
|
vt 0.562500 0.000063
|
||||||
vt 0.437500 0.625000
|
vt 0.437500 0.625000
|
||||||
vt 0.437500 0.500000
|
vt 0.437500 0.500000
|
||||||
vt 0.437500 0.000000
|
vt 0.437500 0.000063
|
||||||
vt 0.562500 0.000000
|
|
||||||
vt 0.562500 0.125000
|
|
||||||
vt 0.437500 0.125000
|
vt 0.437500 0.125000
|
||||||
vn 0.000000 1.000000 0.000000
|
vt 0.000000 1.000000
|
||||||
vn 0.000000 0.000000 -1.000000
|
vt 0.000000 0.000000
|
||||||
vn 1.000000 0.000000 0.000000
|
vt 1.000000 1.000000
|
||||||
s 1
|
vt 1.000000 0.000000
|
||||||
f 1/1/1 2/2/1 3/3/1 4/4/1
|
vt 1.000000 1.000000
|
||||||
f 5/5/1 6/6/1 7/7/1 8/8/1
|
vt 1.000000 0.000000
|
||||||
f 1/2/2 6/6/2 5/5/2 4/3/2
|
vt 0.000000 1.000000
|
||||||
f 2/3/3 1/2/3 6/6/3 7/5/3
|
vt 0.000000 0.000000
|
||||||
f 3/2/2 2/3/2 7/5/2 8/6/2
|
vt 0.000000 1.000000
|
||||||
f 4/3/3 5/5/3 8/6/3 3/2/3
|
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
|
||||||
|
|
|
@ -1,29 +1,72 @@
|
||||||
# Blender v2.76 (sub 0) OBJ File: 'torch_on_wall_node.blend'
|
# Blender 3.3.1
|
||||||
# www.blender.org
|
# www.blender.org
|
||||||
o torch_wall_Cube_Cube.001_Cube_Cube.001_Material.001
|
mtllib mcl_torches_torch_wall.mtl
|
||||||
v 0.062469 -0.303502 0.086070
|
o cube
|
||||||
v 0.062469 -0.195248 0.023570
|
v -0.062500 -0.198340 0.273825
|
||||||
v -0.062531 -0.195248 0.023570
|
v -0.062500 -0.313825 0.321660
|
||||||
v -0.062531 -0.303502 0.086070
|
v -0.062500 -0.437517 -0.303600
|
||||||
v -0.062531 -0.584752 -0.401070
|
v -0.062500 -0.553002 -0.255765
|
||||||
v 0.062469 -0.584752 -0.401070
|
v 0.062500 -0.313825 0.321660
|
||||||
v 0.062469 -0.476498 -0.463570
|
v 0.062500 -0.198340 0.273825
|
||||||
v -0.062531 -0.476498 -0.463570
|
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
|
||||||
vt 0.562500 0.500000
|
vt 0.562500 0.500000
|
||||||
vt 0.562500 0.625000
|
vt 0.562500 0.625000
|
||||||
|
vt 0.562500 0.125000
|
||||||
|
vt 0.562500 0.000063
|
||||||
vt 0.437500 0.625000
|
vt 0.437500 0.625000
|
||||||
vt 0.437500 0.500000
|
vt 0.437500 0.500000
|
||||||
vt 0.437500 0.000000
|
vt 0.437500 0.000063
|
||||||
vt 0.562500 0.000000
|
|
||||||
vt 0.562500 0.125000
|
|
||||||
vt 0.437500 0.125000
|
vt 0.437500 0.125000
|
||||||
vn 0.000000 0.500000 0.866000
|
vt 0.000000 1.000000
|
||||||
vn 0.000000 0.866000 -0.500000
|
vt 0.000000 0.000000
|
||||||
vn 1.000000 -0.000000 0.000000
|
vt 1.000000 1.000000
|
||||||
s 1
|
vt 1.000000 0.000000
|
||||||
f 1/1/1 2/2/1 3/3/1 4/4/1
|
vt 1.000000 1.000000
|
||||||
f 5/5/1 6/6/1 7/7/1 8/8/1
|
vt 1.000000 0.000000
|
||||||
f 1/2/2 6/6/2 5/5/2 4/3/2
|
vt 0.000000 1.000000
|
||||||
f 2/3/3 1/2/3 6/6/3 7/5/3
|
vt 0.000000 0.000000
|
||||||
f 3/2/2 2/3/2 7/5/2 8/6/2
|
vt 0.000000 1.000000
|
||||||
f 4/3/3 5/5/3 8/6/3 3/2/3
|
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
|
||||||
|
|
|
@ -15,6 +15,7 @@ mcl_torches.register_torch({
|
||||||
groups = {dig_immediate = 3, deco_block = 1},
|
groups = {dig_immediate = 3, deco_block = 1},
|
||||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||||
particles = true,
|
particles = true,
|
||||||
|
flame_type = 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
|
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 199 B |
|
@ -605,9 +605,6 @@ end)
|
||||||
-- Don't change HP if the player falls in the water or through End Portal:
|
-- Don't change HP if the player falls in the water or through End Portal:
|
||||||
mcl_damage.register_modifier(function(obj, damage, reason)
|
mcl_damage.register_modifier(function(obj, damage, reason)
|
||||||
if reason.type == "fall" then
|
if reason.type == "fall" then
|
||||||
if minetest.is_creative_enabled(obj:get_player_name()) then
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
local pos = obj:get_pos()
|
local pos = obj:get_pos()
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local velocity = obj:get_velocity() or obj:get_player_velocity() or {x=0,y=-10,z=0}
|
local velocity = obj:get_velocity() or obj:get_player_velocity() or {x=0,y=-10,z=0}
|
||||||
|
|