mirror of
https://github.com/SimplexDevelopment/FeelingLucky.git
synced 2025-07-05 19:46: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,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<>();
|
||||
|
||||
|
Reference in New Issue
Block a user