Rebrand : remplace le package/groupId fr.northblue par fr.votenetwork
Projet destine a etre open source, plus aucune reference a "NorthBlue" dans le code, les artifactId Maven ou les config par defaut. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
8c69a0dc9a
commit
394267ca5a
@@ -1,17 +0,0 @@
|
||||
package fr.northblue.vote.spigot.api;
|
||||
|
||||
public final class NorthBlueVoteAPIHolder {
|
||||
|
||||
static volatile NorthBlueVoteAPI INSTANCE;
|
||||
|
||||
private NorthBlueVoteAPIHolder() {
|
||||
}
|
||||
|
||||
public static void set(NorthBlueVoteAPI api) {
|
||||
INSTANCE = api;
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
INSTANCE = null;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.northblue.vote.spigot;
|
||||
package fr.votenetwork.spigot;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package fr.northblue.vote.spigot;
|
||||
package fr.votenetwork.spigot;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
@@ -8,9 +8,9 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class VoteConfig {
|
||||
|
||||
private final NorthBlueVoteSpigot plugin;
|
||||
private final VoteNetworkSpigot plugin;
|
||||
|
||||
public VoteConfig(NorthBlueVoteSpigot plugin) {
|
||||
public VoteConfig(VoteNetworkSpigot plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class VoteConfig {
|
||||
}
|
||||
|
||||
public String getMysqlDatabase() {
|
||||
return cfg().getString("mysql.database", "northblue");
|
||||
return cfg().getString("mysql.database", "votenetwork");
|
||||
}
|
||||
|
||||
public String getMysqlUser() {
|
||||
+16
-16
@@ -1,19 +1,19 @@
|
||||
package fr.northblue.vote.spigot;
|
||||
package fr.votenetwork.spigot;
|
||||
|
||||
import fr.northblue.vote.spigot.api.NorthBlueVoteAPI;
|
||||
import fr.northblue.vote.spigot.api.NorthBlueVoteAPIHolder;
|
||||
import fr.northblue.vote.spigot.api.NorthBlueVoteAPIImpl;
|
||||
import fr.northblue.vote.spigot.command.ClaimCommand;
|
||||
import fr.northblue.vote.spigot.command.VoteAdminCommand;
|
||||
import fr.northblue.vote.spigot.listener.VoteMessageListener;
|
||||
import fr.northblue.vote.spigot.storage.MySqlPendingVoteStore;
|
||||
import fr.northblue.vote.spigot.storage.PendingVoteStore;
|
||||
import fr.northblue.vote.spigot.storage.YamlPendingVoteStore;
|
||||
import fr.northblue.vote.spigot.voteparty.VoteParty;
|
||||
import fr.votenetwork.spigot.api.VoteNetworkAPI;
|
||||
import fr.votenetwork.spigot.api.VoteNetworkAPIHolder;
|
||||
import fr.votenetwork.spigot.api.VoteNetworkAPIImpl;
|
||||
import fr.votenetwork.spigot.command.ClaimCommand;
|
||||
import fr.votenetwork.spigot.command.VoteAdminCommand;
|
||||
import fr.votenetwork.spigot.listener.VoteMessageListener;
|
||||
import fr.votenetwork.spigot.storage.MySqlPendingVoteStore;
|
||||
import fr.votenetwork.spigot.storage.PendingVoteStore;
|
||||
import fr.votenetwork.spigot.storage.YamlPendingVoteStore;
|
||||
import fr.votenetwork.spigot.voteparty.VoteParty;
|
||||
import org.bukkit.plugin.ServicePriority;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class NorthBlueVoteSpigot extends JavaPlugin {
|
||||
public class VoteNetworkSpigot extends JavaPlugin {
|
||||
|
||||
public static final String CHANNEL = "votenetwork:vote";
|
||||
|
||||
@@ -48,9 +48,9 @@ public class NorthBlueVoteSpigot extends JavaPlugin {
|
||||
getCommand("claim").setExecutor(new ClaimCommand(this, voteConfig, pendingVoteStore, voteParty, maintenanceState));
|
||||
getCommand("vote").setExecutor(new VoteAdminCommand(this, voteConfig, pendingVoteStore, maintenanceState));
|
||||
|
||||
NorthBlueVoteAPI api = new NorthBlueVoteAPIImpl(this, voteConfig, pendingVoteStore, voteParty, maintenanceState);
|
||||
NorthBlueVoteAPIHolder.set(api);
|
||||
getServer().getServicesManager().register(NorthBlueVoteAPI.class, api, this, ServicePriority.Normal);
|
||||
VoteNetworkAPI api = new VoteNetworkAPIImpl(this, voteConfig, pendingVoteStore, voteParty, maintenanceState);
|
||||
VoteNetworkAPIHolder.set(api);
|
||||
getServer().getServicesManager().register(VoteNetworkAPI.class, api, this, ServicePriority.Normal);
|
||||
|
||||
getLogger().info("VoteNetwork (Spigot) demarre.");
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class NorthBlueVoteSpigot extends JavaPlugin {
|
||||
@Override
|
||||
public void onDisable() {
|
||||
getServer().getServicesManager().unregisterAll(this);
|
||||
NorthBlueVoteAPIHolder.clear();
|
||||
VoteNetworkAPIHolder.clear();
|
||||
|
||||
if (voteParty != null) {
|
||||
voteParty.save();
|
||||
+7
-7
@@ -1,17 +1,17 @@
|
||||
package fr.northblue.vote.spigot.api;
|
||||
package fr.votenetwork.spigot.api;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* API publique NorthBlueVote, pour affichage scoreboard / GUI par d'autres plugins.
|
||||
* API publique VoteNetwork, pour affichage scoreboard / GUI par d'autres plugins.
|
||||
*
|
||||
* Recuperation :
|
||||
* NorthBlueVoteAPI api = NorthBlueVoteAPI.get();
|
||||
* VoteNetworkAPI api = VoteNetworkAPI.get();
|
||||
* ou via le ServicesManager Bukkit :
|
||||
* RegisteredServiceProvider<NorthBlueVoteAPI> rsp = Bukkit.getServicesManager().getRegistration(NorthBlueVoteAPI.class);
|
||||
* RegisteredServiceProvider<VoteNetworkAPI> rsp = Bukkit.getServicesManager().getRegistration(VoteNetworkAPI.class);
|
||||
*/
|
||||
public interface NorthBlueVoteAPI {
|
||||
public interface VoteNetworkAPI {
|
||||
|
||||
/** Compteur VoteParty actuel sur CE serveur (thread principal uniquement). */
|
||||
int getVotePartyCurrentVotes();
|
||||
@@ -28,7 +28,7 @@ public interface NorthBlueVoteAPI {
|
||||
*/
|
||||
void getPendingVotes(UUID playerUuid, Consumer<Integer> callback);
|
||||
|
||||
static NorthBlueVoteAPI get() {
|
||||
return NorthBlueVoteAPIHolder.INSTANCE;
|
||||
static VoteNetworkAPI get() {
|
||||
return VoteNetworkAPIHolder.INSTANCE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package fr.votenetwork.spigot.api;
|
||||
|
||||
public final class VoteNetworkAPIHolder {
|
||||
|
||||
static volatile VoteNetworkAPI INSTANCE;
|
||||
|
||||
private VoteNetworkAPIHolder() {
|
||||
}
|
||||
|
||||
public static void set(VoteNetworkAPI api) {
|
||||
INSTANCE = api;
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
INSTANCE = null;
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -1,24 +1,24 @@
|
||||
package fr.northblue.vote.spigot.api;
|
||||
package fr.votenetwork.spigot.api;
|
||||
|
||||
import fr.northblue.vote.spigot.MaintenanceState;
|
||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
||||
import fr.northblue.vote.spigot.VoteConfig;
|
||||
import fr.northblue.vote.spigot.storage.PendingVoteStore;
|
||||
import fr.northblue.vote.spigot.voteparty.VoteParty;
|
||||
import fr.votenetwork.spigot.MaintenanceState;
|
||||
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||
import fr.votenetwork.spigot.VoteConfig;
|
||||
import fr.votenetwork.spigot.storage.PendingVoteStore;
|
||||
import fr.votenetwork.spigot.voteparty.VoteParty;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class NorthBlueVoteAPIImpl implements NorthBlueVoteAPI {
|
||||
public class VoteNetworkAPIImpl implements VoteNetworkAPI {
|
||||
|
||||
private final NorthBlueVoteSpigot plugin;
|
||||
private final VoteNetworkSpigot plugin;
|
||||
private final VoteConfig config;
|
||||
private final PendingVoteStore pendingVoteStore;
|
||||
private final VoteParty voteParty;
|
||||
private final MaintenanceState maintenanceState;
|
||||
|
||||
public NorthBlueVoteAPIImpl(NorthBlueVoteSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore,
|
||||
public VoteNetworkAPIImpl(VoteNetworkSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore,
|
||||
VoteParty voteParty, MaintenanceState maintenanceState) {
|
||||
this.plugin = plugin;
|
||||
this.config = config;
|
||||
+8
-8
@@ -1,10 +1,10 @@
|
||||
package fr.northblue.vote.spigot.command;
|
||||
package fr.votenetwork.spigot.command;
|
||||
|
||||
import fr.northblue.vote.spigot.MaintenanceState;
|
||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
||||
import fr.northblue.vote.spigot.VoteConfig;
|
||||
import fr.northblue.vote.spigot.storage.PendingVoteStore;
|
||||
import fr.northblue.vote.spigot.voteparty.VoteParty;
|
||||
import fr.votenetwork.spigot.MaintenanceState;
|
||||
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||
import fr.votenetwork.spigot.VoteConfig;
|
||||
import fr.votenetwork.spigot.storage.PendingVoteStore;
|
||||
import fr.votenetwork.spigot.voteparty.VoteParty;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
@@ -13,13 +13,13 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class ClaimCommand implements CommandExecutor {
|
||||
|
||||
private final NorthBlueVoteSpigot plugin;
|
||||
private final VoteNetworkSpigot plugin;
|
||||
private final VoteConfig config;
|
||||
private final PendingVoteStore pendingVoteStore;
|
||||
private final VoteParty voteParty;
|
||||
private final MaintenanceState maintenanceState;
|
||||
|
||||
public ClaimCommand(NorthBlueVoteSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore,
|
||||
public ClaimCommand(VoteNetworkSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore,
|
||||
VoteParty voteParty, MaintenanceState maintenanceState) {
|
||||
this.plugin = plugin;
|
||||
this.config = config;
|
||||
+7
-7
@@ -1,9 +1,9 @@
|
||||
package fr.northblue.vote.spigot.command;
|
||||
package fr.votenetwork.spigot.command;
|
||||
|
||||
import fr.northblue.vote.spigot.MaintenanceState;
|
||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
||||
import fr.northblue.vote.spigot.VoteConfig;
|
||||
import fr.northblue.vote.spigot.storage.PendingVoteStore;
|
||||
import fr.votenetwork.spigot.MaintenanceState;
|
||||
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||
import fr.votenetwork.spigot.VoteConfig;
|
||||
import fr.votenetwork.spigot.storage.PendingVoteStore;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
@@ -12,12 +12,12 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
public class VoteAdminCommand implements CommandExecutor {
|
||||
|
||||
private final NorthBlueVoteSpigot plugin;
|
||||
private final VoteNetworkSpigot plugin;
|
||||
private final VoteConfig config;
|
||||
private final PendingVoteStore pendingVoteStore;
|
||||
private final MaintenanceState maintenanceState;
|
||||
|
||||
public VoteAdminCommand(NorthBlueVoteSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore, MaintenanceState maintenanceState) {
|
||||
public VoteAdminCommand(VoteNetworkSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore, MaintenanceState maintenanceState) {
|
||||
this.plugin = plugin;
|
||||
this.config = config;
|
||||
this.pendingVoteStore = pendingVoteStore;
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
package fr.northblue.vote.spigot.listener;
|
||||
package fr.votenetwork.spigot.listener;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
||||
import fr.northblue.vote.spigot.VoteConfig;
|
||||
import fr.northblue.vote.spigot.voteparty.VoteParty;
|
||||
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||
import fr.votenetwork.spigot.VoteConfig;
|
||||
import fr.votenetwork.spigot.voteparty.VoteParty;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
@@ -23,7 +23,7 @@ public class VoteMessageListener implements PluginMessageListener {
|
||||
|
||||
@Override
|
||||
public void onPluginMessageReceived(String channel, Player receivingPlayer, byte[] message) {
|
||||
if (!channel.equals(NorthBlueVoteSpigot.CHANNEL)) {
|
||||
if (!channel.equals(VoteNetworkSpigot.CHANNEL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
+6
-6
@@ -1,9 +1,9 @@
|
||||
package fr.northblue.vote.spigot.storage;
|
||||
package fr.votenetwork.spigot.storage;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
||||
import fr.northblue.vote.spigot.VoteConfig;
|
||||
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||
import fr.votenetwork.spigot.VoteConfig;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
@@ -18,13 +18,13 @@ import java.util.function.IntConsumer;
|
||||
|
||||
public class MySqlPendingVoteStore implements PendingVoteStore {
|
||||
|
||||
private static final String DRIVER_CLASS = "fr.northblue.vote.libs.mysql.cj.jdbc.Driver";
|
||||
private static final String DRIVER_CLASS = "fr.votenetwork.libs.mysql.cj.jdbc.Driver";
|
||||
|
||||
private final NorthBlueVoteSpigot plugin;
|
||||
private final VoteNetworkSpigot plugin;
|
||||
private final VoteConfig config;
|
||||
private HikariDataSource dataSource;
|
||||
|
||||
public MySqlPendingVoteStore(NorthBlueVoteSpigot plugin, VoteConfig config) {
|
||||
public MySqlPendingVoteStore(VoteNetworkSpigot plugin, VoteConfig config) {
|
||||
this.plugin = plugin;
|
||||
this.config = config;
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fr.northblue.vote.spigot.storage;
|
||||
package fr.votenetwork.spigot.storage;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.function.BiConsumer;
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package fr.northblue.vote.spigot.storage;
|
||||
package fr.votenetwork.spigot.storage;
|
||||
|
||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
||||
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
@@ -26,7 +26,7 @@ public class YamlPendingVoteStore implements PendingVoteStore {
|
||||
private final File file;
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
|
||||
public YamlPendingVoteStore(NorthBlueVoteSpigot plugin) {
|
||||
public YamlPendingVoteStore(VoteNetworkSpigot plugin) {
|
||||
this.file = new File(plugin.getDataFolder(), "pending-votes.yml");
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
package fr.northblue.vote.spigot.voteparty;
|
||||
package fr.votenetwork.spigot.voteparty;
|
||||
|
||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
||||
import fr.northblue.vote.spigot.VoteConfig;
|
||||
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||
import fr.votenetwork.spigot.VoteConfig;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@@ -11,12 +11,12 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class VoteParty {
|
||||
|
||||
private final NorthBlueVoteSpigot plugin;
|
||||
private final VoteNetworkSpigot plugin;
|
||||
private final VoteConfig config;
|
||||
private final File storageFile;
|
||||
private final AtomicInteger currentVotes = new AtomicInteger(0);
|
||||
|
||||
public VoteParty(NorthBlueVoteSpigot plugin, VoteConfig config) {
|
||||
public VoteParty(VoteNetworkSpigot plugin, VoteConfig config) {
|
||||
this.plugin = plugin;
|
||||
this.config = config;
|
||||
this.storageFile = new File(plugin.getDataFolder(), "voteparty.yml");
|
||||
@@ -1,5 +1,5 @@
|
||||
name: votenetwork
|
||||
main: fr.northblue.vote.spigot.NorthBlueVoteSpigot
|
||||
main: fr.votenetwork.spigot.VoteNetworkSpigot
|
||||
version: ${project.version}
|
||||
api-version: 1.18
|
||||
author: VoteNetwork
|
||||
|
||||
Reference in New Issue
Block a user