Created
September 24, 2015 17:16
-
-
Save HybridDog/b5133043c1a97a67cf56 to your computer and use it in GitHub Desktop.
tnt mapgen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local c_air = minetest.get_content_id("air") | |
local c_tnt = minetest.get_content_id("tnt:tnt") | |
minetest.register_on_generated(function(minp, maxp) | |
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") | |
local data = vm:get_data() | |
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax} | |
for i in area:iterp(minp, maxp) do | |
if data[i] ~= c_air then | |
data[i] = c_tnt | |
end | |
end | |
vm:set_data(data) | |
vm:write_to_map() | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put that into a mod folder, call it init.lua, add a depends.txt to the folder and write tnt into it.