Gintarus

Game

Jul 6th, 2025
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. /* Decompiler 33ms, total 249ms, lines 80 */
  2. package com.mojang.authlib;
  3.  
  4. import com.mojang.authlib.properties.PropertyMap;
  5. import java.util.UUID;
  6. import org.apache.commons.lang3.StringUtils;
  7. import org.apache.commons.lang3.builder.ToStringBuilder;
  8.  
  9. public class GameProfile {
  10. private final UUID id;
  11. private final String name;
  12. private final PropertyMap properties = new PropertyMap();
  13. private boolean legacy;
  14.  
  15. public GameProfile(UUID id, String name) {
  16. if (id == null && StringUtils.isBlank(name)) {
  17. throw new IllegalArgumentException("Name and ID cannot both be blank");
  18. } else {
  19. this.id = id;
  20. this.name = name;
  21. }
  22. }
  23.  
  24. public UUID getId() {
  25. return this.id;
  26. }
  27.  
  28. public String getName() {
  29. return this.name;
  30. }
  31.  
  32. public PropertyMap getProperties() {
  33. return this.properties;
  34. }
  35.  
  36. public boolean isComplete() {
  37. return this.id != null && StringUtils.isNotBlank(this.getName());
  38. }
  39.  
  40. public boolean equals(Object o) {
  41. if (this == o) {
  42. return true;
  43. } else if (o != null && this.getClass() == o.getClass()) {
  44. GameProfile that = (GameProfile)o;
  45. if (this.id != null) {
  46. if (!this.id.equals(that.id)) {
  47. return false;
  48. }
  49. } else if (that.id != null) {
  50. return false;
  51. }
  52.  
  53. if (this.name != null) {
  54. if (this.name.equals(that.name)) {
  55. return true;
  56. }
  57. } else if (that.name == null) {
  58. return true;
  59. }
  60.  
  61. return false;
  62. } else {
  63. return false;
  64. }
  65. }
  66.  
  67. public int hashCode() {
  68. int result = this.id != null ? this.id.hashCode() : 0;
  69. result = 31 * result + (this.name != null ? this.name.hashCode() : 0);
  70. return result;
  71. }
  72.  
  73. public String toString() {
  74. return (new ToStringBuilder(this)).append("id", this.id).append("name", this.name).append("properties", this.properties).append("legacy", this.legacy).toString();
  75. }
  76.  
  77. public boolean isLegacy() {
  78. return this.legacy;
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment