Fix ClassCastException in tile entity, close #1584