Compare commits
60 Commits
lower_ow_m
...
master
Author | SHA1 | Date |
---|---|---|
cora | e80ce4b758 | |
cora | 51e43f7efc | |
cora | dc0ca59534 | |
FossFanatic | e35e949833 | |
cora | 0b0a48fd10 | |
cora | 1b6df20c0c | |
epCode | 8930f9da45 | |
epCode | aa2693795d | |
talamh | 23ec60fff0 | |
cora | fec0dae4ca | |
epCode | 8cd093afa9 | |
epCode | 9cf5b2a9f6 | |
epCode | 8a63e90e4a | |
epCode | a16e8f0403 | |
epCode | 090c5b086a | |
epCode | c500dc98f9 | |
epCode | 4a086db4c5 | |
epCode | ef980f2ea0 | |
cora | 0c21abf28a | |
PrairieWind | 78f1a81d1f | |
PrairieWind | 0a33c5b5df | |
PrairieWind | f9f74d2af7 | |
cora | d43494e3b7 | |
cora | 2a9d704293 | |
cora | e294466029 | |
cora | a1919b572a | |
cora | 24c03c2d32 | |
cora | 2fa2f7cbf9 | |
cora | aea899a569 | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | 36427d5aef | |
cora | 3e9cb597e6 | |
cora | ba6dfc7368 | |
cora | 52ac8ffd43 | |
cora | 3686d9a79d | |
AFCMS | d71d1c4b82 | |
cora | 0c4edbc4ac | |
AFCMS | 5719637ee7 | |
cora | 3aaf0f3e29 | |
epCode | 3a34773671 | |
epCode | 5a14f385a0 | |
epCode | 029638029d | |
epCode | 1d06ac5774 | |
epCode | 9a338a0eea | |
epCode | 30c77a3517 | |
epCode | 25cceb58a9 | |
epCode | 8b3087c1d3 | |
epCode | 690d97bc63 | |
epCode | 683d973d9f | |
epCode | 99350d4dc8 | |
epCode | bc0d5de1e2 | |
epCode | 5f46f9649a | |
epCode | c72b1fb9db | |
cora | 609f90dd0a | |
cora | 68d04bc4e8 | |
epCode | 1a6698abda | |
cora | 8893241ae9 | |
MysticTempest | 3eb2125538 | |
chmodsayshello | a1bb8812b1 | |
cora | 3b92a5b0d2 | |
talamh | ecd1162c2d |
After Width: | Height: | Size: 144 B |
|
@ -610,3 +610,95 @@ function mcl_util.get_pointed_thing(player, liquid)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- This following part is 2 wrapper functions + helpers for
|
||||||
|
-- object:set_bones
|
||||||
|
-- and player:set_properties preventing them from being resent on
|
||||||
|
-- every globalstep when they have not changed.
|
||||||
|
|
||||||
|
local function roundN(n, d)
|
||||||
|
if type(n) ~= "number" then return n end
|
||||||
|
local m = 10^d
|
||||||
|
return math.floor(n * m + 0.5) / m
|
||||||
|
end
|
||||||
|
|
||||||
|
local function close_enough(a,b)
|
||||||
|
local rt=true
|
||||||
|
if type(a) == "table" and type(b) == "table" then
|
||||||
|
for k,v in pairs(a) do
|
||||||
|
if roundN(v,2) ~= roundN(b[k],2) then
|
||||||
|
rt=false
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
rt = roundN(a,2) == roundN(b,2)
|
||||||
|
end
|
||||||
|
return rt
|
||||||
|
end
|
||||||
|
|
||||||
|
local function props_changed(props,oldprops)
|
||||||
|
local changed=false
|
||||||
|
local p={}
|
||||||
|
for k,v in pairs(props) do
|
||||||
|
if not close_enough(v,oldprops[k]) then
|
||||||
|
p[k]=v
|
||||||
|
changed=true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return changed,p
|
||||||
|
end
|
||||||
|
|
||||||
|
--tests for roundN
|
||||||
|
local test_round1=15
|
||||||
|
local test_round2=15.00199999999
|
||||||
|
local test_round3=15.00111111
|
||||||
|
local test_round4=15.00999999
|
||||||
|
|
||||||
|
assert(roundN(test_round1,2)==roundN(test_round1,2))
|
||||||
|
assert(roundN(test_round1,2)==roundN(test_round2,2))
|
||||||
|
assert(roundN(test_round1,2)==roundN(test_round3,2))
|
||||||
|
assert(roundN(test_round1,2)~=roundN(test_round4,2))
|
||||||
|
|
||||||
|
-- tests for close_enough
|
||||||
|
local test_cb = {-0.35,0,-0.35,0.35,0.8,0.35} --collisionboxes
|
||||||
|
local test_cb_close = {-0.351213,0,-0.35,0.35,0.8,0.351212}
|
||||||
|
local test_cb_diff = {-0.35,0,-1.35,0.35,0.8,0.35}
|
||||||
|
|
||||||
|
local test_eh = 1.65 --eye height
|
||||||
|
local test_eh_close = 1.65123123
|
||||||
|
local test_eh_diff = 1.35
|
||||||
|
|
||||||
|
local test_nt = { r = 225, b = 225, a = 225, g = 225 } --nametag
|
||||||
|
local test_nt_diff = { r = 225, b = 225, a = 0, g = 225 }
|
||||||
|
|
||||||
|
assert(close_enough(test_cb,test_cb_close))
|
||||||
|
assert(not close_enough(test_cb,test_cb_diff))
|
||||||
|
assert(close_enough(test_eh,test_eh_close))
|
||||||
|
assert(not close_enough(test_eh,test_eh_diff))
|
||||||
|
assert(not close_enough(test_nt,test_nt_diff)) --no floats involved here
|
||||||
|
|
||||||
|
--tests for properties_changed
|
||||||
|
local test_properties_set1={collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 0.65, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}
|
||||||
|
local test_properties_set2={collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}
|
||||||
|
|
||||||
|
local test_p1,_=props_changed(test_properties_set1,test_properties_set1)
|
||||||
|
local test_p2,_=props_changed(test_properties_set1,test_properties_set2)
|
||||||
|
|
||||||
|
assert(not test_p1)
|
||||||
|
assert(test_p2)
|
||||||
|
|
||||||
|
function mcl_util.set_properties(obj,props)
|
||||||
|
local changed,p=props_changed(props,obj:get_properties())
|
||||||
|
if changed then
|
||||||
|
obj:set_properties(p)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function mcl_util.set_bone_position(obj,b,p,r) --bone,position,rotation
|
||||||
|
local oldp,oldr=obj:get_bone_position(b)
|
||||||
|
if vector.equals(vector.round(oldp),vector.round(p)) and vector.equals(vector.round(oldr),vector.round(r)) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
obj:set_bone_position(b,p,r)
|
||||||
|
end
|
||||||
|
|
|
@ -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 = {}
|
||||||
|
|
||||||
|
@ -61,6 +84,13 @@ if minetest.settings:get_bool("only_peaceful_mobs", false) then
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function dir_to_pitch(dir)
|
||||||
|
--local dir2 = vector.normalize(dir)
|
||||||
|
local xz = math.abs(dir.x) + math.abs(dir.z)
|
||||||
|
return -math.atan2(-dir.y, xz)
|
||||||
|
end
|
||||||
|
|
||||||
-- pathfinding settings
|
-- pathfinding settings
|
||||||
local enable_pathfinding = true
|
local enable_pathfinding = true
|
||||||
local stuck_timeout = 3 -- how long before mob gets stuck in place and starts searching
|
local stuck_timeout = 3 -- how long before mob gets stuck in place and starts searching
|
||||||
|
@ -302,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
|
||||||
|
@ -405,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 ""
|
||||||
|
@ -1903,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
|
||||||
|
@ -3305,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,
|
||||||
|
@ -3391,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
|
||||||
|
@ -3663,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
|
||||||
|
|
||||||
|
@ -3706,6 +3786,66 @@ local mob_step = function(self, dtime)
|
||||||
|
|
||||||
-- end rotation
|
-- end rotation
|
||||||
|
|
||||||
|
if self.head_swivel and type(self.head_swivel) == "string" then
|
||||||
|
local oldp,oldr = self.object:get_bone_position(self.head_swivel)
|
||||||
|
|
||||||
|
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 10)) do
|
||||||
|
if obj:is_player() and not self.attack or obj:get_luaentity() and obj:get_luaentity().name == self.name and self ~= obj:get_luaentity() then
|
||||||
|
if not self._locked_object then
|
||||||
|
if math.random(5000/self.curiosity) == 1 then
|
||||||
|
self._locked_object = obj
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if math.random(10000/self.curiosity) == 1 then
|
||||||
|
self._locked_object = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.attack then
|
||||||
|
self._locked_object = self.attack
|
||||||
|
end
|
||||||
|
|
||||||
|
if self._locked_object and (self._locked_object:is_player() or self._locked_object:get_luaentity()) and self._locked_object:get_hp() > 0 then
|
||||||
|
local _locked_object_eye_height = 1.5
|
||||||
|
if self._locked_object:get_luaentity() then
|
||||||
|
_locked_object_eye_height = self._locked_object:get_luaentity().head_eye_height
|
||||||
|
end
|
||||||
|
if self._locked_object:is_player() then
|
||||||
|
_locked_object_eye_height = self._locked_object:get_properties().eye_height
|
||||||
|
end
|
||||||
|
local self_rot = self.object:get_rotation()
|
||||||
|
if self.object:get_attach() then
|
||||||
|
self_rot = self.object:get_attach():get_rotation()
|
||||||
|
end
|
||||||
|
local player_pos = self._locked_object:get_pos()
|
||||||
|
local direction_player = vector.direction(vector.add(self.object:get_pos(), vector.new(0, self.head_eye_height*.7, 0)), vector.add(player_pos, vector.new(0, _locked_object_eye_height, 0)))
|
||||||
|
local mob_yaw = math.deg(-(-(self_rot.y)-(-minetest.dir_to_yaw(direction_player))))+self.head_yaw_offset
|
||||||
|
local mob_pitch = math.deg(-dir_to_pitch(direction_player))*self.head_pitch_multiplier
|
||||||
|
if (mob_yaw < -60 or mob_yaw > 60) and not (self.attack and self.type == "monster") then
|
||||||
|
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.multiply(oldr, 0.9))
|
||||||
|
elseif self.attack and self.type == "monster" then
|
||||||
|
if self.head_yaw == "y" then
|
||||||
|
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(mob_pitch, mob_yaw, 0))
|
||||||
|
elseif self.head_yaw == "z" then
|
||||||
|
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(mob_pitch, 0, -mob_yaw))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if self.head_yaw == "y" then
|
||||||
|
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, ((mob_yaw-oldr.y)*.3)+oldr.y, 0))
|
||||||
|
elseif self.head_yaw == "z" then
|
||||||
|
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, 0, -(((mob_yaw-oldr.y)*.3)+oldr.y)*3))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif not self._locked_object and math.abs(oldr.y) > 3 and math.abs(oldr.x) < 3 then
|
||||||
|
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.multiply(oldr, 0.9))
|
||||||
|
else
|
||||||
|
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(0,0,0))
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
-- run custom function (defined in mob lua file)
|
-- run custom function (defined in mob lua file)
|
||||||
if self.do_custom then
|
if self.do_custom then
|
||||||
|
|
||||||
|
@ -3946,6 +4086,14 @@ end
|
||||||
minetest.register_entity(name, {
|
minetest.register_entity(name, {
|
||||||
|
|
||||||
use_texture_alpha = def.use_texture_alpha,
|
use_texture_alpha = def.use_texture_alpha,
|
||||||
|
head_swivel = def.head_swivel or nil, -- bool to activate this function
|
||||||
|
head_yaw_offset = def.head_yaw_offset or 0, -- for wonkey model bones
|
||||||
|
head_pitch_multiplier = def.head_pitch_multiplier or 1, --for inverted pitch
|
||||||
|
bone_eye_height = def.bone_eye_height or 1.4, -- head bone offset
|
||||||
|
head_eye_height = def.head_eye_height or def.bone_eye_height or 0, -- how hight aproximatly the mobs head is fromm the ground to tell the mob how high to look up at the player
|
||||||
|
curiosity = def.curiosity or 1, -- how often mob will look at player on idle
|
||||||
|
head_yaw = def.head_yaw or "y", -- axis to rotate head on
|
||||||
|
horrizonatal_head_height = def.horrizonatal_head_height or 0,
|
||||||
stepheight = def.stepheight or 0.6,
|
stepheight = def.stepheight or 0.6,
|
||||||
name = name,
|
name = name,
|
||||||
description = def.description,
|
description = def.description,
|
||||||
|
@ -3958,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,
|
||||||
|
|
|
@ -26,6 +26,12 @@ mcl_mobs:register_mob("mobs_mc:blaze", {
|
||||||
rotate = -180,
|
rotate = -180,
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_blaze.b3d",
|
mesh = "mobs_mc_blaze.b3d",
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 4,
|
||||||
|
head_eye_height = 3.5,
|
||||||
|
curiosity = 10,
|
||||||
|
head_yaw_offset = 180,
|
||||||
|
head_pitch_multiplier=-1,
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_blaze.png"},
|
{"mobs_mc_blaze.png"},
|
||||||
},
|
},
|
||||||
|
|
|
@ -20,6 +20,13 @@ mcl_mobs:register_mob("mobs_mc:chicken", {
|
||||||
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.69, 0.2},
|
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.69, 0.2},
|
||||||
runaway = true,
|
runaway = true,
|
||||||
floats = 1,
|
floats = 1,
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 4,
|
||||||
|
head_eye_height = 1.5,
|
||||||
|
horrizonatal_head_height = -.3,
|
||||||
|
curiosity = 10,
|
||||||
|
head_yaw="z",
|
||||||
|
visual_size = {x=1,y=1},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_chicken.b3d",
|
mesh = "mobs_mc_chicken.b3d",
|
||||||
textures = {
|
textures = {
|
||||||
|
|
|
@ -17,6 +17,12 @@ local cow_def = {
|
||||||
"mobs_mc_cow.png",
|
"mobs_mc_cow.png",
|
||||||
"blank.png",
|
"blank.png",
|
||||||
}, },
|
}, },
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 10,
|
||||||
|
head_eye_height = 1.1,
|
||||||
|
horrizonatal_head_height=-1.8,
|
||||||
|
curiosity = 2,
|
||||||
|
head_yaw="z",
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
walk_velocity = 1,
|
walk_velocity = 1,
|
||||||
drops = {
|
drops = {
|
||||||
|
|
|
@ -21,6 +21,9 @@ mcl_mobs:register_mob("mobs_mc:creeper", {
|
||||||
pathfinding = 1,
|
pathfinding = 1,
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_creeper.b3d",
|
mesh = "mobs_mc_creeper.b3d",
|
||||||
|
head_swivel = "Head_Control",
|
||||||
|
bone_eye_height = 2.35,
|
||||||
|
curiosity = 2,
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_creeper.png",
|
{"mobs_mc_creeper.png",
|
||||||
"mobs_mc_empty.png"},
|
"mobs_mc_empty.png"},
|
||||||
|
|
|
@ -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
|
||||||
|
@ -263,8 +264,8 @@ mcl_mobs:register_mob("mobs_mc:enderman", {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not spider_eyes then
|
if not spider_eyes then
|
||||||
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.low", vector.new(0,3.25,-1.98), vector.new(90,0,180))
|
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.top", vector.new(0,2.54,-1.99), vector.new(90,0,180))
|
||||||
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.low", vector.new(1,3.25,-1.98), vector.new(90,0,180))
|
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.top", vector.new(1,2.54,-1.99), vector.new(90,0,180))
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
sounds = {
|
sounds = {
|
||||||
|
@ -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
|
||||||
|
|
|
@ -22,6 +22,9 @@ mcl_mobs:register_mob("mobs_mc:iron_golem", {
|
||||||
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.69, 0.7},
|
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.69, 0.7},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_iron_golem.b3d",
|
mesh = "mobs_mc_iron_golem.b3d",
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 3.38,
|
||||||
|
curiosity = 10,
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_iron_golem.png"},
|
{"mobs_mc_iron_golem.png"},
|
||||||
},
|
},
|
||||||
|
|
|
@ -58,6 +58,14 @@ mcl_mobs:register_mob("mobs_mc:llama", {
|
||||||
shoot_offset = 1, --3.5 *would* be a good value visually but it somehow messes with the projectiles trajectory
|
shoot_offset = 1, --3.5 *would* be a good value visually but it somehow messes with the projectiles trajectory
|
||||||
spawn_in_group_min = 4,
|
spawn_in_group_min = 4,
|
||||||
spawn_in_group = 6,
|
spawn_in_group = 6,
|
||||||
|
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 11,
|
||||||
|
head_eye_height = 3,
|
||||||
|
horrizonatal_head_height=0,
|
||||||
|
curiosity = 60,
|
||||||
|
head_yaw = "z",
|
||||||
|
|
||||||
hp_min = 15,
|
hp_min = 15,
|
||||||
hp_max = 30,
|
hp_max = 30,
|
||||||
xp_min = 1,
|
xp_min = 1,
|
||||||
|
|
|
@ -36,6 +36,12 @@ local ocelot = {
|
||||||
hp_max = 10,
|
hp_max = 10,
|
||||||
xp_min = 1,
|
xp_min = 1,
|
||||||
xp_max = 3,
|
xp_max = 3,
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 6.2,
|
||||||
|
head_eye_height = 0.4,
|
||||||
|
horrizonatal_head_height=-0,
|
||||||
|
head_yaw="z",
|
||||||
|
curiosity = 4,
|
||||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.69, 0.3},
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.69, 0.3},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_cat.b3d",
|
mesh = "mobs_mc_cat.b3d",
|
||||||
|
|
|
@ -135,6 +135,10 @@ mcl_mobs:register_mob("mobs_mc:parrot", {
|
||||||
hp_max = 6,
|
hp_max = 6,
|
||||||
xp_min = 1,
|
xp_min = 1,
|
||||||
xp_max = 3,
|
xp_max = 3,
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 1.1,
|
||||||
|
horrizonatal_head_height=0,
|
||||||
|
curiosity = 10,
|
||||||
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
|
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_parrot.b3d",
|
mesh = "mobs_mc_parrot.b3d",
|
||||||
|
|
|
@ -18,6 +18,12 @@ mcl_mobs:register_mob("mobs_mc:pig", {
|
||||||
"mobs_mc_pig.png", -- base
|
"mobs_mc_pig.png", -- base
|
||||||
"blank.png", -- saddle
|
"blank.png", -- saddle
|
||||||
}},
|
}},
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 7.5,
|
||||||
|
head_eye_height = 0.8,
|
||||||
|
horrizonatal_head_height=-1,
|
||||||
|
curiosity = 3,
|
||||||
|
head_yaw="z",
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
walk_velocity = 1,
|
walk_velocity = 1,
|
||||||
run_velocity = 3,
|
run_velocity = 3,
|
||||||
|
|
|
@ -24,6 +24,12 @@ mcl_mobs:register_mob("mobs_mc:polar_bear", {
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_polarbear.png"},
|
{"mobs_mc_polarbear.png"},
|
||||||
},
|
},
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 2.6,
|
||||||
|
head_eye_height = 1,
|
||||||
|
horrizonatal_head_height = 0,
|
||||||
|
curiosity = 20,
|
||||||
|
head_yaw="z",
|
||||||
visual_size = {x=3.0, y=3.0},
|
visual_size = {x=3.0, y=3.0},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
damage = 6,
|
damage = 6,
|
||||||
|
|
|
@ -15,7 +15,12 @@ local rabbit = {
|
||||||
xp_min = 1,
|
xp_min = 1,
|
||||||
xp_max = 3,
|
xp_max = 3,
|
||||||
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2},
|
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2},
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 2,
|
||||||
|
head_eye_height = 0.5,
|
||||||
|
horrizonatal_head_height = -.3,
|
||||||
|
curiosity = 20,
|
||||||
|
head_yaw="z",
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_rabbit.b3d",
|
mesh = "mobs_mc_rabbit.b3d",
|
||||||
textures = {
|
textures = {
|
||||||
|
|
|
@ -61,7 +61,12 @@ mcl_mobs:register_mob("mobs_mc:sheep", {
|
||||||
xp_min = 1,
|
xp_min = 1,
|
||||||
xp_max = 3,
|
xp_max = 3,
|
||||||
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.29, 0.45},
|
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.29, 0.45},
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 3.3,
|
||||||
|
head_eye_height = 1.1,
|
||||||
|
horrizonatal_head_height=-.7,
|
||||||
|
curiosity = 6,
|
||||||
|
head_yaw="z",
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_sheepfur.b3d",
|
mesh = "mobs_mc_sheepfur.b3d",
|
||||||
textures = { sheep_texture("unicolor_white") },
|
textures = { sheep_texture("unicolor_white") },
|
||||||
|
|
|
@ -25,13 +25,15 @@ local skeleton = {
|
||||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3},
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3},
|
||||||
pathfinding = 1,
|
pathfinding = 1,
|
||||||
group_attack = true,
|
group_attack = true,
|
||||||
|
head_swivel = "Head_Control",
|
||||||
|
bone_eye_height = 2.38,
|
||||||
|
curiosity = 6,
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_skeleton.b3d",
|
mesh = "mobs_mc_skeleton.b3d",
|
||||||
textures = { {
|
textures = { {
|
||||||
"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 = {
|
||||||
{
|
{
|
||||||
|
@ -78,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,
|
||||||
|
@ -90,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)
|
||||||
|
|
|
@ -24,11 +24,14 @@ mcl_mobs:register_mob("mobs_mc:witherskeleton", {
|
||||||
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2.39, 0.35},
|
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2.39, 0.35},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_witherskeleton.b3d",
|
mesh = "mobs_mc_witherskeleton.b3d",
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 2.38,
|
||||||
|
curiosity = 60,
|
||||||
textures = {
|
textures = {
|
||||||
{
|
{
|
||||||
"mobs_mc_empty.png", -- armor
|
"mobs_mc_empty.png", -- armor
|
||||||
"mobs_mc_wither_skeleton.png", -- wither skeleton
|
|
||||||
"default_tool_stonesword.png", -- sword
|
"default_tool_stonesword.png", -- sword
|
||||||
|
"mobs_mc_wither_skeleton.png", -- wither skeleton
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
visual_size = {x=1.2, y=1.2},
|
visual_size = {x=1.2, y=1.2},
|
||||||
|
|
|
@ -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,13 +56,25 @@ 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",
|
||||||
|
bone_eye_height = 1,
|
||||||
|
curiosity = 10,
|
||||||
|
head_yaw="z",
|
||||||
collisionbox = {-0.7, -0.01, -0.7, 0.7, 0.89, 0.7},
|
collisionbox = {-0.7, -0.01, -0.7, 0.7, 0.89, 0.7},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_spider.b3d",
|
mesh = "mobs_mc_spider.b3d",
|
||||||
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",
|
||||||
|
|
|
@ -1235,6 +1235,10 @@ mcl_mobs:register_mob("mobs_mc:villager", {
|
||||||
spawn_class = "passive",
|
spawn_class = "passive",
|
||||||
hp_min = 20,
|
hp_min = 20,
|
||||||
hp_max = 20,
|
hp_max = 20,
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 6.3,
|
||||||
|
head_eye_height = 2.2,
|
||||||
|
curiosity = 10,
|
||||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_villager.b3d",
|
mesh = "mobs_mc_villager.b3d",
|
||||||
|
|
|
@ -21,6 +21,10 @@ mcl_mobs:register_mob("mobs_mc:evoker", {
|
||||||
hp_max = 24,
|
hp_max = 24,
|
||||||
xp_min = 10,
|
xp_min = 10,
|
||||||
xp_max = 10,
|
xp_max = 10,
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 6.3,
|
||||||
|
head_eye_height = 2.2,
|
||||||
|
curiosity = 10,
|
||||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.95, 0.4},
|
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.95, 0.4},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_villager.b3d",
|
mesh = "mobs_mc_villager.b3d",
|
||||||
|
|
|
@ -33,6 +33,10 @@ mcl_mobs:register_mob("mobs_mc:illusioner", {
|
||||||
"mobs_mc_illusionist.png", --hat
|
"mobs_mc_illusionist.png", --hat
|
||||||
"mcl_bows_bow.png",
|
"mcl_bows_bow.png",
|
||||||
}, },
|
}, },
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 2.2,
|
||||||
|
head_eye_height = 2.2,
|
||||||
|
curiosity = 10,
|
||||||
sounds = {
|
sounds = {
|
||||||
-- TODO: more sounds
|
-- TODO: more sounds
|
||||||
distance = 16,
|
distance = 16,
|
||||||
|
|
|
@ -23,14 +23,18 @@ mcl_mobs:register_mob("mobs_mc:vindicator", {
|
||||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_vindicator.b3d",
|
mesh = "mobs_mc_vindicator.b3d",
|
||||||
textures = {
|
head_swivel = "head.control",
|
||||||
{
|
bone_eye_height = 2.2,
|
||||||
"mobs_mc_vindicator.png",
|
head_eye_height = 2.2,
|
||||||
"blank.png", --no hat
|
curiosity = 10,
|
||||||
"default_tool_steelaxe.png",
|
textures = {
|
||||||
-- TODO: Glow when attacking (mobs_mc_vindicator.png)
|
{
|
||||||
},
|
"mobs_mc_vindicator.png",
|
||||||
},
|
"blank.png", --no hat
|
||||||
|
"default_tool_steelaxe.png",
|
||||||
|
-- TODO: Glow when attacking (mobs_mc_vindicator.png)
|
||||||
|
},
|
||||||
|
},
|
||||||
visual_size = {x=2.75, y=2.75},
|
visual_size = {x=2.75, y=2.75},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
damage = 13,
|
damage = 13,
|
||||||
|
|
|
@ -39,13 +39,16 @@ mcl_mobs:register_mob("mobs_mc:villager_zombie", {
|
||||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_villager_zombie.b3d",
|
mesh = "mobs_mc_villager_zombie.b3d",
|
||||||
|
head_swivel = "Head_Control",
|
||||||
|
bone_eye_height = 2.35,
|
||||||
|
curiosity = 2,
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_empty.png", "mobs_mc_zombie_butcher.png", "mobs_mc_empty.png"},
|
{"mobs_mc_zombie_butcher.png"},
|
||||||
{"mobs_mc_empty.png", "mobs_mc_zombie_farmer.png", "mobs_mc_empty.png"},
|
{"mobs_mc_zombie_farmer.png"},
|
||||||
{"mobs_mc_empty.png", "mobs_mc_zombie_librarian.png", "mobs_mc_empty.png"},
|
{"mobs_mc_zombie_librarian.png"},
|
||||||
{"mobs_mc_empty.png", "mobs_mc_zombie_priest.png", "mobs_mc_empty.png"},
|
{"mobs_mc_zombie_priest.png"},
|
||||||
{"mobs_mc_empty.png", "mobs_mc_zombie_smith.png", "mobs_mc_empty.png"},
|
{"mobs_mc_zombie_smith.png"},
|
||||||
{"mobs_mc_empty.png", "mobs_mc_zombie_villager.png", "mobs_mc_empty.png"},
|
{"mobs_mc_zombie_villager.png"},
|
||||||
},
|
},
|
||||||
visual_size = {x=2.75, y=2.75},
|
visual_size = {x=2.75, y=2.75},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
|
|
|
@ -26,6 +26,12 @@ local wolf = {
|
||||||
{"mobs_mc_wolf.png"},
|
{"mobs_mc_wolf.png"},
|
||||||
},
|
},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 3.5,
|
||||||
|
head_eye_height = 1.1,
|
||||||
|
horrizonatal_head_height=0,
|
||||||
|
curiosity = 3,
|
||||||
|
head_yaw="z",
|
||||||
sounds = {
|
sounds = {
|
||||||
attack = "mobs_mc_wolf_bark",
|
attack = "mobs_mc_wolf_bark",
|
||||||
war_cry = "mobs_mc_wolf_growl",
|
war_cry = "mobs_mc_wolf_growl",
|
||||||
|
|
|
@ -53,6 +53,11 @@ local zombie = {
|
||||||
hp_max = 20,
|
hp_max = 20,
|
||||||
xp_min = 5,
|
xp_min = 5,
|
||||||
xp_max = 5,
|
xp_max = 5,
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 6.3,
|
||||||
|
head_eye_height = 2.2,
|
||||||
|
curiosity = 7,
|
||||||
|
head_pitch_multiplier=-1,
|
||||||
breath_max = -1,
|
breath_max = -1,
|
||||||
armor = {undead = 90, fleshy = 90},
|
armor = {undead = 90, fleshy = 90},
|
||||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.8, 0.3},
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.8, 0.3},
|
||||||
|
@ -62,7 +67,6 @@ local zombie = {
|
||||||
{
|
{
|
||||||
"mobs_mc_empty.png", -- armor
|
"mobs_mc_empty.png", -- armor
|
||||||
"mobs_mc_zombie.png", -- texture
|
"mobs_mc_zombie.png", -- texture
|
||||||
"mobs_mc_empty.png", -- wielded_item
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
|
@ -107,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
|
||||||
|
@ -129,7 +132,6 @@ husk.textures = {
|
||||||
{
|
{
|
||||||
"mobs_mc_empty.png", -- armor
|
"mobs_mc_empty.png", -- armor
|
||||||
"mobs_mc_husk.png", -- texture
|
"mobs_mc_husk.png", -- texture
|
||||||
"mobs_mc_empty.png", -- wielded_item
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
husk.ignited_by_sunlight = false
|
husk.ignited_by_sunlight = false
|
||||||
|
@ -144,9 +146,8 @@ mcl_mobs:register_mob("mobs_mc:husk", husk)
|
||||||
local baby_husk = table.copy(baby_zombie)
|
local baby_husk = table.copy(baby_zombie)
|
||||||
baby_husk.description = S("Baby Husk")
|
baby_husk.description = S("Baby Husk")
|
||||||
baby_husk.textures = {{
|
baby_husk.textures = {{
|
||||||
"mobs_mc_empty.png", -- armor
|
|
||||||
"mobs_mc_husk.png", -- texture
|
|
||||||
"mobs_mc_empty.png", -- wielded_item
|
"mobs_mc_empty.png", -- wielded_item
|
||||||
|
"mobs_mc_husk.png", -- texture
|
||||||
}}
|
}}
|
||||||
baby_husk.ignited_by_sunlight = false
|
baby_husk.ignited_by_sunlight = false
|
||||||
baby_husk.sunlight_damage = 0
|
baby_husk.sunlight_damage = 0
|
||||||
|
|
|
@ -25,13 +25,17 @@ local pigman = {
|
||||||
group_attack = { "mobs_mc:pigman", "mobs_mc:baby_pigman" },
|
group_attack = { "mobs_mc:pigman", "mobs_mc:baby_pigman" },
|
||||||
damage = 9,
|
damage = 9,
|
||||||
reach = 2,
|
reach = 2,
|
||||||
|
head_swivel = "head.control",
|
||||||
|
bone_eye_height = 2.4,
|
||||||
|
head_eye_height = 1.4,
|
||||||
|
curiosity = 15,
|
||||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_zombie_pigman.b3d",
|
mesh = "mobs_mc_zombie_pigman.b3d",
|
||||||
textures = { {
|
textures = { {
|
||||||
|
"mobs_mc_zombie_pigman.png", --pigman
|
||||||
"blank.png", --baby
|
"blank.png", --baby
|
||||||
"default_tool_goldsword.png", --sword
|
"default_tool_goldsword.png", --sword
|
||||||
"mobs_mc_zombie_pigman.png", --pigman
|
|
||||||
} },
|
} },
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=3, y=3},
|
||||||
sounds = {
|
sounds = {
|
||||||
|
|
|
@ -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=
|
||||||
|
|
|
@ -70,8 +70,8 @@ minetest.register_globalstep(function(dtime)
|
||||||
hud_elem_type = "image",
|
hud_elem_type = "image",
|
||||||
position = position,
|
position = position,
|
||||||
offset = offset,
|
offset = offset,
|
||||||
scale = {x = 2.75, y = 2.75},
|
scale = {x = 0.46875, y = 0.46875},
|
||||||
text = "mcl_offhand_slot.png",
|
text = "mcl_offhand_slot.png" .. "^[resize:" .. max_offhand_px .. "x" .. max_offhand_px,
|
||||||
z_index = 0,
|
z_index = 0,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -80,7 +80,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
hud_elem_type = "image",
|
hud_elem_type = "image",
|
||||||
position = position,
|
position = position,
|
||||||
offset = offset,
|
offset = offset,
|
||||||
scale = {x = 0.4, y = 0.4},
|
scale = {x = 0.375, y = 0.375},
|
||||||
text = item_texture,
|
text = item_texture,
|
||||||
z_index = 1,
|
z_index = 1,
|
||||||
})
|
})
|
||||||
|
|
|
@ -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)
|
||||||
|
@ -75,34 +84,34 @@ minetest.register_on_joinplayer(function(player)
|
||||||
local _, hex_color = get_color("white")
|
local _, hex_color = get_color("white")
|
||||||
huds_idx.title[player] = player:hud_add({
|
huds_idx.title[player] = player:hud_add({
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
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,
|
||||||
})
|
})
|
||||||
huds_idx.subtitle[player] = player:hud_add({
|
huds_idx.subtitle[player] = player:hud_add({
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
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,
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
local eat = minetest.item_eat(6, "mcl_core:bowl") --6 hunger points, player receives mcl_core:bowl after eating
|
local eat = minetest.item_eat(6, "mcl_core:bowl") --6 hunger points, player receives mcl_core:bowl after eating
|
||||||
|
|
||||||
local flower_effect = {
|
local flower_effect = {
|
||||||
|
[ "mcl_flowers:allium" ] = "fire_resistance",
|
||||||
[ "mcl_flowers:tulip_white" ] = "poison",
|
[ "mcl_flowers:tulip_white" ] = "poison",
|
||||||
[ "mcl_flowers:blue_orchid" ] = "hunger",
|
[ "mcl_flowers:blue_orchid" ] = "hunger",
|
||||||
[ "mcl_flowers:dandelion" ] = "hunger",
|
[ "mcl_flowers:dandelion" ] = "hunger",
|
||||||
|
@ -14,6 +15,10 @@ local flower_effect = {
|
||||||
}
|
}
|
||||||
|
|
||||||
local effects = {
|
local effects = {
|
||||||
|
[ "fire_resistance" ] = function(itemstack, placer, pointed_thing)
|
||||||
|
mcl_potions.fire_resistance_func(placer, 1, 4)
|
||||||
|
return eat(itemstack, placer, pointed_thing)
|
||||||
|
end,
|
||||||
[ "poison" ] = function(itemstack, placer, pointed_thing)
|
[ "poison" ] = function(itemstack, placer, pointed_thing)
|
||||||
mcl_potions.poison_func(placer, 1, 12)
|
mcl_potions.poison_func(placer, 1, 12)
|
||||||
return eat(itemstack, placer, pointed_thing)
|
return eat(itemstack, placer, pointed_thing)
|
||||||
|
@ -77,6 +82,7 @@ minetest.register_craftitem("mcl_sus_stew:stew",{
|
||||||
inventory_image = "sus_stew.png",
|
inventory_image = "sus_stew.png",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
on_place = eat_stew,
|
on_place = eat_stew,
|
||||||
|
on_secondary_use = eat_stew,
|
||||||
groups = { food = 2, eatable = 4, can_eat_when_full = 1, not_in_creative_inventory=1,},
|
groups = { food = 2, eatable = 4, can_eat_when_full = 1, not_in_creative_inventory=1,},
|
||||||
_mcl_saturation = 7.2,
|
_mcl_saturation = 7.2,
|
||||||
})
|
})
|
||||||
|
@ -93,6 +99,12 @@ minetest.register_alias("mcl_sus_stew:night_vision_stew", "mcl_sus_stew:stew")
|
||||||
-- ______________
|
-- ______________
|
||||||
--_________________________________________/ Crafts \________________________________
|
--_________________________________________/ Crafts \________________________________
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "mcl_sus_stew:stew",
|
||||||
|
recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:allium"},
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "mcl_sus_stew:stew",
|
output = "mcl_sus_stew:stew",
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
name = mcl_sus_stew
|
name = mcl_sus_stew
|
||||||
author = chmodsayshello
|
author = chmodsayshello, cora
|
||||||
depends = mcl_core, mcl_mushrooms, mcl_flowers, mcl_potions, mcl_hunger
|
depends = mcl_core, mcl_mushrooms, mcl_flowers, mcl_potions, mcl_hunger
|
||||||
|
|
|
@ -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,32 +25,32 @@ 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)
|
||||||
|
|
||||||
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,7 +149,8 @@ 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,
|
||||||
_doc_items_longdesc = def.doc_items_longdesc,
|
_doc_items_longdesc = def.doc_items_longdesc,
|
||||||
|
@ -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 |
|
@ -121,98 +121,8 @@ end
|
||||||
local node_stand, node_stand_below, node_head, node_feet, node_head_top
|
local node_stand, node_stand_below, node_head, node_feet, node_head_top
|
||||||
local is_swimming
|
local is_swimming
|
||||||
|
|
||||||
-- This following part is 2 wrapper functions for player:set_bones
|
local set_bone_position_conditional = mcl_util.set_bone_position
|
||||||
-- and player:set_properties preventing them from being resent on
|
local set_properties_conditional = mcl_util.set_properties
|
||||||
-- every globalstep when they have not changed.
|
|
||||||
|
|
||||||
local function roundN(n, d)
|
|
||||||
if type(n) ~= "number" then return n end
|
|
||||||
local m = 10^d
|
|
||||||
return math.floor(n * m + 0.5) / m
|
|
||||||
end
|
|
||||||
|
|
||||||
local function close_enough(a,b)
|
|
||||||
local rt=true
|
|
||||||
if type(a) == "table" and type(b) == "table" then
|
|
||||||
for k,v in pairs(a) do
|
|
||||||
if roundN(v,2) ~= roundN(b[k],2) then
|
|
||||||
rt=false
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
rt = roundN(a,2) == roundN(b,2)
|
|
||||||
end
|
|
||||||
return rt
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local function props_changed(props,oldprops)
|
|
||||||
local changed=false
|
|
||||||
local p={}
|
|
||||||
for k,v in pairs(props) do
|
|
||||||
if not close_enough(v,oldprops[k]) then
|
|
||||||
p[k]=v
|
|
||||||
changed=true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return changed,p
|
|
||||||
end
|
|
||||||
|
|
||||||
--tests for roundN
|
|
||||||
local test_round1=15
|
|
||||||
local test_round2=15.00199999999
|
|
||||||
local test_round3=15.00111111
|
|
||||||
local test_round4=15.00999999
|
|
||||||
|
|
||||||
assert(roundN(test_round1,2)==roundN(test_round1,2))
|
|
||||||
assert(roundN(test_round1,2)==roundN(test_round2,2))
|
|
||||||
assert(roundN(test_round1,2)==roundN(test_round3,2))
|
|
||||||
assert(roundN(test_round1,2)~=roundN(test_round4,2))
|
|
||||||
|
|
||||||
-- tests for close_enough
|
|
||||||
local test_cb = {-0.35,0,-0.35,0.35,0.8,0.35} --collisionboxes
|
|
||||||
local test_cb_close = {-0.351213,0,-0.35,0.35,0.8,0.351212}
|
|
||||||
local test_cb_diff = {-0.35,0,-1.35,0.35,0.8,0.35}
|
|
||||||
|
|
||||||
local test_eh = 1.65 --eye height
|
|
||||||
local test_eh_close = 1.65123123
|
|
||||||
local test_eh_diff = 1.35
|
|
||||||
|
|
||||||
local test_nt = { r = 225, b = 225, a = 225, g = 225 } --nametag
|
|
||||||
local test_nt_diff = { r = 225, b = 225, a = 0, g = 225 }
|
|
||||||
|
|
||||||
assert(close_enough(test_cb,test_cb_close))
|
|
||||||
assert(not close_enough(test_cb,test_cb_diff))
|
|
||||||
assert(close_enough(test_eh,test_eh_close))
|
|
||||||
assert(not close_enough(test_eh,test_eh_diff))
|
|
||||||
assert(not close_enough(test_nt,test_nt_diff)) --no floats involved here
|
|
||||||
|
|
||||||
--tests for properties_changed
|
|
||||||
local test_properties_set1={collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 0.65, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}
|
|
||||||
local test_properties_set2={collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}
|
|
||||||
|
|
||||||
local test_p1,_=props_changed(test_properties_set1,test_properties_set1)
|
|
||||||
local test_p2,_=props_changed(test_properties_set1,test_properties_set2)
|
|
||||||
|
|
||||||
assert(not test_p1)
|
|
||||||
assert(test_p2)
|
|
||||||
|
|
||||||
local function set_properties_conditional(player,props)
|
|
||||||
local changed,p=props_changed(props,player:get_properties())
|
|
||||||
if changed then
|
|
||||||
player:set_properties(p)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function set_bone_position_conditional(player,b,p,r) --bone,position,rotation
|
|
||||||
local oldp,oldr=player:get_bone_position(b)
|
|
||||||
if vector.equals(vector.round(oldp),vector.round(p)) and vector.equals(vector.round(oldr),vector.round(r)) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
player:set_bone_position(b,p,r)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function get_overall_velocity(vector)
|
local function get_overall_velocity(vector)
|
||||||
local v = math.sqrt(vector.x^2 + vector.y^2 + vector.z^2)
|
local v = math.sqrt(vector.x^2 + vector.y^2 + vector.z^2)
|
||||||
|
@ -695,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}
|
||||||
|
|