Added code to send messages when player enter a gate. (Issue #15)

This commit is contained in:
Tobias Ottenweller 2013-02-26 12:47:38 +01:00
parent 08906f6004
commit 5b1ac6e8f7

View File

@ -2,6 +2,7 @@ package de.craftinc.gates.listeners;
import java.util.logging.Level;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.World;
@ -37,6 +38,7 @@ public class PluginPlayerListener implements Listener
// Check for permission
if (!hasPermission(event.getPlayer(), gateAtLocation)) {
event.getPlayer().sendMessage(ChatColor.RED + "Sorry, you are not allowed to use this gate!");
return;
}
@ -58,6 +60,8 @@ public class PluginPlayerListener implements Listener
event.getPlayer().teleport(teleportToLocation);
event.setTo(teleportToLocation);
event.getPlayer().sendMessage(ChatColor.DARK_AQUA + "Thank you for traveling with Craft Inc. Gates.");
}