Eternal Harvest icon

Eternal Harvest -----

Track and simulate the growth of crops and saplings even offline, with persistent data storage.




- **Improved `onBlockBreak` Event Handling**:
- Updated the `onBlockBreak` event handler in `PlantListener` to include a database existence check before attempting to remove a record. This ensures that only valid records are removed, preventing unnecessary operations and errors.
- **Database Existence Verification**:
- Added logic to fetch the material associated with the block's location from the database using the `getMaterialAtLocation` method.
- If a corresponding record exists in the database, the record is removed using the `recordRemoval` method.
- If no record is found, the plugin logs a debug message, preventing attempts to delete non-existent records.
- **Improved Debugging Information**:
- Enhanced logging for better debugging, including messages when records are successfully removed or when no record is found for the block being broken.

- **Consistent Record Management**:
- Ensured that the same existence check and removal process are used consistently across various block-related events, including block breaks, explosions, and burning events.
- **Code Refactoring**:
- Refactored the event handling methods to reduce redundancy and improve code readability and maintainability.
- Centralized the logic for database checks and record removal to streamline future updates and bug fixes.
This update enhances the reliability and performance of the plugin by ensuring that database operations are only performed when necessary, reducing potential errors and improving overall efficiency.
----------, Aug 17, 2024

Key Changes:
  1. Synchronization and Atomic Counters:
    • Added dbLock to synchronize access to the database.
    • Added activeStatements to track active SQL statements.
  2. Synchronization in Methods:
    • Wrapped database operations within synchronized (dbLock) blocks.
    • Used activeStatements.incrementAndGet() and activeStatements.decrementAndGet() to track active SQL statements.
  3. Waiting Mechanism in vacuumDatabase:
    • Ensured vacuumDatabase waits until no other SQL statements are in progress before proceeding with the VACUUM operation.
This ensures that the VACUUM command only runs when it's safe to do so, avoiding the SQLITE_ERROR.
----------, Aug 3, 2024

EntityExplodeEvent and BlockExplodeEvent: These events are triggered when explosions occur. The event.blockList() method provides a list of blocks affected by the explosion.
handleBlockExplosion method: This method is called for each block affected by the explosion. It performs the same checks and actions as in the onBlockBreak method, ensuring that blocks with growth times are removed from the database.
onBlockBurn Event: This event handler listens for BlockBurnEvent and calls the handleBlockBurn method to handle the block removal.
handleBlockBurn Method: This method performs similar actions as handleBlockExplosion to check if the block has a growth time and then removes it from the database if necessary.
Minor fixes and cleanup
----------, Jul 17, 2024

The newly added code changes, allow the plugin to determine the type of mangrove tree to grow, based on a value specified in a configuration file.
Instead of using a fixed number to decide between tall and regular mangrove trees, the plugin now reads this decision-making number from the config.yml file.
This makes it easy to adjust how often each type of tree appears without changing the code.

Added database Maintenance, to ensure there are no old data or duplications, and a Vacuum to shrink the database file, with configurations inside the config.yml file.
----------, Jul 14, 2024

UPDATED SUPPORT:
Bamboo
Nether Wart
Sweet Berries
Cocoa Beans
Pumpkins
Melons
Kelp
Cactus
Sugar Cane
----------, Jul 14, 2024

Added support for
nether_wart
sweet_berries
cocoa_beans
pumpkin_stems
melon_stems
bamboo
kelp
cherry_sapling
----------, Jul 14, 2024

Resource Information
Author:
----------
Total Downloads: 180
First Release: Jul 13, 2024
Last Update: Aug 17, 2024
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings