12-15-2013, 10:33 PM 
		
	
	
		I thought I'd work on the HandlePlayerAbilities, but i'm stuck already. How do those "Flags" work?
	
	
	
	
	
| 
					Joining the packet sources
				 | 
| 
		
		
		12-15-2013, 10:33 PM 
		
	 
		I thought I'd work on the HandlePlayerAbilities, but i'm stuck already. How do those "Flags" work?
	 
		
		
		12-15-2013, 10:54 PM 
		
	 
		Those flags are just a bitfield, similar to how some block metadata work in MC. Bit 0 says if the player thinks they are in Creative mode, bit 1 says if they think they are flying, bit 2 says if they think they are allowed to fly, etc. To construct such a value, you OR the bit values together: Byte ValueToSend = 1 | 2 | 4; // Creative, flying, can flyTo query such value, you AND it with the respective bitmasks: 
if ((ValueReceived & 1) != 0)
{
  // Creative
}
if ((ValueReceived & 2) != 0)
{
  // Flying
}
Note that the vanilla server ignores some of these, we should as well.Thanks given by: NiLSPACE
		 
		
		
		12-15-2013, 11:29 PM 
		
	 
		
		
		12-15-2013, 11:33 PM 
		
	 
		It's not a plugin   I'm making the server able to control if a player can fly and is flying. | 
| 
					« Next Oldest | Next Newest »
				 |