Rename to vl_physics

This commit is contained in:
teknomunk 2024-05-04 11:43:04 +00:00
parent bcbc0a18a4
commit 0a50bc905b
9 changed files with 13 additions and 13 deletions

View File

@ -971,7 +971,7 @@ minetest.register_entity(":__builtin:item", {
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
local nn = minetest.get_node(vector.offset(p, 0, -0.5, 0)).name

View File

@ -1,4 +1,4 @@
name = mcl_item_entity
author = PilzAdam
description = Dropped items will be attracted to the player like a magnet.
depends = mcl_physics, mcl_enchanting
depends = vl_physics, mcl_enchanting

View File

@ -396,7 +396,7 @@ local function on_step_work (self, dtime)
self:check_suspend(player_in_active_range)
-- Handle environmental physics
mcl_physics.apply_entity_environmental_physics(self)
vl_physics.apply_entity_environmental_physics(self)
if not self._jumping_cliff then
self._can_jump_cliff = self:can_jump_cliff()

View File

@ -2,4 +2,4 @@ name = mcl_mobs
author = PilzAdam
description = Adds a mob API for mods to add animals or monsters, etc.
depends = mcl_particles
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

View File

@ -1,4 +1,4 @@
local mod = mcl_physics
local mod = vl_physics
local registered_environment_effects = {}
@ -35,12 +35,12 @@ local DEFAULT_ENTITY_PHYSICS = {
function mod.apply_entity_environmental_physics(self, data)
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 pos = self.object:get_pos()
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_acceleration then print("new_acceleration="..tostring(new_acceleration)) end

View File

@ -1,7 +1,7 @@
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local mod = {}
mcl_physics = mod
vl_physics = mod
dofile(modpath.."/api.lua")
@ -54,7 +54,7 @@ local DEFAULT_NODE_PHYSICS = {
}
local function apply_node_physics(node, vel, staticdata, entity)
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
if node_physics_effect then

View File

@ -1,4 +1,4 @@
name = mcl_physics
name = vl_physics
author = teknomunk
description = Environmental physics
depends = flowlib

View File

@ -109,7 +109,7 @@ local function xp_step(self, dtime)
end
-- Slide on slippery nodes
mcl_physics.apply_entity_environmental_physics(self)
vl_physics.apply_entity_environmental_physics(self)
end
minetest.register_entity("mcl_experience:orb", {

View File

@ -907,7 +907,7 @@ minetest.register_node("mcl_core:ice", {
_mcl_blast_resistance = 0.5,
_mcl_hardness = 0.5,
_mcl_silk_touch_drop = true,
_mcl_physics = {
_vl_physics = {
friction = 0.4,
},
})
@ -924,7 +924,7 @@ minetest.register_node("mcl_core:packed_ice", {
_mcl_blast_resistance = 0.5,
_mcl_hardness = 0.5,
_mcl_silk_touch_drop = true,
_mcl_physics = {
_vl_physics = {
friction = 0.15,
},
})