Lockette doors and 1.8 servers

Discussion in 'Plugin Help/Development/Requests' started by Shaggy67, Nov 27, 2014.

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

    Shaggy67

    I'm sure others will probably run into this soon, if you haven't seen it already. With some of the changes to doors that are in vanilla minecraft for 1.8, the Lockette plugin has a glitch if you use signs to control doors.

    Technically speaking, a door is made up of an upper and lower block. Bit 0x4 in the block data sets whether the door is open or closed, but it should only be set on the lower block of the door. In previous versions of minecraft, bit 0x4 was unused on the upper door. The Lockette plugin toggles that bit on both halves of the door, even though it technically didn't need to, but it never hurt anything before.

    Now with all of the new door changes in 1.8, I'm guessing that the code is doing something with the 0x4 bit in the upper door. When Lockette toggles a door open/closed now, the door glitches.

    There are two places in the code where this is done. The toggleHalfDoor() and toggleDoorBase() methods. Find the following line in both of those methods:

    Code:
    block.setData((byte) (block.getData() ^ 4));
    
    and change it to this:

    Code:
    if((block.getData() & 0x8) == 0) {
        block.setData((byte) (block.getData() ^ 4));
    }
    
    Bit 0x8 == 0 tells you it's the lower half of the door.

    If anybody wants to download the Lockette source, they can fix the glitch themselves. I've got my own re-write of the mod, but I've tested and verified that the above change fixes the door glitch.
     
  2. Offline

    mrCookieSlime

    Moved to Alternatives Section.
     
Thread Status:
Not open for further replies.

Share This Page