- May 15, 2016
- May 02, 2016
- May 01, 2016
-
-
rubenwardy authored
-
Auke Kok authored
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.
-
- Apr 30, 2016
-
-
Auke Kok authored
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.
-
Auke Kok authored
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.
-
Foz authored
-
paramat authored
Derived from Casimir's Voxelgarden texture
-
tenplus1 authored
Tweaked the beds.save_spawns() function to compile list then output to file with shortened co-ordinates containing 1 decimal place
-
- Apr 26, 2016
-
-
Auke Kok authored
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.
-
Auke Kok authored
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.
-
Auke Kok authored
-
Auke Kok authored
This allows TNT to be used for e.g. traps (drop it from the ceiling) or weird tnt effects with other explosions.
-
Auke Kok authored
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.
-
Auke Kok authored
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.
-
Auke Kok authored
-
Auke Kok authored
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.
-
- Apr 23, 2016
- Apr 19, 2016
- Apr 18, 2016
- Apr 16, 2016
-
-
paramat authored
-
tenplus1 authored
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
-
Auke Kok authored
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.
-
Auke Kok authored
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.
-
Auke Kok authored
This will make sand and gravel blocks on top of TNT actually fly in the air. https://youtu.be/4omndVZijLc
-
Auke Kok authored
Let's just call it "terminal" velocity.
-
Auke Kok authored
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.
-
Auke Kok authored
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.
-
Auke Kok authored
-
red-001 authored
-
Auke Kok authored
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.
-
Auke Kok authored
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
-