Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Essence 1.8.0 #162

Open
wants to merge 66 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
c77f803
Merge pull request #161 from LewMC/main
lewmilburn Sep 28, 2024
7fac98b
Create CONTRIBUTING.md
lewmilburn Sep 28, 2024
26f8d7b
Update README.md
lewmilburn Sep 28, 2024
69a0a6c
Bump version.
lewmilburn Sep 28, 2024
8cd640e
Add the invisible & visible commands.
Sep 29, 2024
392149f
Merge remote-tracking branch 'source/next-update' into next-update
Sep 29, 2024
663f66c
Update .gitignore and README.md
Sep 29, 2024
3672043
Fix: Update .gitignore to include the out/ directory
Sep 29, 2024
4e4fd5f
Merge pull request #163 from dankfmemes/next-update
lewmilburn Sep 29, 2024
3005be6
Add invisibility permission to essence.admin.*
lewmilburn Sep 29, 2024
0629947
Add invisibility to help menu.
lewmilburn Sep 29, 2024
a520e8e
New translations en-gb.yml (Spanish)
lewmilburn Sep 29, 2024
39bad49
New translations en-gb.yml (Chinese Simplified)
lewmilburn Sep 29, 2024
766d553
New translations en-gb.yml (Romanian)
lewmilburn Sep 29, 2024
cf4cb3c
New translations en-gb.yml (French)
lewmilburn Sep 29, 2024
98b7b54
New translations en-gb.yml (German)
lewmilburn Sep 29, 2024
5b13b17
New translations en-gb.yml (Japanese)
lewmilburn Sep 29, 2024
a985dfc
New translations en-gb.yml (Korean)
lewmilburn Sep 29, 2024
45558fa
New translations en-gb.yml (Portuguese)
lewmilburn Sep 29, 2024
5c28682
New translations en-gb.yml (Turkish)
lewmilburn Sep 29, 2024
a76f2a2
New translations en-gb.yml (Vietnamese)
lewmilburn Sep 29, 2024
5e6f832
New translations en-gb.yml (Bengali)
lewmilburn Sep 29, 2024
8a2f7d8
New translations en-gb.yml (Hindi)
lewmilburn Sep 29, 2024
7711c58
Merge branch 'next-update' into crowdin
lewmilburn Sep 29, 2024
18e8e48
Merge pull request #164 from LewMC/crowdin
lewmilburn Sep 29, 2024
b0fc2e4
Add link to SonarCloud.
lewmilburn Sep 29, 2024
fc2e82b
Merge remote-tracking branch 'origin/next-update' into next-update
lewmilburn Sep 29, 2024
a4cc494
New translations en-gb.yml (Chinese Simplified)
lewmilburn Sep 29, 2024
a1213ed
Refactor MessageUtil to use Adventure API for messaging and improve e…
Sep 29, 2024
b0adb5d
Merge pull request #165 from LewMC/crowdin
lewmilburn Sep 29, 2024
bfa2d2d
Merge pull request #167 from dankfmemes/next-update
lewmilburn Sep 29, 2024
70037ad
Merge pull request #168 from LewMC/main
lewmilburn Sep 29, 2024
45acf2a
Add new MC Plugin test.
lewmilburn Oct 1, 2024
0a2c1f7
Merge remote-tracking branch 'origin/next-update' into next-update
lewmilburn Oct 1, 2024
44f01f8
Add event triggers for workflow.
lewmilburn Oct 1, 2024
2867101
Add jar
lewmilburn Oct 1, 2024
8d24eda
Fix version.
lewmilburn Oct 1, 2024
f9d10aa
Fix jar path.
lewmilburn Oct 1, 2024
8dc41a6
Fix version.
lewmilburn Oct 1, 2024
95192eb
Stopping the test server.
lewmilburn Oct 1, 2024
2bfbe74
Update test server.
lewmilburn Oct 1, 2024
36380d2
Update runner types
lewmilburn Oct 1, 2024
2bfab55
Give the server more time.
lewmilburn Oct 1, 2024
d58969c
Try to fix action.
lewmilburn Oct 1, 2024
5c39d76
Merge pull request #174 from LewMC/main
lewmilburn Oct 1, 2024
5757601
Add in-chat update alerts.
lewmilburn Oct 1, 2024
25a662a
Merge pull request #178 from LewMC/chat-update-alerts
lewmilburn Oct 1, 2024
186a136
New translations en-gb.yml (Spanish)
lewmilburn Oct 1, 2024
7ef17a2
New translations en-gb.yml (Chinese Simplified)
lewmilburn Oct 1, 2024
33d1ffc
New translations en-gb.yml (Romanian)
lewmilburn Oct 1, 2024
721d96e
New translations en-gb.yml (French)
lewmilburn Oct 1, 2024
a3d7289
New translations en-gb.yml (German)
lewmilburn Oct 1, 2024
51df4b4
New translations en-gb.yml (Japanese)
lewmilburn Oct 1, 2024
cbb128c
New translations en-gb.yml (Korean)
lewmilburn Oct 1, 2024
d65fc32
New translations en-gb.yml (Portuguese)
lewmilburn Oct 1, 2024
fc667e5
New translations en-gb.yml (Turkish)
lewmilburn Oct 1, 2024
722c595
New translations en-gb.yml (Vietnamese)
lewmilburn Oct 1, 2024
f09d691
New translations en-gb.yml (Bengali)
lewmilburn Oct 1, 2024
48de8a9
New translations en-gb.yml (Hindi)
lewmilburn Oct 1, 2024
f00eb69
Merge pull request #179 from LewMC/crowdin
lewmilburn Oct 4, 2024
a39ff19
Update workflow.
lewmilburn Oct 4, 2024
1c5d875
Fix for #162
lewmilburn Oct 4, 2024
bda7d75
Remove duplications.
lewmilburn Oct 4, 2024
40efb78
Remove adventure components - breaks bukkit servers.
lewmilburn Oct 4, 2024
f1da748
Performance fix for future updates.
lewmilburn Oct 4, 2024
aa95e01
Add javadoc message.
lewmilburn Oct 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/test_minecraft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Test Plugin

on:
push:
branches:
- main
- next-update
pull_request:
types:
- opened
- reopened
- review_requested]
branches:
- 'main/**'
- 'next-update/**'

jobs:
test-server:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
version: [ "1.20.6", "1.21", "1.21.1" ]
java-version: [21]
include:
- version: "1.20.6"
java-version: 21
- version: "1.21"
java-version: 21
- version: "1.21.1"
java-version: 21

name: Minecraft ${{ matrix.version }}
steps:
- uses: actions/checkout@v4
- name: Setup JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: 'maven'
- name: Build Plugin
run: mvn -B package --file pom.xml
- name: Bukkit ${{ matrix.version }}
uses: GamerCoder215/[email protected]
with:
path: "/home/runner/work/Essence/Essence/target/essence-*.jar"
runtime: 'craftbukkit'
version: ${{ matrix.version }}
time: 120
commands: |
essence
- name: Spigot ${{ matrix.version }}
uses: GamerCoder215/[email protected]
with:
path: "/home/runner/work/Essence/Essence/target/essence-*.jar"
runtime: 'spigot'
version: ${{ matrix.version }}
time: 120
commands: |
essence
- name: Paper ${{ matrix.version }}
uses: GamerCoder215/[email protected]
with:
path: "/home/runner/work/Essence/Essence/target/essence-*.jar"
runtime: 'paper'
version: ${{ matrix.version }}
time: 120
commands: |
essence
- name: Purpur ${{ matrix.version }}
uses: GamerCoder215/[email protected]
with:
path: "/home/runner/work/Essence/Essence/target/essence-*.jar"
runtime: 'purpur'
version: ${{ matrix.version }}
time: 120
commands: |
essence
35 changes: 30 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Project exclude paths
/out/
/target/
/.idea
/out
# Ignore IDE directories
.idea/
.vscode/

# Ignore build directories
target/
out/

# Ignore dependency files generated by Maven
dependency-reduced-pom.xml

# Ignore project files
*.iml

# Ignore logs
*.log

# Ignore temporary files
*.tmp
*.temp
*.bak
*.swp
*.swo

# Ignore OS-specific files
.DS_Store
Thumbs.db

# Miscellaneous
*.user
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "interactive"
}
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Welcome to the Essence Contributor Guide!
Thanks for contributing to Essence! We really appreciate you helping us out.

