oweals/minetest_game.git
7 years agoTnt: Avoid divide-by-zero errors in calc_velocity() 0.4.14
paramat [Sun, 8 May 2016 21:26:18 +0000 (22:26 +0100)]
Tnt: Avoid divide-by-zero errors in calc_velocity()

7 years agoCreative: Fix inventory crash after toggling creative mode in-game
tenplus1 [Sat, 7 May 2016 09:12:58 +0000 (10:12 +0100)]
Creative: Fix inventory crash after toggling creative mode in-game

7 years agoCreative: Fix '-' glitch in playername
tenplus1 [Fri, 6 May 2016 14:14:38 +0000 (15:14 +0100)]
Creative: Fix '-' glitch in playername

Fix the glitch when players use the '-' character in their username
on a server, causing creative inventory to not pass page 2

7 years agoCreative: Add global variable creative.formspec_add
tenplus1 [Thu, 21 Apr 2016 20:25:51 +0000 (21:25 +0100)]
Creative: Add global variable creative.formspec_add

This pull adds a new global variable called creative.formspec_add
that will allow mods to add to the creative inventory screen
without the need to fork the mod altogether.  Simple solution
that works already for inventory_plus' BACK button

7 years agoStairs/default: Make sandstone(brick) groups consistent
paramat [Wed, 4 May 2016 23:22:57 +0000 (00:22 +0100)]
Stairs/default: Make sandstone(brick) groups consistent

Sandstone is crumbly = 1 cracky = 3 to be slowly diggable by hand
Sandstonebrick(stair/slab) is cracky = 2

7 years agoTnt: Fix bug in dropped item counting
Foz [Tue, 3 May 2016 02:36:29 +0000 (22:36 -0400)]
Tnt: Fix bug in dropped item counting

7 years agoDefault: Lower grass_side and snow_side textures
paramat [Sat, 30 Apr 2016 19:11:08 +0000 (20:11 +0100)]
Default: Lower grass_side and snow_side textures

Half coverage for a more grassy appearance
Make snow_side universal by removing green pixels
Move KevDoy's heart texture credit to above sound credits

7 years agoAdd give_initial_items API
rubenwardy [Sat, 2 Jan 2016 12:28:07 +0000 (12:28 +0000)]
Add give_initial_items API

7 years agoTNT: Combine adjacent TNT into the explosion
Auke Kok [Wed, 27 Apr 2016 07:26:18 +0000 (00:26 -0700)]
TNT: Combine adjacent TNT into the explosion

This uses a vmanip to count adjacent tnt nodes and explodes them
all at once, using an inverse square law to recalculate the radius.
The maximum explosion becomes 125 nodes of tnt yielding a radius of
15 nodes, which does not break my machine and makes it return
in under a second.

This makes both bigger explosions and less stability issues.

The drop code has been simplified and now drops at all times a
reasonable amount of drops, never blanketing the area with drops,
even at the larges explosion level.

Particles are scaled up according to explosion size as well - a
bigger explosion will show bigger particles.

To scale the tnt:boom particle, we move it to the _effects() function.

7 years agoTNT: Allow mods to override entity physics.
Auke Kok [Thu, 28 Apr 2016 03:15:52 +0000 (20:15 -0700)]
TNT: Allow mods to override entity physics.

Introduces an `on_blast(luaobj, damage)` callback that mods can attach
to an entity def. The function will get called with the damage that
TNT would make.

The function should return three values:

  bool do_damage, bool do_knockback, table drops

do_damage allows the mod to tell the TNT code to perform damage on
the entity for the mod. The mod code should not do anything with
the entity HP. The entity should not be immortal. If false, then
the entity will not be damaged by the TNT mod.

do_knockback allows the mod to tell the TNT mod to perform an
entity knockback effect. If false, no knockback effect is applied
to the entity.

the drops table is a list of items to drop. It may be nil. E.g. {
"wool:red" }.

I've documented both on_blast() API methods in game_api.txt. It is
a better place than lua_api.txt.

7 years agoTNT: Fix multiple explosions erasing drops
Auke Kok [Wed, 27 Apr 2016 06:08:00 +0000 (23:08 -0700)]
TNT: Fix multiple explosions erasing drops

Any second explosion near a first TNT explosion will punch all
entities found nearby, including item drops. This causes the
item pickup code to think the item was picked up, but by
a `nil` player, thus removing the item.

We query for the immortal entity group, and if the item is in
the immortal group, do not punch the item.

