ver. 1.1.2

Fix license, remove npc, fix creative inventory, mobs spawning fix, doc
improve
This commit is contained in:
Maksim Gamarnik 2016-02-19 00:31:22 +02:00
parent 108b5aa536
commit 152d9cfbdb
81 changed files with 713 additions and 1346 deletions

View File

@ -5,17 +5,12 @@ MultiCraft is an Open Source sandbox game inspired by [Minecraft](https://minecr
MultiCraft is based on Minetest project which is developed by a [number of contributors](https://github.com/minetest/minetest/graphs/contributors). MultiCraft is based on Minetest project which is developed by a [number of contributors](https://github.com/minetest/minetest/graphs/contributors).
Copyright (c) 2014-2015 Maksim Gamarnik [MoNTE48] <MoNTE48@mail.ua> & MultiCraft Developement Team. Copyright (c) 2014-2016 Maksim Gamarnik [MoNTE48] <MoNTE48@mail.ua> & MultiCraft Developement Team.
The engine and the game is licensed under LGPLv3 (or higher). Resources games licensed under CC-BY-SA 4.0, unless otherwise stated. The engine and the game is licensed under LGPLv3 (or higher). Resources games licensed under CC-BY-SA 3.0, unless otherwise stated, and also a bit of proprietary code and resources.
You can help in the development. But you should always publish your source code after any changes. You can help in the development. But you should always publish your source code after any changes.
Before any use of source code MultiCraft or any part of you should be familiar with [LGPL-3.0](doc/LGPL-3.0.md). Before any use of source code MultiCraft or any part of you should be familiar with [LGPL-3.0](doc/LGPL-3.0.md) and [Other License.txt](doc/Other%20License.md)
Any code that you push to this repository is automatically licensed as LGPLv3 (or higher) and belongs MultiCraft Project and/or the owner of the project without exception. Any code that you push to this repository is automatically licensed as LGPLv3 (or higher) and belongs MultiCraft Project and/or the owner of the project without exception.
Adding code under another license is possible only by agreement with the owner of the project and the creation of appropriate notes. Adding code under another license is possible only by agreement with the owner of the project and the creation of appropriate notes.
After compiling you need to archive files in assets into three zips - Files.zip, games.zip and worlds.zip.
games.zip must contain "games" folder.
worlds.zip must contain "worlds" folder and "multicraf.conf" text file.
Finally, remaining files must be packed into Files.zip.

View File

@ -1,4 +1,4 @@
Minetest Android port MultiCraft Android version
===================== =====================
Date: 2015 12 16 Date: 2015 12 16
@ -128,3 +128,9 @@ Other things that may be nice to know
e.g.: e.g.:
> make clean_irrlicht > make clean_irrlicht
After compiling you need to archive files in assets into three zips - Files.zip, games.zip and worlds.zip.
games.zip must contain "games" folder.
worlds.zip must contain "worlds" folder and "multicraf.conf" text file.
Finally, remaining files must be packed into Files.zip.

View File

@ -1,21 +1,21 @@
.TH minetest 6 "10 September 2013" "" "" .TH MultiCraft 6 "10 September 2013" "" ""
.SH NAME .SH NAME
minetest, minetestserver \- Multiplayer infinite-world block sandbox MultiCraft, MultiCraftServer \- Multiplayer infinite-world block sandbox
.SH SYNOPSIS .SH SYNOPSIS
.B minetest .B MultiCraft
[\fB--server SERVER OPTIONS\fR | \fBCLIENT OPTIONS\fR] [\fB--server SERVER OPTIONS\fR | \fBCLIENT OPTIONS\fR]
[\fBCOMMON OPTIONS\fR] [\fBCOMMON OPTIONS\fR]
[\fBWORLD PATH\fR] [\fBWORLD PATH\fR]
.B minetestserver .B MultiCraftServer
[\fBSERVER OPTIONS\fR] [\fBSERVER OPTIONS\fR]
[\fBCOMMON OPTIONS\fR] [\fBCOMMON OPTIONS\fR]
[\fBWORLD PATH\fR] [\fBWORLD PATH\fR]
.SH DESCRIPTION .SH DESCRIPTION
.B Minetest .B MultiCraft
is one of the first InfiniMiner/Minecraft(/whatever) inspired games (started October 2010), with a goal of taking the survival multiplayer gameplay to a slightly different direction. is one of the first InfiniMiner/Minecraft(/whatever) inspired games (started October 2010), with a goal of taking the survival multiplayer gameplay to a slightly different direction.
.PP .PP
The main design philosophy is to keep it technically simple, stable and portable. It will be kept lightweight enough to run on fairly old hardware. The main design philosophy is to keep it technically simple, stable and portable. It will be kept lightweight enough to run on fairly old hardware.
@ -95,7 +95,7 @@ Display an interactive terminal over ncurses during execution.
.SH ENVIRONMENT .SH ENVIRONMENT
.TP .TP
.B MINETEST_SUBGAME_PATH .B MULTICRAFT_SUBGAME_PATH
Colon delimited list of directories to search for subgames. Colon delimited list of directories to search for subgames.
.SH BUGS .SH BUGS

View File

@ -1,2 +1,2 @@
.so man6/minetest.6 .so man6/MultiCraft.6

View File

@ -1,5 +1,14 @@
License of Minetest textures and sounds MultiCraft Open Source Project:
---------------------------------------
LGPLv3.0+, CC-BY-SA 3.0 and a little bit proprietary textures. The list in the file nearby.
You can use these textures without restriction within MultiCraft Project.
You can not use them in another project.
They are an integral part of this project and created exclusively for him.
--- --- ---
License of Minetest textures and sounds:
This applies to textures and sounds contained in the main Minetest This applies to textures and sounds contained in the main Minetest
distribution. distribution.
@ -12,17 +21,11 @@ Authors of media files
Everything not listed in here: Everything not listed in here:
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com> Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
BlockMen:
textures/base/pack/menuheader.png
erlehmann: erlehmann:
misc/minetest-icon-24x24.png
misc/minetest-icon.ico
misc/minetest.svg misc/minetest.svg
textures/base/pack/logo.png
License of Minetest source code License of Minetest source code:
-------------------------------
Minetest Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
@ -41,8 +44,9 @@ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc., with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Irrlicht
---------------
Irrlicht:
This program uses the Irrlicht Engine. http://irrlicht.sourceforge.net/ This program uses the Irrlicht Engine. http://irrlicht.sourceforge.net/
@ -99,9 +103,9 @@ Vattic's Terms:
- If I decide I don't want you using stuff from the pack then that is final. This will only be the case in unusual circumstances. - If I decide I don't want you using stuff from the pack then that is final. This will only be the case in unusual circumstances.
- These guidelines can be changed at any time. - These guidelines can be changed at any time.
--- --- ---
JThread JThread:
---------------
This program uses the JThread library. License for JThread follows: This program uses the JThread library. License for JThread follows:
@ -125,8 +129,9 @@ 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 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE. IN THE SOFTWARE.
Lua --- --- ---
---------------
Lua:
Lua is licensed under the terms of the MIT license reproduced below. Lua is licensed under the terms of the MIT license reproduced below.
This means that Lua is free software and can be used for both academic This means that Lua is free software and can be used for both academic
@ -154,8 +159,9 @@ 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
Fonts --- --- ---
---------------
Fonts:
DejaVu Sans Mono: DejaVu Sans Mono:
@ -191,14 +197,8 @@ DroidSansFallback:
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
basis33
basis33 is a fixed-width bitmap font for programming and text editing, which contains Latin, Cyrillic, Greek and Hebrew characters.
Its designed by Manchson basing on Latin-only font Proggy Clean by Tristan Grimmer.
basis33 is free/libre software, you are welcome to redistribute and/or modify it under the terms of MIT/Expat license; see LICENSE for details.
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2004, 2005 Tristan Grimmer Copyright (c) 2004, 2005 Tristan Grimmer
@ -221,3 +221,35 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
--- --- ---
Mod "Dungeon Loot" [dungeon_loot]
=================================
Copyright (c) 2015 BlockMen <blockmen2015@gmail.com>
and Amoeba <amoeba@iki.fi>
In MultiCraft Project this code has been changed:
I changed the drop in a few lines.
=================================
Copyright (c) 2015 BlockMen <blockmen2015@gmail.com>
This software is provided 'as-is', without any express or implied warranty. In no
event will the authors be held liable for any damages arising from the use of
this software.
Permission is granted to anyone to use this software for any purpose, including
commercial applications, and to alter it and redistribute it freely, subject to the
following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software in a
product, an acknowledgment in the product documentation is required.
2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

View File

@ -319,165 +319,4 @@ exit /b 0
:fail :fail
popd popd
echo Failed. echo Failed.
exit /b 1 exit /b 1
License of Minetest textures and sounds
---------------------------------------
This applies to textures and sounds contained in the main Minetest
distribution.
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
-----------------------
Everything not listed in here:
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
BlockMen:
textures/base/pack/menuheader.png
erlehmann:
misc/minetest-icon-24x24.png
misc/minetest-icon.ico
misc/minetest.svg
textures/base/pack/logo.png
License of Minetest source code
-------------------------------
Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3.0 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Irrlicht
---------------
This program uses the Irrlicht Engine. http://irrlicht.sourceforge.net/
The Irrlicht Engine License
Copyright © 2002-2005 Nikolaus Gebhardt
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute
it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
JThread
---------------
This program uses the JThread library. License for JThread follows:
Copyright (c) 2000-2006 Jori Liesenborgs (jori.liesenborgs@gmail.com)
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.
Lua
---------------
Lua is licensed under the terms of the MIT license reproduced below.
This means that Lua is free software and can be used for both academic
and commercial purposes at absolutely no cost.
For details and rationale, see http://www.lua.org/license.html .
Copyright (C) 1994-2008 Lua.org, PUC-Rio.
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.
Fonts
---------------
DejaVu Sans Mono:
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
Bitstream Vera Fonts Copyright:
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
a trademark of Bitstream, Inc.
Arev Fonts Copyright:
Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
Liberation Fonts Copyright:
Copyright (c) 2007 Red Hat, Inc. All rights reserved. LIBERATION is a trademark of Red Hat, Inc.
DroidSansFallback:
Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,7 +1,7 @@
/** @mainpage The Minetest engine internal documentation /** @mainpage The MultiCraft engine internal documentation
Welcome to the Minetest engine Doxygen documentation site!\n Welcome to the MultiCraft engine Doxygen documentation site!\n
This page documents the internal structure of the Minetest engine's C++ code.\n This page documents the internal structure of the MultiCraft engine's C++ code.\n
Use the tree view at the left to navigate. Use the tree view at the left to navigate.
*/ */

View File

@ -1,4 +1,4 @@
Minetest protocol (incomplete, early draft): MultiCraft protocol (incomplete, early draft):
Updated 2011-06-18 Updated 2011-06-18
A custom protocol over UDP. A custom protocol over UDP.

View File

@ -289,11 +289,11 @@ default.player_register_model("3d_armor_character.x", {
minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name() local name = player:get_player_name()
if inventory_plus and fields.armor then --if inventory_plus and fields.armor then
local formspec = armor:get_armor_formspec(name) --local formspec = armor:get_armor_formspec(name)
inventory_plus.set_inventory_formspec(player, formspec) --inventory_plus.set_inventory_formspec(player, formspec)
return --return
end --end
for field, _ in pairs(fields) do for field, _ in pairs(fields) do
if string.find(field, "skins_set_") then if string.find(field, "skins_set_") then
minetest.after(0, function(player) minetest.after(0, function(player)
@ -421,9 +421,9 @@ minetest.register_on_joinplayer(function(player)
for i=1, ARMOR_INIT_TIMES do for i=1, ARMOR_INIT_TIMES do
minetest.after(ARMOR_INIT_DELAY * i, function(player) minetest.after(ARMOR_INIT_DELAY * i, function(player)
armor:set_player_armor(player) armor:set_player_armor(player)
if inventory_plus == nil and unified_inventory == nil then --if inventory_plus == nil and unified_inventory == nil then
--armor:update_inventory(player) --armor:update_inventory(player)
end --end
end, player) end, player)
end end
end) end)

View File

@ -1,2 +0,0 @@
default

View File

@ -1,168 +0,0 @@
--[[
#!#!#!#Cake mod created by Jordan4ibanez#!#!#
#!#!#!#Released under CC Attribution-ShareAlike 3.0 Unported #!#!#
]]--
cake_texture = {"cake_top.png","cake_bottom.png","cake_inner.png","cake_side.png","cake_side.png","cake_side.png"}
slice_1 = { -7/16, -8/16, -7/16, -5/16, 0/16, 7/16}
slice_2 = { -7/16, -8/16, -7/16, -2/16, 0/16, 7/16}
slice_3 = { -7/16, -8/16, -7/16, 1/16, 0/16, 7/16}
slice_4 = { -7/16, -8/16, -7/16, 3/16, 0/16, 7/16}
slice_5 = { -7/16, -8/16, -7/16, 5/16, 0/16, 7/16}
slice_6 = { -7/16, -8/16, -7/16, 7/16, 0/16, 7/16}
minetest.register_craft({
output = "cake:cake",
recipe = {
{'bucket:bucket_water', 'bucket:bucket_water', 'bucket:bucket_water'},
{'default:sugar', 'default:leaves', 'default:sugar'},
{'farming:wheat_harvested', 'farming:wheat_harvested', 'farming:wheat_harvested'},
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}},
})
minetest.register_node("cake:cake", {
description = "Cake",
tiles = {"cake_top.png","cake_bottom.png","cake_side.png","cake_side.png","cake_side.png","cake_side.png"},
paramtype = "light",
drawtype = "nodebox",
selection_box = {
type = "fixed",
fixed = slice_6
},
node_box = {
type = "fixed",
fixed = slice_6
},
is_ground_content = true,
stack_max = 1,
groups = {crumbly=3,falling_node=1, foodstuffs = 1},
drop = '',
--legacy_mineral = true,
on_rightclick = function(pos, node, clicker, itemstack)
if clicker:get_hp() < 20 then
clicker:set_hp(clicker:get_hp()+2)
minetest.add_node(pos,{type="node",name="cake:cake_5",param2=param2})
end
end,
})
minetest.register_node("cake:cake_5", {
description = "Cake [5 Slices Left]",
tiles = cake_texture,
paramtype = "light",
drawtype = "nodebox",
selection_box = {
type = "fixed",
fixed = slice_5
},
node_box = {
type = "fixed",
fixed = slice_5
},
is_ground_content = true,
groups = {crumbly=3,falling_node=1,not_in_creative_inventory=1},
drop = '',
--legacy_mineral = true,
on_rightclick = function(pos, node, clicker, itemstack)
if clicker:get_hp() < 20 then
clicker:set_hp(clicker:get_hp()+2)
minetest.add_node(pos,{type="node",name="cake:cake_4",param2=param2})
end
end,
})
minetest.register_node("cake:cake_4", {
description = "Cake [4 Slices Left]",
tiles = cake_texture,
paramtype = "light",
drawtype = "nodebox",
selection_box = {
type = "fixed",
fixed = slice_4
},
node_box = {
type = "fixed",
fixed = slice_4
},
is_ground_content = true,
groups = {crumbly=3,falling_node=1,not_in_creative_inventory=1},
drop = '',
--legacy_mineral = true,
on_rightclick = function(pos, node, clicker, itemstack)
if clicker:get_hp() < 20 then
clicker:set_hp(clicker:get_hp()+2)
minetest.add_node(pos,{type="node",name="cake:cake_3",param2=param2})
end
end,
})
minetest.register_node("cake:cake_3", {
description = "Cake [3 Slices Left]",
tiles = cake_texture,
paramtype = "light",
drawtype = "nodebox",
selection_box = {
type = "fixed",
fixed = slice_3
},
node_box = {
type = "fixed",
fixed = slice_3
},
is_ground_content = true,
groups = {crumbly=3,falling_node=1,not_in_creative_inventory=1},
drop = '',
--legacy_mineral = true,
on_rightclick = function(pos, node, clicker, itemstack)
if clicker:get_hp() < 20 then
clicker:set_hp(clicker:get_hp()+2)
minetest.add_node(pos,{type="node",name="cake:cake_2",param2=param2})
end
end,
})
minetest.register_node("cake:cake_2", {
description = "Cake [2 Slices Left]",
tiles = cake_texture,
paramtype = "light",
drawtype = "nodebox",
selection_box = {
type = "fixed",
fixed = slice_2
},
node_box = {
type = "fixed",
fixed = slice_2
},
is_ground_content = true,
groups = {crumbly=3,falling_node=1,not_in_creative_inventory=1},
drop = '',
--legacy_mineral = true,
on_rightclick = function(pos, node, clicker, itemstack)
if clicker:get_hp() < 20 then
clicker:set_hp(clicker:get_hp()+2)
minetest.add_node(pos,{type="node",name="cake:cake_1",param2=param2})
end
end,
})
minetest.register_node("cake:cake_1", {
description = "Cake [1 Slice Left]",
tiles = cake_texture,
paramtype = "light",
drawtype = "nodebox",
selection_box = {
type = "fixed",
fixed = slice_1
},
node_box = {
type = "fixed",
fixed = slice_1
},
is_ground_content = true,
groups = {crumbly=3,falling_node=1,not_in_creative_inventory=1},
drop = '',
--legacy_mineral = true,
on_rightclick = function(pos, node, clicker, itemstack)
if clicker:get_hp() < 20 then
clicker:set_hp(clicker:get_hp()+2)
minetest.remove_node(pos)
end
end,
})

View File

@ -1,34 +1,34 @@
multicraft mod "Crafting" multicraft mod "Crafting"
======================= =======================
Version: 2.0.1 Version: 2.0.1
License of source code and Textures: WTFPL License of source code and Textures: WTFPL
------------------------------------ ------------------------------------
copyright (c) 2013-2014 by BlockMen copyright (c) 2013-2014 by BlockMen
This program is free software. It comes without any warranty, to This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details. http://sam.zoy.org/wtfpl/COPYING for more details.
--USING the mod-- --USING the mod--
================= =================
This mod changes the players inventory (survival and creative) with more slots (9*4 instead of 8*4) This mod changes the players inventory (survival and creative) with more slots (9*4 instead of 8*4)
Like known from Minecraft you have a 2x2 crafting grid at inventory now. Furthermore a categorized creative Like known from Minecraft you have a 2x2 crafting grid at inventory now. Furthermore a categorized creative
inventory and a support for stu's 3d armor mod (To use the armor and a preview of player). inventory and a support for stu's 3d armor mod (To use the armor and a preview of player).
Left items in the crafting slots are dropped infront of you. Left items in the crafting slots are dropped infront of you.
Workbench Workbench
_________ _________
With following recipe you craft a workbench (aka crafting table): With following recipe you craft a workbench (aka crafting table):
wood wood wood wood
wood wood wood wood
The workbench has a 3x3 crafting grid, that allows to use all recipes. The workbench has a 3x3 crafting grid, that allows to use all recipes.

View File

@ -1,398 +1,340 @@
crafting = {} crafting = {}
crafting.creative_inventory_size = 0 crafting.creative_inventory_size = 0
crafting.start_is = {} crafting.start_is = {}
crafting.pages = {} crafting.pages = {}
function init() function init()
local inv = minetest.create_detached_inventory("creative", { local inv = minetest.create_detached_inventory("creative", {
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player) allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
if minetest.setting_getbool("creative_mode") then return count
return count end,
else allow_put = function(inv, listname, index, stack, player)
return 0 return 0
end end,
end, allow_take = function(inv, listname, index, stack, player)
allow_put = function(inv, listname, index, stack, player) return -1
return 0 end,
end, on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
allow_take = function(inv, listname, index, stack, player) end,
if minetest.setting_getbool("creative_mode") then on_put = function(inv, listname, index, stack, player)
return -1 end,
else on_take = function(inv, listname, index, stack, player)
return 0 print(player:get_player_name().." takes item from creative inventory; listname="..dump(listname)..", index="..dump(index)..", stack="..dump(stack))
end if stack then
end, print("stack:get_name()="..dump(stack:get_name())..", stack:get_count()="..dump(stack:get_count()))
on_move = function(inv, from_list, from_index, to_list, to_index, count, player) end
end, end,
on_put = function(inv, listname, index, stack, player) })
end, set_inv("all")
on_take = function(inv, listname, index, stack, player) end
print(player:get_player_name().." takes item from creative inventory; listname="..dump(listname)..", index="..dump(index)..", stack="..dump(stack))
if stack then function set_inv(filter, player)
print("stack:get_name()="..dump(stack:get_name())..", stack:get_count()="..dump(stack:get_count())) local inv = minetest.get_inventory({type="detached", name="creative"})
end inv:set_size("main", 0)
end, local creative_list = {}
}) for name,def in pairs(minetest.registered_items) do
set_inv("all") if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then
end if filter ~= "" then
if filter == "#blocks" then
function set_inv(filter, player) if minetest.registered_items[def.name]
local inv = minetest.get_inventory({type="detached", name="creative"}) and minetest.registered_items[def.name].groups
inv:set_size("main", 0) and minetest.registered_items[def.name].groups.building
local creative_list = {} then
for name,def in pairs(minetest.registered_items) do table.insert(creative_list, name)
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then end
if filter ~= "" then elseif filter == "#deco" then
if filter == "#blocks" then if minetest.registered_items[def.name]
if minetest.registered_items[def.name] and minetest.registered_items[def.name].groups
and minetest.registered_items[def.name].groups and minetest.registered_items[def.name].groups.decorative
and minetest.registered_items[def.name].groups.building then
then table.insert(creative_list, name)
table.insert(creative_list, name) end
end elseif filter == "#mese" then
elseif filter == "#deco" then if minetest.registered_items[def.name]
if minetest.registered_items[def.name] and minetest.registered_items[def.name].groups
and minetest.registered_items[def.name].groups and minetest.registered_items[def.name].groups.mese
and minetest.registered_items[def.name].groups.decorative then
then table.insert(creative_list, name)
table.insert(creative_list, name) end
end elseif filter == "#rail" then
elseif filter == "#mese" then if minetest.registered_items[def.name]
if minetest.registered_items[def.name] and minetest.registered_items[def.name].groups
and minetest.registered_items[def.name].groups and minetest.registered_items[def.name].groups.rail
and minetest.registered_items[def.name].groups.mese then
then table.insert(creative_list, name)
table.insert(creative_list, name) end
end elseif filter == "#misc" then
elseif filter == "#rail" then if minetest.registered_items[def.name]
if minetest.registered_items[def.name] and minetest.registered_items[def.name].groups
and minetest.registered_items[def.name].groups and minetest.registered_items[def.name].groups.misc
and minetest.registered_items[def.name].groups.rail then
then table.insert(creative_list, name)
table.insert(creative_list, name) end
end elseif filter == "#food" then
elseif filter == "#misc" then if minetest.registered_items[def.name]
if minetest.registered_items[def.name] and minetest.registered_items[def.name].groups
and minetest.registered_items[def.name].groups and minetest.registered_items[def.name].groups.foodstuffs
and minetest.registered_items[def.name].groups.misc then
then table.insert(creative_list, name)
table.insert(creative_list, name) end
end elseif filter == "#tools" then
elseif filter == "#food" then if minetest.registered_items[def.name]
if minetest.registered_items[def.name] and minetest.registered_items[def.name].groups
and minetest.registered_items[def.name].groups and minetest.registered_items[def.name].groups.tools
and minetest.registered_items[def.name].groups.foodstuffs then
then table.insert(creative_list, name)
table.insert(creative_list, name) end
end elseif filter == "#combat" then
elseif filter == "#tools" then if minetest.registered_items[def.name]
if minetest.registered_items[def.name] and minetest.registered_items[def.name].groups
and minetest.registered_items[def.name].groups and minetest.registered_items[def.name].groups.combat
and minetest.registered_items[def.name].groups.tools then
then table.insert(creative_list, name)
table.insert(creative_list, name) end
end elseif filter == "#matr" then
elseif filter == "#combat" then if minetest.registered_items[def.name]
if minetest.registered_items[def.name] and minetest.registered_items[def.name].groups
and minetest.registered_items[def.name].groups and minetest.registered_items[def.name].groups.materials
and minetest.registered_items[def.name].groups.combat then
then table.insert(creative_list, name)
table.insert(creative_list, name) end
end elseif filter == "#brew" then
elseif filter == "#matr" then if minetest.registered_items[def.name]
if minetest.registered_items[def.name] and minetest.registered_items[def.name].groups
and minetest.registered_items[def.name].groups and minetest.registered_items[def.name].groups.brewing
and minetest.registered_items[def.name].groups.materials then
then table.insert(creative_list, name)
table.insert(creative_list, name) end
end elseif filter == "all" then
elseif filter == "#brew" then table.insert(creative_list, name)
if minetest.registered_items[def.name] else --for all other
and minetest.registered_items[def.name].groups if string.find(string.lower(def.name), filter) or string.find(string.lower(def.description), filter) then
and minetest.registered_items[def.name].groups.brewing table.insert(creative_list, name)
then end
table.insert(creative_list, name) end
end end
elseif filter == "all" then end
table.insert(creative_list, name) end
else --for all other table.sort(creative_list)
if string.find(string.lower(def.name), filter) or string.find(string.lower(def.description), filter) then inv:set_size("main", #creative_list)
table.insert(creative_list, name) for _,itemstring in ipairs(creative_list) do
end inv:add_item("main", ItemStack(itemstring))
end end
end crafting.creative_inventory_size = #creative_list
end --print("creative inventory size: "..dump(crafting.creative_inventory_size))
end end
table.sort(creative_list)
inv:set_size("main", #creative_list) -- Create the trash field
for _,itemstring in ipairs(creative_list) do local trash = minetest.create_detached_inventory("creative_trash", {
inv:add_item("main", ItemStack(itemstring)) allow_put = function(inv, listname, index, stack, player)
end return stack:get_count()
crafting.creative_inventory_size = #creative_list end,
--print("creative inventory size: "..dump(crafting.creative_inventory_size)) on_put = function(inv, listname, index, stack, player)
end inv:set_stack(listname, index, "")
end,
-- Create the trash field })
local trash = minetest.create_detached_inventory("creative_trash", { trash:set_size("main", 1)
allow_put = function(inv, listname, index, stack, player)
if minetest.setting_getbool("creative_mode") then
return stack:get_count() -- Create detached creative inventory after loading all mods
else minetest.after(0.5, init)
return 0
end local offset = {}
end, local hoch = {}
on_put = function(inv, listname, index, stack, player) local bg = {}
inv:set_stack(listname, index, "") offset["blocks"] = "-0.29,-0.25"
end, offset["deco"] = "0.98,-0.25"
}) offset["mese"] = "2.23,-0.25"
trash:set_size("main", 1) offset["rail"] = "3.495,-0.25"
offset["misc"] = "4.75,-0.25"
offset["nix"] = "8.99,-0.25"
-- Create detached creative inventory after loading all mods offset["food"] = "-0.29,8.12"
minetest.after(0, init) offset["tools"] = "0.98,8.12"
offset["combat"] = "2.23,8.12"
local offset = {} offset["brew"] = "4.78,8.12"
local hoch = {} offset["matr"] = "3.495,8.12"
local bg = {} offset["inv"] = "8.99,8.12"
offset["blocks"] = "-0.29,-0.25"
offset["deco"] = "0.98,-0.25" hoch["blocks"] = ""
offset["mese"] = "2.23,-0.25" hoch["deco"] = ""
offset["rail"] = "3.495,-0.25" hoch["mese"] = ""
offset["misc"] = "4.75,-0.25" hoch["rail"] = ""
offset["nix"] = "8.99,-0.25" hoch["misc"] = ""
offset["food"] = "-0.29,8.12" hoch["nix"] = ""
offset["tools"] = "0.98,8.12" hoch["food"] = "^[transformfy"
offset["combat"] = "2.23,8.12" hoch["tools"] = "^[transformfy"
offset["brew"] = "4.78,8.12" hoch["combat"] = "^[transformfy"
offset["matr"] = "3.495,8.12" hoch["brew"] = "^[transformfy"
offset["inv"] = "8.99,8.12" hoch["matr"] = "^[transformfy"
hoch["inv"] = "^[transformfy"
hoch["blocks"] = ""
hoch["deco"] = "" local dark_bg = "crafting_creative_bg_dark.png"
hoch["mese"] = ""
hoch["rail"] = "" local function reset_menu_item_bg()
hoch["misc"] = "" bg["blocks"] = dark_bg
hoch["nix"] = "" bg["deco"] = dark_bg
hoch["food"] = "^[transformfy" bg["mese"] = dark_bg
hoch["tools"] = "^[transformfy" bg["rail"] = dark_bg
hoch["combat"] = "^[transformfy" bg["misc"] = dark_bg
hoch["brew"] = "^[transformfy" bg["nix"] = dark_bg
hoch["matr"] = "^[transformfy" bg["food"] = dark_bg
hoch["inv"] = "^[transformfy" bg["tools"] = dark_bg
bg["combat"] = dark_bg
local dark_bg = "crafting_creative_bg_dark.png" bg["brew"] = dark_bg
bg["matr"] = dark_bg
local function reset_menu_item_bg() bg["inv"] = dark_bg
bg["blocks"] = dark_bg end
bg["deco"] = dark_bg
bg["mese"] = dark_bg
bg["rail"] = dark_bg crafting.set_creative_formspec = function(player, start_i, pagenum, show, page, scroll)
bg["misc"] = dark_bg reset_menu_item_bg()
bg["nix"] = dark_bg pagenum = math.floor(pagenum) or 1
bg["food"] = dark_bg local pagemax = math.floor((crafting.creative_inventory_size-1) / (9*5) + 1)
bg["tools"] = dark_bg local slider_height = 4/pagemax
bg["combat"] = dark_bg local slider_pos = slider_height*(pagenum-1)+2.2
bg["brew"] = dark_bg local player_name = player:get_player_name()
bg["matr"] = dark_bg crafting.start_is[player_name] = start_i
bg["inv"] = dark_bg crafting.pages[player_name] = page
end local name = "nix"
local formspec = ""
local main_list = "list[detached:creative;main;0,1.75;9,5;"..tostring(start_i).."]"
crafting.set_creative_formspec = function(player, start_i, pagenum, show, page, scroll) if page ~= nil then name = page end
reset_menu_item_bg() bg[name] = "crafting_creative_bg.png"
pagenum = math.floor(pagenum) or 1 if name == "inv" then
local pagemax = math.floor((crafting.creative_inventory_size) / (9*5) + 1) main_list = "image[-0.2,1.7;11.35,2.33;crafting_creative_bg.png]"..
local slider_height = 4/pagemax "image[-0.3,0.15;3,4;crafting_inventory_armor2.png]"..
local slider_pos = slider_height*(pagenum-1)+2.2 "list[current_player;main;0,3.75;9,3;9]"..
local player_name = player:get_player_name()
crafting.start_is[player_name] = start_i "list[detached:"..player_name.."_armor;armor;0,1.55;1,1;]"..
crafting.pages[player_name] = page "list[detached:"..player_name.."_armor;armor;0,2.55;1,1;1]"..
local formspec = "" "list[detached:"..player_name.."_armor;armor;1,1.55;1,1;2]"..
local main_list = "list[detached:creative;main;0,1.75;9,5;"..tostring(start_i).."]" "list[detached:"..player_name.."_armor;armor;1,2.55;1,1;3]"
local name = "nix" end
if page ~= nil then name = page end formspec = "size[10,9.3]"..
bg[name] = "crafting_creative_bg.png" "image_button_exit[10,0;1,1;;exit;X;true;true;]"..
if name == "inv" then "background[-0.19,-0.25;10.5,9.87;crafting_inventory_creative.png]"..
main_list = "image[-0.2,1.7;11.35,2.33;crafting_creative_bg.png]".. "bgcolor[#080808BB;true]"..
"image[-0.3,0.15;3,4;crafting_inventory_armor2.png]".. "listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]"..
"list[current_player;main;0,3.75;9,3;9]".. "label[-5,-5;"..name.."]"..
"image[" .. offset[name] .. ";1.5,1.44;crafting_creative_active.png"..hoch[name].."]"..
"list[detached:"..player_name.."_armor;armor;0,1.55;1,1;]".. "image_button[-0.1,0;1,1;"..bg["blocks"].."^crafting_creative_build.png;build;]".. --build blocks
"list[detached:"..player_name.."_armor;armor;0,2.55;1,1;1]".. "image_button[1.15,0;1,1;"..bg["deco"].."^crafting_creative_deko.png;deco;]".. --decoration blocks
"list[detached:"..player_name.."_armor;armor;1,1.55;1,1;2]".. "image_button[2.415,0;1,1;"..bg["mese"].."^crafting_creative_mese.png;mese;]".. --bluestone
"list[detached:"..player_name.."_armor;armor;1,2.55;1,1;3]" "image_button[3.693,0;1,1;"..bg["rail"].."^crafting_creative_rail.png;rail;]".. --transportation
end "image_button[4.93,0;1,1;"..bg["misc"].."^crafting_creative_misc.png;misc;]".. --miscellaneous
formspec = "size[10,9.3]".. "image_button[9.19,0;1,1;"..bg["nix"].."^crafting_creative_all.png;default;]".. --search
"image_button_exit[10,0;1,1;;exit;X;true;true;]".. "image[0,1;5,0.75;fnt_"..name..".png]"..
"background[-0.19,-0.25;10.5,9.87;crafting_inventory_creative.png]".. "list[current_player;main;0,7;9,1;]"..
"bgcolor[#080808BB;true]".. main_list..
"listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]".. "image_button[9.03,1.74;0.85,0.6;crafting_creative_up.png;creative_prev;]"..
"label[-5,-5;"..name.."]".. "image[9.04," .. tostring(slider_pos) .. ";0.75,"..tostring(slider_height) .. ";crafting_slider.png]"..
"image[" .. offset[name] .. ";1.5,1.44;crafting_creative_active.png"..hoch[name].."]".. "image_button[9.03,6.15;0.85,0.6;crafting_creative_down.png;creative_next;]"..
"image_button[-0.1,0;1,1;"..bg["blocks"].."^crafting_creative_build.png;build;]".. --build blocks "image_button[-0.1,8.28;1,1;"..bg["food"].."^crafting_food.png;food;]".. --foodstuff
"image_button[1.15,0;1,1;"..bg["deco"].."^crafting_creative_deko.png;deco;]".. --decoration blocks "image_button[1.15,8.28;1,1;"..bg["tools"].."^crafting_creative_tool.png;tools;]".. --tools
"image_button[2.415,0;1,1;"..bg["mese"].."^crafting_creative_mese.png;mese;]".. --bluestone "image_button[2.415,8.28;1,1;"..bg["combat"].."^crafting_creative_sword.png;combat;]".. --combat
"image_button[3.693,0;1,1;"..bg["rail"].."^crafting_creative_rail.png;rail;]".. --transportation "image_button[3.693,8.28;1,1;"..bg["matr"].."^crafting_creative_matr.png;matr;]".. --brewing
"image_button[4.93,0;1,1;"..bg["misc"].."^crafting_creative_misc.png;misc;]".. --miscellaneous "image_button[4.93,8.28;1,1;"..bg["brew"].."^crafting_inventory_brew.png;brew;]".. --materials^
"image_button[9.19,0;1,1;"..bg["nix"].."^crafting_creative_all.png;default;]".. --search "image_button[9.19,8.28;1,1;"..bg["inv"].."^crafting_creative_inv.png;inv;]".. --inventory
"image[0,1;5,0.75;fnt_"..name..".png]".. "list[detached:creative_trash;main;9,7;1,1;]"..
"list[current_player;main;0,7;9,1;]".. "image[9,7;1,1;crafting_creative_trash.png]"
main_list..
"image_button[9.03,1.74;0.85,0.6;crafting_creative_up.png;creative_prev;]".. if name == "nix" then formspec = formspec .. "field[5.3,1.3;4,0.75;suche;;]" end
"image_button[9.03,6.15;0.85,0.6;crafting_creative_down.png;creative_next;]".. if pagenum ~= nil then formspec = formspec .. "p"..tostring(pagenum) end
"image_button[-0.1,8.28;1,1;"..bg["food"].."^crafting_food.png;food;]".. --foodstuff
"image_button[1.15,8.28;1,1;"..bg["tools"].."^crafting_creative_tool.png;tools;]".. --tools player:set_inventory_formspec(formspec)
"image_button[2.415,8.28;1,1;"..bg["combat"].."^crafting_creative_sword.png;combat;]".. --combat end
"image_button[3.693,8.28;1,1;"..bg["matr"].."^crafting_creative_matr.png;matr;]".. --brewing
"image_button[4.93,8.28;1,1;"..bg["brew"].."^crafting_inventory_brew.png;brew;]".. --materials^ minetest.register_on_player_receive_fields(function(player, formname, fields)
"image_button[9.19,8.28;1,1;"..bg["inv"].."^crafting_creative_inv.png;inv;]".. --inventory local page = nil
"list[detached:creative_trash;main;9,7;1,1;]"..
"image[9,7;1,1;crafting_creative_trash.png]".. if fields.bgcolor then
-- minetest.chat_send_all("jupp")
"image[9.04," .. tostring(slider_pos) .. ";0.78,"..tostring(slider_height) .. ";crafting_slider.png]" end
if fields.suche ~= nil and fields.suche ~= "" then
if name == "nix" then formspec = formspec .. "field[5.3,1.3;4,0.75;suche;;]" end set_inv(string.lower(fields.suche))
if pagenum ~= nil then formspec = formspec .. "p"..tostring(pagenum) end minetest.after(0.5, function()
minetest.show_formspec(player:get_player_name(), "detached:creative", player:get_inventory_formspec())
player:set_inventory_formspec(formspec) end)
end end
minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.build then
local page = nil set_inv("#blocks",player)
if not minetest.setting_getbool("creative_mode") then page = "blocks"
return end
end if fields.deco then
set_inv("#deco",player)
if fields.bgcolor then page = "deco"
-- minetest.chat_send_all("jupp") end
end if fields.mese then
if fields.suche ~= nil and fields.suche ~= "" then set_inv("#mese",player)
set_inv(string.lower(fields.suche)) page = "mese"
minetest.after(0, function() end
minetest.show_formspec(player:get_player_name(), "detached:creative", player:get_inventory_formspec()) if fields.rail then
end) set_inv("#rail",player)
end page = "rail"
end
if fields.build then if fields.misc then
set_inv("#blocks",player) set_inv("#misc",player)
page = "blocks" page = "misc"
end end
if fields.deco then if fields.default then
set_inv("#deco",player) set_inv("all")
page = "deco" page = 'nix'
end end
if fields.mese then if fields.food then
set_inv("#mese",player) set_inv("#food")
page = "mese" page = "food"
end end
if fields.rail then if fields.tools then
set_inv("#rail",player) set_inv("#tools")
page = "rail" page = "tools"
end end
if fields.misc then if fields.combat then
set_inv("#misc",player) set_inv("#combat")
page = "misc" page = "combat"
end end
if fields.default then if fields.matr then
set_inv("all") set_inv("#matr")
page = 'nix' page = "matr"
end end
if fields.food then if fields.inv then
set_inv("#food") page = "inv"
page = "food" end
end if fields.brew then
if fields.tools then set_inv("#brew")
set_inv("#tools") page = "brew"
page = "tools" end
end
if fields.combat then -- Figure out current page from formspec
set_inv("#combat") local current_page = 0
page = "combat" local formspec = player:get_inventory_formspec()
end
if fields.matr then local size = string.len(formspec)
set_inv("#matr") local marker = string.sub(formspec,size-2)
page = "matr" marker = string.sub(marker,1)
end local player_name = player:get_player_name()
if fields.inv then local start_i = crafting.start_is[player_name]
page = "inv" if not page then page = crafting.pages[player_name] end
end if page ~= crafting.pages[player_name] then
if fields.brew then start_i = 0
set_inv("#brew") end
page = "brew" start_i = tonumber(start_i) or 0
end if fields.creative_prev then
start_i = start_i - 9*5
-- Figure out current page from formspec page = tmp_page
local current_page = 0 end
local formspec = player:get_inventory_formspec() if fields.creative_next then
start_i = start_i + 9*5
local size = string.len(formspec) page = tmp_page
local marker = string.sub(formspec,size-1) end
marker = string.sub(marker,1,1) if start_i < 0 then
start_i = start_i + 9*5
local player_name = player:get_player_name() end
local start_i = crafting.start_is[player_name] if start_i >= crafting.creative_inventory_size then
if not page then page = crafting.pages[player_name] end start_i = start_i - 9*5
if page ~= crafting.pages[player_name] then end
start_i = 0 if start_i < 0 or start_i >= crafting.creative_inventory_size then
end start_i = 0
--if marker ~= nil and marker == "p" then end
--local ppage = string.sub(formspec,size) crafting.set_creative_formspec(player, start_i, start_i / (9*5) + 1, false, page)
-- print('ppage ' .. (ppage or 'nope')) end)
--minetest.chat_send_all(page)
--start_i = ppage - 1
--end
--start_i = tonumber(start_i) or 0
if fields.creative_prev then
start_i = start_i - 9*5
end
if fields.creative_next
and start_i + 9*5 <= crafting.creative_inventory_size+1 then
start_i = start_i + 9*5
end
if start_i < 0 then
start_i = 0
end
crafting.set_creative_formspec(player, start_i, start_i/(9*5) +1, false, page)
end)
if minetest.setting_getbool("creative_mode") then
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=0.5},
tool_capabilities = {
full_punch_interval = 0.5,
max_drop_level = 3,
groupcaps = {
crumbly = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
cracky = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
snappy = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
choppy = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
oddly_breakable_by_hand = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3},
}
}
})
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
return true
end)
function minetest.handle_node_drops(pos, drops, digger)
if not digger or not digger:is_player() then
return
end
local inv = digger:get_inventory()
if inv then
for _,item in ipairs(drops) do
item = ItemStack(item):get_name()
if not inv:contains_item("main", item) then
inv:add_item("main", item)
end
end
end
end
end

