Skip to content

Commit

Permalink
Merge pull request #360 from ScoreUnder/patch-1
Browse files Browse the repository at this point in the history
Play sounds on door open/close
  • Loading branch information
Hidendra committed Jul 7, 2012
2 parents 41cce06 + 62ed772 commit ce3e597
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/griefcraft/modules/doors/DoorsModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.griefcraft.scripting.JavaModule;
import com.griefcraft.scripting.event.LWCProtectionInteractEvent;
import com.griefcraft.util.config.Configuration;
import org.bukkit.Effect;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
Expand Down Expand Up @@ -191,8 +192,11 @@ private void changeDoorStates(boolean allowDoorToOpen, Block... doors) {
// Get the top half of the door
Block topHalf = door.getRelative(BlockFace.UP);

// Now xor both data values with 0x8, the flag that states if the door is open
// Now xor both data values with 0x4, the flag that states if the door is open
door.setData((byte) (door.getData() ^ 0x4));

// Play the door open/close sound
door.getWorld().playEffect(door.getLocation(), Effect.DOOR_TOGGLE, 0);

// Only change the block above it if it is something we can open or close
if (isValid(topHalf.getType())) {
Expand Down

0 comments on commit ce3e597

Please sign in to comment.