summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-17 16:53:18 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-17 16:53:18 -0400
commit907e8bf6a64215a516fdf16869dd81248aeaa2f6 (patch)
treed199282e5764c7ab5183fe0d78ed0412dbb0b89f
parent06d9243586cecb1abed74550ce2544b436572a35 (diff)
downloaddreambuilder_modpack-907e8bf6a64215a516fdf16869dd81248aeaa2f6.tar
dreambuilder_modpack-907e8bf6a64215a516fdf16869dd81248aeaa2f6.tar.gz
dreambuilder_modpack-907e8bf6a64215a516fdf16869dd81248aeaa2f6.tar.bz2
dreambuilder_modpack-907e8bf6a64215a516fdf16869dd81248aeaa2f6.tar.xz
dreambuilder_modpack-907e8bf6a64215a516fdf16869dd81248aeaa2f6.zip
update digilines, technic, unified inventory,
and switched castles to the new modpack form
-rw-r--r--anvil/LICENSE675
-rw-r--r--anvil/README.txt3
-rw-r--r--anvil/depends.txt3
-rw-r--r--anvil/description.txt1
-rw-r--r--anvil/init.lua366
-rw-r--r--anvil/intllib.lua45
-rw-r--r--anvil/locale/de.po87
-rw-r--r--anvil/locale/template.pot59
-rw-r--r--anvil/mod.conf1
-rw-r--r--anvil/screenshot.pngbin0 -> 25218 bytes
-rw-r--r--anvil/sounds/anvil_clang.oggbin0 -> 9445 bytes
-rw-r--r--anvil/sounds/license.txt1
-rw-r--r--anvil/textures/anvil_spark.pngbin0 -> 185 bytes
-rw-r--r--anvil/textures/anvil_tool_steelhammer.pngbin0 -> 184 bytes
-rw-r--r--anvil/textures/license.txt2
-rw-r--r--castle_farming/LICENSE21
-rw-r--r--castle_farming/README.txt20
-rw-r--r--castle_farming/depends.txt6
-rw-r--r--castle_farming/description.txt1
-rw-r--r--castle_farming/hides.lua32
-rw-r--r--castle_farming/init.lua4
-rw-r--r--castle_farming/intllib.lua45
-rw-r--r--castle_farming/locale/template.pot30
-rw-r--r--castle_farming/mod.conf1
-rw-r--r--castle_farming/screenshot.pngbin0 -> 51199 bytes
-rw-r--r--castle_farming/straw.lua75
-rw-r--r--castle_farming/textures/LICENSE.txt19
-rw-r--r--castle_farming/textures/castle_hide.pngbin0 -> 618 bytes
-rw-r--r--castle_farming/textures/castle_straw_bale.pngbin0 -> 756 bytes
-rw-r--r--castle_farming/textures/castle_straw_dummy.pngbin0 -> 803 bytes
-rw-r--r--castle_gates/LICENSE21
-rw-r--r--castle_gates/README.txt11
-rw-r--r--castle_gates/api.txt76
-rw-r--r--castle_gates/class_pointset.lua101
-rw-r--r--castle_gates/depends.txt6
-rw-r--r--castle_gates/description.txt1
-rw-r--r--castle_gates/doc.lua52
-rw-r--r--castle_gates/doors.lua62
-rw-r--r--castle_gates/gate_functions.lua389
-rw-r--r--castle_gates/gate_slots.lua138
-rw-r--r--castle_gates/gates.lua243
-rw-r--r--castle_gates/init.lua8
-rw-r--r--castle_gates/intllib.lua45
-rw-r--r--castle_gates/locale/template.pot202
-rw-r--r--castle_gates/mod.conf1
-rw-r--r--castle_gates/screenshot.pngbin0 -> 166238 bytes
-rw-r--r--castle_gates/textures/LICENSE.txt11
-rw-r--r--castle_gates/textures/castle_door_edge_mask.pngbin0 -> 190 bytes
-rw-r--r--castle_gates/textures/castle_door_handle_mask.pngbin0 -> 194 bytes
-rw-r--r--castle_gates/textures/castle_door_jail.pngbin0 -> 878 bytes
-rw-r--r--castle_gates/textures/castle_door_oak.pngbin0 -> 1343 bytes
-rw-r--r--castle_gates/textures/castle_door_side_mask.pngbin0 -> 189 bytes
-rw-r--r--castle_gates/textures/castle_jail_door_inv.pngbin0 -> 186 bytes
-rw-r--r--castle_gates/textures/castle_jailbars.pngbin0 -> 253 bytes
-rw-r--r--castle_gates/textures/castle_oak_door_inv.pngbin0 -> 411 bytes
-rw-r--r--castle_gates/textures/castle_portcullis_mask.pngbin0 -> 194 bytes
-rw-r--r--castle_gates/textures/castle_steel.pngbin0 -> 214 bytes
-rw-r--r--castle_lighting/LICENSE21
-rw-r--r--castle_lighting/README.txt23
-rw-r--r--castle_lighting/brasier.lua267
-rw-r--r--castle_lighting/depends.txt6
-rw-r--r--castle_lighting/description.txt1
-rw-r--r--castle_lighting/init.lua100
-rw-r--r--castle_lighting/intllib.lua45
-rw-r--r--castle_lighting/locale/template.pot52
-rw-r--r--castle_lighting/mod.conf1
-rw-r--r--castle_lighting/screenshot.pngbin0 -> 39320 bytes
-rw-r--r--castle_lighting/textures/LICENSE.txt17
-rw-r--r--castle_lighting/textures/castle_brasier_bed_mask.pngbin0 -> 497 bytes
-rw-r--r--castle_lighting/textures/castle_chandelier.pngbin0 -> 360 bytes
-rw-r--r--castle_lighting/textures/castle_chandelier_chain.pngbin0 -> 169 bytes
-rw-r--r--castle_lighting/textures/castle_chandelier_wield.pngbin0 -> 316 bytes
-rw-r--r--castle_lighting/textures/castle_coal_bed.pngbin0 -> 771 bytes
-rw-r--r--castle_lighting/textures/castle_steel.pngbin0 -> 214 bytes
-rw-r--r--castle_lighting/textures/castle_street_light.pngbin0 -> 465 bytes
-rw-r--r--castle_masonry/LICENSE21
-rw-r--r--castle_masonry/README.txt43
-rw-r--r--castle_masonry/arrow_slits.lua166
-rw-r--r--castle_masonry/depends.txt6
-rw-r--r--castle_masonry/description.txt1
-rw-r--r--castle_masonry/init.lua137
-rw-r--r--castle_masonry/intllib.lua45
-rw-r--r--castle_masonry/locale/template.pot189
-rw-r--r--castle_masonry/mod.conf1
-rw-r--r--castle_masonry/murder_holes.lua91
-rw-r--r--castle_masonry/paving.lua109
-rw-r--r--castle_masonry/pillars.lua314
-rw-r--r--castle_masonry/screenshot.pngbin0 -> 311654 bytes
-rw-r--r--castle_masonry/settingtypes.txt20
-rw-r--r--castle_masonry/stone_wall.lua160
-rw-r--r--castle_masonry/textures/LICENSE.txt21
-rw-r--r--castle_masonry/textures/castle_corner_stonewall1.pngbin0 -> 696 bytes
-rw-r--r--castle_masonry/textures/castle_corner_stonewall2.pngbin0 -> 682 bytes
-rw-r--r--castle_masonry/textures/castle_corner_stonewall_tb.pngbin0 -> 691 bytes
-rw-r--r--castle_masonry/textures/castle_dungeon_stone.pngbin0 -> 543 bytes
-rw-r--r--castle_masonry/textures/castle_pavement_brick.pngbin0 -> 700 bytes
-rw-r--r--castle_masonry/textures/castle_rubble.pngbin0 -> 563 bytes
-rw-r--r--castle_masonry/textures/castle_slate.pngbin0 -> 261 bytes
-rw-r--r--castle_masonry/textures/castle_stonewall.pngbin0 -> 660 bytes
-rw-r--r--castle_shields/LICENSE21
-rw-r--r--castle_shields/README.txt25
-rw-r--r--castle_shields/default_shields.lua18
-rw-r--r--castle_shields/depends.txt3
-rw-r--r--castle_shields/description.txt1
-rw-r--r--castle_shields/init.lua5
-rw-r--r--castle_shields/intllib.lua45
-rw-r--r--castle_shields/locale/template.pot21
-rw-r--r--castle_shields/mod.conf1
-rw-r--r--castle_shields/screenshot.pngbin0 -> 14418 bytes
-rw-r--r--castle_shields/shield_functions.lua39
-rw-r--r--castle_shields/textures/castle_shield_back.pngbin0 -> 620 bytes
-rw-r--r--castle_shields/textures/castle_shield_black.pngbin0 -> 275 bytes
-rw-r--r--castle_shields/textures/castle_shield_blue.pngbin0 -> 379 bytes
-rw-r--r--castle_shields/textures/castle_shield_brown.pngbin0 -> 424 bytes
-rw-r--r--castle_shields/textures/castle_shield_cyan.pngbin0 -> 328 bytes
-rw-r--r--castle_shields/textures/castle_shield_dark_green.pngbin0 -> 371 bytes
-rw-r--r--castle_shields/textures/castle_shield_dark_grey.pngbin0 -> 319 bytes
-rw-r--r--castle_shields/textures/castle_shield_green.pngbin0 -> 388 bytes
-rw-r--r--castle_shields/textures/castle_shield_grey.pngbin0 -> 355 bytes
-rw-r--r--castle_shields/textures/castle_shield_magenta.pngbin0 -> 420 bytes
-rw-r--r--castle_shields/textures/castle_shield_mask_chevron.pngbin0 -> 223 bytes
-rw-r--r--castle_shields/textures/castle_shield_mask_cross.pngbin0 -> 153 bytes
-rw-r--r--castle_shields/textures/castle_shield_mask_slash.pngbin0 -> 183 bytes
-rw-r--r--castle_shields/textures/castle_shield_orange.pngbin0 -> 441 bytes
-rw-r--r--castle_shields/textures/castle_shield_pink.pngbin0 -> 338 bytes
-rw-r--r--castle_shields/textures/castle_shield_red.pngbin0 -> 426 bytes
-rw-r--r--castle_shields/textures/castle_shield_violet.pngbin0 -> 364 bytes
-rw-r--r--castle_shields/textures/castle_shield_white.pngbin0 -> 339 bytes
-rw-r--r--castle_shields/textures/castle_shield_yellow.pngbin0 -> 398 bytes
-rw-r--r--castle_shields/textures/shield.svg143
-rw-r--r--castle_storage/LICENSE21
-rw-r--r--castle_storage/README.txt14
-rw-r--r--castle_storage/crate.lua59
-rw-r--r--castle_storage/depends.txt3
-rw-r--r--castle_storage/description.txt1
-rw-r--r--castle_storage/init.lua3
-rw-r--r--castle_storage/intllib.lua45
-rw-r--r--castle_storage/ironbound_chest.lua143
-rw-r--r--castle_storage/locale/template.pot53
-rw-r--r--castle_storage/screenshot.pngbin0 -> 21461 bytes
-rw-r--r--castle_storage/textures/LICENSE.txt13
-rw-r--r--castle_storage/textures/castle_crate.pngbin0 -> 344 bytes
-rw-r--r--castle_storage/textures/castle_crate_top.pngbin0 -> 395 bytes
-rw-r--r--castle_storage/textures/castle_ironbound_chest_back.pngbin0 -> 522 bytes
-rw-r--r--castle_storage/textures/castle_ironbound_chest_front.pngbin0 -> 537 bytes
-rw-r--r--castle_storage/textures/castle_ironbound_chest_side.pngbin0 -> 374 bytes
-rw-r--r--castle_storage/textures/castle_ironbound_chest_top.pngbin0 -> 522 bytes
-rw-r--r--castle_tapestries/LICENSE21
-rw-r--r--castle_tapestries/README.txt13
-rw-r--r--castle_tapestries/depends.txt3
-rw-r--r--castle_tapestries/description.txt1
-rw-r--r--castle_tapestries/init.lua205
-rw-r--r--castle_tapestries/intllib.lua45
-rw-r--r--castle_tapestries/locale/template.pot33
-rw-r--r--castle_tapestries/mod.conf1
-rw-r--r--castle_tapestries/models/LICENSE.txt5
-rw-r--r--castle_tapestries/models/castle_tapestry.obj212
-rw-r--r--castle_tapestries/models/castle_tapestry_long.obj220
-rw-r--r--castle_tapestries/models/castle_tapestry_very_long.obj228
-rw-r--r--castle_tapestries/screenshot.pngbin0 -> 26720 bytes
-rw-r--r--castle_tapestries/textures/castle_tapestry.pngbin0 -> 323 bytes
-rw-r--r--castle_tapestries/textures/castle_tapestry_inv.pngbin0 -> 2062 bytes
-rw-r--r--castle_tapestries/textures/castle_tapestry_long_inv.pngbin0 -> 1822 bytes
-rw-r--r--castle_tapestries/textures/castle_tapestry_very_long_inv.pngbin0 -> 1376 bytes
-rw-r--r--castle_weapons/LICENSE21
-rw-r--r--castle_weapons/README.txt16
-rw-r--r--castle_weapons/battleaxe.lua28
-rw-r--r--castle_weapons/crossbow.lua451
-rw-r--r--castle_weapons/depends.txt2
-rw-r--r--castle_weapons/description.txt1
-rw-r--r--castle_weapons/init.lua7
-rw-r--r--castle_weapons/intllib.lua45
-rw-r--r--castle_weapons/locale/template.pot29
-rw-r--r--castle_weapons/mod.conf1
-rw-r--r--castle_weapons/models/LICENSE.txt10
-rw-r--r--castle_weapons/models/castle_crossbow_bolt.b3dbin0 -> 21158 bytes
-rw-r--r--castle_weapons/models/castle_crossbow_bolt.blendbin0 -> 493796 bytes
-rw-r--r--castle_weapons/models/castle_crossbow_bolt_uv.pngbin0 -> 157 bytes
-rw-r--r--castle_weapons/screenshot.pngbin0 -> 13769 bytes
-rw-r--r--castle_weapons/sounds/LICENSE.txt19
-rw-r--r--castle_weapons/sounds/castle_crossbow_bolt.oggbin0 -> 5967 bytes
-rw-r--r--castle_weapons/sounds/castle_crossbow_click.oggbin0 -> 7377 bytes
-rw-r--r--castle_weapons/sounds/castle_crossbow_reload.oggbin0 -> 12213 bytes
-rw-r--r--castle_weapons/sounds/castle_crossbow_shoot.oggbin0 -> 8112 bytes
-rw-r--r--castle_weapons/textures/LICENSE.txt25
-rw-r--r--castle_weapons/textures/castle_battleaxe.pngbin0 -> 358 bytes
-rw-r--r--castle_weapons/textures/castle_crossbow_bolt_inv.pngbin0 -> 146 bytes
-rw-r--r--castle_weapons/textures/castle_crossbow_hit.pngbin0 -> 516 bytes
-rw-r--r--castle_weapons/textures/castle_crossbow_inv.pngbin0 -> 280 bytes
-rw-r--r--castle_weapons/textures/castle_crossbow_loaded.pngbin0 -> 295 bytes
-rw-r--r--crafting_bench/LICENSE21
-rw-r--r--crafting_bench/README.txt18
-rw-r--r--crafting_bench/depends.txt4
-rw-r--r--crafting_bench/description.txt1
-rw-r--r--crafting_bench/init.lua170
-rw-r--r--crafting_bench/intllib.lua45
-rw-r--r--crafting_bench/locale/template.pot67
-rw-r--r--crafting_bench/mod.conf1
-rw-r--r--crafting_bench/screenshot.pngbin0 -> 42865 bytes
-rw-r--r--crafting_bench/settingtypes.txt2
-rw-r--r--crafting_bench/textures/LICENSE.txt20
-rw-r--r--crafting_bench/textures/crafting_bench_workbench_back.pngbin0 -> 383 bytes
-rw-r--r--crafting_bench/textures/crafting_bench_workbench_bottom.pngbin0 -> 369 bytes
-rw-r--r--crafting_bench/textures/crafting_bench_workbench_front.pngbin0 -> 391 bytes
-rw-r--r--crafting_bench/textures/crafting_bench_workbench_side.pngbin0 -> 342 bytes
-rw-r--r--crafting_bench/textures/crafting_bench_workbench_top.pngbin0 -> 336 bytes
-rw-r--r--digilines/.luacheckrc12
-rw-r--r--digilines/init.lua46
-rw-r--r--digilines/internal.lua58
-rw-r--r--digilines/inventory.lua20
-rw-r--r--digilines/lcd.lua180
-rw-r--r--digilines/lightsensor.lua8
-rw-r--r--digilines/presetrules.lua4
-rw-r--r--digilines/rtc.lua8
-rw-r--r--digilines/util.lua28
-rw-r--r--digilines/wire_std.lua33
-rw-r--r--digilines/wires_common.lua54
-rw-r--r--ropes/LICENSE.md4
-rw-r--r--ropes/README.md11
-rw-r--r--ropes/crafts.lua34
-rw-r--r--ropes/depends.txt6
-rw-r--r--ropes/description.txt1
-rw-r--r--ropes/doc.lua47
-rw-r--r--ropes/functions.lua97
-rw-r--r--ropes/init.lua43
-rw-r--r--ropes/intllib.lua45
-rw-r--r--ropes/ladder.lua180
-rw-r--r--ropes/locale/template.pot123
-rw-r--r--ropes/loot.lua56
-rw-r--r--ropes/mod.conf1
-rw-r--r--ropes/ropeboxes.lua348
-rw-r--r--ropes/screenshot.pngbin0 -> 109876 bytes
-rw-r--r--ropes/settingtypes.txt37
-rw-r--r--ropes/sounds/license.txt1
-rw-r--r--ropes/sounds/ropes_creak.1.oggbin0 -> 8446 bytes
-rw-r--r--ropes/sounds/ropes_creak.2.oggbin0 -> 10929 bytes
-rw-r--r--ropes/sounds/ropes_creak.3.oggbin0 -> 9114 bytes
-rw-r--r--ropes/textures/ropes_1.pngbin0 -> 376 bytes
-rw-r--r--ropes/textures/ropes_2.pngbin0 -> 435 bytes
-rw-r--r--ropes/textures/ropes_3.pngbin0 -> 509 bytes
-rw-r--r--ropes/textures/ropes_4.pngbin0 -> 572 bytes
-rw-r--r--ropes/textures/ropes_5.pngbin0 -> 653 bytes
-rw-r--r--ropes/textures/ropes_item.pngbin0 -> 153 bytes
-rw-r--r--ropes/textures/ropes_ropebox_front_1.pngbin0 -> 345 bytes
-rw-r--r--ropes/textures/ropes_ropebox_front_2.pngbin0 -> 418 bytes
-rw-r--r--ropes/textures/ropes_ropebox_front_3.pngbin0 -> 475 bytes
-rw-r--r--ropes/textures/ropes_ropebox_front_4.pngbin0 -> 555 bytes
-rw-r--r--ropes/textures/ropes_ropebox_front_5.pngbin0 -> 621 bytes
-rw-r--r--ropes/textures/ropes_ropebox_side.pngbin0 -> 412 bytes
-rw-r--r--ropes/textures/ropes_ropeladder.pngbin0 -> 394 bytes
-rw-r--r--ropes/textures/ropes_ropeladder_bottom.pngbin0 -> 415 bytes
-rw-r--r--ropes/textures/ropes_ropeladder_top.pngbin0 -> 426 bytes
-rw-r--r--technic/machines/supply_converter.lua10
-rw-r--r--unified_inventory/locale/pt.txt107
254 files changed, 8791 insertions, 200 deletions
diff --git a/anvil/LICENSE b/anvil/LICENSE
new file mode 100644
index 0000000..733c072
--- /dev/null
+++ b/anvil/LICENSE
@@ -0,0 +1,675 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
diff --git a/anvil/README.txt b/anvil/README.txt
new file mode 100644
index 0000000..227321f
--- /dev/null
+++ b/anvil/README.txt
@@ -0,0 +1,3 @@
+Anvil mod by Sokomine, originally a part of the Cottages mod but extracted to stand alone.
+
+This anvil (and its associated hammer) allows a player to repair worn tools. Place the worn tool in the anvil's inventory and strike it with the hammer to improve its condition. \ No newline at end of file
diff --git a/anvil/depends.txt b/anvil/depends.txt
new file mode 100644
index 0000000..e5122e9
--- /dev/null
+++ b/anvil/depends.txt
@@ -0,0 +1,3 @@
+default
+doc?
+intllib? \ No newline at end of file
diff --git a/anvil/description.txt b/anvil/description.txt
new file mode 100644
index 0000000..0561b90
--- /dev/null
+++ b/anvil/description.txt
@@ -0,0 +1 @@
+Hammer and anvil for repairing tools \ No newline at end of file
diff --git a/anvil/init.lua b/anvil/init.lua
new file mode 100644
index 0000000..1567894
--- /dev/null
+++ b/anvil/init.lua
@@ -0,0 +1,366 @@
+---------------------------------------------------------------------------------------
+-- simple anvil that can be used to repair tools
+---------------------------------------------------------------------------------------
+-- * can be used to repair tools
+-- * the hammer gets dammaged a bit at each repair step
+---------------------------------------------------------------------------------------
+
+minetest.register_alias("castle:anvil", "anvil:anvil")
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+local item_displacement = 7/16
+
+-- the hammer for the anvil
+minetest.register_tool("anvil:hammer", {
+ description = S("Steel blacksmithing hammer"),
+ _doc_items_longdesc = S("A tool for repairing other tools at a blacksmith's anvil."),
+ _doc_items_usagehelp = S("Use this hammer to strike blows upon an anvil bearing a damaged tool and you can repair it. It can also be used for smashing stone, but it is not well suited to this task."),
+ image = "anvil_tool_steelhammer.png",
+ inventory_image = "anvil_tool_steelhammer.png",
+
+ tool_capabilities = {
+ full_punch_interval = 0.8,
+ max_drop_level=1,
+ groupcaps={
+ -- about equal to a stone pick (it's not intended as a tool)
+ cracky={times={[2]=2.00, [3]=1.20}, uses=30, maxlevel=1},
+ },
+ damage_groups = {fleshy=6},
+ }
+})
+
+local tmp = {}
+
+minetest.register_entity("anvil:item",{
+ hp_max = 1,
+ visual="wielditem",
+ visual_size={x=.33,y=.33},
+ collisionbox = {0,0,0,0,0,0},
+ physical=false,
+ textures={"air"},
+ on_activate = function(self, staticdata)
+ if tmp.nodename ~= nil and tmp.texture ~= nil then
+ self.nodename = tmp.nodename
+ tmp.nodename = nil
+ self.texture = tmp.texture
+ tmp.texture = nil
+ else
+ if staticdata ~= nil and staticdata ~= "" then
+ local data = staticdata:split(';')
+ if data and data[1] and data[2] then
+ self.nodename = data[1]
+ self.texture = data[2]
+ end
+ end
+ end
+ if self.texture ~= nil then
+ self.object:set_properties({textures={self.texture}})
+ end
+ end,
+ get_staticdata = function(self)
+ if self.nodename ~= nil and self.texture ~= nil then
+ return self.nodename .. ';' .. self.texture
+ end
+ return ""
+ end,
+})
+
+local remove_item = function(pos, node)
+ local objs = minetest.env:get_objects_inside_radius({x = pos.x, y = pos.y + item_displacement, z = pos.z}, .5)
+ if objs then
+ for _, obj in ipairs(objs) do
+ if obj and obj:get_luaentity() and obj:get_luaentity().name == "anvil:item" then
+ obj:remove()
+ end
+ end
+ end
+end
+
+local update_item = function(pos, node)
+ local meta = minetest.env:get_meta(pos)
+ local inv = meta:get_inventory()
+ if not inv:is_empty("input") then
+ pos.y = pos.y + item_displacement
+ tmp.nodename = node.name
+ tmp.texture = inv:get_stack("input", 1):get_name()
+ local e = minetest.env:add_entity(pos,"anvil:item")
+ local yaw = math.pi*2 - node.param2 * math.pi/2
+ e:setyaw(yaw)
+ end
+end
+
+local metal_sounds
+-- Apparently node_sound_metal_defaults is a newer thing, I ran into games using an older version of the default mod without it.
+if default.node_sound_metal_defaults ~= nil then
+ metal_sounds = default.node_sound_metal_defaults()
+else
+ metal_sounds = default.node_sound_stone_defaults()
+end
+
+minetest.register_node("anvil:anvil", {
+ drawtype = "nodebox",
+ description = S("Anvil"),
+ _doc_items_longdesc = S("A tool for repairing other tools in conjunction with a blacksmith's hammer."),
+ _doc_items_usagehelp = S("Right-click on this anvil with a damaged tool to place the damaged tool upon it. You can then repair the damaged tool by striking it with a blacksmith's hammer. Repeated blows may be necessary to fully repair a badly worn tool. To retrieve the tool either punch or right-click the anvil with an empty hand."),
+ tiles = {"default_stone.png"},
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = {cracky=2},
+ sounds = metal_sounds,
+ -- the nodebox model comes from realtest
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5,-0.5,-0.3,0.5,-0.4,0.3},
+ {-0.35,-0.4,-0.25,0.35,-0.3,0.25},
+ {-0.3,-0.3,-0.15,0.3,-0.1,0.15},
+ {-0.35,-0.1,-0.2,0.35,0.1,0.2},
+ },
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5,-0.5,-0.3,0.5,-0.4,0.3},
+ {-0.35,-0.4,-0.25,0.35,-0.3,0.25},
+ {-0.3,-0.3,-0.15,0.3,-0.1,0.15},
+ {-0.35,-0.1,-0.2,0.35,0.1,0.2},
+ }
+ },
+ on_construct = function(pos)
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+ inv:set_size("input", 1)
+ end,
+
+ after_place_node = function(pos, placer)
+ local meta = minetest.get_meta(pos)
+ meta:set_string("owner", placer:get_player_name() or "")
+ end,
+
+ can_dig = function(pos,player)
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+
+ if not inv:is_empty("input") then
+ return false
+ end
+ return true
+ end,
+
+ allow_metadata_inventory_put = function(pos, listname, index, stack, player)
+ local meta = minetest.get_meta(pos)
+ if listname~="input" then
+ return 0
+ end
+ if (listname=='input'
+ and(stack:get_wear() == 0
+ or stack:get_name() == "technic:water_can"
+ or stack:get_name() == "technic:lava_can" )) then
+
+ minetest.chat_send_player( player:get_player_name(), S('This anvil is for damaged tools only.'))
+ return 0
+ end
+
+ if meta:get_inventory():room_for_item("input", stack) then
+ return stack:get_count()
+ end
+ return 0
+ end,
+
+ allow_metadata_inventory_take = function(pos, listname, index, stack, player)
+ if listname~="input" then
+ return 0
+ end
+ return stack:get_count()
+ end,
+
+ on_rightclick = function(pos, node, clicker, itemstack)
+ if itemstack:get_count() == 0 then
+ local meta = minetest.env:get_meta(pos)
+ local inv = meta:get_inventory()
+ if not inv:is_empty("input") then
+ local return_stack = inv:get_stack("input", 1)
+ inv:set_stack("input", 1, nil)
+ clicker:get_inventory():add_item("main", return_stack)
+ remove_item(pos, node)
+ return return_stack
+ end
+ end
+ local this_def = minetest.registered_nodes[node.name]
+ if this_def.allow_metadata_inventory_put(pos, "input", 1, itemstack:peek_item(), clicker) > 0 then
+ local s = itemstack:take_item()
+ local meta = minetest.env:get_meta(pos)
+ local inv = meta:get_inventory()
+ inv:add_item("input", s)
+ update_item(pos,node)
+ end
+ return itemstack
+ end,
+
+ on_punch = function(pos, node, puncher)
+ if( not( pos ) or not( node ) or not( puncher )) then
+ return
+ end
+
+ local wielded = puncher:get_wielded_item()
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+
+ if wielded:get_count() == 0 then
+ if not inv:is_empty("input") then
+ local return_stack = inv:get_stack("input", 1)
+ inv:set_stack("input", 1, nil)
+ puncher:get_inventory():add_item("main", return_stack)
+ remove_item(pos, node)
+ end
+ end
+
+ -- only punching with the hammer is supposed to work
+ if wielded:get_name() ~= 'anvil:hammer' then
+ return
+ end
+
+ local input = inv:get_stack('input',1)
+
+ -- only tools can be repaired
+ if( not( input )
+ or input:is_empty()
+ or input:get_name() == "technic:water_can"
+ or input:get_name() == "technic:lava_can" ) then
+ return
+ end
+
+ -- 65535 is max damage
+ local damage_state = 40-math.floor(input:get_wear()/1638)
+
+ local tool_name = input:get_name()
+
+ local hud2 = nil
+ local hud3 = nil
+ if( input:get_wear()>0 ) then
+ hud2 = puncher:hud_add({
+ hud_elem_type = "statbar",
+ text = "default_cloud.png^[colorize:#ff0000:256",
+ number = 40,
+ direction = 0, -- left to right
+ position = {x=0.5, y=0.65},
+ alignment = {x = 0, y = 0},
+ offset = {x = -320, y = 0},
+ size = {x=32, y=32},
+ })
+ hud3 = puncher:hud_add({
+ hud_elem_type = "statbar",
+ text = "default_cloud.png^[colorize:#00ff00:256",
+ number = damage_state,
+ direction = 0, -- left to right
+ position = {x=0.5, y=0.65},
+ alignment = {x = 0, y = 0},
+ offset = {x = -320, y = 0},
+ size = {x=32, y=32},
+ })
+ end
+ minetest.after(2, function()
+ if( puncher ) then
+ puncher:hud_remove(hud2)
+ puncher:hud_remove(hud3)
+ end
+ end)
+
+ -- tell the player when the job is done
+ if( input:get_wear() == 0 ) then
+ local tool_desc
+ if minetest.registered_items[tool_name] and minetest.registered_items[tool_name].description then
+ tool_desc = minetest.registered_items[tool_name].description
+ else
+ tool_desc = tool_name
+ end
+ minetest.chat_send_player( puncher:get_player_name(), S('Your @1 has been repaired successfully.', tool_desc))
+ return
+ else
+ pos.y = pos.y + item_displacement
+ minetest.sound_play({name="anvil_clang"}, {pos=pos})
+ minetest.add_particlespawner({
+ amount = 10,
+ time = 0.1,
+ minpos = pos,
+ maxpos = pos,
+ minvel = {x=2, y=3, z=2},
+ maxvel = {x=-2, y=1, z=-2},
+ minacc = {x=0, y= -10, z=0},
+ maxacc = {x=0, y= -10, z=0},
+ minexptime = 0.5,
+ maxexptime = 1,
+ minsize = 1,
+ maxsize = 1,
+ collisiondetection = true,
+ vertical = false,
+ texture = "anvil_spark.png",
+ })
+ end
+
+ -- do the actual repair
+ input:add_wear( -5000 ) -- equals to what technic toolshop does in 5 seconds
+ inv:set_stack("input", 1, input)
+
+ -- damage the hammer slightly
+ wielded:add_wear( 100 )
+ puncher:set_wielded_item( wielded )
+ end,
+ is_ground_content = false,
+})
+
+-- automatically restore entities lost due to /clearobjects or similar
+minetest.register_lbm({
+ name = "anvil:anvil_item_restoration",
+ nodenames = { "anvil:anvil" },
+ run_at_every_load = true,
+ action = function(pos, node, active_object_count, active_object_count_wider)
+ local test_pos = {x=pos.x, y=pos.y + item_displacement, z=pos.z}
+ if #minetest.get_objects_inside_radius(test_pos, 0.5) > 0 then return end
+ update_item(pos, node)
+ end
+})
+
+-- Transfer the hammer from the old hammer storage slot to the main slot, or else drop it in world
+minetest.register_lbm({
+ name = "anvil:hammer_ejection",
+ nodenames = "anvil:anvil",
+ run_at_every_load = false,
+ action = function(pos, node)
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+ if not inv:is_empty("hammer") then
+ local hammer = inv:get_stack("hammer", 1)
+ inv:set_stack("hammer", 1, nil)
+ inv:set_size("hammer", 0)
+ if inv:is_empty("input") then
+ inv:set_stack("input", 1, hammer) -- the abm will ensure there's an entity showing the hammer is here
+ else
+ minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, hammer)
+ end
+ end
+ end
+})
+
+---------------------------------------------------------------------------------------
+-- crafting receipes
+---------------------------------------------------------------------------------------
+minetest.register_craft({
+ output = "anvil:anvil",
+ recipe = {
+ {"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 = "anvil:hammer",
+ recipe = {
+ {"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
+ {"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
+ {'', "group:stick", '' } }
+})
+
diff --git a/anvil/intllib.lua b/anvil/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/anvil/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/anvil/locale/de.po b/anvil/locale/de.po
new file mode 100644
index 0000000..80a33a6
--- /dev/null
+++ b/anvil/locale/de.po
@@ -0,0 +1,87 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-03-07 22:17-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: XanthinLanguage-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: init.lua:19
+msgid "Steel blacksmithing hammer"
+msgstr ""
+
+#: init.lua:20
+#, fuzzy
+msgid "A tool for repairing other tools at a blacksmith's anvil."
+msgstr "Stahlhammer um Werkzeuge auf dem Amboss zu reparieren"
+
+#: init.lua:21
+msgid ""
+"Use this hammer to strike blows upon an anvil bearing a damaged tool and you "
+"can repair it. It can also be used for smashing stone, but it is not well "
+"suited to this task."
+msgstr ""
+
+#: init.lua:98
+msgid "Anvil"
+msgstr "Amboss"
+
+#: init.lua:99
+msgid ""
+"A tool for repairing other tools in conjunction with a blacksmith's hammer."
+msgstr ""
+
+#: init.lua:100
+msgid ""
+"Right-click on this anvil with a damaged tool to place the damaged tool upon "
+"it. You can then repair the damaged tool by striking it with a blacksmith's "
+"hammer. Repeated blows may be necessary to fully repair a badly worn tool. "
+"To retrieve the tool either punch or right-click the anvil with an empty "
+"hand."
+msgstr ""
+
+#: init.lua:155
+#, fuzzy
+msgid "This anvil is for damaged tools only."
+msgstr "Das Werkstueckfeld gilt nur fuer beschaedigtes Werkzeug."
+
+#: init.lua:267
+msgid "Your @1 has been repaired successfully."
+msgstr ""
+
+#~ msgid "Workpiece:"
+#~ msgstr "Werkstueck:"
+
+#~ msgid "Optional"
+#~ msgstr "Moegliche"
+
+#~ msgid "storage for"
+#~ msgstr "Aufbewahrung fuer"
+
+#~ msgid "your hammer"
+#~ msgstr "deinen Hammer"
+
+#~ msgid "Punch anvil with hammer to"
+#~ msgstr "Schlage mit dem Hammer auf den Amboss um"
+
+#~ msgid "repair tool in workpiece-slot."
+#~ msgstr "das Werkzeug im Werkstueckfeld zu reparieren."
+
+#~ msgid "anvil"
+#~ msgstr "Amboss"
+
+#~ msgid "Anvil (owned by %s)"
+#~ msgstr "Amboss (gehoert %s)"
+
+#~ msgid "Owner: %s"
+#~ msgstr "Besitzer: %s"
diff --git a/anvil/locale/template.pot b/anvil/locale/template.pot
new file mode 100644
index 0000000..0be726a
--- /dev/null
+++ b/anvil/locale/template.pot
@@ -0,0 +1,59 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-03-07 22:17-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: init.lua:19
+msgid "Steel blacksmithing hammer"
+msgstr ""
+
+#: init.lua:20
+msgid "A tool for repairing other tools at a blacksmith's anvil."
+msgstr ""
+
+#: init.lua:21
+msgid ""
+"Use this hammer to strike blows upon an anvil bearing a damaged tool and you "
+"can repair it. It can also be used for smashing stone, but it is not well "
+"suited to this task."
+msgstr ""
+
+#: init.lua:98
+msgid "Anvil"
+msgstr ""
+
+#: init.lua:99
+msgid ""
+"A tool for repairing other tools in conjunction with a blacksmith's hammer."
+msgstr ""
+
+#: init.lua:100
+msgid ""
+"Right-click on this anvil with a damaged tool to place the damaged tool upon "
+"it. You can then repair the damaged tool by striking it with a blacksmith's "
+"hammer. Repeated blows may be necessary to fully repair a badly worn tool. "
+"To retrieve the tool either punch or right-click the anvil with an empty "
+"hand."
+msgstr ""
+
+#: init.lua:155
+msgid "This anvil is for damaged tools only."
+msgstr ""
+
+#: init.lua:267
+msgid "Your @1 has been repaired successfully."
+msgstr ""
diff --git a/anvil/mod.conf b/anvil/mod.conf
new file mode 100644
index 0000000..2372a4a
--- /dev/null
+++ b/anvil/mod.conf
@@ -0,0 +1 @@
+name = anvil
diff --git a/anvil/screenshot.png b/anvil/screenshot.png
new file mode 100644
index 0000000..e3d3edb
--- /dev/null
+++ b/anvil/screenshot.png
Binary files differ
diff --git a/anvil/sounds/anvil_clang.ogg b/anvil/sounds/anvil_clang.ogg
new file mode 100644
index 0000000..f960a28
--- /dev/null
+++ b/anvil/sounds/anvil_clang.ogg
Binary files differ
diff --git a/anvil/sounds/license.txt b/anvil/sounds/license.txt
new file mode 100644
index 0000000..b719c14
--- /dev/null
+++ b/anvil/sounds/license.txt
@@ -0,0 +1 @@
+anvil_clang.ogg - from https://freesound.org/people/Benboncan/sounds/103631/ by Benboncan under the CC BY 3.0 license \ No newline at end of file
diff --git a/anvil/textures/anvil_spark.png b/anvil/textures/anvil_spark.png
new file mode 100644
index 0000000..a18643a
--- /dev/null
+++ b/anvil/textures/anvil_spark.png
Binary files differ
diff --git a/anvil/textures/anvil_tool_steelhammer.png b/anvil/textures/anvil_tool_steelhammer.png
new file mode 100644
index 0000000..b662a71
--- /dev/null
+++ b/anvil/textures/anvil_tool_steelhammer.png
Binary files differ
diff --git a/anvil/textures/license.txt b/anvil/textures/license.txt
new file mode 100644
index 0000000..4441a6d
--- /dev/null
+++ b/anvil/textures/license.txt
@@ -0,0 +1,2 @@
+License of the hammer picture: CC-by-SA; done by GloopMaster; source:
+https://github.com/GloopMaster/glooptest/blob/master/glooptest/textures/glooptest_tool_steelhammer.png
diff --git a/castle_farming/LICENSE b/castle_farming/LICENSE
new file mode 100644
index 0000000..456d091
--- /dev/null
+++ b/castle_farming/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Minetest Mods Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/castle_farming/README.txt b/castle_farming/README.txt
new file mode 100644
index 0000000..a0334bd
--- /dev/null
+++ b/castle_farming/README.txt
@@ -0,0 +1,20 @@
+=-=-=-=-=-=-=-=-=-=
+
+Castles Mod
+by: Philipbenr And DanDuncombe
+
+=-=-=-=-=-=-=-=-=-=
+
+Licence: MIT
+
+see: LICENSE
+
+=-=-=-=-=-=-=-=-=-=
+
+Contains farm products useful for decorating a castle:
+
+* Hide wall and floor coverings
+* Bound straw bale
+* Straw training dummy
+
+=-=-=-=-=-=-=-=-=-=
diff --git a/castle_farming/depends.txt b/castle_farming/depends.txt
new file mode 100644
index 0000000..6bfb336
--- /dev/null
+++ b/castle_farming/depends.txt
@@ -0,0 +1,6 @@
+default
+farming
+intllib?
+wool
+bucket
+ropes? \ No newline at end of file
diff --git a/castle_farming/description.txt b/castle_farming/description.txt
new file mode 100644
index 0000000..f241ff4
--- /dev/null
+++ b/castle_farming/description.txt
@@ -0,0 +1 @@
+Contains farming products useful for decorating a castle \ No newline at end of file
diff --git a/castle_farming/hides.lua b/castle_farming/hides.lua
new file mode 100644
index 0000000..73a9df2
--- /dev/null
+++ b/castle_farming/hides.lua
@@ -0,0 +1,32 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+minetest.register_alias("castle:hides", "castle_farming:hides")
+
+minetest.register_node("castle_farming:hides", {
+ drawtype = "nodebox",
+ description = S("Hides"),
+ inventory_image = "castle_hide.png",
+ paramtype = "light",
+ walkable = false,
+ tiles = {'castle_hide.png'},
+ climbable = true,
+ paramtype2 = "wallmounted",
+ groups = {dig_immediate=2},
+ node_box = {
+ type = "wallmounted",
+ wall_top = {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
+ wall_bottom = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
+ wall_side = {-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
+ },
+})
+
+minetest.register_craft( {
+ type = "shapeless",
+ output = "castle_farming:hides 6",
+ recipe = { "wool:white" , "bucket:bucket_water" },
+ replacements = {
+ { 'bucket:bucket_water', 'bucket:bucket_empty' }
+ }
+})
diff --git a/castle_farming/init.lua b/castle_farming/init.lua
new file mode 100644
index 0000000..efc24dc
--- /dev/null
+++ b/castle_farming/init.lua
@@ -0,0 +1,4 @@
+local MP = minetest.get_modpath(minetest.get_current_modname())
+
+dofile(MP.."/hides.lua")
+dofile(MP.."/straw.lua") \ No newline at end of file
diff --git a/castle_farming/intllib.lua b/castle_farming/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/castle_farming/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/castle_farming/locale/template.pot b/castle_farming/locale/template.pot
new file mode 100644
index 0000000..233f90f
--- /dev/null
+++ b/castle_farming/locale/template.pot
@@ -0,0 +1,30 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-27 00:59-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: hides.lua:9
+msgid "Hides"
+msgstr ""
+
+#: straw.lua:13
+msgid "Bound Straw"
+msgstr ""
+
+#: straw.lua:22
+msgid "Training Dummy"
+msgstr ""
diff --git a/castle_farming/mod.conf b/castle_farming/mod.conf
new file mode 100644
index 0000000..5095d9a
--- /dev/null
+++ b/castle_farming/mod.conf
@@ -0,0 +1 @@
+name = castle_farming
diff --git a/castle_farming/screenshot.png b/castle_farming/screenshot.png
new file mode 100644
index 0000000..ecf7139
--- /dev/null
+++ b/castle_farming/screenshot.png
Binary files differ
diff --git a/castle_farming/straw.lua b/castle_farming/straw.lua
new file mode 100644
index 0000000..673daac
--- /dev/null
+++ b/castle_farming/straw.lua
@@ -0,0 +1,75 @@
+minetest.register_alias("cottages:straw", "farming:straw")
+minetest.register_alias("castle:straw", "farming:straw")
+minetest.register_alias("darkage:straw", "farming:straw")
+minetest.register_alias("cottages:straw_bale", "castle_farming:bound_straw")
+minetest.register_alias("darkage:straw_bale", "castle_farming:bound_straw")
+minetest.register_alias("castle:bound_straw", "castle_farming:bound_straw")
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+minetest.register_node("castle_farming:bound_straw", {
+ description = S("Bound Straw"),
+ drawtype = "normal",
+ tiles = {"castle_straw_bale.png"},
+ groups = {choppy=4, flammable=1, oddly_breakable_by_hand=3},
+ sounds = default.node_sound_leaves_defaults(),
+ paramtype = "light",
+})
+
+minetest.register_node("castle_farming:straw_dummy", {
+ description = S("Training Dummy"),
+ tiles = {"castle_straw_dummy.png"},
+ groups = {choppy=4, flammable=1, oddly_breakable_by_hand=3},
+ sounds = default.node_sound_leaves_defaults(),
+ drawtype = "nodebox",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.25, -0.5, -0.125, 0, 0.1875, 0.125}, -- right_leg
+ {0, -0.5, -0.125, 0.25, 0.1875, 0.125}, -- left_leg
+ {-0.25, 0.1875, -0.1875, 0.25, 0.875, 0.125}, -- torso
+ {0.25, 0.1875, -0.125, 0.5, 0.875, 0.125}, -- left_arm
+ {-0.5, 0.1875, -0.125, -0.25, 0.875, 0.125}, -- right_arm
+ {-0.25, 0.875, -0.25, 0.25, 1.3125, 0.1875}, -- head
+ }
+ }
+})
+
+minetest.register_craft({
+ output = "castle_farming:straw_dummy",
+ recipe = {
+ {"group:stick", "castle_farming:bound_straw","group:stick"},
+ {"", "castle_farming:bound_straw",""},
+ {"group:stick", "","group:stick"},
+ },
+})
+
+minetest.register_craft({
+ output = "castle_farming:bound_straw 6",
+ type = "shapeless",
+ recipe = {"farming:straw", "farming:straw", "farming:straw", "farming:straw", "farming:straw", "farming:straw", "ropes:ropesegment",}
+})
+
+minetest.register_craft({
+ output = "castle_farming:bound_straw",
+ type = "shapeless",
+ recipe = {"farming:straw", "farming:cotton",}
+})
+
+minetest.register_craft({
+ type = "fuel",
+ recipe = "castle_farming:bound_straw",
+ burntime = 10
+})
+
+local stick_burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack("default:stick")}}).time
+
+minetest.register_craft({
+ type = "fuel",
+ recipe = "castle_farming:straw_dummy",
+ burntime = 10*2 + 4*stick_burn_time
+}) \ No newline at end of file
diff --git a/castle_farming/textures/LICENSE.txt b/castle_farming/textures/LICENSE.txt
new file mode 100644
index 0000000..594d102
--- /dev/null
+++ b/castle_farming/textures/LICENSE.txt
@@ -0,0 +1,19 @@
+--------------------------------------------
+
+16 px textures based on Castle mod
+original textures by Philipner
+
+License Textures: Napiophelios - CC-BY-SA 3.0
+
+castle_hide.png
+castle_straw_bale.png
+
+--------------------------------------------
+
+Attribution 3.0 Unported (CC BY 3.0)
+Copyright (C) 2012-2016 PilzAdam
+Copyright (C) 2014-2016 BlockMen
+Copyright (C) 2015-2016 MasterGollum
+Copyright (C) 2015-2016 Gambit
+
+castle_straw_dummy.png - derived from farming_straw.png \ No newline at end of file
diff --git a/castle_farming/textures/castle_hide.png b/castle_farming/textures/castle_hide.png
new file mode 100644
index 0000000..3e6f6c4
--- /dev/null
+++ b/castle_farming/textures/castle_hide.png
Binary files differ
diff --git a/castle_farming/textures/castle_straw_bale.png b/castle_farming/textures/castle_straw_bale.png
new file mode 100644
index 0000000..ad56330
--- /dev/null
+++ b/castle_farming/textures/castle_straw_bale.png
Binary files differ
diff --git a/castle_farming/textures/castle_straw_dummy.png b/castle_farming/textures/castle_straw_dummy.png
new file mode 100644
index 0000000..265f532
--- /dev/null
+++ b/castle_farming/textures/castle_straw_dummy.png
Binary files differ
diff --git a/castle_gates/LICENSE b/castle_gates/LICENSE
new file mode 100644
index 0000000..5c3c583
--- /dev/null
+++ b/castle_gates/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2017 Minetest Mods Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/castle_gates/README.txt b/castle_gates/README.txt
new file mode 100644
index 0000000..113bd89
--- /dev/null
+++ b/castle_gates/README.txt
@@ -0,0 +1,11 @@
+Castle Gates
+
+Licence: MIT
+
+see: LICENSE
+
+=-=-=-=-=-=-=-=-=-=
+
+This is a mod all about creating castle gates and dungeons. It contains dungeon doors and bars, and also a set of nodes for constructing larger swinging and sliding gates.
+
+This allows the construction of portcullises and drawbridges as well as conventional swinging doors. Use the screwdriver to reorient gate pieces as needed for these purposes.
diff --git a/castle_gates/api.txt b/castle_gates/api.txt
new file mode 100644
index 0000000..8d8b4d6
--- /dev/null
+++ b/castle_gates/api.txt
@@ -0,0 +1,76 @@
+This document is intended primarily for modders interested in adding their own gate nodes and gate types.
+
+This mod allows for additional gate nodes to be defined in other dependent mods that will work seamlessly with existing gate nodes. The following is a minimalist example that shows a node using all of the features offered by this mod's gate API:
+
+minetest.register_node("castle_gates:example_gate_piece", {
+ description = "Example gate",
+ groups = {castle_gate = 1},
+ tiles = {"default_wood.png"},
+ paramtype2 = "facedir",
+ on_rightclick = castle_gates.trigger_gate,
+ _gate_edges = {"right"=true},
+ _gate_hinge = {axis="top", offset={"front","left"}},
+})
+
+The key features are:
+
+* paramtype2 = "facedir" (mandatory)
+* "castle_gate" group membership (mandatory)
+* on_rightclick = castle_gates.trigger_gate (optional, but recommended)
+* _gate_edges = <edge definition> (optional)
+* _gate_hinge = <hinge defintion> (optional)
+
+
+Paramtype2
+==========
+
+All gate pieces must be orientable via facedir.
+
+Castle_gate group
+=================
+
+When a gate is triggered by right-clicking on a gate node, the gate code does a "flood fill" operation to find all connected gate nodes. This flood fill operation looks for adjacent nodes that belong to the same castle_gate group, so all gate nodes need to belong to this group.
+
+Gates defined in this mod all belong to castle_gate=1.
+
+on_rightclick
+=============
+
+The castle_gates.trigger_gate method is a right-click handler that will trigger the movement of the gate. If you want your gate pieces to respond to a player's right click by opening, use this call to make the gate magic happen.
+
+Note that if you wish you can embed the call to The castle_gates.trigger_gate inside your own on_rightclick function, so that for example you could make a "locked" gate that will only respond to specific players (you may wish to use a different castle_gate group ID for such a gate). Or you can omit this function, in which case the gate piece will still move with the rest of the gate but right-clicking on it will not trigger the gate's movement.
+
+_gate_edges
+===========
+
+This is an optional property you can put on a gate node's definition to prevent flood-fill from extending beyond this node in a particular direction. This is useful if, for example, you want players to be able to build double doors that would otherwise connect together when both doors are closed.
+
+It consists of a table with directions defined as edges set to true. You can use this template:
+
+_gate_edges = {right=false, left=false, top=false, bottom=false}
+
+("front" and "back" are also possible but are unlikely to be of any real use)
+
+Note that the flood-fill search for gate nodes will flow *around* an edge piece if a path exists, the mere fact that there's an edge piece does not guarantee that the door node beyond the edge will not be considered part of the same door as it.
+
+_gate_hinge
+===========
+
+The hinge definition for a node def is of the following form:
+
+_gate_hinge = {axis=<axis>, offset=<offset>}
+
+<axis> is one of "top", "bottom", "left", "right", "front" or "back".
+Top/bottom, left/right and front/back are interchangeable pairings as far as this code is concerned.
+These directions are relative to the orientation of the block. Existing gates use "top", so for
+maximum compatibility it's advised that new gate hinges are defined with the same axis.
+
+<offset> is optional. If it is not defined, the gate hinge will try to rotate around the center of the node.
+
+<offset> can be a single direction ("top", "bottom", "left", "right", "front", "back"). If a single direction is
+given the hinge will try to rotate around the center of the node that lies in that direction relative to the hinge node.
+
+<offset> can also be a pair of directions given in a table. This is how the *edge* of a node can be made into the
+center of rotation. For example, existing gate hinges in this mod have the offset {"front","left"}. This means that the
+gate will try to rotate around the center of the edge of the node where the front and left faces intersect.
+You should only use direction pairs that form a 90 degree angle. \ No newline at end of file
diff --git a/castle_gates/class_pointset.lua b/castle_gates/class_pointset.lua
new file mode 100644
index 0000000..3cbbd89
--- /dev/null
+++ b/castle_gates/class_pointset.lua
@@ -0,0 +1,101 @@
+-- A simple special-purpose class, this is used for building up sets of three-dimensional points for fast reference
+
+Pointset = {}
+Pointset.__index = Pointset
+
+function Pointset.create()
+ local set = {}
+ setmetatable(set,Pointset)
+ set.points = {}
+ return set
+end
+
+function Pointset:set(x, y, z, value)
+ -- sets a value in the 3D array "points".
+ if self.points[x] == nil then
+ self.points[x] = {}
+ end
+ if self.points[x][y] == nil then
+ self.points[x][y] = {}
+ end
+ self.points[x][y][z] = value
+end
+
+function Pointset:set_if_not_in(excluded, x, y, z, value)
+ -- If a value is not already set for this point in the 3D array "excluded", set it in "points"
+ if excluded:get(x, y, z) ~= nil then
+ return
+ end
+ self:set(x, y, z, value)
+end
+
+function Pointset:get(x, y, z)
+ -- return a value from the 3D array "points"
+ if self.points[x] == nil or self.points[x][y] == nil then
+ return nil
+ end
+ return self.points[x][y][z]
+end
+
+function Pointset:set_pos(pos, value)
+ self:set(pos.x, pos.y, pos.z, value)
+end
+
+function Pointset:set_pos_if_not_in(excluded, pos, value)
+ self:set_if_not_in(excluded, pos.x, pos.y, pos.z, value)
+end
+
+function Pointset:get_pos(pos)
+ return self:get(pos.x, pos.y, pos.z)
+end
+
+function Pointset:pop()
+ -- returns a point that's in the 3D array, and then removes it.
+ local pos = {}
+ local ytable
+ local ztable
+ local val
+
+ local count = 0
+ for _ in pairs(self.points) do count = count + 1 end
+ if count == 0 then
+ return nil
+ end
+
+ pos.x, ytable = next(self.points)
+ pos.y, ztable = next(ytable)
+ pos.z, val = next(ztable)
+
+ self.points[pos.x][pos.y][pos.z] = nil
+
+ count = 0
+ for _ in pairs(self.points[pos.x][pos.y]) do count = count + 1 end
+ if count == 0 then
+ self.points[pos.x][pos.y] = nil
+ end
+
+ count = 0
+ for _ in pairs(self.points[pos.x]) do count = count + 1 end
+ if count == 0 then
+ self.points[pos.x] = nil
+ end
+
+ return pos, val
+end
+
+function Pointset:get_pos_list(value)
+ -- Returns a list of all points with the given value in standard Minetest vector format. If no value is provided, returns all points
+ local outlist = {}
+ for x, ytable in ipairs(self.points) do
+ for y, ztable in ipairs(ytable) do
+ for z, val in ipairs(ztable) do
+ if (value == nil and val ~= nil ) or val == value then
+ table.insert(outlist, {x=x, y=y, z=z})
+ end
+ end
+ end
+ end
+ return outlist
+end
+
+ \ No newline at end of file
diff --git a/castle_gates/depends.txt b/castle_gates/depends.txt
new file mode 100644
index 0000000..acb8d9e
--- /dev/null
+++ b/castle_gates/depends.txt
@@ -0,0 +1,6 @@
+default
+castle_masonry?
+doors?
+xpanes?
+intllib?
+doc? \ No newline at end of file
diff --git a/castle_gates/description.txt b/castle_gates/description.txt
new file mode 100644
index 0000000..2399226
--- /dev/null
+++ b/castle_gates/description.txt
@@ -0,0 +1 @@
+This is a mod all about creating castles and castle dungeons. Many of the nodes are used for the outer-walls or dungeons.
diff --git a/castle_gates/doc.lua b/castle_gates/doc.lua
new file mode 100644
index 0000000..ac868e7
--- /dev/null
+++ b/castle_gates/doc.lua
@@ -0,0 +1,52 @@
+castle_gates.doc = {}
+
+if not minetest.get_modpath("doc") then
+ return
+end
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+castle_gates.doc.portcullis_bars_longdesc = S("Heavy wooden bars designed to prevent entry even to siege equipment.")
+castle_gates.doc.portcullis_bars_usagehelp = S("Place these bars in a structure together and they will slide as a unified gate when clicked on.")
+
+castle_gates.doc.portcullis_bars_bottom_longdesc = S("The bottom edge of a portcullis gate, with knobs to lock securely into the floor.")
+castle_gates.doc.portcullis_bars_bottom_usagehelp = S("This block can be used to define the edge of a portcullius that meets up with another gate, should you have an arrangement like that. Otherwise it's just decorative.")
+
+castle_gates.doc.gate_panel_longdesc = S("A basic gate panel.")
+castle_gates.doc.gate_panel_usagehelp = S("This gate segment will move in unison with adjoining gate segments when right-clicked.")
+
+castle_gates.doc.gate_edge_longdesc = S("A gate panel with a defined edge.")
+castle_gates.doc.gate_edge_usagehelp = S("The darkened edge of this panel marks the edge of the gate it's a part of. You can use these when building double doors to ensure the two parts swing separately, for example. Note that edges aren't strictly necessary for gates that stand alone.")
+
+castle_gates.doc.gate_edge_handle_longdesc = S("A gate edge with a handle.")
+castle_gates.doc.gate_edge_handle_usagehelp = S("The handle is basically decorative, a door this size can be swung by clicking anywhere on it. But the darkened edge of this panel is useful for defining the edge of a gate when it abuts a partner to the side.")
+
+castle_gates.doc.gate_hinge_longdesc = S("A hinged gate segment that allows a gate to swing.")
+castle_gates.doc.gate_hinge_usagehelp = S("If you have more than one hinge in your gate, make sure the hinges line up correctly otherwise the gate will not be able to swing. The hinge is the protruding block along the edge of the gate panel.")
+
+castle_gates.doc.gate_slot_longdesc = S("A block with a slot to allow an adjacent sliding gate through.")
+castle_gates.doc.gate_slot_usagehelp = S("This block is designed to extend into a neighboring node that a sliding gate passes through, to provide a tight seal for the gate to move through without allowing anything else to squeeze in.")
+
+castle_gates.doc.gate_slot_reverse_longdesc = S("A block that extends into an adjacent node to provide a tight seal for a large gate.")
+castle_gates.doc.gate_slot_reverse_usagehelp = S("Two nodes cannot occupy the same space, but this block extends into a neighboring node's space to allow for gates to form a tight seal. It can be used with sliding gates or swinging gates.")
+
+doc.add_category("castle_gates",
+{
+ name = S("Gates"),
+ description = S("Gates are large multi-node constructions that swing on hinges or slide out of the way when triggered."),
+ build_formspec = doc.entry_builders.text_and_gallery,
+})
+
+doc.add_entry("castle_gates", "construction", {
+ name = S("Gate construction"),
+ data = { text =
+S("Gates are multi-node constructions, usually (though not always) consisting of multiple node types that fit together into a unified whole. The orientation of gate nodes is significant, so a screwdriver will be a helpful tool when constructing gates."
+.."\n\n"..
+"A gate's extent is determined by a \"flood fill\" operation. When you trigger a gate block, all compatible neighboring blocks will be considered part of the same structure and will move in unison. Only gate blocks that are aligned with each other will be considered part of the same gate. If you wish to build adjoining gates (for example, a large pair of double doors that meet in the center) you'll need to make use of gate edge blocks to prevent it all from being considered one big door. Note that if your gate does not abut any other gates you don't actually need to define its edges this way - you don't have to use edge blocks in this case."
+.."\n\n"..
+"If a gate has no hinge nodes it will be considered a sliding gate. When triggered, the gate code will search for a direction that the gate can slide in and will move it in that direction at a rate of one block-length per second. Once it reaches an obstruction it will stop, and when triggered again it will try sliding in the opposite direction."
+.."\n\n"..
+"If a gate has hinge nodes then triggering it will cause the gate to try swinging around the hinge. If the gate has multiple hinges and they don't line up properly the gate will be unable to move. Note that the gate can only exist in 90-degree increments of orientation, but the gate still looks for obstructions in the region it is swinging through and will not swing if there's something in the way.")
+}}) \ No newline at end of file
diff --git a/castle_gates/doors.lua b/castle_gates/doors.lua
new file mode 100644
index 0000000..58e3e4f
--- /dev/null
+++ b/castle_gates/doors.lua
@@ -0,0 +1,62 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+if minetest.get_modpath("doors") then
+ doors.register("castle_gates:oak_door", {
+ tiles = {{ name = "castle_door_oak.png", backface_culling = true }},
+ description = S("Oak Door"),
+ inventory_image = "castle_oak_door_inv.png",
+ protected = true,
+ groups = { choppy = 2, door = 1 },
+ sounds = default.node_sound_wood_defaults(),
+ recipe = {
+ {"default:tree", "default:tree"},
+ {"default:tree", "default:tree"},
+ {"default:tree", "default:tree"},
+ }
+ })
+
+ doors.register("castle_gates:jail_door", {
+ tiles = {{ name = "castle_door_jail.png", backface_culling = true }},
+ description = S("Jail Door"),
+ inventory_image = "castle_jail_door_inv.png",
+ protected = true,
+ groups = { cracky = 2, door = 1, flow_through = 1},
+ sound_open = "doors_steel_door_open",
+ sound_close = "doors_steel_door_close",
+ recipe = {
+ {"castle_gates:jailbars", "castle_gates:jailbars"},
+ {"castle_gates:jailbars", "castle_gates:jailbars"},
+ {"castle_gates:jailbars", "castle_gates:jailbars"},
+ }
+ })
+
+ minetest.register_alias("castle:oak_door_a", "castle_gates:oak_door_a")
+ minetest.register_alias("castle:oak_door_b", "castle_gates:oak_door_b")
+ minetest.register_alias("castle:jail_door_a", "castle_gates:jail_door_a")
+ minetest.register_alias("castle:jail_door_b", "castle_gates:jail_door_b")
+end
+
+if minetest.get_modpath("xpanes") then
+ xpanes.register_pane("jailbars", {
+ description = S("Jail Bars"),
+ tiles = {"castle_jailbars.png"},
+ drawtype = "airlike",
+ paramtype = "light",
+ textures = {"castle_jailbars.png", "castle_jailbars.png", "xpanes_space.png"},
+ inventory_image = "castle_jailbars.png",
+ wield_image = "castle_jailbars.png",
+ sounds = default.node_sound_metal_defaults(),
+ groups = {cracky=1, pane=1, flow_through=1},
+ recipe = {
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+ {"default:steel_ingot", "", "default:steel_ingot"},
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}},
+ })
+end
+
+for i = 1, 15 do
+ minetest.register_alias("castle:jailbars_"..i, "xpanes:jailbars_"..i)
+end
+minetest.register_alias("castle:jailbars", "xpanes:jailbars")
diff --git a/castle_gates/gate_functions.lua b/castle_gates/gate_functions.lua
new file mode 100644
index 0000000..4a3c7f7
--- /dev/null
+++ b/castle_gates/gate_functions.lua
@@ -0,0 +1,389 @@
+local MP = minetest.get_modpath(minetest.get_current_modname())
+dofile(MP.."/class_pointset.lua")
+
+-- Given a facedir, returns a set of all the corresponding directions
+local get_dirs = function(facedir)
+ local dirs = {}
+ local top = {[0]={x=0, y=1, z=0},
+ {x=0, y=0, z=1},
+ {x=0, y=0, z=-1},
+ {x=1, y=0, z=0},
+ {x=-1, y=0, z=0},
+ {x=0, y=-1, z=0}}
+ dirs.back = minetest.facedir_to_dir(facedir)
+ dirs.top = top[math.floor(facedir/4)]
+ dirs.right = {
+ x=dirs.top.y*dirs.back.z - dirs.back.y*dirs.top.z,
+ y=dirs.top.z*dirs.back.x - dirs.back.z*dirs.top.x,
+ z=dirs.top.x*dirs.back.y - dirs.back.x*dirs.top.y
+ }
+ dirs.front = vector.multiply(dirs.back, -1)
+ dirs.bottom = vector.multiply(dirs.top, -1)
+ dirs.left = vector.multiply(dirs.right, -1)
+ return dirs
+end
+
+-- Returns the axis that dir points along
+local dir_to_axis = function(dir)
+ if dir.x ~= 0 then
+ return "x"
+ elseif dir.y ~= 0 then
+ return "y"
+ else
+ return "z"
+ end
+end
+
+-- Given a hinge definition, turns it into an axis and placement that can be used by the door rotation.
+local interpret_hinge = function(hinge_def, pos, node_dirs)
+ local axis = dir_to_axis(node_dirs[hinge_def.axis])
+
+ local placement
+ if type(hinge_def.offset) == "string" then
+ placement = vector.add(pos, node_dirs[hinge_def.offset])
+ elseif type(hinge_def.offset) == "table" then
+ placement = vector.new(0,0,0)
+ local divisor = 0
+ for _, val in pairs(hinge_def.offset) do
+ placement = vector.add(placement, node_dirs[val])
+ divisor = divisor + 1
+ end
+ placement = vector.add(pos, vector.divide(placement, divisor))
+ else
+ placement = pos
+ end
+
+ return axis, placement
+end
+
+
+--------------------------------------------------------------------------
+-- Rotation (slightly more complex than sliding)
+
+local facedir_rotate = {
+ ['x'] = {
+ [-1] = {[0]=4, 5, 6, 7, 22, 23, 20, 21, 0, 1, 2, 3, 13, 14, 15, 12, 19, 16, 17, 18, 10, 11, 8, 9}, -- 270 degrees
+ [1] = {[0]=8, 9, 10, 11, 0, 1, 2, 3, 22, 23, 20, 21, 15, 12, 13, 14, 17, 18, 19, 16, 6, 7, 4, 5}, -- 90 degrees
+ },
+ ['y'] = {
+ [-1] = {[0]=3, 0, 1, 2, 19, 16, 17, 18, 15, 12, 13, 14, 7, 4, 5, 6, 11, 8, 9, 10, 21, 22, 23, 20}, -- 270 degrees
+ [1] = {[0]=1, 2, 3, 0, 13, 14, 15, 12, 17, 18, 19, 16, 9, 10, 11, 8, 5, 6, 7, 4, 23, 20, 21, 22}, -- 90 degrees
+ },
+ ['z'] = {
+ [-1] = {[0]=16, 17, 18, 19, 5, 6, 7, 4, 11, 8, 9, 10, 0, 1, 2, 3, 20, 21, 22, 23, 12, 13, 14, 15}, -- 270 degrees
+ [1] = {[0]=12, 13, 14, 15, 7, 4, 5, 6, 9, 10, 11, 8, 20, 21, 22, 23, 0, 1, 2, 3, 16, 17, 18, 19}, -- 90 degrees
+ }
+}
+ --90 degrees CW about x-axis: (x, y, z) -> (x, -z, y)
+ --90 degrees CCW about x-axis: (x, y, z) -> (x, z, -y)
+ --90 degrees CW about y-axis: (x, y, z) -> (-z, y, x)
+ --90 degrees CCW about y-axis: (x, y, z) -> (z, y, -x)
+ --90 degrees CW about z-axis: (x, y, z) -> (y, -x, z)
+ --90 degrees CCW about z-axis: (x, y, z) -> (-y, x, z)
+local rotate_pos = function(axis, direction, pos)
+ if axis == "x" then
+ if direction < 0 then
+ return {x= pos.x, y= -pos.z, z= pos.y}
+ else
+ return {x= pos.x, y= pos.z, z= -pos.y}
+ end
+ elseif axis == "y" then
+ if direction < 0 then
+ return {x= -pos.z, y= pos.y, z= pos.x}
+ else
+ return {x= pos.z, y= pos.y, z= -pos.x}
+ end
+ else
+ if direction < 0 then
+ return {x= -pos.y, y= pos.x, z= pos.z}
+ else
+ return {x= pos.y, y= -pos.x, z= pos.z}
+ end
+ end
+end
+
+local rotate_pos_displaced = function(pos, origin, axis, direction)
+ -- position in space relative to origin
+ local newpos = vector.subtract(pos, origin)
+ newpos = rotate_pos(axis, direction, newpos)
+ -- Move back to original reference frame
+ return vector.add(newpos, origin)
+end
+
+local get_buildable_to = function(pos)
+ return minetest.registered_nodes[minetest.get_node(pos).name].buildable_to
+end
+
+
+local get_door_layout = function(pos, facedir, player)
+ -- This method does a flood-fill looking for all nodes that meet the following criteria:
+ -- belongs to a "castle_gate" group
+ -- has the same "back" direction as the initial node
+ -- is accessible via up, down, left or right directions unless one of those directions goes through an edge that one of the two nodes has marked as a gate edge
+ local door = {}
+
+ door.all = {}
+ door.contains_protected_node = false
+ door.directions = get_dirs(facedir)
+ door.previous_move = minetest.get_meta(pos):get_string("previous_move")
+
+ -- temporary pointsets used while searching
+ local to_test = Pointset.create()
+ local tested = Pointset.create()
+ local can_slide_to = Pointset.create()
+
+ local castle_gate_group_value -- this will be populated from the first gate node we encounter, which will be the one that was clicked on
+
+ to_test:set_pos(pos, true)
+
+ local test_pos, _ = to_test:pop()
+ while test_pos ~= nil do
+ tested:set_pos(test_pos, true) -- track nodes we've looked at
+ local test_node = minetest.get_node(test_pos)
+
+ if test_node.name == "ignore" then
+ --array is next to unloaded nodes, too dangerous to do anything. Abort.
+ return nil
+ end
+
+ if minetest.is_protected(test_pos, player:get_player_name()) and not minetest.check_player_privs(player, "protection_bypass") then
+ door.contains_protected_node = true
+ end
+
+ local test_node_def = minetest.registered_nodes[test_node.name]
+ can_slide_to:set_pos(test_pos, test_node_def.buildable_to == true)
+
+ if test_node_def.paramtype2 == "facedir" then
+ local test_node_dirs = get_dirs(test_node.param2)
+ local coplanar = vector.equals(test_node_dirs.back, door.directions.back)
+
+ if castle_gate_group_value == nil and test_node_def.groups.castle_gate ~= nil then
+ castle_gate_group_value = test_node_def.groups.castle_gate -- read the group value from the first gate node encountered
+ end
+
+ if coplanar and test_node_def.groups.castle_gate == castle_gate_group_value then
+ local entry = {["pos"] = test_pos, ["node"] = test_node}
+ table.insert(door.all, entry)
+ if test_node_def._gate_hinge ~= nil then
+ local axis, placement = interpret_hinge(test_node_def._gate_hinge, test_pos, test_node_dirs)
+ if door.hinge == nil then
+ door.hinge = {axis=axis, placement=placement}
+ elseif door.hinge.axis ~= axis then
+ return nil -- Misaligned hinge axes, door cannot rotate.
+ else
+ local axis_dir = {x=0, y=0, z=0}
+ axis_dir[axis] = 1
+ local displacement = vector.normalize(vector.subtract(placement, door.hinge.placement))
+ if not (vector.equals(displacement, axis_dir) or vector.equals(displacement, vector.multiply(axis_dir, -1))) then
+ return nil -- Misaligned hinge offset, door cannot rotate.
+ end
+ end
+ end
+
+ can_slide_to:set_pos(test_pos, true) -- since this is part of the door, other parts of the door can slide into it
+
+ local test_directions = {"top", "bottom", "left", "right"}
+ for _, dir in pairs(test_directions) do
+ local adjacent_pos = vector.add(test_pos, door.directions[dir])
+ local adjacent_node = minetest.get_node(adjacent_pos)
+ local adjacent_def = minetest.registered_nodes[adjacent_node.name]
+ can_slide_to:set_pos(adjacent_pos, adjacent_def.buildable_to == true or adjacent_def.groups.castle_gate)
+
+ if test_node_def._gate_edges == nil or not test_node_def._gate_edges[dir] then -- if we ourselves are an edge node, don't look in the direction we're an edge in
+ if tested:get_pos(adjacent_pos) == nil then -- don't look at nodes that have already been looked at
+ if adjacent_def.paramtype2 == "facedir" then -- all doors are facedir nodes so we can pre-screen some targets
+
+ local edge_points_back_at_test_pos = false
+ -- Look at the adjacent node's definition. If it's got gate edges, check if they point back at us.
+ if adjacent_def._gate_edges ~= nil then
+ local adjacent_directions = get_dirs(adjacent_node.param2)
+ for dir, val in pairs(adjacent_def._gate_edges) do
+ if vector.equals(vector.add(adjacent_pos, adjacent_directions[dir]), test_pos) then
+ edge_points_back_at_test_pos = true
+ break
+ end
+ end
+ end
+
+ if not edge_points_back_at_test_pos then
+ to_test:set_pos(adjacent_pos, true)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+
+ test_pos, _ = to_test:pop()
+ end
+
+ if door.hinge == nil then
+ --sliding door, evaluate which directions it can go
+ door.can_slide = {top=true, bottom=true, left=true, right=true}
+ for _,door_node in pairs(door.all) do
+ door.can_slide.top = door.can_slide.top and can_slide_to:get_pos(vector.add(door_node.pos, door.directions.top))
+ door.can_slide.bottom = door.can_slide.bottom and can_slide_to:get_pos(vector.add(door_node.pos, door.directions.bottom))
+ door.can_slide.left = door.can_slide.left and can_slide_to:get_pos(vector.add(door_node.pos, door.directions.left))
+ door.can_slide.right = door.can_slide.right and can_slide_to:get_pos(vector.add(door_node.pos, door.directions.right))
+ end
+ else
+ --rotating door, evaluate which direction it can go. Slightly more complicated.
+ local origin = door.hinge.placement
+ local axis = door.hinge.axis
+ local backfront = dir_to_axis(door.directions.back)
+ local leftright = dir_to_axis(door.directions.right)
+
+ door.swings = {}
+
+ for _, direction in pairs({-1, 1}) do
+ door.swings[direction] = true
+ for _, door_node in pairs(door.all) do
+ origin[axis] = door_node.pos[axis]
+ if not vector.equals(door_node.pos, origin) then -- There's no obstruction if the node is literally located along the rotation axis
+ local newpos = rotate_pos_displaced(door_node.pos, origin, axis, direction)
+ local newnode = minetest.get_node(newpos)
+ local newdef = minetest.registered_nodes[newnode.name]
+ if not newdef.buildable_to then -- check if the destination node is free.
+ door.swings[direction] = false
+ break
+ end
+
+ local swing_corner = {} -- the corner of the square "arc" that a Minetest gate swings through
+ local scan_dir
+ swing_corner[axis] = door_node.pos[axis]
+ swing_corner[backfront] = newpos[backfront]
+ swing_corner[leftright] = door_node.pos[leftright]
+ if not (vector.equals(newpos, swing_corner) or vector.equals(door_node.pos, swing_corner)) then -- we're right next to the hinge, no need for further testing
+ scan_dir = vector.direction(newpos, swing_corner) -- get the direction from the new door position toward the swing corner
+ repeat
+ newpos = vector.add(newpos, scan_dir) -- we start with newpos on the destination node, which has already been tested.
+ if not get_buildable_to(newpos) then
+ door.swings[direction] = false
+ end
+ until vector.equals(newpos, swing_corner) or door.swings[direction] == false
+
+ if not (vector.equals(newpos, door_node.pos) or door.swings[direction] == false) then
+ scan_dir = vector.direction(newpos, door_node.pos)
+ newpos = vector.add(newpos, scan_dir) -- the first step here is a freebie since we've already checked swing_corner
+ while not (vector.equals(newpos, door_node.pos) or door.swings[direction] == false) do
+ if not get_buildable_to(newpos) then
+ door.swings[direction] = false
+ end
+ newpos = vector.add(newpos, scan_dir)
+ end
+ end
+ end
+ end
+
+ if door.swings[direction] == false then
+ break
+ end
+
+ end
+ end
+ end
+ return door
+end
+
+
+local slide_gate = function(door, direction)
+ for _, door_node in pairs(door.all) do
+ door_node.pos = vector.add(door_node.pos, door.directions[direction])
+ end
+ door.previous_move = direction
+end
+
+local rotate_door = function (door, direction)
+ if not door.swings[direction] then
+ return false
+ end
+
+ local origin = door.hinge.placement
+ local axis = door.hinge.axis
+
+ for _, door_node in pairs(door.all) do
+ door_node.pos = rotate_pos_displaced(door_node.pos, origin, axis, direction)
+ door_node.node.param2 = facedir_rotate[axis][direction][door_node.node.param2]
+ end
+ return true
+end
+
+
+----------------------------------------------------------------------------------------------------
+-- When creating new gate pieces use this as the "on_rightclick" method of their node definitions
+-- if you want the player to be able to trigger the gate by clicking on that particular node.
+-- If you just want the node to move with the gate and not trigger it this isn't necessary,
+-- only the "castle_gate" group is needed for that.
+
+castle_gates.trigger_gate = function(pos, node, player)
+ local door = get_door_layout(pos, node.param2, player)
+
+ if door ~= nil then
+ for _, door_node in pairs(door.all) do
+ minetest.set_node(door_node.pos, {name="air"})
+ end
+
+ local door_moved = false
+ if door.can_slide ~= nil then -- this is a sliding door
+ if door.previous_move == "top" and door.can_slide.top then
+ slide_gate(door, "top")
+ door_moved = true
+ elseif door.previous_move == "bottom" and door.can_slide.bottom then
+ slide_gate(door, "bottom")
+ door_moved = true
+ elseif door.previous_move == "left" and door.can_slide.left then
+ slide_gate(door, "left")
+ door_moved = true
+ elseif door.previous_move == "right" and door.can_slide.right then
+ slide_gate(door, "right")
+ door_moved = true
+ end
+
+ if not door_moved then -- reverse door's direction for next time
+ if door.previous_move == "top" and door.can_slide.bottom then
+ door.previous_move = "bottom"
+ elseif door.previous_move == "bottom" and door.can_slide.top then
+ door.previous_move = "top"
+ elseif door.previous_move == "left" and door.can_slide.right then
+ door.previous_move = "right"
+ elseif door.previous_move == "right" and door.can_slide.left then
+ door.previous_move = "left"
+ else
+ -- find any open direction
+ for slide_dir, enabled in pairs(door.can_slide) do
+ if enabled then
+ door.previous_move = slide_dir
+ break
+ end
+ end
+ end
+ end
+ elseif door.hinge ~= nil then -- this is a hinged door
+ if door.previous_move == "deosil" then
+ door_moved = rotate_door(door, 1)
+ elseif door.previous_move == "widdershins" then
+ door_moved = rotate_door(door, -1)
+ end
+
+ if not door_moved then
+ if door.previous_move == "deosil" then
+ door.previous_move = "widdershins"
+ else
+ door.previous_move = "deosil"
+ end
+ end
+ end
+
+ for _, door_node in pairs(door.all) do
+ minetest.set_node(door_node.pos, door_node.node)
+ minetest.get_meta(door_node.pos):set_string("previous_move", door.previous_move)
+ end
+
+ if door_moved then
+ minetest.after(1, function()
+ castle_gates.trigger_gate(door.all[1].pos, door.all[1].node, player)
+ end)
+ end
+ end
+end \ No newline at end of file
diff --git a/castle_gates/gate_slots.lua b/castle_gates/gate_slots.lua
new file mode 100644
index 0000000..8f3c095
--- /dev/null
+++ b/castle_gates/gate_slots.lua
@@ -0,0 +1,138 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+-- copied from castle_masonry in case that mod is not loaded
+local get_material_properties = function(material)
+ local composition_def
+ local burn_time
+ if material.composition_material ~= nil then
+ composition_def = minetest.registered_nodes[material.composition_material]
+ burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.composition_material)}}).time
+ else
+ composition_def = minetest.registered_nodes[material.craft_material]
+ burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.craft_materia)}}).time
+ end
+
+ local tiles = material.tile
+ if tiles == nil then
+ tiles = composition_def.tile
+ elseif type(tiles) == "string" then
+ tiles = {tiles}
+ end
+
+ local desc = material.desc
+ if desc == nil then
+ desc = composition_def.description
+ end
+
+ return composition_def, burn_time, tiles, desc
+end
+
+local materials
+if minetest.get_modpath("castle_masonry") then
+ materials = castle_masonry.materials
+else
+ materials = {{name="stonebrick", desc=S("Stonebrick"), tile="default_stone_brick.png", craft_material="default:stonebrick"}}
+end
+
+castle_gates.register_gate_slot = function(material)
+ local composition_def, burn_time, tile, desc = get_material_properties(material)
+ local mod_name = minetest.get_current_modname()
+
+ minetest.register_node(mod_name..":"..material.name.."_gate_slot", {
+ drawtype = "nodebox",
+ description = S("@1 Gate Slot", desc),
+ _doc_items_longdesc = castle_gates.doc.gate_slot_longdesc,
+ _doc_items_usagehelp = castle_gates.doc.gate_slot_usagehelp,
+ tiles = tile,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- body
+ {-0.5, -0.5, -0.75, 0.5, 0.5, -1.5}, -- bracket
+ }
+ },
+
+ collision_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 1.5}, -- body
+ },
+ })
+
+ minetest.register_node(mod_name..":"..material.name.."_gate_slot_reverse", {
+ drawtype = "nodebox",
+ description = S("@1 Gate Slot Reverse", desc),
+ _doc_items_longdesc = castle_gates.doc.gate_slot_reverse_longdesc,
+ _doc_items_usagehelp = castle_gates.doc.gate_slot_reverse_usagehelp,
+ tiles = tile,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -1.25, 0.5, 0.5, 0.5}, -- body
+ }
+ },
+
+ collision_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -1.25, 0.5, 0.5, 0.5}, -- body
+ },
+ })
+
+
+ minetest.register_craft({
+ output = mod_name..":"..material.name.."_portcullis_slot 3",
+ recipe = {
+ {material.craft_material,"",material.craft_material},
+ {material.craft_material,"",material.craft_material},
+ {material.craft_material,"",material.craft_material},
+ },
+ })
+
+ minetest.register_craft({
+ output = mod_name..":"..material.name.."_portcullis_slot",
+ type = "shapeless",
+ recipe = {mod_name..":"..material.name.."_portcullis_slot_reverse"},
+ })
+ minetest.register_craft({
+ output = mod_name..":"..material.name.."_portcullis_slot_reverse",
+ type = "shapeless",
+ recipe = {mod_name..":"..material.name.."_portcullis_slot"},
+ })
+
+ if burn_time > 0 then
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":"..material.name.."_portcullis_slot",
+ burntime = burn_time * 2,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":"..material.name.."_portcullis_slot_reverse",
+ burntime = burn_time * 2,
+ })
+ end
+end
+
+castle_gates.register_gate_slot_alias = function(old_mod_name, old_material_name, new_mod_name, new_material_name)
+ minetest.register_alias(old_mod_name..":"..old_material_name.."_gate_slot", new_mod_name..":"..new_material_name.."_gate_slot")
+ minetest.register_alias(old_mod_name..":"..old_material_name.."_gate_slot_reverse", new_mod_name..":"..new_material_name.."_gate_slot_reverse")
+end
+castle_gates.register_gate_slot_alias_force = function(old_mod_name, old_material_name, new_mod_name, new_material_name)
+ minetest.register_alias_force(old_mod_name..":"..old_material_name.."_gate_slot", new_mod_name..":"..new_material_name.."_gate_slot")
+ minetest.register_alias_force(old_mod_name..":"..old_material_name.."_gate_slot_reverse", new_mod_name..":"..new_material_name.."_gate_slot_reverse")
+end
+
+for _, material in pairs(materials) do
+ castle_gates.register_gate_slot(material)
+end
diff --git a/castle_gates/gates.lua b/castle_gates/gates.lua
new file mode 100644
index 0000000..e7195ef
--- /dev/null
+++ b/castle_gates/gates.lua
@@ -0,0 +1,243 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+minetest.register_node("castle_gates:portcullis_bars", {
+ drawtype = "nodebox",
+ description = S("Portcullis Bars"),
+ _doc_items_longdesc = castle_gates.doc.portcullis_bars_longdesc,
+ _doc_items_usagehelp = castle_gates.doc.portcullis_bars_usagehelp,
+ groups = {castle_gate = 1, choppy = 1, flow_through = 1},
+ tiles = {
+ "castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
+ "castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90",
+ "castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
+ "castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
+ },
+ sounds = default.node_sound_wood_defaults(),
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.125, -0.5, -0.5, 0.125, 0.5, -0.25}, -- middle bar
+ {-0.5, -0.5, -0.5, -0.375, 0.5, -0.25}, -- side bar
+ {0.375, -0.5, -0.5, 0.5, 0.5, -0.25}, -- side bar
+ {-0.375, 0.1875, -0.4375, 0.375, 0.3125, -0.3125}, -- crosspiece
+ {-0.375, -0.3125, -0.4375, 0.375, -0.1875, -0.3125}, -- crosspiece
+ }
+ },
+ on_rightclick = castle_gates.trigger_gate,
+})
+
+minetest.register_node("castle_gates:portcullis_bars_bottom", {
+ drawtype = "nodebox",
+ description = S("Portcullis Bottom"),
+ _doc_items_longdesc = castle_gates.doc.portcullis_bars_bottom_longdesc,
+ _doc_items_usagehelp = castle_gates.doc.portcullis_bars_bottom_usagehelp,
+ groups = {castle_gate = 1, choppy = 1, flow_through = 1},
+ tiles = {
+ "castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
+ "castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90",
+ "castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
+ "castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
+ },
+ sounds = default.node_sound_wood_defaults(),
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.125, -0.5, -0.5, 0.125, 0.5, -0.25}, -- middle bar
+ {-0.5, -0.5, -0.5, -0.375, 0.5, -0.25}, -- side bar
+ {0.375, -0.5, -0.5, 0.5, 0.5, -0.25}, -- side bar
+ {-0.375, 0.1875, -0.4375, 0.375, 0.3125, -0.3125}, -- crosspiece
+ {-0.375, -0.3125, -0.4375, 0.375, -0.1875, -0.3125}, -- crosspiece
+ {-0.0625, -0.5, -0.4375, 0.0625, -0.625, -0.3125}, -- peg
+ {0.4375, -0.5, -0.4375, 0.5, -0.625, -0.3125}, -- peg
+ {-0.5, -0.5, -0.4375, -0.4375, -0.625, -0.3125}, -- peg
+ }
+ },
+ _gate_edges = {bottom=true},
+ on_rightclick = castle_gates.trigger_gate,
+})
+
+minetest.register_craft({
+ output = "castle_gates:portcullis_bars 3",
+ recipe = {
+ {"group:wood","default:steel_ingot","group:wood" },
+ {"group:wood","default:steel_ingot","group:wood" },
+ {"group:wood","default:steel_ingot","group:wood" },
+ },
+})
+
+minetest.register_craft({
+ output = "castle_gates:portcullis_bars",
+ recipe = {
+ {"castle_gates:portcullis_bars_bottom"}
+ },
+})
+
+minetest.register_craft({
+ output = "castle_gates:portcullis_bars_bottom",
+ recipe = {
+ {"castle_gates:portcullis_bars"}
+ },
+})
+
+--------------------------------------------------------------------------------------------------------------
+
+minetest.register_craft({
+ output = "castle_gates:gate_panel 8",
+ recipe = {
+ {"stairs:slab_wood","stairs:slab_wood", ""},
+ {"stairs:slab_wood","stairs:slab_wood", ""},
+ },
+})
+
+minetest.register_node("castle_gates:gate_panel", {
+ drawtype = "nodebox",
+ description = S("Gate Door"),
+ _doc_items_longdesc = castle_gates.doc.gate_panel_longdesc,
+ _doc_items_usagehelp = castle_gates.doc.gate_panel_usagehelp,
+ groups = {choppy = 1, castle_gate = 1},
+ tiles = {
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90",
+ },
+ sounds = default.node_sound_wood_defaults(),
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, 0.5, -0.25},
+ }
+ },
+ on_rightclick = castle_gates.trigger_gate,
+})
+
+minetest.register_craft({
+ output = "castle_gates:gate_edge",
+ type = "shapeless",
+ recipe = {"castle_gates:gate_panel"},
+})
+
+minetest.register_node("castle_gates:gate_edge", {
+ drawtype = "nodebox",
+ description = S("Gate Door Edge"),
+ _doc_items_longdesc = castle_gates.doc.gate_edge_longdesc,
+ _doc_items_usagehelp = castle_gates.doc.gate_edge_usagehelp,
+ groups = {choppy = 1, castle_gate = 1},
+ tiles = {
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90",
+ "default_wood.png^[transformR90^(default_coal_block.png^[mask:castle_door_edge_mask.png^[transformFX)",
+ "default_wood.png^[transformR90^(default_coal_block.png^[mask:castle_door_edge_mask.png)",
+ },
+ sounds = default.node_sound_wood_defaults(),
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, 0.5, -0.25},
+ }
+ },
+ _gate_edges = {right=true},
+ on_rightclick = castle_gates.trigger_gate,
+})
+
+minetest.register_craft({
+ output = "castle_gates:gate_edge_handle",
+ type = "shapeless",
+ recipe = {"castle_gates:gate_edge"},
+})
+
+minetest.register_craft({
+ output = "castle_gates:gate_panel",
+ type = "shapeless",
+ recipe = {"castle_gates:gate_edge_handle"},
+})
+
+minetest.register_node("castle_gates:gate_edge_handle", {
+ drawtype = "nodebox",
+ description = S("Gate Door With Handle"),
+ _doc_items_longdesc = castle_gates.doc.gate_edge_handle_longdesc,
+ _doc_items_usagehelp = castle_gates.doc.gate_edge_handle_usagehelp,
+ groups = {choppy = 1, castle_gate = 1},
+ tiles = {
+ "castle_steel.png^(default_wood.png^[mask:castle_door_side_mask.png^[transformR90)",
+ "castle_steel.png^(default_wood.png^[mask:castle_door_side_mask.png^[transformR270)",
+ "castle_steel.png^(default_wood.png^[transformR90^[mask:castle_door_side_mask.png)",
+ "castle_steel.png^(default_wood.png^[transformR90^[mask:(castle_door_side_mask.png^[transformFX))",
+ "default_wood.png^[transformR90^(default_coal_block.png^[mask:castle_door_edge_mask.png^[transformFX)^(castle_steel.png^[mask:castle_door_handle_mask.png^[transformFX)",
+ "default_wood.png^[transformR90^(default_coal_block.png^[mask:castle_door_edge_mask.png)^(castle_steel.png^[mask:castle_door_handle_mask.png)",
+ },
+ sounds = default.node_sound_wood_defaults(),
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, 0.5, -0.25},
+ {4/16, -4/16, -2/16, 6/16, 4/16, -3/16},
+ {4/16, -4/16, -9/16, 6/16, 4/16, -10/16},
+ {4/16, -4/16, -9/16, 6/16, -3/16, -3/16},
+ {4/16, 4/16, -9/16, 6/16, 3/16, -3/16},
+ }
+ },
+ _gate_edges = {right=true},
+ on_rightclick = castle_gates.trigger_gate,
+})
+
+
+------------------------------------------------------------------------------
+
+minetest.register_craft({
+ output = "castle_gates:gate_hinge 3",
+ recipe = {
+ {"", "castle_gates:gate_panel", ""},
+ {"default:steel_ingot", "castle_gates:gate_panel", ""},
+ {"", "castle_gates:gate_panel", ""}
+ },
+})
+
+minetest.register_node("castle_gates:gate_hinge", {
+ drawtype = "nodebox",
+ description = S("Gate Door With Hinge"),
+ _doc_items_longdesc = castle_gates.doc.gate_hinge_longdesc,
+ _doc_items_usagehelp = castle_gates.doc.gate_hinge_usagehelp,
+ groups = {choppy = 1, castle_gate = 1},
+ tiles = {
+ "default_wood.png^[transformR90",
+ },
+ sounds = default.node_sound_wood_defaults(),
+ paramtype = "light",
+ paramtype2 = "facedir",
+
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, 0.5, -0.25},
+ {-10/16, -4/16, -10/16, -6/16, 4/16, -6/16},
+ }
+ },
+ collision_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, -0.25},
+ },
+
+ _gate_hinge = {axis="top", offset={"front","left"}},
+ on_rightclick = castle_gates.trigger_gate,
+})
diff --git a/castle_gates/init.lua b/castle_gates/init.lua
new file mode 100644
index 0000000..3292cef
--- /dev/null
+++ b/castle_gates/init.lua
@@ -0,0 +1,8 @@
+castle_gates = {}
+
+local modpath = minetest.get_modpath(minetest.get_current_modname())
+dofile(modpath.."/doc.lua")
+dofile(modpath.."/gate_functions.lua")
+dofile(modpath.."/gate_slots.lua")
+dofile(modpath.."/gates.lua")
+dofile(modpath.."/doors.lua")
diff --git a/castle_gates/intllib.lua b/castle_gates/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/castle_gates/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/castle_gates/locale/template.pot b/castle_gates/locale/template.pot
new file mode 100644
index 0000000..2122c17
--- /dev/null
+++ b/castle_gates/locale/template.pot
@@ -0,0 +1,202 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-03-01 23:41-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: doc.lua:11
+msgid "Heavy wooden bars designed to prevent entry even to siege equipment."
+msgstr ""
+
+#: doc.lua:12
+msgid ""
+"Place these bars in a structure together and they will slide as a unified "
+"gate when clicked on."
+msgstr ""
+
+#: doc.lua:14
+msgid ""
+"The bottom edge of a portcullis gate, with knobs to lock securely into the "
+"floor."
+msgstr ""
+
+#: doc.lua:15
+msgid ""
+"This block can be used to define the edge of a portcullius that meets up "
+"with another gate, should you have an arrangement like that. Otherwise it's "
+"just decorative."
+msgstr ""
+
+#: doc.lua:17
+msgid "A basic gate panel."
+msgstr ""
+
+#: doc.lua:18
+msgid ""
+"This gate segment will move in unison with adjoining gate segments when "
+"right-clicked."
+msgstr ""
+
+#: doc.lua:20
+msgid "A gate panel with a defined edge."
+msgstr ""
+
+#: doc.lua:21
+msgid ""
+"The darkened edge of this panel marks the edge of the gate it's a part of. "
+"You can use these when building double doors to ensure the two parts swing "
+"separately, for example. Note that edges aren't strictly necessary for gates "
+"that stand alone."
+msgstr ""
+
+#: doc.lua:23
+msgid "A gate edge with a handle."
+msgstr ""
+
+#: doc.lua:24
+msgid ""
+"The handle is basically decorative, a door this size can be swung by "
+"clicking anywhere on it. But the darkened edge of this panel is useful for "
+"defining the edge of a gate when it abuts a partner to the side."
+msgstr ""
+
+#: doc.lua:26
+msgid "A hinged gate segment that allows a gate to swing."
+msgstr ""
+
+#: doc.lua:27
+msgid ""
+"If you have more than one hinge in your gate, make sure the hinges line up "
+"correctly otherwise the gate will not be able to swing. The hinge is the "
+"protruding block along the edge of the gate panel."
+msgstr ""
+
+#: doc.lua:29
+msgid "A block with a slot to allow an adjacent sliding gate through."
+msgstr ""
+
+#: doc.lua:30
+msgid ""
+"This block is designed to extend into a neighboring node that a sliding gate "
+"passes through, to provide a tight seal for the gate to move through without "
+"allowing anything else to squeeze in."
+msgstr ""
+
+#: doc.lua:32
+msgid ""
+"A block that extends into an adjacent node to provide a tight seal for a "
+"large gate."
+msgstr ""
+
+#: doc.lua:33
+msgid ""
+"Two nodes cannot occupy the same space, but this block extends into a "
+"neighboring node's space to allow for gates to form a tight seal. It can be "
+"used with sliding gates or swinging gates."
+msgstr ""
+
+#: doc.lua:37
+msgid "Gates"
+msgstr ""
+
+#: doc.lua:38
+msgid ""
+"Gates are large multi-node constructions that swing on hinges or slide out "
+"of the way when triggered."
+msgstr ""
+
+#: doc.lua:43
+msgid "Gate construction"
+msgstr ""
+
+#: doc.lua:45
+msgid ""
+"Gates are multi-node constructions, usually (though not always) consisting "
+"of multiple node types that fit together into a unified whole. The "
+"orientation of gate nodes is significant, so a screwdriver will be a helpful "
+"tool when constructing gates.\n"
+"\n"
+"A gate's extent is determined by a \"flood fill\" operation. When you "
+"trigger a gate block, all compatible neighboring blocks will be considered "
+"part of the same structure and will move in unison. Only gate blocks that "
+"are aligned with each other will be considered part of the same gate. If you "
+"wish to build adjoining gates (for example, a large pair of double doors "
+"that meet in the center) you'll need to make use of gate edge blocks to "
+"prevent it all from being considered one big door. Note that if your gate "
+"does not abut any other gates you don't actually need to define its edges "
+"this way - you don't have to use edge blocks in this case.\n"
+"\n"
+"If a gate has no hinge nodes it will be considered a sliding gate. When "
+"triggered, the gate code will search for a direction that the gate can slide "
+"in and will move it in that direction at a rate of one block-length per "
+"second. Once it reaches an obstruction it will stop, and when triggered "
+"again it will try sliding in the opposite direction.\n"
+"\n"
+"If a gate has hinge nodes then triggering it will cause the gate to try "
+"swinging around the hinge. If the gate has multiple hinges and they don't "
+"line up properly the gate will be unable to move. Note that the gate can "
+"only exist in 90-degree increments of orientation, but the gate still looks "
+"for obstructions in the region it is swinging through and will not swing if "
+"there's something in the way."
+msgstr ""
+
+#: doors.lua:8
+msgid "Oak Door"
+msgstr ""
+
+#: doors.lua:22
+msgid "Jail Door"
+msgstr ""
+
+#: doors.lua:43
+msgid "Jail Bars"
+msgstr ""
+
+#: gate_slots.lua:36
+msgid "Stonebrick"
+msgstr ""
+
+#: gate_slots.lua:45
+msgid "@1 Gate Slot"
+msgstr ""
+
+#: gate_slots.lua:70
+msgid "@1 Gate Slot Reverse"
+msgstr ""
+
+#: gates.lua:7
+msgid "Portcullis Bars"
+msgstr ""
+
+#: gates.lua:37
+msgid "Portcullis Bottom"
+msgstr ""
+
+#: gates.lua:104
+msgid "Gate Door"
+msgstr ""
+
+#: gates.lua:136
+msgid "Gate Door Edge"
+msgstr ""
+
+#: gates.lua:175
+msgid "Gate Door With Handle"
+msgstr ""
+
+#: gates.lua:218
+msgid "Gate Door With Hinge"
+msgstr ""
diff --git a/castle_gates/mod.conf b/castle_gates/mod.conf
new file mode 100644
index 0000000..1ad7f80
--- /dev/null
+++ b/castle_gates/mod.conf
@@ -0,0 +1 @@
+name = castle_gates
diff --git a/castle_gates/screenshot.png b/castle_gates/screenshot.png
new file mode 100644
index 0000000..54163c8
--- /dev/null
+++ b/castle_gates/screenshot.png
Binary files differ
diff --git a/castle_gates/textures/LICENSE.txt b/castle_gates/textures/LICENSE.txt
new file mode 100644
index 0000000..38224f3
--- /dev/null
+++ b/castle_gates/textures/LICENSE.txt
@@ -0,0 +1,11 @@
+16 px textures based on Castle mod
+original textures by Philipner
+
+License Textures: Napiophelios - CC-BY-SA 3.0
+
+-castle_door_jail.png
+-castle_door_oak.png
+-castle_jail_door_inv.png
+-castle_jailbars.png
+-castle_oak_door_inv.png
+-castle_steel.png
diff --git a/castle_gates/textures/castle_door_edge_mask.png b/castle_gates/textures/castle_door_edge_mask.png
new file mode 100644
index 0000000..59ae96b
--- /dev/null
+++ b/castle_gates/textures/castle_door_edge_mask.png
Binary files differ
diff --git a/castle_gates/textures/castle_door_handle_mask.png b/castle_gates/textures/castle_door_handle_mask.png
new file mode 100644
index 0000000..6417aaf
--- /dev/null
+++ b/castle_gates/textures/castle_door_handle_mask.png
Binary files differ
diff --git a/castle_gates/textures/castle_door_jail.png b/castle_gates/textures/castle_door_jail.png
new file mode 100644
index 0000000..0d4f7bf
--- /dev/null
+++ b/castle_gates/textures/castle_door_jail.png
Binary files differ
diff --git a/castle_gates/textures/castle_door_oak.png b/castle_gates/textures/castle_door_oak.png
new file mode 100644
index 0000000..2282fb2
--- /dev/null
+++ b/castle_gates/textures/castle_door_oak.png
Binary files differ
diff --git a/castle_gates/textures/castle_door_side_mask.png b/castle_gates/textures/castle_door_side_mask.png
new file mode 100644
index 0000000..039803c
--- /dev/null
+++ b/castle_gates/textures/castle_door_side_mask.png
Binary files differ
diff --git a/castle_gates/textures/castle_jail_door_inv.png b/castle_gates/textures/castle_jail_door_inv.png
new file mode 100644
index 0000000..5121fb8
--- /dev/null
+++ b/castle_gates/textures/castle_jail_door_inv.png
Binary files differ
diff --git a/castle_gates/textures/castle_jailbars.png b/castle_gates/textures/castle_jailbars.png
new file mode 100644
index 0000000..e2cc911
--- /dev/null
+++ b/castle_gates/textures/castle_jailbars.png
Binary files differ
diff --git a/castle_gates/textures/castle_oak_door_inv.png b/castle_gates/textures/castle_oak_door_inv.png
new file mode 100644
index 0000000..1122d51
--- /dev/null
+++ b/castle_gates/textures/castle_oak_door_inv.png
Binary files differ
diff --git a/castle_gates/textures/castle_portcullis_mask.png b/castle_gates/textures/castle_portcullis_mask.png
new file mode 100644
index 0000000..ac5d8e2
--- /dev/null
+++ b/castle_gates/textures/castle_portcullis_mask.png
Binary files differ
diff --git a/castle_gates/textures/castle_steel.png b/castle_gates/textures/castle_steel.png
new file mode 100644
index 0000000..28ecd60
--- /dev/null
+++ b/castle_gates/textures/castle_steel.png
Binary files differ
diff --git a/castle_lighting/LICENSE b/castle_lighting/LICENSE
new file mode 100644
index 0000000..456d091
--- /dev/null
+++ b/castle_lighting/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Minetest Mods Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/castle_lighting/README.txt b/castle_lighting/README.txt
new file mode 100644
index 0000000..90fb450
--- /dev/null
+++ b/castle_lighting/README.txt
@@ -0,0 +1,23 @@
+=-=-=-=-=-=-=-=-=-=
+
+Castles Mod
+by: Philipbenr And DanDuncombe
+
+=-=-=-=-=-=-=-=-=-=
+
+Licence: MIT
+
+see: LICENSE
+
+=-=-=-=-=-=-=-=-=-=
+
+This mod contains medieval lighting sources suitable for a castle. It includes:
+
+* Small chandelier and hanging chain
+* Lantern box
+* Steel floor brasier
+* Stone pedestal/column brasier.
+
+If the castle_masonry mod is installed, brasiers will be generated for all enabled material types.
+
+Brasiers require fuel to generate a flame. \ No newline at end of file
diff --git a/castle_lighting/brasier.lua b/castle_lighting/brasier.lua
new file mode 100644
index 0000000..b461e52
--- /dev/null
+++ b/castle_lighting/brasier.lua
@@ -0,0 +1,267 @@
+if not minetest.get_modpath("fire") then return end
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+local brasier_longdesc = S("A brasier for producing copious amounts of light and heat.")
+local brasier_usagehelp = S("To ignite the brasier place a flammable fuel in its inventory slot. A lump of coal will burn for about half an hour.")
+
+local brasier_nodebox = {
+ type = "fixed",
+ fixed = {
+ {-0.25, 0, -0.25, 0.25, 0.125, 0.25}, -- base
+ {-0.375, 0.125, -0.375, 0.375, 0.25, 0.375}, -- mid
+ {-0.5, 0.25, -0.5, 0.5, 0.375, 0.5}, -- plat
+ {-0.5, 0.375, 0.375, 0.5, 0.5, 0.5}, -- edge
+ {-0.5, 0.375, -0.5, 0.5, 0.5, -0.375}, -- edge
+ {0.375, 0.375, -0.375, 0.5, 0.5, 0.375}, -- edge
+ {-0.5, 0.375, -0.375, -0.375, 0.5, 0.375}, -- edge
+ {0.25, -0.5, -0.375, 0.375, 0.125, -0.25}, -- leg
+ {-0.375, -0.5, 0.25, -0.25, 0.125, 0.375}, -- leg
+ {0.25, -0.5, 0.25, 0.375, 0.125, 0.375}, -- leg
+ {-0.375, -0.5, -0.375, -0.25, 0.125, -0.25}, -- leg
+ {-0.125, -0.0625, -0.125, 0.125, 0, 0.125}, -- bottom_knob
+ }
+}
+local brasier_selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.375, -0.5, -0.375, 0.375, 0.25, 0.375}, -- mid
+ {-0.5, 0.25, -0.5, 0.5, 0.5, 0.5}, -- plat
+ }
+}
+
+local brasier_burn = function(pos)
+ local pos_above = {x=pos.x, y=pos.y+1, z=pos.z}
+ local node_above = minetest.get_node(pos_above)
+ local timer = minetest.get_node_timer(pos)
+
+ if timer:is_started() and node_above.name == "fire:permanent_flame" then return end -- already burning, don't burn a new thing.
+
+ local inv = minetest.get_inventory({type="node", pos=pos})
+ local item = inv:get_stack("fuel", 1)
+ local fuel_burned = minetest.get_craft_result({method="fuel", width=1, items={item:peek_item(1)}}).time
+
+ if fuel_burned > 0 and (node_above.name == "air" or node_above.name == "fire:permanent_flame") then
+ item:set_count(item:get_count() - 1)
+ inv:set_stack("fuel", 1, item)
+
+ timer:start(fuel_burned * 60) -- one minute of flame per second of burn time, for balance.
+
+ if node_above.name == "air" then
+ minetest.set_node(pos_above, {name = "fire:permanent_flame"})
+ end
+ else
+ if node_above.name == "fire:permanent_flame" then
+ minetest.set_node(pos_above, {name = "air"})
+ end
+ end
+end
+
+local brasier_on_construct = function(pos)
+ local inv = minetest.get_meta(pos):get_inventory()
+ inv:set_size("fuel", 1)
+
+ local meta = minetest.get_meta(pos)
+ meta:set_string("formspec",
+ "size[8,5.3]" ..
+ default.gui_bg ..
+ default.gui_bg_img ..
+ default.gui_slots ..
+ "list[current_name;fuel;3.5,0;1,1;]" ..
+ "list[current_player;main;0,1.15;8,1;]" ..
+ "list[current_player;main;0,2.38;8,3;8]" ..
+ "listring[current_name;main]" ..
+ "listring[current_player;main]" ..
+ default.get_hotbar_bg(0,1.15)
+ )
+end
+
+local brasier_on_destruct = function(pos, oldnode)
+ local pos_above = {x=pos.x, y=pos.y+1, z=pos.z}
+ local node_above = minetest.get_node(pos_above)
+ if node_above.name == "fire:permanent_flame" then
+ minetest.set_node(pos_above, {name = "air"})
+ end
+end
+
+local brasier_can_dig = function(pos, player)
+ local inv = minetest.get_meta(pos):get_inventory()
+ return inv:is_empty("fuel")
+end
+
+-- Only allow fuel items to be placed in fuel
+local brasier_allow_metadata_inventory_put = function(pos, listname, index, stack, player)
+ if listname == "fuel" then
+ if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then
+ return stack:get_count()
+ else
+ return 0
+ end
+ end
+ return 0
+end
+
+minetest.register_node("castle_lighting:brasier_floor", {
+ description = S("Floor Brasier"),
+ _doc_items_longdesc = brasier_longdesc,
+ _doc_items_usagehelp = brasier_usagehelp,
+ tiles = {
+ "castle_steel.png^(castle_coal_bed.png^[mask:castle_brasier_bed_mask.png)",
+ "castle_steel.png",
+ "castle_steel.png",
+ "castle_steel.png",
+ "castle_steel.png",
+ "castle_steel.png",
+ },
+ drawtype = "nodebox",
+ groups = {cracky=2},
+ paramtype = "light",
+ node_box = brasier_nodebox,
+ selection_box = brasier_selection_box,
+
+ on_construct = brasier_on_construct,
+ on_destruct = brasier_on_destruct,
+ can_dig = brasier_can_dig,
+ allow_metadata_inventory_put = brasier_allow_metadata_inventory_put,
+ on_metadata_inventory_put = brasier_burn,
+ on_timer = brasier_burn,
+})
+
+
+minetest.register_craft({
+ output = "castle_lighting:brasier_floor",
+ recipe = {
+ {"default:steel_ingot", "default:torch", "default:steel_ingot"},
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+ }
+})
+
+if minetest.get_modpath("hopper") and hopper ~= nil and hopper.add_container ~= nil then
+ hopper:add_container({
+ {"top", "castle_lighting:brasier_floor", "fuel"},
+ {"bottom", "castle_lighting:brasier_floor", "fuel"},
+ {"side", "castle_lighting:brasier_floor", "fuel"},
+ })
+end
+
+------------------------------------------------------------------------------------------------------
+-- Masonry brasiers
+
+local materials
+if minetest.get_modpath("castle_masonry") then
+ materials = castle_masonry.materials
+else
+ materials = {{name="stonebrick", desc=S("Stonebrick"), tile="default_stone_brick.png", craft_material="default:stonebrick"}}
+end
+
+local get_material_properties = function(material)
+ local composition_def
+ local burn_time
+ if material.composition_material ~= nil then
+ composition_def = minetest.registered_nodes[material.composition_material]
+ burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.composition_material)}}).time
+ else
+ composition_def = minetest.registered_nodes[material.craft_material]
+ burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.craft_materia)}}).time
+ end
+
+ local tiles = material.tile
+ if tiles == nil then
+ tiles = composition_def.tile
+ elseif type(tiles) == "string" then
+ tiles = {tiles}
+ end
+
+ -- Apply bed of coals to the texture.
+ if table.getn(tiles) == 1 then
+ tiles = {tiles[1].."^(castle_coal_bed.png^[mask:castle_brasier_bed_mask.png)", tiles[1], tiles[1], tiles[1], tiles[1], tiles[1]}
+ else
+ tiles[1] = tiles[1].."^(castle_coal_bed.png^[mask:castle_brasier_bed_mask.png)"
+ end
+
+ local desc = material.desc
+ if desc == nil then
+ desc = composition_def.description
+ end
+
+ return composition_def, burn_time, tiles, desc
+end
+
+local pillar_brasier_nodebox = {
+ type = "fixed",
+ fixed = {
+ {-0.375, 0.125, -0.375, 0.375, 0.25, 0.375}, -- mid
+ {-0.5, 0.25, -0.5, 0.5, 0.375, 0.5}, -- plat
+ {-0.5, 0.375, 0.375, 0.5, 0.5, 0.5}, -- edge
+ {-0.5, 0.375, -0.5, 0.5, 0.5, -0.375}, -- edge
+ {0.375, 0.375, -0.375, 0.5, 0.5, 0.375}, -- edge
+ {-0.5, 0.375, -0.375, -0.375, 0.5, 0.375}, -- edge
+ {-0.25,-0.5,-0.25,0.25,0.125,0.25}, -- support
+ }
+}
+
+local pillar_brasier_selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.375, 0.125, -0.375, 0.375, 0.25, 0.375}, -- mid
+ {-0.5, 0.25, -0.5, 0.5, 0.5, 0.5}, -- plat
+ {-0.25,-0.5,-0.25,0.25,0.125,0.25}, -- support
+ }
+}
+
+castle_lighting.register_pillar_brasier = function(material)
+ local composition_def, burn_time, tile, desc = get_material_properties(material)
+ if burn_time > 0 or composition_def.groups.puts_out_fire then return end -- No wooden brasiers, snow brasiers, or ice brasiers, alas.
+
+ local crossbrace_connectable_groups = {}
+ for group, val in pairs(composition_def.groups) do
+ crossbrace_connectable_groups[group] = val
+ end
+ crossbrace_connectable_groups.crossbrace_connectable = 1
+
+ local mod_name = minetest.get_current_modname()
+
+ minetest.register_node(mod_name..":"..material.name.."_pillar_brasier", {
+ drawtype = "nodebox",
+ description = S("@1 Brasier", desc),
+ _doc_items_longdesc = brasier_longdesc,
+ _doc_items_usagehelp = brasier_usagehelp,
+ tiles = tile,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = crossbrace_connectable_groups,
+ sounds = composition_def.sounds,
+
+ node_box = pillar_brasier_nodebox,
+ selection_box = pillar_brasier_selection_box,
+
+ on_construct = brasier_on_construct,
+ on_destruct = brasier_on_destruct,
+ can_dig = brasier_can_dig,
+ allow_metadata_inventory_put = brasier_allow_metadata_inventory_put,
+ on_metadata_inventory_put = brasier_burn,
+ on_timer = brasier_burn,
+ })
+
+ minetest.register_craft({
+ output = mod_name..":"..material.name.."_pillar_brasier 5",
+ recipe = {
+ {material.craft_material,"default:torch",material.craft_material},
+ {material.craft_material,material.craft_material,material.craft_material},
+ },
+ })
+
+ if minetest.get_modpath("hopper") and hopper ~= nil and hopper.add_container ~= nil then
+ hopper:add_container({
+ {"top", mod_name..":"..material.name.."_pillar_brasier", "fuel"},
+ {"bottom", mod_name..":"..material.name.."_pillar_brasier", "fuel"},
+ {"side", mod_name..":"..material.name.."_pillar_brasier", "fuel"},
+ })
+ end
+end
+
+for _, material in pairs(materials) do
+ castle_lighting.register_pillar_brasier(material)
+end
diff --git a/castle_lighting/depends.txt b/castle_lighting/depends.txt
new file mode 100644
index 0000000..ad94907
--- /dev/null
+++ b/castle_lighting/depends.txt
@@ -0,0 +1,6 @@
+default
+intllib?
+fire?
+castle_masonry?
+hopper?
+doc? \ No newline at end of file
diff --git a/castle_lighting/description.txt b/castle_lighting/description.txt
new file mode 100644
index 0000000..aae3f9b
--- /dev/null
+++ b/castle_lighting/description.txt
@@ -0,0 +1 @@
+This mod contains medieval castle lighting solutions
diff --git a/castle_lighting/init.lua b/castle_lighting/init.lua
new file mode 100644
index 0000000..34eb1c3
--- /dev/null
+++ b/castle_lighting/init.lua
@@ -0,0 +1,100 @@
+minetest.register_alias("darkage:lamp", "castle_lighting:light")
+minetest.register_alias("castle:street_light", "castle_lighting:light")
+minetest.register_alias("castle:light", "castle_lighting:light")
+minetest.register_alias("castle:chandelier", "castle_lighting:chandelier")
+minetest.register_alias("castle:chandelier_chain", "castle_lighting:chandelier_chain")
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+castle_lighting = {}
+
+dofile(MP.."/brasier.lua")
+
+minetest.register_node("castle_lighting:light",{
+ drawtype = "glasslike",
+ description = S("Light Block"),
+ sunlight_propagates = true,
+ light_source = 14,
+ tiles = {"castle_street_light.png"},
+ groups = {cracky=2},
+ sounds = default.node_sound_glass_defaults(),
+ paramtype = "light",
+})
+
+minetest.register_craft({
+ output = "castle_lighting:light",
+ recipe = {
+ {"default:stick", "default:glass", "default:stick"},
+ {"default:glass", "default:torch", "default:glass"},
+ {"default:stick", "default:glass", "default:stick"},
+ }
+})
+
+minetest.register_node( "castle_lighting:chandelier", {
+ drawtype = "plantlike",
+ description = S("Chandelier"),
+ paramtype = "light",
+ wield_image = "castle_chandelier_wield.png",
+ inventory_image = "castle_chandelier_wield.png",
+ groups = {cracky=2},
+ sounds = default.node_sound_glass_defaults(),
+ sunlight_propagates = true,
+ light_source = 14,
+ tiles = {
+ {
+ name = "castle_chandelier.png",
+ animation = {
+ type = "vertical_frames",
+ aspect_w = 16,
+ aspect_h = 16,
+ length = 1.0
+ },
+ },
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {0.35,-0.375,0.35,-0.35,0.5,-0.35},
+
+ },
+ },
+})
+
+minetest.register_craft({
+ output = "castle_lighting:chandelier",
+ recipe = {
+ {"", "", ""},
+ {"", "default:steel_ingot", ""},
+ {"default:torch","default:torch","default:torch"},
+ }
+})
+
+minetest.register_node( "castle_lighting:chandelier_chain", {
+ drawtype = "plantlike",
+ description = S("Chandelier Chain"),
+ paramtype = "light",
+ wield_image = "castle_chandelier_chain.png",
+ inventory_image = "castle_chandelier_chain.png",
+ groups = {cracky=2},
+ sounds = default.node_sound_glass_defaults(),
+ sunlight_propagates = true,
+ tiles = {"castle_chandelier_chain.png"},
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {0.1,-0.5,0.1,-0.1,0.5,-0.1},
+
+ },
+ },
+})
+
+minetest.register_craft({
+ output = "castle_lighting:chandelier_chain 4",
+ recipe = {
+ {"", "default:steel_ingot", ""},
+ {"", "", ""},
+ {"","default:steel_ingot",""},
+ }
+}) \ No newline at end of file
diff --git a/castle_lighting/intllib.lua b/castle_lighting/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/castle_lighting/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/castle_lighting/locale/template.pot b/castle_lighting/locale/template.pot
new file mode 100644
index 0000000..e7f0768
--- /dev/null
+++ b/castle_lighting/locale/template.pot
@@ -0,0 +1,52 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-03-01 23:52-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: brasier.lua:7
+msgid "A brasier for producing copious amounts of light and heat."
+msgstr ""
+
+#: brasier.lua:8
+msgid ""
+"To ignite the brasier place a flammable fuel in its inventory slot. A lump "
+"of coal will burn for about half an hour."
+msgstr ""
+
+#: brasier.lua:107
+msgid "Floor Brasier"
+msgstr ""
+
+#: brasier.lua:156
+msgid "Stonebrick"
+msgstr ""
+
+#: brasier.lua:228
+msgid "@1 Brasier"
+msgstr ""
+
+#: init.lua:17
+msgid "Light Block"
+msgstr ""
+
+#: init.lua:37
+msgid "Chandelier"
+msgstr ""
+
+#: init.lua:76
+msgid "Chandelier Chain"
+msgstr ""
diff --git a/castle_lighting/mod.conf b/castle_lighting/mod.conf
new file mode 100644
index 0000000..b894c97
--- /dev/null
+++ b/castle_lighting/mod.conf
@@ -0,0 +1 @@
+name = castle_lighting
diff --git a/castle_lighting/screenshot.png b/castle_lighting/screenshot.png
new file mode 100644
index 0000000..354f4a2
--- /dev/null
+++ b/castle_lighting/screenshot.png
Binary files differ
diff --git a/castle_lighting/textures/LICENSE.txt b/castle_lighting/textures/LICENSE.txt
new file mode 100644
index 0000000..7d7ed99
--- /dev/null
+++ b/castle_lighting/textures/LICENSE.txt
@@ -0,0 +1,17 @@
+License Textures: Philipner - CC-BY-SA 3.0
+
+-castle_chandelier.png
+-castle_chandelier_chain.png
+-castle_chandelier_wield.png
+
+
+--------------------------------------------
+
+16 px textures based on Castle mod
+original textures by Philipner
+
+License Textures: Napiophelios - CC-BY-SA 3.0
+
+-castle_street_light.png
+
+--------------------------------------------
diff --git a/castle_lighting/textures/castle_brasier_bed_mask.png b/castle_lighting/textures/castle_brasier_bed_mask.png
new file mode 100644
index 0000000..2c30c88
--- /dev/null
+++ b/castle_lighting/textures/castle_brasier_bed_mask.png
Binary files differ
diff --git a/castle_lighting/textures/castle_chandelier.png b/castle_lighting/textures/castle_chandelier.png
new file mode 100644
index 0000000..fbc0039
--- /dev/null
+++ b/castle_lighting/textures/castle_chandelier.png
Binary files differ
diff --git a/castle_lighting/textures/castle_chandelier_chain.png b/castle_lighting/textures/castle_chandelier_chain.png
new file mode 100644
index 0000000..47a526a
--- /dev/null
+++ b/castle_lighting/textures/castle_chandelier_chain.png
Binary files differ
diff --git a/castle_lighting/textures/castle_chandelier_wield.png b/castle_lighting/textures/castle_chandelier_wield.png
new file mode 100644
index 0000000..59dae96
--- /dev/null
+++ b/castle_lighting/textures/castle_chandelier_wield.png
Binary files differ
diff --git a/castle_lighting/textures/castle_coal_bed.png b/castle_lighting/textures/castle_coal_bed.png
new file mode 100644
index 0000000..e263bcd
--- /dev/null
+++ b/castle_lighting/textures/castle_coal_bed.png
Binary files differ
diff --git a/castle_lighting/textures/castle_steel.png b/castle_lighting/textures/castle_steel.png
new file mode 100644
index 0000000..28ecd60
--- /dev/null
+++ b/castle_lighting/textures/castle_steel.png
Binary files differ
diff --git a/castle_lighting/textures/castle_street_light.png b/castle_lighting/textures/castle_street_light.png
new file mode 100644
index 0000000..dc3f72e
--- /dev/null
+++ b/castle_lighting/textures/castle_street_light.png
Binary files differ
diff --git a/castle_masonry/LICENSE b/castle_masonry/LICENSE
new file mode 100644
index 0000000..5c3c583
--- /dev/null
+++ b/castle_masonry/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2017 Minetest Mods Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/castle_masonry/README.txt b/castle_masonry/README.txt
new file mode 100644
index 0000000..98b129a
--- /dev/null
+++ b/castle_masonry/README.txt
@@ -0,0 +1,43 @@
+=-=-=-=-=-=-=-=-=-=
+
+Castles Mod
+by: Philipbenr And DanDuncombe
+
+=-=-=-=-=-=-=-=-=-=
+
+Licence: MIT
+
+see: LICENSE
+
+=-=-=-=-=-=-=-=-=-=
+
+This is a mod all about creating castles and castle dungeons. Many of the nodes are used for the outer-walls or dungeons.
+
+=-=-=-=-=-=-=-=-=-=
+
+Contains:
+
+--Walls, Corner-walls,
+--Castlestone Stairs, Slabs, and Pillars
+--Arrowslits and embrasures
+--Rubble (to fill the interior of thick castle walls)
+--Murder holes and machicolations
+--Pillars and crossbraces
+--Roof slate
+--Paving stone
+--Dungeon stone
+
+Mod settings can allow for the basic castle masonry forms to be made for the following material types (all optional):
+
+Cobble
+Desert stone
+Desert stone brick
+Sandstone
+Sandstone brick
+Stone
+Stone brick
+Castle wall
+Wood
+Snow
+Ice
+Obsidian Brick \ No newline at end of file
diff --git a/castle_masonry/arrow_slits.lua b/castle_masonry/arrow_slits.lua
new file mode 100644
index 0000000..188d7dd
--- /dev/null
+++ b/castle_masonry/arrow_slits.lua
@@ -0,0 +1,166 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+castle_masonry.register_arrowslit = function(material)
+ local composition_def, burn_time, tile, desc = castle_masonry.get_material_properties(material)
+ local mod_name = minetest.get_current_modname()
+
+ -- Node Definition
+ minetest.register_node(mod_name..":arrowslit_"..material.name, {
+ drawtype = "nodebox",
+ description = S("@1 Arrowslit", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.375, 0.5, -0.0625, 0.375, 0.3125},
+ {0.0625, -0.375, 0.5, 0.5, 0.375, 0.3125},
+ {-0.5, 0.375, 0.5, 0.5, 0.5, 0.3125},
+ {-0.5, -0.5, 0.5, 0.5, -0.375, 0.3125},
+ {0.25, -0.5, 0.3125, 0.5, 0.5, 0.125},
+ {-0.5, -0.5, 0.3125, -0.25, 0.5, 0.125},
+ },
+ },
+ })
+
+ minetest.register_node(mod_name..":arrowslit_"..material.name.."_cross", {
+ drawtype = "nodebox",
+ description = S("@1 Arrowslit with Cross", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.125, 0.5, -0.0625, 0.375, 0.3125},
+ {0.0625, -0.125, 0.5, 0.5, 0.375, 0.3125},
+ {-0.5, 0.375, 0.5, 0.5, 0.5, 0.3125},
+ {-0.5, -0.5, 0.5, 0.5, -0.375, 0.3125},
+ {0.0625, -0.375, 0.5, 0.5, -0.25, 0.3125},
+ {-0.5, -0.375, 0.5, -0.0625, -0.25, 0.3125},
+ {-0.5, -0.25, 0.5, -0.1875, -0.125, 0.3125},
+ {0.1875, -0.25, 0.5, 0.5, -0.125, 0.3125},
+ {0.25, -0.5, 0.3125, 0.5, 0.5, 0.125},
+ {-0.5, -0.5, 0.3125, -0.25, 0.5, 0.125},
+ },
+ },
+ })
+
+ minetest.register_node(mod_name..":arrowslit_"..material.name.."_hole", {
+ drawtype = "nodebox",
+ description = S("@1 Arrowslit with Hole", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.375, 0.5, -0.125, 0.375, 0.3125},
+ {0.125, -0.375, 0.5, 0.5, 0.375, 0.3125},
+ {-0.5, -0.5, 0.5, 0.5, -0.375, 0.3125},
+ {0.0625, -0.125, 0.5, 0.125, 0.375, 0.3125},
+ {-0.125, -0.125, 0.5, -0.0625, 0.375, 0.3125},
+ {-0.5, 0.375, 0.5, 0.5, 0.5, 0.3125},
+ {0.25, -0.5, 0.3125, 0.5, 0.5, 0.125},
+ {-0.5, -0.5, 0.3125, -0.25, 0.5, 0.125},
+ },
+ },
+ })
+
+ minetest.register_node(mod_name..":arrowslit_"..material.name.."_embrasure", {
+ drawtype = "nodebox",
+ description = S("@1 Embrasure", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.25, -0.5, 0.375, -0.125, 0.5, 0.5},
+ {0.125, -0.5, 0.375, 0.25, 0.5, 0.5},
+ {0.25, -0.5, 0.25, 0.5, 0.5, 0.5},
+ {0.375, -0.5, 0.125, 0.5, 0.5, 0.25},
+ {-0.5, -0.5, 0.25, -0.25, 0.5, 0.5},
+ {-0.5, -0.5, 0.125, -0.375, 0.5, 0.25},
+ },
+ },
+ })
+
+ minetest.register_craft({
+ output = mod_name..":arrowslit_"..material.name.." 6",
+ recipe = {
+ {material.craft_material,"", material.craft_material},
+ {material.craft_material,"", material.craft_material},
+ {material.craft_material,"", material.craft_material} },
+ })
+
+ minetest.register_craft({
+ output = mod_name..":arrowslit_"..material.name.."_cross",
+ recipe = {
+ {mod_name..":arrowslit_"..material.name} },
+ })
+ minetest.register_craft({
+ output = mod_name..":arrowslit_"..material.name.."_hole",
+ recipe = {
+ {mod_name..":arrowslit_"..material.name.."_cross"} },
+ })
+ minetest.register_craft({
+ output = mod_name..":arrowslit_"..material.name.."_embrasure",
+ recipe = {
+ {mod_name..":arrowslit_"..material.name.."_hole"} },
+ })
+ minetest.register_craft({
+ output = mod_name..":arrowslit_"..material.name,
+ recipe = {
+ {mod_name..":arrowslit_"..material.name.."_embrasure"} },
+ })
+
+ if burn_time > 0 then
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":arrowslit_"..material.name,
+ burntime = burn_time,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":arrowslit_"..material.name.."_cross",
+ burntime = burn_time,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":arrowslit_"..material.name.."_hole",
+ burntime = burn_time,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":arrowslit_"..material.name.."_embrasure",
+ burntime = burn_time,
+ })
+ end
+end
+
+
+castle_masonry.register_arrowslit_alias = function(old_mod_name, old_material_name, new_mod_name, new_material_name)
+ minetest.register_alias(old_mod_name..":arrowslit_"..old_material_name, new_mod_name..":arrowslit_"..new_material_name)
+ minetest.register_alias(old_mod_name..":arrowslit_"..old_material_name.."_cross", new_mod_name..":arrowslit_"..new_material_name.."_cross")
+ minetest.register_alias(old_mod_name..":arrowslit_"..old_material_name.."_hole", new_mod_name..":arrowslit_"..new_material_name.."_hole")
+ minetest.register_alias(old_mod_name..":arrowslit_"..old_material_name.."_embrasure", new_mod_name..":arrowslit_"..new_material_name.."_embrasure")
+end
+
+castle_masonry.register_arrowslit_alias_force = function(old_mod_name, old_material_name, new_mod_name, new_material_name)
+ minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name, new_mod_name..":arrowslit_"..new_material_name)
+ minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name.."_cross", new_mod_name..":arrowslit_"..new_material_name.."_cross")
+ minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name.."_hole", new_mod_name..":arrowslit_"..new_material_name.."_hole")
+ minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name.."_embrasure", new_mod_name..":arrowslit_"..new_material_name.."_embrasure")
+end \ No newline at end of file
diff --git a/castle_masonry/depends.txt b/castle_masonry/depends.txt
new file mode 100644
index 0000000..206a637
--- /dev/null
+++ b/castle_masonry/depends.txt
@@ -0,0 +1,6 @@
+default
+moreblocks?
+stairs?
+building_blocks?
+asphalt?
+streets? \ No newline at end of file
diff --git a/castle_masonry/description.txt b/castle_masonry/description.txt
new file mode 100644
index 0000000..2399226
--- /dev/null
+++ b/castle_masonry/description.txt
@@ -0,0 +1 @@
+This is a mod all about creating castles and castle dungeons. Many of the nodes are used for the outer-walls or dungeons.
diff --git a/castle_masonry/init.lua b/castle_masonry/init.lua
new file mode 100644
index 0000000..0d23922
--- /dev/null
+++ b/castle_masonry/init.lua
@@ -0,0 +1,137 @@
+castle_masonry = {}
+
+local MP = minetest.get_modpath(minetest.get_current_modname())
+dofile(MP.."/pillars.lua")
+dofile(MP.."/arrow_slits.lua")
+dofile(MP.."/murder_holes.lua")
+dofile(MP.."/stone_wall.lua")
+dofile(MP.."/paving.lua")
+
+local S, NS = dofile(MP.."/intllib.lua")
+
+local read_setting = function(name, default)
+ local setting = minetest.setting_getbool(name)
+ if setting == nil then return default end
+ return setting
+end
+
+-- Material definition:
+-- {
+-- name=, -- the name that will be part of the resulting node names
+-- desc=, -- Player-facing name of the material
+-- tile=, -- Optional - the texture tile to use for the resulting blocks (can be a single texture or a table, as a normal node definition's tile def). If not set this will be taken from the material it's made out of.
+-- craft_material=, -- What source block is used to craft these blocks.
+-- composition_material=, -- Optional, this will override the properties of the product with a specific material. Useful if you want to use a group for the craft material (eg, "group:wood")
+--}
+
+castle_masonry.materials = {}
+if read_setting("castle_masonry_stonewall", true) then
+ table.insert(castle_masonry.materials, {name="stonewall", desc=S("Stonewall"), tile="castle_stonewall.png", craft_material="castle:stonewall"})
+end
+if read_setting("castle_masonry_cobble", true) then
+ table.insert(castle_masonry.materials, {name="cobble", desc=S("Cobble"), tile="default_cobble.png", craft_material="default:cobble"})
+end
+if read_setting("castle_masonry_stonebrick", true) then
+ table.insert(castle_masonry.materials, {name="stonebrick", desc=S("Stonebrick"), tile="default_stone_brick.png", craft_material="default:stonebrick"})
+end
+if read_setting("castle_masonry_sandstonebrick", true) then
+ table.insert(castle_masonry.materials, {name="sandstonebrick", desc=S("Sandstone Brick"), tile="default_sandstone_brick.png", craft_material="default:sandstonebrick"})
+end
+if read_setting("castle_masonry_desertstonebrick", true) then
+ table.insert(castle_masonry.materials, {name="desertstonebrick", desc=S("Desert Stone Brick"), tile="default_desert_stone_brick.png", craft_material="default:desert_stonebrick"})
+end
+if read_setting("castle_masonry_stone", true) then
+ table.insert(castle_masonry.materials, {name="stone", desc=S("Stone"), tile="default_stone.png", craft_material="default:stone"})
+end
+if read_setting("castle_masonry_sandstone", true) then
+ table.insert(castle_masonry.materials, {name="sandstone", desc=S("Sandstone"), tile="default_sandstone.png", craft_material="default:sandstone"})
+end
+if read_setting("castle_masonry_desertstone", true) then
+ table.insert(castle_masonry.materials, {name="desertstone", desc=S("Desert Stone"), tile="default_desert_stone.png", craft_material="default:desert_stone"})
+end
+if read_setting("castle_masonry_wood", false) then
+ table.insert(castle_masonry.materials, {name="wood", desc=S("Wood"), tile="default_wood.png", craft_material="group:wood", composition_material="default:wood"})
+end
+if read_setting("castle_masonry_ice", false) then
+ table.insert(castle_masonry.materials, {name="ice", desc=S("Ice"), tile="default_ice.png", craft_material="default:ice"})
+end
+if read_setting("castle_masonry_snow", false) then
+ table.insert(castle_masonry.materials, {name="snow", desc=S("Snow"), tile="default_snow.png", craft_material="default:snow"})
+end
+if read_setting("castle_masonry_obsidianbrick", false) then
+ table.insert(castle_masonry.materials, {name="obsidianbrick", desc=S("Obsidian Brick"), tile="default_obsidian_brick.png", craft_material="default:obsidianbrick"})
+end
+
+castle_masonry.get_material_properties = function(material)
+ local composition_def
+ local burn_time
+ if material.composition_material ~= nil then
+ composition_def = minetest.registered_nodes[material.composition_material]
+ burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.composition_material)}}).time
+ else
+ composition_def = minetest.registered_nodes[material.craft_material]
+ burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.craft_materia)}}).time
+ end
+
+ local tiles = material.tile
+ if tiles == nil then
+ tiles = composition_def.tile
+ elseif type(tiles) == "string" then
+ tiles = {tiles}
+ end
+
+ local desc = material.desc
+ if desc == nil then
+ desc = composition_def.description
+ end
+
+ return composition_def, burn_time, tiles, desc
+end
+
+
+if read_setting("castle_masonry_pillar", true) then
+ for _, material in pairs(castle_masonry.materials) do
+ castle_masonry.register_pillar(material)
+ end
+end
+
+if read_setting("castle_masonry_arrowslit", true) then
+ for _, material in pairs(castle_masonry.materials) do
+ castle_masonry.register_arrowslit(material)
+ end
+end
+
+if read_setting("castle_masonry_murderhole", true) then
+ for _, material in pairs(castle_masonry.materials) do
+ castle_masonry.register_murderhole(material)
+ end
+end
+
+minetest.register_alias("castle:pillars_bottom", "castle_masonry:pillars_stonewall_bottom")
+minetest.register_alias("castle:pillars_top", "castle_masonry:pillars_stonewall_top")
+minetest.register_alias("castle:pillars_middle", "castle_masonry:pillars_stonewall_middle")
+minetest.register_alias("castle:arrowslit", "castle_masonry:arrowslit_stonewall")
+minetest.register_alias("castle:arrowslit_hole", "castle_masonry:arrowslit_stonewall_hole")
+minetest.register_alias("castle:arrowslit_cross", "castle_masonry:arrowslit_stonewall_cross")
+
+for _, material in pairs(castle_masonry.materials) do
+ castle_masonry.register_murderhole_alias("castle", material.name, "castle_masonry", material.name)
+ castle_masonry.register_pillar_alias("castle", material.name, "castle_masonry", material.name)
+
+ -- Arrowslit upgrade has special handling because the castle mod arrow slit is reversed relative to current build-from-inside standard
+ local lbm_def = {
+ name = "castle_masonry:arrowslit_flip_front_to_back"..material.name,
+ nodenames = {
+ "castle:arrowslit_"..material.name,
+ "castle:arrowslit_"..material.name.."_cross",
+ "castle:arrowslit_"..material.name.."_hole",
+ },
+ action = function(pos, node)
+ local flip_front_to_back = {[0]=2, 3, 0, 1, 6, 7, 4, 5, 10, 7, 8, 9, 14, 15, 12, 13, 18, 19, 16, 17, 22, 23, 20, 21}
+ node.param2 = flip_front_to_back[node.param2]
+ node.name = "castle_masonry" .. string.sub(node.name, 7, -1)
+ minetest.swap_node(pos, node)
+ end
+ }
+ minetest.register_lbm(lbm_def)
+end \ No newline at end of file
diff --git a/castle_masonry/intllib.lua b/castle_masonry/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/castle_masonry/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/castle_masonry/locale/template.pot b/castle_masonry/locale/template.pot
new file mode 100644
index 0000000..93b2f4c
--- /dev/null
+++ b/castle_masonry/locale/template.pot
@@ -0,0 +1,189 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-21 23:41-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: arrow_slits.lua:12
+msgid "@1 Arrowslit"
+msgstr ""
+
+#: arrow_slits.lua:33
+msgid "@1 Arrowslit with Cross"
+msgstr ""
+
+#: arrow_slits.lua:58
+msgid "@1 Arrowslit with Hole"
+msgstr ""
+
+#: arrow_slits.lua:81
+msgid "@1 Embrasure"
+msgstr ""
+
+#: init.lua:29
+msgid "Stonewall"
+msgstr ""
+
+#: init.lua:32
+msgid "Cobble"
+msgstr ""
+
+#: init.lua:35
+msgid "Stonebrick"
+msgstr ""
+
+#: init.lua:38
+msgid "Sandstone Brick"
+msgstr ""
+
+#: init.lua:41
+msgid "Desert Stone Brick"
+msgstr ""
+
+#: init.lua:44
+msgid "Stone"
+msgstr ""
+
+#: init.lua:47
+msgid "Sandstone"
+msgstr ""
+
+#: init.lua:50
+msgid "Desert Stone"
+msgstr ""
+
+#: init.lua:53
+msgid "Wood"
+msgstr ""
+
+#: init.lua:56
+msgid "Ice"
+msgstr ""
+
+#: init.lua:59
+msgid "Snow"
+msgstr ""
+
+#: init.lua:62
+msgid "Obsidian Brick"
+msgstr ""
+
+#: murder_holes.lua:14
+msgid "@1 Murder Hole"
+msgstr ""
+
+#: murder_holes.lua:33
+msgid "@1 Machicolation"
+msgstr ""
+
+#: paving.lua:11
+msgid "Paving Stone"
+msgstr ""
+
+#: paving.lua:30
+msgid "Pavement Brick"
+msgstr ""
+
+#: paving.lua:40
+msgid "Castle Pavement Stair"
+msgstr ""
+
+#: paving.lua:41
+msgid "Castle Pavement Slab"
+msgstr ""
+
+#: paving.lua:49
+msgid "Roof Slates"
+msgstr ""
+
+#: pillars.lua:18
+msgid "@1 Pillar Base"
+msgstr ""
+
+#: pillars.lua:36
+msgid "@1 Half Pillar Base"
+msgstr ""
+
+#: pillars.lua:54
+msgid "@1 Pillar Top"
+msgstr ""
+
+#: pillars.lua:72
+msgid "@1 Half Pillar Top"
+msgstr ""
+
+#: pillars.lua:90
+msgid "@1 Pillar Middle"
+msgstr ""
+
+#: pillars.lua:106
+msgid "@1 Half Pillar Middle"
+msgstr ""
+
+#: pillars.lua:123
+msgid "@1 Crossbrace"
+msgstr ""
+
+#: pillars.lua:147
+msgid "@1 Extended Crossbrace"
+msgstr ""
+
+#: stone_wall.lua:11
+msgid "Castle Wall"
+msgstr ""
+
+#: stone_wall.lua:22
+msgid "Castle Rubble"
+msgstr ""
+
+#: stone_wall.lua:57
+msgid "Castle Corner"
+msgstr ""
+
+#: stone_wall.lua:78
+msgid "Stone Wall"
+msgstr ""
+
+#: stone_wall.lua:86
+msgid "Rubble"
+msgstr ""
+
+#: stone_wall.lua:100
+msgid "Castle Stonewall Stair"
+msgstr ""
+
+#: stone_wall.lua:101
+msgid "Castle Stonewall Slab"
+msgstr ""
+
+#: stone_wall.lua:108
+msgid "Castle Rubble Stair"
+msgstr ""
+
+#: stone_wall.lua:109
+msgid "Castle Rubble Slab"
+msgstr ""
+
+#: stone_wall.lua:117 stone_wall.lua:143
+msgid "Dungeon Stone"
+msgstr ""
+
+#: stone_wall.lua:156
+msgid "Dungeon Stone Stair"
+msgstr ""
+
+#: stone_wall.lua:157
+msgid "Dungeon Stone Slab"
+msgstr ""
diff --git a/castle_masonry/mod.conf b/castle_masonry/mod.conf
new file mode 100644
index 0000000..dd444cc
--- /dev/null
+++ b/castle_masonry/mod.conf
@@ -0,0 +1 @@
+name = castle_masonry
diff --git a/castle_masonry/murder_holes.lua b/castle_masonry/murder_holes.lua
new file mode 100644
index 0000000..090c399
--- /dev/null
+++ b/castle_masonry/murder_holes.lua
@@ -0,0 +1,91 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+-------------------------------------------------------------------------------------
+
+castle_masonry.register_murderhole = function(material)
+ local composition_def, burn_time, tile, desc = castle_masonry.get_material_properties(material)
+ local mod_name = minetest.get_current_modname()
+
+ -- Node Definition
+ minetest.register_node(mod_name..":hole_"..material.name, {
+ drawtype = "nodebox",
+ description = S("@1 Murder Hole", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-8/16,-8/16,-8/16,-4/16,8/16,8/16},
+ {4/16,-8/16,-8/16,8/16,8/16,8/16},
+ {-4/16,-8/16,-8/16,4/16,8/16,-4/16},
+ {-4/16,-8/16,8/16,4/16,8/16,4/16},
+ },
+ },
+ })
+
+ minetest.register_node(mod_name..":machicolation_"..material.name, {
+ drawtype = "nodebox",
+ description = S("@1 Machicolation", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, 0, -0.5, 0.5, 0.5, 0},
+ {-0.5, -0.5, 0, -0.25, 0.5, 0.5},
+ {0.25, -0.5, 0, 0.5, 0.5, 0.5},
+ },
+ },
+ })
+
+ minetest.register_craft({
+ output = mod_name..":hole_"..material.name.." 4",
+ recipe = {
+ {"",material.craft_material, "" },
+ {material.craft_material,"", material.craft_material},
+ {"",material.craft_material, ""}
+ },
+ })
+
+ minetest.register_craft({
+ output = mod_name..":machicolation_"..material.name,
+ type="shapeless",
+ recipe = {mod_name..":hole_"..material.name},
+ })
+ minetest.register_craft({
+ output = mod_name..":hole_"..material.name,
+ type="shapeless",
+ recipe = {mod_name..":machicolation_"..material.name},
+ })
+
+ if burn_time > 0 then
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":hole_"..material.name,
+ burntime = burn_time,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":machicolation_"..material.name,
+ burntime = burn_time,
+ })
+ end
+end
+
+castle_masonry.register_murderhole_alias = function(old_mod_name, old_material_name, new_mod_name, new_material_name)
+ minetest.register_alias(old_mod_name..":hole_"..old_material_name, new_mod_name..":hole_"..new_material_name)
+ minetest.register_alias(old_mod_name..":machicolation_"..old_material_name, new_mod_name..":machicolation_"..new_material_name)
+end
+
+castle_masonry.register_murderhole_alias_force = function(old_mod_name, old_material_name, new_mod_name, new_material_name)
+ minetest.register_alias_force(old_mod_name..":hole_"..old_material_name, new_mod_name..":hole_"..new_material_name)
+ minetest.register_alias_force(old_mod_name..":machicolation_"..old_material_name, new_mod_name..":machicolation_"..new_material_name)
+end \ No newline at end of file
diff --git a/castle_masonry/paving.lua b/castle_masonry/paving.lua
new file mode 100644
index 0000000..a6c5c42
--- /dev/null
+++ b/castle_masonry/paving.lua
@@ -0,0 +1,109 @@
+minetest.register_alias("castle:pavement", "castle_masonry:pavement_brick")
+minetest.register_alias("castle:pavement_brick", "castle_masonry:pavement_brick")
+minetest.register_alias("castle:roofslate", "castle_masonry:roofslate")
+
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+minetest.register_node("castle_masonry:pavement_brick", {
+ description = S("Paving Stone"),
+ drawtype = "normal",
+ tiles = {"castle_pavement_brick.png"},
+ groups = {cracky=2},
+ paramtype = "light",
+ sounds = default.node_sound_stone_defaults(),
+})
+
+minetest.register_craft({
+ output = "castle_masonry:pavement_brick 4",
+ recipe = {
+ {"default:stone", "default:cobble"},
+ {"default:cobble", "default:stone"},
+ }
+})
+
+
+if minetest.get_modpath("moreblocks") then
+ stairsplus:register_all("castle", "pavement_brick", "castle_masonry:pavement_brick", {
+ description = S("Pavement Brick"),
+ tiles = {"castle_pavement_brick.png"},
+ groups = {cracky=2, not_in_creative_inventory=1},
+ sounds = default.node_sound_stone_defaults(),
+ sunlight_propagates = true,
+ })
+elseif minetest.get_modpath("stairs") then
+ stairs.register_stair_and_slab("pavement_brick", "castle_masonry:pavement_brick",
+ {cracky=2},
+ {"castle_pavement_brick.png"},
+ S("Castle Pavement Stair"),
+ S("Castle Pavement Slab"),
+ default.node_sound_stone_defaults()
+ )
+end
+
+
+minetest.register_node("castle_masonry:roofslate", {
+ drawtype = "raillike",
+ description = S("Roof Slates"),
+ inventory_image = "castle_slate.png",
+ paramtype = "light",
+ walkable = false,
+ tiles = {'castle_slate.png'},
+ climbable = true,
+ selection_box = {
+ type = "fixed",
+ fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
+ },
+ groups = {cracky=3,attached_node=1},
+ sounds = default.node_sound_glass_defaults(),
+})
+
+local mod_building_blocks = minetest.get_modpath("building_blocks")
+local mod_streets = minetest.get_modpath("streets") or minetest.get_modpath("asphalt")
+
+if mod_building_blocks then
+ minetest.register_craft({
+ output = "castle_masonry:roofslate 4",
+ recipe = {
+ { "building_blocks:Tar" , "default:gravel" },
+ { "default:gravel", "building_blocks:Tar" }
+ }
+ })
+
+ minetest.register_craft( {
+ output = "castle_masonry:roofslate 4",
+ recipe = {
+ { "default:gravel", "building_blocks:Tar" },
+ { "building_blocks:Tar" , "default:gravel" }
+ }
+ })
+end
+
+if mod_streets then
+ minetest.register_craft( {
+ output = "castle_masonry:roofslate 4",
+ recipe = {
+ { "streets:asphalt" , "default:gravel" },
+ { "default:gravel", "streets:asphalt" }
+ }
+ })
+
+ minetest.register_craft( {
+ output = "castle_masonry:roofslate 4",
+ recipe = {
+ { "default:gravel", "streets:asphalt" },
+ { "streets:asphalt" , "default:gravel" }
+ }
+ })
+end
+
+if not (mod_building_blocks or mod_streets) then
+ minetest.register_craft({
+ type = "cooking",
+ output = "castle_masonry:roofslate",
+ recipe = "default:gravel",
+ })
+
+end \ No newline at end of file
diff --git a/castle_masonry/pillars.lua b/castle_masonry/pillars.lua
new file mode 100644
index 0000000..96d76a3
--- /dev/null
+++ b/castle_masonry/pillars.lua
@@ -0,0 +1,314 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+castle_masonry.register_pillar = function(material)
+ local composition_def, burn_time, tile, desc = castle_masonry.get_material_properties(material)
+ local crossbrace_connectable_groups = {}
+ for group, val in pairs(composition_def.groups) do
+ crossbrace_connectable_groups[group] = val
+ end
+ crossbrace_connectable_groups.crossbrace_connectable = 1
+
+ local mod_name = minetest.get_current_modname()
+
+ -- Node Definition
+ minetest.register_node(mod_name..":pillar_"..material.name.."_bottom", {
+ drawtype = "nodebox",
+ description = S("@1 Pillar Base", desc),
+ tiles = tile,
+ groups = crossbrace_connectable_groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5,-0.5,-0.5,0.5,-0.375,0.5},
+ {-0.375,-0.375,-0.375,0.375,-0.125,0.375},
+ {-0.25,-0.125,-0.25,0.25,0.5,0.25},
+ },
+ },
+ })
+
+ minetest.register_node(mod_name..":pillar_"..material.name.."_bottom_half", {
+ drawtype = "nodebox",
+ description = S("@1 Half Pillar Base", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, 0, 0.5, -0.375, 0.5},
+ {-0.375, -0.375, 0.125, 0.375, -0.125, 0.5},
+ {-0.25, -0.125, 0.25, 0.25, 0.5, 0.5},
+ },
+ },
+ })
+
+ minetest.register_node(mod_name..":pillar_"..material.name.."_top", {
+ drawtype = "nodebox",
+ description = S("@1 Pillar Top", desc),
+ tiles = tile,
+ groups = crossbrace_connectable_groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5,0.3125,-0.5,0.5,0.5,0.5},
+ {-0.375,0.0625,-0.375,0.375,0.3125,0.375},
+ {-0.25,-0.5,-0.25,0.25,0.0625,0.25},
+ },
+ },
+ })
+
+ minetest.register_node(mod_name..":pillar_"..material.name.."_top_half", {
+ drawtype = "nodebox",
+ description = S("@1 Half Pillar Top", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, 0.3125, 0, 0.5, 0.5, 0.5},
+ {-0.375, 0.0625, 0.125, 0.375, 0.3125, 0.5},
+ {-0.25, -0.5, 0.25, 0.25, 0.0625, 0.5},
+ },
+ },
+ })
+
+ minetest.register_node(mod_name..":pillar_"..material.name.."_middle", {
+ drawtype = "nodebox",
+ description = S("@1 Pillar Middle", desc),
+ tiles = tile,
+ groups = crossbrace_connectable_groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.25,-0.5,-0.25,0.25,0.5,0.25},
+ },
+ },
+ })
+
+ minetest.register_node(mod_name..":pillar_"..material.name.."_middle_half", {
+ drawtype = "nodebox",
+ description = S("@1 Half Pillar Middle", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.25, -0.5, 0.25, 0.25, 0.5, 0.5},
+ },
+ },
+ })
+
+ minetest.register_node(mod_name..":pillar_"..material.name.."_crossbrace",
+ {
+ drawtype = "nodebox",
+ description = S("@1 Crossbrace", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "connected",
+ fixed = {-0.25,0.25,-0.25,0.25,0.5,0.25},
+ connect_front = {-0.25,0.25,-0.75,0.25,0.5,-0.25}, -- -Z
+ connect_left = {-0.25,0.25,-0.25,-0.75,0.5,0.25}, -- -X
+ connect_back = {-0.25,0.25,0.25,0.25,0.5,0.75}, -- +Z
+ connect_right = {0.25,0.25,-0.25,0.75,0.5,0.25}, -- +X
+ },
+ connects_to = {
+ mod_name..":pillar_"..material.name.."_crossbrace",
+ mod_name..":pillar_"..material.name.."_extended_crossbrace",
+ "group:crossbrace_connectable"},
+ connect_sides = { "front", "left", "back", "right" },
+ })
+
+ minetest.register_node(mod_name..":pillar_"..material.name.."_extended_crossbrace",
+ {
+ drawtype = "nodebox",
+ description = S("@1 Extended Crossbrace", desc),
+ tiles = tile,
+ groups = composition_def.groups,
+ sounds = composition_def.sounds,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {-1.25,0.25,-0.25,1.25,0.5,0.25},
+ },
+ })
+
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_bottom 4",
+ recipe = {
+ {"",material.craft_material,""},
+ {"",material.craft_material,""},
+ {material.craft_material,material.craft_material,material.craft_material} },
+ })
+
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_top 4",
+ recipe = {
+ {material.craft_material,material.craft_material,material.craft_material},
+ {"",material.craft_material,""},
+ {"",material.craft_material,""} },
+ })
+
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_middle 4",
+ recipe = {
+ {material.craft_material,material.craft_material},
+ {material.craft_material,material.craft_material},
+ {material.craft_material,material.craft_material} },
+ })
+
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_crossbrace 10",
+ recipe = {
+ {material.craft_material,"",material.craft_material},
+ {"",material.craft_material,""},
+ {material.craft_material,"",material.craft_material} },
+ })
+
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_middle_half 2",
+ type="shapeless",
+ recipe = {mod_name..":pillar_"..material.name.."_middle"},
+ })
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_middle",
+ type="shapeless",
+ recipe = {mod_name..":pillar_"..material.name.."_middle_half", mod_name..":pillar_"..material.name.."_middle_half"},
+ })
+
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_top_half 2",
+ type="shapeless",
+ recipe = {mod_name..":pillar_"..material.name.."_top"},
+ })
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_top",
+ type="shapeless",
+ recipe = {mod_name..":pillar_"..material.name.."_top_half", mod_name..":pillar_"..material.name.."_top_half"},
+ })
+
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_bottom_half 2",
+ type="shapeless",
+ recipe = {mod_name..":pillar_"..material.name.."_bottom"},
+ })
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_bottom",
+ type="shapeless",
+ recipe = {mod_name..":pillar_"..material.name.."_bottom_half", mod_name..":pillar_"..material.name.."_bottom_half"},
+ })
+
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_extended_crossbrace",
+ type="shapeless",
+ recipe = {mod_name..":pillar_"..material.name.."_crossbrace"},
+ })
+
+ minetest.register_craft({
+ output = mod_name..":pillar_"..material.name.."_crossbrace",
+ type="shapeless",
+ recipe = {mod_name..":pillar_"..material.name.."_extended_crossbrace"},
+ })
+
+ if burn_time > 0 then
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":pillar_"..material.name.."_top",
+ burntime = burn_time*5/4,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":pillar_"..material.name.."_top_half",
+ burntime = burn_time*5/8,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":pillar_"..material.name.."_bottom",
+ burntime = burn_time*5/4,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":pillar_"..material.name.."_bottom_half",
+ burntime = burn_time*5/8,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":pillar_"..material.name.."_middle",
+ burntime = burn_time*6/4,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":pillar_"..material.name.."_middle_half",
+ burntime = burn_time*6/8,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":pillar_"..material.name.."_crossbrace",
+ burntime = burn_time*5/10,
+ })
+ minetest.register_craft({
+ type = "fuel",
+ recipe = mod_name..":pillar_"..material.name.."_extended_crossbrace",
+ burntime = burn_time*5/10,
+ })
+ end
+
+end
+
+-- The original castle mod had "pillars_", plural, which didn't match the arrowslit and murderhole standard.
+castle_masonry.register_pillar_alias = function(old_mod_name, old_material_name, new_mod_name, new_material_name)
+ minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_bottom", new_mod_name..":pillar_"..new_material_name.."_bottom")
+ minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_bottom_half", new_mod_name..":pillar_"..new_material_name.."_bottom_half")
+ minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_crossbrace", new_mod_name..":pillar_"..new_material_name.."_crossbrace")
+ minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_middle", new_mod_name..":pillar_"..new_material_name.."_middle")
+ minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_middle_half", new_mod_name..":pillar_"..new_material_name.."_middle_half")
+ minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_top", new_mod_name..":pillar_"..new_material_name.."_top")
+ minetest.register_alias(old_mod_name..":pillars_"..old_material_name.."_top_half", new_mod_name..":pillar_"..new_material_name.."_top_half")
+ minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_bottom", new_mod_name..":pillar_"..new_material_name.."_bottom")
+ minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_bottom_half", new_mod_name..":pillar_"..new_material_name.."_bottom_half")
+ minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_crossbrace", new_mod_name..":pillar_"..new_material_name.."_crossbrace")
+ minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_middle", new_mod_name..":pillar_"..new_material_name.."_middle")
+ minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_middle_half", new_mod_name..":pillar_"..new_material_name.."_middle_half")
+ minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_top", new_mod_name..":pillar_"..new_material_name.."_top")
+ minetest.register_alias(old_mod_name..":pillar_"..old_material_name.."_top_half", new_mod_name..":pillar_"..new_material_name.."_top_half")
+end
+
+castle_masonry.register_arrowslit_alias_force = function(old_mod_name, old_material_name, new_mod_name, new_material_name)
+ minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_bottom", new_mod_name..":pillar_"..new_material_name.."_bottom")
+ minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_bottom_half", new_mod_name..":pillar_"..new_material_name.."_bottom_half")
+ minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_crossbrace", new_mod_name..":pillar_"..new_material_name.."_crossbrace")
+ minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_middle", new_mod_name..":pillar_"..new_material_name.."_middle")
+ minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_middle_half", new_mod_name..":pillar_"..new_material_name.."_middle_half")
+ minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_top", new_mod_name..":pillar_"..new_material_name.."_top")
+ minetest.register_alias_force(old_mod_name..":pillars_"..old_material_name.."_top_half", new_mod_name..":pillar_"..new_material_name.."_top_half")
+ minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_bottom", new_mod_name..":pillar_"..new_material_name.."_bottom")
+ minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_bottom_half", new_mod_name..":pillar_"..new_material_name.."_bottom_half")
+ minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_crossbrace", new_mod_name..":pillar_"..new_material_name.."_crossbrace")
+ minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_middle", new_mod_name..":pillar_"..new_material_name.."_middle")
+ minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_middle_half", new_mod_name..":pillar_"..new_material_name.."_middle_half")
+ minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_top", new_mod_name..":pillar_"..new_material_name.."_top")
+ minetest.register_alias_force(old_mod_name..":pillar_"..old_material_name.."_top_half", new_mod_name..":pillar_"..new_material_name.."_top_half")
+end \ No newline at end of file
diff --git a/castle_masonry/screenshot.png b/castle_masonry/screenshot.png
new file mode 100644
index 0000000..ff33db0
--- /dev/null
+++ b/castle_masonry/screenshot.png
Binary files differ
diff --git a/castle_masonry/settingtypes.txt b/castle_masonry/settingtypes.txt
new file mode 100644
index 0000000..3f11b23
--- /dev/null
+++ b/castle_masonry/settingtypes.txt
@@ -0,0 +1,20 @@
+[Materials]
+
+castle_masonry_stonewall (Stonewall) bool true
+castle_masonry_cobble (Cobble) bool true
+castle_masonry_stonebrick (Stone Brick) bool true
+castle_masonry_sandstonebrick (Sandstone Brick) bool true
+castle_masonry_desertstonebrick (Desert Stone Brick) bool true
+castle_masonry_stone (Stone) bool true
+castle_masonry_sandstone (Sandstone) bool true
+castle_masonry_desertstone (Desert Stone) bool true
+castle_masonry_wood (Wood) bool false
+castle_masonry_ice (Ice) bool false
+castle_masonry_snow (Snow) bool false
+castle_masonry_obsidianbrick (Obsidian Brick) bool false
+
+[Forms]
+
+castle_masonry_pillar (Pillars) bool true
+castle_masonry_arrowslit (Arrow slits) bool true
+castle_masonry_murderhole (Murder holes and machicolations) bool true \ No newline at end of file
diff --git a/castle_masonry/stone_wall.lua b/castle_masonry/stone_wall.lua
new file mode 100644
index 0000000..ae598e0
--- /dev/null
+++ b/castle_masonry/stone_wall.lua
@@ -0,0 +1,160 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+minetest.register_alias("castle:stonewall", "castle_masonry:stonewall")
+minetest.register_alias("castle:dungeon_stone", "castle_masonry:dungeon_stone")
+minetest.register_alias("castle:rubble", "castle_masonry:rubble")
+minetest.register_alias("castle:stonewall_corner", "castle_masonry:stonewall_corner")
+
+minetest.register_node("castle_masonry:stonewall", {
+ description = S("Castle Wall"),
+ drawtype = "normal",
+ tiles = {"castle_stonewall.png"},
+ paramtype = "light",
+ drop = "castle_masonry:stonewall",
+ groups = {cracky=3},
+ sunlight_propagates = false,
+ sounds = default.node_sound_stone_defaults(),
+})
+
+minetest.register_node("castle_masonry:rubble", {
+ description = S("Castle Rubble"),
+ drawtype = "normal",
+ tiles = {"castle_rubble.png"},
+ paramtype = "light",
+ groups = {crumbly=3,falling_node=1},
+ sounds = default.node_sound_gravel_defaults(),
+})
+
+minetest.register_craft({
+ output = "castle_masonry:stonewall",
+ recipe = {
+ {"default:cobble"},
+ {"default:desert_stone"},
+ }
+})
+
+minetest.register_craft({
+ output = "castle_masonry:rubble",
+ recipe = {
+ {"castle_masonry:stonewall"},
+ }
+})
+
+minetest.register_craft({
+ output = "castle_masonry:rubble 2",
+ recipe = {
+ {"default:gravel"},
+ {"default:desert_stone"},
+ }
+})
+
+minetest.register_node("castle_masonry:stonewall_corner", {
+ drawtype = "normal",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ description = S("Castle Corner"),
+ tiles = {"castle_corner_stonewall_tb.png^[transformR90",
+ "castle_corner_stonewall_tb.png^[transformR180",
+ "castle_corner_stonewall1.png",
+ "castle_stonewall.png",
+ "castle_stonewall.png",
+ "castle_corner_stonewall2.png"},
+ groups = {cracky=3},
+ sounds = default.node_sound_stone_defaults(),
+})
+
+minetest.register_craft({
+ output = "castle_masonry:stonewall_corner",
+ recipe = {
+ {"", "castle_masonry:stonewall"},
+ {"castle_masonry:stonewall", "default:sandstone"},
+ }
+})
+
+if minetest.get_modpath("moreblocks") then
+ stairsplus:register_all("castle_masonry", "stonewall", "castle_masonry:stonewall", {
+ description = S("Stone Wall"),
+ tiles = {"castle_stonewall.png"},
+ groups = {cracky=3, not_in_creative_inventory=1},
+ sounds = default.node_sound_stone_defaults(),
+ sunlight_propagates = true,
+ })
+
+ stairsplus:register_all("castle_masonry", "rubble", "castle_masonry:rubble", {
+ description = S("Rubble"),
+ tiles = {"castle_rubble.png"},
+ groups = {cracky=3, not_in_creative_inventory=1},
+ sounds = default.node_sound_gravel_defaults(),
+ sunlight_propagates = true,
+ })
+
+ stairsplus:register_stair_alias("castle", "stonewall", "castle_masonry", "stonewall")
+ stairsplus:register_stair_alias("castle", "rubble", "castle_masonry", "rubble")
+
+elseif minetest.get_modpath("stairs") then
+ stairs.register_stair_and_slab("stonewall", "castle_masonry:stonewall",
+ {cracky=3},
+ {"castle_stonewall.png"},
+ S("Castle Stonewall Stair"),
+ S("Castle Stonewall Slab"),
+ default.node_sound_stone_defaults()
+ )
+
+ stairs.register_stair_and_slab("rubble", "castle_masonry:rubble",
+ {cracky=3},
+ {"castle_rubble.png"},
+ S("Castle Rubble Stair"),
+ S("Castle Rubble Slab"),
+ default.node_sound_stone_defaults()
+ )
+end
+
+--------------------------------------------------------------------------------------------------------------
+
+minetest.register_node("castle_masonry:dungeon_stone", {
+ description = S("Dungeon Stone"),
+ drawtype = "normal",
+ tiles = {"castle_dungeon_stone.png"},
+ groups = {cracky=2},
+ paramtype = "light",
+ sounds = default.node_sound_stone_defaults(),
+})
+
+minetest.register_craft({
+ output = "castle_masonry:dungeon_stone 2",
+ recipe = {
+ {"default:stonebrick", "default:obsidian"},
+ }
+})
+
+minetest.register_craft({
+ output = "castle_masonry:dungeon_stone 2",
+ recipe = {
+ {"default:stonebrick"},
+ {"default:obsidian"},
+ }
+})
+
+
+if minetest.get_modpath("moreblocks") then
+ stairsplus:register_all("castle", "dungeon_stone", "castle_masonry:dungeon_stone", {
+ description = S("Dungeon Stone"),
+ tiles = {"castle_dungeon_stone.png"},
+ groups = {cracky=2, not_in_creative_inventory=1},
+ sounds = default.node_sound_stone_defaults(),
+ sunlight_propagates = true,
+ })
+
+ stairsplus:register_stair_alias("castle", "dungeon_stone", "castle_masonry", "dungeon_stone")
+
+elseif minetest.get_modpath("stairs") then
+ stairs.register_stair_and_slab("dungeon_stone", "castle_masonry:dungeon_stone",
+ {cracky=2},
+ {"castle_dungeon_stone.png"},
+ S("Dungeon Stone Stair"),
+ S("Dungeon Stone Slab"),
+ default.node_sound_stone_defaults()
+ )
+end \ No newline at end of file
diff --git a/castle_masonry/textures/LICENSE.txt b/castle_masonry/textures/LICENSE.txt
new file mode 100644
index 0000000..306be33
--- /dev/null
+++ b/castle_masonry/textures/LICENSE.txt
@@ -0,0 +1,21 @@
+--------------------------------------------
+
+License Textures: Philipner - CC-BY-SA 3.0
+
+-castle_corner_stonewall_tb.png
+-castle_corner_stonewall1.png
+-castle_corner_stonewall2.png
+
+--------------------------------------------
+
+16 px textures based on Castle mod
+original textures by Philipner
+
+License Textures: Napiophelios - CC-BY-SA 3.0
+
+-castle_pavement_brick.png
+-castle_rubble.png
+-castle_slate.png
+-castle_stonewall.png
+
+--------------------------------------------
diff --git a/castle_masonry/textures/castle_corner_stonewall1.png b/castle_masonry/textures/castle_corner_stonewall1.png
new file mode 100644
index 0000000..0a9c091
--- /dev/null
+++ b/castle_masonry/textures/castle_corner_stonewall1.png
Binary files differ
diff --git a/castle_masonry/textures/castle_corner_stonewall2.png b/castle_masonry/textures/castle_corner_stonewall2.png
new file mode 100644
index 0000000..d9d7d0c
--- /dev/null
+++ b/castle_masonry/textures/castle_corner_stonewall2.png
Binary files differ
diff --git a/castle_masonry/textures/castle_corner_stonewall_tb.png b/castle_masonry/textures/castle_corner_stonewall_tb.png
new file mode 100644
index 0000000..d72d78d
--- /dev/null
+++ b/castle_masonry/textures/castle_corner_stonewall_tb.png
Binary files differ
diff --git a/castle_masonry/textures/castle_dungeon_stone.png b/castle_masonry/textures/castle_dungeon_stone.png
new file mode 100644
index 0000000..6a2c154
--- /dev/null
+++ b/castle_masonry/textures/castle_dungeon_stone.png
Binary files differ
diff --git a/castle_masonry/textures/castle_pavement_brick.png b/castle_masonry/textures/castle_pavement_brick.png
new file mode 100644
index 0000000..fd10e0f
--- /dev/null
+++ b/castle_masonry/textures/castle_pavement_brick.png
Binary files differ
diff --git a/castle_masonry/textures/castle_rubble.png b/castle_masonry/textures/castle_rubble.png
new file mode 100644
index 0000000..fbaa32c
--- /dev/null
+++ b/castle_masonry/textures/castle_rubble.png
Binary files differ
diff --git a/castle_masonry/textures/castle_slate.png b/castle_masonry/textures/castle_slate.png
new file mode 100644
index 0000000..a7de1ea
--- /dev/null
+++ b/castle_masonry/textures/castle_slate.png
Binary files differ
diff --git a/castle_masonry/textures/castle_stonewall.png b/castle_masonry/textures/castle_stonewall.png
new file mode 100644
index 0000000..b8f823f
--- /dev/null
+++ b/castle_masonry/textures/castle_stonewall.png
Binary files differ
diff --git a/castle_shields/LICENSE b/castle_shields/LICENSE
new file mode 100644
index 0000000..456d091
--- /dev/null
+++ b/castle_shields/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Minetest Mods Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/castle_shields/README.txt b/castle_shields/README.txt
new file mode 100644
index 0000000..e2b85ce
--- /dev/null
+++ b/castle_shields/README.txt
@@ -0,0 +1,25 @@
+=-=-=-=-=-=-=-=-=-=
+
+Castles Mod
+by: Philipbenr And DanDuncombe
+
+=-=-=-=-=-=-=-=-=-=
+
+Licence: MIT
+
+see: LICENSE
+
+=-=-=-=-=-=-=-=-=-=
+
+This mod adds decorative wall-mounted shields. It comes with three default shields, but it's very easy to mix and match the colours and patterns to generate additional shields for your server; see default_shields.lua for a good place to insert your own, or make use of the castle_shields.register_shield method in your own mods.
+
+The three default shields were defined thusly:
+
+castle_shields.register_shield("shield_1", "Mounted Shield", "red", "blue", "slash")
+castle_shields.register_shield("shield_2", "Mounted Shield", "cyan", "yellow", "chevron")
+castle_shields.register_shield("shield_3", "Mounted Shield", "grey", "green", "cross")
+
+The following colors are permitted:
+ "black", "blue", "brown", "cyan", "dark_green", "dark_grey", "green", "grey", "magenta", "orange", "pink", "red", "violet", "white", "yellow"
+The following patterns are permitted:
+ "slash", "chevron", "cross" \ No newline at end of file
diff --git a/castle_shields/default_shields.lua b/castle_shields/default_shields.lua
new file mode 100644
index 0000000..f29a8e5
--- /dev/null
+++ b/castle_shields/default_shields.lua
@@ -0,0 +1,18 @@
+minetest.register_alias("castle:shield", "castle_shields:shield_1")
+minetest.register_alias("castle:shield_2", "castle_shields:shield_2")
+minetest.register_alias("castle:shield_3", "castle_shields:shield_3")
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+--The following colors are permitted:
+-- "black", "blue", "brown", "cyan", "dark_green", "dark_grey", "green", "grey", "magenta", "orange", "pink", "red", "violet", "white", "yellow"
+--The following patterns are permitted:
+-- "slash", "chevron", "cross"
+
+-- method parameters are name, desc, background_color, foreground_color, pattern
+
+castle_shields.register_shield("shield_1", S("Mounted Shield"), "red", "blue", "slash")
+castle_shields.register_shield("shield_2", S("Mounted Shield"), "cyan", "yellow", "chevron")
+castle_shields.register_shield("shield_3", S("Mounted Shield"), "grey", "green", "cross") \ No newline at end of file
diff --git a/castle_shields/depends.txt b/castle_shields/depends.txt
new file mode 100644
index 0000000..cc455cf
--- /dev/null
+++ b/castle_shields/depends.txt
@@ -0,0 +1,3 @@
+default
+dye
+intllib? \ No newline at end of file
diff --git a/castle_shields/description.txt b/castle_shields/description.txt
new file mode 100644
index 0000000..8cd8630
--- /dev/null
+++ b/castle_shields/description.txt
@@ -0,0 +1 @@
+Adds decorative wall shields
diff --git a/castle_shields/init.lua b/castle_shields/init.lua
new file mode 100644
index 0000000..05ee2d1
--- /dev/null
+++ b/castle_shields/init.lua
@@ -0,0 +1,5 @@
+castle_shields = {}
+
+local MP = minetest.get_modpath(minetest.get_current_modname())
+dofile(MP.."/shield_functions.lua")
+dofile(MP.."/default_shields.lua")
diff --git a/castle_shields/intllib.lua b/castle_shields/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/castle_shields/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/castle_shields/locale/template.pot b/castle_shields/locale/template.pot
new file mode 100644
index 0000000..bfb347c
--- /dev/null
+++ b/castle_shields/locale/template.pot
@@ -0,0 +1,21 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-25 14:47-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: init.lua:6 init.lua:41 init.lua:75
+msgid "Mounted Shield"
+msgstr ""
diff --git a/castle_shields/mod.conf b/castle_shields/mod.conf
new file mode 100644
index 0000000..5df74cc
--- /dev/null
+++ b/castle_shields/mod.conf
@@ -0,0 +1 @@
+name = castle_shields
diff --git a/castle_shields/screenshot.png b/castle_shields/screenshot.png
new file mode 100644
index 0000000..b2cfd5f
--- /dev/null
+++ b/castle_shields/screenshot.png
Binary files differ
diff --git a/castle_shields/shield_functions.lua b/castle_shields/shield_functions.lua
new file mode 100644
index 0000000..d32938b
--- /dev/null
+++ b/castle_shields/shield_functions.lua
@@ -0,0 +1,39 @@
+castle_shields.register_shield = function(name, desc, background_color, foreground_color, mask)
+
+ local tile_side = "castle_shield_"..background_color..".png"
+ local tile_front = "castle_shield_"..background_color..".png^(castle_shield_"..foreground_color..".png^[mask:castle_shield_mask_"..mask..".png)"
+
+ minetest.register_node(minetest.get_current_modname()..":"..name, {
+ description = desc,
+ tiles = {tile_side, tile_side, tile_side, tile_side, "castle_shield_back.png", tile_front},
+ drawtype="nodebox",
+ paramtype2 = "facedir",
+ paramtype = "light",
+ groups={cracky=3},
+ sounds = default.node_sound_metal_defaults(),
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.500000,-0.125000,0.375000,0.500000,0.500000,0.500000},
+ {-0.437500,-0.312500,0.375000,0.425000,0.500000,0.500000},
+ {-0.312500,-0.437500,0.375000,0.312500,0.500000,0.500000},
+ {-0.187500,-0.500000,0.375000,0.187500,0.500000,0.500000},
+ },
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.500000,-0.500000,0.375000,0.500000,0.500000,0.500000},
+ },
+ },
+ })
+
+ minetest.register_craft({
+ output = minetest.get_current_modname()..":"..name,
+ recipe = {
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+ {"dye:"..background_color, "default:steel_ingot", "dye:"..foreground_color},
+ }
+ })
+end \ No newline at end of file
diff --git a/castle_shields/textures/castle_shield_back.png b/castle_shields/textures/castle_shield_back.png
new file mode 100644
index 0000000..53cca18
--- /dev/null
+++ b/castle_shields/textures/castle_shield_back.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_black.png b/castle_shields/textures/castle_shield_black.png
new file mode 100644
index 0000000..cb39341
--- /dev/null
+++ b/castle_shields/textures/castle_shield_black.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_blue.png b/castle_shields/textures/castle_shield_blue.png
new file mode 100644
index 0000000..7ef3a9e
--- /dev/null
+++ b/castle_shields/textures/castle_shield_blue.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_brown.png b/castle_shields/textures/castle_shield_brown.png
new file mode 100644
index 0000000..b1c274d
--- /dev/null
+++ b/castle_shields/textures/castle_shield_brown.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_cyan.png b/castle_shields/textures/castle_shield_cyan.png
new file mode 100644
index 0000000..4bf2f4d
--- /dev/null
+++ b/castle_shields/textures/castle_shield_cyan.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_dark_green.png b/castle_shields/textures/castle_shield_dark_green.png
new file mode 100644
index 0000000..2f6031e
--- /dev/null
+++ b/castle_shields/textures/castle_shield_dark_green.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_dark_grey.png b/castle_shields/textures/castle_shield_dark_grey.png
new file mode 100644
index 0000000..00ff607
--- /dev/null
+++ b/castle_shields/textures/castle_shield_dark_grey.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_green.png b/castle_shields/textures/castle_shield_green.png
new file mode 100644
index 0000000..7b9a82a
--- /dev/null
+++ b/castle_shields/textures/castle_shield_green.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_grey.png b/castle_shields/textures/castle_shield_grey.png
new file mode 100644
index 0000000..53ba7a3
--- /dev/null
+++ b/castle_shields/textures/castle_shield_grey.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_magenta.png b/castle_shields/textures/castle_shield_magenta.png
new file mode 100644
index 0000000..6b60e17
--- /dev/null
+++ b/castle_shields/textures/castle_shield_magenta.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_mask_chevron.png b/castle_shields/textures/castle_shield_mask_chevron.png
new file mode 100644
index 0000000..59ffa37
--- /dev/null
+++ b/castle_shields/textures/castle_shield_mask_chevron.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_mask_cross.png b/castle_shields/textures/castle_shield_mask_cross.png
new file mode 100644
index 0000000..a032ef4
--- /dev/null
+++ b/castle_shields/textures/castle_shield_mask_cross.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_mask_slash.png b/castle_shields/textures/castle_shield_mask_slash.png
new file mode 100644
index 0000000..1bd1174
--- /dev/null
+++ b/castle_shields/textures/castle_shield_mask_slash.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_orange.png b/castle_shields/textures/castle_shield_orange.png
new file mode 100644
index 0000000..11f4a92
--- /dev/null
+++ b/castle_shields/textures/castle_shield_orange.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_pink.png b/castle_shields/textures/castle_shield_pink.png
new file mode 100644
index 0000000..a2b08cc
--- /dev/null
+++ b/castle_shields/textures/castle_shield_pink.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_red.png b/castle_shields/textures/castle_shield_red.png
new file mode 100644
index 0000000..87e8657
--- /dev/null
+++ b/castle_shields/textures/castle_shield_red.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_violet.png b/castle_shields/textures/castle_shield_violet.png
new file mode 100644
index 0000000..2168cb4
--- /dev/null
+++ b/castle_shields/textures/castle_shield_violet.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_white.png b/castle_shields/textures/castle_shield_white.png
new file mode 100644
index 0000000..a124396
--- /dev/null
+++ b/castle_shields/textures/castle_shield_white.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_yellow.png b/castle_shields/textures/castle_shield_yellow.png
new file mode 100644
index 0000000..033d679
--- /dev/null
+++ b/castle_shields/textures/castle_shield_yellow.png
Binary files differ
diff --git a/castle_shields/textures/shield.svg b/castle_shields/textures/shield.svg
new file mode 100644
index 0000000..78b355e
--- /dev/null
+++ b/castle_shields/textures/shield.svg
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ viewBox="0 0 16 16"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="gradient.svg"
+ inkscape:export-filename="C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\castle_shields\textures\rect4138.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4148">
+ <stop
+ style="stop-color:#fcf611;stop-opacity:1"
+ offset="0"
+ id="stop4150" />
+ <stop
+ style="stop-color:#ffc20b;stop-opacity:1"
+ offset="1"
+ id="stop4152" />
+ </linearGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4148"
+ id="radialGradient4154"
+ cx="8"
+ cy="1043.8622"
+ fx="8"
+ fy="1043.8622"
+ r="3.5"
+ gradientTransform="matrix(3.1428571,-2.4687518e-6,2.4687459e-6,3.1428481,-17.145434,-2236.3381)"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.4"
+ inkscape:cx="12.024399"
+ inkscape:cy="9.317634"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer4"
+ showgrid="true"
+ units="px"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1680"
+ inkscape:window-height="987"
+ inkscape:window-x="2952"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1"
+ inkscape:snap-grids="true"
+ inkscape:snap-to-guides="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)"
+ style="display:none">
+ <rect
+ style="fill:url(#radialGradient4154);fill-opacity:1;stroke:none;stroke-width:100;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4138"
+ width="16"
+ height="16.000017"
+ x="0"
+ y="1036.3622"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="sash"
+ style="display:none">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 20,-4 -5,21"
+ id="path4163"
+ inkscape:connector-curvature="0"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer3"
+ inkscape:label="chevron"
+ style="display:none">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M -4,-4 8,8 20,-4"
+ id="path4166"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer4"
+ inkscape:label="cross">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 8,-4 8,20"
+ id="path4169"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 20,6 -4,6"
+ id="path4171"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/castle_storage/LICENSE b/castle_storage/LICENSE
new file mode 100644
index 0000000..456d091
--- /dev/null
+++ b/castle_storage/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Minetest Mods Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/castle_storage/README.txt b/castle_storage/README.txt
new file mode 100644
index 0000000..1954c29
--- /dev/null
+++ b/castle_storage/README.txt
@@ -0,0 +1,14 @@
+=-=-=-=-=-=-=-=-=-=
+
+Castles Mod
+by: Philipbenr And DanDuncombe
+
+=-=-=-=-=-=-=-=-=-=
+
+Licence: MIT
+
+see: LICENSE
+
+=-=-=-=-=-=-=-=-=-=
+
+This mod contains a storage crate and an iron-bound chest. \ No newline at end of file
diff --git a/castle_storage/crate.lua b/castle_storage/crate.lua
new file mode 100644
index 0000000..e370b87
--- /dev/null
+++ b/castle_storage/crate.lua
@@ -0,0 +1,59 @@
+minetest.register_alias("darkage:box", "castle_storage:crate")
+minetest.register_alias("castle:crate", "castle_storage:crate")
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+minetest.register_node("castle_storage:crate", {
+ description = S("Crate"),
+ drawtype = "normal",
+ tiles = {"castle_crate_top.png","castle_crate_top.png","castle_crate.png","castle_crate.png","castle_crate.png","castle_crate.png"},
+ groups = {choppy=3},
+ sounds = default.node_sound_wood_defaults(),
+ paramtype = "light",
+ on_construct = function(pos)
+ local meta = minetest.get_meta(pos)
+ meta:set_string("formspec",
+ "size[8,9]"..
+ default.gui_bg ..
+ default.gui_bg_img ..
+ default.gui_slots ..
+ "list[current_name;main;0,0;8,5;]"..
+ "list[current_player;main;0,5;8,4;]")
+ meta:set_string("infotext", S("Crate"))
+ local inv = meta:get_inventory()
+ inv:set_size("main", 8*4)
+ end,
+ can_dig = function(pos,player)
+ local meta = minetest.get_meta(pos);
+ local inv = meta:get_inventory()
+ return inv:is_empty("main")
+ end,
+ on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
+ minetest.log("action", S("@1 moves stuff in crate at @2", player:get_player_name(), minetest.pos_to_string(pos)))
+ end,
+ on_metadata_inventory_put = function(pos, listname, index, stack, player)
+ minetest.log("action", S("@1 moves stuff to crate at @2", player:get_player_name(), minetest.pos_to_string(pos)))
+ end,
+ on_metadata_inventory_take = function(pos, listname, index, stack, player)
+ minetest.log("action", S("@1 takes stuff from locked chest at @2", player:get_player_name(), minetest.pos_to_string(pos)))
+ end,
+})
+
+minetest.register_craft({
+ output = "castle_storage:crate",
+ recipe = {
+ {"default:wood", "default:wood", "default:wood"},
+ {"default:wood", "default:steel_ingot", "default:wood"},
+ }
+})
+
+-- Hopper compatibility
+if minetest.get_modpath("hopper") and hopper ~= nil and hopper.add_container ~= nil then
+ hopper:add_container({
+ {"top", "castle_storage:crate", "main"},
+ {"side", "castle_storage:crate", "main"},
+ {"bottom", "castle_storage:crate", "main"},
+ })
+end \ No newline at end of file
diff --git a/castle_storage/depends.txt b/castle_storage/depends.txt
new file mode 100644
index 0000000..9dd7d9b
--- /dev/null
+++ b/castle_storage/depends.txt
@@ -0,0 +1,3 @@
+default
+intllib?
+hopper?
diff --git a/castle_storage/description.txt b/castle_storage/description.txt
new file mode 100644
index 0000000..bb901c6
--- /dev/null
+++ b/castle_storage/description.txt
@@ -0,0 +1 @@
+This mod contains storage containers one might find contained in a castle.
diff --git a/castle_storage/init.lua b/castle_storage/init.lua
new file mode 100644
index 0000000..187af4f
--- /dev/null
+++ b/castle_storage/init.lua
@@ -0,0 +1,3 @@
+local MP = minetest.get_modpath(minetest.get_current_modname())
+dofile(MP.."/crate.lua")
+dofile(MP.."/ironbound_chest.lua") \ No newline at end of file
diff --git a/castle_storage/intllib.lua b/castle_storage/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/castle_storage/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/castle_storage/ironbound_chest.lua b/castle_storage/ironbound_chest.lua
new file mode 100644
index 0000000..c042244
--- /dev/null
+++ b/castle_storage/ironbound_chest.lua
@@ -0,0 +1,143 @@
+minetest.register_alias("castle:ironbound_chest", "castle_storage:ironbound_chest")
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+local get_ironbound_chest_formspec = function(pos)
+ local spos = pos.x .. "," .. pos.y .. "," ..pos.z
+ local formspec =
+ "size[8,9]"..
+ default.gui_bg ..
+ default.gui_bg_img ..
+ default.gui_slots ..
+ "list[nodemeta:".. spos .. ";main;,0;8,4;]"..
+ "list[current_player;main;,5;8,4;]"
+ return formspec
+end
+
+local function has_ironbound_chest_privilege(meta, player)
+ local name = ""
+ if player then
+ if minetest.check_player_privs(player, "protection_bypass") then
+ return true
+ end
+ name = player:get_player_name()
+ end
+ if name ~= meta:get_string("owner") then
+ return false
+ end
+ return true
+end
+
+minetest.register_node("castle_storage:ironbound_chest",{
+ drawtype = "nodebox",
+ description = S("Ironbound Chest"),
+ tiles = {"castle_ironbound_chest_top.png",
+ "castle_ironbound_chest_top.png",
+ "castle_ironbound_chest_side.png",
+ "castle_ironbound_chest_side.png",
+ "castle_ironbound_chest_back.png",
+ "castle_ironbound_chest_front.png"},
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = {cracky=2},
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.3125, 0.5, -0.0625, 0.3125},
+ {-0.5, -0.0625, -0.25, 0.5, 0, 0.25},
+ {-0.5, 0, -0.1875,0.5, 0.0625, 0.1875},
+ {-0.5, 0.0625, -0.0625, 0.5, 0.125, 0.0625},
+ },
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.4, 0.5, 0.2, 0.4},
+
+ },
+ },
+ sounds = default.node_sound_wood_defaults(),
+ after_place_node = function(pos, placer)
+ local meta = minetest.get_meta(pos)
+ meta:set_string("owner", placer:get_player_name() or "")
+ meta:set_string("infotext", S("Ironbound Chest (owned by @1)", meta:get_string("owner")))
+ end,
+ on_construct = function(pos)
+ local meta = minetest.get_meta(pos)
+ meta:set_string("infotext", S("Ironbound Chest"))
+ meta:set_string("owner", "")
+ local inv = meta:get_inventory()
+ inv:set_size("main", 8*4)
+ end,
+ can_dig = function(pos,player)
+ local meta = minetest.get_meta(pos);
+ local inv = meta:get_inventory()
+ return inv:is_empty("main") and has_ironbound_chest_privilege(meta, player)
+ end,
+ allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
+ local meta = minetest.get_meta(pos)
+ if not has_ironbound_chest_privilege(meta, player) then
+ minetest.log("action", S("@1 tried to access a locked chest belonging to @2 at @3",
+ player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos)))
+ return 0
+ end
+ return count
+ end,
+ allow_metadata_inventory_put = function(pos, listname, index, stack, player)
+ local meta = minetest.get_meta(pos)
+ if not has_ironbound_chest_privilege(meta, player) then
+ minetest.log("action", S("@1 tried to access a locked chest belonging to @2 at @3",
+ player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos)))
+ return 0
+ end
+ return stack:get_count()
+ end,
+ allow_metadata_inventory_take = function(pos, listname, index, stack, player)
+ local meta = minetest.get_meta(pos)
+ if not has_ironbound_chest_privilege(meta, player) then
+ minetest.log("action", S("@1 tried to access a locked chest belonging to @2 at @3",
+ player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos)))
+ return 0
+ end
+ return stack:get_count()
+ end,
+ on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
+ minetest.log("action", S("@1 moves stuff in locked chest at @2", player:get_player_name(), minetest.pos_to_string(pos)))
+ end,
+ on_metadata_inventory_put = function(pos, listname, index, stack, player)
+ minetest.log("action", S("@1 moves stuff to locked chest at @2", player:get_player_name(), minetest.pos_to_string(pos)))
+ end,
+ on_metadata_inventory_take = function(pos, listname, index, stack, player)
+ minetest.log("action", S("@1 takes stuff from locked chest at @2", player:get_player_name(), minetest.pos_to_string(pos)))
+ end,
+ on_rightclick = function(pos, node, clicker)
+ local meta = minetest.get_meta(pos)
+ if has_ironbound_chest_privilege(meta, clicker) then
+ minetest.show_formspec(
+ clicker:get_player_name(),
+ "castle_storage:ironbound_chest",
+ get_ironbound_chest_formspec(pos)
+ )
+ end
+ end,
+ on_blast = function() end,
+})
+
+minetest.register_craft({
+ output = "castle_storage:ironbound_chest",
+ recipe = {
+ {"default:wood", "default:steel_ingot","default:wood"},
+ {"default:wood", "default:steel_ingot","default:wood"}
+ }
+})
+
+-- Hopper compatibility
+if minetest.get_modpath("hopper") and hopper ~= nil and hopper.add_container ~= nil then
+ hopper:add_container({
+ {"top", "castle_storage:ironbound_chest", "main"},
+ {"side", "castle_storage:ironbound_chest", "main"},
+ {"bottom", "castle_storage:ironbound_chest", "main"},
+ })
+end \ No newline at end of file
diff --git a/castle_storage/locale/template.pot b/castle_storage/locale/template.pot
new file mode 100644
index 0000000..0753584
--- /dev/null
+++ b/castle_storage/locale/template.pot
@@ -0,0 +1,53 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-25 19:18-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: crate.lua:9 crate.lua:24
+msgid "Crate"
+msgstr ""
+
+#: crate.lua:34
+msgid "@1 moves stuff in crate at @2"
+msgstr ""
+
+#: crate.lua:37
+msgid "@1 moves stuff to crate at @2"
+msgstr ""
+
+#: crate.lua:40 ironbound_chest.lua:113
+msgid "@1 takes stuff from locked chest at @2"
+msgstr ""
+
+#: ironbound_chest.lua:35 ironbound_chest.lua:69
+msgid "Ironbound Chest"
+msgstr ""
+
+#: ironbound_chest.lua:65
+msgid "Ironbound Chest (owned by @1)"
+msgstr ""
+
+#: ironbound_chest.lua:82 ironbound_chest.lua:91 ironbound_chest.lua:100
+msgid "@1 tried to access a locked chest belonging to @2 at @3"
+msgstr ""
+
+#: ironbound_chest.lua:107
+msgid "@1 moves stuff in locked chest at @2"
+msgstr ""
+
+#: ironbound_chest.lua:110
+msgid "@1 moves stuff to locked chest at @2"
+msgstr ""
diff --git a/castle_storage/screenshot.png b/castle_storage/screenshot.png
new file mode 100644
index 0000000..bd3e20b
--- /dev/null
+++ b/castle_storage/screenshot.png
Binary files differ
diff --git a/castle_storage/textures/LICENSE.txt b/castle_storage/textures/LICENSE.txt
new file mode 100644
index 0000000..0d64b59
--- /dev/null
+++ b/castle_storage/textures/LICENSE.txt
@@ -0,0 +1,13 @@
+--------------------------------------------
+
+16 px textures based on Castle mod
+original textures by Philipner
+
+License Textures: Napiophelios - CC-BY-SA 3.0
+
+-castle_ironbound_chest_back.png
+-castle_ironbound_chest_front.png
+-castle_ironbound_chest_side.png
+-castle_ironbound_chest_top.png
+
+--------------------------------------------
diff --git a/castle_storage/textures/castle_crate.png b/castle_storage/textures/castle_crate.png
new file mode 100644
index 0000000..33669e8
--- /dev/null
+++ b/castle_storage/textures/castle_crate.png
Binary files differ
diff --git a/castle_storage/textures/castle_crate_top.png b/castle_storage/textures/castle_crate_top.png
new file mode 100644
index 0000000..89d65a2
--- /dev/null
+++ b/castle_storage/textures/castle_crate_top.png
Binary files differ
diff --git a/castle_storage/textures/castle_ironbound_chest_back.png b/castle_storage/textures/castle_ironbound_chest_back.png
new file mode 100644
index 0000000..29446db
--- /dev/null
+++ b/castle_storage/textures/castle_ironbound_chest_back.png
Binary files differ
diff --git a/castle_storage/textures/castle_ironbound_chest_front.png b/castle_storage/textures/castle_ironbound_chest_front.png
new file mode 100644
index 0000000..8d91e07
--- /dev/null
+++ b/castle_storage/textures/castle_ironbound_chest_front.png
Binary files differ
diff --git a/castle_storage/textures/castle_ironbound_chest_side.png b/castle_storage/textures/castle_ironbound_chest_side.png
new file mode 100644
index 0000000..3a94f81
--- /dev/null
+++ b/castle_storage/textures/castle_ironbound_chest_side.png
Binary files differ
diff --git a/castle_storage/textures/castle_ironbound_chest_top.png b/castle_storage/textures/castle_ironbound_chest_top.png
new file mode 100644
index 0000000..29446db
--- /dev/null
+++ b/castle_storage/textures/castle_ironbound_chest_top.png
Binary files differ
diff --git a/castle_tapestries/LICENSE b/castle_tapestries/LICENSE
new file mode 100644
index 0000000..456d091
--- /dev/null
+++ b/castle_tapestries/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Minetest Mods Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/castle_tapestries/README.txt b/castle_tapestries/README.txt
new file mode 100644
index 0000000..dc5885f
--- /dev/null
+++ b/castle_tapestries/README.txt
@@ -0,0 +1,13 @@
+=-=-=-=-=-=-=-=-=-=
+
+Tapestries Mod
+by: Philipbenr And DanDuncombe
+
+=-=-=-=-=-=-=-=-=-=
+
+Licence: MIT
+
+see: LICENSE
+
+
+This mod contains tapestries of three different lengths, and a wooden crosspiece to hang them from. The tapestries can be dyed any color once hung. \ No newline at end of file
diff --git a/castle_tapestries/depends.txt b/castle_tapestries/depends.txt
new file mode 100644
index 0000000..fe7e3d9
--- /dev/null
+++ b/castle_tapestries/depends.txt
@@ -0,0 +1,3 @@
+default
+unifieddyes
+intllib?
diff --git a/castle_tapestries/description.txt b/castle_tapestries/description.txt
new file mode 100644
index 0000000..29d4bd2
--- /dev/null
+++ b/castle_tapestries/description.txt
@@ -0,0 +1 @@
+This is a mod for creating medieval tapestries, as found in castles
diff --git a/castle_tapestries/init.lua b/castle_tapestries/init.lua
new file mode 100644
index 0000000..03e318d
--- /dev/null
+++ b/castle_tapestries/init.lua
@@ -0,0 +1,205 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+local tapestry = {}
+
+minetest.register_alias("castle:tapestry_top", "castle_tapestries:tapestry_top")
+minetest.register_alias("castle:tapestry", "castle_tapestries:tapestry")
+minetest.register_alias("castle:tapestry_long", "castle_tapestries:tapestry_long")
+minetest.register_alias("castle:tapestry_very_long", "castle_tapestries:tapestry_very_long")
+
+minetest.register_node("castle_tapestries:tapestry_top", {
+ drawtype = "nodebox",
+ description = S("Tapestry Top"),
+ tiles = {"default_wood.png"},
+ sunlight_propagates = true,
+ groups = {flammable=3,oddly_breakable_by_hand=3},
+ sounds = default.node_sound_defaults(),
+ paramtype = "light",
+ paramtype2 = "facedir",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.6,-0.5,0.375,0.6,-0.375,0.5},
+ },
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.6,-0.5,0.375,0.6,-0.375,0.5},
+ },
+ },
+})
+
+minetest.register_craft({
+ type = "shapeless",
+ output = 'castle_tapestries:tapestry_top',
+ recipe = {'default:stick'},
+})
+
+tapestry.colours = {
+ "white",
+ "grey",
+ "black",
+ "red",
+ "yellow",
+ "green",
+ "cyan",
+ "blue",
+ "magenta",
+ "orange",
+ "violet",
+ "dark_grey",
+ "dark_green",
+ "pink",
+ "brown",
+}
+
+-- Regular-length tapestry
+
+minetest.register_node("castle_tapestries:tapestry", {
+ drawtype = "mesh",
+ mesh = "castle_tapestry.obj",
+ description = S("Tapestry"),
+ tiles = {"castle_tapestry.png"},
+ inventory_image = "castle_tapestry_inv.png",
+ groups = {oddly_breakable_by_hand=3,flammable=3, ud_param2_colorable = 1},
+ sounds = default.node_sound_defaults(),
+ paramtype = "light",
+ paramtype2 = "colorwallmounted",
+ palette = "unifieddyes_palette_colorwallmounted.png",
+ selection_box = {
+ type = "wallmounted",
+ wall_side = {-0.5,-0.5,0.4375,0.5,1.5,0.5},
+ },
+ after_place_node = unifieddyes.fix_rotation_nsew,
+ after_dig_node = unifieddyes.after_dig_node,
+ on_rotate = unifieddyes.fix_after_screwdriver_nsew
+})
+
+-- Crafting from wool and a stick
+
+minetest.register_craft({
+ type = "shapeless",
+ output = 'castle_tapestries:tapestry',
+ recipe = {'wool:white', 'default:stick'},
+})
+
+-- Long tapestry
+
+minetest.register_node("castle_tapestries:tapestry_long", {
+ drawtype = "mesh",
+ mesh = "castle_tapestry_long.obj",
+ description = S("Tapestry (Long)"),
+ tiles = {"castle_tapestry.png"},
+ inventory_image = "castle_tapestry_long_inv.png",
+ groups = {oddly_breakable_by_hand=3,flammable=3, ud_param2_colorable = 1},
+ sounds = default.node_sound_defaults(),
+ paramtype = "light",
+ paramtype2 = "colorwallmounted",
+ palette = "unifieddyes_palette_colorwallmounted.png",
+ selection_box = {
+ type = "wallmounted",
+ wall_side = {-0.5,-0.5,0.4375,0.5,2.5,0.5},
+ },
+ after_place_node = unifieddyes.fix_rotation_nsew,
+ after_dig_node = unifieddyes.after_dig_node,
+ on_rotate = unifieddyes.fix_after_screwdriver_nsew
+})
+
+-- Crafting from normal tapestry and wool
+
+minetest.register_craft({
+ type = "shapeless",
+ output = 'castle_tapestries:tapestry_long',
+ recipe = {'wool:white', 'castle_tapestries:tapestry'},
+})
+
+-- Very long tapestry
+
+minetest.register_node("castle_tapestries:tapestry_very_long", {
+ drawtype = "mesh",
+ mesh = "castle_tapestry_very_long.obj",
+ description = S("Tapestry (Very Long)"),
+ tiles = {"castle_tapestry.png"},
+ inventory_image = "castle_tapestry_very_long_inv.png",
+ groups = {oddly_breakable_by_hand=3,flammable=3, ud_param2_colorable = 1},
+ sounds = default.node_sound_defaults(),
+ paramtype = "light",
+ paramtype2 = "colorwallmounted",
+ palette = "unifieddyes_palette_colorwallmounted.png",
+ selection_box = {
+ type = "wallmounted",
+ wall_side = {-0.5,-0.5,0.4375,0.5,3.5,0.5},
+ },
+ after_place_node = unifieddyes.fix_rotation_nsew,
+ after_dig_node = unifieddyes.after_dig_node,
+ on_rotate = unifieddyes.fix_after_screwdriver_nsew
+})
+
+-- Crafting from long tapestry and wool
+
+minetest.register_craft({
+ type = "shapeless",
+ output = 'castle_tapestries:tapestry_very_long',
+ recipe = {'wool:white', 'castle_tapestries:tapestry_long'},
+})
+
+-- Convert static tapestries to param2 color
+
+local old_static_tapestries = {}
+
+for _, color in ipairs(tapestry.colours) do
+ table.insert(old_static_tapestries, "castle:tapestry_"..color)
+ table.insert(old_static_tapestries, "castle:long_tapestry_"..color)
+ table.insert(old_static_tapestries, "castle:very_long_tapestry_"..color)
+end
+
+minetest.register_lbm({
+ name = "castle_tapestries:convert_tapestries",
+ label = "Convert tapestries to use param2 color",
+ run_at_every_load = false,
+ nodenames = old_static_tapestries,
+ action = function(pos, node)
+ local oldname = node.name
+ local color = string.sub(oldname, string.find(oldname, "_", -12) + 1)
+
+ if color == "red" then
+ color = "medium_red"
+ elseif color == "cyan" then
+ color = "medium_cyan"
+ elseif color == "blue" then
+ color = "medium_blue"
+ elseif color == "magenta" then
+ color = "medium_magenta"
+ end
+
+ local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
+
+ local old_fdir = math.floor(node.param2 % 32)
+ local new_fdir = 3
+
+ if old_fdir == 0 then
+ new_fdir = 3
+ elseif old_fdir == 1 then
+ new_fdir = 4
+ elseif old_fdir == 2 then
+ new_fdir = 2
+ elseif old_fdir == 3 then
+ new_fdir = 5
+ end
+
+ local param2 = paletteidx + new_fdir
+ local newname = "castle_tapestries:tapestry"
+ if string.find(oldname, ":long") then
+ newname = "castle_tapestries:tapestry_long"
+ elseif string.find(oldname, ":very_long") then
+ newname = "castle_tapestries:tapestry_very_long"
+ end
+
+ minetest.set_node(pos, { name = newname, param2 = param2 })
+ local meta = minetest.get_meta(pos)
+ meta:set_string("dye", "unifieddyes:"..color)
+ end
+})
diff --git a/castle_tapestries/intllib.lua b/castle_tapestries/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/castle_tapestries/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/castle_tapestries/locale/template.pot b/castle_tapestries/locale/template.pot
new file mode 100644
index 0000000..0a0745a
--- /dev/null
+++ b/castle_tapestries/locale/template.pot
@@ -0,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-25 14:32-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: init.lua:14
+msgid "Tapestry Top"
+msgstr ""
+
+#: init.lua:64
+msgid "Tapestry"
+msgstr ""
+
+#: init.lua:94
+msgid "Tapestry (Long)"
+msgstr ""
+
+#: init.lua:124
+msgid "Tapestry (Very Long)"
+msgstr ""
diff --git a/castle_tapestries/mod.conf b/castle_tapestries/mod.conf
new file mode 100644
index 0000000..6d86a0d
--- /dev/null
+++ b/castle_tapestries/mod.conf
@@ -0,0 +1 @@
+name = castle_tapestries
diff --git a/castle_tapestries/models/LICENSE.txt b/castle_tapestries/models/LICENSE.txt
new file mode 100644
index 0000000..80d15c1
--- /dev/null
+++ b/castle_tapestries/models/LICENSE.txt
@@ -0,0 +1,5 @@
+License Textures: Stuart Jones - WTFPL
+
+-castle_crossbow_bolt_inv.png
+-castle_crossbow_bolt_uv.png
+-castle_crossbow_hit.png
diff --git a/castle_tapestries/models/castle_tapestry.obj b/castle_tapestries/models/castle_tapestry.obj
new file mode 100644
index 0000000..5465c46
--- /dev/null
+++ b/castle_tapestries/models/castle_tapestry.obj
@@ -0,0 +1,212 @@
+# Blender v2.72 (sub 0) OBJ File: 'castle_tapestry.blend'
+# www.blender.org
+o Cube
+v -0.500000 0.500000 -0.125000
+v -0.437500 0.500000 -0.125000
+v -0.500000 0.500000 1.500000
+v -0.437500 0.500000 1.500000
+v -0.437500 -0.500000 1.500000
+v -0.500000 -0.500000 1.500000
+v -0.437500 0.125000 -0.250000
+v -0.500000 0.125000 -0.250000
+v -0.500000 0.125000 -0.375000
+v -0.437500 0.125000 -0.375000
+v -0.437500 0.187500 -0.375000
+v -0.500000 0.187500 -0.375000
+v -0.500000 0.312500 -0.500000
+v -0.437500 0.312500 -0.500000
+v -0.437500 0.312500 -0.375000
+v -0.500000 0.312500 -0.375000
+v -0.500000 0.375000 -0.375000
+v -0.437500 0.375000 -0.375000
+v -0.437500 0.375000 -0.250000
+v -0.500000 0.375000 -0.250000
+v -0.437500 -0.187500 -0.500000
+v -0.500000 -0.312500 -0.500000
+v -0.437500 -0.312500 -0.500000
+v -0.500000 0.187500 -0.500000
+v -0.437500 0.187500 -0.500000
+v -0.500000 0.437500 -0.250000
+v -0.437500 0.437500 -0.250000
+v -0.437500 0.437500 -0.125000
+v -0.500000 0.437500 -0.125000
+v -0.437500 0.062500 -0.250000
+v -0.500000 0.062500 -0.250000
+v -0.437500 0.062500 -0.125000
+v -0.500000 0.062500 -0.125000
+v -0.437500 -0.062500 -0.125000
+v -0.500000 -0.062500 -0.125000
+v -0.437500 -0.062500 -0.250000
+v -0.500000 -0.062500 -0.250000
+v -0.437500 -0.125000 -0.250000
+v -0.500000 -0.125000 -0.250000
+v -0.437500 -0.125000 -0.375000
+v -0.500000 -0.125000 -0.375000
+v -0.437500 -0.187500 -0.375000
+v -0.500000 -0.187500 -0.375000
+v -0.500000 -0.187500 -0.500000
+v -0.500000 -0.312500 -0.375000
+v -0.437500 -0.312500 -0.375000
+v -0.500000 -0.375000 -0.375000
+v -0.437500 -0.375000 -0.375000
+v -0.500000 -0.375000 -0.250000
+v -0.437500 -0.375000 -0.250000
+v -0.500000 -0.437500 -0.250000
+v -0.437500 -0.437500 -0.250000
+v -0.500000 -0.437500 -0.125000
+v -0.437500 -0.437500 -0.125000
+v -0.500000 -0.500000 -0.125000
+v -0.437500 -0.500000 -0.125000
+v -0.500000 0.500000 0.500000
+v -0.437500 0.500000 0.500000
+v -0.500000 -0.500000 0.500000
+v -0.437500 -0.500000 0.500000
+v -0.500000 0.343750 -0.375000
+vt 0.062500 0.000000
+vt 0.062500 1.000000
+vt 0.000000 1.000000
+vt 0.000003 0.000000
+vt 0.937500 0.250000
+vt 1.000000 0.250000
+vt 1.000000 0.375000
+vt 0.937500 0.375000
+vt 0.625000 0.937500
+vt 0.625000 0.999999
+vt 0.562500 0.999999
+vt 0.562500 0.937500
+vt 0.937500 0.125000
+vt 1.000000 0.125000
+vt 0.687500 0.937500
+vt 0.687500 0.999999
+vt 0.937500 0.000000
+vt 1.000000 0.000000
+vt 0.062500 0.125000
+vt 0.000000 0.125000
+vt 0.875000 0.937500
+vt 0.875000 1.000000
+vt 0.812500 1.000000
+vt 0.812500 0.937500
+vt 0.843750 0.937500
+vt 0.062500 0.250000
+vt 0.000000 0.250000
+vt 0.937500 0.937500
+vt 0.937500 1.000000
+vt 0.062500 0.375000
+vt 0.000000 0.375000
+vt 1.000000 0.937500
+vt 1.000000 1.000000
+vt 0.437500 0.937500
+vt 0.437500 0.999999
+vt 0.375000 0.999999
+vt 0.375000 0.937500
+vt 0.312500 0.999999
+vt 0.312500 0.937500
+vt 0.187500 0.937500
+vt 0.187500 0.999999
+vt 0.125000 0.999999
+vt 0.125000 0.937500
+vt 0.062500 0.937500
+vt 0.000000 0.937500
+vt 0.625000 0.000000
+vt 0.625000 0.062500
+vt 0.625000 0.437500
+vt 0.625000 0.562500
+vt 0.375000 0.437500
+vt 0.375000 0.062500
+vt 0.375000 0.000000
+vt 0.375000 0.562500
+vt 0.250000 0.437500
+vt 0.250000 0.375000
+vt 0.250000 0.125000
+vt 0.250000 0.062500
+vt 0.250000 0.937500
+vt 0.250000 0.875000
+vt 0.250000 0.625000
+vt 0.250000 0.562500
+vt 0.750000 0.562500
+vt 0.750000 0.625000
+vt 0.750000 0.875000
+vt 0.750000 0.937500
+vt 0.750000 0.062500
+vt 0.750000 0.125000
+vt 0.750000 0.375000
+vt 0.750000 0.437500
+vt 0.875000 0.625000
+vt 0.875000 0.687500
+vt 0.875000 0.812500
+vt 0.875000 0.875000
+vt 0.875000 0.125000
+vt 0.875000 0.156250
+vt 0.875000 0.187500
+vt 0.875000 0.312500
+vt 0.875000 0.375000
+vt 1.000000 0.687500
+vt 1.000000 0.812500
+vt 1.000000 0.187500
+vt 1.000000 0.312500
+vt 0.125000 0.187500
+vt 0.125000 0.312500
+vt 0.000000 0.312500
+vt 0.000000 0.187500
+vt 0.125000 0.687500
+vt 0.125000 0.812500
+vt 0.000000 0.812500
+vt 0.000000 0.687500
+vt 0.125000 0.875000
+vt 0.125000 0.625000
+vt 0.125000 0.375000
+vt 0.125000 0.125000
+vn 0.000000 1.000000 -0.000000
+vn -0.000000 -1.000000 0.000000
+vn 0.000000 0.000000 -1.000000
+vn -1.000000 0.000000 0.000000
+vn 1.000000 -0.000000 -0.000000
+vn 0.000000 0.000000 1.000000
+g Cube_Cube_Material
+s off
+f 57/1/1 3/2/1 4/3/1 58/4/1
+f 31/5/2 30/6/2 32/7/2 33/8/2
+f 8/9/3 7/10/3 30/11/3 31/12/3
+f 9/13/2 10/14/2 7/6/2 8/5/2
+f 12/15/3 11/16/3 10/10/3 9/9/3
+f 24/17/2 25/18/2 11/14/2 12/13/2
+f 16/19/1 15/20/1 14/4/1 13/1/1
+f 17/21/3 18/22/3 15/23/3 16/24/3 61/25/3
+f 20/26/1 19/27/1 18/20/1 17/19/1
+f 26/28/3 27/29/3 19/22/3 20/21/3
+f 29/30/1 28/31/1 27/27/1 26/26/1
+f 1/32/3 2/33/3 28/29/3 29/28/3
+f 37/34/3 36/35/3 38/36/3 39/37/3
+f 39/26/1 38/27/1 40/20/1 41/19/1
+f 41/37/3 40/36/3 42/38/3 43/39/3
+f 22/17/2 23/18/2 46/14/2 45/13/2
+f 45/40/3 46/41/3 48/42/3 47/43/3
+f 47/13/2 48/14/2 50/6/2 49/5/2
+f 49/43/3 50/42/3 52/2/3 51/44/3
+f 51/5/2 52/6/2 54/7/2 53/8/2
+f 53/44/3 54/2/3 56/3/3 55/45/3
+f 43/19/1 42/20/1 21/4/1 44/1/1
+f 14/23/3 25/16/3 24/15/3 13/24/3
+f 60/18/2 5/33/2 6/29/2 59/17/2
+f 21/38/3 23/41/3 22/40/3 44/39/3
+f 57/18/4 59/33/4 6/3/4 3/4/4
+f 60/3/5 58/4/5 4/18/5 5/33/5
+f 1/30/1 57/2/1 58/3/1 2/31/1
+f 56/7/2 60/33/2 59/29/2 55/8/2
+f 1/46/4 29/47/4 33/48/4 35/49/4 53/9/4 55/10/4 59/3/4 57/4/4
+f 32/50/5 28/51/5 2/52/5 58/18/5 60/33/5 56/36/5 54/37/5 34/53/5
+f 34/31/1 36/27/1 37/26/1 35/30/1
+f 30/54/5 7/55/5 19/56/5 27/57/5 28/51/5 32/50/5
+f 34/53/5 54/37/5 52/58/5 50/59/5 38/60/5 36/61/5
+f 53/9/4 35/49/4 37/62/4 39/63/4 49/64/4 51/65/4
+f 29/47/4 26/66/4 20/67/4 8/68/4 31/69/4 33/48/4
+f 33/12/3 32/11/3 34/35/3 35/34/3
+f 49/64/4 39/63/4 41/70/4 43/71/4 45/72/4 47/73/4
+f 8/68/4 20/67/4 17/74/4 61/75/4 16/76/4 12/77/4 9/78/4
+f 45/72/4 43/71/4 44/79/4 22/80/4
+f 12/77/4 16/76/4 13/81/4 24/82/4
+f 15/83/5 11/84/5 25/85/5 14/86/5
+f 42/87/5 46/88/5 23/89/5 21/90/5
+f 38/60/5 50/59/5 48/91/5 46/88/5 42/87/5 40/92/5
+f 7/55/5 10/93/5 11/84/5 15/83/5 18/94/5 19/56/5
+f 3/33/6 6/3/6 5/45/6 4/32/6
diff --git a/castle_tapestries/models/castle_tapestry_long.obj b/castle_tapestries/models/castle_tapestry_long.obj
new file mode 100644
index 0000000..f240853
--- /dev/null
+++ b/castle_tapestries/models/castle_tapestry_long.obj
@@ -0,0 +1,220 @@
+# Blender v2.72 (sub 0) OBJ File: 'castle_tapestry_long.blend'
+# www.blender.org
+o Cube
+v -0.500000 0.500000 -0.125000
+v -0.437500 0.500000 -0.125000
+v -0.500000 0.500001 1.500000
+v -0.437499 0.500000 1.500000
+v -0.437500 -0.500000 1.500000
+v -0.500000 -0.500000 1.500000
+v -0.437500 0.125000 -0.250000
+v -0.500000 0.125000 -0.250000
+v -0.500000 0.125000 -0.375000
+v -0.437500 0.125000 -0.375000
+v -0.437500 0.187500 -0.375000
+v -0.500000 0.187500 -0.375000
+v -0.500000 0.312500 -0.500000
+v -0.437500 0.312500 -0.500000
+v -0.437500 0.312500 -0.375000
+v -0.500000 0.312500 -0.375000
+v -0.500000 0.375000 -0.375000
+v -0.437500 0.375000 -0.375000
+v -0.437500 0.375000 -0.250000
+v -0.500000 0.375000 -0.250000
+v -0.437500 -0.187500 -0.500000
+v -0.500000 -0.312500 -0.500000
+v -0.437500 -0.312500 -0.500000
+v -0.500000 0.187500 -0.500000
+v -0.437500 0.187500 -0.500000
+v -0.500000 0.437500 -0.250000
+v -0.437500 0.437500 -0.250000
+v -0.437500 0.437500 -0.125000
+v -0.500000 0.437500 -0.125000
+v -0.437500 0.062500 -0.250000
+v -0.500000 0.062500 -0.250000
+v -0.437500 0.062500 -0.125000
+v -0.500000 0.062500 -0.125000
+v -0.437500 -0.062500 -0.125000
+v -0.500000 -0.062500 -0.125000
+v -0.437500 -0.062500 -0.250000
+v -0.500000 -0.062500 -0.250000
+v -0.437500 -0.125000 -0.250000
+v -0.500000 -0.125000 -0.250000
+v -0.437500 -0.125000 -0.375000
+v -0.500000 -0.125000 -0.375000
+v -0.437500 -0.187500 -0.375000
+v -0.500000 -0.187500 -0.375000
+v -0.500000 -0.187500 -0.500000
+v -0.500000 -0.312500 -0.375000
+v -0.437500 -0.312500 -0.375000
+v -0.500000 -0.375000 -0.375000
+v -0.437500 -0.375000 -0.375000
+v -0.500000 -0.375000 -0.250000
+v -0.437500 -0.375000 -0.250000
+v -0.500000 -0.437500 -0.250000
+v -0.437500 -0.437500 -0.250000
+v -0.500000 -0.437500 -0.125000
+v -0.437500 -0.437500 -0.125000
+v -0.500000 -0.500000 -0.125000
+v -0.437500 -0.500000 -0.125000
+v -0.500000 0.500000 0.500000
+v -0.437500 0.500000 0.500000
+v -0.500000 -0.500000 0.500000
+v -0.437500 -0.500000 0.500000
+v -0.500000 0.500001 2.500000
+v -0.437499 0.500000 2.500000
+v -0.437500 -0.500000 2.500000
+v -0.500000 -0.500000 2.500000
+v -0.500000 0.343750 -0.375000
+vt 0.062500 0.000000
+vt 0.062500 1.000000
+vt 0.000000 1.000000
+vt 0.000003 0.000000
+vt 0.937500 0.250000
+vt 1.000000 0.250000
+vt 1.000000 0.375000
+vt 0.937500 0.375000
+vt 0.625000 0.937500
+vt 0.625000 0.999999
+vt 0.562500 0.999999
+vt 0.562500 0.937500
+vt 0.937500 0.125000
+vt 1.000000 0.125000
+vt 0.687500 0.937500
+vt 0.687500 0.999999
+vt 0.937500 0.000000
+vt 1.000000 0.000000
+vt 0.062500 0.125000
+vt 0.000000 0.125000
+vt 0.875000 0.937500
+vt 0.875000 1.000000
+vt 0.812500 1.000000
+vt 0.812500 0.937500
+vt 0.843750 0.937500
+vt 0.062500 0.250000
+vt 0.000000 0.250000
+vt 0.937500 0.937500
+vt 0.937500 1.000000
+vt 0.062500 0.375000
+vt 0.000000 0.375000
+vt 1.000000 0.937500
+vt 1.000000 1.000000
+vt 0.437500 0.937500
+vt 0.437500 0.999999
+vt 0.375000 0.999999
+vt 0.375000 0.937500
+vt 0.312500 0.999999
+vt 0.312500 0.937500
+vt 0.187500 0.937500
+vt 0.187500 0.999999
+vt 0.125000 0.999999
+vt 0.125000 0.937500
+vt 0.062500 0.937500
+vt 0.000000 0.937500
+vt 0.625000 0.000000
+vt 0.625000 0.062500
+vt 0.625000 0.437500
+vt 0.625000 0.562500
+vt 0.375000 0.437500
+vt 0.375000 0.062500
+vt 0.375000 0.000000
+vt 0.375000 0.562500
+vt 0.250000 0.437500
+vt 0.250000 0.375000
+vt 0.250000 0.125000
+vt 0.250000 0.062500
+vt 0.250000 0.937500
+vt 0.250000 0.875000
+vt 0.250000 0.625000
+vt 0.250000 0.562500
+vt 0.750000 0.562500
+vt 0.750000 0.625000
+vt 0.750000 0.875000
+vt 0.750000 0.937500
+vt 0.750000 0.062500
+vt 0.750000 0.125000
+vt 0.750000 0.375000
+vt 0.750000 0.437500
+vt 0.875000 0.625000
+vt 0.875000 0.687500
+vt 0.875000 0.812500
+vt 0.875000 0.875000
+vt 0.875000 0.125000
+vt 0.875000 0.156250
+vt 0.875000 0.187500
+vt 0.875000 0.312500
+vt 0.875000 0.375000
+vt 1.000000 0.687500
+vt 1.000000 0.812500
+vt 1.000000 0.187500
+vt 1.000000 0.312500
+vt 0.125000 0.187500
+vt 0.125000 0.312500
+vt 0.000000 0.312500
+vt 0.000000 0.187500
+vt 0.125000 0.687500
+vt 0.125000 0.812500
+vt 0.000000 0.812500
+vt 0.000000 0.687500
+vt 0.125000 0.875000
+vt 0.125000 0.625000
+vt 0.125000 0.375000
+vt 0.125000 0.125000
+vn 0.000000 1.000000 0.000000
+vn -0.000000 -1.000000 0.000000
+vn 0.000000 0.000000 -1.000000
+vn -1.000000 0.000000 0.000000
+vn 1.000000 -0.000000 -0.000000
+vn 0.000000 0.000000 1.000000
+g Cube_Cube_Material
+s off
+f 57/1/1 3/2/1 4/3/1 58/4/1
+f 31/5/2 30/6/2 32/7/2 33/8/2
+f 8/9/3 7/10/3 30/11/3 31/12/3
+f 9/13/2 10/14/2 7/6/2 8/5/2
+f 12/15/3 11/16/3 10/10/3 9/9/3
+f 24/17/2 25/18/2 11/14/2 12/13/2
+f 16/19/1 15/20/1 14/4/1 13/1/1
+f 17/21/3 18/22/3 15/23/3 16/24/3 65/25/3
+f 20/26/1 19/27/1 18/20/1 17/19/1
+f 26/28/3 27/29/3 19/22/3 20/21/3
+f 29/30/1 28/31/1 27/27/1 26/26/1
+f 1/32/3 2/33/3 28/29/3 29/28/3
+f 37/34/3 36/35/3 38/36/3 39/37/3
+f 39/26/1 38/27/1 40/20/1 41/19/1
+f 41/37/3 40/36/3 42/38/3 43/39/3
+f 22/17/2 23/18/2 46/14/2 45/13/2
+f 45/40/3 46/41/3 48/42/3 47/43/3
+f 47/13/2 48/14/2 50/6/2 49/5/2
+f 49/43/3 50/42/3 52/2/3 51/44/3
+f 51/5/2 52/6/2 54/7/2 53/8/2
+f 53/44/3 54/2/3 56/3/3 55/45/3
+f 43/19/1 42/20/1 21/4/1 44/1/1
+f 14/23/3 25/16/3 24/15/3 13/24/3
+f 60/18/2 5/33/2 6/29/2 59/17/2
+f 21/38/3 23/41/3 22/40/3 44/39/3
+f 57/18/4 59/33/4 6/3/4 3/4/4
+f 60/3/5 58/4/5 4/18/5 5/33/5
+f 1/30/1 57/2/1 58/3/1 2/31/1
+f 56/7/2 60/33/2 59/29/2 55/8/2
+f 1/46/4 29/47/4 33/48/4 35/49/4 53/9/4 55/10/4 59/3/4 57/4/4
+f 32/50/5 28/51/5 2/52/5 58/18/5 60/33/5 56/36/5 54/37/5 34/53/5
+f 34/31/1 36/27/1 37/26/1 35/30/1
+f 30/54/5 7/55/5 19/56/5 27/57/5 28/51/5 32/50/5
+f 34/53/5 54/37/5 52/58/5 50/59/5 38/60/5 36/61/5
+f 53/9/4 35/49/4 37/62/4 39/63/4 49/64/4 51/65/4
+f 29/47/4 26/66/4 20/67/4 8/68/4 31/69/4 33/48/4
+f 33/12/3 32/11/3 34/35/3 35/34/3
+f 3/1/1 61/2/1 62/3/1 4/4/1
+f 5/18/2 63/33/2 64/29/2 6/17/2
+f 3/18/4 6/33/4 64/3/4 61/4/4
+f 5/3/5 4/4/5 62/18/5 63/33/5
+f 49/64/4 39/63/4 41/70/4 43/71/4 45/72/4 47/73/4
+f 8/68/4 20/67/4 17/74/4 65/75/4 16/76/4 12/77/4 9/78/4
+f 45/72/4 43/71/4 44/79/4 22/80/4
+f 12/77/4 16/76/4 13/81/4 24/82/4
+f 15/83/5 11/84/5 25/85/5 14/86/5
+f 42/87/5 46/88/5 23/89/5 21/90/5
+f 38/60/5 50/59/5 48/91/5 46/88/5 42/87/5 40/92/5
+f 7/55/5 10/93/5 11/84/5 15/83/5 18/94/5 19/56/5
+f 61/33/6 64/3/6 63/45/6 62/32/6
diff --git a/castle_tapestries/models/castle_tapestry_very_long.obj b/castle_tapestries/models/castle_tapestry_very_long.obj
new file mode 100644
index 0000000..bfe9843
--- /dev/null
+++ b/castle_tapestries/models/castle_tapestry_very_long.obj
@@ -0,0 +1,228 @@
+# Blender v2.72 (sub 0) OBJ File: 'castle_tapestry_very_long.blend'
+# www.blender.org
+o Cube
+v -0.500000 0.500000 -0.125000
+v -0.437500 0.500000 -0.125000
+v -0.500000 0.500001 1.500000
+v -0.437499 0.500000 1.500000
+v -0.437500 -0.500000 1.500000
+v -0.500000 -0.500000 1.500000
+v -0.437500 0.125000 -0.250000
+v -0.500000 0.125000 -0.250000
+v -0.500000 0.125000 -0.375000
+v -0.437500 0.125000 -0.375000
+v -0.437500 0.187500 -0.375000
+v -0.500000 0.187500 -0.375000
+v -0.500000 0.312500 -0.500000
+v -0.437500 0.312500 -0.500000
+v -0.437500 0.312500 -0.375000
+v -0.500000 0.312500 -0.375000
+v -0.500000 0.375000 -0.375000
+v -0.437500 0.375000 -0.375000
+v -0.437500 0.375000 -0.250000
+v -0.500000 0.375000 -0.250000
+v -0.437500 -0.187500 -0.500000
+v -0.500000 -0.312500 -0.500000
+v -0.437500 -0.312500 -0.500000
+v -0.500000 0.187500 -0.500000
+v -0.437500 0.187500 -0.500000
+v -0.500000 0.437500 -0.250000
+v -0.437500 0.437500 -0.250000
+v -0.437500 0.437500 -0.125000
+v -0.500000 0.437500 -0.125000
+v -0.437500 0.062500 -0.250000
+v -0.500000 0.062500 -0.250000
+v -0.437500 0.062500 -0.125000
+v -0.500000 0.062500 -0.125000
+v -0.437500 -0.062500 -0.125000
+v -0.500000 -0.062500 -0.125000
+v -0.437500 -0.062500 -0.250000
+v -0.500000 -0.062500 -0.250000
+v -0.437500 -0.125000 -0.250000
+v -0.500000 -0.125000 -0.250000
+v -0.437500 -0.125000 -0.375000
+v -0.500000 -0.125000 -0.375000
+v -0.437500 -0.187500 -0.375000
+v -0.500000 -0.187500 -0.375000
+v -0.500000 -0.187500 -0.500000
+v -0.500000 -0.312500 -0.375000
+v -0.437500 -0.312500 -0.375000
+v -0.500000 -0.375000 -0.375000
+v -0.437500 -0.375000 -0.375000
+v -0.500000 -0.375000 -0.250000
+v -0.437500 -0.375000 -0.250000
+v -0.500000 -0.437500 -0.250000
+v -0.437500 -0.437500 -0.250000
+v -0.500000 -0.437500 -0.125000
+v -0.437500 -0.437500 -0.125000
+v -0.500000 -0.500000 -0.125000
+v -0.437500 -0.500000 -0.125000
+v -0.500000 0.500000 0.500000
+v -0.437500 0.500000 0.500000
+v -0.500000 -0.500000 0.500000
+v -0.437500 -0.500000 0.500000
+v -0.500000 0.500001 2.500000
+v -0.437499 0.500000 2.500000
+v -0.437500 -0.500000 2.500000
+v -0.500000 -0.500000 2.500000
+v -0.500000 0.500001 3.500000
+v -0.437499 0.500000 3.500000
+v -0.437500 -0.500000 3.500000
+v -0.500000 -0.500000 3.500000
+v -0.500000 0.343750 -0.375000
+vt 0.062500 0.000000
+vt 0.062500 1.000000
+vt 0.000000 1.000000
+vt 0.000003 0.000000
+vt 0.937500 0.250000
+vt 1.000000 0.250000
+vt 1.000000 0.375000
+vt 0.937500 0.375000
+vt 0.625000 0.937500
+vt 0.625000 0.999999
+vt 0.562500 0.999999
+vt 0.562500 0.937500
+vt 0.937500 0.125000
+vt 1.000000 0.125000
+vt 0.687500 0.937500
+vt 0.687500 0.999999
+vt 0.937500 0.000000
+vt 1.000000 0.000000
+vt 0.062500 0.125000
+vt 0.000000 0.125000
+vt 0.875000 0.937500
+vt 0.875000 1.000000
+vt 0.812500 1.000000
+vt 0.812500 0.937500
+vt 0.843750 0.937500
+vt 0.062500 0.250000
+vt 0.000000 0.250000
+vt 0.937500 0.937500
+vt 0.937500 1.000000
+vt 0.062500 0.375000
+vt 0.000000 0.375000
+vt 1.000000 0.937500
+vt 1.000000 1.000000
+vt 0.437500 0.937500
+vt 0.437500 0.999999
+vt 0.375000 0.999999
+vt 0.375000 0.937500
+vt 0.312500 0.999999
+vt 0.312500 0.937500
+vt 0.187500 0.937500
+vt 0.187500 0.999999
+vt 0.125000 0.999999
+vt 0.125000 0.937500
+vt 0.062500 0.937500
+vt 0.000000 0.937500
+vt 0.625000 0.000000
+vt 0.625000 0.062500
+vt 0.625000 0.437500
+vt 0.625000 0.562500
+vt 0.375000 0.437500
+vt 0.375000 0.062500
+vt 0.375000 0.000000
+vt 0.375000 0.562500
+vt 0.250000 0.437500
+vt 0.250000 0.375000
+vt 0.250000 0.125000
+vt 0.250000 0.062500
+vt 0.250000 0.937500
+vt 0.250000 0.875000
+vt 0.250000 0.625000
+vt 0.250000 0.562500
+vt 0.750000 0.562500
+vt 0.750000 0.625000
+vt 0.750000 0.875000
+vt 0.750000 0.937500
+vt 0.750000 0.062500
+vt 0.750000 0.125000
+vt 0.750000 0.375000
+vt 0.750000 0.437500
+vt 0.875000 0.625000
+vt 0.875000 0.687500
+vt 0.875000 0.812500
+vt 0.875000 0.875000
+vt 0.875000 0.125000
+vt 0.875000 0.156250
+vt 0.875000 0.187500
+vt 0.875000 0.312500
+vt 0.875000 0.375000
+vt 1.000000 0.687500
+vt 1.000000 0.812500
+vt 1.000000 0.187500
+vt 1.000000 0.312500
+vt 0.125000 0.187500
+vt 0.125000 0.312500
+vt 0.000000 0.312500
+vt 0.000000 0.187500
+vt 0.125000 0.687500
+vt 0.125000 0.812500
+vt 0.000000 0.812500
+vt 0.000000 0.687500
+vt 0.125000 0.875000
+vt 0.125000 0.625000
+vt 0.125000 0.375000
+vt 0.125000 0.125000
+vn 0.000000 1.000000 0.000000
+vn -0.000000 -1.000000 0.000000
+vn 0.000000 0.000000 -1.000000
+vn -1.000000 0.000000 0.000000
+vn 1.000000 -0.000000 -0.000000
+vn 0.000000 0.000000 1.000000
+g Cube_Cube_Material
+s off
+f 57/1/1 3/2/1 4/3/1 58/4/1
+f 31/5/2 30/6/2 32/7/2 33/8/2
+f 8/9/3 7/10/3 30/11/3 31/12/3
+f 9/13/2 10/14/2 7/6/2 8/5/2
+f 12/15/3 11/16/3 10/10/3 9/9/3
+f 24/17/2 25/18/2 11/14/2 12/13/2
+f 16/19/1 15/20/1 14/4/1 13/1/1
+f 17/21/3 18/22/3 15/23/3 16/24/3 69/25/3
+f 20/26/1 19/27/1 18/20/1 17/19/1
+f 26/28/3 27/29/3 19/22/3 20/21/3
+f 29/30/1 28/31/1 27/27/1 26/26/1
+f 1/32/3 2/33/3 28/29/3 29/28/3
+f 37/34/3 36/35/3 38/36/3 39/37/3
+f 39/26/1 38/27/1 40/20/1 41/19/1
+f 41/37/3 40/36/3 42/38/3 43/39/3
+f 22/17/2 23/18/2 46/14/2 45/13/2
+f 45/40/3 46/41/3 48/42/3 47/43/3
+f 47/13/2 48/14/2 50/6/2 49/5/2
+f 49/43/3 50/42/3 52/2/3 51/44/3
+f 51/5/2 52/6/2 54/7/2 53/8/2
+f 53/44/3 54/2/3 56/3/3 55/45/3
+f 43/19/1 42/20/1 21/4/1 44/1/1
+f 14/23/3 25/16/3 24/15/3 13/24/3
+f 60/18/2 5/33/2 6/29/2 59/17/2
+f 21/38/3 23/41/3 22/40/3 44/39/3
+f 57/18/4 59/33/4 6/3/4 3/4/4
+f 60/3/5 58/4/5 4/18/5 5/33/5
+f 1/30/1 57/2/1 58/3/1 2/31/1
+f 56/7/2 60/33/2 59/29/2 55/8/2
+f 1/46/4 29/47/4 33/48/4 35/49/4 53/9/4 55/10/4 59/3/4 57/4/4
+f 32/50/5 28/51/5 2/52/5 58/18/5 60/33/5 56/36/5 54/37/5 34/53/5
+f 34/31/1 36/27/1 37/26/1 35/30/1
+f 30/54/5 7/55/5 19/56/5 27/57/5 28/51/5 32/50/5
+f 34/53/5 54/37/5 52/58/5 50/59/5 38/60/5 36/61/5
+f 53/9/4 35/49/4 37/62/4 39/63/4 49/64/4 51/65/4
+f 29/47/4 26/66/4 20/67/4 8/68/4 31/69/4 33/48/4
+f 33/12/3 32/11/3 34/35/3 35/34/3
+f 3/1/1 61/2/1 62/3/1 4/4/1
+f 65/33/6 68/3/6 67/45/6 66/32/6
+f 5/18/2 63/33/2 64/29/2 6/17/2
+f 3/18/4 6/33/4 64/3/4 61/4/4
+f 5/3/5 4/4/5 62/18/5 63/33/5
+f 61/1/1 65/2/1 66/3/1 62/4/1
+f 63/18/2 67/33/2 68/29/2 64/17/2
+f 61/18/4 64/33/4 68/3/4 65/4/4
+f 63/3/5 62/4/5 66/18/5 67/33/5
+f 49/64/4 39/63/4 41/70/4 43/71/4 45/72/4 47/73/4
+f 8/68/4 20/67/4 17/74/4 69/75/4 16/76/4 12/77/4 9/78/4
+f 45/72/4 43/71/4 44/79/4 22/80/4
+f 12/77/4 16/76/4 13/81/4 24/82/4
+f 15/83/5 11/84/5 25/85/5 14/86/5
+f 42/87/5 46/88/5 23/89/5 21/90/5
+f 38/60/5 50/59/5 48/91/5 46/88/5 42/87/5 40/92/5
+f 7/55/5 10/93/5 11/84/5 15/83/5 18/94/5 19/56/5
diff --git a/castle_tapestries/screenshot.png b/castle_tapestries/screenshot.png
new file mode 100644
index 0000000..838038e
--- /dev/null
+++ b/castle_tapestries/screenshot.png
Binary files differ
diff --git a/castle_tapestries/textures/castle_tapestry.png b/castle_tapestries/textures/castle_tapestry.png
new file mode 100644
index 0000000..e807340
--- /dev/null
+++ b/castle_tapestries/textures/castle_tapestry.png
Binary files differ
diff --git a/castle_tapestries/textures/castle_tapestry_inv.png b/castle_tapestries/textures/castle_tapestry_inv.png
new file mode 100644
index 0000000..99c1b2e
--- /dev/null
+++ b/castle_tapestries/textures/castle_tapestry_inv.png
Binary files differ
diff --git a/castle_tapestries/textures/castle_tapestry_long_inv.png b/castle_tapestries/textures/castle_tapestry_long_inv.png
new file mode 100644
index 0000000..ce04c40
--- /dev/null
+++ b/castle_tapestries/textures/castle_tapestry_long_inv.png
Binary files differ
diff --git a/castle_tapestries/textures/castle_tapestry_very_long_inv.png b/castle_tapestries/textures/castle_tapestry_very_long_inv.png
new file mode 100644
index 0000000..6fcca22
--- /dev/null
+++ b/castle_tapestries/textures/castle_tapestry_very_long_inv.png
Binary files differ
diff --git a/castle_weapons/LICENSE b/castle_weapons/LICENSE
new file mode 100644
index 0000000..456d091
--- /dev/null
+++ b/castle_weapons/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Minetest Mods Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/castle_weapons/README.txt b/castle_weapons/README.txt
new file mode 100644
index 0000000..62ec203
--- /dev/null
+++ b/castle_weapons/README.txt
@@ -0,0 +1,16 @@
+=-=-=-=-=-=-=-=-=-=
+
+Castles Mod
+by: Philipbenr And DanDuncombe
+
+=-=-=-=-=-=-=-=-=-=
+
+Licence: MIT, LGPLv2.1 (Crossbow)
+
+see: LICENSE
+
+=-=-=-=-=-=-=-=-=-=
+
+This mod contains a crossbow with bolts, suitable for ranged combat. The crossbow is sourced from the "shooter" mod.
+
+It also contains a battleaxe for fighting up close and personal. \ No newline at end of file
diff --git a/castle_weapons/battleaxe.lua b/castle_weapons/battleaxe.lua
new file mode 100644
index 0000000..f882cf9
--- /dev/null
+++ b/castle_weapons/battleaxe.lua
@@ -0,0 +1,28 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+minetest.register_alias("castle:battleaxe", "castle_weapons:battleaxe")
+
+minetest.register_tool("castle_weapons:battleaxe", {
+ description = S("Battleaxe"),
+ inventory_image = "castle_battleaxe.png",
+ tool_capabilities = {
+ full_punch_interval = 2.0,
+ max_drop_level=1,
+ groupcaps={
+ choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=20, maxlevel=3},
+ snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=20, maxlevel=3},
+ },
+ damage_groups = {fleshy=7},
+ },
+})
+
+minetest.register_craft({
+ output = "castle_weapons:battleaxe",
+ recipe = {
+ {"default:steel_ingot", "default:steel_ingot","default:steel_ingot"},
+ {"default:steel_ingot", "default:stick","default:steel_ingot"},
+ {"", "default:stick",""}
+ }
+})
diff --git a/castle_weapons/crossbow.lua b/castle_weapons/crossbow.lua
new file mode 100644
index 0000000..f61b752
--- /dev/null
+++ b/castle_weapons/crossbow.lua
@@ -0,0 +1,451 @@
+--[[
+Minetest Mod - Simple Shooter [shooter] 0.5.3
+=======================================
+
+License Source Code: 2013 Stuart Jones - LGPL v2.1
+
+License Textures: Stuart Jones - WTFPL
+
+Licence Models: Stuart Jones - CC-BY-SA 3.0
+
+License Sounds: freesound.org
+
+--]]
+minetest.register_alias("crossbow", "castle_weapons:crossbow")
+minetest.register_alias("bolt", "castle_weapons:crossbow_bolt")
+minetest.register_alias("castle:crossbow", "castle_weapons:crossbow")
+minetest.register_alias("castle:bolt", "castle_weapons:crossbow_bolt")
+minetest.register_alias("castle:crossbow_bolt", "castle_weapons:crossbow_bolt")
+minetest.register_alias("castle:crossbow_loaded", "castle_weapons:crossbow_loaded")
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+local crossbow={}
+
+CROSSBOW_USES = 300
+CROSSBOW_BOLT_TOOL_CAPS = {damage_groups={fleshy=4}}
+CROSSBOW_BOLT_LIFETIME = 60-- 1 minute
+CROSSBOW_ENABLE_PARTICLE_FX = false
+CROSSBOW_ENABLE_PROTECTION = true
+CROSSBOW_EXPLOSION_TEXTURE = "castle_crossbow_hit.png"
+CROSSBOW_ALLOW_NODES = true
+CROSSBOW_ALLOW_ENTITIES = true
+CROSSBOW_ALLOW_PLAYERS = true
+CROSSBOW_PLAYER_OFFSET = {x=0, y=1, z=0}
+CROSSBOW_ENTITY_OFFSET = {x=0, y=0, z=0}
+CROSSBOW_ENTITIES = {
+"mobs:chicken",
+"mobs:cow",
+"mobs:dirt_monster",
+"mobs:dungeon_master",
+"mobs:goat",
+"mobs:mese_monster",
+"mobs:npc",
+"mobs:oerkki",
+"mobs:pig",
+"mobs:pumba",
+"mobs:rat",
+"mobs:rhino",
+"mobs:sand_monster",
+"mobs:sheep",
+"mobs:spider",
+"mobs:stone_monster",
+"mobs:tree_monster",
+}
+
+if minetest.is_singleplayer() == true then
+ CROSSBOW_ALLOW_ENTITIES = true
+ CROSSBOW_ALLOW_PLAYERS = true
+end
+
+local allowed_entities = {}
+for _,v in ipairs(CROSSBOW_ENTITIES) do
+ allowed_entities[v] = 1
+end
+
+local function get_dot_product(v1, v2)
+ return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
+end
+
+local function get_particle_pos(p, v, d)
+ return vector.add(p, vector.multiply(v, {x=d, y=d, z=d}))
+end
+
+function crossbow:spawn_particles(pos, texture)
+ if CROSSBOW_ENABLE_PARTICLE_FX == true then
+ if type(texture) ~= "string" then
+ texture = CROSSBOW_EXPLOSION_TEXTURE
+ end
+ local spread = {x=0.1, y=0.1, z=0.1}
+ minetest.add_particlespawner(15, 0.3,
+ vector.subtract(pos, spread), vector.add(pos, spread),
+ {x=-1, y=1, z=-1}, {x=1, y=2, z=1},
+ {x=-2, y=-2, z=-2}, {x=2, y=-2, z=2},
+ 0.1, 0.75, 1, 2, false, texture
+ )
+ end
+end
+
+function crossbow:punch_node(pos, def)
+ local node = minetest.get_node(pos)
+ if not node then
+ return
+ end
+ local item = minetest.registered_items[node.name]
+ if not item then
+ return
+ end
+ if CROSSBOW_ENABLE_PROTECTION then
+ if minetest.is_protected(pos, def.name) then
+ return
+ end
+ end
+ if item.groups then
+ for k, v in pairs(def.groups) do
+ local level = item.groups[k] or 0
+ if level >= v then
+ minetest.remove_node(pos)
+ if item.tiles then
+ if item.tiles[1] then
+ crossbow:spawn_particles(pos, item.tiles[1])
+ end
+ end
+ break
+ end
+ end
+ end
+end
+
+function crossbow:is_valid_object(object)
+ if object then
+ if object:is_player() == true then
+ return CROSSBOW_ALLOW_PLAYERS
+ end
+ if CROSSBOW_ALLOW_ENTITIES == true then
+ local luaentity = object:get_luaentity()
+ if luaentity then
+ if luaentity.name then
+ if allowed_entities[luaentity.name] then
+ return true
+ end
+ end
+ end
+ end
+ end
+end
+
+function crossbow:get_intersect_pos(ray, plane, collisionbox)
+ local v = vector.subtract(ray.pos, plane.pos)
+ local r1 = get_dot_product(v, plane.normal)
+ local r2 = get_dot_product(ray.dir, plane.normal)
+ if r2 ~= 0 then
+ local t = -(r1 / r2)
+ local td = vector.multiply(ray.dir, {x=t, y=t, z=t})
+ local pt = vector.add(ray.pos, td)
+ local pd = vector.subtract(pt, plane.pos)
+ if math.abs(pd.x) < collisionbox[4] and
+ math.abs(pd.y) < collisionbox[5] and
+ math.abs(pd.z) < collisionbox[6] then
+ return pt
+ end
+ end
+end
+
+function crossbow:process_round(round)
+ local target = {object=nil, distance=10000}
+ local p1 = round.pos
+ local v1 = round.ray
+ for _,ref in ipairs(castle.objects) do
+ local p2 = vector.add(ref.pos, ref.offset)
+ if p1 and p2 and ref.name ~= round.name then
+ local d = vector.distance(p1, p2)
+ if d < round.def.step and d < target.distance then
+ local ray = {pos=p1, dir=v1}
+ local plane = {pos=p2, normal={x=-1, y=0, z=-1}}
+ local pos = crossbow:get_intersect_pos(ray, plane, ref.collisionbox)
+ if pos then
+ target.object = ref.object
+ target.pos = pos
+ target.distance = d
+ end
+ end
+ end
+ end
+ if target.object and target.pos then
+ local success, pos = minetest.line_of_sight(p1, target.pos, 1)
+ if success then
+ local user = minetest.get_player_by_name(round.name)
+ if user then
+ target.object:punch(user, nil, round.def.tool_caps, v1)
+ crossbow:spawn_particles(target.pos, CROSSBOW_EXPLOSION_TEXTURE)
+ end
+ return 1
+ elseif pos and CROSSBOW_ALLOW_NODES == true then
+ crossbow:punch_node(pos, round.def)
+ return 1
+ end
+ elseif CROSSBOW_ALLOW_NODES == true then
+ local d = round.def.step
+ local p2 = vector.add(p1, vector.multiply(v1, {x=d, y=d, z=d}))
+ local success, pos = minetest.line_of_sight(p1, p2, 1)
+ if pos then
+ crossbow:punch_node(pos, round.def)
+ return 1
+ end
+ end
+end
+
+local function get_animation_frame(dir)
+ local angle = math.atan(dir.y)
+ local frame = 90 - math.floor(angle * 360 / math.pi)
+ if frame < 1 then
+ frame = 1
+ elseif frame > 180 then
+ frame = 180
+ end
+ return frame
+end
+
+local function get_target_pos(p1, p2, dir, offset)
+ local d = vector.distance(p1, p2) - offset
+ local td = vector.multiply(dir, {x=d, y=d, z=d})
+ return vector.add(p1, td)
+end
+
+local function punch_object(puncher, object)
+ if puncher and crossbow:is_valid_object(object) then
+ if puncher ~= object then
+ local dir = puncher:get_look_dir()
+ local p1 = puncher:getpos()
+ local p2 = object:getpos()
+ local tpos = get_target_pos(p1, p2, dir, 0)
+ crossbow:spawn_particles(tpos, CROSSBOW_EXPLOSION_TEXTURE)
+ object:punch(puncher, nil, CROSSBOW_BOLT_TOOL_CAPS, dir)
+ end
+ end
+end
+
+local function stop_crossbow_bolt(object, pos, stuck)
+ local acceleration = {x=0, y=-10, z=0}
+ if stuck == true then
+ pos = pos or object:getpos()
+ acceleration = {x=0, y=0, z=0}
+ object:moveto(pos)
+ end
+ object:set_properties({
+ physical = true,
+ collisionbox = {-1/8,-1/8,-1/8, 1/8,1/8,1/8},
+ })
+ object:setvelocity({x=0, y=0, z=0})
+ object:setacceleration(acceleration)
+end
+
+minetest.register_craftitem("castle_weapons:crossbow_bolt", {
+ description = S("Bolt"),
+ stack_max = 20,
+ inventory_image = "castle_crossbow_bolt_inv.png",
+})
+
+minetest.register_entity("castle_weapons:crossbow_bolt_entity", {
+ physical = false,
+ visual = "mesh",
+ mesh = "castle_crossbow_bolt.b3d",
+ visual_size = {x=1.0, y=1.0},
+ textures = {
+ "castle_crossbow_bolt_uv.png"
+ },
+ timer = 0,
+ lifetime = CROSSBOW_BOLT_LIFETIME,
+ player = nil,
+ state = "init",
+ node_pos = nil,
+ collisionbox = {0,0,0, 0,0,0},
+ on_activate = function(self, staticdata)
+ self.object:set_armor_groups({immortal=1})
+ if staticdata == "expired" then
+ self.object:remove()
+ end
+ end,
+ on_punch = function(self, puncher)
+ if puncher then
+ if puncher:is_player() then
+ local stack = "castle_weapons:crossbow_bolt"
+ local inv = puncher:get_inventory()
+ if inv:room_for_item("main", stack) then
+ inv:add_item("main", stack)
+ self.object:remove()
+ end
+ end
+ end
+ end,
+ on_step = function(self, dtime)
+ if self.state == "init" then
+ return
+ end
+ self.timer = self.timer + dtime
+ self.lifetime = self.lifetime - dtime
+ if self.lifetime < 0 then
+ self.object:remove()
+ return
+ elseif self.state == "dropped" then
+ return
+ elseif self.state == "stuck" then
+ if self.timer > 1 then
+ if self.node_pos then
+ local node = minetest.get_node(self.node_pos)
+ if node.name then
+ local item = minetest.registered_items[node.name]
+ if item then
+ if not item.walkable then
+ self.state = "dropped"
+ stop_crossbow_bolt(self.object)
+ return
+ end
+ end
+ end
+ end
+ self.timer = 0
+ end
+ return
+ end
+ if self.timer > 0.2 then
+ local pos = self.object:getpos()
+ local dir = vector.normalize(self.object:getvelocity())
+ local frame = get_animation_frame(dir)
+ self.object:set_animation({x=frame, y=frame}, 0)
+ local objects = minetest.get_objects_inside_radius(pos, 5)
+ for _,obj in ipairs(objects) do
+ if crossbow:is_valid_object(obj) then
+ local collisionbox = {-0.25,-1.0,-0.25, 0.25,0.8,0.25}
+ local offset = CROSSBOW_PLAYER_OFFSET
+ if not obj:is_player() then
+ offset = CROSSBOW_ENTITY_OFFSET
+ local ent = obj:get_luaentity()
+ if ent then
+ local def = minetest.registered_entities[ent.name]
+ collisionbox = def.collisionbox or collisionbox
+ end
+ end
+ local opos = vector.add(obj:getpos(), offset)
+ local ray = {pos=pos, dir=dir}
+ local plane = {pos=opos, normal={x=-1, y=0, z=-1}}
+ local ipos = crossbow:get_intersect_pos(ray, plane, collisionbox)
+ if ipos then
+ punch_object(self.player, obj)
+ end
+ end
+ end
+ local p = vector.add(pos, vector.multiply(dir, {x=5, y=5, z=5}))
+ local _, npos = minetest.line_of_sight(pos, p, 1)
+ if npos then
+ local node = minetest.get_node(npos)
+ local tpos = get_target_pos(pos, npos, dir, 0.66)
+ self.node_pos = npos
+ self.state = "stuck"
+ stop_crossbow_bolt(self.object, tpos, true)
+ minetest.sound_play("castle_crossbow_bolt", {gain = 0.08, max_hear_distance = 2})
+ end
+ self.timer = 0
+ end
+ end,
+ get_staticdata = function(self)
+ return "expired"
+ end,
+})
+
+ minetest.register_tool("castle_weapons:crossbow_loaded", {
+ description = S("Crossbow"),
+ inventory_image = "castle_crossbow_loaded.png",
+ groups = {not_in_creative_inventory=1},
+ on_use = function(itemstack, user, pointed_thing)
+ minetest.sound_play("castle_crossbow_click", {object=user})
+ if not minetest.setting_getbool("creative_mode") then
+ itemstack:add_wear(65535/CROSSBOW_USES)
+ end
+ itemstack = "castle_weapons:crossbow 1 "..itemstack:get_wear()
+ local pos = user:getpos()
+ local dir = user:get_look_dir()
+ local yaw = user:get_look_yaw()
+ if pos and dir and yaw then
+ pos.y = pos.y + 1.5
+ local obj = minetest.add_entity(pos, "castle_weapons:crossbow_bolt_entity")
+ local ent = nil
+ if obj then
+ ent = obj:get_luaentity()
+ end
+ if ent then
+ obj:set_properties({
+ textures = {"castle_crossbow_bolt_uv.png"}
+ })
+ minetest.sound_play("castle_crossbow_shoot", {object=obj})
+ local frame = get_animation_frame(dir)
+ obj:setyaw(yaw + math.pi)
+ obj:set_animation({x=frame, y=frame}, 0)
+ obj:setvelocity({x=dir.x * 14, y=dir.y * 14, z=dir.z * 14})
+ if pointed_thing.type ~= "nothing" then
+ local ppos = minetest.get_pointed_thing_position(pointed_thing, false)
+ local _, npos = minetest.line_of_sight(pos, ppos, 1)
+ if npos then
+ ppos = npos
+ pointed_thing.type = "node"
+ end
+ if pointed_thing.type == "object" then
+ punch_object(user, pointed_thing.ref)
+ elseif pointed_thing.type == "node" then
+ local node = minetest.get_node(ppos)
+ local tpos = get_target_pos(pos, ppos, dir, 0.66)
+ minetest.after(0.2, function(object, pos, npos)
+ ent.node_pos = npos
+ ent.state = "stuck"
+ stop_crossbow_bolt(object, pos, true)
+ minetest.sound_play("castle_crossbow_bolt", {gain = 0.08, max_hear_distance = 2})
+ end, obj, tpos, ppos)
+ return itemstack
+ end
+ end
+ obj:setacceleration({x=dir.x * -3, y=-5, z=dir.z * -3})
+ ent.player = ent.player or user
+ ent.state = "flight"
+ end
+ end
+ return itemstack
+ end,
+ })
+
+minetest.register_tool("castle_weapons:crossbow", {
+ description = S("Crossbow"),
+ inventory_image = "castle_crossbow_inv.png",
+ on_use = function(itemstack, user, pointed_thing)
+ local inv = user:get_inventory()
+if inv:contains_item("main", "castle_weapons:crossbow_bolt") then
+ minetest.sound_play("castle_crossbow_reload", {object=user})
+ if not minetest.setting_getbool("creative_mode") then
+ inv:remove_item("main", "castle_weapons:crossbow_bolt 1")
+ end
+ return "castle_weapons:crossbow_loaded 1 "..itemstack:get_wear()
+ end
+ minetest.sound_play("castle_crossbow_click", {object=user})
+ end,
+})
+
+-----------
+--Crafting
+-----------
+
+minetest.register_craft({
+ output = 'castle_weapons:crossbow',
+ recipe = {
+ {'default:steel_ingot', 'default:stick', 'default:steel_ingot'},
+ {'farming:string', 'farming:string', 'farming:string'},
+ {'', 'default:stick', ''},
+ }
+})
+
+minetest.register_craft({
+ output = "castle_weapons:crossbow_bolt 6",
+ recipe = {
+ {'default:stick', 'default:stick', 'default:steel_ingot'},
+ }
+}) \ No newline at end of file
diff --git a/castle_weapons/depends.txt b/castle_weapons/depends.txt
new file mode 100644
index 0000000..9207dab
--- /dev/null
+++ b/castle_weapons/depends.txt
@@ -0,0 +1,2 @@
+default
+intllib?
diff --git a/castle_weapons/description.txt b/castle_weapons/description.txt
new file mode 100644
index 0000000..e4dc9f1
--- /dev/null
+++ b/castle_weapons/description.txt
@@ -0,0 +1 @@
+Provides several medieval weapons for use around castles \ No newline at end of file
diff --git a/castle_weapons/init.lua b/castle_weapons/init.lua
new file mode 100644
index 0000000..20d3df3
--- /dev/null
+++ b/castle_weapons/init.lua
@@ -0,0 +1,7 @@
+local MP = minetest.get_modpath(minetest.get_current_modname())
+
+dofile(MP.."/crossbow.lua")
+dofile(MP.."/battleaxe.lua")
+
+
+
diff --git a/castle_weapons/intllib.lua b/castle_weapons/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/castle_weapons/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/castle_weapons/locale/template.pot b/castle_weapons/locale/template.pot
new file mode 100644
index 0000000..79f7a19
--- /dev/null
+++ b/castle_weapons/locale/template.pot
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-25 19:35-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: battleaxe.lua:8
+msgid "Battleaxe"
+msgstr ""
+
+#: crossbow.lua:244
+msgid "Bolt"
+msgstr ""
+
+#: crossbow.lua:357 crossbow.lua:416
+msgid "Crossbow"
+msgstr ""
diff --git a/castle_weapons/mod.conf b/castle_weapons/mod.conf
new file mode 100644
index 0000000..456a415
--- /dev/null
+++ b/castle_weapons/mod.conf
@@ -0,0 +1 @@
+name = castle_weapons
diff --git a/castle_weapons/models/LICENSE.txt b/castle_weapons/models/LICENSE.txt
new file mode 100644
index 0000000..7c019e6
--- /dev/null
+++ b/castle_weapons/models/LICENSE.txt
@@ -0,0 +1,10 @@
+License Textures: Stuart Jones - WTFPL
+
+-castle_crossbow_bolt_inv.png
+-castle_crossbow_bolt_uv.png
+-castle_crossbow_hit.png
+
+Licence Models: Stuart Jones - CC-BY-SA 3.0
+
+-castle_crossbow_bolt.b3d
+-castle_crossbow_bolt.blend \ No newline at end of file
diff --git a/castle_weapons/models/castle_crossbow_bolt.b3d b/castle_weapons/models/castle_crossbow_bolt.b3d
new file mode 100644
index 0000000..d24be3c
--- /dev/null
+++ b/castle_weapons/models/castle_crossbow_bolt.b3d
Binary files differ
diff --git a/castle_weapons/models/castle_crossbow_bolt.blend b/castle_weapons/models/castle_crossbow_bolt.blend
new file mode 100644
index 0000000..4cf5f43
--- /dev/null
+++ b/castle_weapons/models/castle_crossbow_bolt.blend
Binary files differ
diff --git a/castle_weapons/models/castle_crossbow_bolt_uv.png b/castle_weapons/models/castle_crossbow_bolt_uv.png
new file mode 100644
index 0000000..b7d29c5
--- /dev/null
+++ b/castle_weapons/models/castle_crossbow_bolt_uv.png
Binary files differ
diff --git a/castle_weapons/screenshot.png b/castle_weapons/screenshot.png
new file mode 100644
index 0000000..d23d181
--- /dev/null
+++ b/castle_weapons/screenshot.png
Binary files differ
diff --git a/castle_weapons/sounds/LICENSE.txt b/castle_weapons/sounds/LICENSE.txt
new file mode 100644
index 0000000..b127b0e
--- /dev/null
+++ b/castle_weapons/sounds/LICENSE.txt
@@ -0,0 +1,19 @@
+License Sounds
+------------------
+
+(From Simple Shooter mod by Stuart Jones)
+-castle_crossbow_click.ogg
+-castle_crossbow_shoot.ogg
+-castle_crossbow_reload.ogg
+
+Author : freesound.org
+License : Attribution 3.0 Unported (CC BY 3.0)
+CC0 1.0 Universal (CC0 1.0)
+
+------------------
+
+(From Minetest Game:default mod)
+-default_wood_footstep.1.ogg
+(renamed to : castle_crossbow_bolt.ogg)
+Author : Mito551
+License : (CC BY-SA)
diff --git a/castle_weapons/sounds/castle_crossbow_bolt.ogg b/castle_weapons/sounds/castle_crossbow_bolt.ogg
new file mode 100644
index 0000000..34f63a1
--- /dev/null
+++ b/castle_weapons/sounds/castle_crossbow_bolt.ogg
Binary files differ
diff --git a/castle_weapons/sounds/castle_crossbow_click.ogg b/castle_weapons/sounds/castle_crossbow_click.ogg
new file mode 100644
index 0000000..8e60db8
--- /dev/null
+++ b/castle_weapons/sounds/castle_crossbow_click.ogg
Binary files differ
diff --git a/castle_weapons/sounds/castle_crossbow_reload.ogg b/castle_weapons/sounds/castle_crossbow_reload.ogg
new file mode 100644
index 0000000..47f7245
--- /dev/null
+++ b/castle_weapons/sounds/castle_crossbow_reload.ogg
Binary files differ
diff --git a/castle_weapons/sounds/castle_crossbow_shoot.ogg b/castle_weapons/sounds/castle_crossbow_shoot.ogg
new file mode 100644
index 0000000..9ce9176
--- /dev/null
+++ b/castle_weapons/sounds/castle_crossbow_shoot.ogg
Binary files differ
diff --git a/castle_weapons/textures/LICENSE.txt b/castle_weapons/textures/LICENSE.txt
new file mode 100644
index 0000000..0ecff29
--- /dev/null
+++ b/castle_weapons/textures/LICENSE.txt
@@ -0,0 +1,25 @@
+--------------------------------------------
+
+License Textures: Stuart Jones - WTFPL
+-castle_crossbow_bolt_inv.png
+-castle_crossbow_bolt_uv.png
+-castle_crossbow_hit.png
+
+Licence Models: Stuart Jones - CC-BY-SA 3.0
+-castle_crossbow_bolt.b3d
+-castle_crossbow_bolt.blend
+
+
+--------------------------------------------
+
+16 px textures based on Castle mod
+original textures by Philipner
+
+License Textures: Napiophelios - CC-BY-SA 3.0
+
+-castle_battleaxe.png
+-castle_crossbow_bolt_inv.png
+-castle_crossbow_hit.png
+-castle_crossbow_loaded.png
+
+--------------------------------------------
diff --git a/castle_weapons/textures/castle_battleaxe.png b/castle_weapons/textures/castle_battleaxe.png
new file mode 100644
index 0000000..4f7f738
--- /dev/null
+++ b/castle_weapons/textures/castle_battleaxe.png
Binary files differ
diff --git a/castle_weapons/textures/castle_crossbow_bolt_inv.png b/castle_weapons/textures/castle_crossbow_bolt_inv.png
new file mode 100644
index 0000000..87cd847
--- /dev/null
+++ b/castle_weapons/textures/castle_crossbow_bolt_inv.png
Binary files differ
diff --git a/castle_weapons/textures/castle_crossbow_hit.png b/castle_weapons/textures/castle_crossbow_hit.png
new file mode 100644
index 0000000..0a2b2f3
--- /dev/null
+++ b/castle_weapons/textures/castle_crossbow_hit.png
Binary files differ
diff --git a/castle_weapons/textures/castle_crossbow_inv.png b/castle_weapons/textures/castle_crossbow_inv.png
new file mode 100644
index 0000000..39bcf07
--- /dev/null
+++ b/castle_weapons/textures/castle_crossbow_inv.png
Binary files differ
diff --git a/castle_weapons/textures/castle_crossbow_loaded.png b/castle_weapons/textures/castle_crossbow_loaded.png
new file mode 100644
index 0000000..ca2dca7
--- /dev/null
+++ b/castle_weapons/textures/castle_crossbow_loaded.png
Binary files differ
diff --git a/crafting_bench/LICENSE b/crafting_bench/LICENSE
new file mode 100644
index 0000000..456d091
--- /dev/null
+++ b/crafting_bench/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Minetest Mods Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/crafting_bench/README.txt b/crafting_bench/README.txt
new file mode 100644
index 0000000..54045a2
--- /dev/null
+++ b/crafting_bench/README.txt
@@ -0,0 +1,18 @@
+=-=-=-=-=-=-=-=-=-=
+
+Crafting Bench
+by: Philipbenr And DanDuncombe
+
+=-=-=-=-=-=-=-=-=-=
+
+Licence: MIT
+
+see: LICENSE
+
+=-=-=-=-=-=-=-=-=-=
+
+An auto-crafting bench. Place raw materials into its inventory, define a crafting recipe in its main grid, and then every five seconds it will generate a crafted output.
+
+This mod is compatible with hoppers.
+
+The crafting rate can be modified in advanced settings. \ No newline at end of file
diff --git a/crafting_bench/depends.txt b/crafting_bench/depends.txt
new file mode 100644
index 0000000..3e4cdce
--- /dev/null
+++ b/crafting_bench/depends.txt
@@ -0,0 +1,4 @@
+default
+intllib?
+hopper?
+doc? \ No newline at end of file
diff --git a/crafting_bench/description.txt b/crafting_bench/description.txt
new file mode 100644
index 0000000..728c836
--- /dev/null
+++ b/crafting_bench/description.txt
@@ -0,0 +1 @@
+An auto-crafting bench
diff --git a/crafting_bench/init.lua b/crafting_bench/init.lua
new file mode 100644
index 0000000..b723424
--- /dev/null
+++ b/crafting_bench/init.lua
@@ -0,0 +1,170 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+minetest.register_alias("castle:workbench", "crafting_bench:workbench")
+
+local usage_help = S("The inventory on the left is for raw materials, the inventory on the right holds finished products. The crafting grid in the center defines what recipe this workbench will make use of; place raw materials into it in the crafting pattern corresponding to what you want to build.")
+
+if minetest.get_modpath("hopper") and hopper ~= nil and hopper.add_container ~= nil then
+ usage_help = usage_help .. "\n\n" .. S("This workbench is compatible with hoppers. Hoppers will insert into the raw material inventory and remove items from the finished goods inventory.")
+end
+
+
+local crafting_rate = minetest.setting_get("crafting_bench_crafting_rate")
+if crafting_rate == nil then crafting_rate = 5 end
+
+
+minetest.register_node("crafting_bench:workbench",{
+ description = S("Workbench"),
+ _doc_items_longdesc = string.format(S("A workbench that does work for you. Set a crafting recipe and provide raw materials and items will magically craft themselves once every %i seconds."), crafting_rate),
+ _doc_items_usagehelp = usage_help,
+ tiles = {
+ "crafting_bench_workbench_top.png",
+ "crafting_bench_workbench_bottom.png",
+ "crafting_bench_workbench_side.png",
+ "crafting_bench_workbench_side.png",
+ "crafting_bench_workbench_back.png",
+ "crafting_bench_workbench_front.png"
+ },
+ paramtype2 = "facedir",
+ paramtype = "light",
+ groups = {choppy=2,oddly_breakable_by_hand=2,flammable=2},
+ sounds = default.node_sound_wood_defaults(),
+ drawtype = "normal",
+ on_construct = function ( pos )
+ local meta = minetest.get_meta( pos )
+ meta:set_string( 'formspec',
+ 'size[10,10;]' ..
+ default.gui_bg ..
+ default.gui_bg_img ..
+ default.gui_slots ..
+ 'label[1,0;'..S('Source Material')..']' ..
+ 'list[context;src;1,1;2,4;]' ..
+ 'label[4,0;'..S('Recipe to Use')..']' ..
+ 'list[context;rec;4,1;3,3;]' ..
+ 'label[7.5,0;'..S('Craft Output')..']' ..
+ 'list[context;dst;8,1;1,4;]' ..
+ 'list[current_player;main;1,6;8,4;]' )
+ meta:set_string( 'infotext', S('Workbench'))
+ local inv = meta:get_inventory()
+ inv:set_size( 'src', 2 * 4 )
+ inv:set_size( 'rec', 3 * 3 )
+ inv:set_size( 'dst', 1 * 4 )
+ end,
+ can_dig = function(pos,player)
+ local meta = minetest.get_meta(pos);
+ local inv = meta:get_inventory()
+ return inv:is_empty("main")
+ end,
+ on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
+ minetest.log("action", S("@1 moves stuff in workbench at @2", player:get_player_name(), minetest.pos_to_string(pos)))
+ end,
+ on_metadata_inventory_put = function(pos, listname, index, stack, player)
+ minetest.log("action", S("@1 moves stuff to workbench at @2", player:get_player_name(), minetest.pos_to_string(pos)))
+ end,
+ on_metadata_inventory_take = function(pos, listname, index, stack, player)
+ minetest.log("action", S("@1 takes stuff from workbench at @2", player:get_player_name(), minetest.pos_to_string(pos)))
+ end,
+})
+local get_recipe = function ( inv )
+ local result, needed, input
+ needed = inv:get_list( 'rec' )
+
+ result, input = minetest.get_craft_result( {
+ method = 'normal',
+ width = 3,
+ items = needed
+ })
+
+ local totalneed = {}
+
+ if result.item:is_empty() then
+ result = nil
+ else
+ result = result.item
+ for _, item in ipairs( needed ) do
+ if item ~= nil and not item:is_empty() and not inv:contains_item( 'src', item ) then
+ result = nil
+ break
+ end
+ if item ~= nil and not item:is_empty() then
+ if totalneed[item:get_name()] == nil then
+ totalneed[item:get_name()] = 1
+ else
+ totalneed[item:get_name()] = totalneed[item:get_name()] + 1
+ end
+ end
+ end
+ for name, number in pairs( totalneed ) do
+ local totallist = inv:get_list( 'src' )
+ for i, srcitem in pairs( totallist ) do
+ if srcitem:get_name() == name then
+ local taken = srcitem:take_item( number )
+ number = number - taken:get_count()
+ totallist[i] = srcitem
+ end
+ if number <= 0 then
+ break
+ end
+ end
+ if number > 0 then
+ result = nil
+ break
+ end
+ end
+ end
+
+ return needed, input, result
+end
+
+minetest.register_abm( {
+ nodenames = { 'crafting_bench:workbench' },
+ interval = crafting_rate,
+ chance = 1,
+ action = function ( pos, node )
+ local meta = minetest.get_meta( pos )
+ local inv = meta:get_inventory()
+ local result, newinput, needed
+ if not inv:is_empty( 'src' ) then
+ -- Check for a valid recipe and sufficient resources to craft it
+ needed, newinput, result = get_recipe( inv )
+ if result ~= nil and inv:room_for_item( 'dst', result ) then
+ inv:add_item( 'dst', result )
+ for i, item in pairs( needed ) do
+ if item ~= nil and item ~= '' then
+ inv:remove_item( 'src', ItemStack( item ) )
+ end
+ if newinput[i] ~= nil and not newinput[i]:is_empty() then
+ inv:add_item( 'src', newinput[i] )
+ end
+ end
+ end
+ end
+ end
+} )
+
+local function has_locked_chest_privilege(meta, player)
+ if player:get_player_name() ~= meta:get_string("owner") then
+ return false
+ end
+ return true
+end
+
+minetest.register_craft({
+ output = "crafting_bench:workbench",
+ recipe = {
+ {"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
+ {"default:wood", "default:wood","default:steel_ingot"},
+ {"default:tree", "default:tree","default:steel_ingot"},
+ }
+})
+
+-- Hopper compatibility
+if minetest.get_modpath("hopper") and hopper ~= nil and hopper.add_container ~= nil then
+ hopper:add_container({
+ {"top", "crafting_bench:workbench", "dst"},
+ {"side", "crafting_bench:workbench", "src"},
+ {"bottom", "crafting_bench:workbench", "src"},
+ })
+end
diff --git a/crafting_bench/intllib.lua b/crafting_bench/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/crafting_bench/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/crafting_bench/locale/template.pot b/crafting_bench/locale/template.pot
new file mode 100644
index 0000000..7ac578e
--- /dev/null
+++ b/crafting_bench/locale/template.pot
@@ -0,0 +1,67 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-28 21:08-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: init.lua:7
+msgid ""
+"The inventory on the left is for raw materials, the inventory on the right "
+"holds finished products. The crafting grid in the center defines what recipe "
+"this workbench will make use of; place raw materials into it in the crafting "
+"pattern corresponding to what you want to build."
+msgstr ""
+
+#: init.lua:10
+msgid ""
+"This workbench is compatible with hoppers. Hoppers will insert into the raw "
+"material inventory and remove items from the finished goods inventory."
+msgstr ""
+
+#: init.lua:19 init.lua:49
+msgid "Workbench"
+msgstr ""
+
+#: init.lua:20
+#, lua-format
+msgid ""
+"A workbench that does work for you. Set a crafting recipe and provide raw "
+"materials and items will magically craft themselves once every %i seconds."
+msgstr ""
+
+#: init.lua:42
+msgid "Source Material"
+msgstr ""
+
+#: init.lua:44
+msgid "Recipe to Use"
+msgstr ""
+
+#: init.lua:46
+msgid "Craft Output"
+msgstr ""
+
+#: init.lua:61
+msgid "@1 moves stuff in workbench at @2"
+msgstr ""
+
+#: init.lua:64
+msgid "@1 moves stuff to workbench at @2"
+msgstr ""
+
+#: init.lua:67
+msgid "@1 takes stuff from workbench at @2"
+msgstr ""
diff --git a/crafting_bench/mod.conf b/crafting_bench/mod.conf
new file mode 100644
index 0000000..9d51c80
--- /dev/null
+++ b/crafting_bench/mod.conf
@@ -0,0 +1 @@
+name = crafting_bench
diff --git a/crafting_bench/screenshot.png b/crafting_bench/screenshot.png
new file mode 100644
index 0000000..e068be8
--- /dev/null
+++ b/crafting_bench/screenshot.png
Binary files differ
diff --git a/crafting_bench/settingtypes.txt b/crafting_bench/settingtypes.txt
new file mode 100644
index 0000000..9276289
--- /dev/null
+++ b/crafting_bench/settingtypes.txt
@@ -0,0 +1,2 @@
+# The number of seconds between each operation of the crafting bench.
+crafting_bench_crafting_rate (Crafting rate) int 5 1 60 \ No newline at end of file
diff --git a/crafting_bench/textures/LICENSE.txt b/crafting_bench/textures/LICENSE.txt
new file mode 100644
index 0000000..bd7ca92
--- /dev/null
+++ b/crafting_bench/textures/LICENSE.txt
@@ -0,0 +1,20 @@
+--------------------------------------------
+
+License Textures: Philipner - CC-BY-SA 3.0
+
+-crafting_bench_workbench_back.png
+-crafting_bench_workbench_front.png
+-crafting_bench_workbench_side.png
+-crafting_bench_workbench_top.png
+
+
+--------------------------------------------
+
+16 px textures based on crafting_bench mod
+original textures by Philipner
+
+License Textures: Napiophelios - CC-BY-SA 3.0
+
+-crafting_bench_workbench_bottom.png
+
+--------------------------------------------
diff --git a/crafting_bench/textures/crafting_bench_workbench_back.png b/crafting_bench/textures/crafting_bench_workbench_back.png
new file mode 100644
index 0000000..174d941
--- /dev/null
+++ b/crafting_bench/textures/crafting_bench_workbench_back.png
Binary files differ
diff --git a/crafting_bench/textures/crafting_bench_workbench_bottom.png b/crafting_bench/textures/crafting_bench_workbench_bottom.png
new file mode 100644
index 0000000..f50a8f3
--- /dev/null
+++ b/crafting_bench/textures/crafting_bench_workbench_bottom.png
Binary files differ
diff --git a/crafting_bench/textures/crafting_bench_workbench_front.png b/crafting_bench/textures/crafting_bench_workbench_front.png
new file mode 100644
index 0000000..27a1f1f
--- /dev/null
+++ b/crafting_bench/textures/crafting_bench_workbench_front.png
Binary files differ
diff --git a/crafting_bench/textures/crafting_bench_workbench_side.png b/crafting_bench/textures/crafting_bench_workbench_side.png
new file mode 100644
index 0000000..b6418ac
--- /dev/null
+++ b/crafting_bench/textures/crafting_bench_workbench_side.png
Binary files differ
diff --git a/crafting_bench/textures/crafting_bench_workbench_top.png b/crafting_bench/textures/crafting_bench_workbench_top.png
new file mode 100644
index 0000000..fef4827
--- /dev/null
+++ b/crafting_bench/textures/crafting_bench_workbench_top.png
Binary files differ
diff --git a/digilines/.luacheckrc b/digilines/.luacheckrc
new file mode 100644
index 0000000..6d89a3f
--- /dev/null
+++ b/digilines/.luacheckrc
@@ -0,0 +1,12 @@
+
+read_globals = {
+ "minetest",
+ "default",
+ "pipeworks",
+ "dump",
+ "VoxelArea",
+}
+
+globals = {
+ "digilines",
+}
diff --git a/digilines/init.lua b/digilines/init.lua
index bffd4e7..21c1c8e 100644
--- a/digilines/init.lua
+++ b/digilines/init.lua
@@ -1,4 +1,42 @@
-digiline = {}
+
+digilines = {}
+
+-- Backwards compatibility code.
+-- We define a proxy table whose methods can be called with the
+-- `foo:bar` notation, and it will redirect the call to the
+-- real function, dropping the first implicit argument.
+local digiline; digiline = setmetatable({}, {
+ __index = function(_, k)
+ -- Get method from real table.
+ local v = digilines[k]
+ if type(v) == "function" then
+ -- We need to wrap functions in order to ignore
+ -- the implicit `self` argument.
+ local f = v
+ return function(self, ...)
+ -- Trap invalid calls of the form `digiline.foo(...)`.
+ assert(self == digiline)
+ return f(...)
+ end
+ end
+ return v
+ end,
+})
+rawset(_G, "digiline", digiline)
+
+-- Let's test our proxy table.
+function digilines._testproxy(x)
+ return x
+end
+
+-- Test using old `digiline:foobar` form.
+assert(digiline:_testproxy("foobar") == "foobar")
+
+-- Test using new `digilines.foobar` form.
+assert(digilines._testproxy("foobar") == "foobar")
+
+-- Test calling incorrect form raises an error.
+assert(not pcall(function() digiline._testproxy("foobar") end))
local modpath = minetest.get_modpath("digilines")
dofile(modpath .. "/presetrules.lua")
@@ -7,12 +45,12 @@ dofile(modpath .. "/internal.lua")
dofile(modpath .. "/wires_common.lua")
dofile(modpath .. "/wire_std.lua")
-function digiline:receptor_send(pos, rules, channel, msg)
+function digilines.receptor_send(pos, rules, channel, msg)
local checked = {}
checked[minetest.hash_node_position(pos)] = true -- exclude itself
for _,rule in ipairs(rules) do
- if digiline:rules_link(pos, digiline:addPosRule(pos, rule)) then
- digiline:transmit(digiline:addPosRule(pos, rule), channel, msg, checked)
+ if digilines.rules_link(pos, digilines.addPosRule(pos, rule)) then
+ digilines.transmit(digilines.addPosRule(pos, rule), channel, msg, checked)
end
end
end
diff --git a/digilines/internal.lua b/digilines/internal.lua
index 45cd5d7..2528f35 100644
--- a/digilines/internal.lua
+++ b/digilines/internal.lua
@@ -1,55 +1,55 @@
-function digiline:getspec(node)
+function digilines.getspec(node)
if not minetest.registered_nodes[node.name] then return false end
return minetest.registered_nodes[node.name].digiline
end
-function digiline:importrules(spec, node)
+function digilines.importrules(spec, node)
if type(spec) == 'function' then
return spec(node)
elseif spec then
return spec
else
- return digiline.rules.default
+ return digilines.rules.default
end
end
-function digiline:getAnyInputRules(pos)
- local node = digiline:get_node_force(pos)
- local spec = digiline:getspec(node)
+function digilines.getAnyInputRules(pos)
+ local node = digilines.get_node_force(pos)
+ local spec = digilines.getspec(node)
if not spec then return end
if spec.wire then
- return digiline:importrules(spec.wire.rules, node)
+ return digilines.importrules(spec.wire.rules, node)
end
if spec.effector then
- return digiline:importrules(spec.effector.rules, node)
+ return digilines.importrules(spec.effector.rules, node)
end
end
-function digiline:getAnyOutputRules(pos)
- local node = digiline:get_node_force(pos)
- local spec = digiline:getspec(node)
+function digilines.getAnyOutputRules(pos)
+ local node = digilines.get_node_force(pos)
+ local spec = digilines.getspec(node)
if not spec then return end
if spec.wire then
- return digiline:importrules(spec.wire.rules, node)
+ return digilines.importrules(spec.wire.rules, node)
end
if spec.receptor then
- return digiline:importrules(spec.receptor.rules, node)
+ return digilines.importrules(spec.receptor.rules, node)
end
end
-function digiline:rules_link(output, input)
- local outputrules = digiline:getAnyOutputRules(output)
- local inputrules = digiline:getAnyInputRules (input)
+function digilines.rules_link(output, input)
+ local outputrules = digilines.getAnyOutputRules(output)
+ local inputrules = digilines.getAnyInputRules (input)
if not outputrules or not inputrules then return false end
for _, orule in ipairs(outputrules) do
- if digiline:cmpPos(digiline:addPosRule(output, orule), input) then
+ if digilines.cmpPos(digilines.addPosRule(output, orule), input) then
for _, irule in ipairs(inputrules) do
- if digiline:cmpPos(digiline:addPosRule(input, irule), output) then
+ if digilines.cmpPos(digilines.addPosRule(input, irule), output) then
return true
end
end
@@ -58,9 +58,9 @@ function digiline:rules_link(output, input)
return false
end
-function digiline:rules_link_anydir(output, input)
- return digiline:rules_link(output, input)
- or digiline:rules_link(input, output)
+function digilines.rules_link_anydir(output, input)
+ return digilines.rules_link(output, input)
+ or digilines.rules_link(input, output)
end
local function queue_new()
@@ -85,14 +85,14 @@ local function queue_dequeue(queue)
return object
end
-function digiline:transmit(pos, channel, msg, checked)
- digiline:vm_begin()
+function digilines.transmit(pos, channel, msg, checked)
+ digilines.vm_begin()
local queue = queue_new()
queue_enqueue(queue, pos)
while not queue_empty(queue) do
local curPos = queue_dequeue(queue)
- local node = digiline:get_node_force(curPos)
- local spec = digiline:getspec(node)
+ local node = digilines.get_node_force(curPos)
+ local spec = digilines.getspec(node)
if spec then
-- Effector actions --> Receive
if spec.effector then
@@ -101,10 +101,10 @@ function digiline:transmit(pos, channel, msg, checked)
-- Cable actions --> Transmit
if spec.wire then
- local rules = digiline:importrules(spec.wire.rules, node)
+ local rules = digilines.importrules(spec.wire.rules, node)
for _, rule in ipairs(rules) do
- local nextPos = digiline:addPosRule(curPos, rule)
- if digiline:rules_link(curPos, nextPos) then
+ local nextPos = digilines.addPosRule(curPos, rule)
+ if digilines.rules_link(curPos, nextPos) then
local checkedID = minetest.hash_node_position(nextPos)
if not checked[checkedID] then
checked[checkedID] = true
@@ -115,5 +115,5 @@ function digiline:transmit(pos, channel, msg, checked)
end
end
end
- digiline:vm_end()
+ digilines.vm_end()
end
diff --git a/digilines/inventory.lua b/digilines/inventory.lua
index 0134e5c..70cb133 100644
--- a/digilines/inventory.lua
+++ b/digilines/inventory.lua
@@ -2,7 +2,7 @@ local function sendMessage(pos, msg, channel)
if channel == nil then
channel = minetest.get_meta(pos):get_string("channel")
end
- digiline:receptor_send(pos,digiline.rules.default,channel,msg)
+ digilines.receptor_send(pos,digilines.rules.default,channel,msg)
end
local function maybeString(stack)
@@ -58,10 +58,10 @@ minetest.register_node("digilines:chest", {
end,
after_place_node = tubescan,
after_dig_node = tubescan,
- can_dig = function(pos, player)
+ can_dig = function(pos)
return minetest.get_meta(pos):get_inventory():is_empty("main")
end,
- on_receive_fields = function(pos, formname, fields, sender)
+ on_receive_fields = function(pos, _, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then
minetest.record_protection_violation(pos, name)
@@ -74,7 +74,7 @@ minetest.register_node("digilines:chest", {
digiline = {
receptor = {},
effector = {
- action = function(pos,node,channel,msg) end
+ action = function() end
}
},
tube = {
@@ -83,10 +83,10 @@ minetest.register_node("digilines:chest", {
return not pipeworks.connects.facingFront(i,param2)
end,
input_inventory = "main",
- can_insert = function(pos, node, stack, direction)
+ can_insert = function(pos, _, stack)
return can_insert(pos, stack)
end,
- insert_object = function(pos, node, stack, direction)
+ insert_object = function(pos, _, stack)
local inv = minetest.get_meta(pos):get_inventory()
local leftover = inv:add_item("main", stack)
local count = leftover:get_count()
@@ -108,16 +108,16 @@ minetest.register_node("digilines:chest", {
return leftover
end,
},
- allow_metadata_inventory_put = function(pos, listname, index, stack, player)
+ allow_metadata_inventory_put = function(pos, _, _, stack)
if not can_insert(pos, stack) then
sendMessage(pos,"uoverflow "..maybeString(stack))
end
return stack:get_count()
end,
- on_metadata_inventory_move = function(pos, fromlistname, fromindex, tolistname, toindex, count, player)
+ on_metadata_inventory_move = function(pos, _, _, _, _, _, player)
minetest.log("action", player:get_player_name().." moves stuff in chest at "..minetest.pos_to_string(pos))
end,
- on_metadata_inventory_put = function(pos, listname, index, stack, player)
+ on_metadata_inventory_put = function(pos, _, _, stack, player)
local channel = minetest.get_meta(pos):get_string("channel")
local send = function(msg)
sendMessage(pos,msg,channel)
@@ -132,7 +132,7 @@ minetest.register_node("digilines:chest", {
end
minetest.log("action", player:get_player_name().." puts stuff into chest at "..minetest.pos_to_string(pos))
end,
- on_metadata_inventory_take = function(pos, listname, index, stack, player)
+ on_metadata_inventory_take = function(pos, listname, _, stack, player)
local meta = minetest.get_meta(pos)
local channel = meta:get_string("channel")
local inv = meta:get_inventory()
diff --git a/digilines/lcd.lua b/digilines/lcd.lua
index 3370a31..ce17dac 100644
--- a/digilines/lcd.lua
+++ b/digilines/lcd.lua
@@ -20,16 +20,98 @@ else
end
end
+-- CONSTANTS
+local LCD_WITH = 100
+local LCD_PADDING = 8
+
+local LINE_LENGTH = 12
+local NUMBER_OF_LINES = 5
+
+local LINE_HEIGHT = 14
+local CHAR_WIDTH = 5
+
+local create_lines = function(text)
+ local line = ""
+ local line_num = 1
+ local tab = {}
+ for word in string.gmatch(text, "%S+") do
+ if string.len(line)+string.len(word) < LINE_LENGTH and word ~= "|" then
+ if line ~= "" then
+ line = line.." "..word
+ else
+ line = word
+ end
+ else
+ table.insert(tab, line)
+ if word ~= "|" then
+ line = word
+ else
+ line = ""
+ end
+ line_num = line_num+1
+ if line_num > NUMBER_OF_LINES then
+ return tab
+ end
+ end
+ end
+ table.insert(tab, line)
+ return tab
+end
+
+local generate_line = function(s, ypos)
+ local i = 1
+ local parsed = {}
+ local width = 0
+ local chars = 0
+ while chars < max_chars and i <= #s do
+ local file = nil
+ if charmap[s:sub(i, i)] ~= nil then
+ file = charmap[s:sub(i, i)]
+ i = i + 1
+ elseif i < #s and charmap[s:sub(i, i + 1)] ~= nil then
+ file = charmap[s:sub(i, i + 1)]
+ i = i + 2
+ else
+ print("[digilines] W: LCD: unknown symbol in '"..s.."' at "..i)
+ i = i + 1
+ end
+ if file ~= nil then
+ width = width + CHAR_WIDTH
+ table.insert(parsed, file)
+ chars = chars + 1
+ end
+ end
+ width = width - 1
+
+ local texture = ""
+ local xpos = math.floor((LCD_WITH - 2 * LCD_PADDING - width) / 2 + LCD_PADDING)
+ for ii = 1, #parsed do
+ texture = texture..":"..xpos..","..ypos.."="..parsed[ii]..".png"
+ xpos = xpos + CHAR_WIDTH + 1
+ end
+ return texture
+end
+
+local generate_texture = function(lines)
+ local texture = "[combine:"..LCD_WITH.."x"..LCD_WITH
+ local ypos = 16
+ for i = 1, #lines do
+ texture = texture..generate_line(lines[i], ypos)
+ ypos = ypos + LINE_HEIGHT
+ end
+ return texture
+end
+
local lcds = {
-- on ceiling
--* [0] = {delta = {x = 0, y = 0.4, z = 0}, pitch = math.pi / -2},
-- on ground
--* [1] = {delta = {x = 0, y =-0.4, z = 0}, pitch = math.pi / 2},
-- sides
- [2] = {delta = {x = 0.4, y = 0, z = 0}, yaw = math.pi / -2},
- [3] = {delta = {x = -0.4, y = 0, z = 0}, yaw = math.pi / 2},
- [4] = {delta = {x = 0, y = 0, z = 0.4}, yaw = 0},
- [5] = {delta = {x = 0, y = 0, z = -0.4}, yaw = math.pi},
+ [2] = {delta = {x = 0.437, y = 0, z = 0}, yaw = math.pi / -2},
+ [3] = {delta = {x = -0.437, y = 0, z = 0}, yaw = math.pi / 2},
+ [4] = {delta = {x = 0, y = 0, z = 0.437}, yaw = 0},
+ [5] = {delta = {x = 0, y = 0, z = -0.437}, yaw = math.pi},
}
local reset_meta = function(pos)
@@ -58,7 +140,7 @@ local prepare_writing = function(pos)
return text
end
-local on_digiline_receive = function(pos, node, channel, msg)
+local on_digiline_receive = function(pos, _, channel, msg)
local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel")
if setchan ~= channel then return end
@@ -91,7 +173,7 @@ minetest.register_node("digilines:lcd", {
selection_box = lcd_box,
groups = {choppy = 3, dig_immediate = 2},
- after_place_node = function (pos, placer, itemstack)
+ after_place_node = function (pos)
local param2 = minetest.get_node(pos).param2
if param2 == 0 or param2 == 1 then
minetest.add_node(pos, {name = "digilines:lcd", param2 = 3})
@@ -107,7 +189,7 @@ minetest.register_node("digilines:lcd", {
clearscreen(pos)
end,
- on_receive_fields = function(pos, formname, fields, sender)
+ on_receive_fields = function(pos, _, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then
minetest.record_protection_violation(pos, name)
@@ -118,7 +200,7 @@ minetest.register_node("digilines:lcd", {
end
end,
- digiline =
+ digiline =
{
receptor = {},
effector = {
@@ -141,88 +223,6 @@ minetest.register_entity(":digilines_lcd:text", {
end
})
--- CONSTANTS
-local LCD_WITH = 100
-local LCD_PADDING = 8
-
-local LINE_LENGTH = 12
-local NUMBER_OF_LINES = 5
-
-local LINE_HEIGHT = 14
-local CHAR_WIDTH = 5
-
-create_lines = function(text)
- local line = ""
- local line_num = 1
- local tab = {}
- for word in string.gmatch(text, "%S+") do
- if string.len(line)+string.len(word) < LINE_LENGTH and word ~= "|" then
- if line ~= "" then
- line = line.." "..word
- else
- line = word
- end
- else
- table.insert(tab, line)
- if word ~= "|" then
- line = word
- else
- line = ""
- end
- line_num = line_num+1
- if line_num > NUMBER_OF_LINES then
- return tab
- end
- end
- end
- table.insert(tab, line)
- return tab
-end
-
-generate_texture = function(lines)
- local texture = "[combine:"..LCD_WITH.."x"..LCD_WITH
- local ypos = 16
- for i = 1, #lines do
- texture = texture..generate_line(lines[i], ypos)
- ypos = ypos + LINE_HEIGHT
- end
- return texture
-end
-
-generate_line = function(s, ypos)
- local i = 1
- local parsed = {}
- local width = 0
- local chars = 0
- while chars < max_chars and i <= #s do
- local file = nil
- if charmap[s:sub(i, i)] ~= nil then
- file = charmap[s:sub(i, i)]
- i = i + 1
- elseif i < #s and charmap[s:sub(i, i + 1)] ~= nil then
- file = charmap[s:sub(i, i + 1)]
- i = i + 2
- else
- print("[digilines] W: LCD: unknown symbol in '"..s.."' at "..i)
- i = i + 1
- end
- if file ~= nil then
- width = width + CHAR_WIDTH
- table.insert(parsed, file)
- chars = chars + 1
- end
- end
- width = width - 1
-
- local texture = ""
- local xpos = math.floor((LCD_WITH - 2 * LCD_PADDING - width) / 2 + LCD_PADDING)
- for i = 1, #parsed do
- texture = texture..":"..xpos..","..ypos.."="..parsed[i]..".png"
- xpos = xpos + CHAR_WIDTH + 1
- end
- return texture
-end
-
minetest.register_craft({
output = "digilines:lcd 2",
recipe = {
diff --git a/digilines/lightsensor.lua b/digilines/lightsensor.lua
index 86a29c9..1c7237b 100644
--- a/digilines/lightsensor.lua
+++ b/digilines/lightsensor.lua
@@ -21,11 +21,11 @@ local lsensor_selbox =
fixed = {{ -8/16, -8/16, -8/16, 8/16, -3/16, 8/16 }}
}
-local on_digiline_receive = function (pos, node, channel, msg)
+local on_digiline_receive = function (pos, _, channel, msg)
local setchan = minetest.get_meta(pos):get_string("channel")
if channel == setchan and msg == GET_COMMAND then
local lightval = minetest.get_node_light(pos)
- digiline:receptor_send(pos, digiline.rules.default, channel, lightval)
+ digilines.receptor_send(pos, digilines.rules.default, channel, lightval)
end
end
@@ -39,7 +39,7 @@ minetest.register_node("digilines:lightsensor", {
groups = {dig_immediate=2},
selection_box = lsensor_selbox,
node_box = lsensor_nodebox,
- digiline =
+ digiline =
{
receptor = {},
effector = {
@@ -50,7 +50,7 @@ minetest.register_node("digilines:lightsensor", {
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "field[channel;Channel;${channel}]")
end,
- on_receive_fields = function(pos, formname, fields, sender)
+ on_receive_fields = function(pos, _, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then
minetest.record_protection_violation(pos, name)
diff --git a/digilines/presetrules.lua b/digilines/presetrules.lua
index 8d5e35b..a0ab508 100644
--- a/digilines/presetrules.lua
+++ b/digilines/presetrules.lua
@@ -1,6 +1,6 @@
-digiline.rules = {}
+digilines.rules = {}
-digiline.rules.default =
+digilines.rules.default =
{{x=0, y=0, z=-1},
{x=1, y=0, z=0},
{x=-1, y=0, z=0},
diff --git a/digilines/rtc.lua b/digilines/rtc.lua
index f8f6af4..a82f774 100644
--- a/digilines/rtc.lua
+++ b/digilines/rtc.lua
@@ -16,11 +16,11 @@ local rtc_selbox =
fixed = {{ -8/16, -8/16, -8/16, 8/16, -3/16, 8/16 }}
}
-local on_digiline_receive = function (pos, node, channel, msg)
+local on_digiline_receive = function (pos, _, channel, msg)
local setchan = minetest.get_meta(pos):get_string("channel")
if channel == setchan and msg == GET_COMMAND then
local timeofday = minetest.get_timeofday()
- digiline:receptor_send(pos, digiline.rules.default, channel, timeofday)
+ digilines.receptor_send(pos, digilines.rules.default, channel, timeofday)
end
end
@@ -35,7 +35,7 @@ minetest.register_node("digilines:rtc", {
groups = {dig_immediate=2},
selection_box = rtc_selbox,
node_box = rtc_nodebox,
- digiline =
+ digiline =
{
receptor = {},
effector = {
@@ -46,7 +46,7 @@ minetest.register_node("digilines:rtc", {
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "field[channel;Channel;${channel}]")
end,
- on_receive_fields = function(pos, formname, fields, sender)
+ on_receive_fields = function(pos, _, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then
minetest.record_protection_violation(pos, name)
diff --git a/digilines/util.lua b/digilines/util.lua
index cec75be..ac15fab 100644
--- a/digilines/util.lua
+++ b/digilines/util.lua
@@ -1,13 +1,13 @@
-function digiline:addPosRule(p, r)
+function digilines.addPosRule(p, r)
return {x = p.x + r.x, y = p.y + r.y, z = p.z + r.z}
end
-function digiline:cmpPos(p1, p2)
+function digilines.cmpPos(p1, p2)
return (p1.x == p2.x and p1.y == p2.y and p1.z == p2.z)
end
--Rules rotation Functions:
-function digiline:rotate_rules_right(rules)
+function digilines.rotate_rules_right(rules)
local nr={}
for i, rule in ipairs(rules) do
nr[i]={}
@@ -18,18 +18,18 @@ function digiline:rotate_rules_right(rules)
return nr
end
-function digiline:rotate_rules_left(rules)
+function digilines.rotate_rules_left(rules)
local nr={}
for i, rule in ipairs(rules) do
nr[i]={}
- nr[i].z=-rules[i].x
- nr[i].x=rules[i].z
- nr[i].y=rules[i].y
+ nr[i].z=-rule.x
+ nr[i].x=rule.z
+ nr[i].y=rule.y
end
return nr
end
-function digiline:rotate_rules_down(rules)
+function digilines.rotate_rules_down(rules)
local nr={}
for i, rule in ipairs(rules) do
nr[i]={}
@@ -40,7 +40,7 @@ function digiline:rotate_rules_down(rules)
return nr
end
-function digiline:rotate_rules_up(rules)
+function digilines.rotate_rules_up(rules)
local nr={}
for i, rule in ipairs(rules) do
nr[i]={}
@@ -51,13 +51,13 @@ function digiline:rotate_rules_up(rules)
return nr
end
-function digiline:tablecopy(table) -- deep table copy
+function digilines.tablecopy(table) -- deep table copy
if type(table) ~= "table" then return table end -- no need to copy
local newtable = {}
for idx, item in pairs(table) do
if type(item) == "table" then
- newtable[idx] = digiline:tablecopy(item)
+ newtable[idx] = digilines.tablecopy(item)
else
newtable[idx] = item
end
@@ -88,12 +88,12 @@ local vm_cache = nil
-- directly on VM-loaded arrays, which should be faster for reading many nodes
-- in rapid succession. However, the cache must be flushed with vm_end once the
-- scan is finished, to avoid using stale data in future.
-function digiline:vm_begin()
+function digilines.vm_begin()
vm_cache = {}
end
-- Ends a bulk-VoxelManipulator operation, freeing the cached data.
-function digiline:vm_end()
+function digilines.vm_end()
vm_cache = nil
end
@@ -141,7 +141,7 @@ end
-- there.
--
-- Inside a bulk-VoxelManipulator operation, the operation’s VM cache is used.
-function digiline:get_node_force(pos)
+function digilines.get_node_force(pos)
if vm_cache then
return vm_get_node(pos)
end
diff --git a/digilines/wire_std.lua b/digilines/wire_std.lua
index 71bbd0f..177e795 100644
--- a/digilines/wire_std.lua
+++ b/digilines/wire_std.lua
@@ -3,19 +3,19 @@
-- 1 = there is one; 0 = there is none
-- y always means y+
-box_center = {-1/16, -.5, -1/16, 1/16, -.5+1/16, 1/16}
-box_bump1 = { -2/16, -8/16, -2/16, 2/16, -13/32, 2/16 }
-box_bump2 = { -3/32, -13/32, -3/32, 3/32, -12/32, 3/32 }
+local box_center = {-1/16, -.5, -1/16, 1/16, -.5+1/16, 1/16}
+local box_bump1 = { -2/16, -8/16, -2/16, 2/16, -13/32, 2/16 }
+local box_bump2 = { -3/32, -13/32, -3/32, 3/32, -12/32, 3/32 }
-box_xp = {1/16, -.5, -1/16, 8/16, -.5+1/16, 1/16}
-box_zp = {-1/16, -.5, 1/16, 1/16, -.5+1/16, 8/16}
-box_xm = {-8/16, -.5, -1/16, -1/16, -.5+1/16, 1/16}
-box_zm = {-1/16, -.5, -8/16, 1/16, -.5+1/16, -1/16}
+local box_xp = {1/16, -.5, -1/16, 8/16, -.5+1/16, 1/16}
+local box_zp = {-1/16, -.5, 1/16, 1/16, -.5+1/16, 8/16}
+local box_xm = {-8/16, -.5, -1/16, -1/16, -.5+1/16, 1/16}
+local box_zm = {-1/16, -.5, -8/16, 1/16, -.5+1/16, -1/16}
-box_xpy = {.5-1/16, -.5+1/16, -1/16, .5, .4999+1/16, 1/16}
-box_zpy = {-1/16, -.5+1/16, .5-1/16, 1/16, .4999+1/16, .5}
-box_xmy = {-.5, -.5+1/16, -1/16, -.5+1/16, .4999+1/16, 1/16}
-box_zmy = {-1/16, -.5+1/16, -.5, 1/16, .4999+1/16, -.5+1/16}
+local box_xpy = {.5-1/16, -.5+1/16, -1/16, .5, .4999+1/16, 1/16}
+local box_zpy = {-1/16, -.5+1/16, .5-1/16, 1/16, .4999+1/16, .5}
+local box_xmy = {-.5, -.5+1/16, -1/16, -.5+1/16, .4999+1/16, 1/16}
+local box_zmy = {-1/16, -.5+1/16, -.5, 1/16, .4999+1/16, -.5+1/16}
for xp=0, 1 do
for zp=0, 1 do
@@ -25,13 +25,15 @@ for xpy=0, 1 do
for zpy=0, 1 do
for xmy=0, 1 do
for zmy=0, 1 do
- if (xpy == 1 and xp == 0) or (zpy == 1 and zp == 0)
+ if (xpy == 1 and xp == 0) or (zpy == 1 and zp == 0)
or (xmy == 1 and xm == 0) or (zmy == 1 and zm == 0) then break end
local groups
local nodeid = tostring(xp )..tostring(zp )..tostring(xm )..tostring(zm )..
tostring(xpy)..tostring(zpy)..tostring(xmy)..tostring(zmy)
+ local wiredesc
+
if nodeid == "00000000" then
groups = {dig_immediate = 3}
wiredesc = "Digiline"
@@ -51,6 +53,7 @@ for zmy=0, 1 do
if xmy == 1 then table.insert(nodebox, box_xmy) end
if zmy == 1 then table.insert(nodebox, box_zmy) end
+ local tiles
if adjx and adjz and (xp + zp + xm + zm > 2) then
table.insert(nodebox, box_bump1)
table.insert(nodebox, box_bump2)
@@ -87,16 +90,16 @@ for zmy=0, 1 do
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
- digiline =
+ digiline =
{
- wire =
+ wire =
{
basename = "digilines:wire_std_",
use_autoconnect = true
}
},
selection_box = {
- type = "fixed",
+ type = "fixed",
fixed = {-.5, -.5, -.5, .5, -.5+1/16, .5}
},
node_box = {
diff --git a/digilines/wires_common.lua b/digilines/wires_common.lua
index c5f761b..8ac1d29 100644
--- a/digilines/wires_common.lua
+++ b/digilines/wires_common.lua
@@ -1,17 +1,17 @@
minetest.register_on_placenode(function(pos, node)
if minetest.registered_nodes[node.name].digiline then
- digiline:update_autoconnect(pos)
+ digilines.update_autoconnect(pos)
end
end)
minetest.register_on_dignode(function(pos, node)
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].digiline then
-- need to make sure that node exists (unknown nodes!)
- digiline:update_autoconnect(pos)
+ digilines.update_autoconnect(pos)
end
end)
-function digiline:update_autoconnect(pos, secondcall)
+function digilines.update_autoconnect(pos, secondcall)
local xppos = {x=pos.x+1, y=pos.y, z=pos.z}
local zppos = {x=pos.x, y=pos.y, z=pos.z+1}
local xmpos = {x=pos.x-1, y=pos.y, z=pos.z}
@@ -26,20 +26,20 @@ function digiline:update_autoconnect(pos, secondcall)
local zmypos = {x=pos.x, y=pos.y+1, z=pos.z-1}
if secondcall == nil then
- digiline:update_autoconnect(xppos, true)
- digiline:update_autoconnect(zppos, true)
- digiline:update_autoconnect(xmpos, true)
- digiline:update_autoconnect(zmpos, true)
+ digilines.update_autoconnect(xppos, true)
+ digilines.update_autoconnect(zppos, true)
+ digilines.update_autoconnect(xmpos, true)
+ digilines.update_autoconnect(zmpos, true)
- digiline:update_autoconnect(xpypos, true)
- digiline:update_autoconnect(zpypos, true)
- digiline:update_autoconnect(xmypos, true)
- digiline:update_autoconnect(zmypos, true)
+ digilines.update_autoconnect(xpypos, true)
+ digilines.update_autoconnect(zpypos, true)
+ digilines.update_autoconnect(xmypos, true)
+ digilines.update_autoconnect(zmypos, true)
- digiline:update_autoconnect(xpympos, true)
- digiline:update_autoconnect(zpympos, true)
- digiline:update_autoconnect(xmympos, true)
- digiline:update_autoconnect(zmympos, true)
+ digilines.update_autoconnect(xpympos, true)
+ digilines.update_autoconnect(zpympos, true)
+ digilines.update_autoconnect(xmympos, true)
+ digilines.update_autoconnect(zmympos, true)
end
local def = minetest.registered_nodes[minetest.get_node(pos).name]
@@ -49,20 +49,20 @@ function digiline:update_autoconnect(pos, secondcall)
return nil
end
- local zmg = digiline:rules_link_anydir(pos, zmpos)
- local zmymg = digiline:rules_link_anydir(pos, zmympos)
- local xmg = digiline:rules_link_anydir(pos, xmpos)
- local xmymg = digiline:rules_link_anydir(pos, xmympos)
- local zpg = digiline:rules_link_anydir(pos, zppos)
- local zpymg = digiline:rules_link_anydir(pos, zpympos)
- local xpg = digiline:rules_link_anydir(pos, xppos)
- local xpymg = digiline:rules_link_anydir(pos, xpympos)
+ local zmg = digilines.rules_link_anydir(pos, zmpos)
+ local zmymg = digilines.rules_link_anydir(pos, zmympos)
+ local xmg = digilines.rules_link_anydir(pos, xmpos)
+ local xmymg = digilines.rules_link_anydir(pos, xmympos)
+ local zpg = digilines.rules_link_anydir(pos, zppos)
+ local zpymg = digilines.rules_link_anydir(pos, zpympos)
+ local xpg = digilines.rules_link_anydir(pos, xppos)
+ local xpymg = digilines.rules_link_anydir(pos, xpympos)
- local xpyg = digiline:rules_link_anydir(pos, xpypos)
- local zpyg = digiline:rules_link_anydir(pos, zpypos)
- local xmyg = digiline:rules_link_anydir(pos, xmypos)
- local zmyg = digiline:rules_link_anydir(pos, zmypos)
+ local xpyg = digilines.rules_link_anydir(pos, xpypos)
+ local zpyg = digilines.rules_link_anydir(pos, zpypos)
+ local xmyg = digilines.rules_link_anydir(pos, xmypos)
+ local zmyg = digilines.rules_link_anydir(pos, zmypos)
local zm, xm, zp, xp, xpy, zpy, xmy, zmy
if zmg or zmymg then zm = 1 else zm = 0 end
diff --git a/ropes/LICENSE.md b/ropes/LICENSE.md
new file mode 100644
index 0000000..fb67788
--- /dev/null
+++ b/ropes/LICENSE.md
@@ -0,0 +1,4 @@
+License
+=======
+- Code WTFPL
+- Texture CC
diff --git a/ropes/README.md b/ropes/README.md
new file mode 100644
index 0000000..699369c
--- /dev/null
+++ b/ropes/README.md
@@ -0,0 +1,11 @@
+# Ropes
+
+This mod adds "rope boxes", blocks that when placed in world will automatically lower a rope at 1 meter per second until it reaches a fixed maximum length. The basic rope box produces 50m of rope by default and there are up to eight additional rope box types that produce multiples of that rope length - 100m, 150m, and so forth up to 450m. The number of rope boxes and the length of a standard rope length can be configured via the settings menu.
+
+The rope stops lowering if it reaches an obstruction. Ropes can be cut using an axe or other choppy tool at any location and when they're cut the bottom half of the rope will disappear, dropping any climbers. The same happens to the entire rope if the rope box at the top of the rope is removed. Cutting the rope doesn't reduce the maximum length of rope the rope box will produce if it's removed and rebuilt again. Ropes are flammable. They respect protection settings - if the player that placed the rope box isn't permitted to build in an area then the rope descending from that box will treat it as an obstruction.
+
+Also included is a rope ladder that behaves similarly, though it only comes in one standard maximum length - 50m by default, again changeable in settings.
+
+This mod retains optional backward compatibility with the crafting items from the vines mod (anything with group "vines" can be used to make rope boxes and rope ladders). Ropes can also be made from cotton, available via an optional dependency on the farming mod.
+
+In-game documentation is provided via an optional dependency on the doc mod. \ No newline at end of file
diff --git a/ropes/crafts.lua b/ropes/crafts.lua
new file mode 100644
index 0000000..299c0cc
--- /dev/null
+++ b/ropes/crafts.lua
@@ -0,0 +1,34 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+if minetest.get_modpath("farming") then
+ minetest.register_craft({
+ output = 'ropes:ropesegment',
+ recipe = {
+ {'farming:cotton','farming:cotton'},
+ {'farming:cotton','farming:cotton'},
+ {'farming:cotton','farming:cotton'}
+ }
+ })
+end
+
+minetest.register_craftitem("ropes:ropesegment", {
+ description = S("Rope Segment"),
+ _doc_items_longdesc = ropes.doc.ropesegment_longdesc,
+ _doc_items_usagehelp = ropes.doc.ropesegment_usage,
+ groups = {vines = 1},
+ inventory_image = "ropes_item.png",
+})
+
+local cotton_burn_time = 1
+ropes.wood_burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack("default:wood")}}).time
+ropes.rope_burn_time = cotton_burn_time * 6
+local stick_burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack("default:stick")}}).time
+ropes.ladder_burn_time = ropes.rope_burn_time * 2 + stick_burn_time * 3
+
+minetest.register_craft({
+ type = "fuel",
+ recipe = "ropes:ropesegment",
+ burntime = ropes.rope_burn_time,
+}) \ No newline at end of file
diff --git a/ropes/depends.txt b/ropes/depends.txt
new file mode 100644
index 0000000..6672602
--- /dev/null
+++ b/ropes/depends.txt
@@ -0,0 +1,6 @@
+default
+farming?
+vines?
+doc?
+intllib?
+loot? \ No newline at end of file
diff --git a/ropes/description.txt b/ropes/description.txt
new file mode 100644
index 0000000..846f150
--- /dev/null
+++ b/ropes/description.txt
@@ -0,0 +1 @@
+Adds rope boxes of various lengths and also rope ladders. \ No newline at end of file
diff --git a/ropes/doc.lua b/ropes/doc.lua
new file mode 100644
index 0000000..7f2ce54
--- /dev/null
+++ b/ropes/doc.lua
@@ -0,0 +1,47 @@
+ropes.doc = {}
+
+if not minetest.get_modpath("doc") then
+ return
+end
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+ropes.doc.ropesegment_longdesc = S("Rope segments are bundles of fibre twisted into robust cables.")
+ropes.doc.ropesegment_usage = S("This craft item is useful for creating rope ladders, or for spooling on wooden spindles to hang and climb upon.")
+
+ropes.doc.ropeladder_longdesc = S("A hanging rope ladder that automatically extends downward.")
+ropes.doc.ropeladder_usage = S("After a rope ladder is placed on a vertical wall it will begin extending downward until it reaches its maximum length (@1 meters). If the rope ladder is removed all of the ladder below the point of removal will disappear. A rope ladder can be severed partway down using an axe or similar tool, and the ladder below the point where it is cut will collapse. No rope is actually lost in the process, though, and if the uppermost section of the ladder is removed and replaced the ladder will re-extend to the same maximum length as before.", ropes.ropeLadderLength)
+
+local rope_length_doc = S("Rope boxes have a certain amount of rope contained within them specified in the name of the node, and have a limit to how much rope they can support that depends on the material they're made of. The different lengths can be crafted by combining and splitting up rope boxes in the crafting grid. For example, you can craft a @1m rope box by putting a @2m rope box and a rope segment in the crafting grid, or a @3m rope box and two rope segments in the crafting grid. Two rope segments can be recovered by putting the @1m rope box in the crafting grid by itself.", ropes.ropeLength*3, ropes.ropeLength*2, ropes.ropeLength) .. "\n"
+
+if ropes.woodRopeBoxMaxMultiple == 1 then
+ rope_length_doc = rope_length_doc .. "\n" .. S("Wood") .. " " .. S("rope boxes can hold @1m of rope.", ropes.ropeLength)
+elseif ropes.woodRopeBoxMaxMultiple > 1 then
+ rope_length_doc = rope_length_doc .. "\n" .. S("Wood") .. " " .. S("rope boxes can hold rope lengths from @1m to @2m.", ropes.ropeLength, ropes.ropeLength*ropes.woodRopeBoxMaxMultiple)
+end
+
+if ropes.copperRopeBoxMaxMultiple == 1 then
+ rope_length_doc = rope_length_doc .. "\n" .. S("Copper") .. " " .. S("rope boxes can hold @1m of rope.", ropes.ropeLength)
+elseif ropes.copperRopeBoxMaxMultiple > 1 then
+ rope_length_doc = rope_length_doc .. "\n" .. S("Copper") .. " " .. S("rope boxes can hold rope lengths from @1m to @2m.", ropes.ropeLength, ropes.ropeLength*ropes.copperRopeBoxMaxMultiple)
+end
+
+if ropes.steelRopeBoxMaxMultiple == 1 then
+ rope_length_doc = rope_length_doc .. "\n" .. S("Steel") .. " " .. S("rope boxes can hold @1m of rope.", ropes.ropeLength)
+elseif ropes.steelRopeBoxMaxMultiple > 1 then
+ rope_length_doc = rope_length_doc .. "\n" .. S("Steel") .. " " .. S("rope boxes can hold rope lengths from @1m to @2m.", ropes.ropeLength, ropes.ropeLength*ropes.steelRopeBoxMaxMultiple)
+end
+
+ropes.doc.ropebox_longdesc = S("Ropes are hung by placing rope boxes, which automatically lower a rope of fixed length below them. They can be climbed and cut.")
+ropes.doc.ropebox_usage = rope_length_doc .. "\n\n" ..
+ S("When a rope box is placed the rope will immediately begin lowering from it at one meter per second. The rope will only descend when its end is in the vicinity of an active player, suspending its journey when no players are nearby, so a long descent may require a player to climb down the rope as it goes. If you are near the bottom end of a rope that's extending you'll be automatically carried down with it. The rope will stop when it encounters and obstruction, but will resume lowering if the obstruction is removed.") .. "\n\n" ..
+ S("A rope can be severed midway using an axe or other similar tool. The section of rope below the cut will collapse and disappear, potentially causing players who were hanging on to it to fall. The remaining rope will not resume descent on its own, but the rope box at the top of the rope \"remembers\" how long the rope was and if it is deconstructed and replaced it will still have the same maximum length of rope as before - no rope is permanently lost when a rope is severed like this.")
+
+doc.add_entry_alias("nodes", "ropes:ropeladder_top", "nodes", "ropes:ropeladder")
+doc.add_entry_alias("nodes", "ropes:ropeladder_top", "nodes", "ropes:ropeladder_bottom")
+doc.add_entry_alias("nodes", "ropes:ropeladder_top", "nodes", "ropes:ropeladder_falling")
+
+doc.add_entry_alias("nodes", "ropes:rope", "nodes", "ropes:rope_bottom")
+doc.add_entry_alias("nodes", "ropes:rope", "nodes", "ropes:rope_top") \ No newline at end of file
diff --git a/ropes/functions.lua b/ropes/functions.lua
new file mode 100644
index 0000000..4ce5e62
--- /dev/null
+++ b/ropes/functions.lua
@@ -0,0 +1,97 @@
+ropes.make_rope_on_timer = function(rope_node_name)
+ return function(pos, elapsed)
+ local currentend = minetest.get_node(pos)
+ local currentmeta = minetest.get_meta(pos)
+ local currentlength = currentmeta:get_int("length_remaining")
+ local placer_name = currentmeta:get_string("placer")
+ local newpos = {x=pos.x, y=pos.y-1, z=pos.z}
+ local newnode = minetest.get_node(newpos)
+ local oldnode = minetest.get_node(pos)
+ if currentlength > 1 and (not minetest.is_protected(newpos, placer_name)
+ or minetest.check_player_privs(placer_name, "protection_bypass")) then
+ if newnode.name == "air" then
+ minetest.add_node(newpos, {name=currentend.name, param2=oldnode.param2})
+ local newmeta = minetest.get_meta(newpos)
+ newmeta:set_int("length_remaining", currentlength-1)
+ newmeta:set_string("placer", placer_name)
+ minetest.set_node(pos, {name=rope_node_name, param2=oldnode.param2})
+ ropes.move_players_down(pos, 1)
+ else
+ local timer = minetest.get_node_timer( pos )
+ timer:start( 1 )
+ end
+ end
+ end
+end
+
+local data = {}
+local c_air = minetest.get_content_id("air")
+
+ropes.destroy_rope = function(pos, nodes)
+ local top = pos.y
+ local bottom = pos.y-15
+ local voxel_manip = minetest.get_voxel_manip()
+
+ local finished = false
+ local ids_to_destroy = {}
+ for _, node in pairs(nodes) do
+ ids_to_destroy[minetest.get_content_id(node)] = true
+ end
+
+ while not finished do
+ local emin, emax = voxel_manip:read_from_map({x=pos.x, y=bottom, z=pos.z}, {x=pos.x, y=top, z=pos.z})
+ voxel_manip:get_data(data)
+ local voxel_area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
+ bottom = emin.y
+ for y = top, bottom, -1 do
+ local index = voxel_area:index(pos.x, y, pos.z)
+ if ids_to_destroy[data[index]] then
+ data[index] = c_air
+ else
+ finished = true
+ break
+ end
+ end
+ voxel_manip:set_data(data)
+ voxel_manip:write_to_map()
+ voxel_manip:update_map()
+ top = bottom - 1
+ bottom = bottom - 15
+ end
+end
+
+
+ropes.hanging_after_destruct = function(pos, top_node, middle_node, bottom_node)
+ local node = minetest.get_node(pos)
+ if node.name == top_node or node.name == middle_node or node.name == bottom_node then
+ return -- this was done by another ladder or rope node changing this one, don't react
+ end
+
+ pos.y = pos.y + 1 -- one up
+ local node_above = minetest.get_node(pos)
+ if node_above.name == middle_node then
+ minetest.swap_node(pos, {name=bottom_node, param2=node_above.param2})
+ end
+
+ pos.y = pos.y - 2 -- one down
+ local node_below = minetest.get_node(pos)
+ if node_below.name == middle_node then
+ ropes.destroy_rope(pos, {middle_node, bottom_node})
+ elseif node_below.name == bottom_node then
+ minetest.swap_node(pos, {name="air"})
+ end
+end
+
+ropes.move_players_down = function(pos, radius)
+ local all_objects = minetest.get_objects_inside_radius({x=pos.x, y=pos.y+radius, z=pos.z}, radius)
+ local players = {}
+ local _,obj
+ for _,obj in pairs(all_objects) do
+ if obj:is_player() then
+ local obj_pos = obj:getpos()
+ if math.abs(obj_pos.x-pos.x) < 0.5 and math.abs(obj_pos.z-pos.z) < 0.5 then
+ obj:moveto({x=obj_pos.x, y=obj_pos.y-1, z=obj_pos.z}, true)
+ end
+ end
+ end
+end
diff --git a/ropes/init.lua b/ropes/init.lua
new file mode 100644
index 0000000..68d9895
--- /dev/null
+++ b/ropes/init.lua
@@ -0,0 +1,43 @@
+ropes = {
+ name = 'ropes',
+}
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+ropes.ropeLength = tonumber(minetest.setting_get("ropes_rope_length")) or 50
+ropes.ropeLadderLength = tonumber(minetest.setting_get("ropes_rope_ladder_length")) or 50
+ropes.woodRopeBoxMaxMultiple = tonumber(minetest.setting_get("ropes_wood_rope_box_max_multiple")) or 2
+ropes.copperRopeBoxMaxMultiple = tonumber(minetest.setting_get("ropes_copper_rope_box_max_multiple")) or 5
+ropes.steelRopeBoxMaxMultiple = tonumber(minetest.setting_get("ropes_steel_rope_box_max_multiple")) or 9
+ropes.create_all_definitions = minetest.setting_getbool("ropes_create_all_definitions")
+
+dofile( minetest.get_modpath( ropes.name ) .. "/doc.lua" )
+dofile( minetest.get_modpath( ropes.name ) .. "/functions.lua" )
+dofile( minetest.get_modpath( ropes.name ) .. "/crafts.lua" )
+dofile( minetest.get_modpath( ropes.name ) .. "/ropeboxes.lua" )
+dofile( minetest.get_modpath( ropes.name ) .. "/ladder.lua" )
+dofile( minetest.get_modpath( ropes.name ) .. "/loot.lua" )
+
+
+for i=1,5 do
+ minetest.register_alias(string.format("vines:%irope_block", i), string.format("ropes:%irope_block", i))
+end
+minetest.register_alias("vines:rope", "ropes:rope")
+minetest.register_alias("vines:rope_bottom", "ropes:rope_bottom")
+minetest.register_alias("vines:rope_end", "ropes:rope_bottom")
+minetest.register_alias("vines:rope_top", "ropes:rope_top")
+minetest.register_alias("vines:ropeladder_top", "ropes:ropeladder_top")
+minetest.register_alias("vines:ropeladder", "ropes:ropeladder")
+minetest.register_alias("vines:ropeladder_bottom", "ropes:ropeladder_bottom")
+minetest.register_alias("vines:ropeladder_falling", "ropes:ropeladder_falling")
+minetest.register_alias("vines:rope_block", "ropes:steel5rope_block")
+for i=1,9 do
+ minetest.register_alias(string.format("ropes:%irope_block", i), string.format("ropes:steel%irope_block", i))
+end
+minetest.register_alias("castle:ropes", "ropes:rope")
+minetest.register_alias("castle:ropebox", "ropes:steel1rope_block")
+minetest.register_alias("castle:box_rope", "ropes:rope")
+
+print(S("[Ropes] Loaded!"))
diff --git a/ropes/intllib.lua b/ropes/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/ropes/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/ropes/ladder.lua b/ropes/ladder.lua
new file mode 100644
index 0000000..5ac872c
--- /dev/null
+++ b/ropes/ladder.lua
@@ -0,0 +1,180 @@
+if ropes.ropeLadderLength == 0 and not ropes.create_all_definitions then
+ return
+end
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+if ropes.ropeLadderLength > 0 then
+ minetest.register_craft({
+ output = "ropes:ropeladder_top",
+ recipe = {
+ {'','group:stick',''},
+ {'group:vines','group:stick','group:vines'},
+ {'','group:stick',''},
+ }
+ })
+end
+
+minetest.register_craft({
+ type = "fuel",
+ recipe = "ropes:ropeladder_top",
+ burntime = ropes.ladder_burn_time,
+})
+
+local rope_ladder_top_def = {
+ description = S("Rope Ladder"),
+ _doc_items_longdesc = ropes.doc.ropeladder_longdesc,
+ _doc_items_usagehelp = ropes.doc.ropeladder_usage,
+ drawtype = "signlike",
+ tiles = {"default_ladder_wood.png^ropes_ropeladder_top.png"},
+ is_ground_content = false,
+ inventory_image = "default_ladder_wood.png^ropes_ropeladder_top.png",
+ wield_image = "default_ladder_wood.png^ropes_ropeladder_top.png",
+ paramtype = "light",
+ paramtype2 = "wallmounted",
+ walkable = false,
+ climbable = true,
+ sunlight_propagates = true,
+ selection_box = {
+ type = "wallmounted",
+ --wall_top = = <default>
+ --wall_bottom = = <default>
+ --wall_side = = <default>
+
+ },
+ groups = { choppy=2, oddly_breakable_by_hand=1,flammable=2},
+ sounds = default.node_sound_wood_defaults(),
+
+ after_place_node = function(pos, placer)
+ local pos_below = {x=pos.x, y=pos.y-1, z=pos.z}
+ local node_below = minetest.get_node(pos_below)
+ local this_node = minetest.get_node(pos)
+ local placer_name = placer:get_player_name()
+ -- param2 holds the facing direction of this node. If it's 0 or 1 the node is "flat" and we don't want the ladder to extend.
+ if node_below.name == "air" and this_node.param2 > 1
+ and (not minetest.is_protected(pos_below, placer_name)
+ or minetest.check_player_privs(placer_name, "protection_bypass")) then
+ minetest.add_node(pos_below, {name="ropes:ropeladder_bottom", param2=this_node.param2})
+ local meta = minetest.get_meta(pos_below)
+ meta:set_int("length_remaining", ropes.ropeLadderLength)
+ meta:set_string("placer", placer_name)
+ end
+ end,
+ after_destruct = function(pos)
+ local pos_below = {x=pos.x, y=pos.y-1, z=pos.z}
+ ropes.destroy_rope(pos_below, {"ropes:ropeladder", "ropes:ropeladder_bottom", "ropes:ropeladder_falling"})
+ end,
+}
+
+if ropes.ropeLadderLength == 0 then
+ rope_ladder_top_def.groups.not_in_creative_inventory = 1
+end
+
+minetest.register_node("ropes:ropeladder_top", rope_ladder_top_def)
+
+minetest.register_node("ropes:ropeladder", {
+ description = S("Rope Ladder"),
+ _doc_items_create_entry = false,
+ drop = "",
+ drawtype = "signlike",
+ tiles = {"default_ladder_wood.png^ropes_ropeladder.png"},
+ is_ground_content = false,
+ inventory_image = "default_ladder_wood.png^ropes_ropeladder.png",
+ wield_image = "default_ladder_wood.png^ropes_ropeladder.png",
+ paramtype = "light",
+ paramtype2 = "wallmounted",
+ walkable = false,
+ climbable = true,
+ sunlight_propagates = true,
+ selection_box = {
+ type = "wallmounted",
+ --wall_top = = <default>
+ --wall_bottom = = <default>
+ --wall_side = = <default>
+ },
+ groups = {choppy=2, flammable=2, not_in_creative_inventory=1},
+ sounds = default.node_sound_wood_defaults(),
+
+ after_destruct = function(pos)
+ ropes.hanging_after_destruct(pos, "ropes:ropeladder_falling", "ropes:ropeladder", "ropes:ropeladder_bottom")
+ end,
+})
+
+local ladder_extender = ropes.make_rope_on_timer("ropes:ropeladder")
+
+minetest.register_node("ropes:ropeladder_bottom", {
+ description = S("Rope Ladder"),
+ _doc_items_create_entry = false,
+ drop = "",
+ drawtype = "signlike",
+ tiles = {"default_ladder_wood.png^ropes_ropeladder_bottom.png"},
+ is_ground_content = false,
+ inventory_image = "default_ladder_wood.png^ropes_ropeladder_bottom.png",
+ wield_image = "default_ladder_wood.png^ropes_ropeladder_bottom.png",
+ paramtype = "light",
+ paramtype2 = "wallmounted",
+ walkable = false,
+ climbable = true,
+ sunlight_propagates = true,
+ selection_box = {
+ type = "wallmounted",
+ --wall_top = = <default>
+ --wall_bottom = = <default>
+ --wall_side = = <default>
+
+ },
+ groups = {choppy=2, flammable=2, not_in_creative_inventory=1},
+ sounds = default.node_sound_wood_defaults(),
+ on_construct = function( pos )
+ local timer = minetest.get_node_timer( pos )
+ timer:start( 1 )
+ end,
+ on_timer = ladder_extender,
+
+ after_destruct = function(pos)
+ ropes.hanging_after_destruct(pos, "ropes:ropeladder_falling", "ropes:ropeladder", "ropes:ropeladder_bottom")
+ end,
+})
+
+minetest.register_node("ropes:ropeladder_falling", {
+ description = S("Rope Ladder"),
+ _doc_items_create_entry = false,
+ drop = "",
+ drawtype = "signlike",
+ tiles = {"default_ladder_wood.png^ropes_ropeladder.png"},
+ is_ground_content = false,
+ inventory_image = "default_ladder_wood.png^ropes_ropeladder.png",
+ wield_image = "default_ladder_wood.png^ropes_ropeladder.png",
+ paramtype = "light",
+ paramtype2 = "wallmounted",
+ walkable = false,
+ climbable = true,
+ sunlight_propagates = true,
+ selection_box = {
+ type = "wallmounted",
+ --wall_top = = <default>
+ --wall_bottom = = <default>
+ --wall_side = = <default>
+
+ },
+ groups = {flammable=2, not_in_creative_inventory=1},
+ sounds = default.node_sound_wood_defaults(),
+ on_construct = function( pos )
+ local timer = minetest.get_node_timer( pos )
+ timer:start( 1 )
+ end,
+ on_timer = function( pos, elapsed )
+ local pos_below = {x=pos.x, y=pos.y-1, z=pos.z}
+ local node_below = minetest.get_node(pos_below)
+
+ if (node_below.name ~= "ignore") then
+ ropes.destroy_rope(pos_below, {'ropes:ropeladder', 'ropes:ropeladder_bottom', 'ropes:ropeladder_falling'})
+ minetest.swap_node(pos, {name="air"})
+ else
+ local timer = minetest.get_node_timer( pos )
+ timer:start( 1 )
+ end
+ end
+})
diff --git a/ropes/locale/template.pot b/ropes/locale/template.pot
new file mode 100644
index 0000000..3d739ab
--- /dev/null
+++ b/ropes/locale/template.pot
@@ -0,0 +1,123 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-09 21:21-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: crafts.lua:17
+msgid "Rope Segment"
+msgstr ""
+
+#: doc.lua:11
+msgid "Rope segments are bundles of fibre twisted into robust cables."
+msgstr ""
+
+#: doc.lua:12
+msgid ""
+"This craft item is useful for creating rope ladders, or for spooling on "
+"wooden spindles to hang and climb upon."
+msgstr ""
+
+#: doc.lua:14
+msgid "A hanging rope ladder that automatically extends downward."
+msgstr ""
+
+#: doc.lua:15
+msgid ""
+"After a rope ladder is placed on a vertical wall it will begin extending "
+"downward until it reaches its maximum length (@1 meters). If the rope ladder "
+"is removed all of the ladder below the point of removal will disappear. A "
+"rope ladder can be severed partway down using an axe or similar tool, and "
+"the ladder below the point where it is cut will collapse. No rope is "
+"actually lost in the process, though, and if the uppermost section of the "
+"ladder is removed and replaced the ladder will re-extend to the same maximum "
+"length as before."
+msgstr ""
+
+#: doc.lua:17
+msgid ""
+"Rope boxes have a certain amount of rope contained within them specified in "
+"the name of the node, and have a limit to how much rope they can support "
+"that depends on the material they're made of. The different lengths can be "
+"crafted by combining and splitting up rope boxes in the crafting grid. For "
+"example, you can craft a @1m rope box by putting a @2m rope box and a rope "
+"segment in the crafting grid, or a @3m rope box and two rope segments in the "
+"crafting grid. Two rope segments can be recovered by putting the @1m rope "
+"box in the crafting grid by itself."
+msgstr ""
+
+#: doc.lua:20 doc.lua:22 ropeboxes.lua:302
+msgid "Wood"
+msgstr ""
+
+#: doc.lua:20 doc.lua:26 doc.lua:32
+msgid "rope boxes can hold @1m of rope."
+msgstr ""
+
+#: doc.lua:22 doc.lua:28 doc.lua:34
+msgid "rope boxes can hold rope lengths from @1m to @2m."
+msgstr ""
+
+#: doc.lua:26 doc.lua:28 ropeboxes.lua:319
+msgid "Copper"
+msgstr ""
+
+#: doc.lua:32 doc.lua:34 ropeboxes.lua:336
+msgid "Steel"
+msgstr ""
+
+#: doc.lua:37
+msgid ""
+"Ropes are hung by placing rope boxes, which automatically lower a rope of "
+"fixed length below them. They can be climbed and cut."
+msgstr ""
+
+#: doc.lua:39
+msgid ""
+"When a rope box is placed the rope will immediately begin lowering from it "
+"at one meter per second. The rope will only descend when its end is in the "
+"vicinity of an active player, suspending its journey when no players are "
+"nearby, so a long descent may require a player to climb down the rope as it "
+"goes. If you are near the bottom end of a rope that's extending you'll be "
+"automatically carried down with it. The rope will stop when it encounters "
+"and obstruction, but will resume lowering if the obstruction is removed."
+msgstr ""
+
+#: doc.lua:40
+msgid ""
+"A rope can be severed midway using an axe or other similar tool. The section "
+"of rope below the cut will collapse and disappear, potentially causing "
+"players who were hanging on to it to fall. The remaining rope will not "
+"resume descent on its own, but the rope box at the top of the rope "
+"\"remembers\" how long the rope was and if it is deconstructed and replaced "
+"it will still have the same maximum length of rope as before - no rope is "
+"permanently lost when a rope is severed like this."
+msgstr ""
+
+#: init.lua:72
+msgid "[Ropes] Loaded!"
+msgstr ""
+
+#: ladder.lua:27 ladder.lua:78 ladder.lua:108 ladder.lua:142
+msgid "Rope Ladder"
+msgstr ""
+
+#: ropeboxes.lua:121
+msgid "@1 Ropebox @2m"
+msgstr ""
+
+#: ropeboxes.lua:218 ropeboxes.lua:249
+msgid "Rope"
+msgstr ""
diff --git a/ropes/loot.lua b/ropes/loot.lua
new file mode 100644
index 0000000..ed512be
--- /dev/null
+++ b/ropes/loot.lua
@@ -0,0 +1,56 @@
+if not minetest.get_modpath("loot") then
+ return
+end
+
+loot.register_loot({
+ weights = { generic = 300 },
+ payload = {
+ stack = ItemStack("ropes:ropesegment"),
+ min_size = 1,
+ max_size = 50,
+ },
+})
+
+if ropes.ropeLadderLength > 0 then
+loot.register_loot({
+ weights = { generic = 150 },
+ payload = {
+ stack = ItemStack("ropes:ropeladder_top"),
+ min_size = 1,
+ max_size = 20,
+ },
+})
+end
+
+if ropes.woodRopeBoxMaxMultiple > 0 then
+loot.register_loot({
+ weights = { generic = 100 },
+ payload = {
+ stack = ItemStack("ropes:wood1rope_block"),
+ min_size = 1,
+ max_size = 20,
+ },
+})
+end
+
+if ropes.copperRopeBoxMaxMultiple > 0 then
+loot.register_loot({
+ weights = { generic = 75 },
+ payload = {
+ stack = ItemStack("ropes:copper1rope_block"),
+ min_size = 1,
+ max_size = 15,
+ },
+})
+end
+
+if ropes.steelRopeBoxMaxMultiple > 0 then
+loot.register_loot({
+ weights = { generic = 50 },
+ payload = {
+ stack = ItemStack("ropes:steel1rope_block"),
+ min_size = 1,
+ max_size = 10,
+ },
+})
+end \ No newline at end of file
diff --git a/ropes/mod.conf b/ropes/mod.conf
new file mode 100644
index 0000000..88ecfd1
--- /dev/null
+++ b/ropes/mod.conf
@@ -0,0 +1 @@
+name = ropes \ No newline at end of file
diff --git a/ropes/ropeboxes.lua b/ropes/ropeboxes.lua
new file mode 100644
index 0000000..9049bb1
--- /dev/null
+++ b/ropes/ropeboxes.lua
@@ -0,0 +1,348 @@
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+local function rope_box_tiles(count, tint)
+ return {
+ string.format("ropes_ropebox_front_%i.png^[colorize:%s^ropes_ropebox_front_%i.png^ropes_%i.png", count, tint, count, count),
+ string.format("ropes_ropebox_front_%i.png^[colorize:%s^ropes_ropebox_front_%i.png^ropes_%i.png", count, tint, count, count),
+ string.format("ropes_ropebox_side.png^[colorize:%s^ropes_ropebox_side.png", tint),
+ string.format("ropes_ropebox_side.png^[colorize:%s^ropes_ropebox_side.png", tint),
+ string.format("ropes_ropebox_front_%i.png^[colorize:%s^ropes_ropebox_front_%i.png^ropes_%i.png", count, tint, count, count),
+ string.format("ropes_ropebox_front_%i.png^[colorize:%s^ropes_ropebox_front_%i.png^ropes_%i.png", count, tint, count, count),
+ }
+end
+
+local rope_box_data = {
+{
+ node={
+ {-0.125, -0.125, -0.25, 0.125, 0.125, 0.25}, -- pulley
+ {-0.125, -0.25, -0.125, 0.125, 0.25, 0.125}, -- pulley
+ {-0.125, -0.1875, -0.1875, 0.125, 0.1875, 0.1875}, -- pulley_core
+ {-0.1875, -0.5, -0.125, -0.125, 0.125, 0.125}, -- support
+ {0.125, -0.5, -0.125, 0.1875, 0.125, 0.125}, -- support
+ },
+ --selection = {-0.1875, -0.5, -0.25, 0.1875, 0.25, 0.25}, -- selection
+ tiles = 1,
+},
+{
+ node={
+ {-0.1875, -0.125, -0.25, 0.1875, 0.125, 0.25}, -- pulley
+ {-0.1875, -0.25, -0.125, 0.1875, 0.25, 0.125}, -- pulley
+ {-0.1875, -0.1875, -0.1875, 0.1875, 0.1875, 0.1875}, -- pulley_core
+ {-0.25, -0.5, -0.125, -0.1875, 0.125, 0.125}, -- support
+ {0.1875, -0.5, -0.125, 0.25, 0.125, 0.125}, -- support
+ },
+ --selection = {-0.1875, -0.5, -0.25, 0.1875, 0.25, 0.25}, -- selection
+ tiles = 2,
+},
+{
+ node={
+ {-0.25, -0.125, -0.25, 0.25, 0.125, 0.25}, -- pulley
+ {-0.25, -0.25, -0.125, 0.25, 0.25, 0.125}, -- pulley
+ {-0.25, -0.1875, -0.1875, 0.25, 0.1875, 0.1875}, -- pulley_core
+ {-0.3125, -0.5, -0.125, -0.25, 0.125, 0.125}, -- support
+ {0.25, -0.5, -0.125, 0.3125, 0.125, 0.125}, -- support
+ },
+ --selection = {-0.3125, -0.5, -0.25, 0.3125, 0.25, 0.25}, -- selection
+ tiles = 3,
+},
+{
+ node={
+ {-0.3125, -0.125, -0.25, 0.3125, 0.125, 0.25}, -- pulley
+ {-0.3125, -0.25, -0.125, 0.3125, 0.25, 0.125}, -- pulley
+ {-0.3125, -0.1875, -0.1875, 0.3125, 0.1875, 0.1875}, -- pulley_core
+ {-0.375, -0.5, -0.125, -0.3125, 0.125, 0.125}, -- support
+ {0.3125, -0.5, -0.125, 0.375, 0.125, 0.125}, -- support
+ },
+ --selection = {-0.375, -0.5, -0.25, 0.375, 0.25, 0.25}, -- selection
+ tiles = 4,
+},
+{
+ node={
+ {-0.375, -0.125, -0.25, 0.375, 0.125, 0.25}, -- pulley
+ {-0.375, -0.25, -0.125, 0.375, 0.25, 0.125}, -- pulley
+ {-0.375, -0.1875, -0.1875, 0.375, 0.1875, 0.1875}, -- pulley_core
+ {-0.4375, -0.5, -0.125, -0.375, 0.125, 0.125}, -- support
+ {0.375, -0.5, -0.125, 0.4375, 0.125, 0.125}, -- support
+ },
+ --selection = {-0.4375, -0.5, -0.25, 0.4375, 0.25, 0.25}, -- selection
+ tiles = 5,
+},
+{
+ node={
+ {-0.1875, -0.1875, -0.3125, 0.1875, 0.1875, 0.3125}, -- pulley
+ {-0.1875, -0.3125, -0.1875, 0.1875, 0.3125, 0.1875}, -- pulley
+ {-0.1875, -0.25, -0.25, 0.1875, 0.25, 0.25}, -- pulley_core
+ {-0.25, -0.5, -0.125, -0.1875, 0.125, 0.125}, -- support
+ {0.1875, -0.5, -0.125, 0.25, 0.125, 0.125}, -- support
+ },
+ --selection = {-0.1875, -0.5, -0.3125, 0.1875, 0.3125, 0.3125}, -- selection
+ tiles = 2,
+},
+{
+ node={
+ {-0.25, -0.1875, -0.3125, 0.25, 0.1875, 0.3125}, -- pulley
+ {-0.25, -0.3125, -0.1875, 0.25, 0.3125, 0.1875}, -- pulley
+ {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, -- pulley_core
+ {-0.3125, -0.5, -0.125, -0.25, 0.125, 0.125}, -- support
+ {0.25, -0.5, -0.125, 0.3125, 0.125, 0.125}, -- support
+ },
+ --selection = {-0.3125, -0.5, -0.3125, 0.3125, 0.3125, 0.3125}, -- selection
+ tiles = 3,
+},
+{
+ node={
+ {-0.3125, -0.1875, -0.3125, 0.3125, 0.1875, 0.3125}, -- pulley
+ {-0.3125, -0.3125, -0.1875, 0.3125, 0.3125, 0.1875}, -- pulley
+ {-0.3125, -0.25, -0.25, 0.3125, 0.25, 0.25}, -- pulley_core
+ {-0.375, -0.5, -0.125, -0.3125, 0.125, 0.125}, -- support
+ {0.3125, -0.5, -0.125, 0.375, 0.125, 0.125}, -- support
+ },
+ --selection = {-0.375, -0.5, -0.3125, 0.375, 0.3125, 0.3125}, -- selection
+ tiles = 4,
+},
+{
+ node={
+ {-0.375, -0.1875, -0.3125, 0.375, 0.1875, 0.3125}, -- pulley
+ {-0.375, -0.3125, -0.1875, 0.375, 0.3125, 0.1875}, -- pulley
+ {-0.375, -0.25, -0.25, 0.375, 0.25, 0.25}, -- pulley_core
+ {-0.4375, -0.5, -0.125, -0.375, 0.125, 0.125}, -- support
+ {0.375, -0.5, -0.125, 0.4375, 0.125, 0.125}, -- support
+ },
+ --selection_bottom = {-0.4375, -0.5, -0.3125, 0.4375, 0.3125, 0.3125}, -- selection
+ tiles = 5,
+}
+}
+
+local function register_rope_block(multiple, max_multiple, name_prefix, node_prefix, tint, flammable)
+ local node_name = string.format("ropes:%s%irope_block", node_prefix, multiple)
+ local rope_block_def = {
+ description = S("@1 Ropebox @2m", name_prefix, ropes.ropeLength*multiple),
+ _doc_items_create_entry = false,
+ drawtype="nodebox",
+ sunlight_propagates = true,
+ paramtype = "light",
+ paramtype2 = "wallmounted",
+ walkable = false,
+ climbable = true,
+ tiles = rope_box_tiles(rope_box_data[multiple].tiles, tint),
+ node_box = {
+ type = "fixed",
+ fixed = rope_box_data[multiple].node
+ },
+ selection_box = {type="regular"},
+ collision_box = {type="regular"},
+ groups = {choppy=2, oddly_breakable_by_hand=1, rope_block = 1},
+
+ after_place_node = function(pos, placer)
+ local pos_below = {x=pos.x, y=pos.y-1, z=pos.z}
+ local placer_name = placer:get_player_name()
+
+ if minetest.is_protected(pos_below, placer_name) and not minetest.check_player_privs(placer, "protection_bypass") then
+ return
+ end
+
+ local node_below = minetest.get_node(pos_below)
+ if node_below.name == "air" then
+ minetest.add_node(pos_below, {name="ropes:rope_bottom"})
+ local meta = minetest.get_meta(pos_below)
+ meta:set_int("length_remaining", ropes.ropeLength*multiple)
+ meta:set_string("placer", placer:get_player_name())
+ end
+ end,
+
+ after_destruct = function(pos)
+ local pos_below = {x=pos.x, y=pos.y-1, z=pos.z}
+ ropes.destroy_rope(pos_below, {'ropes:rope', 'ropes:rope_bottom'})
+ end
+ }
+
+ -- If this number is higher than permitted, we still want to register the block (in case
+ -- some were already placed in-world) but we want to hide it from creative inventory
+ -- and if someone digs it we want to disintegrate it into its component parts to prevent
+ -- reuse.
+ if multiple > max_multiple then
+ rope_block_def.groups.not_in_creative_inventory = 1
+ rope_block_def.drop = string.format("ropes:%s1rope_block %i", node_prefix, multiple)
+ end
+
+ if flammable then
+ rope_block_def.groups.flammable = flammable
+
+ minetest.register_craft({
+ type = "fuel",
+ recipe = node_name,
+ burntime = ropes.rope_burn_time * multiple + ropes.wood_burn_time,
+ })
+ end
+
+ minetest.register_node(node_name, rope_block_def)
+
+ if (multiple ~= 1) then
+ -- Only register a recipe to craft this if it's within the permitted multiple range
+ if multiple <= max_multiple then
+ for i = 1, multiple-1 do
+ local rec = {string.format("ropes:%s%irope_block", node_prefix, i)}
+ for n = 1, multiple-i do
+ table.insert(rec, "ropes:ropesegment")
+ end
+ minetest.register_craft({
+ output = node_name,
+ type = "shapeless",
+ recipe = rec
+ })
+ end
+ end
+
+ -- Always allow players to disintegrate this into component parts, in case
+ -- there were some in inventory and the setting was changed.
+ minetest.register_craft({
+ output = "ropes:ropesegment",
+ type = "shapeless",
+ recipe = {
+ node_name
+ },
+ replacements = {
+ {node_name, string.format('ropes:%s%irope_block', node_prefix, multiple-1)},
+ },
+ })
+ end
+
+ if minetest.get_modpath("doc") then
+ doc.add_entry_alias("nodes", "ropes:rope", "nodes", node_name)
+ end
+end
+
+local rope_def = {
+ description = S("Rope"),
+ _doc_items_longdesc = ropes.doc.ropebox_longdesc,
+ _doc_items_usagehelp = ropes.doc.ropebox_usage,
+ walkable = false,
+ climbable = true,
+ sunlight_propagates = true,
+ paramtype = "light",
+ drop = "",
+ tiles = { "ropes_3.png", "ropes_3.png", "ropes_3.png", "ropes_3.png", "ropes_5.png", "ropes_5.png" },
+ groups = {choppy=2, flammable=2, not_in_creative_inventory=1},
+ sounds = default.node_sound_leaves_defaults(),
+ sounds = {
+ footstep = "ropes_creak",
+ dig = "__group",
+ dug = "__group",
+ },
+ drawtype = "nodebox",
+ node_box = {
+ type = "connected",
+ fixed = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
+ connect_top = {-1/16, 1/2, -1/16, 1/16, 3/4, 1/16}
+ },
+ connects_to = {"group:rope_block"},
+ connect_sides = {"top"},
+ selection_box = {
+ type = "fixed",
+ fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8},
+ },
+ after_destruct = function(pos)
+ ropes.hanging_after_destruct(pos, "ropes:rope_top", "ropes:rope", "ropes:rope_bottom")
+ end,
+}
+
+local rope_extension_timer = ropes.make_rope_on_timer("ropes:rope")
+
+local rope_bottom_def = {
+ description = S("Rope"),
+ _doc_items_create_entry = false,
+ walkable = false,
+ climbable = true,
+ sunlight_propagates = true,
+ paramtype = "light",
+ drop = "",
+ tiles = { "ropes_3.png", "ropes_3.png", "ropes_3.png", "ropes_3.png", "ropes_5.png", "ropes_5.png" },
+ drawtype = "nodebox",
+ groups = {choppy=2, flammable=2, not_in_creative_inventory=1},
+ sounds = {
+ footstep = "ropes_creak",
+ dig = "__group",
+ dug = "__group",
+ },
+ node_box = {
+ type = "connected",
+ fixed = {
+ {-1/16, -3/8, -1/16, 1/16, 1/2, 1/16},
+ {-2/16, -5/16, -2/16, 2/16, -1/16, 2/16},
+ },
+ connect_top = {-1/16, 1/2, -1/16, 1/16, 3/4, 1/16}
+ },
+ connects_to = {"group:rope_block"},
+ connect_sides = {"top"},
+ selection_box = {
+ type = "fixed",
+ fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8},
+ },
+
+ on_construct = function( pos )
+ local timer = minetest.get_node_timer( pos )
+ timer:start( 1 )
+ end,
+
+ on_timer = rope_extension_timer,
+
+ after_destruct = function(pos)
+ ropes.hanging_after_destruct(pos, "ropes:rope_top", "ropes:rope", "ropes:rope_bottom")
+ end,
+}
+
+minetest.register_node("ropes:rope", rope_def)
+minetest.register_node("ropes:rope_bottom", rope_bottom_def)
+
+if ropes.woodRopeBoxMaxMultiple > 0 or ropes.create_all_definitions then
+ if ropes.woodRopeBoxMaxMultiple > 0 then
+ minetest.register_craft({
+ output = "ropes:wood1rope_block",
+ recipe = {
+ {'group:wood'},
+ {'group:vines'}
+ }
+ })
+ end
+ for i = 1,9 do
+ if ropes.woodRopeBoxMaxMultiple >= i or ropes.create_all_definitions then
+ register_rope_block(i, ropes.woodRopeBoxMaxMultiple, S("Wood"), "wood", "#86683a", 2)
+ end
+ end
+end
+
+if ropes.copperRopeBoxMaxMultiple > 0 or ropes.create_all_definitions then
+ if ropes.copperRopeBoxMaxMultiple > 0 then
+ minetest.register_craft({
+ output = "ropes:copper1rope_block",
+ recipe = {
+ {'default:copper_ingot'},
+ {'group:vines'}
+ }
+ })
+ end
+ for i = 1,9 do
+ if ropes.copperRopeBoxMaxMultiple >= i or ropes.create_all_definitions then
+ register_rope_block(i, ropes.copperRopeBoxMaxMultiple, S("Copper"), "copper", "#c88648")
+ end
+ end
+end
+
+if ropes.steelRopeBoxMaxMultiple > 0 or ropes.create_all_definitions then
+ if ropes.steelRopeBoxMaxMultiple > 0 then
+ minetest.register_craft({
+ output = "ropes:steel1rope_block",
+ recipe = {
+ {'default:steel_ingot'},
+ {'group:vines'}
+ }
+ })
+ end
+ for i = 1,9 do
+ if ropes.steelRopeBoxMaxMultiple >= i or ropes.create_all_definitions then
+ register_rope_block(i, ropes.steelRopeBoxMaxMultiple, S("Steel"), "steel", "#ffffff")
+ end
+ end
+end
diff --git a/ropes/screenshot.png b/ropes/screenshot.png
new file mode 100644
index 0000000..1366a4f
--- /dev/null
+++ b/ropes/screenshot.png
Binary files differ
diff --git a/ropes/settingtypes.txt b/ropes/settingtypes.txt
new file mode 100644
index 0000000..242cd76
--- /dev/null
+++ b/ropes/settingtypes.txt
@@ -0,0 +1,37 @@
+#The shortest rope will extend for this many meters. Longer ropes come in
+#multiples of this length.
+#Changing this value will not affect ropes that already exist in-world.
+ropes_rope_length (Rope length) int 50 1 30000
+
+#Rope ladders will extend this far at maximum.
+#Changing this value will not affect rope ladders that already exist in-world.
+#Setting this to 0 disables rope ladders.
+ropes_rope_ladder_length (Rope ladder length) int 50 0 30000
+
+#Sets the maximum length multiple wooden rope box permitted to be crafted.
+#So for example if the rope length is set to 50 and this is set to 2,
+#the longest possible wooden rope box a player can craft has 100 meters of rope.
+#Allowed values run from 0 to 9. 0 disables wood rope boxes.
+ropes_wood_rope_box_max_multiple (Maximum wood_rope box multiple) int 2 0 9
+
+#Sets the maximum length multiple copper rope box permitted to be crafted.
+#So for example if the rope length is set to 50 and this is set to 5,
+#the longest possible copper rope box a player can craft has 250 meters of rope.
+#Allowed values run from 0 to 9. 0 disables copper rope boxes.
+ropes_copper_rope_box_max_multiple (Maximum copper rope box multiple) int 5 0 9
+
+#Sets the maximum length multiple steel rope box permitted to be crafted.
+#So for example if the rope length is set to 50 and this is set to 9,
+#the longest possible steel rope box a player can craft has 450 meters of rope.
+#Allowed values run from 0 to 9. 0 disables steel rope boxes.
+ropes_steel_rope_box_max_multiple (Maximum steel rope box multiple) int 9 0 9
+
+#If this is set to true, then the mod will generate definitions for the rope boxes
+#that are otherwise not permitted by the settings above. These rope boxes
+#will not be craftable and will not be available in the creative inventory,
+#but they will continue to exist if they were placed "in world" and a player
+#can deconstruct them to retrieve their rope components. This setting is
+#intended for the situation where you have an established world and you want
+#to reduce the number of rope boxes available to players without turning
+#existing rope boxes into "unknown node"s.
+ropes_create_all_definitions (Create all rope box definitions) bool false \ No newline at end of file
diff --git a/ropes/sounds/license.txt b/ropes/sounds/license.txt
new file mode 100644
index 0000000..c5f29d0
--- /dev/null
+++ b/ropes/sounds/license.txt
@@ -0,0 +1 @@
+ropes_creak.ogg - by jergonda from https://www.freesound.org/people/jergonda/sounds/254735/ under public domain via CC 0 \ No newline at end of file
diff --git a/ropes/sounds/ropes_creak.1.ogg b/ropes/sounds/ropes_creak.1.ogg
new file mode 100644
index 0000000..c6f1b68
--- /dev/null
+++ b/ropes/sounds/ropes_creak.1.ogg
Binary files differ
diff --git a/ropes/sounds/ropes_creak.2.ogg b/ropes/sounds/ropes_creak.2.ogg
new file mode 100644
index 0000000..625083b
--- /dev/null
+++ b/ropes/sounds/ropes_creak.2.ogg
Binary files differ
diff --git a/ropes/sounds/ropes_creak.3.ogg b/ropes/sounds/ropes_creak.3.ogg
new file mode 100644
index 0000000..c52876b
--- /dev/null
+++ b/ropes/sounds/ropes_creak.3.ogg
Binary files differ
diff --git a/ropes/textures/ropes_1.png b/ropes/textures/ropes_1.png
new file mode 100644
index 0000000..6172d67
--- /dev/null
+++ b/ropes/textures/ropes_1.png
Binary files differ
diff --git a/ropes/textures/ropes_2.png b/ropes/textures/ropes_2.png
new file mode 100644
index 0000000..ef361cb
--- /dev/null
+++ b/ropes/textures/ropes_2.png
Binary files differ
diff --git a/ropes/textures/ropes_3.png b/ropes/textures/ropes_3.png
new file mode 100644
index 0000000..a7dd7c8
--- /dev/null
+++ b/ropes/textures/ropes_3.png
Binary files differ
diff --git a/ropes/textures/ropes_4.png b/ropes/textures/ropes_4.png
new file mode 100644
index 0000000..c67d74f
--- /dev/null
+++ b/ropes/textures/ropes_4.png
Binary files differ
diff --git a/ropes/textures/ropes_5.png b/ropes/textures/ropes_5.png
new file mode 100644
index 0000000..3a40d58
--- /dev/null
+++ b/ropes/textures/ropes_5.png
Binary files differ
diff --git a/ropes/textures/ropes_item.png b/ropes/textures/ropes_item.png
new file mode 100644
index 0000000..6f53f82
--- /dev/null
+++ b/ropes/textures/ropes_item.png
Binary files differ
diff --git a/ropes/textures/ropes_ropebox_front_1.png b/ropes/textures/ropes_ropebox_front_1.png
new file mode 100644
index 0000000..23b6067
--- /dev/null
+++ b/ropes/textures/ropes_ropebox_front_1.png
Binary files differ
diff --git a/ropes/textures/ropes_ropebox_front_2.png b/ropes/textures/ropes_ropebox_front_2.png
new file mode 100644
index 0000000..ee8c471
--- /dev/null
+++ b/ropes/textures/ropes_ropebox_front_2.png
Binary files differ
diff --git a/ropes/textures/ropes_ropebox_front_3.png b/ropes/textures/ropes_ropebox_front_3.png
new file mode 100644
index 0000000..4e420cd
--- /dev/null
+++ b/ropes/textures/ropes_ropebox_front_3.png
Binary files differ
diff --git a/ropes/textures/ropes_ropebox_front_4.png b/ropes/textures/ropes_ropebox_front_4.png
new file mode 100644
index 0000000..cc0a10a
--- /dev/null
+++ b/ropes/textures/ropes_ropebox_front_4.png
Binary files differ
diff --git a/ropes/textures/ropes_ropebox_front_5.png b/ropes/textures/ropes_ropebox_front_5.png
new file mode 100644
index 0000000..e6eab8b
--- /dev/null
+++ b/ropes/textures/ropes_ropebox_front_5.png
Binary files differ
diff --git a/ropes/textures/ropes_ropebox_side.png b/ropes/textures/ropes_ropebox_side.png
new file mode 100644
index 0000000..37cfa10
--- /dev/null
+++ b/ropes/textures/ropes_ropebox_side.png
Binary files differ
diff --git a/ropes/textures/ropes_ropeladder.png b/ropes/textures/ropes_ropeladder.png
new file mode 100644
index 0000000..e27a55c
--- /dev/null
+++ b/ropes/textures/ropes_ropeladder.png
Binary files differ
diff --git a/ropes/textures/ropes_ropeladder_bottom.png b/ropes/textures/ropes_ropeladder_bottom.png
new file mode 100644
index 0000000..71f91b0
--- /dev/null
+++ b/ropes/textures/ropes_ropeladder_bottom.png
Binary files differ
diff --git a/ropes/textures/ropes_ropeladder_top.png b/ropes/textures/ropes_ropeladder_top.png
new file mode 100644
index 0000000..81a31ce
--- /dev/null
+++ b/ropes/textures/ropes_ropeladder_top.png
Binary files differ
diff --git a/technic/machines/supply_converter.lua b/technic/machines/supply_converter.lua
index 0d32439..af10baa 100644
--- a/technic/machines/supply_converter.lua
+++ b/technic/machines/supply_converter.lua
@@ -68,7 +68,15 @@ local run = function(pos, node, run_stage)
-- Machine information
local machine_name = S("Supply Converter")
local meta = minetest.get_meta(pos)
- local enabled = meta:get_string("enabled") ~= "0" and (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0)
+ local enabled = meta:get_string("enabled")
+ if enabled == "" then
+ -- Backwards compatibility
+ minetest.registered_nodes["technic:supply_converter"].on_construct(pos)
+ enabled = true
+ else
+ enabled = enabled == "1"
+ end
+ enabled = enabled and (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0)
local demand = enabled and meta:get_int("power") or 0
local pos_up = {x=pos.x, y=pos.y+1, z=pos.z}
diff --git a/unified_inventory/locale/pt.txt b/unified_inventory/locale/pt.txt
new file mode 100644
index 0000000..28ff76d
--- /dev/null
+++ b/unified_inventory/locale/pt.txt
@@ -0,0 +1,107 @@
+# Translation by Lunovox <lunovox@openmailbox.org>
+
+### api.lua ###
+Digging (by chance) = Cavando (por acaso)
+
+# Template
+### bags.lua ###
+Bags = Bolsas
+Bag @1 = Bolsa @1
+Small Bag = Bolsa Pequena
+Medium Bag = Bolsa Média
+Large Bag = Bolsa Grande
+
+### inernal.lua ###
+First page = Primeira Página
+Back three pages = Voltar 3 Páginas
+Back one page = Voltar 1 Página
+Forward one page = Avançar 1 Página
+Forward three pages = Avançar 3 Páginas
+Last page = Ultima Página
+No matching items = Nenhum item correspondente
+Page = Página
+%s of %s = %s de %s
+Filter = Filtro
+Search = Pesquisar
+Reset search and display everything = Redefinir pesquisa e exibir tudo
+
+### register.lua ###
+Can use the creative inventory = Pode usar o inventário do criativo
+Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally = Força o Unified Inventory a ser exibido no modo Full se o modo Lite estiver configurado globalmente
+Home position set to: %s = Posição inicial definida para: %s
+Time of day set to 6am = Hora do dia definida para 06h
+You don't have the settime priviledge! = Você não tem o privilégio de 'settime'!
+Time of day set to 9pm = Hora do dia ajustada para 21h
+This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. = Este botão foi desativado fora do modo de criativo para evitar o descarte acidental de inventário. \nUse o slot de lixo em vez disso.
+Inventory cleared! = Inventário Apagado!
+Crafting = Artesanato
+Digging = Escavação
+Cooking = Cozimento
+Mixing = Muistura
+Trash: = Lixo:
+Refill: = Recarga:
+Crafting Guide = Guia de Artesanato
+Method: = Método:
+Result: %s = Resultado: %s
+crafting = artesanato
+shapeless crafting = artesanato sem formato
+cooking = cozinhar
+alloy cooking = Cozinhar em liga
+Copy to craft grid: = Copiar para grade de artesanato:
+All = MAX
+Alternate = Alternar
+Crafting Grid = Grade de Artesanato
+Show next recipe = Exibir Próxima Receita
+Show next usage = Mostrar Próxima Utilização
+Show previous recipe = Exibir Receita Anterior
+Show previous usage = Exibir Utilização Anterior
+
+# Shown for huge crafting recipes; try to keep the line length short and use multiple line breaks as needed
+This recipe is too\nlarge to be displayed. = Esta receita é grande \ndemais para ser apresentada.
+
+# %s = group name (e.g. wool)
+Any item belonging to the %s group = Qualquer item pertencente ao grupo '%s'.
+
+# %s = List of “and”-concatenated group names
+Any item belonging to the groups %s = Qualquer item pertencente aos grupos '%s'.
+Recipe %d of %d = Receita %s de %s
+Usage %d of %d = Utilização %s de %s
+No recipes = Sem Receita
+No usages = Sem Utilização
+Result = Resultado
+Ingredient = Ingrediente
+Set time to day = Definir turno para dia
+Set time to night = Definir turno para noite
+Set home position = Definir posição de casa
+Go home = Transportar para Casa
+Clear inventory = Limpar Inventário
+Give me: = Gerado:
+To craft grid: = Para Grade de Artesanato
+
+### group.lua ###
+# Logical connective, example: “Any item belonging to the groups foo and bar”
+\sand\s =
+
+### waypoints.lua ###
+White = Branco
+Yellow = Amarelo
+Red = Vermelho
+Green = Verde
+Blue = Azul
+Waypoints = Apontador de Direção
+Waypoint %d = Apontador de Direção %002
+Waypoint active = Apontador de Direção Ativo
+Waypoint inactive = Apontador de Direção Inativo
+World position = Posição Mundial
+Name = Nome
+HUD text color = Cor de HUD
+Edit waypoint name = Editar Nome de Apontador de Direção
+Rename waypoint = Renomear Apontador de Direção
+Change color of waypoint display = Mudar cor exibida do Apontador de Direção
+Set waypoint to current location = Configurar localização atual do Apontador de Direção
+Make waypoint visible = Fazer Apontador de Direção Visível
+Make waypoint invisible = Fazer Apontador de Direção Invisível
+Disable display of waypoint coordinates = Desativar exibição de coordenadas de Fazer Apontador de Direção
+Enable display of waypoint coordinates = Ativar exibição de coordenadas de Fazer Apontador de Direção
+Finish editing = Edição Finalizada
+Select Waypoint #%d = Seleção de Apontador de Direção #%02d