View File

@ -1,48 +1,48 @@
default.chest_formspec = default.chest_formspec =
"size[9,9.75]".. "size[9,9.75]"..
"image_button_exit[9,0;1,1;;exit;X;true;true;]".. "image_button_exit[9,0;1,1;;exit;X;true;true;]"..
"background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]".. "background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]"..
"bgcolor[#080808BB;true]".. "bgcolor[#080808BB;true]"..
"listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]".. "listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]"..
"list[current_name;main;0,0.5;9,4;]".. "list[current_name;main;0,0.5;9,4;]"..
"list[current_player;main;0,5.5;9,3;9]".. "list[current_player;main;0,5.5;9,3;9]"..
"list[current_player;main;0,8.74;9,1;]" "list[current_player;main;0,8.74;9,1;]"
local chest_inv_size = 4*9 local chest_inv_size = 4*9
local chest_inv_vers = 2 local chest_inv_vers = 2
function default.get_locked_chest_formspec(pos) function default.get_locked_chest_formspec(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv_v = meta:get_int("chest_inv_ver") local inv_v = meta:get_int("chest_inv_ver")
if inv_v and inv_v < chest_inv_vers then if inv_v and inv_v < chest_inv_vers then
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("main",chest_inv_size) inv:set_size("main",chest_inv_size)
meta:set_int("chest_inv_ver",chest_inv_vers) meta:set_int("chest_inv_ver",chest_inv_vers)
end end
local spos = pos.x .. "," .. pos.y .. "," ..pos.z local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec = local formspec =
"size[9,9.75]".. "size[9,9.75]"..
"image_button_exit[9,0;1,1;;exit;X;true;true;]".. "image_button_exit[9,0;1,1;;exit;X;true;true;]"..
"background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]".. "background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]"..
"bgcolor[#080808BB;true]".. "bgcolor[#080808BB;true]"..
"listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]".. "listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]"..
"list[nodemeta:".. spos .. ";main;0,0.5;9,4;]".. "list[nodemeta:".. spos .. ";main;0,0.5;9,4;]"..
"list[current_player;main;0,5.5;9,3;9]".. "list[current_player;main;0,5.5;9,3;9]"..
"list[current_player;main;0,8.74;9,1;]" "list[current_player;main;0,8.74;9,1;]"
return formspec return formspec
end end
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:chest"}, nodenames = {"default:chest"},
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node) action = function(pos, node)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv_v = meta:get_int("chest_inv_ver") local inv_v = meta:get_int("chest_inv_ver")
if inv_v and inv_v < chest_inv_vers then if inv_v and inv_v < chest_inv_vers then
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("main",chest_inv_size) inv:set_size("main",chest_inv_size)
meta:set_int("chest_inv_ver",chest_inv_vers) meta:set_int("chest_inv_ver",chest_inv_vers)
end end
end end
}) })

