A super simple system for easily creating messages and putting them in in a file, whilst also being able to add replacements without struggle.

Overview

✉️ Solyze's Message System

A super simple system for easily creating messages and putting them in in a file, whilst also being able to add replacement values without struggle. Please remember: Give constructive feedback, not negative feedback. There are probably a million things to improve, and I am aware of that.

💻 Usage

It's really easy. You could probably figure it out yourself by just having a look at the example plugin. But I will be explaining anyways.

  • Copy the classes in the source code to your own project. (Obviously change the Main class of your project to follow the same process as in the MainClass.java class)
  • Follow the code in the ExampleCommand.java class and you will understand it. Indented code

ExampleCommand.java

package io.github.solyze.solyzemessagesystem;

import io.github.solyze.solyzemessagesystem.message.Message;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

import java.util.Arrays;

/**
 * @author Solyze
 *
 * You are free to use this in any of your
 * projects, credit would be appreciated though,
 * just leave the javadoc in each class please.
 */
public class ExampleCommand implements CommandExecutor {

    // We get an instance of the Main class.
    MainClass plugin;

    /**
     * A constructor to set the string that
     * must be typed to execute the command.
     *
     * You can make commands in your own way, this
     * is just how I like to do it. Looks clean.
     */
    public ExampleCommand() {
        /*
        We set ("activate") the instance,
        making sure it is not null.
         */
        plugin = MainClass.getInstance();
        /*
        We set the string that must be typed
        for the command to be executed.
        Making the command /example.
         */
        plugin.getCommand("example").setExecutor(this);
    }

    /**
     * Reminder: The format for the message
     * replacements can be changed in
     * @see Message
     *
     * By default, it will be {%count%}.
     */
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        /*
        We send a test STRING message to the sender.

        The process:
        - We create a new Message passing in a path, and a String.
        - We add 2 replacements, which will be:
            - {0}: very cool
            - {1}: don't you agree
        - We send it to the CommandSender. (You can alternatively send it to a Player)

        NOTE: You can also call getString() to get the String without sending it.
         */
        new Message("testMessage", "&fThis is a &b{0} &ftest &b{1}&f?")
                .withReplacement("very cool")
                .withReplacement("don't you agree")
                .send(sender); // You can alternatively use .send(CommandSender, long) to add a delay.

        /*
        We send a test STRINGLIST message to the sender.

        The process:
        - We create a new Message passing in a path, and a StringList.
        - We add 3 replacements, which will be:
            - {0}: amazing
            - {1}: duper
            - {2}: are you with me
        - We send it to the CommandSender. (You can alternatively send it to a Player)

        NOTE: You can also call getList() to get the StringList without sending it.
         */
        new Message("testList", "&fThis is an &b{0}&f, super &b{1}", "&fcool list &b{2}&f?")
                .withReplacement("amazing")
                .withReplacement("duper")
                .withReplacement("are you with me")
                .send(sender); // You can alternatively use .send(CommandSender, long) to add a delay.

        return false;
    }
}
testMessage: '&fThis is a &b{0} &ftest &b{1}&f?'
testList:
- '&fThis is an &b{0}&f, super &b{1}'
- '&fcool list &b{2}&f?'

Ingame Example

🤖 Contribute

