]> git.lizzy.rs Git - Crafter.git/commitdiff
Snowballs now explode when they hit something in the nether
authoroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 26 May 2020 04:41:05 +0000 (00:41 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 26 May 2020 04:41:05 +0000 (00:41 -0400)
README.md
mods/weather/init.lua

index 831a2a3122abe2db03ce99caa7eeebad2a69da61..e69feba867270daec5819355042e5810e9ca157c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -149,6 +149,7 @@ enable_mod_channels = true
 - You no longer get hurt in nether lava when in an iron boat
 - Boats now throw players up so they can make it to land
 - Nether songs play 3-6 seconds after entering the nether
+- Snowballs now explode when they hit something in the nether
 ---
 
 
index c9d36553d4e3eda630cb3e7be4d260b661a54094..f7e530542160f93ecf963844a8713d888fc88dc9 100644 (file)
@@ -433,43 +433,46 @@ snowball.on_step = function(self, dtime)
        end
        
        if (self.oldvel and ((vel.x == 0 and self.oldvel.x ~= 0) or (vel.y == 0 and self.oldvel.y ~= 0) or (vel.z == 0 and self.oldvel.z ~= 0))) or hit == true then
-       
-               minetest.sound_play("wool",{pos=pos, pitch = math.random(80,100)/100})
-               minetest.add_particlespawner({
-                       amount = 20,
-                       -- Number of particles spawned over the time period `time`.
-
-                       time = 0.001,
-                       -- Lifespan of spawner in seconds.
-                       -- If time is 0 spawner has infinite lifespan and spawns the `amount` on
-                       -- a per-second basis.
-
-                       minpos = pos,
-                       maxpos = pos,
-                       minvel = {x=-2, y=3, z=-2},
-                       maxvel = {x=2, y=5, z=2},
-                       minacc = {x=0, y=-9.81, z=0},
-                       maxacc = {x=0, y=-9.81, z=0},
-                       minexptime = 1,
-                       maxexptime = 3,
-                       minsize = 1,
-                       maxsize = 1,
-                       -- The particles' properties are random values between the min and max
-                       -- values.
-                       -- pos, velocity, acceleration, expirationtime, size
-
-                       collisiondetection = true,
-
-                       collision_removal = true,
-
-                       object_collision = false,
-
-                       texture = "snowflake_"..math.random(1,2)..".png",
-
-               })
-               
-               self.object:remove()
-               
+               --snowballs explode in the nether
+               if pos.y <= -10000 and pos.y >= -20000 then
+                       self.object:remove()
+                       tnt(pos,4)
+               else
+                       minetest.sound_play("wool",{pos=pos, pitch = math.random(80,100)/100})
+                       minetest.add_particlespawner({
+                               amount = 20,
+                               -- Number of particles spawned over the time period `time`.
+
+                               time = 0.001,
+                               -- Lifespan of spawner in seconds.
+                               -- If time is 0 spawner has infinite lifespan and spawns the `amount` on
+                               -- a per-second basis.
+
+                               minpos = pos,
+                               maxpos = pos,
+                               minvel = {x=-2, y=3, z=-2},
+                               maxvel = {x=2, y=5, z=2},
+                               minacc = {x=0, y=-9.81, z=0},
+                               maxacc = {x=0, y=-9.81, z=0},
+                               minexptime = 1,
+                               maxexptime = 3,
+                               minsize = 1,
+                               maxsize = 1,
+                               -- The particles' properties are random values between the min and max
+                               -- values.
+                               -- pos, velocity, acceleration, expirationtime, size
+
+                               collisiondetection = true,
+
+                               collision_removal = true,
+
+                               object_collision = false,
+
+                               texture = "snowflake_"..math.random(1,2)..".png",
+
+                       })
+                       self.object:remove()
+               end
        end
        
        self.oldvel = vel