package openperipheral.integration.vanilla;

import java.util.Map;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Vec3;
import openperipheral.api.helpers.EntityMetaProviderSimple;

import com.google.common.collect.Maps;

public class EntityPlayerMetaProvider extends EntityMetaProviderSimple<EntityPlayer> {

	@Override
	public String getKey() {
		return "player";
	}

	@Override
	public Object getMeta(EntityPlayer target, Vec3 relativePos) {
		Map<String, Object> map = Maps.newHashMap();

		map.put("inventory", InventoryMetaProvider.wrapToProxyTable(target.inventory));
		map.put("isAirBorne", target.isAirBorne);
		map.put("isBlocking", target.isBlocking());
		map.put("profile", target.getGameProfile());
		map.put("foodLevel", target.getFoodStats().getFoodLevel());
		map.put("isCreativeMode", target.capabilities.isCreativeMode);

		return map;
	}

}

@@ -861,16 +861,265 @@
 Mode);%0A%0A
+%09%09Map%3CString, Object%3E experience = Maps.newHashMap();%0A%09%09experience.put(%22level%22, target.experienceLevel);%0A%09%09experience.put(%22levelProgress%22, target.experience);%0A%09%09experience.put(%22nextLevelXp%22, target.xpBarCap());%0A%09%09map.put(%22experience%22, experience);%0A%0A
 %09%09return

Add information about player experience to meta provider