package fr.aumgn.tobenamed.stage.listeners;

import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;

import fr.aumgn.tobenamed.game.Game;
import fr.aumgn.tobenamed.stage.PauseStage;

public class PauseListener implements Listener {

    private PauseStage stage;
    private Game game;

    public PauseListener(PauseStage stage) {
        this.stage = stage;
        this.game = stage.getGame();
    }

    @EventHandler
    public void onMove(PlayerMoveEvent event) {
        Player player = event.getPlayer();
        Location from = event.getFrom();
        Location to = event.getTo();
        if (from.getBlockX() != to.getBlockX()
                || from.getBlockY() != to.getBlockY()
                || from.getBlockZ() != to.getBlockZ()) {
            if (game.contains(player)) {
                stage.getPauseLocation(player).
                    teleportTo(player);
            }
        }
    }

    @EventHandler
    public void onDrop(PlayerDropItemEvent event) {
        Player player = event.getPlayer();
        if (game.contains(player)) {
            event.setCancelled(true);
        }
    }

    @EventHandler
    public void onInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        if (game.contains(player)) {
            event.setCancelled(true);
        }
    }

    @EventHandler
    public void onInteractEntity(PlayerInteractEntityEvent event) {
        Player player = event.getPlayer();
        if (game.contains(player)) {
            event.setCancelled(true);
        }
    }
}

@@ -69,16 +69,50 @@
 ation;%0D%0A
+import org.bukkit.entity.Entity;%0D%0A
 import o
@@ -207,24 +207,237 @@
 .Listener;%0D%0A
+import org.bukkit.event.entity.EntityDamageEvent;%0D%0Aimport org.bukkit.event.entity.EntityRegainHealthEvent;%0D%0Aimport org.bukkit.event.entity.EntityTargetEvent;%0D%0Aimport org.bukkit.event.entity.FoodLevelChangeEvent;%0D%0A
 import org.b
@@ -2132,12 +2132,1036 @@
 %0D%0A    %7D%0D
+%0A%0D%0A    @EventHandler%0D%0A    public void onDamage(EntityDamageEvent event) %7B%0D%0A        Entity entity = event.getEntity();%0D%0A        if (entity instanceof Player && game.contains((Player) entity)) %7B%0D%0A            event.setCancelled(true);%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    @EventHandler%0D%0A    public void onRegainHealth(EntityRegainHealthEvent event) %7B%0D%0A        Entity entity = event.getEntity();%0D%0A        if (entity instanceof Player && game.contains((Player) entity)) %7B%0D%0A            event.setCancelled(true);%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    @EventHandler%0D%0A    public void onFoodLevelChange(FoodLevelChangeEvent event) %7B%0D%0A        Entity entity = event.getEntity();%0D%0A        if (entity instanceof Player && game.contains((Player) entity)) %7B%0D%0A            event.setCancelled(true);%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    @EventHandler%0D%0A    public void onTarget(EntityTargetEvent event) %7B%0D%0A        Entity entity = event.getTarget();%0D%0A        if (entity instanceof Player && game.contains((Player) entity)) %7B%0D%0A            event.setCancelled(true);%0D%0A        %7D%0D%0A    %7D%0D
 %0A%7D%0D%0A

Add missing event in for pause stage