1
0
mirror of git://repo.or.cz/minetest_schemedit.git synced 2025-07-05 09:30:22 +02:00

46 Commits
1.1.0 ... 1.4.1

Author SHA1 Message Date
ad6bf63f3b Version 1.4.1 2021-04-04 17:33:19 +02:00
433878a938 Add use_texture_alpha compability 2021-04-04 17:29:53 +02:00
e9ad4bcf00 Hide ypos field for slice editing 2021-04-04 17:23:59 +02:00
329f394499 Fix invalid slice_list on import 2021-04-04 17:10:02 +02:00
f0c5c2659f Prevent adding dupe slice definitions 2021-04-04 16:44:14 +02:00
cd808777c8 Update locale files 2021-04-04 16:35:42 +02:00
0240a09800 Tweak slice edit buttons 2021-04-04 16:35:19 +02:00
6f8a575786 Update locale files 2021-04-04 16:23:16 +02:00
cb1e33485e Remove symbols in slice buttons 2021-04-04 16:20:20 +02:00
8e0794217d Fix incorrect placement of prob stuff in import 2021-04-04 16:13:56 +02:00
b8e5c5cda7 Add use_texture_alpha="clip" for void 2021-04-02 23:20:09 +02:00
e19d5e0bfa Version 1.4.0 2020-06-03 16:31:47 +02:00
b6e4d2f7f0 Fix incorrect size importing 2020-06-03 16:31:03 +02:00
abfd913862 Replace deprecated get/set_attribute 2020-06-03 15:58:34 +02:00
01a3a970d2 Add buttons to convert air to void to air 2020-06-03 15:48:57 +02:00
e389fcc041 Fix text area being too large 2020-05-31 00:13:25 +02:00
05ca8d90be Version 1.3.0 2020-05-15 03:24:14 +02:00
84d6dc3c69 Update README 2020-05-15 03:23:58 +02:00
fedc4c51fa Require server priv 2020-05-15 03:12:19 +02:00
4199f645f3 Do more strict privilege checks 2020-05-15 03:11:50 +02:00
a639c2b9c0 Fix crash when opening new creator 2020-05-15 03:04:00 +02:00
7f279bbd7a Require new privilege to do stuff 2020-05-15 03:01:29 +02:00
54aa7f35df Localize DIR_DELIM 2020-05-15 02:51:21 +02:00
bbed49e365 Add Lua export feature 2020-05-15 02:48:22 +02:00
5cf551dccd Version 1.2.0 2020-05-15 01:46:31 +02:00
b8cbb66d83 Fix typo in readme and update it 2020-05-15 01:46:10 +02:00
a6cf015631 Remove the final TODO 2020-05-15 01:45:04 +02:00
5aba3aada8 Display current size and name 2020-05-15 01:44:48 +02:00
3c7c208dcb Tweak displayed path in formspec 2020-05-15 01:32:09 +02:00
0fc0180a04 Backwards-compat for versions w/o read_schematic 2020-05-15 01:26:49 +02:00
2c8e6fae3e Add me to credits 2020-05-15 01:22:11 +02:00
cdcda91fd6 Add help about importing 2020-05-15 01:21:45 +02:00
1d53577085 Get prob and force_place when importing schem 2020-05-15 01:09:27 +02:00
59cf898ddc Localize punchpos var 2020-05-14 23:05:24 +02:00
02acad209b Fix a waypoint-related crash 2020-05-14 23:04:40 +02:00
fee142eab2 Hide waypoint distance 2020-05-14 23:02:49 +02:00
9cb700327a Fix wrong data type for waypoint call 2020-05-14 23:01:35 +02:00
476f62c286 Require debug priv to import schematic 2020-05-14 22:43:45 +02:00
d7363f470d Rename button 2020-05-14 22:40:15 +02:00
713deec575 Easier name and size editing 2020-05-14 22:39:36 +02:00
442329d886 Disable MTG screwdriver 2020-05-14 22:27:21 +02:00
f4470596dc Also show upper and lower box boundaries 2020-05-14 22:12:02 +02:00
27c0c2764c Resize slice edit buttons 2020-05-14 21:52:30 +02:00
7797aa8de6 Add schematic import functionality 2020-05-14 21:47:30 +02:00
ab122a1692 Fix /placeschem ignoring file changes after subsequent loads 2020-05-14 20:34:09 +02:00
16950a773d Remove border entities more liberally 2019-10-25 01:47:58 +02:00
6 changed files with 463 additions and 100 deletions

View File

@ -1,5 +1,5 @@
MIT License MIT License
Copyright (c) 2017 Elijah Duffy Copyright (c) 2017-2020 Elijah Duffy and Wuzzy
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

View File

@ -1,23 +1,34 @@
# Schematic Editor [`schemedit`] # Schematic Editor [`schemedit`]
## Version ## Version
1.1.0 1.4.1
## Description ## Description
This is a mod which allows you to edit and export schematics (`.mts` files). This is a mod which allows you to edit and export schematics (`.mts` files).
It supports node porbabilities, forced node placement and slice probabilities. This mod works in Minetest 5.0.0 or later, but recommended is version 5.1.0
or later.
It supports node probabilities, forced node placement and slice probabilities.
It adds 3 items: It adds 3 items:
* Schematic Creator: Used to mark a region and export it as schematic * Schematic Creator: Used to mark a region and export or import it as schematic
* Schematic Void: Marks a position in a schematic which should not replace anything when placed as a schematic * Schematic Void: Marks a position in a schematic which should not replace anything when placed as a schematic
* Schematic Node Probability Tool: Set per-node probabilities and forced node placement * Schematic Node Probability Tool: Set per-node probabilities and forced node placement
It also adds the server command `placeschem` to place a schematic. Note: The import feature requires Minetest 5.1.0 or later.
It also adds these server commands:
* `placeschem` to place a schematic
* `mts2lua` to convert .mts files to .lua files (Lua code)
There's also a setting `schemedit_export_lua` to enable automatic export to .lua files.
## Usage help ## Usage help
Usage help can be found when you use the optional Help modpack (mods `doc` and `doc_items`). Usage help can be found when you use the optional Help modpack (mods `doc` and `doc_items`).
The “server” privilege is required for most features.
You should also refer to the Minetest Lua API documentation to understand more about schematics. You should also refer to the Minetest Lua API documentation to understand more about schematics.

458
init.lua
View File

