From 8f7696cdb5be77aa1ac331ded0f1dbbbf90569e9 Mon Sep 17 00:00:00 2001 From: Sn0wStorm Date: Sun, 12 Apr 2020 22:21:17 +0200 Subject: [PATCH] Implemented Custom Model Data issue #246 --- resources/config/v12/de/config.yml | 13 ++++++-- resources/config/v12/en/config.yml | 13 ++++++-- resources/config/v12/fr/config.yml | 13 ++++++-- resources/config/v12/it/config.yml | 13 ++++++-- resources/config/v13/de/config.yml | 13 ++++++-- resources/config/v13/en/config.yml | 13 ++++++-- resources/config/v13/fr/config.yml | 13 ++++++-- resources/config/v13/it/config.yml | 13 ++++++-- resources/config/v13/zh/config.yml | 13 ++++++-- src/com/dre/brewery/BIngredients.java | 4 +++ src/com/dre/brewery/Brew.java | 24 ++++++++++++++ src/com/dre/brewery/filedata/BConfig.java | 3 +- .../dre/brewery/recipe/BCauldronRecipe.java | 10 ++++++ src/com/dre/brewery/recipe/BRecipe.java | 33 +++++++++++++++++++ 14 files changed, 172 insertions(+), 19 deletions(-) diff --git a/resources/config/v12/de/config.yml b/resources/config/v12/de/config.yml index 47c7db5..5b9da71 100644 --- a/resources/config/v12/de/config.yml +++ b/resources/config/v12/de/config.yml @@ -124,6 +124,7 @@ customItems: # -- Zutaten im Kessel -- # Hier kann angegeben werden welche Zutaten in den Kessel getan werden können und was mit ihnen geschieht. +# Es braucht nur etwas hier eingetragen werden falls der Basistrank besondere Eigenschaften wie Name und Farbe haben soll # name: Name des Basistrankes der aus dem Kessel kommt (Farbcodes möglich: z.b. &6) # ingredients: Auflistung von 'Material/Anzahl' @@ -134,6 +135,7 @@ customItems: # Benutzbare Farben: DARK_RED, RED, BRIGHT_RED, ORANGE, PINK, BLUE, CYAN, WATER, GREEN, BLACK, GREY, BRIGHT_GREY # Oder RGB Farben (Hex: also zB '99FF33') (Ohne #) (mit '') (Einfach nach "HTML color" im Internet suchen) # lore: Auflistung von zusätzlichem Text auf dem Trank. (Farbcodes möglich: z.b. &6) + # customModelData: Custom Model Data Modelldaten. Mit dieser Zahl kann die Tranktextur mit einem Resourcepack geändert werden cauldron: @@ -146,6 +148,7 @@ cauldron: lore: - Ein Beispiel für einen Basistrank - So kommt er aus dem Kessel + customModelData: 545 # -- Eine Zutat: -- wheat: @@ -217,10 +220,12 @@ cauldron: # alcohol: Alkoholgehalt 0-100 in absoluter Menge bei perfektem Getränk (wird dem Spieler hinzugefügt, bei 100 = tot) # lore: Auflistung von zusätzlichem Text auf dem fertigen Trank. (Farbcodes möglich: z.b. &6) # Lore nur für bestimmte Qualität möglich mit + Schlecht, ++ Mittel, +++ Gut, vorne anhängen. -# servercommands: Liste von Befehlen ausgeführt vom Server wenn der Trank getrunken wird -# playercommands: Liste von Befehlen ausgeführt vom Spieler wenn der Trank getrunken wird +# servercommands: Liste von Befehlen ausgeführt vom -Server- wenn der Trank getrunken wird (%player_name% benutzbar) +# playercommands: Liste von Befehlen ausgeführt vom -Spieler- wenn der Trank getrunken wird (%player_name% benutzbar) # drinkmessage: Nachricht im Chat beim trinken des Trankes # drinktitle: Nachricht als Titel auf dem Bildschirm an den Spieler beim trinken des Trankes +# customModelData: Custom Model Data Modelldaten. Mit dieser Zahl kann die Tranktextur mit einem Resourcepack geändert werden +# Es kann eine für alle, oder drei für die qualitäten schlecht/normal/gut agegeben werden, mit / getrennt # effects: Auflistung Effekt/Level/Dauer Besonderere Trank-Effekte beim Trinken, Dauer in sek. # Ein 'X' an den Namen anhängen, um ihn zu verbergen. Bsp: 'POISONX/2/10' (WEAKNESS, INCREASE_DAMAGE, SLOW und SPEED sind immer verborgen.) # Effekte sind ab der 1.9 immer verborgen, wegen Änderungen an den Tränken. @@ -262,6 +267,7 @@ recipes: - homes drinkmessage: Schmeckt toll drinktitle: Wärmt dich von innen + customModelData: 556/557/557 effects: - FIRE_RESISTANCE/20 - HEAL/1 @@ -448,6 +454,9 @@ multiServerDB: # Ob Items in der Zweithand auch in den Kessel geworfen werden sollen [false] useOffhandForCauldron: false +# Of Fass- und Kesseldaten Async/im Hintergrund geladen werden können [true] +loadDataAsync: true + # -- Chat Veränderungs Einstellungen -- diff --git a/resources/config/v12/en/config.yml b/resources/config/v12/en/config.yml index 9bfb46f..e36af33 100644 --- a/resources/config/v12/en/config.yml +++ b/resources/config/v12/en/config.yml @@ -125,6 +125,7 @@ customItems: # -- Ingredients in the Cauldron -- # Which Ingredients are accepted by the Cauldron and the base potion resulting from them +# You only need to add something here if you want to specify a custom name or color for the base potion # name: Name of the base potion coming out of the Cauldron (Formatting codes possible: such as &6) # ingredients: List of 'material/amount' @@ -135,6 +136,7 @@ customItems: # Usable Colors: DARK_RED, RED, BRIGHT_RED, ORANGE, PINK, BLUE, CYAN, WATER, GREEN, BLACK, GREY, BRIGHT_GREY # Or RGB colors (hex: for example '99FF33') (with '') (search for "HTML color" on the internet) # lore: List of additional text on the base potion. (Formatting codes possible: such as &6) + # customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. cauldron: ex: @@ -146,6 +148,7 @@ cauldron: lore: - An example for a Base Potion - This is how it comes out of a Cauldron + customModelData: 545 # -- One Ingredient: -- wheat: @@ -218,10 +221,12 @@ cauldron: # alcohol: Absolute amount of alcohol 0-100 in a perfect potion (will be added directly to the player, where 100 means fainting) # lore: List of additional text on the finished brew. (Formatting codes possible: such as &6) # Specific lore for quality possible, using + bad, ++ normal, +++ good, added to the front of the line. -# servercommands: List of Commands executed by the Server when drinking the brew -# playercommands: List of Commands executed by the Player when drinking the brew +# servercommands: List of Commands executed by the -Server- when drinking the brew (Can use %player_name%) +# playercommands: List of Commands executed by the -Player- when drinking the brew (Can use %player_name%) # drinkmessage: Chat-message to the Player when drinking the Brew # drinktitle: Title on Screen to the Player when drinking the Brew +# customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. +# Can specify one for all, or one for each quality, separated by / # effects: List of effect/level/duration Special potion-effect when drinking, duration in sek. # Suffix name with 'X' to hide effect from label. Sample: 'POISONX/2/10' (WEAKNESS, INCREASE_DAMAGE, SLOW and SPEED are always hidden.) # Effects are always hidden in 1.9 and newer, because of changes in the potion mechanics. @@ -263,6 +268,7 @@ recipes: - homes drinkmessage: Tastes good drinktitle: Warms you from inside + customModelData: 556/557/557 effects: - FIRE_RESISTANCE/20 - HEAL/1 @@ -449,6 +455,9 @@ multiServerDB: # If items in Offhand should be added to the cauldron as well [false] useOffhandForCauldron: false +# If Barrel and Cauldron data can be loaded Async/in the Background [true] +loadDataAsync: true + # -- Chat Distortion Settings -- diff --git a/resources/config/v12/fr/config.yml b/resources/config/v12/fr/config.yml index bd1e3a9..fcc3f4f 100644 --- a/resources/config/v12/fr/config.yml +++ b/resources/config/v12/fr/config.yml @@ -126,6 +126,7 @@ customItems: # -- Ingrédients dans le chaudron -- # Quels sont les ingrédients acceptés par le chaudron et la potion de base qui en résulte +# Il vous suffit d'ajouter quelque chose ici si vous voulez spécifier un nom ou une couleur pour la potion de base # name: Nom de la potion de base qui sort du chaudron (codes de formatage possibles : tels que &6) # ingredients: Liste des 'matériaux/montant' @@ -137,6 +138,7 @@ customItems: # (Dans l'ordre : Rouge foncé, Rouge, Rouge clair, Orange, Rose, Bleu, Cyan, Eau, Vert, Noir, Gris, Gris clair) # Ou couleurs RGB (hex: par exemple '99FF33') (avec '') (recherche de "HTML color" sur internet) # lore: Liste de texte supplémentaire sur la potion de base. (Formatting codes possible: such as &6) + # customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. cauldron: ex: @@ -148,6 +150,7 @@ cauldron: lore: - Un exemple pour une potion de base - Voici comment il sort d'un chaudron + customModelData: 545 # -- Un ingrédient: -- wheat: @@ -221,10 +224,12 @@ cauldron: # alcohol: Le montant d'alcool absolu dans une boisson parfaite (cela sera ajouté directement au joueur, où 100% entraînera l'évanouissement), un degré d'alcooléisme en fait # lore: Liste des textes supplémentaires sur le breuvage fini. (Codes de formatage possibles : tels que &6) # Texte spécifique de qualité possible, en utilisant + mauvais, ++ normal, +++ bon, ajouté à l'avant de la ligne. -# servercommands: Liste des commandes exécutées par le serveur lors de la consommation de la potion -# playercommands: Liste des commandes exécutées par le joueur lors de la consommation de la potion +# servercommands: Liste des commandes exécutées par le serveur lors de la consommation de la potion (Peut utiliser %player_name%) +# playercommands: Liste des commandes exécutées par le joueur lors de la consommation de la potion (Peut utiliser %player_name%) # drinkmessage: Chat-message au joueur lorsqu'il boit la potion # drinktitle: Titre à l'écran du joueur lorsqu'il boit la potion +# customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. +# Can specify one for all, or one for each quality, separated by / # effects: Liste des effets/durée en secondes lors de la consommation. # Rajouter le suffixe 'X' pour le cacher du label. Exemple: POISONX/10 # (WEAKNESS, INCREASE_DAMAGE, SLOW et SPEED sont toujours cachés.) @@ -270,6 +275,7 @@ recipes: - homes drinkmessage: C'est bon au goût drinktitle: vous réchauffe à l'intérieur + customModelData: 556/557/557 effects: - FIRE_RESISTANCE/20 - HEAL/1 @@ -444,6 +450,9 @@ multiServerDB: # If items in Offhand should be added to the cauldron as well [false] useOffhandForCauldron: false +# If Barrel and Cauldron data can be loaded Async/in the Background [true] +loadDataAsync: true + # -- Paramètres de la distorsion du Chat -- diff --git a/resources/config/v12/it/config.yml b/resources/config/v12/it/config.yml index 57340d3..c3675da 100644 --- a/resources/config/v12/it/config.yml +++ b/resources/config/v12/it/config.yml @@ -125,6 +125,7 @@ customItems: # -- Ingredients in the Cauldron -- # Which Ingredients are accepted by the Cauldron and the base potion resulting from them +# You only need to add something here if you want to specify a custom name or color for the base potion # name: Name of the base potion coming out of the Cauldron (Formatting codes possible: such as &6) # ingredients: List of 'material/amount' @@ -135,6 +136,7 @@ customItems: # Usable Colors: DARK_RED, RED, BRIGHT_RED, ORANGE, PINK, BLUE, CYAN, WATER, GREEN, BLACK, GREY, BRIGHT_GREY # Or RGB colors (hex: for example '99FF33') (with '') (search for "HTML color" on the internet) # lore: List of additional text on the base potion. (Formatting codes possible: such as &6) + # customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. cauldron: ex: @@ -146,6 +148,7 @@ cauldron: lore: - An example for a Base Potion - This is how it comes out of a Cauldron + customModelData: 545 # -- One Ingredient: -- wheat: @@ -216,10 +219,12 @@ cauldron: # alcohol: Volume alcolico da 0 a 100 nella versione perfetta (sarà aggiunta direttamente al giocatore, dove 100 è la quantità massima di alcohol assorbibile. # lore: List of additional text on the finished brew. (Formatting codes possible: such as &6) # Specific lore for quality possible, using + bad, ++ normal, +++ good, added to the front of the line. -# servercommands: List of Commands executed by the Server when drinking the brew -# playercommands: List of Commands executed by the Player when drinking the brew +# servercommands: List of Commands executed by the -Server- when drinking the brew (Can use %player_name%) +# playercommands: List of Commands executed by the -Player- when drinking the brew (Can use %player_name%) # drinkmessage: Chat-message to the Player when drinking the Brew # drinktitle: Title on Screen to the Player when drinking the Brew +# customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. +# Can specify one for all, or one for each quality, separated by / # effects: Eventuali effetti come quelli delle pozioni nel formato di effetto/livello/durata. # Aggiungere il suffisso 'X' per nascondere l'effetto dalla descrizione. Esempio: 'POISONX/2/10' (gli effetti WEAKNESS, INCREASE_DAMAGE, SLOW and SPEED sono sempre nascosti). # Gli effetti sono sempre nascosti dalla 1.9 in poi, per via dei cambiamenti nelle meccaniche delle pozioni. @@ -261,6 +266,7 @@ recipes: - homes drinkmessage: Tastes good drinktitle: Warms you from inside + customModelData: 556/557/557 effects: - FIRE_RESISTANCE/20 - HEAL/1 @@ -436,6 +442,9 @@ multiServerDB: # If items in Offhand should be added to the cauldron as well [false] useOffhandForCauldron: false +# If Barrel and Cauldron data can be loaded Async/in the Background [true] +loadDataAsync: true + # -- Imostazioni di distorsione della chat -- diff --git a/resources/config/v13/de/config.yml b/resources/config/v13/de/config.yml index 32e5e88..95fe1c2 100644 --- a/resources/config/v13/de/config.yml +++ b/resources/config/v13/de/config.yml @@ -131,6 +131,7 @@ customItems: # -- Zutaten im Kessel -- # Hier kann angegeben werden welche Zutaten in den Kessel getan werden können und was mit ihnen geschieht. +# Es braucht nur etwas hier eingetragen werden falls der Basistrank besondere Eigenschaften wie Name und Farbe haben soll # name: Name des Basistrankes der aus dem Kessel kommt (Farbcodes möglich: z.b. &6) # ingredients: Auflistung von 'Material/Anzahl' @@ -141,6 +142,7 @@ customItems: # Benutzbare Farben: DARK_RED, RED, BRIGHT_RED, ORANGE, YELLOW, PINK, PURPLE, BLUE, CYAN, WATER, TEAL, OLIVE, GREEN, LIME, BLACK, GREY, BRIGHT_GREY, WHITE # Oder RGB Farben (Hex: also zB '99FF33') (Ohne #) (mit '') (Einfach nach "HTML color" im Internet suchen) # lore: Auflistung von zusätzlichem Text auf dem Trank. (Farbcodes möglich: z.b. &6) + # customModelData: Custom Model Data Modelldaten. Mit dieser Zahl kann die Tranktextur mit einem Resourcepack geändert werden cauldron: # Ein vollständiges Beispiel zuerst: @@ -153,6 +155,7 @@ cauldron: lore: - Ein Beispiel für einen Basistrank - So kommt er aus dem Kessel + customModelData: 545 # -- Eine Zutat: -- wheat: @@ -350,10 +353,12 @@ cauldron: # alcohol: Alkoholgehalt 0-100 in absoluter Menge bei perfektem Getränk (wird dem Spieler hinzugefügt, bei 100 = tot) # lore: Auflistung von zusätzlichem Text auf dem fertigen Trank. (Farbcodes möglich: z.b. &6) # Lore nur für bestimmte Qualität möglich mit + Schlecht, ++ Mittel, +++ Gut, vorne anhängen. -# servercommands: Liste von Befehlen ausgeführt vom Server wenn der Trank getrunken wird -# playercommands: Liste von Befehlen ausgeführt vom Spieler wenn der Trank getrunken wird +# servercommands: Liste von Befehlen ausgeführt vom -Server- wenn der Trank getrunken wird (%player_name% benutzbar) +# playercommands: Liste von Befehlen ausgeführt vom -Spieler- wenn der Trank getrunken wird (%player_name% benutzbar) # drinkmessage: Nachricht im Chat beim trinken des Trankes # drinktitle: Nachricht als Titel auf dem Bildschirm an den Spieler beim trinken des Trankes +# customModelData: Custom Model Data Modelldaten. Mit dieser Zahl kann die Tranktextur mit einem Resourcepack geändert werden +# Es kann eine für alle, oder drei für die qualitäten schlecht/normal/gut agegeben werden, mit / getrennt # effects: Auflistung Effekt/Level/Dauer Besonderere Trank-Effekte beim Trinken, Dauer in sek. # Mögliche Effekte: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html # Minimale und Maximale Level/Dauer können durch "-" festgelegt werden, Bsp: 'SPEED/1-2/30-40' = Level 1 und 30 sek minimal, Level 2 und 40 sek maximal @@ -392,6 +397,7 @@ recipes: - homes drinkmessage: Schmeckt toll drinktitle: Wärmt dich von innen + customModelData: 556/557/557 effects: - FIRE_RESISTANCE/20 - HEAL/1 @@ -807,6 +813,9 @@ multiServerDB: # Ob Items in der Zweithand auch in den Kessel geworfen werden sollen [false] useOffhandForCauldron: false +# Of Fass- und Kesseldaten Async/im Hintergrund geladen werden können [true] +loadDataAsync: true + # -- Chat Veränderungs Einstellungen -- diff --git a/resources/config/v13/en/config.yml b/resources/config/v13/en/config.yml index 6792e40..63ea861 100644 --- a/resources/config/v13/en/config.yml +++ b/resources/config/v13/en/config.yml @@ -132,6 +132,7 @@ customItems: # -- Ingredients in the Cauldron -- # Which Ingredients are accepted by the Cauldron and the base potion resulting from them +# You only need to add something here if you want to specify a custom name or color for the base potion # name: Name of the base potion coming out of the Cauldron (Formatting codes possible: such as &6) # ingredients: List of 'material/amount' @@ -142,6 +143,7 @@ customItems: # Usable Colors: DARK_RED, RED, BRIGHT_RED, ORANGE, YELLOW, PINK, PURPLE, BLUE, CYAN, WATER, TEAL, OLIVE, GREEN, LIME, BLACK, GREY, BRIGHT_GREY, WHITE # Or RGB colors (hex: for example '99FF33') (with '') (search for "HTML color" on the internet) # lore: List of additional text on the base potion. (Formatting codes possible: such as &6) + # customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. cauldron: # Example with all possible entries @@ -154,6 +156,7 @@ cauldron: lore: - An example for a Base Potion - This is how it comes out of a Cauldron + customModelData: 545 # -- One Ingredient: -- wheat: @@ -350,10 +353,12 @@ cauldron: # alcohol: Absolute amount of alcohol 0-100 in a perfect potion (will be added directly to the player, where 100 means fainting) # lore: List of additional text on the finished brew. (Formatting codes possible: such as &6) # Specific lore for quality possible, using + bad, ++ normal, +++ good, added to the front of the line. -# servercommands: List of Commands executed by the Server when drinking the brew -# playercommands: List of Commands executed by the Player when drinking the brew +# servercommands: List of Commands executed by the -Server- when drinking the brew (Can use %player_name%) +# playercommands: List of Commands executed by the -Player- when drinking the brew (Can use %player_name%) # drinkmessage: Chat-message to the Player when drinking the Brew # drinktitle: Title on Screen to the Player when drinking the Brew +# customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. +# Can specify one for all, or one for each quality, separated by / # effects: List of effect/level/duration Special potion-effect when drinking, duration in sek. # Possible Effects: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html # Level or Duration ranges may be specified with a "-", ex. 'SPEED/1-2/30-40' = lvl 1 and 30 sec at worst and lvl 2 and 40 sec at best @@ -392,6 +397,7 @@ recipes: - homes drinkmessage: Tastes good drinktitle: Warms you from inside + customModelData: 556/557/557 effects: - FIRE_RESISTANCE/20 - HEAL/1 @@ -800,6 +806,9 @@ multiServerDB: # If items in Offhand should be added to the cauldron as well [false] useOffhandForCauldron: false +# If Barrel and Cauldron data can be loaded Async/in the Background [true] +loadDataAsync: true + # -- Chat Distortion Settings -- diff --git a/resources/config/v13/fr/config.yml b/resources/config/v13/fr/config.yml index 4ac65b4..7a05dff 100644 --- a/resources/config/v13/fr/config.yml +++ b/resources/config/v13/fr/config.yml @@ -133,6 +133,7 @@ customItems: # -- Ingrédients dans le chaudron -- # Quels sont les ingrédients acceptés par le chaudron et la potion de base qui en résulte +# Il vous suffit d'ajouter quelque chose ici si vous voulez spécifier un nom ou une couleur pour la potion de base # name: Nom de la potion de base qui sort du chaudron (codes de formatage possibles : tels que &6) # ingredients: Liste des 'matériaux/montant' @@ -144,6 +145,7 @@ customItems: # (Dans l'ordre : Rouge foncé, Rouge, Rouge clair, Orange, Jaune, Rose, Pourpre, Bleu, Cyan, Eau, Sarcelle, Olive, Vert, Vert lime, Noir, Gris, Gris clair, Blanc) # Ou couleurs RGB (hex: par exemple '99FF33') (avec '') (recherche de "HTML color" sur internet) # lore: Liste de texte supplémentaire sur la potion de base. (Formatting codes possible: such as &6) + # customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. cauldron: # Exemple avec tous les paramètres possibles : @@ -156,6 +158,7 @@ cauldron: lore: - Un exemple pour une potion de base - Voici comment il sort d'un chaudron + customModelData: 545 # -- Un ingrédient: -- wheat: @@ -354,10 +357,12 @@ cauldron: # alcohol: Le montant d'alcool absolu dans une boisson parfaite (cela sera ajouté directement au joueur, où 100% entraînera l'évanouissement), un degré d'alcooléisme en fait # lore: Liste des textes supplémentaires sur le breuvage fini. (Codes de formatage possibles : tels que &6) # Texte spécifique de qualité possible, en utilisant + mauvais, ++ normal, +++ bon, ajouté à l'avant de la ligne. -# servercommands: Liste des commandes exécutées par le serveur lors de la consommation de la potion -# playercommands: Liste des commandes exécutées par le joueur lors de la consommation de la potion +# servercommands: Liste des commandes exécutées par le serveur lors de la consommation de la potion (Peut utiliser %player_name%) +# playercommands: Liste des commandes exécutées par le joueur lors de la consommation de la potion (Peut utiliser %player_name%) # drinkmessage: Chat-message au joueur lorsqu'il boit la potion # drinktitle: Titre à l'écran du joueur lorsqu'il boit la potion +# customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. +# Can specify one for all, or one for each quality, separated by / # effects: Liste des effets/durée en secondes lors de la consommation. # Effets posssible: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html # POUR LES EFFETS EN FONCTIONS DE LA QUALITE : Les Niveaux (I ou II) ou les Intervalles de durées d'effets doivent être spécifiés avec un "-". @@ -399,6 +404,7 @@ recipes: - homes drinkmessage: C'est bon au goût drinktitle: vous réchauffe à l'intérieur + customModelData: 556/557/557 effects: - FIRE_RESISTANCE/20 - HEAL/1 @@ -806,6 +812,9 @@ multiServerDB: # If items in Offhand should be added to the cauldron as well [false] useOffhandForCauldron: false +# If Barrel and Cauldron data can be loaded Async/in the Background [true] +loadDataAsync: true + # -- Paramètres de la distorsion du Chat -- diff --git a/resources/config/v13/it/config.yml b/resources/config/v13/it/config.yml index c457109..3bc44b8 100644 --- a/resources/config/v13/it/config.yml +++ b/resources/config/v13/it/config.yml @@ -132,6 +132,7 @@ customItems: # -- Ingredients in the Cauldron -- # Which Ingredients are accepted by the Cauldron and the base potion resulting from them +# You only need to add something here if you want to specify a custom name or color for the base potion # name: Name of the base potion coming out of the Cauldron (Formatting codes possible: such as &6) # ingredients: List of 'material/amount' @@ -142,6 +143,7 @@ customItems: # Usable Colors: DARK_RED, RED, BRIGHT_RED, ORANGE, YELLOW, PINK, PURPLE, BLUE, CYAN, WATER, TEAL, OLIVE, GREEN, LIME, BLACK, GREY, BRIGHT_GREY, WHITE # Or RGB colors (hex: for example '99FF33') (with '') (search for "HTML color" on the internet) # lore: List of additional text on the base potion. (Formatting codes possible: such as &6) + # customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. cauldron: # Example with all possible entries @@ -154,6 +156,7 @@ cauldron: lore: - An example for a Base Potion - This is how it comes out of a Cauldron + customModelData: 545 # -- One Ingredient: -- wheat: @@ -350,10 +353,12 @@ cauldron: # alcohol: Volume alcolico da 0 a 100 nella versione perfetta (sarà aggiunta direttamente al giocatore, dove 100 è la quantità massima di alcohol assorbibile. # lore: List of additional text on the finished brew. (Formatting codes possible: such as &6) # Specific lore for quality possible, using + bad, ++ normal, +++ good, added to the front of the line. -# servercommands: List of Commands executed by the Server when drinking the brew -# playercommands: List of Commands executed by the Player when drinking the brew +# servercommands: List of Commands executed by the -Server- when drinking the brew (Can use %player_name%) +# playercommands: List of Commands executed by the -Player- when drinking the brew (Can use %player_name%) # drinkmessage: Chat-message to the Player when drinking the Brew # drinktitle: Title on Screen to the Player when drinking the Brew +# customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. +# Can specify one for all, or one for each quality, separated by / # effects: Eventuali effetti come quelli delle pozioni nel formato di effetto/livello/durata. # Lista di effetti possibili: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html # Intervalli di livelli o durate possono essere specificati con un "-", per esempio 'SPEED/1-2/30-40'. Ciò significa nel peggior caso livello 1 e 30 secondi di durata e livello 2 e 40 secondi nel migliore. @@ -392,6 +397,7 @@ recipes: - homes drinkmessage: Tastes good drinktitle: Warms you from inside + customModelData: 556/557/557 effects: - FIRE_RESISTANCE/20 - HEAL/1 @@ -800,6 +806,9 @@ multiServerDB: # If items in Offhand should be added to the cauldron as well [false] useOffhandForCauldron: false +# If Barrel and Cauldron data can be loaded Async/in the Background [true] +loadDataAsync: true + # -- Imostazioni di distorsione della chat -- diff --git a/resources/config/v13/zh/config.yml b/resources/config/v13/zh/config.yml index 574f18e..b42a5d6 100644 --- a/resources/config/v13/zh/config.yml +++ b/resources/config/v13/zh/config.yml @@ -134,6 +134,7 @@ customItems: # -- Ingredients in the Cauldron -- # Which Ingredients are accepted by the Cauldron and the base potion resulting from them +# You only need to add something here if you want to specify a custom name or color for the base potion # name: Name of the base potion coming out of the Cauldron (Formatting codes possible: such as &6) # ingredients: List of 'material/amount' @@ -144,6 +145,7 @@ customItems: # Usable Colors: DARK_RED, RED, BRIGHT_RED, ORANGE, YELLOW, PINK, PURPLE, BLUE, CYAN, WATER, TEAL, OLIVE, GREEN, LIME, BLACK, GREY, BRIGHT_GREY, WHITE # Or RGB colors (hex: for example '99FF33') (with '') (search for "HTML color" on the internet) # lore: List of additional text on the base potion. (Formatting codes possible: such as &6) + # customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. cauldron: # Example with all possible entries @@ -156,6 +158,7 @@ cauldron: lore: - An example for a Base Potion - This is how it comes out of a Cauldron + customModelData: 545 # -- One Ingredient: -- wheat: @@ -353,10 +356,12 @@ cauldron: # alcohol: 完美质量的饮品所含有的酒精度(百分数, 会被直接添加到玩家身上, 100意为直接昏迷) # lore: List of additional text on the finished brew. (Formatting codes possible: such as &6) # Specific lore for quality possible, using + bad, ++ normal, +++ good, added to the front of the line. -# servercommands: List of Commands executed by the Server when drinking the brew -# playercommands: List of Commands executed by the Player when drinking the brew +# servercommands: List of Commands executed by the -Server- when drinking the brew (Can use %player_name%) +# playercommands: List of Commands executed by the -Player- when drinking the brew (Can use %player_name%) # drinkmessage: Chat-message to the Player when drinking the Brew # drinktitle: Title on Screen to the Player when drinking the Brew +# customModelData: Custom Model Data Tag. This is a number that can be used to add custom textures to the item. +# Can specify one for all, or one for each quality, separated by / # effects: 饮用后能够获得的药效的列表. 格式为"药效/强度/时长(秒)". # 药效列表: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html # 药效强度与时长可以用"-"划分区间, 如: "SPEED/1-2/30-40" = 最劣质情况下的饮品会给予速度1三十秒, 最优质则会给予速度2四十秒. @@ -396,6 +401,7 @@ recipes: - homes drinkmessage: Tastes good drinktitle: Warms you from inside + customModelData: 556/557/557 effects: - FIRE_RESISTANCE/20 - HEAL/1 @@ -804,6 +810,9 @@ multiServerDB: # If items in Offhand should be added to the cauldron as well [false] useOffhandForCauldron: false +# If Barrel and Cauldron data can be loaded Async/in the Background [true] +loadDataAsync: true + # -- 口糊设置 -- diff --git a/src/com/dre/brewery/BIngredients.java b/src/com/dre/brewery/BIngredients.java index 872ab12..e8c9390 100644 --- a/src/com/dre/brewery/BIngredients.java +++ b/src/com/dre/brewery/BIngredients.java @@ -130,6 +130,7 @@ public class BIngredients { cookedName = cookRecipe.getName(quality); cookRecipe.getColor().colorBrew(potionMeta, potion, false); + brew.updateCustomModelData(potionMeta); } else { // new base potion @@ -149,6 +150,9 @@ public class BIngredients { lore.write(); } cauldronRecipe.getColor().colorBrew(potionMeta, potion, true); + if (P.use1_14 && cauldronRecipe.getCmData() != 0) { + potionMeta.setCustomModelData(cauldronRecipe.getCmData()); + } } } } diff --git a/src/com/dre/brewery/Brew.java b/src/com/dre/brewery/Brew.java index e8ef874..1a580e5 100644 --- a/src/com/dre/brewery/Brew.java +++ b/src/com/dre/brewery/Brew.java @@ -409,6 +409,27 @@ public class Brew implements Cloneable { } } + public void updateCustomModelData(ItemMeta meta) { + if (!P.use1_14) return; + if (currentRecipe != null && currentRecipe.getCmData() != null) { + int cm; + if (quality > 7) { + cm = currentRecipe.getCmData()[2]; + } else if (quality > 3) { + cm = currentRecipe.getCmData()[1]; + } else { + cm = currentRecipe.getCmData()[0]; + } + if (cm == 0) { + meta.setCustomModelData(null); + } else { + meta.setCustomModelData(cm); + } + } else { + meta.setCustomModelData(null); + } + } + /** * Get Special Drink Effects */ @@ -621,6 +642,7 @@ public class Brew implements Cloneable { PotionColor.GREY.colorBrew(potionMeta, slotItem, canDistill()); } alc = calcAlcohol(); + updateCustomModelData(potionMeta); // Distill Lore if (currentRecipe != null && BConfig.colorInBrewer != BrewLore.hasColorLore(potionMeta)) { @@ -695,6 +717,7 @@ public class Brew implements Cloneable { } } alc = calcAlcohol(); + updateCustomModelData(potionMeta); // Lore if (currentRecipe != null && BConfig.colorInBarrels != BrewLore.hasColorLore(potionMeta)) { @@ -779,6 +802,7 @@ public class Brew implements Cloneable { PotionMeta potionMeta = (PotionMeta) potion.getItemMeta(); recipe.getColor().colorBrew(potionMeta, potion, false); + updateCustomModelData(potionMeta); potionMeta.setDisplayName(P.p.color("&f" + recipe.getName(quality))); //if (!P.use1_14) { // Before 1.14 the effects duration would strangely be only a quarter of what we tell it to be diff --git a/src/com/dre/brewery/filedata/BConfig.java b/src/com/dre/brewery/filedata/BConfig.java index 1aead46..abf52a6 100644 --- a/src/com/dre/brewery/filedata/BConfig.java +++ b/src/com/dre/brewery/filedata/BConfig.java @@ -58,7 +58,7 @@ public class BConfig { // Barrel public static boolean openEverywhere; - public static boolean loadDataAsync = true; + public static boolean loadDataAsync; // Cauldron public static boolean useOffhandForCauldron; @@ -242,6 +242,7 @@ public class BConfig { openEverywhere = config.getBoolean("openLargeBarrelEverywhere", false); MCBarrel.maxBrews = config.getInt("maxBrewsInMCBarrels", 6); useOffhandForCauldron = config.getBoolean("useOffhandForCauldron", false); + loadDataAsync = config.getBoolean("loadDataAsync", true); Brew.loadSeed(config, new File(P.p.getDataFolder(), "config.yml")); diff --git a/src/com/dre/brewery/recipe/BCauldronRecipe.java b/src/com/dre/brewery/recipe/BCauldronRecipe.java index 077a7dc..11cefdc 100644 --- a/src/com/dre/brewery/recipe/BCauldronRecipe.java +++ b/src/com/dre/brewery/recipe/BCauldronRecipe.java @@ -31,6 +31,7 @@ public class BCauldronRecipe { //private List particles private PotionColor color; private List lore; + private int cmData; // Custom Model Data private boolean saveInData; // If this recipe should be saved in data and loaded again when the server restarts. Applicable to non-config recipes @@ -83,6 +84,8 @@ public class BCauldronRecipe { recipe.lore = lore.stream().map(Tuple::second).collect(Collectors.toList()); } + recipe.cmData = cfg.getInt(id + ".customModelData", 0); + return recipe; } @@ -131,6 +134,13 @@ public class BCauldronRecipe { this.lore = lore; } + /** + * Get the Custom Model Data + */ + public int getCmData() { + return cmData; + } + public void setSaveInData(boolean saveInData) { this.saveInData = saveInData; } diff --git a/src/com/dre/brewery/recipe/BRecipe.java b/src/com/dre/brewery/recipe/BRecipe.java index 706101a..4937a3f 100644 --- a/src/com/dre/brewery/recipe/BRecipe.java +++ b/src/com/dre/brewery/recipe/BRecipe.java @@ -45,6 +45,7 @@ public class BRecipe { private PotionColor color; // color of the distilled/finished potion private int alcohol; // Alcohol in perfect potion private List> lore; // Custom Lore on the Potion. The int is for Quality Lore, 0 = any, 1,2,3 = Bad,Middle,Good + private int[] cmData; // Custom Model Data[3] for each quality // drinking private List effects = new ArrayList<>(); // Special Effects when drinking @@ -150,6 +151,23 @@ public class BRecipe { recipe.drinkMsg = P.p.color(BUtil.loadCfgString(configSectionRecipes, recipeId + ".drinkmessage")); recipe.drinkTitle = P.p.color(BUtil.loadCfgString(configSectionRecipes, recipeId + ".drinktitle")); + if (configSectionRecipes.isString(recipeId + ".customModelData")) { + String[] cmdParts = configSectionRecipes.getString(recipeId + ".customModelData", "").split("/"); + if (cmdParts.length == 3) { + recipe.cmData = new int[]{P.p.parseInt(cmdParts[0]), P.p.parseInt(cmdParts[1]), P.p.parseInt(cmdParts[2])}; + if (recipe.cmData[0] == 0 && recipe.cmData[1] == 0 && recipe.cmData[2] == 0) { + P.p.errorLog("Invalid customModelData in Recipe: " + recipe.getRecipeName()); + recipe.cmData = null; + } + } else { + P.p.errorLog("Invalid customModelData in Recipe: " + recipe.getRecipeName()); + } + } else { + int cmd = configSectionRecipes.getInt(recipeId + ".customModelData", 0); + if (cmd != 0) { + recipe.cmData = new int[]{cmd, cmd, cmd}; + } + } List effectStringList = configSectionRecipes.getStringList(recipeId + ".effects"); if (effectStringList != null) { @@ -628,6 +646,13 @@ public class BRecipe { return list; } + /** + * Get the Custom Model Data array for bad, normal, good quality + */ + public int[] getCmData() { + return cmData; + } + public List getPlayercmds() { return playercmds; } @@ -889,6 +914,14 @@ public class BRecipe { return this; } + /** + * Add Custom Model Data for each Quality + */ + public Builder addCustomModelData(int bad, int normal, int good) { + recipe.cmData = new int[] {bad, normal, good}; + return this; + } + public Builder addEffects(BEffect... effects) { Collections.addAll(recipe.effects, effects); return this;