Class EditorClient

java.lang.Object
com.hypixel.hytale.builtin.asseteditor.EditorClient
All Implemented Interfaces:
PermissionHolder

public class EditorClient extends Object implements PermissionHolder
Since:
2021/03/29
  • Constructor Details

    • EditorClient

      public EditorClient(String language, @Nonnull PlayerAuthentication auth, PacketHandler packetHandler)
    • EditorClient

      public EditorClient(String language, UUID uuid, String username, PacketHandler packetHandler)
    • EditorClient

      @Deprecated public EditorClient(@Nonnull PlayerRef playerRef)
      Deprecated.
      Creates a mock EditorClient object wrapping a Player. This should not be used by any new code.
      Parameters:
      playerRef - The player
  • Method Details

    • getLanguage

      public String getLanguage()
    • setLanguage

      public void setLanguage(String language)
    • getUuid

      public UUID getUuid()
    • getUsername

      public String getUsername()
    • getAuth

      @Nullable public PlayerAuthentication getAuth()
    • getPacketHandler

      public PacketHandler getPacketHandler()
    • tryGetPlayer

      @Nullable public PlayerRef tryGetPlayer()
    • hasPermission

      public boolean hasPermission(@Nonnull String id)
      Description copied from interface: PermissionHolder
      Whether their attached permissions contains the id. This will also attempt to find wildcard matches.

      For example, if their permissions contain "hytale.*", the check "hytale.permission-test" will return true.

      If they have the root "*" permission, all returns will be true.
      Specified by:
      hasPermission in interface PermissionHolder
      Parameters:
      id - the permission.
      Returns:
      true if they have the permission, false otherwise.
    • hasPermission

      public boolean hasPermission(@Nonnull String id, boolean def)
      Description copied from interface: PermissionHolder
      Determines whether the associated instance has the given permission.
      Specified by:
      hasPermission in interface PermissionHolder
      Parameters:
      id - The identifier of the permission.
      def - The default value to return if the player does not have the permission.
      Returns:
      true if they have the permission, false otherwise.
    • hasPermission

      public boolean hasPermission(@Nonnull PermissionQuery query)
      Description copied from interface: PermissionHolder
      Determines whether the associated instance has the given permission.

      A holder that resolves permissions itself should override this, because a lookup built once and reused costs an order of magnitude less than one built for each check.

      Specified by:
      hasPermission in interface PermissionHolder
      Parameters:
      query - The lookup for the permission.
      Returns:
      true if they have the permission, false otherwise.
    • hasPermission

      public boolean hasPermission(@Nonnull PermissionQuery query, boolean def)
      Specified by:
      hasPermission in interface PermissionHolder
      Parameters:
      query - The lookup for the permission.
      def - The default value to return if nothing decides.
      Returns:
      true if they have the permission, false otherwise.
      See Also:
    • sendPopupNotification

      public void sendPopupNotification(AssetEditorPopupNotificationType type, @Nonnull Message message)
    • sendSuccessReply

      public void sendSuccessReply(int token)
    • sendSuccessReply

      public void sendSuccessReply(int token, @Nullable Message message)
    • sendFailureReply

      public void sendFailureReply(int token, @Nonnull Message message)