Skip to content
Open
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
30 changes: 27 additions & 3 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>kryptonite</artifactId>
<name>Kryptonite</name>
<version>2.0.1</version>
<version>2.1.0-SNAPSHOT</version>
<build>
<resources>
<resource>
Expand All @@ -15,7 +15,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<version>3.14.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand All @@ -40,6 +40,10 @@
<pattern>com.tcoded.folialib</pattern>
<shadedPattern>net.lewmc.kryptonite.lib.folialib</shadedPattern>
</relocation>
<relocation>
<pattern>net.lewmc.foundry</pattern>
<shadedPattern>net.lewmc.kryptonite.lib.foundry</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
Expand All @@ -64,6 +68,16 @@
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>lewmc</id>
<name>LewMC Repository</name>
<url>https://repo.lewmc.net/releases</url>
</repository>
<repository>
<id>lewmc-snapshots</id>
<name>LewMC Repository</name>
<url>https://repo.lewmc.net/snapshots</url>
</repository>
</repositories>
<dependencies>
<dependency>
Expand All @@ -73,8 +87,18 @@
<scope>provided</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>lewmc</id>
<url>https://repo.lewmc.net/releases</url>
</repository>
<snapshotRepository>
<id>lewmc</id>
<url>https://repo.lewmc.net/snapshots</url>
</snapshotRepository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
<pattern>com.tcoded.folialib</pattern>
<shadedPattern>net.lewmc.kryptonite.lib.folialib</shadedPattern>
</relocation>
<relocation>
<pattern>net.lewmc.foundry</pattern>
<shadedPattern>net.lewmc.kryptonite.lib.foundry</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
Expand Down Expand Up @@ -78,6 +82,16 @@
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>lewmc</id>
<name>LewMC Repository</name>
<url>https://repo.lewmc.net/releases</url>
</repository>
<repository>
<id>lewmc-snapshots</id>
<name>LewMC Repository</name>
<url>https://repo.lewmc.net/snapshots</url>
</repository>
</repositories>

<dependencies>
Expand Down Expand Up @@ -110,6 +124,12 @@
<version>0.4.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.lewmc</groupId>
<artifactId>foundry</artifactId>
<version>1.3.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

<distributionManagement>
Expand Down
21 changes: 17 additions & 4 deletions src/main/java/net/lewmc/kryptonite/Kryptonite.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package net.lewmc.kryptonite;

import com.tcoded.folialib.FoliaLib;
import net.lewmc.foundry.FoundryConfig;
import net.lewmc.foundry.Logger;
import net.lewmc.kryptonite.commands.ExploitDBCommand;
import net.lewmc.kryptonite.commands.KryptoniteCommand;
import net.lewmc.kryptonite.commands.OptimiseCommand;
import net.lewmc.kryptonite.event.JoinEvent;
import net.lewmc.kryptonite.utils.CompatablityUtil;
import net.lewmc.kryptonite.utils.LogUtil;
import net.lewmc.kryptonite.utils.UpdateUtil;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
Expand All @@ -18,9 +19,9 @@

public final class Kryptonite extends JavaPlugin {

private final LogUtil log = new LogUtil(this);
private Logger log;
public enum ConfigurationOptions {
SERVER_PROPERTIES,
MINECRAFT,
BUKKIT,
SPIGOT,
PAPER_WORLD,
Expand All @@ -32,9 +33,15 @@ public enum ConfigurationOptions {
public List<ConfigurationOptions> SupportedConfigurations = new ArrayList<>();
public boolean restartRequired = false;
public boolean updatePending = false;
public FoundryConfig foundryConfig;

@Override
public void onEnable() {
this.foundryConfig = new FoundryConfig(this);
this.foundryConfig.setVerbose(this.getConfig().getBoolean("verbose"));
this.foundryConfig.setPluginId("kr");
this.log = new Logger(this.foundryConfig);

this.log.info("");
this.log.info("█▄▀ █▀█ █▄█ █▀█ ▀█▀ █▀█ █▄ █ █ ▀█▀ █▀▀");
this.log.info("█ █ █▀▄ █ █▀▀ █ █▄█ █ ▀█ █ █ ██▄");
Expand Down Expand Up @@ -122,7 +129,7 @@ private void checkSoftware() {

File serverProperties = new File("server.properties");
if (serverProperties.exists()) {
this.SupportedConfigurations.add(ConfigurationOptions.SERVER_PROPERTIES);
this.SupportedConfigurations.add(ConfigurationOptions.MINECRAFT);
supportedConfigs = supportedConfigs + "Server Properties";
}

Expand Down Expand Up @@ -161,6 +168,12 @@ private void checkSoftware() {
this.SupportedConfigurations.add(ConfigurationOptions.PUFFERFISH);
supportedConfigs = supportedConfigs + ", Pufferfish";
}

File leafConfig = new File("config/leaf-global.yml");
if (leafConfig.exists()) {
this.SupportedConfigurations.add(ConfigurationOptions.LEAF);
supportedConfigs = supportedConfigs + ", Leaf";
}
this.log.info("Supported configurations loaded: "+supportedConfigs+".");
}

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/net/lewmc/kryptonite/Metrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

/**
* @deprecated
*/
@Deprecated
public class Metrics {
Comment on lines +49 to 53
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Do not modify bStats Metrics class — revert deprecation

Header explicitly forbids modifications other than package changes. Adding @deprecated may violate bStats requirements.

-/**
- * @deprecated
- */
-@Deprecated
+/* no modifications allowed by bStats other than package */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* @deprecated
*/
@Deprecated
public class Metrics {
/* no modifications allowed by bStats other than package */
public class Metrics {
🤖 Prompt for AI Agents
In src/main/java/net/lewmc/kryptonite/Metrics.java around lines 49 to 53, the
bStats Metrics class was edited to add a @Deprecated annotation and a
deprecation Javadoc; revert those changes so the class matches the original
bStats implementation (remove the @Deprecated annotation and the deprecated
Javadoc), leaving only the allowed package change if that was required, and
ensure no other modifications are present to comply with bStats header
requirements.


private final Plugin plugin;
Expand Down
Loading