Compare commits
36 Commits
next
...
server_ste
Author | SHA1 | Date | |
---|---|---|---|
49dcd970a0 | |||
ddcdc74fd3 | |||
62a8ae240c | |||
fa0cf15cd9 | |||
8be0d0e1d9 | |||
f9ce95154e | |||
24160d45ff | |||
682cf34792 | |||
6f83f4cf1e | |||
255e363b04 | |||
ac9a05df0b | |||
cc20b9ba47 | |||
163384f308 | |||
d4f18d08c0 | |||
9299111900 | |||
13757ac854 | |||
0a9bcf26ca | |||
b3fb406727 | |||
b0bef909a0 | |||
fc5245139d | |||
109d817df6 | |||
1a5b1b4691 | |||
10bacdd7f4 | |||
8afc6abcd5 | |||
e88e99b54f | |||
01d8c26b5b | |||
3b1afb1783 | |||
6cfd12e63c | |||
c08e868be2 | |||
f1a327ad16 | |||
e45a2a511e | |||
63a18f1a51 | |||
57e1547515 | |||
3b38bbcaf2 | |||
e789794c75 | |||
2cc38909a1 |
24
README
@ -1,24 +0,0 @@
|
|||||||
-- |\ /| ____ ____ ____ _____ ____ _____
|
|
||||||
-- | \ / | | | | | | | |\ | |
|
|
||||||
-- | \/ | |___ ____ |___ | | | | \ | |____
|
|
||||||
-- | | | | | | | | | \ | |
|
|
||||||
-- | | |___ ____| |___ |____ |____| | \| ____|
|
|
||||||
-- by Jeija and contributors
|
|
||||||
|
|
||||||
Credits:
|
|
||||||
Jeija: main developer
|
|
||||||
VanessaE: Awesome textures & design, coding
|
|
||||||
sfan5: coding, textures
|
|
||||||
temperest: coding, textures
|
|
||||||
Jordach: Sounds for the noteblock
|
|
||||||
minerd247: Some textures
|
|
||||||
...other contributors
|
|
||||||
|
|
||||||
This is a mod for minetest-c55.
|
|
||||||
Copy the minetest-mod-mesecons directory into you game's mod folder
|
|
||||||
(e.g. games/minetest_game/mods/minetest-mod-mesecons)
|
|
||||||
|
|
||||||
You can remove modules of this mod by deleting the mesecons_*
|
|
||||||
folders in the minetest-mod-mesecons directory.
|
|
||||||
|
|
||||||
Mod dependencies: none
|
|
76
README.md
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
########################################################################
|
||||||
|
## __ __ _____ _____ _____ _____ _____ _ _ _____ ##
|
||||||
|
## | \ / | | ___| | ___| | ___| | ___| | _ | | \ | | | ___| ##
|
||||||
|
## | \/ | | |___ | |___ | |___ | | | | | | | \| | | |___ ##
|
||||||
|
## | |\__/| | | ___| |___ | | ___| | | | | | | | | |___ | ##
|
||||||
|
## | | | | | |___ ___| | | |___ | |___ | |_| | | |\ | ___| | ##
|
||||||
|
## |_| |_| |_____| |_____| |_____| |_____| |_____| |_| \_| |_____| ##
|
||||||
|
## ##
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
MESECONS by Jeija and contributors
|
||||||
|
|
||||||
|
Mezzee-what?
|
||||||
|
------------
|
||||||
|
[Mesecons](http://mesecons.net/)! They're yellow, they're conductive, and they'll add a whole new dimension to Minetest's gameplay.
|
||||||
|
|
||||||
|
Mesecons is a mod for [Minetest](http://minetest.net/) that implements a ton of items related to digital circuitry, such as wires, buttons, lights, and even programmable controllers. Among other things, there are also pistons, solar panels, pressure plates, and note blocks.
|
||||||
|
|
||||||
|
Mesecons has a similar goal to Redstone in Minecraft, but works in its own way, with different rules and mechanics.
|
||||||
|
|
||||||
|
OK, I want in.
|
||||||
|
--------------
|
||||||
|
Go get it!
|
||||||
|
|
||||||
|
[DOWNLOADS PAGE](http://mesecons.net/downloads.php)
|
||||||
|
|
||||||
|
Now go ahead and install it like any other Minetest mod. Don't know how? Check out [the wonderful page about it](http://wiki.minetest.com/wiki/Mods) over at the Minetest Wiki. For your convenience, here's a quick summary:
|
||||||
|
|
||||||
|
1. If Mesecons is still in a ZIP file, extract the folder inside to somewhere on the computer.
|
||||||
|
2. Make sure that when you open the folder, you can directly find `README.md` in the listing. If you just see another folder, move that folder up one level and delete the old one.
|
||||||
|
3. Open up the Minetest mods folder - usually `/mods/`. If you see the `minetest` or folder inside of that, that is your mod folder instead.
|
||||||
|
4. Copy the Mesecons folder into the mods folder.
|
||||||
|
|
||||||
|
Don't like some parts of Mesecons? Open up the Mesecons folder and delete the subfolder containing the mod you don't want. If you didn't want movestones, for example, all you have to do is delete the `mesecons_movestones` folder and they will no longer be available.
|
||||||
|
|
||||||
|
There are no dependencies - it will work right after installing!
|
||||||
|
|
||||||
|
How do I use this thing?
|
||||||
|
------------------------
|
||||||
|
How about a [quick overview video](https://www.youtube.com/watch?v=6kmeQj6iW5k)?
|
||||||
|
|
||||||
|
Or maybe a [comprehensive reference](http://mesecons.net/items.php) is your style?
|
||||||
|
|
||||||
|
An overview for the very newest of new beginners? How does [this one](http://uberi.mesecons.net/projects/MeseconsBasics/index.html) look?
|
||||||
|
|
||||||
|
Want to get more into building? Why not check out the [Mesecons Laboratory](http://uberi.mesecons.net/), a website dedicated to advanced Mesecons builders?
|
||||||
|
|
||||||
|
Want to contribute to Mesecons itself? Check out the [source code](https://github.com/Jeija/minetest-mod-mesecons)!
|
||||||
|
|
||||||
|
Who wrote it anyways?
|
||||||
|
---------------------
|
||||||
|
These awesome people made Mesecons possible!
|
||||||
|
|
||||||
|
| Contributor | Contribution |
|
||||||
|
| --------------- | ---------------------------------- |
|
||||||
|
| Jat15 | Various tweaks. |
|
||||||
|
| Jeija | **Main developer! Everything.** |
|
||||||
|
| Jordach | Noteblock sounds. |
|
||||||
|
| khonkhortistan | Coding, recipes, textures. |
|
||||||
|
| Kotolegokot | Nodeboxes for items. |
|
||||||
|
| minerd247 | Textures. |
|
||||||
|
| RealBadAngel | Fixes, improvements. |
|
||||||
|
| sfan5 | Coding, recipes, textures. |
|
||||||
|
| Uberi/Temperest | Coding, textures, documentation. |
|
||||||
|
| VanessaE | Coding, recipes, textures, design. |
|
||||||
|
| Whiskers75 | Logic gates implementation. |
|
||||||
|
|
||||||
|
There are also a whole bunch of other people helping with everything from code to testing and feedback. Mesecons would also not be possible without their help!
|
||||||
|
|
||||||
|
Alright, how can I use it?
|
||||||
|
--------------------------
|
||||||
|
All textures in this project are licensed under the CC-BY-SA 2.0 (Creative Commons Attribution-ShareAlike 2.0 Generic). That means you can distribute and remix them as much as you want to, under the condition that you give credit to the authors and the project, and that if you remix and release them, they must be under the same or similar license to this one.
|
||||||
|
|
||||||
|
All code in this project is licensed under the LGPL version 3 or later. That means you have unlimited freedom to distribute and modify the work however you see fit, provided that if you decide to distribute it or any modified versions of it, you must also use the same license. The LGPL also grants the additional freedom to write extensions for the software and distribute them without the extensions being subject to the terms of the LGPL, although the software itself retains its license.
|
||||||
|
|
||||||
|
No warranty is provided, express or implied, for any part of the project.
|
@ -49,6 +49,10 @@ mesecon.receptors={} -- saves all information about receptors | DEPRECATED
|
|||||||
mesecon.effectors={} -- saves all information about effectors | DEPRECATED
|
mesecon.effectors={} -- saves all information about effectors | DEPRECATED
|
||||||
mesecon.conductors={} -- saves all information about conductors | DEPRECATED
|
mesecon.conductors={} -- saves all information about conductors | DEPRECATED
|
||||||
|
|
||||||
|
|
||||||
|
mesecon.to_update = {}
|
||||||
|
mesecon.r_to_update = {}
|
||||||
|
|
||||||
-- Settings
|
-- Settings
|
||||||
dofile(minetest.get_modpath("mesecons").."/settings.lua")
|
dofile(minetest.get_modpath("mesecons").."/settings.lua")
|
||||||
|
|
||||||
@ -76,7 +80,7 @@ dofile(minetest.get_modpath("mesecons").."/legacy.lua");
|
|||||||
-- API
|
-- API
|
||||||
-- these are the only functions you need to remember
|
-- these are the only functions you need to remember
|
||||||
|
|
||||||
function mesecon:receptor_on(pos, rules)
|
function mesecon:receptor_on_i(pos, rules)
|
||||||
rules = rules or mesecon.rules.default
|
rules = rules or mesecon.rules.default
|
||||||
|
|
||||||
for _, rule in ipairs(rules) do
|
for _, rule in ipairs(rules) do
|
||||||
@ -88,7 +92,12 @@ function mesecon:receptor_on(pos, rules)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mesecon:receptor_off(pos, rules)
|
function mesecon:receptor_on(pos, rules)
|
||||||
|
rules = rules or mesecon.rules.default
|
||||||
|
mesecon.r_to_update[#mesecon.r_to_update+1]={pos=pos, rules=rules, action="on"}
|
||||||
|
end
|
||||||
|
|
||||||
|
function mesecon:receptor_off_i(pos, rules)
|
||||||
rules = rules or mesecon.rules.default
|
rules = rules or mesecon.rules.default
|
||||||
|
|
||||||
for _, rule in ipairs(rules) do
|
for _, rule in ipairs(rules) do
|
||||||
@ -104,6 +113,11 @@ function mesecon:receptor_off(pos, rules)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function mesecon:receptor_off(pos, rules)
|
||||||
|
rules = rules or mesecon.rules.default
|
||||||
|
mesecon.r_to_update[#mesecon.r_to_update+1]={pos=pos, rules=rules, action="off"}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
print("[OK] Mesecons")
|
print("[OK] Mesecons")
|
||||||
|
|
||||||
|
@ -180,24 +180,111 @@ end
|
|||||||
--Signals
|
--Signals
|
||||||
|
|
||||||
function mesecon:activate(pos, node, rulename)
|
function mesecon:activate(pos, node, rulename)
|
||||||
local effector = mesecon:get_effector(node.name)
|
if rulename == nil then
|
||||||
if effector and effector.action_on then
|
for _,rule in ipairs(mesecon:effector_get_rules(node)) do
|
||||||
effector.action_on (pos, node, rulename)
|
mesecon:activate(pos, node, rule)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if MESECONS_GLOBALSTEP then
|
||||||
|
add_action(pos, "on", rulename)
|
||||||
|
else
|
||||||
|
local effector = mesecon:get_effector(node.name)
|
||||||
|
if effector and effector.action_on then
|
||||||
|
effector.action_on (pos, node, rulename)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mesecon:deactivate(pos, node, rulename)
|
function mesecon:deactivate(pos, node, rulename)
|
||||||
local effector = mesecon:get_effector(node.name)
|
if rulename == nil then
|
||||||
if effector and effector.action_off then
|
for _,rule in ipairs(mesecon:effector_get_rules(node)) do
|
||||||
effector.action_off (pos, node, rulename)
|
mesecon:deactivate(pos, node, rule)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if MESECONS_GLOBALSTEP then
|
||||||
|
add_action(pos, "off", rulename)
|
||||||
|
else
|
||||||
|
local effector = mesecon:get_effector(node.name)
|
||||||
|
if effector and effector.action_off then
|
||||||
|
effector.action_off (pos, node, rulename)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mesecon:changesignal(pos, node, rulename, newstate)
|
function mesecon:changesignal(pos, node, rulename, newstate)
|
||||||
local effector = mesecon:get_effector(node.name)
|
|
||||||
if effector and effector.action_change then
|
newstate = newstate or "on"
|
||||||
effector.action_change (pos, node, rulename, newstate)
|
--rulename = rulename or mesecon.rules.default
|
||||||
|
if rulename == nil then
|
||||||
|
for _,rule in ipairs(mesecon:effector_get_rules(node)) do
|
||||||
|
mesecon:changesignal(pos, node, rule, newstate)
|
||||||
|
end
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
if MESECONS_GLOBALSTEP then
|
||||||
|
add_action(pos, "c"..newstate, rulename)
|
||||||
|
else
|
||||||
|
local effector = mesecon:get_effector(node.name)
|
||||||
|
if effector and effector.action_change then
|
||||||
|
effector.action_change (pos, node, rulename, newstate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function execute_actions(dtime)
|
||||||
|
local nactions = mesecon.to_update
|
||||||
|
mesecon.to_update = {}
|
||||||
|
for _,i in ipairs(nactions) do
|
||||||
|
node = minetest.env:get_node(i.pos)
|
||||||
|
effector = mesecon:get_effector(node.name)
|
||||||
|
if i.action == "on" then
|
||||||
|
if effector and effector.action_on then
|
||||||
|
effector.action_on(i.pos, node, i.rname)
|
||||||
|
end
|
||||||
|
elseif i.action == "off" then
|
||||||
|
if effector and effector.action_off then
|
||||||
|
effector.action_off(i.pos, node, i.rname)
|
||||||
|
end
|
||||||
|
elseif i.action == "con" then
|
||||||
|
if effector and effector.action_change then
|
||||||
|
effector.action_change(i.pos, node, i.rname, "on")
|
||||||
|
end
|
||||||
|
elseif i.action == "coff" then
|
||||||
|
if effector and effector.action_change then
|
||||||
|
effector.action_change(i.pos, node, i.rname, "off")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local nactions = mesecon.r_to_update
|
||||||
|
mesecon.r_to_update = {}
|
||||||
|
for _,i in ipairs(nactions) do
|
||||||
|
if i.action == "on" then
|
||||||
|
mesecon:receptor_on_i(i.pos, i.rules)
|
||||||
|
else
|
||||||
|
mesecon:receptor_off_i(i.pos,i.rules)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_globalstep(execute_actions)
|
||||||
|
|
||||||
|
function add_action(pos, action, rname)
|
||||||
|
for _,i in ipairs(mesecon.to_update) do
|
||||||
|
if i.pos.x == pos.x and i.pos.y == pos.y and i.pos.z == pos.z and i.rname.x == rname.x and i.rname.y == rname.y and i.rname.z == rname.z then
|
||||||
|
if (i.action == "on" and action == "on") or (i.action == "off" and action == "off") then
|
||||||
|
--nothing
|
||||||
|
elseif i.action == "coff" and action == "on" then i.action = "on"
|
||||||
|
elseif i.action == "con" and action == "off" then i.action = "off"
|
||||||
|
else
|
||||||
|
if action == "on" or action == "con" then i.action = "con" end
|
||||||
|
if action == "off" or action == "coff" then i.action = "coff" end
|
||||||
|
end
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
mesecon.to_update[#mesecon.to_update+1] = {pos = pos, action = action, rname = rname}
|
||||||
end
|
end
|
||||||
|
|
||||||
--Rules
|
--Rules
|
||||||
|
@ -29,7 +29,7 @@ minetest.register_node("mesecons:mesecon_on", {
|
|||||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.45, 0.5},
|
fixed = {-0.5, -0.5, -0.5, 0.5, -0.45, 0.5},
|
||||||
},
|
},
|
||||||
groups = {dig_immediate=3, not_in_creaive_inventory=1, mesecon=1},
|
groups = {dig_immediate=3, not_in_creaive_inventory=1, mesecon=1},
|
||||||
drop = '"mesecons:mesecon_off" 1',
|
drop = "mesecons:mesecon_off 1",
|
||||||
light_source = LIGHT_MAX-11,
|
light_source = LIGHT_MAX-11,
|
||||||
mesecons = {conductor={
|
mesecons = {conductor={
|
||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
|
@ -6,7 +6,7 @@ mesecon.on_placenode = function (pos, node)
|
|||||||
mesecon:turnon (pos)
|
mesecon:turnon (pos)
|
||||||
mesecon:receptor_on (pos, mesecon:conductor_get_rules(node))
|
mesecon:receptor_on (pos, mesecon:conductor_get_rules(node))
|
||||||
else
|
else
|
||||||
mesecon:changesignal(pos, node)
|
mesecon:changesignal(pos, node, mesecon:effector_get_rules(node), "on")
|
||||||
mesecon:activate(pos, node)
|
mesecon:activate(pos, node)
|
||||||
end
|
end
|
||||||
elseif mesecon:is_conductor_on(node.name) then
|
elseif mesecon:is_conductor_on(node.name) then
|
||||||
|
@ -5,3 +5,5 @@ PRESSURE_PLATE_INTERVAL = 0.1
|
|||||||
OBJECT_DETECTOR_RADIUS = 6
|
OBJECT_DETECTOR_RADIUS = 6
|
||||||
PISTON_MAXIMUM_PUSH = 15
|
PISTON_MAXIMUM_PUSH = 15
|
||||||
MOVESTONE_MAXIMUM_PUSH = 100
|
MOVESTONE_MAXIMUM_PUSH = 100
|
||||||
|
MESECONS_GLOBALSTEP = true -- true = receptors/effectors won't be updated
|
||||||
|
-- until next globalstep, decreases server load
|
@ -22,3 +22,17 @@ end
|
|||||||
function mesecon:cmpPos(p1, p2)
|
function mesecon:cmpPos(p1, p2)
|
||||||
return (p1.x == p2.x and p1.y == p2.y and p1.z == p2.z)
|
return (p1.x == p2.x and p1.y == p2.y and p1.z == p2.z)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function mesecon:tablecopy(table) -- deep table copy
|
||||||
|
local newtable = {}
|
||||||
|
|
||||||
|
for idx, item in pairs(table) do
|
||||||
|
if type(item) == "table" then
|
||||||
|
newtable[idx] = mesecon:tablecopy(item)
|
||||||
|
else
|
||||||
|
newtable[idx] = item
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return newtable
|
||||||
|
end
|
||||||
|
@ -108,7 +108,7 @@ for zmy=0, 1 do
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-.5, -.5, -.5, .5, -.5+1/16, .5}
|
fixed = {-.5, -.5, -.5, .5, -.5+4/16, .5}
|
||||||
},
|
},
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -137,7 +137,7 @@ for zmy=0, 1 do
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-.5, -.5, -.5, .5, -.5+1/16, .5}
|
fixed = {-.5, -.5, -.5, .5, -.5+4/16, .5}
|
||||||
},
|
},
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -276,6 +276,6 @@ end
|
|||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
output = '"mesecons:wire_00000000_off" 16',
|
output = "mesecons:wire_00000000_off 16",
|
||||||
recipe = "default:mese_crystal",
|
recipe = "default:mese_crystal",
|
||||||
})
|
})
|
||||||
|
@ -12,7 +12,7 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_off", {
|
|||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
|
fixed = {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3},
|
||||||
},
|
},
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.off
|
state = mesecon.state.off
|
||||||
@ -27,13 +27,13 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_on", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {dig_immediate=3, not_in_creative_inventory=1, mesecon = 2},
|
groups = {dig_immediate=3, not_in_creative_inventory=1, mesecon = 2},
|
||||||
drop='"mesecons_blinkyplant:blinky_plant_off" 1',
|
drop="mesecons_blinkyplant:blinky_plant_off 1",
|
||||||
light_source = LIGHT_MAX-7,
|
light_source = LIGHT_MAX-7,
|
||||||
description = "Blinky Plant",
|
description = "Blinky Plant",
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
|
fixed = {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3},
|
||||||
},
|
},
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.on
|
state = mesecon.state.on
|
||||||
@ -41,11 +41,11 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_on", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_blinkyplant:blinky_plant_off" 1',
|
output = "mesecons_blinkyplant:blinky_plant_off 1",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'','"group:mesecon_conductor_craftable"',''},
|
{"","group:mesecon_conductor_craftable",""},
|
||||||
{'','"group:mesecon_conductor_craftable"',''},
|
{"","group:mesecon_conductor_craftable",""},
|
||||||
{'"default:sapling"','"default:sapling"','"default:sapling"'},
|
{"default:sapling","default:sapling","default:sapling"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -91,8 +91,8 @@ minetest.register_node("mesecons_button:button_on", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_button:button_off" 2',
|
output = "mesecons_button:button_off 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'"group:mesecon_conductor_craftable"','"default:stone"'},
|
{"group:mesecon_conductor_craftable","default:stone"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -16,7 +16,18 @@ minetest.register_chatcommand("tell", {
|
|||||||
minetest.chat_send_player(name, "Invalid usage: " .. param)
|
minetest.chat_send_player(name, "Invalid usage: " .. param)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
minetest.chat_send_player(target, name .. " whispers: " .. message)
|
if not minetest.env:get_player_by_name(target) then
|
||||||
|
minetest.chat_send_player(name, "Invalid target: " .. target)
|
||||||
|
end
|
||||||
|
minetest.chat_send_player(target, name .. " whispers: " .. message, false)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("tellme", {
|
||||||
|
params = "<text>",
|
||||||
|
description = "Say <text> to yourself",
|
||||||
|
func = function(name, param)
|
||||||
|
minetest.chat_send_player(name, param, false)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -30,7 +41,12 @@ minetest.register_chatcommand("hp", {
|
|||||||
minetest.chat_send_player(name, "Invalid usage: " .. param)
|
minetest.chat_send_player(name, "Invalid usage: " .. param)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
minetest.get_player_by_name(target):set_hp(value)
|
local player = minetest.env:get_player_by_name(target)
|
||||||
|
if player then
|
||||||
|
player:set_hp(value)
|
||||||
|
else
|
||||||
|
minetest.chat_send_player(name, "Invalid target: " .. target)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ minetest.register_node("mesecons_extrawires:corner_off", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_extrawires:corner_off" 3',
|
output = "mesecons_extrawires:corner_off 3",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"", "", ""},
|
{"", "", ""},
|
||||||
{"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", ""},
|
{"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", ""},
|
||||||
|
@ -75,7 +75,7 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_extrawires:tjunction_off" 3',
|
output = "mesecons_extrawires:tjunction_off 3",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"", "", ""},
|
{"", "", ""},
|
||||||
{"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off"},
|
{"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off"},
|
||||||
|
@ -117,7 +117,7 @@ minetest.register_node("mesecons_extrawires:vertical_off", {
|
|||||||
minetest.register_node("mesecons_extrawires:vertical_top_on", {
|
minetest.register_node("mesecons_extrawires:vertical_top_on", {
|
||||||
description = "Vertical mesecon",
|
description = "Vertical mesecon",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {"wires_full_on.png"},
|
tiles = {"wires_full_on.png","wires_full_on.png","wires_vertical_on.png"},
|
||||||
walkable = false,
|
walkable = false,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
@ -139,7 +139,7 @@ minetest.register_node("mesecons_extrawires:vertical_top_on", {
|
|||||||
minetest.register_node("mesecons_extrawires:vertical_top_off", {
|
minetest.register_node("mesecons_extrawires:vertical_top_off", {
|
||||||
description = "Vertical mesecon",
|
description = "Vertical mesecon",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {"wires_full_off.png"},
|
tiles = {"wires_full_off.png","wires_full_off.png","wires_vertical_off.png"},
|
||||||
walkable = false,
|
walkable = false,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
@ -162,7 +162,7 @@ minetest.register_node("mesecons_extrawires:vertical_top_off", {
|
|||||||
minetest.register_node("mesecons_extrawires:vertical_bottom_on", {
|
minetest.register_node("mesecons_extrawires:vertical_bottom_on", {
|
||||||
description = "Vertical mesecon",
|
description = "Vertical mesecon",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {"wires_full_on.png"},
|
tiles = {"wires_full_on.png","wires_full_on.png","wires_vertical_on.png"},
|
||||||
walkable = false,
|
walkable = false,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
@ -183,7 +183,7 @@ minetest.register_node("mesecons_extrawires:vertical_bottom_on", {
|
|||||||
minetest.register_node("mesecons_extrawires:vertical_bottom_off", {
|
minetest.register_node("mesecons_extrawires:vertical_bottom_off", {
|
||||||
description = "Vertical mesecon",
|
description = "Vertical mesecon",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {"wires_full_off.png"},
|
tiles = {"wires_full_off.png","wires_full_off.png","wires_vertical_off.png"},
|
||||||
walkable = false,
|
walkable = false,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
|
@ -32,7 +32,7 @@ minetest.register_node("mesecons_hydroturbine:hydro_turbine_off", {
|
|||||||
minetest.register_node("mesecons_hydroturbine:hydro_turbine_on", {
|
minetest.register_node("mesecons_hydroturbine:hydro_turbine_on", {
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {"jeija_hydro_turbine_on.png"},
|
tiles = {"jeija_hydro_turbine_on.png"},
|
||||||
drop = '"mesecons_hydroturbine:hydro_turbine_off" 1',
|
drop = "mesecons_hydroturbine:hydro_turbine_off 1",
|
||||||
groups = {dig_immediate=2,not_in_creative_inventory=1},
|
groups = {dig_immediate=2,not_in_creative_inventory=1},
|
||||||
description="Water Turbine",
|
description="Water Turbine",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
@ -86,11 +86,11 @@ nodenames = {"mesecons_hydroturbine:hydro_turbine_on"},
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_hydroturbine:hydro_turbine_off" 2',
|
output = "mesecons_hydroturbine:hydro_turbine_off 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'','"default:stick"', ''},
|
{"","default:stick", ""},
|
||||||
{'"default:stick"', '"default:steel_ingot"', '"default:stick"'},
|
{"default:stick", "default:steel_ingot", "default:stick"},
|
||||||
{'','"default:stick"', ''},
|
{"","default:stick", ""},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ minetest.register_node("mesecons_insulated:insulated_off", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_insulated:insulated_off" 3',
|
output = "mesecons_insulated:insulated_off 3",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"mesecons_materials:fiber", "mesecons_materials:fiber", "mesecons_materials:fiber"},
|
{"mesecons_materials:fiber", "mesecons_materials:fiber", "mesecons_materials:fiber"},
|
||||||
{"mesecons:wire_00000000_off", "mesecons:wire_00000000_off", "mesecons:wire_00000000_off"},
|
{"mesecons:wire_00000000_off", "mesecons:wire_00000000_off", "mesecons:wire_00000000_off"},
|
||||||
|
@ -21,7 +21,7 @@ minetest.register_node("mesecons_lamp:lamp_on", {
|
|||||||
node_box = mesecon_lamp_box,
|
node_box = mesecon_lamp_box,
|
||||||
selection_box = mesecon_lamp_box,
|
selection_box = mesecon_lamp_box,
|
||||||
groups = {dig_immediate=3,not_in_creative_inventory=1, mesecon_effector_on = 1},
|
groups = {dig_immediate=3,not_in_creative_inventory=1, mesecon_effector_on = 1},
|
||||||
drop='"mesecons_lamp:lamp_off" 1',
|
drop="mesecons_lamp:lamp_off 1",
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
mesecons = {effector = {
|
mesecons = {effector = {
|
||||||
action_off = function (pos, node)
|
action_off = function (pos, node)
|
||||||
@ -52,10 +52,10 @@ minetest.register_node("mesecons_lamp:lamp_off", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_lamp:lamp_off" 1',
|
output = "mesecons_lamp:lamp_off 1",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'', '"default:glass"', ''},
|
{"", "default:glass", ""},
|
||||||
{'"group:mesecon_conductor_craftable"', '"default:steel_ingot"', '"group:mesecon_conductor_craftable"'},
|
{"group:mesecon_conductor_craftable", "default:steel_ingot", "group:mesecon_conductor_craftable"},
|
||||||
{'', '"default:glass"', ''},
|
{"", "default:glass", ""},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
function mesecon:lightstone_add(name, base_item, texture_off, texture_on)
|
function mesecon:lightstone_add(name, base_item, texture_off, texture_on)
|
||||||
minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_off", {
|
minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_off", {
|
||||||
tiles = {texture_off},
|
tiles = {texture_off},
|
||||||
inventory_image = minetest.inventorycube(texture_off),
|
|
||||||
groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2},
|
groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2},
|
||||||
description=name.." Lightstone",
|
description=name.." Lightstone",
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
@ -13,9 +12,8 @@ function mesecon:lightstone_add(name, base_item, texture_off, texture_on)
|
|||||||
})
|
})
|
||||||
minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_on", {
|
minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_on", {
|
||||||
tiles = {texture_on},
|
tiles = {texture_on},
|
||||||
inventory_image = minetest.inventorycube(texture_on),
|
|
||||||
groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
|
groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
|
||||||
drop = "node mesecons_lightstone:lightstone_" .. name .. "_off 1",
|
drop = "mesecons_lightstone:lightstone_" .. name .. "_off",
|
||||||
light_source = LIGHT_MAX-2,
|
light_source = LIGHT_MAX-2,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
mesecons = {effector = {
|
mesecons = {effector = {
|
||||||
@ -23,21 +21,22 @@ function mesecon:lightstone_add(name, base_item, texture_off, texture_on)
|
|||||||
mesecon:swap_node(pos, "mesecons_lightstone:lightstone_" .. name .. "_off")
|
mesecon:swap_node(pos, "mesecons_lightstone:lightstone_" .. name .. "_off")
|
||||||
end
|
end
|
||||||
}}
|
}}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "node mesecons_lightstone:lightstone_" .. name .. "_off 1",
|
output = "mesecons_lightstone:lightstone_" .. name .. "_off",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'',base_item,''},
|
{"",base_item,""},
|
||||||
{base_item,'default:torch',base_item},
|
{base_item,"default:torch",base_item},
|
||||||
{'','group:mesecon_conductor_craftable',''},
|
{"","group:mesecon_conductor_craftable",""}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
mesecon:lightstone_add("red", "craft default:clay_brick 1", "jeija_lightstone_red_off.png", "jeija_lightstone_red_on.png")
|
mesecon:lightstone_add("red", "default:clay_brick", "jeija_lightstone_red_off.png", "jeija_lightstone_red_on.png")
|
||||||
mesecon:lightstone_add("green", "node default:cactus 1", "jeija_lightstone_green_off.png", "jeija_lightstone_green_on.png")
|
mesecon:lightstone_add("green", "default:cactus", "jeija_lightstone_green_off.png", "jeija_lightstone_green_on.png")
|
||||||
mesecon:lightstone_add("blue", "node mesecons_materials:fiber 1", "jeija_lightstone_blue_off.png", "jeija_lightstone_blue_on.png")
|
mesecon:lightstone_add("blue", "mesecons_materials:fiber", "jeija_lightstone_blue_off.png", "jeija_lightstone_blue_on.png")
|
||||||
mesecon:lightstone_add("gray", "node default:cobble 1", "jeija_lightstone_gray_off.png", "jeija_lightstone_gray_on.png")
|
mesecon:lightstone_add("gray", "default:cobble", "jeija_lightstone_gray_off.png", "jeija_lightstone_gray_on.png")
|
||||||
mesecon:lightstone_add("darkgray", "node default:gravel 1", "jeija_lightstone_darkgray_off.png", "jeija_lightstone_darkgray_on.png")
|
mesecon:lightstone_add("darkgray", "default:gravel", "jeija_lightstone_darkgray_off.png", "jeija_lightstone_darkgray_on.png")
|
||||||
|
mesecon:lightstone_add("yellow", "default:mese_crystal_fragment", "jeija_lightstone_yellow_off.png", "jeija_lightstone_yellow_on.png")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
-- Reference
|
-- Reference
|
||||||
-- ports = get_real_portstates(pos): gets if inputs are powered from outside
|
-- ports = get_real_portstates(pos): gets if inputs are powered from outside
|
||||||
-- newport = merge_portstates(state1, state2): just does result = state1 or state2 for every port
|
-- newport = merge_portstates(state1, state2): just does result = state1 or state2 for every port
|
||||||
-- action_setports(pos, ports, vports): activates/deactivates the mesecons according to the portstates (helper for action)
|
-- action_setports(pos, rule, state): activates/deactivates the mesecons according to the portstates (helper for action)
|
||||||
-- action(pos, ports): Applies new portstates to a luacontroller at pos
|
-- action(pos, ports): Applies new portstates to a luacontroller at pos
|
||||||
-- lc_update(pos): updates the controller at pos by executing the code
|
-- lc_update(pos): updates the controller at pos by executing the code
|
||||||
-- reset_meta (pos, code, errmsg): performs a software-reset, installs new code and prints error messages
|
-- reset_meta (pos, code, errmsg): performs a software-reset, installs new code and prints error messages
|
||||||
@ -54,30 +54,24 @@ local merge_portstates = function (ports, vports)
|
|||||||
return npo
|
return npo
|
||||||
end
|
end
|
||||||
|
|
||||||
local generate_name = function (ports, overwrite)
|
local generate_name = function (ports)
|
||||||
local overwrite = overwrite or {}
|
local overwrite = overwrite or {}
|
||||||
local d = overwrite.d or (ports.d and 1 or 0)
|
local d = ports.d and 1 or 0
|
||||||
local c = overwrite.c or (ports.c and 1 or 0)
|
local c = ports.c and 1 or 0
|
||||||
local b = overwrite.b or (ports.b and 1 or 0)
|
local b = ports.b and 1 or 0
|
||||||
local a = overwrite.a or (ports.a and 1 or 0)
|
local a = ports.a and 1 or 0
|
||||||
return BASENAME..d..c..b..a
|
return BASENAME..d..c..b..a
|
||||||
end
|
end
|
||||||
|
|
||||||
local setport = function (pos, rule, ignore, state, ports)
|
local setport = function (pos, rule, state)
|
||||||
local ignorename = generate_name(ports, ignore)
|
|
||||||
mesecon:swap_node(pos, ignorename)
|
|
||||||
if state then
|
if state then
|
||||||
mesecon:receptor_on(pos, {rule})
|
mesecon:receptor_on(pos, {rule})
|
||||||
else
|
else
|
||||||
mesecon:receptor_off(pos, {rule})
|
mesecon:receptor_off(pos, {rule})
|
||||||
end
|
end
|
||||||
if minetest.env:get_node(pos).name ~= ignorename then
|
|
||||||
return true -- overridden by second process
|
|
||||||
end
|
|
||||||
return false -- success
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local action = function (pos, ports, forcereset)
|
local action = function (pos, ports)
|
||||||
local name = minetest.env:get_node(pos).name
|
local name = minetest.env:get_node(pos).name
|
||||||
local vports = minetest.registered_nodes[name].virtual_portstates
|
local vports = minetest.registered_nodes[name].virtual_portstates
|
||||||
local newname = generate_name(ports)
|
local newname = generate_name(ports)
|
||||||
@ -85,24 +79,14 @@ local action = function (pos, ports, forcereset)
|
|||||||
if name ~= newname and vports then
|
if name ~= newname and vports then
|
||||||
local rules_on = {}
|
local rules_on = {}
|
||||||
local rules_off = {}
|
local rules_off = {}
|
||||||
local ignore = {}
|
|
||||||
|
|
||||||
local interrupted
|
|
||||||
if ports.a ~= vports.a then interrupted = setport(pos, rules.a, {a = 2}, ports.a, ports) end
|
|
||||||
if interrupted and not forcereset then return end
|
|
||||||
if ports.b ~= vports.b then interrupted = setport(pos, rules.b, {b = 2}, ports.b, ports) end
|
|
||||||
if interrupted and not forcereset then return end
|
|
||||||
if ports.c ~= vports.c then interrupted = setport(pos, rules.c, {c = 2}, ports.c, ports) end
|
|
||||||
if interrupted and not forcereset then return end
|
|
||||||
if ports.d ~= vports.d then interrupted = setport(pos, rules.d, {d = 2}, ports.d, ports) end
|
|
||||||
if interrupted and not forcereset then return end
|
|
||||||
|
|
||||||
mesecon:swap_node(pos, newname)
|
mesecon:swap_node(pos, newname)
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local delayedaction = function (params)
|
if ports.a ~= vports.a then setport(pos, rules.a, ports.a) end
|
||||||
action(params.pos, params.ports)
|
if ports.b ~= vports.b then setport(pos, rules.b, ports.b) end
|
||||||
|
if ports.c ~= vports.c then setport(pos, rules.c, ports.c) end
|
||||||
|
if ports.d ~= vports.d then setport(pos, rules.d, ports.d) end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
@ -165,8 +149,17 @@ local getinterrupt = function(pos)
|
|||||||
local iid = iid or math.random()
|
local iid = iid or math.random()
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
local interrupts = minetest.deserialize(meta:get_string("lc_interrupts")) or {}
|
local interrupts = minetest.deserialize(meta:get_string("lc_interrupts")) or {}
|
||||||
table.insert (interrupts, iid)
|
local found = false
|
||||||
meta:set_string("lc_interrupts", minetest.serialize(interrupts))
|
for _, i in ipairs(interrupts) do
|
||||||
|
if minetest.serialize(i) == minetest.serialize(iid) then
|
||||||
|
found = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not found then
|
||||||
|
table.insert(interrupts, iid)
|
||||||
|
meta:set_string("lc_interrupts", minetest.serialize(interrupts))
|
||||||
|
end
|
||||||
minetest.after(time, interrupt, {pos=pos, iid = iid})
|
minetest.after(time, interrupt, {pos=pos, iid = iid})
|
||||||
end
|
end
|
||||||
return interrupt
|
return interrupt
|
||||||
@ -267,9 +260,9 @@ local do_overheat = function (pos, meta)
|
|||||||
heat(meta)
|
heat(meta)
|
||||||
minetest.after(0.5, cool, meta)
|
minetest.after(0.5, cool, meta)
|
||||||
if overheat(meta) then
|
if overheat(meta) then
|
||||||
minetest.env:remove_node(pos)
|
mesecon:swap_node(pos, BASENAME.."_burnt")
|
||||||
|
minetest.env:get_meta(pos):set_string("lc_interrupts", "")
|
||||||
minetest.after(0.2, overheat_off, pos) -- wait for pending operations
|
minetest.after(0.2, overheat_off, pos) -- wait for pending operations
|
||||||
minetest.env:add_item(pos, BASENAME.."0000")
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -330,7 +323,7 @@ lc_update = function (pos, event)
|
|||||||
save_memory(meta, mem)
|
save_memory(meta, mem)
|
||||||
|
|
||||||
-- Actually set the ports
|
-- Actually set the ports
|
||||||
minetest.after(0, delayedaction, {pos = pos, ports = env.port})
|
minetest.after(0, action, pos, env.port)
|
||||||
end
|
end
|
||||||
|
|
||||||
local reset_meta = function(pos, code, errmsg)
|
local reset_meta = function(pos, code, errmsg)
|
||||||
@ -397,10 +390,10 @@ local digiline = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for a = 0, 2 do -- 0 = off; 1 = on; 2 = ignore
|
for a = 0, 1 do -- 0 = off; 1 = on
|
||||||
for b = 0, 2 do
|
for b = 0, 1 do
|
||||||
for c = 0, 2 do
|
for c = 0, 1 do
|
||||||
for d = 0, 2 do
|
for d = 0, 1 do
|
||||||
|
|
||||||
local cid = tostring(d)..tostring(c)..tostring(b)..tostring(a)
|
local cid = tostring(d)..tostring(c)..tostring(b)..tostring(a)
|
||||||
local nodename = BASENAME..cid
|
local nodename = BASENAME..cid
|
||||||
@ -495,6 +488,37 @@ end
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--overheated luacontroller
|
||||||
|
minetest.register_node(BASENAME .. "_burnt", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = {
|
||||||
|
"jeija_luacontroller_burnt_top.png",
|
||||||
|
"jeija_microcontroller_bottom.png",
|
||||||
|
"jeija_microcontroller_sides.png",
|
||||||
|
"jeija_microcontroller_sides.png",
|
||||||
|
"jeija_microcontroller_sides.png",
|
||||||
|
"jeija_microcontroller_sides.png"
|
||||||
|
},
|
||||||
|
inventory_image = "jeija_luacontroller_burnt_top.png",
|
||||||
|
paramtype = "light",
|
||||||
|
groups = {dig_immediate=2, not_in_creative_inventory=1},
|
||||||
|
drop = BASENAME.."0000",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
selection_box = selectionbox,
|
||||||
|
node_box = nodebox,
|
||||||
|
on_construct = reset_meta,
|
||||||
|
on_receive_fields = function(pos, formname, fields)
|
||||||
|
reset(pos)
|
||||||
|
reset_meta(pos, fields.code)
|
||||||
|
local err = lc_update(pos, {type="program"})
|
||||||
|
if err then print(err) end
|
||||||
|
reset_meta(pos, fields.code, err)
|
||||||
|
end,
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
is_luacontroller = true,
|
||||||
|
virtual_portstates = {a = false, b = false, c = false, d = false},
|
||||||
|
})
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
-- Craft Registration --
|
-- Craft Registration --
|
||||||
------------------------
|
------------------------
|
||||||
|
@ -12,14 +12,14 @@ minetest.register_craftitem("mesecons_materials:fiber", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_materials:glue" 2',
|
output = "mesecons_materials:glue 2",
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
recipe = "default:sapling",
|
recipe = "default:sapling",
|
||||||
cooktime = 2
|
cooktime = 2
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_materials:fiber" 6',
|
output = "mesecons_materials:fiber 6",
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
recipe = "mesecons_materials:glue",
|
recipe = "mesecons_materials:glue",
|
||||||
cooktime = 4
|
cooktime = 4
|
||||||
@ -33,9 +33,9 @@ minetest.register_craftitem("mesecons_materials:silicon", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_materials:silicon" 4',
|
output = "mesecons_materials:silicon 4",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'"default:sand"', '"default:sand"'},
|
{"default:sand", "default:sand"},
|
||||||
{'"default:sand"', '"default:steel_ingot"'},
|
{"default:sand", "default:steel_ingot"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -66,7 +66,7 @@ minetest.register_node(nodename, {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = true,
|
walkable = true,
|
||||||
groups = groups,
|
groups = groups,
|
||||||
drop = '"mesecons_microcontroller:microcontroller0000" 1',
|
drop = "mesecons_microcontroller:microcontroller0000 1",
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = { -8/16, -8/16, -8/16, 8/16, -5/16, 8/16 },
|
fixed = { -8/16, -8/16, -8/16, 8/16, -5/16, 8/16 },
|
||||||
|
@ -77,8 +77,9 @@ minetest.register_entity("mesecons_movestones:movestone_entity", {
|
|||||||
physical = false,
|
physical = false,
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
textures = {"jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_movestone_arrows.png", "jeija_movestone_arrows.png"},
|
textures = {"jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_movestone_arrows.png", "jeija_movestone_arrows.png"},
|
||||||
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
|
collisionbox = {-0.5,-0.5,-0.5, 0.5, 0.5, 0.5},
|
||||||
visual = "cube",
|
visual = "cube",
|
||||||
|
lastdir = {x=0, y=0, z=0},
|
||||||
|
|
||||||
on_punch = function(self, hitter)
|
on_punch = function(self, hitter)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
@ -87,24 +88,30 @@ minetest.register_entity("mesecons_movestones:movestone_entity", {
|
|||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
pos.x, pos.y, pos.z = math.floor(pos.x), math.floor(pos.y), math.floor(pos.z)
|
pos.x, pos.y, pos.z = math.floor(pos.x+0.5), math.floor(pos.y+0.5), math.floor(pos.z+0.5)
|
||||||
local direction = mesecon:get_movestone_direction(pos)
|
local direction = mesecon:get_movestone_direction(pos)
|
||||||
|
|
||||||
if not direction then
|
if not direction then -- no mesecon power
|
||||||
local name = minetest.env:get_node(pos).name
|
local name = minetest.env:get_node(pos).name
|
||||||
if name ~= "air" and name ~= "ignore" and minetest.registered_nodes[name].liquidtype == "none" then
|
if name ~= "air" and name ~= "ignore"
|
||||||
mesecon:mvps_push(pos, direction, MOVESTONE_MAXIMUM_PUSH)
|
and minetest.registered_nodes[name].liquidtype == "none" then
|
||||||
|
mesecon:mvps_push(pos, self.lastdir, MOVESTONE_MAXIMUM_PUSH)
|
||||||
end
|
end
|
||||||
minetest.env:add_node(pos, {name="mesecons_movestones:movestone"})
|
minetest.env:add_node(pos, {name="mesecons_movestones:movestone"})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local np = mesecon:addPosRule(pos, direction)
|
local success, stack, oldstack =
|
||||||
if not mesecon:mvps_push(np, direction, MOVESTONE_MAXIMUM_PUSH) then
|
mesecon:mvps_push(pos, direction, MOVESTONE_MAXIMUM_PUSH)
|
||||||
|
if not success then -- Too large stack/stopper in the way
|
||||||
minetest.env:add_node(pos, {name="mesecons_movestones:movestone"})
|
minetest.env:add_node(pos, {name="mesecons_movestones:movestone"})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
|
else
|
||||||
|
mesecon:mvps_process_stack (stack)
|
||||||
|
mesecon:mvps_move_objects (pos, direction, oldstack)
|
||||||
|
self.lastdir = direction
|
||||||
end
|
end
|
||||||
|
|
||||||
self.object:setvelocity({x=direction.x*2, y=direction.y*2, z=direction.z*2})
|
self.object:setvelocity({x=direction.x*2, y=direction.y*2, z=direction.z*2})
|
||||||
@ -112,11 +119,11 @@ minetest.register_entity("mesecons_movestones:movestone_entity", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_movestones:movestone" 2',
|
output = "mesecons_movestones:movestone 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'"default:stone"', '"default:stone"', '"default:stone"'},
|
{"default:stone", "default:stone", "default:stone"},
|
||||||
{'"group:mesecon_conductor_craftable"', '"group:mesecon_conductor_craftable"', '"group:mesecon_conductor_craftable"'},
|
{"group:mesecon_conductor_craftable", "group:mesecon_conductor_craftable", "group:mesecon_conductor_craftable"},
|
||||||
{'"default:stone"', '"default:stone"', '"default:stone"'},
|
{"default:stone", "default:stone", "default:stone"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -144,9 +151,9 @@ minetest.register_node("mesecons_movestones:sticky_movestone", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_movestones:sticky_movestone" 2',
|
output = "mesecons_movestones:sticky_movestone 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'"mesecons_materials:glue"', '"mesecons_movestones:movestone"', '"mesecons_materials:glue"'},
|
{"mesecons_materials:glue", "mesecons_movestones:movestone", "mesecons_materials:glue"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -154,8 +161,9 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
|
|||||||
physical = false,
|
physical = false,
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
textures = {"jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_sticky_movestone.png", "jeija_sticky_movestone.png"},
|
textures = {"jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_movestone_side.png", "jeija_sticky_movestone.png", "jeija_sticky_movestone.png"},
|
||||||
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
|
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||||
visual = "cube",
|
visual = "cube",
|
||||||
|
lastdir = {x=0, y=0, z=0},
|
||||||
|
|
||||||
on_punch = function(self, hitter)
|
on_punch = function(self, hitter)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
@ -164,24 +172,32 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
|
|||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
pos.x, pos.y, pos.z = math.floor(pos.x), math.floor(pos.y), math.floor(pos.z)
|
pos.x, pos.y, pos.z = math.floor(pos.x+0.5), math.floor(pos.y+0.5), math.floor(pos.z+0.5)
|
||||||
local direction = mesecon:get_movestone_direction(pos)
|
local direction = mesecon:get_movestone_direction(pos)
|
||||||
|
|
||||||
if not direction then
|
if not direction then -- no mesecon power
|
||||||
local name = minetest.env:get_node(pos).name
|
local name = minetest.env:get_node(pos).name
|
||||||
if name ~= "air" and name ~= "ignore" and minetest.registered_nodes[name].liquidtype == "none" then
|
if name ~= "air" and name ~= "ignore"
|
||||||
mesecon:mvps_push(pos, direction, MOVESTONE_MAXIMUM_PUSH)
|
and minetest.registered_nodes[name].liquidtype == "none" then
|
||||||
|
mesecon:mvps_push(pos, self.lastdir, MOVESTONE_MAXIMUM_PUSH)
|
||||||
|
--STICKY
|
||||||
|
mesecon:mvps_pull_all(pos, self.lastdir)
|
||||||
end
|
end
|
||||||
minetest.env:add_node(pos, {name="mesecons_movestones:sticky_movestone"})
|
minetest.env:add_node(pos, {name="mesecons_movestones:sticky_movestone"})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local np = mesecon:addPosRule(pos, direction)
|
local success, stack, oldstack =
|
||||||
if not mesecon:mvps_push(np, direction, MOVESTONE_MAXIMUM_PUSH) then
|
mesecon:mvps_push(pos, direction, MOVESTONE_MAXIMUM_PUSH)
|
||||||
|
if not success then -- Too large stack/stopper in the way
|
||||||
minetest.env:add_node(pos, {name="mesecons_movestones:sticky_movestone"})
|
minetest.env:add_node(pos, {name="mesecons_movestones:sticky_movestone"})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
|
else
|
||||||
|
mesecon:mvps_process_stack (stack)
|
||||||
|
mesecon:mvps_move_objects (pos, direction, oldstack)
|
||||||
|
self.lastdir = direction
|
||||||
end
|
end
|
||||||
|
|
||||||
self.object:setvelocity({x=direction.x*2, y=direction.y*2, z=direction.z*2})
|
self.object:setvelocity({x=direction.x*2, y=direction.y*2, z=direction.z*2})
|
||||||
@ -190,3 +206,7 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
|
|||||||
mesecon:mvps_pull_all(pos, direction)
|
mesecon:mvps_pull_all(pos, direction)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
mesecon:register_mvps_unmov("mesecons_movestones:movestone_entity")
|
||||||
|
mesecon:register_mvps_unmov("mesecons_movestones:sticky_movestone_entity")
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
--register stoppers for movestones/pistons
|
--register stoppers for movestones/pistons
|
||||||
|
|
||||||
mesecon.mvps_stoppers={}
|
mesecon.mvps_stoppers = {}
|
||||||
|
mesecon.mvps_unmov = {}
|
||||||
|
|
||||||
function mesecon:is_mvps_stopper(node, pushdir, stack, stackid)
|
function mesecon:is_mvps_stopper(node, pushdir, stack, stackid)
|
||||||
local get_stopper = mesecon.mvps_stoppers[node.name]
|
local get_stopper = mesecon.mvps_stoppers[node.name]
|
||||||
@ -17,6 +18,15 @@ function mesecon:register_mvps_stopper(nodename, get_stopper)
|
|||||||
mesecon.mvps_stoppers[nodename] = get_stopper
|
mesecon.mvps_stoppers[nodename] = get_stopper
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Objects that cannot be moved (e.g. movestones)
|
||||||
|
function mesecon:register_mvps_unmov(objectname)
|
||||||
|
mesecon.mvps_unmov[objectname] = true;
|
||||||
|
end
|
||||||
|
|
||||||
|
function mesecon:is_mvps_unmov(objectname)
|
||||||
|
return mesecon.mvps_unmov[objectname]
|
||||||
|
end
|
||||||
|
|
||||||
function mesecon:mvps_process_stack(stack)
|
function mesecon:mvps_process_stack(stack)
|
||||||
-- update mesecons for placed nodes ( has to be done after all nodes have been added )
|
-- update mesecons for placed nodes ( has to be done after all nodes have been added )
|
||||||
for _, n in ipairs(stack) do
|
for _, n in ipairs(stack) do
|
||||||
@ -26,16 +36,15 @@ function mesecon:mvps_process_stack(stack)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mesecon:mvps_push(pos, dir, maximum) -- pos: pos of mvps; dir: direction of push; maximum: maximum nodes to be pushed
|
function mesecon:mvps_get_stack(pos, dir, maximum)
|
||||||
np = {x = pos.x, y = pos.y, z = pos.z}
|
|
||||||
|
|
||||||
-- determine the number of nodes to be pushed
|
-- determine the number of nodes to be pushed
|
||||||
|
local np = {x = pos.x, y = pos.y, z = pos.z}
|
||||||
local nodes = {}
|
local nodes = {}
|
||||||
while true do
|
while true do
|
||||||
nn = minetest.env:get_node_or_nil(np)
|
local nn = minetest.env:get_node_or_nil(np)
|
||||||
if not nn or #nodes > maximum then
|
if not nn or #nodes > maximum then
|
||||||
-- don't push at all, something is in the way (unloaded map or too many nodes)
|
-- don't push at all, something is in the way (unloaded map or too many nodes)
|
||||||
return
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
if nn.name == "air"
|
if nn.name == "air"
|
||||||
@ -47,7 +56,13 @@ function mesecon:mvps_push(pos, dir, maximum) -- pos: pos of mvps; dir: directio
|
|||||||
|
|
||||||
np = mesecon:addPosRule(np, dir)
|
np = mesecon:addPosRule(np, dir)
|
||||||
end
|
end
|
||||||
|
return nodes
|
||||||
|
end
|
||||||
|
|
||||||
|
function mesecon:mvps_push(pos, dir, maximum) -- pos: pos of mvps; dir: direction of push; maximum: maximum nodes to be pushed
|
||||||
|
local nodes = mesecon:mvps_get_stack(pos, dir, maximum)
|
||||||
|
|
||||||
|
if not nodes then return end
|
||||||
-- determine if one of the nodes blocks the push
|
-- determine if one of the nodes blocks the push
|
||||||
for id, n in ipairs(nodes) do
|
for id, n in ipairs(nodes) do
|
||||||
if mesecon:is_mvps_stopper(n.node, dir, nodes, id) then
|
if mesecon:is_mvps_stopper(n.node, dir, nodes, id) then
|
||||||
@ -74,11 +89,12 @@ function mesecon:mvps_push(pos, dir, maximum) -- pos: pos of mvps; dir: directio
|
|||||||
minetest.env:get_meta(np):from_table(n.meta)
|
minetest.env:get_meta(np):from_table(n.meta)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local oldstack = mesecon:tablecopy(nodes)
|
||||||
for i in ipairs(nodes) do
|
for i in ipairs(nodes) do
|
||||||
nodes[i].pos = mesecon:addPosRule(nodes[i].pos, dir)
|
nodes[i].pos = mesecon:addPosRule(nodes[i].pos, dir)
|
||||||
end
|
end
|
||||||
|
|
||||||
return true, nodes
|
return true, nodes, oldstack
|
||||||
end
|
end
|
||||||
|
|
||||||
function mesecon:mvps_pull_single(pos, dir) -- pos: pos of mvps; direction: direction of pull (matches push direction for sticky pistons)
|
function mesecon:mvps_pull_single(pos, dir) -- pos: pos of mvps; direction: direction of pull (matches push direction for sticky pistons)
|
||||||
@ -101,26 +117,65 @@ function mesecon:mvps_pull_single(pos, dir) -- pos: pos of mvps; direction: dire
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mesecon:mvps_pull_all(pos, direction) -- pos: pos of mvps; direction: direction of pull
|
function mesecon:mvps_pull_all(pos, direction) -- pos: pos of mvps; direction: direction of pull
|
||||||
local lpos = {x=pos.x-direction.x, y=pos.y-direction.y, z=pos.z-direction.z} -- 1 away
|
local lpos = {x=pos.x-direction.x, y=pos.y-direction.y, z=pos.z-direction.z} -- 1 away
|
||||||
local lnode = minetest.env:get_node(lpos)
|
local lnode = minetest.env:get_node(lpos)
|
||||||
local lpos2 = {x=pos.x-direction.x*2, y=pos.y-direction.y*2, z=pos.z-direction.z*2} -- 2 away
|
local lpos2 = {x=pos.x-direction.x*2, y=pos.y-direction.y*2, z=pos.z-direction.z*2} -- 2 away
|
||||||
local lnode2 = minetest.env:get_node(lpos2)
|
local lnode2 = minetest.env:get_node(lpos2)
|
||||||
|
|
||||||
if lnode.name ~= "ignore" and lnode.name ~= "air" and minetest.registered_nodes[lnode.name].liquidtype == "none" then return end
|
if lnode.name ~= "ignore" and lnode.name ~= "air" and minetest.registered_nodes[lnode.name].liquidtype == "none" then return end
|
||||||
if lnode2.name == "ignore" or lnode2.name == "air" or not(minetest.registered_nodes[lnode2.name].liquidtype == "none") then return end
|
if lnode2.name == "ignore" or lnode2.name == "air" or not(minetest.registered_nodes[lnode2.name].liquidtype == "none") then return end
|
||||||
|
|
||||||
local oldpos = {x=lpos2.x+direction.x, y=lpos2.y+direction.y, z=lpos2.z+direction.z}
|
local oldpos = {x=lpos2.x+direction.x, y=lpos2.y+direction.y, z=lpos2.z+direction.z}
|
||||||
repeat
|
repeat
|
||||||
lnode2 = minetest.env:get_node(lpos2)
|
lnode2 = minetest.env:get_node(lpos2)
|
||||||
minetest.env:add_node(oldpos, {name=lnode2.name})
|
minetest.env:add_node(oldpos, {name=lnode2.name})
|
||||||
nodeupdate(oldpos)
|
nodeupdate(oldpos)
|
||||||
oldpos = {x=lpos2.x, y=lpos2.y, z=lpos2.z}
|
oldpos = {x=lpos2.x, y=lpos2.y, z=lpos2.z}
|
||||||
lpos2.x = lpos2.x-direction.x
|
lpos2.x = lpos2.x-direction.x
|
||||||
lpos2.y = lpos2.y-direction.y
|
lpos2.y = lpos2.y-direction.y
|
||||||
lpos2.z = lpos2.z-direction.z
|
lpos2.z = lpos2.z-direction.z
|
||||||
lnode = minetest.env:get_node(lpos2)
|
lnode = minetest.env:get_node(lpos2)
|
||||||
until lnode.name=="air" or lnode.name=="ignore" or not(minetest.registered_nodes[lnode2.name].liquidtype == "none")
|
until lnode.name=="air" or lnode.name=="ignore" or not(minetest.registered_nodes[lnode2.name].liquidtype == "none")
|
||||||
minetest.env:remove_node(oldpos)
|
minetest.env:remove_node(oldpos)
|
||||||
|
end
|
||||||
|
|
||||||
|
function mesecon:mvps_move_objects(pos, dir, nodestack)
|
||||||
|
local objects_to_move = {}
|
||||||
|
|
||||||
|
-- Move object at tip of stack
|
||||||
|
local pushpos = mesecon:addPosRule(pos, -- get pos at tip of stack
|
||||||
|
{x = dir.x * (#nodestack),
|
||||||
|
y = dir.y * (#nodestack),
|
||||||
|
z = dir.z * (#nodestack)})
|
||||||
|
|
||||||
|
|
||||||
|
local objects = minetest.env:get_objects_inside_radius(pushpos, 1)
|
||||||
|
for _, obj in ipairs(objects) do
|
||||||
|
table.insert(objects_to_move, obj)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Move objects lying/standing on the stack (before it was pushed - oldstack)
|
||||||
|
if tonumber(minetest.setting_get("movement_gravity")) > 0 and dir.y == 0 then
|
||||||
|
-- If gravity positive and dir horizontal, push players standing on the stack
|
||||||
|
for _, n in ipairs(nodestack) do
|
||||||
|
local p_above = mesecon:addPosRule(n.pos, {x=0, y=1, z=0})
|
||||||
|
local objects = minetest.env:get_objects_inside_radius(p_above, 1)
|
||||||
|
for _, obj in ipairs(objects) do
|
||||||
|
table.insert(objects_to_move, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, obj in ipairs(objects_to_move) do
|
||||||
|
local entity = obj:get_luaentity()
|
||||||
|
if not entity or not mesecon:is_mvps_unmov(entity.name) then
|
||||||
|
local np = mesecon:addPosRule(obj:getpos(), dir)
|
||||||
|
local nn = minetest.env:get_node(np)
|
||||||
|
if not minetest.registered_nodes[nn.name].walkable then
|
||||||
|
obj:setpos(np)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
mesecon:register_mvps_stopper("default:chest_locked")
|
mesecon:register_mvps_stopper("default:chest_locked")
|
||||||
|
@ -23,7 +23,7 @@ minetest.register_node("mesecons_noteblock:noteblock", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_noteblock:noteblock" 1',
|
output = "mesecons_noteblock:noteblock 1",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:wood", "default:wood", "default:wood"},
|
{"default:wood", "default:wood", "default:wood"},
|
||||||
{"group:mesecon_conductor_craftable", "default:steel_ingot", "group:mesecon_conductor_craftable"},
|
{"group:mesecon_conductor_craftable", "default:steel_ingot", "group:mesecon_conductor_craftable"},
|
||||||
|
@ -1,62 +1,63 @@
|
|||||||
-- Get mesecon rules of pistons
|
-- Get mesecon rules of pistons
|
||||||
local piston_rules =
|
piston_rules =
|
||||||
{{x = 0, z = 0, y = 1}, -- everything apart from pusher side
|
{{x=0, y=0, z=1}, --everything apart from z- (pusher side)
|
||||||
{x = 1, z = 0, y = 1},
|
{x=1, y=0, z=0},
|
||||||
{x = 1, z = 1, y = 1},
|
{x=-1, y=0, z=0},
|
||||||
{x = 0, z = 1, y = 1},
|
{x=1, y=1, z=0},
|
||||||
{x =-1, z = 0, y = 1},
|
{x=1, y=-1, z=0},
|
||||||
{x =-1, z =-1, y = 1},
|
{x=-1, y=1, z=0},
|
||||||
{x = 0, z =-1, y = 1},
|
{x=-1, y=-1, z=0},
|
||||||
{x = 1, z =-1, y = 1},
|
{x=0, y=1, z=1},
|
||||||
{x =-1, z = 1, y = 1},
|
{x=0, y=-1, z=1}}
|
||||||
|
|
||||||
{x = 1, z = 0, y = 0},
|
local piston_up_rules =
|
||||||
{x = 1, z = 1, y = 0},
|
{{x=0, y=0, z=-1}, --everything apart from y+ (pusher side)
|
||||||
{x = 0, z = 1, y = 0},
|
{x=1, y=0, z=0},
|
||||||
{x =-1, z = 0, y = 0},
|
{x=-1, y=0, z=0},
|
||||||
{x =-1, z =-1, y = 0},
|
{x=0, y=0, z=1},
|
||||||
--{x = 0, z =-1, y = 0}, pusher side --> disabled
|
{x=1, y=-1, z=0},
|
||||||
{x = 1, z =-1, y = 0},
|
{x=-1, y=-1, z=0},
|
||||||
{x =-1, z = 1, y = 0},
|
{x=0, y=-1, z=1},
|
||||||
|
{x=0, y=-1, z=-1}}
|
||||||
|
|
||||||
{x = 0, z = 0, y =-1},
|
local piston_down_rules =
|
||||||
{x = 1, z = 0, y =-1},
|
{{x=0, y=0, z=-1}, --everything apart from y- (pusher side)
|
||||||
{x = 1, z = 1, y =-1},
|
{x=1, y=0, z=0},
|
||||||
{x = 0, z = 1, y =-1},
|
{x=-1, y=0, z=0},
|
||||||
{x =-1, z = 0, y =-1},
|
{x=0, y=0, z=1},
|
||||||
{x =-1, z =-1, y =-1},
|
{x=1, y=1, z=0},
|
||||||
{x = 0, z =-1, y =-1},
|
{x=-1, y=1, z=0},
|
||||||
{x = 1, z =-1, y =-1},
|
{x=0, y=1, z=1},
|
||||||
{x =-1, z = 1, y =-1}}
|
{x=0, y=1, z=-1}}
|
||||||
|
|
||||||
local piston_rotate_rules = function(param2, rules)
|
local piston_get_rules = function (node)
|
||||||
if param2 == 4 then
|
local rules = piston_rules
|
||||||
return mesecon:rotate_rules_up(mesecon:rotate_rules_left(rules))
|
for i = 1, node.param2 do
|
||||||
end -- face up
|
|
||||||
if param2 == 6 then
|
|
||||||
return mesecon:rotate_rules_down(mesecon:rotate_rules_left(rules))
|
|
||||||
end -- face up
|
|
||||||
|
|
||||||
rules = mesecon:rotate_rules_down(rules)
|
|
||||||
for i = 1, param2 do
|
|
||||||
rules = mesecon:rotate_rules_left(rules)
|
rules = mesecon:rotate_rules_left(rules)
|
||||||
end
|
end
|
||||||
return rules
|
return rules
|
||||||
end
|
end
|
||||||
|
|
||||||
local piston_get_rules = function (node)
|
piston_facedir_direction = function (node)
|
||||||
return piston_rotate_rules(node.param2, piston_rules)
|
local rules = {{x = 0, y = 0, z = -1}}
|
||||||
|
for i = 1, node.param2 do
|
||||||
|
rules = mesecon:rotate_rules_left(rules)
|
||||||
|
end
|
||||||
|
return rules[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
piston_facedir_direction = function (node)
|
piston_get_direction = function (dir, node)
|
||||||
local rules = piston_rotate_rules(node.param2, {{x = 0, y = 0, z =-1}})
|
if type(dir) == "function" then
|
||||||
return rules[1]
|
return dir(node)
|
||||||
|
else
|
||||||
|
return dir
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local piston_remove_pusher = function (pos, node)
|
local piston_remove_pusher = function (pos, node)
|
||||||
pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
||||||
|
|
||||||
dir = piston_facedir_direction(node)
|
dir = piston_get_direction(pistonspec.dir, node)
|
||||||
local pusherpos = mesecon:addPosRule(pos, dir)
|
local pusherpos = mesecon:addPosRule(pos, dir)
|
||||||
local pushername = minetest.env:get_node(pusherpos).name
|
local pushername = minetest.env:get_node(pusherpos).name
|
||||||
|
|
||||||
@ -69,13 +70,14 @@ end
|
|||||||
local piston_on = function (pos, node)
|
local piston_on = function (pos, node)
|
||||||
local pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
local pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
||||||
|
|
||||||
dir = piston_facedir_direction(node)
|
local dir = piston_get_direction(pistonspec.dir, node)
|
||||||
local np = mesecon:addPosRule(pos, dir)
|
local np = mesecon:addPosRule(pos, dir)
|
||||||
success, stack = mesecon:mvps_push(np, dir, PISTON_MAXIMUM_PUSH)
|
local success, stack, oldstack = mesecon:mvps_push(np, dir, PISTON_MAXIMUM_PUSH)
|
||||||
if success then
|
if success then
|
||||||
minetest.env:add_node(pos, {param2 = node.param2, name = pistonspec.onname})
|
minetest.env:add_node(pos, {param2 = node.param2, name = pistonspec.onname})
|
||||||
minetest.env:add_node(np, {param2 = node.param2, name = pistonspec.pusher})
|
minetest.env:add_node(np, {param2 = node.param2, name = pistonspec.pusher})
|
||||||
mesecon:mvps_process_stack(stack)
|
mesecon:mvps_process_stack (stack)
|
||||||
|
mesecon:mvps_move_objects (np, dir, oldstack)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -85,10 +87,10 @@ local piston_off = function (pos, node)
|
|||||||
piston_remove_pusher (pos, node)
|
piston_remove_pusher (pos, node)
|
||||||
|
|
||||||
if pistonspec.sticky then
|
if pistonspec.sticky then
|
||||||
dir = piston_facedir_direction(node)
|
dir = piston_get_direction(pistonspec.dir, node)
|
||||||
pullpos = mesecon:addPosRule(pos, dir)
|
pullpos = mesecon:addPosRule(pos, dir)
|
||||||
stack = mesecon:mvps_pull_single(pullpos, dir)
|
stack = mesecon:mvps_pull_single(pullpos, dir)
|
||||||
mesecon:mvps_process_stack(stack)
|
mesecon:mvps_process_stack(pos, dir, stack)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -100,20 +102,16 @@ local piston_orientate = function (pos, placer)
|
|||||||
local pitch = placer:get_look_pitch() * (180 / math.pi)
|
local pitch = placer:get_look_pitch() * (180 / math.pi)
|
||||||
|
|
||||||
local node = minetest.env:get_node(pos)
|
local node = minetest.env:get_node(pos)
|
||||||
|
local pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
||||||
if pitch > 55 then --looking upwards --> face down
|
if pitch > 55 then --looking upwards
|
||||||
minetest.env:set_node(pos, {name = node.name, param2 = 6})
|
minetest.env:add_node(pos, {name=pistonspec.piston_down})
|
||||||
elseif pitch < -55 then --looking downwards --> face up
|
elseif pitch < -55 then --looking downwards
|
||||||
minetest.env:set_node(pos, {name = node.name, param2 = 4})
|
minetest.env:add_node(pos, {name=pistonspec.piston_up})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- Node Registration
|
|
||||||
--
|
|
||||||
--
|
|
||||||
|
|
||||||
|
-- Horizontal pistons
|
||||||
|
|
||||||
local pt = 3/16 -- pusher thickness
|
local pt = 3/16 -- pusher thickness
|
||||||
|
|
||||||
@ -138,6 +136,7 @@ local piston_on_box = {
|
|||||||
local pistonspec_normal = {
|
local pistonspec_normal = {
|
||||||
offname = "mesecons_pistons:piston_normal_off",
|
offname = "mesecons_pistons:piston_normal_off",
|
||||||
onname = "mesecons_pistons:piston_normal_on",
|
onname = "mesecons_pistons:piston_normal_on",
|
||||||
|
dir = piston_facedir_direction,
|
||||||
pusher = "mesecons_pistons:piston_pusher_normal",
|
pusher = "mesecons_pistons:piston_pusher_normal",
|
||||||
piston_down = "mesecons_pistons:piston_down_normal_off",
|
piston_down = "mesecons_pistons:piston_down_normal_off",
|
||||||
piston_up = "mesecons_pistons:piston_up_normal_off",
|
piston_up = "mesecons_pistons:piston_up_normal_off",
|
||||||
@ -217,6 +216,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_normal", {
|
|||||||
local pistonspec_sticky = {
|
local pistonspec_sticky = {
|
||||||
offname = "mesecons_pistons:piston_sticky_off",
|
offname = "mesecons_pistons:piston_sticky_off",
|
||||||
onname = "mesecons_pistons:piston_sticky_on",
|
onname = "mesecons_pistons:piston_sticky_on",
|
||||||
|
dir = piston_facedir_direction,
|
||||||
pusher = "mesecons_pistons:piston_pusher_sticky",
|
pusher = "mesecons_pistons:piston_pusher_sticky",
|
||||||
sticky = true,
|
sticky = true,
|
||||||
piston_down = "mesecons_pistons:piston_down_sticky_off",
|
piston_down = "mesecons_pistons:piston_down_sticky_off",
|
||||||
@ -292,6 +292,372 @@ minetest.register_node("mesecons_pistons:piston_pusher_sticky", {
|
|||||||
node_box = piston_pusher_box,
|
node_box = piston_pusher_box,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- UP
|
||||||
|
--
|
||||||
|
--
|
||||||
|
|
||||||
|
local piston_up_pusher_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-2/16, -.5 - pt, -2/16, 2/16, .5 - pt, 2/16},
|
||||||
|
{-.5 , .5 - pt, -.5 , .5 , .5 , .5},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local piston_up_on_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-.5, -.5, -.5 , .5, .5-pt, .5}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Normal
|
||||||
|
|
||||||
|
local pistonspec_normal_up = {
|
||||||
|
offname = "mesecons_pistons:piston_up_normal_off",
|
||||||
|
onname = "mesecons_pistons:piston_up_normal_on",
|
||||||
|
dir = {x = 0, y = 1, z = 0},
|
||||||
|
pusher = "mesecons_pistons:piston_up_pusher_normal"
|
||||||
|
}
|
||||||
|
|
||||||
|
-- offstate
|
||||||
|
minetest.register_node("mesecons_pistons:piston_up_normal_off", {
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_pusher_front.png",
|
||||||
|
"mesecons_piston_back.png",
|
||||||
|
"mesecons_piston_left.png^[transformR270",
|
||||||
|
"mesecons_piston_right.png^[transformR90",
|
||||||
|
"mesecons_piston_bottom.png",
|
||||||
|
"mesecons_piston_top.png^[transformR180",
|
||||||
|
},
|
||||||
|
inventory_image = "mesecons_piston_top.png",
|
||||||
|
wield_image = "mesecons_piston_top.png",
|
||||||
|
groups = {cracky = 3, not_in_creative_inventory = 1},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "mesecons_pistons:piston_normal_off",
|
||||||
|
mesecons_piston = pistonspec_normal_up,
|
||||||
|
mesecons = {effector={
|
||||||
|
action_on = piston_on,
|
||||||
|
rules = piston_up_rules,
|
||||||
|
}}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- onstate
|
||||||
|
minetest.register_node("mesecons_pistons:piston_up_normal_on", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_on_front.png",
|
||||||
|
"mesecons_piston_back.png",
|
||||||
|
"mesecons_piston_left.png^[transformR270",
|
||||||
|
"mesecons_piston_right.png^[transformR90",
|
||||||
|
"mesecons_piston_bottom.png",
|
||||||
|
"mesecons_piston_top.png^[transformR180",
|
||||||
|
},
|
||||||
|
inventory_image = "mesecons_piston_top.png",
|
||||||
|
wield_image = "mesecons_piston_top.png",
|
||||||
|
groups = {cracky = 3, not_in_creative_inventory = 1},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "mesecons_pistons:piston_normal_off",
|
||||||
|
after_dig_node = piston_remove_pusher,
|
||||||
|
node_box = piston_up_on_box,
|
||||||
|
selection_box = piston_up_on_box,
|
||||||
|
mesecons_piston = pistonspec_normal_up,
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
mesecons = {effector={
|
||||||
|
action_off = piston_off,
|
||||||
|
rules = piston_up_rules,
|
||||||
|
}}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- pusher
|
||||||
|
minetest.register_node("mesecons_pistons:piston_up_pusher_normal", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_pusher_front.png",
|
||||||
|
"mesecons_piston_pusher_back.png",
|
||||||
|
"mesecons_piston_pusher_left.png^[transformR270",
|
||||||
|
"mesecons_piston_pusher_right.png^[transformR90",
|
||||||
|
"mesecons_piston_pusher_bottom.png",
|
||||||
|
"mesecons_piston_pusher_top.png^[transformR180",
|
||||||
|
},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
diggable = false,
|
||||||
|
corresponding_piston = "mesecons_pistons:piston_up_normal_on",
|
||||||
|
selection_box = piston_up_pusher_box,
|
||||||
|
node_box = piston_up_pusher_box,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Sticky
|
||||||
|
|
||||||
|
|
||||||
|
local pistonspec_sticky_up = {
|
||||||
|
offname = "mesecons_pistons:piston_up_sticky_off",
|
||||||
|
onname = "mesecons_pistons:piston_up_sticky_on",
|
||||||
|
dir = {x = 0, y = 1, z = 0},
|
||||||
|
pusher = "mesecons_pistons:piston_up_pusher_sticky",
|
||||||
|
sticky = true
|
||||||
|
}
|
||||||
|
|
||||||
|
-- offstate
|
||||||
|
minetest.register_node("mesecons_pistons:piston_up_sticky_off", {
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_pusher_front_sticky.png",
|
||||||
|
"mesecons_piston_back.png",
|
||||||
|
"mesecons_piston_left.png^[transformR270",
|
||||||
|
"mesecons_piston_right.png^[transformR90",
|
||||||
|
"mesecons_piston_bottom.png",
|
||||||
|
"mesecons_piston_top.png^[transformR180",
|
||||||
|
"mesecons_piston_tb.png"
|
||||||
|
},
|
||||||
|
inventory_image = "mesecons_piston_top.png",
|
||||||
|
wield_image = "mesecons_piston_top.png",
|
||||||
|
groups = {cracky = 3, not_in_creative_inventory = 1},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "mesecons_pistons:piston_sticky_off",
|
||||||
|
mesecons_piston = pistonspec_sticky_up,
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
mesecons = {effector={
|
||||||
|
action_on = piston_on,
|
||||||
|
rules = piston_up_rules,
|
||||||
|
}}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- onstate
|
||||||
|
minetest.register_node("mesecons_pistons:piston_up_sticky_on", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_on_front.png",
|
||||||
|
"mesecons_piston_back.png",
|
||||||
|
"mesecons_piston_left.png^[transformR270",
|
||||||
|
"mesecons_piston_right.png^[transformR90",
|
||||||
|
"mesecons_piston_bottom.png",
|
||||||
|
"mesecons_piston_top.png^[transformR180",
|
||||||
|
},
|
||||||
|
inventory_image = "mesecons_piston_top.png",
|
||||||
|
wield_image = "mesecons_piston_top.png",
|
||||||
|
groups = {cracky = 3, not_in_creative_inventory = 1},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "mesecons_pistons:piston_normal_off",
|
||||||
|
after_dig_node = piston_remove_pusher,
|
||||||
|
node_box = piston_up_on_box,
|
||||||
|
selection_box = piston_up_on_box,
|
||||||
|
mesecons_piston = pistonspec_sticky_up,
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
mesecons = {effector={
|
||||||
|
action_off = piston_off,
|
||||||
|
rules = piston_up_rules,
|
||||||
|
}}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- pusher
|
||||||
|
minetest.register_node("mesecons_pistons:piston_up_pusher_sticky", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_pusher_front_sticky.png",
|
||||||
|
"mesecons_piston_pusher_back.png",
|
||||||
|
"mesecons_piston_pusher_left.png^[transformR270",
|
||||||
|
"mesecons_piston_pusher_right.png^[transformR90",
|
||||||
|
"mesecons_piston_pusher_bottom.png",
|
||||||
|
"mesecons_piston_pusher_top.png^[transformR180",
|
||||||
|
},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
diggable = false,
|
||||||
|
corresponding_piston = "mesecons_pistons:piston_up_sticky_on",
|
||||||
|
selection_box = piston_up_pusher_box,
|
||||||
|
node_box = piston_up_pusher_box,
|
||||||
|
})
|
||||||
|
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- DOWN
|
||||||
|
--
|
||||||
|
--
|
||||||
|
|
||||||
|
local piston_down_pusher_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-2/16, -.5 + pt, -2/16, 2/16, .5 + pt, 2/16},
|
||||||
|
{-.5 , -.5 , -.5 , .5 , -.5 + pt, .5},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local piston_down_on_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-.5, -.5+pt, -.5 , .5, .5, .5}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Normal
|
||||||
|
|
||||||
|
local pistonspec_normal_down = {
|
||||||
|
offname = "mesecons_pistons:piston_down_normal_off",
|
||||||
|
onname = "mesecons_pistons:piston_down_normal_on",
|
||||||
|
dir = {x = 0, y = -1, z = 0},
|
||||||
|
pusher = "mesecons_pistons:piston_down_pusher_normal",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- offstate
|
||||||
|
minetest.register_node("mesecons_pistons:piston_down_normal_off", {
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_back.png",
|
||||||
|
"mesecons_piston_pusher_front.png",
|
||||||
|
"mesecons_piston_left.png^[transformR90",
|
||||||
|
"mesecons_piston_right.png^[transformR270",
|
||||||
|
"mesecons_piston_bottom.png^[transformR180",
|
||||||
|
"mesecons_piston_top.png",
|
||||||
|
},
|
||||||
|
inventory_image = "mesecons_piston_top.png",
|
||||||
|
wield_image = "mesecons_piston_top.png",
|
||||||
|
groups = {cracky = 3, not_in_creative_inventory = 1},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "mesecons_pistons:piston_normal_off",
|
||||||
|
mesecons_piston = pistonspec_normal_down,
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
mesecons = {effector={
|
||||||
|
action_on = piston_on,
|
||||||
|
rules = piston_down_rules,
|
||||||
|
}}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- onstate
|
||||||
|
minetest.register_node("mesecons_pistons:piston_down_normal_on", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_back.png",
|
||||||
|
"mesecons_piston_on_front.png",
|
||||||
|
"mesecons_piston_left.png^[transformR90",
|
||||||
|
"mesecons_piston_right.png^[transformR270",
|
||||||
|
"mesecons_piston_bottom.png^[transformR180",
|
||||||
|
"mesecons_piston_top.png",
|
||||||
|
},
|
||||||
|
inventory_image = "mesecons_piston_top.png",
|
||||||
|
wield_image = "mesecons_piston_top.png",
|
||||||
|
groups = {cracky = 3, not_in_creative_inventory = 1},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "mesecons_pistons:piston_normal_off",
|
||||||
|
after_dig_node = piston_remove_pusher,
|
||||||
|
node_box = piston_down_on_box,
|
||||||
|
selection_box = piston_down_on_box,
|
||||||
|
mesecons_piston = pistonspec_normal_down,
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
mesecons = {effector={
|
||||||
|
action_off = piston_off,
|
||||||
|
rules = piston_down_rules,
|
||||||
|
}}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- pusher
|
||||||
|
minetest.register_node("mesecons_pistons:piston_down_pusher_normal", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_pusher_back.png",
|
||||||
|
"mesecons_piston_pusher_front.png",
|
||||||
|
"mesecons_piston_pusher_left.png^[transformR90",
|
||||||
|
"mesecons_piston_pusher_right.png^[transformR270",
|
||||||
|
"mesecons_piston_pusher_bottom.png^[transformR180",
|
||||||
|
"mesecons_piston_pusher_top.png",
|
||||||
|
},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
diggable = false,
|
||||||
|
corresponding_piston = "mesecons_pistons:piston_down_normal_on",
|
||||||
|
selection_box = piston_down_pusher_box,
|
||||||
|
node_box = piston_down_pusher_box,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Sticky
|
||||||
|
|
||||||
|
local pistonspec_sticky_down = {
|
||||||
|
onname = "mesecons_pistons:piston_down_sticky_on",
|
||||||
|
offname = "mesecons_pistons:piston_down_sticky_off",
|
||||||
|
dir = {x = 0, y = -1, z = 0},
|
||||||
|
pusher = "mesecons_pistons:piston_down_pusher_sticky",
|
||||||
|
sticky = true
|
||||||
|
}
|
||||||
|
|
||||||
|
-- offstate
|
||||||
|
minetest.register_node("mesecons_pistons:piston_down_sticky_off", {
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_back.png",
|
||||||
|
"mesecons_piston_pusher_front_sticky.png",
|
||||||
|
"mesecons_piston_left.png^[transformR90",
|
||||||
|
"mesecons_piston_right.png^[transformR270",
|
||||||
|
"mesecons_piston_bottom.png^[transformR180",
|
||||||
|
"mesecons_piston_top.png",
|
||||||
|
},
|
||||||
|
inventory_image = "mesecons_piston_top.png",
|
||||||
|
wield_image = "mesecons_piston_top.png",
|
||||||
|
groups = {cracky = 3, not_in_creative_inventory = 1},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "mesecons_pistons:piston_sticky_off",
|
||||||
|
mesecons_piston = pistonspec_sticky_down,
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
mesecons = {effector={
|
||||||
|
action_on = piston_on,
|
||||||
|
rules = piston_down_rules,
|
||||||
|
}}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- onstate
|
||||||
|
minetest.register_node("mesecons_pistons:piston_down_sticky_on", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_back.png",
|
||||||
|
"mesecons_piston_on_front.png",
|
||||||
|
"mesecons_piston_left.png^[transformR90",
|
||||||
|
"mesecons_piston_right.png^[transformR270",
|
||||||
|
"mesecons_piston_bottom.png^[transformR180",
|
||||||
|
"mesecons_piston_top.png",
|
||||||
|
},
|
||||||
|
inventory_image = "mesecons_piston_top.png",
|
||||||
|
wield_image = "mesecons_piston_top.png",
|
||||||
|
groups = {cracky = 3, not_in_creative_inventory = 1},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "mesecons_pistons:piston_sticky_off",
|
||||||
|
after_dig_node = piston_remove_pusher,
|
||||||
|
node_box = piston_down_on_box,
|
||||||
|
selection_box = piston_down_on_box,
|
||||||
|
mesecons_piston = pistonspec_sticky_down,
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
mesecons = {effector={
|
||||||
|
action_off = piston_off,
|
||||||
|
rules = piston_down_rules,
|
||||||
|
}}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- pusher
|
||||||
|
minetest.register_node("mesecons_pistons:piston_down_pusher_sticky", {
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = {
|
||||||
|
"mesecons_piston_pusher_back.png",
|
||||||
|
"mesecons_piston_pusher_front_sticky.png",
|
||||||
|
"mesecons_piston_pusher_left.png^[transformR90",
|
||||||
|
"mesecons_piston_pusher_right.png^[transformR270",
|
||||||
|
"mesecons_piston_pusher_bottom.png^[transformR180",
|
||||||
|
"mesecons_piston_pusher_top.png",
|
||||||
|
},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
diggable = false,
|
||||||
|
corresponding_piston = "mesecons_pistons:piston_down_sticky_on",
|
||||||
|
selection_box = piston_down_pusher_box,
|
||||||
|
node_box = piston_down_pusher_box,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
-- Register pushers as stoppers if they would be seperated from the piston
|
-- Register pushers as stoppers if they would be seperated from the piston
|
||||||
local piston_pusher_get_stopper = function (node, dir, stack, stackid)
|
local piston_pusher_get_stopper = function (node, dir, stack, stackid)
|
||||||
if (stack[stackid + 1]
|
if (stack[stackid + 1]
|
||||||
@ -318,9 +684,27 @@ end
|
|||||||
mesecon:register_mvps_stopper("mesecons_pistons:piston_pusher_normal", piston_pusher_get_stopper)
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_pusher_normal", piston_pusher_get_stopper)
|
||||||
mesecon:register_mvps_stopper("mesecons_pistons:piston_pusher_sticky", piston_pusher_get_stopper)
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_pusher_sticky", piston_pusher_get_stopper)
|
||||||
|
|
||||||
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_up_pusher_normal", piston_pusher_up_down_get_stopper)
|
||||||
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_up_pusher_sticky", piston_pusher_up_down_get_stopper)
|
||||||
|
|
||||||
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_down_pusher_normal", piston_pusher_up_down_get_stopper)
|
||||||
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_down_pusher_sticky", piston_pusher_up_down_get_stopper)
|
||||||
|
|
||||||
|
|
||||||
|
-- Register pistons as stoppers if they would be seperated from the stopper
|
||||||
|
local piston_up_down_get_stopper = function (node, dir, stack, stackid)
|
||||||
|
if (stack[stackid + 1]
|
||||||
|
and stack[stackid + 1].node.name == minetest.registered_nodes[node.name].mesecons_piston.pusher)
|
||||||
|
or (stack[stackid - 1]
|
||||||
|
and stack[stackid - 1].node.name == minetest.registered_nodes[node.name].mesecons_piston.pusher) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
local piston_get_stopper = function (node, dir, stack, stackid)
|
local piston_get_stopper = function (node, dir, stack, stackid)
|
||||||
pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
||||||
dir = piston_facedir_direction(node)
|
dir = piston_get_direction(pistonspec.dir, node)
|
||||||
local pusherpos = mesecon:addPosRule(stack[stackid].pos, dir)
|
local pusherpos = mesecon:addPosRule(stack[stackid].pos, dir)
|
||||||
local pushernode = minetest.env:get_node(pusherpos)
|
local pushernode = minetest.env:get_node(pusherpos)
|
||||||
|
|
||||||
@ -338,9 +722,15 @@ end
|
|||||||
mesecon:register_mvps_stopper("mesecons_pistons:piston_normal_on", piston_get_stopper)
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_normal_on", piston_get_stopper)
|
||||||
mesecon:register_mvps_stopper("mesecons_pistons:piston_sticky_on", piston_get_stopper)
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_sticky_on", piston_get_stopper)
|
||||||
|
|
||||||
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_up_normal_on", piston_up_down_get_stopper)
|
||||||
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_up_sticky_on", piston_up_down_get_stopper)
|
||||||
|
|
||||||
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_down_normal_on", piston_up_down_get_stopper)
|
||||||
|
mesecon:register_mvps_stopper("mesecons_pistons:piston_down_sticky_on", piston_up_down_get_stopper)
|
||||||
|
|
||||||
--craft recipes
|
--craft recipes
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'mesecons_pistons:piston_normal_off 2',
|
output = "mesecons_pistons:piston_normal_off 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:wood", "default:wood", "default:wood"},
|
{"default:wood", "default:wood", "default:wood"},
|
||||||
{"default:cobble", "default:steel_ingot", "default:cobble"},
|
{"default:cobble", "default:steel_ingot", "default:cobble"},
|
||||||
|
@ -13,7 +13,7 @@ minetest.register_node("mesecons_powerplant:power_plant", {
|
|||||||
description="Power Plant",
|
description="Power Plant",
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
|
fixed = {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3},
|
||||||
},
|
},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
@ -22,10 +22,10 @@ minetest.register_node("mesecons_powerplant:power_plant", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_powerplant:power_plant" 1',
|
output = "mesecons_powerplant:power_plant 1",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'"group:mesecon_conductor_craftable"'},
|
{"group:mesecon_conductor_craftable"},
|
||||||
{'"group:mesecon_conductor_craftable"'},
|
{"group:mesecon_conductor_craftable"},
|
||||||
{'"default:sapling"'},
|
{"default:sapling"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -5,7 +5,7 @@ local pp_box_off = {
|
|||||||
|
|
||||||
local pp_box_on = {
|
local pp_box_on = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
|
fixed = { -7/16, -8/16, -7/16, 7/16, -7.5/16, 7/16 },
|
||||||
}
|
}
|
||||||
|
|
||||||
pp_on_timer = function (pos, elapsed)
|
pp_on_timer = function (pos, elapsed)
|
||||||
@ -49,7 +49,7 @@ end
|
|||||||
-- image: inventory and wield image of the pressure plate
|
-- image: inventory and wield image of the pressure plate
|
||||||
-- recipe: crafting recipe of the pressure plate
|
-- recipe: crafting recipe of the pressure plate
|
||||||
|
|
||||||
function mesecon:register_pressure_plate(offstate, onstate, description, texture_off, texture_on, recipe)
|
function mesecon:register_pressure_plate(offstate, onstate, description, textures_off, textures_on, image_w, image_i, recipe)
|
||||||
local ppspec = {
|
local ppspec = {
|
||||||
offstate = offstate,
|
offstate = offstate,
|
||||||
onstate = onstate
|
onstate = onstate
|
||||||
@ -57,9 +57,9 @@ function mesecon:register_pressure_plate(offstate, onstate, description, texture
|
|||||||
|
|
||||||
minetest.register_node(offstate, {
|
minetest.register_node(offstate, {
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {texture_off},
|
tiles = textures_off,
|
||||||
inventory_image = texture_off,
|
inventory_image = image_i,
|
||||||
wield_image = image,
|
wield_image = image_w,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
selection_box = pp_box_off,
|
selection_box = pp_box_off,
|
||||||
node_box = pp_box_off,
|
node_box = pp_box_off,
|
||||||
@ -77,7 +77,7 @@ function mesecon:register_pressure_plate(offstate, onstate, description, texture
|
|||||||
|
|
||||||
minetest.register_node(onstate, {
|
minetest.register_node(onstate, {
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {texture_on},
|
tiles = textures_on,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
selection_box = pp_box_on,
|
selection_box = pp_box_on,
|
||||||
node_box = pp_box_on,
|
node_box = pp_box_on,
|
||||||
@ -110,14 +110,18 @@ mesecon:register_pressure_plate(
|
|||||||
"mesecons_pressureplates:pressure_plate_wood_off",
|
"mesecons_pressureplates:pressure_plate_wood_off",
|
||||||
"mesecons_pressureplates:pressure_plate_wood_on",
|
"mesecons_pressureplates:pressure_plate_wood_on",
|
||||||
"Wooden Pressure Plate",
|
"Wooden Pressure Plate",
|
||||||
"jeija_pressure_plate_wood_off.png",
|
{"jeija_pressure_plate_wood_off.png","jeija_pressure_plate_wood_off.png","jeija_pressure_plate_wood_off_edges.png"},
|
||||||
"jeija_pressure_plate_wood_on.png",
|
{"jeija_pressure_plate_wood_on.png","jeija_pressure_plate_wood_on.png","jeija_pressure_plate_wood_on_edges.png"},
|
||||||
|
"jeija_pressure_plate_wood_wield.png",
|
||||||
|
"jeija_pressure_plate_wood_inv.png",
|
||||||
{{"default:wood", "default:wood"}})
|
{{"default:wood", "default:wood"}})
|
||||||
|
|
||||||
mesecon:register_pressure_plate(
|
mesecon:register_pressure_plate(
|
||||||
"mesecons_pressureplates:pressure_plate_stone_off",
|
"mesecons_pressureplates:pressure_plate_stone_off",
|
||||||
"mesecons_pressureplates:pressure_plate_stone_on",
|
"mesecons_pressureplates:pressure_plate_stone_on",
|
||||||
"Stone Pressure Plate",
|
"Stone Pressure Plate",
|
||||||
"jeija_pressure_plate_stone_off.png",
|
{"jeija_pressure_plate_stone_off.png","jeija_pressure_plate_stone_off.png","jeija_pressure_plate_stone_off_edges.png"},
|
||||||
"jeija_pressure_plate_stone_on.png",
|
{"jeija_pressure_plate_stone_on.png","jeija_pressure_plate_stone_on.png","jeija_pressure_plate_stone_on_edges.png"},
|
||||||
|
"jeija_pressure_plate_stone_wield.png",
|
||||||
|
"jeija_pressure_plate_stone_inv.png",
|
||||||
{{"default:cobble", "default:cobble"}})
|
{{"default:cobble", "default:cobble"}})
|
||||||
|
@ -59,10 +59,10 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_solarpanel:solar_panel_off" 1',
|
output = "mesecons_solarpanel:solar_panel_off 1",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'"mesecons_materials:silicon"', '"mesecons_materials:silicon"'},
|
{"mesecons_materials:silicon", "mesecons_materials:silicon"},
|
||||||
{'"mesecons_materials:silicon"', '"mesecons_materials:silicon"'},
|
{"mesecons_materials:silicon", "mesecons_materials:silicon"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ minetest.register_node("mesecons_switch:mesecon_switch_on", {
|
|||||||
tiles = {"jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_on.png"},
|
tiles = {"jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_side.png", "jeija_mesecon_switch_on.png"},
|
||||||
paramtype2="facedir",
|
paramtype2="facedir",
|
||||||
groups = {dig_immediate=2,not_in_creative_inventory=1},
|
groups = {dig_immediate=2,not_in_creative_inventory=1},
|
||||||
drop='"mesecons_switch:mesecon_switch_off" 1',
|
drop="mesecons_switch:mesecon_switch_off 1",
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.on
|
state = mesecon.state.on
|
||||||
@ -33,9 +33,9 @@ minetest.register_node("mesecons_switch:mesecon_switch_on", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_switch:mesecon_switch_off" 2',
|
output = "mesecons_switch:mesecon_switch_off 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'"default:steel_ingot"', '"default:cobble"', '"default:steel_ingot"'},
|
{"default:steel_ingot", "default:cobble", "default:steel_ingot"},
|
||||||
{'"group:mesecon_conductor_craftable"','', '"group:mesecon_conductor_craftable"'},
|
{"group:mesecon_conductor_craftable","", "group:mesecon_conductor_craftable"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
BIN
mesecons_textures/textures/jeija_lightstone_yellow_off.png
Normal file
After Width: | Height: | Size: 291 B |
BIN
mesecons_textures/textures/jeija_lightstone_yellow_on.png
Normal file
After Width: | Height: | Size: 486 B |
BIN
mesecons_textures/textures/jeija_luacontroller_burnt_top.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
mesecons_textures/textures/jeija_pressure_plate_stone_inv.png
Normal file
After Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 648 B After Width: | Height: | Size: 555 B |
After Width: | Height: | Size: 292 B |
Before Width: | Height: | Size: 680 B After Width: | Height: | Size: 579 B |
After Width: | Height: | Size: 336 B |
BIN
mesecons_textures/textures/jeija_pressure_plate_stone_wield.png
Normal file
After Width: | Height: | Size: 604 B |
BIN
mesecons_textures/textures/jeija_pressure_plate_wood_inv.png
Normal file
After Width: | Height: | Size: 716 B |
Before Width: | Height: | Size: 750 B After Width: | Height: | Size: 663 B |
After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 675 B |
After Width: | Height: | Size: 336 B |
BIN
mesecons_textures/textures/jeija_pressure_plate_wood_wield.png
Normal file
After Width: | Height: | Size: 716 B |
@ -35,7 +35,7 @@ local torch_get_input_rules = function(node)
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_torch:mesecon_torch_on" 4',
|
output = "mesecons_torch:mesecon_torch_on 4",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"group:mesecon_conductor_craftable"},
|
{"group:mesecon_conductor_craftable"},
|
||||||
{"default:stick"},}
|
{"default:stick"},}
|
||||||
|
@ -71,7 +71,7 @@ minetest.register_node("mesecons_walllever:wall_lever_on", {
|
|||||||
{ -1/16, 0, 4/16, 1/16, 8/16, 6/16 }} -- the lever itself.
|
{ -1/16, 0, 4/16, 1/16, 8/16, 6/16 }} -- the lever itself.
|
||||||
},
|
},
|
||||||
groups = {dig_immediate = 2, not_in_creative_inventory = 1, mesecon_needs_receiver = 1},
|
groups = {dig_immediate = 2, not_in_creative_inventory = 1, mesecon_needs_receiver = 1},
|
||||||
drop = '"mesecons_walllever:wall_lever_off" 1',
|
drop = "mesecons_walllever:wall_lever_off 1",
|
||||||
description="Lever",
|
description="Lever",
|
||||||
on_punch = function (pos, node)
|
on_punch = function (pos, node)
|
||||||
mesecon:swap_node(pos, "mesecons_walllever:wall_lever_off")
|
mesecon:swap_node(pos, "mesecons_walllever:wall_lever_off")
|
||||||
@ -86,10 +86,10 @@ minetest.register_node("mesecons_walllever:wall_lever_on", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = '"mesecons_walllever:wall_lever_off" 2',
|
output = "mesecons_walllever:wall_lever_off 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'"group:mesecon_conductor_craftable"'},
|
{"group:mesecon_conductor_craftable"},
|
||||||
{'"default:stone"'},
|
{"default:stone"},
|
||||||
{'"default:stick"'},
|
{"default:stick"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|