mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Rename to vl_physics
This commit is contained in:
parent
9c98588c3a
commit
a9f3504e34
9 changed files with 13 additions and 13 deletions
|
@ -995,7 +995,7 @@ minetest.register_entity(":__builtin:item", {
|
||||||
|
|
||||||
if push_out_item_stuck_in_solid(self, dtime, p, def, is_in_water) then return end
|
if push_out_item_stuck_in_solid(self, dtime, p, def, is_in_water) then return end
|
||||||
|
|
||||||
mcl_physics.apply_entity_environmental_physics(self)
|
vl_physics.apply_entity_environmental_physics(self)
|
||||||
|
|
||||||
-- If node is not registered or node is walkably solid and resting on nodebox
|
-- If node is not registered or node is walkably solid and resting on nodebox
|
||||||
local nn = minetest.get_node(vector.offset(p, 0, -0.5, 0)).name
|
local nn = minetest.get_node(vector.offset(p, 0, -0.5, 0)).name
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
name = mcl_item_entity
|
name = mcl_item_entity
|
||||||
author = PilzAdam
|
author = PilzAdam
|
||||||
description = Dropped items will be attracted to the player like a magnet.
|
description = Dropped items will be attracted to the player like a magnet.
|
||||||
depends = mcl_physics, mcl_enchanting
|
depends = vl_physics, mcl_enchanting
|
||||||
|
|
|
@ -412,7 +412,7 @@ local function on_step_work (self, dtime)
|
||||||
self:check_suspend(player_in_active_range)
|
self:check_suspend(player_in_active_range)
|
||||||
|
|
||||||
-- Handle environmental physics
|
-- Handle environmental physics
|
||||||
mcl_physics.apply_entity_environmental_physics(self)
|
vl_physics.apply_entity_environmental_physics(self)
|
||||||
|
|
||||||
if not self._jumping_cliff then
|
if not self._jumping_cliff then
|
||||||
self._can_jump_cliff = self:can_jump_cliff()
|
self._can_jump_cliff = self:can_jump_cliff()
|
||||||
|
|
|
@ -2,4 +2,4 @@ name = mcl_mobs
|
||||||
author = PilzAdam
|
author = PilzAdam
|
||||||
description = Adds a mob API for mods to add animals or monsters, etc.
|
description = Adds a mob API for mods to add animals or monsters, etc.
|
||||||
depends = mcl_particles, mcl_luck
|
depends = mcl_particles, mcl_luck
|
||||||
optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor, mcl_portals, mcl_experience, mcl_sculk, mcl_physics
|
optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor, mcl_portals, mcl_experience, mcl_sculk, vl_physics
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local mod = mcl_physics
|
local mod = vl_physics
|
||||||
|
|
||||||
local registered_environment_effects = {}
|
local registered_environment_effects = {}
|
||||||
|
|
||||||
|
@ -35,12 +35,12 @@ local DEFAULT_ENTITY_PHYSICS = {
|
||||||
function mod.apply_entity_environmental_physics(self, data)
|
function mod.apply_entity_environmental_physics(self, data)
|
||||||
data = data or {}
|
data = data or {}
|
||||||
|
|
||||||
local physics = self._mcl_physics or DEFAULT_ENTITY_PHYSICS
|
local physics = self._vl_physics or DEFAULT_ENTITY_PHYSICS
|
||||||
local mass = physics.mass or DEFAULT_ENTITY_PHYSICS.mass
|
local mass = physics.mass or DEFAULT_ENTITY_PHYSICS.mass
|
||||||
|
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
local vel = self.object:get_velocity()
|
local vel = self.object:get_velocity()
|
||||||
local new_velocity,new_acceleration = mcl_physics.get_environment_effect(pos, vel, data, mass, self)
|
local new_velocity,new_acceleration = vl_physics.get_environment_effect(pos, vel, data, mass, self)
|
||||||
|
|
||||||
--if new_velocity then print("new_velocity="..tostring(new_velocity)) end
|
--if new_velocity then print("new_velocity="..tostring(new_velocity)) end
|
||||||
--if new_acceleration then print("new_acceleration="..tostring(new_acceleration)) end
|
--if new_acceleration then print("new_acceleration="..tostring(new_acceleration)) end
|
|
@ -1,7 +1,7 @@
|
||||||
local modname = minetest.get_current_modname()
|
local modname = minetest.get_current_modname()
|
||||||
local modpath = minetest.get_modpath(modname)
|
local modpath = minetest.get_modpath(modname)
|
||||||
local mod = {}
|
local mod = {}
|
||||||
mcl_physics = mod
|
vl_physics = mod
|
||||||
|
|
||||||
dofile(modpath.."/api.lua")
|
dofile(modpath.."/api.lua")
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ local DEFAULT_NODE_PHYSICS = {
|
||||||
}
|
}
|
||||||
local function apply_node_physics(node, vel, staticdata, entity)
|
local function apply_node_physics(node, vel, staticdata, entity)
|
||||||
local node_def = minetest.registered_nodes[node.name] or {}
|
local node_def = minetest.registered_nodes[node.name] or {}
|
||||||
local node_physics = node_def._mcl_physics or DEFAULT_NODE_PHYSICS
|
local node_physics = node_def._vl_physics or DEFAULT_NODE_PHYSICS
|
||||||
|
|
||||||
local node_physics_effect = node_physics.effect
|
local node_physics_effect = node_physics.effect
|
||||||
if node_physics_effect then
|
if node_physics_effect then
|
|
@ -1,4 +1,4 @@
|
||||||
name = mcl_physics
|
name = vl_physics
|
||||||
author = teknomunk
|
author = teknomunk
|
||||||
description = Environmental physics
|
description = Environmental physics
|
||||||
depends = flowlib
|
depends = flowlib
|
|
@ -107,7 +107,7 @@ local function xp_step(self, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Slide on slippery nodes
|
-- Slide on slippery nodes
|
||||||
mcl_physics.apply_entity_environmental_physics(self)
|
vl_physics.apply_entity_environmental_physics(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_entity("mcl_experience:orb", {
|
minetest.register_entity("mcl_experience:orb", {
|
||||||
|
|
|
@ -919,7 +919,7 @@ minetest.register_node("mcl_core:ice", {
|
||||||
_mcl_blast_resistance = 0.5,
|
_mcl_blast_resistance = 0.5,
|
||||||
_mcl_hardness = 0.5,
|
_mcl_hardness = 0.5,
|
||||||
_mcl_silk_touch_drop = true,
|
_mcl_silk_touch_drop = true,
|
||||||
_mcl_physics = {
|
_vl_physics = {
|
||||||
friction = 0.4,
|
friction = 0.4,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -936,7 +936,7 @@ minetest.register_node("mcl_core:packed_ice", {
|
||||||
_mcl_blast_resistance = 0.5,
|
_mcl_blast_resistance = 0.5,
|
||||||
_mcl_hardness = 0.5,
|
_mcl_hardness = 0.5,
|
||||||
_mcl_silk_touch_drop = true,
|
_mcl_silk_touch_drop = true,
|
||||||
_mcl_physics = {
|
_vl_physics = {
|
||||||
friction = 0.15,
|
friction = 0.15,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue