BuildCraft|Core

BuildCraft|Core

7M Downloads

Quarry not mining around Oil

pokkits opened this issue ยท 15 comments

commented

Minecraft 1.6.4 Buildcraft 4.1.2 Forge .938
Previously, the quarry ignored underwater oil deposits and mined through to bedrock, stopping only for lava.
Now, quarries mine around underwater oil deposits, leaving towers of un-mined materials all the way down to bedrock with a layer of oil above.

commented

Oil is so tedious and useless - it's only used for galacticraft, and I guess early on if you decide to use combustion engines or some dynamos with fuel, we have reactors and what-not, besides if you want huge quantities you can pump it in the desert, please make a hotfix and add that 1 option in the config to enable oil destruction, come on please, I hate it so much - wastes so much of your time - like when you make a quarry it could cover up to 2/3 of the area and you mine almost nothing, so pointless. And no, I don't want to disable it - like I said, it's useful for galacticraft and early energy source, just make it stop trolling my quarry please.

commented

I agree. Not being able to set any config value for this is a big miss. Sorry for pointing that out.

commented

For anyone who is encountering this issue there is a somewhat solution:
There are two lines in buildcraft/factory/TileQuarry.java that have to be changed.


in line 334:
blockedColumns[searchX][searchZ] = true;
set this to:
blockedColumns[searchX][searchZ] = false;

in line 489:

private boolean isQuarriableBlock(int bx, int by, int bz) {
		int blockID = worldObj.getBlockId(bx, by, bz);
		return BlockUtil.canChangeBlock(blockID, worldObj, bx, by, bz) && !BlockUtil.isSoftBlock(blockID, worldObj, bx, by, bz);
	}

set this to:

	private boolean isQuarriableBlock(int bx, int by, int bz) {
		return true;
	}

The Quarry will now mine under Oil or anything.

To do this you will need to recompile buildcraft with the help of the minecraft forge and MCP because the antbuild file seems to have links that cannot download the dependencies anymore this is a bit tricky.


What I did was to import the buildcraft.jar into recarf: https://github.com/Col-E/Recaf (a java bytecode editor) to set the first statement and the second function to be always true.

If you use recarf follow these steps:

  1. open import buildcraft.java and go to buildcraft/factory/TileQuarry.java
  2. navigate to line 248 to function: private void createColumnVisitList() and rightclick => edit with assembler
  3. around line 257 there is something like :
ALOAD blockedColumns
ILOAD searchX
AALOAD
ILOAD searchZ
ICONST_0
BASTORE

change the ICONST_0 to ICONST_1
4. press STRG+S to save the changes you will see that the code magically changed to blockedColumns[searchX][searchZ] = false;

  1. Now open line 400 function: private boolean isQuarriableBlock(int bx, int by, int bz) and right click edit with assembler
  2. in line 4 change "ALOAD this" to "GOTO C" the result should look like this:
DEFINE PRIVATE isQuarriableBlock(I bx, I by, I bz)Z
A:
LINE A 490
GOTO C
  1. at the end of the code there is something like this:
C:
ICONST_0
D:
IRETURN
E:

just change ICONST_0 to ICONST_1 again

  1. press STRG+S to save your changes. Now the computer jumps direct to C: gets the Iconst_1 and then to the return statement
  2. the code should be magically changed to :
private boolean isQuarriableBlock(int bx, int by, int bz) {
		return true;
	}

Export to a new .jar file and replace your buildcraft in the mods folder and test your new Quarry!

I know this is not a pretty solution but it works for the most part but I hope you guys enjoy it!

commented

Not a bug

commented

Is there a config option to change this back to the old behavior of mining through it like water? And if not (I don't see one in the generated config file), can it be added as an option please?

commented

the problem is that there is no easy way to move the quary arm through a
liquid without destroying it, so running a quarry through an oil field
results in complaints about destroyed oil ...

@CovertJaguar, perhaps if when the quary arm moves into a liquid square, it
"saves" the source block, and replaces it as it moves on?

That way it could quarry an oil/ other liquid and just leave it flowing
behind.

On Thu, Feb 6, 2014 at 12:39 PM, James [email protected] wrote:

Is there a config option to change this back to the old behavior of mining
through it like water?

commented

You can always make quarry see BlockFluid as air.

commented

@jdinkel There is no config option.

Everyone else: There are no technical reasons behind the current behaviour. The Quarry, The Filler and The Mining well is using a common function that explicitly prevents them from digging through the fluids. This is intentional and "not a bug" like CJ pointed out.

You may continue the discussion on the buildcraft forums as a suggestion.

commented

But if it sees all liquid as air, then lava will no longer stop it which is a functional limitation to quarries

Sent from my iPhone

On Feb 6, 2014, at 1:07 AM, laz2727 [email protected] wrote:

You can always make quarry see BlockFluid as air.

โ€”
Reply to this email directly or view it on GitHub.

commented

-_-
if ((!block.isAir && (block instanceof BlockFluid)) || ((block != Block.lavaStill) || (block != Block.lavaMoving)))

commented

Regarding AartBloustoke's point, I would be fine with destroying the oil blocks if that was an option.

commented

You might be, but that doesn't mean everyone is, myself included.

commented

If it was an option and defaulted to the current behavior, why would that be a problem? Is it just the hassle of coding and maintaining the code? Or is there a problem with people being able to decide how they want to play the mod?

commented

Because not every trivial thing that someone could possibly dislike can have an option. You can already turn Oil off if you don't want it.

commented

What if the quarry could put the oil it encounters into connected pipes or tanks? Perhaps going around it as currently if nowhere to put it?