summaryrefslogtreecommitdiff
path: root/castle_storage
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 /castle_storage
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
Diffstat (limited to 'castle_storage')
-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
17 files changed, 355 insertions, 0 deletions
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