Contact me on Discord (@Solyze#3343) if you want to contribute to the system. You can also send me suggestions there if you want to, I'd appreciate it! Please remember: I do not accept friend requests before you've sent a message, so make sure to send a message before friend adding me so I realize what's going on (I get a lot of random friend requests out of nowhere, which kind of sketches me out).

Contributors (Currently empty):

Name Contribution
Insert name here Insert contribution here

📜 TO-DO

Feature Status
Send messages with a delay Complete
You might also like...

Crackersanimator is a particle system library that works with the standard Android UI

Crackersanimator is a particle system library that works with the standard Android UI

Crackersanimator is a particle system library that works with the standard Android UI. This library build from https://github.com/plattysoft/Leonids library but make some update to support for latest version of android.

Jun 14, 2022

TChart Simple and fast charts

TChart Simple and fast charts

TChart Simple and fast charts. Current version Beta 0.9.1 Preview Import jitpack.io gradle allprojects

Sep 20, 2022

⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations

⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations

⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Android UI library made by @Ramotion

Dec 27, 2022

Simple, server side api for drawing on maps with runtime only state and no id collisions

Simple, server side api for drawing on maps with runtime only state and no id collisions! It can be used in non-main/server threads for better performance/more fps.

Sep 2, 2022

A lightweight, simple FTP server. Pure Java, no dependencies.

MinimalFTP A lightweight, simple FTP server. Pure Java, no libraries. Features Although it's named "minimal", it supports a bunch of features: 100% Ja

Jan 5, 2023

Simple API, Complex Emails (JavaMail smtp wrapper)

Simple Java Mail Simple Java Mail is the simplest to use lightweight mailing library for Java, while being able to send complex emails including CLI s

Jan 5, 2023

A simple music player bot for Discord in Java

Delete Discord A simple music player bot for Discord in Java Usage Let's start by running the .jar

Sep 30, 2021

A simple ping plugin for amazing people.

SimplisticPing Download: https://github.com/LoJoSho/SimplisticPing/releases Paper Forum Post: https://forums.papermc.io/threads/simplisticping-a-ping-

Jan 9, 2022

Gleam is a simple Scheme language interpreter written in Java.

Gleam Scheme Interpreter (c) 2001-2020 Guglielmo Nigri (guglielmonigri at yahoo.it, googlielmo at gmail.com) Gleam comes with ABSOLUTELY NO WARRANTY.

Jun 6, 2022
Owner
Solyze
Minecraft server owner, developer & builder.
Solyze
Java Notes & Codes for better understanding and it contains all the funtions with examples and also added Cheat Sheet for Revision

Java Notes & Codes for better understanding and it contains all the funtions with examples and also added Cheat Sheet for Revision...

Ujjawal Singh 1 Nov 30, 2022
An in-memory file system for Java 7+

Jimfs Jimfs is an in-memory file system for Java 7 and above, implementing the java.nio.file abstract file system APIs. Getting started The latest rel

Google 2.2k Jan 3, 2023
A simple file sharing program

FileSharing A simple file sharing program How to use Place all the files to be shared in /html/files (symbolic links work).

AK 3 May 13, 2021
Masterful Machinery is a mod about creating customisable and complex multiblocks machines.

Masterful Machinery Masterful Machinery is a mod about creating customisable and complex multiblocks machines. Everything in the mod is customisable w

null 23 Nov 12, 2022
Cordova plugin for Android Serial USB communication (easily connect an Arduino board to an Android device).

PR-DC cordova-plugin-serialusb Cordova plugin for Android Serial USB communication. This plugin makes a connection to the external board trivial, for

PR-DC 3 May 8, 2022
A small program to allow you to easily generate fabric mods

FabricModGenerator A small program to allow you to easily generate fabric mods. Most of the code was taken from GeneratorFabricMod and TemplateMakerFa

Aaron 2 Mar 3, 2022
Serverless Reference Architecture for Real-time File Processing

Serverless Reference Architecture: Real-time File Processing The Real-time File Processing reference architecture is a general-purpose, event-driven,

AWS Samples 436 Oct 7, 2022
ONLINE DYNAMIC UNIVERSITY VOTING SYSTEM

WEVOTE ONLINE DYNAMIC UNIVERSITY VOTING SYSTEM Online university voting system is developed as a web-based application using html for front-end design

null 3 May 7, 2021
Leveraging Java 8, create an API with a multi-tier user system.

Project 0 Description Leveraging Java 8, create an API with a multi-tier user system. You may choose the actual use case for your application as long

null 1 Jan 9, 2022
This is a Blog & Report System with Java, JSP, AJAX

Blog-Report-System-in-Java This is a Blog & Report System with Java, JSP, AJAX Java project based on JDBC, JSP, Java Servlet & Server Deployment Proje

Muhammad Asad 5 Feb 2, 2022