package com.endercrest.voidspawn;

import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;

/**
 * Handles updating player location for touch mode.
 */
public class MoveListener implements Listener {

    @EventHandler
    public void onMoveEvent(PlayerMoveEvent event){
        Player player = event.getPlayer();
        if(player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType().isSolid()){
            TeleportManager.getInstance().setPlayerLocation(player.getUniqueId(), player.getLocation());
        }
    }
}
@@ -28,16 +28,44 @@
 spawn;%0A%0A
+import org.bukkit.Material;%0A
 import o
@@ -557,16 +557,102 @@
 sSolid()
+ && !isTrapDoor(player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType())
 )%7B%0A     
@@ -767,9 +767,332 @@
 %7D%0A    %7D%0A
-%7D
+    %0A    public boolean isTrapDoor(Material mat) %7B%0A        return (mat == Material.OAK_TRAPDOOR %7C%7C mat == Material.SPRUCE_TRAPDOOR %7C%7C mat == Material.BIRCH_TRAPDOOR %7C%7C mat == Material.JUNGLE_TRAPDOOR %7C%7C mat == Material.ACACIA_TRAPDOOR %7C%7C mat == Material.DARK_OAK_TRAPDOOR %7C%7C mat == Material.IRON_TRAPDOOR);%0A    %7D    %0A    %0A%7D%0A

Fix falling from trapdoors