Water Ores

by Silari

Allows resources to spawn in water tiles.

Tweaks
a month ago
0.17 - 2.0
10.9K
Environment

i Incompatibility with Noxys Swimming

5 years ago

So I wanted to make a water world like which used this and Noxys Swimming but found both are not working together since you overwrite the collision mask, which undoes the changes Noxys Swimming makes to have the players swim (aka walk on water).

So I went and basically rewrote your mod to make it work with Noxys Swimming. Also makes it easy to update in the future and add support for other water-tiles.

local waters = {"water", "deepwater", "water-green", "deepwater-green", "water-mud", "water-shallow"}

for _,water in pairs(waters) do
    local mask = data.raw.tile[water].collision_mask
    for i=#mask,1,-1 do
        if mask[i] == "resource-layer" then
            table.remove(mask, i)
        end
    end
end

What is does, is going through all tiles defined in waters and removes the "resource-layer" collision from the mask.

5 years ago

I had planned to refactor the code to do that, but been too busy with classes and other coding to finish it. Went ahead and just used this, thanks.

This thread has been locked.