]> git.lizzy.rs Git - Crafter.git/commitdiff
Pass through TTL to item entity so it can use an internalized variable (useful for...
authoroilboi <47129783+oilboi@users.noreply.github.com>
Wed, 22 Apr 2020 05:30:11 +0000 (01:30 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Wed, 22 Apr 2020 05:30:11 +0000 (01:30 -0400)
README.md
mods/itemhandling/init.lua

index ecea4e4841beddd5e2b351f463869776a40b382e..ef709b6296c20d22cc7d631cee8fc8126ba3ade6 100644 (file)
--- a/README.md
+++ b/README.md
 - Add in Aether prototype dimension (21000-31000 on Y axis)
 - Added in the early prototype of the VOID (made of bedrock for now)
 - Make it so you can place down beds in the nether and void, but they explode when you try to sleep in them
-
+- Made TNT even more efficient, stopped dropping of bedrock and obsidian
 ---
 
 
index 4b2df0b1783ded5088a4548745c1b3c46823901c..458c1fa2abbd92725e160c0644d9570a7445e53d 100644 (file)
@@ -116,7 +116,7 @@ end
 -- If item_entity_ttl is not set, enity will have default life time
 -- Setting it to -1 disables the feature
 
-local time_to_live = tonumber(minetest.settings:get("item_entity_ttl")) or 900
+local time_to_live = tonumber(minetest.settings:get("item_entity_ttl")) or 300
 local gravity = tonumber(minetest.settings:get("movement_gravity")) or 9.81
 
 
@@ -153,6 +153,7 @@ minetest.register_entity(":__builtin:item", {
        collected = false,
        delete_timer = 0,
        radius = collection.magnet_radius,
+       time_to_live = time_to_live,
 
        set_item = function(self, item)
                local stack = ItemStack(item or self.itemstring)
@@ -309,7 +310,7 @@ minetest.register_entity(":__builtin:item", {
                end
                                
                self.age = self.age + dtime
-               if time_to_live > 0 and self.age > time_to_live then
+               if self.time_to_live > 0 and self.age > self.time_to_live then
                        self.itemstring = ""
                        self.object:remove()
                        return