Commit Graph

843 Commits

Author SHA1 Message Date
paramat
d42f77cc5f Default/mapgen: Simplify iron ore registrations
Preserve overlapping registrations of large and small clusters
below y = -64 but now extend the small clusters up to y = 0 (the
previous highest iron ore level) in a similar to way to coal
2016-07-05 18:16:52 +01:00
paramat
d476d017a4 Default/mapgen: Add ores above y = 1024
Each ore's rarity is equal to that occuring below y= -1024
2016-07-05 18:16:52 +01:00
paramat
1886d293d7 Default/mapgen: Clean up ore registrations
Re-order registrations
Add and improve comments
Change sand blob ymax to 0 as sand does not always rise above 0
Remove dirt blobs from sandstone as it is unsuitable for
many sandstone biomes and ugly in stony sandstone desert
Change ymax of first iron region to 0
2016-07-05 18:16:52 +01:00
tenplus1
21b457c9e1 Bucket: Correct liquid placing in protected areas
- Placing liquid inside a protected area no longer returns an empty bucket
- Remove on_place function, tidy up code, return proper itemstack
- Shorten code (changes from HybridDog/patch-35)
2016-07-05 18:15:35 +01:00
tenplus1
80d49095f5 Tidy sethome code, add global functions, round coords to 1 decimal
- Global functions sethome.set(name, pos) , sethome.get(name) and sethome.go(name)
- Tidy: trim coords to one decimal place and write to table and output table in one go.
- Add error checking
- Add t4im's homepos loader
2016-07-03 18:40:43 +02:00
paramat
f4f9e58ef2 Flowers: Make waterlily floodable
When waterlilies are placed near river water source make flowing river
water remove waterlilies instead of flowing around them in an ugly way
2016-07-01 07:05:53 +01:00
Thomas--S
55fd286083 Doors: Remove use_texture_alpha from door definition 2016-07-01 07:05:19 +01:00
HybridDog
1231f72628 Wool: Use adv- and optipng to optimise texture files 2016-07-01 07:03:17 +01:00
HybridDog
15b82f5b03 Wool: Clean up code 2016-07-01 07:02:38 +01:00
paramat
f796194c69 Doors: Add dedicated sounds for glass doors
Changed node sounds for steel door/trapdoor to stone
defaults instead of wood defaults
2016-06-27 05:32:36 +01:00
paramat
84e4ae1881 Default: New aspen tree schematics 2016-06-27 05:32:36 +01:00
tenplus1
f15f35c604 Default: Enable crafting of mese crystal fragments into mese crystal 2016-06-27 05:31:04 +01:00
tenplus1
be918d2d98 Default: Craft locked chest from chest plus steel ingot 2016-06-27 05:30:20 +01:00
paramat
983af7b1c0 Stairs: Code cleanup, fix various errors
Improve registration format
Fix groups not matching corresponding full node
Improve some descriptions
2016-06-26 06:11:16 +01:00
paramat
22dc7b2d9e Stairs: Register stone / desert stone / sandstone / obsidian blocks 2016-06-26 06:11:16 +01:00
paramat
9d6df824d6 Default: Add stone / desert stone / sandstone / obsidian blocks 2016-06-25 06:58:18 +01:00
paramat
5809c28ae3 Stairs: Stair recipe returns 8 stairs not 6
Make it consistent with the slab recipe which conserves volume
2016-06-22 02:12:57 +01:00
Xunto
e77ef553ff Default: Fix character model uv-mapping
Arm and leg textures are now edge-consistent
2016-06-22 02:12:11 +01:00
paramat
1fafed3387 Default: Remove mortar from stone brick, desert stone brick 2016-06-22 02:10:52 +01:00
Yutao Yuan
e0bec501f2 Flowers: Fix misaligned waterlily texture
Previously waterlily has misaligned top and bottom textures and looks
different when viewed from below.

This also hides the flower in bottom texture.
2016-06-21 02:21:00 +01:00
Auke Kok
3e9afe097c Doors: Clean up nodedef usage
Allows for more properties to be passed through. Somewhat simplifies
the code as well.
2016-06-21 02:20:47 +01:00
cd2
5775c9147c Farming: Add negative fall_damage_add_percent to straw
This doubles the fall height without damage to 11 nodes.
2016-06-17 23:43:41 +01:00
Auke Kok
ba1ae07b4a Default: Make brick and plank nodes rotatable
Allow many crafted nodes to be rotated in any way possible.

