]> git.lizzy.rs Git - enderchest.git/commitdiff
Initial Commit
authorElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 11 Dec 2020 16:36:19 +0000 (17:36 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 11 Dec 2020 16:36:19 +0000 (17:36 +0100)
README [new file with mode: 0644]
init.lua [new file with mode: 0644]
mod.conf [new file with mode: 0644]

diff --git a/README b/README
new file mode 100644 (file)
index 0000000..0f71f5d
--- /dev/null
+++ b/README
@@ -0,0 +1,2 @@
+# enderchest
+A dragonfire CSM that allows to to access your Ender Inventory in MineClone2 anytime
diff --git a/init.lua b/init.lua
new file mode 100644 (file)
index 0000000..24f30ff
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,26 @@
+function get_itemslot_bg(x, y, w, h)
+       local out = ""
+       for i = 0, w - 1, 1 do
+               for j = 0, h - 1, 1 do
+                       out = out .."image["..x+i..","..y+j..";1,1;mcl_formspec_itemslot.png]"
+               end
+       end
+       return out
+end
+
+local enderchest_formspec = "size[9,8.75]"..
+       "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", "Ender Chest")).."]"..
+       "list[current_player;enderchest;0,0.5;9,3;]"..
+       get_itemslot_bg(0,0.5,9,3)..
+       "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", "Inventory")).."]"..
+       "list[current_player;main;0,4.5;9,3;9]"..
+       get_itemslot_bg(0,4.5,9,3)..
+       "list[current_player;main;0,7.74;9,1;]"..
+       get_itemslot_bg(0,7.74,9,1)..
+       "listring[current_player;enderchest]"..
+       "listring[current_player;main]"
+
+function minetest.open_enderchest()
+       minetest.show_formspec("enderchest:enderchest", enderchest_formspec)
+end
diff --git a/mod.conf b/mod.conf
new file mode 100644 (file)
index 0000000..4c92c50
--- /dev/null
+++ b/mod.conf
@@ -0,0 +1,3 @@
+name = enderchest
+author = Fleckenstein
+description = A dragonfire CSM that allows to to access your Ender Inventory in MineClone2 anytime