minetest-mods / saveschems Goto Github PK
View Code? Open in Web Editor NEWCreate MTS format schematics used by minetest mapgen decoration code.
License: Other
Create MTS format schematics used by minetest mapgen decoration code.
License: Other
The minetest_game schematics were changed and those changes not merged back in here:
Binary files schematics/acacia_tree.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/acacia_tree.mts differ
Binary files schematics/apple_tree.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/apple_tree.mts differ
Binary files schematics/apple_tree_from_sapling.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/apple_tree_from_sapling.mts differ
Binary files schematics/jungle_tree.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/jungle_tree.mts differ
Binary files schematics/large_cactus.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/large_cactus.mts differ
Binary files schematics/papyrus.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/papyrus.mts differ
Binary files schematics/pine_tree.mts and /home/sofar/.minetest/games/minetest/mods/default/schematics/pine_tree.mts differ
We need to see if we can find the modified schematics so this repo will have the correct and used minetest_game tree models again.
I can work on this if desired as an additional function for use with future lua tables, it works.
I will call the function 'mts_save_rev' since it reverses the lua table.
local mts_convert = function(name, schematic)
-- Reverse data table
local datarev = {}
local datasize = #schematic.data
for i = 1, datasize do
datarev[i] = schematic.data[datasize + 1 - i]
end
schematic.data = datarev
local s = minetest.serialize_schematic(schematic, "mts", {})
local path = minetest.get_modpath("saveschems") .. "/schematics"
local filename = path .. "/" .. name .. ".mts"
filename = filename:gsub("\"", "\\\""):gsub("\\", "\\\\")
local file, err = io.open(filename, "wb")
if err == nil then
file:write(s)
file:flush()
file:close()
end
print("Wrote: " .. filename)
end
Tested tiny pine:
local L = {name = "default:pine_needles", prob = 255}
local T = {name = "default:pine_tree", prob = 255, force_place = true}
mts_convert("tiny_pine", {
size = {x = 3, y = 4, z = 3},
data = {
_, _, _,
L, L, L,
_, _, _,
_, _, _,
_, L, _,
L, T, L,
_, T, _,
_, T, _,
_, _, _,
L, L, L,
_, _, _,
_, _, _,
},
})
The repo now misses a schematics folder, obviously due to the new gitignore, however this means the mod doesn't work as-is, it needs a folder named 'schematics' adding. This may confuse users. Maybe add a comment about this somewhere? Or is there a way to have the folder present but empty?
Maybe even include the actual schematics in the folder, they're small files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.