These blocks all have slab and stair versions, which can create awkward
patterns if placed together. By allowing these to be rotated players
can create new patterns and appearances that were not before possible.

Since this wasn't possible before, there won't be any effect
to existing builds, as param2 should always be '0'. The current
screwdriver mod also refuses to rotate and alter param2, so this is
safe to enable from now on.

Personally, since these are all *crafted* nodes to begin with, it
should be apparent that they can be rotated to begin with, but I can
see people may disagree from a simplicity perspective. It also may
affect param2 usage that other mods rely on, although I'm not aware
of any mods that do this.
2016-06-17 23:41:42 +01:00
paramat
50eb079813 Creative: Add missing 'formspec_escape' to fix bug
Symbols used in search caused the game to hang with a grey screen,
for example searching for 'diamond;ingot'
2016-06-14 23:29:21 +01:00
paramat
da0fe31443 Boats: Raise collisionbox top surface to fix boat behaviour
Lowering the top surface to be level with the boat top somehow
causes the boat to fall through world if underwater. Revert to
previous position that is needed for correct behaviour
2016-06-14 23:29:21 +01:00
Auke Kok
2199be5108 Stairs: Add mossy cobble slab and stair
Allow water to turn cobble slab and stairs to turn into mossy versions.

There is no crafting recipe for mossy stairs and mossy slabs, the
stair/slab API has been modified to allow for a recipeitem that
is `nil`, which will omit adding a crafting recipe for these two
items. The API documentation is updated.

The slabs and stairs will turn mossy when water is adjacent, just like
cobblestone. You can either farm mossy versions by placing them in
water for a while, then collecting them, or run water over your craft.
2016-06-14 23:28:17 +01:00
paramat
b5ea7d17b2 Mapgen: Add biome fields for riverbed node and depth 2016-06-05 19:15:50 +01:00
Auke Kok
dcf2465441 Farming: allow LBM's for other mods as well.
Fixes #1114
2016-06-04 13:39:58 +01:00
paramat
6386684f3e Fire: Ignite tnt, gunpowder, permanent flame above coalblock
Enable ignition of tnt, gunpowder and permanent
flame above coalblock using flint and steel
Override coalblock to remove flame above when dug
Add depends.txt for default mod
2016-06-04 13:39:00 +01:00
Auke Kok
ba33639887 Doors: Pass pointed_thing to on_rightclick() callback
This is an omission technicality. The callee should be able
to trust this isn't `nil`
2016-05-30 11:55:12 +01:00
paramat
541b2d79c7 Default: New mese texture. Add missing texture credits
Mese texture is a classic-mese-yellow version
of celeron55's texture used in MTv0.4.0
Add missing texture credits for mese crystal
and mese crystal fragment
2016-05-30 11:54:24 +01:00
paramat
37347d40f4 Default: Bookshelf has 2 openings instead of 4
Make rotatable with 'paramtype2 = facedir'
2016-05-28 15:11:43 +01:00
Auke Kok
d61803b65f Fire: move fire node removal out of ABM.
Because the fire nodes are not removed 100% when there are
no more burnable nodes nearby, they can potentially stay around
for very, very long times, leading to ABM trains every 5 seconds
for no good reason (only 1 in 16 will be removed every interval).

A much better method to remove fire nodes is to remove them by
timer, and give removal a 100% chance if no flammable nodes are
adjacent. This makes fire cleanup a lot faster and more natural,
and will reduce the amount of ABM hits making fire overall more
responsive.

We also remove the 1 in 4 chance and fold the removal of flammable
nodes into the ABM chance.

There's some low hanging fruit cleanups in here as well.
2016-05-28 15:11:31 +01:00
Auke Kok
e0cb3fce02 Default: Convert saplings to use node timers
Each sapling is given a single node timer that is between
2 and 4 days of game play time (40-80 minutes). If you walk out
of the zone, and come back later, the tree will always grow
to full if the timer has elapsed.

Because trees.lua is all functions, it needs to be parsed before
nodes.lua, since that references some of its functions. Hence,
change the order of parsing here. Otherwise saplings would not
grow to full.
2016-05-25 03:27:08 +01:00
Auke Kok
70ef7864c1 Farming: Convert plants to use node timers
This PR requires @minetest/minetest#3677

Farming and plant growth has traditionally in minetest been
implemented using ABM's. These ABM's periodically tick and cause
plants to grow. The way these ABM's work has several side effects
that can be considered harmful.

Not to mention a comprehensive list of downsides here, but ABM's
are chance-dependent. That results in the chance that some nodes
potentially never get processed by the ABM action, and others get
processed always. One can easily find this effect by planting a large
field of crops, and seeing that some nodes are fully grown really
fast, and some just won't make it to fully grown status even after
hours or play time.

One could solve the problem by making the ABM's slower, and giving them
a 100% of action, but this would cause the entire field to grow a step
instantly at ABM intervals, and is both ugly, and a large number of
node updates that needs to be sent out to each client. Very un-ideal.

With NodeTimers though, each node will see a separate node timer event,
and they will likely not coalesce. This means that we can stop relying
on chance to distribute plant growth, and assign a single timer event
to grow the plant to the next phase.  Due to the timer implementation,
we won't ever miss a growth event, and we can re-scehdule them until
the plant has reached full size.

Previously, plants would attempt to grow every 9 seconds, with a
chance of 1/20. This means typically, a plant would need 9*20 seconds
to grow 1 phase, and since there are 8 steps, a typical plant growth
would require 9*20*8 ABM node events. (spread out over 9*8 ABM actual
underlying events per block, roughly).

