Hello! Is there any way to refresh / recreate Player Entity? I am currently facing a problem where i am setting “textures” property for GameProfile but the changes are not visible for player itself until he travel between worlds.
For other players i simply toggle Keys.VANISH and the others will see his new skin.
Currently i am “recreating” player this way:
Location<World> oldLocation = player.getLocation();
Vector3d rotation = player.getRotation();
World receiverWorld = player.getWorld();
Sponge.getServer().getWorlds()
.stream()
.filter(world -> !world.equals(receiverWorld))
.findFirst()
.ifPresent(world -> {
player.setLocation(world.getSpawnLocation());
player.setLocationAndRotation(oldLocation, rotation);
});
But i can’t use this in final product because it shows loading screen for a while.
So… Is there anyone who knows how to bypass that problem or encountered similar?