Compare commits

..

39 Commits

Author SHA1 Message Date
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 ee2418f91c Merge pull request 'mapgen mod compatibility' (#409) from FaceDeer/MineClone5:mapgen_mod_compatibility into master
Reviewed-on: MineClone5/MineClone5#409
2022-09-16 18:10:14 +00:00
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 56b915d51d Merge pull request 'Fix Smoker and Blast Furnace Aliases, and potatoes can now be cooked in the smoker.' (#413) from smoker_blast_furnace_fixes into master
Reviewed-on: MineClone5/MineClone5#413
2022-09-07 17:48:09 +00:00
PrairieWind ba47414a95 Fixed Smoker and Blast Furnace Aliases, and potatoes can now be cooked in the smoker. 2022-09-03 10:19:49 -06:00
3raven 52d311119f Merge pull request 'cohésion/fix translation' (#411) from 3raven-patch-2 into master
Reviewed-on: MineClone5/MineClone5#411
2022-08-24 04:36:37 +00:00
3raven 3cee342f1f cohésion/fix translation 2022-08-24 04:35:35 +00:00
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 15ac28d000 Merge pull request 'Beacons from MineClone2' (#395) from chmodsayshello/MineClone5:mcl5_beacons into master
Reviewed-on: MineClone5/MineClone5#395
2022-08-16 17:59:16 +00:00
FaceDeer 7e0cfed1b5 Add a log warning wrapper to calls to register_on_generated, as discussed in MineClone5/MineClone5#399 2022-08-15 11:06:48 -06:00
chmodsayshello 19df0fb5d7 update init.lua 2022-08-13 10:03:06 +00:00
FaceDeer 5cc0288a03 found a typo 2022-08-13 02:22:46 -06:00
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 a50255cb97 Merge pull request 'Make dirt head debugging an option, and disable head_code by default if has_head is not defined.' (#402) from fbievan/MineClone5:fix-heads into master
Reviewed-on: MineClone5/MineClone5#402
2022-08-10 18:15:20 +00:00
Your Name 841789f010 removed soemthing i was messing with lmao 2022-08-09 12:43:46 -05:00
Your Name 7270094619 Moved variable to align with other ones 2022-08-09 12:42:16 -05:00
Your Name 3a77a97e2d moved identetion of debug_head variable 2022-08-09 12:36:22 -05:00
Your Name 384e5ece67 Moved debug_head above function. 2022-08-08 15:50:30 -05:00
Your Name da81f0b5b4 Cache output of function to variable then call it 2022-08-08 10:32:32 -05:00
Your Name 6ac082aff7 add indent 2022-08-08 09:53:31 -05:00
FaceDeer eef5c0dc46 add an override setting for rail tunnel heights 2022-08-07 18:00:26 -06:00
Your Name cdb881ff9a Fixed formatting (I think?) 2022-08-07 17:36:12 -05:00
Your Name cce8dcce97 remove newline 2022-08-07 10:45:51 -05:00
Your Name 71f0d9364a Fix formatting 2022-08-07 10:44:21 -05:00
Your Name 2b39a1b9bf Make debugging head dirt an option 2022-08-07 10:25:46 -05:00
Your Name e6cb2c48b7 make has_head actaully do something, and if not has_head is not defined disable head code for mob 2022-08-07 10:04:28 -05:00
FaceDeer ae60960a00 add callbacks mapgen mods can use to alter locally-saved copies of settings, reveal register_on_generated 2022-08-06 20:27:44 -06:00
chmodsayshello d4da512309 mcl_beacons: textures 2/2 2022-08-02 14:01:18 +00:00
chmodsayshello 3a36593612 mcl_beacons: textures 1/2 2022-08-02 14:00:55 +00:00
chmodsayshello a506ae9fff mcl_beacons: german translation 2022-08-02 13:58:08 +00:00
chmodsayshello 82cd2be6b7 mcl_beacons: add translation template 2022-08-02 13:57:01 +00:00
chmodsayshello 368f891746 mcl_beacons: mod.conf 2022-08-02 13:56:01 +00:00
chmodsayshello c53055c472 mcl_beacons: init.lua 2022-08-02 13:55:25 +00:00
chmodsayshello 5507303deb mcl_achievements: update german translation 2022-08-02 13:53:58 +00:00
chmodsayshello e98be27138 mcl_achievements: update translation template 2022-08-02 13:53:21 +00:00
chmodsayshello e308240fb6 register beacon achievements 2022-08-02 13:52:30 +00:00
chmodsayshello 82423cfb33 Merge pull request 'Update Fork' (#9) from MineClone5/MineClone5:master into master
Reviewed-on: chmodsayshello/MineClone5#9
2022-08-02 13:50:36 +00:00
kay27 4ade7dc769 Merge pull request 'Make baby sheep have big heads' (#392) from MrRar/MineClone5:sheep into master
Reviewed-on: MineClone5/MineClone5#392
2022-08-02 11:57:49 +00:00
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 6bbf3bc80c Make baby sheep have big heads 2022-08-01 12:54:48 -05:00
kay27 85ca6e867a Merge pull request 'Add nether biomes' (#389) from nether_biomes into master
Reviewed-on: MineClone5/MineClone5#389
2022-07-28 18:12:45 +00:00
cora 70daeda500 Add nether biomes 2022-07-28 17:22:05 +02:00
kay27 6c2bdf3156 Merge 1.11 leftovers from testing branch 2022-07-24 06:27:52 +03:00
chmodsayshello 25ff05635a Merge pull request 'Update Fork' (#8) from MineClone5/MineClone5:master into master
Reviewed-on: chmodsayshello/MineClone5#8
2022-03-29 15:39:19 +00:00
77 changed files with 1182 additions and 832 deletions

View File

@ -1,125 +0,0 @@
mcl_compatibility = mcl_compatibility or {}
mcl_vars = mcl_vars or {}
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local math = math
local math_ceil = math.ceil
local math_floor = math.floor
local math_abs = math.abs
local minetest_get_node = minetest.get_node
if not bit then
bit = {}
function bit.bxor(a, b)
-- fake! mock! speedify for now! TODO: make proper xor bitwise
return math_ceil(math_abs(math_floor(a/0.14) * b * 1.001 + b))
end
end
function math.round(x)
if x >= 0 then
return math_floor(x + 0.5)
end
return math_ceil(x - 0.5)
end
dofile(modpath .. "/vector.lua")
mcl_compatibility.sort_nodes = function(nodes)
local nodes = nodes
if not nodes then return {} end
for _, pos in pairs(nodes) do
if not pos.x or not pos.y or not pos.z then
return nodes
end
end
local new_nodes = {}
for _, pos in pairs(nodes) do
local node = minetest_get_node(pos)
local name = node.name
local ref = new_nodes[name]
if not ref then
new_nodes[name] = { pos }
else
ref[#ref + 1] = pos
end
end
return new_nodes
end
local sort_nodes = mcl_compatibility.sort_nodes
local minetest_find_nodes_in_area = minetest.find_nodes_in_area
minetest.find_nodes_in_area = function(pos1, pos2, nodenames, grouped)
if not grouped then
return minetest_find_nodes_in_area(pos1, pos2, nodenames)
end
local nodes, num = minetest_find_nodes_in_area(pos1, pos2, nodenames, grouped)
if not nodes or next(nodes) == nil then
return nodes, num
end
return sort_nodes(nodes)
end
function mcl_vars.pos_to_block(pos)
return mcl_mapgen and mcl_mapgen.pos_to_block(pos)
end
function mcl_vars.pos_to_chunk(pos)
return mcl_mapgen and mcl_mapgen.pos_to_chunk(pos)
end
function mcl_vars.get_chunk_number(pos)
return mcl_mapgen and get_chunk_number(pos)
end
function mcl_vars.is_generated(pos)
local node = minetest_get_node(pos)
if not node then return false end
if node.name == "ignore" then return false end
return true
end
function mcl_vars.get_node(p, force, us_timeout)
if not p or not p.x or not p.y or not p.z then return {name="error"} end
local node = minetest_get_node(p)
if node.name ~= "ignore" then return node end
minetest.get_voxel_manip():read_from_map(p, p)
return minetest_get_node(pos)
end
mcl_vars.mg_overworld_min = -62
mcl_vars.mg_overworld_max_official = 198
mcl_vars.mg_bedrock_overworld_min = -62
mcl_vars.mg_bedrock_overworld_max = -58
mcl_vars.mg_lava_overworld_max = -52
mcl_vars.mg_lava = true
mcl_vars.mg_bedrock_is_rough = true
mcl_vars.mg_overworld_max = 30927
mcl_vars.mg_nether_min = -29067
mcl_vars.mg_nether_max = -28939
mcl_vars.mg_bedrock_nether_bottom_min = -29067
mcl_vars.mg_bedrock_nether_top_max = -29063
mcl_vars.mg_end_min = -27073
mcl_vars.mg_end_max_official = -26817
mcl_vars.mg_end_max = -2062
mcl_vars.mg_end_platform_pos = { x = 100, y = -26999, z = 0 }
mcl_vars.mg_realm_barrier_overworld_end_max = -2062
mcl_vars.mg_realm_barrier_overworld_end_min = -2073
mcl_vars.mg_dungeons = true
if not minetest.register_on_authplayer then
minetest.register_on_authplayer = function(callback_function)
minetest.register_on_prejoinplayer(function(name, ip)
callback_function(name, ip, true)
end)
end
end
if not minetest.colorspec_to_colorstring then
minetest.colorspec_to_colorstring = function(colorspec)
return '#334455'
end
end

View File

@ -1,3 +0,0 @@
name = mcl_compatibility
author = kay27, minetest devs
description = Makes MineClone 5 run in old versions of Minetest and be compatible with mods using old MineClone APIs

View File

@ -1,362 +0,0 @@
--[[
Vector helpers
Note: The vector.*-functions must be able to accept old vectors that had no metatables
]]
-- localize functions
local setmetatable = setmetatable
vector = {}
local metatable = {}
vector.metatable = metatable
local xyz = {"x", "y", "z"}
-- only called when rawget(v, key) returns nil
function metatable.__index(v, key)
return rawget(v, xyz[key]) or vector[key]
end
-- only called when rawget(v, key) returns nil
function metatable.__newindex(v, key, value)
rawset(v, xyz[key] or key, value)
end
-- constructors
local function fast_new(x, y, z)
return setmetatable({x = x, y = y, z = z}, metatable)
end
function vector.new(a, b, c)
if a and b and c then
return fast_new(a, b, c)
end
-- deprecated, use vector.copy and vector.zero directly
if type(a) == "table" then
return vector.copy(a)
else
assert(not a, "Invalid arguments for vector.new()")
return vector.zero()
end
end
function vector.zero()
return fast_new(0, 0, 0)
end
function vector.copy(v)
assert(v.x and v.y and v.z, "Invalid vector passed to vector.copy()")
return fast_new(v.x, v.y, v.z)
end
function vector.from_string(s, init)
local x, y, z, np = string.match(s, "^%s*%(%s*([^%s,]+)%s*[,%s]%s*([^%s,]+)%s*[,%s]" ..
"%s*([^%s,]+)%s*[,%s]?%s*%)()", init)
x = tonumber(x)
y = tonumber(y)
z = tonumber(z)
if not (x and y and z) then
return nil
end
return fast_new(x, y, z), np
end
function vector.to_string(v)
return string.format("(%g, %g, %g)", v.x, v.y, v.z)
end
metatable.__tostring = vector.to_string
function vector.equals(a, b)
return a.x == b.x and
a.y == b.y and
a.z == b.z
end
metatable.__eq = vector.equals
-- unary operations
function vector.length(v)
return math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z)
end
-- Note: we can not use __len because it is already used for primitive table length
function vector.normalize(v)
local len = vector.length(v)
if len == 0 then
return fast_new(0, 0, 0)
else
return vector.divide(v, len)
end
end
function vector.floor(v)
return vector.apply(v, math.floor)
end
function vector.round(v)
return fast_new(
math.round(v.x),
math.round(v.y),
math.round(v.z)
)
end
function vector.apply(v, func)
return fast_new(
func(v.x),
func(v.y),
func(v.z)
)
end
function vector.distance(a, b)
local x = a.x - b.x
local y = a.y - b.y
local z = a.z - b.z
return math.sqrt(x * x + y * y + z * z)
end
function vector.direction(pos1, pos2)
return vector.subtract(pos2, pos1):normalize()
end
function vector.angle(a, b)
local dotp = vector.dot(a, b)
local cp = vector.cross(a, b)
local crossplen = vector.length(cp)
return math.atan2(crossplen, dotp)
end
function vector.dot(a, b)
return a.x * b.x + a.y * b.y + a.z * b.z
end
function vector.cross(a, b)
return fast_new(
a.y * b.z - a.z * b.y,
a.z * b.x - a.x * b.z,
a.x * b.y - a.y * b.x
)
end
function metatable.__unm(v)
return fast_new(-v.x, -v.y, -v.z)
end
-- add, sub, mul, div operations
function vector.add(a, b)
if type(b) == "table" then
return fast_new(
a.x + b.x,
a.y + b.y,
a.z + b.z
)
else
return fast_new(
a.x + b,
a.y + b,
a.z + b
)
end
end
function metatable.__add(a, b)
return fast_new(
a.x + b.x,
a.y + b.y,
a.z + b.z
)
end
function vector.subtract(a, b)
if type(b) == "table" then
return fast_new(
a.x - b.x,
a.y - b.y,
a.z - b.z
)
else
return fast_new(
a.x - b,
a.y - b,
a.z - b
)
end
end
function metatable.__sub(a, b)
return fast_new(
a.x - b.x,
a.y - b.y,
a.z - b.z
)
end
function vector.multiply(a, b)
if type(b) == "table" then
return fast_new(
a.x * b.x,
a.y * b.y,
a.z * b.z
)
else
return fast_new(
a.x * b,
a.y * b,
a.z * b
)
end
end
function metatable.__mul(a, b)
if type(a) == "table" then
return fast_new(
a.x * b,
a.y * b,
a.z * b
)
else
return fast_new(
a * b.x,
a * b.y,
a * b.z
)
end
end
function vector.divide(a, b)
if type(b) == "table" then
return fast_new(
a.x / b.x,
a.y / b.y,
a.z / b.z
)
else
return fast_new(
a.x / b,
a.y / b,
a.z / b
)
end
end
function metatable.__div(a, b)
-- scalar/vector makes no sense
return fast_new(
a.x / b,
a.y / b,
a.z / b
)
end
-- misc stuff
function vector.offset(v, x, y, z)
return fast_new(
v.x + x,
v.y + y,
v.z + z
)
end
function vector.sort(a, b)
return fast_new(math.min(a.x, b.x), math.min(a.y, b.y), math.min(a.z, b.z)),
fast_new(math.max(a.x, b.x), math.max(a.y, b.y), math.max(a.z, b.z))
end
function vector.check(v)
return getmetatable(v) == metatable
end
local function sin(x)
if x % math.pi == 0 then
return 0
else
return math.sin(x)
end
end
local function cos(x)
if x % math.pi == math.pi / 2 then
return 0
else
return math.cos(x)
end
end
function vector.rotate_around_axis(v, axis, angle)
local cosangle = cos(angle)
local sinangle = sin(angle)
axis = vector.normalize(axis)
-- https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
local dot_axis = vector.multiply(axis, vector.dot(axis, v))
local cross = vector.cross(v, axis)
return vector.new(
cross.x * sinangle + (v.x - dot_axis.x) * cosangle + dot_axis.x,
cross.y * sinangle + (v.y - dot_axis.y) * cosangle + dot_axis.y,
cross.z * sinangle + (v.z - dot_axis.z) * cosangle + dot_axis.z
)
end
function vector.rotate(v, rot)
local sinpitch = sin(-rot.x)
local sinyaw = sin(-rot.y)
local sinroll = sin(-rot.z)
local cospitch = cos(rot.x)
local cosyaw = cos(rot.y)
local cosroll = math.cos(rot.z)
-- Rotation matrix that applies yaw, pitch and roll
local matrix = {
{
sinyaw * sinpitch * sinroll + cosyaw * cosroll,
sinyaw * sinpitch * cosroll - cosyaw * sinroll,
sinyaw * cospitch,
},
{
cospitch * sinroll,
cospitch * cosroll,
-sinpitch,
},
{
cosyaw * sinpitch * sinroll - sinyaw * cosroll,
cosyaw * sinpitch * cosroll + sinyaw * sinroll,
cosyaw * cospitch,
},
}
-- Compute matrix multiplication: `matrix` * `v`
return vector.new(
matrix[1][1] * v.x + matrix[1][2] * v.y + matrix[1][3] * v.z,
matrix[2][1] * v.x + matrix[2][2] * v.y + matrix[2][3] * v.z,
matrix[3][1] * v.x + matrix[3][2] * v.y + matrix[3][3] * v.z
)
end
function vector.dir_to_rotation(forward, up)
forward = vector.normalize(forward)
local rot = vector.new(math.asin(forward.y), -math.atan2(forward.x, forward.z), 0)
if not up then
return rot
end
assert(vector.dot(forward, up) < 0.000001,
"Invalid vectors passed to vector.dir_to_rotation().")
up = vector.normalize(up)
-- Calculate vector pointing up with roll = 0, just based on forward vector.
local forwup = vector.rotate(vector.new(0, 1, 0), rot)
-- 'forwup' and 'up' are now in a plane with 'forward' as normal.
-- The angle between them is the absolute of the roll value we're looking for.
rot.z = vector.angle(forwup, up)
-- Since vector.angle never returns a negative value or a value greater
-- than math.pi, rot.z has to be inverted sometimes.
-- To determine wether this is the case, we rotate the up vector back around
-- the forward vector and check if it worked out.
local back = vector.rotate_around_axis(up, forward, -rot.z)
-- We don't use vector.equals for this because of floating point imprecision.
if (back.x - forwup.x) * (back.x - forwup.x) +
(back.y - forwup.y) * (back.y - forwup.y) +
(back.z - forwup.z) * (back.z - forwup.z) > 0.0000001 then
rot.z = -rot.z
end
return rot
end

View File

@ -1 +0,0 @@
-- moved to mcl_compatibility

View File

@ -1,5 +1,5 @@
-- Some global variables (don't overwrite them!)
mcl_vars = mcl_vars or {}
mcl_vars = {}
mcl_vars.redstone_tick = 0.1

View File

@ -1,4 +1,3 @@
name = mcl_init
depends = mcl_compatibility
author = Wuzzy
description = Initialization mod of MineClone 2. Defines some common shared variables and sets up initial default settings which have to be set at the beginning.

View File

@ -394,7 +394,17 @@ minetest.register_on_generated(function(minp, maxp, chunkseed)
end
end)
minetest.register_on_generated = mcl_mapgen.register_chunk_generator
local register_on_generated_old = minetest.register_on_generated
minetest.register_on_generated = function(...)
minetest.log("warning", "minetest.register_on_generated() is being called by the mod '"
.. minetest.get_current_modname() .. "'. MineClone5's map generation system avoids using "
.. "this callback to work around engine map generation issues. If possible please read "
.. "mods/CORE/mcl_mapgen/API.md and update " .. minetest.get_current_modname()
.. " to use the method described from there. MineClone5 makes no promises that "
.. "mapgen mods will be fully compatible with it, please test your server and use at "
.. "your own risk.")
return register_on_generated_old(...)
end
function mcl_mapgen.get_far_node(p)
local p = p
@ -440,6 +450,21 @@ function mcl_mapgen.get_chunk_number(pos) -- unsigned int
c.x + k_positive
end
-- Components of this game should register functions here to update their internal
-- state when external mods modify mapgen settings that they care about.
local settings_changed_callbacks = {}
function mcl_mapgen.register_on_settings_changed(callback)
table.insert(settings_changed_callbacks, callback)
end
-- this is to be called by external mods after modifying these settings
-- to notify Mineclone that it needs to update local copies and whatever's based on them.
function mcl_mapgen.on_settings_changed()
for _, callback in pairs(settings_changed_callbacks) do
callback()
end
end
mcl_mapgen.minecraft_height_limit = 256
mcl_mapgen.bedrock_is_rough = normal

View File

@ -148,7 +148,6 @@ function mcl_time.get_irl_seconds_passed_at_pos_or_nil(pos)
if last_time <= 0 then return end
local delta_time = seconds_irl_public - last_time
if delta_time <= 0 then return end
meta:set_int(meta_name, seconds_irl_public)
return delta_time
end

View File

@ -2,11 +2,18 @@ mcl_worlds = {}
local get_connected_players = minetest.get_connected_players
local min1, min2, min3
local max1, max2, max3
local get_local_settings = function()
min1, min2, min3 = mcl_mapgen.overworld.min, mcl_mapgen.end_.min, mcl_mapgen.nether.min
max1, max2, max3 = mcl_mapgen.overworld.max, mcl_mapgen.end_.max, mcl_mapgen.nether.max+128
end
get_local_settings()
mcl_mapgen.register_on_settings_changed(get_local_settings)
-- For a given position, returns a 2-tuple:
-- 1st return value: true if pos is in void
-- 2nd return value: true if it is in the deadly part of the void
local min1, min2, min3 = mcl_mapgen.overworld.min, mcl_mapgen.end_.min, mcl_mapgen.nether.min
local max1, max2, max3 = mcl_mapgen.overworld.max, mcl_mapgen.end_.max, mcl_mapgen.nether.max+128
function mcl_worlds.is_in_void(pos)
local y = pos.y
local void = not ((y < max1 and y > min1) or (y < max2 and y > min2) or (y < max3 and y > min3))

View File

@ -11,7 +11,6 @@ function mcl_burning.is_affected_by_rain(obj)
end
function mcl_burning.get_collisionbox(obj, smaller, storage)
if not storage then return end
local cache = storage.collisionbox_cache
if cache then
local box = cache[smaller and 2 or 1]
@ -30,7 +29,6 @@ end
function mcl_burning.get_touching_nodes(obj, nodenames, storage)
local pos = obj:get_pos()
local minp, maxp = mcl_burning.get_collisionbox(obj, true, storage)
if not minp or not maxp then return {} end
local nodes = minetest.find_nodes_in_area(vector.add(pos, minp), vector.add(pos, maxp), nodenames)
return nodes
end

View File

@ -115,9 +115,7 @@ minetest.register_globalstep(function(dtime)
local pos = player:get_pos()
local pool_name = pool[name]
if tick == true and pool_name and pool_name > 0 then
if tick == true and pool[name] > 0 then
minetest.sound_play("item_drop_pickup", {
pos = pos,
gain = 0.7,

View File

@ -417,7 +417,7 @@ function mobs:register_mob(name, def)
--on_breed = def.on_breed,
--on_grown = def.on_grown,
on_grown = def.on_grown,
--on_detach_child = mob_detach_child,

View File

@ -185,15 +185,9 @@ mobs.punch_attack = function(self)
dir = vector_multiply(dir,3)
local attacking = self.attacking
if attacking then
local attacking_velocity = attacking:get_velocity() or attacking:get_player_velocity()
if attacking_velocity then
if attacking_velocity.y <= 1 then
dir.y = 5
end
end
end
if self.attacking:get_velocity().y <= 1 then
dir.y = 5
end
self.attacking:add_velocity(dir)
end

View File

@ -146,11 +146,12 @@ end
--make the baby grow up
mobs.baby_grow_up = function(self)
self.baby = nil
self.visual_size = self.backup_visual_size
self.collisionbox = self.backup_collisionbox
self.selectionbox = self.backup_selectionbox
self.object:set_properties(self)
self.baby = nil
self.visual_size = self.backup_visual_size
self.collisionbox = self.backup_collisionbox
self.selectionbox = self.backup_selectionbox
self.object:set_properties(self)
if self.on_grown then self.on_grown(self) end
end
--makes the baby grow up faster with diminishing returns

View File

@ -99,8 +99,7 @@ mobs.death_logic = function(self, dtime)
self.death_animation_timer = self.death_animation_timer + dtime
--get all attached entities and sort through them
-- TODO: support 5.1.1
local attached_entities = self.object.get_children and self.object:get_children() or {}
local attached_entities = self.object:get_children()
if #attached_entities > 0 then
for _,entity in pairs(attached_entities) do
--kick the player off

View File

@ -1,5 +1,6 @@
local math = math
local vector = vector
local debug_head = minetest.settings:get_bool("mcl_debug_head_code", false)
--converts yaw to degrees
local degrees = function(yaw)
@ -7,7 +8,7 @@ local degrees = function(yaw)
end
mobs.do_head_logic = function(self, dtime, player)
if not self.has_head == true then return end
local player = player or minetest.get_player_by_name("singleplayer")
local look_at = player:get_pos()
@ -25,15 +26,16 @@ mobs.do_head_logic = function(self, dtime, player)
pos = vector.add(pos, head_offset)
minetest.add_particle({
pos = pos,
velocity = {x=0, y=0, z=0},
acceleration = {x=0, y=0, z=0},
expirationtime = 0.2,
size = 1,
texture = "default_dirt.png",
})
if debug_head then
minetest.add_particle({
pos = pos,
velocity = {x=0, y=0, z=0},
acceleration = {x=0, y=0, z=0},
expirationtime = 0.2,
size = 1,
texture = "default_dirt.png",
})
end
local bone_pos = vector.new(0,0,0)
--(horizontal)
@ -106,4 +108,4 @@ mobs.do_head_logic = function(self, dtime, player)
end
end
--set_bone_position([bone, position, rotation])
end
end

View File

@ -185,8 +185,7 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
--if player is falling multiply damage by 1.5
--critical hit
local hitter_velocity = hitter:get_velocity() or hitter:get_player_velocity() or vector.new(0, 0, 0)
if hitter_velocity.y < 0 then
if hitter:get_velocity().y < 0 then
damage = damage * 1.5
mobs.critical_effect(self)
end
@ -208,9 +207,7 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
self.pause_timer = 0.4
--don't do knockback from a rider
local object_children = self.object.get_children and self.object:get_children()
-- TODO: support 5.1.1
for _,obj in pairs(object_children or {}) do
for _,obj in pairs(self.object:get_children()) do
if obj == hitter then
return
end

Binary file not shown.

View File

@ -82,16 +82,16 @@ mobs:register_mob("mobs_mc:sheep", {
--head code
has_head = true,
head_bone = {"hea1", "hea2",},
head_bone = "head",
swap_y_with_x = false,
reverse_head_yaw = false,
head_bone_pos_y = 3.6,
head_bone_pos_z = -0.6,
head_bone_pos_y = 0,
head_bone_pos_z = 0,
head_height_offset = 1.0525,
head_direction_offset = 0.5,
head_height_offset = 1.2,
head_direction_offset = 0,
head_pitch_modifier = 0,
--end head code
@ -117,7 +117,7 @@ mobs:register_mob("mobs_mc:sheep", {
},
animation = {
speed_normal = 25, run_speed = 65,
stand_start = 40, stand_end = 80,
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 40,
run_start = 0, run_end = 40,
},
@ -330,6 +330,24 @@ mobs:register_mob("mobs_mc:sheep", {
return false
end
end,
on_spawn = function(self)
if self.baby then
self.animation = table.copy(self.animation)
self.animation.stand_start = 81
self.animation.stand_end = 81
self.animation.walk_start = 81
self.animation.walk_end = 121
self.animation.run_start = 81
self.animation.run_end = 121
end
return true
end,
on_grown = function(self)
self.animation = nil
local anim = self.current_animation
self.current_animation = nil -- Mobs Redo does nothing otherwise
mobs.set_mob_animation(self, anim)
end
})
mobs:spawn_specific(
"mobs_mc:sheep",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -229,19 +229,23 @@ mobs_mc.override.spawn = {
}
-- This table contains important spawn height references for the mob spawn height.
mobs_mc.override.spawn_height = {
water = tonumber(minetest.settings:get("water_level")) or 0, -- Water level in the Overworld
-- Overworld boundaries (inclusive)
overworld_min = mcl_mapgen.overworld.min,
overworld_max = mcl_mapgen.overworld.max,
-- Nether boundaries (inclusive)
nether_min = mcl_mapgen.nether.min,
nether_max = mcl_mapgen.nether.max,
-- End boundaries (inclusive)
end_min = mcl_mapgen.end_.min,
end_max = mcl_mapgen.end_.max,
}
local get_local_settings = function()
mobs_mc.override.spawn_height = {
water = tonumber(minetest.settings:get("water_level")) or 0, -- Water level in the Overworld
-- Overworld boundaries (inclusive)
overworld_min = mcl_mapgen.overworld.min,
overworld_max = mcl_mapgen.overworld.max,
-- Nether boundaries (inclusive)
nether_min = mcl_mapgen.nether.min,
nether_max = mcl_mapgen.nether.max,
-- End boundaries (inclusive)
end_min = mcl_mapgen.end_.min,
end_max = mcl_mapgen.end_.max,
}
end
get_local_settings()
mcl_mapgen.register_on_settings_changed(get_local_settings)

View File

@ -53,18 +53,10 @@ minetest.register_globalstep(function(dtime)
local moon_arg = {texture = get_moon_texture()}
local players = minetest.get_connected_players()
for p=1, #players do
if players[p].set_moon then
players[p]:set_moon(moon_arg)
else
-- TODO: use old sky api
end
players[p]:set_moon(moon_arg)
end
end)
minetest.register_on_joinplayer(function(player)
if player.set_moon then
player:set_moon({texture = get_moon_texture(), scale=3.75})
else
-- TODO: use old sky api
end
player:set_moon({texture = get_moon_texture(), scale=3.75})
end)

View File

@ -1,46 +1,6 @@
local mods_loaded = false
local NIGHT_VISION_RATIO = 0.45
local function set_sky(player, def)
if player.set_sun then
-- new api
player:set_sky(def)
else
-- TODO
-- old api
end
end
local function set_sun(player, def)
if player.set_sun then
-- new api
player:set_sun(def)
else
-- TODO
-- old api
end
end
local function set_moon(player, def)
if player.set_sun then
-- new api
player:set_moon(def)
else
-- TODO
-- old api
end
end
local function set_stars(player, def)
if player.set_sun then
-- new api
player:set_stars(def)
else
-- TODO
-- old api
end
end
mcl_weather.skycolor = {
-- Should be activated before do any effect.
active = true,
@ -123,7 +83,7 @@ mcl_weather.skycolor = {
if dim == "overworld" then
if (mcl_weather.state == "none") then
-- Clear weather
set_sky(player, {
player:set_sky({
type = "regular",
sky_color = {
day_sky = "#92B9FF",
@ -135,17 +95,16 @@ mcl_weather.skycolor = {
},
clouds = true,
})
set_sun(player, {visible = true, sunrise_visible = true})
set_moon(player, {visible = true})
set_stars(player, {visible = true})
player:set_sun({visible = true, sunrise_visible = true})
player:set_moon({visible = true})
player:set_stars({visible = true})
mcl_weather.skycolor.override_day_night_ratio(player, nil)
else
-- Weather skies
local day_color = mcl_weather.skycolor.get_sky_layer_color(0.5)
local dawn_color = mcl_weather.skycolor.get_sky_layer_color(0.75)
local night_color = mcl_weather.skycolor.get_sky_layer_color(0)
set_sky(player, {
type = "regular",
player:set_sky({ type = "regular",
sky_color = {
day_sky = day_color,
day_horizon = day_color,
@ -156,9 +115,9 @@ mcl_weather.skycolor = {
},
clouds = true,
})
set_sun(player, {visible = false, sunrise_visible = false})
set_moon(player, {visible = false})
set_stars(player, {visible = false})
player:set_sun({visible = false, sunrise_visible = false})
player:set_moon({visible = false})
player:set_stars({visible = false})
local lf = mcl_weather.get_current_light_factor()
if mcl_weather.skycolor.current_layer_name() == "lightning" then
@ -177,35 +136,32 @@ mcl_weather.skycolor = {
end
elseif dim == "end" then
local t = "mcl_playerplus_end_sky.png"
set_sky(player, {
type = "skybox",
player:set_sky({ type = "skybox",
base_color = "#000000",
textures = {t,t,t,t,t,t},
clouds = false,
})
set_sun(player, {visible = false , sunrise_visible = false})
set_moon(player, {visible = false})
set_stars(player, {visible = false})
player:set_sun({visible = false , sunrise_visible = false})
player:set_moon({visible = false})
player:set_stars({visible = false})
mcl_weather.skycolor.override_day_night_ratio(player, 0.5)
elseif dim == "nether" then
set_sky(player, {
type = "plain",
player:set_sky({ type = "plain",
base_color = "#300808",
clouds = false,
})
set_sun(player, {visible = false , sunrise_visible = false})
set_moon(player, {visible = false})
set_stars(player, {visible = false})
player:set_sun({visible = false , sunrise_visible = false})
player:set_moon({visible = false})
player:set_stars({visible = false})
mcl_weather.skycolor.override_day_night_ratio(player, nil)
elseif dim == "void" then
set_sky(player, {
type = "plain",
player:set_sky({ type = "plain",
base_color = "#000000",
clouds = false,
})
set_sun(player, {visible = false, sunrise_visible = false})
set_moon(player, {visible = false})
set_stars(player, {visible = false})
player:set_sun({visible = false, sunrise_visible = false})
player:set_moon({visible = false})
player:set_stars({visible = false})
end
end
end,

View File

@ -1,4 +1,4 @@
name = doc
author = Wuzzy
description = A simple in-game documentation system which enables mods to add help entries based on templates.
optional_depends = unified_inventory, sfinv_buttons, central_message, inventory_plus, mcl_compatibility
optional_depends = unified_inventory, sfinv_buttons, central_message, inventory_plus

View File

@ -1080,10 +1080,10 @@ if progressive_mode then
if not awaiting_connection_player_names[name] then
local data = player_data[name]
local inv_items = get_inv_items(player)
local diff = table_diff(inv_items, data.inv_items or {})
local diff = table_diff(inv_items, data.inv_items)
if #diff > 0 then
data.inv_items = table_merge(diff, data.inv_items or {})
data.inv_items = table_merge(diff, data.inv_items)
end
end
end

View File

@ -234,6 +234,20 @@ awards.register_achievement("mcl:fishyBusiness", {
icon = "mcl_fishing_fishing_rod.png",
})
--Triggered in mcl_beacons
awards.register_achievement("mcl:beacon", {
title = S("Bring Home the Beacon"),
description = S("Use a beacon."),
icon = "beacon_achievement_icon.png",
})
awards.register_achievement("mcl:maxed_beacon", {
title = S("Beaconator"),
description = S("Use a fully powered beacon."),
icon = "beacon_achievement_icon.png",
})
-- Armor Advancements
--[[awards.register_achievement("mcl:suitUp", {
title = S("Suit Up"),

View File

@ -47,3 +47,7 @@ Use a crafting table to craft a wooden hoe from wooden planks and sticks.=Benutz
Use a crafting table to craft a wooden pickaxe from wooden planks and sticks.=Benutzen Sie eine Werkbank, um eine Holzspitzhacke aus Holzplanken und Stöcken zu fertigen.
Use obsidian and a fire starter to construct a Nether portal.=Benutzen Sie Obsidian und ein Feuerzeug, um ein Netherportal zu errichten.
Use wheat to craft a bread.=Benutzen Sie Weizen, um ein Brot zu machen.
Bring Home the Beacon=Den Nachbarn heimleuchten
Use a beacon.=Benutzen Sie ein Leuchtfeuer.
Beaconator=Leuchtturmwärter
Use a fully powered beacon.=Benutzen Sie ein vollständiges Leuchtfeuer.

View File

@ -75,3 +75,7 @@ What A Deal!=
Successfully trade with a Villager.=
Tactical Fishing=
Catch a fish... without a fishing rod=
Bring Home the Beacon=
Use a beacon.=
Beaconator=
Use a fully powered beacon.=

View File

@ -124,12 +124,12 @@ minetest.register_globalstep(function(dtime)
local name = player:get_player_name()
local bars = mcl_bossbars.bars[name]
local huds = mcl_bossbars.huds[name]
table.sort(bars or {}, function(a, b) return a.priority < b.priority end)
table.sort(bars, function(a, b) return a.priority < b.priority end)
local huds_new = {}
local bars_new = {}
local i = 0
while huds and bars and (#huds > 0 or #bars > 0) do
while #huds > 0 or #bars > 0 do
local bar = table.remove(bars, 1)
local hud = table.remove(huds, 1)

View File

@ -12,9 +12,17 @@ local floor = math.floor
local minetest_get_gametime = minetest.get_gametime
local get_voxel_manip = minetest.get_voxel_manip
local min1, min2, min3 = mcl_mapgen.overworld.min, mcl_mapgen.end_.min, mcl_mapgen.nether.min
local max1, max2, max3 = mcl_mapgen.overworld.max, mcl_mapgen.end_.max, mcl_mapgen.nether.max + 128
local CS = mcl_mapgen.CS_NODES
local min1, min2, min3
local max1, max2, max3
local CS
local get_local_settings = function()
min1, min2, min3 = mcl_mapgen.overworld.min, mcl_mapgen.end_.min, mcl_mapgen.nether.min
max1, max2, max3 = mcl_mapgen.overworld.max, mcl_mapgen.end_.max, mcl_mapgen.nether.max+128
CS = mcl_mapgen.CS_NODES
end
get_local_settings()
mcl_mapgen.register_on_settings_changed(get_local_settings)
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)

View File

@ -34,7 +34,7 @@ minetest.register_on_mods_loaded(function()
for name,def in pairs(minetest.registered_items) do
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then
local function is_redstone(def)
return def.mesecons or def.groups.mesecon or def.groups.mesecon_conductor_craftable or def.groups.mesecon_effecor_off
return def.mesecons or def.groups.mesecon or def.groups.mesecon_conductor_craftable or def.groups.mesecon_effector_off
end
local function is_tool(def)
return def.groups.tool or (def.tool_capabilities and def.tool_capabilities.damage_groups == nil)

View File

@ -0,0 +1,402 @@
local S = minetest.get_translator(minetest.get_current_modname())
--[[
there are strings in meta, which are being used to see which effect will be given to the player(s)
Valid strings:
swiftness
leaping
strenght
regeneration
]]--
mcl_beacons = {
blocks ={"mcl_core:diamondblock","mcl_core:ironblock","mcl_core:goldblock","mcl_core:emeraldblock","mcl_nether:netheriteblock"},
fuel = {"mcl_core:diamond","mcl_core:emerald","mcl_core:iron_ingot","mcl_core:gold_ingot","mcl_nether:netherite_ingot"}
}
local beacon_blocklist = mcl_beacons.blocks
local beacon_fuellist = mcl_beacons.fuel
local pallete_order = {
glass_cyan = 1,
pane_cyan_flat = 1,
pane_cyan = 1,
glass_white = 2,
pane_white_flat = 2,
pane_white = 2,
glass_brown = 3,
pane_brown_flat = 3,
pane_brown = 3,
glass_blue = 4,
pane_blue_flat = 4,
pane_blue = 4,
glass_light_blue = 5,
pane_light_blue_flat = 5,
pane_light_blue = 5,
glass_pink = 6,
pane_pink_flat = 6,
pane_pink = 6,
glass_purple = 7,
pane_purple_flat = 7,
pane_purple = 7,
glass_red = 8,
pane_red_flat = 8,
pane_red = 8,
glass_silver = 9,
pane_silver_flat = 9,
pane_silver = 9,
glass_gray = 10,
pane_gray_flat = 10,
pane_gray = 10,
glass_lime = 11,
pane_lime_flat = 11,
pane_lime = 11,
glass_green = 12,
pane_green_flat = 12,
pane_green = 12,
glass_orange = 13,
pane_orange_flat = 13,
pane_orange = 13,
glass_yellow = 14,
pane_yellow_flat = 14,
pane_yellow = 14,
glass_black = 15,
pane_black_flat = 15,
pane_black = 15,
glass_magenta = 16,
pane_magenta_flat = 16,
pane_magenta = 16
}
local function get_beacon_beam(glass_nodename)
if glass_nodename == "air" then return 0 end
local glass_string = glass_nodename:split(':')[2]
if not pallete_order[glass_string] then return 0 end
return pallete_order[glass_string]
end
minetest.register_node("mcl_beacons:beacon_beam", {
tiles = {"^[colorize:#b8bab9"},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.1250, -0.5000, -0.1250, 0.1250, 0.5000, 0.1250}
}
},
pointable= false,
light_source = 14,
walkable = false,
groups = {not_in_creative_inventory=1},
_mcl_blast_resistance = 1200,
paramtype2 = "color",
palette = "beacon_beam_palette.png",
palette_index = 0,
buildable_to = true,
})
mesecon.register_mvps_stopper("mcl_beacons:beacon_beam")
local formspec_string=
"size[11,14]"..
"label[4.5,0.5;"..minetest.formspec_escape(S("Beacon:")).."]"..
"label[0.5,1;"..minetest.formspec_escape(S("Primary Power:")).."]"..
"label[0.5,8.25;"..minetest.formspec_escape( S("Inventory:")).."]"..
"image[1,1.5;1,1;custom_beacom_symbol_4.png]"..
"image[1,3;1,1;custom_beacom_symbol_3.png]"..
"image[1,4.5;1,1;custom_beacom_symbol_2.png]"..
"image[1,6;1,1;custom_beacom_symbol_1.png]"..
"image_button[5.2,1.5;1,1;mcl_potions_effect_swift.png;swiftness;]"..
"image_button[5.2,3;1,1;mcl_potions_effect_leaping.png;leaping;]"..
"image_button[5.2,4.5;1,1;mcl_potions_effect_strong.png;strenght;]"..
"image_button[5.2,6;1,1;mcl_potions_effect_regenerating.png;regeneration;]"..
"item_image[1,7;1,1;mcl_core:diamond]"..
"item_image[2.2,7;1,1;mcl_core:emerald]"..
"item_image[3.4,7;1,1;mcl_core:iron_ingot]"..
"item_image[4.6,7;1,1;mcl_core:gold_ingot]"..
"item_image[5.8,7;1,1;mcl_nether:netherite_ingot]"..
mcl_formspec.get_itemslot_bg(7.2,7,1,1)..
"list[context;input;7.2,7;1,1;]"..
mcl_formspec.get_itemslot_bg(1,9,9,3)..
"list[current_player;main;1,9;9,3;9]"..
mcl_formspec.get_itemslot_bg(1,12.5,9,1)..
"list[current_player;main;1,12.5;9,1;]"
local function remove_beacon_beam(pos)
for y=pos.y, pos.y+301 do
local node = minetest.get_node({x=pos.x,y=y,z=pos.z})
if node.name ~= "air" and node.name ~= "mcl_core:bedrock" and node.name ~= "mcl_core:void" then
if node.name == "ignore" then
minetest.get_voxel_manip():read_from_map({x=pos.x,y=y,z=pos.z}, {x=pos.x,y=y,z=pos.z})
node = minetest.get_node({x=pos.x,y=y,z=pos.z})
end
if node.name == "mcl_beacons:beacon_beam" then
minetest.remove_node({x=pos.x,y=y,z=pos.z})
end
end
end
end
local function beacon_blockcheck(pos)
for y_offset = 1,4 do
local block_y = pos.y - y_offset
for block_x = (pos.x-y_offset),(pos.x+y_offset) do
for block_z = (pos.z-y_offset),(pos.z+y_offset) do
local valid_block = false --boolean which stores if block is valid or not
for _, beacon_block in pairs(beacon_blocklist) do
if beacon_block == minetest.get_node({x=block_x,y=block_y,z=block_z}).name and not valid_block then --is the block in the pyramid a valid beacon block
valid_block =true
end
end
if not valid_block then
return y_offset -1 --the last layer is complete, this one is missing or incomplete
end
end
end
if y_offset == 4 then --all checks are done, beacon is maxed
return y_offset
end
end
end
local function effect_player(effect,pos,power_level, effect_level,player)
local distance = vector.distance(player:get_pos(), pos)
if distance > (power_level+1)*10 then return end
if effect == "swiftness" then
mcl_potions.swiftness_func(player,effect_level,16)
elseif effect == "leaping" then
mcl_potions.leaping_func(player, effect_level, 16)
elseif effect == "strenght" then
mcl_potions.strength_func(player, effect_level, 16)
elseif effect == "regeneration" then
mcl_potions.regeneration_func(player, effect_level, 16)
end
end
local function globalstep_function(pos,player)
local meta = minetest.get_meta(pos)
local power_level = beacon_blockcheck(pos)
local effect_string = meta:get_string("effect")
if meta:get_int("effect_level") == 2 and power_level < 4 then
return
else
local obstructed = false
for y=pos.y+1, pos.y+100 do
local nodename = minetest.get_node({x=pos.x,y=y, z = pos.z}).name
if nodename ~= "mcl_core:bedrock" and nodename ~= "air" and nodename ~= "mcl_core:void" and nodename ~= "ignore" then --ignore means not loaded, let's just assume that's air
if nodename ~="mcl_beacons:beacon_beam" then
if minetest.get_item_group(nodename,"glass") == 0 and minetest.get_item_group(nodename,"material_glass") == 0 then
obstructed = true
remove_beacon_beam(pos)
return
end
end
end
end
if obstructed then
return
end
effect_player(effect_string,pos,power_level,meta:get_int("effect_level"),player)
end
end
minetest.register_node("mcl_beacons:beacon", {
description = S"Beacon",
drawtype = "mesh",
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
mesh = "mcl_beacon.b3d",
tiles = {"beacon_UV.png"},
use_texture_alpha = "clip",
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
inv:set_size("input", 1)
local form = formspec_string
meta:set_string("formspec", form)
end,
on_destruct = function(pos)
local meta = minetest.get_meta(pos)
local input = meta:get_inventory():get_stack("input",1)
if not input:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} --from mcl_anvils
minetest.add_item(p, input)
end
remove_beacon_beam(pos)
end,
on_receive_fields = function(pos, formname, fields, sender)
if fields.swiftness or fields.regeneration or fields.leaping or fields.strenght then
local sender_name = sender:get_player_name()
local power_level = beacon_blockcheck(pos)
if minetest.is_protected(pos, sender_name) then
minetest.record_protection_violation(pos, sender_name)
return
elseif power_level == 0 then
return
end
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local input = inv:get_stack("input",1)
if input:is_empty() then
return
end
local valid_item = false
for _, item in ipairs(beacon_fuellist) do
if input:get_name() == item then
valid_item = true
end
end
if not valid_item then
return
end
local successful = false
if fields.swiftness then
if power_level == 4 then
minetest.get_meta(pos):set_int("effect_level",2)
else
minetest.get_meta(pos):set_int("effect_level",1)
end
minetest.get_meta(pos):set_string("effect","swiftness")
successful = true
elseif fields.leaping and power_level >= 2 then
if power_level == 4 then
minetest.get_meta(pos):set_int("effect_level",2)
else
minetest.get_meta(pos):set_int("effect_level",1)
end
minetest.get_meta(pos):set_string("effect","leaping")
successful = true
elseif fields.strenght and power_level >= 3 then
if power_level == 4 then
minetest.get_meta(pos):set_int("effect_level",2)
else
minetest.get_meta(pos):set_int("effect_level",1)
end
minetest.get_meta(pos):set_string("effect","strenght")
successful = true
elseif fields.regeneration and power_level == 4 then
minetest.get_meta(pos):set_int("effect_level",2)
minetest.get_meta(pos):set_string("effect","regeneration")
successful = true
end
if successful then
if power_level == 4 then
awards.unlock(sender:get_player_name(),"mcl:maxed_beacon")
end
awards.unlock(sender:get_player_name(),"mcl:beacon")
input:take_item()
inv:set_stack("input",1,input)
local beam_palette_index = 0
remove_beacon_beam(pos)
for y = pos.y +1, pos.y + 201 do
local node = minetest.get_node({x=pos.x,y=y,z=pos.z})
if node.name == ignore then
minetest.get_voxel_manip():read_from_map({x=pos.x,y=y,z=pos.z}, {x=pos.x,y=y,z=pos.z})
node = minetest.get_node({x=pos.x,y=y,z=pos.z})
end
if minetest.get_item_group(node.name, "glass") ~= 0 or minetest.get_item_group(node.name,"material_glass") ~= 0 then
beam_palette_index = get_beacon_beam(node.name)
end
if node.name == "air" then
minetest.set_node({x=pos.x,y=y,z=pos.z},{name="mcl_beacons:beacon_beam",param2=beam_palette_index})
end
end
globalstep_function(pos,sender)--call it once outside the globalstep so the player gets the effect right after selecting it
end
end
end,
light_source = 14,
groups = {handy=1},
drop = "mcl_beacons:beacon",
sounds = mcl_sounds.node_sound_glass_defaults(),
_mcl_hardness = 3,
})
mesecon.register_mvps_stopper("mcl_beacons:beacon")
mcl_wip.register_wip_item("mcl_beacons:beacon")
function register_beaconblock (itemstring)--API function for other mods
table.insert(beacon_blocklist, itemstring)
end
function register_beaconfuel(itemstring)
table.insert(beacon_fuellist, itemstring)
end
local timer = 0
minetest.register_globalstep(function(dtime)
timer = timer + dtime
if timer >= 3 then
for _, player in ipairs(minetest.get_connected_players()) do
local player_pos = player:get_pos()
local pos_list = minetest.find_nodes_in_area({x=player_pos.x-50, y=player_pos.y-50, z=player_pos.z-50}, {x=player_pos.x+50, y=player_pos.y+50, z=player_pos.z+50},"mcl_beacons:beacon")
for _, pos in ipairs(pos_list) do
globalstep_function(pos,player)
end
end
timer = 0
end
end)
minetest.register_abm{
label="update beacon beam",
nodenames = {"mcl_beacons:beacon_beam"},
interval = 1,
chance = 1,
action = function(pos)
local node_below = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
local node_above = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
local node_current = minetest.get_node(pos)
if node_below.name == "air" then
if minetest.get_node({x=pos.x,y=pos.y-2,z=pos.z}).name == "mcl_beacons:beacon" then
minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z},{name="mcl_beacons:beacon_beam",param2=0})
end
remove_beacon_beam(pos)
elseif node_above.name == "air" or (node_above.name == "mcl_beacons:beacon_beam" and node_above.param2 ~= node_current.param2) then
minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="mcl_beacons:beacon_beam",param2=node_current.param2})
elseif minetest.get_item_group(node_above.name, "glass") ~= 0 or minetest.get_item_group(node_above.name,"material_glass") ~= 0 then
minetest.set_node({x=pos.x,y=pos.y+2,z=pos.z},{name="mcl_beacons:beacon_beam",param2=get_beacon_beam(node_above.name)})
end
end,
}
minetest.register_craft({
output = "mcl_beacons:beacon",
recipe = {
{"mcl_core:glass", "mcl_core:glass", "mcl_core:glass"},
{"mcl_core:glass", "mcl_mobitems:nether_star", "mcl_core:glass"},
{"mcl_core:obsidian", "mcl_core:obsidian", "mcl_core:obsidian"}
}
})

View File

@ -0,0 +1,5 @@
# textdomain: mcl_beacons
Beacon=Leuchtfeuer
Beacon:=Leuchtfeuer:
Primary Power:=Primäre Kraft:
Inventory:=Inventar:

View File

@ -0,0 +1,5 @@
# textdomain: mcl_beacons
Beacon=
Beacon:=
Primary Power:=
Inventory:=

View File

@ -0,0 +1,2 @@
author=chmodsayshello
depends=mcl_formspec, mcl_init, mcl_wip, mesecons_mvps, mcl_core, mcl_sounds, awards, mcl_achievements, mcl_mobitems, mcl_nether

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

View File

@ -251,7 +251,7 @@ mcl_stairs.register_stair_and_slab_simple("blackstone", "mcl_blackstone:blacksto
mcl_stairs.register_stair_and_slab_simple("blackstone_polished", "mcl_blackstone:blackstone_polished", S("Polished Blackstone Stair"), S("Polished Blackstone Slab"), S("Polished Double Blackstone Slab"))
mcl_stairs.register_stair_and_slab_simple("blackstone_chiseled_polished", "mcl_blackstone:blackstone_chiseled_polished", S("Polished Chiseled Blackstone Stair"), S("Chiseled Polished Blackstone Slab"), S("Double Polished Chiseled Blackstone Slab"))
mcl_stairs.register_stair_and_slab_simple("blackstone_chiseled_polished", "mcl_blackstone:blackstone_chiseled_polished", S("Chiseled Polished Blackstone Stair"), S("Chiseled Polished Blackstone Slab"), S("Double Polished Chiseled Blackstone Slab"))
mcl_stairs.register_stair_and_slab_simple("blackstone_brick_polished", "mcl_blackstone:blackstone_brick_polished", S("Polished Blackstone Brick Stair"), S("Polished Blackstone Brick Slab"), S("Double Polished Blackstone Brick Slab"))

View File

@ -510,8 +510,8 @@ minetest.register_craft({
}
})
minetest.register_alias("mcl_blast_furnace:blast_furnace", "mcl_furnaces:blast_furnace")
minetest.register_alias("mcl_blast_furnace:blast_furnace_active", "mcl_furnaces:blast_furnace_active")
minetest.register_alias("mcl_furnaces:blast_furnace", "mcl_blast_furnace:blast_furnace")
minetest.register_alias("mcl_furnaces:blast_furnace_active", "mcl_blast_furnace:blast_furnace_active")
-- Add entry alias for the Help
if minetest.get_modpath("doc") then

View File

@ -507,7 +507,6 @@ function ARROW_ENTITY.on_activate(self, staticdata, dtime_s)
end
minetest.register_on_respawnplayer(function(player)
if not player.get_children then return end
for _, obj in pairs(player:get_children()) do
local ent = obj:get_luaentity()
if ent and ent.name and string.find(ent.name, "mcl_bows:arrow_entity") then

View File

@ -91,7 +91,7 @@ minetest.register_craftitem("mcl_farming:potato_item", {
_doc_items_longdesc = S("Potatoes are food items which can be eaten, cooked in the furnace and planted. Pigs like potatoes."),
_doc_items_usagehelp = S("Hold it in your hand and rightclick to eat it. Place it on top of farmland to plant it. It grows in sunlight and grows faster on hydrated farmland. Rightclick an animal to feed it."),
inventory_image = "farming_potato.png",
groups = { food = 2, eatable = 1, compostability=65 },
groups = { food = 2, eatable = 1, compostability=65, smoker_cookable=1 },
_mcl_saturation = 0.6,
stack_max = 64,
on_secondary_use = minetest.item_eat(1),

View File

@ -20,7 +20,7 @@ end
-- Warped fungus
-- Crimson fungus
-- Nether woods
-- Functions and Biomes
-- Functions
-- WARNING: The most comments are in german. Please Translate with an translater if you don't speak good german
@ -636,7 +636,7 @@ for b=1, #barks do
local bark = barks[b]
local sub = bark[1].."_hyphae_bark"
local id = "mcl_mushroom:"..bark[1].."_hyphae"
mcl_stairs.register_stair(sub, id,
{handy=1,axey=1, bark_stairs=1, material_wood=1},
{minetest.registered_nodes[id].tiles[3]},
@ -830,112 +830,7 @@ function generate_crimson_tree(pos)
end
else
if breakgrow2 == false then
minetest.set_node(pos,{ name = "mcl_mushroom:crimson_fungus" })
minetest.set_node(pos,{ name = "mcl_mushroom:crimson_fungus" })
end
end
end
--[[
FIXME: Biomes are to rare
FIXME: Decoration don't do generate
WARNING: Outdatet, the biomes gernerate now different, with Ores
-- biomes in test!
minetest.register_biome({
name = "WarpedForest",
node_filler = "mcl_nether:netherrack",
node_stone = "mcl_nether:netherrack",
node_top = "mcl_mushroom:warped_nylium",
node_water = "air",
node_river_water = "air",
y_min = -29065,
y_max = -28940,
heat_point = 100,
humidity_point = 0,
_mcl_biome_type = "hot",
_mcl_palette_index = 19,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_mushroom:warped_nylium"},
sidelen = 16,
noise_params = {
offset = 0.01,
scale = 0.0022,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"WarpedForest"},
y_min = -29065,
y_max = -28940 + 80,
decoration = "mcl_mushroom:warped_fungus",
})
]]
minetest.register_ore({
ore_type = "sheet",
ore = "mcl_mushroom:warped_checknode",
-- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally
-- in v6, but instead set with the on_generated function in mcl_mapgen_core.
wherein = {"mcl_nether:netherrack", "mcl_core:stone"},
clust_scarcity = 14 * 14 * 14,
clust_size = 10,
y_min = -29065,
y_max = -28940,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.1,
spread = {x = 8, y = 8, z = 8},
seed = 4996,
octaves = 1,
persist = 0.0
},
})
minetest.register_ore({
ore_type = "sheet",
ore = "mcl_mushroom:crimson_checknode",
-- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally
-- in v6, but instead set with the on_generated function in mcl_mapgen_core.
wherein = {"mcl_nether:netherrack", "mcl_core:stone"},
clust_scarcity = 10 * 10 * 10,
clust_size = 10,
y_min = -29065,
y_max = -28940,
noise_threshold = 0.0,
noise_params = {
offset = 1,
scale = 0.5,
spread = {x = 12, y = 12, z = 12},
seed = 12948,
octaves = 1,
persist = 0.0
},
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_mushroom:warped_nylium"},
sidelen = 16,
fill_ratio = 0.1,
biomes = {"Nether"},
y_max = -28940,
y_min = -29065,
decoration = "mcl_mushroom:warped_fungus",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_mushroom:crimson_nylium"},
sidelen = 16,
fill_ratio = 0.1,
biomes = {"Nether"},
y_max = -28940,
y_min = -29065,
decoration = "mcl_mushroom:crimson_fungus",
})

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -27,8 +27,34 @@ local DELAY = 3 -- seconds before teleporting in Nether portal in Survival mo
local DISTANCE_MAX = 128
local PORTAL = "mcl_portals:portal"
local OBSIDIAN = "mcl_core:obsidian"
local O_Y_MIN, O_Y_MAX = max(mcl_mapgen.overworld.min, -31), min(mcl_mapgen.overworld.max, 2048)
local N_Y_MIN, N_Y_MAX = mcl_mapgen.nether.bedrock_bottom_min, mcl_mapgen.nether.bedrock_top_min - H_MIN
local O_Y_MIN, O_Y_MAX
local N_Y_MIN, N_Y_MAX
local overworld_lava_max
local nether_lava_max
local overworld_min
local limits
local get_local_settings = function()
O_Y_MIN, O_Y_MAX = max(mcl_mapgen.overworld.min, -31), min(mcl_mapgen.overworld.max, 2048)
N_Y_MIN, N_Y_MAX = mcl_mapgen.nether.bedrock_bottom_min, mcl_mapgen.nether.bedrock_top_min - H_MIN
overworld_min = mcl_mapgen.overworld.min
overworld_lava_max = mcl_mapgen.overworld.lava_max
nether_lava_max = mcl_mapgen.nether.lava_max
limits = {
nether = {
pmin = {x=LIM_MIN, y = N_Y_MIN, z = LIM_MIN},
pmax = {x=LIM_MAX, y = N_Y_MAX, z = LIM_MAX},
},
overworld = {
pmin = {x=LIM_MIN, y = O_Y_MIN, z = LIM_MIN},
pmax = {x=LIM_MAX, y = O_Y_MAX, z = LIM_MAX},
},
}
end
get_local_settings()
mcl_mapgen.register_on_settings_changed(get_local_settings)
-- Alpha and particles
local node_particles_allowed = minetest.settings:get("mcl_node_particles") or "none"
@ -79,17 +105,6 @@ local get_us_time = minetest.get_us_time
local dimension_to_teleport = { nether = "overworld", overworld = "nether" }
local limits = {
nether = {
pmin = {x=LIM_MIN, y = N_Y_MIN, z = LIM_MIN},
pmax = {x=LIM_MAX, y = N_Y_MAX, z = LIM_MAX},
},
overworld = {
pmin = {x=LIM_MIN, y = O_Y_MIN, z = LIM_MIN},
pmax = {x=LIM_MAX, y = O_Y_MAX, z = LIM_MAX},
},
}
-- This function registers exits from Nether portals.
-- Incoming verification performed: two nodes must be portal nodes, and an obsidian below them.
-- If the verification passes - position adds to the table and saves to mod storage on exit.
@ -164,7 +179,7 @@ local function find_exit(p, dx, dy, dz)
end
end
-- This functon searches Nether portal nodes whitin distance specified and checks the node
-- This function searches Nether portal nodes within distance specified and checks the node
local function find_exit_with_check(p, dx, dy, dz)
while true do
local pos = find_exit(p, dx, dy, dz)
@ -181,7 +196,7 @@ local function find_exit_with_check(p, dx, dy, dz)
end
end
-- Ping-Pong the coordinate for Fast Travelling, https://git.minetest.land/Wuzzy/MineClone2/issues/795#issuecomment-11058
-- Ping-Pong the coordinate for Fast Traveling, https://git.minetest.land/Wuzzy/MineClone2/issues/795#issuecomment-11058
local function ping_pong(x, m, l1, l2)
if x < 0 then
return l1 + abs(((x*m+l1) % (l1*4)) - (l1*2)), floor(x*m/l1/2) + ((ceil(x*m/l1)+1)%2) * ((x*m)%l1)/l1
@ -421,9 +436,9 @@ end
local function get_lava_level(pos, pos1, pos2)
if pos.y > -1000 then
return max(min(mcl_mapgen.overworld.lava_max, pos2.y-1), pos1.y+1)
return max(min(overworld_lava_max, pos2.y-1), pos1.y+1)
end
return max(min(mcl_mapgen.nether.lava_max, pos2.y-1), pos1.y+1)
return max(min(nether_lava_max, pos2.y-1), pos1.y+1)
end
local function ecb_scan_area_2(blockpos, action, calls_remaining, param)
@ -746,7 +761,7 @@ minetest.register_abm({
return
end
if lower_node_name == OBSIDIAN and pos.y >= mcl_mapgen.overworld.min and random(1, 750) == 19 then
if lower_node_name == OBSIDIAN and pos.y >= overworld_min and random(1, 750) == 19 then
local pigman_obj = minetest.add_entity(pos, "mobs_mc:pigman")
if pigman_obj then
teleport_cooloff(pigman_obj)

View File

@ -509,8 +509,8 @@ minetest.register_craft({
}
})
minetest.register_alias("mcl_smoker:smoker", "mcl_furnaces:smoker")
minetest.register_alias("mcl_smoker:smoker_active", "mcl_furnaces:smoker_active")
minetest.register_alias("mcl_furnaces:smoker", "mcl_smoker:smoker")
minetest.register_alias("mcl_furnaces:smoker_active", "mcl_smoker:smoker_active")
-- Add entry alias for the Help
if minetest.get_modpath("doc") then

View File

@ -8,6 +8,8 @@ local generate_fallen_logs = minetest.settings:get_bool("mcl_generate_fallen_log
local mod_mcl_structures = minetest.get_modpath("mcl_structures")
local mod_mcl_core = minetest.get_modpath("mcl_core")
local mod_mcl_mushrooms = minetest.get_modpath("mcl_mushrooms")
local mod_mcl_mushroom = minetest.get_modpath("mcl_mushroom")
local mod_mcl_blackstone = minetest.get_modpath("mcl_blackstone")
-- Jungle bush schematic. In PC/Java Edition it's Jungle Wood + Oak Leaves
local jungle_bush_schematic = mod_mcl_core.."/schematics/mcl_core_jungle_bush_oak_leaves.mts"
@ -1482,6 +1484,12 @@ end
-- Register biomes of non-Overworld biomes
local function register_dimension_biomes()
--mcl2 schematic compat
minetest.register_alias("mcl_crimson:warped_wart_block", "mcl_mushroom:warped_wart_block")
minetest.register_alias("mcl_crimson:warped_hyphae", "mcl_mushroom:warped_hyphae")
minetest.register_alias("mcl_crimson:shroomlight", "mcl_mushroom:shroomlight")
minetest.register_alias("mcl_crimson:crimson_hyphae", "mcl_mushroom:crimson_hyphae")
--[[ REALMS ]]
--[[ THE NETHER ]]
@ -1493,8 +1501,7 @@ local function register_dimension_biomes()
node_river_water = "air",
node_cave_liquid = "air",
y_min = mcl_mapgen.nether.min,
-- FIXME: For some reason the Nether stops generating early if this constant is not added.
-- Figure out why.
y_max = mcl_mapgen.nether.max + 80,
heat_point = 100,
humidity_point = 0,
@ -1502,6 +1509,176 @@ local function register_dimension_biomes()
_mcl_palette_index = 17,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand"},
sidelen = 16,
fill_ratio = 10,
biomes = { "Nether" },
y_min = -31000,
y_max = mcl_mapgen.nether.max,
decoration = "mcl_nether:netherrack",
flags = "all_floors",
param2 = 0,
})
minetest.register_biome({
name = "SoulsandValley",
node_filler = "mcl_nether:netherrack",
node_stone = "mcl_nether:netherrack",
node_top = "mcl_blackstone:soul_soil",
node_water = "air",
node_river_water = "air",
node_cave_liquid = "air",
y_min = mcl_mapgen.nether.min,
y_max = mcl_mapgen.nether.max + 80,
heat_point = 77,
humidity_point = 33,
_mcl_biome_type = "hot",
_mcl_palette_index = 17,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack","mcl_nether:glowstone"},
sidelen = 16,
fill_ratio = 10,
biomes = { "SoulsandValley" },
y_min = -31000,
y_max = mcl_mapgen.nether.max,
decoration = "mcl_blackstone:soul_soil",
flags = "all_floors, all_ceilings",
param2 = 0,
})
minetest.register_ore({
ore_type = "blob",
ore = "mcl_nether:soul_sand",
wherein = { "mcl_nether:netherrack", "mcl_blackstone:soul_soil" },
clust_scarcity = 100,
clust_num_ores = 225,
clust_size = 15,
biomes = { "SoulsandValley" },
y_min = mcl_mapgen.nether.min,
y_max = mcl_mapgen.nether.max + 80,
noise_params = {
offset = 0,
scale = 1,
spread = { x = 250, y = 250, z = 250 },
seed = 12345,
octaves = 3,
persist = 0.6,
lacunarity = 2,
flags = "defaults",
}
})
minetest.register_biome({
name = "CrimsonForest",
node_filler = "mcl_nether:netherrack",
node_stone = "mcl_nether:netherrack",
node_top = "mcl_mushroom:crimson_nylium",
node_water = "air",
node_river_water = "air",
node_cave_liquid = "air",
y_min = mcl_mapgen.nether.min,
y_max = mcl_mapgen.nether.max + 80,
heat_point = 60,
humidity_point = 47,
_mcl_biome_type = "hot",
_mcl_palette_index = 17,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand"},
sidelen = 16,
fill_ratio = 10,
biomes = { "CrimsonForest" },
y_min = -31000,
y_max = mcl_mapgen.nether.max,
decoration = "mcl_mushroom:crimson_nylium",
flags = "all_floors",
param2 = 0,
})
minetest.register_biome({
name = "WarpedForest",
node_filler = "mcl_nether:netherrack",
node_stone = "mcl_nether:netherrack",
node_top = "mcl_mushroom:warped_nylium",
node_water = "air",
node_river_water = "air",
node_cave_liquid = "air",
y_min = mcl_mapgen.nether.min,
y_max = mcl_mapgen.nether.max + 80,
heat_point = 37,
humidity_point = 70,
_mcl_biome_type = "hot",
_mcl_palette_index = 17,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand"},
sidelen = 16,
fill_ratio = 10,
biomes = { "WarpedForest" },
y_min = -31000,
y_max = mcl_mapgen.nether.max,
decoration = "mcl_mushroom:warped_nylium",
flags = "all_floors",
param2 = 0,
})
minetest.register_biome({
name = "BasaltDelta",
node_filler = "mcl_nether:netherrack",
node_stone = "mcl_nether:netherrack",
node_top = "mcl_blackstone:basalt",
node_water = "air",
node_river_water = "air",
node_cave_liquid = "air",
y_min = mcl_mapgen.nether.min,
y_max = mcl_mapgen.nether.max + 80,
heat_point = 27,
humidity_point = 80,
_mcl_biome_type = "hot",
_mcl_palette_index = 17,
})
minetest.register_ore({
ore_type = "blob",
ore = "mcl_blackstone:blackstone",
wherein = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_core:gravel","mcl_nether:soul_sand"},
clust_scarcity = 100,
clust_num_ores = 400,
clust_size = 20,
biomes = { "BasaltDelta" },
y_min = mcl_mapgen.nether.min,
y_max = mcl_mapgen.nether.max + 80,
noise_params = {
offset = 0,
scale = 1,
spread = { x = 250, y = 250, z = 250 },
seed = 12345,
octaves = 3,
persist = 0.6,
lacunarity = 2,
flags = "defaults",
}
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand","mcl_blackstone:blackstone"},
sidelen = 16,
fill_ratio = 10,
biomes = { "BasaltDelta" },
y_min = -31000,
y_max = mcl_mapgen.nether.max,
decoration = "mcl_blackstone:basalt",
flags = "all_floors",
param2 = 0,
})
--[[ THE END ]]
minetest.register_biome({
name = "End",
@ -3938,7 +4115,331 @@ local chorus_noise_params = {
local function register_dimension_decorations()
--[[ NETHER ]]
-- TODO: Nether
--NETHER WASTES (Nether)
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack","mcl_nether:magma"},
sidelen = 16,
fill_ratio = 0.04,
biomes = {"Nether"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 1,
flags = "all_floors",
decoration = "mcl_fire:eternal_fire",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack"},
sidelen = 16,
fill_ratio = 0.013,
biomes = {"Nether"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 1,
flags = "all_floors",
decoration = "mcl_mushrooms:mushroom_brown",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack"},
sidelen = 16,
fill_ratio = 0.012,
biomes = {"Nether"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 1,
flags = "all_floors",
decoration = "mcl_mushrooms:mushroom_red",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:soul_sand"},
sidelen = 16,
fill_ratio = 0.0032,
biomes = {"Nether","SoulsandValley"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 1,
flags = "all_floors",
decoration = "mcl_nether:nether_wart",
})
-- WARPED FOREST
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_mushroom:warped_nylium"},
sidelen = 16,
fill_ratio = 0.02,
biomes = {"WarpedForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 10,
flags = "all_floors",
decoration = "mcl_mushroom:warped_fungus",
})
minetest.register_decoration({
deco_type = "schematic",
name = "mcl_biomes:warped_tree1",
place_on = {"mcl_mushroom:warped_nylium"},
sidelen = 16,
fill_ratio = 0.007,
biomes = {"WarpedForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 15,
flags = "all_floors, place_center_x, place_center_z",
schematic = mod_mcl_mushroom.."/schematics/warped_fungus_1.mts",
size = {x = 5, y = 11, z = 5},
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
name = "mcl_biomes:warped_tree2",
place_on = {"mcl_mushroom:warped_nylium"},
sidelen = 16,
fill_ratio = 0.005,
biomes = {"WarpedForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 10,
flags = "all_floors, place_center_x, place_center_z",
schematic = mod_mcl_mushroom.."/schematics/warped_fungus_2.mts",
size = {x = 5, y = 6, z = 5},
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
name = "mcl_biomes:warped_tree3",
place_on = {"mcl_mushroom:warped_nylium"},
sidelen = 16,
fill_ratio = 0.03,
biomes = {"WarpedForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 14,
flags = "all_floors, place_center_x, place_center_z",
schematic = mod_mcl_mushroom.."/schematics/warped_fungus_3.mts",
size = {x = 5, y = 12, z = 5},
rotation = "random",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_mushroom:warped_nylium","mcl_mushroom:twisting_vines"},
sidelen = 16,
fill_ratio = 0.012,
biomes = {"WarpedForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors",
height = 2,
height_max = 8,
decoration = "mcl_mushroom:twisting_vines",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_mushroom:warped_nylium"},
sidelen = 16,
fill_ratio = 0.0812,
biomes = {"WarpedForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors",
max_height = 5,
decoration = "mcl_mushroom:warped_roots",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_mushroom:crimson_nylium"},
sidelen = 16,
fill_ratio = 0.052,
biomes = {"WarpedForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors",
decoration = "mcl_mushroom:nether_sprouts",
})
-- CRIMSON FOREST
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_mushroom:crimson_nylium"},
sidelen = 16,
fill_ratio = 0.02,
biomes = {"CrimsonForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.lava_max - 10,
flags = "all_floors",
decoration = "mcl_mushroom:crimson_fungus",
})
minetest.register_decoration({
deco_type = "schematic",
name = "mcl_biomes:crimson_tree",
place_on = {"mcl_mushroom:crimson_nylium"},
sidelen = 16,
fill_ratio = 0.008,
biomes = {"CrimsonForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 10,
flags = "all_floors, place_center_x, place_center_z",
schematic = mod_mcl_mushroom.."/schematics/crimson_fungus_1.mts",
size = {x = 5, y = 8, z = 5},
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
name = "mcl_biomes:crimson_tree2",
place_on = {"mcl_mushroom:crimson_nylium"},
sidelen = 16,
fill_ratio = 0.006,
biomes = {"CrimsonForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 15,
flags = "all_floors, place_center_x, place_center_z",
schematic = mod_mcl_mushroom.."/schematics/crimson_fungus_2.mts",
size = {x = 5, y = 12, z = 5},
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
name = "mcl_biomes:crimson_tree3",
place_on = {"mcl_mushroom:crimson_nylium"},
sidelen = 16,
fill_ratio = 0.004,
biomes = {"CrimsonForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 20,
flags = "all_floors, place_center_x, place_center_z",
schematic = mod_mcl_mushroom.."/schematics/crimson_fungus_3.mts",
size = {x = 7, y = 13, z = 7},
rotation = "random",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_mushroom:crimson_nylium"},
sidelen = 16,
fill_ratio = 0.082,
biomes = {"CrimsonForest"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors",
max_height = 5,
decoration = "mcl_mushroom:crimson_roots",
})
--SOULSAND VALLEY
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_blackstone:soul_soil","mcl_nether:soul_sand"},
sidelen = 16,
fill_ratio = 0.062,
biomes = {"SoulsandValley"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors",
max_height = 5,
decoration = "mcl_blackstone:soul_fire",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"},
sidelen = 16,
fill_ratio = 0.000212,
biomes = {"SoulsandValley"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors, place_center_x, place_center_z",
schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_1.mts",
size = {x = 5, y = 8, z = 5},
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"},
sidelen = 16,
fill_ratio = 0.0002233,
biomes = {"SoulsandValley"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors, place_center_x, place_center_z",
schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_2.mts",
size = {x = 5, y = 8, z = 5},
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"},
sidelen = 16,
fill_ratio = 0.000225,
biomes = {"SoulsandValley"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors, place_center_x, place_center_z",
schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_3.mts",
size = {x = 5, y = 8, z = 5},
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"mcl_blackstone:soul_soil","mcl_nether:soulsand"},
sidelen = 16,
fill_ratio = 0.00022323,
biomes = {"SoulsandValley"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors, place_center_x, place_center_z",
schematic = mod_mcl_blackstone.."/schematics/mcl_blackstone_nether_fossil_4.mts",
size = {x = 5, y = 8, z = 5},
rotation = "random",
})
--BASALT DELTA
minetest.register_decoration({
deco_type = "simple",
decoration = "mcl_blackstone:basalt",
place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"},
sidelen = 80,
height_max = 55,
noise_params={
offset = -0.0085,
scale = 0.002,
spread = {x = 25, y = 120, z = 25},
seed = 2325,
octaves = 5,
persist = 2,
lacunarity = 3.5,
flags = "absvalue"
},
biomes = {"BasaltDelta"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors, all ceilings",
})
minetest.register_decoration({
deco_type = "simple",
decoration = "mcl_blackstone:basalt",
place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"},
sidelen = 80,
height_max = 15,
noise_params={
offset = -0.0085,
scale = 0.004,
spread = {x = 25, y = 120, z = 25},
seed = 235,
octaves = 5,
persist = 2.5,
lacunarity = 3.5,
flags = "absvalue"
},
biomes = {"BasaltDelta"},
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors, all ceilings",
})
minetest.register_decoration({
deco_type = "simple",
decoration = "mcl_nether:magma",
place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"},
sidelen = 80,
fill_ratio = 0.082323,
biomes = {"BasaltDelta"},
place_offset_y = -1,
y_min = mcl_mapgen.nether.lava_max + 1,
flags = "all_floors, all ceilings",
})
minetest.register_decoration({
deco_type = "simple",
decoration = "mcl_nether:nether_lava_source",
place_on = {"mcl_blackstone:basalt","mcl_nether:netherrack","mcl_blackstone:blackstone"},
spawn_by = {"mcl_blackstone:basalt","mcl_blackstone:blackstone"},
num_spawn_by = 14,
sidelen = 80,
fill_ratio = 4,
biomes = {"BasaltDelta"},
place_offset_y = -1,
y_min = mcl_mapgen.nether.lava_max + 1,
y_max = mcl_mapgen.nether.max - 5,
flags = "all_floors, force_placement",
})
--[[ THE END ]]

View File

@ -32,9 +32,16 @@ local math_ceil = math.ceil
--custom mcl_vars
local get_node = mcl_mapgen.get_far_node
local min_y
local max_y
local get_local_settings = function()
min_y = math_max(mcl_mapgen.overworld.min, mcl_mapgen.overworld.bedrock_max) + 1
max_y = mcl_mapgen.overworld.max - 1
end
get_local_settings()
mcl_mapgen.register_on_settings_changed(get_local_settings)
local min_y = math_max(mcl_mapgen.overworld.min, mcl_mapgen.overworld.bedrock_max) + 1
local max_y = mcl_mapgen.overworld.max - 1
-- Calculate the number of dungeon spawn attempts
-- In Minecraft, there 8 dungeon spawn attempts Minecraft chunk (16*256*16 = 65536 blocks).
-- Minetest chunks don't have this size, so scale the number accordingly.

View File

@ -1101,7 +1101,7 @@ local function register_mgv6_decorations()
end
local mg_flags = minetest.settings.get_flags and minetest.settings:get_flags("mg_flags") or {}
local mg_flags = minetest.settings:get_flags("mg_flags")
-- Inform other mods of dungeon setting for MCL2-style dungeons
mcl_vars.mg_dungeons = mcl_mapgen.dungeons
@ -1214,25 +1214,34 @@ if flat then
air_layers[#air_layers + 1] = {mcl_mapgen.nether.flat_floor, mcl_mapgen.nether.flat_ceiling} -- Flat Nether
end
-- Realm barrier between the Overworld void and the End
local barrier_min = mcl_mapgen.realm_barrier_overworld_end_min
local barrier_max = mcl_mapgen.realm_barrier_overworld_end_max
local barrier_min
local barrier_max
local void_layers
local bedrock_layers
local void_layers = {
{mcl_mapgen.EDGE_MIN , mcl_mapgen.nether.min - 1 }, -- below Nether
{mcl_mapgen.nether.max + 129, mcl_mapgen.end_.min - 1 }, -- below End (above Nether)
{mcl_mapgen.end_.max + 1 , barrier_min - 1 }, -- below Realm Barrier, above End
{barrier_max + 1 , mcl_mapgen.overworld.min - 1}, -- below Overworld, above Realm Barrier
}
local get_local_settings = function()
-- Realm barrier between the Overworld void and the End
barrier_min = mcl_mapgen.realm_barrier_overworld_end_min
barrier_max = mcl_mapgen.realm_barrier_overworld_end_max
local bedrock_layers = {}
if not singlenode then
bedrock_layers = {
{mcl_mapgen.overworld.bedrock_min , mcl_mapgen.overworld.bedrock_max },
{mcl_mapgen.nether.bedrock_bottom_min, mcl_mapgen.nether.bedrock_bottom_max},
{mcl_mapgen.nether.bedrock_top_min , mcl_mapgen.nether.bedrock_top_max },
void_layers = {
{mcl_mapgen.EDGE_MIN , mcl_mapgen.nether.min - 1 }, -- below Nether
{mcl_mapgen.nether.max + 129, mcl_mapgen.end_.min - 1 }, -- below End (above Nether)
{mcl_mapgen.end_.max + 1 , barrier_min - 1 }, -- below Realm Barrier, above End
{barrier_max + 1 , mcl_mapgen.overworld.min - 1}, -- below Overworld, above Realm Barrier
}
bedrock_layers = {}
if not singlenode then
bedrock_layers = {
{mcl_mapgen.overworld.bedrock_min , mcl_mapgen.overworld.bedrock_max },
{mcl_mapgen.nether.bedrock_bottom_min, mcl_mapgen.nether.bedrock_bottom_max},
{mcl_mapgen.nether.bedrock_top_min , mcl_mapgen.nether.bedrock_top_max },
}
end
end
get_local_settings()
mcl_mapgen.register_on_settings_changed(get_local_settings)
mcl_mapgen.register_mapgen_block_lvm(function(vm_context)
local vm, data, area, minp, maxp, chunkseed, blockseed = vm_context.vm, vm_context.data, vm_context.area, vm_context.minp, vm_context.maxp, vm_context.chunkseed, vm_context.blockseed

View File

@ -1 +0,0 @@
-- moved into mcl_structures

View File

@ -1,3 +0,0 @@
name = mcl_strongholds
author = Wuzzy
description = Mod has been moved into mcl_structures. This is a dummy thing to overwrite the old thing, kay27 01/25/22

View File

@ -108,7 +108,6 @@ end
function process_mapgen_block_lvm(vm_context)
local nodes = minetest.find_nodes_in_area(vm_context.minp, vm_context.maxp, {"group:struct"}, true)
nodes = mcl_compatibility.sort_nodes(nodes)
for node_name, pos_list in pairs(nodes) do
local lvm_callback = on_finished_block_callbacks[node_name]
if lvm_callback then
@ -119,7 +118,6 @@ end
function process_mapgen_chunk(minp, maxp, seed, vm_context)
local nodes = minetest.find_nodes_in_area(minp, maxp, {"group:struct"}, true)
nodes = mcl_compatibility.sort_nodes(nodes)
for node_name, pos_list in pairs(nodes) do
local chunk_callback = on_finished_chunk_callbacks[node_name]
if chunk_callback then

View File

@ -1,4 +1,4 @@
name = mcl_structures
author = Wuzzy, kay27, cora
description = Structures for MineClone 2/5
depends = mcl_init, mcl_loot, mcl_mapgen, mcl_worlds
depends = mcl_loot, mcl_mapgen, mcl_worlds

View File

@ -94,13 +94,21 @@ if setting then
end
-- Max. and min. heights between rail corridors are generated
local height_min
if mcl_mapgen.lava then
height_min = mcl_mapgen.overworld.lava_max + 2
else
height_min = mcl_mapgen.overworld.bedrock_max + 2
local height_min, height_max
local get_local_settings = function()
if mcl_mapgen.lava then
height_min = mcl_mapgen.overworld.lava_max + 2
else
height_min = mcl_mapgen.overworld.bedrock_max + 2
end
height_max = mcl_worlds.layer_to_y(60)
-- Allow mods to separately override this
height_min = mcl_mapgen.overworld.railcorridors_height_min or height_min
height_max = mcl_mapgen.overworld.railcorridors_height_max or height_max
end
local height_max = mcl_worlds.layer_to_y(60)
get_local_settings()
mcl_mapgen.register_on_settings_changed(get_local_settings)
-- Chaos Mode: If enabled, rail corridors don't stop generating when hitting obstacles
local chaos_mode = minetest.settings:get_bool("tsm_railcorridors_chaos") or false

View File

@ -20,7 +20,6 @@ minetest.register_on_shutdown(function()
end)
local core_is_creative_enabled = minetest.is_creative_enabled
or function() return false end
minetest.is_creative_enabled = function(name)
local id = player_to_gamemode_id[name]

View File

@ -66,7 +66,7 @@ local function update_player(player_object)
local noclip = #find_nodes_in_area({x = x, y = head_y, z = z}, {x = x + 1, y = head_y + 1, z = z + 1}, "group:opaque") == 8
local velocity = player_object:get_velocity() or player_object:get_player_velocity()
local velocity = player_object:get_velocity()
if vector_length(velocity) < 0.00000001 then
player_doesnt_move[name] = (player_doesnt_move[name] or 0) + 1
else
@ -125,7 +125,7 @@ local function check_player(name)
if not obj_player then
return
end
local velocity = obj_player:get_velocity() or obj_player:get_player_velocity()
local velocity = obj_player:get_velocity()
local pos = obj_player:get_pos()
local x, y, z = floor(pos.x), floor(pos.y), floor(pos.z)
while #find_nodes_in_area({x = x, y = y, z = z}, {x = x + 1, y = y, z = z + 1}, "air") == 4 do

View File

@ -2,4 +2,3 @@ name = mcl_meshhand
author = jordan4ibanez
description = Applies the player skin texture to the hand.
depends = mcl_tools, mcl_skins
optional_depends = mcl_compatibility

View File

@ -90,11 +90,7 @@ function mcl_player.player_set_model(player, model_name)
end
local function set_texture(player, index, texture)
local textures = player_textures[player:get_player_name()]
if not textures then
player_textures[player:get_player_name()] = {"blank.png", "blank.png", "blank.png"}
textures = player_textures[player:get_player_name()]
end
local textures = player_textures[player:get_player_name()] or {}
textures[index] = texture
player:set_properties({textures = textures})
end

View File

@ -1,4 +1,3 @@
name = mcl_player
author = celeron55
description = Adds the 3D player model, taken from Minetest Game 0.4.16.
depends = mcl_playerinfo

View File

@ -63,10 +63,6 @@ minetest.register_globalstep(function(dtime)
-- what is around me?
local node_stand, node_stand_below, node_head, node_feet = get_player_nodes(pos)
if not mcl_playerinfo[name] then
mcl_playerinfo[name] = {}
end
mcl_playerinfo[name].node_stand = node_stand
mcl_playerinfo[name].node_stand_below = node_stand_below
mcl_playerinfo[name].node_head = node_head

View File

@ -254,7 +254,7 @@ minetest.register_globalstep(function(dtime)
local wielded_def = wielded:get_definition()
local c_x, c_y = unpack(player_collision(player))
--[[
if player_velocity.x + player_velocity.y < .5 and c_x + c_y > 0 then
local add_velocity = player.add_player_velocity or player.add_velocity
@ -277,12 +277,6 @@ minetest.register_globalstep(function(dtime)
local fly_pos = player:get_pos()
local fly_node = minetest.get_node({x = fly_pos.x, y = fly_pos.y - 0.5, z = fly_pos.z}).name
local elytra = mcl_playerplus.elytra[name]
if not elytra then
mcl_playerplus.elytra[player] = {}
elytra = mcl_playerplus.elytra[player]
end
elytra.inv = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra"
elytra.enchanted = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra_enchanted"
if not elytra.active then
@ -418,8 +412,7 @@ minetest.register_globalstep(function(dtime)
-- Update jump status immediately since we need this info in real time.
-- WARNING: This section is HACKY as hell since it is all just based on heuristics.
local mcl_playerplus_internal_name = mcl_playerplus_internal[name]
if mcl_playerplus_internal_name and mcl_playerplus_internal_name.jump_cooldown > 0 then
if mcl_playerplus_internal[name].jump_cooldown > 0 then
mcl_playerplus_internal[name].jump_cooldown = mcl_playerplus_internal[name].jump_cooldown - dtime
end
@ -743,9 +736,6 @@ minetest.register_globalstep(function(dtime)
end
-- Update internal values
if not mcl_playerplus_internal[name] then
mcl_playerplus_internal[name] = {}
end
mcl_playerplus_internal[name].lastPos = pos
end

View File

@ -185,3 +185,4 @@ revoke_shout_for_spammers (Revoke shout priv for spammers) bool true
mcl_item_id_debug (Item ID Debug) bool false
mcl_debug_struct_noise (Show Structures Perlin Noise) bool false
mcl_debug_chunk_borders (Show Chunk Borders) bool false
mcl_debug_head_code (Spawn dirt particles at mob head position) bool false