7 years agoDefault: Add function 'node_sound_gravel_defaults()'
Foz [Sun, 24 Apr 2016 22:10:46 +0000 (18:10 -0400)]
Default: Add function 'node_sound_gravel_defaults()'

7 years agoDefault: New grass and grass_side textures
paramat [Mon, 11 Apr 2016 01:11:17 +0000 (02:11 +0100)]
Default: New grass and grass_side textures

Derived from Casimir's Voxelgarden texture

7 years agoBeds: Quicker saves with tidy output
tenplus1 [Mon, 28 Mar 2016 19:14:35 +0000 (20:14 +0100)]
Beds: Quicker saves with tidy output

Tweaked the beds.save_spawns() function to compile list then output
to file with shortened co-ordinates containing 1 decimal place

7 years agoTNT: make tnt:boom visual a particle, and larger
Auke Kok [Tue, 26 Apr 2016 00:51:38 +0000 (17:51 -0700)]
TNT: make tnt:boom visual a particle, and larger

We reuse the tnt:boom texture for a particle that is added by the
on_construct() of tnt:boom, and has a short expiry time (0.2sec).
It is 3 nodes larged, centered on the explosion.

We then make tnt:boom airlike so it doesn't have a texture, and it's
the thing that emits lots of light (we could even make it exist a
bit longer).

The nice thing about particles is that the client is less susceptible
to lag and will always remove them as fast as possible, so this makes
the visual more constant and responsive.

7 years agoTNT: lower smoke particle count and speed.
Auke Kok [Sat, 23 Apr 2016 05:24:19 +0000 (22:24 -0700)]
TNT: lower smoke particle count and speed.

The effect is similar, and the reduction in particles is a small
boost in responsiveness.

To compensate, I've lowered the spawner time and expiration length
as well.

7 years agoTNT: self-start boom removal timer.
Auke Kok [Mon, 18 Apr 2016 04:04:50 +0000 (21:04 -0700)]
TNT: self-start boom removal timer.

7 years agoTNT: make tnt:burning a falling node.
Auke Kok [Mon, 18 Apr 2016 03:52:45 +0000 (20:52 -0700)]
TNT: make tnt:burning a falling node.

This allows TNT to be used for e.g. traps (drop it from the
ceiling) or weird tnt effects with other explosions.

7 years agoTNT: randomly vary ejecting velocity
Auke Kok [Sat, 16 Apr 2016 19:13:13 +0000 (12:13 -0700)]
TNT: randomly vary ejecting velocity

We add a +/- 0.5 random value to the velocity vector of
ejecting nodes.

I've spotted a lot of nodes going exactly straight up if blowing
up sand above TNT. The extra variation looks less artificial.

7 years agoTNT: Damage mobs, knock back players
Auke Kok [Sat, 16 Apr 2016 19:00:17 +0000 (12:00 -0700)]
TNT: Damage mobs, knock back players

We apply punch damage to mobs caught in the blast radius, as
this code previously only hurt players.

We "move" players back 1 node if they're caught in the blast, and
slightly up. We can't "eject" players due to missing API code to
support that, unfortunately.

7 years agoTNT: Whitespace cleanup
Auke Kok [Sat, 16 Apr 2016 17:22:37 +0000 (10:22 -0700)]
TNT: Whitespace cleanup

7 years agoTNT: Add on_blast to all nodes with an inventory
Auke Kok [Sat, 16 Apr 2016 02:21:45 +0000 (19:21 -0700)]
TNT: Add on_blast to all nodes with an inventory

Adds a minor helper function that allows efficient retrieval of
several inventories from a node inventory. We use this helper to
quickly retrieve the items in chests, vessel shelves, book shelves
and furnaces, and return these with the nodes itself to the TNT caller.

The TNT caller then performs the entity physics, and we don't need
to do anything else.

We disable TNT doing anything with bones.

We expose a bug in the code that drops the items - metadata was lost
entirely. This patch corrects that by properly copying the metadata
and creating the drops list inclusive metadata.

8 years agoFarming: Add quiet sounds to seeds
paramat [Fri, 22 Apr 2016 15:20:47 +0000 (16:20 +0100)]
Farming: Add quiet sounds to seeds

8 years agoFlowers: Fix waterlily node's duplication with stack of 1
kilbith [Thu, 21 Apr 2016 10:38:44 +0000 (12:38 +0200)]
Flowers: Fix waterlily node's duplication with stack of 1

8 years agoDefault: New heart texture
KevDoy [Tue, 12 Apr 2016 06:52:56 +0000 (23:52 -0700)]
Default: New heart texture

Similar to before, add symmetry and slightly more rounded off

