Localize some global vars
parent
4bb230110b
commit
c63bdc613a
|
@ -4,12 +4,6 @@
|
|||
|
||||
-- The API documentation in here was moved into doc/lua_api.txt
|
||||
|
||||
|
||||
WATER_ALPHA = 160
|
||||
WATER_VISC = 1
|
||||
LAVA_VISC = 7
|
||||
LIGHT_MAX = minetest.LIGHT_MAX - 1
|
||||
|
||||
-- Definitions made by this mod that other mods can use too
|
||||
default = {}
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
-- mods/default/nodes.lua
|
||||
|
||||
local WATER_ALPHA = 160
|
||||
local WATER_VISC = 1
|
||||
local LAVA_VISC = 7
|
||||
local LIGHT_MAX = minetest.LIGHT_MAX - 1
|
||||
|
||||
minetest.register_node("default:stone", {
|
||||
description = "Stone",
|
||||
|
|
|
@ -43,7 +43,7 @@ minetest.register_node("glowcrystals:glowcrystal_torch", {
|
|||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
light_source = LIGHT_MAX-1,
|
||||
light_source = minetest.LIGHT_MAX-1,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1},
|
||||
|
|
|
@ -166,7 +166,7 @@ end
|
|||
|
||||
if minetest.settings:get("enable_item_pickup") == "true" then
|
||||
local tickets = 0 -- XXX: oy vey
|
||||
moveDelay = 0
|
||||
local moveDelay = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
-- it's much more efficient to just restart... no way to unregister_globalstep right?
|
||||
if not minetest.settings:get("enable_item_pickup") then return end
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
-- 1 = there is one; 0 = there is none
|
||||
-- y always means y+
|
||||
|
||||
box_center = {-1/16, -.5, -1/16, 1/16, -.5+1/16, 1/16}
|
||||
box_bump1 = { -2/16, -8/16, -2/16, 2/16, -13/32, 2/16 }
|
||||
local box_center = {-1/16, -.5, -1/16, 1/16, -.5+1/16, 1/16}
|
||||
local box_bump1 = { -2/16, -8/16, -2/16, 2/16, -13/32, 2/16 }
|
||||
|
||||
box_xp = {1/16, -.5, -1/16, 8/16, -.5+1/16, 1/16}
|
||||
box_zp = {-1/16, -.5, 1/16, 1/16, -.5+1/16, 8/16}
|
||||
box_xm = {-8/16, -.5, -1/16, -1/16, -.5+1/16, 1/16}
|
||||
box_zm = {-1/16, -.5, -8/16, 1/16, -.5+1/16, -1/16}
|
||||
local box_xp = {1/16, -.5, -1/16, 8/16, -.5+1/16, 1/16}
|
||||
local box_zp = {-1/16, -.5, 1/16, 1/16, -.5+1/16, 8/16}
|
||||
local box_xm = {-8/16, -.5, -1/16, -1/16, -.5+1/16, 1/16}
|
||||
local box_zm = {-1/16, -.5, -8/16, 1/16, -.5+1/16, -1/16}
|
||||
|
||||
box_xpy = {.5-1/16, -.5+1/16, -1/16, .5, .4999+1/16, 1/16}
|
||||
box_zpy = {-1/16, -.5+1/16, .5-1/16, 1/16, .4999+1/16, .5}
|
||||
box_xmy = {-.5, -.5+1/16, -1/16, -.5+1/16, .4999+1/16, 1/16}
|
||||
box_zmy = {-1/16, -.5+1/16, -.5, 1/16, .4999+1/16, -.5+1/16}
|
||||
local box_xpy = {.5-1/16, -.5+1/16, -1/16, .5, .4999+1/16, 1/16}
|
||||
local box_zpy = {-1/16, -.5+1/16, .5-1/16, 1/16, .4999+1/16, .5}
|
||||
local box_xmy = {-.5, -.5+1/16, -1/16, -.5+1/16, .4999+1/16, 1/16}
|
||||
local box_zmy = {-1/16, -.5+1/16, -.5, 1/16, .4999+1/16, -.5+1/16}
|
||||
|
||||
-- Registering the wires
|
||||
|
||||
|
@ -33,6 +33,7 @@ for zmy=0, 1 do
|
|||
local nodeid = tostring(xp )..tostring(zp )..tostring(xm )..tostring(zm )..
|
||||
tostring(xpy)..tostring(zpy)..tostring(xmy)..tostring(zmy)
|
||||
|
||||
local wiredesc
|
||||
if nodeid == "00000000" then
|
||||
groups = {dig_immediate = 3, mesecon_conductor_craftable=1}
|
||||
wiredesc = "Mesecon"
|
||||
|
|
|
@ -52,7 +52,7 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_on", {
|
|||
walkable = false,
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1, mesecon=2},
|
||||
drop="mesecons_blinkyplant:blinky_plant_off 1",
|
||||
light_source = LIGHT_MAX-7,
|
||||
light_source = minetest.LIGHT_MAX-7,
|
||||
description = "Blinky Plant",
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
|
|
|
@ -67,7 +67,7 @@ minetest.register_node("mesecons_button:button_on", {
|
|||
paramtype2 = "facedir",
|
||||
legacy_wallmounted = true,
|
||||
walkable = false,
|
||||
light_source = LIGHT_MAX-7,
|
||||
light_source = minetest.LIGHT_MAX-7,
|
||||
sunlight_propagates = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
|
|
|
@ -47,7 +47,7 @@ elseif i == 2 then delaytime = 0.3
|
|||
elseif i == 3 then delaytime = 0.5
|
||||
elseif i == 4 then delaytime = 1.0 end
|
||||
|
||||
boxes = {{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab
|
||||
local boxes = {{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab
|
||||
|
||||
{ -2/16, -7/16, -4/16, 2/16, -26/64, -3/16 }, -- the jeweled "on" indicator
|
||||
{ -3/16, -7/16, -3/16, 3/16, -26/64, -2/16 },
|
||||
|
|
|
@ -31,7 +31,7 @@ function mesecon:lightstone_add(name, base_item, texture_off, texture_on, desc)
|
|||
tiles = {texture_on},
|
||||
groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
|
||||
drop = "mesecons_lightstone:lightstone_" .. name .. "_off",
|
||||
light_source = LIGHT_MAX-2,
|
||||
light_source = minetest.LIGHT_MAX-2,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
mesecons = {effector = {
|
||||
rules = lightstone_rules,
|
||||
|
|
|
@ -9,7 +9,7 @@ minetest.register_node("mesecons_powerplant:power_plant", {
|
|||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = {dig_immediate=3, mesecon = 2},
|
||||
light_source = LIGHT_MAX-9,
|
||||
light_source = minetest.LIGHT_MAX-9,
|
||||
description="Power Plant",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
|
|
|
@ -76,7 +76,7 @@ minetest.register_node("mesecons_torch:mesecon_torch_on", {
|
|||
paramtype2 = "wallmounted",
|
||||
selection_box = torch_selectionbox,
|
||||
groups = {dig_immediate=3},
|
||||
light_source = LIGHT_MAX-5,
|
||||
light_source = minetest.LIGHT_MAX-5,
|
||||
description="Mesecon Torch",
|
||||
mesecons = {receptor = {
|
||||
state = mesecon.state.on,
|
||||
|
|
|
@ -57,7 +57,7 @@ minetest.register_node("mesecons_walllever:wall_lever_on", {
|
|||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
light_source = LIGHT_MAX-7,
|
||||
light_source = minetest.LIGHT_MAX-7,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -8/16, -8/16, 3/16, 8/16, 8/16, 8/16 },
|
||||
|
|
|
@ -10,7 +10,7 @@ local conv = function(pos)
|
|||
end
|
||||
end
|
||||
|
||||
cotrig = function(pos)
|
||||
local cotrig = function(pos)
|
||||
for dx=-4,4 do
|
||||
for dz=-4,4 do
|
||||
for dy=1,-1,-1 do
|
||||
|
|
Loading…
Reference in New Issue