1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-28 20:56:02 +02:00

131 Commits

Author SHA1 Message Date
90aaa1fb62 Fixe digging times of axes 2013-03-03 11:15:05 +01:00
6c70e0295a Dont place doors if node under it has on_rightclick 2013-03-01 17:40:26 +01:00
230747c748 Update README 2013-02-24 19:01:10 +01:00
86cff038a4 makes wood doors craftable from wood group 2013-02-12 15:46:03 -05:00
0823f16acb Merge pull request #119 from HybridDog/patch-1
Update mods/default/init.lua
2013-02-08 06:08:47 -08:00
e1d17b1747 Update mods/default/init.lua
how did this line get there?
2013-02-08 15:03:14 +01:00
Jat
2817db19d4 Fix duplicate in default 2013-02-06 02:43:48 +01:00
716397819d Update mods/doors/init.lua
Fix door's glitch in creative mode
2013-01-26 17:00:15 +01:00
67fa74ac01 Fix texture glitch when digging junglegrass 2013-01-15 20:30:55 +01:00
d5cc51a396 Update minetest.show_formspec() 2013-01-07 20:42:31 +01:00
cd604fa9c8 Better lump & ingot textures 2013-01-06 12:07:19 +04:00
686c0d087c Open/close doors with rightclick 2013-01-05 17:25:19 +01:00
c27afe7ee8 Add junglegrass to mapgen 2013-01-05 00:46:46 +01:00
9e23e9ecbf Wool group
For better crafting and modding.
2013-01-04 23:47:27 +01:00
97db50a2fe Expose generate_ore 2013-01-04 21:55:31 +01:00
a0ba7cf973 Show the contents of the locked chest only to the owner 2013-01-04 21:25:37 +01:00
c1b1f2aa49 Add a selection box for stairs that fit the nodebox 2013-01-04 19:45:10 +01:00
0beabfc755 Fix a glitch where the player gets liquids in his inventory when the server lags 2013-01-04 16:47:29 +01:00
5fa8852115 Make fire buildable to 2012-12-31 13:24:05 +01:00
0eb46a01ff Remove old unused texture 2012-12-29 00:29:52 +01:00
de8726a9f7 new mese pick texture 2012-12-28 21:34:10 +00:00
33ec25caed Convert old mese to the new mese block and generate it deep underground 2012-12-28 20:05:40 +01:00
deb39ddcd4 Run nodeupdate() after burning nodes. 2012-12-28 02:30:52 +01:00
2d1e7463d3 Run nodeupdate after decay. 2012-12-28 02:30:52 +01:00
7505fbce51 add new texture with shading this time around.
also, license follows the default one since thats how the textures for
minetest_game usually work.
2012-12-27 21:58:57 +00:00
9232734a48 Removed significant details from default_dirt.png to make it look less repetative
Fixed default_grass_side.png
2012-12-22 20:08:56 +04:00
1bf62bbad4 Changed Mese to act like an object cut out of a block of stone, rather than an
object found *among* the stone.

That is, mese should behave such that you get something potentially useful out
of the aggregate block you just broke, rather than just collecting the whole
block when mined.

Mese crystals in stone give a single Mese Crystal when mines. Craft three of
those + 2 sticks for Mese Pickaxe, or 9 for a Mese block. Craft one Mese
Crystal by itself to get 9 Mese Crystal fragments, which all mods should use
when a full Mese Crystal is too much.

This includes new textures for the above objects, tweaks to the sounds used for
them, and naming tweaks for the textures used for default mese in stone, so
that old texture packs don't use the "wrong" image.

