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
34 changes: 31 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,14 @@
<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>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>net.lewmc.kryptonite.lib.bstats</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
Expand All @@ -64,6 +72,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 +91,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>
26 changes: 25 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
<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>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>net.lewmc.kryptonite.lib.bstats</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
Expand Down Expand Up @@ -78,6 +86,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 All @@ -96,7 +114,7 @@
<dependency>
<groupId>com.tchristofferson</groupId>
<artifactId>ConfigUpdater</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.2</version>
</dependency>
<dependency>
<groupId>de.themoep</groupId>
Expand All @@ -110,6 +128,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
31 changes: 21 additions & 10 deletions src/main/java/net/lewmc/kryptonite/Kryptonite.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
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.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

Expand All @@ -18,9 +20,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 +34,15 @@
public List<ConfigurationOptions> SupportedConfigurations = new ArrayList<>();
public boolean restartRequired = false;
public boolean updatePending = false;
public FoundryConfig foundryConfig;

Check warning on line 37 in src/main/java/net/lewmc/kryptonite/Kryptonite.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make foundryConfig a static final constant or non-public and provide accessors if needed.

See more on https://sonarcloud.io/project/issues?id=LewMC_Kryptonite&issues=AZjxxh1kBlTU0eG3wvjz&open=AZjxxh1kBlTU0eG3wvjz&pullRequest=58

@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 All @@ -45,8 +53,7 @@
this.log.info("Beginning startup...");
this.log.info("");

int pluginId = 21962;
new Metrics(this, pluginId);
new Metrics(this, 21962);

this.initFilesystem();
this.loadCommands();
Expand Down Expand Up @@ -102,8 +109,7 @@

@Override
public void onDisable() {
FoliaLib foliaLib = new FoliaLib(this);
foliaLib.getScheduler().cancelAllTasks();
new FoliaLib(this).getScheduler().cancelAllTasks();
}

/**
Expand All @@ -122,7 +128,7 @@

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,12 +167,17 @@
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+".");
}

private void detectBadPlugins() {
CompatablityUtil compat = new CompatablityUtil(this);
List<String> badPlugins = new java.util.ArrayList<>(compat.badPlugins());
List<String> badPlugins = new java.util.ArrayList<>(new CompatablityUtil(this).badPlugins());

for (String badPlugin : badPlugins) {
this.log.severe("");
Expand Down
Loading
Loading