steps = 8, -- How many steps the plant has to grow, until it can be harvested
^ Always provide a plant texture for ech step, format: modname_plantname_i.png (i = stepnumber)
minlight = 13, -- Minimum light to grow
- maxlight = LIGHT_MAX -- Maximum light to grow
+ maxlight = default.LIGHT_MAX -- Maximum light to grow
}
Stairs API
default.node_sound_leaves_defaults()
default.node_sound_glass_defaults()
+Default constants
+-----------------
+default.LIGHT_MAX
+^ The maximum light level (see [Node definition] light_source)
+
Player API
----------
The player API can register player models and update the player's appearence
-- Minetest 0.4 mod: default
-- See README.txt for licensing and other information.
--- The API documentation in here was moved into doc/lua_api.txt
-
-WATER_ALPHA = 160
-WATER_VISC = 1
-LAVA_VISC = 7
-LIGHT_MAX = 14
+-- The API documentation in here was moved into game_api.txt
-- Definitions made by this mod that other mods can use too
default = {}
+default.LIGHT_MAX = 14
+
-- GUI related stuff
default.gui_bg = "bgcolor[#080808BB;true]"
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
dofile(minetest.get_modpath("default").."/player.lua")
dofile(minetest.get_modpath("default").."/trees.lua")
dofile(minetest.get_modpath("default").."/aliases.lua")
+
+-- Legacy:
+WATER_ALPHA = minetest.registered_nodes["default:water_source"].alpha
+WATER_VISC = minetest.registered_nodes["default:water_source"].liquid_viscosity
+LAVA_VISC = minetest.registered_nodes["default:lava_source"].liquid_viscosity
+LIGHT_MAX = default.LIGHT_MAX
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
},
},
- alpha = WATER_ALPHA,
+ alpha = 160,
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
liquidtype = "flowing",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
- liquid_viscosity = WATER_VISC,
+ liquid_viscosity = 1,
post_effect_color = {a=64, r=100, g=100, b=200},
groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
})
backface_culling = false,
}
},
- alpha = WATER_ALPHA,
+ alpha = 160,
paramtype = "light",
walkable = false,
pointable = false,
liquidtype = "source",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
- liquid_viscosity = WATER_VISC,
+ liquid_viscosity = 1,
post_effect_color = {a=64, r=100, g=100, b=200},
groups = {water=3, liquid=3, puts_out_fire=1},
})
},
paramtype = "light",
paramtype2 = "flowingliquid",
- light_source = LIGHT_MAX - 1,
+ light_source = default.LIGHT_MAX - 1,
walkable = false,
pointable = false,
diggable = false,
liquidtype = "flowing",
liquid_alternative_flowing = "default:lava_flowing",
liquid_alternative_source = "default:lava_source",
- liquid_viscosity = LAVA_VISC,
+ liquid_viscosity = 7,
liquid_renewable = false,
damage_per_second = 4*2,
post_effect_color = {a=192, r=255, g=64, b=0},
}
},
paramtype = "light",
- light_source = LIGHT_MAX - 1,
+ light_source = default.LIGHT_MAX - 1,
walkable = false,
pointable = false,
diggable = false,
liquidtype = "source",
liquid_alternative_flowing = "default:lava_flowing",
liquid_alternative_source = "default:lava_source",
- liquid_viscosity = LAVA_VISC,
+ liquid_viscosity = 7,
liquid_renewable = false,
damage_per_second = 4*2,
post_effect_color = {a=192, r=255, g=64, b=0},
sunlight_propagates = true,
is_ground_content = false,
walkable = false,
- light_source = LIGHT_MAX-1,
+ light_source = default.LIGHT_MAX - 1,
selection_box = {
type = "wallmounted",
wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1},