MineFactoryReloaded icon indicating copy to clipboard operation
MineFactoryReloaded copied to clipboard

[EASY FIX] IFactoryHarvestables can't see their harvesters

Open orthoplex64 opened this issue 10 years ago • 0 comments

Essentially what I was trying to do was write an implementation of IFactoryHarvestable such that, for each harvester:

  1. If the harvester and the target block are both in area A or both in area B, allow
  2. If the harvester is in area A and the target block is in area B, allow
  3. If the harvester is in area B and the target block is in area A, disallow

As you can see, when checking (from the context of an implementation of IFactoryHarvestable's canBeHarvested) if a block can be broken, I need to also be able to check the location of the corresponding harvester itself. What's frustrating about this is that the information that I'm looking for is already there, as the x/y/zCoord attributes of the harvester's TileEntity which is calling the checking method, but Java simply provides no way to determine, from within a method itself, the particular instance that's calling the method.

It would be really great if IFactoryHarvestables had some way of getting a reference to the harvester that's using them, for situations such as the example above.

orthoplex64 avatar Oct 08 '14 04:10 orthoplex64