Fix ClassCastException in tile entity

I think it is fixed for all tile entity. (see  #1584)