because plants are likely not growing to full for a very long time
due to statistics working against it (5% of the crops take 20x longer
than the median to grow to full, we'd be seeing ABMs fire possibly
up to 9*20*8*20 with a 95% confidence interval (the actual math
is likely off, but the scale should be correct). That's incredibly
wasteful. We'd reach those conditions easily with 20 plant nodes.

Now, after we convert to NodeTimers, each plant node will see exactly
8 NodeTimer events, and no more. This scales lineairly per plant.

I've tuned the growth rate of crops to be mature in just under 3
whole days. That's about 1hr of game time. Previously, about half
the crops would grow to full in under 2 days, but many plants would
still not be mature by the end of day 3. This is more consistent.

An additional problem in the farming mod was that the final fully-grown
plant was also included in the ABM, causing infinite more ABM's even
after the entire field had grown to completion.

Now, we're left with the problem that none of the pre-existing plants
have actual node timers started on them, and we do not want a new ABM
to fix this issue, since that would be wasteful.  Fortunately, there
is now an LBM concept, and we can use it to assure that NodeTimers
on crop nodes are properly started, and only have to do the actual
conversion once per block, ever.

We want to provide a fairly similar growth rate after this conversion
and as such I've resorted to modelling some statistical data. For this
I created a virtual 32x32 crop field with 9 steps (8 transitions)
as is the default wheat crop. We then apply a step where 1 in 20
plants in the field grows a step (randomly chosen) and count the
number of steps needed to get to 25%, 50, 75% and 95% grown.

The resulting data looks as follows:

25% - ~120 steps * 9 sec / abm = 1080s
50% - ~152 steps               = 1368s
75% - ~194 steps               = 1746s
95% - ~255 steps               = 2295s

Next, we want to create a model where the chance that a crop grows
is 100% every node timer. Since there will only be 8 steps ever,
we want the slowest crops to grow in intervals of ~ 2300 / 8 seconds
and the fastest 1/4 of crops to grow 1080 / 8 seconds intervals.
We can roughly compare this to a normal distribution with a median
of 1400 with a stddev of ~350 (thick fingering this one here).

The rest is a bit of thick-fingering to get similar growth rates,
taking into account that ABM's fire regularly so if they're missed
it's fairly painless, but our timers are going to be 1-2 minutes
apart at minimum. I calculate the timer should be around 150s
median, and experimented with several jitter ranges.

Eventually I settled for now on [80,200] with a redo of [40,80],
meaning that each growth step at minimum takes (80 to 200) seconds,
and if a negative growth condition was found (darkness, soil not
wet, etc), then the growth step is retried every (40 to 80) seconds.

The end result is a growth period from seed to full in ~ 2.25
minetest days. This is a little bit shorter than the current
growth rate but the chances you'll miss timer ticks is a bit
larger, so in normal gameplay it should be fairly comparable.

A side effect is that fields grow to full yield fairly quickly
after crops make it to mature growth, and no crops are mature
a very long time before the majority grows to full. The spread
and view over a growing field is also fairly even, there's no
large updates with plenty of nodes. Just a node here or there
every second or so in large fields.

Ultimately, we get rid of ABM rollercoasters that cause tens of
node updates every 9 seconds. This will help multiplayer servers
likely a lot.
2016-05-25 03:26:53 +01:00
Auke Kok
fc902a77de Boats: Lower boat collision box top
Standing on a boat makes you appear to "hover" over it since this
collision box is way too high. Lower it so that it's low enough
to look normal when walking on top of a boat
2016-05-23 08:37:58 +01:00
paramat
3e5f3f28d2 Vessels: Improve code style 2016-05-23 08:37:58 +01:00
paramat
d8daee7e47 Vessels: Make shelf open on 2 sides not impossible 4 sides
Make shelf facedir rotatable as is now required
2016-05-23 08:37:58 +01:00
Duane Robertson
7681682d28 Doors: Fix uninitialized state variable 2016-05-23 08:37:11 +01:00
Thomas--S
b9422ed44e Vessels: Smaller/improved textures, remove duplicated 'inv' textures
Removed unnecessary inventory textures
The drinking glass inventory texture now differs from
the node texture to be more clearly a drinking glass
Smaller textures to reduce size as nodes
2016-05-21 03:03:03 +01:00
red-001
b1e0864cf1 Creative: Reset 'start_i' to 1 when the inventory filter is changed 2016-05-21 03:02:10 +01:00
paramat
90f24e312d Default: Remove unnecessary infotexts for chests and signs 2016-05-21 03:01:10 +01:00
paramat
e7a55734d3 Tnt: Avoid divide-by-zero errors in calc_velocity() 2016-05-08 22:53:16 +01:00
tenplus1
b36b154257 Creative: Fix inventory crash after toggling creative mode in-game 2016-05-08 00:40:52 +01:00
tenplus1
3976dc6a5b 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
2016-05-07 02:13:00 +01:00
tenplus1
8ea031ef77 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
2016-05-07 02:07:55 +01:00
paramat
8c3f96d738 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
2016-05-05 23:46:53 +01:00
Foz
8d3d558e42 Tnt: Fix bug in dropped item counting 2016-05-05 23:46:10 +01:00
paramat
de3adb5859 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
2016-05-05 23:42:10 +01:00
rubenwardy
acafe5ca86 Add give_initial_items API 2016-05-01 19:29:15 +01:00
Auke Kok
12c763a6c7 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.
2016-05-01 18:57:45 +01:00
Auke Kok
098ea0d10a 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.
2016-04-30 20:47:21 +01:00
Auke Kok
f14b411157 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.
2016-04-30 20:47:21 +01:00
Foz
1a6298958e Default: Add function 'node_sound_gravel_defaults()' 2016-04-29 23:19:30 +01:00
paramat
fafbe2c268 Default: New grass and grass_side textures
Derived from Casimir's Voxelgarden texture
2016-04-29 23:19:30 +01:00
tenplus1
dc7cbdd5ab 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
2016-04-29 23:18:05 +01:00
Auke Kok
5cd4b5a231 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.
2016-04-26 22:34:00 +01:00
Auke Kok
f62afa02b7 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.
2016-04-26 22:34:00 +01:00
Auke Kok
7a892c70e6 TNT: self-start boom removal timer. 2016-04-26 22:34:00 +01:00
Auke Kok
682d79b82a 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.
2016-04-26 22:34:00 +01:00
Auke Kok
8b384fb257 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.
2016-04-26 22:34:00 +01:00
Auke Kok
d6c33da355 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.
2016-04-26 22:33:59 +01:00
Auke Kok
386dcdef06 TNT: Whitespace cleanup 2016-04-26 22:33:59 +01:00
Auke Kok
54b87e955d 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.
2016-04-26 22:33:59 +01:00
paramat
f32a3ff57c Farming: Add quiet sounds to seeds 2016-04-23 20:09:04 +01:00
kilbith
16fe1efcd8 Flowers: Fix waterlily node's duplication with stack of 1 2016-04-23 20:08:43 +01:00
KevDoy
fa43bd8a56 Default: New heart texture
Similar to before, add symmetry and slightly more rounded off
2016-04-23 20:01:09 +01:00
paramat
e426f64993 Fire: Higher chance of removing flammable nodes
Flammable nodes burn away quicker
2016-04-19 05:33:13 +01:00
paramat
ab7b7c7504 Flowers: Make flower spread a public function to enable override
Remove search for 'group:flora_block'
Enable flora spread on 'dirt with dry grass'
2016-04-19 02:58:03 +01:00
Auke Kok
80664f9f8a Doors: Use LBM instead of ABM to convert doors.
This works much more efficiently to replace old style doors.
2016-04-19 02:57:54 +01:00
paramat
0ca43e42bc Default: Create 'grass', 'dry_grass' groups, use in dirt conversion ABM 2016-04-18 01:52:03 +01:00
Auke Kok
33aa5e77dc Character: Fix boat leg wobble.
There was a small leg wobble in the sitting animation (visible
when sitting on the boat). This removes it.
2016-04-18 01:51:57 +01:00
paramat
f8e273da15 Boats: Increase maximum velocity to 5n/s 2016-04-16 19:27:47 +01:00
tenplus1
9ece86cc7a 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
2016-04-16 19:27:41 +01:00
Auke Kok
7d93272caa 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.
2016-04-16 19:27:34 +01:00
Auke Kok
64fe69f382 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.
2016-04-16 19:27:34 +01:00
Auke Kok
a2d4e57716 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
2016-04-16 19:27:16 +01:00
Auke Kok
8114c3dbab Limit entity speed to 250m/s.
Let's just call it "terminal" velocity.
2016-04-16 19:27:16 +01:00
Auke Kok
e6cef57661 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.
2016-04-16 19:27:16 +01:00
Auke Kok
0736d30e33 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.
2016-04-16 19:27:16 +01:00
red-001
a84e2669c7 Restructure code to only check def once. 2016-04-16 19:27:16 +01:00
Auke Kok
ccee025ce3 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.
2016-04-16 19:27:16 +01:00
Auke Kok
8c801529df 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
2016-04-16 19:27:16 +01:00
Auke Kok
3ddff2fbea TNT: Chain reaction
With the new high res timer, we can make TNT much better create chain
reactions. This does exactly that.
2016-04-16 19:27:16 +01:00
Auke Kok
eafd1ebc43 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.
2016-04-16 19:27:16 +01:00
Auke Kok
3623398b78 TNT: Spacing / codestyle fixes
- Fix spacing errors around = and ..
- Indentation fixes
- Break up long lines
2016-04-16 19:27:16 +01:00
red-001
b25889e742 Make TNT faster by using VoxelManip() for removing nodes. 2016-04-16 19:27:16 +01:00
red-001
9f4dc1412b Fix TNT mod calculate blast intensity.
Currently the TNT mod uses a dummy vaule of 1 for this.
2016-04-16 19:27:16 +01:00
red-001
cfef21f4d9 Add TNT API. 2016-04-16 19:27:16 +01:00
Auke Kok
8556dd30e2 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.
2016-04-16 19:27:16 +01:00
Auke Kok
8cd049c224 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.
2016-04-16 19:27:16 +01:00
Auke Kok
12d5ca2f48 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.
2016-04-16 19:27:16 +01:00
Auke Kok
3ecafbcfb4 Remove composed shelf side.
Don't compose the shelf side texture. The texture isn't transparent,
and unlikely to be in any case.
2016-04-14 02:46:03 +01:00
kilbith
082b36d3e7 Books: Split text per page relatively to number of lines 2016-04-14 02:45:57 +01:00
kilbith
7be008936e Flowers: Fix itemstack when waterlily is placed 2016-04-12 01:28:16 +01:00
tenplus1
6e1a329763 default: Strengthen obsidian glass Remove group 'oddly_breakable_by_hand' 2016-04-12 01:27:55 +01:00
kilbith
47b197e4d5 Flowers: Cleaning of waterlily's placement 2016-04-08 01:13:14 +01:00
paramat
be05441e77 Farming: Override dirt_with_dry_grass to enable cultivation 2016-04-08 01:13:05 +01:00
paramat
aadac1223d Default/mapgen: Denser rainforest, fewer logs 2016-04-08 01:12:56 +01:00
kilbith
9a6cb2d7c8 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.
2016-04-04 05:39:29 +01:00
Auke Kok
f4e77edcc6 Flood snow with either lava or water.
Fixes #1005

This doesn't flood snow or ice blocks.
2016-04-04 05:39:23 +01:00
tenplus1
e38f69d549 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.
2016-04-04 05:39:16 +01:00
Auke Kok
874b1ae326 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
2016-04-04 05:39:06 +01:00
Auke Kok
1977ae19ae 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
2016-03-30 23:11:12 +01:00
Rui
7bbbcbf7b0 Fire: Use get_item_group instead of get_node_group 2016-03-30 23:11:04 +01:00
Auke Kok
4d7dbfc826 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.
2016-03-30 23:10:59 +01:00
tenplus1
787ccb5747 Add recipe to craft clay block back into lumps
Added a recipe to craft a clay block back into 4 clay lumps.
2016-03-30 23:10:52 +01:00
Jean-Patrick Guerrero
12bcfeab4d Shelves: Fix listring functionality + code cleaning 2016-03-30 23:10:46 +01:00
paramat
14334a1d89 Default: Reduce sand footstep and dug sound gains 2016-03-25 13:15:22 +00:00
Jean-Patrick Guerrero
6749da1070 Books: Ensure backward compatibility for older written books 2016-03-25 13:15:12 +00:00
Jean-Patrick Guerrero
7a29d26e3e Fire: Allow placing only above flammable blocks 2016-03-25 13:15:04 +00:00
Rui
7cba7af894 Rename Glass Door (the obisian one) to Obsidian Glass Door 2016-03-22 15:46:26 +00:00
Jean-Patrick Guerrero
a71948c007 Books: Move page buttons at the bottom 2016-03-22 15:46:19 +00:00
Jean-Patrick Guerrero
c3d2bc383b Wooden Sign: Add group oddly_breakable_by_hand 2016-03-22 15:46:13 +00:00
paramat
7d55320d5c Default: Make some plant nodes non-flammable 2016-03-22 15:46:07 +00:00
paramat
0d3bca790c Default: Fix rotation errors for mapgen aspen and sapling jungletree 2016-03-22 15:46:00 +00:00
Auke Kok
ffba9d978e 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.
2016-03-22 15:45:54 +00:00
Jean-Patrick Guerrero
1a5f89e750 Creative: Code cleaning + Fix items moving in virtual inventory 2016-03-22 15:45:48 +00:00
tenplus1
51891122f2 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 :)
2016-03-22 15:45:39 +00:00
paramat
537f94c28e Fire: Speed up fire spread and burn out 2016-03-21 06:17:50 +00:00
Auke Kok
da0cc7f6f6 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)
2016-03-21 06:17:45 +00:00
Jean-Patrick Guerrero
b57dd0f9b2 Books: Add support for multiple pages 2016-03-21 06:17:40 +00:00
Rui
8fdcfea9f9 Allow for shift+clicking inventory from bones 2016-03-21 06:17:33 +00:00
Auke Kok
9de43cdf7d 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.
2016-03-21 06:17:27 +00:00
Rui914
a2ecc51fbc Create API for registration of fence gate. 2016-03-21 06:17:21 +00:00
James Stevenson
d90a081722 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
2016-03-18 02:35:38 +00:00
Auke Kok
70248505ae 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.
2016-03-18 02:35:28 +00:00
Auke Kok
22e32a01ad Allow digging of protected doors with "protection_bypass"
This was probably lost in either the API rewrite or a merge/rebase.

