Hello, virtual farmers! The
FarmingZone version 1.6 update introduces a highly requested feature: the ability to visit other players' farms! This update also includes bug fixes, fully configurable messages, and improvements for a smoother experience. Here’s the full rundown:
New Features
- Command /farm visit [player|open|close]:
- Visit a Farm: Use /farm visit [player] to teleport to another player's farm home point, if visits are enabled.
- Manage Visits: Farm owners can enable or disable visits with /farm visit open or /farm visit close.
- Added a GUI item (slot 13, LIME_DYE for open, GRAY_DYE for closed) to toggle visit permissions easily.
- Visual and sound effects (PORTAL and END_ROD particles, ENTITY_ENDERMAN_TELEPORT sound) for an immersive teleportation experience.
- Permission farmv1.visit added (default: true for all players).
- Fully Configurable Messages:
- All messages sent via player.sendMessage are now configurable in settings.yml, including:
- Error message for farm deletion (error_deleting_farm).
- Notification for being removed from a farm (removed_from_farm).
- Farm creation cancellation (farm_creation_cancelled).
- Manual harvesting in FarmListener (manual_harvest).
- New messages for /farm visit added to settings.yml:
- usage_visit, no_farm_target, no_home_set_target, teleported_to_farm, visit_opened, visit_closed, visits_closed, help_visit.
Bug Fixes
- Fixed playerId Error:
- Resolved an issue in FarmGUIListener.java where playerId was used without being defined. Replaced with player.getUniqueId() in the case 13 block for visit toggling in the GUI.
- Fixed zoneItem Error:
- Corrected an error in FarmCommand.java where zoneItem.setItemMeta(zoneItem) caused a type mismatch. Fixed by using zoneItem.setItemMeta(zoneMeta) for the /farm zone item.
- Removed Hardcoded Messages:
- All previously hardcoded messages in FarmManager.java, ChatListener.java, and FarmListener.java have been moved to settings.yml for full customization.
- Fixed help_delete Description:
- Corrected a typo in settings.yml where help_delete contained incorrect text ("Brasilee0 coins back"). Updated to the correct message.
Improvements
- Database:
- Added the visit_open column (BOOLEAN, default TRUE) to the farms table to persist visit permissions (open/closed).
- Updated saveFarm and loadFarms methods to handle visit_open.
- Enhanced GUI:
- Added an interactive item in the GUI (slot 13) to toggle visit permissions, dynamically switching between LIME_DYE (open) and GRAY_DYE (closed).
- Permissions:
- Added the farmv1.visit permission in plugin.yml to control access to the /farm visit command. Set to default: true for universal access.
- Configurability:
- All messages are now loaded from settings.yml, allowing server administrators to customize text and colors easily.
Update Instructions
- Backup:
- Back up your settings.yml and database (farms.db for SQLite or your MySQL/MariaDB database) before updating.
- Update Files:
- Replace the plugin JAR in the plugins folder with the new version.
- Update settings.yml with the new messages (see provided file or manually add keys like usage_visit, no_farm_target, etc.).
- Update plugin.yml to include the farmv1.visit permission.
- Restart Server:
- Use /stop to restart the server and load the new configuration.
- Check latest.log to ensure the database and messages load without errors.
- Test New Features:
- Create a farm with /farm create test.
- Test /farm visit [player] to visit a farm (ensure visits are enabled).
- Use /farm visit open or /farm visit close to manage farm access.
- Open the GUI with /farm gui and verify the visit toggle item (slot 13).
- Confirm that customized messages in settings.yml display correctly.
Notes
- Compatibility: This version is compatible with Minecraft 1.21 and requires Vault for economy features.
- Customization: Edit settings.yml to tailor messages and colors to your server’s style.
- Known Issues:
- Ensure farm chunks are loaded before using /farm visit to avoid teleportation errors.
- For MySQL/MariaDB users, verify connection details in mysql.yml.
Acknowledgments
A huge thank you to the community for your feedback and suggestions! The farm visit feature was inspired by your requests. Please report any bugs or share new ideas on the Spigot forum or in the plugin’s discussion section.
Happy farming!