Java Code Examples for org.inventivetalent.packetlistener.handler.SentPacket

The following examples show how to use org.inventivetalent.packetlistener.handler.SentPacket. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: StaffPlus   Source File: PacketModifier.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void handleClientSound(SentPacket packet)
{
	Player player = packet.getPlayer();
	
	if(player != null)
	{
		if(!isVanished(player))
		{
			return;
		}
	}else return;
	
	if(versionProtocol.shouldIgnorePacket(packet.getPacketValue(0)))
	{
		return;
	}
	
	packet.setCancelled(true);
}
 
Example 2
Source Project: StaffPlus   Source File: PacketModifier.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void handleClientAnimation(SentPacket packet)
{
	Player player = packet.getPlayer();
	
	if(player == null)
	{
		return;
	}
	
	if(userManager.get(packet.getPlayer().getUniqueId()).getVanishType() != VanishType.TOTAL)
	{
		return;
	}
	
	packet.setCancelled(true);
}