mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-17 16:41:06 +01:00
Save axolotl properties in item meta on bucket pickup
This commit is contained in:
parent
67e8f13a96
commit
665e8a06a2
1 changed files with 8 additions and 3 deletions
|
@ -84,8 +84,13 @@ local axolotl = {
|
||||||
|
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then
|
if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then
|
||||||
|
if clicker:set_wielded_item("mcl_buckets:bucket_axolotl") then
|
||||||
|
local it = clicker:get_wielded_item()
|
||||||
|
local m = it:get_meta()
|
||||||
|
m:set_string("properties",minetest.serialize(self.object:get_properties()))
|
||||||
|
clicker:set_wielded_item(it)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
clicker:set_wielded_item("mcl_buckets:bucket_axolotl")
|
end
|
||||||
awards.unlock(clicker:get_player_name(), "mcl:cutestPredator")
|
awards.unlock(clicker:get_player_name(), "mcl:cutestPredator")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -132,7 +137,7 @@ local axolotl = {
|
||||||
self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0})
|
self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
mcl_mobs:register_mob("mobs_mc:axolotl", axolotl)
|
mcl_mobs:register_mob("mobs_mc:axolotl", axolotl)
|
||||||
|
|
Loading…
Reference in a new issue