安装和配置 Installation and Configuration
(版本:2018-11-13 翻译:kjiang 原文链接)
Installation
First of all you should install Citizens plugin. You can find it on it's dev.bukkit.org page. It's not required, you can use NPCs made from clay blocks, but that would be less immersive. Download the BetonQuest plugin, place .jar file in your plugins folder and start the server. BetonQuest generated configuration files. If you want to use MySQL for data storage then open config.yml and fill your database informations. If not, just leave these fields blank, the plugin will use SQLite instead. If you don't want to use autoupdater disable it in configuration before restarting the server or reloading the plugin. When you're finished you can reload the plugin (/q reload). Now tweak the configuration to your liking and move on to Quick start tutorial chapter. You don't have to read about commands and permissions just yet, you should undestand how the plugin works first.
Configuration
The configuration of BetonQuest is done mainly in config.yml file. All options are described here. If you don't know about some aspect of BetonQuest you can skip the explanation here. It will be repeated later, in the description of a specific feature.
Do not touch “version” option! It may corrupt your files!
- First is connection data for MySQL database. Fill it to use MySQL, leave it blank (or incorrect) to use SQLite.
- Language is just translation of the plugin. Currently there are 7 available languages, English (en), Polish (pl), German (de), French (fr), Spanish (es), Chinese (cn), Dutch (nl) and Italian (it).
updatesection controls the updater. It has the following settings:enableoption is set to true by default and it controls if the plugin should do anything update-related.download_bugfixescontrols if BetonQuest should automatically update bugfix versions (like 1.7.3 → 1.7.4 or 1.8.1 → 1.8.3).
These versions do not change how the plugin works, they only fix bugs, so it's good to set it totrue.notify_new_releaseoption is responsible for displaying a notification at startup about new releases (like 1.7.6 → 1.8).
These can change how the plugin works by introducing new features and changing existing ones, so they won't be downloaded automatically. You can use/q updatewhen you're ready.- If you're using a development version, there will be a third setting here,
notify_dev_build.
This is the same asnotify_new_releasebut it checks the development builds instead. There are no specific version checking here, so if the found dev number is higher, it will appear. You download development builds on your own responsibility.
default_journal_slotis a number of slot where the journal will appear after using/journalcommand.citizens_npcs_by_namesets if npcs from citizens2 should be identified in main.yml by their name instead of their id.max_npc_distanceis a distance you need to walk away from the NPC for the conversation to end (in case of using chat-based conversation interface).default_conversation_IOis a conversation interface.simpleis a conversation in chat,tellrawis an extension to provide clickable options andchestis a conversation in inventory window. If you want to use chest, but also write the conversation to the players chat usecombined. Other plugins can add additional IO types.display_chat_after_conversationthis will prevent all chat messages from displaying during a conversation and it will show them once it's finished.combat_delayis a delay (in seconds) the player must wait before he can start the conversation after combat.notify_pullbackwill display a message every time the player is pulled back by thestopoption in conversations (in case of chat-based conversations). It notifies players that they are in a conversation and the pullback is not some kind of a bug.default_packageis a name of the package that should be used when you don't specify package in /q command. It's for your convenience.remove_items_after_respawnoption should be turned on if you don't use “keepInventory” gamerule. It prevents other plugins from duplicating quest items after death.
When the player dies, his quest items are removed from drops and stored in the backpack, but some plugins may try to restore all items to the player (for example WorldGuard custom flag keep-inventory). That's why BetonQuest removes the quest items that are in player's inventory after he respawns again, to be sure they were not readded. The “keepInventory” gamerule however works differently - the items are never dropped, so they cannot be added to backpack. Removing them from the inventory would destroy them forever. Sadly, Bukkit does not allow for gamerule checking, so it's up to you to decide. Once again: if you have “keepInventory” gamerule true, this setting has to be false, and vice versa.quest_items_unbreakablecontrolls whenever quest items can be broken by usage. It was used in the past, whenunbreakabletag couldn't be added to items. You can now turn it off and make your quest items unbreakable by vanilla means.- Sounds define what sounds will be played on these occasions:
startandendrefer to starting/ending conversationsjournalis just updating journalupdateis played when there's a changelog file, to draw your attentionfullcan be played when the player uses /j command but his inventory is full.
List of all possible sounds can be found here.
cmd_blacklistis a list of commands that can't be used while in conversation. Remember that you can type here only single words (command names)!hookcontrols compatibility with other plugins. Here you can turn off each hook.journalcontrols various settings of the journal:chars_per_pageis a number of characters before a page break. If you set it too high, the text on a journal page can overflow, becoming invisible. This was replaced bychars_per_lineandlines_per_pageand is only required if you don't like the new behaviour.chars_per_lineis a number of characters before a line break. If you set it too high, the text on a journal page can overflow, becoming invisible. If this isn't set BQ will fall back on the old page wrapping behaviour configured throughchars_per_page.lines_per_pageis a number of lines before a new page. If you set it too high, the text on a journal page can overflow, becoming invisible. Only required ifchars_per_lineis set.one_entry_per_pagewill make each entry take a single page. Note that it won't expand to other pages even if it overflows, so keep your entries short.reversed_ordercontrols the chronological order of entries in the journal. By default the entries are ordered from newest to oldest. You can reverse it, but it will force players to click through a lot of pages to get to the latest entry.hide_datehides the date of each entry. Set it to true if you don't want this functionality.full_main_pagemakes the main page take always a full page. If you display a lot of information you should probably make this true. If you use main page only for small notifications, set it to false, so the entries can follow immediately.show_separatorshows a separator between journal entries (default: true). Customize the separator inmessages.ymlwith the keyjournal_separator.
journal_colorscontrols the colors used in the journal. It takes color codes without the&character.date.dayis a day numberdate.houris a hour numberlineis a delimiter between entriestextis the text of the entry
conversation_colorscontrols the colors of the conversation. It takes color names. If you want to add a font style (bold, italic etc.) you can add it after a comma.npcis the name of the NPCplayeris the name of the playertextis the NPC's textansweris the text of player's answer (after choosing it)numberis the option numberoptionis the text of an option
date_formatis the Java date format used in journal dates. It needs to have a space between the day and hour.debugis responsible for logging plugin's activity to debug.log file in logs directory. You shouldn't turn this on as it can slow your server down. However if you experience any errors turn this on, let the plugin gather the data and send logs to the developer. Note that first run of the plugin will be logged anyway, just as a precaution.
Updating
The updating process is safe and easy. After updating to a new version (manually or automatically) configuration files and database will be automatically backed up to a zip file so you never lose all your work due to an error. Then configuration will be converted to a new version. At the end the localization will be updated with new languages and the changelog.txt file will be created for you.
When you enter the server BetonQuest will alert you about changes and ask you to read changelog.txt file located in plugin's main directory. This way you will be always up to date with every changes made by new versions.
All next versions of BetonQuest should have full compatibility with your current version of the plugin and server. This means that after updating the plugin should work exactly the same way as it did before (except for bugs). The changes will be visible only in configuration format or new features. (For example in 1.5 inverting conditions was done by adding –inverted argument to the instruction. It was changed to the current format (with exclamation marks before the condition name) in 1.6 version. The plugin had updated the configuration files automaticly when switching to the new version, the only problem the user had was getting used to the new (better) way of negating conditions).
If there were any unexpected errors during an update process just download previous version, restore your configs from backup and disable autoupdating feature. Don't forget to post your error so I can fix it!
Backups
Every time the plugin updates the configuration there is a backup created. This is especially important if you use development versions, as they may be unstable. You can also create a backup manually by running /q backup command. It needs to be run from console on empty server, because it heavily uses the database.
You can find your backups in backup directory in plugin's folder. They are .zip files containing all your configuration and database-backup.yml file, which - as the name says - is your database backup. If you want to replace your configuration with an older backup just delete all the files (except backups and logs) and replace them with the files from .zip file.
If you want your database loaded you should also place database-backup.yml file in plugin's directory. When the plugin sees this file while enabling, it will backup the current database and load all data from that file to the database. You can find a backup of old database in backups folder, so if you ever need to load it back, just rename it to database-backup.yml and place it back in main plugin's directory. Note that database-backup.yml file will be deleted after loading, so it doesn't replace your database on next plugin start.
Migrating database from SQLite to MySQL and back
Follow these few simple steps to migrate your database easily:
- Create a backup with /q backup command.
- Extract database backup from it.
- Turn your server off.
- Place the database-backup.yml file inside plugin's directory.
- Edit in configuration which database type you want to use (correct credentials for MySQL, incorrect or empty for SQLite).
- Start the server.
- Check for errors.
- If there are no errors, enjoy your migrated database.
- If there are any errors, post them to the developer or try to fix them if you know how.