*/
private JButton createCharacterButton(final String name, final RPObject character) {
// Abusing EntityView code to get the image of the player.
// Avoid doing sound stuff. That is not available at this stage of
// running the client.
IEntity player = new Player() {
@Override
protected void onPosition(double x, double y) {
}
@Override
protected void addSounds(String groupName, String categoryName, String... soundNames) {
}
};
// Zero the coordinates, otherwise the EntityView will try to draw
// itself to some weird place
character.put("x", 0);
character.put("y", 0);
// ignore ghostmode for showing the image
character.remove("ghostmode");
// ignore player killer skull
character.remove("last_player_kill_time");
player.initialize(character);
EntityView view = EntityViewFactory.create(player);
// this if-block is there to be compatible with Stendhal 0.84 that is missing information
Icon icon = null;
if (view != null) {