# What can I do?
We usually have a full list of tasks scheduled for the next update in our [milestones page](https://github.com/LewMC/Essence/milestones).
If this is empty, you can also take a look at our [issues](https://github.com/LewMC/Essence/issues), or add anything else you think would be a good fit!

## Testing
Please ensure you test all your additions in as many ways as you can.
All of our automated tests must pass, and we ask that you go in-game to check they work too.
The way we do it is we try to break it.
Try to make it do things it shouldn't.
That's usually a good indicator to if it works, but every feature is different and you should test it how you see fit.

# Where to Merge
## Bugfixes and features for new updates
If you're adding bugfixes or features, please merge them into the `next-update` branch.
This helps us to ensure that our snapshot builds are labelled as snapshot, so that it is clear to users download them that they are still in development.

## Changes to workflows, templates, etc.
You can merge these either into `next-update` if you'd like to wait until we next push an update for them to be applied, or into `main` if you'd like them to be applied immediately.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
- 💾 **Download Essence** - https://lewmc.net/plugin/essence
- 🔧 **View the JavaDocs** - https://lewmc.github.io/Essence
- 🌐 **Help Translate Essence** - https://crowdin.com/project/lewmc-essence
- 📊 **Code Analysis** - https://sonarcloud.io/project/overview?id=LewMC_Essence
- ⭐ Enjoying Essence? We'd love to hear your feedback on Spigot. Leave us a review [here](https://www.spigotmc.org/resources/essence.114553/).

[![Crowdin](https://badges.crowdin.net/lewmc-essence/localized.svg)](https://crowdin.com/project/lewmc-essence) [![Maven Build](https://github.com/LewMC/Essence/actions/workflows/maven.yml/badge.svg)](https://github.com/LewMC/Essence/actions/workflows/maven.yml)

# Contributing
We welcome contributions from the community. Please fork the repository, make your changes, and submit a pull request.

Please read [our contributor guide](CONTRIBUTING.md) before submitting any changes, thank you!

## Build Process

Install JDK 21 before continuing. Click [here](https://docs.oracle.com/en/java/javase/21/install/index.html) for documentation.
Expand All @@ -26,12 +32,6 @@ mvn clean package -Dmaven.test.skip=true
mvn -B package --file pom.xml -Dmaven.compiler.source=21 -Dmaven.compiler.target=21
```

## Contributing

We welcome contributions from the community. Please fork the repository, make your changes, and submit a pull request.

When adding new features for the next update, please merge them into the `next-update` branch. This helps us keep our CI Builds separate as `-SNAPSHOT` builds.

## Licensing
# Licensing

Essence is licensed under the Apache License 2.0. See [LICENSE](LICENSE) for more information.
8 changes: 4 additions & 4 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>net.lewmc</groupId>
<artifactId>essence</artifactId>
<name>Essence</name>
<version>1.7.2</version>
<version>1.8.0-SNAPSHOT</version>
<build>
<resources>
<resource>
Expand All @@ -30,8 +30,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>11</source>
<target>11</target>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -97,7 +97,7 @@
</dependency>
</dependencies>
<properties>
<java.version>11</java.version>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
1 change: 1 addition & 0 deletions essence.iml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<configuration>
<autoDetectTypes>
<platformType>PAPER</platformType>
<platformType>ADVENTURE</platformType>
</autoDetectTypes>
<projectReimportVersion>1</projectReimportVersion>
</configuration>
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<groupId>net.lewmc</groupId>
<artifactId>essence</artifactId>
<version>1.7.2</version>
<version>1.8.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Essence</name>

<properties>
<java.version>11</java.version>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -37,8 +37,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>11</source>
<target>11</target>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<plugin>
Expand Down
42 changes: 27 additions & 15 deletions src/main/java/net/lewmc/essence/Essence.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ public class Essence extends JavaPlugin {
*/
public List<String> disabledCommands;

/**
* Stores update status.
*/
public boolean hasPendingUpdate = false;

/**
* Manages random numbers.
* Pseudo-random, not to be used in secure contexts.
*/
public Random rand = new Random();

/**
* This function runs when Essence is enabled.
*/
Expand All @@ -94,7 +105,7 @@ public void onEnable() {
this.log.info("███████╗██████╔╝██████╔╝███████╗██║░╚███║╚█████╔╝███████╗");
this.log.info("╚══════╝╚═════╝░╚═════╝░╚══════╝╚═╝░░╚══╝░╚════╝░╚══════╝");
this.log.info("");
this.log.info("Running Essence version "+this.getDescription().getVersion()+ ".");
this.log.info("Running Essence version " + this.getDescription().getVersion() + ".");
this.log.info("Please report any issues with Essence to our GitHub repository: https://github.com/lewmc/essence/issues");
this.log.info("");
this.log.info("Please consider leaving us a review at https://www.spigotmc.org/resources/essence.114553");
Expand Down Expand Up @@ -165,6 +176,7 @@ public void onEnable() {

/**
* Sets up Vault to use Essence's economy.
*
* @return boolean - If it could be setup correctly.
*/
private boolean setupEconomy() {
Expand Down Expand Up @@ -199,7 +211,7 @@ private void checkForPaper() {
this.log.severe("To get full plugin support please consider using Paper instead.");
this.log.severe("You can download it from https://papermc.io");
} else {
this.log.info("Running server jar: "+ this.getServer().getName());
this.log.info("Running server jar: " + this.getServer().getName());
if (this.verbose) {
FoliaLib flib = new FoliaLib(this);
this.log.info("Is Folia: " + flib.isFolia());
Expand All @@ -212,10 +224,7 @@ private void checkForPaper() {
* Checks if Essentials or EssentialsX is installed and disables the plugin if it is.
*/
private void checkForEssentials() {
if (
getServer().getPluginManager().getPlugin("Essentials") != null ||
getServer().getPluginManager().getPlugin("EssentialsX") != null
) {
if (getServer().getPluginManager().getPlugin("Essentials") != null || getServer().getPluginManager().getPlugin("EssentialsX") != null) {
this.log.severe("Essentials is installed alongside Essence.");
this.log.severe("Essence's commands clash with Essentials, this may cause issues later down the line.");
this.log.severe("If you require commands that are in Essentials but not in Essence, please remove Essence from the server.");
Expand All @@ -233,14 +242,14 @@ private void initFileSystem() {

File statsFolder = new File(getDataFolder() + File.separator + "data" + File.separator + "players");
if (!statsFolder.exists() && !statsFolder.mkdirs()) {
log.severe("Unable to make data folder.");
log.warn("The plugin is being disabled, most of the plugin's features will not work without the data folder.");
log.warn("Please create a folder called 'data' in the 'Essence' folder.");
log.warn("Please create a folder called 'players' in the 'data' folder.");
log.warn("Once this is complete, restart the server and Essence will re-enable.");
this.log.info("");
getServer().getPluginManager().disablePlugin(this);
}
log.severe("Unable to make data folder.");
log.warn("The plugin is being disabled, most of the plugin's features will not work without the data folder.");
log.warn("Please create a folder called 'data' in the 'Essence' folder.");
log.warn("Please create a folder called 'players' in the 'data' folder.");
log.warn("Once this is complete, restart the server and Essence will re-enable.");
this.log.info("");
getServer().getPluginManager().disablePlugin(this);
}


File warpsFile = new File(getDataFolder() + File.separator + "data" + File.separator + "warps.yml");
Expand Down Expand Up @@ -270,7 +279,7 @@ private void initFileSystem() {
private void checkLanguageSystem() {
File setLang = new File(getDataFolder() + File.separator + "language" + File.separator + getConfig().getString("language") + ".yml");
if (!setLang.exists()) {
this.log.severe("Language file '"+getConfig().getString("language")+"' does not exist!");
this.log.severe("Language file '" + getConfig().getString("language") + "' does not exist!");
this.log.severe("Please check the file and try again.");
getServer().getPluginManager().disablePlugin(this);
}
Expand Down Expand Up @@ -344,6 +353,9 @@ private void loadCommands() {
this.getCommand("seen").setExecutor(new SeenCommand(this));
this.getCommand("info").setExecutor(new InfoCommand(this));

this.getCommand("invisible").setExecutor(new InvisibleCommand(this));
this.getCommand("visible").setExecutor(new VisibleCommand(this));

this.getCommand("rules").setExecutor(new RulesCommands(this));
} catch (NullPointerException e) {
this.log.severe("Unable to load Essence commands.");
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/lewmc/essence/commands/HelpCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@ public boolean runHelpCommand() {
this.blank(blank);
this.message.send("help", "page", new String[] { "1", "1" });
} else if ("admin".equalsIgnoreCase(args[1])) {
int blank = 6;
int blank = 4;
this.message.send("help", "admin");
if (!cu.isDisabled("info")) { this.message.send("help", "info"); } else { blank++; }
if (!cu.isDisabled("seen")) { this.message.send("help", "seen"); } else { blank++; }
if (!cu.isDisabled("invisible")) { this.message.send("help", "invisible"); } else { blank++; }
if (!cu.isDisabled("visible")) { this.message.send("help", "visible"); } else { blank++; }
this.blank(blank);
this.message.send("help", "page", new String[] { "1", "1" });
} else if ("chat".equalsIgnoreCase(args[1])) {
Expand Down
Loading
Loading