This represents my best effort to match C55's suggestions.
2012-12-18 17:56:23 +01:00
95cbfc50d8 Fix incorrect slabs to full block transformation by changing the modname to 'stairs' for all stairs and slabs 2012-12-17 21:03:25 +01:00
61e60724f6 Use infinite stacks in creative mode and make the hand break anything 2012-12-17 20:27:01 +01:00
8c977451a8 Fix modname prefix in stairs and slab functions 2012-12-16 19:52:13 +01:00
73d078fd27 Damage tweaks 2012-12-15 18:05:14 +01:00
0636d574af Add upside down slabs and stairs 2012-12-15 15:01:49 +01:00
c4f2bee9a6 Add sounds to stairs and slabs 2012-12-12 20:37:33 +01:00
4763fa635a Fix glass step sound 2012-12-10 18:43:12 +01:00
3928eccf74 Use the group attached_nodes 2012-12-01 14:39:23 +01:00
5311c6ec96 Replace the doors mod 2012-11-28 14:43:49 +01:00
91937acf76 Merge Taoki's 3D player improvements 2012-11-27 08:15:38 +02:00
e7b4b2ba57 Fix the death animation looping while the player is dead, by using a still frame instead (I don't believe the amount of detail for a full animation is needed anyway). Also call the animation Lay instead of Death, so other mods like beds can use it 2012-11-27 02:50:19 +02:00
89fb5aed7f Fix positioning for sit animation 2012-11-27 01:52:39 +02:00
df54836ea0 Add support for hats, so that MineCraft skins using this feature are compatible 2012-11-27 01:26:51 +02:00
f2a67871d2 VanessaE suggested a sit animation, so add one to the player. Not used by default, but many mods might find this handy 2012-11-27 01:19:48 +02:00
c3eaa9cd64 Add glass breaking sound 2012-11-26 19:53:28 +01:00
d39044a2a7 new apple image. 2012-11-25 20:25:28 +01:00
8a6b2df6b1 Make functions of fire mod global and move register_on_* functions to node definition 2012-11-25 20:11:54 +01:00
bed848f68a Make fire hurt the player 2012-11-25 20:11:40 +01:00
24939c299b Add animation for fire 2012-11-25 20:11:29 +01:00
24d8d79ea1 Make the arms swing more for the walk animation 2012-11-25 21:02:01 +02:00
cb4bfa51a1 Models allow multiple materials with multiple textures, so make the player texture field a list instead 2012-11-25 21:02:01 +02:00
7a01de2f36 Improve and optimize the player script and add better comments 2012-11-25 21:02:01 +02:00
c7a4a68d28 Implement death animation, but it currently loops constantly after the player dies (the player gets up and falls to the ground forever) 2012-11-25 21:02:01 +02:00
91da5d1308 Model - Get rid of the 4 walk animations and only leave one, which looks good for all directions. Also add a Walk + Mine animation, since Irrlicht doesn't support blending the two animations otherwise
Update player script to match the animations in the previous commit

Shorten the still mine animation so the hand matches the speed of the walk-mine animation

Reduce animation speed to half when sneaking
2012-11-25 21:02:01 +02:00
39e4bf0346 Get player walking and standing animations working! The player will play the proper animation when walking or standing.
Also get the mine animation working when holding the left mouse button. Walk animations have priority over it, and sadly you can't play both at the same time

Set initial player animation to stand
2012-11-25 21:02:01 +02:00
dce87664d2 Important improvements to the player script. Instead of setting model and texture every X seconds, only do it when the player joins (so far)
Add a function which allows registering different frame ranges for different player models

Cosmetic improvements to the player script

More progress on the player animation functions, this commit adds useles code currently
2012-11-25 21:02:01 +02:00
b97400d71d Updated texture from Jordach, and fix the licensing confusion
I forgot frame range definitions need to be per-model, since each model could have its own animations. Specify current ones as being player.x's

Add death animation, and correct many mesh issues I didn't notice last time
2012-11-25 21:02:01 +02:00
abaf4c5121 Remove segmentation of limbs, because I don't like how the arms appeared to shrink during some deformations. This makes the player mesh exactly like the one in MineCraft, and gives people more reasons to complain that we're copying it :P
Rename player to character, to avoid conflicting with the default player sprite

New skin by Jordach

Add licenses to readme for the model and skin

Fix bad mirroring of left arm for player model
2012-11-25 21:02:00 +02:00
609646b9b5 At last, we have a player.
Consists of a simple standi animation currently being looped.

Compatible with any MineCraft skin, no texture included on GIT for licensing reasons.

Walk animations for the player (forward, backward, strafe left and strafe right). This commit removes other test cases from the default script, so that player.lua can be brought to what it's intended for

Punch / mine animation, and some consistency improvements to the player script
2012-11-25 21:02:00 +02:00
04d40a5ce4 Fix attachment test script and unregistered entities. Thanks jin_xi for this 2012-11-25 21:02:00 +02:00
24781813fa b3d, you have failed me. x model format, you're in
Entries for the newly added animation features

Update player script to work with the latest code

Add a test case for attachments. A LUA entity is attached to the player with a specified name 10 seconds after the server starts

Add a detachment test case (5 seconds after attaching)

Update function names, plus add a test case for both player to player and lua-entity to player attachments
2012-11-25 21:02:00 +02:00
0057a87b99 Add script to turn players into meshes, ticks every 1 second
Trigger the player.lua file in init.lua

Commit the ugly and temporary test model and texture. We'll get to a real animated player mesh once the code for that is ready

Set visual_size accordingly so the player model doesn't stretch vertically (default of the sprite player)

Attempt to use the b3d model format, although it doesn't seem to work so far
2012-11-25 21:02:00 +02:00
dfa0f096ce Use full stacks in the creative inventory and add a trash field 2012-11-25 14:09:25 +01:00
e9ad8d06c8 Render nayncat as a cube in inventory 2012-11-24 18:13:43 +01:00
0495f9e209 Rotate the wield image of the shovel for better animation 2012-11-24 17:24:02 +01:00
2ff55cf6cc Update vessels mod 2012-11-24 16:59:49 +01:00
d0638d7284 sandstone should drop itself, and craft back to 4 sand.
Otherwise you lose 3 sand every time you have to dig up sandstone to move it.
2012-11-23 22:23:13 -05:00
6687b5504d Fix a rare bug in leafdecay 2012-11-21 18:05:52 +01:00
c455ba9b68 Fix dry shrubs being placed in cacti and fix incorrect comments 2012-11-20 17:43:46 +01:00
165da9348a Use groups to craft things 2012-11-18 17:47:22 +01:00
fb8144f703 Don't grow papyrus into trees 2012-11-18 17:25:43 +01:00
df2fdba2b4 Make steel block and brick drop themselves when digged and make them craftable back into the their materials 2012-11-12 17:51:48 +01:00
3a7cbfc531 Merge pull request #34 from PilzAdam/selection_box
Add VanessaE's selection box for apples, saplings and papyrus
2012-11-11 09:21:30 -08:00
2768d4974b Add VanessaE's selection box for apples, saplings and papyrus 2012-11-11 18:17:09 +01:00
d317d7b80b Merge pull request #31 from PilzAdam/textures
Add Calinou's improved default textures
2012-11-09 10:32:21 -08:00
91ee23d61b Add Calinou's improved default textures 2012-11-09 19:29:14 +01:00
df3a694099 Swap out pixel-perfect nyan cat by request of Chris Torres 2012-11-09 20:16:14 +02:00
d75b39683a Merge pull request #29 from PilzAdam/bucket
Dont allow the bucket to replace nodes that are not buildable to
2012-11-09 06:40:12 -08:00
68020d2e93 Dont allow the bucket to replace nodes that are not buildable to 2012-11-09 15:25:21 +01:00
f1a447d1fe Merge pull request #26 from PilzAdam/bucket
Follow the naming convention and make the first letter Bucket capitalize...
2012-11-06 11:41:15 -08:00
30d582296b Follow the naming convention and make the first letter Bucket capitalized 2012-11-06 20:38:40 +01:00
36c17b04fe Merge pull request #24 from PilzAdam/water
Update default_water.png to the new water textures
2012-11-04 03:17:20 -08:00
ff9e2a75ee Update default_water.png to the new water textures 2012-11-04 11:55:35 +01:00
5497db98de Merge pull request #21 from PilzAdam/animated_water
Add animation for water
2012-11-02 10:26:04 -07:00
4a68126a2b Add animation for water 2012-11-02 18:24:25 +01:00
5ce918059d Merge pull request #19 from PilzAdam/slabs
Fix slab -> full block transformation
2012-11-02 04:40:49 -07:00
e0fe1a08c5 Fix slab -> full block transformation 2012-11-02 12:28:23 +01:00
25a6cd866b Merge pull request #18 from darkrose/master
stop using hacks for sign input
2012-11-01 11:07:17 -07:00
0ed7ccfc1f Merge pull request #17 from PilzAdam/master
Move falling to builtin
2012-11-01 11:01:35 -07:00
e5502c9415 Move falling to builtin 2012-10-31 19:09:17 +01:00
e5e62f9085 formspec changes 2012-10-29 02:03:27 +10:00
a8a204ae39 Merge pull request #14 from khonkhortisan/patch-2
Emtpy bucket
2012-10-28 09:01:42 -07:00
a399f648e7 Emtpy bucket
-> Empty bucket
2012-10-09 09:05:00 -07:00
87a1e37d34 Update invsize[8,9;] -> size[8,9] 2012-09-03 17:38:32 +03:00
6ad1d56b3d Remove obsolete metadata_name field 2012-09-03 17:30:07 +03:00
Jat
d3d3e76447 Update tile_images 2012-09-03 17:30:05 +03:00
794c68b32b Vessels 2012-09-03 00:22:23 +03:00
0722c8064b Animated torches 2012-09-03 00:22:06 +03:00
d98eab6a84 Fix crash when furnace is full 2012-08-12 17:10:28 +03:00
61a9bb2b47 Fix crash when a player happens to join the server quicker than the creative inventory filler is called 2012-08-12 17:03:05 +03:00
32ee20ebe7 Use working shapeless multigroup recipes for dyeing wool 2012-07-26 13:48:34 +03:00
937ec64ee6 Make wools colorable by any dye (not just the ones in the dye mod) 2012-07-26 04:05:39 +03:00
7db7ea543f Remove some unwanted items from the creative inventory 2012-07-26 00:08:47 +03:00
319ac40fa5 Move creative_inventory to creative 2012-07-25 20:37:47 +03:00
cd4e86773f Add description to bucket to make it show in creative inventory 2012-07-25 18:28:21 +03:00
8643caac3c Add visible page number to creative inventory 2012-07-25 18:18:34 +03:00
81afea1c00 Use new creative mode inventory properly 2012-07-25 18:05:13 +03:00
a29819ebee Add creative mode inventory as a mod 2012-07-25 18:04:25 +03:00
6de625c67f Use improved inventory callbacks 2012-07-25 15:14:36 +03:00
e550a0e26f Update locked chest metadata to new metadata inventory API 2012-07-25 02:40:26 +03:00
8739c4e737 Wool 2012-07-24 18:23:46 +03:00
3ea6096a7a Dyes 2012-07-24 18:20:37 +03:00
f2916c0a31 mods/doors: make variables local 2012-07-24 17:44:26 +03:00
c7b624d67c Remove /give, /giveme, /spawnentity and /pulverize as they are now implemented by the engine 2012-07-23 17:43:47 +03:00
6ba4f01d0b Make fire a tiny bit less eager to jump everywhere 2012-07-21 03:08:59 +03:00
a9da19c590 Merge pull request #3 from sfan5/master
Fix Lava Bucket in Furnace
2012-07-20 13:44:01 -07:00
b1dcbe72aa Merge pull request #2 from cyisfor/master
making rails selectable again.
2012-07-20 13:43:32 -07:00
8c8b4b005e Fix Lava Bucket as Fuel 2012-07-20 08:26:05 +02:00
537344bc62 Make rails selectable.
Rails weren't selectable, and couldn't be removed from a map asides from
using worldedit (or maybe sand)
2012-06-20 04:33:26 +00:00
274f280e10 Add flipped stair recipe for silly minecrafters and make slabs convert to full cubes when placed on each other 2012-06-17 19:47:17 +03:00
3c8d4879a1 Stairs and slabs 2012-06-17 17:46:36 +03:00
d05002ecc0 Rename crack.png to crack_anylength.png as required by new engine (needed for proper texture pack compatibility) 2012-06-16 20:49:37 +03:00
d817c9babe Add flowing lava animation and update some field names 2012-06-16 17:19:35 +03:00
4e996ffa35 Update license in all READMEs (forgot to do that) 2012-06-09 13:33:05 +03:00
1dd62938c1 Use traditional mese texture 2012-06-08 01:43:08 +03:00
9a624d85d0 Change license to LGPLv2/later, as agreed major contributors 2012-06-05 18:58:30 +03:00
a93527dfb6 Proper top/bottom textures for active furnace 2012-06-05 02:13:12 +03:00
fcaacdb4ad Fire visualization in furnace menu 2012-06-04 00:14:45 +03:00
dd9b33db67 Use new node metadata API for chests and furnaces; use cisoun's textures 2012-06-03 22:51:57 +03:00
894f98d878 Fix typo in nyan cat generation 2012-05-20 18:32:58 +03:00
3a1a7d511d Improve style of item descriptions 2012-05-20 16:02:51 +03:00
53e9b0e107 Re-implement nyancat generation in Lua (they don't occur in the exact same spots, though) 2012-05-20 15:30:27 +03:00
216227bac3 Tune ore generation 2012-05-20 14:32:19 +03:00
1a62348e44 Attempt to balance cutting of wood with axes vs. swords 2012-05-20 14:32:01 +03:00
122 changed files with 8602 additions and 744 deletions

View File

@ -6,7 +6,7 @@ To build the wholeness of the Minetest project, insert this repository as
in the Minetest Engine.
The Minetest Engine can be found in:
https://github.com/celeron55/minetest/
https://github.com/minetest/minetest/
Compatibility
--------------
@ -17,7 +17,7 @@ Additionally, when the minetest engine is tagged to be a certain version (eg.
0.4.dev-20120326), minetest_game is tagged with the version too.
When stable releases are made, minetest_game is packaged and made available in
https://github.com/celeron55/minetest_game/downloads
http://minetest.net/download.php
and in case the repository has grown too much, it may be reset. In that sense,
this is not a "real" git repository. (Package maintainers please note!)
@ -27,16 +27,16 @@ Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
See README.txt in each mod directory for information about other authors.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License along
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.

View File

@ -7,11 +7,11 @@ Copyright (C) 2011-2012 Kahrl <kahrl@gmx.net>
Copyright (C) 2011-2012 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 General Public License as published by
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/gpl-2.0.html
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------

View File

@ -40,14 +40,21 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image)
if pointed_thing.type ~= "node" then
return
end
-- Check if pointing to a liquid
-- Check if pointing to a buildable node
n = minetest.env:get_node(pointed_thing.under)
if bucket.liquids[n.name] == nil then
-- Not a liquid
minetest.env:add_node(pointed_thing.above, {name=source})
elseif n.name ~= source then
-- It's a liquid
if minetest.registered_nodes[n.name].buildable_to then
-- buildable; replace the node
minetest.env:add_node(pointed_thing.under, {name=source})
else
-- not buildable to; place the liquid above
-- check if the node above can be replaced
n = minetest.env:get_node(pointed_thing.above)
if minetest.registered_nodes[n.name].buildable_to then
minetest.env:add_node(pointed_thing.above,{name=source})
else
-- do not remove the bucket with the liquid
return
end
end
return {name="bucket:bucket_empty"}
end
@ -56,6 +63,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image)
end
minetest.register_craftitem("bucket:bucket_empty", {
description = "Empty Bucket",
inventory_image = "bucket.png",
stack_max = 1,
liquids_pointable = true,
@ -90,6 +98,6 @@ bucket.register_liquid(
minetest.register_craft({
type = "fuel",
recipe = "default:bucket_lava",
recipe = "bucket:bucket_lava",
burntime = 60,
})

22
mods/creative/README.txt Normal file
View File

@ -0,0 +1,22 @@
Minetest 0.4 mod: creative
==========================
Implements creative mode.
Switch on by using the "creative_mode" setting.
Registered items that
- have a description, and
- do not have the group not_in_creative_inventory
are added to the creative inventory.
License of source code and media files:
---------------------------------------
Copyright (C) 2012 Perttu Ahola (celeron55) <celeron55@gmail.com>
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.

View File

@ -0,0 +1 @@
default

162
mods/creative/init.lua Normal file
View File

@ -0,0 +1,162 @@
-- minetest/creative/init.lua
local creative_inventory = {}
creative_inventory.creative_inventory_size = 0
-- Create detached creative inventory after loading all mods
minetest.after(0, function()
local inv = minetest.create_detached_inventory("creative", {
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
if minetest.setting_getbool("creative_mode") then
return count
else
return 0
end
end,
allow_put = function(inv, listname, index, stack, player)
return 0
end,
allow_take = function(inv, listname, index, stack, player)
if minetest.setting_getbool("creative_mode") then
return -1
else
return 0
end
end,
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
end,
on_put = function(inv, listname, index, stack, player)
end,
on_take = function(inv, listname, index, stack, player)
print(player:get_player_name().." takes item from creative inventory; listname="..dump(listname)..", index="..dump(index)..", stack="..dump(stack))
if stack then
print("stack:get_name()="..dump(stack:get_name())..", stack:get_count()="..dump(stack:get_count()))
end
end,
})
local creative_list = {}
for name,def in pairs(minetest.registered_items) do
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0)
and def.description and def.description ~= "" then
table.insert(creative_list, name)
end
end
table.sort(creative_list)
inv:set_size("main", #creative_list)
for _,itemstring in ipairs(creative_list) do
inv:add_item("main", ItemStack(itemstring))
end
creative_inventory.creative_inventory_size = #creative_list
print("creative inventory size: "..dump(creative_inventory.creative_inventory_size))
end)
-- Create the trash field
local trash = minetest.create_detached_inventory("creative_trash", {
-- Allow the stack to be placed and remove it in on_put()
-- This allows the creative inventory to restore the stack
allow_put = function(inv, listname, index, stack, player)
if minetest.setting_getbool("creative_mode") then
return stack:get_count()
else
return 0
end
end,
on_put = function(inv, listname, index, stack, player)
inv:set_stack(listname, index, "")
end,
})
trash:set_size("main", 1)
creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
pagenum = math.floor(pagenum)
local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1)
player:set_inventory_formspec("size[13,7.5]"..
--"image[6,0.6;1,2;player.png]"..
"list[current_player;main;5,3.5;8,4;]"..
"list[current_player;craft;8,0;3,3;]"..
"list[current_player;craftpreview;12,1;1,1;]"..
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]"..
"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]"..
"button[0.3,6.5;1.6,1;creative_prev;<<]"..
"button[2.7,6.5;1.6,1;creative_next;>>]"..
"label[5,1.5;Trash:]"..
"list[detached:creative_trash;main;5,2;1,1;]")
end
minetest.register_on_joinplayer(function(player)
-- If in creative mode, modify player's inventory forms
if not minetest.setting_getbool("creative_mode") then
return
end
creative_inventory.set_creative_formspec(player, 0, 1)
end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
if not minetest.setting_getbool("creative_mode") then
return
end
-- Figure out current page from formspec
local current_page = 0
local formspec = player:get_inventory_formspec()
local start_i = string.match(formspec, "list%[detached:creative;main;[%d.]+,[%d.]+;[%d.]+,[%d.]+;(%d+)%]")
start_i = tonumber(start_i) or 0
if fields.creative_prev then
start_i = start_i - 4*6
end
if fields.creative_next then
start_i = start_i + 4*6
end
if start_i < 0 then
start_i = start_i + 4*6
end
if start_i >= creative_inventory.creative_inventory_size then
start_i = start_i - 4*6
end
if start_i < 0 or start_i >= creative_inventory.creative_inventory_size then
start_i = 0
end
creative_inventory.set_creative_formspec(player, start_i, start_i / (6*4) + 1)
end)
if minetest.setting_getbool("creative_mode") then
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=2.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

@ -6,11 +6,11 @@ License of source code:
Copyright (C) 2011-2012 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 General Public License as published by
the Free Software Foundation; either version 2 of the License, or
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/gpl-2.0.html
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
@ -47,7 +47,6 @@ Cisoun's WTFPL texture pack:
default_tool_mesepick.png
default_tool_steelpick.png
default_tool_steelshovel.png
default_tool_steelsword.png
default_tool_stonepick.png
default_tool_stoneshovel.png
default_tool_woodpick.png
@ -62,3 +61,35 @@ Originating from G4JC's Almost MC Texture Pack:
default_torch_on_ceiling.png
default_torch_on_floor.png
VanessaE's animated torches (WTFPL):
default_torch_animated.png
default_torch_on_ceiling_animated.png
default_torch_on_floor_animated.png
default_torch_on_floor.png
RealBadAngel's animated water (WTFPL):
default_water_source_animated.png
default_water_flowing_animated.png
VanessaE:
default_nc_back.png
default_nc_front.png
default_nc_rb.png
default_nc_side.png
Calinou's improved default textures (CC BY-SA):
default_brick.png
default_clay_brick.png
default_papyrus.png
default_tool_steelsword.png
MirceaKitsune (WTFPL):
character.x
Jordach (CC BY-SA 3.0):
character.png
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
2: http://www.freesound.org/people/Tomlija/sounds/97669/
3: http://www.freesound.org/people/lsprice/sounds/88808/

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ minetest.register_abm({
local n = minetest.env:get_node(trunkp)
local reg = minetest.registered_nodes[n.name]
-- Assume ignore is a trunk, to make the thing work at the border of the active area
if n.name == "ignore" or (reg.groups.tree and reg.groups.tree ~= 0) then
if n.name == "ignore" or (reg and reg.groups.tree and reg.groups.tree ~= 0) then
--print("cached trunk still exists")
return
end
@ -86,6 +86,7 @@ minetest.register_abm({
end
-- Remove node
minetest.env:remove_node(p0)
nodeupdate(p0)
end
end
})

View File

@ -29,7 +29,7 @@ minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
-- Ore generation
--
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, ore_per_chunk, height_min, height_max)
function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
if maxp.y < height_min or minp.y > height_max then
return
end
@ -38,10 +38,6 @@ local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume,
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
local pr = PseudoRandom(seed)
local num_chunks = math.floor(chunks_per_volume * volume)
local chunk_size = 3
if ore_per_chunk <= 4 then
chunk_size = 2
end
local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
--print("generate_ore num_chunks: "..dump(num_chunks))
for i=1,num_chunks do
@ -73,22 +69,91 @@ end
function default.make_papyrus(pos, size)
for y=0,size-1 do
local p = {x=pos.x, y=pos.y+y, z=pos.z}
local nn = minetest.env:get_node(p).name
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
minetest.env:set_node(p, {name="default:papyrus"})
else
return
end
end
end
function default.make_cactus(pos, size)
for y=0,size-1 do
local p = {x=pos.x, y=pos.y+y, z=pos.z}
local nn = minetest.env:get_node(p).name
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
minetest.env:set_node(p, {name="default:cactus"})
else
return
end
end
end
-- facedir: 0/1/2/3 (head node facedir value)
-- length: length of rainbow tail
function default.make_nyancat(pos, facedir, length)
local tailvec = {x=0, y=0, z=0}
if facedir == 0 then
tailvec.z = 1
elseif facedir == 1 then
tailvec.x = 1
elseif facedir == 2 then
tailvec.z = -1
elseif facedir == 3 then
tailvec.x = -1
else
print("default.make_nyancat(): Invalid facedir: "+dump(facedir))
facedir = 0
tailvec.z = 1
end
local p = {x=pos.x, y=pos.y, z=pos.z}
minetest.env:set_node(p, {name="default:nyancat", param2=facedir})
for i=1,length do
p.x = p.x + tailvec.x
p.z = p.z + tailvec.z
minetest.env:set_node(p, {name="default:nyancat_rainbow"})
end
end
function generate_nyancats(seed, minp, maxp)
local height_min = -31000
local height_max = -32
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
local pr = PseudoRandom(seed + 9324342)
local max_num_nyancats = math.floor(volume / (16*16*16))
for i=1,max_num_nyancats do
if pr:next(0, 1000) == 0 then
local x0 = pr:next(minp.x, maxp.x)
local y0 = pr:next(minp.y, maxp.y)
local z0 = pr:next(minp.z, maxp.z)
local p0 = {x=x0, y=y0, z=z0}
default.make_nyancat(p0, pr:next(0,3), pr:next(3,15))
end
end
end
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed, 1/8/8/8, 5, -31000, 64)
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/16/16/16, 5, -5, 7)
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/12/12/12, 5, -16, -5)
generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/9/9/9, 5, -31000, -17)
-- Generate regular ores
default.generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+0, 1/8/8/8, 3, 8, -31000, 64)
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/12/12/12, 2, 3, -15, 2)
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/9/9/9, 3, 5, -63, -16)
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/7/7/7, 3, 5, -31000, -64)
default.generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+4, 1/16/16/16, 2, 3, -127, -64)
default.generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+5, 1/9/9/9, 3, 5, -31000, -128)
default.generate_ore("default:mese", "default:stone", minp, maxp, seed+8, 1/16/16/16, 2, 3, -31000,-1024)
default.generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+7, 1/24/24/24, 6,27, -31000, 0)
default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+6, 1/24/24/24, 6,27, -31000, -64)
if maxp.y >= 2 and minp.y <= 0 then
-- Generate clay
-- Assume X and Z lengths are equal
@ -183,7 +248,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
end
end
-- Generate dry shrubs
-- Generate grass
local perlin1 = minetest.env:get_perlin(329, 3, 0.6, 100)
-- Assume X and Z lengths are equal
local divlen = 16
@ -194,11 +259,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
local z0 = minp.z + math.floor((divz+0)*divlen)
local x1 = minp.x + math.floor((divx+1)*divlen)
local z1 = minp.z + math.floor((divz+1)*divlen)
-- Determine cactus amount from perlin noise
local cactus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0)
-- Find random positions for cactus based on this random
-- Determine grass amount from perlin noise
local grass_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0)
-- Find random positions for grass based on this random
local pr = PseudoRandom(seed+1)
for i=0,cactus_amount do
for i=0,grass_amount do
local x = pr:next(x0, x1)
local z = pr:next(z0, z1)
-- Find ground level (0...15)
@ -209,13 +274,31 @@ minetest.register_on_generated(function(minp, maxp, seed)
break
end
end
-- If desert sand, make cactus
if ground_y and minetest.env:get_node({x=x,y=ground_y,z=z}).name == "default:desert_sand" then
minetest.env:set_node({x=x,y=ground_y+1,z=z}, {name="default:dry_shrub"})
end
if ground_y then
local p = {x=x,y=ground_y+1,z=z}
local nn = minetest.env:get_node(p).name
-- Check if the node can be replaced
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
nn = minetest.env:get_node({x=x,y=ground_y,z=z}).name
-- If desert sand, make dry shrub
if nn == "default:desert_sand" then
minetest.env:set_node(p,{name="default:dry_shrub"})
-- If grass, make junglegrass
elseif nn == "default:dirt_with_grass" then
minetest.env:set_node(p,{name="default:junglegrass"})
end
end
end
end
end
end
end
-- Generate nyan cats
generate_nyancats(seed, minp, maxp)
end)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

