update biome_lib, digilines, hotbar, mesecons, pipeworks,
ropes, technic, unified inventory, unified dyes, vines, and worldedit
@ -72,6 +72,7 @@ biome = {
|
||||
---- most likely want to use at least some of these to limit how and
|
||||
---- where your objects are spawned.
|
||||
|
||||
label = string, -- set this to identify the ABM for Minetest's profiler
|
||||
avoid_nodes = {table}, -- same meaning as savoid, above
|
||||
avoid_radius = num, -- same as sradius
|
||||
seed_diff = num, -- The Perlin seed difference value passed to the
|
||||
@ -238,7 +239,7 @@ biome = {
|
||||
---- Everything else is optional, but you'll definitely want to use
|
||||
---- some of these other fields to limit where and under what
|
||||
---- conditions the objects are spawned.
|
||||
|
||||
|
||||
below_nodes = {table}, -- List of nodes that must be below the target
|
||||
-- node. Useful in snow biomes to keep objects from
|
||||
-- spawning in snow that's on the wrong surface for
|
||||
@ -342,14 +343,18 @@ into something else over time. This function has no return value, and accepts
|
||||
a biome definition table as the only parameter. These are defined like so:
|
||||
|
||||
options = {
|
||||
grow_plant = "string", -- Name of the node to be grown into something
|
||||
-- else. This value is passed to the ABM as the
|
||||
-- "nodenames" parameter, so it is the plants
|
||||
-- themselves that are the ABM trigger, rather than
|
||||
label = string, -- set this to identify the ABM for Minetest's
|
||||
-- profiler. If not set, biome_lib will set it to
|
||||
-- "biome_lib grow_plants(): " appended with the node
|
||||
-- in grow_plant (or the first item if it's a table)
|
||||
grow_plant = "string" or {table}, -- Name(s) of the node(s) to be grown
|
||||
-- into something else. This value is passed to the
|
||||
-- ABM as the "nodenames" parameter, so the plants
|
||||
-- themselves are the ABM trigger, rather than
|
||||
-- the ground they spawned on. A plant will only grow
|
||||
-- if the node above it is air. Can also be a table,
|
||||
-- but note that all nodes referenced therein will be
|
||||
-- grown into the same object.
|
||||
-- if the node above it is air. If you use a table,
|
||||
-- note that all nodes referenced therein will be
|
||||
-- grown into the same final object.
|
||||
grow_delay = num, -- Passed as the ABM "interval" parameter, as with
|
||||
-- spawning.
|
||||
grow_chance = num, -- Passed as the ABM "chance" parameter.
|
||||
|
@ -501,11 +501,20 @@ function biome_lib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa)
|
||||
biome_lib:set_defaults(biome)
|
||||
biome.spawn_plants_count = #(biome.spawn_plants)
|
||||
|
||||
local n
|
||||
if type(biome.spawn_plants) == "table" then
|
||||
n = "random: "..biome.spawn_plants[1]..", ..."
|
||||
else
|
||||
n = biome.spawn_plants
|
||||
end
|
||||
biome.label = biome.label or "biome_lib spawn_on_surfaces(): "..n
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = biome.spawn_surfaces,
|
||||
interval = biome.interval,
|
||||
chance = biome.spawn_chance,
|
||||
neighbors = biome.neighbors,
|
||||
label = biome.label,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local p_top = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
local n_top = minetest.get_node(p_top)
|
||||
@ -583,6 +592,16 @@ function biome_lib:grow_plants(opts)
|
||||
options.grow_nodes = options.grow_nodes or { "default:dirt_with_grass" }
|
||||
options.seed_diff = options.seed_diff or 0
|
||||
|
||||
local n
|
||||
|
||||
if type(options.grow_plant) == "table" then
|
||||
n = "multi: "..options.grow_plant[1]..", ..."
|
||||
else
|
||||
n = options.grow_plant
|
||||
end
|
||||
|
||||
options.label = options.label or "biome_lib grow_plants(): "..n
|
||||
|
||||
if options.grow_delay*time_scale >= 1 then
|
||||
options.interval = options.grow_delay*time_scale
|
||||
else
|
||||
@ -593,6 +612,7 @@ function biome_lib:grow_plants(opts)
|
||||
nodenames = { options.grow_plant },
|
||||
interval = options.interval,
|
||||
chance = options.grow_chance,
|
||||
label = options.label,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local p_top = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local p_bot = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
|
@ -155,24 +155,34 @@ local get_entity = function(pos)
|
||||
return lcd_entity
|
||||
end
|
||||
|
||||
local spawn_entity = function(pos)
|
||||
if not get_entity(pos) then
|
||||
local lcd_info = lcds[minetest.get_node(pos).param2]
|
||||
if not lcd_info then
|
||||
return
|
||||
end
|
||||
local text = minetest.add_entity(vector.add(pos, lcd_info.delta), "digilines_lcd:text")
|
||||
text:set_yaw(lcd_info.yaw or 0)
|
||||
local rotate_text = function(pos, param)
|
||||
local entity = get_entity(pos)
|
||||
if not entity then
|
||||
return
|
||||
end
|
||||
local lcd_info = lcds[param or minetest.get_node(pos).param2]
|
||||
if not lcd_info then
|
||||
return
|
||||
end
|
||||
entity.object:set_pos(vector.add(pos, lcd_info.delta))
|
||||
entity.object:set_yaw(lcd_info.yaw or 0)
|
||||
end
|
||||
|
||||
local prepare_writing = function(pos)
|
||||
local entity = get_entity(pos)
|
||||
if entity then
|
||||
set_texture(entity)
|
||||
rotate_text(pos)
|
||||
end
|
||||
end
|
||||
|
||||
local spawn_entity = function(pos)
|
||||
if not get_entity(pos) then
|
||||
local text = minetest.add_entity(pos, "digilines_lcd:text")
|
||||
rotate_text(pos)
|
||||
end
|
||||
end
|
||||
|
||||
local on_digiline_receive = function(pos, _, channel, msg)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local setchan = meta:get_string("channel")
|
||||
@ -220,6 +230,12 @@ minetest.register_node("digilines:lcd", {
|
||||
spawn_entity(pos)
|
||||
end
|
||||
end,
|
||||
on_rotate = function(pos, node, user, mode, new_param2)
|
||||
if mode ~= screwdriver.ROTATE_FACE then
|
||||
return false
|
||||
end
|
||||
rotate_text(pos, new_param2)
|
||||
end,
|
||||
on_receive_fields = function(pos, _, fields, sender)
|
||||
local name = sender:get_player_name()
|
||||
if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then
|
||||
|
@ -1,4 +1,15 @@
|
||||
local hotbar_size_default = minetest.setting_get("hotbar_size") or 16
|
||||
local mtver = minetest.get_version()
|
||||
local maxslots = (string.sub(mtver.string, 1, 4) ~= "0.4.") and 32 or 23
|
||||
|
||||
local function validate_size(s)
|
||||
local size = s and tonumber(s) or 16
|
||||
if (size == 8 or size == 16 or size == 23 or size == 24 or size == 32)
|
||||
and size <= maxslots then
|
||||
return size
|
||||
end
|
||||
end
|
||||
|
||||
local hotbar_size_default = validate_size(minetest.setting_get("hotbar_size"))
|
||||
|
||||
local player_hotbar_settings = {}
|
||||
|
||||
@ -27,18 +38,12 @@ end
|
||||
|
||||
load_hotbar_settings()
|
||||
|
||||
local function resize_hotbar(size)
|
||||
if size == 8 then return "gui_hb_bg.png" end
|
||||
if size == 23 then return "gui_hb_bg_23.png" end
|
||||
return "gui_hb_bg_16.png"
|
||||
end
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local hotbar_size = get_hotbar_setting(player:get_player_name())
|
||||
local hotbar_size = validate_size(get_hotbar_setting(player:get_player_name()))
|
||||
player:hud_set_hotbar_itemcount(hotbar_size)
|
||||
minetest.after(0.5,function(hotbar_size)
|
||||
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
|
||||
player:hud_set_hotbar_image(resize_hotbar(hotbar_size))
|
||||
player:hud_set_hotbar_image("gui_hb_bg_"..hotbar_size..".png")
|
||||
end,hotbar_size)
|
||||
end)
|
||||
|
||||
@ -46,12 +51,12 @@ minetest.register_chatcommand("hotbar", {
|
||||
params = "[size]",
|
||||
description = "Sets the size of your hotbar",
|
||||
func = function(name, slots)
|
||||
if slots ~= "8" and slots ~= "23" then slots = "16" end
|
||||
player_hotbar_settings[name] = slots
|
||||
hotbar_size = validate_size(tonumber(slots))
|
||||
player_hotbar_settings[name] = hotbar_size
|
||||
local player = minetest.get_player_by_name(name)
|
||||
player:hud_set_hotbar_itemcount(tonumber(slots))
|
||||
minetest.chat_send_player(name, "[_] Hotbar size set to " .. tonumber(slots) .. ".")
|
||||
player:hud_set_hotbar_image(resize_hotbar(tonumber(slots)))
|
||||
player:hud_set_hotbar_itemcount(hotbar_size)
|
||||
minetest.chat_send_player(name, "[_] Hotbar size set to " ..hotbar_size.. ".")
|
||||
player:hud_set_hotbar_image("gui_hb_bg_"..hotbar_size..".png")
|
||||
save_hotbar_settings()
|
||||
end,
|
||||
})
|
||||
|
Before (image error) Size: 474 B |
BIN
hotbar/textures/gui_hb_bg_1.png
Normal file
After (image error) Size: 246 B |
Before (image error) Size: 764 B After (image error) Size: 763 B |
Before (image error) Size: 971 B After (image error) Size: 952 B |
BIN
hotbar/textures/gui_hb_bg_24.png
Normal file
After (image error) Size: 984 B |
BIN
hotbar/textures/gui_hb_bg_32.png
Normal file
After (image error) Size: 1.2 KiB |
BIN
hotbar/textures/gui_hb_bg_8.png
Normal file
After (image error) Size: 479 B |
@ -1,5 +1,5 @@
|
||||
FPGAs can be used to chain multiple logic gates together in a compact manner.
|
||||
They come with 4 I/O ports and 10 internal registers,
|
||||
which can then be connected with eachother to form logic circuits.<br />
|
||||
which can then be connected with each other to form logic circuits.<br />
|
||||
Supported gate types: <b>AND</b>, <b>OR</b>, <b>NOT</b>, <b>XOR</b>, <b>NAND</b>, <b>XNOR</b>, <b>Buffer</b> (=)<br />
|
||||
I/O ports: <b>A B C D</b>; Registers: numbered <b>0</b> to <b>9</b>
|
||||
|
@ -619,12 +619,13 @@ local function reset_formspec(meta, code, errmsg)
|
||||
meta:mark_as_private("code")
|
||||
code = minetest.formspec_escape(code or "")
|
||||
errmsg = minetest.formspec_escape(tostring(errmsg or ""))
|
||||
meta:set_string("formspec", "size[12,10]"..
|
||||
"background[-0.2,-0.25;12.4,10.75;jeija_luac_background.png]"..
|
||||
"textarea[0.2,0.2;12.2,9.5;code;;"..code.."]"..
|
||||
"image_button[4.75,8.75;2.5,1;jeija_luac_runbutton.png;program;]"..
|
||||
"image_button_exit[11.72,-0.25;0.425,0.4;jeija_close_window.png;exit;]"..
|
||||
"label[0.1,9;"..errmsg.."]")
|
||||
meta:set_string("formspec", "size[12,10]"
|
||||
.."background[-0.2,-0.25;12.4,10.75;jeija_luac_background.png]"
|
||||
.."label[0.1,8.3;"..errmsg.."]"
|
||||
.."textarea[0.2,0.2;12.2,9.5;code;;"..code.."]"
|
||||
.."image_button[4.75,8.75;2.5,1;jeija_luac_runbutton.png;program;]"
|
||||
.."image_button_exit[11.72,-0.25;0.425,0.4;jeija_close_window.png;exit;]"
|
||||
)
|
||||
end
|
||||
|
||||
local function reset_meta(pos, code, errmsg)
|
||||
|
@ -1 +1 @@
|
||||
A power plant is a receptor that is always turned on: It provides energy.
|
||||
A power plant is a receptor that is always turned on: it provides energy.
|
||||
|
@ -1 +1 @@
|
||||
This receptor turns on if there's an object above it. And object can be a player, an item, a mob...
|
||||
This receptor turns on if there's an object above it. An object can be a player, an item, a mob...
|
||||
|
@ -1 +1 @@
|
||||
This receptor turns on if there's an object above it. And object can be a player, an item, a mob...
|
||||
This receptor turns on if there's an object above it. An object can be a player, an item, a mob...
|
||||
|
@ -1 +1 @@
|
||||
Ghoststones disappear when powered, just like Removestones. But in contrast to Removestones, they Reappear again when not powered anymore and they are also conductive.
|
||||
Ghoststones disappear when powered, just like Removestones. But in contrast to Removestones, they reappear again when not powered anymore and they are also conductive.
|
||||
|
@ -1 +1 @@
|
||||
Removestones are propably the simplest effectors possible. They simply disappear when powered.
|
||||
Removestones are probably the simplest effectors possible. They simply disappear when powered.
|
||||
|
@ -1 +1 @@
|
||||
Solar Panel are light receptors: they turn on if there is enough light.
|
||||
Solar panels are light receptors: they turn on if there is enough light.
|
||||
|
@ -1 +1 @@
|
||||
The switch is a receptor. It changes its state as when punched.
|
||||
The switch is a receptor. It changes its state when punched.
|
||||
|
@ -1,5 +1,5 @@
|
||||
default
|
||||
basic_materials
|
||||
mesecons
|
||||
mesecons_mvps
|
||||
mesecons?
|
||||
mesecons_mvps?
|
||||
digilines?
|
||||
|
@ -193,6 +193,8 @@ local function punch_filter(data, filtpos, filtnode, msg)
|
||||
["technic:mv_grinder"] = "dst",
|
||||
["technic:mv_grinder_active"] = "dst",
|
||||
["technic:tool_workshop"] = "src",
|
||||
["technic:mv_freezer"] = "dst",
|
||||
["technic:mv_freezer_active"] = "dst"
|
||||
}
|
||||
|
||||
-- make sure there's something appropriate to inject the item into
|
||||
|
@ -133,15 +133,16 @@ dofile(pipeworks.modpath..logicdir.."flowable_node_registry_install.lua")
|
||||
if pipeworks.enable_pipes then dofile(pipeworks.modpath.."/pipes.lua") end
|
||||
if pipeworks.enable_teleport_tube then dofile(pipeworks.modpath.."/teleport_tube.lua") end
|
||||
if pipeworks.enable_pipe_devices then dofile(pipeworks.modpath.."/devices.lua") end
|
||||
|
||||
if pipeworks.enable_redefines then
|
||||
dofile(pipeworks.modpath.."/compat-chests.lua")
|
||||
dofile(pipeworks.modpath.."/compat-furnaces.lua")
|
||||
end
|
||||
if pipeworks.enable_autocrafter then dofile(pipeworks.modpath.."/autocrafter.lua") end
|
||||
if pipeworks.enable_lua_tube then dofile(pipeworks.modpath.."/lua_tube.lua") end
|
||||
if pipeworks.enable_lua_tube and
|
||||
(minetest.get_modpath("mesecons") or minetest.get_modpath("digilines")) then
|
||||
dofile(pipeworks.modpath.."/lua_tube.lua")
|
||||
end
|
||||
|
||||
minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
|
||||
|
||||
print("Pipeworks loaded!")
|
||||
|
||||
|
@ -6,6 +6,8 @@ The rope stops lowering if it reaches an obstruction. Ropes can be cut using an
|
||||
|
||||
Also included is a rope ladder that behaves similarly, though it only comes in one standard maximum length - 50m by default, again changeable in settings.
|
||||
|
||||
This mod will also enhance default wood ladders and steel ladders to make them "extendable", capable of building upward independent of support to a setting-defined limit (defaulting to 5 nodes for wood and 15 nodes for steel ladders). This can be disabled if undesired.
|
||||
|
||||
This mod retains optional backward compatibility with the crafting items from the vines mod (anything with group "vines" can be used to make rope boxes and rope ladders). Ropes can also be made from cotton, available via an optional dependency on the farming mod.
|
||||
|
||||
In-game documentation is provided via an optional dependency on the doc mod.
|
88
ropes/bridge.lua
Normal file
@ -0,0 +1,88 @@
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(modpath.."/intllib.lua")
|
||||
|
||||
if ropes.bridges_enabled then
|
||||
|
||||
local bridge_on_place = function(itemstack, placer, pointed_thing)
|
||||
-- Shall place item and return the leftover itemstack.
|
||||
-- The placer may be any ObjectRef or nil.
|
||||
-- default: minetest.item_place
|
||||
if placer == nil then
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
|
||||
local above = pointed_thing.above
|
||||
local under = pointed_thing.under
|
||||
|
||||
if above.x == under.x and above.z == under.z and above.y > under.y then
|
||||
-- we're aimed downward at a buildable node from above.
|
||||
-- determine the direction the placer lies relative to this node.
|
||||
local new_under = vector.new(under)
|
||||
local placer_pos = placer:get_pos()
|
||||
local diff_x = placer_pos.x - under.x
|
||||
local diff_z = placer_pos.z - under.z
|
||||
if math.abs(diff_x) > math.abs(diff_z) then
|
||||
-- placer is displaced along the X axis relative to the target
|
||||
if diff_x > 0 then
|
||||
new_under.x = under.x - 1
|
||||
else
|
||||
new_under.x = under.x + 1
|
||||
end
|
||||
else
|
||||
-- placer is displaced along the Z axis relative to the target
|
||||
if diff_z > 0 then
|
||||
new_under.z = under.z - 1
|
||||
else
|
||||
new_under.z = under.z + 1
|
||||
end
|
||||
end
|
||||
if minetest.registered_nodes[minetest.get_node(new_under).name].buildable_to then
|
||||
local new_pointed_thing = {type="node", under=new_under, above={x=new_under.x, y=new_under.y+1, z=new_under.z}}
|
||||
return minetest.item_place(itemstack, placer, new_pointed_thing)
|
||||
end
|
||||
end
|
||||
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
|
||||
minetest.register_node("ropes:wood_bridge", {
|
||||
description = S("Wooden Bridge"),
|
||||
_doc_items_longdesc = ropes.doc.wooden_bridge_longdesc,
|
||||
_doc_items_usagehelp = ropes.doc.wooden_bridge_usagehelp,
|
||||
tiles = {
|
||||
"default_wood.png", "default_wood.png",
|
||||
"default_wood.png^[transformR270", "default_wood.png^[transformR90",
|
||||
"default_wood.png^[transformR270", "default_wood.png^[transformR90",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 2, flammable = 2, oddly_breakable_by_hand = 1, flow_through = 1, fence = 1, wall = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, 0.375, -0.5, 0.5, 0.5, 0.5}, -- Platform
|
||||
{-0.375, -0.5, -0.5, 0.375, -0.375, -0.4375}, -- x beam4
|
||||
{-0.375, -0.5, 0.4375, 0.375, -0.375, 0.5}, -- x beam3
|
||||
{0.375, -0.5, -0.4375, 0.5, -0.375, 0.4375}, -- z beam2
|
||||
{-0.5, -0.5, -0.4375, -0.375, -0.375, 0.4375}, -- z beam1
|
||||
{0.375, -0.5, -0.5, 0.5, 0.375, -0.4375}, -- upright4
|
||||
{0.375, -0.5, 0.4375, 0.5, 0.375, 0.5}, -- upright3
|
||||
{-0.5, -0.5, -0.5, -0.375, 0.375, -0.4375}, -- upright2
|
||||
{-0.5, -0.5, 0.4375, -0.375, 0.375, 0.5}, -- upright1
|
||||
}
|
||||
},
|
||||
on_place = bridge_on_place,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ropes:wood_bridge 5",
|
||||
recipe = {
|
||||
{"group:stick", "stairs:slab_wood", "group:stick"},
|
||||
{"group:stick", "", "group:stick"},
|
||||
{"group:stick", "group:stick", "group:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
end
|
@ -39,6 +39,14 @@ ropes.doc.ropebox_usage = rope_length_doc .. "\n\n" ..
|
||||
S("When a rope box is placed the rope will immediately begin lowering from it at one meter per second. The rope will only descend when its end is in the vicinity of an active player, suspending its journey when no players are nearby, so a long descent may require a player to climb down the rope as it goes. If you are near the bottom end of a rope that's extending you'll be automatically carried down with it. The rope will stop when it encounters and obstruction, but will resume lowering if the obstruction is removed.") .. "\n\n" ..
|
||||
S("A rope can be severed midway using an axe or other similar tool. The section of rope below the cut will collapse and disappear, potentially causing players who were hanging on to it to fall. The remaining rope will not resume descent on its own, but the rope box at the top of the rope \"remembers\" how long the rope was and if it is deconstructed and replaced it will still have the same maximum length of rope as before - no rope is permanently lost when a rope is severed like this.")
|
||||
|
||||
if ropes.extending_ladder_enabled then
|
||||
ropes.doc.ladder_longdesc = S("A ladder for climbing. It can reach greater heights when placed against a supporting block.")
|
||||
ropes.doc.ladder_usagehelp = S("Right-clicking on a ladder with a stack of identical ladder items will automatically add new ladder segments to the top, provided it hasn't extended too far up beyond the last block behind it providing support.")
|
||||
end
|
||||
|
||||
ropes.doc.wooden_bridge_longdesc = S("A wooden platform with support struts useful for bridging gaps.")
|
||||
ropes.doc.wooden_bridge_usagehelp = S("This behaves like most structural blocks except in one circumstance: when placed on top of a block with buildable space on the side facing away from you, this block will not be built on top but instead will extend out from that far side of the target block. This allows a platform to be easily built that juts out away from the location you're standing on.")
|
||||
|
||||
doc.add_entry_alias("nodes", "ropes:ropeladder_top", "nodes", "ropes:ropeladder")
|
||||
doc.add_entry_alias("nodes", "ropes:ropeladder_top", "nodes", "ropes:ropeladder_bottom")
|
||||
doc.add_entry_alias("nodes", "ropes:ropeladder_top", "nodes", "ropes:ropeladder_falling")
|
||||
|
204
ropes/extendingladder.lua
Normal file
@ -0,0 +1,204 @@
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(modpath.."/intllib.lua")
|
||||
|
||||
if ropes.extending_ladder_enabled then
|
||||
|
||||
minetest.unregister_item("default:ladder_wood")
|
||||
minetest.unregister_item("default:ladder_steel")
|
||||
minetest.clear_craft({output = "default:ladder_wood"})
|
||||
minetest.clear_craft({output = "default:ladder_steel"})
|
||||
|
||||
local wallmounted_to_facedir =
|
||||
{[0] = 15, -- ceiling
|
||||
[1] = 13, -- floor
|
||||
[2] = 1, -- +X
|
||||
[3] = 3, -- -X
|
||||
[4] = 0, -- +Z
|
||||
[5] = 2, -- -Z
|
||||
}
|
||||
|
||||
minetest.register_lbm({
|
||||
label = "Switch from wallmounted default ladders to rope mod extending ladders",
|
||||
name = "ropes:wallmounted_ladder_to_facedir_ladder",
|
||||
nodenames = {"default:ladder_wood", "default:ladder_steel"},
|
||||
run_at_every_load = false,
|
||||
action = function(pos, node)
|
||||
local new_node = {param2 = wallmounted_to_facedir[node.param2]}
|
||||
if (node.name == "default:ladder_wood") then
|
||||
new_node.name = "ropes:ladder_wood"
|
||||
else
|
||||
new_node.name = "ropes:ladder_steel"
|
||||
end
|
||||
minetest.set_node(pos, new_node)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ropes:ladder_wood 5",
|
||||
recipe = {
|
||||
{"group:stick", "", "group:stick"},
|
||||
{"group:stick", "group:stick", "group:stick"},
|
||||
{"group:stick", "", "group:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'ropes:ladder_steel 15',
|
||||
recipe = {
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
local ladder_extender = function(pos, node, clicker, itemstack, pointed_thing, ladder_node, standing_limit)
|
||||
local clicked_stack = ItemStack(itemstack)
|
||||
|
||||
-- true if we're pointing up at the ladder from below and there's a buildable space below it
|
||||
-- this check allows us to extend ladders downward
|
||||
local pointing_directly_below =
|
||||
pointed_thing.above.x == pos.x and
|
||||
pointed_thing.above.z == pos.z and
|
||||
pointed_thing.above.y == pos.y - 1 and
|
||||
minetest.registered_nodes[minetest.get_node(pointed_thing.above).name].buildable_to
|
||||
|
||||
if clicked_stack:get_name() == ladder_node and not pointing_directly_below then
|
||||
local param2 = minetest.get_node(pos).param2
|
||||
local dir = minetest.facedir_to_dir(param2)
|
||||
local scan_limit = pos.y + 6 -- Only add ladder segments up to five nodes above the one clicked on
|
||||
pos.y = pos.y + 1
|
||||
while pos.y < scan_limit and minetest.get_node(pos).name == ladder_node do
|
||||
param2 = minetest.get_node(pos).param2
|
||||
pos.y = pos.y + 1
|
||||
end
|
||||
if pos.y < scan_limit and minetest.registered_nodes[minetest.get_node(pos).name].buildable_to then
|
||||
|
||||
-- scan downward behind the ladder to find support
|
||||
local behind_pos = vector.add(pos, minetest.facedir_to_dir(param2))
|
||||
local target_height = pos.y - standing_limit - 1
|
||||
while behind_pos.y > target_height and minetest.registered_nodes[minetest.get_node(behind_pos).name].buildable_to do
|
||||
behind_pos.y = behind_pos.y - 1
|
||||
end
|
||||
|
||||
-- If there's enough support, build a new ladder segment
|
||||
if behind_pos.y > target_height then
|
||||
if minetest.is_protected(pos, clicker:get_player_name()) then
|
||||
minetest.record_protection_violation(clicker:get_player_name())
|
||||
else
|
||||
minetest.set_node(pos, {name=ladder_node, param2=param2})
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
clicked_stack:take_item(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif clicked_stack:get_definition().type == "node" then
|
||||
return minetest.item_place_node(itemstack, clicker, pointed_thing)
|
||||
end
|
||||
return clicked_stack
|
||||
end
|
||||
|
||||
minetest.register_node("ropes:ladder_wood", {
|
||||
description = S("Wooden Ladder"),
|
||||
_doc_items_longdesc = ropes.doc.ladder_longdesc,
|
||||
_doc_items_usagehelp = ropes.doc.ladder_usagehelp,
|
||||
tiles = {"default_wood.png","default_wood.png","default_wood.png^[transformR270","default_wood.png^[transformR270","default_ladder_wood.png"},
|
||||
inventory_image = "default_ladder_wood.png",
|
||||
wield_image = "default_ladder_wood.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
is_ground_content = false,
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.375, -0.5, 0.375, -0.25, 0.5, 0.5}, -- Upright1
|
||||
{0.25, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Upright2
|
||||
{-0.4375, 0.3125, 0.4375, 0.4375, 0.4375, 0.5}, -- Rung_4
|
||||
{-0.4375, -0.1875, 0.4375, 0.4375, -0.0625, 0.5}, -- Rung_2
|
||||
{-0.4375, -0.4375, 0.4375, 0.4375, -0.3125, 0.5}, -- Rung_1
|
||||
{-0.4375, 0.0625, 0.4375, 0.4375, 0.1875, 0.5}, -- Rung_3
|
||||
}
|
||||
},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2, flow_through = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
return ladder_extender(pos, node, clicker, itemstack, pointed_thing, "ropes:ladder_wood", ropes.extending_wood_ladder_limit)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("ropes:ladder_steel", {
|
||||
description = S("Steel Ladder"),
|
||||
_doc_items_longdesc = ropes.doc.ladder_longdesc,
|
||||
_doc_items_usagehelp = ropes.doc.ladder_usagehelp,
|
||||
tiles = {"default_steel_block.png","default_steel_block.png","default_steel_block.png","default_steel_block.png","default_ladder_steel.png"},
|
||||
inventory_image = "default_ladder_steel.png",
|
||||
wield_image = "default_ladder_steel.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
is_ground_content = false,
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.5, 0.3125, -0.25, 0.5, 0.5}, -- Upright1
|
||||
{0.25, -0.5, 0.3125, 0.4375, 0.5, 0.5}, -- Upright2
|
||||
{-0.25, 0.3125, 0.375, 0.25, 0.4375, 0.5}, -- Rung_4
|
||||
{-0.25, -0.1875, 0.375, 0.25, -0.0625, 0.5}, -- Rung_2
|
||||
{-0.25, -0.4375, 0.375, 0.25, -0.3125, 0.5}, -- Rung_1
|
||||
{-0.25, 0.0625, 0.375, 0.25, 0.1875, 0.5}, -- Rung_3
|
||||
}
|
||||
},
|
||||
groups = {cracky = 2, flow_through = 1},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
return ladder_extender(pos, node, clicker, itemstack, pointed_thing, "ropes:ladder_steel", ropes.extending_steel_ladder_limit)
|
||||
end,
|
||||
})
|
||||
|
||||
else
|
||||
|
||||
-- Table of possible wallmounted values
|
||||
local facedir_to_wallmounted = {
|
||||
4, -- +Z
|
||||
2, -- +X
|
||||
5, -- -Z
|
||||
3, -- -X
|
||||
1, -- -Y
|
||||
0, -- +Y
|
||||
}
|
||||
-- Mapping from facedir value to index in facedir_to_dir.
|
||||
local facedir_to_wallmounted_map = {
|
||||
[0]=1, 2, 3, 4,
|
||||
5, 2, 6, 4,
|
||||
6, 2, 5, 4,
|
||||
1, 5, 3, 6,
|
||||
1, 6, 3, 5,
|
||||
1, 4, 3, 2,
|
||||
}
|
||||
|
||||
minetest.register_lbm({
|
||||
label = "Switch from ropes ladders to wallmounted default ladders",
|
||||
name = "ropes:facedir_ladder_to_wallmounted_ladder",
|
||||
nodenames = {"ropes:ladder_wood", "ropes:ladder_steel"},
|
||||
run_at_every_load = false,
|
||||
action = function(pos, node)
|
||||
local new_node = {param2 = facedir_to_wallmounted[facedir_to_wallmounted_map[node.param2 % 32]]}
|
||||
if (node.name == "ropes:ladder_wood") then
|
||||
new_node.name = "default:ladder_wood"
|
||||
else
|
||||
new_node.name = "default:ladder_steel"
|
||||
end
|
||||
minetest.set_node(pos, new_node)
|
||||
end,
|
||||
})
|
||||
|
||||
end
|
@ -7,18 +7,33 @@ local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
ropes.ropeLength = tonumber(minetest.settings:get("ropes_rope_length")) or 50
|
||||
ropes.ropeLadderLength = tonumber(minetest.settings:get("ropes_rope_ladder_length")) or 50
|
||||
ropes.woodRopeBoxMaxMultiple = tonumber(minetest.settings:get("ropes_wood_rope_box_max_multiple")) or 2
|
||||
ropes.copperRopeBoxMaxMultiple = tonumber(minetest.settings:get("ropes_copper_rope_box_max_multiple")) or 5
|
||||
ropes.steelRopeBoxMaxMultiple = tonumber(minetest.settings:get("ropes_steel_rope_box_max_multiple")) or 9
|
||||
ropes.create_all_definitions = minetest.settings:get_bool("ropes_create_all_definitions")
|
||||
|
||||
dofile( minetest.get_modpath( ropes.name ) .. "/doc.lua" )
|
||||
dofile( minetest.get_modpath( ropes.name ) .. "/functions.lua" )
|
||||
dofile( minetest.get_modpath( ropes.name ) .. "/crafts.lua" )
|
||||
dofile( minetest.get_modpath( ropes.name ) .. "/ropeboxes.lua" )
|
||||
dofile( minetest.get_modpath( ropes.name ) .. "/ladder.lua" )
|
||||
dofile( minetest.get_modpath( ropes.name ) .. "/loot.lua" )
|
||||
ropes.ropeLadderLength = tonumber(minetest.settings:get("ropes_rope_ladder_length")) or 50
|
||||
|
||||
ropes.extending_ladder_enabled = minetest.settings:get_bool("ropes_extending_ladder_enabled")
|
||||
if ropes.extending_ladder_enabled == nil then
|
||||
ropes.extending_ladder_enabled = true
|
||||
end
|
||||
ropes.extending_wood_ladder_limit = tonumber(minetest.settings:get("ropes_extending_wood_ladder_limit")) or 5
|
||||
ropes.extending_steel_ladder_limit = tonumber(minetest.settings:get("ropes_extending_steel_ladder_limit")) or 15
|
||||
|
||||
ropes.bridges_enabled = minetest.settings:get_bool("ropes_bridges_enabled")
|
||||
if ropes.bridges_enabled == nil then
|
||||
ropes.bridges_enabled = true
|
||||
end
|
||||
|
||||
dofile( MP .. "/doc.lua" )
|
||||
dofile( MP .. "/functions.lua" )
|
||||
dofile( MP .. "/crafts.lua" )
|
||||
dofile( MP .. "/ropeboxes.lua" )
|
||||
dofile( MP .. "/ropeladder.lua" )
|
||||
dofile( MP .. "/extendingladder.lua" )
|
||||
dofile( MP .. "/bridge.lua" )
|
||||
dofile( MP .. "/loot.lua" )
|
||||
|
||||
|
||||
for i=1,5 do
|
||||
@ -40,4 +55,4 @@ minetest.register_alias("castle:ropes", "ropes:rope")
|
||||
minetest.register_alias("castle:ropebox", "ropes:steel1rope_block")
|
||||
minetest.register_alias("castle:box_rope", "ropes:rope")
|
||||
|
||||
print(S("[Ropes] Loaded!"))
|
||||
print("[Ropes] Loaded!")
|
||||
|
@ -7,18 +7,22 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-10-27 10:41+0200\n"
|
||||
"POT-Creation-Date: 2018-11-27 22:45-0700\n"
|
||||
"PO-Revision-Date: 2018-10-27 11:26+0200\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.8.11\n"
|
||||
"Last-Translator: \n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"Language: es\n"
|
||||
|
||||
#: crafts.lua:17
|
||||
#: bridge.lua:47
|
||||
msgid "Wooden Bridge"
|
||||
msgstr ""
|
||||
|
||||
#: crafts.lua:54
|
||||
msgid "Rope Segment"
|
||||
msgstr "Segmento de cuerda"
|
||||
|
||||
@ -83,23 +87,33 @@ msgstr ""
|
||||
"recuperar dos segmentos de cable colocando solo la caja de cable de @1m en "
|
||||
"la rejilla de fabricación."
|
||||
|
||||
#: doc.lua:20 doc.lua:22 ropeboxes.lua:302
|
||||
#: doc.lua:20
|
||||
#: doc.lua:22
|
||||
#: ropeboxes.lua:321
|
||||
msgid "Wood"
|
||||
msgstr "madera"
|
||||
|
||||
#: doc.lua:20 doc.lua:26 doc.lua:32
|
||||
#: doc.lua:20
|
||||
#: doc.lua:26
|
||||
#: doc.lua:32
|
||||
msgid "rope boxes can hold @1m of rope."
|
||||
msgstr "Las cajas de cuerdas pueden mantener @1m de cuerda."
|
||||
|
||||
#: doc.lua:22 doc.lua:28 doc.lua:34
|
||||
#: doc.lua:22
|
||||
#: doc.lua:28
|
||||
#: doc.lua:34
|
||||
msgid "rope boxes can hold rope lengths from @1m to @2m."
|
||||
msgstr "Las cajas de cuerda pueden contener longitudes de cuerda de @1m a @2m."
|
||||
|
||||
#: doc.lua:26 doc.lua:28 ropeboxes.lua:319
|
||||
#: doc.lua:26
|
||||
#: doc.lua:28
|
||||
#: ropeboxes.lua:338
|
||||
msgid "Copper"
|
||||
msgstr "cobre"
|
||||
|
||||
#: doc.lua:32 doc.lua:34 ropeboxes.lua:336
|
||||
#: doc.lua:32
|
||||
#: doc.lua:34
|
||||
#: ropeboxes.lua:355
|
||||
msgid "Steel"
|
||||
msgstr "acero"
|
||||
|
||||
@ -149,18 +163,52 @@ msgstr ""
|
||||
"longitud máxima de cuerda que antes - ninguna cuerda se pierde "
|
||||
"permanentemente cuando una cuerda es cortada de esta manera."
|
||||
|
||||
#: init.lua:72
|
||||
msgid "[Ropes] Loaded!"
|
||||
msgstr "¡[Ropes] Cargado!"
|
||||
#: doc.lua:43
|
||||
msgid ""
|
||||
"A ladder for climbing. It can reach greater heights when placed against a "
|
||||
"supporting block."
|
||||
msgstr ""
|
||||
|
||||
#: ladder.lua:27 ladder.lua:78 ladder.lua:108 ladder.lua:142
|
||||
msgid "Rope Ladder"
|
||||
msgstr "Escalera de cuerda"
|
||||
#: doc.lua:44
|
||||
msgid ""
|
||||
"Right-clicking on a ladder with a stack of identical ladder items will "
|
||||
"automatically add new ladder segments to the top, provided it hasn't "
|
||||
"extended too far up beyond the last block behind it providing support."
|
||||
msgstr ""
|
||||
|
||||
#: doc.lua:47
|
||||
msgid "A wooden platform with support struts useful for bridging gaps."
|
||||
msgstr ""
|
||||
|
||||
#: doc.lua:48
|
||||
msgid ""
|
||||
"This behaves like most structural blocks except in one circumstance: when "
|
||||
"placed on top of a block with buildable space on the side facing away from "
|
||||
"you, this block will not be built on top but instead will extend out from "
|
||||
"that far side of the target block. This allows a platform to be easily built "
|
||||
"that juts out away from the location you're standing on."
|
||||
msgstr ""
|
||||
|
||||
#: extendingladder.lua:103
|
||||
msgid "Wooden Ladder"
|
||||
msgstr ""
|
||||
|
||||
#: extendingladder.lua:136
|
||||
msgid "Steel Ladder"
|
||||
msgstr ""
|
||||
|
||||
#: ropeboxes.lua:121
|
||||
msgid "@1 Ropebox @2m"
|
||||
msgstr "Caja de cuerda de @1 de @2m"
|
||||
|
||||
#: ropeboxes.lua:218 ropeboxes.lua:249
|
||||
#: ropeboxes.lua:229
|
||||
#: ropeboxes.lua:264
|
||||
msgid "Rope"
|
||||
msgstr "Cuerda"
|
||||
|
||||
#: ropeladder.lua:27
|
||||
#: ropeladder.lua:89
|
||||
#: ropeladder.lua:119
|
||||
#: ropeladder.lua:153
|
||||
msgid "Rope Ladder"
|
||||
msgstr "Escalera de cuerda"
|
||||
|
@ -8,15 +8,20 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-02-09 21:21-0700\n"
|
||||
"POT-Creation-Date: 2018-11-27 22:45-0700\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: crafts.lua:17
|
||||
#: bridge.lua:47
|
||||
msgid "Wooden Bridge"
|
||||
msgstr ""
|
||||
|
||||
#: crafts.lua:54
|
||||
msgid "Rope Segment"
|
||||
msgstr ""
|
||||
|
||||
@ -58,23 +63,33 @@ msgid ""
|
||||
"box in the crafting grid by itself."
|
||||
msgstr ""
|
||||
|
||||
#: doc.lua:20 doc.lua:22 ropeboxes.lua:302
|
||||
#: doc.lua:20
|
||||
#: doc.lua:22
|
||||
#: ropeboxes.lua:321
|
||||
msgid "Wood"
|
||||
msgstr ""
|
||||
|
||||
#: doc.lua:20 doc.lua:26 doc.lua:32
|
||||
#: doc.lua:20
|
||||
#: doc.lua:26
|
||||
#: doc.lua:32
|
||||
msgid "rope boxes can hold @1m of rope."
|
||||
msgstr ""
|
||||
|
||||
#: doc.lua:22 doc.lua:28 doc.lua:34
|
||||
#: doc.lua:22
|
||||
#: doc.lua:28
|
||||
#: doc.lua:34
|
||||
msgid "rope boxes can hold rope lengths from @1m to @2m."
|
||||
msgstr ""
|
||||
|
||||
#: doc.lua:26 doc.lua:28 ropeboxes.lua:319
|
||||
#: doc.lua:26
|
||||
#: doc.lua:28
|
||||
#: ropeboxes.lua:338
|
||||
msgid "Copper"
|
||||
msgstr ""
|
||||
|
||||
#: doc.lua:32 doc.lua:34 ropeboxes.lua:336
|
||||
#: doc.lua:32
|
||||
#: doc.lua:34
|
||||
#: ropeboxes.lua:355
|
||||
msgid "Steel"
|
||||
msgstr ""
|
||||
|
||||
@ -106,18 +121,52 @@ msgid ""
|
||||
"permanently lost when a rope is severed like this."
|
||||
msgstr ""
|
||||
|
||||
#: init.lua:72
|
||||
msgid "[Ropes] Loaded!"
|
||||
#: doc.lua:43
|
||||
msgid ""
|
||||
"A ladder for climbing. It can reach greater heights when placed against a "
|
||||
"supporting block."
|
||||
msgstr ""
|
||||
|
||||
#: ladder.lua:27 ladder.lua:78 ladder.lua:108 ladder.lua:142
|
||||
msgid "Rope Ladder"
|
||||
#: doc.lua:44
|
||||
msgid ""
|
||||
"Right-clicking on a ladder with a stack of identical ladder items will "
|
||||
"automatically add new ladder segments to the top, provided it hasn't "
|
||||
"extended too far up beyond the last block behind it providing support."
|
||||
msgstr ""
|
||||
|
||||
#: doc.lua:47
|
||||
msgid "A wooden platform with support struts useful for bridging gaps."
|
||||
msgstr ""
|
||||
|
||||
#: doc.lua:48
|
||||
msgid ""
|
||||
"This behaves like most structural blocks except in one circumstance: when "
|
||||
"placed on top of a block with buildable space on the side facing away from "
|
||||
"you, this block will not be built on top but instead will extend out from "
|
||||
"that far side of the target block. This allows a platform to be easily built "
|
||||
"that juts out away from the location you're standing on."
|
||||
msgstr ""
|
||||
|
||||
#: extendingladder.lua:103
|
||||
msgid "Wooden Ladder"
|
||||
msgstr ""
|
||||
|
||||
#: extendingladder.lua:136
|
||||
msgid "Steel Ladder"
|
||||
msgstr ""
|
||||
|
||||
#: ropeboxes.lua:121
|
||||
msgid "@1 Ropebox @2m"
|
||||
msgstr ""
|
||||
|
||||
#: ropeboxes.lua:218 ropeboxes.lua:249
|
||||
#: ropeboxes.lua:229
|
||||
#: ropeboxes.lua:264
|
||||
msgid "Rope"
|
||||
msgstr ""
|
||||
|
||||
#: ropeladder.lua:27
|
||||
#: ropeladder.lua:89
|
||||
#: ropeladder.lua:119
|
||||
#: ropeladder.lua:153
|
||||
msgid "Rope Ladder"
|
||||
msgstr ""
|
||||
|
6
ropes/locale/update.bat
Normal file
@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||
cd ..
|
||||
set LIST=
|
||||
for /r %%X in (*.lua) do set LIST=!LIST! %%X
|
||||
..\intllib\tools\xgettext.bat %LIST%
|
@ -34,4 +34,17 @@ ropes_steel_rope_box_max_multiple (Maximum steel rope box multiple) int 9 0 9
|
||||
#intended for the situation where you have an established world and you want
|
||||
#to reduce the number of rope boxes available to players without turning
|
||||
#existing rope boxes into "unknown node"s.
|
||||
ropes_create_all_definitions (Create all rope box definitions) bool false
|
||||
ropes_create_all_definitions (Create all rope box definitions) bool false
|
||||
|
||||
#Extending ladders replaces the default wallmounted wood and steel ladders
|
||||
#with ladders capable of standing on their own, to a defined limit.
|
||||
#A ladder can extend to its unsupported limit before needing another node
|
||||
#behind it to provide a new point of support. Right-clicking on an existing
|
||||
#ladder with a stack of ladders will add new ladder segments to its top.
|
||||
ropes_extending_ladder_enabled (Enable extendable ladders) bool true
|
||||
ropes_extending_wood_ladder_limit (Unsupported limit of wooden ladders) int 5
|
||||
ropes_extending_steel_ladder_limit (Unsupported limit of steel ladders) int 15
|
||||
|
||||
#These nodes make it easier to build bridges by extending out away
|
||||
#from the player as they're placed
|
||||
ropes_bridges_enabled (Enable bridges) bool true
|
@ -42,7 +42,7 @@ end)
|
||||
-- | |
|
||||
-- \___/\___/
|
||||
|
||||
local function update_forcefield(pos, meta, active, first)
|
||||
local function update_forcefield(pos, meta, active)
|
||||
local shape = meta:get_int("shape")
|
||||
local range = meta:get_int("range")
|
||||
local vm = VoxelManip()
|
||||
@ -86,11 +86,6 @@ local function update_forcefield(pos, meta, active, first)
|
||||
vm:set_data(data)
|
||||
vm:update_liquids()
|
||||
vm:write_to_map()
|
||||
-- update_map is very slow, but if we don't call it we'll
|
||||
-- get phantom blocks on the client.
|
||||
if not active or first then
|
||||
vm:update_map()
|
||||
end
|
||||
end
|
||||
|
||||
local function set_forcefield_formspec(meta)
|
||||
@ -273,13 +268,11 @@ local function run(pos, node)
|
||||
technic.swap_node(pos, "technic:forcefield_emitter_off")
|
||||
end
|
||||
elseif eu_input >= power_requirement then
|
||||
local first = false
|
||||
if node.name == "technic:forcefield_emitter_off" then
|
||||
first = true
|
||||
technic.swap_node(pos, "technic:forcefield_emitter_on")
|
||||
meta:set_string("infotext", S("%s Active"):format(machine_name))
|
||||
end
|
||||
update_forcefield(pos, meta, true, first)
|
||||
update_forcefield(pos, meta, true)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -112,6 +112,11 @@ local function quarry_run(pos, node)
|
||||
|
||||
if meta:get_int("enabled") and meta:get_int("HV_EU_input") >= quarry_demand and meta:get_int("purge_on") == 0 then
|
||||
local pdir = minetest.facedir_to_dir(node.param2)
|
||||
if pdir.y ~= 0 then
|
||||
-- faces up or down, not valid, otherwise depth-check would run endless and hang up the server
|
||||
return
|
||||
end
|
||||
|
||||
local qdir = pdir.x == 1 and vector.new(0,0,-1) or
|
||||
(pdir.z == -1 and vector.new(-1,0,0) or
|
||||
(pdir.x == -1 and vector.new(0,0,1) or
|
||||
|
12
technic/machines/MV/freezer.lua
Normal file
@ -0,0 +1,12 @@
|
||||
-- MV freezer
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:mv_freezer',
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:motor', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:pipe_1_empty', 'technic:mv_transformer', 'pipeworks:pipe_1_empty'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
technic.register_freezer({tier = "MV", demand = {800, 600, 400}, speed = 0.5, upgrade = 1, tube = 1})
|
@ -18,7 +18,7 @@ minetest.register_craft({
|
||||
|
||||
local function get_water_flow(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if minetest.get_item_group(node.name, "water") == 3 then
|
||||
if minetest.get_item_group(node.name, "water") == 3 and string.find(node.name, "flowing") then
|
||||
return node.param2 -- returns approx. water flow, if any
|
||||
end
|
||||
return 0
|
||||
|
@ -25,6 +25,8 @@ dofile(path.."/centrifuge.lua")
|
||||
|
||||
dofile(path.."/tool_workshop.lua")
|
||||
|
||||
dofile(path.."/freezer.lua")
|
||||
|
||||
-- The power radiator supplies appliances with inductive coupled power:
|
||||
-- Lighting and associated textures is taken directly from VanessaE's homedecor and made electric.
|
||||
-- This is currently useless, slow, and mostly copied
|
||||
|
9
technic/machines/register/freezer.lua
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
function technic.register_freezer(data)
|
||||
data.typename = "freezing"
|
||||
data.machine_name = "freezer"
|
||||
data.machine_desc = S("%s Freezer")
|
||||
technic.register_base_machine(data)
|
||||
end
|
21
technic/machines/register/freezer_recipes.lua
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
technic.register_recipe_type("freezing", { description = S("Freezing") })
|
||||
|
||||
function technic.register_freezer_recipe(data)
|
||||
data.time = data.time or 5
|
||||
technic.register_recipe("freezing", data)
|
||||
end
|
||||
|
||||
local recipes = {
|
||||
{"bucket:bucket_water", { "default:ice", "bucket:bucket_empty" } },
|
||||
{"bucket:bucket_river_water", { "default:ice", "bucket:bucket_empty" } },
|
||||
{"default:dirt", "default:dirt_with_snow" },
|
||||
{"bucket:bucket_lava", { "default:obsidian", "bucket:bucket_empty" } }
|
||||
}
|
||||
|
||||
for _, data in pairs(recipes) do
|
||||
technic.register_freezer_recipe({input = {data[1]}, output = data[2]})
|
||||
end
|
||||
|
@ -30,6 +30,8 @@ local recipes = {
|
||||
{"default:sandstone", "default:sand 2"}, -- reverse recipe can be found in the compressor
|
||||
{"default:desert_sandstone", "default:desert_sand 2"}, -- reverse recipe can be found in the compressor
|
||||
{"default:silver_sandstone", "default:silver_sand 2"}, -- reverse recipe can be found in the compressor
|
||||
|
||||
{"default:ice", "default:snowblock"},
|
||||
}
|
||||
|
||||
-- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe)
|
||||
|
@ -20,6 +20,7 @@ dofile(path.."/grinder_recipes.lua")
|
||||
dofile(path.."/extractor_recipes.lua")
|
||||
dofile(path.."/compressor_recipes.lua")
|
||||
dofile(path.."/centrifuge_recipes.lua")
|
||||
dofile(path.."/freezer_recipes.lua")
|
||||
|
||||
-- Multi-Machine Recipes
|
||||
dofile(path.."/grindings.lua")
|
||||
@ -31,3 +32,4 @@ dofile(path.."/grinder.lua")
|
||||
dofile(path.."/extractor.lua")
|
||||
dofile(path.."/compressor.lua")
|
||||
dofile(path.."/centrifuge.lua")
|
||||
dofile(path.."/freezer.lua")
|
||||
|
BIN
technic/textures/technic_mv_freezer_bottom.png
Normal file
After (image error) Size: 284 B |
BIN
technic/textures/technic_mv_freezer_front.png
Normal file
After (image error) Size: 413 B |
BIN
technic/textures/technic_mv_freezer_front_active.png
Normal file
After (image error) Size: 447 B |
BIN
technic/textures/technic_mv_freezer_side.png
Normal file
After (image error) Size: 381 B |
BIN
technic/textures/technic_mv_freezer_top.png
Normal file
After (image error) Size: 325 B |
BIN
technic/textures/technicx32/technic_mv_freezer_bottom.png
Normal file
After (image error) Size: 672 B |
BIN
technic/textures/technicx32/technic_mv_freezer_front.png
Normal file
After (image error) Size: 947 B |
BIN
technic/textures/technicx32/technic_mv_freezer_front_active.png
Normal file
After (image error) Size: 1.1 KiB |
BIN
technic/textures/technicx32/technic_mv_freezer_side.png
Normal file
After (image error) Size: 1.1 KiB |
BIN
technic/textures/technicx32/technic_mv_freezer_top.png
Normal file
After (image error) Size: 826 B |
@ -223,7 +223,8 @@ function unified_inventory.get_formspec(player, page)
|
||||
for y = 0, ui_peruser.pagerows - 1 do
|
||||
for x = 0, ui_peruser.pagecols - 1 do
|
||||
local name = unified_inventory.filtered_items_list[player_name][list_index]
|
||||
if minetest.registered_items[name] then
|
||||
local item = minetest.registered_items[name]
|
||||
if item then
|
||||
-- Clicked on current item: Flip crafting direction
|
||||
if name == unified_inventory.current_item[player_name] then
|
||||
local cdir = unified_inventory.current_craft_direction[player_name]
|
||||
@ -236,12 +237,18 @@ function unified_inventory.get_formspec(player, page)
|
||||
-- Default: use active search direction by default
|
||||
dir = unified_inventory.active_search_direction[player_name]
|
||||
end
|
||||
formspec[n] = "item_image_button["
|
||||
..(8.2 + x * 0.7)..","
|
||||
..(ui_peruser.formspec_y + ui_peruser.page_y + y * 0.7)..";.81,.81;"
|
||||
..name..";item_button_"..dir.."_"
|
||||
..unified_inventory.mangle_for_formspec(name)..";]"
|
||||
n = n+1
|
||||
|
||||
local button_name = "item_button_" .. dir .. "_"
|
||||
.. unified_inventory.mangle_for_formspec(name)
|
||||
formspec[n] = ("item_image_button[%f,%f;.81,.81;%s;%s;]"):format(
|
||||
8.2 + x * 0.7, ui_peruser.formspec_y + ui_peruser.page_y + y * 0.7,
|
||||
name, button_name
|
||||
)
|
||||
formspec[n + 1] = ("tooltip[%s;%s \\[%s\\]]"):format(
|
||||
button_name, minetest.formspec_escape(item.description),
|
||||
item.mod_origin or "??"
|
||||
)
|
||||
n = n + 2
|
||||
list_index = list_index + 1
|
||||
end
|
||||
end
|
||||
|
@ -128,7 +128,7 @@ unifieddyes.GREYS = {
|
||||
unifieddyes.GREYS_EXTENDED = table.copy(unifieddyes.GREYS)
|
||||
|
||||
for i = 1, 14 do
|
||||
if i ~= 0 and i ~= 3 and i ~= 7 and i ~= 11 and i ~= 15 then
|
||||
if i ~= 0 and i ~= 4 and i ~= 8 and i ~= 11 and i ~= 15 then
|
||||
table.insert(unifieddyes.GREYS_EXTENDED, "grey_"..i)
|
||||
end
|
||||
end
|
||||
@ -449,7 +449,7 @@ function unifieddyes.getpaletteidx(color, palette_type)
|
||||
["grey_14"] = 1,
|
||||
["grey_13"] = 2,
|
||||
["grey_12"] = 3,
|
||||
["light_grey"] = 3,
|
||||
["light_grey"] = 4,
|
||||
["grey_11"] = 4,
|
||||
["grey_10"] = 5,
|
||||
["grey_9"] = 6,
|
||||
@ -630,6 +630,19 @@ function unifieddyes.getpaletteidx(color, palette_type)
|
||||
end
|
||||
end
|
||||
|
||||
function unifieddyes.get_color_from_dye_name(name)
|
||||
if name == "dye:black" then
|
||||
return "000000"
|
||||
elseif name == "dye:white" then
|
||||
return "ffffff"
|
||||
end
|
||||
local item = minetest.registered_items[name]
|
||||
if not item then return end
|
||||
local inv_image = item.inventory_image
|
||||
if not inv_image then return end
|
||||
return string.match(inv_image,"colorize:#(......):200")
|
||||
end
|
||||
|
||||
-- punch-to-recolor using the airbrush
|
||||
|
||||
function unifieddyes.on_airbrush(itemstack, player, pointed_thing)
|
||||
@ -640,8 +653,28 @@ function unifieddyes.on_airbrush(itemstack, player, pointed_thing)
|
||||
painting_with = unifieddyes.player_current_dye[player_name]
|
||||
end
|
||||
|
||||
if not painting_with then
|
||||
minetest.chat_send_player(player_name, "*** You need to set a color first.")
|
||||
minetest.chat_send_player(player_name, "*** Right-click any random node to open the color selector,")
|
||||
minetest.chat_send_player(player_name, "*** or shift+right-click a colorized node to use its color.")
|
||||
minetest.chat_send_player(player_name, "*** Be sure to click \"Accept\", or the color you select will be ignored.")
|
||||
return
|
||||
end
|
||||
|
||||
local pos = minetest.get_pointed_thing_position(pointed_thing)
|
||||
if not pos then return end
|
||||
if not pos then
|
||||
local look_angle = player:get_look_vertical()
|
||||
if look_angle > -1.55 then
|
||||
minetest.chat_send_player(player_name, "*** No node selected")
|
||||
else
|
||||
local hexcolor = unifieddyes.get_color_from_dye_name(painting_with)
|
||||
local r = tonumber(string.sub(hexcolor,1,2),16)
|
||||
local g = tonumber(string.sub(hexcolor,3,4),16)
|
||||
local b = tonumber(string.sub(hexcolor,5,6),16)
|
||||
player:set_sky({r=r,g=g,b=b,a=255},"plain")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local node = minetest.get_node(pos)
|
||||
local def = minetest.registered_items[node.name]
|
||||
@ -652,14 +685,6 @@ function unifieddyes.on_airbrush(itemstack, player, pointed_thing)
|
||||
return
|
||||
end
|
||||
|
||||
if not painting_with then
|
||||
minetest.chat_send_player(player_name, "*** You need to set a color first.")
|
||||
minetest.chat_send_player(player_name, "*** Right-click any random node to open the color selector,")
|
||||
minetest.chat_send_player(player_name, "*** or shift+right-click a colorized node to use its color.")
|
||||
minetest.chat_send_player(player_name, "*** Be sure to click \"Accept\", or the color you select will be ignored.")
|
||||
return
|
||||
end
|
||||
|
||||
if not (def.groups and def.groups.ud_param2_colorable and def.groups.ud_param2_colorable > 0) then
|
||||
minetest.chat_send_player(player_name, "*** That node can't be colored.")
|
||||
return
|
||||
|
@ -3,6 +3,8 @@ vines = {
|
||||
recipes = {}
|
||||
}
|
||||
|
||||
local enable_roots = minetest.settings:get_bool("vines_enable_roots")
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
|
||||
@ -305,6 +307,14 @@ minetest.register_tool("vines:shears", {
|
||||
})
|
||||
|
||||
-- VINES
|
||||
local spawn_root_surfaces = {}
|
||||
|
||||
if enable_roots ~= false then
|
||||
spawn_root_surfaces = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt"
|
||||
}
|
||||
end
|
||||
|
||||
vines.register_vine('root',
|
||||
{description = S("Roots"), average_length = 9}, {
|
||||
@ -313,10 +323,7 @@ vines.register_vine('root',
|
||||
avoid_radius = 5,
|
||||
spawn_delay = 500,
|
||||
spawn_chance = 10,
|
||||
spawn_surfaces = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt"
|
||||
},
|
||||
spawn_surfaces = spawn_root_surfaces,
|
||||
spawn_on_bottom = true,
|
||||
plantlife_limit = -0.6,
|
||||
humidity_min = 0.4,
|
||||
|
@ -42,7 +42,7 @@ load_module(path .. "/compatibility.lua")
|
||||
load_module(path .. "/cuboid.lua")
|
||||
|
||||
|
||||
if minetest.setting_getbool("log_mods") then
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
print("[WorldEdit] Loaded!")
|
||||
end
|
||||
|
||||
|
@ -108,7 +108,7 @@ end
|
||||
|
||||
minetest.register_chatcommand("/about", {
|
||||
params = "",
|
||||
description = "Get information about the mod",
|
||||
description = "Get information about the WorldEdit mod",
|
||||
func = function(name, param)
|
||||
worldedit.player_notify(name, "WorldEdit " .. worldedit.version_string .. " is available on this server. Type /help to get a list of commands, or get more information at https://github.com/Uberi/Minetest-WorldEdit/")
|
||||
end,
|
||||
|