package net.minecraft.entity;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import jml.confighelper.Registries;

import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.ChunkCoordinates;

public class DataWatcher{
	
	private static final HashMap dataTypes = new HashMap();

	public DataWatcher(Entity entityCreeper) 
	{
		
	}

	public static void registerDataType(Class dataType, int id)
	{
		dataTypes.put(dataType, id);
	}

	/**
     * Writes a watchable object (entity attribute of type {byte, short, int, float, string, ItemStack,
     * ChunkCoordinates}) to the specified PacketBuffer
     */
   public static void writeWatchableObjectToPacketBuffer(PacketBuffer buf, WatchableObject entry) throws IOException 
   {
      int type = entry.getObjectType();
      buf.writeByte(type);
      buf.writeVarIntToBuffer(entry.getDataValueId());
      Registries.writeWatcher(buf, type, entry.getObject());
   }

   public static List<DataWatcher.WatchableObject> readWatchedListFromPacketBuffer(PacketBuffer buf) throws IOException 
   {
       List<DataWatcher.WatchableObject> list = new ArrayList();
       int b;
       while ((b = buf.readUnsignedByte()) != 255)
       {
           int dataType = b;
           int id = buf.readVarIntFromBuffer();
           Object obj = Registries.readWatcher(buf, dataType);
           DataWatcher.WatchableObject watchableobject = new DataWatcher.WatchableObject(dataType, id, obj);
           list.add(watchableobject);
       }
       return list.isEmpty() ? null : list;
   }
    
	public static class WatchableObject 
	{
        public WatchableObject(int p_i1603_1_, int p_i1603_2_, Object p_i1603_3_)
        {
        	
        }
        public int getObjectType()
        {
            return -1;
        }
		public int getDataValueId()
        {
           return -1;
        }
		public Object getObject() 
		{
			return null;
		}
	}
	
}