Fixes #929
2016-03-18 02:35:20 +00:00
Auke Kok
c94349eaef 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.
2016-03-18 02:35:14 +00:00
Auke Kok
41c2b2aeea 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.
2016-03-18 02:35:07 +00:00
Auke Kok
cb57f70aab 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.
2016-03-18 02:34:43 +00:00
paramat
f18871d60c Default: Colourise desert cobble to be consistent with desert stone
Hue and saturation match desert stone and desert stone brick
Preserve original mortar colour
2016-03-15 16:23:13 +00:00
paramat
c17c317669 Doors: Update glass door item textures to new design 2016-03-15 16:23:05 +00:00
Auke Kok
7c966db4bc 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.
2016-03-15 16:22:58 +00:00
Auke Kok
e5304ce674 Fire: Optimize spreading ABM.
No need to find_node_near twice with the same params.
2016-03-15 16:22:50 +00:00
Jean-Patrick Guerrero
28884cc784 Add flint and flint-and-steel 2016-03-15 16:22:42 +00:00
Auke Kok
dfee51c21e 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.
2016-03-13 04:49:21 +00:00
tenplus1
20053d6b52 Fix bug rotating unknown node
This fixes a bug what crashes game when rotating an unknown node.
2016-03-13 04:49:15 +00:00
paramat
079b796031 Dye: Add global table of dye names and descriptions 2016-03-13 04:49:03 +00:00
paramat
9c887e0b32 Dye: Make pink dye mixable
Correct 2 inconsistent mixes
Clean up code style and vertically align mix table
Remove dyelocal and simplify table names
2016-03-13 04:49:03 +00:00
Auke Kok
2fb40be409 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
2016-03-13 04:48:57 +00:00
Auke Kok
f8f7502e32 Basic stone walls, using NDT_CONNECTED.
These basic connected wall nodes automatically connect
to neigboring stone blocks, other wall blocks and anything
that's "cracky". The do not connect to wood (fences will do
that).