8 years agoFire: Higher chance of removing flammable nodes
paramat [Wed, 6 Apr 2016 18:43:54 +0000 (19:43 +0100)]
Fire: Higher chance of removing flammable nodes

Flammable nodes burn away quicker

8 years agoFlowers: Make flower spread a public function to enable override
paramat [Sat, 16 Apr 2016 21:33:08 +0000 (22:33 +0100)]
Flowers: Make flower spread a public function to enable override

Remove search for 'group:flora_block'
Enable flora spread on 'dirt with dry grass'

8 years agoDoors: Use LBM instead of ABM to convert doors.
Auke Kok [Sat, 16 Apr 2016 03:55:56 +0000 (20:55 -0700)]
Doors: Use LBM instead of ABM to convert doors.

This works much more efficiently to replace old style doors.

8 years agoDefault: Create 'grass', 'dry_grass' groups, use in dirt conversion ABM
paramat [Sat, 16 Apr 2016 20:53:03 +0000 (21:53 +0100)]
Default: Create 'grass', 'dry_grass' groups, use in dirt conversion ABM

8 years agoCharacter: Fix boat leg wobble.
Auke Kok [Sat, 16 Apr 2016 20:42:48 +0000 (13:42 -0700)]
Character: Fix boat leg wobble.

There was a small leg wobble in the sitting animation (visible
when sitting on the boat). This removes it.

8 years agoBoats: Increase maximum velocity to 5n/s
paramat [Fri, 15 Apr 2016 09:43:10 +0000 (10:43 +0100)]
Boats: Increase maximum velocity to 5n/s

8 years agoFlowers: Tweak flower and mushroom spreading
tenplus1 [Sun, 3 Apr 2016 15:31:19 +0000 (16:31 +0100)]
Flowers: Tweak flower and mushroom spreading

Tidy up position numbers and code
Check for flora group aswell
Improve node light check for mushroom growth
Shrooms grow in 3 and below light

8 years agoChange how dirt turns to dirt_with_(something)
Auke Kok [Fri, 1 Apr 2016 04:58:59 +0000 (21:58 -0700)]
Change how dirt turns to dirt_with_(something)

This changes how dirt blocks turn to dirt_with -grass, -dry_grass
or -snow.

Previously, dirt that was sunlit would turn to dirt_with_grass no
matter what, but this happened without any context, so you could
get green patches of dirt_with_grass in the middle of a savannah or
even desert.

Dirt no longer turns to covered dirt unless it's within 1 node from
another dirt_with_grass or dirt_with_dry_grass or dirt_with_snow.
This makes dirt_with_grass "growback" a lot slower, since it now only
happens on the edges, but it retains the context nicely now.

If there is any dirt with a grass or dry grass plant, or snow on top,
and enough light, we'll convert it sporadically to dirt_with_grass
or dirt_with_dry_grass or dirt_with_snow.

This allows us to plant grass of our choice in a large dirt patch,
or in a region where otherwise that type of grass is not present.

This used to be done by 2 abms, but I've combined them in to a single
ABM that is ordered to run with maximum efficiency, solving for the
most common outcome first before attempting more complex checks.

8 years agoRemove "grass under snow" from default:dirt_with_snow in darkness.
Auke Kok [Mon, 4 Apr 2016 02:52:27 +0000 (19:52 -0700)]
Remove "grass under snow" from default:dirt_with_snow in darkness.

This is technically "dirt with grass" that's just under a snow
cover, so in darkness the grass on these nodes will also die,
turning it into dirt.

This doesn't convert dirt_with_snow under snow.

8 years agoCall nodeupdate on the entire blast zone
Auke Kok [Thu, 31 Mar 2016 23:07:15 +0000 (16:07 -0700)]
Call nodeupdate on the entire blast zone

This will make sand and gravel blocks on top of TNT actually fly
in the air.

  https://youtu.be/4omndVZijLc

8 years agoLimit entity speed to 250m/s.
Auke Kok [Wed, 30 Mar 2016 06:09:47 +0000 (23:09 -0700)]
Limit entity speed to 250m/s.

Let's just call it "terminal" velocity.

8 years agoTNT: Move timer start to on_create() for burning nodes.
Auke Kok [Tue, 29 Mar 2016 14:39:46 +0000 (07:39 -0700)]
TNT: Move timer start to on_create() for burning nodes.

We add on_create() handlers for both burning TNT and burning
gunpowder. Because gunpowder will explode TNT in 1 second,
and not 4, we need to modify the 4 second timer after we
make the TNT burning. Other mods can now place burning TNT
that will by default explode after 4 seconds.

