Skip to content

DiamondDagger590/Prisma

Repository files navigation

Prisma

Purpose

Prisma is a new plugin that allows for developers to easily hook in and use custom color codes provided from the colors.yml.

The idea behind Prisma is to allow for server owners to easily define new color codes using RGB and Hex codes that they can then use on things such as plugin's language files, provided they hook into prisma

Server Owner Usage

To use Prisma, simply put the jar in your plugins folder, run the server once to generate the colors.yml, and then you are free to add your custom color codes.

This will only work with plugins that hook into Prisma.

You will not be able to assign custom color codes that are currently used by vanilla, such as b, a, 4, l, etc.

At the moment, Prisma only works with chat messages, but we are looking to move that into action bars and other formats in the future.

Developer Implementation

Adding support for Prisma is amazingly easy. All you need to do is place this method in a util class such as a Methods class, and change your player.sendMessage()s to run through this method. This method would provide vanilla and custom color code implementation, and if Prisma is absent, would not break and just use vanilla coloring.

public static void sendMessage(Player player, String message) {

    // Probably want to move this to onEnable and cache the result
    if (Bukkit.getPluginManager().isPluginEnabled("Prisma")) {

        // Send the message to the player
        player.sendMessage(ChatColorProvider.translatePrisma(message));
    }
}

Prisma also provides over 130 colors in an enum called PrismaColor you can use as easily as so

player.sendMessage(PrismaColor.SALMON + "SALMON");

About

A plugin to hook into for support of new RGB color coming in Minecraft 1.16

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages