Jump to content

Recommended Posts

Posted
5 minutes ago, maldito171 said:

hi, i have a question about (  ->  ) on java 8. this arrow is what code in java 7?
 

Sorry for bad en, and thanks for who can help me.

 

That is lamba expression. Write me down the code from java 8. 

Posted

    

	
	public static void changeProcess(BanProssesInfo process)
	{
		BanProssesInfo prosess = conteins(process);
		
		if (prosess != null)
			_list.remove(prosess);
		else
			_list.add(process);
		
		updateData();
		
		L2World.getInstance().getPlayers().stream().filter(player -> player.isOnline() && !player.getClient().getInformation().isOfflineShop()).forEach(pl -> _list.forEach(pros -> pl.sendPacket(new BlockedProcessUpdate(pros))));
	}
	

Thanks man.
 

Sem título.png

Posted

You can use lamba instead of a for loop, add it to the runnable call method, and so on.

getPlayers() seems wrong method name, it can be getAllPlayers() or so. Check your L2World for proper name.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock