Add missing ores, fix unsafe neighbors and sending target messages

This commit is contained in:
Jack O'Sullivan 2024-01-18 00:25:35 +00:00
parent fdd00e3fb6
commit c14a2a0d08
14 changed files with 21 additions and 12 deletions

BIN
icon/ore-ancient-debris.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

BIN
icon/ore-ds-uraninite.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 B

BIN
icon/ore-ds-zinc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

BIN
icon/ore-glowstone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

BIN
icon/ore-nether-quartz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

BIN
icon/ore-thorium.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

BIN
icon/ore-uraninite-poor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

BIN
icon/ore-uraninite.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

BIN
icon/ore-zinc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

View File

@ -254,6 +254,10 @@ local ORES = Set{
"minecraft:diamond_ore", "minecraft:diamond_ore",
"minecraft:deepslate_diamond_ore", "minecraft:deepslate_diamond_ore",
"minecraft:glowstone",
"minecraft:nether_quartz_ore",
"minecraft:ancient_debris",
"create:ochrum", "create:ochrum",
"create:zinc_ore", "create:zinc_ore",
"create:deepslate_zinc_ore", "create:deepslate_zinc_ore",
@ -420,7 +424,7 @@ function Miner:safeNeighbors(p)
p + vector.new( 0, 0, -1), p + vector.new( 0, 0, -1),
} }
-- only allow downwards if above bedrock -- only allow downwards if above bedrock
if (self.absolutePos + p).y - 1 > -60 then if (self.absolutePos - self.pos + p).y - 1 > -60 then
table.insert(ns, p + vector.new(0, -1, 0)) table.insert(ns, p + vector.new(0, -1, 0))
end end

View File

@ -26,17 +26,21 @@ local ORE_ICONS = {
["minecraft:diamond_ore"] = "diamond", ["minecraft:diamond_ore"] = "diamond",
["minecraft:deepslate_diamond_ore"] = "ds-diamond", ["minecraft:deepslate_diamond_ore"] = "ds-diamond",
-- ["create:ochrum"] =, ["minecraft:glowstone"] = "glowstone",
-- ["create:zinc_ore"] =, ["minecraft:nether_quartz_ore"] = "nether-quartz",
-- ["create:deepslate_zinc_ore"] =, ["minecraft:ancient_debris"] = "ancient-debris",
-- ["create_new_age:thorium_ore"] =,
-- ["powah:deepslate_uraninite_ore_poor"] =, -- ["create:ochrum"] =,
-- ["powah:deepslate_uraninite_ore"] =, ["create:zinc_ore"] = "zinc",
-- ["powah:deepslate_uraninite_ore_dense"] =, ["create:deepslate_zinc_ore"] = "ds-zinc",
-- ["powah:uraninite_ore_poor"] =, ["create_new_age:thorium_ore"] = "thorium",
-- ["powah:uraninite_ore"] =,
-- ["powah:uraninite_ore_dense"] =, ["powah:deepslate_uraninite_ore_poor"] = "ds-uraninite-poor",
["powah:deepslate_uraninite_ore"] = "ds-uraninite",
["powah:deepslate_uraninite_ore_dense"] = "ds-uraninite-dense",
["powah:uraninite_ore_poor"] = "uraninite-poor",
["powah:uraninite_ore"] = "uraninite",
["powah:uraninite_ore_dense"] = "uraninite-dense",
} }
function oreIcon(t) function oreIcon(t)
@ -61,6 +65,7 @@ function Chat.new(prefix)
local self = setmetatable({}, { __index = Chat }) local self = setmetatable({}, { __index = Chat })
self.chat = peripheral.find("chatBox") self.chat = peripheral.find("chatBox")
self.detector = peripheral.find("playerDetector")
self.prefix = prefix self.prefix = prefix
self.lastSend = 0 self.lastSend = 0
@ -76,7 +81,7 @@ function Chat:send(msg, target)
local msgJSON = textutils.serializeJSON(msg) local msgJSON = textutils.serializeJSON(msg)
-- print(msgJSON) -- print(msgJSON)
if target then if target and self.detector.getPlayerPos(target).dimension then
assert(self.chat.sendFormattedMessageToPlayer(msgJSON, target, self.prefix)) assert(self.chat.sendFormattedMessageToPlayer(msgJSON, target, self.prefix))
else else
assert(self.chat.sendFormattedMessage(msgJSON, self.prefix)) assert(self.chat.sendFormattedMessage(msgJSON, self.prefix))