-
Notifications
You must be signed in to change notification settings - Fork 2
API
George V edited this page Feb 6, 2023
·
3 revisions
The class to use SkinOverlay user methods is UserData and Utilities
These methods can be changed at any time without notice. You can view the UserData file for any changes or return to this page
//example
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
//Initialize the UserData with PlayerObject
PlayerObject playerObject = new PlayerObjectBukkit(event.getPlayer());
UserData data = UserData.getUser(playerObject);
//Initialize the UserData with UUID
UserData userData = UserData.getUser(event.getPlayer().getUniqueID);
}
//example
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
//Initialize the UserData with PlayerObject
PlayerObject playerObject = new PlayerObjectBukkit(event.getPlayer());
UserData data = UserData.getUser(playerObject);
//Initialize the UserData with UUID
UserData userData = UserData.getUser(event.getPlayer().getUniqueID);
//Set the default skin property
//This is the skin cache in order to not send requests for the default skin to the mojang servers.
userData.setDefaultSkinProperty(Property);
//Set the skin property
//The new skin property for the player
userData.setProperty(Property);
//Set the skin name
//Set the name of the current skin (eg default or alley)
userData.setSkinName(String);
}
//example
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
//Initialize the UserData with PlayerObject
PlayerObject playerObject = new PlayerObjectBukkit(event.getPlayer());
UserData data = UserData.getUser(playerObject);
//Initialize the UserData with UUID
UserData userData = UserData.getUser(event.getPlayer().getUniqueID);
//Get the default skin property
Property property = userData.getDefaultSkinProperty();
//Set skin property
//The new skin property for the player
Property property = userData.getProperty();
//Set skin name
//Set the name of the current skin (eg default or alley)
String skinName = userData.getSkinName();
}
//example
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
//Initialize the UserData with PlayerObject
PlayerObject playerObject = new PlayerObjectBukkit(event.getPlayer());
UserData data = UserData.getUser(playerObject);
//Initialize the UserData with UUID
UserData userData = UserData.getUser(event.getPlayer().getUniqueID);
//Setup user. this method is called by default everytime the user joins
data.setupUser();
//Reset user
data.reset();
//Check if player exists (return boolean)
if(data.playerExist()) {
}
}
import com.georgev22.skinoverlay.utilities.Utilities;
//example
public void updateSkin(PlayerObject playerObject) {
Utilities.updateSkin(playerObject, true /* if you want other to see the change */, false /* true if it is a skin reset */)
}