How to rewrite drill behavior?
Posted: Mon Aug 12, 2019 12:43 am
I have a bit of a problem. It's a rather unusual problem...
Thing is, I'm using an infinite-ores mod on my world, so the mining drills display such numbers as 350/s... yet still produce at their 0.5/s rate. What's more, if the overall drill has a displayed rate of 60/s or so but one of the ores it's on has a yield of just 8% (I have one such drill), it'll occasionally produce 0/s for several seconds while it tries to mine that.
The solution... As a programmer, I want to make a mod, to rework how the drills work. What this mod would do, is get it to always produce 1 ore each time it finishes a job- but the duration of that job would vary dynamically with the yield of the ores under it. I'd have it calculate the rates for each affected ore and calculate the best one to drill from, resulting in a (gradual) evening of infinite resource amounts long before it hits the minimum. Which, I may also want to adjust those minimums... Non-infinite ores would be treated as 100% yield until depleted, configurable.
The problem is, I can't find any documentation or anything on how to modify the algorithm that works the drill, only configuration for it. Is that accessible to mods? If so, how?
Thing is, I'm using an infinite-ores mod on my world, so the mining drills display such numbers as 350/s... yet still produce at their 0.5/s rate. What's more, if the overall drill has a displayed rate of 60/s or so but one of the ores it's on has a yield of just 8% (I have one such drill), it'll occasionally produce 0/s for several seconds while it tries to mine that.
The solution... As a programmer, I want to make a mod, to rework how the drills work. What this mod would do, is get it to always produce 1 ore each time it finishes a job- but the duration of that job would vary dynamically with the yield of the ores under it. I'd have it calculate the rates for each affected ore and calculate the best one to drill from, resulting in a (gradual) evening of infinite resource amounts long before it hits the minimum. Which, I may also want to adjust those minimums... Non-infinite ores would be treated as 100% yield until depleted, configurable.
The problem is, I can't find any documentation or anything on how to modify the algorithm that works the drill, only configuration for it. Is that accessible to mods? If so, how?