CommonDex 1.0

A common API library for some of my plugins.

  1. Wasabi_Thumbs
    Native Minecraft Version:
    1.16
    Tested Minecraft Versions:
    • 1.16
    CommonDex
    "It's Just Some Stuff" - Somebody

    Package: cx.wasabi.common


    API INFO
    cx.wasabi.common.DeltaTime
    Code (Java):

    public static Long getMillis() throws InstanceMissingException
    // Get the amount of time it took the last tick to complete in ms

    public static float getSeconds() throws InstanceMissingException
    // Get the amount of time it took the last tick to complete in seconds

    public static double getSecondsDouble() throws InstanceMissingException
    // getSeconds() as a more precise double value

    public static float getTPS() throws InstanceMissingException
    // Gets the exact Ticks Per Second currently

    public static int getTPSRounded() throws InstanceMissingException
    // A rounded integer of getTPS()
     
    cx.wasabi.common.InfoPath
    Code (Java):

    public InfoPath(String... pt)
    // Creates an InfoPath using a sequence of strings (eg. "infosection1", "subsection5")

    public ConfigurationSection getSection(Plugin p)
    // Gets the ConfigurationSection attached to this path using the config of the provided plugin.
     
    cx.wasabi.common.PersistentInfo
    Code (Java):

    public PersistentInfo(InfoPath ip)
    // Creates a Persistent Info object using the provided InfoPath (getting/setting from this PersistentInfo object basically simplifies Plugin config calls, see below)

    public ConfigurationSection value()
    // Get the ConfigurationSection this is attached to.

    public boolean hasProperty(String key)
    // Does this config have a set property?

    public Object getProperty(String key)
    // Gets a property by key

    public <T> T getPropertyAssert(String key, Class<T> type)
    // Gets a property and asserts it's type

    public void setProperty(String key, Object value)
    // Sets the property and automatically saves it to plugin config
     
    cx.wasabi.common.QuadUUID [1.16]
    THIS IS ONLY FOR 1.16! IT CONVERTS UUID OBJECTS TO THE NEW "INTEGER ARRAY" FORMAT FROM 1.16
    Code (Java):

    public QuadUUID(int[] components)
    // Creates a QuadUUID object. Mostly an internal function.

    public static QuadUUID fromUUID(UUID input)
    // Creates a QuadUUID object from a regular UUID. More useful than the constructor.

    public UUID toUUID()
    // Returns this QuadUUID's UUID representation.

    public int[] getIntArray()
    // Returns an integer array of length 4 representing a UUID int array.
     
    cx.wasabi.common.TextBanner
    Code (Java):

    public static ItemStack[] test()
    // Returns an ItemStack array of one of every TextBanner (white text, black background)

    public static ItemStack create(char letter, DyeColor background, DyeColor foreground, int count)
    // Creates a TextBanner with the given character written on it (A-Z and 0-9), with a set background/foreground color, and the size of the stack.
     
    cx.wasabi.common.TextureHead [1.16]
    Code (Java):

    public static ItemStack create(String texture)
    // Creates a Player Head with a given texture string (eg. "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTQ3N2UyYzg1ZjUwNDY0MWMwODc5MDMyZTRmZWM4YTI4MWRlNDVhZDQyYmU1NTJkMWRiYzVmNDFmYzM5Y2MyMyJ9fX0=") using the new 1.16 method.