The walls are generated using a new walls.register() API.
Documentation on the API is included in game_api.txt.

This change requires minetest/minetest#3503.

Walls are added for all cobble stone materials. They generally
look best and are the natural use cases for these materials.
2016-03-13 04:11:22 +00:00
Auke Kok
b998ab1b3a Add a simple, but stylish fence gate.
This fence gate builds on NDT_CONNECTED by assuming fence nodes will
automatically connect to it's sides properly. The fence gate will
open and close just like doors, with sounds, but it only opens one
way. The gate sticks out quite a bit and can be bumped into, so the
fence may be used as some sort of path switch.

The fence gate offers no form of protection and can be opened and
closed by anyone. This is done on purpose - the fencegate isn't
meant to provide protection from players, as fences can be
trivially jumped over. Instead, these fences should be used for
protecting crops from hungry sheep, or keeping rabbits in their
pen, or just decoration. Mods can also modify the mod to add
protection, of course.

A recipe is added to make these. It's 4 sticks and 2 wood (any)
as follows:

  stick  wood  stick
  stick  wood  stick

The collision box of the open gate is such that if two gates are
connected but mirrored (making an M shape) then you can walk a large
entity that's larger than 1.0 wide through the opening. The gate of
an opened fence can also be stood upon or bumped into.

