Skip to content

Commit

Permalink
finalized v0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonnanto committed Aug 18, 2022
1 parent d0e3855 commit 9bdecc7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 70 deletions.
70 changes: 13 additions & 57 deletions .github/contributing.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,20 @@

# Adding a new language

In order for BasicQuest to support a new language, the `messages.properties` file needs to be translated.
The new file should be named `messages_<language code>.properties`. The file can be found [here](https://github.com/Tonnanto/BasicQuests/blob/basicQuestsPlugin/src/basicQuestsPlugin/resources/messages.properties).
In order for BasicQuest to support a new language, the `messages_en.yml` file needs to be translated.
The new file should be named `messages_<language code>.yml`. The file can be found [here](https://github.com/Tonnanto/BasicQuests/blob/main/src/main/resources/lang/messages_en.yml).

I recommend copy and pasting the contents of the `message.properties` file into the new file, so hints about placeholders are included.
I recommend copy and pasting the contents of the `messages_en.yml` file into the new file.

### Plural forms
Translated minecraft names like items, mobs etc. are automatically downloaded by the plugin. Plural forms are not included though!
There are 3 ways you can handle plural forms of minecraft names in your language file:

1. Use the plural property of the quest title:
There are separate properties for quest title with singular and plural forms.
It is **MANDATORY** to provide singular and plural forms even if they are the same.
The plural form always contains one additional placeholder in comparison to the singular form.
The following example shows how these can be used:
```
# {0} - amount, {1} - material
quest.enchantItem.any.plural = Enchant {0} {1}s
# {0} - material
quest.enchantItem.any.singular = Enchant a {0}
```
2. Default plural forms: For all quest types that use (items/blocks/mobs) there is an **OPTIONAL** property that can be used to format all (items/blocks/entities) of that quest in the same way. The following 6 properties can be used to do that. In this example an "s" is appended to the singular name whenever a plural form is used:
```
quest.killEntity.default.plural = {0}s
quest.breakBlock.default.plural = {0}s
quest.mineBlock.default.plural = {0}s
quest.harvestBlock.default.plural = {0}s
quest.chopWood.default.plural = {0}s
quest.enchantItem.default.plural = {0}s
```

3. Unique plural forms: In some languages certain items require completely unique plural forms. These values can be added with **OPTIONAL** properties of the following format:
```
quest.killEntity.<mob_key>.plural
quest.breakBlock.<item_key>.plural
quest.mineBlock.<item_key>.plural
quest.harvestBlock.<item_key>.plural
quest.chopWood.<item_key>.plural
quest.enchantItem.<item_key>.plural
```
The keys must be lowercase and snake_case.
Hint: Use the same keys that can be found in the [generation files](https://github.com/Tonnanto/BasicQuests/tree/basicQuestsPlugin/src/basicQuestsPlugin/resources/quest_generation) and make them lowercase.


All three approaches can be combined if necessary. The following example shows how all three approaches are used to pluralize kill entity quests in english:
```
# {0} - amount, {1} - entity
quest.killEntity.plural = Kill {0} {1}
# {0} - entity
quest.killEntity.singular = Kill 1 {0}
# {0} - singular entity
quest.killEntity.default.plural = {0}s
quest.killEntity.witch.plural = Witches
quest.killEntity.drowned.plural = Drowned
quest.killEntity.enderman.plural = Endermen
quest.killEntity.sheep.plural = Sheep
```
### Keep in mind:
- Placeholders `{0}`, `{1}`, ... should not be changed! Ask if it is unclear which placeholder contains which value.
- ColorCodes `&a`, `&f`, `&7`, ... should not be changed. If a certain word has been highlighted, try to highlight the same word in your language.
- MineDown Syntax `[...](hover=... run_command=...)` should not be changed.
- Please always use quotation marks `""` for consistency.
- Everything within the `ìtem-plural` sections is optional! This can be used to add unique plural forms of minecraft items names. Feel free to ask if unclear how to use this section.
- You can test your language file by adding its contents to the `custom_messages.yml` file at `plugins/BasicQuests/`.
To include minecraft item names in your language set the `locale` option in the `config.yml` to a locale from this [list](https://minecraft.fandom.com/wiki/Language) (`In-game` Column)

---
### Contact me if there are any questions.
### Create an issue or a pull request to submit your file.
Contact me if there are any questions.
Create an issue or a pull request to submit your file.
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
All notable changes to this project will be documented in this file.

---
## [0.4] - Upcoming
## [0.4] - 2022-08-18

### Added
- New Reload Command
- Localized Quests
- Placeholder `bquests_completed` to show number of completed quests
- Reload Command
- Fully Localized Quests
- Placeholder `%bquests_completed%` to show total number of completed quests

### Changed
- All messages where completely overhauled (Credits to Log1x)
- Messages can now be fully customized within the plugin folder (Credits to Log1x)
- Messages can now be fully customized in the `custom_messages.yml` file (Credits to Log1x)
- Commands redesign
- Permission redesign
- Improved Scoreboard (Can now display Quests with rewards)

### Fixed
- Fixed bug where `quantity-factor` `reward-factor` and `money-factor` would not get read correctly from config.
- Fixed bug where the `max-factor` could be exceeded which lead to huge quantities and rewards in quests.
- Fixed bug where quests would progress if another plugin cancelled the event (like GriefPrevention).
- Fixed bug where quests would progress even though another plugin cancelled the event (like GriefPrevention).


---
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ A plugin for Spigot servers that implements randomly generated basic quests with

## General
Author: Tonnanto
Current Version: 0.3.2
Current Version: 0.4

A **<ins>spigot</ins>** compatible Server is required to run this plugin!

Download the plugin and find the Project Page on [SpigotMC](https://www.spigotmc.org/resources/basicquests.87972/) and [Bukkit](https://dev.bukkit.org/projects/basicquests).


## How it works
Every player is given a set amount of quests initially (default: 3).
You can view your active quests by using `/quests show` or `/quests show rewards`.
When a player completes a quest the reward can be received by clicking the **"Collect Reward"** button in the chat or by using `/quests reward`.
As soon as a quests reward is collected it disappears from the list of quests, and a newly generated quest will be added to the list.
Every player receives an initial amount of quests (default: 3).
You can view your active quests by using `/quests list` or `/quests list rewards`.
When a player completes a quest the reward can be received by clicking the reward button in the chat or by using `/quests reward`.
As soon as a quests reward has been collected the quest disappears from the list, and a newly generated quest will be added.
By default, a player is allowed to skip one quest every 24h by using `/quests skip`.
Some quests require the player to complete an advancement before they can be generated. Quests in the nether for example require the player to have completed the ***"Diamonds!"*** advancement.
Also, newly generated quests will increase in their quantities proportional to the players' playtime on the server: While a new player might receive a quest like ***"Mine 32 Iron Ore"*** a player with lots of playtime on the server would rather receive a quest like this ***"Mine 512 Iron Ore"***.
Expand Down Expand Up @@ -317,6 +317,7 @@ BasicQuests supports the following placeholders:
`%bquests%` A (multiline) list of the players quests (same output as /quests command)
`%bquests_detail%` A (multiline) list of the players quests and rewards (same output as /quests detail command)
`%bquests_count%` The amount of quests the player has
`%bquests_completed%` The amount of quests the player has completed
`%bquests_<index>%` The players quest at the given index
`%bquests_<index>_title%` The title of the players quest at the given index
`%bquests_<index>_progress%` The progress of the players quest at the given index: "1/16" or "Completed!"
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/lang/messages_es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ commands:
none: "No se han encontrado &6misiones&f."
scoreboard:
show: "El ScoreBoard de misiones se ha &aACTIVADO&f."
hide: "El ScoreBoard de misiones se ha &cDESACTIVADO&f."
hide: "El ScoreBoard de misiones se ha &cDESACTIVADO&f."
disabled: "El ScoreBoard esta &cdeshabilitado&f."
reload:
success: "BasicQuests se ha &6recargado&f correctamente."
Expand All @@ -79,7 +79,7 @@ events:
skips-reset: "Los &6saltos de misión&f han sido restablecidos."
received-rewards: "&6{0}&f recibió &6{1, number}&f recompensas de misión."
scoreboard:
title: "&6&m+&8&m &6 Misión &8&m &6&m+"
title: "&6&m+&8&m &6 Misiones &8&m &6&m+"
more: "&7... &6{0}&7 más líneas"
placeholder:
more: "&7+ &6{0}&7 más..."
Expand Down

0 comments on commit 9bdecc7

Please sign in to comment.