Skip to content

Commit

Permalink
Play the door toggle sound effect on door toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
ScoreUnder committed Jul 7, 2012
1 parent b1b934b commit 08cc443
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/griefcraft/modules/doors/DoorsModule.java
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 @@ -193,6 +194,9 @@ private void changeDoorStates(boolean allowDoorToOpen, Block... doors) {

// 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 08cc443

Please sign in to comment.