mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-08 17:47:30 +01:00
Fix syntax error from rebase, fix cart tilt, change cart speed to 4 blocks/second and make into a setting, make minecart settings compatibily with upcoming dynamic rules PR (#4662)
This commit is contained in:
parent
879175bb97
commit
bf3e9190b3
@ -1,6 +1,8 @@
|
|||||||
local modname = minetest.get_current_modname()
|
local modname = minetest.get_current_modname()
|
||||||
local S = minetest.get_translator(modname)
|
local S = minetest.get_translator(modname)
|
||||||
|
|
||||||
|
local FURNACE_CART_SPEED = {tonumber(minetest.settings:get("mcl_minecarts_furnace_speed") or 4)}
|
||||||
|
|
||||||
-- Minecart with Furnace
|
-- Minecart with Furnace
|
||||||
mcl_minecarts.register_minecart({
|
mcl_minecarts.register_minecart({
|
||||||
itemstring = "mcl_minecarts:furnace_minecart",
|
itemstring = "mcl_minecarts:furnace_minecart",
|
||||||
@ -73,8 +75,10 @@ mcl_minecarts.register_minecart({
|
|||||||
|
|
||||||
-- Update furnace stuff
|
-- Update furnace stuff
|
||||||
if (staticdata.fueltime or 0) > 0 then
|
if (staticdata.fueltime or 0) > 0 then
|
||||||
if staticdata.velocity < 0.25 then
|
for car in mcl_minecarts.train_cars(staticdata) do
|
||||||
staticdata.velocity = 0.25
|
if car.velocity < FURNACE_CART_SPEED[1] - 0.1 then -- Slightly less to allow train cars to maintain spacing
|
||||||
|
car.velocity = FURNACE_CART_SPEED[1]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
staticdata.fueltime = (staticdata.fueltime or dtime) - dtime
|
staticdata.fueltime = (staticdata.fueltime or dtime) - dtime
|
||||||
|
@ -3,9 +3,9 @@ local modpath = minetest.get_modpath(modname)
|
|||||||
local mod = mcl_minecarts
|
local mod = mcl_minecarts
|
||||||
local S = minetest.get_translator(modname)
|
local S = minetest.get_translator(modname)
|
||||||
|
|
||||||
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_minecarts", false)
|
local LOGGING_ON = {minetest.settings:get_bool("mcl_logging_minecarts", false)}
|
||||||
local function mcl_log(message)
|
local function mcl_log(message)
|
||||||
if LOGGING_ON then
|
if LOGGING_ON[1] then
|
||||||
mcl_util.mcl_log(message, "[Minecarts]", true)
|
mcl_util.mcl_log(message, "[Minecarts]", true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -441,7 +441,7 @@ end
|
|||||||
|
|
||||||
local _2_pi = math.pi * 2
|
local _2_pi = math.pi * 2
|
||||||
local _half_pi = math.pi * 0.5
|
local _half_pi = math.pi * 0.5
|
||||||
local _quart_pi = math.pi * 0.5
|
local _quart_pi = math.pi * 0.25
|
||||||
local pi = math.pi
|
local pi = math.pi
|
||||||
local rot_debug = {}
|
local rot_debug = {}
|
||||||
function mod.update_cart_orientation(self)
|
function mod.update_cart_orientation(self)
|
||||||
@ -469,9 +469,9 @@ function mod.update_cart_orientation(self)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Forward/backwards tilt (pitch)
|
-- Forward/backwards tilt (pitch)
|
||||||
if dir.y < 0 then
|
if dir.y > 0 then
|
||||||
rot.x = -_quart_pi
|
rot.x = -_quart_pi
|
||||||
elseif dir.y > 0 then
|
elseif dir.y < 0 then
|
||||||
rot.x = _quart_pi
|
rot.x = _quart_pi
|
||||||
else
|
else
|
||||||
rot.x = 0
|
rot.x = 0
|
||||||
|
@ -61,6 +61,7 @@ tsm_railcorridors.carts = {
|
|||||||
"mcl_minecarts:minecart", "mcl_minecarts:minecart",
|
"mcl_minecarts:minecart", "mcl_minecarts:minecart",
|
||||||
"mcl_minecarts:chest_minecart", "mcl_minecarts:chest_minecart",
|
"mcl_minecarts:chest_minecart", "mcl_minecarts:chest_minecart",
|
||||||
"mcl_minecarts:tnt_minecart"
|
"mcl_minecarts:tnt_minecart"
|
||||||
|
}
|
||||||
local has_loot = {
|
local has_loot = {
|
||||||
["mcl_minecarts:chest_minecart"] = true,
|
["mcl_minecarts:chest_minecart"] = true,
|
||||||
["mcl_minecarts:hopper_minceart"] = true,
|
["mcl_minecarts:hopper_minceart"] = true,
|
||||||
|
Loading…
Reference in New Issue
Block a user