aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking
Commit message (Collapse)AuthorAge
* Apply minetest.formspec_escape() to prevent formspec injection (H#143)MT0.4Blockhead2020-01-04
|
* Add inverse ARS rulesGabriel Pérez-Cerezo2019-12-05
| | | | | | | | !RC foo !LN bar will match all trains except those matching RC foo or LN bar. This can be useful to exclude one specific service from a component.
* Fix the "red signals" bug that appeared when clicking a green signalorwell962019-11-21
|
* Do not throw error when sync_tcb_neighbors failsorwell962019-08-29
|
* Don't allow to remove TCB when a signal is assignedorwell962019-08-26
|
* Various small fixesGabriel Pérez-Cerezo2019-07-16
| | | | | | - Also do atomic operations on nodedb - no longer require Worldedit for at_sync_ndb - "overrun LZB 0 restriction" should now show where it happened.
* Fix remote routesettingorwell962019-04-16
|
* Move LZB system to core and unify approach callback mechanismorwell962019-04-16
|
* Disable-ARS switch in signal and set this when cancelling an ARS routeorwell962019-03-15
|
* Ugly workaround for green signals bugorwell962019-03-15
|
* Fix cancelling "Unknown Route" when section is deleted.orwell962019-03-15
|
* Do not clear LZB control when invalidating.orwell962019-02-23
| | | | Prevents trains accelerating towards red signals on /at_reroute
* possible fix for "trains standing at green signals"orwell962019-02-21
|
* Fix moving Signal IPs (no duplicate IPs)orwell962019-02-21
|
* Add ARS rules for stop railsorwell962019-02-19
|
* Prioritize LZB callback (possible bugfix for H#100)orwell962019-02-19
|
* Improve Signal IP form/workfloworwell962019-02-16
|
* Fix TCBS crash also for route_uiorwell962019-02-16
|
* Fix routesetting when TCBS is missing (H#109)orwell962019-02-12
|
* Fixes regarding signal assignments/tcbsorwell962019-02-09
| | | | | - No longer crashes when assigned tcb is removed - don't forbid modification just because signal is assigned
* Signalling form auto-updateorwell962019-02-05
|
* Force LZB Halt settingorwell962019-02-05
|
* Minor Bugfixesorwell962019-02-03
|
* Basic functions of "stop rail", missing ARS rules and signal.orwell962019-01-24
| | | | For signal, need to think of a callback system for signals and moving atlatc queue to core?
* Point speed restriction railsorwell962019-01-24
|
* Fix last commit (and another warn2log)orwell962019-01-22
|
* Fix atc command evaluation BB commandorwell962019-01-22
|
* Make LZB params adjustableorwell962019-01-22
|
* another small fix for route_uiorwell962019-01-22
|
* Fix small bug in routeui and make another message log-onlyorwell962019-01-22
|
* disable debug print of ARSorwell962019-01-22
|
* Fix may_modify_section on newly created sectionsorwell962019-01-22
|
* Fix invalid path invalidation in ARS codeorwell962019-01-22
|
* Prohibit removing/changing of TCBs and sections while routes or signals are setorwell962019-01-22
|
* Do not run LZB traverser when path does not existorwell962019-01-21
|
* Fix route aspect dialogorwell962019-01-15
|
* Fix Routingcode ARSorwell962019-01-15
|
* Can disable automatic working without cancelling routeorwell962019-01-15
|
* Actual working ARSorwell962019-01-15
|
* Add Automatic Routesetting UIorwell962019-01-09
| | | | Settings have no effect so far
* Fix crashes:orwell962018-12-10
| | | | | 1. when train hit a route, nil access to already cancelled route caused crash 2. fix crash when trying to ensure_init a train that doesn't exist
* Signs (static signals)orwell962018-12-08
|
* Shunt signals (not exactly Ks), along with fixes in other components that ↵orwell962018-12-08
| | | | those rely on
* Apply speed restriction 0.5 indexes later, do not cap tarvelocity by ↵orwell962018-12-04
| | | | speed_restriction
* Do not set speed_restriction for nprorwell962018-12-04
|
* Added on_train_approach callback, non-permanent external LZB brakepoints and ↵orwell962018-11-29
| | | | | | basis for "stop rails" Stop rails ATM use the aforementioned things to add a pointwise "2" speed restriction. Seems to work.
* Permit basic signal aspect settingorwell962018-11-19
| | | | (basically only usable with Ks signals, because they're the only signals supporting slow move and/or shunt move
* Replace "Allow accelereting train towards signal"orwell962018-10-30
| | | | This is a better implementation of the same goal. The last commit caused trains to overrun the IP sometimes. Haven't noticed so far with this approach
* Make fillout_aspect also fill "info" fieldorwell962018-10-30
|
* Do not allow static signals for routesettingorwell962018-10-30
|
n785'>785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830
-- default (Minetest 0.4 mod)
-- Most default stuff

-- Quick documentation about the API
-- =================================
--
-- Helper functions defined by builtin.lua:
-- dump2(obj, name="_", dumped={})
-- dump(obj, dumped={})
--
-- Mod load path
-- -------------
-- Generic:
-- $path_data/mods/
-- $path_userdata/usermods/
-- $mapdir/worldmods/
--
-- On a run-in-place version (eg. the distributed windows version):
-- minetest-0.4.x/data/mods/
-- minetest-0.4.x/usermods/
-- minetest-0.4.x/world/worldmods/
--
-- On an installed version on linux:
-- /usr/share/minetest/mods/
-- ~/.minetest/usermods
-- ~/.minetest/world/worldmods
--
-- Naming convention for registered textual names
-- ----------------------------------------------
-- "modname:<whatever>" (<whatever> can have characters a-zA-Z0-9_)
--
-- This is to prevent conflicting names from corrupting maps and is
-- enforced by the mod loader.
--
-- Example: mod "experimental", ideal item/node/entity name "tnt":
--          -> the name should be "experimental:tnt".
--
-- Enforcement can be overridden by prefixing the name with ":". This can
-- be used for overriding the registrations of some other mod.
--
-- Example: Any mod can redefine experimental:tnt by using the name
--          ":experimental:tnt" when registering it.
-- (also that mods is required to have "experimental" as a dependency)
--
-- The legacy mod uses ":" for maintaining backwards compatibility.
--
-- Textures
-- --------
-- Mods should generally prefix their textures with modname_, eg. given
-- the mod name "foomod", a texture could be called "default_foomod_superfurnace.png"
--
-- This is not crucial and a conflicting name will not corrupt maps.
--
-- Representations of simple things
-- --------------------------------
--
-- MapNode representation:
-- {name="name", param1=num, param2=num}
--
-- param1 and param2 are 8 bit and 4 bit integers, respectively. They
-- are reserved for certain automated functions. If you don't use these
-- functions, you can use them to store arbitrary values.
--
-- param1 is reserved for the engine when:
--   paramtype != "none"
-- param2 is reserved for the engine when any of these are used:
--   liquidtype == "flowing"
--   drawtype == "flowingliquid"
--   drawtype == "torchlike"
--   drawtype == "signlike"
--
-- Position representation:
-- {x=num, y=num, z=num}
--
-- stackstring/itemstring: A stack of items in serialized format.
-- eg. 'node "default:dirt" 5'
-- eg. 'tool "default:pick_wood" 21323'
-- eg. 'craft "default:apple" 2'
--
-- item: A stack of items in Lua table format.
-- eg. {name="default:dirt", count=1, wear=0, metadata=""} 
--     ^ a single dirt node
-- eg. {name="default:pick_wood", count=1, wear=21323, metadata=""}
--     ^ a wooden pick about 1/3 weared out
-- eg. {name="default:apple", count=1, wear=0, metadata=""}
--     ^ an apple.
--
-- Any time an item must be passed to a function, it can be an
-- ItemStack (see below), an itemstring or a table in the above format.
--
-- Global functions:
-- minetest.register_entity(name, prototype table)
-- minetest.register_abm(abm definition)
-- minetest.register_node(name, node definition)
-- minetest.register_tool(name, item definition)
-- minetest.register_craftitem(name, item definition)
-- minetest.register_alias(name, convert_to)
-- minetest.register_craft(recipe)
-- minetest.register_globalstep(func(dtime))
-- minetest.register_on_placenode(func(pos, newnode, placer))
-- minetest.register_on_dignode(func(pos, oldnode, digger))
-- minetest.register_on_punchnode(func(pos, node, puncher))
-- minetest.register_on_generated(func(minp, maxp))
-- minetest.register_on_newplayer(func(ObjectRef))
-- minetest.register_on_dieplayer(func(ObjectRef))
-- minetest.register_on_respawnplayer(func(ObjectRef))
-- ^ return true in func to disable regular player placement
-- ^ currently called _before_ repositioning of player occurs
-- minetest.register_on_chat_message(func(name, message))
-- minetest.add_to_creative_inventory(itemstring)
-- minetest.setting_get(name) -> string or nil
-- minetest.setting_getbool(name) -> boolean value or nil
-- minetest.chat_send_all(text)
-- minetest.chat_send_player(name, text)
-- minetest.get_player_privs(name) -> set of privs
-- minetest.get_inventory(location) -> InvRef
-- ^ location = eg. {type="player", name="celeron55"}
--                  {type="node", pos={x=, y=, z=}}
-- minetest.get_current_modname() -> string
-- minetest.get_modpath(modname) -> eg. "/home/user/.minetest/usermods/modname"
-- ^ Useful for loading additional .lua modules or static data from mod
-- minetest.get_worldpath(modname) -> eg. "/home/user/.minetest/world"
-- ^ Useful for storing custom data
--
-- minetest.debug(line)
-- ^ Goes to dstream
-- minetest.log(line)
-- minetest.log(loglevel, line)
-- ^ loglevel one of "error", "action", "info", "verbose"
--
-- minetest.digprop_constanttime(time)
-- minetest.digprop_stonelike(toughness)
-- minetest.digprop_dirtlike(toughness)
-- minetest.digprop_gravellike(toughness)
-- minetest.digprop_woodlike(toughness)
-- minetest.digprop_leaveslike(toughness)
-- minetest.digprop_glasslike(toughness)
--
-- Global objects:
-- minetest.env - environment reference
--
-- Global tables:
-- minetest.registered_items
-- ^ List of registered items, indexed by name
-- minetest.registered_nodes
-- ^ List of registered node definitions, indexed by name
-- minetest.registered_craftitems
-- ^ List of registered craft item definitions, indexed by name
-- minetest.registered_tools
-- ^ List of registered tool definitions, indexed by name
-- minetest.registered_entities
-- ^ List of registered entity prototypes, indexed by name
-- minetest.object_refs
-- ^ List of object references, indexed by active object id
-- minetest.luaentities
-- ^ List of lua entities, indexed by active object id
--
-- EnvRef is basically ServerEnvironment and ServerMap combined.
-- EnvRef methods:
-- - add_node(pos, node)
-- - remove_node(pos)
-- - get_node(pos)
--   ^ Returns {name="ignore", ...} for unloaded area
-- - get_node_or_nil(pos)
--   ^ Returns nil for unloaded area
-- - get_node_light(pos, timeofday) -> 0...15 or nil
--   ^ timeofday: nil = current time, 0 = night, 0.5 = day
-- - add_entity(pos, name): Returns ObjectRef or nil if failed
-- - add_item(pos, itemstring)
-- - add_rat(pos)
-- - add_firefly(pos)
-- - get_meta(pos) -- Get a NodeMetaRef at that position
-- - get_player_by_name(name) -- Get an ObjectRef to a player
-- - get_objects_inside_radius(pos, radius)
-- - set_timeofday(val): val: 0...1; 0 = midnight, 0.5 = midday
-- - get_timeofday()
--
-- NodeMetaRef (this stuff is subject to change in a future version)
-- - get_type()
-- - allows_text_input()
-- - set_text(text) -- eg. set the text of a sign
-- - get_text()
-- - get_owner()
-- - set_owner(string)
-- Generic node metadata specific:
-- - set_infotext(infotext)
-- - get_inventory() -> InvRef
-- - set_inventory_draw_spec(string)
-- - set_allow_text_input(bool)
-- - set_allow_removal(bool)
-- - set_enforce_owner(bool)
-- - is_inventory_modified()
-- - reset_inventory_modified()
-- - is_text_modified()
-- - reset_text_modified()
-- - set_string(name, value)
-- - get_string(name)
--
-- ObjectRef is basically ServerActiveObject.
-- ObjectRef methods:
-- - remove(): remove object (after returning from Lua)
-- - getpos() -> {x=num, y=num, z=num}
-- - setpos(pos); pos={x=num, y=num, z=num}
-- - moveto(pos, continuous=false): interpolated move
-- - punch(puncher, time_from_last_punch, tool_capabilities, direction)
--   ^ puncher = an another ObjectRef,
--   ^ time_from_last_punch = time since last punch action of the puncher
-- - right_click(clicker); clicker = an another ObjectRef
-- - get_hp(): returns number of hitpoints (2 * number of hearts)
-- - set_hp(hp): set number of hitpoints (2 * number of hearts)
-- - get_inventory() -> InvRef
-- - get_wield_list(): returns the name of the inventory list the wielded item is in
-- - get_wield_index(): returns the index of the wielded item
-- - get_wielded_item() -> ItemStack
-- - set_wielded_item(item): replaces the wielded item, returns true if successful
-- LuaEntitySAO-only: (no-op for other objects)
-- - setvelocity({x=num, y=num, z=num})
-- - getvelocity() -> {x=num, y=num, z=num}
-- - setacceleration({x=num, y=num, z=num})
-- - getacceleration() -> {x=num, y=num, z=num}
-- - setyaw(radians)
-- - getyaw() -> radians
-- - settexturemod(mod)
-- - setsprite(p={x=0,y=0}, num_frames=1, framelength=0.2,
-- -           select_horiz_by_yawpitch=false)
-- - ^ Select sprite from spritesheet with optional animation and DM-style
-- -   texture selection based on yaw relative to camera
-- - set_armor_groups({group1=rating, group2=rating, ...})
-- - get_entity_name() (DEPRECATED: Will be removed in a future version)
-- - get_luaentity()
-- Player-only: (no-op for other objects)
-- - get_player_name(): will return nil if is not a player
-- - get_look_dir(): get camera direction as a unit vector
-- - get_look_pitch(): pitch in radians
-- - get_look_yaw(): yaw in radians (wraps around pretty randomly as of now)
--
-- InvRef methods:
-- - get_size(listname): get size of a list
-- - set_size(listname, size): set size of a list
-- - get_stack(listname, i): get a copy of stack index i in list
-- - set_stack(listname, i, stack): copy stack to index i in list
-- - get_list(listname): return full list
-- - set_list(listname, list): set full list (size will not change)
-- - add_item(listname, stack): add item somewhere in list, returns leftover ItemStack
-- - room_for_item(listname, stack): returns true if the stack of items
--     can be fully added to the list
-- - contains_item(listname, stack): returns true if the stack of items
--     can be fully taken from the list
--   remove_item(listname, stack): take as many items as specified from the list,
--     returns the items that were actually removed (as an ItemStack)
--
-- ItemStack methods:
-- - is_empty(): return true if stack is empty
-- - get_name(): returns item name (e.g. "default:stone")
-- - get_count(): returns number of items on the stack
-- - get_wear(): returns tool wear (0-65535), 0 for non-tools
-- - get_metadata(): returns metadata (a string attached to an item stack)
-- - clear(): removes all items from the stack, making it empty
-- - replace(item): replace the contents of this stack (item can also
--     be an itemstring or table)
-- - to_string(): returns the stack in itemstring form
-- - to_table(): returns the stack in Lua table form
-- - get_stack_max(): returns the maximum size of the stack (depends on the item)
-- - get_free_space(): returns get_stack_max() - get_count()
-- - is_known(): returns true if the item name refers to a defined item type
-- - get_definition(): returns the item definition table
-- - get_tool_capabilities(): returns the digging properties of the item,
--   ^ or those of the hand if none are defined for this item type
-- - add_wear(amount): increases wear by amount if the item is a tool
-- - add_item(item): put some item or stack onto this stack,
--   ^ returns leftover ItemStack
-- - item_fits(item): returns true if item or stack can be fully added to this one
-- - take_item(n): take (and remove) up to n items from this stack
--   ^ returns taken ItemStack
--   ^ if n is omitted, n=1 is used
-- - peek_item(n): copy (don't remove) up to n items from this stack
--   ^ returns copied ItemStack
--   ^ if n is omitted, n=1 is used
--
-- Registered entities:
-- - Functions receive a "luaentity" as self:
--   - It has the member .name, which is the registered name ("mod:thing")
--   - It has the member .object, which is an ObjectRef pointing to the object
--   - The original prototype stuff is visible directly via a metatable
-- - Callbacks:
--   - on_activate(self, staticdata)
--   - on_step(self, dtime)
--   - on_punch(self, hitter)
--   - on_rightclick(self, clicker)
--   - get_staticdata(self)
--     ^ return string that will be passed to on_activate when the object
--       is created next time
--
-- Entity prototype table:
-- {
--     physical = true,
--     collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
--     visual = "cube"/"sprite",
--     visual_size = {x=1, y=1},
--     textures = {texture,texture,texture,texture,texture,texture},
--     spritediv = {x=1, y=1},
--     initial_sprite_basepos = {x=0, y=0},
--     on_activate = function(self, staticdata),
--     on_step = function(self, dtime),
--     on_punch = function(self, hitter),
--     on_rightclick = function(self, clicker),
--     get_staticdata = function(self),
--     # Also you can define arbitrary member variables here
--     myvariable = whatever,
-- }
--
-- Item definition options (register_node, register_craftitem, register_tool)
-- {
--     description = "Steel Axe",
--     groups = {}, -- key=name, value=rating; rating=1..3.
--                     if rating not applicable, use 1.
--                     eg. {wool=1, fluffy=3}
--                         {soil=2, outerspace=1, crumbly=1}
--                         {bendy=2, snappy=1},
--                         {hard=1, metal=1, spikes=1}
--     inventory_image = "default_tool_steelaxe.png",
--     wield_image = "",
--     wield_scale = {x=1,y=1,z=1},
--     stack_max = 99,
--     liquids_pointable = false,
--     tool_capabilities = {
--         full_punch_interval = 1.0,
--         max_drop_level=0,
--         groupcaps={
--             -- For example:
--             fleshy={times={[2]=0.80, [3]=0.40}, maxwear=0.05, maxlevel=1},
--             snappy={times={[2]=0.80, [3]=0.40}, maxwear=0.05, maxlevel=1},
--             choppy={times={[3]=0.90}, maxwear=0.05, maxlevel=0}
--         }
--     }
--     on_drop = func(item, dropper, pos),
--     on_place = func(item, placer, pointed_thing),
--     on_use = func(item, user, pointed_thing),
-- }
--
-- Node definition options (register_node):
-- {
--     <all fields allowed in item definitions>,
--     drawtype = "normal",
--     visual_scale = 1.0,
--     tile_images = {"default_unknown_block.png"},
--     special_materials = {
--         {image="", backface_culling=true},
--         {image="", backface_culling=true},
--     },
--     alpha = 255,
--     post_effect_color = {a=0, r=0, g=0, b=0},
--     paramtype = "none",
--     paramtype2 = "none",
--     is_ground_content = false,
--     sunlight_propagates = false,
--     walkable = true,
--     pointable = true,
--     diggable = true,
--     climbable = false,
--     buildable_to = false,
--     drop = "",
--     -- alternatively drop = { max_items = ..., items = { ... } }
--     metadata_name = "",
--     liquidtype = "none",
--     liquid_alternative_flowing = "",
--     liquid_alternative_source = "",
--     liquid_viscosity = 0,
--     light_source = 0,
--     damage_per_second = 0,
--     selection_box = {type="regular"},
--     legacy_facedir_simple = false, -- Support maps made in and before January 2012
--     legacy_wallmounted = false, -- Support maps made in and before January 2012
-- }
--
-- Recipe:
-- {
--     output = 'default:pick_stone',
--     recipe = {
--         {'default:cobble', 'default:cobble', 'default:cobble'},
--         {'', 'default:stick', ''},
--         {'', 'default:stick', ''},
--     },
--     replacements = <optional list of item pairs,
--                     replace one input item with another item on crafting>
-- }
--
-- Recipe (shapeless):
-- {
--     type = "shapeless",
--     output = 'mushrooms:mushroom_stew',
--     recipe = {
--         "mushrooms:bowl",
--         "mushrooms:mushroom_brown",
--         "mushrooms:mushroom_red",
--     },
--     replacements = <optional list of item pairs,
--                     replace one input item with another item on crafting>
-- }
--
-- Recipe (tool repair):
-- {
--     type = "toolrepair",
--     additional_wear = -0.02,
-- }
--
-- Recipe (cooking):
-- {
--     type = "cooking",
--     output = "default:glass",
--     recipe = "default:sand",
--     cooktime = 3,
-- }
--
-- Recipe (furnace fuel):
-- {
--     type = "fuel",
--     recipe = "default:leaves",
--     burntime = 1,
-- }
--
-- ABM (ActiveBlockModifier) definition:
-- {
--     nodenames = {"default:lava_source"},
--     neighbors = {"default:water_source", "default:water_flowing"}, -- (any of these)
--      ^ If left out or empty, any neighbor will do
--      ^ This might get removed in the future
--     interval = 1.0, -- (operation interval)
--     chance = 1, -- (chance of trigger is 1.0/this)
--     action = func(pos, node, active_object_count, active_object_count_wider),
-- }
--
-- Item groups:
-- - Groups always have a rating associated with them. If there is no
--   useful meaning for a rating for a given group, it shall be 1.
-- - When not defined, the rating of a group defaults to 0.
--
-- Special groups:
-- - dig_immediate:
--   - 2: node is removed without tool wear after 1 second or so
--   - 3: node is removed without tool wear immediately (like a torch)
-- - level: Can be used to give an additional sense of progression in the game.
--   - 0 is something that is directly accessible at the start of gameplay

WATER_ALPHA = 160
WATER_VISC = 1
LAVA_VISC = 7
LIGHT_MAX = 14

-- Definitions made by this mod that other mods can use too
default = {}

--
-- Tool definition
--

-- The hand
minetest.register_item(":", {
	type = "none",
	wield_image = "wieldhand.png",
	wield_scale = {x=1,y=1,z=2.5},
	tool_capabilities = {
		full_punch_interval = 1.0,
		max_drop_level = 0,
		groupcaps = {
			fleshy = {times={[2]=2.00, [3]=1.00}, maxwear=0, maxlevel=1},
			crumbly = {times={[3]=0.70}, maxwear=0, maxlevel=1},
			snappy = {times={[3]=0.70}, maxwear=0, maxlevel=1},
		}
	}
})

minetest.register_tool("default:pick_wood", {
	description = "Wooden Pickaxe",
	inventory_image = "default_tool_woodpick.png",
	tool_capabilities = {
		max_drop_level=0,
		groupcaps={
			cracky={times={[2]=1.50, [3]=0.80}, maxwear=0.1, maxlevel=1}
		}
	},
})
minetest.register_tool("default:pick_stone", {
	description = "Stone Pickaxe",
	inventory_image = "default_tool_stonepick.png",
	tool_capabilities = {
		max_drop_level=0,
		groupcaps={
			cracky={times={[1]=1.50, [2]=0.80, [3]=0.60}, maxwear=0.05, maxlevel=1}
		}
	},
})
minetest.register_tool("default:pick_steel", {
	description = "Steel Pickaxe",
	inventory_image = "default_tool_steelpick.png",
	tool_capabilities = {
		max_drop_level=1,
		groupcaps={
			cracky={times={[1]=1.00, [2]=0.60, [3]=0.40}, maxwear=0.1, maxlevel=2}
		}
	},
})
minetest.register_tool("default:pick_mese", {
	description = "Mese Pickaxe",
	inventory_image = "default_tool_mesepick.png",
	tool_capabilities = {
		max_drop_level=3,
		groupcaps={
			cracky={times={[1]=0.2, [2]=0.2, [3]=0.2}, maxwear=0.05, maxlevel=3},
			crumbly={times={[1]=0.2, [2]=0.2, [3]=0.2}, maxwear=0.05, maxlevel=3},
			snappy={times={[1]=0.2, [2]=0.2, [3]=0.2}, maxwear=0.05, maxlevel=3}
		}
	},
})
minetest.register_tool("default:shovel_wood", {
	description = "Wooden Shovel",
	inventory_image = "default_tool_woodshovel.png",
	tool_capabilities = {
		max_drop_level=0,
		groupcaps={
			crumbly={times={[1]=1.50, [2]=0.80, [3]=0.50}, maxwear=0.1, maxlevel=1}
		}
	},
})
minetest.register_tool("default:shovel_stone", {
	description = "Stone Shovel",
	inventory_image = "default_tool_stoneshovel.png",
	tool_capabilities = {
		max_drop_level=0,
		groupcaps={
			crumbly={times={[1]=0.80, [2]=0.50, [3]=0.30}, maxwear=0.05, maxlevel=1}
		}
	},
})
minetest.register_tool("default:shovel_steel", {
	description = "Steel Shovel",
	inventory_image = "default_tool_steelshovel.png",
	tool_capabilities = {
		max_drop_level=1,
		groupcaps={
			crumbly={times={[1]=0.50, [2]=0.35, [3]=0.30}, maxwear=0.1, maxlevel=2}
		}
	},
})
minetest.register_tool("default:axe_wood", {
	description = "Wooden Axe",
	inventory_image = "default_tool_woodaxe.png",
	tool_capabilities = {
		max_drop_level=0,
		groupcaps={
			choppy={times={[2]=1.50, [3]=0.80}, maxwear=0.1, maxlevel=1},
			fleshy={times={[2]=1.50, [3]=0.80}, maxwear=0.1, maxlevel=1}
		}
	},
})
minetest.register_tool("default:axe_stone", {
	description = "Stone Axe",
	inventory_image = "default_tool_stoneaxe.png",
	tool_capabilities = {
		max_drop_level=0,
		groupcaps={
			choppy={times={[1]=1.50, [2]=1.00, [3]=0.60}, maxwear=0.05, maxlevel=1},
			fleshy={times={[2]=1.30, [3]=0.70}, maxwear=0.05, maxlevel=1}
		}
	},
})
minetest.register_tool("default:axe_steel", {
	description = "Steel Axe",
	inventory_image = "default_tool_steelaxe.png",
	tool_capabilities = {
		max_drop_level=1,
		groupcaps={
			choppy={times={[1]=1.00, [2]=0.80, [3]=0.50}, maxwear=0.1, maxlevel=2},
			fleshy={times={[2]=1.10, [3]=0.60}, maxwear=0.03, maxlevel=1}
		}
	},
})
minetest.register_tool("default:sword_wood", {
	description = "Wooden Sword",
	inventory_image = "default_tool_woodsword.png",
	tool_capabilities = {
		full_punch_interval = 1.0,
		max_drop_level=0,
		groupcaps={
			fleshy={times={[2]=1.10, [3]=0.60}, maxwear=0.1, maxlevel=1},
			snappy={times={[2]=1.00, [3]=0.50}, maxwear=0.1, maxlevel=1},
			choppy={times={[3]=1.00}, maxwear=0.05, maxlevel=0}
		}
	}
})
minetest.register_tool("default:sword_stone", {
	description = "Stone Sword",
	inventory_image = "default_tool_stonesword.png",
	tool_capabilities = {
		full_punch_interval = 1.0,
		max_drop_level=0,
		groupcaps={
			fleshy={times={[2]=0.80, [3]=0.40}, maxwear=0.05, maxlevel=1},
			snappy={times={[2]=0.80, [3]=0.40}, maxwear=0.05, maxlevel=1},
			choppy={times={[3]=0.90}, maxwear=0.05, maxlevel=0}
		}
	}
})
minetest.register_tool("default:sword_steel", {
	description = "Steel Sword",
	inventory_image = "default_tool_steelsword.png",
	tool_capabilities = {
		full_punch_interval = 1.0,
		max_drop_level=1,
		groupcaps={
			fleshy={times={[1]=1.00, [2]=0.40, [3]=0.20}, maxwear=0.1, maxlevel=2},
			snappy={times={[2]=0.70, [3]=0.30}, maxwear=0.03, maxlevel=1},
			choppy={times={[3]=0.70}, maxwear=0.03, maxlevel=0}
		}
	}
})

--
-- Crafting definition
--

minetest.register_craft({
	output = 'default:wood 4',
	recipe = {
		{'default:tree'},
	}
})

minetest.register_craft({
	output = 'default:stick 4',
	recipe = {
		{'default:wood'},
	}
})

minetest.register_craft({
	output = 'default:fence_wood 2',
	recipe = {
		{'default:stick', 'default:stick', 'default:stick'},
		{'default:stick', 'default:stick', 'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:sign_wall',
	recipe = {
		{'default:wood', 'default:wood', 'default:wood'},
		{'default:wood', 'default:wood', 'default:wood'},
		{'', 'default:stick', ''},
	}
})

minetest.register_craft({
	output = 'default:torch 4',
	recipe = {
		{'default:coal_lump'},
		{'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:pick_wood',
	recipe = {
		{'default:wood', 'default:wood', 'default:wood'},
		{'', 'default:stick', ''},
		{'', 'default:stick', ''},
	}
})

minetest.register_craft({
	output = 'default:pick_stone',
	recipe = {
		{'default:cobble', 'default:cobble', 'default:cobble'},
		{'', 'default:stick', ''},
		{'', 'default:stick', ''},
	}
})

minetest.register_craft({
	output = 'default:pick_steel',
	recipe = {
		{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
		{'', 'default:stick', ''},
		{'', 'default:stick', ''},
	}
})

minetest.register_craft({
	output = 'default:pick_mese',
	recipe = {
		{'default:mese', 'default:mese', 'default:mese'},
		{'', 'default:stick', ''},
		{'', 'default:stick', ''},
	}
})

minetest.register_craft({
	output = 'default:shovel_wood',
	recipe = {
		{'default:wood'},
		{'default:stick'},
		{'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:shovel_stone',
	recipe = {
		{'default:cobble'},
		{'default:stick'},
		{'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:shovel_steel',
	recipe = {
		{'default:steel_ingot'},
		{'default:stick'},
		{'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:axe_wood',
	recipe = {
		{'default:wood', 'default:wood'},
		{'default:wood', 'default:stick'},
		{'', 'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:axe_stone',
	recipe = {
		{'default:cobble', 'default:cobble'},
		{'default:cobble', 'default:stick'},
		{'', 'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:axe_steel',
	recipe = {
		{'default:steel_ingot', 'default:steel_ingot'},
		{'default:steel_ingot', 'default:stick'},
		{'', 'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:sword_wood',
	recipe = {
		{'default:wood'},
		{'default:wood'},
		{'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:sword_stone',
	recipe = {
		{'default:cobble'},
		{'default:cobble'},
		{'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:sword_steel',
	recipe = {
		{'default:steel_ingot'},
		{'default:steel_ingot'},
		{'default:stick'},
	}
})

minetest.register_craft({
	output = 'default:rail 15',
	recipe = {
		{'default:steel_ingot', '', 'default:steel_ingot'},
		{'default:steel_ingot', 'default:stick', 'default:steel_ingot'},
		{'default:steel_ingot', '', 'default:steel_ingot'},
	}
})

minetest.register_craft({
	output = 'default:chest',
	recipe = {
		{'default:wood', 'default:wood', 'default:wood'},
		{'default:wood', '', 'default:wood'},
		{'default:wood', 'default:wood', 'default:wood'},
	}
})

minetest.register_craft({
	output = 'default:chest_locked',
	recipe = {
		{'default:wood', 'default:wood', 'default:wood'},
		{'default:wood', 'default:steel_ingot', 'default:wood'},
		{'default:wood', 'default:wood', 'default:wood'},
	}
})

minetest.register_craft({
	output = 'default:furnace',
	recipe = {
		{'default:cobble', 'default:cobble', 'default:cobble'},
		{'default:cobble', '', 'default:cobble'},
		{'default:cobble', 'default:cobble', 'default:cobble'},
	}
})

minetest.register_craft({
	output = 'default:steelblock',
	recipe = {
		{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
		{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
		{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
	}
})

minetest.register_craft({
	output = 'default:sandstone',
	recipe = {
		{'default:sand', 'default:sand'},
		{'default:sand', 'default:sand'},
	}
})

minetest.register_craft({
	output = 'default:clay',
	recipe = {
		{'default:clay_lump', 'default:clay_lump'},
		{'default:clay_lump', 'default:clay_lump'},
	}
})

minetest.register_craft({
	output = 'default:brick',
	recipe = {
		{'default:clay_brick', 'default:clay_brick'},
		{'default:clay_brick', 'default:clay_brick'},
	}
})

minetest.register_craft({
	output = 'default:paper',
	recipe = {
		{'default:papyrus', 'default:papyrus', 'default:papyrus'},
	}
})

minetest.register_craft({
	output = 'default:book',
	recipe = {
		{'default:paper'},
		{'default:paper'},
		{'default:paper'},
	}
})

minetest.register_craft({
	output = 'default:bookshelf',
	recipe = {
		{'default:wood', 'default:wood', 'default:wood'},
		{'default:book', 'default:book', 'default:book'},
		{'default:wood', 'default:wood', 'default:wood'},
	}
})

minetest.register_craft({
	output = 'default:ladder',
	recipe = {
		{'default:stick', '', 'default:stick'},
		{'default:stick', 'default:stick', 'default:stick'},
		{'default:stick', '', 'default:stick'},
	}
})

--
-- Crafting (tool repair)
--
minetest.register_craft({
	type = "toolrepair",
	additional_wear = -0.02,
})

--
-- Cooking recipes
--

minetest.register_craft({
	type = "cooking",
	output = "default:glass",
	recipe = "default:sand",
})

minetest.register_craft({
	type = "cooking",
	output = "default:coal_lump",
	recipe = "default:tree",
})

minetest.register_craft({
	type = "cooking",
	output = "default:coal_lump",
	recipe = "default:jungletree",
})

minetest.register_craft({
	type = "cooking",
	output = "default:stone",
	recipe = "default:cobble",
})

minetest.register_craft({
	type = "cooking",
	output = "default:steel_ingot",
	recipe = "default:iron_lump",
})

minetest.register_craft({
	type = "cooking",
	output = "default:clay_brick",
	recipe = "default:clay_lump",
})

--
-- Fuels
--

minetest.register_craft({
	type = "fuel",
	recipe = "default:tree",
	burntime = 30,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:jungletree",
	burntime = 30,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:junglegrass",
	burntime = 2,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:leaves",
	burntime = 1,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:cactus",
	burntime = 15,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:papyrus",
	burntime = 1,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:bookshelf",
	burntime = 30,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:fence_wood",
	burntime = 15,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:ladder",
	burntime = 5,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:wood",
	burntime = 7,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:mese",
	burntime = 30,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:lava_source",
	burntime = 60,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:torch",
	burntime = 4,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:sign_wall",
	burntime = 10,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:chest",
	burntime = 30,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:chest_locked",
	burntime = 30,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:nyancat",
	burntime = 1,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:nyancat_rainbow",
	burntime = 1,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:sapling",
	burntime = 10,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:apple",
	burntime = 3,
})

minetest.register_craft({
	type = "fuel",
	recipe = "default:coal_lump",
	burntime = 40,
})

--
-- Node definitions
--

minetest.register_node("default:stone", {
	description = "Stone",
	tile_images = {"default_stone.png"},
	is_ground_content = true,
	groups = {cracky=3},
	drop = 'default:cobble',
	legacy_mineral = true,
})

minetest.register_node("default:stone_with_coal", {
	description = "Stone with coal",
	tile_images = {"default_stone.png^default_mineral_coal.png"},
	is_ground_content = true,
	groups = {cracky=3},
	drop = 'default:coal_lump',
})

minetest.register_node("default:stone_with_iron", {
	description = "Stone with iron",
	tile_images = {"default_stone.png^default_mineral_iron.png"},
	is_ground_content = true,
	groups = {cracky=3},
	drop = 'default:iron_lump',
})

minetest.register_node("default:dirt_with_grass", {
	description = "Dirt with grass",
	tile_images = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
	is_ground_content = true,
	groups = {crumbly=3},
	drop = 'default:dirt',
})

minetest.register_node("default:dirt_with_grass_footsteps", {
	description = "Dirt with grass and footsteps",
	tile_images = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
	is_ground_content = true,
	groups = {crumbly=3},
	drop = 'default:dirt',
})

minetest.register_node("default:dirt", {
	description = "Dirt",
	tile_images = {"default_dirt.png"},
	is_ground_content = true,
	groups = {crumbly=3},
})

minetest.register_node("default:sand", {
	description = "Sand",
	tile_images = {"default_sand.png"},
	is_ground_content = true,
	groups = {crumbly=3},
})

minetest.register_node("default:gravel", {
	description = "Gravel",
	tile_images = {"default_gravel.png"},
	is_ground_content = true,
	groups = {crumbly=2},
})

minetest.register_node("default:sandstone", {
	description = "Sandstone",
	tile_images = {"default_sandstone.png"},
	is_ground_content = true,
	groups = {crumbly=2,cracky=2},
	drop = 'default:sand',
})

minetest.register_node("default:clay", {
	description = "Clay",
	tile_images = {"default_clay.png"},
	is_ground_content = true,
	groups = {crumbly=3},
	drop = 'default:clay_lump 4',
})

minetest.register_node("default:brick", {
	description = "Brick",
	tile_images = {"default_brick.png"},
	is_ground_content = true,
	groups = {cracky=3},
	drop = 'default:clay_brick 4',
})

minetest.register_node("default:tree", {
	description = "Tree",
	tile_images = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
	is_ground_content = true,
	groups = {snappy=2,choppy=2},
})

minetest.register_node("default:jungletree", {
	description = "Jungle Tree",
	tile_images = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"},
	is_ground_content = true,
	groups = {snappy=2,choppy=2},
})

minetest.register_node("default:junglegrass", {
	description = "Jungle Grass",
	drawtype = "plantlike",
	visual_scale = 1.3,
	tile_images = {"default_junglegrass.png"},
	inventory_image = "default_junglegrass.png",
	wield_image = "default_junglegrass.png",
	paramtype = "light",
	walkable = false,
	groups = {snappy=3},
})

minetest.register_node("default:leaves", {
	description = "Leaves",
	drawtype = "allfaces_optional",
	visual_scale = 1.3,
	tile_images = {"default_leaves.png"},
	paramtype = "light",
	groups = {snappy=3},
	drop = {
		max_items = 1,
		items = {
			{
				-- player will get sapling with 1/20 chance
				items = {'default:sapling'},
				rarity = 20,
			},
			{
				-- player will get leaves only if he get no saplings,
				-- this is because max_items is 1
				items = {'default:leaves'},
			}
		}
	},
})

minetest.register_node("default:cactus", {
	description = "Cactus",
	tile_images = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
	is_ground_content = true,
	groups = {snappy=2,choppy=3},
})

minetest.register_node("default:papyrus", {
	description = "Papyrus",
	drawtype = "plantlike",
	tile_images = {"default_papyrus.png"},
	inventory_image = "default_papyrus.png",
	wield_image = "default_papyrus.png",
	paramtype = "light",
	is_ground_content = true,
	walkable = false,
	groups = {snappy=3},
})

minetest.register_node("default:bookshelf", {
	description = "Bookshelf",
	tile_images = {"default_wood.png", "default_wood.png", "default_bookshelf.png"},
	is_ground_content = true,
	groups = {snappy=2,choppy=3},
})

minetest.register_node("default:glass", {
	description = "Glass",
	drawtype = "glasslike",
	tile_images = {"default_glass.png"},
	inventory_image = minetest.inventorycube("default_glass.png"),
	paramtype = "light",
	sunlight_propagates = true,
	is_ground_content = true,
	groups = {snappy=2,cracky=3},
})

minetest.register_node("default:fence_wood", {
	description = "Wooden Fence",
	drawtype = "fencelike",
	tile_images = {"default_wood.png"},
	inventory_image = "default_fence.png",
	wield_image = "default_fence.png",
	paramtype = "light",
	is_ground_content = true,
	selection_box = {
		type = "fixed",
		fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
	},
	groups = {snappy=2,choppy=2},
})

minetest.register_node("default:rail", {
	description = "Rail",
	drawtype = "raillike",
	tile_images = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
	inventory_image = "default_rail.png",
	wield_image = "default_rail.png",
	paramtype = "light",
	is_ground_content = true,
	walkable = false,
	selection_box = {
		type = "fixed",
		--fixed = <default>
	},
	groups = {bendy=2,snappy=1,dig_immediate=2},
})

minetest.register_node("default:ladder", {
	description = "Ladder",
	drawtype = "signlike",
	tile_images = {"default_ladder.png"},
	inventory_image = "default_ladder.png",
	wield_image = "default_ladder.png",
	paramtype = "light",
	paramtype2 = "wallmounted",
	is_ground_content = true,
	walkable = false,
	climbable = true,
	selection_box = {
		type = "wallmounted",
		--wall_top = = <default>
		--wall_bottom = = <default>
		--wall_side = = <default>
	},
	groups = {snappy=2,choppy=2},
	legacy_wallmounted = true,
})

minetest.register_node("default:wood", {
	description = "Wood",
	tile_images = {"default_wood.png"},
	is_ground_content = true,
	groups = {snappy=2,choppy=2},
})

minetest.register_node("default:mese", {
	description = "Mese",
	tile_images = {"default_mese.png"},
	is_ground_content = true,
	groups = {cracky=1},
})

minetest.register_node("default:cloud", {
	description = "Cloud",
	tile_images = {"default_cloud.png"},
	is_ground_content = true,
})

minetest.register_node("default:water_flowing", {
	description = "Water (flowing)",
	inventory_image = minetest.inventorycube("default_water.png"),
	drawtype = "flowingliquid",
	tile_images = {"default_water.png"},
	alpha = WATER_ALPHA,
	paramtype = "light",
	walkable = false,
	pointable = false,
	diggable = false,
	buildable_to = true,
	liquidtype = "flowing",
	liquid_alternative_flowing = "default:water_flowing",
	liquid_alternative_source = "default:water_source",
	liquid_viscosity = WATER_VISC,
	post_effect_color = {a=64, r=100, g=100, b=200},
	special_materials = {
		{image="default_water.png", backface_culling=false},
		{image="default_water.png", backface_culling=true},
	},
	groups = {water=3, liquid=3},
})

minetest.register_node("default:water_source", {
	description = "Water",
	inventory_image = minetest.inventorycube("default_water.png"),
	drawtype = "liquid",
	tile_images = {"default_water.png"},
	alpha = WATER_ALPHA,
	paramtype = "light",
	walkable = false,
	pointable = false,
	diggable = false,
	buildable_to = true,
	liquidtype = "source",
	liquid_alternative_flowing = "default:water_flowing",
	liquid_alternative_source = "default:water_source",
	liquid_viscosity = WATER_VISC,
	post_effect_color = {a=64, r=100, g=100, b=200},
	special_materials = {
		-- New-style water source material (mostly unused)
		{image="default_water.png", backface_culling=false},
	},
	groups = {water=3, liquid=3},
})

minetest.register_node("default:lava_flowing", {
	description = "Lava (flowing)",
	inventory_image = minetest.inventorycube("default_lava.png"),
	drawtype = "flowingliquid",
	tile_images = {"default_lava.png"},
	paramtype = "light",
	light_source = LIGHT_MAX - 1,
	walkable = false,
	pointable = false,
	diggable = false,
	buildable_to = true,
	liquidtype = "flowing",
	liquid_alternative_flowing = "default:lava_flowing",
	liquid_alternative_source = "default:lava_source",
	liquid_viscosity = LAVA_VISC,
	damage_per_second = 4*2,
	post_effect_color = {a=192, r=255, g=64, b=0},
	special_materials = {
		{image="default_lava.png", backface_culling=false},
		{image="default_lava.png", backface_culling=true},
	},
	groups = {lava=3, liquid=2, hot=3},
})

minetest.register_node("default:lava_source", {
	description = "Lava",
	inventory_image = minetest.inventorycube("default_lava.png"),
	drawtype = "liquid",
	tile_images = {"default_lava.png"},
	paramtype = "light",
	light_source = LIGHT_MAX - 1,
	walkable = false,
	pointable = false,
	diggable = false,
	buildable_to = true,
	liquidtype = "source",
	liquid_alternative_flowing = "default:lava_flowing",
	liquid_alternative_source = "default:lava_source",
	liquid_viscosity = LAVA_VISC,
	damage_per_second = 4*2,
	post_effect_color = {a=192, r=255, g=64, b=0},
	special_materials = {
		-- New-style lava source material (mostly unused)
		{image="default_lava.png", backface_culling=false},
	},
	groups = {lava=3, liquid=2, hot=3},
})

minetest.register_node("default:torch", {
	description = "Torch",
	drawtype = "torchlike",
	tile_images = {"default_torch_on_floor.png", "default_torch_on_ceiling.png", "default_torch.png"},
	inventory_image = "default_torch_on_floor.png",
	wield_image = "default_torch_on_floor.png",
	paramtype = "light",
	paramtype2 = "wallmounted",
	sunlight_propagates = true,
	walkable = false,
	light_source = LIGHT_MAX-1,
	selection_box = {
		type = "wallmounted",
		wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1},
		wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
		wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
	},
	groups = {dig_immediate=3},