package com.github.niwaniwa.we.core.util.lib;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

import com.github.niwaniwa.we.core.player.WhitePlayer;

public class Vanish {

	private Vanish(){}

	public static boolean hide(WhitePlayer player){

		if(player.isVanish()){return false;}

		for(Player p : Bukkit.getOnlinePlayers()){
			if(!p.hasPermission("whiteegg.moderator")){
				p.hidePlayer(player.getPlayer());
			}
		}
		player.setVanish(true);
		return true;

	}

	public static boolean show(WhitePlayer player){

		if(!player.isVanish()){return false;}

		for(Player p : Bukkit.getOnlinePlayers()){
			p.showPlayer(player.getPlayer());
		}

		player.setVanish(false);

		return true;

	}

}

@@ -69,41 +69,8 @@
 kit;
-%0Aimport org.bukkit.entity.Player;
 %0A%0Aim
@@ -167,16 +167,50 @@
 sh()%7B%7D%0A%0A
+%09@SuppressWarnings(%22deprecation%22)%0A
 %09public 
@@ -246,25 +246,24 @@
 er player)%7B%0A
-%0A
 %09%09if(player.
@@ -289,34 +289,18 @@
 false;%7D%0A
-%0A
 %09%09
-for(Player p : 
 Bukkit.g
@@ -320,17 +320,30 @@
 rs()
-)%7B%0A%09%09%09if(
+.stream().filter(p -%3E 
 !p.h
@@ -381,14 +381,34 @@
 r%22))
-%7B
 %0A%09%09%09%09
+%09%09%09%09%09%09%09.forEach(p -%3E 
 p.hi
@@ -439,19 +439,11 @@
 r())
+)
 ;%0A
-%09%09%09%7D%0A%09%09%7D%0A
 %09%09pl
@@ -479,21 +479,54 @@
 n true;%0A
-%0A
 %09%7D%0A%0A
+%09@SuppressWarnings(%22deprecation%22)%0A
 %09public 
@@ -566,17 +566,16 @@
 layer)%7B%0A
-%0A
 %09%09if(!pl
@@ -610,26 +610,10 @@
 e;%7D%0A
-%0A
 %09%09
-for(Player p : 
 Bukk
@@ -637,14 +637,95 @@
 rs()
-)%7B%0A%09%09%09
+.stream().filter(p -%3E !p.hasPermission(%22whiteegg.moderator%22))%0A%09%09%09%09%09%09%09%09%09%09%09.forEach(p -%3E 
 p.sh
@@ -756,15 +756,11 @@
 r())
+)
 ;%0A
-%09%09%7D%0A%0A
 %09%09pl
@@ -782,17 +782,16 @@
 false);%0A
-%0A
 %09%09return
@@ -797,15 +797,14 @@
 n true;%0A
-%0A
 %09%7D%0A%0A%7D%0A

Change to lambda expression