I've mixed together some sounds to provide a somewhat light sound
experience, one that one would expect from a small gate latching open
and close.

This change requires #873, otherwise it doesn't connect to fences.
2016-03-13 04:11:03 +00:00
Auke Kok
d979293f14 Convert fences to NDT_CONNECTED.
This changes the drawtype of fences to NDT_CONNECTED nodebox drawtype.

These nodes are drawn by the client with the needed connections on
the fly as the scene is drawn. There is no logic needed by mods to
modify the nodes.

These fences connect to (1) other fences, (2) planks and (3) tree
trunks, but nothing else. They do not connect to stone, dirt, wool,
etc. This is done by the "connects_to" parameter, which takes groups
and node names.

Due to the way textures are wrapped, we can make these nodes look a
lot better by giving them a special tile.

This change requires minetest/minetest#3503.
2016-03-13 04:10:51 +00:00
Jean-Patrick Guerrero
676822d286 Change steel ladder sounds + fix/add missing recipes 2016-03-11 15:28:13 +00:00
red-001
a5ad30748d Add an on_burn callback. 2016-03-11 15:27:57 +00:00
paramat
45bc0b245f Beds: Fix code style issues 2016-03-09 02:44:32 +00:00
Jean-Patrick Guerrero
aa676ab878 Add steel sign + Update wooden sign texture 2016-03-09 02:44:27 +00:00
paramat
f80fafbcfb Default: New jungletree_top texture 2016-03-06 01:32:11 +00:00
Jean-Patrick Guerrero
7f317871d4 Add steel ladder 2016-03-06 01:31:36 +00:00