0
0
Fork 0

Added more entity's properties into initial_properties table.

This commit is contained in:
James Clarke 2024-01-15 03:19:08 +00:00 committed by James Clarke
parent 3cf8655b4e
commit a05a52c217
11 changed files with 120 additions and 96 deletions

View File

@ -31,11 +31,13 @@ local place_frequency_min = 235
local place_frequency_max = 245 local place_frequency_max = 245
minetest.register_entity("mobs_mc:ender_eyes", { minetest.register_entity("mobs_mc:ender_eyes", {
visual = "mesh", initial_properties = {
mesh = "mobs_mc_spider.b3d", visual = "mesh",
visual_size = {x=1.01/3, y=1.01/3}, mesh = "mobs_mc_spider.b3d",
textures = { visual_size = {x=1.01/3, y=1.01/3},
"mobs_mc_enderman_eyes.png", textures = {
"mobs_mc_enderman_eyes.png",
},
}, },
on_step = function(self) on_step = function(self)
if self and self.object then if self and self.object then

View File

@ -12,12 +12,14 @@ local S = minetest.get_translator("mobs_mc")
-- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture) -- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture)
minetest.register_entity("mobs_mc:spider_eyes", { minetest.register_entity("mobs_mc:spider_eyes", {
pointable = false, initial_properties = {
visual = "mesh", pointable = false,
mesh = "mobs_mc_spider.b3d", visual = "mesh",
visual_size = {x=1.01/3, y=1.01/3}, mesh = "mobs_mc_spider.b3d",
textures = { visual_size = {x=1.01/3, y=1.01/3},
"mobs_mc_spider_eyes.png", textures = {
"mobs_mc_spider_eyes.png",
},
}, },
on_step = function(self) on_step = function(self)
if self and self.object then if self and self.object then

View File

@ -72,7 +72,7 @@ local oban_layers = {
local oban_def = table.copy(minetest.registered_entities["mcl_banners:standing_banner"]) local oban_def = table.copy(minetest.registered_entities["mcl_banners:standing_banner"])
oban_def.visual_size = { x=1, y=1 } oban_def.initial_properties.visual_size = { x=1, y=1 }
local old_step = oban_def.on_step local old_step = oban_def.on_step
oban_def.on_step = function(self,dtime) oban_def.on_step = function(self,dtime)
if not self.object:get_attach() then return self.object:remove() end if not self.object:get_attach() then return self.object:remove() end

View File

@ -613,13 +613,15 @@ end
-- Banner entities. -- Banner entities.
local entity_standing = { local entity_standing = {
physical = false, initial_properties = {
collide_with_objects = false, physical = false,
visual = "mesh", collide_with_objects = false,
mesh = "amc_banner.b3d", visual = "mesh",
visual_size = { x=2.499, y=2.499 }, mesh = "amc_banner.b3d",
textures = {mcl_banners.make_banner_texture()}, visual_size = { x=2.499, y=2.499 },
pointable = false, textures = {mcl_banners.make_banner_texture()},
pointable = false,
},
_base_color = nil, -- base color of banner _base_color = nil, -- base color of banner
_layers = nil, -- table of layers painted over the base color. _layers = nil, -- table of layers painted over the base color.
@ -663,7 +665,7 @@ local entity_standing = {
minetest.register_entity("mcl_banners:standing_banner", entity_standing) minetest.register_entity("mcl_banners:standing_banner", entity_standing)
local entity_hanging = table.copy(entity_standing) local entity_hanging = table.copy(entity_standing)
entity_hanging.mesh = "amc_banner_hanging.b3d" entity_hanging.initial_properties.mesh = "amc_banner_hanging.b3d"
minetest.register_entity("mcl_banners:hanging_banner", entity_hanging) minetest.register_entity("mcl_banners:hanging_banner", entity_hanging)
-- FIXME: Prevent entity destruction by /clearobjects -- FIXME: Prevent entity destruction by /clearobjects
@ -682,4 +684,3 @@ minetest.register_craft({
recipe = "group:banner", recipe = "group:banner",
burntime = 15, burntime = 15,
}) })

View File

@ -57,14 +57,16 @@ S("Arrows might get stuck on solid blocks and can be retrieved again. They are a
}) })
local ARROW_ENTITY={ local ARROW_ENTITY={
physical = true, initial_properties = {
pointable = false, physical = true,
visual = "mesh", pointable = false,
mesh = "mcl_bows_arrow.obj", visual = "mesh",
visual_size = {x=-1, y=1}, mesh = "mcl_bows_arrow.obj",
textures = {"mcl_bows_arrow.png"}, visual_size = {x=-1, y=1},
collisionbox = {-0.19, -0.125, -0.19, 0.19, 0.125, 0.19}, textures = {"mcl_bows_arrow.png"},
collide_with_objects = false, collisionbox = {-0.19, -0.125, -0.19, 0.19, 0.125, 0.19},
collide_with_objects = false,
},
_fire_damage_resistant = true, _fire_damage_resistant = true,
_lastpos={}, _lastpos={},

View File

@ -2,12 +2,13 @@
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
minetest.register_entity("mcl_end:ender_eye", { minetest.register_entity("mcl_end:ender_eye", {
physical = false, initial_properties = {
textures = {"mcl_end_ender_eye.png"}, physical = false,
visual_size = {x=1.5, y=1.5}, textures = {"mcl_end_ender_eye.png"},
collisionbox = {0,0,0,0,0,0}, visual_size = {x=1.5, y=1.5},
pointable = false, collisionbox = {0,0,0,0,0,0},
pointable = false,
},
-- Save and restore age -- Save and restore age
get_staticdata = function(self) get_staticdata = function(self)
return tostring(self._age) return tostring(self._age)

View File

@ -3,13 +3,15 @@
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local bobber_ENTITY={ local bobber_ENTITY={
physical = false, initial_properties = {
timer=0, physical = false,
textures = {"mcl_fishing_bobber.png"}, timer=0,
visual_size = {x=0.5, y=0.5}, textures = {"mcl_fishing_bobber.png"},
collisionbox = {0.45,0.45,0.45,0.45,0.45,0.45}, visual_size = {x=0.5, y=0.5},
pointable = false, collisionbox = {0.45,0.45,0.45,0.45,0.45,0.45},
static_save = false, pointable = false,
static_save = false,
},
_lastpos={}, _lastpos={},
_dive = false, _dive = false,
@ -308,12 +310,14 @@ bobber_ENTITY.on_step = bobber_on_step
minetest.register_entity("mcl_fishing:bobber_entity", bobber_ENTITY) minetest.register_entity("mcl_fishing:bobber_entity", bobber_ENTITY)
local flying_bobber_ENTITY={ local flying_bobber_ENTITY={
physical = false, initial_properties = {
timer=0, physical = false,
textures = {"mcl_fishing_bobber.png"}, --FIXME: Replace with correct texture. timer=0,
visual_size = {x=0.5, y=0.5}, textures = {"mcl_fishing_bobber.png"}, --FIXME: Replace with correct texture.
collisionbox = {0,0,0,0,0,0}, visual_size = {x=0.5, y=0.5},
pointable = false, collisionbox = {0,0,0,0,0,0},
pointable = false,
},
get_staticdata = mcl_throwing.get_staticdata, get_staticdata = mcl_throwing.get_staticdata,
on_activate = mcl_throwing.on_activate, on_activate = mcl_throwing.on_activate,

View File

@ -28,11 +28,13 @@ end)
-- This defines the text entity for the lettering of the sign. -- This defines the text entity for the lettering of the sign.
-- FIXME: Prevent entity destruction by /clearobjects -- FIXME: Prevent entity destruction by /clearobjects
minetest.register_entity("mcl_signs:text", { minetest.register_entity("mcl_signs:text", {
initial_properties = {
pointable = false, pointable = false,
visual = "upright_sprite", visual = "upright_sprite",
textures = {}, textures = {},
physical = false, physical = false,
collide_with_objects = false, collide_with_objects = false,
},
_signnodename = nil, -- node name of sign node to which the text belongs _signnodename = nil, -- node name of sign node to which the text belongs

View File

@ -362,20 +362,22 @@ mcl_signs.wall_standard = {
} }
-- standing sign base (definition) -- standing sign base (definition)
mcl_signs.standing_standard = { mcl_signs.standing_standard = {
paramtype = "light", initial_properties = {
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, paramtype = "light",
sunlight_propagates = true, use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
walkable = false, sunlight_propagates = true,
is_ground_content = false, walkable = false,
paramtype2 = "facedir", is_ground_content = false,
drawtype = "mesh", paramtype2 = "facedir",
mesh = "mcl_signs_sign.obj", drawtype = "mesh",
selection_box = { type = "fixed", fixed = { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } }, mesh = "mcl_signs_sign.obj",
tiles = { "mcl_signs_sign.png" }, selection_box = { type = "fixed", fixed = { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } },
groups = mcl_signs.sign_groups, tiles = { "mcl_signs_sign.png" },
drop = "mcl_signs:wall_sign", groups = mcl_signs.sign_groups,
stack_max = 16, drop = "mcl_signs:wall_sign",
sounds = node_sounds, stack_max = 16,
sounds = node_sounds,
},
on_destruct = function(pos) on_destruct = function(pos)
mcl_signs:destruct_sign(pos) mcl_signs:destruct_sign(pos)

View File

@ -7,12 +7,14 @@ local mod_target = minetest.get_modpath("mcl_target")
-- The snowball entity -- The snowball entity
local snowball_ENTITY={ local snowball_ENTITY={
physical = false, initial_properties = {
timer=0, physical = false,
textures = {"mcl_throwing_snowball.png"}, timer=0,
visual_size = {x=0.5, y=0.5}, textures = {"mcl_throwing_snowball.png"},
collisionbox = {0,0,0,0,0,0}, visual_size = {x=0.5, y=0.5},
pointable = false, collisionbox = {0,0,0,0,0,0},
pointable = false,
},
get_staticdata = mcl_throwing.get_staticdata, get_staticdata = mcl_throwing.get_staticdata,
on_activate = mcl_throwing.on_activate, on_activate = mcl_throwing.on_activate,
@ -22,12 +24,14 @@ local snowball_ENTITY={
} }
local egg_ENTITY={ local egg_ENTITY={
physical = false, initial_properties = {
timer=0, physical = false,
textures = {"mcl_throwing_egg.png"}, timer=0,
visual_size = {x=0.45, y=0.45}, textures = {"mcl_throwing_egg.png"},
collisionbox = {0,0,0,0,0,0}, visual_size = {x=0.45, y=0.45},
pointable = false, collisionbox = {0,0,0,0,0,0},
pointable = false,
},
get_staticdata = mcl_throwing.get_staticdata, get_staticdata = mcl_throwing.get_staticdata,
on_activate = mcl_throwing.on_activate, on_activate = mcl_throwing.on_activate,
@ -38,12 +42,14 @@ local egg_ENTITY={
-- Ender pearl entity -- Ender pearl entity
local pearl_ENTITY={ local pearl_ENTITY={
physical = false, initial_properties = {
timer=0, physical = false,
textures = {"mcl_throwing_ender_pearl.png"}, timer=0,
visual_size = {x=0.9, y=0.9}, textures = {"mcl_throwing_ender_pearl.png"},
collisionbox = {0,0,0,0,0,0}, visual_size = {x=0.9, y=0.9},
pointable = false, collisionbox = {0,0,0,0,0,0},
pointable = false,
},
get_staticdata = mcl_throwing.get_staticdata, get_staticdata = mcl_throwing.get_staticdata,
on_activate = mcl_throwing.on_activate, on_activate = mcl_throwing.on_activate,

View File

@ -115,23 +115,25 @@ minetest.register_node("mcl_tnt:tnt", {
local TNT = { local TNT = {
-- Static definition -- Static definition
physical = true, -- Collides with things initial_properties = {
--weight = -100, physical = true, -- Collides with things
collisionbox = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }, --weight = -100,
visual = "cube", collisionbox = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
textures = { visual = "cube",
"default_tnt_top.png", textures = {
"default_tnt_bottom.png", "default_tnt_top.png",
"default_tnt_side.png", "default_tnt_bottom.png",
"default_tnt_side.png", "default_tnt_side.png",
"default_tnt_side.png", "default_tnt_side.png",
"default_tnt_side.png", "default_tnt_side.png",
"default_tnt_side.png",
},
-- Initial value for our timer
timer = 0,
blinktimer = 0,
tnt_knockback = true,
blinkstatus = true,
}, },
-- Initial value for our timer
timer = 0,
blinktimer = 0,
tnt_knockback = true,
blinkstatus = true,
} }
function TNT:on_activate(_, _) function TNT:on_activate(_, _)