Players can now choose between buying a ticket with a random number or manually entering a number.
Configuration: allow_custom_numbers enables or disables this option.
Commands:
/lt buyticket or /lt bt buys a random ticket. /lt buyticket <number> or /lt bt <number> allows purchasing a ticket with a custom number, if enabled. Configurable Partial Prizes:
A partial prize system is now available, allowing players to win if they partially match the winning number.
Configuration:
partial_prizes.enabled: Enables or disables partial prizes.
partial_prizes.levels: Defines the matching levels and prize percentages based on the number of matching digits.
Purchased tickets are now saved in the tickets.yml file, allowing ticket data to persist even after a server restart.
Tickets are automatically loaded and saved when the server starts or stops.
Logging Winners in a Log File:
Every time there's a winner, their name, winning ticket number, and prize amount are recorded in a log file (winners.log).
Logged information:
Winner's name.
Winning ticket number.
Prize amount.
Date of the draw.
Minor Adjustments:
Enhanced Messaging System:
Messages related to ticket purchases, prize notifications, and lottery draws have been improved for clarity and are now customizable via the configuration file.
Added the option to display the remaining time for the draw using the boss bar (BossBar).
Bug Fixes:
Fixed Logic for Draws and Partial Prize Distribution: Improved the logic to prevent a player from receiving multiple partial prizes if they already won a higher matching level.
Partial prizes are now distributed correctly according to the configured percentage for each matching level.