Open richardhendricks opened 6 years ago
Sample output from log mOilFieldChunks.size = 16 pump speed = 0.5 chunkX = -64 chunkZ = -64 Oil pumped = 211 chunkX = -64 chunkZ = -63 Oil pumped = 315 chunkX = -64 chunkZ = -62 Oil pumped = 238 chunkX = -64 chunkZ = -61 Oil pumped = 229 chunkX = -63 chunkZ = -64 Oil pumped = 216 chunkX = -63 chunkZ = -63 Oil pumped = 249 chunkX = -63 chunkZ = -62 Oil pumped = 301 chunkX = -63 chunkZ = -61 Oil pumped = 325 chunkX = -62 chunkZ = -64 Oil pumped = 327 chunkX = -62 chunkZ = -63 Oil pumped = 281 chunkX = -62 chunkZ = -62 Oil pumped = 280 chunkX = -62 chunkZ = -61 Oil pumped = 248 chunkX = -61 chunkZ = -64 Oil pumped = 316 chunkX = -61 chunkZ = -63 Oil pumped = 238 chunkX = -61 chunkZ = -62 Oil pumped = 222 chunkX = -61 chunkZ = -61 Oil pumped = 262
Java is written by mathematical idiots. / is not handled properly on the negative side. Have to use Math.floorDiv() instead https://github.com/GTNewHorizons/GT5-Unofficial/commit/7e6fb0abeef22b80f16da5f63e7849525823579e
This logic for negative chunks is wrong and not necessary. % is continuous across negative values and needs no special handling.
https://github.com/Blood-Asp/GT5-Unofficial/blob/unstable/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java#L117
Tested with
https://github.com/GTNewHorizons/GT5-Unofficial/commit/4c4c412769df240e4dfe949854c8750b7a91cc9f
Oil in negative chunks
Total oil in 4x4 = 8516 Base extraction per operation is .5 = 4258
For HV oil drill, each operation is 32 ticks
4258 * 20/32 = 2661L/s
80902L in 30s test = 2692L/s (roundoff error from LSB)
https://github.com/GTNewHorizons/NewHorizons/issues/3399