/bungeeguard-bungee/src/main/java/me/lucko/bungeeguard/bungee/SpoofedLoginResultJava8.java

https://github.com/lucko/BungeeGuard · Java · 49 lines · 16 code · 7 blank · 26 comment · 0 complexity · c0ee28b0fb22a8a50c23f4e8c244e281 MD5 · raw file

  1. /*
  2. * This file is part of BungeeGuard, licensed under the MIT License.
  3. *
  4. * Copyright (c) lucko (Luck) <luck@lucko.me>
  5. * Copyright (c) contributors
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8. * of this software and associated documentation files (the "Software"), to deal
  9. * in the Software without restriction, including without limitation the rights
  10. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. * copies of the Software, and to permit persons to whom the Software is
  12. * furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in all
  15. * copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  23. * SOFTWARE.
  24. */
  25. package me.lucko.bungeeguard.bungee;
  26. import net.md_5.bungee.connection.LoginResult;
  27. import jdk.internal.reflect.Reflection;
  28. public class SpoofedLoginResultJava8 extends SpoofedLoginResult {
  29. // online mode constructor
  30. public SpoofedLoginResultJava8(LoginResult oldProfile, String bungeeGuardToken) {
  31. super(oldProfile, bungeeGuardToken);
  32. }
  33. // offline mode constructor
  34. public SpoofedLoginResultJava8(String bungeeGuardToken) {
  35. super(bungeeGuardToken);
  36. }
  37. @Override
  38. public Property[] getProperties() {
  39. Class<?> caller = Reflection.getCallerClass();
  40. return getSpoofedProperties(caller);
  41. }
  42. }