[TUT] Doors - A better understanding

Discussion in 'Plugin Development' started by SamV522, May 1, 2011.

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

    SamV522

    For those who haven't picked it up yet...

    So, after brutalising the doors in minecraft through Bukkit API, you may have found that doors, specifically double doors, behave in really unusual ways that make no sense. Well, hopefully this will enlighten you. Currently, I'm not too sure on the difference uses as to why you would possibly need this, but hey, knowledge is power, and who doesn't want power, right?

    Now...
    Figure 1
    [​IMG]
    Double Doors.

    As you may have noticed, in minecraft, a door has 4 possible hinges, North East(0x0), South East(0x1), South West(0x2) and of course North West(0x3), which work exactly like you'd expect it would - the hinge is in whichever corner of the door block you specify (keeping in mind that a door is in fact 1x1x2, with only the opacity reduced - therefor making it traversable by a player when it's in it's open state).

    With that in mind, another thing to think about, is the fact that doors rotate in only one way. Counter-clockwise(0x4) That makes 8 different states, but theres 16 different door positions. It just doesn't make sense does it? Well, you're right. It doesn't. That's because there are only 8 different states.


    Figure 2
    [​IMG]
    Consider this: Two "Single" doors, 1 open, one shut.

    What if our second door, or our "9th state" was really just another door, that starts open? From left to right in the image, we'll name our doors 1,2,3 and 4 because I'm creative. Now, first thing you'll notice is that door numper 2 is in it's CLOSED state, WITHOUT a redstone torch, yet door number 4 is in a "CLOSED" state, with an active redstone input. Again, doesn't make sense, does it? Well, that's because there is no "9th state", it's just a door on the other side of the block.

    Thats nice Sam, but you're still not making sense


    Figure 3
    [​IMG]
    Well, put it this way, doors number 2 and 4 are just doors with a north-east hinge, like the one you can see above, so, if we take away the torch in Figure 2, we end up with the below result...

    Figure 4
    [​IMG]
    And there you have it; A closed north-east hinged door.

    It's because of this, that you have to invert the redstone current for a "Double Door" in game! Though a fix would be quick and painless on Notch's part, I imagine he has little time for things so small.
     
    Zeroth likes this.
  2. Offline

    Zeroth

    Hey, this is pretty enlightening. I don't really know how I could apply it, but it was interesting to read :p A mod should move this to Resources.
     
  3. Offline

    SamV522

    Yeah, that's my bad, I started the thread asking questions, and then ended up editing it to answer my question, with some more information on the topic to help clear things up a bit should anyone else want to look into it
     
Thread Status:
Not open for further replies.

Share This Page