Add Magnetite and Nether bedrock upper limit

This commit is contained in:
Jack O'Sullivan 2024-01-20 01:45:34 +00:00
parent 08b159fc14
commit 516abf28ea

View File

@ -267,6 +267,7 @@ local ORES = Set{
"create:zinc_ore",
"create:deepslate_zinc_ore",
"create_new_age:thorium_ore",
"create_new_age:magnetite_block",
"powah:deepslate_uraninite_ore_poor",
"powah:deepslate_uraninite_ore",
@ -423,15 +424,17 @@ end
function Miner:safeNeighbors(p)
local ns = {
p + vector.new( 1, 0, 0),
p + vector.new( 0, 1, 0),
p + vector.new( 0, 0, 1),
p + vector.new(-1, 0, 0),
p + vector.new( 0, 0, -1),
}
-- only allow downwards if above bedrock
-- only allow downwards if above / below bedrock
if (self.absolutePos - self.pos + p).y - 1 > -60 then
table.insert(ns, p + vector.new(0, -1, 0))
end
if self.dimension ~= "the_nether" or (self.absolutePos - self.pos + p).y + 1 < 123 then
table.insert(ns, p + vector.new(0, 1, 0))
end
return ns
end
@ -494,7 +497,7 @@ function Miner:findOres(radius)
local found = {}
for _, b in ipairs(info) do
-- only ores and avoid bedrock
if ORES[b.name] and self.absolutePos.y + b.y > -60 then
if ORES[b.name] and self.absolutePos.y + b.y > -60 and (self.dimension ~= "the_nether" or self.absolutePos.y + b.y < 123) then
table.insert(found, b)
end
end