File diff suppressed because it is too large Load Diff

132
mods/default/player.lua Normal file
View File

@ -0,0 +1,132 @@
-- Minetest 0.4 mod: player
-- See README.txt for licensing and other information.
--
-- Start of configuration area:
--
-- Player animation speed
animation_speed = 30
-- Player animation blending
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
animation_blend = 0
-- Default player appearance
default_model = "character.x"
default_textures = {"character.png", }
-- Frame ranges for each player model
function player_get_animations(model)
if model == "character.x" then
return {
stand_START = 0,
stand_END = 79,
sit_START = 81,
sit_END = 160,
lay_START = 162,
lay_END = 166,
walk_START = 168,
walk_END = 187,
mine_START = 189,
mine_END = 198,
walk_mine_START = 200,
walk_mine_END = 219
}
end
end
--
-- End of configuration area.
--
-- Player stats and animations
local player_model = {}
local player_anim = {}
local player_sneak = {}
local ANIM_STAND = 1
local ANIM_SIT = 2
local ANIM_LAY = 3
local ANIM_WALK = 4
local ANIM_WALK_MINE = 5
local ANIM_MINE = 6
-- Called when a player's appearance needs to be updated
function player_update_visuals(pl)
local name = pl:get_player_name()
player_model[name] = default_model
player_anim[name] = 0 -- Animation will be set further below immediately
player_sneak[name] = false
prop = {
mesh = default_model,
textures = default_textures,
visual = "mesh",
visual_size = {x=1, y=1},
}
pl:set_properties(prop)
end
-- Update appearance when the player joins
minetest.register_on_joinplayer(player_update_visuals)
-- Check each player and apply animations
function player_step(dtime)
for _, pl in pairs(minetest.get_connected_players()) do
local name = pl:get_player_name()
local anim = player_get_animations(player_model[name])
local controls = pl:get_player_control()
local walking = false
local animation_speed_mod = animation_speed
-- Determine if the player is walking
if controls.up or controls.down or controls.left or controls.right then
walking = true
end
-- Determine if the player is sneaking, and reduce animation speed if so
if controls.sneak and pl:get_hp() ~= 0 and (walking or controls.LMB) then
animation_speed_mod = animation_speed_mod / 2
-- Refresh player animation below if sneak state changed
if not player_sneak[name] then
player_anim[name] = 0
player_sneak[name] = true
end
else
-- Refresh player animation below if sneak state changed
if player_sneak[name] then
player_anim[name] = 0
player_sneak[name] = false
end
end
-- Apply animations based on what the player is doing
if pl:get_hp() == 0 then
if player_anim[name] ~= ANIM_LAY then
pl:set_animation({x=anim.lay_START, y=anim.lay_END}, animation_speed_mod, animation_blend)
player_anim[name] = ANIM_LAY
end
elseif walking and controls.LMB then
if player_anim[name] ~= ANIM_WALK_MINE then
pl:set_animation({x=anim.walk_mine_START, y=anim.walk_mine_END}, animation_speed_mod, animation_blend)
player_anim[name] = ANIM_WALK_MINE
end
elseif walking then
if player_anim[name] ~= ANIM_WALK then
pl:set_animation({x=anim.walk_START, y=anim.walk_END}, animation_speed_mod, animation_blend)
player_anim[name] = ANIM_WALK
end
elseif controls.LMB then
if player_anim[name] ~= ANIM_MINE then
pl:set_animation({x=anim.mine_START, y=anim.mine_END}, animation_speed_mod, animation_blend)
player_anim[name] = ANIM_MINE
end
elseif player_anim[name] ~= ANIM_STAND then
pl:set_animation({x=anim.stand_START, y=anim.stand_END}, animation_speed_mod, animation_blend)
player_anim[name] = ANIM_STAND
end
end
end
minetest.register_globalstep(player_step)
-- END

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 B

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 B

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 936 B

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 672 B

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 B

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 352 B

