]> git.lizzy.rs Git - Crafter.git/commitdiff
Torch particle, item magnet fix
authoroilboi <47129783+oilboi@users.noreply.github.com>
Sat, 22 Feb 2020 15:27:33 +0000 (10:27 -0500)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Sat, 22 Feb 2020 15:27:33 +0000 (10:27 -0500)
Disable the torch particles temporarily to move to another fix with abms.
Make the item magnet move with the player as to not break the animation flow when a player is moving fast.

mods/itemhandling/init.lua
mods/redstone/torch.lua
mods/torch/init.lua
todo.txt

index 374d740a485bae84d04360c530eac16380e0d476..8f996148ca1f26519547c13086d830992db106fd 100644 (file)
@@ -237,10 +237,12 @@ minetest.register_entity(":__builtin:item", {
                         --get the variables
                         local pos = self.object:getpos()
                         local pos2 = collector:getpos()
                         --get the variables
                         local pos = self.object:getpos()
                         local pos2 = collector:getpos()
+                        local player_velocity = collector:get_player_velocity()
                         pos2.y = pos2.y + self.collection_height
                                                 
                         local direction = vector.normalize(vector.subtract(pos2,pos))
                         local distance = vector.distance(pos2,pos)
                         pos2.y = pos2.y + self.collection_height
                                                 
                         local direction = vector.normalize(vector.subtract(pos2,pos))
                         local distance = vector.distance(pos2,pos)
+                                                
                         
                         --remove if too far away
                         if distance > self.radius then
                         
                         --remove if too far away
                         if distance > self.radius then
@@ -250,6 +252,7 @@ minetest.register_entity(":__builtin:item", {
                         local multiplier = (self.radius*5) - distance
                         local velocity = vector.multiply(direction,multiplier)
                         
                         local multiplier = (self.radius*5) - distance
                         local velocity = vector.multiply(direction,multiplier)
                         
+                        local velocity = vector.add(player_velocity,velocity)
                         
                         self.object:setvelocity(velocity)
                         
                         
                         self.object:setvelocity(velocity)
                         
index 6f627c5f4d652ba62bad4b4c5e81c16fbbe92c5b..8aa659e4e814fe73dd4ddecea1d5e7dc031dc93a 100644 (file)
@@ -76,6 +76,7 @@ local function create_ps(pos)
 end
 
 --reload smoke and flame on load
 end
 
 --reload smoke and flame on load
+--[[
 minetest.register_lbm({
       name = "redstone:torch",
       nodenames = {"redstone:torch_floor","redstone:torch_wall"},
 minetest.register_lbm({
       name = "redstone:torch",
       nodenames = {"redstone:torch_floor","redstone:torch_wall"},
@@ -84,7 +85,7 @@ minetest.register_lbm({
             create_ps(pos)
       end,
 })
             create_ps(pos)
       end,
 })
-
+]]--
 -- Item definitions
 minetest.register_craftitem("redstone:torch", {
       description = "Redstone Torch",
 -- Item definitions
 minetest.register_craftitem("redstone:torch", {
       description = "Redstone Torch",
@@ -144,14 +145,14 @@ minetest.register_node("redstone:torch_floor", {
             fixed = {-1/16, -0.5, -1/16, 1/16, 2/16, 1/16},
       },
       on_construct = function(pos)
             fixed = {-1/16, -0.5, -1/16, 1/16, 2/16, 1/16},
       },
       on_construct = function(pos)
-            create_ps(pos)
+            --create_ps(pos)
             redstone.update(pos)
       end,
       after_destruct = function(pos, oldnode)
             redstone.update(pos,oldnode)
       end,
       on_destruct = function(pos)
             redstone.update(pos)
       end,
       after_destruct = function(pos, oldnode)
             redstone.update(pos,oldnode)
       end,
       on_destruct = function(pos)
-            delete_ps(pos)
+            --delete_ps(pos)
       end,
       sounds = main.woodSound(),
 })
       end,
       sounds = main.woodSound(),
 })
@@ -178,11 +179,11 @@ minetest.register_node("redstone:torch_wall", {
             wall_side = {-0.5, -0.3, -0.1, -0.2, 0.3, 0.1},
       },
       on_construct = function(pos)
             wall_side = {-0.5, -0.3, -0.1, -0.2, 0.3, 0.1},
       },
       on_construct = function(pos)
-            create_ps(pos)
+            --create_ps(pos)
             redstone.update(pos)
       end,
       after_destruct = function(pos, oldnode)
             redstone.update(pos)
       end,
       after_destruct = function(pos, oldnode)
-            redstone.update(pos,oldnode)
+            --redstone.update(pos,oldnode)
       end,
       on_destruct = function(pos)
             delete_ps(pos)
       end,
       on_destruct = function(pos)
             delete_ps(pos)
index f1949ad9761e0719cf7b174e3e864e8d78cdbedd..8d5906a31f1bc9e73526c6e665aa7f746662ba1e 100644 (file)
@@ -75,6 +75,7 @@ local function create_ps(pos)
       meta:set_int("pss", pss)
 end
 
       meta:set_int("pss", pss)
 end
 
+--[[
 --reload smoke and flame on load
 minetest.register_lbm({
       name = "torch:torch",
 --reload smoke and flame on load
 minetest.register_lbm({
       name = "torch:torch",
@@ -84,7 +85,7 @@ minetest.register_lbm({
             create_ps(pos)
       end,
 })
             create_ps(pos)
       end,
 })
-
+]]--
 -- Item definitions
 minetest.register_craftitem("torch:torch", {
       description = "Torch",
 -- Item definitions
 minetest.register_craftitem("torch:torch", {
       description = "Torch",
@@ -142,10 +143,10 @@ minetest.register_node("torch:floor", {
             fixed = {-1/16, -0.5, -1/16, 1/16, 2/16, 1/16},
       },
       on_construct = function(pos)
             fixed = {-1/16, -0.5, -1/16, 1/16, 2/16, 1/16},
       },
       on_construct = function(pos)
-            create_ps(pos)
+            --create_ps(pos)
       end,
       on_destruct = function(pos)
       end,
       on_destruct = function(pos)
-            delete_ps(pos)
+            --delete_ps(pos)
       end,
       sounds = main.woodSound(),
 })
       end,
       sounds = main.woodSound(),
 })
@@ -171,10 +172,10 @@ minetest.register_node("torch:wall", {
             wall_side = {-0.5, -0.3, -0.1, -0.2, 0.3, 0.1},
       },
       on_construct = function(pos)
             wall_side = {-0.5, -0.3, -0.1, -0.2, 0.3, 0.1},
       },
       on_construct = function(pos)
-            create_ps(pos)
+           -- create_ps(pos)
       end,
       on_destruct = function(pos)
       end,
       on_destruct = function(pos)
-            delete_ps(pos)
+           -- delete_ps(pos)
       end,
       sounds = main.woodSound(),
 })
       end,
       sounds = main.woodSound(),
 })
index 2d262197e656c92cc79922f577038566e455e838..1d71413efd0321aa6f1c917c535f29ed72d1a089 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -1,3 +1,5 @@
+ALPHA STATE CHANGELOG
+0.1
 --make a grass biome
 --make trees
 --make hand - mod another mod
 --make a grass biome
 --make trees
 --make hand - mod another mod
 --water flow faster
 --torches with particle
 --make a mob
 --water flow faster
 --torches with particle
 --make a mob
-
+--0.2
 --fix tools causing crash on pigs with no fleshy definition
 --ladders - only placeable on walls
 --eating animation - particles? - entity?
 --boats
 --make falling item have fall soundspec
 --rebalance sand audio
 --fix tools causing crash on pigs with no fleshy definition
 --ladders - only placeable on walls
 --eating animation - particles? - entity?
 --boats
 --make falling item have fall soundspec
 --rebalance sand audio
+--rewrite the item collection better
+(not finished) redstone - make nodes drop multiple items individually
+make item collection move with the player's speed too
 
 
-
-
-redstone - make nodes drop multiple items individually
-
-
-
-
+saplings
 make entities push against players
 make entities push against players
-rewrite the item collection to magnetize using the possible application below
 crafting bench
 fishing
 bows
 crafting bench
 fishing
 bows
@@ -54,11 +52,16 @@ colored chat messages
 check if everyone is in bed before going to next night
 also lock player in bed until they get out or daytime
 
 check if everyone is in bed before going to next night
 also lock player in bed until they get out or daytime
 
+
+
+
 open bugs:
 fix torches not deleting particles when mounted node dug <- meta glitch?
 open bugs:
 fix torches not deleting particles when mounted node dug <- meta glitch?
+--fixing with abm
+
 
 
-possible applications:
 
 
+possible applications:
 causes object to magnetize towards player or other objects and stop after an inner radius
 use for better item magnet?
 
 causes object to magnetize towards player or other objects and stop after an inner radius
 use for better item magnet?