Skip to content

Commit

Permalink
add name/skin to network intercept enable
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 24, 2021
1 parent 2fe476b commit e6e504b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -24,7 +24,7 @@ public class WeatherChangesScriptEvent extends BukkitScriptEvent implements List
//
// @Context
// <context.world> returns the WorldTag the weather changed in.
// <context.weather> returns an ElementTag with the name of the new weather. (rain or clear).
// <context.weather> returns an ElementTag with the name of the new weather (rains or clears).
//
// -->

Expand Down
Expand Up @@ -2,6 +2,7 @@

import com.denizenscript.denizen.nms.NMSHandler;
import com.denizenscript.denizen.nms.util.PlayerProfile;
import com.denizenscript.denizen.utilities.packets.NetworkInterceptHelper;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand All @@ -24,6 +25,7 @@ public ProfileEditor() {
}

public void setPlayerName(Player player, String name) {
NetworkInterceptHelper.enable();
PlayerProfile profile = getFakeProfile(player);
profile.setName(name);
updatePlayer(player, false);
Expand All @@ -34,6 +36,7 @@ public String getPlayerName(Player player) {
}

public void setPlayerSkin(Player player, String name) {
NetworkInterceptHelper.enable();
PlayerProfile profile = getFakeProfile(player);
PlayerProfile skinProfile = NMSHandler.getInstance().fillPlayerProfile(new PlayerProfile(name, null));
if (skinProfile.getTexture() != null) {
Expand Down Expand Up @@ -79,6 +82,7 @@ public void setPlayerSkin(Player player, String name) {
// -->

public void setPlayerSkinBlob(Player player, String blob) {
NetworkInterceptHelper.enable();
PlayerProfile profile = getFakeProfile(player);
String[] split = blob.split(";");
profile.setTexture(split[0]);
Expand Down

0 comments on commit e6e504b

Please sign in to comment.