View File

@ -1,203 +1,198 @@
dofile(minetest.get_modpath("crafting").."/formspecs.lua")
dofile(minetest.get_modpath("crafting").."/formspecs.lua") local show_armor = true
local show_armor = false local function item_drop(itemstack, dropper, pos)
if minetest.get_modpath("3d_armor") ~= nil then show_armor = true end if dropper:is_player() then
local v = dropper:get_look_dir()
local function item_drop(itemstack, dropper, pos) local p = {x=pos.x, y=pos.y+1.2, z=pos.z}
if dropper:is_player() then p.x = p.x+(math.random(1,3)*0.2)
local v = dropper:get_look_dir() p.z = p.z+(math.random(1,3)*0.2)
local p = {x=pos.x, y=pos.y+1.2, z=pos.z} local obj = minetest.env:add_item(p, itemstack)
p.x = p.x+(math.random(1,3)*0.2) if obj then
p.z = p.z+(math.random(1,3)*0.2) v.x = v.x*4
local obj = minetest.add_item(p, itemstack) v.y = v.y*4 + 2
if obj then v.z = v.z*4
v.x = v.x*4 obj:setvelocity(v)
v.y = v.y*4 + 2 end
v.z = v.z*4 else
obj:setvelocity(v) minetest.add_item(pos, itemstack)
end end
else return itemstack
minetest.add_item(pos, itemstack) end
end
return itemstack local function drop_fields(player, name)
end local inv = player:get_inventory()
for i,stack in ipairs(inv:get_list(name)) do
local function drop_fields(player, name) item_drop(stack, player, player:getpos())
local inv = player:get_inventory() stack:clear()
for i,stack in ipairs(inv:get_list(name)) do inv:set_stack(name, i, stack)
item_drop(stack, player, player:getpos()) end
stack:clear() end
inv:set_stack(name, i, stack)
end local player_armor = {}
end
local function update_armor(player)
local player_armor = {} local out = ""
if not player then return end
local function update_armor(player) local name = player:get_player_name()
local out = "" if not armor or not armor.textures then return end
if not player then return end local armor_str = armor.textures[name].armor
local name = player:get_player_name() if string.find(armor_str, "leggings") then
if not armor or not armor.textures then return end out = out .. "^crafting_armor_legs.png"
local armor_str = armor.textures[name].armor end
if string.find(armor_str, "leggings") then if string.find(armor_str, "boots") then
out = out .. "^crafting_armor_legs.png" out = out .. "^crafting_armor_boots.png"
end end
if string.find(armor_str, "boots") then if string.find(armor_str, "helmet") then
out = out .. "^crafting_armor_boots.png" out = out .. "^crafting_armor_helmet.png"
end end
if string.find(armor_str, "helmet") then if string.find(armor_str, "chestplate") then
out = out .. "^crafting_armor_helmet.png" out = out .. "^crafting_armor_chest.png"
end end
if string.find(armor_str, "chestplate") then player_armor[name] = out
out = out .. "^crafting_armor_chest.png" end
end
player_armor[name] = out local function set_inventory(player)
end player:get_inventory():set_width("craft", 3)
player:get_inventory():set_size("craft", 9)
local function set_inventory(player) player:get_inventory():set_size("main", 9*4)
if minetest.setting_getbool("creative_mode") then
minetest.after(0.5,function() local player_name = player:get_player_name()
crafting.set_creative_formspec(player, 0, 1) local img = "crafting_player2d.png"
return local armor_img = ""
end) if show_armor then
end armor_img = "^crafting_inventory_armor.png"
player:get_inventory():set_width("craft", 3) if player_armor[player_name] ~= nil then
player:get_inventory():set_size("craft", 9) img = img .. player_armor[player_name]
player:get_inventory():set_size("main", 9*4) end
end
local player_name = player:get_player_name() local img_element = "image[1.5,0;2,4;"..img.."]"
local img = "crafting_inventory_player.png" if show_armor and armor.textures[player_name] and armor.textures[player_name].preview then
local armor_img = "" img = armor.textures[player_name].preview
if show_armor then local s1 = img:find("character_preview")
armor_img = "^crafting_inventory_armor.png" if s1 ~= nil then
if player_armor[player_name] ~= nil then s1 = img:sub(s1+21)
img = img .. player_armor[player_name] img = "crafting_player2d.png"..s1
end end
end img_element = "image[1.5,0;2,4;"..img.."]"
local img_element = "image[1,0;3,4;"..img.."]" end
if show_armor and armor.textures[player_name] and armor.textures[player_name].preview then
img = armor.textures[player_name].preview local form = "size[9,8.75]"..
local s1 = img:find("character_preview") "image_button_exit[9,0;1,1;;exit;X;true;true;]"..
if s1 ~= nil then "background[-0.19,-0.25;9.41,9.49;crafting_formspec_inv.png]"..
s1 = img:sub(s1+21) "bgcolor[#080808BB;true]"..
img = "crafting_player2d.png"..s1 "listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]"..
end img_element
img_element = "image[1.5,0;2,4;"..img.."]" --armor
end if show_armor then
if armor.def[player_name] and armor.def[player_name].level then
local form = "size[9,8.75]".. form = form ..
"image_button_exit[9,0;1,1;;exit;X;true;true;]".. "list[detached:"..player_name.."_armor;armor;0,0;1,1;]"..
"background[-0.19,-0.25;9.41,9.49;crafting_formspec_inv.png]".. "list[detached:"..player_name.."_armor;armor;0,1;1,1;1]"..
"bgcolor[#080808BB;true]".. "list[detached:"..player_name.."_armor;armor;0,2;1,1;2]"..
"listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]".. "list[detached:"..player_name.."_armor;armor;0,3;1,1;3]"
img_element else
--armor form = form ..
if show_armor then "list[detached:"..player_name.."_armor;armor_head;0,0;1,1;]"..
if armor.def[player_name] and armor.def[player_name].level then "list[detached:"..player_name.."_armor;armor_torso;0,1;1,1;1]"..
form = form .. "list[detached:"..player_name.."_armor;armor_legs;0,2;1,1;2]"..
"list[detached:"..player_name.."_armor;armor;0,0;1,1;]".. "list[detached:"..player_name.."_armor;armor_feet;0,3;1,1;3]"
"list[detached:"..player_name.."_armor;armor;0,1;1,1;1]".. end
"list[detached:"..player_name.."_armor;armor;0,2;1,1;2]".. end
"list[detached:"..player_name.."_armor;armor;0,3;1,1;3]" form = form ..
else "list[current_player;main;0,4.5;9,3;9]"..
form = form .. "list[current_player;main;0,7.74;9,1;]"..
"list[detached:"..player_name.."_armor;armor_head;0,0;1,1;]".. "list[current_player;craft;4,1;2,1;1]"..
"list[detached:"..player_name.."_armor;armor_torso;0,1;1,1;1]".. "list[current_player;craft;4,2;2,1;4]"..
"list[detached:"..player_name.."_armor;armor_legs;0,2;1,1;2]".. "list[current_player;craftpreview;7,1.5;1,1;]"..
"list[detached:"..player_name.."_armor;armor_feet;0,3;1,1;3]" "inv"
end
end player:set_inventory_formspec(form)
form = form .. end
"list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]".. local function set_workbench(player)
"list[current_player;craft;4,1;2,1;1]".. player:get_inventory():set_width("craft", 3)
"list[current_player;craft;4,2;2,1;4]".. player:get_inventory():set_size("craft", 9)
"list[current_player;craftpreview;7,1.5;1,1;]".. player:get_inventory():set_size("main", 9*4)
"inv"
local form = "size[9,8.75]"..
player:set_inventory_formspec(form) "image_button_exit[9,0;1,1;;exit;X;true;true;]"..
end "background[-0.19,-0.25;9.41,9.49;crafting_formspec_workbench.png]"..
"bgcolor[#080808BB;true]"..
local function set_workbench(player) "listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]"..
player:get_inventory():set_width("craft", 3) "list[current_player;main;0,4.5;9,3;9]"..
player:get_inventory():set_size("craft", 9) "list[current_player;main;0,7.74;9,1;]"..
player:get_inventory():set_size("main", 9*4) "list[current_player;craft;1.75,0.5;3,3;]"..
"list[current_player;craftpreview;5.75,1.5;1,1;]"..
local form = "size[9,8.75]".. "wob"
"image_button_exit[9,0;1,1;;exit;X;true;true;]"..
"background[-0.19,-0.25;9.41,9.49;crafting_formspec_workbench.png]".. minetest.show_formspec(player:get_player_name(), "main", form)
"bgcolor[#080808BB;true]".. end
"listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]"..
"list[current_player;main;0,4.5;9,3;9]".. --drop craf items and reset inventory on closing
"list[current_player;main;0,7.74;9,1;]".. minetest.register_on_player_receive_fields(function(player, formname, fields)
"list[current_player;craft;1.75,0.5;3,3;]".. if fields.quit then
"list[current_player;craftpreview;5.75,1.5;1,1;]".. local formspec = player:get_inventory_formspec()
"wob" local size = string.len(formspec)
local marker = string.sub(formspec,size-2)
--player:set_inventory_formspec(form) if marker == "inv" or marker == "wob" then
minetest.show_formspec(player:get_player_name(), "main", form) set_inventory(player)
end drop_fields(player,"craft")
end
--drop craf items and reset inventory on closing end
minetest.register_on_player_receive_fields(function(player, formname, fields) end)
if fields.quit then
local formspec = player:get_inventory_formspec() minetest.register_on_joinplayer(function(player)
local size = string.len(formspec) if minetest.setting_getbool("creative_mode") then
local marker = string.sub(formspec,size-2) minetest.after(0.5,function()
if marker == "inv" or marker == "wob" then dofile(minetest.get_modpath("crafting").."/creative.lua")
set_inventory(player) crafting.set_creative_formspec(player, 0, 1)
drop_fields(player,"craft") return
end end)
end else
end) --init inventory
set_inventory(player)
minetest.register_on_joinplayer(function(player) end
minetest.after(0,function(dt) --set hotbar size
if player then set_inventory(player) end --if player.hud_set_hotbar_itemcount then
end) --minetest.after(0.5, player.hud_set_hotbar_itemcount, player, 8)
if minetest.setting_getbool("creative_mode") then --end
dofile(minetest.get_modpath("crafting").."/creative.lua") --add hotbar images
end minetest.after(0.5,function()
--init inventory player:hud_set_hotbar_image("crafting_hotbar.png")
set_inventory(player) player:hud_set_hotbar_selected_image("crafting_hotbar_selected.png")
--set hotbar size
if player.hud_set_hotbar_itemcount then if show_armor then
minetest.after(0, player.hud_set_hotbar_itemcount, player, 8) local armor_orginal = armor.set_player_armor
end armor.set_player_armor = function(self, player)
--add hotbar images armor_orginal(self, player)
minetest.after(0,function() update_armor(player)
player:hud_set_hotbar_image("crafting_hotbar.png") minetest.after(0.5,function()
player:hud_set_hotbar_selected_image("crafting_hotbar_selected.png") --set_inventory(player)
return
if show_armor then end)
local armor_orginal = armor.set_player_armor end
armor.set_player_armor = function(self, player) end
armor_orginal(self, player) end)
update_armor(player) end)
-- set_inventory(player)
end minetest.register_node("crafting:workbench", {
end description = "Workbench",
end) tiles = {"crafting_workbench_top.png", "default_wood.png", "crafting_workbench_side.png",
end) "crafting_workbench_side.png", "crafting_workbench_front.png", "crafting_workbench_front.png"},
paramtype2 = "facedir",
minetest.register_node("crafting:workbench", { paramtype = "light",
description = "Workbench", groups = {choppy=2,oddly_breakable_by_hand=2,flammable=2, decorative = 1},
tiles = {"crafting_workbench_top.png", "default_wood.png", "crafting_workbench_side.png", on_rightclick = function(pos, node, clicker, itemstack)
"crafting_workbench_side.png", "crafting_workbench_front.png", "crafting_workbench_front.png"}, set_workbench(clicker)
paramtype2 = "facedir", end
paramtype = "light", })
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=2, decorative = 1},
on_rightclick = function(pos, node, clicker, itemstack) minetest.register_craft({
set_workbench(clicker) output = "crafting:workbench",
end recipe = {
}) {"group:wood", "group:wood"},
{"group:wood", "group:wood"}
minetest.register_craft({ }
output = "crafting:workbench", })
recipe = {
{"group:wood", "group:wood"},
{"group:wood", "group:wood"}
}
})

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 186 B

View File

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 451 B

View File

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 229 B

View File

Before

Width:  |  Height:  |  Size: 668 B

After

Width:  |  Height:  |  Size: 668 B

View File

Before

Width:  |  Height:  |  Size: 494 B

After

Width:  |  Height:  |  Size: 494 B

View File

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 356 B

View File

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 402 B

View File

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

View File

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 250 B

View File

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 283 B

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 224 B

View File

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 428 B

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 144 B

After

Width:  |  Height:  |  Size: 144 B

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View File

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 204 B

View File

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 432 B

View File

Before

Width:  |  Height:  |  Size: 253 B

After

Width:  |  Height:  |  Size: 253 B

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 550 B

After

Width:  |  Height:  |  Size: 550 B

View File

Before

Width:  |  Height:  |  Size: 82 B

After

Width:  |  Height:  |  Size: 82 B

View File

Before

Width:  |  Height:  |  Size: 583 B

After

Width:  |  Height:  |  Size: 583 B

View File

Before

Width:  |  Height:  |  Size: 571 B

After

Width:  |  Height:  |  Size: 571 B

View File

Before

Width:  |  Height:  |  Size: 447 B

After

Width:  |  Height:  |  Size: 447 B

View File

@ -1,31 +0,0 @@
multicraft mod "Crafting"
=======================
version: 2.0.1
License of source code and Textures: WTFPL
------------------------------------
Copyright (c) 2013-2014 BlockMen
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.
--USING the mod--
=================
This mod changes the players inventory (survival and creative) with more slots (9*4 instead of 8*4)
Like known from Minecraft you have a 2x2 crafting grid at inventory now. Furthermore a categorized creative
inventory and a support for stu's 3d armor mod (To use the armor and a preview of player).
Left items in the crafting slots are dropped infront of you.
Workbench
=========
With following recipe you craft a workbench (aka crafting table):
wood wood
wood wood
The workbench has a 3x3 crafting grid, that allows to use all recipes.