8 years agoTNT: Fix up nil derefs
Auke Kok [Tue, 29 Mar 2016 01:20:14 +0000 (18:20 -0700)]
TNT: Fix up nil derefs

I spotted two places where under stress (many explosions) luajit would
end up passing nil to these functions. I'm not entirely sure how,
but it seems good form to guard against it, which does make it
more robust. After this patch, I'm not able to crash the server. With
many explosions, it may still lag significantly, but always returns
in the end.

8 years agoFix API docs after various changes.
Auke Kok [Sun, 27 Mar 2016 17:51:55 +0000 (10:51 -0700)]
Fix API docs after various changes.

8 years agoRestructure code to only check `def` once.
red-001 [Wed, 23 Mar 2016 11:01:59 +0000 (11:01 +0000)]
Restructure code to only check `def` once.

8 years agoCalculate blast intensity at all locations.
Auke Kok [Wed, 23 Mar 2016 05:05:34 +0000 (22:05 -0700)]
Calculate blast intensity at all locations.

We define the blast intensity as the square of the tnt_radius, divided
by the square of the distance to the explosion center, where distance
is limited to 1 at the lower end.

When destroying nodes, we calculate the intensity for each node, and
only destroy the nodes when the intensity is 1.0 or larger. To avoid
perfectly spherical explosions, we make sure to retain a randomness
factor of 20%. This will make explosion edges jagged and not smooth,
but not too much.

We pass the calculated intensity to on_blast() functions as well,
except we take the jitter here out and make sure it's always 1.0
or larger.

8 years agoTNT: Limit amount of stacks ejected.
Auke Kok [Wed, 23 Mar 2016 04:25:44 +0000 (21:25 -0700)]
TNT: Limit amount of stacks ejected.

We apply a log scale to the size of the stacks ejected, so that
in larger explosions we are getting larger stacks. For normal r=3
explosions, this gives stack sizes ~6-7 or so, but for r=10 explosions
it could end up giving stacks of 25+.V

8 years agoTNT: Chain reaction
Auke Kok [Sat, 19 Mar 2016 06:31:10 +0000 (23:31 -0700)]
TNT: Chain reaction

With the new high res timer, we can make TNT much better create chain
reactions. This does exactly that.

8 years agoTNT particles: use drops list smartly
Auke Kok [Sat, 19 Mar 2016 06:07:15 +0000 (23:07 -0700)]
TNT particles: use drops list smartly

The drops list already has quantities, so let's just select the one
with the highest quantity from it, and use that as tile. Fallback
tile will therefore only be used if explosion happens in air. Oh well.

8 years agoTNT: Spacing / codestyle fixes
Auke Kok [Sun, 13 Mar 2016 06:48:52 +0000 (22:48 -0800)]
TNT: Spacing / codestyle fixes

- Fix spacing errors around = and ..
- Indentation fixes
- Break up long lines

8 years agoMake TNT faster by using `VoxelManip()` for removing nodes.
red-001 [Sun, 31 Jan 2016 19:42:07 +0000 (19:42 +0000)]
Make TNT faster by using `VoxelManip()` for removing nodes.

8 years agoFix TNT mod calculate blast intensity.
red-001 [Wed, 27 Jan 2016 16:33:32 +0000 (16:33 +0000)]
Fix TNT mod calculate blast intensity.

Currently the TNT mod uses a dummy vaule of 1 for this.

8 years agoAdd TNT API.
red-001 [Fri, 1 Jan 2016 22:49:32 +0000 (22:49 +0000)]
Add TNT API.

8 years agoTNT: add some depth to the explosion effect
Auke Kok [Mon, 25 Jan 2016 07:48:38 +0000 (23:48 -0800)]
TNT: add some depth to the explosion effect

