renewData()
renewData Method in MelodyManager Class
renewData Method in MelodyManager ClassMethod Signature
public void renewData(RenewData data)Parameters
Parameter
Type
Description
data
RenewData
The updated data of the all players.
Example
Here is an example of how to use the renewData method in another plugin:
import ir.taher7.melodymine.core.MelodyManager;
import ir.taher7.melodymine.models.MelodyPlayer;
import ir.taher7.melodymine.models.RenewData;
public class ExamplePlugin {
public void updatePlayerData(String playerUUID, RenewData newData) {
MelodyManager.INSTANCE.renewData(newData);
Bukkit.getLogger().info("Updating players data in client.");
}
}In this example, the updatePlayerData method in the ExamplePlugin class retrieves the MelodyPlayer instance for the player using their UUID. It then uses the renewData method of the MelodyManager class to update the player's data. If the data is successfully updated, a message is logged to the console. If the player is not found, a warning is logged instead.
Last updated