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

fix for java version 23 #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Remove config
/config/

.idea
.gradle
**/build/
!src/**/build/
Expand Down
13 changes: 13 additions & 0 deletions autonick.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>SPIGOT</platformType>
</autoDetectTypes>
<projectReimportVersion>1</projectReimportVersion>
</configuration>
</facet>
</component>
</module>
13 changes: 13 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>de.jan.autonick.AutoNick</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
Expand Down
16 changes: 5 additions & 11 deletions src/main/java/de/jan/autonick/AutoNick.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
package de.jan.autonick;

import de.jan.autonick.commands.NickCommand;
import de.jan.autonick.config.AutoNickConfiguration;
import de.jan.autonick.database.DatabaseRegistry;
import de.jan.autonick.commands.NickCommand;
import de.jan.autonick.listener.InventoryClickListener;
import de.jan.autonick.listener.PlayerChatListener;
import de.jan.autonick.listener.PlayerInteractListener;
import de.jan.autonick.listener.PlayerJoinListener;
import de.jan.autonick.listener.PlayerQuitListener;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
import de.jan.autonick.listener.*;
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
Expand Down Expand Up @@ -52,9 +46,9 @@ public void onEnable() {
}

/* METRICS */
final int pluginId = 8730;
final Metrics metrics = new Metrics(this, pluginId);
metrics.addCustomChart(new SimplePie("bungeecord", () -> String.valueOf(configuration.isBungeeCord())));
//final int pluginId = 8730;
//final Metrics metrics = new Metrics(this, pluginId);
//metrics.addCustomChart(new SimplePie("bungeecord", () -> String.valueOf(configuration.isBungeeCord())));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import de.jan.autonick.AutoNick;

import java.io.*;
import java.nio.charset.StandardCharsets;

import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
Expand All @@ -18,13 +17,7 @@ public class AutoNickConfiguration {
public AutoNickConfiguration(AutoNick plugin) {
plugin.saveDefaultConfig();

try {
this.configuration = YamlConfiguration.loadConfiguration(
new BufferedReader(new InputStreamReader(new FileInputStream(new File(plugin.getDataFolder(), "config.yml")), StandardCharsets.UTF_8)));
} catch (FileNotFoundException ex) {
ex.printStackTrace();
return;
}
this.configuration = YamlConfiguration.loadConfiguration(new File(plugin.getDataFolder(), "config.yml"));

this.bungeeCord = this.getBoolean("bungeecord");
}
Expand Down