updated boost_cart, plantlife, castle, homedecor, fake_fire,
glooptest, quartz, unified_inventory, inbox, mesecons, and worldedit modsmaster
|
@ -1,23 +1,47 @@
|
|||
Minetest mod: boost_cart
|
||||
=======================
|
||||
Minetest mod: boost_cart
|
||||
==========================
|
||||
Based on (and fully compatible with) the mod "carts" by PilzAdam
|
||||
Target: Run smoothly and do not use too much CPU
|
||||
Target: Run smoothly as possible even on laggy server
|
||||
|
||||
License of source code:
|
||||
-----------------------
|
||||
WTFPL
|
||||
|
||||
License of media (textures, sounds and models):
|
||||
-----------------------------------------------
|
||||
Features
|
||||
----------
|
||||
- A fast cart for your railway or roller coaster (up to 10 m/s!)
|
||||
- Boost and brake rails
|
||||
- By mesecons controlled Start-Stop rails
|
||||
- Detector rails that send a mesecons signal when the cart drives over them
|
||||
- Rail junction switching with the 'right-left' walking keys
|
||||
- Handbrake with the 'back' key
|
||||
|
||||
|
||||
License for everything
|
||||
------------------------
|
||||
CC-0
|
||||
|
||||
Authors of media files:
|
||||
-----------------------
|
||||
kddekadenz:
|
||||
cart_bottom.png
|
||||
cart_side.png
|
||||
cart_top.png
|
||||
|
||||
Zeg9:
|
||||
cart.x
|
||||
cart.png
|
||||
Authors
|
||||
---------
|
||||
Hawk777
|
||||
carts_rail_ss.png
|
||||
carts_rail_*_ss.png
|
||||
|
||||
hexafraction
|
||||
carts_rail_brk.png
|
||||
carts_rail_*_brk.png
|
||||
carts_rail_pwr.png
|
||||
carts_rail_*_pwr.png
|
||||
|
||||
kddekadenz
|
||||
cart_bottom.png
|
||||
cart_side.png
|
||||
cart_top.png
|
||||
|
||||
numberZero
|
||||
carts_rail_dtc.png
|
||||
carts_rail_dtc_on.png
|
||||
carts_rail_*_dtc.png
|
||||
carts_rail_*_dtc_on.png
|
||||
|
||||
Zeg9
|
||||
cart.x
|
||||
cart.png
|
|
@ -0,0 +1 @@
|
|||
This mod offers improved minecarts and a few more rail types.
|
|
@ -15,7 +15,7 @@ function boost_cart:signal_detector_rail(pos)
|
|||
if minetest.get_item_group(node.name, "detector_rail") ~= 1 then
|
||||
return
|
||||
end
|
||||
--minetest.log("action", "Signaling detector at " .. minetest.pos_to_string(pos))
|
||||
|
||||
if node.name == "boost_cart:detectorrail" then
|
||||
minetest.swap_node(pos, {name = "boost_cart:detectorrail_on", param2=node.param2})
|
||||
end
|
||||
|
@ -25,19 +25,27 @@ end
|
|||
|
||||
boost_cart:register_rail("boost_cart:detectorrail", {
|
||||
description = "Detector rail",
|
||||
tiles = {"carts_rail_dtc.png", "carts_rail_curved_dtc.png", "carts_rail_t_junction_dtc.png", "carts_rail_crossing_dtc.png"},
|
||||
groups = {dig_immediate = 2, attached_node = 1, rail = 1, connect_to_raillike = 1, detector_rail = 1},
|
||||
tiles = {
|
||||
"carts_rail_dtc.png", "carts_rail_curved_dtc.png",
|
||||
"carts_rail_t_junction_dtc.png", "carts_rail_crossing_dtc.png"
|
||||
},
|
||||
groups = boost_cart:get_rail_groups({detector_rail = 1}),
|
||||
|
||||
mesecons = {receptor = {state = "off", rules = mesecons_rules }},
|
||||
mesecons = {receptor = {state = "off", rules = mesecons_rules}},
|
||||
})
|
||||
|
||||
boost_cart:register_rail("boost_cart:detectorrail_on", {
|
||||
description = "Detector rail ON (you hacker you)",
|
||||
tiles = {"carts_rail_dtc_on.png", "carts_rail_curved_dtc_on.png", "carts_rail_t_junction_dtc_on.png", "carts_rail_crossing_dtc_on.png"},
|
||||
groups = {dig_immediate = 2, attached_node = 1, rail = 1, connect_to_raillike = 1, detector_rail = 1, not_in_creative_inventory = 1},
|
||||
tiles = {
|
||||
"carts_rail_dtc_on.png", "carts_rail_curved_dtc_on.png",
|
||||
"carts_rail_t_junction_dtc_on.png", "carts_rail_crossing_dtc_on.png"
|
||||
},
|
||||
groups = boost_cart:get_rail_groups({
|
||||
detector_rail = 1, not_in_creative_inventory = 1
|
||||
}),
|
||||
drop = "boost_cart:detectorrail",
|
||||
|
||||
mesecons = {receptor = {state = "on", rules = mesecons_rules }},
|
||||
mesecons = {receptor = {state = "on", rules = mesecons_rules}},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
|
|
@ -55,7 +55,7 @@ function boost_cart:is_rail(pos, railtype)
|
|||
return minetest.get_item_group(node, "connect_to_raillike") == railtype
|
||||
end
|
||||
|
||||
function boost_cart:check_front_up_down(pos, dir_, check_down, railtype)
|
||||
function boost_cart:check_front_up_down(pos, dir_, check_up, railtype)
|
||||
local dir = vector.new(dir_)
|
||||
local cur = nil
|
||||
|
||||
|
@ -66,7 +66,7 @@ function boost_cart:check_front_up_down(pos, dir_, check_down, railtype)
|
|||
return dir
|
||||
end
|
||||
-- Up
|
||||
if check_down then
|
||||
if check_up then
|
||||
dir.y = 1
|
||||
cur = vector.add(pos, dir)
|
||||
if boost_cart:is_rail(cur, railtype) then
|
||||
|
@ -212,4 +212,15 @@ function boost_cart:register_rail(name, def)
|
|||
end
|
||||
|
||||
minetest.register_node(name, def)
|
||||
end
|
||||
end
|
||||
|
||||
function boost_cart:get_rail_groups(additional_groups)
|
||||
-- Get the default rail groups and add more when a table is given
|
||||
local groups = {dig_immediate = 2, attached_node = 1, rail = 1, connect_to_raillike = 1}
|
||||
if type(additional_groups) == "table" then
|
||||
for k, v in pairs(additional_groups) do
|
||||
groups[k] = v
|
||||
end
|
||||
end
|
||||
return groups
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ end
|
|||
dofile(boost_cart.modpath.."/functions.lua")
|
||||
dofile(boost_cart.modpath.."/rails.lua")
|
||||
|
||||
if mesecon then
|
||||
if minetest.global_exists(mesecon) then
|
||||
dofile(boost_cart.modpath.."/detector.lua")
|
||||
end
|
||||
|
||||
|
@ -44,7 +44,7 @@ boost_cart.cart = {
|
|||
driver = nil,
|
||||
punched = false, -- used to re-send velocity and position
|
||||
velocity = {x=0, y=0, z=0}, -- only used on punch
|
||||
old_dir = {x=0, y=0, z=0},
|
||||
old_dir = {x=1, y=0, z=0}, -- random value to start the cart on punch
|
||||
old_pos = nil,
|
||||
old_switch = 0,
|
||||
railtype = nil,
|
||||
|
@ -75,11 +75,15 @@ function boost_cart.cart:on_activate(staticdata, dtime_s)
|
|||
return
|
||||
end
|
||||
self.railtype = data.railtype
|
||||
if data.old_dir then
|
||||
self.old_dir = data.old_dir
|
||||
end
|
||||
end
|
||||
|
||||
function boost_cart.cart:get_staticdata()
|
||||
return minetest.serialize({
|
||||
railtype = self.railtype
|
||||
railtype = self.railtype,
|
||||
old_dir = self.old_dir
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -92,7 +96,7 @@ function boost_cart.cart:on_punch(puncher, time_from_last_punch, tool_capabiliti
|
|||
end
|
||||
|
||||
if not puncher or not puncher:is_player() then
|
||||
local cart_dir = boost_cart:get_rail_direction(pos, {x=1, y=0, z=0}, nil, nil, self.railtype)
|
||||
local cart_dir = boost_cart:get_rail_direction(pos, self.old_dir, nil, nil, self.railtype)
|
||||
if vector.equals(cart_dir, {x=0, y=0, z=0}) then
|
||||
return
|
||||
end
|
||||
|
@ -147,6 +151,7 @@ function boost_cart.cart:on_punch(puncher, time_from_last_punch, tool_capabiliti
|
|||
local f = 3 * (time_from_last_punch / punch_interval)
|
||||
|
||||
self.velocity = vector.multiply(cart_dir, f)
|
||||
self.old_dir = cart_dir
|
||||
self.old_pos = nil
|
||||
self.punched = true
|
||||
end
|
||||
|
@ -189,7 +194,9 @@ function boost_cart.cart:on_step(dtime)
|
|||
if self.old_pos then
|
||||
-- Detection for "skipping" nodes
|
||||
local expected_pos = vector.add(self.old_pos, self.old_dir)
|
||||
local found_path = boost_cart:pathfinder(pos, expected_pos, self.old_dir, ctrl, self.old_switch, self.railtype)
|
||||
local found_path = boost_cart:pathfinder(
|
||||
pos, expected_pos, self.old_dir, ctrl, self.old_switch, self.railtype
|
||||
)
|
||||
|
||||
if not found_path then
|
||||
-- No rail found: reset back to the expected position
|
||||
|
@ -198,20 +205,12 @@ function boost_cart.cart:on_step(dtime)
|
|||
end
|
||||
end
|
||||
|
||||
if vel.y == 0 then
|
||||
-- Stop cart completely (do not swing)
|
||||
for _,v in ipairs({"x", "z"}) do
|
||||
if vel[v] ~= 0 and math.abs(vel[v]) < 0.9 then
|
||||
vel[v] = 0
|
||||
update.vel = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local cart_dir = boost_cart:velocity_to_dir(vel)
|
||||
local max_vel = boost_cart.speed_max
|
||||
if not dir then
|
||||
dir, last_switch = boost_cart:get_rail_direction(pos, cart_dir, ctrl, self.old_switch, self.railtype)
|
||||
dir, last_switch = boost_cart:get_rail_direction(
|
||||
pos, cart_dir, ctrl, self.old_switch, self.railtype
|
||||
)
|
||||
end
|
||||
|
||||
local new_acc = {x=0, y=0, z=0}
|
||||
|
@ -244,26 +243,39 @@ function boost_cart.cart:on_step(dtime)
|
|||
-- Slow down or speed up..
|
||||
local acc = dir.y * -1.8
|
||||
|
||||
local speed_mod = tonumber(minetest.get_meta(pos):get_string("cart_acceleration"))
|
||||
if speed_mod and speed_mod ~= 0 then
|
||||
if speed_mod > 0 then
|
||||
for _,v in ipairs({"x","y","z"}) do
|
||||
if math.abs(vel[v]) >= max_vel then
|
||||
speed_mod = 0
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
local speed_mod_string = minetest.get_meta(pos):get_string("cart_acceleration")
|
||||
local speed_mod = tonumber(speed_mod_string)
|
||||
if speed_mod_string == "halt" then
|
||||
vel = {x=0, y=0, z=0}
|
||||
acc = 0
|
||||
pos = vector.round(pos)
|
||||
update.pos = true
|
||||
update.vel = true
|
||||
elseif speed_mod and speed_mod ~= 0 then
|
||||
-- Try to make it similar to the original carts mod
|
||||
acc = acc + (speed_mod * 10)
|
||||
else
|
||||
acc = acc - 0.4
|
||||
-- Handbrake
|
||||
if ctrl and ctrl.down and math.abs(vel.x + vel.z) > 1.2 then
|
||||
if ctrl and ctrl.down then
|
||||
acc = acc - 1.2
|
||||
end
|
||||
end
|
||||
|
||||
if self.old_dir.y == 0 and not self.punched then
|
||||
-- Stop the cart swing between two rail parts (handbrake)
|
||||
if vector.equals(vector.multiply(self.old_dir, -1), dir) then
|
||||
vel = {x=0, y=0, z=0}
|
||||
acc = 0
|
||||
if self.old_pos then
|
||||
pos = vector.new(self.old_pos)
|
||||
update.pos = true
|
||||
end
|
||||
dir = vector.new(self.old_dir)
|
||||
update.vel = true
|
||||
end
|
||||
end
|
||||
|
||||
new_acc = vector.multiply(dir, acc)
|
||||
end
|
||||
|
||||
|
@ -279,10 +291,12 @@ function boost_cart.cart:on_step(dtime)
|
|||
update.vel = true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
self.object:setacceleration(new_acc)
|
||||
self.old_pos = vector.new(pos)
|
||||
self.old_dir = vector.new(dir)
|
||||
if not vector.equals(dir, {x=0, y=0, z=0}) then
|
||||
self.old_dir = vector.new(dir)
|
||||
end
|
||||
self.old_switch = last_switch
|
||||
|
||||
|
||||
|
@ -293,11 +307,13 @@ function boost_cart.cart:on_step(dtime)
|
|||
obj_:get_luaentity() and
|
||||
not obj_:get_luaentity().physical_state and
|
||||
obj_:get_luaentity().name == "__builtin:item" then
|
||||
|
||||
obj_:set_attach(self.object, "", {x=0, y=0, z=0}, {x=0, y=0, z=0})
|
||||
self.attached_items[#self.attached_items + 1] = obj_
|
||||
end
|
||||
end
|
||||
self.punched = false
|
||||
update.vel = true -- update player animation
|
||||
end
|
||||
|
||||
if not (update.vel or update.pos) then
|
||||
|
@ -305,11 +321,11 @@ function boost_cart.cart:on_step(dtime)
|
|||
end
|
||||
|
||||
local yaw = 0
|
||||
if dir.x < 0 then
|
||||
if self.old_dir.x < 0 then
|
||||
yaw = 0.5
|
||||
elseif dir.x > 0 then
|
||||
elseif self.old_dir.x > 0 then
|
||||
yaw = 1.5
|
||||
elseif dir.z < 0 then
|
||||
elseif self.old_dir.z < 0 then
|
||||
yaw = 1
|
||||
end
|
||||
self.object:setyaw(yaw * math.pi)
|
||||
|
@ -355,4 +371,4 @@ minetest.register_craft({
|
|||
{"default:steel_ingot", "", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||
},
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
minetest.register_node(":default:rail", {
|
||||
description = "Rail",
|
||||
drawtype = "raillike",
|
||||
tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
|
||||
tiles = {
|
||||
"default_rail.png", "default_rail_curved.png",
|
||||
"default_rail_t_junction.png", "default_rail_crossing.png"
|
||||
},
|
||||
inventory_image = "default_rail.png",
|
||||
wield_image = "default_rail.png",
|
||||
paramtype = "light",
|
||||
|
@ -12,7 +15,7 @@ minetest.register_node(":default:rail", {
|
|||
type = "fixed",
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||
},
|
||||
groups = {dig_immediate = 2, attached_node = 1, rail = 1, connect_to_raillike = 1},
|
||||
groups = boost_cart:get_rail_groups(),
|
||||
})
|
||||
|
||||
if minetest.get_modpath("moreores") then
|
||||
|
@ -21,8 +24,11 @@ if minetest.get_modpath("moreores") then
|
|||
else
|
||||
boost_cart:register_rail(":carts:copperrail", {
|
||||
description = "Copper rail",
|
||||
tiles = {"carts_rail_cp.png", "carts_rail_curved_cp.png", "carts_rail_t_junction_cp.png", "carts_rail_crossing_cp.png"},
|
||||
groups = {dig_immediate = 2, attached_node = 1, rail = 1, connect_to_raillike = 1},
|
||||
tiles = {
|
||||
"carts_rail_cp.png", "carts_rail_curved_cp.png",
|
||||
"carts_rail_t_junction_cp.png", "carts_rail_crossing_cp.png"
|
||||
},
|
||||
groups = boost_cart:get_rail_groups(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
@ -39,9 +45,12 @@ end
|
|||
|
||||
boost_cart:register_rail(":carts:powerrail", {
|
||||
description = "Powered rail",
|
||||
tiles = {"carts_rail_pwr.png", "carts_rail_curved_pwr.png", "carts_rail_t_junction_pwr.png", "carts_rail_crossing_pwr.png"},
|
||||
groups = {dig_immediate = 2, attached_node = 1, rail = 1, connect_to_raillike = 1},
|
||||
|
||||
tiles = {
|
||||
"carts_rail_pwr.png", "carts_rail_curved_pwr.png",
|
||||
"carts_rail_t_junction_pwr.png", "carts_rail_crossing_pwr.png"
|
||||
},
|
||||
groups = boost_cart:get_rail_groups(),
|
||||
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
if not mesecon then
|
||||
minetest.get_meta(pos):set_string("cart_acceleration", "0.5")
|
||||
|
@ -72,19 +81,22 @@ minetest.register_craft({
|
|||
|
||||
boost_cart:register_rail(":carts:brakerail", {
|
||||
description = "Brake rail",
|
||||
tiles = {"carts_rail_brk.png", "carts_rail_curved_brk.png", "carts_rail_t_junction_brk.png", "carts_rail_crossing_brk.png"},
|
||||
groups = {dig_immediate = 2, attached_node = 1, rail = 1, connect_to_raillike = 1},
|
||||
tiles = {
|
||||
"carts_rail_brk.png", "carts_rail_curved_brk.png",
|
||||
"carts_rail_t_junction_brk.png", "carts_rail_crossing_brk.png"
|
||||
},
|
||||
groups = boost_cart:get_rail_groups(),
|
||||
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
if not mesecon then
|
||||
minetest.get_meta(pos):set_string("cart_acceleration", "-0.2")
|
||||
minetest.get_meta(pos):set_string("cart_acceleration", "-0.3")
|
||||
end
|
||||
end,
|
||||
|
||||
mesecons = {
|
||||
effector = {
|
||||
action_on = function(pos, node)
|
||||
boost_cart:boost_rail(pos, -0.2)
|
||||
minetest.get_meta(pos):set_string("cart_acceleration", "-0.3")
|
||||
end,
|
||||
|
||||
action_off = function(pos, node)
|
||||
|
@ -101,4 +113,37 @@ minetest.register_craft({
|
|||
{"default:steel_ingot", "group:stick", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:coal_lump", "default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
boost_cart:register_rail("boost_cart:startstoprail", {
|
||||
description = "Start-stop rail",
|
||||
tiles = {
|
||||
"carts_rail_ss.png", "carts_rail_curved_ss.png",
|
||||
"carts_rail_t_junction_ss.png", "carts_rail_crossing_ss.png"
|
||||
},
|
||||
groups = boost_cart:get_rail_groups(),
|
||||
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
if not mesecon then
|
||||
minetest.get_meta(pos):set_string("cart_acceleration", "halt")
|
||||
end
|
||||
end,
|
||||
|
||||
mesecons = {
|
||||
effector = {
|
||||
action_on = function(pos, node)
|
||||
boost_cart:boost_rail(pos, 0.5)
|
||||
end,
|
||||
|
||||
action_off = function(pos, node)
|
||||
minetest.get_meta(pos):set_string("cart_acceleration", "halt")
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "boost_cart:startstoprail 2",
|
||||
recipe = {"carts:powerrail", "carts:brakerail"},
|
||||
})
|
||||
|
|
After Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 458 B |
Before Width: | Height: | Size: 654 B After Width: | Height: | Size: 458 B |
After Width: | Height: | Size: 462 B |
Before Width: | Height: | Size: 578 B After Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 575 B After Width: | Height: | Size: 443 B |
After Width: | Height: | Size: 445 B |
Before Width: | Height: | Size: 542 B After Width: | Height: | Size: 498 B |
Before Width: | Height: | Size: 559 B After Width: | Height: | Size: 498 B |
After Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 431 B |
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 433 B |
|
@ -3,27 +3,27 @@ local S = biome_lib.intllib
|
|||
-- Basket
|
||||
|
||||
minetest.register_craft({
|
||||
output = "bushes:basket_empty",
|
||||
recipe = {
|
||||
{ "default:stick", "default:stick", "default:stick" },
|
||||
{ "", "default:stick", "" },
|
||||
},
|
||||
output = "bushes:basket_empty",
|
||||
recipe = {
|
||||
{ "default:stick", "default:stick", "default:stick" },
|
||||
{ "", "default:stick", "" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Sugar
|
||||
|
||||
minetest.register_craftitem(":bushes:sugar", {
|
||||
description = S("Sugar"),
|
||||
inventory_image = "bushes_sugar.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
description = S("Sugar"),
|
||||
inventory_image = "bushes_sugar.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
groups = {food_sugar=1}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "bushes:sugar 1",
|
||||
recipe = {
|
||||
{ "default:papyrus", "default:papyrus" },
|
||||
},
|
||||
output = "bushes:sugar 1",
|
||||
recipe = {
|
||||
{ "default:papyrus", "default:papyrus" },
|
||||
},
|
||||
})
|
||||
|
||||
for i, berry in ipairs(bushes_classic.bushes) do
|
||||
|
@ -37,10 +37,12 @@ for i, berry in ipairs(bushes_classic.bushes) do
|
|||
|
||||
if berry ~= "mixed_berry" then
|
||||
|
||||
-- Special case for strawberries, blueberries and raspberries
|
||||
-- when farming_plus or farming redo is in use. Use items
|
||||
-- from these mods, but redefine there so they has the right
|
||||
-- groups and does't look so ugly!
|
||||
|
||||
if berry == "strawberry" and minetest.registered_nodes["farming_plus:strawberry"] then
|
||||
-- Special case for strawberries, when farming_plus is in use. Use
|
||||
-- the item from that mod, but redefine it so it has the right
|
||||
-- groups and does't look so ugly!
|
||||
minetest.register_craftitem(":farming_plus:strawberry_item", {
|
||||
description = S("Strawberry"),
|
||||
inventory_image = "bushes_"..berry..".png",
|
||||
|
@ -48,6 +50,25 @@ for i, berry in ipairs(bushes_classic.bushes) do
|
|||
groups = {berry=1, strawberry=1}
|
||||
})
|
||||
minetest.register_alias("bushes:strawberry", "farming_plus:strawberry_item")
|
||||
|
||||
elseif berry == "blueberry" and minetest.registered_items["farming:blueberries"] then
|
||||
minetest.register_craftitem(":farming:blueberries", {
|
||||
description = S("Blueberry"),
|
||||
inventory_image = "bushes_"..berry..".png",
|
||||
on_use = minetest.item_eat(1),
|
||||
groups = {berry=1, blueberry=1}
|
||||
})
|
||||
minetest.register_alias("bushes:blueberry", "farming:blueberries")
|
||||
|
||||
elseif berry == "raspberry" and minetest.registered_items["farming:raspberries"] then
|
||||
minetest.register_craftitem(":farming:raspberries", {
|
||||
description = S("Raspberry"),
|
||||
inventory_image = "bushes_"..berry..".png",
|
||||
on_use = minetest.item_eat(1),
|
||||
groups = {berry=1, raspberry=1}
|
||||
})
|
||||
minetest.register_alias("bushes:raspberry", "farming:raspberries")
|
||||
|
||||
else
|
||||
minetest.register_craftitem(":bushes:"..berry, {
|
||||
description = desc,
|
||||
|
@ -56,6 +77,7 @@ for i, berry in ipairs(bushes_classic.bushes) do
|
|||
on_use = minetest.item_eat(1),
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = "bushes:"..berry.."_pie_raw 1",
|
||||
recipe = {
|
||||
|
|
|
@ -9,9 +9,10 @@ if minetest.get_modpath("xpanes") then
|
|||
wield_image = "castle_jailbars.png",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
groups = {cracky=1, pane=1},
|
||||
recipe = {{"default:steel_ingot","","default:steel_ingot"},
|
||||
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
|
||||
{"default:steel_ingot","","default:steel_ingot"}}
|
||||
recipe = {
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}},
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ minetest.register_node("chains:chain_top_brass", {
|
|||
minetest.register_node("chains:chandelier", {
|
||||
description = "Chandelier (wrought iron)",
|
||||
paramtype = "light",
|
||||
light_source = LIGHT_MAX-2,
|
||||
light_source = default.LIGHT_MAX-2,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
sunlight_propagates = true,
|
||||
|
@ -97,7 +97,7 @@ minetest.register_node("chains:chandelier", {
|
|||
minetest.register_node("chains:chandelier_brass", {
|
||||
description = "Chandelier (brass)",
|
||||
paramtype = "light",
|
||||
light_source = LIGHT_MAX-2,
|
||||
light_source = default.LIGHT_MAX-2,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
sunlight_propagates = true,
|
||||
|
|
|
@ -29,6 +29,7 @@ minetest.register_node("computer:vanio", {
|
|||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
node.name = "computer:vanio_off"
|
||||
minetest.set_node(pos, node)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -48,6 +49,7 @@ minetest.register_node("computer:vanio_off", {
|
|||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
node.name = "computer:vanio"
|
||||
minetest.set_node(pos, node)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -168,6 +170,7 @@ minetest.register_node("computer:monitor", {
|
|||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
node.name = "computer:monitor_on"
|
||||
minetest.set_node(pos, node)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -186,6 +189,7 @@ minetest.register_node("computer:monitor_on", {
|
|||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
node.name = "computer:monitor"
|
||||
minetest.set_node(pos, node)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -294,12 +298,13 @@ minetest.register_node("computer:server", {
|
|||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
node.name = "computer:server_on"
|
||||
minetest.set_node(pos, node)
|
||||
return itemstack
|
||||
end,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pos = pointed_thing.above
|
||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
|
||||
minetest.chat_send_player( placer:get_player_name(), "Not enough vertical space to place a server!" )
|
||||
return
|
||||
return itemstack
|
||||
end
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
|
@ -333,5 +338,6 @@ minetest.register_node("computer:server_on", {
|
|||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
node.name = "computer:server"
|
||||
minetest.set_node(pos, node)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
|
|
@ -27,11 +27,12 @@ computer.register = function (name, def)
|
|||
node_box = def.node_box,
|
||||
selection_box = def.node_box,
|
||||
on_rightclick = function (pos, node, clicker, itemstack)
|
||||
if (def.on_turn_off) then
|
||||
if (def.on_turn_off(pos, node, clicker, itemstack)) then return end
|
||||
if def.on_turn_off and def.on_turn_off(pos, node, clicker, itemstack) then
|
||||
return itemstack
|
||||
end
|
||||
node.name = OFFSTATE
|
||||
minetest.set_node(pos, node)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
minetest.register_node(OFFSTATE, {
|
||||
|
@ -50,11 +51,12 @@ computer.register = function (name, def)
|
|||
node_box = def.node_box_off or def.node_box,
|
||||
selection_box = def.node_box_off or def.node_box,
|
||||
on_rightclick = function (pos, node, clicker, itemstack)
|
||||
if (def.on_turn_on) then
|
||||
if (def.on_turn_on(pos, node, clicker, itemstack)) then return end
|
||||
if def.on_turn_on and def.on_turn_on(pos, node, clicker, itemstack) then
|
||||
return itemstack
|
||||
end
|
||||
node.name = ONSTATE
|
||||
minetest.set_node(pos, node)
|
||||
return itemstack
|
||||
end,
|
||||
drop = ONSTATE
|
||||
})
|
||||
|
|
|
@ -276,7 +276,8 @@ minetest.register_node("computer:tetris_arcade", {
|
|||
end
|
||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
|
||||
minetest.chat_send_player(placer:get_player_name(), "No room for place the Arcade!")
|
||||
return end
|
||||
return itemstack
|
||||
end
|
||||
local dir = placer:get_look_dir()
|
||||
local node = {name="computer:tetris_arcade", param1=0, param2 = minetest.dir_to_facedir(dir)}
|
||||
minetest.set_node(pos, node)
|
||||
|
|
|
@ -84,8 +84,9 @@ for _, f in ipairs(flame_types) do
|
|||
{name=f.."_fire_animated.png", animation={type="vertical_frames",
|
||||
aspect_w=16, aspect_h=16, length=1.5}},
|
||||
},
|
||||
on_rightclick = function (pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
start_smoke(pos, node, clicker)
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function (pos)
|
||||
stop_smoke(pos)
|
||||
|
@ -113,8 +114,9 @@ minetest.register_node("fake_fire:fancy_fire", {
|
|||
tiles = {
|
||||
{name="fake_fire_animated.png",
|
||||
animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='fake_fire_logs.png'}},
|
||||
on_rightclick = function (pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
start_smoke(pos, node, clicker)
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function (pos)
|
||||
stop_smoke(pos)
|
||||
|
@ -161,9 +163,10 @@ for _, m in ipairs(materials) do
|
|||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
},
|
||||
on_rightclick = function (pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local chimney = 1
|
||||
start_smoke(pos, node, clicker, chimney)
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function (pos)
|
||||
stop_smoke(pos)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
Released under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||
|
||||
Legal code available for viewing here: http://creativecommons.org/licenses/by-sa/3.0/legalcode
|
||||
|
||||
Basic license overview available for viewing here: http://creativecommons.org/licenses/by-sa/3.0/
|
|
@ -0,0 +1,21 @@
|
|||
=-=-=-=-=-=-=
|
||||
GloopTest :D *insert witty comment here*
|
||||
=-=-=-=-=-=-=
|
||||
|
||||
Adds a collection of things into minetest. As it stands, this adds three different modules.
|
||||
|
||||
More (or possibly (most likely) less) imformation can be found here: http://minetest.net/forum/viewtopic.php?id=4345
|
||||
|
||||
--==--==--
|
||||
|
||||
Ore Module: Adds a variety of ores into minetest, for use here and possibly in other mods.
|
||||
|
||||
OtherGen Module: Adds generation aside from ores.
|
||||
|
||||
Parts Module: Adds some bits and bobs for machinery and some minor blocks.
|
||||
|
||||
Tech Module: Adds the "tech" of glooptest.
|
||||
|
||||
Tools Module: Adds extra kinds of tools.
|
||||
|
||||
Compat Module: Puts into place a number of aliases for cross-mod-compatibility.
|
|
@ -0,0 +1 @@
|
|||
Adds a variety of ores, bits and bobs for machinery, extra kinds of tools.
|
|
@ -0,0 +1 @@
|
|||
name = glooptest
|
|
@ -114,7 +114,7 @@ homedecor.register("sink", {
|
|||
|
||||
--Taps
|
||||
|
||||
local function taps_on_rightclick(pos, node, clicker)
|
||||
local function taps_on_rightclick(pos, node, clicker, itemstack, pointed_thing)
|
||||
local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
if below and
|
||||
below.name == "homedecor:shower_tray" or
|
||||
|
@ -129,6 +129,7 @@ local function taps_on_rightclick(pos, node, clicker)
|
|||
}
|
||||
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_faucet")
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
homedecor.register("taps", {
|
||||
|
@ -225,7 +226,7 @@ homedecor.register("shower_head", {
|
|||
selection_box = sh_cbox,
|
||||
walkable = false,
|
||||
on_rotate = screwdriver.disallow,
|
||||
on_rightclick = function (pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-2.0, z=pos.z})
|
||||
if below and below.name == "homedecor:shower_tray" then
|
||||
local particledef = {
|
||||
|
@ -237,6 +238,7 @@ homedecor.register("shower_head", {
|
|||
}
|
||||
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_shower")
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
homedecor.stop_particle_spawner(pos)
|
||||
|
|
|
@ -79,10 +79,11 @@ for i in ipairs(bedcolors) do
|
|||
after_dig_node = function(pos)
|
||||
homedecor.unextend_bed(pos, color)
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
if minetest.get_modpath("beds") then
|
||||
beds.on_rightclick(pos, clicker)
|
||||
else return end
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -104,10 +105,11 @@ for i in ipairs(bedcolors) do
|
|||
after_dig_node = function(pos)
|
||||
homedecor.unextend_bed(pos, color)
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
if minetest.get_modpath("beds") then
|
||||
beds.on_rightclick(pos, clicker)
|
||||
else return end
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
drop = "homedecor:bed_"..color.."_regular"
|
||||
})
|
||||
|
@ -137,10 +139,11 @@ for i in ipairs(bedcolors) do
|
|||
inv:add_item("main", "homedecor:bed_"..color.."_regular 2")
|
||||
end
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
if minetest.get_modpath("beds") then
|
||||
beds.on_rightclick(pos, clicker)
|
||||
else return end
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ for c in ipairs(bookcolors) do
|
|||
drop = "homedecor:book_"..color,
|
||||
walkable = false,
|
||||
on_dig = book_dig,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local player_name = clicker:get_player_name()
|
||||
local title = meta:get_string("title") or ""
|
||||
|
@ -136,6 +136,7 @@ for c in ipairs(bookcolors) do
|
|||
end
|
||||
player_current_book[player_name] = pos
|
||||
minetest.show_formspec(player_name, BOOK_FORMNAME, formspec)
|
||||
return itemstack
|
||||
end,
|
||||
on_punch = function(pos, node, puncher, pointed_thing)
|
||||
local fdir = node.param2
|
||||
|
|
|
@ -111,7 +111,7 @@ homedecor.register("ceiling_fan", {
|
|||
}
|
||||
},
|
||||
groups = { snappy = 3 },
|
||||
light_source = LIGHT_MAX-1,
|
||||
light_source = default.LIGHT_MAX-1,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
|
|
|
@ -252,8 +252,9 @@ for i in ipairs(sides) do
|
|||
on_construct = function(pos)
|
||||
minetest.get_meta(pos):set_int("closed", 1)
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
homedecor.flip_door(pos, node, clicker, doorname, side)
|
||||
return itemstack
|
||||
end,
|
||||
-- both left and right doors may be used for open or closed doors
|
||||
-- so they have to have both action_on and action_off and just
|
||||
|
@ -385,8 +386,9 @@ for i in ipairs(gates_list) do
|
|||
type = "fixed",
|
||||
fixed = gate_models_closed[i]
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
homedecor.flip_gate(pos, node, clicker, gate, "closed")
|
||||
return itemstack
|
||||
end,
|
||||
mesecons = {
|
||||
effector = {
|
||||
|
@ -413,8 +415,9 @@ for i in ipairs(gates_list) do
|
|||
tiles[3]
|
||||
}
|
||||
def.drop = "homedecor:gate_"..gate.."_closed"
|
||||
def.on_rightclick = function(pos, node, clicker)
|
||||
def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
homedecor.flip_gate(pos, node, clicker, gate, "open")
|
||||
return itemstack
|
||||
end
|
||||
def.mesecons.effector = {
|
||||
action_off = function(pos,node) homedecor.flip_gate(pos,node,player,gate, "open") end
|
||||
|
@ -605,8 +608,9 @@ homedecor.register("door_japanese_closed", {
|
|||
fixed = {-0.5, -0.5, -0.0625, 0.5, 1.5, 0},
|
||||
},
|
||||
expand = { top = "placeholder" },
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.set_node(pos, {name = "homedecor:door_japanese_open", param2 = node.param2})
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -628,8 +632,9 @@ homedecor.register("door_japanese_open", {
|
|||
fixed = {-1.5, -0.5, -0.0625, -0.5, 1.5, 0},
|
||||
},
|
||||
expand = { top = "placeholder" },
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.set_node(pos, {name = "homedecor:door_japanese_closed", param2 = node.param2})
|
||||
return itemstack
|
||||
end,
|
||||
drop = "homedecor:door_japanese_closed",
|
||||
})
|
||||
|
|
|
@ -84,9 +84,10 @@ for i in ipairs(chaircolors) do
|
|||
collision_box = kc_cbox,
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
pos.y = pos.y+0 -- where do I put my ass ?
|
||||
homedecor.sit(pos, node, clicker)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ homedecor.register("toaster", {
|
|||
{-0.0625, -0.5, -0.125, 0.125, -0.3125, 0.125}, -- NodeBox1
|
||||
},
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local fdir = node.param2
|
||||
minetest.set_node(pos, { name = "homedecor:toaster_loaf", param2 = fdir })
|
||||
minetest.sound_play("toaster", {
|
||||
|
@ -177,6 +177,7 @@ homedecor.register("toaster", {
|
|||
gain = 1.0,
|
||||
max_hear_distance = 5
|
||||
})
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -199,9 +200,10 @@ homedecor.register("toaster_loaf", {
|
|||
{0.0625, -0.3125, -0.0935, 0.0935, -0.25, 0.0935}, -- NodeBox3
|
||||
},
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local fdir = node.param2
|
||||
minetest.set_node(pos, { name = "homedecor:toaster", param2 = fdir })
|
||||
return itemstack
|
||||
end,
|
||||
drop = "homedecor:toaster"
|
||||
})
|
||||
|
|
|
@ -117,7 +117,7 @@ homedecor.register("kitchen_faucet", {
|
|||
selection_box = kf_cbox,
|
||||
walkable = false,
|
||||
on_rotate = screwdriver.disallow,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
if below and
|
||||
below.name == "homedecor:sink" or
|
||||
|
@ -131,6 +131,7 @@ homedecor.register("kitchen_faucet", {
|
|||
}
|
||||
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_faucet")
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = homedecor.stop_particle_spawner
|
||||
})
|
||||
|
|
|
@ -179,8 +179,9 @@ homedecor.register("fishtank", {
|
|||
collision_box = ft_cbox,
|
||||
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.set_node(pos, {name = "homedecor:fishtank_lighted", param2 = node.param2})
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -195,14 +196,15 @@ homedecor.register("fishtank_lighted", {
|
|||
"homedecor_fishtank_water_top_lighted.png",
|
||||
"homedecor_fishtank_sides_lighted.png",
|
||||
},
|
||||
light_source = LIGHT_MAX-4,
|
||||
light_source = default.LIGHT_MAX-4,
|
||||
use_texture_alpha = true,
|
||||
selection_box = ft_cbox,
|
||||
collision_box = ft_cbox,
|
||||
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.set_node(pos, {name = "homedecor:fishtank", param2 = node.param2})
|
||||
return itemstack
|
||||
end,
|
||||
drop = "homedecor:fishtank",
|
||||
})
|
||||
|
|
|
@ -81,10 +81,11 @@ homedecor.register("calendar", {
|
|||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_defaults(),
|
||||
infotext = "Date (right-click to update):\n" .. os.date("%Y-%m-%d"), -- ISO 8601 format
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local date = os.date("%Y-%m-%d")
|
||||
meta:set_string("infotext", "Date (right-click to update):\n"..date)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
|
|
@ -125,12 +125,13 @@ for c in ipairs(curtaincolors) do
|
|||
paramtype2 = 'wallmounted',
|
||||
selection_box = { type = "wallmounted" },
|
||||
-- Open the curtains
|
||||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
|
||||
if string.find(topnode.name, "homedecor:curtainrod") then
|
||||
local fdir = node.param2
|
||||
minetest.set_node(pos, { name = "homedecor:curtain_open_"..color, param2 = fdir })
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
@ -147,12 +148,13 @@ for c in ipairs(curtaincolors) do
|
|||
paramtype2 = 'wallmounted',
|
||||
selection_box = { type = "wallmounted" },
|
||||
-- Close the curtains
|
||||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
|
||||
if string.find(topnode.name, "homedecor:curtainrod") then
|
||||
local fdir = node.param2
|
||||
minetest.set_node(pos, { name = "homedecor:curtain_"..color, param2 = fdir })
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
|
|
@ -57,12 +57,14 @@ minetest.register_node("inbox:empty", {
|
|||
"default:chest_locked",
|
||||
inbox.get_inbox_insert_formspec(pos))
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local name = player and player:get_player_name()
|
||||
local owner = meta:get_string("owner")
|
||||
local inv = meta:get_inventory()
|
||||
return player:get_player_name() == owner and inv:is_empty("main")
|
||||
return player == owner and inv:is_empty("main")
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
|
|
@ -141,9 +141,9 @@ minetest.register_node("itemframes:frame",{
|
|||
end
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
|
||||
local name = player and player:get_player_name()
|
||||
local meta = minetest.get_meta(pos)
|
||||
return player:get_player_name() == meta:get_string("owner")
|
||||
return name == meta:get_string("owner")
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
@ -198,9 +198,9 @@ minetest.register_node("itemframes:pedestal",{
|
|||
end
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
|
||||
local name = player and player:get_player_name()
|
||||
local meta = minetest.get_meta(pos)
|
||||
return player:get_player_name() == meta:get_string("owner")
|
||||
return name == meta:get_string("owner")
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
|
|
@ -39,9 +39,10 @@ for i in ipairs(lavalamps_list) do
|
|||
},
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
node.name = "lavalamp:"..colour.."_off"
|
||||
minetest.set_node(pos, node)
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -64,9 +65,10 @@ for i in ipairs(lavalamps_list) do
|
|||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
drop = "lavalamp:"..colour,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
node.name = "lavalamp:"..colour
|
||||
minetest.set_node(pos, node)
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
|
@ -24,13 +24,14 @@ for i in ipairs(lrfurn.colors) do
|
|||
groups = {snappy=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = armchair_cbox,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
if not clicker:is_player() then
|
||||
return
|
||||
return itemstack
|
||||
end
|
||||
pos.y = pos.y-0.5
|
||||
clicker:setpos(pos)
|
||||
clicker:set_hp(20)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
|
|
@ -46,13 +46,14 @@ for i in ipairs(lrfurn.colors) do
|
|||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
if not clicker:is_player() then
|
||||
return
|
||||
return itemstack
|
||||
end
|
||||
pos.y = pos.y-0.5
|
||||
clicker:setpos(pos)
|
||||
clicker:set_hp(20)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
|
|
@ -48,13 +48,14 @@ for i in ipairs(lrfurn.colors) do
|
|||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
if not clicker:is_player() then
|
||||
return
|
||||
return itemstack
|
||||
end
|
||||
pos.y = pos.y-0.5
|
||||
clicker:setpos(pos)
|
||||
clicker:set_hp(20)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ function mesecon.get_conductor(nodename)
|
|||
end
|
||||
end
|
||||
|
||||
function mesecon.get_any_outputrules (node)
|
||||
function mesecon.get_any_outputrules(node)
|
||||
if not node then return nil end
|
||||
|
||||
if mesecon.is_conductor(node.name) then
|
||||
|
@ -86,7 +86,7 @@ function mesecon.get_any_outputrules (node)
|
|||
end
|
||||
end
|
||||
|
||||
function mesecon.get_any_inputrules (node)
|
||||
function mesecon.get_any_inputrules(node)
|
||||
if not node then return nil end
|
||||
|
||||
if mesecon.is_conductor(node.name) then
|
||||
|
@ -96,7 +96,7 @@ function mesecon.get_any_inputrules (node)
|
|||
end
|
||||
end
|
||||
|
||||
function mesecon.get_any_rules (node)
|
||||
function mesecon.get_any_rules(node)
|
||||
return mesecon.mergetable(mesecon.get_any_inputrules(node) or {},
|
||||
mesecon.get_any_outputrules(node) or {})
|
||||
end
|
||||
|
@ -381,27 +381,41 @@ function mesecon.turnon(pos, link)
|
|||
|
||||
-- area not loaded, postpone action
|
||||
if not node then
|
||||
mesecon.queue:add_action(f.pos, "turnon", {link}, nil, true)
|
||||
mesecon.queue:add_action(f.pos, "turnon", {f.link}, nil, true)
|
||||
elseif mesecon.is_conductor_off(node, f.link) then
|
||||
local rules = mesecon.conductor_get_rules(node)
|
||||
|
||||
minetest.swap_node(f.pos, {name = mesecon.get_conductor_on(node, f.link),
|
||||
param2 = node.param2})
|
||||
-- Success: If false, at least one neighboring node is unloaded,
|
||||
-- postpone turning on action
|
||||
local success = true
|
||||
local neighborlinks = {}
|
||||
|
||||
-- call turnon on neighbors: normal rules
|
||||
-- call turnon on neighbors
|
||||
for _, r in ipairs(mesecon.rule2meta(f.link, rules)) do
|
||||
local np = vector.add(f.pos, r)
|
||||
|
||||
-- area not loaded, postpone action
|
||||
-- Neighboring node not loaded, postpone turning on current node
|
||||
-- since we can't even know if neighboring node has matching rules
|
||||
if not mesecon.get_node_force(np) then
|
||||
mesecon.queue:add_action(np, "turnon", {rulename},
|
||||
nil, true)
|
||||
success = false
|
||||
break
|
||||
else
|
||||
local links = mesecon.rules_link_rule_all(f.pos, r)
|
||||
neighborlinks[minetest.hash_node_position(np)] = mesecon.rules_link_rule_all(f.pos, r)
|
||||
end
|
||||
end
|
||||
|
||||
if success then
|
||||
minetest.swap_node(f.pos, {name = mesecon.get_conductor_on(node, f.link),
|
||||
param2 = node.param2})
|
||||
|
||||
for npos, links in pairs(neighborlinks) do
|
||||
-- links = all links to node, l = each single link
|
||||
for _, l in ipairs(links) do
|
||||
table.insert(frontiers, {pos = np, link = l})
|
||||
table.insert(frontiers, {pos = minetest.get_position_from_hash(npos), link = l})
|
||||
end
|
||||
end
|
||||
else
|
||||
mesecon.queue:add_action(f.pos, "turnon", {f.link}, nil, true)
|
||||
end
|
||||
elseif mesecon.is_effector(node.name) then
|
||||
mesecon.changesignal(f.pos, node, f.link, mesecon.state.on, depth)
|
||||
|
@ -413,7 +427,7 @@ function mesecon.turnon(pos, link)
|
|||
end
|
||||
end
|
||||
|
||||
mesecon.queue:add_function("turnon", function (pos, rulename, recdepth)
|
||||
mesecon.queue:add_function("turnon", function(pos, rulename, recdepth)
|
||||
mesecon.turnon(pos, rulename, recdepth)
|
||||
end)
|
||||
|
||||
|
@ -427,27 +441,41 @@ function mesecon.turnoff(pos, link)
|
|||
|
||||
-- area not loaded, postpone action
|
||||
if not node then
|
||||
mesecon.queue:add_action(f.pos, "turnoff", {link}, nil, true)
|
||||
mesecon.queue:add_action(f.pos, "turnoff", {f.link}, nil, true)
|
||||
elseif mesecon.is_conductor_on(node, f.link) then
|
||||
local rules = mesecon.conductor_get_rules(node)
|
||||
|
||||
minetest.swap_node(f.pos, {name = mesecon.get_conductor_off(node, f.link),
|
||||
param2 = node.param2})
|
||||
-- Success: If false, at least one neighboring node is unloaded,
|
||||
-- postpone turning on action
|
||||
local success = true
|
||||
local neighborlinks = {}
|
||||
|
||||
-- call turnoff on neighbors: normal rules
|
||||
-- call turnoff on neighbors
|
||||
for _, r in ipairs(mesecon.rule2meta(f.link, rules)) do
|
||||
local np = vector.add(f.pos, r)
|
||||
|
||||
-- area not loaded, postpone action
|
||||
-- Neighboring node not loaded, postpone turning off current node
|
||||
-- since we can't even know if neighboring node has matching rules
|
||||
if not mesecon.get_node_force(np) then
|
||||
mesecon.queue:add_action(np, "turnoff", {rulename},
|
||||
nil, true)
|
||||
success = false
|
||||
break
|
||||
else
|
||||
local links = mesecon.rules_link_rule_all(f.pos, r)
|
||||
neighborlinks[minetest.hash_node_position(np)] = mesecon.rules_link_rule_all(f.pos, r)
|
||||
end
|
||||
end
|
||||
|
||||
if success then
|
||||
minetest.swap_node(f.pos, {name = mesecon.get_conductor_off(node, f.link),
|
||||
param2 = node.param2})
|
||||
|
||||
for npos, links in pairs(neighborlinks) do
|
||||
-- links = all links to node, l = each single link
|
||||
for _, l in ipairs(links) do
|
||||
table.insert(frontiers, {pos = np, link = l})
|
||||
table.insert(frontiers, {pos = minetest.get_position_from_hash(npos), link = l})
|
||||
end
|
||||
end
|
||||
else
|
||||
mesecon.queue:add_action(f.pos, "turnoff", {f.link}, nil, true)
|
||||
end
|
||||
elseif mesecon.is_effector(node.name) then
|
||||
mesecon.changesignal(f.pos, node, f.link, mesecon.state.off, depth)
|
||||
|
@ -459,7 +487,7 @@ function mesecon.turnoff(pos, link)
|
|||
end
|
||||
end
|
||||
|
||||
mesecon.queue:add_function("turnoff", function (pos, rulename, recdepth)
|
||||
mesecon.queue:add_function("turnoff", function(pos, rulename, recdepth)
|
||||
mesecon.turnoff(pos, rulename, recdepth)
|
||||
end)
|
||||
|
||||
|
@ -523,8 +551,8 @@ function mesecon.rules_link(output, input, dug_outputrules) --output/input are p
|
|||
local outputnode = mesecon.get_node_force(output)
|
||||
local inputnode = mesecon.get_node_force(input)
|
||||
|
||||
local outputrules = dug_outputrules or mesecon.get_any_outputrules (outputnode)
|
||||
local inputrules = mesecon.get_any_inputrules (inputnode)
|
||||
local outputrules = dug_outputrules or mesecon.get_any_outputrules(outputnode)
|
||||
local inputrules = mesecon.get_any_inputrules(inputnode)
|
||||
if not outputrules or not inputrules then
|
||||
return
|
||||
end
|
||||
|
@ -547,7 +575,7 @@ end
|
|||
function mesecon.rules_link_rule_all(output, rule)
|
||||
local input = vector.add(output, rule)
|
||||
local inputnode = mesecon.get_node_force(input)
|
||||
local inputrules = mesecon.get_any_inputrules (inputnode)
|
||||
local inputrules = mesecon.get_any_inputrules(inputnode)
|
||||
if not inputrules then
|
||||
return {}
|
||||
end
|
||||
|
@ -567,7 +595,7 @@ function mesecon.rules_link_rule_all_inverted(input, rule)
|
|||
--local irule = mesecon.invertRule(rule)
|
||||
local output = vector.add(input, rule)
|
||||
local outputnode = mesecon.get_node_force(output)
|
||||
local outputrules = mesecon.get_any_outputrules (outputnode)
|
||||
local outputrules = mesecon.get_any_outputrules(outputnode)
|
||||
if not outputrules then
|
||||
return {}
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
dofile(minetest.get_modpath("quartz").."/settings.txt")
|
||||
local settings = Settings(minetest.get_modpath("quartz").."/settings.txt")
|
||||
|
||||
--
|
||||
-- Item Registration
|
||||
|
@ -153,7 +153,7 @@ minetest.register_abm({
|
|||
-- Compatibility with stairsplus
|
||||
--
|
||||
|
||||
if minetest.get_modpath("moreblocks") and ENABLE_STAIRSPLUS then
|
||||
if minetest.get_modpath("moreblocks") and settings:get_bool("ENABLE_STAIRSPLUS") then
|
||||
register_stair_slab_panel_micro("quartz", "block", "quartz:block",
|
||||
{cracky=3},
|
||||
{"quartz_block.png"},
|
||||
|
@ -187,7 +187,7 @@ end
|
|||
-- Deprecated
|
||||
--
|
||||
|
||||
if ENABLE_HORIZONTAL_PILLAR then
|
||||
if settings:get_bool("ENABLE_HORIZONTAL_PILLAR") then
|
||||
-- Quartz Pillar (horizontal)
|
||||
minetest.register_node("quartz:pillar_horizontal", {
|
||||
description = "Quartz Pillar Horizontal",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
-- Set this to true to allow usage of the stairsplus mod in moreblocks
|
||||
# Set this to true to allow usage of the stairsplus mod in moreblocks
|
||||
|
||||
ENABLE_STAIRSPLUS = false
|
||||
|
||||
-- This enables the old horizontal pillar block(deprecated, be sure to convert them back to normal pillars)
|
||||
# This enables the old horizontal pillar block(deprecated, be sure to convert them back to normal pillars)
|
||||
|
||||
ENABLE_HORIZONTAL_PILLAR = true
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
local S = unified_inventory.gettext
|
||||
local F = unified_inventory.fgettext
|
||||
|
||||
-- Create detached creative inventory after loading all mods
|
||||
minetest.after(0.01, function()
|
||||
|
@ -44,6 +45,7 @@ minetest.after(0.01, function()
|
|||
print("Unified Inventory. inventory size: "..unified_inventory.items_list_size)
|
||||
for _, name in ipairs(unified_inventory.items_list) do
|
||||
local def = minetest.registered_items[name]
|
||||
-- Simple drops
|
||||
if type(def.drop) == "string" then
|
||||
local dstack = ItemStack(def.drop)
|
||||
if not dstack:is_empty() and dstack:get_name() ~= name then
|
||||
|
@ -55,6 +57,77 @@ minetest.after(0.01, function()
|
|||
})
|
||||
|
||||
end
|
||||
-- Complex drops. Yes, it's really complex!
|
||||
elseif type(def.drop) == "table" then
|
||||
--[[ Extract single items from the table and save them into dedicated tables
|
||||
to register them later, in order to avoid duplicates. These tables counts
|
||||
the total number of guaranteed drops and drops by chance (“maybes”) for each item.
|
||||
For “maybes”, the final count is the theoretical maximum number of items, not
|
||||
neccessarily the actual drop count. ]]
|
||||
local drop_guaranteed = {}
|
||||
local drop_maybe = {}
|
||||
-- This is for catching an obscure corner case: If the top items table has
|
||||
-- only items with rarity = 1, but max_items is set, then only the first
|
||||
-- max_items will be part of the drop, any later entries are logically
|
||||
-- impossible, so this variable is for keeping track of this
|
||||
local max_items_left = def.drop.max_items
|
||||
-- For checking whether we still encountered only guaranteed only so far;
|
||||
-- for the first “maybe” item it will become false which will cause ALL
|
||||
-- later items to be considered “maybes”.
|
||||
-- A common idiom is:
|
||||
-- { max_items 1, { items = {
|
||||
-- { items={"example:1"}, rarity = 5 },
|
||||
-- { items={"example:2"}, rarity = 1 }, }}}
|
||||
-- example:2 must be considered a “maybe” because max_items is set and it
|
||||
-- appears after a “maybe”
|
||||
local max_start = true
|
||||
-- Let's iterate through the items madness!
|
||||
for i=1,#def.drop.items do
|
||||
if max_items_left ~= nil and max_items_left <= 0 then break end
|
||||
local itit = def.drop.items[i]
|
||||
for j=1,#itit.items do
|
||||
local dstack = ItemStack(itit.items[j])
|
||||
if not dstack:is_empty() and dstack:get_name() ~= name then
|
||||
local dname = dstack:get_name()
|
||||
local dcount = dstack:get_count()
|
||||
-- Guaranteed drops AND we are not yet in “maybe mode”
|
||||
if #itit.items == 1 and itit.rarity == 1 and max_start then
|
||||
if drop_guaranteed[dname] == nil then
|
||||
drop_guaranteed[dname] = 0
|
||||
end
|
||||
drop_guaranteed[dname] = drop_guaranteed[dname] + dcount
|
||||
|
||||
if max_items_left ~= nil then
|
||||
max_items_left = max_items_left - 1
|
||||
if max_items_left <= 0 then break end
|
||||
end
|
||||
-- Drop was a “maybe”
|
||||
else
|
||||
if max_items_left ~= nil then max_start = false end
|
||||
if drop_maybe[dname] == nil then
|
||||
drop_maybe[dname] = 0
|
||||
end
|
||||
drop_maybe[dname] = drop_maybe[dname] + dcount
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for itemstring, count in pairs(drop_guaranteed) do
|
||||
unified_inventory.register_craft({
|
||||
type = "digging",
|
||||
items = {name},
|
||||
output = itemstring .. " " .. count,
|
||||
width = 0,
|
||||
})
|
||||
end
|
||||
for itemstring, count in pairs(drop_maybe) do
|
||||
unified_inventory.register_craft({
|
||||
type = "digging_chance",
|
||||
items = {name},
|
||||
output = itemstring .. " " .. count,
|
||||
width = 0,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, recipes in pairs(unified_inventory.crafts_for.recipe) do
|
||||
|
@ -158,7 +231,7 @@ end
|
|||
|
||||
|
||||
unified_inventory.register_craft_type("normal", {
|
||||
description = "Crafting",
|
||||
description = F("Crafting"),
|
||||
icon = "ui_craftgrid_icon.png",
|
||||
width = 3,
|
||||
height = 3,
|
||||
|
@ -174,7 +247,7 @@ unified_inventory.register_craft_type("normal", {
|
|||
|
||||
|
||||
unified_inventory.register_craft_type("shapeless", {
|
||||
description = "Mixing",
|
||||
description = F("Mixing"),
|
||||
icon = "ui_craftgrid_icon.png",
|
||||
width = 3,
|
||||
height = 3,
|
||||
|
@ -189,7 +262,7 @@ unified_inventory.register_craft_type("shapeless", {
|
|||
|
||||
|
||||
unified_inventory.register_craft_type("cooking", {
|
||||
description = "Cooking",
|
||||
description = F("Cooking"),
|
||||
icon = "default_furnace_front.png",
|
||||
width = 1,
|
||||
height = 1,
|
||||
|
@ -197,12 +270,18 @@ unified_inventory.register_craft_type("cooking", {
|
|||
|
||||
|
||||
unified_inventory.register_craft_type("digging", {
|
||||
description = "Digging",
|
||||
description = F("Digging"),
|
||||
icon = "default_tool_steelpick.png",
|
||||
width = 1,
|
||||
height = 1,
|
||||
})
|
||||
|
||||
unified_inventory.register_craft_type("digging_chance", {
|
||||
description = "Digging (by chance)",
|
||||
icon = "default_tool_steelpick.png^[transformFY.png",
|
||||
width = 1,
|
||||
height = 1,
|
||||
})
|
||||
|
||||
function unified_inventory.register_page(name, def)
|
||||
unified_inventory.pages[name] = def
|
||||
|
|
|
@ -4,16 +4,17 @@
|
|||
-- License: GPLv3
|
||||
|
||||
local S = unified_inventory.gettext
|
||||
local F = unified_inventory.fgettext
|
||||
|
||||
unified_inventory.register_page("bags", {
|
||||
get_formspec = function(player)
|
||||
local player_name = player:get_player_name()
|
||||
local formspec = "background[0.06,0.99;7.92,7.52;ui_bags_main_form.png]"
|
||||
formspec = formspec.."label[0,0;"..S("Bags").."]"
|
||||
formspec = formspec.."button[0,2;2,0.5;bag1;Bag 1]"
|
||||
formspec = formspec.."button[2,2;2,0.5;bag2;Bag 2]"
|
||||
formspec = formspec.."button[4,2;2,0.5;bag3;Bag 3]"
|
||||
formspec = formspec.."button[6,2;2,0.5;bag4;Bag 4]"
|
||||
formspec = formspec.."label[0,0;"..F("Bags").."]"
|
||||
formspec = formspec.."button[0,2;2,0.5;bag1;"..F("Bag 1").."]"
|
||||
formspec = formspec.."button[2,2;2,0.5;bag2;"..F("Bag 2").."]"
|
||||
formspec = formspec.."button[4,2;2,0.5;bag3;"..F("Bag 3").."]"
|
||||
formspec = formspec.."button[6,2;2,0.5;bag4;"..F("Bag 4").."]"
|
||||
formspec = formspec.."listcolors[#00000000;#00000000]"
|
||||
formspec = formspec.."list[detached:"..minetest.formspec_escape(player_name).."_bags;bag1;0.5,1;1,1;]"
|
||||
formspec = formspec.."list[detached:"..minetest.formspec_escape(player_name).."_bags;bag2;2.5,1;1,1;]"
|
||||
|
@ -36,7 +37,7 @@ unified_inventory.register_button("bags", {
|
|||
local stack = player:get_inventory():get_stack("bag1", 1)
|
||||
local image = stack:get_definition().inventory_image
|
||||
local formspec = "image[7,0;1,1;"..image.."]"
|
||||
formspec = formspec.."label[0,0;Bag 1]"
|
||||
formspec = formspec.."label[0,0;"..F("Bag 1").."]"
|
||||
formspec = formspec.."listcolors[#00000000;#00000000]"
|
||||
formspec = formspec.."list[current_player;bag1contents;0,1;8,3;]"
|
||||
formspec = formspec.."listring[current_name;bag1contents]"
|
||||
|
@ -57,7 +58,7 @@ unified_inventory.register_button("bags", {
|
|||
local stack = player:get_inventory():get_stack("bag2", 1)
|
||||
local image = stack:get_definition().inventory_image
|
||||
local formspec = "image[7,0;1,1;"..image.."]"
|
||||
formspec = formspec.."label[0,0;Bag 2]"
|
||||
formspec = formspec.."label[0,0;"..F("Bag 2").."]"
|
||||
formspec = formspec.."listcolors[#00000000;#00000000]"
|
||||
formspec = formspec.."list[current_player;bag2contents;0,1;8,3;]"
|
||||
formspec = formspec.."listring[current_name;bag2contents]"
|
||||
|
@ -78,7 +79,7 @@ unified_inventory.register_button("bags", {
|
|||
local stack = player:get_inventory():get_stack("bag3", 1)
|
||||
local image = stack:get_definition().inventory_image
|
||||
local formspec = "image[7,0;1,1;"..image.."]"
|
||||
formspec = formspec.."label[0,0;Bag 3]"
|
||||
formspec = formspec.."label[0,0;"..F("Bag 3").."]"
|
||||
formspec = formspec.."listcolors[#00000000;#00000000]"
|
||||
formspec = formspec.."list[current_player;bag3contents;0,1;8,3;]"
|
||||
formspec = formspec.."listring[current_name;bag3contents]"
|
||||
|
@ -99,7 +100,7 @@ unified_inventory.register_button("bags", {
|
|||
local stack = player:get_inventory():get_stack("bag4", 1)
|
||||
local image = stack:get_definition().inventory_image
|
||||
local formspec = "image[7,0;1,1;"..image.."]"
|
||||
formspec = formspec.."label[0,0;Bag 4]"
|
||||
formspec = formspec.."label[0,0;"..F("Bag 4").."]"
|
||||
formspec = formspec.."listcolors[#00000000;#00000000]"
|
||||
formspec = formspec.."list[current_player;bag4contents;0,1;8,3;]"
|
||||
formspec = formspec.."listring[current_name;bag4contents]"
|
||||
|
@ -144,11 +145,36 @@ minetest.register_on_joinplayer(function(player)
|
|||
player:get_inventory():set_stack(listname, index, nil)
|
||||
end,
|
||||
allow_put = function(inv, listname, index, stack, player)
|
||||
if stack:get_definition().groups.bagslots then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
local new_slots = stack:get_definition().groups.bagslots
|
||||
if new_slots then
|
||||
local player_inv = player:get_inventory()
|
||||
local old_slots = player_inv:get_size(listname.."contents")
|
||||
|
||||
if new_slots >= old_slots then
|
||||
return 1
|
||||
else
|
||||
-- using a smaller bag, make sure it fits
|
||||
local old_list = player_inv:get_list(listname.."contents")
|
||||
local new_list = {}
|
||||
local slots_used = 0
|
||||
local use_new_list = false
|
||||
|
||||
for i, v in ipairs(old_list) do
|
||||
if v and not v:is_empty() then
|
||||
slots_used = slots_used + 1
|
||||
use_new_list = i > new_slots
|
||||
new_list[slots_used] = v
|
||||
end
|
||||
end
|
||||
if new_slots >= slots_used then
|
||||
if use_new_list then
|
||||
player_inv:set_list(listname.."contents", new_list)
|
||||
end
|
||||
return 1
|
||||
end
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
allow_take = function(inv, listname, index, stack, player)
|
||||
if player:get_inventory():is_empty(listname.."contents") then
|
||||
|
@ -189,30 +215,31 @@ minetest.register_tool("unified_inventory:bag_large", {
|
|||
})
|
||||
|
||||
-- register bag crafts
|
||||
minetest.register_craft({
|
||||
output = "unified_inventory:bag_small",
|
||||
recipe = {
|
||||
{"", "farming:cotton", ""},
|
||||
{"group:wool", "group:wool", "group:wool"},
|
||||
{"group:wool", "group:wool", "group:wool"},
|
||||
},
|
||||
})
|
||||
if minetest.get_modpath("farming") ~= nil then
|
||||
minetest.register_craft({
|
||||
output = "unified_inventory:bag_small",
|
||||
recipe = {
|
||||
{"", "farming:cotton", ""},
|
||||
{"group:wool", "group:wool", "group:wool"},
|
||||
{"group:wool", "group:wool", "group:wool"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "unified_inventory:bag_medium",
|
||||
recipe = {
|
||||
{"", "", ""},
|
||||
{"farming:cotton", "unified_inventory:bag_small", "farming:cotton"},
|
||||
{"farming:cotton", "unified_inventory:bag_small", "farming:cotton"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "unified_inventory:bag_large",
|
||||
recipe = {
|
||||
{"", "", ""},
|
||||
{"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"},
|
||||
{"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "unified_inventory:bag_medium",
|
||||
recipe = {
|
||||
{"", "", ""},
|
||||
{"farming:cotton", "unified_inventory:bag_small", "farming:cotton"},
|
||||
{"farming:cotton", "unified_inventory:bag_small", "farming:cotton"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "unified_inventory:bag_large",
|
||||
recipe = {
|
||||
{"", "", ""},
|
||||
{"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"},
|
||||
{"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
|
|
@ -187,3 +187,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
unified_inventory.current_page[player_name])
|
||||
end)
|
||||
|
||||
if minetest.delete_detached_inventory then
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local player_name = player:get_player_name()
|
||||
minetest.delete_detached_inventory(player_name.."_bags")
|
||||
minetest.delete_detached_inventory(player_name.."craftrecipe")
|
||||
minetest.delete_detached_inventory(player_name.."refill")
|
||||
end)
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
creative?
|
||||
intllib?
|
||||
datastorage?
|
||||
|
||||
farming?
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
local worldpath = minetest.get_worldpath()
|
||||
local mygettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
|
||||
|
||||
-- Data tables definitions
|
||||
unified_inventory = {
|
||||
|
@ -31,7 +32,8 @@ unified_inventory = {
|
|||
default = "craft",
|
||||
|
||||
-- intllib
|
||||
gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end,
|
||||
gettext = mygettext,
|
||||
fgettext = function(s) return minetest.formspec_escape(mygettext(s)) end,
|
||||
|
||||
-- "Lite" mode
|
||||
lite_mode = minetest.setting_getbool("unified_inventory_lite"),
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
local S = unified_inventory.gettext
|
||||
local F = unified_inventory.fgettext
|
||||
|
||||
-- This pair of encoding functions is used where variable text must go in
|
||||
-- button names, where the text might contain formspec metacharacters.
|
||||
|
@ -135,39 +136,39 @@ function unified_inventory.get_formspec(player, page)
|
|||
formspec[n] =
|
||||
"image_button[" .. (start_x + 0.6 * 0)
|
||||
.. ",9;.8,.8;ui_skip_backward_icon.png;start_list;]"
|
||||
.. "tooltip[start_list;" .. minetest.formspec_escape(S("First page")) .. "]"
|
||||
.. "tooltip[start_list;" .. F("First page") .. "]"
|
||||
|
||||
.. "image_button[" .. (start_x + 0.6 * 1)
|
||||
.. ",9;.8,.8;ui_doubleleft_icon.png;rewind3;]"
|
||||
.. "tooltip[rewind3;" .. minetest.formspec_escape(S("Back three pages")) .. "]"
|
||||
.. "tooltip[rewind3;" .. F("Back three pages") .. "]"
|
||||
.. "image_button[" .. (start_x + 0.6 * 2)
|
||||
.. ",9;.8,.8;ui_left_icon.png;rewind1;]"
|
||||
.. "tooltip[rewind1;" .. minetest.formspec_escape(S("Back one page")) .. "]"
|
||||
.. "tooltip[rewind1;" .. F("Back one page") .. "]"
|
||||
|
||||
.. "image_button[" .. (start_x + 0.6 * 3)
|
||||
.. ",9;.8,.8;ui_right_icon.png;forward1;]"
|
||||
.. "tooltip[forward1;" .. minetest.formspec_escape(S("Forward one page")) .. "]"
|
||||
.. "tooltip[forward1;" .. F("Forward one page") .. "]"
|
||||
.. "image_button[" .. (start_x + 0.6 * 4)
|
||||
.. ",9;.8,.8;ui_doubleright_icon.png;forward3;]"
|
||||
.. "tooltip[forward3;" .. minetest.formspec_escape(S("Forward three pages")) .. "]"
|
||||
.. "tooltip[forward3;" .. F("Forward three pages") .. "]"
|
||||
|
||||
.. "image_button[" .. (start_x + 0.6 * 5)
|
||||
.. ",9;.8,.8;ui_skip_forward_icon.png;end_list;]"
|
||||
.. "tooltip[end_list;" .. minetest.formspec_escape(S("Last page")) .. "]"
|
||||
.. "tooltip[end_list;" .. F("Last page") .. "]"
|
||||
else
|
||||
formspec[n] =
|
||||
"image_button[" .. (8.2 + 0.65 * 0)
|
||||
.. ",5.8;.8,.8;ui_skip_backward_icon.png;start_list;]"
|
||||
.. "tooltip[start_list;" .. minetest.formspec_escape(S("First page")) .. "]"
|
||||
.. "tooltip[start_list;" .. F("First page") .. "]"
|
||||
.. "image_button[" .. (8.2 + 0.65 * 1)
|
||||
.. ",5.8;.8,.8;ui_left_icon.png;rewind1;]"
|
||||
.. "tooltip[rewind1;" .. minetest.formspec_escape(S("Back one page")) .. "]"
|
||||
.. "tooltip[rewind1;" .. F("Back one page") .. "]"
|
||||
.. "image_button[" .. (8.2 + 0.65 * 2)
|
||||
.. ",5.8;.8,.8;ui_right_icon.png;forward1;]"
|
||||
.. "tooltip[forward1;" .. minetest.formspec_escape(S("Forward one page")) .. "]"
|
||||
.. "tooltip[forward1;" .. F("Forward one page") .. "]"
|
||||
.. "image_button[" .. (8.2 + 0.65 * 3)
|
||||
.. ",5.8;.8,.8;ui_skip_forward_icon.png;end_list;]"
|
||||
.. "tooltip[end_list;" .. minetest.formspec_escape(S("Last page")) .. "]"
|
||||
.. "tooltip[end_list;" .. F("Last page") .. "]"
|
||||
end
|
||||
n = n+1
|
||||
|
||||
|
@ -177,12 +178,12 @@ function unified_inventory.get_formspec(player, page)
|
|||
formspec[n] = "field[9.5,8.325;3,1;searchbox;;"
|
||||
.. minetest.formspec_escape(unified_inventory.current_searchbox[player_name]) .. "]"
|
||||
formspec[n+1] = "image_button[12.2,8.1;.8,.8;ui_search_icon.png;searchbutton;]"
|
||||
.. "tooltip[searchbutton;" ..S("Search") .. "]"
|
||||
.. "tooltip[searchbutton;" ..F("Search") .. "]"
|
||||
else
|
||||
formspec[n] = "field[8.5,5.225;2.2,1;searchbox;;"
|
||||
.. minetest.formspec_escape(unified_inventory.current_searchbox[player_name]) .. "]"
|
||||
formspec[n+1] = "image_button[10.3,5;.8,.8;ui_search_icon.png;searchbutton;]"
|
||||
.. "tooltip[searchbutton;" ..S("Search") .. "]"
|
||||
.. "tooltip[searchbutton;" ..F("Search") .. "]"
|
||||
end
|
||||
n = n+2
|
||||
|
||||
|
@ -193,7 +194,7 @@ function unified_inventory.get_formspec(player, page)
|
|||
|
||||
-- Items list
|
||||
if #unified_inventory.filtered_items_list[player_name] == 0 then
|
||||
formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";" .. S(no_matches) .. "]"
|
||||
formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";" .. F(no_matches) .. "]"
|
||||
else
|
||||
local dir = unified_inventory.active_search_direction[player_name]
|
||||
local list_index = unified_inventory.current_index[player_name]
|
||||
|
@ -206,6 +207,18 @@ function unified_inventory.get_formspec(player, page)
|
|||
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
|
||||
-- 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]
|
||||
if cdir == "recipe" then
|
||||
dir = "usage"
|
||||
elseif cdir == "usage" then
|
||||
dir = "recipe"
|
||||
end
|
||||
else
|
||||
-- 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;"
|
||||
|
@ -216,13 +229,13 @@ function unified_inventory.get_formspec(player, page)
|
|||
end
|
||||
end
|
||||
end
|
||||
formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";"..S("Page") .. ": "
|
||||
formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";"..F("Page") .. ": "
|
||||
.. S("%s of %s"):format(page,pagemax).."]"
|
||||
end
|
||||
n= n+1
|
||||
|
||||
if unified_inventory.activefilter[player_name] ~= "" then
|
||||
formspec[n] = "label[8.2,"..(ui_peruser.form_header_y + 0.4)..";" .. S("Filter") .. ":]"
|
||||
formspec[n] = "label[8.2,"..(ui_peruser.form_header_y + 0.4)..";" .. F("Filter") .. ":]"
|
||||
formspec[n+1] = "label[9.1,"..(ui_peruser.form_header_y + 0.4)..";"..minetest.formspec_escape(unified_inventory.activefilter[player_name]).."]"
|
||||
end
|
||||
return table.concat(formspec, "")
|
||||
|
|
|
@ -1,71 +1,90 @@
|
|||
# Translation mostly by Xanthin
|
||||
|
||||
### api.lua ###
|
||||
Digging (by chance) = Graben (durch Zufall)
|
||||
|
||||
### bags.lua ###
|
||||
Bags = Rucksaecke
|
||||
Bag 1 = Rucksack 1
|
||||
Bag 2 = Rucksack 2
|
||||
Bag 3 = Rucksack 3
|
||||
Bag 4 = Rucksack 4
|
||||
Small Bag = Rucksack (klein)
|
||||
Medium Bag = Rucksack (mittel)
|
||||
Large Bag = Rucksack (gross)
|
||||
Bags = Taschen
|
||||
Bag 1 = Tasche 1
|
||||
Bag 2 = Tasche 2
|
||||
Bag 3 = Tasche 3
|
||||
Bag 4 = Tasche 4
|
||||
Small Bag = Kleine Tasche
|
||||
Medium Bag = Mittelgroße Tasche
|
||||
Large Bag = Große Tasche
|
||||
|
||||
### inernal.lua ###
|
||||
First page = Erste Seite
|
||||
Back three pages = Drei Seiten zurueckblaettern
|
||||
Back one page = Eine Seiten zurueckblaettern
|
||||
Forward one page = Eine Seiten vorblaettern
|
||||
Forward three pages = Drei Seiten vorblaettern
|
||||
Back three pages = Drei Seiten zurueckblättern
|
||||
Back one page = Eine Seite zurueckblättern
|
||||
Forward one page = Eine Seite vorblättern
|
||||
Forward three pages = Drei Seiten vorblättern
|
||||
Last page = Letzte Seite
|
||||
No matching items = Keine passenden Gegenstände
|
||||
Page = Seite
|
||||
%s of %s = %s von %s
|
||||
Filter = Suche
|
||||
Filter = Filter
|
||||
Search = Suchen
|
||||
|
||||
### register.lua ###
|
||||
Can use the creative inventory = Kann das Kreativinventar nutzen
|
||||
Home position set to: %s = Ausgangsposition nach: %s gesetzt
|
||||
Time of day set to 6am = Tageszeit auf 6 Uhr morgens geaendert
|
||||
You don't have the settime privilege! = Du hast nicht das "settime" Privileg!
|
||||
Time of day set to 9pm = Tageszeit auf 9 Uhr abends geaendert
|
||||
This button has been disabled outside of creative mode to prevent accidental inventory trashing. Use the trash slot instead. = Diese Funktion ist ausserhalb des Kreativmodus deaktiviert um ein versehentliches Loeschen des ganzen Inventars zu verhindern.\nNutze stattdessen das Muellfeld.
|
||||
Inventory Cleared! = Inventar geleert!
|
||||
Crafting = Bauen
|
||||
Trash: = Muell:
|
||||
Refill: = Nachfuellen:
|
||||
Crafting Guide = Bauanleitung
|
||||
Home position set to: %s = Heimatposition nach: %s gesetzt
|
||||
Time of day set to 6am = Tageszeit auf 6 Uhr geändert
|
||||
You don't have the settime privilege! = Du hast nicht das „settime“-Privileg!
|
||||
Time of day set to 9pm = Tageszeit auf 21 Uhr geändert
|
||||
This button has been disabled outside of creative mode to prevent accidental inventory trashing. Use the trash slot instead. = Diese Funktion ist außerhalb des Kreativmodus deaktiviert, um ein versehentliches Löschen des ganzen Inventars zu verhindern.\nNutze stattdessen das Müllfeld.
|
||||
Inventory cleared! = Inventar geleert!
|
||||
Crafting = Fertigung
|
||||
Digging = Graben
|
||||
Cooking = Kochen
|
||||
Mixing = Mischen
|
||||
Trash: = Müll:
|
||||
Refill: = Nachfüllen:
|
||||
Crafting Guide = Fertigungsführer
|
||||
Method: = Methode:
|
||||
Result: %s = Ergebnis: %s
|
||||
crafting = Bauen
|
||||
shapeless crafting = Formloses Bauen
|
||||
shapeless crafting = Formlose Fertigung
|
||||
cooking = Kochen
|
||||
alloy cooking = Legierung Kochen
|
||||
Copy to craft grid: = Kopiere ins Baufeld:
|
||||
Copy to craft grid: = Ins Fertigungsraster kopieren:
|
||||
All = Alles
|
||||
Recipe %s of %s = Rezept %s von %s
|
||||
Alternate = Alternative
|
||||
Crafting Grid =
|
||||
Crafting Grid = Fertigungsraster
|
||||
Recipe %d of %d = Rezept %d von %d
|
||||
Usage %d of %d = Verwendung %d von %d
|
||||
No recipes = Keine Rezepte
|
||||
No usages = Keine Verwendungen
|
||||
Result = Ergebnis
|
||||
Ingredient = Zutat
|
||||
Set time to day = Zur Tageszeit wechseln
|
||||
Set time to night = Zur Nachtzeit wechseln
|
||||
Set home position = Heimatposition setzen
|
||||
Go home = Nach Hause gehen
|
||||
Clear inventory = Inventar leeren
|
||||
Give me: = Gib mir:
|
||||
To craft grid: = Ins Fertigungsraster:
|
||||
|
||||
### waypoints.lua ###
|
||||
White = Weiß
|
||||
Yellow = Gelb
|
||||
Red = Rot
|
||||
Green = Gruen
|
||||
Green = Grün
|
||||
Blue = Blau
|
||||
Waypoints = Markierungen
|
||||
Waypoint active = Markierung aktiv
|
||||
Waypoint inactive = Markierung inaktiv
|
||||
World position = Welt Position
|
||||
Name =
|
||||
HUD text color =
|
||||
Edit waypoint name = Name der Markierung aendern
|
||||
Rename waypoint = Markierung umbenennen
|
||||
Change color of waypoint display = Farbe der Darstellung der Markierung aendern
|
||||
Set waypoint to current location = Setze Markierung zur derzeitigen Position
|
||||
Make waypoint visible = Markierung sichtbar machen
|
||||
Make waypoint invisible = Markierung verstecken
|
||||
Disable display of waypoint coordinates =
|
||||
Enable display of waypoint coordinates =
|
||||
Finish editing =
|
||||
Select Waypoint #%d =
|
||||
Waypoints = Wegpunkte
|
||||
Waypoint %d = Wegpunkt Nr. %d
|
||||
Waypoint active = Wegpunkt aktiv
|
||||
Waypoint inactive = Wegpunkt inaktiv
|
||||
World position = Weltposition
|
||||
Name = Name
|
||||
HUD text color = HUD-Textfarbe
|
||||
Edit waypoint name = Name des Wegpunkts ändern
|
||||
Rename waypoint = Wegpunkt umbenennen
|
||||
Change color of waypoint display = Farbe der Darstellung der Wegpunkte ändern
|
||||
Set waypoint to current location = Setze Wegpunkt zur derzeitigen Position
|
||||
Make waypoint visible = Wegpunkt sichtbar machen
|
||||
Make waypoint invisible = Wegpunkt verstecken
|
||||
Disable display of waypoint coordinates = Anzeige der Wegpunktkoordinaten deaktivieren
|
||||
Enable display of waypoint coordinates = Anzeige der Wegpunktkoordinaten aktivieren
|
||||
Finish editing = Bearbeitung abschließen
|
||||
Select Waypoint #%d = Wegpunkt Nr. %d auswählen
|
||||
|
|
|
@ -31,7 +31,7 @@ Time of day set to 6am = Hora del día cambiada a 6AM
|
|||
You don't have the settime priviledge! = ¡No tienes el privilegio `settime'!
|
||||
Time of day set to 9pm = Hora del día cambiada a 9PM
|
||||
This button has been disabled outside of creative mode to prevent accidental inventory trashing. Use the trash slot instead. = Éste botón ha sido deshabilitado para prevenir la destrucción accidental del inventario.\nUsa la ranura para basura en su lugar.
|
||||
Inventory Cleared! = ¡Inventario limpio!
|
||||
Inventory cleared! = ¡Inventario limpio!
|
||||
Crafting = Elaboración
|
||||
Trash: = Basura:
|
||||
Refill: = Rellenar:
|
||||
|
|
|
@ -31,7 +31,7 @@ Time of day set to 6am = Heure fixée à 6h
|
|||
You don't have the settime priviledge! = Vous n'avez pas le privilège 'settime' !
|
||||
Time of day set to 9pm = Heure fixée à 21h
|
||||
This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. = Ce bouton a été désactivé en dehors du mode créatif pour éviter des saccages dans l'inventaire.\nUtilisez plutôt la case poubelle.
|
||||
Inventory Cleared! = Inventaire vidé !
|
||||
Inventory cleared! = Inventaire vidé !
|
||||
Crafting = Création
|
||||
Trash: = Poubelle :
|
||||
Refill: = Remplir :
|
||||
|
|
|
@ -30,7 +30,7 @@ Time of day set to 6am = Czas ustawiony na 6:00
|
|||
You don't have the settime priviledge! = Nie masz uprawnien do zmiany czasu (settime)!
|
||||
Time of day set to 9pm = Czas ustawiony na 21:00
|
||||
This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. =
|
||||
Inventory Cleared! =
|
||||
Inventory cleared! =
|
||||
Crafting =
|
||||
Trash: = Smietnik:
|
||||
Refill: = Uzupelnianie:
|
||||
|
|
|
@ -31,7 +31,7 @@ Time of day set to 6am = Установлено время 6 утра
|
|||
You don't have the settime priviledge! = Вам не разрешено устанавливать время!
|
||||
Time of day set to 9pm = Установлено время 9 вечера
|
||||
This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. = Эта кнопка отключена вне творческого режима, чтобы предотвратить случайное уничтожение предметов.\nИспользуйте слот корзины вместо нее.
|
||||
Inventory Cleared! = Инвентарь очищен!
|
||||
Inventory cleared! = Инвентарь очищен!
|
||||
Crafting = Крафт
|
||||
Trash: = Корзина:
|
||||
Refill: = Размножить:
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Translation by
|
||||
|
||||
### api.lua ###
|
||||
Digging (by chance) =
|
||||
|
||||
# Template
|
||||
### bags.lua ###
|
||||
Bags =
|
||||
|
@ -26,13 +29,17 @@ Search =
|
|||
|
||||
### register.lua ###
|
||||
Can use the creative inventory =
|
||||
Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally =
|
||||
Home position set to: %s =
|
||||
Time of day set to 6am =
|
||||
You don't have the settime priviledge! =
|
||||
Time of day set to 9pm =
|
||||
This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. =
|
||||
Inventory Cleared! =
|
||||
Inventory cleared! =
|
||||
Crafting =
|
||||
Digging =
|
||||
Cooking =
|
||||
Mixing =
|
||||
Trash: =
|
||||
Refill: =
|
||||
Crafting Guide =
|
||||
|
@ -44,9 +51,21 @@ cooking =
|
|||
alloy cooking =
|
||||
Copy to craft grid: =
|
||||
All =
|
||||
Recipe %s of %s =
|
||||
Alternate =
|
||||
Crafting Grid =
|
||||
Recipe %d of %d =
|
||||
Usage %d of %d =
|
||||
No recipes =
|
||||
No usages =
|
||||
Result =
|
||||
Ingredient =
|
||||
Set time to day =
|
||||
Set time to night =
|
||||
Set home position =
|
||||
Go home =
|
||||
Clear inventory =
|
||||
Give me: =
|
||||
To craft grid: =
|
||||
|
||||
### waypoints.lua ###
|
||||
White =
|
||||
|
@ -55,6 +74,7 @@ Red =
|
|||
Green =
|
||||
Blue =
|
||||
Waypoints =
|
||||
Waypoint %d =
|
||||
Waypoint active =
|
||||
Waypoint inactive =
|
||||
World position =
|
||||
|
|
|
@ -31,7 +31,7 @@ Time of day set to 6am = Saat 06:00 olarak ayarlandı
|
|||
You don't have the settime priviledge = Saati düzenleme yetkiniz yok!
|
||||
Time of day set to 9pm = Saat 19:00 olarak ayarlandı
|
||||
This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. = Yaratıcı modu dışında iken bu tuş kullanılamaz.
|
||||
Inventory Cleared! = Envanter temizlendi!
|
||||
Inventory cleared! = Envanter temizlendi!
|
||||
Crafting = Üretim
|
||||
Trash: = Çöp
|
||||
Refill: = Doldur
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
local S = unified_inventory.gettext
|
||||
local F = unified_inventory.fgettext
|
||||
|
||||
minetest.register_privilege("creative", {
|
||||
description = "Can use the creative inventory",
|
||||
description = S("Can use the creative inventory"),
|
||||
give_to_singleplayer = false,
|
||||
})
|
||||
|
||||
minetest.register_privilege("ui_full", {
|
||||
description = "Forces UI to display in Full mode when Lite mode is configured globally",
|
||||
description = S("Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally"),
|
||||
give_to_singleplayer = false,
|
||||
})
|
||||
|
||||
|
@ -135,7 +136,7 @@ unified_inventory.register_button("clear_inv", {
|
|||
return
|
||||
end
|
||||
player:get_inventory():set_list("main", {})
|
||||
minetest.chat_send_player(player_name, 'Inventory Cleared!')
|
||||
minetest.chat_send_player(player_name, S('Inventory cleared!'))
|
||||
minetest.sound_play("trash_all",
|
||||
{to_player=player_name, gain = 1.0})
|
||||
end,
|
||||
|
@ -150,16 +151,16 @@ unified_inventory.register_page("craft", {
|
|||
local player_name = player:get_player_name()
|
||||
local formspec = "background[2,"..formspecy..";6,3;ui_crafting_form.png]"
|
||||
formspec = formspec.."background[0,"..(formspecy + 3.5)..";8,4;ui_main_inventory.png]"
|
||||
formspec = formspec.."label[0,"..formheadery..";Crafting]"
|
||||
formspec = formspec.."label[0,"..formheadery..";" ..F("Crafting").."]"
|
||||
formspec = formspec.."listcolors[#00000000;#00000000]"
|
||||
formspec = formspec.."list[current_player;craftpreview;6,"..formspecy..";1,1;]"
|
||||
formspec = formspec.."list[current_player;craft;2,"..formspecy..";3,3;]"
|
||||
formspec = formspec.."label[7,"..(formspecy + 1.5)..";" .. S("Trash:") .. "]"
|
||||
formspec = formspec.."label[7,"..(formspecy + 1.5)..";" .. F("Trash:") .. "]"
|
||||
formspec = formspec.."list[detached:trash;main;7,"..(formspecy + 2)..";1,1;]"
|
||||
formspec = formspec.."listring[current_name;craft]"
|
||||
formspec = formspec.."listring[current_player;main]"
|
||||
if unified_inventory.is_creative(player_name) then
|
||||
formspec = formspec.."label[0,"..(formspecy + 1.5)..";" .. S("Refill:") .. "]"
|
||||
formspec = formspec.."label[0,"..(formspecy + 1.5)..";" .. F("Refill:") .. "]"
|
||||
formspec = formspec.."list[detached:"..minetest.formspec_escape(player_name).."refill;main;0,"..(formspecy +2)..";1,1;]"
|
||||
end
|
||||
return {formspec=formspec}
|
||||
|
@ -195,8 +196,8 @@ local function stack_image_button(x, y, w, h, buttonname_prefix, item)
|
|||
end
|
||||
|
||||
local recipe_text = {
|
||||
recipe = "Recipe",
|
||||
usage = "Usage",
|
||||
recipe = "Recipe %d of %d",
|
||||
usage = "Usage %d of %d",
|
||||
}
|
||||
local no_recipe_text = {
|
||||
recipe = "No recipes",
|
||||
|
@ -223,10 +224,12 @@ unified_inventory.register_page("craftguide", {
|
|||
local player_privs = minetest.get_player_privs(player_name)
|
||||
local formspec = ""
|
||||
formspec = formspec.."background[0,"..(formspecy + 3.5)..";8,4;ui_main_inventory.png]"
|
||||
formspec = formspec.."label[0,"..formheadery..";" .. S("Crafting Guide") .. "]"
|
||||
formspec = formspec.."label[0,"..formheadery..";" .. F("Crafting Guide") .. "]"
|
||||
formspec = formspec.."listcolors[#00000000;#00000000]"
|
||||
local item_name = unified_inventory.current_item[player_name]
|
||||
if not item_name then return {formspec=formspec} end
|
||||
local displayed_name = minetest.registered_items[item_name].description
|
||||
if not displayed_name then displayed_name = item_name end
|
||||
|
||||
local dir = unified_inventory.current_craft_direction[player_name]
|
||||
local rdir
|
||||
|
@ -242,20 +245,20 @@ unified_inventory.register_page("craftguide", {
|
|||
|
||||
formspec = formspec.."background[0.5,"..(formspecy + 0.2)..";8,3;ui_craftguide_form.png]"
|
||||
formspec = formspec.."textarea["..craftresultx..","..craftresulty
|
||||
..";10,1;;"..minetest.formspec_escape(role_text[dir]..": "..item_name)..";]"
|
||||
..";10,1;;"..minetest.formspec_escape(F(role_text[dir])..": "..displayed_name)..";]"
|
||||
formspec = formspec..stack_image_button(0, formspecy, 1.1, 1.1, "item_button_"
|
||||
.. rdir .. "_", ItemStack(item_name))
|
||||
|
||||
if not craft then
|
||||
formspec = formspec.."label[5.5,"..(formspecy + 2.35)..";"
|
||||
..minetest.formspec_escape(no_recipe_text[dir]).."]"
|
||||
..minetest.formspec_escape(F(no_recipe_text[dir])).."]"
|
||||
local no_pos = dir == "recipe" and 4.5 or 6.5
|
||||
local item_pos = dir == "recipe" and 6.5 or 4.5
|
||||
formspec = formspec.."image["..no_pos..","..formspecy..";1.1,1.1;ui_no.png]"
|
||||
formspec = formspec..stack_image_button(item_pos, formspecy, 1.1, 1.1, "item_button_"
|
||||
..other_dir[dir].."_", ItemStack(item_name))
|
||||
if player_privs.give == true then
|
||||
formspec = formspec.."label[0,"..(formspecy + 2.10)..";" .. S("Give me:") .. "]"
|
||||
formspec = formspec.."label[0,"..(formspecy + 2.10)..";" .. F("Give me:") .. "]"
|
||||
.."button[0, "..(formspecy + 2.7)..";0.6,0.5;craftguide_giveme_1;1]"
|
||||
.."button[0.6,"..(formspecy + 2.7)..";0.7,0.5;craftguide_giveme_10;10]"
|
||||
.."button[1.3,"..(formspecy + 2.7)..";0.8,0.5;craftguide_giveme_99;99]"
|
||||
|
@ -297,23 +300,22 @@ unified_inventory.register_page("craftguide", {
|
|||
end
|
||||
|
||||
if craft_type.uses_crafting_grid then
|
||||
formspec = formspec.."label[0,"..(formspecy + 0.9)..";" .. S("To craft grid:") .. "]"
|
||||
formspec = formspec.."label[0,"..(formspecy + 0.9)..";" .. F("To craft grid:") .. "]"
|
||||
.."button[0, "..(formspecy + 1.5)..";0.6,0.5;craftguide_craft_1;1]"
|
||||
.."button[0.6,"..(formspecy + 1.5)..";0.7,0.5;craftguide_craft_10;10]"
|
||||
.."button[1.3,"..(formspecy + 1.5)..";0.8,0.5;craftguide_craft_max;" .. S("All") .. "]"
|
||||
.."button[1.3,"..(formspecy + 1.5)..";0.8,0.5;craftguide_craft_max;" .. F("All") .. "]"
|
||||
end
|
||||
if player_privs.give then
|
||||
formspec = formspec.."label[0,"..(formspecy + 2.1)..";" .. S("Give me:") .. "]"
|
||||
formspec = formspec.."label[0,"..(formspecy + 2.1)..";" .. F("Give me:") .. "]"
|
||||
.."button[0, "..(formspecy + 2.7)..";0.6,0.5;craftguide_giveme_1;1]"
|
||||
.."button[0.6,"..(formspecy + 2.7)..";0.7,0.5;craftguide_giveme_10;10]"
|
||||
.."button[1.3,"..(formspecy + 2.7)..";0.8,0.5;craftguide_giveme_99;99]"
|
||||
end
|
||||
|
||||
if alternates and alternates > 1 then
|
||||
formspec = formspec.."label[5.5,"..(formspecy + 1.6)..";"..recipe_text[dir].." "
|
||||
..tostring(alternate).." of "
|
||||
..tostring(alternates).."]"
|
||||
.."button[5.5,"..(formspecy + 2)..";2,1;alternate;" .. S("Alternate") .. "]"
|
||||
formspec = formspec.."label[5.5,"..(formspecy + 1.6)..";"
|
||||
..string.format(F(recipe_text[dir]), alternate, alternates).."]"
|
||||
.."button[5.5,"..(formspecy + 2)..";2,1;alternate;" .. F("Alternate") .. "]"
|
||||
end
|
||||
return {formspec = formspec}
|
||||
end,
|
||||
|
|
Before Width: | Height: | Size: 149 KiB After Width: | Height: | Size: 134 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 688 B After Width: | Height: | Size: 546 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 777 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 81 B |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 680 B After Width: | Height: | Size: 896 B |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 3.8 KiB |