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:
Paldiu
2022-04-02 09:00:40 -05:00
parent ffdafda69c
commit 247a2fafc0
18 changed files with 33 additions and 16 deletions

View File

@ -1,6 +1,7 @@
package io.github.simplex.luck.player;
import io.github.simplex.luck.FeelingLucky;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@ -12,6 +13,10 @@ import java.util.List;
import java.util.Map;
public record PlayerHandler(FeelingLucky plugin) implements Listener {
public PlayerHandler {
Bukkit.getServer().getPluginManager().registerEvents(this, plugin);
}
private static final Map<Player, Luck> playerLuckMap = new HashMap<>();
private static final List<Player> markedPlayers = new ArrayList<>();