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

Add Folia support. #12

Merged
merged 6 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion 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>kryptonite</artifactId>
<name>Kryptonite</name>
<version>1.2.0-SNAPSHOT</version>
<version>1.3.0-SNAPSHOT</version>
<build>
<resources>
<resource>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.lewmc</groupId>
<artifactId>kryptonite</artifactId>
<version>1.2.0</version>
<version>1.3.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Kryptonite</name>
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/net/lewmc/kryptonite/Kryptonite.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public enum Software {
CRAFTBUKKIT,
PAPER,
SPIGOT,
PURPUR, PUFFERFISH
FOLIA,
PURPUR,
PUFFERFISH
}
public Software server = Software.UNKNOWN;

Expand Down Expand Up @@ -87,6 +89,9 @@ private void checkSoftware() {
} else if (this.getServer().getName().equals("Paper")) {
this.server = Software.PAPER;
this.log.info("Detected server jar: Paper.");
} else if (this.getServer().getName().equals("Folia")) {
this.server = Software.FOLIA;
this.log.info("Detected server jar: Folia.");
} else if (this.getServer().getName().equals("Purpur")) {
this.server = Software.PURPUR;
this.log.info("Detected server jar: Purpur.");
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/lewmc/kryptonite/utils/SoftwareUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public boolean isCraftBukkit() {
if (this.plugin.server == Kryptonite.Software.CRAFTBUKKIT) { return true; }
if (this.plugin.server == Kryptonite.Software.SPIGOT) { return true; }
if (this.plugin.server == Kryptonite.Software.PAPER) { return true; }
if (this.plugin.server == Kryptonite.Software.FOLIA) { return true; }
if (this.plugin.server == Kryptonite.Software.PURPUR) { return true; }
if (this.plugin.server == Kryptonite.Software.PUFFERFISH) { return true; }

Expand All @@ -22,6 +23,7 @@ public boolean isCraftBukkit() {
public boolean isSpigot() {
if (this.plugin.server == Kryptonite.Software.SPIGOT) { return true; }
if (this.plugin.server == Kryptonite.Software.PAPER) { return true; }
if (this.plugin.server == Kryptonite.Software.FOLIA) { return true; }
if (this.plugin.server == Kryptonite.Software.PURPUR) { return true; }
if (this.plugin.server == Kryptonite.Software.PUFFERFISH) { return true; }

Expand All @@ -30,6 +32,7 @@ public boolean isSpigot() {

public boolean isPaper() {
if (this.plugin.server == Kryptonite.Software.PAPER) { return true; }
if (this.plugin.server == Kryptonite.Software.FOLIA) { return true; }
if (this.plugin.server == Kryptonite.Software.PURPUR) { return true; }
if (this.plugin.server == Kryptonite.Software.PUFFERFISH) { return true; }

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ commands:
edb:
description: Exploit Database
usage: /<command>
aliases: ['exploit']
aliases: ['exploit']
folia-supported: true
Loading