mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
Implement Translatable on CreativeCategory (#7587)
This commit is contained in:
@@ -336,6 +336,85 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
// Paper start - Add villager reputation API
|
||||
diff --git a/src/main/java/org/bukkit/inventory/CreativeCategory.java b/src/main/java/org/bukkit/inventory/CreativeCategory.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/CreativeCategory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/CreativeCategory.java
|
||||
@@ -0,0 +0,0 @@ package org.bukkit.inventory;
|
||||
/**
|
||||
* Represents a category in the creative inventory.
|
||||
*/
|
||||
-public enum CreativeCategory {
|
||||
+public enum CreativeCategory implements net.kyori.adventure.translation.Translatable { // Paper
|
||||
|
||||
/**
|
||||
* An assortment of building blocks including dirt, bricks, planks, ores
|
||||
* slabs, etc.
|
||||
*/
|
||||
- BUILDING_BLOCKS,
|
||||
+ BUILDING_BLOCKS("buildingBlocks"), // Paper
|
||||
/**
|
||||
* Blocks and items typically used for decorative purposes including
|
||||
* candles, saplings, flora, fauna, fences, walls, carpets, etc.
|
||||
*/
|
||||
- DECORATIONS,
|
||||
+ DECORATIONS("decorations"), // Paper
|
||||
/**
|
||||
* Blocks used and associated with redstone contraptions including buttons,
|
||||
* levers, pressure plates, redstone components, pistons, etc.
|
||||
*/
|
||||
- REDSTONE,
|
||||
+ REDSTONE("redstone"), // Paper
|
||||
/**
|
||||
* Items pertaining to transportation including minecarts, rails, boats,
|
||||
* elytra, etc.
|
||||
*/
|
||||
- TRANSPORTATION,
|
||||
+ TRANSPORTATION("transportation"), // Paper
|
||||
/**
|
||||
* Miscellaneous items and blocks that do not fit into other categories
|
||||
* including gems, dyes, spawn eggs, discs, banner patterns, etc.
|
||||
*/
|
||||
- MISC,
|
||||
+ MISC("misc"), // Paper
|
||||
/**
|
||||
* Food items consumable by the player including meats, berries, edible
|
||||
* drops from creatures, etc.
|
||||
*/
|
||||
- FOOD,
|
||||
+ FOOD("food"), // Paper
|
||||
/**
|
||||
* Equipment items meant for general utility including pickaxes, axes, hoes,
|
||||
* flint and steel, and useful enchantment books for said tools.
|
||||
*/
|
||||
- TOOLS,
|
||||
+ TOOLS("tools"), // Paper
|
||||
/**
|
||||
* Equipment items meant for combat including armor, swords, bows, tipped
|
||||
* arrows, and useful enchantment books for said equipment.
|
||||
*/
|
||||
- COMBAT,
|
||||
+ COMBAT("combat"), // Paper
|
||||
/**
|
||||
* All items related to brewing and potions including all types of potions,
|
||||
* their variants, and ingredients to brew them.
|
||||
*/
|
||||
- BREWING;
|
||||
+ BREWING("brewing"); // Paper
|
||||
+ // Paper start
|
||||
+ private final String translationKey;
|
||||
+
|
||||
+ CreativeCategory(String translationKey) {
|
||||
+ this.translationKey = "itemGroup." + translationKey;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @org.jetbrains.annotations.NotNull String translationKey() {
|
||||
+ return this.translationKey;
|
||||
+ }
|
||||
+ // Paper start
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
|
Reference in New Issue
Block a user