Class Utils

java.lang.Object
org.geysermc.floodgate.core.util.Utils

public class Utils extends Object
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • removeHandler

      public static void removeHandler(io.netty.channel.ChannelPipeline pipeline, String handler)
      This method is used in Addons.
      Most addons can be removed once the player associated to the channel has been logged in, but they should also be removed once the inject is removed. Because of how Netty works it will throw an exception and we don't want that. This method removes those handlers safely.
      Parameters:
      pipeline - the pipeline
      handler - the name of the handler to remove
    • readProperties

      public static Properties readProperties(String resourceFile)
      Reads a properties resource file
      Parameters:
      resourceFile - the resource file to read
      Returns:
      the properties file if the resource exists, otherwise null
      Throws:
      AssertionError - if something went wrong while readin the resource file
    • getLocale

      public static String getLocale(Locale locale)
    • getJavaUuid

      public static UUID getJavaUuid(long xuid)
    • getJavaUuid

      public static UUID getJavaUuid(String xuid)
    • fromShortUniqueId

      public static UUID fromShortUniqueId(String uuid)
    • isUniquePrefix

      public static boolean isUniquePrefix(String prefix)
    • generateCode

      public static String generateCode(int length)
    • generateCodeChar

      public static char generateCodeChar()
    • readVarInt

      public static int readVarInt(io.netty.buffer.ByteBuf buffer)
    • getStackTrace

      public static String getStackTrace(Throwable throwable)