We add a dirt-like particle (drawn from scratch, uses some
colors from default_dirt's palette) to spawn many particles
that have collision enabled around the center of the blast.

This has the effect of obscuring the center of the blast, as
that is a painfully visible empty area when the explosion happens,
as there's only a little spark.

The dirt particles bounce around the walls and floor a bit,
and disappear rapidly, well before the smoke particles disappear.

This is a nice visual distraction that obscures the sudden
appearance of the gaping hole, and makes it a whole lot more
believable.

8 years agoMake TNT a bit more fun.
Auke Kok [Mon, 25 Jan 2016 07:27:50 +0000 (23:27 -0800)]
Make TNT a bit more fun.

But not too much.

TNT is a bit underwhelming at the moment. We can make it a bit
more interesting by ejecting not just one or two itemstacks,
but a bunch of them. This code splits up the drops into
separate itemstacks that are 2-5 items together, which
results in generally roughly 10 itemstacks being ejected.

Since now we have multiple ejecta, it makes sense to tune
the ejecta velocities a bit better to get the appearance of
an actual explosion better. The items will not all start
with the same vertical velocity, since that would look
like fireworks. Instead we give them all a different vertical
speed.

8 years agoAllow the on_blast API to pass an itemstack.
Auke Kok [Tue, 26 Jan 2016 06:27:15 +0000 (22:27 -0800)]
Allow the on_blast API to pass an itemstack.

If the node is special and has an on_blast() handler, we need
to call it instead of getting node drops manually. However, we
do want to know if drops should be added for the special nodes,
so we modify the on_blast() handler code to allow the nodedef
handlers to pass back itemstacks. This could be used by e.g.
the doors mod to drop door items after a blast.

Since this API is documented in lua_api.txt, a separate PR will
be incoming to update the on_blast() documentation.

8 years agoRemove composed shelf side.
Auke Kok [Wed, 13 Apr 2016 00:28:30 +0000 (17:28 -0700)]
Remove composed shelf side.

Don't compose the shelf side texture. The texture isn't transparent,
and unlikely to be in any case.

8 years agoBooks: Split text per page relatively to number of lines
kilbith [Sun, 10 Apr 2016 19:29:02 +0000 (21:29 +0200)]
Books: Split text per page relatively to number of lines

8 years agoFlowers: Fix itemstack when waterlily is placed
kilbith [Fri, 8 Apr 2016 12:29:48 +0000 (14:29 +0200)]
Flowers: Fix itemstack when waterlily is placed

8 years agodefault: Strengthen obsidian glass Remove group 'oddly_breakable_by_hand'
tenplus1 [Wed, 17 Jun 2015 17:07:55 +0000 (18:07 +0100)]
default: Strengthen obsidian glass Remove group 'oddly_breakable_by_hand'

8 years agoFlowers: Cleaning of waterlily's placement 1028/head
kilbith [Thu, 7 Apr 2016 11:10:18 +0000 (13:10 +0200)]
Flowers: Cleaning of waterlily's placement

8 years agoFarming: Override dirt_with_dry_grass to enable cultivation
paramat [Wed, 6 Apr 2016 21:52:53 +0000 (22:52 +0100)]
Farming: Override dirt_with_dry_grass to enable cultivation

8 years agoDefault/mapgen: Denser rainforest, fewer logs
paramat [Tue, 5 Apr 2016 16:01:15 +0000 (17:01 +0100)]
Default/mapgen: Denser rainforest, fewer logs

8 years agoCreative: Add myself in credits
kilbith [Sat, 2 Apr 2016 23:39:28 +0000 (01:39 +0200)]
Creative: Add myself in credits

Some people borrowed the creative code for their sub-games with an exclusive attribution to celeron55.

This is frustrating since I've largely rewritten, redesigned and carefully maintained this mod for the last months.

I expect to be credited.

8 years agoFlood snow with either lava or water.
Auke Kok [Sat, 2 Apr 2016 19:14:18 +0000 (12:14 -0700)]
Flood snow with either lava or water.

Fixes #1005

This doesn't flood snow or ice blocks.

8 years agoFix doors disappearing while underwater
tenplus1 [Fri, 1 Apr 2016 10:34:28 +0000 (11:34 +0100)]
Fix doors disappearing while underwater

Currently any doors viewed from underwater will disappear but removing the line 'use_texture_alpha = true,' seems to fix this.  Thanks to Thomas-S for finding this glitch.

8 years agoBeds: Check for buildable_to for bottom half
Auke Kok [Thu, 31 Mar 2016 14:21:40 +0000 (07:21 -0700)]
Beds: Check for buildable_to for bottom half

We properly checked top half already, just not the top half
target location.

Assure both checked positions are not unknown nodes.

Fixes #991

8 years agoBoats: Optimize, re-UV unwrap.
Auke Kok [Wed, 30 Mar 2016 04:46:46 +0000 (21:46 -0700)]
Boats: Optimize, re-UV unwrap.

The boat model had over 1700 tris (!) before this redo. I've reduced
the amount of tris to ~150, which is very reasonable given that there
are almost 45 faces to this model.

I've also spent a good hour re-UV unwrapping the entire model which
has a huuuge impact on the boats' appearance. As much as possible,
the boat now looks like it's made out of actual blocks of wood,
and I've even attempted to make the grains connect around edges,
appear in the same pattern and spacing, and generally make it look
like it's just a nice crafted thing out of several pieces of wood.

I've had to tweak the rudder part to make the texture actually have
square texture pixels. I did that by varying the vertical position of
the botton of the rudder handle and the top of the rudder bottom, which
worked well. I also had to 'slice' the rear face of the boat to prevent
a strange texture tear, probably due to non-flat surface somewhere,
but I couldn't spot the issue there anymore after adding 2 extra edges.

This looks totally like a new boat now.

 - http://i.imgur.com/stiVzsa.jpg

8 years agoFire: Use get_item_group instead of get_node_group
Rui [Wed, 30 Mar 2016 03:32:53 +0000 (12:32 +0900)]
Fire: Use get_item_group instead of get_node_group

8 years agoStart timer as well when moving items around.
Auke Kok [Sun, 27 Mar 2016 23:50:55 +0000 (16:50 -0700)]
Start timer as well when moving items around.

It's possible to hit this when using an e.g. charcoal mod
where a tree is both a fuel and a source.

8 years agoAdd recipe to craft clay block back into lumps
tenplus1 [Fri, 25 Mar 2016 20:18:24 +0000 (20:18 +0000)]
Add recipe to craft clay block back into lumps

Added a recipe to craft a clay block back into 4 clay lumps.

8 years agoShelves: Fix listring functionality + code cleaning
Jean-Patrick Guerrero [Wed, 23 Mar 2016 18:48:22 +0000 (19:48 +0100)]
Shelves: Fix listring functionality + code cleaning

8 years agoDefault: Reduce sand footstep and dug sound gains
paramat [Thu, 24 Mar 2016 03:00:43 +0000 (03:00 +0000)]
Default: Reduce sand footstep and dug sound gains

8 years agoBooks: Ensure backward compatibility for older written books
Jean-Patrick Guerrero [Wed, 23 Mar 2016 18:31:25 +0000 (19:31 +0100)]
Books: Ensure backward compatibility for older written books

8 years agoFire: Allow placing only above flammable blocks
Jean-Patrick Guerrero [Mon, 21 Mar 2016 15:16:29 +0000 (16:16 +0100)]
Fire: Allow placing only above flammable blocks

8 years agoRename Glass Door (the obisian one) to Obsidian Glass Door
Rui [Tue, 22 Mar 2016 07:26:36 +0000 (16:26 +0900)]
Rename Glass Door (the obisian one) to Obsidian Glass Door

8 years agoBooks: Move page buttons at the bottom
Jean-Patrick Guerrero [Mon, 21 Mar 2016 19:37:35 +0000 (20:37 +0100)]
Books: Move page buttons at the bottom

8 years agoWooden Sign: Add group oddly_breakable_by_hand
Jean-Patrick Guerrero [Mon, 21 Mar 2016 10:25:25 +0000 (11:25 +0100)]
Wooden Sign: Add group oddly_breakable_by_hand

8 years agoDefault: Make some plant nodes non-flammable
paramat [Mon, 21 Mar 2016 09:23:12 +0000 (09:23 +0000)]
Default: Make some plant nodes non-flammable

8 years agoDefault: Fix rotation errors for mapgen aspen and sapling jungletree
paramat [Mon, 21 Mar 2016 08:03:52 +0000 (08:03 +0000)]
Default: Fix rotation errors for mapgen aspen and sapling jungletree

8 years agoDoors: Allow schematic placement of wooden doors.
Auke Kok [Mon, 21 Mar 2016 06:48:16 +0000 (23:48 -0700)]
Doors: Allow schematic placement of wooden doors.

If LVM or some other nonmetadata method is used to place a door,
then metadata is missing that tells us whether the door is left
or right-hinged.

However, we can detect that nodemeta is missing and see if the node
name is _a or _b. In the case of _a, nothing needs to be done and we
can just open the door. In the case of _b we assume the door is right
hinged, and tune the state nodemeta value so that the door opens the
right way. This all of course assumes that the schematic method places
the doors *closed* by default, which is reasonable.

8 years agoCreative: Code cleaning + Fix items moving in virtual inventory
Jean-Patrick Guerrero [Wed, 16 Mar 2016 23:11:44 +0000 (00:11 +0100)]
Creative: Code cleaning + Fix items moving in virtual inventory

8 years agoChanges to Screwdriver to add new drivers.
tenplus1 [Thu, 3 Mar 2016 10:18:41 +0000 (10:18 +0000)]
Changes to Screwdriver to add new drivers.

A few screwdriver changes so that mod makers can add new screwdrivers with different wear levels.  Tried and tested with new diamond screwdriver :)

