Find out if a block is a part of a double chest?

Discussion in 'Plugin Development' started by mjmr89, Mar 19, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    mjmr89

    I was wondering if there was any way to find out if a chest block is a part of a double chest and, if so, there was a way to get the other chest block. This is for my Cabinet plugin to make things easier for me, and to make it easier to implement a new feature for it.
     
  2. Offline

    Valrix

    You could always iterate through the x-axis and z-axis on each side of the block until you find another chest, or if there isn't one then it's a single chest. That's how I'd do it.
     
  3. Offline

    mjmr89

    That's what I'm doing now, but it seems like there may be a better way. I can't explain it very well, but it sort of makes sense in my head.
     
  4. Offline

    darknesschaos

    its at most, 4 calls, that is far from bad.
     
  5. Offline

    Edward Hand

    What they're describing is exactly how it's done in the minecraft source.
     
Thread Status:
Not open for further replies.

Share This Page