Skip to content

Commit

Permalink
Use initial_properties for entities (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklp09 authored Jul 3, 2024
1 parent d0ab9b8 commit 1ef4837
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 7 additions & 5 deletions homedecor_climate_control/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ homedecor.register("air_conditioner", {
-- fans

minetest.register_entity(":homedecor:mesh_desk_fan", {
collisionbox = homedecor.nodebox.null,
visual = "mesh",
mesh = "homedecor_desk_fan.b3d",
textures = {"homedecor_desk_fan_uv.png"},
visual_size = {x=10, y=10},
initial_properties = {
collisionbox = homedecor.nodebox.null,
visual = "mesh",
mesh = "homedecor_desk_fan.b3d",
textures = {"homedecor_desk_fan_uv.png"},
visual_size = {x=10, y=10},
}
})

local add_mesh_desk_fan_entity = function(pos)
Expand Down
14 changes: 8 additions & 6 deletions itemframes/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ local tmp = {}
local sd_disallow = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil

minetest.register_entity("itemframes:item",{
hp_max = 1,
visual="wielditem",
visual_size={x = 0.33, y = 0.33},
collisionbox = {0, 0, 0, 0, 0, 0},
physical = false,
textures = {"air"},
initial_properties = {
hp_max = 1,
visual = "wielditem",
visual_size = {x = 0.33, y = 0.33},
collisionbox = {0, 0, 0, 0, 0, 0},
physical = false,
textures = {"air"},
},
on_activate = function(self, staticdata)
if tmp.nodename ~= nil and tmp.texture ~= nil then
self.nodename = tmp.nodename
Expand Down

0 comments on commit 1ef4837

Please sign in to comment.