View File

@ -1,3 +0,0 @@
default
crafting

View File

@ -1,9 +0,0 @@
inventory_plus = {}
function inventory_plus.set_inventory_formspec(player, formspec)
end
function inventory_plus.register_button(player,str1, str2)
end

View File

@ -1,6 +1,3 @@
creative = {}
local player_inventory = {}
if minetest.setting_getbool("creative_mode") then if minetest.setting_getbool("creative_mode") then
local digtime = 1 local digtime = 1
minetest.register_item(":", { minetest.register_item(":", {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

View File

@ -9,6 +9,8 @@ Version: 1.1 alpha
A simple mod that add to dungeons chests that contain some loot. A simple mod that add to dungeons chests that contain some loot.
Configurable in many aspects, see "config.lua" for more details. Configurable in many aspects, see "config.lua" for more details.
In MultiCraft Project this code has been changed:
I changed the drop in a few lines.
License: License:
~~~~~~~~ ~~~~~~~~

View File

@ -61,21 +61,6 @@ minetest.register_craft({
} }
}) })
-- net
minetest.register_tool("mobs:net", {
description = "Net (right-click animal to put in inventory)",
inventory_image = "mobs_net.png",
})
minetest.register_craft({
output = "mobs:net",
recipe = {
{"default:stick", "", "default:stick"},
{"default:stick", "", "default:stick"},
{"farming:string", "default:stick", "farming:string"},
}
})
-- shears (right click to shear animal) -- shears (right click to shear animal)
minetest.register_tool("mobs:shears", { minetest.register_tool("mobs:shears", {
description = "Steel Shears (right-click to shear)", description = "Steel Shears (right-click to shear)",

View File

@ -1,99 +1,3 @@
-- Npc by TenPlus1
mobs.npc_drops = {
"default:pick_steel", "mobs:meat", "default:sword_steel",
"default:shovel_steel", "farming:bread", "bucket:bucket_water"
}
mobs:register_mob("mobs:npc", { mobs:register_mob("mobs:npc", {
type = "npc", lifetimer = 1,
passive = false, })
damage = 3,
attack_type = "dogfight",
attacks_monsters = true,
reach = 2,
hp_min = 10,
hp_max = 20,
armor = 100,
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
visual = "mesh",
mesh = "character.b3d",
drawtype = "front",
textures = {
{"mobs_npc.png"},
{"mobs_npc2.png"}, -- female by nuttmeg20
},
child_texture = {
{"mobs_npc_baby.png"}, -- derpy baby by AmirDerAssassine
},
makes_footstep_sound = true,
sounds = {},
walk_velocity = 2,
run_velocity = 3,
jump = true,
drops = {
{name = "default:wood",
chance = 1, min = 1, max = 3},
{name = "default:apple",
chance = 2, min = 1, max = 2},
{name = "default:axe_stone",
chance = 5, min = 1, max = 1},
},
water_damage = 0,
lava_damage = 2,
light_damage = 0,
follow = {"farming:bread", "mobs:meat", "default:diamond"},
view_range = 15,
owner = "",
order = "follow",
animation = {
speed_normal = 30,
speed_run = 30,
stand_start = 0,
stand_end = 79,
walk_start = 168,
walk_end = 187,
run_start = 168,
run_end = 187,
punch_start = 200,
punch_end = 219,
},
on_rightclick = function(self, clicker)
-- feed to heal npc
if not mobs:feed_tame(self, clicker, 8, true, true) then
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
-- right clicking with gold lump drops random item from mobs.npc_drops
if item:get_name() == "default:gold_lump" then
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
local pos = self.object:getpos()
pos.y = pos.y + 0.5
minetest.add_item(pos, {
name = mobs.npc_drops[math.random(1, #mobs.npc_drops)]
})
return
else
-- if owner switch between follow and stand
if self.owner and self.owner == clicker:get_player_name() then
if self.order == "follow" then
self.order = "stand"
else
self.order = "follow"
end
end
end
end
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
end,
})
mobs:register_spawn("mobs:npc", {"default:dirt", "default:sand", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, 20, 0, 10000, 1, 31000)
mobs:register_egg("mobs:npc", "Npc", "default_brick.png", 1)

View File

@ -7,7 +7,7 @@ mobs:register_mob("mobs:rat", {
hp_min = 1, hp_min = 1,
hp_max = 4, hp_max = 4,
armor = 100, armor = 100,
collisionbox = {-0.2, -1, -0.2, 0.2, -0.8, 0.2}, collisionbox = {-0.25, -1, -0.25, 0.25, -0.8, 0.25},
visual = "mesh", visual = "mesh",
mesh = "mobs_rat.b3d", mesh = "mobs_rat.b3d",
textures = { textures = {

View File

@ -44,6 +44,6 @@ mobs:register_mob("mobs:skeleton", {
mobs:spawn_specific("mobs:skeleton", mobs:spawn_specific("mobs:skeleton",
{"default:dirt", "default:sandstone", "default:sand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:cobble", "default:mossycobble"}, {"default:dirt", "default:sandstone", "default:sand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:cobble", "default:mossycobble"},
{"air"}, {"air"},
0, 5, 0, 4000, 1, -31000, 31000 0, 7, 0, 4000, 1, -31000, 31000
) )
--mobs:register_egg("mobs:skeleton", "Zombie", "zombie_head.png", 0) --mobs:register_egg("mobs:skeleton", "Zombie", "zombie_head.png", 0)

View File

@ -51,7 +51,7 @@ mobs:register_mob("mobs:spider", {
mobs:spawn_specific("mobs:spider", mobs:spawn_specific("mobs:spider",
{"default:dirt", "default:sandstone", "default:sand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:cobble", "default:mossycobble"}, {"default:dirt", "default:sandstone", "default:sand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:cobble", "default:mossycobble"},
{"air"}, {"air"},
0, 5, 0, 5000, 1, -31000, 31000 0, 7, 0, 5000, 1, -31000, 31000
) )
mobs:register_egg("mobs:spider", "Spider", "mobs_cobweb.png", 1) mobs:register_egg("mobs:spider", "Spider", "mobs_cobweb.png", 1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 B

View File

@ -44,7 +44,7 @@ mobs:register_mob("mobs:zombie", {
mobs:spawn_specific("mobs:zombie", mobs:spawn_specific("mobs:zombie",
{"default:dirt", "default:sandstone", "default:sand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:cobble", "default:mossycobble"}, {"default:dirt", "default:sandstone", "default:sand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:cobble", "default:mossycobble"},
{"air"}, {"air"},
0, 5, 0, 4000, 1, -31000, 31000 0, 7, 0, 4000, 1, -31000, 31000
) )
mobs:register_egg("mobs:zombie", "Zombie", "zombie_head.png", 0) mobs:register_egg("mobs:zombie", "Zombie", "zombie_head.png", 0)

View File

@ -1,15 +0,0 @@
[mod] visible wielded items [wieldview]
=======================================
depends: default, 3d_armor
Makes hand wielded items visible to other players.
default settings: [minetest.conf]
# Set number of seconds between visible wielded item updates.
wieldview_update_time = 2
# Show nodes as tiles, disabled by default
wieldview_node_tiles = false

View File

@ -1,2 +0,0 @@
default
3d_armor

View File

@ -1,76 +0,0 @@
local time = 0
local update_time = tonumber(minetest.setting_get("wieldview_update_time"))
if not update_time then
update_time = 2
minetest.setting_set("wieldview_update_time", tostring(update_time))
end
local node_tiles = minetest.setting_getbool("wieldview_node_tiles")
if not node_tiles then
node_tiles = false
minetest.setting_set("wieldview_node_tiles", "false")
end
wieldview = {
wielded_item = {},
transform = {},
}
dofile(minetest.get_modpath(minetest.get_current_modname()).."/transform.lua")
wieldview.get_item_texture = function(self, item)
local texture = "3d_armor_trans.png"
if item ~= "" then
if minetest.registered_items[item] then
if minetest.registered_items[item].inventory_image ~= "" then
texture = minetest.registered_items[item].inventory_image
elseif node_tiles == true and minetest.registered_items[item].tiles
and type(minetest.registered_items[item].tiles[1]) == "string"
and minetest.registered_items[item].tiles[1] ~= "" then
texture = minetest.inventorycube(minetest.registered_items[item].tiles[1])
end
end
if wieldview.transform[item] then
texture = texture.."^[transform"..wieldview.transform[item]
end
end
return texture
end
wieldview.update_wielded_item = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local stack = player:get_wielded_item()
local item = stack:get_name()
if not item then
return
end
if self.wielded_item[name] then
if self.wielded_item[name] == item then
return
end
armor.textures[name].wielditem = self:get_item_texture(item)
armor:update_player_visuals(player)
end
self.wielded_item[name] = item
end
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
wieldview.wielded_item[name] = ""
minetest.after(0, function(player)
wieldview:update_wielded_item(player)
end, player)
end)
minetest.register_globalstep(function(dtime)
time = time + dtime
if time > update_time then
for _,player in ipairs(minetest.get_connected_players()) do
wieldview:update_wielded_item(player)
end
time = 0
end
end)

View File

@ -1,24 +0,0 @@
-- Wielded Item Transformations - http://dev.minetest.net/texture
wieldview.transform = {
["default:torch"]="R270",
["default:sapling"]="R270",
["flowers:dandelion_white"]="R270",
["flowers:dandelion_yellow"]="R270",
["flowers:orchid"]="R270",
["flowers:rose"]="R270",
["flowers:tulip"]="R270",
["flowers:allium"]="R270",
["bucket:bucket_empty"]="R270",
["bucket:bucket_water"]="R270",
["bucket:bucket_lava"]="R270",
["screwdriver:screwdriver"]="R270",
["screwdriver:screwdriver1"]="R270",
["screwdriver:screwdriver2"]="R270",
["screwdriver:screwdriver3"]="R270",
["screwdriver:screwdriver4"]="R270",
["vessels:glass_bottle"]="R270",
["vessels:drinking_glass"]="R270",
["vessels:steel_bottle"]="R270",
}

View File

@ -1136,7 +1136,7 @@ static void show_pause_menu(GUIFormSpecMenu **cur_formspec,
<< strgettext("Continue") << "]"; << strgettext("Continue") << "]";
if (!singleplayermode) { if (!singleplayermode) {
os << "button_exit[1," << (ypos++) << ";3,0.5;btn_change_password;" os << "button_exit[4," << (ypos++) << ";3,0.5;btn_change_password;"
<< strgettext("Change Password") << "]"; << strgettext("Change Password") << "]";
} }