add forcefields, size is 31k, can be configured.
This commit is contained in:
parent
4cdaa052ae
commit
c2d57c6cb4
53
mods/mapgen/forcefields.lua
Normal file
53
mods/mapgen/forcefields.lua
Normal file
@ -0,0 +1,53 @@
|
||||
--forcefields, used to limit the world size. Once the walls have been assembled you can disable the mod by commenting out line 13 for mapgen/init.lua
|
||||
|
||||
-- configure world size here - max = 30000, min = 32 (can be smaller, spawn might be outside of area.)
|
||||
|
||||
-- note: default settings are 31000
|
||||
|
||||
-- Warning: you will have to set all six dimensions.
|
||||
|
||||
x_pos_position = 31000
|
||||
x_nega_position = -31000
|
||||
|
||||
y_pos_position = 31000
|
||||
y_nega_position = -31000
|
||||
|
||||
z_pos_position = 31000
|
||||
z_nega_position = -31000
|
||||
|
||||
minetest.register_node("mapgen:force_field", {
|
||||
description = "Alien Forcefield",
|
||||
tiles = {"mapgen_force.png"},
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
drawtype = "glasslike",
|
||||
inventory_image = minetest.inventorycube("mapgen_force_inv_wield.png"),
|
||||
wield_image = minetest.inventorycube("mapgen_force_inv_wield.png"),
|
||||
is_ground_content = true,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
-- sorry, inefficient code - can't do any better yet. not unless a contributor wants to improve it.
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"air"},
|
||||
interval = 2,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if x_nega_position == pos.x then
|
||||
minetest.set_node(pos, {name="mapgen:force_field"})
|
||||
elseif x_pos_position == pos.x then
|
||||
minetest.set_node(pos, {name="mapgen:force_field"})
|
||||
elseif y_nega_position == pos.y then
|
||||
minetest.set_node(pos, {name="mapgen:force_field"})
|
||||
elseif y_pos_position == pos.y then
|
||||
minetest.set_node(pos, {name="mapgen:force_field"})
|
||||
elseif z_nega_position == pos.z then
|
||||
minetest.set_node(pos, {name="mapgen:force_field"})
|
||||
elseif z_pos_position == pos.z then
|
||||
minetest.set_node(pos, {name="mapgen:force_field"})
|
||||
else
|
||||
--no forcefields constructed.
|
||||
end
|
||||
end,
|
||||
})
|
@ -9,6 +9,9 @@ dofile(minetest.get_modpath("mapgen").."/nodes.lua")
|
||||
dofile(minetest.get_modpath("mapgen").."/flowers.lua")
|
||||
dofile(minetest.get_modpath("mapgen").."/functions.lua")
|
||||
|
||||
-- enable forcefields (useful for server admins
|
||||
dofile(minetest.get_modpath("mapgen").."/forcefields.lua")
|
||||
|
||||
minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
|
||||
minetest.register_alias("mapgen_water_source", "mapgen:water_source")
|
||||
minetest.register_alias("mapgen_lava_source", "mapgen:lava_source")
|
||||
@ -860,18 +863,4 @@ minetest.register_node(":base:leaves", {
|
||||
drop = 'mapgen:dirt',
|
||||
groups = {crumbly=3, soil=1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mapgen:force_field", {
|
||||
description = "Alien Forcefield",
|
||||
tiles = {
|
||||
{name="mapgen_force.png", animation={type="vertical_frames", aspect_w=128, aspect_h=128, length=1.5}},
|
||||
},
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
drawtype = "glasslike",
|
||||
inventory_image = minetest.inventorycube("mapgen_force_inv_wield.png"),
|
||||
wield_image = minetest.inventorycube("mapgen_force_inv_wield.png"),
|
||||
is_ground_content = true,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
Binary file not shown.
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 188 B |
Loading…
x
Reference in New Issue
Block a user