8 years agoFire: Speed up fire spread and burn out
paramat [Sat, 19 Mar 2016 20:49:29 +0000 (20:49 +0000)]
Fire: Speed up fire spread and burn out

8 years agoBeds: priv/griefing fixes.
Auke Kok [Sat, 19 Mar 2016 01:55:56 +0000 (18:55 -0700)]
Beds: priv/griefing fixes.

- disallow placing beds in protected areas
- fix rotation of beds(broken after 41c2b2ae)
- allow using others' beds, but don't change spawn location

Fixes #953. #943 isn't something I think was ever implemented, and
this does a fair job of addressing the main concern (spawning in
others' houses)

8 years agoBooks: Add support for multiple pages
Jean-Patrick Guerrero [Wed, 16 Mar 2016 21:01:14 +0000 (22:01 +0100)]
Books: Add support for multiple pages

8 years agoAllow for shift+clicking inventory from bones
Rui [Wed, 16 Mar 2016 11:10:25 +0000 (20:10 +0900)]
Allow for shift+clicking inventory from bones

8 years agoDoors: Allow falling nodes to fall onto doors.
Auke Kok [Tue, 15 Mar 2016 04:27:32 +0000 (21:27 -0700)]
Doors: Allow falling nodes to fall onto doors.

We were cleverly attempting to use an airlike node as the
top half of the doors, but as airlike nodes are not walkable,
falling nodes would not stop falling and thus remain an entity
stuck on top of a door.

After inspecting the builtin/game/falling.lua code, I considered
the remaining options: (a) revert doors such that the top part is
actually the door, (b) play with nodedef fields and see if other
flags may work, or (c) modify the hidden door part to another
drawtype that properly prevents this issue.

(a) seemed way over the top for now, although it would solve the
issue, it would cause a rewrite of most of the code including the
old-door-conversion.

(b) turned up nothing.

(c) turned out to be relatively simple.

So, here's the implementation where I turn the hidden door top
into a tiny, non-targetable but walkable nodebox that is entirely
inside the door hinge. It's entirely transparent, so you still
can't see it, can't hit it, nor can you place anything in it or
make liquids flow through it. The top part is placed in the right
position on placement and not touched further.

Falling nodes will properly stop on top of these doors. I've
adjusted the door conversion code to properly account for the
issue as well, so the only thing remaining is people who have
been running a git branch - those can upgrade by re-placing the
door.

8 years agoCreate API for registration of fence gate.
Rui914 [Fri, 18 Mar 2016 07:33:14 +0000 (16:33 +0900)]
Create API for registration of fence gate.

8 years agoRename argument to priv check
James Stevenson [Wed, 16 Mar 2016 18:34:07 +0000 (14:34 -0400)]
Rename argument to priv check

Fixes crash when punching bones not owned by you, and may resolve https://github.com/minetest/minetest_game/issues/940

8 years agoWalls: Don't connect to group:cracky
Auke Kok [Wed, 16 Mar 2016 14:22:34 +0000 (07:22 -0700)]
Walls: Don't connect to group:cracky

the ```group:cracky``` group contains all sorts of odds and ends
nodes that we shouldn't connect to. There are a few nodes that
walls now no longer connect to, that probably should get
```group:stone``` added, or something similar, though.

8 years agoAllow digging of protected doors with "protection_bypass"
Auke Kok [Wed, 16 Mar 2016 05:49:20 +0000 (22:49 -0700)]
Allow digging of protected doors with "protection_bypass"

This was probably lost in either the API rewrite or a merge/rebase.

Fixes #929

8 years agoRe-export character.b3d without texture linkage.
Auke Kok [Wed, 16 Mar 2016 05:18:49 +0000 (22:18 -0700)]
Re-export character.b3d without texture linkage.

I've created a modified B3Dexport.py version that automatically strips
the embedded texture link to external texture files. These links were
causing the engine to spew "can't find character.png" messages on the
console, but were harmless due to texture loading being done by the
client side and not through irrlicht.

I previously moved character.png to /textures/, which is wrong. I now
understand that character.png was in the same folder as character.blend
simply to make blender load the texture from the embedded linkage
automatically. Nothing more, nothing less.

Subsequently the character.png file should just sit in convenience
in the /models/ folder with the blend file, and not in the textures
file. This patch moves it back. And yes, minetest does load the
character.png from this path.

8 years agoAllow both sides of the bed to be digged up.
Auke Kok [Sat, 12 Mar 2016 07:21:56 +0000 (23:21 -0800)]
Allow both sides of the bed to be digged up.

Tested with nodebreaker, fire.

If called from lua, minetest.remove_node() calls on_destruct() callbacks
before the map is actually updated. This means that we can't look at the
map data to determine if we're done cleaning up adjacent nodes, and we
have to stop recursing some other way.

There's no data we can pass around through functions that would survive
scope to a secondary on_destruct() callback, so we have to maintain
local state somewhere in the mod namespace.

In this case, we keep a bitflag. The bitflag is set to "true" by
default. On the first half removal, the flag is flipped and afterwards
we remove the other half node. When the on_destruct for the other half
is running, it's value is false and we flip it back to true without
removing the other half node.

This thus prevents recursing.

To facilitate easier finding of the bed partner, we tell our on_destruct
whether we're a top or bottom half node through a passed flag.

Now that the top is diggable, we just need to assure that it drops a
bottom bed part.

8 years agoAdd steel door/trapdoor sounds.
Auke Kok [Sun, 6 Mar 2016 07:08:02 +0000 (23:08 -0800)]
Add steel door/trapdoor sounds.

I've found a favorable steel door sound from a parking garage
door that isn't abrupt or scary, just sounds like a nice solid
metal door. The sample had both opening and closing sounds, and
so they match nicely. Amplified and mixed several samples together
to reduce ambient noise, and get the right level compared to
wood doors. Attribution was added as well. CC-BY-3.0 sounds.

8 years agoDefault: Colourise desert cobble to be consistent with desert stone
paramat [Mon, 14 Mar 2016 13:26:38 +0000 (13:26 +0000)]
Default: Colourise desert cobble to be consistent with desert stone

Hue and saturation match desert stone and desert stone brick
Preserve original mortar colour

8 years agoDoors: Update glass door item textures to new design
paramat [Mon, 14 Mar 2016 13:12:39 +0000 (13:12 +0000)]
Doors: Update glass door item textures to new design

8 years agoFencegate: prevent y-fighting at top.
Auke Kok [Sun, 13 Mar 2016 20:42:24 +0000 (13:42 -0700)]
Fencegate: prevent y-fighting at top.

We raise the height of the fencegate node by 0.0001 to make the
fencegate post stop fighting with node blocks. This makes the
gate pole appear to be cut through the node, and doesn't leave
a gap when stacking fencegates, which would look odd.

8 years agoFire: Optimize spreading ABM.
Auke Kok [Sun, 13 Mar 2016 01:50:09 +0000 (17:50 -0800)]
Fire: Optimize spreading ABM.

No need to find_node_near twice with the same params.

8 years agoAdd flint and flint-and-steel
Jean-Patrick Guerrero [Fri, 11 Mar 2016 17:27:22 +0000 (18:27 +0100)]
Add flint and flint-and-steel

8 years agoClean up door tops if fire destroys bottom.
Auke Kok [Sat, 12 Mar 2016 06:11:39 +0000 (22:11 -0800)]
Clean up door tops if fire destroys bottom.

Fixes #909. Door tops are never flammable.

This doesn't guard yet against a voxelmanip removing the top node,
but that is less of an issue since if a voxelmanip removes the top,
then the bottom part remains functional and visibly intact. If the
voxelmanip removes the bottom part, but not the top, then this patch
makes it clean up the top just fine.

8 years agoFix bug rotating unknown node
tenplus1 [Fri, 11 Mar 2016 21:45:09 +0000 (21:45 +0000)]
Fix bug rotating unknown node

This fixes a bug what crashes game when rotating an unknown node.

8 years agoDye: Add global table of dye names and descriptions
paramat [Tue, 8 Mar 2016 02:40:45 +0000 (02:40 +0000)]
Dye: Add global table of dye names and descriptions

8 years agoDye: Make pink dye mixable
paramat [Tue, 8 Mar 2016 00:41:22 +0000 (00:41 +0000)]
Dye: Make pink dye mixable

Correct 2 inconsistent mixes
Clean up code style and vertically align mix table
Remove dyelocal and simplify table names

8 years agoAdd "protection_bypass" priv.
Auke Kok [Wed, 20 Jan 2016 14:29:48 +0000 (14:29 +0000)]
Add "protection_bypass" priv.

The access privilege allows players that have it to bypass protection
on locked doors/trapdoors, chests and bones.

The priv also allows bypassing any minetest.is_protected() check,
including digging nodes and placing them. It is meant for world
moderators to clean up and fix map issues.

Original patch by red-001. Split up and rebased/rewritten by sofar.

This patch requires https://github.com/minetest/minetest/pull/3800