Skip to content

Commit

Permalink
Merge pull request #12 from LewMC/folia-support
Browse files Browse the repository at this point in the history
Add Folia support.
  • Loading branch information
lewmilburn authored May 29, 2024
2 parents b0a1f95 + 373af5d commit bc7eab4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
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

0 comments on commit bc7eab4

Please sign in to comment.