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
minetest.register_entity("mobs_mc:ender_eyes", {
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
visual_size = {x=1.01/3, y=1.01/3},
textures = {
"mobs_mc_enderman_eyes.png",
initial_properties = {
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
visual_size = {x=1.01/3, y=1.01/3},
textures = {
"mobs_mc_enderman_eyes.png",
},
},
on_step = function(self)
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)
minetest.register_entity("mobs_mc:spider_eyes", {
pointable = false,
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
visual_size = {x=1.01/3, y=1.01/3},
textures = {
"mobs_mc_spider_eyes.png",
initial_properties = {
pointable = false,
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
visual_size = {x=1.01/3, y=1.01/3},
textures = {
"mobs_mc_spider_eyes.png",
},
},
on_step = function(self)
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"])
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
oban_def.on_step = function(self,dtime)
if not self.object:get_attach() then return self.object:remove() end

View File

@ -613,13 +613,15 @@ end
-- Banner entities.
local entity_standing = {
physical = false,
collide_with_objects = false,
visual = "mesh",
mesh = "amc_banner.b3d",
visual_size = { x=2.499, y=2.499 },
textures = {mcl_banners.make_banner_texture()},
pointable = false,
initial_properties = {
physical = false,
collide_with_objects = false,
visual = "mesh",
mesh = "amc_banner.b3d",
visual_size = { x=2.499, y=2.499 },
textures = {mcl_banners.make_banner_texture()},
pointable = false,
},
_base_color = nil, -- base color of banner
_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)
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)
-- FIXME: Prevent entity destruction by /clearobjects
@ -682,4 +684,3 @@ minetest.register_craft({
recipe = "group:banner",
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={
physical = true,
pointable = false,
visual = "mesh",
mesh = "mcl_bows_arrow.obj",
visual_size = {x=-1, y=1},
textures = {"mcl_bows_arrow.png"},
collisionbox = {-0.19, -0.125, -0.19, 0.19, 0.125, 0.19},
collide_with_objects = false,
initial_properties = {
physical = true,
pointable = false,
visual = "mesh",
mesh = "mcl_bows_arrow.obj",
visual_size = {x=-1, y=1},
textures = {"mcl_bows_arrow.png"},
collisionbox = {-0.19, -0.125, -0.19, 0.19, 0.125, 0.19},
collide_with_objects = false,
},
_fire_damage_resistant = true,
_lastpos={},

View File

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

View File

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

View File

@ -28,11 +28,13 @@ end)
-- This defines the text entity for the lettering of the sign.
-- FIXME: Prevent entity destruction by /clearobjects
minetest.register_entity("mcl_signs:text", {
initial_properties = {
pointable = false,
visual = "upright_sprite",
textures = {},
physical = false,
collide_with_objects = false,
},
_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)
mcl_signs.standing_standard = {
paramtype = "light",
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
sunlight_propagates = true,
walkable = false,
is_ground_content = false,
paramtype2 = "facedir",
drawtype = "mesh",
mesh = "mcl_signs_sign.obj",
selection_box = { type = "fixed", fixed = { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } },
tiles = { "mcl_signs_sign.png" },
groups = mcl_signs.sign_groups,
drop = "mcl_signs:wall_sign",
stack_max = 16,
sounds = node_sounds,
initial_properties = {
paramtype = "light",
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
sunlight_propagates = true,
walkable = false,
is_ground_content = false,
paramtype2 = "facedir",
drawtype = "mesh",
mesh = "mcl_signs_sign.obj",
selection_box = { type = "fixed", fixed = { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } },
tiles = { "mcl_signs_sign.png" },
groups = mcl_signs.sign_groups,
drop = "mcl_signs:wall_sign",
stack_max = 16,
sounds = node_sounds,
},
on_destruct = function(pos)
mcl_signs:destruct_sign(pos)

View File

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

View File

@ -115,23 +115,25 @@ minetest.register_node("mcl_tnt:tnt", {
local TNT = {
-- Static definition
physical = true, -- Collides with things
--weight = -100,
collisionbox = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
visual = "cube",
textures = {
"default_tnt_top.png",
"default_tnt_bottom.png",
"default_tnt_side.png",
"default_tnt_side.png",
"default_tnt_side.png",
"default_tnt_side.png",
initial_properties = {
physical = true, -- Collides with things
--weight = -100,
collisionbox = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
visual = "cube",
textures = {
"default_tnt_top.png",
"default_tnt_bottom.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(_, _)