Charakterbewegungen hinzugefügt, Deko hinzugefügt, Kochrezepte angepasst
This commit is contained in:
parent
95945c0306
commit
a0c893ca0b
1124 changed files with 64294 additions and 763 deletions
42
mods/emote/entity.lua
Normal file
42
mods/emote/entity.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
|
||||
-- entity for locked emotes (attached to nodes, etc)
|
||||
local attacher = {
|
||||
description = "Attachment entity for emotes",
|
||||
physical = false,
|
||||
visual = "upright_sprite",
|
||||
visual_size = {x = 1/16, y = 1/16},
|
||||
spritediv = {x = 1/16, y = 1/16},
|
||||
collisionbox = {-1/16, -1/16, -1/16, 1/16, 1/16, 1/16},
|
||||
textures = {"emote_blank.png"},
|
||||
static_save = false,
|
||||
init = function(self, player)
|
||||
self.player = player
|
||||
end,
|
||||
}
|
||||
|
||||
function attacher:on_step()
|
||||
if not minetest.is_player(self.player) then
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
|
||||
local ctrl = self.player:get_player_control()
|
||||
if ctrl and ctrl.jump then
|
||||
self:detach()
|
||||
end
|
||||
end
|
||||
|
||||
function attacher:detach()
|
||||
emote.attached[self.player] = nil
|
||||
|
||||
if not minetest.is_player(self.player) then
|
||||
return
|
||||
end
|
||||
|
||||
self.player:set_detach()
|
||||
self.object:remove()
|
||||
|
||||
emote.stop(self.player)
|
||||
end
|
||||
|
||||
minetest.register_entity("emote:attacher", attacher)
|
Loading…
Add table
Add a link
Reference in a new issue