mirror of
https://github.com/SimplexDevelopment/FeelingLucky.git
synced 2025-07-04 19:16:41 +00:00
Bug Fix 0001
**Changelog**: - Fixed a bug where the PlayerListener was not being initialized - Included the registration for the listener inside the constructor - Dropped static import in favor of class parent access - Added to the Luck method "setValue(double)" to automatically update the configuration file when called. - Adjusted Luck to utilize all 1024 units when calculating the boolean for rng percentage.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package io.github.simplex.luck;
|
||||
|
||||
import io.github.simplex.luck.listener.PlayerListener;
|
||||
import io.github.simplex.luck.player.PlayerConfig;
|
||||
import io.github.simplex.luck.player.PlayerHandler;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -15,6 +16,7 @@ public final class FeelingLucky extends JavaPlugin {
|
||||
private static final Map<UUID, PlayerConfig> configMap = new HashMap<>();
|
||||
public LuckCMD cmd;
|
||||
public PlayerHandler handler;
|
||||
public PlayerListener playerListener;
|
||||
|
||||
public static Map<UUID, PlayerConfig> getConfigMap() {
|
||||
return configMap;
|
||||
@ -24,8 +26,8 @@ public final class FeelingLucky extends JavaPlugin {
|
||||
public void onEnable() {
|
||||
Bukkit.getLogger().info("Initializing the PlayerHandler...");
|
||||
handler = new PlayerHandler(this);
|
||||
Bukkit.getLogger().info("Initialization complete! Attempting to register the handler...");
|
||||
this.getServer().getPluginManager().registerEvents(handler, this);
|
||||
Bukkit.getLogger().info("Initialization complete! Attempting to register the Listeners...");
|
||||
playerListener = new PlayerListener(this);
|
||||
Bukkit.getLogger().info("Registration complete! Attempting to load all player configuration files...");
|
||||
|
||||
File[] files = getDataFolder().listFiles();
|
||||
|
Reference in New Issue
Block a user