@ -3,10 +3,8 @@ local F = minetest.formspec_escape
local schemedit = {} local schemedit = {}
-- Directory delimeter fallback (normally comes from builtin) local DIR_DELIM = "/"
if not DIR_DELIM then
DIR_DELIM = "/"
end
local export_path_full = table.concat({minetest.get_worldpath(), "schems"}, DIR_DELIM) local export_path_full = table.concat({minetest.get_worldpath(), "schems"}, DIR_DELIM)
-- truncated export path so the server directory structure is not exposed publicly -- truncated export path so the server directory structure is not exposed publicly
@ -15,6 +13,8 @@ local export_path_trunc = table.concat({S("<world path>"), "schems"}, DIR_DELIM)
local text_color = "#D79E9E" local text_color = "#D79E9E"
local text_color_number = 0xD79E9E local text_color_number = 0xD79E9E
local can_import = minetest.read_schematic ~= nil
schemedit.markers = {} schemedit.markers = {}
-- [local function] Renumber table -- [local function] Renumber table
@ -26,6 +26,38 @@ local function renumber(t)
return res return res
end end
local NEEDED_PRIV = "server"
local function check_priv(player_name, quit)
local privs = minetest.get_player_privs(player_name)
if privs[NEEDED_PRIV] then
return true
else
if not quit then
minetest.chat_send_player(player_name, minetest.colorize("red",
S("Insufficient privileges! You need the “@1” privilege to use this.", NEEDED_PRIV)))
end
return false
end
end
-- Lua export
local export_schematic_to_lua
if can_import then
export_schematic_to_lua = function(schematic, filepath, options)
if not options then options = {} end
local str = minetest.serialize_schematic(schematic, "lua", options)
local file = io.open(filepath, "w")
if file and str then
file:write(str)
file:flush()
file:close()
return true
else
return false
end
end
end
--- ---
--- Formspec API --- Formspec API
--- ---
@ -110,7 +142,8 @@ function schemedit.show_formspec(pos, player, tab, show, ...)
-- Update player attribute -- Update player attribute
if forms[tab].cache_name ~= false then if forms[tab].cache_name ~= false then
player:set_attribute("schemedit:tab", tab) local pmeta = player:get_meta()
pmeta:set_string("schemedit:tab", tab)
end end
else else
minetest.close_formspec(pname, "schemedit:"..tab) minetest.close_formspec(pname, "schemedit:"..tab)
@ -231,7 +264,10 @@ end
--- ---
--- Formspec Tabs --- Formspec Tabs
--- ---
local import_btn = ""
if can_import then
import_btn = "button[0.5,2.5;6,1;import;"..F(S("Import schematic")).."]"
end
schemedit.add_form("main", { schemedit.add_form("main", {
tab = true, tab = true,
caption = S("Main"), caption = S("Main"),
@ -247,27 +283,36 @@ schemedit.add_form("main", {
border_button = "button[3.5,7.5;3,1;border;"..F(S("Show border")).."]" border_button = "button[3.5,7.5;3,1;border;"..F(S("Show border")).."]"
end end
-- TODO: Show information regarding volume, pos1, pos2, etc... in formspec local xs, ys, zs = meta.x_size or 1, meta.y_size or 1, meta.z_size or 1
local size = {x=xs, y=ys, z=zs}
local schem_name = meta.schem_name or ""
local form = [[ local form = [[
size[7,8] size[7,8]
label[0.5,-0.1;]]..F(S("Position: @1", strpos))..[[] label[0.5,-0.1;]]..F(S("Position: @1", strpos))..[[]
label[3,-0.1;]]..F(S("Owner: @1", name))..[[] label[3,-0.1;]]..F(S("Owner: @1", name))..[[]
label[0.5,0.4;]]..F(S("Schematic name: @1", F(schem_name)))..[[]
label[0.5,0.9;]]..F(S("Size: @1", minetest.pos_to_string(size)))..[[]
field[0.8,1;5,1;name;]]..F(S("Schematic name:"))..[[;]]..F(meta.schem_name or "")..[[] field[0.8,2;5,1;name;]]..F(S("Schematic name:"))..[[;]]..F(schem_name or "")..[[]
button[5.3,0.69;1.2,1;save_name;]]..F(S("Save"))..[[] button[5.3,1.69;1.2,1;save_name;]]..F(S("OK"))..[[]
tooltip[save_name;]]..F(S("Save schematic name"))..[[] tooltip[save_name;]]..F(S("Save schematic name"))..[[]
field_close_on_enter[name;false] field_close_on_enter[name;false]
button[0.5,1.5;6,1;export;]]..F(S("Export schematic"))..[[] button[0.5,3.5;6,1;export;]]..F(S("Export schematic")).."]"..
textarea[0.8,2.5;6.2,5;;]]..F(S("The schematic will be exported as a .mts file and stored in\n@1", import_btn..[[
export_path_trunc .. DIR_DELIM .. "<name>.mts."))..[[;] textarea[0.8,4.5;6.2,1;;]]..F(S("Export/import path:\n@1",
field[0.8,7;2,1;x;]]..F(S("X size:"))..[[;]]..meta.x_size..[[] export_path_trunc .. DIR_DELIM .. F(S("<name>"))..".mts"))..[[;]
field[2.8,7;2,1;y;]]..F(S("Y size:"))..[[;]]..meta.y_size..[[] button[0.5,5.5;3,1;air2void;]]..F(S("Air to voids"))..[[]
field[4.8,7;2,1;z;]]..F(S("Z size:"))..[[;]]..meta.z_size..[[] button[3.5,5.5;3,1;void2air;]]..F(S("Voids to air"))..[[]
tooltip[air2void;]]..F(S("Turn all air nodes into schematic void nodes"))..[[]
tooltip[void2air;]]..F(S("Turn all schematic void nodes into air nodes"))..[[]
field[0.8,7;2,1;x;]]..F(S("X size:"))..[[;]]..xs..[[]
field[2.8,7;2,1;y;]]..F(S("Y size:"))..[[;]]..ys..[[]
field[4.8,7;2,1;z;]]..F(S("Z size:"))..[[;]]..zs..[[]
field_close_on_enter[x;false] field_close_on_enter[x;false]
field_close_on_enter[y;false] field_close_on_enter[y;false]
field_close_on_enter[z;false] field_close_on_enter[z;false]
button[0.5,7.5;3,1;save;]]..F(S("Save size"))..[[] button[0.5,7.5;3,1;save;]]..F(S("Save size"))..[[]
]].. ]]..
border_button border_button
@ -278,12 +323,56 @@ schemedit.add_form("main", {
return form return form
end, end,
handle = function(self, pos, name, fields) handle = function(self, pos, name, fields)
if fields.doc then
doc.show_entry(name, "nodes", "schemedit:creator", true)
return
end
if not check_priv(name, fields.quit) then
return
end
local realmeta = minetest.get_meta(pos) local realmeta = minetest.get_meta(pos)
local meta = realmeta:to_table().fields local meta = realmeta:to_table().fields
local hashpos = minetest.hash_node_position(pos) local hashpos = minetest.hash_node_position(pos)
if fields.doc then -- Save size vector values
doc.show_entry(name, "nodes", "schemedit:creator", true) if (fields.x and fields.x ~= "") then
local x = tonumber(fields.x)
if x then
meta.x_size = math.max(x, 1)
end
end
if (fields.y and fields.y ~= "") then
local y = tonumber(fields.y)
if y then
meta.y_size = math.max(y, 1)
end
end
if (fields.z and fields.z ~= "") then
local z = tonumber(fields.z)
if z then
meta.z_size = math.max(z, 1)
end
end
-- Save schematic name
if fields.name then
meta.schem_name = fields.name
end
-- Node conversion
if (fields.air2void) then
local pos1, pos2 = schemedit.size(pos)
pos1, pos2 = schemedit.sort_pos(pos1, pos2)
local nodes = minetest.find_nodes_in_area(pos1, pos2, {"air"})
minetest.bulk_set_node(nodes, {name="schemedit:void"})
return
elseif (fields.void2air) then
local pos1, pos2 = schemedit.size(pos)
pos1, pos2 = schemedit.sort_pos(pos1, pos2)
local nodes = minetest.find_nodes_in_area(pos1, pos2, {"schemedit:void"})
minetest.bulk_set_node(nodes, {name="air"})
return return
end end
@ -298,30 +387,6 @@ schemedit.add_form("main", {
end end
end end
-- Save size vector values
if (fields.save or fields.key_enter_field == "x" or
fields.key_enter_field == "y" or fields.key_enter_field == "z")
and (fields.x and fields.y and fields.z and fields.x ~= ""
and fields.y ~= "" and fields.z ~= "") then
local x, y, z = tonumber(fields.x), tonumber(fields.y), tonumber(fields.z)
if x then
meta.x_size = math.max(x, 1)
end
if y then
meta.y_size = math.max(y, 1)
end
if z then
meta.z_size = math.max(z, 1)
end
end
-- Save schematic name
if fields.save_name or fields.key_enter_field == "name" and fields.name and
fields.name ~= "" then
meta.schem_name = fields.name
end
-- Export schematic -- Export schematic
if fields.export and meta.schem_name and meta.schem_name ~= "" then if fields.export and meta.schem_name and meta.schem_name ~= "" then
local pos1, pos2 = schemedit.size(pos) local pos1, pos2 = schemedit.size(pos)
@ -358,12 +423,106 @@ schemedit.add_form("main", {
if res then if res then
minetest.chat_send_player(name, minetest.colorize("#00ff00", minetest.chat_send_player(name, minetest.colorize("#00ff00",
S("Exported schematic to @1", filepath))) S("Exported schematic to @1", filepath)))
-- Additional export to Lua file if MTS export was successful
local schematic = minetest.read_schematic(filepath, {})
if schematic and minetest.settings:get_bool("schemedit_export_lua") then
local filepath_lua = path..meta.schem_name..".lua"
res = export_schematic_to_lua(schematic, filepath_lua)
if res then
minetest.chat_send_player(name, minetest.colorize("#00ff00",
S("Exported schematic to @1", filepath_lua)))
end
end
else else
minetest.chat_send_player(name, minetest.colorize("red", minetest.chat_send_player(name, minetest.colorize("red",
S("Failed to export schematic to @1", filepath))) S("Failed to export schematic to @1", filepath)))
end end
end end
-- Import schematic
if fields.import and meta.schem_name and meta.schem_name ~= "" then
if not can_import then
return
end
local pos1
local node = minetest.get_node(pos)
local path = export_path_full .. DIR_DELIM
local filepath = path..meta.schem_name..".mts"
local schematic = minetest.read_schematic(filepath, {write_yslice_prob="low"})
local success = false
if schematic then
meta.x_size = schematic.size.x
meta.y_size = schematic.size.y
meta.z_size = schematic.size.z
meta.slices = minetest.serialize(renumber(schematic.yslice_prob))
local special_x_size = meta.x_size
local special_y_size = meta.y_size
local special_z_size = meta.z_size
if node.param2 == 1 then
pos1 = vector.add(pos, {x=1,y=0,z=-meta.z_size+1})
meta.x_size, meta.z_size = meta.z_size, meta.x_size
elseif node.param2 == 2 then
pos1 = vector.add(pos, {x=-meta.x_size+1,y=0,z=-meta.z_size})
elseif node.param2 == 3 then
pos1 = vector.add(pos, {x=-meta.x_size,y=0,z=0})
meta.x_size, meta.z_size = meta.z_size, meta.x_size
else
pos1 = vector.add(pos, {x=0,y=0,z=1})
end
local schematic_for_meta = table.copy(schematic)
-- Strip probability data for placement
schematic.yslice_prob = {}
for d=1, #schematic.data do
schematic.data[d].prob = nil
end
-- Place schematic
success = minetest.place_schematic(pos1, schematic, "0", nil, true)
-- Add special schematic data to nodes
if success then
local d = 1
for z=0, special_z_size-1 do
for y=0, special_y_size-1 do
for x=0, special_x_size-1 do
local data = schematic_for_meta.data[d]
local pp = {x=pos1.x+x, y=pos1.y+y, z=pos1.z+z}
if data.prob == 0 then
minetest.set_node(pp, {name="schemedit:void"})
else
local meta = minetest.get_meta(pp)
if data.prob and data.prob ~= 255 and data.prob ~= 254 then
meta:set_string("schemedit_prob", tostring(data.prob))
else
meta:set_string("schemedit_prob", "")
end
if data.force_place then
meta:set_string("schemedit_force_place", "true")
else
meta:set_string("schemedit_force_place", "")
end
end
d = d + 1
end
end
end
end
end
if success then
minetest.chat_send_player(name, minetest.colorize("#00ff00",
S("Imported schematic from @1", filepath)))
else
minetest.chat_send_player(name, minetest.colorize("red",
S("Failed to import schematic from @1", filepath)))
end
end
-- Save meta before updating visuals -- Save meta before updating visuals
local inv = realmeta:get_inventory():get_lists() local inv = realmeta:get_inventory():get_lists()
realmeta:from_table({fields = meta, inventory = inv}) realmeta:from_table({fields = meta, inventory = inv})
@ -403,17 +562,22 @@ schemedit.add_form("slice", {
if self.panel_add or self.panel_edit then if self.panel_add or self.panel_edit then
local ypos_default, prob_default = "", "" local ypos_default, prob_default = "", ""
local done_button = "button[5,7.18;2,1;done_add;"..F(S("Done")).."]" local done_button = "button[5,7.18;2,1;done_add;"..F(S("Add")).."]"
if self.panel_edit then if self.panel_edit then
done_button = "button[5,7.18;2,1;done_edit;"..F(S("Done")).."]" done_button = "button[5,7.18;2,1;done_edit;"..F(S("Apply")).."]"
if slice_list[self.selected] then if slice_list[self.selected] then
ypos_default = slice_list[self.selected].ypos ypos_default = slice_list[self.selected].ypos
prob_default = slice_list[self.selected].prob prob_default = slice_list[self.selected].prob
end end
end end
local field_ypos = ""
if self.panel_add then
field_ypos = "field[0.3,7.5;2.5,1;ypos;"..F(S("Y position (max. @1):", (meta.y_size - 1)))..";"..ypos_default.."]"
end
form = form..[[ form = form..[[
field[0.3,7.5;2.5,1;ypos;]]..F(S("Y position (max. @1):", (meta.y_size - 1)))..[[;]]..ypos_default..[[] ]]..field_ypos..[[
field[2.8,7.5;2.5,1;prob;]]..F(S("Probability (0-255):"))..[[;]]..prob_default..[[] field[2.8,7.5;2.5,1;prob;]]..F(S("Probability (0-255):"))..[[;]]..prob_default..[[]
field_close_on_enter[ypos;false] field_close_on_enter[ypos;false]
field_close_on_enter[prob;false] field_close_on_enter[prob;false]
@ -421,19 +585,22 @@ schemedit.add_form("slice", {
end end
if not self.panel_edit then if not self.panel_edit then
form = form.."button[0,6;2,1;add;"..F(S("+ Add slice")).."]" if self.panel_add then
form = form.."button[0,6;2.4,1;add;"..F(S("Cancel")).."]"
else
form = form.."button[0,6;2.4,1;add;"..F(S("Add slice")).."]"
end
end end
if slices ~= "" and self.selected and not self.panel_add then if slices ~= "" and self.selected and not self.panel_add then
if not self.panel_edit then if not self.panel_edit then
form = form..[[ form = form..[[
button[2,6;2,1;remove;]]..F(S("- Remove slice"))..[[] button[2.4,6;2.4,1;remove;]]..F(S("Remove slice"))..[[]
button[4,6;2,1;edit;]]..F(S("+/- Edit slice"))..[[] button[4.8,6;2.4,1;edit;]]..F(S("Edit slice"))..[[]
]] ]]
else else
form = form..[[ form = form..[[
button[2,6;2,1;remove;]]..F(S("- Remove slice"))..[[] button[4.8,6;2.4,1;edit;]]..F(S("Back"))..[[]
button[4,6;2,1;edit;]]..F(S("+/- Edit slice"))..[[]
]] ]]
end end
end end
@ -441,6 +608,10 @@ schemedit.add_form("slice", {
return form return form
end, end,
handle = function(self, pos, name, fields) handle = function(self, pos, name, fields)
if not check_priv(name, fields.quit) then
return
end
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
@ -460,8 +631,10 @@ schemedit.add_form("slice", {
end end
local ypos, prob = tonumber(fields.ypos), tonumber(fields.prob) local ypos, prob = tonumber(fields.ypos), tonumber(fields.prob)
if (fields.done_add or fields.done_edit) and fields.ypos and fields.prob and if fields.done_edit then
fields.ypos ~= "" and fields.prob ~= "" and ypos and prob and ypos = 0
end
if (fields.done_add or fields.done_edit) and ypos and prob and
ypos <= (meta:get_int("y_size") - 1) and prob >= 0 and prob <= 255 then ypos <= (meta:get_int("y_size") - 1) and prob >= 0 and prob <= 255 then
local slice_list = minetest.deserialize(meta:get_string("slices")) local slice_list = minetest.deserialize(meta:get_string("slices"))
local index = #slice_list + 1 local index = #slice_list + 1
@ -469,7 +642,21 @@ schemedit.add_form("slice", {
index = self.selected index = self.selected
end end
slice_list[index] = {ypos = ypos, prob = prob} local dupe = false
if fields.done_add then
for k,v in pairs(slice_list) do
if v.ypos == ypos then
v.prob = prob
dupe = true
end
end
end
if fields.done_edit and slice_list[index] then
ypos = slice_list[index].ypos
end
if not dupe then
slice_list[index] = {ypos = ypos, prob = prob}
end
meta:set_string("slices", minetest.serialize(slice_list)) meta:set_string("slices", minetest.serialize(slice_list))
@ -484,7 +671,7 @@ schemedit.add_form("slice", {
meta:set_string("slices", minetest.serialize(renumber(slice_list))) meta:set_string("slices", minetest.serialize(renumber(slice_list)))
-- Update formspec -- Update formspec
self.selected = 1 self.selected = math.max(1, self.selected-1)
self.panel_edit = nil self.panel_edit = nil
schemedit.show_formspec(pos, player, "slice") schemedit.show_formspec(pos, player, "slice")
end end
@ -536,6 +723,10 @@ schemedit.add_form("probtool", {
return form return form
end, end,
handle = function(self, pos, name, fields) handle = function(self, pos, name, fields)
if not check_priv(name, fields.quit) then
return
end
if fields.submit then if fields.submit then
local prob = tonumber(fields.prob) local prob = tonumber(fields.prob)
if prob then if prob then
@ -651,7 +842,7 @@ function schemedit.mark(pos)
local marker = minetest.add_entity({x = pos1.x + sizex - 0.5, y = pos1.y + sizey - 0.5, z = z + offset}, "schemedit:display") local marker = minetest.add_entity({x = pos1.x + sizex - 0.5, y = pos1.y + sizey - 0.5, z = z + offset}, "schemedit:display")
if marker ~= nil then if marker ~= nil then
marker:set_properties({ marker:set_properties({
visual_size={x=(sizex+0.01) * 2, y=sizey * 2}, visual_size={x=(sizex+0.01) * 2, y=(sizey+0.01) * 2},
}) })
marker:get_luaentity().id = id marker:get_luaentity().id = id
marker:get_luaentity().owner = owner marker:get_luaentity().owner = owner
@ -672,9 +863,9 @@ function schemedit.mark(pos)
local marker = minetest.add_entity({x = x + offset, y = pos1.y + sizey - 0.5, z = pos1.z + sizez - 0.5}, "schemedit:display") local marker = minetest.add_entity({x = x + offset, y = pos1.y + sizey - 0.5, z = pos1.z + sizez - 0.5}, "schemedit:display")
if marker ~= nil then if marker ~= nil then
marker:set_properties({ marker:set_properties({
visual_size={x=(sizez+0.01) * 2, y=sizey * 2}, visual_size={x=(sizez+0.01) * 2, y=(sizey+0.01) * 2},
}) })
marker:set_yaw(math.pi / 2) marker:set_rotation({x=0, y=math.pi / 2, z=0})
marker:get_luaentity().id = id marker:get_luaentity().id = id
marker:get_luaentity().owner = owner marker:get_luaentity().owner = owner
table.insert(m, marker) table.insert(m, marker)
@ -682,6 +873,30 @@ function schemedit.mark(pos)
low = false low = false
end end
low = true
-- XZ plane markers
for _, y in ipairs({pos1.y - 0.5, pos2.y + 0.5}) do
if low then
offset = -0.01
else
offset = 0.01
end
local marker = minetest.add_entity({x = pos1.x + sizex - 0.5, y = y + offset, z = pos1.z + sizez - 0.5}, "schemedit:display")
if marker ~= nil then
marker:set_properties({
visual_size={x=(sizex+0.01) * 2, y=(sizez+0.01) * 2},
})
marker:set_rotation({x=math.pi/2, y=0, z=0})
marker:get_luaentity().id = id
marker:get_luaentity().owner = owner
table.insert(m, marker)
end
low = false
end
schemedit.markers[id] = m schemedit.markers[id] = m
return true return true
end end
@ -706,12 +921,12 @@ end
-- Show probability and force_place status of a particular position for player in HUD. -- Show probability and force_place status of a particular position for player in HUD.
-- Probability is shown as a number followed by “[F]” if the node is force-placed. -- Probability is shown as a number followed by “[F]” if the node is force-placed.
-- The distance to the node is also displayed below that. This can't be avoided and is -- The distance to the node is also displayed below that. This can't be avoided and is
-- and artifact of the waypoint HUD element. TODO: Hide displayed distance. -- and artifact of the waypoint HUD element.
function schemedit.display_node_prob(player, pos, prob, force_place) function schemedit.display_node_prob(player, pos, prob, force_place)
local wpstring local wpstring
if prob and force_place == true then if prob and force_place == true then
wpstring = string.format("%d [F]", prob) wpstring = string.format("%s [F]", prob)
elseif prob then elseif prob and type(tonumber(prob)) == "number" then
wpstring = prob wpstring = prob
elseif force_place == true then elseif force_place == true then
wpstring = "[F]" wpstring = "[F]"
@ -720,6 +935,7 @@ function schemedit.display_node_prob(player, pos, prob, force_place)
return player:hud_add({ return player:hud_add({
hud_elem_type = "waypoint", hud_elem_type = "waypoint",
name = wpstring, name = wpstring,
precision = 0,
text = "m", -- For the distance artifact text = "m", -- For the distance artifact
number = text_color_number, number = text_color_number,
world_pos = pos, world_pos = pos,
@ -756,7 +972,7 @@ function schemedit.display_node_probs_region(player, pos1, pos2)
local prob, force_place local prob, force_place
local meta = minetest.get_meta(checkpos) local meta = minetest.get_meta(checkpos)
prob = tonumber(meta:get_string("schemedit_prob")) prob = meta:get_string("schemedit_prob")
force_place = meta:get_string("schemedit_force_place") == "true" force_place = meta:get_string("schemedit_force_place") == "true"
local hud_id = schemedit.display_node_prob(player, checkpos, prob, force_place) local hud_id = schemedit.display_node_prob(player, checkpos, prob, force_place)
if hud_id then if hud_id then
@ -822,12 +1038,18 @@ minetest.register_privilege("schematic_override", {
give_to_singleplayer = false, give_to_singleplayer = false,
}) })
local help_import = ""
if can_import then
help_import = S("Importing a schematic will load a schematic from the world directory, place it in front of the schematic creator and sets probability and force-place data accordingly.").."\n"
end
-- [node] Schematic creator -- [node] Schematic creator
minetest.register_node("schemedit:creator", { minetest.register_node("schemedit:creator", {
description = S("Schematic Creator"), description = S("Schematic Creator"),
_doc_items_longdesc = S("The schematic creator is used to save a region of the world into a schematic file (.mts)."), _doc_items_longdesc = S("The schematic creator is used to save a region of the world into a schematic file (.mts)."),
_doc_items_usagehelp = S("To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “schematic_override” privilege.").."\n".. _doc_items_usagehelp = S("To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “schematic_override” privilege.").."\n"..
S("To save a region, use the block, enter the size and a schematic name and hit “Export schematic”. The file will always be saved in the world directory. Note you can use this name in the /placeschem command to place the schematic again.").."\n\n".. S("To save a region, use the block, enter the size and a schematic name and hit “Export schematic”. The file will always be saved in the world directory. Note you can use this name in the /placeschem command to place the schematic again.").."\n\n"..
help_import..
S("The other features of the schematic creator are optional and are used to allow to add randomness and fine-tuning.").."\n\n".. S("The other features of the schematic creator are optional and are used to allow to add randomness and fine-tuning.").."\n\n"..
S("Y slices are used to remove entire slices based on chance. For each slice of the schematic region along the Y axis, you can specify that it occurs only with a certain chance. In the Y slice tab, you have to specify the Y slice height (0 = bottom) and a probability from 0 to 255 (255 is for 100%). By default, all Y slices occur always.").."\n\n".. S("Y slices are used to remove entire slices based on chance. For each slice of the schematic region along the Y axis, you can specify that it occurs only with a certain chance. In the Y slice tab, you have to specify the Y slice height (0 = bottom) and a probability from 0 to 255 (255 is for 100%). By default, all Y slices occur always.").."\n\n"..
S("With a schematic node probability tool, you can set a probability for each node and enable them to overwrite all nodes when placed as schematic. This tool must be used prior to the file export."), S("With a schematic node probability tool, you can set a probability for each node and enable them to overwrite all nodes when placed as schematic. This tool must be used prior to the file export."),
@ -872,7 +1094,8 @@ S("With a schematic node probability tool, you can set a probability for each no
if meta:get_string("owner") == name or if meta:get_string("owner") == name or
minetest.check_player_privs(player, "schematic_override") == true then minetest.check_player_privs(player, "schematic_override") == true then
-- Get player attribute -- Get player attribute
local tab = player:get_attribute("schemedit:tab") local pmeta = player:get_meta()
local tab = pmeta:get_string("schemedit:tab")
if not forms[tab] or not tab then if not forms[tab] or not tab then
tab = "main" tab = "main"
end end
@ -883,6 +1106,9 @@ S("With a schematic node probability tool, you can set a probability for each no
after_destruct = function(pos) after_destruct = function(pos)
schemedit.unmark(pos) schemedit.unmark(pos)
end, end,
-- No support for Minetest Game's screwdriver
on_rotate = false,
}) })
minetest.register_tool("schemedit:probtool", { minetest.register_tool("schemedit:probtool", {
@ -906,6 +1132,11 @@ S("The node HUD is not updated automatically and may be outdated. The node HUD o
liquids_pointable = true, liquids_pointable = true,
groups = { disable_repair = 1 }, groups = { disable_repair = 1 },
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
local uname = user:get_player_name()
if uname and not check_priv(uname) then
return
end
local ctrl = user:get_player_control() local ctrl = user:get_player_control()
-- Simple use -- Simple use
if not ctrl.sneak then if not ctrl.sneak then
@ -920,7 +1151,7 @@ S("The node HUD is not updated automatically and may be outdated. The node HUD o
-- within the creator's region. -- within the creator's region.
local use_creator_region = false local use_creator_region = false
if pointed_thing and pointed_thing.type == "node" and pointed_thing.under then if pointed_thing and pointed_thing.type == "node" and pointed_thing.under then
punchpos = pointed_thing.under local punchpos = pointed_thing.under
local node = minetest.get_node(punchpos) local node = minetest.get_node(punchpos)
if node.name == "schemedit:creator" then if node.name == "schemedit:creator" then
local pos1, pos2 = schemedit.size(punchpos) local pos1, pos2 = schemedit.size(punchpos)
@ -935,10 +1166,20 @@ S("The node HUD is not updated automatically and may be outdated. The node HUD o
end end
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
local uname = user:get_player_name()
if uname and not check_priv(uname) then
return
end
schemedit.clear_displayed_node_probs(user) schemedit.clear_displayed_node_probs(user)
end, end,
-- Set note probability and force_place and enable node probability display -- Set note probability and force_place and enable node probability display
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local pname = placer:get_player_name()
if pname and not check_priv(pname) then
return
end
-- Use pointed node's on_rightclick function first, if present -- Use pointed node's on_rightclick function first, if present
local node = minetest.get_node(pointed_thing.under) local node = minetest.get_node(pointed_thing.under)
if placer and not placer:get_player_control().sneak then if placer and not placer:get_player_control().sneak then
@ -978,11 +1219,19 @@ S("The node HUD is not updated automatically and may be outdated. The node HUD o
end, end,
}) })
local use_texture_alpha_void
if minetest.features.use_texture_alpha_string_modes then
use_texture_alpha_void = "clip"
else
use_texture_alpha_void = true
end
minetest.register_node("schemedit:void", { minetest.register_node("schemedit:void", {
description = S("Schematic Void"), description = S("Schematic Void"),
_doc_items_longdesc = S("This is an utility block used in the creation of schematic files. It should be used together with a schematic creator. When saving a schematic, all nodes with a schematic void will be left unchanged when the schematic is placed again. Technically, this is equivalent to a block with the node probability set to 0."), _doc_items_longdesc = S("This is an utility block used in the creation of schematic files. It should be used together with a schematic creator. When saving a schematic, all nodes with a schematic void will be left unchanged when the schematic is placed again. Technically, this is equivalent to a block with the node probability set to 0."),
_doc_items_usagehelp = S("Just place the schematic void like any other block and use the schematic creator to save a portion of the world."), _doc_items_usagehelp = S("Just place the schematic void like any other block and use the schematic creator to save a portion of the world."),
tiles = { "schemedit_void.png" }, tiles = { "schemedit_void.png" },
use_texture_alpha = use_texture_alpha_void,
drawtype = "nodebox", drawtype = "nodebox",
is_ground_content = false, is_ground_content = false,
paramtype = "light", paramtype = "light",
@ -1004,6 +1253,7 @@ minetest.register_entity("schemedit:display", {
visual_size = {x=10, y=10}, visual_size = {x=10, y=10},
pointable = false, pointable = false,
physical = false, physical = false,
static_save = false,
glow = minetest.LIGHT_MAX, glow = minetest.LIGHT_MAX,
on_step = function(self, dtime) on_step = function(self, dtime)
@ -1018,10 +1268,34 @@ minetest.register_entity("schemedit:display", {
end, end,
}) })
minetest.register_lbm({
label = "Reset schematic creator border entities",
name = "schemedit:reset_border",
nodenames = "schemedit:creator",
run_at_every_load = true,
action = function(pos, node)
local meta = minetest.get_meta(pos)
meta:set_string("schem_border", "false")
end,
})
local function add_suffix(schem)
-- Automatically add file name suffix if omitted
local schem_full, schem_lua
if string.sub(schem, string.len(schem)-3, string.len(schem)) == ".mts" then
schem_full = schem
schem_lua = string.sub(schem, 1, -5) .. ".lua"
else
schem_full = schem .. ".mts"
schem_lua = schem .. ".lua"
end
return schem_full, schem_lua
end
-- [chatcommand] Place schematic -- [chatcommand] Place schematic
minetest.register_chatcommand("placeschem", { minetest.register_chatcommand("placeschem", {
description = S("Place schematic at the position specified or the current player position (loaded from @1)", export_path_trunc), description = S("Place schematic at the position specified or the current player position (loaded from @1)", export_path_trunc),
privs = {debug = true}, privs = {server = true},
params = S("<schematic name>[.mts] [<x> <y> <z>]"), params = S("<schematic name>[.mts] [<x> <y> <z>]"),
func = function(name, param) func = function(name, param)
local schem, p = string.match(param, "^([^ ]+) *(.*)$") local schem, p = string.match(param, "^([^ ]+) *(.*)$")
@ -1035,16 +1309,22 @@ minetest.register_chatcommand("placeschem", {
pos = minetest.get_player_by_name(name):get_pos() pos = minetest.get_player_by_name(name):get_pos()
end end
-- Automatiically add file name suffix if omitted local schem_full, schem_lua = add_suffix(schem)
local schem_full local success = false
if string.sub(schem, string.len(schem)-3, string.len(schem)) == ".mts" then local schem_path = export_path_full .. DIR_DELIM .. schem_full
schem_full = schem if minetest.read_schematic then
-- We don't call minetest.place_schematic with the path name directly because
-- this would trigger the caching and we wouldn't get any updates to the schematic
-- files when we reload. minetest.read_schematic circumvents that.
local schematic = minetest.read_schematic(schem_path, {})
if schematic then
success = minetest.place_schematic(pos, schematic, "random", nil, false)
end
else else
schem_full = schem .. ".mts" -- Legacy support for Minetest versions that do not have minetest.read_schematic
success = minetest.place_schematic(schem_path, schematic, "random", nil, false)
end end
local success = minetest.place_schematic(pos, export_path_full .. DIR_DELIM .. schem_full, "random", nil, false)
if success == nil then if success == nil then
return false, S("Schematic file could not be loaded!") return false, S("Schematic file could not be loaded!")
else else
@ -1053,3 +1333,39 @@ minetest.register_chatcommand("placeschem", {
end, end,
}) })
if can_import then
-- [chatcommand] Convert MTS schematic file to .lua file
minetest.register_chatcommand("mts2lua", {
description = S("Convert .mts schematic file to .lua file (loaded from @1)", export_path_trunc),
privs = {server = true},
params = S("<schematic name>[.mts] [comments]"),
func = function(name, param)
local schem, comments_str = string.match(param, "^([^ ]+) *(.*)$")
if not schem then
return false, S("No schematic file specified.")
end
local comments = comments_str == "comments"
-- Automatically add file name suffix if omitted
local schem_full, schem_lua = add_suffix(schem)
local schem_path = export_path_full .. DIR_DELIM .. schem_full
local schematic = minetest.read_schematic(schem_path, {})
if schematic then
local str = minetest.serialize_schematic(schematic, "lua", {lua_use_comments=comments})
local lua_path = export_path_full .. DIR_DELIM .. schem_lua
local file = io.open(lua_path, "w")
if file and str then
file:write(str)
file:flush()
file:close()
return true, S("Exported schematic to @1", lua_path)
else
return false, S("Failed!")
end
end
end,
})
end

View File

@ -1,36 +1,53 @@
# textdomain: schemedit # textdomain: schemedit
<world path>=<Weltpfad> <world path>=<Weltpfad>
Insufficient privileges! You need the “@1” privilege to use this.=Unzureichende Privilegien! Sie benötigen das „@1“-Privileg, um dies benutzen zu können.
Probability: @1=Wahrscheinlichkeit: @1 Probability: @1=Wahrscheinlichkeit: @1
Not Set=Nicht gesetzt Not Set=Nicht gesetzt
Force placement=Platzierung erzwingen Force placement=Platzierung erzwingen
Import schematic=Schematic importieren
Main=Grundeinstellungen
Hide border=Rand verbergen Hide border=Rand verbergen
Show border=Rand anzeigen Show border=Rand anzeigen
Position: @1=Position: @1 Position: @1=Position: @1
Owner: @1=Eigentümer: @1 Owner: @1=Eigentümer: @1
Schematic name: @1=Schematic-Name: @1
Size: @1=Größe: @1
Schematic name:=Schematic-Name: Schematic name:=Schematic-Name:
Save=Speichern OK=OK
Save schematic name=Schematic-Name speichern Save schematic name=Schematic-Name speichern
Export schematic=Schematic exportieren Export schematic=Schematic exportieren
The schematic will be exported as a .mts file and stored in@n@1=Das Schematic wird als .mts-Datei gespeichert in:@n@1 Export/import path:@n@1=Export-/Importpfad:@n@1
<name>=<Name>
Air to voids=Luft zu Lücken
Voids to air=Lücken zu Luft
Turn all air nodes into schematic void nodes=Alle Luft-Nodes zu Schematic-Lücken umwandeln
Turn all schematic void nodes into air nodes=Alle Schematic-Lücken zu Luft-Nodes umwandeln
X size:=X-Größe:
Y size:=Y-Größe:
Z size:=Z-Größe:
Save size=Größe speichern Save size=Größe speichern
Help=Hilfe Help=Hilfe
Exported schematic to @1=Schematic nach @1 exportiert Exported schematic to @1=Schematic nach @1 exportiert
Failed to export schematic to @1=Schematic konnte nicht nach @1 exportiert werden Failed to export schematic to @1=Schematic konnte nicht nach @1 exportiert werden
Imported schematic from @1=Schematic von @1 importiert
Failed to import schematic from @1=Schematic konnte nicht von @1 importiert werden
Y Slices=Y-Scheiben Y Slices=Y-Scheiben
Y @= @1; Probability @= @2=Y @= @1; Wahrscheinlichkeit @= @2 Y @= @1; Probability @= @2=Y @= @1; Wahrscheinlichkeit @= @2
Done=Fertig Add=Hinzufügen
Apply=Anwenden
Y position (max. @1):=Y-Position (max. @1): Y position (max. @1):=Y-Position (max. @1):
Probability (0-255):=Wahrscheinlichkeit (0-255): Probability (0-255):=Wahrscheinlichkeit (0-255):
+ Add slice=+ Neue Scheibe Cancel=Abbrechen
+/- Edit slice=+/- Scheibe bearbeiten Add slice=Neue Scheibe
- Remove slice=- Scheibe entfernen Remove slice=Scheibe entfernen
Edit slice=Scheibe anpassen
Back=Zurück
Schematic Node Probability Tool=Schematic-Node-Wahrscheinlichkeitswerkzeug Schematic Node Probability Tool=Schematic-Node-Wahrscheinlichkeitswerkzeug
Probability (0-255)=Wahrscheinlichkeit Probability (0-255)=Wahrscheinlichkeit
Cancel=Abbrechen
Apply=Anwenden
Probability that the node will be placed=Wahrscheinlichkeit, dass der Node platizert wird Probability that the node will be placed=Wahrscheinlichkeit, dass der Node platizert wird
If enabled, the node will replace nodes other than air and ignore=Wenn aktiviert, wird der Node alle Nodes außer Luft und Ignorieren ersetzen If enabled, the node will replace nodes other than air and ignore=Wenn aktiviert, wird der Node alle Nodes außer Luft und Ignorieren ersetzen
Allows you to access schemedit nodes not owned by you=Damit können Sie auf Schemedit-Nodes, die ihnen nicht gehören, zugreifen Allows you to access schemedit nodes not owned by you=Damit können Sie auf Schemedit-Nodes, die ihnen nicht gehören, zugreifen
Importing a schematic will load a schematic from the world directory, place it in front of the schematic creator and sets probability and force-place data accordingly.=Das Importieren eines Schematics wird eine Schematicdatei aus dem Weltverzeichnis laden, sie vor dem Schematic-Macher platzieren und die Wahrscheinlichkeits- und Zwangsplatzierungsdaten entsprechend setzen.
Schematic Creator=Schematic-Macher Schematic Creator=Schematic-Macher
The schematic creator is used to save a region of the world into a schematic file (.mts).=Der Schematic-Macher wird benutzt, um eine Region der Welt in eine Schematic-Datei (.mts) zu speichern. The schematic creator is used to save a region of the world into a schematic file (.mts).=Der Schematic-Macher wird benutzt, um eine Region der Welt in eine Schematic-Datei (.mts) zu speichern.
To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “schematic_override” privilege.=Um anzufangen, platzieren Sie den Block direkt vor einer beliebigen unteren linken Ecke des Gebäudes, das Sie speichern möchten. Dieser Block kann nur vom Platzierer oder von Spielern mit dem „schematic_override“-Privileg benutzt werden. To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “schematic_override” privilege.=Um anzufangen, platzieren Sie den Block direkt vor einer beliebigen unteren linken Ecke des Gebäudes, das Sie speichern möchten. Dieser Block kann nur vom Platzierer oder von Spielern mit dem „schematic_override“-Privileg benutzt werden.
@ -58,7 +75,6 @@ Place schematic at the position specified or the current player position (loaded
<schematic name>[.mts] [<x> <y> <z>]=<Schematic-Name>[.mts] [<x> <y> <z>] <schematic name>[.mts] [<x> <y> <z>]=<Schematic-Name>[.mts] [<x> <y> <z>]
No schematic file specified.=Keinen Schematic-Namen angegeben. No schematic file specified.=Keinen Schematic-Namen angegeben.
Schematic file could not be loaded!=Schematic-Datei konnte nicht geladen werden! Schematic file could not be loaded!=Schematic-Datei konnte nicht geladen werden!
Main=Grundeinstellungen Convert .mts schematic file to .lua file (loaded from @1)=„.mts“-Schematicdatei zu „.lua“-Datei konvertieren (geladen von @1)
X size:=X-Größe: <schematic name>[.mts] [comments]=<Schematic-Name>[.mts] [comments]
Y size:=Y-Größe: Failed!=Fehlgeschlagen!
Z size:=Z-Größe:

View File

@ -1,35 +1,53 @@
# textdomain: schemedit # textdomain: schemedit
<world path>= <world path>=
Not Set= Insufficient privileges! You need the “@1” privilege to use this.=
Probability: @1= Probability: @1=
Not Set=
Force placement= Force placement=
Import schematic=
Main=
Hide border= Hide border=
Show border= Show border=
Position: @1= Position: @1=
Owner: @1= Owner: @1=
Schematic name: @1=
Size: @1=
Schematic name:= Schematic name:=
Save= OK=
Save schematic name= Save schematic name=
Export schematic= Export schematic=
The schematic will be exported as a .mts file and stored in@n@1= Export/import path:@n@1=
<name>=
Air to voids=
Voids to air=
Turn all air nodes into schematic void nodes=
Turn all schematic void nodes into air nodes=
X size:=
Y size:=
Z size:=
Save size= Save size=
Help= Help=
Exported schematic to @1= Exported schematic to @1=
Failed to export schematic to @1= Failed to export schematic to @1=
Imported schematic from @1=
Failed to import schematic from @1=
Y Slices= Y Slices=
Y @= @1; Probability @= @2= Y @= @1; Probability @= @2=
Done= Add=
Apply=
Y position (max. @1):= Y position (max. @1):=
Probability (0-255):= Probability (0-255):=
+ Add slice= Cancel=
+/- Edit slice= Add slice=
Remove slice=
Edit slice=
Back=
Schematic Node Probability Tool= Schematic Node Probability Tool=
Probability (0-255)= Probability (0-255)=
Cancel=
Apply=
Probability that the node will be placed= Probability that the node will be placed=
If enabled, the node will replace nodes other than air and ignore= If enabled, the node will replace nodes other than air and ignore=
Allows you to access schemedit nodes not owned by you= Allows you to access schemedit nodes not owned by you=
Importing a schematic will load a schematic from the world directory, place it in front of the schematic creator and sets probability and force-place data accordingly.=
Schematic Creator= Schematic Creator=
The schematic creator is used to save a region of the world into a schematic file (.mts).= The schematic creator is used to save a region of the world into a schematic file (.mts).=
To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “schematic_override” privilege.= To get started, place the block facing directly in front of any bottom left corner of the structure you want to save. This block can only be accessed by the placer or by anyone with the “schematic_override” privilege.=
@ -57,7 +75,6 @@ Place schematic at the position specified or the current player position (loaded
<schematic name>[.mts] [<x> <y> <z>]= <schematic name>[.mts] [<x> <y> <z>]=
No schematic file specified.= No schematic file specified.=
Schematic file could not be loaded!= Schematic file could not be loaded!=
Main= Convert .mts schematic file to .lua file (loaded from @1)=
X size:= <schematic name>[.mts] [comments]=
Y size:= Failed!=
Z size:=

3
settingtypes.txt Normal file
View File

@ -0,0 +1,3 @@
# If enabled, exporting a schematic will also create a .lua file
# in addition to the .mts file.
schemedit_export_lua (.lua file schematic export) bool false