Skip to content
This repository was archived by the owner on May 18, 2025. It is now read-only.

Latest commit

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

stngularity's projectbuild

issuespull_requests

What it is?

EpsilonEngine is a text engine built for the Bukkit plugins. It's needed for processing some expressions, for example, placeholders and templates (if and format). But now this project under development. Let you know, it may contain a lot of bugs.

Thank you for taking the time to read this!

Features

  1. Miscellaneous placeholders (static, by time, and a map that can use any type and even placeholders)
  2. Line actions, so far only 1 (ignoreLine). But you can add own actions
  3. Templates. Templates are checks (if/elif/else) and formatting (format). I will add more templates in the future.

How to use?

First, add Sonatype repository to your Maven project:

<repositories>
<repository>
<id>sonatype</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>

Second, add an engine to dependencies of your Maven project:

<dependencies>
<dependency>
<groupId>io.github.stngularity.epsilon</groupId>
<artifactId>engine</artifactId>
<version>0.1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

The version is marked SNAPSHOT because the engine is still under development

Third, use EpsilonEngine class for work with an engine (in example uses Bukkit API):

importorg.bukkit.plugin.java.JavaPlugin;
importorg.bukkit.Bukkit;
importio.github.stngularity.epsilon.engine.EpsilonEngine;
importio.github.stngularity.epsilon.engine.placeholders.Placeholder;
publicclassBeautifulPluginextendsJavaPlugin {
@OverridepublicvoidonEnable() {
EpsilonEngineengine = newEpsilonEngine(); // You can specify custom patterns for any parts of engine in argumentsengine.addPlaceholder(newPlaceholder("plugin.name", getName()));
Bukkit.getConsoleSender().sendMessage(engine.process("Enabled {plugin.name}!"));
// if/elif/elseList.of("owner", "admin", "moder", "unknown").forEach(rank -> {
EpsilonEngineengine = newEpsilonEngine();
engine.addPlaceholder(newPlaceholder("user.rank", rank));
Bukkit.getConsoleSender().sendMessage(engine.process("You're $if[user.rank == 'owner']$owner$elif[user.rank == 'admin']$admin$elif[user.rank == 'moder']$moder$else$user$endif$!"));
});
// format (maxLength, font, format & placeholder)engine.addPlaceholder(newPlaceholder("text", "Hello, hello, hello, hello, hello, hello, hello"));
Bukkit.getConsoleSender().sendMessage(engine.process("Max length (14) & format & placeholder:\n$format[maxLength=14,font=smallcaps,format='' {original} '']${text}$endFormat$"));
}
}

Comment from me

"Reinventing the wheel is fun and educational." — stngularity, 2023 year

"...but still a bad idea" — Egor Bron, 2023 year

"...unless your wheel is better" — Jabka, 2023 year

License

This project is completely open-source and distributed under the MIT license. Read the LICENSE file for more information.

Made with ❤ and 🍵 by stngularity for everyone

About

A text engine built for the Bukkit plugins.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages