From e1cfd7d7970ccf7674e844a203bf30d06b709afd Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sat, 25 Feb 2017 14:52:02 -0700 Subject: [PATCH] Initial commit This was split out of the venerable Castle mod, https://github.com/minetest-mods/castle, which has been maintained by a long line of distinguished modders. --- .gitattributes | 17 +++++ .gitignore | 47 ++++++++++++ LICENSE | 21 ++++++ README.txt | 15 ++++ depends.txt | 3 + description.txt | 1 + init.lua | 111 +++++++++++++++++++++++++++++ intllib.lua | 45 ++++++++++++ locale/template.pot | 21 ++++++ mod.conf | 1 + textures/castle_shield_back.png | Bin 0 -> 620 bytes textures/castle_shield_front.png | Bin 0 -> 520 bytes textures/castle_shield_front_2.png | Bin 0 -> 701 bytes textures/castle_shield_front_3.png | Bin 0 -> 536 bytes textures/castle_shield_side.png | Bin 0 -> 94 bytes textures/castle_shield_side_2.png | Bin 0 -> 91 bytes textures/castle_shield_side_3.png | Bin 0 -> 101 bytes 17 files changed, 282 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.txt create mode 100644 depends.txt create mode 100644 description.txt create mode 100644 init.lua create mode 100644 intllib.lua create mode 100644 locale/template.pot create mode 100644 mod.conf create mode 100644 textures/castle_shield_back.png create mode 100644 textures/castle_shield_front.png create mode 100644 textures/castle_shield_front_2.png create mode 100644 textures/castle_shield_front_3.png create mode 100644 textures/castle_shield_side.png create mode 100644 textures/castle_shield_side_2.png create mode 100644 textures/castle_shield_side_3.png diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cd2946a --- /dev/null +++ b/.gitignore @@ -0,0 +1,47 @@ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..456d091 --- /dev/null +++ b/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/README.txt b/README.txt new file mode 100644 index 0000000..d058b7a --- /dev/null +++ b/README.txt @@ -0,0 +1,15 @@ +=-=-=-=-=-=-=-=-=-= + +Castles Mod +by: Philipbenr And DanDuncombe + +=-=-=-=-=-=-=-=-=-= + +Licence: MIT + +see: LICENSE + +=-=-=-=-=-=-=-=-=-= + +This mod adds decorative wall-mounted shields + diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..cc455cf --- /dev/null +++ b/depends.txt @@ -0,0 +1,3 @@ +default +dye +intllib? \ No newline at end of file diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..8cd8630 --- /dev/null +++ b/description.txt @@ -0,0 +1 @@ +Adds decorative wall shields diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..0eb0d3d --- /dev/null +++ b/init.lua @@ -0,0 +1,111 @@ +minetest.register_alias("castle:shield", "castle_shields:shield") +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") + +minetest.register_node("castle_shields:shield",{ + description = S("Mounted Shield"), + tiles = {"castle_shield_side.png", "castle_shield_side.png", "castle_shield_side.png", "castle_shield_side.png", "castle_shield_back.png", "castle_shield_front.png"}, + drawtype="nodebox", + paramtype2 = "facedir", + paramtype = "light", + groups={cracky=3}, + sounds = default.node_sound_defaults(), + node_box = { + type = "fixed", + fixed = { + {-0.500000,-0.125000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1 + {-0.437500,-0.312500,0.375000,0.425000,0.500000,0.500000}, --NodeBox 2 + {-0.312500,-0.437500,0.375000,0.312500,0.500000,0.500000}, --NodeBox 3 + {-0.187500,-0.500000,0.375000,0.187500,0.500000,0.500000}, --NodeBox 4 + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.500000,-0.500000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1 + }, + }, +}) + + +minetest.register_craft({ + output = "castle_shields:shield", + recipe = { + {"default:steel_ingot","default:steel_ingot","default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot","default:steel_ingot"}, + {"dye:red", "default:steel_ingot","dye:blue"}, + } +}) + +minetest.register_node("castle_shields:shield_2",{ + description = S("Mounted Shield"), + tiles = {"castle_shield_side_2.png", "castle_shield_side_2.png", "castle_shield_side_2.png", "castle_shield_side_2.png", "castle_shield_back.png", "castle_shield_front_2.png"}, + drawtype="nodebox", + paramtype2 = "facedir", + paramtype = "light", + groups={cracky=3}, + sounds = default.node_sound_defaults(), + node_box = { + type = "fixed", + fixed = { + {-0.500000,-0.125000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1 + {-0.437500,-0.312500,0.375000,0.425000,0.500000,0.500000}, --NodeBox 2 + {-0.312500,-0.437500,0.375000,0.312500,0.500000,0.500000}, --NodeBox 3 + {-0.187500,-0.500000,0.375000,0.187500,0.500000,0.500000}, --NodeBox 4 + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.500000,-0.500000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1 + }, + }, +}) + +minetest.register_craft({ + output = "castle_shields:shield_2", + recipe = { + {"default:steel_ingot","default:steel_ingot","default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot","default:steel_ingot"}, + {"dye:cyan", "default:steel_ingot","dye:yellow"}, + } +}) + +minetest.register_node("castle_shields:shield_3",{ + description = S("Mounted Shield"), + tiles = {"castle_shield_side_3.png", "castle_shield_side_3.png", "castle_shield_side_3.png", "castle_shield_side_3.png", "castle_shield_back.png", "castle_shield_front_3.png"}, + drawtype="nodebox", + paramtype2 = "facedir", + paramtype = "light", + groups={cracky=3}, + sounds = default.node_sound_defaults(), + node_box = { + type = "fixed", + fixed = { + {-0.500000,-0.125000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1 + {-0.437500,-0.312500,0.375000,0.425000,0.500000,0.500000}, --NodeBox 2 + {-0.312500,-0.437500,0.375000,0.312500,0.500000,0.500000}, --NodeBox 3 + {-0.187500,-0.500000,0.375000,0.187500,0.500000,0.500000}, --NodeBox 4 + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.500000,-0.500000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1 + }, + }, +}) + +minetest.register_craft({ + output = "castle_shields:shield_3", + recipe = { + {"default:steel_ingot","default:steel_ingot","default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot","default:steel_ingot"}, + {"dye:grey", "default:steel_ingot","dye:green"}, + } +}) + diff --git a/intllib.lua b/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- 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/locale/template.pot b/locale/template.pot new file mode 100644 index 0000000..bfb347c --- /dev/null +++ b/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 , 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 \n" +"Language-Team: LANGUAGE \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/mod.conf b/mod.conf new file mode 100644 index 0000000..5df74cc --- /dev/null +++ b/mod.conf @@ -0,0 +1 @@ +name = castle_shields diff --git a/textures/castle_shield_back.png b/textures/castle_shield_back.png new file mode 100644 index 0000000000000000000000000000000000000000..53cca18c6bc17095921b463940eb09409a961c82 GIT binary patch literal 620 zcmV-y0+aoTP)xp+c4}p3=acv@zJ-M#f*`0xD(y6a1}sDq z_E~fJZ+;(t{OKo|xt5%3-qsxhDHAfJ00a;fQB~1CyNX(OCc;v<)Vi))DH(w4l8F!z zL=-a@v(Y6*2+<*(&)bPJE$e#PPq}13UKoK35~@s#c8KAdiwo$+rGC+k3Re&lDq3tRyQ4UFa&U}*8aZy@$=Q2?-fd~z4Zb6 z<JwDm|yr-)27>3xV;3T2t1taA6o2ow}FP}A5(X%IyM>7jsz4jrO^KVbJXP*5Py#ffYQr2L7L z5fXnRABuf@yUW{mUc~9?H8(RiZ|3wHpafDt0}4oF2yilO7^Ps3@ZwZ`ywO|NjNSwa zAQzgF@q%u`kcU0S=nuWVmSyKlqf7qugF2a%dH=FCTjp?x_koZJG>rrwC`52mjK0yh%r`Duw`J;mREAHb=vzfUymI*O z7=2~!jJ4gish^>`51cTe%OnveopuUeWAKG0y}W*q@v?Un#z~&6IubNX<%|Sdq6K zK}qwosC`=!lqP+TP3I;7&1g%>Xfsl)W&_EE1Xi=*c zfe_TdkWp5Xi=sbpB}q&z3c~&v`~L1Z=l%0}2+qBpn&@pZ>ab}vh8Tll00#gE_m(Ay zX0DxS9&hd;Qnw)Y^< zXk1h42o6w9-LzMpPq9V&^yv#PZ67D<@co@fF0H*c;GG}+x!xa;A$Cp_0On@Ns!bQs z_{)>$XSLngy`RF}_2XY3-S}+s$>SGJf7@;T^+Y;oOud1lTb)7R<@YDf{=XcrZ=D%U z2CAXov%h@)_o1U#$5#%&diq+ox%(vDV;Z|KT~H}kkGy;{-?g!QcD%A&NF)H@(6tBj z>;DcP`{Dc-51o1H`eM^9l3V# zs|Q{@`Agiqx%T6O&;2`0j{o!~t>&n$&NT$22;hJYfuV`}WqWq?*w1fWy6=_O?tS-< zVfDoIcW@<(ceqePKmbzr1|YbanQBaXhby<%pWUg?@7p?cYCndU?5a`L}f%vjl`eky+hGstZ->REucK>?u>xC5+Tlpb7!h9Ew7zE)rOT z1`{|x#LPhWki4wB49GCNnBb8afHGKrq)Pp za+%lKG3UZWHEVDra(6cCQtFcwL_zBf%v4xz)!H+2E-pgq3B-cV1z)z$s_Nd_CF92|i_7?g!kgu;;+9D+8E!P$Da#C_iu5q<)qP|;=v(*`k-fzf+9v!sd)#&+J*dN+uU zG3LB_AEpgMpa5lFR~9pS(*RU}rp=l))i&of$Lyo`-f=-y3Ax|Dr`B} z=@`~88&@BFwAmmKa^6=-NrQkTJ()$?%(=;Iqz#;_kF*c@A}>T`TcJU`TYHhzr|}k zpU>Ccd#$ye%j6Ak)ojKwbWWQ+I|LBiaX0te^jG>T@PsTFRSHG0B$FAHQV?O0o)MM7 zEM%dmWGgFHRk5nF+}-`uiYlt;-aEa*J) literal 0 HcmV?d00001 diff --git a/textures/castle_shield_side.png b/textures/castle_shield_side.png new file mode 100644 index 0000000000000000000000000000000000000000..8aaa6a9ffc7a7f9beaae745180230c4776cc8735 GIT binary patch literal 94 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~j!2~2Dq<3-vDOFDw$B>F!tOwf#83Y6vHoRz_ seXH2x)e_^35~)_7M}?L-O$i?v3me&c61@0(ff^V*UHx3vIVCg!0N{Tapa1{> literal 0 HcmV?d00001 diff --git a/textures/castle_shield_side_2.png b/textures/castle_shield_side_2.png new file mode 100644 index 0000000000000000000000000000000000000000..07282d258050215da0815a757957ad8c43dc1f38 GIT binary patch literal 91 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~j!2~2Dq<3-vDJ4%A$B>F!$%z@6NeRi$3Swdc oNl8f!4fX#e{{2b(@s+!eVM!>ju!9P-DNr?or>mdKI;Vst0C^V|U;qFB literal 0 HcmV?d00001 diff --git a/textures/castle_shield_side_3.png b/textures/castle_shield_side_3.png new file mode 100644 index 0000000000000000000000000000000000000000..6dc8aeb19f596c3463b5ec6c20ce22ce57bf6c03 GIT binary patch literal 101 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~j!2~2Dq<3-vDIHH2$B>F!tOqwT9x&iJykY5P z&;RvHpU4C}2u@Fn6%!OKX{^qj_2k_pliXj-B0oi&c$D1c0rfF>y85}Sb4q9e01~Pm A!T