Last active
November 17, 2021 22:28
-
-
Save 123DMWM/a98753c58f32c45ea70e756760ac58da to your computer and use it in GitHub Desktop.
plugin to force skins to use your own custom URL prefix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MCGalaxy { | |
public class ForceSkins : Plugin { | |
public override string name { get { return "ForceSkins"; } } | |
public override string MCGalaxy_Version { get { return "1.9.3.5"; } } | |
public override string welcome { get { return "Loaded ForceSkins!"; } } | |
public override string creator { get { return "123DMWM"; } } | |
//Set to the URL prefix you want to download skins from | |
public static string skinServer = "https://example.com/skins/"; | |
public override void Load(bool startup) { | |
Events.PlayerEvents.OnPlayerConnectEvent.Register(PlayerJoinCall, Priority.High); | |
} | |
public static void PlayerJoinCall(Player p) { | |
string skin = skinServer + p.truename + ".png"; | |
p.SkinName = skin; | |
Entities.GlobalRespawn(p); | |
Server.skins.Update(p.name, skin); | |
Server.skins.Save(); | |
} | |
public override void Unload(bool shutdown) { | |
Events.PlayerEvents.OnPlayerConnectEvent.Unregister(PlayerJoinCall); | |
} | |
public override void Help(Player p) { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment