use of org.spongepowered.common.interfaces.server.management.IMixinPlayerProfileCache in project SpongeCommon by SpongePowered.
the class SpongeInternalListeners method onWorldSave.
@Listener
public void onWorldSave(SaveWorldEvent event) {
if (Sponge.getServer().getDefaultWorld().isPresent()) {
if (event.getTargetWorld().getUniqueId().equals(Sponge.getServer().getDefaultWorld().get().getUniqueId())) {
SpongeUsernameCache.save();
final MinecraftServer server = SpongeImpl.getServer();
((IMixinPlayerProfileCache) server.getPlayerProfileCache()).setCanSave(true);
server.getPlayerProfileCache().save();
((IMixinPlayerProfileCache) server.getPlayerProfileCache()).setCanSave(false);
}
}
}
Aggregations