File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
main/src/main/java/net/citizensnpcs Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 44import java .util .Iterator ;
55import java .util .Locale ;
66import java .util .Map ;
7+ import java .util .UUID ;
78import java .util .concurrent .Callable ;
89
910import org .bstats .bukkit .Metrics ;
@@ -79,13 +80,16 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
7980 private final SkullMetaProvider skullMetaProvider = new SkullMetaProvider () {
8081 @ Override
8182 public String getTexture (SkullMeta meta ) {
83+ if (NMS .getProfile (meta ) == null )
84+ return null ;
8285 return Iterables .getFirst (NMS .getProfile (meta ).getProperties ().get ("textures" ), new Property ("" , "" ))
8386 .getValue ();
8487 }
8588
8689 @ Override
8790 public void setTexture (String string , SkullMeta meta ) {
88- NMS .setProfile (meta , new GameProfile (meta .getOwningPlayer ().getUniqueId (), string ));
91+ UUID uuid = meta .getOwningPlayer () == null ? UUID .randomUUID () : meta .getOwningPlayer ().getUniqueId ();
92+ NMS .setProfile (meta , new GameProfile (uuid , string ));
8993 }
9094 };
9195 private CitizensSpeechFactory speechFactory ;
You can’t perform that action at this time.
0 commit comments