IDailyGaming

Untitled

Dec 16th, 2017
19,194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. package com.gmail.idailygaming.idgpack;
  2.  
  3. import java.util.Arrays;
  4. import net.md_5.bungee.api.ChatColor;
  5. import net.md_5.bungee.api.chat.BaseComponent;
  6. import net.md_5.bungee.api.chat.ComponentBuilder;
  7. import net.md_5.bungee.api.connection.ProxiedPlayer;
  8. import net.md_5.bungee.api.plugin.Event;
  9.  
  10. public final class IDGpack
  11. extends Event
  12. {
  13. private final ProxiedPlayer player;
  14. private boolean isAuthorized;
  15. private boolean isUpToDate = true;
  16. private String username;
  17. private final byte[][] interfaces = null;
  18. private final byte[] computerUUID = null;
  19. private String uuid;
  20. private BaseComponent[] kickMessage = null;
  21. public static final BaseComponent[] NOT_AUTH = new ComponentBuilder("Blad autoryzacji! Pobierz paczke ze strony: ").color(ChatColor.AQUA).bold(true).append("BlazingPack.pl").color(ChatColor.GOLD).bold(true).create();
  22. public static final BaseComponent[] NOT_UP_TO_DATE = new ComponentBuilder("Wylacz i wlacz paczke!").color(ChatColor.AQUA).bold(true).create();
  23.  
  24. @Deprecated
  25. public IDGpack(ProxiedPlayer paramProxiedPlayer)
  26. {
  27. this.player = paramProxiedPlayer;
  28. }
  29.  
  30. public final ProxiedPlayer getPlayer()
  31. {
  32. return this.player;
  33. }
  34.  
  35. public final boolean isAuthorized()
  36. {
  37. return this.isAuthorized;
  38. }
  39.  
  40. public final void setAuthorized(boolean paramBoolean)
  41. {
  42. this.isAuthorized = paramBoolean;
  43. }
  44.  
  45. public final boolean isUpToDate()
  46. {
  47. return this.isUpToDate;
  48. }
  49.  
  50. public final void setUpToDate(boolean paramBoolean)
  51. {
  52. this.isUpToDate = paramBoolean;
  53. }
  54.  
  55. public final String getUsername()
  56. {
  57. return this.username;
  58. }
  59.  
  60. public final byte[][] getInterfaces()
  61. {
  62. return this.interfaces;
  63. }
  64.  
  65. public final byte[] getComputerUUID()
  66. {
  67. return this.computerUUID;
  68. }
  69.  
  70. public final String getUuid()
  71. {
  72. return this.uuid;
  73. }
  74.  
  75. public final void setUuid(String paramString)
  76. {
  77. this.uuid = paramString;
  78. }
  79.  
  80. public final BaseComponent[] getKickMessage()
  81. {
  82. if (this.kickMessage == null)
  83. {
  84. if ((this.isAuthorized) && (!this.isUpToDate)) {
  85. return NOT_UP_TO_DATE;
  86. }
  87. return NOT_AUTH;
  88. }
  89. return this.kickMessage;
  90. }
  91.  
  92. public final void setKickMessage(BaseComponent... paramVarArgs)
  93. {
  94. this.kickMessage = paramVarArgs;
  95. }
  96.  
  97. public final int hashCode()
  98. {
  99. return (((((((31 + Arrays.hashCode(this.computerUUID)) * 31 + Arrays.deepHashCode(this.interfaces)) * 31 + (this.isAuthorized ? 1231 : 1237)) * 31 + (this.isUpToDate ? 1231 : 1237)) * 31 + Arrays.hashCode(this.kickMessage)) * 31 + (this.player == null ? 0 : this.player.hashCode())) * 31 + (this.username == null ? 0 : this.username.hashCode())) * 31 + (this.uuid == null ? 0 : this.uuid.hashCode());
  100. }
  101.  
  102. public final boolean equals(Object paramObject)
  103. {
  104. if (this == paramObject) {
  105. return true;
  106. }
  107. if (paramObject == null) {
  108. return false;
  109. }
  110. if (getClass() != paramObject.getClass()) {
  111. return false;
  112. }
  113. paramObject = (IDGpack)paramObject;
  114. if (!Arrays.equals(this.computerUUID, ((IDGpack)paramObject).computerUUID)) {
  115. return false;
  116. }
  117. if (!Arrays.deepEquals(this.interfaces, ((IDGpack)paramObject).interfaces)) {
  118. return false;
  119. }
  120. if (this.isAuthorized != ((IDGpack)paramObject).isAuthorized) {
  121. return false;
  122. }
  123. if (this.isUpToDate != ((IDGpack)paramObject).isUpToDate) {
  124. return false;
  125. }
  126. if (!Arrays.equals(this.kickMessage, ((IDGpack)paramObject).kickMessage)) {
  127. return false;
  128. }
  129. if (this.player == null)
  130. {
  131. if (((IDGpack)paramObject).player != null) {
  132. return false;
  133. }
  134. }
  135. else if (!this.player.equals(((IDGpack)paramObject).player)) {
  136. return false;
  137. }
  138. if (this.username == null)
  139. {
  140. if (((IDGpack)paramObject).username != null) {
  141. return false;
  142. }
  143. }
  144. else if (!this.username.equals(((IDGpack)paramObject).username)) {
  145. return false;
  146. }
  147. if (this.uuid == null)
  148. {
  149. if (((IDGpack)paramObject).uuid != null) {
  150. return false;
  151. }
  152. }
  153. else if (!this.uuid.equals(((IDGpack)paramObject).uuid)) {
  154. return false;
  155. }
  156. return true;
  157. }
  158.  
  159. public final String toString()
  160. {
  161. return String.format("BlazingPackAuthorizationEvent [player=%s, isAuthorized=%s, isUpToDate=%s, username=%s, interfaces=%s, computerUUID=%s, uuid=%s, kickMessage=%s]", new Object[] { this.player, Boolean.valueOf(this.isAuthorized), Boolean.valueOf(this.isUpToDate), this.username, Arrays.toString(this.interfaces), Arrays.toString(this.computerUUID), this.uuid, Arrays.toString(this.kickMessage) });
  162. }
  163. }
Add Comment
Please, Sign In to add comment