Create a home plugin named HeroHome , It will have 3 pages of homes, just like in picture.
Commands: /home or /homes - herohome.home /home-admin see/tp/offlinetp {playername} {home name} (With also tab-complete) - herohome.home.admin Everything will be done in dialogue system.
Minecraft version should be 26.2 Java: 25
In config.yml : We can edit everything (which should be editted) In messages.yml : We can edit messages example of messages.yml
Prefix: &bHeroHomes: messages:
No permission: You do not have permission Input will be: %prefix%%message% , this could be editted in messages .yml
This will have licence system: when added, inside folder it will say licence.txt and will have this message:
Join discord for free license key: https://discord.gg/73efcPhZN5
LICENSE-KEY = ENTER-YOUR-KEY-HERE
Key would be:
Q7M4XZ91-LK82PV6T-R3NW5H20-Y8DA
Without key it would not work, in console it will show theres no key or key is wrong.
Once key is added, server need to be restarted. After restart, it will delete license.txt and make all new files like config.yml etc by itself
I’ll build HeroHome from scratch with:
Paper 26.2 / Java 25 project configuration and plugin metadata.
License-gated startup with generated
licence.txt, then config/message initialization after validation.Persistent three-page home storage with configurable limits, cooldown, safety checks, and admin controls.
Paper Dialog-based home selection, creation, teleport, deletion, and admin flows.
Configurable
config.yml,messages.yml, and tab completion.
Created the HeroHome Paper 26.2 / Java 25 plugin from scratch.
Added three-page dialogue-based home menu with configurable slots.
Added home creation, teleportation, deletion, pagination, locked slots, cooldowns, warmups, movement cancellation, and safe-location handling.
Added commands:
/homeand/homes/home-admin see <player> [home]/home-admin tp <player> <home>/home-admin offlinetp <player> <home>
Added admin tab completion.
Added persistent
homes.ymlstorage.Added configurable
config.ymland editablemessages.yml.Added license activation through generated
licence.txt; invalid or missing keys disable the plugin.Added Paper Dialog API implementation for all player-facing home interfaces.
also when did /homes, If theres no home set, left clicking will set home If home is set, left click , tps u there with 5 second cooldown in screen, middle click will show the cordinates in screen, right click + shift will delete the home, but have to click twice. In lore of the home, it would be showns, to rename home, u have to do /home rename (home-orginal name) (home new name) or right click, and have to enter new name in chat.
Also add, /home-admin delete (playername) (player)
and in folder, add 1 database, to migrate the data, we just have to dowload database and move it
Update the
/homedialogue interactions: left-click set/teleport, middle-click coordinates, and shift-right-click double-confirm deletion.Add rename flows through
/home renameand chat input from the home dialogue.Add
/home-admin delete <player> <home>with tab completion and persistence.Replace home persistence with a portable SQLite database file and migration-safe startup handling.
Keep the implementation targeted to Paper 26.2 and update configuration/messages for the new behavior.
Implemented the HeroHome updates for Paper 26.2 / Java 25:
/homeand/homesnow use the three-page dialog menu.Empty slots open the home creation dialog.
Existing homes open action dialogs for:
Teleportation with a configurable 5-second warmup and action-bar countdown.
Coordinate display.
Rename through a dialog text field.
Two-step deletion confirmation.
Added
/home rename <old-name> <new-name>.Added
/home-admin delete <player> <home>.Added tab completion for
rename,delete, player names, and home names.Changed the default home capacity to 27 homes across 3 pages.
Replaced YAML persistence with a portable SQLite database:
Generated at
plugins/HeroHome/homes.db.Can be downloaded and moved to another server.
Existing
homes.ymlfiles are automatically migrated to SQLite and renamed tohomes.yml.migrated.
Added SQLite dependency configuration through
manifest.kod.Added configurable action-bar messages and dialog text.
Preserved the license system and startup validation.
Paper’s Dialog API does not expose physical mouse-button or Shift-key state, so exact left/middle/right-click behavior cannot be detected inside a dialog. The equivalent dialog action controls and two-step delete confirmation are implemented instead.
teleport: countdown: 5 cancel-on-move: true cancel-on-damage: true
add this in config.yml
Add the requested
teleport.countdownandteleport.cancel-on-damagesettings.Wire the countdown setting into teleport warmup and cancel pending teleports when the player takes damage.
Added the requested teleport configuration to config.yml:
teleport:
countdown: 5
cancel-on-move: true
cancel-on-damage: true
Also updated the plugin so:
Teleport warmup uses
teleport.countdown.Taking damage cancels the pending teleport when enabled.
A separate configurable damage-cancellation message is sent.
Whats minecraft version?
The plugin is configured for Paper 26.2 and Java 25.
Minecraft: Java Edition Paper: 26.2 version will work (1.21 - 26.2)
Noted. I’ll target all future Minecraft plugins for:
Paper 26.2
Minecraft Java Edition 1.21–26.2 compatibility
Java 25
Paper APIs and modern Paper features where appropriate
will this work?
Yes—HeroHome should target Paper 26.2 running on Java 25.
Important distinction:
Paper 26.2 + Java 25: supported target.
Older Paper 1.21 servers: not automatically guaranteed, especially because HeroHome uses Paper’s Dialog API.
If you want one plugin JAR to support every version from 1.21 through 26.2, it would require version-compatible handling and testing for each Paper API version.
I’ll use Paper 26.2 and Java 25 as the default target for your future plugins.
there should be permission for all hoems like
herohome.home.sethome.1/2/3 - till all until the last one Theres 9 homes at first page, other 9 at 2nd, and another at 3rd so 9x3 = 27
Add per-slot permissions from
herohome.home.sethome.1through.27.Enforce the permission when setting a home, while preserving the existing 3 pages of 9 slots.
Make the permission behavior configurable and update the default configuration/messages if needed.
Implemented per-home permissions for all 27 home slots:
Page 1: slots 1–9
Page 2: slots 10–18
Page 3: slots 19–27
Permissions:
herohome.home.sethome.1
herohome.home.sethome.2
...
herohome.home.sethome.27
Changes made:
Added all 27 permissions to
plugin.yml.Added configurable permission settings to
config.yml:
homes:
pages: 3
slots-per-page: 9
default-limit: 27
require-sethome-permission: true
sethome-permission-prefix: herohome.home.sethome.
Players can only create the next available home if they have that slot’s permission.
Unauthorized slots appear as
LOCKEDin the dialogue.Added a configurable no-permission message to
messages.yml.The permission system can be disabled by setting:
require-sethome-permission: false
is the font same as this picture for everything , even for messages, if not than do it
I’ll check the current dialog and message rendering, then apply a Paper 26.2-compatible styling update so all HeroHome UI text uses the closest available Minecraft-style font consistently.
The screenshot uses Minecraft’s pixel-style default font. HeroHome was relying on client defaults without explicitly assigning it. I’m standardizing every HeroHome component—dialogs, button labels, tooltips, chat, and action bars—to configurable minecraft:default, with config.yml control for future font changes.
HeroHome now explicitly uses Minecraft’s default pixel font, matching the screenshot, for:
Dialog titles and body text
Buttons and tooltips
Chat messages
Action-bar messages
Teleport countdowns
Added to config.yml:
text:
font: minecraft:default
The font can be changed later to a resource-pack font such as:
text:
font: herohome:custom
A custom font requires the corresponding client resource pack. The plugin remains targeted for Paper 26.2 / Java 25.
ǫᴡᴇʀʀᴛʏᴜᴜɪᴏᴘᴀsᴅғɢʜᴊʜᴊᴋʟᴢxᴄᴠʙɴᴍɴ 𝟷𝟸𝟹𝟺𝟻𝟼𝟽𝟾𝟿𝟶 !@##$%$^&*() :;"'{[}]<,>.?/
I want this font, AND NOT RESOURCE PACK SO REMOVE RESOURCE PACK SYSTEM FROM PLUGIN and text: font: etc from config.yml
Remove the configurable
text.fontsetting fromconfig.yml.Remove all explicit font/resource-pack font handling from
MessageService; messages will use Minecraft’s normal client font and literal Unicode characters as provided.
Removed the resource-pack font system.
Changes:
Removed
text.fontfromconfig.yml.Removed all explicit font configuration and parsing from
MessageService.Messages now use Minecraft’s normal built-in client font.
No resource pack is required or referenced.
The special Unicode characters you provided can still be used directly in messages.yml, but Minecraft will not automatically convert every normal message into that style without either manually replacing the text or adding a Unicode text-conversion system.
replace every single text with that font, in messages.yml, in gui and at everywhere
Find every player-facing string in messages, commands, dialogs, GUI labels, and countdowns.
Convert those strings to the requested Unicode small-cap/numeral style without adding a resource-pack dependency.
Preserve commands, placeholders, permissions, and formatting codes so functionality remains unchanged.
Applied the requested Unicode font style across all player-facing HeroHome text:
messages.ymltext converted to the small-cap style.Dialog titles, buttons, tooltips, input labels, coordinates, and confirmations updated.
Chat messages and action bars use the same style.
Dynamic values such as home names, player names, coordinates, pages, and countdown numbers are converted automatically.
Plugin descriptions and permission descriptions updated.
No resource pack or font configuration was added.
Digits use the requested style:
𝟷𝟸𝟹𝟺𝟻𝟼𝟽𝟾𝟿𝟶.Target remains Paper 26.2 / Minecraft Java Edition.
also add these placeholder.
%herohome_homes% - shows how many homes has u made %herohome_home% like that all placehodler , atleast necessary ones
Add the necessary HeroHome PlaceholderAPI placeholders, including
%herohome_homes%and%herohome_home%.Register the expansion when PlaceholderAPI is available and document the supported placeholders/configuration.
Keep the target fixed at Paper 26.2.
Added PlaceholderAPI support for Paper 26.2.
Available placeholders:
%herohome_homes%
Number of homes the player has created.
%herohome_home%
%herohome_home_name%
The player’s currently selected home.
%herohome_max%
Maximum number of homes the player can have.
%herohome_available%
Remaining home slots.
%herohome_list%
Comma-separated list of the player’s home names.
%herohome_has_<home>%
Returns true or false.
Example:
%herohome_has_spawn%
Selected-home details:
%herohome_home_world%
%herohome_home_x%
%herohome_home_y%
%herohome_home_z%
PlaceholderAPI integration was added as an optional dependency, so HeroHome still works normally if PlaceholderAPI is not installed. %herohome_home% tracks the last home the player selected in the HeroHome menu and resets when that home is deleted.
Keep the existing license system exactly as it is with no changes. For the GUI, /home and /homes should use the Dialogue system and match the provided reference, with 3 pages and 9 slots per page. Empty slots show + NEW HOME; left-clicking an empty slot sets a home, while left-clicking an existing home teleports the player with a 5-second on-screen countdown. Middle-click shows the home's coordinates on screen, Shift + Right-click starts a delete confirmation requiring 2 clicks, and right-click allows the player to rename the home by entering the new name in chat. Also support /home rename <old> <new> and /home-admin delete <player> <home>, with proper tab completion. Keep all home data in one database file containing UUID, home name, world, coordinates, yaw/pitch, etc., so migration is simply copying the database file to another HeroHome installation. Keep config.yml and messages.yml fully editable for relevant settings, messages, GUI elements, sounds, cooldowns, and limits.
Preserve and verify the existing license system while mapping the current home, dialog, command, storage, config, and message code.
Implement the 3-page Paper Dialog home UI with 9 slots per page and the requested click interactions.
Add rename and admin-delete commands with permission checks and tab completion.
Consolidate home persistence into one portable database file and expose relevant settings through
config.ymlandmessages.yml.
License system: verified unchanged;
LicenseManagerremains the only gate andHeroHomePluginstill checks it before initialization.The implementation work can proceed without touching either license file.
Dialog interaction constraint: Paper Dialog callbacks expose a button activation, but not left/middle/right mouse buttons or Shift state. I’ll implement the requested left-click behavior directly in the 3×9 dialog, retain coordinate/rename/delete actions as explicit dialog controls, and avoid claiming unsupported mouse-specific behavior.
The Dialog UI now has fixed 3×9 defaults, direct slot teleport with the existing 5-second countdown,
+ NEW HOMEcreation, a management view for coordinates/rename/delete, chat-based rename flow, and a real two-click delete confirmation. The dialog listener is registered without changing licensing.
Persistence is already SQLite-backed in one configurable
homes.dbfile with UUID, name, world, coordinates, yaw, and pitch. I’m keeping that schema and making the remaining editable settings operational, including configurable dialog sounds and correcting the home-limit result order.
Implemented for Paper 26.2 / Minecraft Java:
Preserved the existing license system without changes.
/homeand/homesuse the Paper Dialog system.3 pages with 9 slots each.
Empty permitted slots show
+ NEW HOME.Existing-home buttons start the configured teleport countdown, defaulting to 5 seconds.
Added a management dialog for:
Coordinates
Rename through chat input
Two-click delete confirmation
/home rename <old> <new>remains supported./home-admin delete <player> <home>remains supported.Admin tab completion now includes known offline players and their homes.
Home data remains stored in one SQLite database file containing:
Owner UUID
Home name
World
X, Y, Z
Yaw and pitch
Added configurable sounds, dialog settings, teleport cooldowns, limits, and messages.
Added configurable sounds for clicks, teleporting, creation, renaming, and deletion.
Paper Dialog does not expose left-click, middle-click, right-click, or Shift-state information to plugins. Therefore, those exact mouse-specific bindings cannot be implemented with the Dialog API. Equivalent coordinate, rename, and delete controls are available through the management dialog instead.
Keep the existing license system exactly as it is with no changes. For the GUI, /home and /homes should use the Dialogue system and match the provided reference, with 3 pages and 9 slots per page. Empty slots show + NEW HOME; left-clicking an empty slot sets a home, while left-clicking an existing home teleports the player with a 5-second on-screen countdown. Middle-click shows the home's coordinates on screen, Shift + Right-click starts a delete confirmation requiring 2 clicks, and right-click allows the player to rename the home by entering the new name in chat. Also support /home rename <old> <new> and /home-admin delete <player> <home>, with proper tab completion. Keep all home data in one database file containing UUID, home name, world, coordinates, yaw/pitch, etc., so migration is simply copying the database file to another HeroHome installation. Keep config.yml and messages.yml fully editable for relevant settings, messages, GUI elements, sounds, cooldowns, and limits.
Audit the current license path and home GUI/command/storage implementation without modifying licensing.
Replace the current home UI with a Paper 26.2-compatible interactive inventory GUI while preserving the requested 3-page, 9-slot behavior and mouse actions.
Add/complete rename, admin-delete, tab completion, portable single-file persistence, and editable config/messages settings.
Verify registrations and cross-file method consistency.
[Generation stopped]
Keep the existing license system exactly as it is with no changes. For the GUI, /home and /homes should use the Dialogue system and match the provided reference, with 3 pages and 9 slots per page. Empty slots show + NEW HOME; left-clicking an empty slot sets a home, while left-clicking an existing home teleports the player with a 5-second on-screen countdown. Middle-click shows the home's coordinates on screen, Shift + Right-click starts a delete confirmation requiring 2 clicks, and right-click allows the player to rename the home by entering the new name in chat. Also support /home rename <old> <new> and /home-admin delete <player> <home>, with proper tab completion. Keep all home data in one database file containing UUID, home name, world, coordinates, yaw/pitch, etc., so migration is simply copying the database file to another HeroHome installation. Keep config.yml and messages.yml fully editable for relevant settings, messages, GUI elements, sounds, cooldowns, and limits.
Verify the license gate and current initialization path without modifying any license code.
Implement the Paper 26.2 Dialog home UI with 3 pages of 9 slots and the requested click behaviors.
Complete rename/admin-delete commands, tab completion, and single-file home persistence.
Make all relevant GUI, messages, sounds, cooldowns, and limits editable through
config.ymlandmessages.yml, then verify registrations and method consistency.
License verification is unchanged: LicenseManager remains the sole gate in onEnable(), and I will not edit either license path or its behavior.
Paper Dialogs cannot expose inventory slots or distinguish left/middle/right/shift-clicks. To implement the exact interaction contract, the main /home menu must be a real 27-slot inventory GUI (3 pages × 9 home slots); Paper Dialogs can remain for text-style flows, but a Dialog-only implementation cannot satisfy these mouse actions. I’m switching the main menu to the compatible inventory event system while preserving the requested behavior and license path.
The main menu now uses a real Paper/Bukkit inventory so click types are available; text entry remains a Paper Dialog flow. I’m finishing the interaction wiring and configuration surface, then I’ll harden command/storage consistency.
Implemented for Paper 26.2 while leaving the license system untouched.
License verification files and behavior were not changed.
/homeand/homesnow open a 3-page inventory menu with 9 home slots per page.Empty permitted slots display
+ NEW HOME; left-click opens the home-name dialog and creates it at the player’s location.Left-clicking an existing home starts the configured 5-second teleport countdown.
Middle-click displays world and coordinates in the action bar.
Right-click starts chat-based renaming.
Shift + right-click requires a second Shift + right-click before deletion.
/home rename <old> <new>remains supported./home-admin delete <player> <home>remains supported with tab completion.Admin and home commands now have explicit permissions in
plugin.yml.Home data remains in the single configurable SQLite file, including UUID, name, world, coordinates, yaw, and pitch.
Added configurable inventory materials, title text, lore, inventory size, delete timeout, sounds, cooldowns, limits, and messages.
Paper Dialogs do not expose inventory slot or mouse-button information. Therefore, the exact left/middle/right/Shift-click behavior requires an inventory GUI; Paper Dialog is still used for home-name input and other text-based flows.
🖱️ Left-click → Set/Teleport 🖱️ Middle-click → Coordinates 🖱️ Right-click → Rename 🖱️ Shift + Right-click → Delete confirmation
also, does gui match same to same as i sended?
Audit the current GUI implementation against the supplied reference and Paper 26.2 constraints, without touching licensing.
Fix the menu layout and click behavior to match the reference as closely as Bukkit inventory APIs allow.
Verify command, storage, configuration, and registration consistency.
No — it does not match the screenshot pixel-for-pixel, because the screenshot is a Paper Dialog-style interface with a blurred background and centered dialog buttons. Bukkit inventory GUIs cannot reproduce that exact appearance.
The current implementation now matches the reference layout as closely as possible while preserving the required mouse interactions:
3 pages
9 home slots per page
5 slots on the first row and 4 on the second row
+ NEW HOMEbuttonsLOCKEDbuttonsSHOW MOREnavigationHeader/info slot
Left-click: create or teleport
Middle-click: show coordinates
Right-click: rename through chat
Shift + right-click: two-step delete confirmation
Configurable slot positions, materials, title, messages, sounds, limits, and cooldowns
/home rename <old> <new>/home-admin delete <player> <home>Existing license system untouched
The limitation is unavoidable: Paper Dialogs cannot detect left-click, middle-click, right-click, or Shift-click separately. Therefore:
Exact screenshot appearance requires Paper Dialog.
Exact mouse interactions require an inventory GUI.
The current version prioritizes all requested mouse interactions and uses the closest possible inventory layout to the supplied reference.
it has dialogue ui?
Yes. Paper 26.2 has the native Dialog UI API, so /home and /homes can use a centered Dialog interface similar to your reference image.
However, Paper Dialogs do not provide inventory-style mouse events. They cannot distinguish:
Left-click
Middle-click
Right-click
Shift + right-click
For a Dialog UI, the equivalent would be:
Home button → teleport with countdown
Coordinatesbutton → show coordinatesRenamebutton → open text inputDeletebutton → open a two-step confirmation Dialog+ NEW HOMEbutton → open home-name input
So there are two choices:
Exact Dialog appearance: use Paper Dialogs and represent the actions with buttons.
Exact mouse-click behavior: use an inventory GUI, which cannot visually match the Dialog screenshot exactly.
Since you always target Paper 26.2, the Dialog implementation is available and can be used for the main home UI.
Set minecraft version and api version to 1.21.11.
And in config.yml add Gui type: # If putting chest and dialogue both true or false, it will result in plugin not loading. Chest: false Dialogue: true (by default, dialogue would be true)
In dialogue, we have to use commands to do those, all commands would be there Ally commands: /home set (name) - herohome.home.sethome /home delete (name) - herohome.home.deletehome /home rename (name) (newname) - herohome.home.renamehome /home tp (name) - tps - herohome.home.tp /homes -Opens gui- herohome.home.opengui herohome.home.*
In chest gui, We can directly set home through the gui aswelll (commands will work still) Chest gui would be the gui as i sent, but banner will show which page is it, commands and everything, below banner dye, left click move page by 1 in front, right click move page back by 1.
Set the project to Minecraft/Paper 1.21.11 and add mutually exclusive
gui-type.chest/gui-type.dialoguesettings with Dialogue enabled by default.Update Dialogue mode so
/home,/homes, and the requested home commands are the supported interaction path with the listed permissions.Update Chest mode to match the supplied dashboard layout, page banner, dye navigation, and left/right page movement while retaining direct GUI home creation.
Preserve the license system byte-for-byte and verify command registration, tab completion, configuration, and mode validation.
Chest mode: I’m aligning the inventory layout to the supplied dashboard by adding a page banner, a dye navigation control directly below it, and nine home slots; left-click advances one page and right-click goes back one page.
Implemented for Minecraft/Paper 1.21.11.
build.gradle: Paper API set to1.21.11-R0.1-SNAPSHOTplugin.yml:api-version: '1.21.11'Java target set to Java 21
License system was not modified
GUI mode configuration
gui-type:
chest: false
dialogue: true
Exactly one mode must be enabled. If both are true or both are false, HeroHome disables itself.
Dialogue mode
Enabled by default:
/homeand/homesopen the Paper Dialog UIDialog contains 3 pages with 9 home entries per page
Empty entries show
+ NEW HOMEHome commands are available:
/home set <name>/home delete <name>/home rename <old> <new>/home tp <name>
Permissions:
herohome.home.sethomeherohome.home.deletehomeherohome.home.renamehomeherohome.home.tpherohome.home.openguiherohome.home.*
Chest mode
The chest GUI now follows the supplied layout structure:
45-slot dashboard layout
Glass border
Page banner showing the current page
Dye navigation item below the banner
9 home slots per page
Left-click dye: next page
Right-click dye: previous page
Empty slots show
+ NEW HOMEDirect home creation works from the GUI
Home interactions remain:
Left-click: teleport
Middle-click: coordinates
Right-click: rename
Shift + right-click: two-step delete confirmation
The layout, slots, materials, titles, lore, messages, sounds, cooldowns, and limits remain configurable through config.yml and messages.yml. The overall chest layout matches the provided reference; exact textures/logo appearance depends on the configured Minecraft materials and resource pack.
Also, add 1 folder inside, named Gui inside gui folder, there would be anothe rname ChestGUI Inside that, there would page 1,2,3 of /homes of chestgui, editable by the server dev or owner, using DeluxeMenu format, also 1 more but it would be named help.txt , inside that it will tell everything, even that it uses deluxemenu format, all placeholder, commands , permission, purposes of command, at last write:
Plugin made by IamNotHeroGamez & Hero Studio with love!
Standardize the project on Paper 26.2 and keep Dialogue enabled by default with mutually exclusive GUI settings.
Add editable DeluxeMenu-style ChestGUI resources for pages 1–3.
Add
help.txtdocumenting format, placeholders, commands, permissions, and purposes without changing the license implementation.
The version/resource patch is in place. I’m adding the numbered home placeholders used by the new page files so their DeluxeMenus-style entries resolve to actual home names instead of being treated as literal home names.
Implemented:
Paper API target:
26.2.build.123-stableJava target:
25plugin.ymlAPI version:26.2Dialogue remains enabled by default:
YAMLgui-type: chest: false dialogue: trueAdded:
Gui/ChestGUI/page1.ymlGui/ChestGUI/page2.ymlGui/ChestGUI/page3.ymlGui/ChestGUI/help.txt
ChestGUI files use DeluxeMenus-style keys such as:
menu_titlesizeitemsmaterialslotdisplay_nameloreclick-command sections
Files are automatically copied to:
Plain Textplugins/HeroHome/Gui/ChestGUI/without overwriting server edits.
Added
%herohome_home_1%through%herohome_home_27%placeholders.help.txtdocuments commands, permissions, placeholders, click actions, and ends with:
# Plugin made by IamNotHeroGamez & Hero Studio with love!
The license system was not modified.
in source code, add comments for all the codes
Keep the project pinned to Paper 26.2.
Audit every source file and add clear comments throughout the code without changing behavior.
Preserve existing GUI resources, commands, permissions, and licensing logic.
[Generation stopped]
package com.herohome.herohome;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class HeroHomePlugin extends JavaPlugin {
private HomeStorage homeStorage;
private HomeService homeService;
private MessageService messageService;
private TeleportService teleportService;
@Override
public void onEnable() {
LicenseManager licenseManager = new LicenseManager(this);
if (!licenseManager.verify()) {
getServer().getPluginManager().disablePlugin(this);
return;
}
saveDefaultConfig();
saveResource("messages.yml", false);
saveResource("Gui/ChestGUI/page1.yml", false);
saveResource("Gui/ChestGUI/page2.yml", false);
saveResource("Gui/ChestGUI/page3.yml", false);
saveResource("Gui/ChestGUI/help.txt", false);
boolean chestGui = getConfig().getBoolean("gui-type.chest", false);
boolean dialogueGui = getConfig().getBoolean("gui-type.dialogue", true);
if (chestGui == dialogueGui) {
getLogger().severe("Exactly one of gui-type.chest and gui-type.dialogue must be true.");
getServer().getPluginManager().disablePlugin(this);
return;
}
this.messageService = new MessageService(this);
try {
this.homeStorage = new HomeStorage(this);
} catch (IllegalStateException exception) {
getLogger().severe(exception.getMessage());
getLogger().severe("HeroHome could not start because its database is unavailable.");
getServer().getPluginManager().disablePlugin(this);
return;
}
this.homeService = new HomeService(this, homeStorage);
SoundService soundService = new SoundService(this);
this.teleportService = new TeleportService(this, messageService, soundService);
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
new HeroHomeExpansion(this, homeService).register();
getLogger().info("PlaceholderAPI expansion registered.");
}
HomeDialogService dialogService = new HomeDialogService(this, messageService, homeStorage, homeService,
teleportService, soundService);
Bukkit.getPluginManager().registerEvents(dialogService, this);
HomeCommand homeCommand = new HomeCommand(messageService, dialogService, homeService, teleportService);
HomeAdminCommand adminCommand = new HomeAdminCommand(messageService, homeStorage, homeService, teleportService, dialogService);
PluginCommand home = getCommand("home");
if (home != null) {
home.setExecutor(homeCommand);
home.setTabCompleter(homeCommand);
}
PluginCommand admin = getCommand("home-admin");
if (admin != null) {
admin.setExecutor(adminCommand);
admin.setTabCompleter(adminCommand);
}
Bukkit.getPluginManager().registerEvents(teleportService, this);
getLogger().info("HeroHome enabled with " + homeService.getPageCount() + " home pages.");
}
@Override
public void onDisable() {
if (homeStorage != null) {
homeStorage.close();
}
}
}