Torch particle, item magnet fix

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.
This commit is contained in:
oilboi 2020-02-22 10:27:33 -05:00
parent 8b20c9cfc4
commit c354bbfe59
4 changed files with 28 additions and 20 deletions

View File

@ -237,10 +237,12 @@ minetest.register_entity(":__builtin:item", {
--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)
--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 velocity = vector.add(player_velocity,velocity)
self.object:setvelocity(velocity)

View File

@ -76,6 +76,7 @@ local function create_ps(pos)
end
--reload smoke and flame on load
--[[
minetest.register_lbm({
name = "redstone:torch",
nodenames = {"redstone:torch_floor","redstone:torch_wall"},
@ -84,7 +85,7 @@ minetest.register_lbm({
create_ps(pos)
end,
})
]]--
-- 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)
create_ps(pos)
--create_ps(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(),
})
@ -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)
create_ps(pos)
--create_ps(pos)
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)

View File

@ -75,6 +75,7 @@ local function create_ps(pos)
meta:set_int("pss", pss)
end
--[[
--reload smoke and flame on load
minetest.register_lbm({
name = "torch:torch",
@ -84,7 +85,7 @@ minetest.register_lbm({
create_ps(pos)
end,
})
]]--
-- 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)
create_ps(pos)
--create_ps(pos)
end,
on_destruct = function(pos)
delete_ps(pos)
--delete_ps(pos)
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)
create_ps(pos)
-- create_ps(pos)
end,
on_destruct = function(pos)
delete_ps(pos)
-- delete_ps(pos)
end,
sounds = main.woodSound(),
})

View File

@ -1,3 +1,5 @@
ALPHA STATE CHANGELOG
0.1
--make a grass biome
--make trees
--make hand - mod another mod
@ -19,23 +21,19 @@
--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
--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
rewrite the item collection to magnetize using the possible application below
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
open bugs:
fix torches not deleting particles when mounted node dug <- meta glitch?
--fixing with abm
possible applications:
causes object to magnetize towards player or other objects and stop after an inner radius
use for better item magnet?