Skip to content

Commit

Permalink
* Adjusted the "getTranslatedName" method to allow for durability/dat…
Browse files Browse the repository at this point in the history
…a values for older MineCraft versions.

  - A few more default options have been added to the "lang.yml" since they will be more common for translations.

Signed-off-by: Jeremiah Osborne <[email protected]>
  • Loading branch information
XZot1K committed Jul 21, 2023
1 parent 11b2cfd commit 05637b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/xzot1k/plugins/ds/api/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ EconomyCallEvent initiateShopEconomyTransaction(@NotNull Player investor, @NotNu
* Obtains any translation created for the passed material found in the "lang.yml".
*
* @param material The material to obtain the translation for.
* @param data The durability/data value used in older versions (Optional, defaults to 0).
* @return The translated version.
*/
String getTranslatedName(@NotNull Material material);
String getTranslatedName(Material material, int... data);

/**
* Obtains any translation created for the passed enchantment found in the "lang.yml".
Expand Down
19 changes: 18 additions & 1 deletion src/main/resources/lang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,23 @@ translated-enchantment-names:
# Here is where any material names can be placed and given a translated name that will be used in place for material names (No Item Meta) holograms.
# A list of materials can be found here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
# (Format: <exact material>: <translated name>)
# Optionally :<durability> can be added behind the material name for older MineCraft versions.
translated-material-names:
DIAMOND_SWORD: "Diamond Sword"
RED_WOOL: "Red Wool"
RED_WOOL: "Red Wool"
INK_SACK:0: "Ink Sac"
INK_SACK:1: "Red Dye"
INK_SACK:2: "Green Dye"
INK_SACK:3: "Coca Beans"
INK_SACK:4: "Lapis Lazuli"
INK_SACK:5: "Purple Dye"
INK_SACK:6: "Cyan Dye"
INK_SACK:7: "Light Gray Dye"
INK_SACK:8: "Gray Dye"
INK_SACK:9: "Pink Dye"
INK_SACK:10: "Lime Dye"
INK_SACK:11: "Yellow Dye"
INK_SACK:12: "Light Blue Dye"
INK_SACK:13: "Magenta Dye"
INK_SACK:14: "Orange Dye"
INK_SACK:15: "Bone Meal"

0 comments on commit 05637b8

Please sign in to comment.