@EventHandler
public void jailDoorExit(PlayerInteractEvent e){
jailLoc = new Location(Bukkit.getWorld("kaospvp"), 1106, 32, -236);
jailLeaveLoc = new Location(Bukkit.getWorld("kaospvp"), 1103, 33, -238);
Punished pj = Punished.isJailed(e.getPlayer().getUniqueId().toString());
if(e.getClickedBlock() == null) return;
Location cbl = e.getClickedBlock().getLocation(); // clicked block location
boolean ird = // is right door?
cbl.getBlockX() == jailLeaveLoc.getBlockX() &&
cbl.getBlockY() == jailLeaveLoc.getBlockY() &&
cbl.getBlockZ() == jailLeaveLoc.getBlockZ();
if(ird){
if(pj.punished){
e.getPlayer().sendMessage(
tag + ChatColor.GRAY + "You still have " +
ChatColor.RED + pj.expirySecs / (60*60*24) + ChatColor.GRAY + " days, " +
ChatColor.RED + ((pj.expirySecs/HOUR)%24) + ChatColor.GRAY + " hours, " +
ChatColor.RED + ((pj.expirySecs/MINUTE) % 60) + ChatColor.GRAY + " minutes!");
}else{
e.getPlayer().teleport(e.getPlayer().getWorld().getSpawnLocation());
e.getPlayer().sendMessage(tag + ChatColor.GREEN + "You are free from jail!");
}
}
}
Core.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:kaosEssentials
作者:
评论列表
文章目录