BIN
mods/default/textures/default_tool_steelsword.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 483 B

View File

@ -1,43 +1,23 @@
Minetest 0.4 mod: doors
========================
=======================
License of source code:
-----------------------
Original license text:
-- (c) 2011 Fernando Zapata
-- Code licensed under GNU GPLv3
-- Content licensed under CC BY-SA 3.0
-- 2012-01-08 11:03:57
Copyright (C) 2012 PilzAdam
There has been unsuccesful attempts to contact the original author. Thus,
based on the intentions of the author, it is assumed that this code is
distributable and modifiable under GPLv2+later, under which Minetest is
distributed.
Modifications:
Copyright (C) 2012 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 General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/gpl-2.0.html
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.
License of media (textures and sounds)
--------------------------------------
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>
From the original zlpdoors mod by Fernando Zapata:
Textures created by Fernando Zapata (CC BY-SA 3.0):
door_wood.png
door_wood_a.png
door_wood_a_r.png
door_wood_b.png
door_wood_b_r.png
door_wood.png
All other textures (created by PilzAdam): WTFPL

View File

@ -1,205 +1,295 @@
-- Minetest 0.4 mod: doors
-- See README.txt for licensing and other information.
--------------------------------------------------------------------------------
doors = {}
local WALLMX = 3
local WALLMZ = 5
local WALLPX = 2
local WALLPZ = 4
-- Registers a door
-- name: The name of the door
-- def: a table with the folowing fields:
-- description
-- inventory_image
-- groups
-- tiles_bottom: the tiles of the bottom part of the door {front, side}
-- tiles_top: the tiles of the bottom part of the door {front, side}
-- If the following fields are not defined the default values are used
-- node_box_bottom
-- node_box_top
-- selection_box_bottom
-- selection_box_top
-- only_placer_can_open: if true only the player who placed the door can
-- open it
function doors:register_door(name, def)
def.groups.not_in_creative_inventory = 1
--------------------------------------------------------------------------------
local box = {{-0.5, -0.5, -0.5, 0.5, 0.5, -0.5+1.5/16}}
minetest.register_alias('door', 'doors:door_wood')
minetest.register_alias('door_wood', 'doors:door_wood')
if not def.node_box_bottom then
def.node_box_bottom = box
end
if not def.node_box_top then
def.node_box_top = box
end
if not def.selection_box_bottom then
def.selection_box_bottom= box
end
if not def.selection_box_top then
def.selection_box_top = box
end
minetest.register_node( 'doors:door_wood', {
description = 'Wooden Door',
drawtype = 'signlike',
tile_images = { 'door_wood.png' },
inventory_image = 'door_wood.png',
wield_image = 'door_wood.png',
paramtype2 = 'wallmounted',
selection_box = { type = 'wallmounted' },
groups = { choppy=2, dig_immediate=2 },
})
minetest.register_craftitem(name, {
description = def.description,
inventory_image = def.inventory_image,
minetest.register_craft( {
output = 'doors:door_wood',
recipe = {
{ 'default:wood', 'default:wood' },
{ 'default:wood', 'default:wood' },
{ 'default:wood', 'default:wood' },
on_place = function(itemstack, placer, pointed_thing)
if not pointed_thing.type == "node" then
return itemstack
end
local ptu = pointed_thing.under
local nu = minetest.env:get_node(ptu)
if minetest.registered_nodes[nu.name].on_rightclick then
return minetest.registered_nodes[nu.name].on_rightclick(ptu, nu, placer, itemstack)
end
local pt = pointed_thing.above
local pt2 = {x=pt.x, y=pt.y, z=pt.z}
pt2.y = pt2.y+1
if
not minetest.registered_nodes[minetest.env:get_node(pt).name].buildable_to or
not minetest.registered_nodes[minetest.env:get_node(pt2).name].buildable_to or
not placer or
not placer:is_player()
then
return itemstack
end
local p2 = minetest.dir_to_facedir(placer:get_look_dir())
local pt3 = {x=pt.x, y=pt.y, z=pt.z}
if p2 == 0 then
pt3.x = pt3.x-1
elseif p2 == 1 then
pt3.z = pt3.z+1
elseif p2 == 2 then
pt3.x = pt3.x+1
elseif p2 == 3 then
pt3.z = pt3.z-1
end
if not string.find(minetest.env:get_node(pt3).name, name.."_b_") then
minetest.env:set_node(pt, {name=name.."_b_1", param2=p2})
minetest.env:set_node(pt2, {name=name.."_t_1", param2=p2})
else
minetest.env:set_node(pt, {name=name.."_b_2", param2=p2})
minetest.env:set_node(pt2, {name=name.."_t_2", param2=p2})
end
if def.only_placer_can_open then
local pn = placer:get_player_name()
local meta = minetest.env:get_meta(pt)
meta:set_string("doors_owner", pn)
meta:set_string("infotext", "Owned by "..pn)
meta = minetest.env:get_meta(pt2)
meta:set_string("doors_owner", pn)
meta:set_string("infotext", "Owned by "..pn)
end
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
})
local tt = def.tiles_top
local tb = def.tiles_bottom
local function after_dig_node(pos, name)
if minetest.env:get_node(pos).name == name then
minetest.env:remove_node(pos)
end
end
local function on_rightclick(pos, dir, check_name, replace, replace_dir, params)
pos.y = pos.y+dir
if not minetest.env:get_node(pos).name == check_name then
return
end
local p2 = minetest.env:get_node(pos).param2
p2 = params[p2+1]
local meta = minetest.env:get_meta(pos):to_table()
minetest.env:set_node(pos, {name=replace_dir, param2=p2})
minetest.env:get_meta(pos):from_table(meta)
pos.y = pos.y-dir
meta = minetest.env:get_meta(pos):to_table()
minetest.env:set_node(pos, {name=replace, param2=p2})
minetest.env:get_meta(pos):from_table(meta)
end
local function check_player_priv(pos, player)
if not def.only_placer_can_open then
return true
end
local meta = minetest.env:get_meta(pos)
local pn = player:get_player_name()
return meta:get_string("doors_owner") == pn
end
minetest.register_node(name.."_b_1", {
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"},
paramtype = "light",
paramtype2 = "facedir",
drop = name,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = def.node_box_bottom
},
selection_box = {
type = "fixed",
fixed = def.selection_box_bottom
},
groups = def.groups,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
pos.y = pos.y+1
after_dig_node(pos, name.."_t_1")
end,
on_rightclick = function(pos, node, clicker)
if check_player_priv(pos, clicker) then
on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
end
end,
can_dig = check_player_priv,
})
minetest.register_node(name.."_t_1", {
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"},
paramtype = "light",
paramtype2 = "facedir",
drop = name,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = def.node_box_top
},
selection_box = {
type = "fixed",
fixed = def.selection_box_top
},
groups = def.groups,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
pos.y = pos.y-1
after_dig_node(pos, name.."_b_1")
end,
on_rightclick = function(pos, node, clicker)
if check_player_priv(pos, clicker) then
on_rightclick(pos, -1, name.."_b_1", name.."_t_2", name.."_b_2", {1,2,3,0})
end
end,
can_dig = check_player_priv,
})
minetest.register_node(name.."_b_2", {
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]},
paramtype = "light",
paramtype2 = "facedir",
drop = name,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = def.node_box_bottom
},
selection_box = {
type = "fixed",
fixed = def.selection_box_bottom
},
groups = def.groups,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
pos.y = pos.y+1
after_dig_node(pos, name.."_t_2")
end,
on_rightclick = function(pos, node, clicker)
if check_player_priv(pos, clicker) then
on_rightclick(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2})
end
end,
can_dig = check_player_priv,
})
minetest.register_node(name.."_t_2", {
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]},
paramtype = "light",
paramtype2 = "facedir",
drop = name,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = def.node_box_top
},
selection_box = {
type = "fixed",
fixed = def.selection_box_top
},
groups = def.groups,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
pos.y = pos.y-1
after_dig_node(pos, name.."_b_2")
end,
on_rightclick = function(pos, node, clicker)
if check_player_priv(pos, clicker) then
on_rightclick(pos, -1, name.."_b_2", name.."_t_1", name.."_b_1", {3,0,1,2})
end
end,
can_dig = check_player_priv,
})
end
doors:register_door("doors:door_wood", {
description = "Wooden Door",
inventory_image = "door_wood.png",
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
tiles_bottom = {"door_wood_b.png", "door_brown.png"},
tiles_top = {"door_wood_a.png", "door_brown.png"},
})
minetest.register_craft({
type = 'fuel',
recipe = 'doors:door_wood',
burntime = 30,
output = "doors:door_wood",
recipe = {
{"group:wood", "group:wood"},
{"group:wood", "group:wood"},
{"group:wood", "group:wood"}
}
})
minetest.register_node( 'doors:door_wood_a_c', {
Description = 'Top Closed Door',
drawtype = 'signlike',
tile_images = { 'door_wood_a.png' },
inventory_image = 'door_wood_a.png',
paramtype = 'light',
paramtype2 = 'wallmounted',
walkable = true,
selection_box = { type = "wallmounted", },
groups = { choppy=2, dig_immediate=2 },
legacy_wallmounted = true,
drop = 'doors:door_wood',
doors:register_door("doors:door_steel", {
description = "Steel Door",
inventory_image = "door_steel.png",
groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2,door=1},
tiles_bottom = {"door_steel_b.png", "door_grey.png"},
tiles_top = {"door_steel_a.png", "door_grey.png"},
only_placer_can_open = true,
})
minetest.register_node( 'doors:door_wood_b_c', {
Description = 'Bottom Closed Door',
drawtype = 'signlike',
tile_images = { 'door_wood_b.png' },
inventory_image = 'door_wood_b.png',
paramtype = 'light',
paramtype2 = 'wallmounted',
walkable = true,
selection_box = { type = "wallmounted", },
groups = { choppy=2, dig_immediate=2 },
legacy_wallmounted = true,
drop = 'doors:door_wood',
minetest.register_craft({
output = "doors:door_steel",
recipe = {
{"default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot"}
}
})
minetest.register_node( 'doors:door_wood_a_o', {
Description = 'Top Open Door',
drawtype = 'signlike',
tile_images = { 'door_wood_a_r.png' },
inventory_image = 'door_wood_a_r.png',
paramtype = 'light',
paramtype2 = 'wallmounted',
walkable = false,
selection_box = { type = "wallmounted", },
groups = { choppy=2, dig_immediate=2 },
legacy_wallmounted = true,
drop = 'doors:door_wood',
})
minetest.register_node( 'doors:door_wood_b_o', {
Description = 'Bottom Open Door',
drawtype = 'signlike',
tile_images = { 'door_wood_b_r.png' },
inventory_image = 'door_wood_b_r.png',
paramtype = 'light',
paramtype2 = 'wallmounted',
walkable = false,
selection_box = { type = "wallmounted", },
groups = { choppy=2, dig_immediate=2 },
legacy_wallmounted = true,
drop = 'doors:door_wood',
})
--------------------------------------------------------------------------------
local round = function( n )
if n >= 0 then
return math.floor( n + 0.5 )
else
return math.ceil( n - 0.5 )
end
end
local on_door_placed = function( pos, node, placer )
if node.name ~= 'doors:door_wood' then return end
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
und = minetest.env:get_node( upos )
abv = minetest.env:get_node( apos )
dir = placer:get_look_dir()
if round( dir.x ) == 1 then
newparam = WALLMX
elseif round( dir.x ) == -1 then
newparam = WALLPX
elseif round( dir.z ) == 1 then
newparam = WALLMZ
elseif round( dir.z ) == -1 then
newparam = WALLPZ
end
if und.name == 'air' then
minetest.env:add_node( pos, { name = 'doors:door_wood_a_c', param2 = newparam } )
minetest.env:add_node( upos, { name = 'doors:door_wood_b_c', param2 = newparam } )
elseif abv.name == 'air' then
minetest.env:add_node( pos, { name = 'doors:door_wood_b_c', param2 = newparam } )
minetest.env:add_node( apos, { name = 'doors:door_wood_a_c', param2 = newparam } )
else
minetest.env:remove_node( pos )
placer:get_inventory():add_item( "main", 'doors:door_wood' )
minetest.chat_send_player( placer:get_player_name(), 'not enough space' )
end
end
local on_door_punched = function( pos, node, puncher )
if string.find( node.name, 'doors:door_wood' ) == nil then return end
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
if string.find( node.name, '_c', -2 ) ~= nil then
if node.param2 == WALLPX then
newparam = WALLMZ
elseif node.param2 == WALLMZ then
newparam = WALLMX
elseif node.param2 == WALLMX then
newparam = WALLPZ
elseif node.param2 == WALLPZ then
newparam = WALLPX
end
elseif string.find( node.name, '_o', -2 ) ~= nil then
if node.param2 == WALLMZ then
newparam = WALLPX
elseif node.param2 == WALLMX then
newparam = WALLMZ
elseif node.param2 == WALLPZ then
newparam = WALLMX
elseif node.param2 == WALLPX then
newparam = WALLPZ
end
end
if ( node.name == 'doors:door_wood_a_c' ) then
minetest.env:add_node( pos, { name = 'doors:door_wood_a_o', param2 = newparam } )
minetest.env:add_node( upos, { name = 'doors:door_wood_b_o', param2 = newparam } )
elseif ( node.name == 'doors:door_wood_b_c' ) then
minetest.env:add_node( pos, { name = 'doors:door_wood_b_o', param2 = newparam } )
minetest.env:add_node( apos, { name = 'doors:door_wood_a_o', param2 = newparam } )
elseif ( node.name == 'doors:door_wood_a_o' ) then
minetest.env:add_node( pos, { name = 'doors:door_wood_a_c', param2 = newparam } )
minetest.env:add_node( upos, { name = 'doors:door_wood_b_c', param2 = newparam } )
elseif ( node.name == 'doors:door_wood_b_o' ) then
minetest.env:add_node( pos, { name = 'doors:door_wood_b_c', param2 = newparam } )
minetest.env:add_node( apos, { name = 'doors:door_wood_a_c', param2 = newparam } )
end
end
local on_door_digged = function( pos, node, digger )
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
if ( node.name == 'doors:door_wood_a_c' ) or ( node.name == 'doors:door_wood_a_o' ) then
minetest.env:remove_node( upos )
elseif ( node.name == 'doors:door_wood_b_c' ) or ( node.name == 'doors:door_wood_b_o' ) then
minetest.env:remove_node( apos )
end
end
--------------------------------------------------------------------------------
minetest.register_on_placenode( on_door_placed )
minetest.register_on_punchnode( on_door_punched )
minetest.register_on_dignode( on_door_digged )
--------------------------------------------------------------------------------
minetest.register_alias("doors:door_wood_a_c", "doors:door_wood_t_1")
minetest.register_alias("doors:door_wood_a_o", "doors:door_wood_t_1")
minetest.register_alias("doors:door_wood_b_c", "doors:door_wood_b_1")
minetest.register_alias("doors:door_wood_b_o", "doors:door_wood_b_1")

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

15
mods/dye/README.txt Normal file
View File

@ -0,0 +1,15 @@
Minetest 0.4 mod: dye
======================
See init.lua for documentation.
License of source code and media files:
---------------------------------------
Copyright (C) 2012 Perttu Ahola (celeron55) <celeron55@gmail.com>
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.

0
mods/dye/depends.txt Normal file
View File

134
mods/dye/init.lua Normal file
View File

@ -0,0 +1,134 @@
-- minetest/dye/init.lua
-- To make recipes that will work with any dye ever made by anybody, define
-- them based on groups.
-- You can select any group of groups, based on your need for amount of colors.
-- basecolor: 9, excolor: 17, unicolor: 89
--
-- Example of one shapeless recipe using a color group:
-- Note: As this uses basecolor_*, you'd need 9 of these.
-- minetest.register_craft({
-- type = "shapeless",
-- output = '<mod>:item_yellow',
-- recipe = {'<mod>:item_no_color', 'group:basecolor_yellow'},
-- })
-- Other mods can use these for looping through available colors
local dye = {}
dye.basecolors = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta"}
dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow", "lime", "green", "aqua", "cyan", "sky_blue", "blue", "violet", "magenta", "red_violet"}
-- Base color groups:
-- - basecolor_white
-- - basecolor_grey
-- - basecolor_black
-- - basecolor_red
-- - basecolor_yellow
-- - basecolor_green
-- - basecolor_cyan
-- - basecolor_blue
-- - basecolor_magenta
-- Extended color groups (* = equal to a base color):
-- * excolor_white
-- - excolor_lightgrey
-- * excolor_grey
-- - excolor_darkgrey
-- * excolor_black
-- * excolor_red
-- - excolor_orange
-- * excolor_yellow
-- - excolor_lime
-- * excolor_green
-- - excolor_aqua
-- * excolor_cyan
-- - excolor_sky_blue
-- * excolor_blue
-- - excolor_violet
-- * excolor_magenta
-- - excolor_red_violet
-- The whole unifieddyes palette as groups:
-- - unicolor_<excolor>
-- For the following, no white/grey/black is allowed:
-- - unicolor_medium_<excolor>
-- - unicolor_dark_<excolor>
-- - unicolor_light_<excolor>
-- - unicolor_<excolor>_s50
-- - unicolor_medium_<excolor>_s50
-- - unicolor_dark_<excolor>_s50
-- Local stuff
local dyelocal = {}
-- This collection of colors is partly a historic thing, partly something else.
dyelocal.dyes = {
{"white", "White dye", {dye=1, basecolor_white=1, excolor_white=1, unicolor_white=1}},
{"grey", "Grey dye", {dye=1, basecolor_grey=1, excolor_grey=1, unicolor_grey=1}},
{"dark_grey", "Dark grey dye", {dye=1, basecolor_grey=1, excolor_darkgrey=1, unicolor_darkgrey=1}},
{"black", "Black dye", {dye=1, basecolor_black=1, excolor_black=1, unicolor_black=1}},
{"violet", "Violet dye", {dye=1, basecolor_magenta=1, excolor_violet=1, unicolor_violet=1}},
{"blue", "Blue dye", {dye=1, basecolor_blue=1, excolor_blue=1, unicolor_blue=1}},
{"cyan", "Cyan dye", {dye=1, basecolor_cyan=1, excolor_cyan=1, unicolor_cyan=1}},
{"dark_green", "Dark green dye",{dye=1, basecolor_green=1, excolor_green=1, unicolor_dark_green=1}},
{"green", "Green dye", {dye=1, basecolor_green=1, excolor_green=1, unicolor_green=1}},
{"yellow", "Yellow dye", {dye=1, basecolor_yellow=1, excolor_yellow=1, unicolor_yellow=1}},
{"brown", "Brown dye", {dye=1, basecolor_yellow=1, excolor_orange=1, unicolor_dark_orange=1}},
{"orange", "Orange dye", {dye=1, basecolor_orange=1, excolor_orange=1, unicolor_orange=1}},
{"red", "Red dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_red=1}},
{"magenta", "Magenta dye", {dye=1, basecolor_magenta=1, excolor_red_violet=1,unicolor_red_violet=1}},
{"pink", "Pink dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_light_red=1}},
}
-- Define items
for _, row in ipairs(dyelocal.dyes) do
local name = row[1]
local description = row[2]
local groups = row[3]
local item_name = "dye:"..name
local item_image = "dye_"..name..".png"
minetest.register_craftitem(item_name, {
inventory_image = item_image,
description = description,
groups = groups
})
end
-- Mix recipes
-- Just mix everything to everything somehow sanely
dyelocal.mixbases = {"magenta", "red", "orange", "brown", "yellow", "green", "dark_green", "cyan", "blue", "violet", "black", "dark_grey", "grey", "white"}
dyelocal.mixes = {
-- magenta, red, orange, brown, yellow, green, dark_green, cyan, blue, violet, black, dark_grey, grey, white
white = {"pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet", "grey", "grey", "white", "white"},
grey = {"pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "pink", "dark_grey","grey", "grey"},
dark_grey={"brown","brown", "brown", "brown", "brown","dark_green","dark_green","blue","blue","violet","black", "black"},
black = {"black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black"},
violet= {"magenta","magenta","red", "brown", "red", "cyan", "brown", "blue", "violet","violet"},
blue = {"violet", "magenta","brown","brown","dark_green","cyan","cyan", "cyan", "blue"},
cyan = {"blue","brown","dark_green","dark_grey","green","cyan","dark_green","cyan"},
dark_green={"brown","brown","brown", "brown", "green", "green", "dark_green"},
green = {"brown", "yellow","yellow","dark_green","green","green"},
yellow= {"red", "orange", "yellow","orange", "yellow"},
brown = {"brown", "brown","orange", "brown"},
orange= {"red", "orange","orange"},
red = {"magenta","red"},
magenta={"magenta"},
}
for one,results in pairs(dyelocal.mixes) do
for i,result in ipairs(results) do
local another = dyelocal.mixbases[i]
minetest.register_craft({
type = "shapeless",
output = 'dye:'..result..' 2',
recipe = {'dye:'..one, 'dye:'..another},
})
end
end
-- Hide dyelocal
dyelocal = nil
-- EOF

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

View File

@ -6,11 +6,11 @@ License of source code:
Copyright (C) 2012 Perttu Ahola (celeron55) <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/gpl-2.0.html
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
@ -28,3 +28,5 @@ fire_small.ogg sampled from:
fire_large.ogg sampled from:
http://www.freesound.org/people/Dynamicell/sounds/17548/
fire_basic_flame_animated.png:
Muadtralk

View File

@ -2,15 +2,29 @@
minetest.register_node("fire:basic_flame", {
description = "Fire",
drawtype = "glasslike",
tile_images = {"fire_basic_flame.png"},
drawtype = "plantlike",
tiles = {{
name="fire_basic_flame_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
}},
inventory_image = "fire_basic_flame.png",
light_source = 14,
groups = {igniter=3,dig_immediate=3},
groups = {igniter=2,dig_immediate=3},
drop = '',
walkable = false,
buildable_to = true,
damage_per_second = 4,
after_place_node = function(pos, placer)
fire.on_flame_add_at(pos)
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
fire.on_flame_remove_at(pos)
end,
})
local fire = {}
fire = {}
fire.D = 6
-- key: position hash of low corner of area
-- value: {handle=sound handle, name=sound name}
@ -88,18 +102,6 @@ function fire.flame_should_extinguish(pos)
return (#ps ~= 0)
end
minetest.register_on_placenode(function(pos, newnode, placer)
if newnode.name == "fire:basic_flame" then
fire.on_flame_add_at(pos)
end
end)
minetest.register_on_dignode(function(pos, oldnode, digger)
if oldnode.name == "fire:basic_flame" then
fire.on_flame_remove_at(pos)
end
end)
-- Ignite neighboring nodes
minetest.register_abm({
nodenames = {"group:flammable"},
@ -177,6 +179,7 @@ minetest.register_abm({
return
end
minetest.env:remove_node(p)
nodeupdate(p)
end
else
-- remove flame

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -102,6 +102,7 @@ minetest.register_craftitem(":cooked_rat", {
minetest.register_craftitem(":firefly", {
description = "Firefly",
inventory_image = "firefly.png",
groups = {not_in_creative_inventory=1},
on_drop = function(item, dropper, pos)
minetest.env:add_firefly(pos)
item:take_item()

26
mods/stairs/README.txt Normal file
View File

@ -0,0 +1,26 @@
Minetest 0.4 mod: stairs
=========================
License of source code:
-----------------------
Copyright (C) 2011-2012 Kahrl <kahrl@gmx.net>
Copyright (C) 2011-2012 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 2 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
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>

1
mods/stairs/depends.txt Normal file
View File

@ -0,0 +1 @@
default

260
mods/stairs/init.lua Normal file
View File

@ -0,0 +1,260 @@
-- Minetest 0.4 mod: stairs
-- See README.txt for licensing and other information.
stairs = {}
-- Node will be called stairs:stair_<subname>
function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
minetest.register_node(":stairs:stair_" .. subname, {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
sounds = sounds,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
},
},
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return itemstack
end
local p0 = pointed_thing.under
local p1 = pointed_thing.above
if p0.y-1 == p1.y then
local fakestack = ItemStack("stairs:stair_" .. subname.."upside_down")
local ret = minetest.item_place(fakestack, placer, pointed_thing)
if ret:is_empty() then
itemstack:take_item()
return itemstack
end
end
-- Otherwise place regularly
return minetest.item_place(itemstack, placer, pointed_thing)
end,
})
minetest.register_node(":stairs:stair_" .. subname.."upside_down", {
drop = "stairs:stair_" .. subname,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
sounds = sounds,
node_box = {
type = "fixed",
fixed = {
{-0.5, 0, -0.5, 0.5, 0.5, 0.5},
{-0.5, -0.5, 0, 0.5, 0, 0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, 0, -0.5, 0.5, 0.5, 0.5},
{-0.5, -0.5, 0, 0.5, 0, 0.5},
},
},
})
minetest.register_craft({
output = 'stairs:stair_' .. subname .. ' 4',
recipe = {
{recipeitem, "", ""},
{recipeitem, recipeitem, ""},
{recipeitem, recipeitem, recipeitem},
},
})
-- Flipped recipe for the silly minecrafters
minetest.register_craft({
output = 'stairs:stair_' .. subname .. ' 4',
recipe = {
{"", "", recipeitem},
{"", recipeitem, recipeitem},
{recipeitem, recipeitem, recipeitem},
},
})
end
-- Node will be called stairs:slab_<subname>
function stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
minetest.register_node(":stairs:slab_" .. subname, {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
is_ground_content = true,
groups = groups,
sounds = sounds,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return itemstack
end
-- If it's being placed on an another similar one, replace it with
-- a full block
local slabpos = nil
local slabnode = nil
local p0 = pointed_thing.under
local p1 = pointed_thing.above
local n0 = minetest.env:get_node(p0)
if n0.name == "stairs:slab_" .. subname and
p0.y+1 == p1.y then
slabpos = p0
slabnode = n0
end
if slabpos then
-- Remove the slab at slabpos
minetest.env:remove_node(slabpos)
-- Make a fake stack of a single item and try to place it
local fakestack = ItemStack(recipeitem)
pointed_thing.above = slabpos
fakestack = minetest.item_place(fakestack, placer, pointed_thing)
-- If the item was taken from the fake stack, decrement original
if not fakestack or fakestack:is_empty() then
itemstack:take_item(1)
-- Else put old node back
else
minetest.env:set_node(slabpos, slabnode)
end
return itemstack
end
-- Upside down slabs
if p0.y-1 == p1.y then
-- Turn into full block if pointing at a existing slab
if n0.name == "stairs:slab_" .. subname.."upside_down" then
-- Remove the slab at the position of the slab
minetest.env:remove_node(p0)
-- Make a fake stack of a single item and try to place it
local fakestack = ItemStack(recipeitem)
pointed_thing.above = p0
fakestack = minetest.item_place(fakestack, placer, pointed_thing)
-- If the item was taken from the fake stack, decrement original
if not fakestack or fakestack:is_empty() then
itemstack:take_item(1)
-- Else put old node back
else
minetest.env:set_node(p0, n0)
end
return itemstack
end
-- Place upside down slab
local fakestack = ItemStack("stairs:slab_" .. subname.."upside_down")
local ret = minetest.item_place(fakestack, placer, pointed_thing)
if ret:is_empty() then
itemstack:take_item()
return itemstack
end
end
-- If pointing at the side of a upside down slab
if n0.name == "stairs:slab_" .. subname.."upside_down" and
p0.y+1 ~= p1.y then
-- Place upside down slab
local fakestack = ItemStack("stairs:slab_" .. subname.."upside_down")
local ret = minetest.item_place(fakestack, placer, pointed_thing)
if ret:is_empty() then
itemstack:take_item()
return itemstack
end
end
-- Otherwise place regularly
return minetest.item_place(itemstack, placer, pointed_thing)
end,
})
minetest.register_node(":stairs:slab_" .. subname.."upside_down", {
drop = "stairs:slab_"..subname,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
is_ground_content = true,
groups = groups,
sounds = sounds,
node_box = {
type = "fixed",
fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
},
})
minetest.register_craft({
output = 'stairs:slab_' .. subname .. ' 3',
recipe = {
{recipeitem, recipeitem, recipeitem},
},
})
end
-- Nodes will be called stairs:{stair,slab}_<subname>
function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds)
stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds)
end
stairs.register_stair_and_slab("wood", "default:wood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2},
{"default_wood.png"},
"Wooden stair",
"Wooden slab",
default.node_sound_wood_defaults())
stairs.register_stair_and_slab("stone", "default:stone",
{cracky=3},
{"default_stone.png"},
"Stone stair",
"Stone slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("cobble", "default:cobble",
{cracky=3},
{"default_cobble.png"},
"Cobble stair",
"Cobble slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("brick", "default:brick",
{cracky=3},
{"default_brick.png"},
"Brick stair",
"Brick slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("sandstone", "default:sandstone",
{crumbly=2,cracky=2},
{"default_sandstone.png"},
"Sandstone stair",
"Sandstone slab",
default.node_sound_stone_defaults())

45
mods/vessels/README.txt Normal file
View File

@ -0,0 +1,45 @@
Minetest 0.4 mod: vessels
==========================
Crafts
-------
Glass bottle (yields 10)
G - G
G - G
- G -
Drinking Glass (yields 14)
G - G
G - G
G G G
Heavy Steel Bottle (yields 5)
S - S
S - S
- S -
License of source code:
-----------------------
Copyright (C) 2012 Vanessa Ezekowitz
Version 2012-09-02
Modifications by 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 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
WTFPL
Authors of media files
-----------------------
Unless specifically noted,
Copyright (C) 2012 Vanessa Ezekowitz

1
mods/vessels/depends.txt Normal file
View File

@ -0,0 +1 @@
default

89
mods/vessels/init.lua Normal file
View File

@ -0,0 +1,89 @@
-- Minetest 0.4 mod: vessels
-- See README.txt for licensing and other information.
minetest.register_craftitem("vessels:glass_bottle", {
description = "Glass Bottle (empty)",
inventory_image = "vessels_glass_bottle_inv.png",
wield_image = "vessels_glass_bottle.png",
groups = {vessel=1},
})
minetest.register_craft( {
output = "vessels:glass_bottle 10",
recipe = {
{ "default:glass", "", "default:glass" },
{ "default:glass", "", "default:glass" },
{ "", "default:glass", "" }
}
})
minetest.register_craftitem("vessels:drinking_glass", {
description = "Drinking Glass (empty)",
inventory_image = "vessels_drinking_glass_inv.png",
wield_image = "vessels_drinking_glass.png",
groups = {vessel=1},
})
minetest.register_craft( {
output = "vessels:drinking_glass 14",
recipe = {
{ "default:glass", "", "default:glass" },
{ "default:glass", "", "default:glass" },
{ "default:glass", "default:glass", "default:glass" }
}
})
minetest.register_craftitem("vessels:steel_bottle", {
description = "Heavy Steel Bottle (empty)",
inventory_image = "vessels_steel_bottle_inv.png",
wield_image = "vessels_steel_bottle.png",
groups = {vessel=1},
})
minetest.register_craft( {
output = "vessels:steel_bottle 5",
recipe = {
{ "default:steel_ingot", "", "default:steel_ingot" },
{ "default:steel_ingot", "", "default:steel_ingot" },
{ "", "default:steel_ingot", "" }
}
})
-- Make sure we can recycle them
minetest.register_craftitem("vessels:glass_fragments", {
description = "Pile of Glass Fragments",
inventory_image = "vessels_glass_fragments.png",
})
minetest.register_craft( {
type = "shapeless",
output = "vessels:glass_fragments",
recipe = {
"vessels:glass_bottle",
"vessels:glass_bottle",
},
})
minetest.register_craft( {
type = "shapeless",
output = "vessels:glass_fragments",
recipe = {
"vessels:drinking_glass",
"vessels:drinking_glass",
},
})
minetest.register_craft({
type = "cooking",
output = "default:glass",
recipe = "vessels:glass_fragments",
})
minetest.register_craft( {
type = "cooking",
output = "default:steel_ingot",
recipe = "vessels:steel_bottle",
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Some files were not shown because too many files have changed in this diff Show More