diff --git a/resources/config/v12/de/config.yml b/resources/config/v12/de/config.yml index 0596072..469d7cc 100644 --- a/resources/config/v12/de/config.yml +++ b/resources/config/v12/de/config.yml @@ -245,7 +245,7 @@ cauldron: # cookingtime: Zeit in Echtminuten die die Zutaten kochen müssen # distillruns: Wie oft destilliert werden muss für vollen Alkoholgehalt (0=ohne Destillieren) # distilltime: Wie lange (in sekunden) ein Destillations-Durchlauf braucht (0=Standard Zeit von 40 sek) MC Standard wäre 20 sek -# wood: Holz des Fasses 0=alle Holzsorten 1=Birke 2=Eiche 3=Jungel 4=Fichte 5=Akazie 6=Schwarzeiche +# wood: Holz des Fasses 0=alle Holzsorten 1=Birke 2=Eiche 3=Jungel 4=Fichte 5=Akazie 6=Schwarzeiche 7=Karmesin 8=Wirr # Das Minecraft Fass besteht aus Eiche # age: Zeit in Minecraft-Tagen, die das Getränk im Fass reifen muss 0= kein reifen # color: Farbe des Getränks nach destillieren/reifen. diff --git a/resources/config/v12/en/config.yml b/resources/config/v12/en/config.yml index c626653..1624e11 100644 --- a/resources/config/v12/en/config.yml +++ b/resources/config/v12/en/config.yml @@ -246,7 +246,7 @@ cauldron: # cookingtime: Time in real minutes ingredients have to boil # distillruns: How often it has to be distilled for full alcohol (0=without distilling) # distilltime: How long (in seconds) one distill-run takes (0=Default time of 40 sec) MC Default would be 20 sec -# wood: Wood of the barrel 0=any 1=Birch 2=Oak 3=Jungle 4=Spruce 5=Acacia 6=Dark Oak +# wood: Wood of the barrel 0=any 1=Birch 2=Oak 3=Jungle 4=Spruce 5=Acacia 6=Dark Oak 7=Crimson 8=Warped # The Minecraft barrel is made of oak # age: Time in Minecraft-days, the potion has to age in a barrel 0=no aging # color: Color of the potion after distilling/aging. diff --git a/resources/config/v12/fr/config.yml b/resources/config/v12/fr/config.yml index 668503c..394cdb0 100644 --- a/resources/config/v12/fr/config.yml +++ b/resources/config/v12/fr/config.yml @@ -248,7 +248,7 @@ cauldron: # cookingtime: Temps en minutes réelles durant lesquelles les ingrédients devront bouillir # distillruns: Combien de fois le breuvage devra être distillé pour un alcool de qualité (0=Ne pas distiller) # distilltime: Combien de temps (en secondes) dure une distillation (0=Temps par défaut de 40 secondes) MC Par défaut serait de 20 secondes -# wood: Type de bois du baril 0=aucun 1=Bouleau 2=Chêne 3=Jungle 4=Pin 5=Acacia 6=Chêne Noir +# wood: Type de bois du baril 0=aucun 1=Bouleau 2=Chêne 3=Jungle 4=Pin 5=Acacia 6=Chêne Noir 7=Crimson 8=Warped # Le tonneau Minecraft est en chêne. # age: Temps en jours de Minecraft, la potion devra être âgée dans un baril. 0=Pas besoin d'âge # color: Couleur de la potion après distillation/avoir laissé vieillir. diff --git a/resources/config/v12/it/config.yml b/resources/config/v12/it/config.yml index d8c2ffc..3affbeb 100644 --- a/resources/config/v12/it/config.yml +++ b/resources/config/v12/it/config.yml @@ -244,7 +244,7 @@ cauldron: # cookingtime: Tempo in minuti richiesto dagli ingredienti per bollire # distillruns: Quanto spesso deve essere distillato per ottenere la versione perfetta con il volume alcolico impostato (0=non serve distillare). # distilltime: How long (in seconds) one distill-run takes (0=Default time of 40 sec) MC Default would be 20 sec -# wood: Legno del barile 0=qualiasi 1=Betulla 2=Quercia 3=Mogano 4=Abete 5=Acacia 6=Quercia nera +# wood: Legno del barile 0=qualiasi 1=Betulla 2=Quercia 3=Mogano 4=Abete 5=Acacia 6=Quercia nera 7=Crimson 8=Warped # The Minecraft barrel is made of oak # age: Tempo in giorni di Minecraft per cui la pozione deve essere invecchiata in un barile (0=nessun invecchiamento). # color: Colore della pozione dopo essere stata distillata/invecchiata diff --git a/resources/config/v13/de/config.yml b/resources/config/v13/de/config.yml index d3ddeff..8cd4699 100644 --- a/resources/config/v13/de/config.yml +++ b/resources/config/v13/de/config.yml @@ -415,7 +415,7 @@ cauldron: # cookingtime: Zeit in Echtminuten die die Zutaten kochen müssen # distillruns: Wie oft destilliert werden muss für vollen Alkoholgehalt (0=ohne Destillieren) # distilltime: Wie lange (in sekunden) ein Destillations-Durchlauf braucht (0=Standard Zeit von 40 sek) MC Standard wäre 20 sek -# wood: Holz des Fasses 0=alle Holzsorten 1=Birke 2=Eiche 3=Jungel 4=Fichte 5=Akazie 6=Schwarzeiche +# wood: Holz des Fasses 0=alle Holzsorten 1=Birke 2=Eiche 3=Jungel 4=Fichte 5=Akazie 6=Schwarzeiche 7=Karmesin 8=Wirr # Das Minecraft Fass besteht aus Eiche # age: Zeit in Minecraft-Tagen, die das Getränk im Fass reifen muss 0= kein reifen # color: Farbe des Getränks nach destillieren/reifen. diff --git a/resources/config/v13/en/config.yml b/resources/config/v13/en/config.yml index a29362c..e638263 100644 --- a/resources/config/v13/en/config.yml +++ b/resources/config/v13/en/config.yml @@ -415,7 +415,7 @@ cauldron: # cookingtime: Time in real minutes ingredients have to boil # distillruns: How often it has to be distilled for full alcohol (0=without distilling) # distilltime: How long (in seconds) one distill-run takes (0=Default time of 40 sec) MC Default would be 20 sec -# wood: Wood of the barrel 0=any 1=Birch 2=Oak 3=Jungle 4=Spruce 5=Acacia 6=Dark Oak +# wood: Wood of the barrel 0=any 1=Birch 2=Oak 3=Jungle 4=Spruce 5=Acacia 6=Dark Oak 7=Crimson 8=Warped # The Minecraft barrel is made of oak # age: Time in Minecraft-days, the potion has to age in a barrel 0=no aging # color: Color of the potion after distilling/aging. diff --git a/resources/config/v13/es/config.yml b/resources/config/v13/es/config.yml index c0d0e14..ba83a47 100644 --- a/resources/config/v13/es/config.yml +++ b/resources/config/v13/es/config.yml @@ -415,7 +415,7 @@ cauldron: # cookingtime: Time in real minutes ingredients have to boil # distillruns: How often it has to be distilled for full alcohol (0=without distilling) # distilltime: How long (in seconds) one distill-run takes (0=Default time of 40 sec) MC Default would be 20 sec -# wood: Wood of the barrel 0=any 1=Birch 2=Oak 3=Jungle 4=Spruce 5=Acacia 6=Dark Oak +# wood: Wood of the barrel 0=any 1=Birch 2=Oak 3=Jungle 4=Spruce 5=Acacia 6=Dark Oak 7=Crimson 8=Warped # The Minecraft barrel is made of oak # age: Time in Minecraft-days, the potion has to age in a barrel 0=no aging # color: Color of the potion after distilling/aging. diff --git a/resources/config/v13/fr/config.yml b/resources/config/v13/fr/config.yml index 2c684c2..e11b664 100644 --- a/resources/config/v13/fr/config.yml +++ b/resources/config/v13/fr/config.yml @@ -418,7 +418,7 @@ cauldron: # cookingtime: Temps en minutes réelles durant lesquelles les ingrédients devront bouillir # distillruns: Combien de fois le breuvage devra être distillé pour un alcool de qualité (0=Ne pas distiller) # distilltime: Combien de temps (en secondes) dure une distillation (0=Temps par défaut de 40 secondes) MC Par défaut serait de 20 secondes -# wood: Type de bois du baril 0=aucun 1=Bouleau 2=Chêne 3=Jungle 4=Pin 5=Acacia 6=Chêne Noir +# wood: Type de bois du baril 0=aucun 1=Bouleau 2=Chêne 3=Jungle 4=Pin 5=Acacia 6=Chêne Noir 7=Crimson 8=Warped # Le tonneau Minecraft est en chêne. # age: Temps en jours de Minecraft, la potion devra être âgée dans un baril. 0=Pas besoin d'âge # color: Couleur de la potion après distillation/avoir laissé vieillir. diff --git a/resources/config/v13/it/config.yml b/resources/config/v13/it/config.yml index f0619c1..c71f397 100644 --- a/resources/config/v13/it/config.yml +++ b/resources/config/v13/it/config.yml @@ -415,7 +415,7 @@ cauldron: # cookingtime: Tempo in minuti richiesto dagli ingredienti per bollire # distillruns: Quanto spesso deve essere distillato per ottenere la versione perfetta con il volume alcolico impostato (0=non serve distillare). # distilltime: How long (in seconds) one distill-run takes (0=Default time of 40 sec) MC Default would be 20 sec -# wood: Legno del barile 0=qualiasi 1=Betulla 2=Quercia 3=Mogano 4=Abete 5=Acacia 6=Quercia nera +# wood: Legno del barile 0=qualiasi 1=Betulla 2=Quercia 3=Mogano 4=Abete 5=Acacia 6=Quercia nera 7=Crimson 8=Warped # The Minecraft barrel is made of oak # age: Tempo in giorni di Minecraft per cui la pozione deve essere invecchiata in un barile (0=nessun invecchiamento). # color: Colore della pozione dopo essere stata distillata/invecchiata diff --git a/resources/config/v13/zh/config.yml b/resources/config/v13/zh/config.yml index 5265a45..fc2c8e8 100644 --- a/resources/config/v13/zh/config.yml +++ b/resources/config/v13/zh/config.yml @@ -417,7 +417,7 @@ cauldron: # cookingtime: 原料需要在炼药锅内烹制发酵的时间, 单位为现实分钟. # distillruns: 饮品需要在酿造台上蒸馏的次数(0=无需蒸馏). # distilltime: 每次蒸馏所需要耗费的时间(0=默认值, 即40秒), MC默认则为20秒/ -# wood: 木桶所需要的木质 0=任意 1=桦木 2=橡木 3=丛林木 4=云杉木 5=金合欢木 6=深色橡木 +# wood: 木桶所需要的木质 0=任意 1=桦木 2=橡木 3=丛林木 4=云杉木 5=金合欢木 6=深色橡木 7=Crimson 8=Warped # MC的木桶默认为橡木桶. # age: 饮品需要在木桶中熟成所需要的时间(MC天). 0=无需熟成. # color: 饮品制成后的颜色. diff --git a/src/com/dre/brewery/Barrel.java b/src/com/dre/brewery/Barrel.java index 0ba060b..699d149 100644 --- a/src/com/dre/brewery/Barrel.java +++ b/src/com/dre/brewery/Barrel.java @@ -405,12 +405,13 @@ public class Barrel implements InventoryHolder { } } if (event.willDropItems()) { + byte wood = body.getWood(); for (ItemStack item : items) { if (item != null) { Brew brew = Brew.get(item); if (brew != null) { // Brew before throwing - brew.age(item, time, body.getWood()); + brew.age(item, time, wood); PotionMeta meta = (PotionMeta) item.getItemMeta(); if (BrewLore.hasColorLore(meta)) { BrewLore lore = new BrewLore(brew, meta); diff --git a/src/com/dre/brewery/utility/LegacyUtil.java b/src/com/dre/brewery/utility/LegacyUtil.java index 50420f9..d050601 100644 --- a/src/com/dre/brewery/utility/LegacyUtil.java +++ b/src/com/dre/brewery/utility/LegacyUtil.java @@ -50,6 +50,25 @@ public class LegacyUtil { } PLANKS = planks; + Set woodStairs = EnumSet.noneOf(Material.class); + Material[] gotStairs = { + get("OAK_STAIRS", "WOOD_STAIRS"), + get("SPRUCE_STAIRS", "SPRUCE_WOOD_STAIRS"), + get("BIRCH_STAIRS", "BIRCH_WOOD_STAIRS"), + get("JUNGLE_STAIRS", "JUNGLE_WOOD_STAIRS"), + get("ACACIA_STAIRS"), + get("DARK_OAK_STAIRS"), + get("CRIMSON_STAIRS"), + get("WARPED_STAIRS"), + }; + for (Material stair : gotStairs) { + if (stair != null) { + woodStairs.add(stair); + } + } + WOOD_STAIRS = woodStairs; + + Set fences = EnumSet.noneOf(Material.class); for (Material m : Material.values()) { if (m.name().endsWith("FENCE")) { @@ -64,13 +83,8 @@ public class LegacyUtil { public static final Material SOUL_CAMPFIRE = get("SOUL_CAMPFIRE"); public static final Material SOUL_FIRE = get("SOUL_FIRE"); public static final Material CLOCK = get("CLOCK", "WATCH"); - public static final Material OAK_STAIRS = get("OAK_STAIRS", "WOOD_STAIRS"); - public static final Material SPRUCE_STAIRS = get("SPRUCE_STAIRS", "SPRUCE_WOOD_STAIRS"); - public static final Material BIRCH_STAIRS = get("BIRCH_STAIRS", "BIRCH_WOOD_STAIRS"); - public static final Material JUNGLE_STAIRS = get("JUNGLE_STAIRS", "JUNGLE_WOOD_STAIRS"); - public static final Material ACACIA_STAIRS = get("ACACIA_STAIRS"); - public static final Material DARK_OAK_STAIRS = get("DARK_OAK_STAIRS"); public static final Set PLANKS; + public static final Set WOOD_STAIRS; public static final Set FENCES; // Materials removed in 1.13 @@ -99,8 +113,7 @@ public class LegacyUtil { } public static boolean isWoodStairs(Material type) { - return type == OAK_STAIRS || type == SPRUCE_STAIRS || type == BIRCH_STAIRS || type == JUNGLE_STAIRS - || (type == ACACIA_STAIRS && ACACIA_STAIRS != null) || (type == DARK_OAK_STAIRS && DARK_OAK_STAIRS != null); + return WOOD_STAIRS.contains(type); } public static boolean isFence(Material type) { @@ -153,22 +166,25 @@ public class LegacyUtil { } public static byte getWoodType(Block wood) throws NoSuchFieldError, NoClassDefFoundError { - TreeSpecies woodType; if (P.use1_13 || isWoodStairs(wood.getType())) { String material = wood.getType().name(); if (material.startsWith("OAK")) { - woodType = TreeSpecies.GENERIC; + return 2; } else if (material.startsWith("SPRUCE")) { - woodType = TreeSpecies.REDWOOD; + return 4; } else if (material.startsWith("BIRCH")) { - woodType = TreeSpecies.BIRCH; + return 1; } else if (material.startsWith("JUNGLE")) { - woodType = TreeSpecies.JUNGLE; + return 3; } else if (material.startsWith("ACACIA")) { - woodType = TreeSpecies.ACACIA; + return 5; } else if (material.startsWith("DARK_OAK")) { - woodType = TreeSpecies.DARK_OAK; + return 6; + } else if (material.startsWith("CRIMSON")) { + return 7; + } else if (material.startsWith("WARPED")) { + return 8; } else { return 0; } @@ -176,6 +192,7 @@ public class LegacyUtil { } else { @SuppressWarnings("deprecation") MaterialData data = wood.getState().getData(); + TreeSpecies woodType; if (data instanceof Tree) { woodType = ((Tree) data).getSpecies(); } else if (data instanceof Wood) { @@ -183,23 +200,23 @@ public class LegacyUtil { } else { return 0; } - } - switch (woodType) { - case GENERIC: - return 2; - case REDWOOD: - return 4; - case BIRCH: - return 1; - case JUNGLE: - return 3; - case ACACIA: - return 5; - case DARK_OAK: - return 6; - default: - return 0; + switch (woodType) { + case GENERIC: + return 2; + case REDWOOD: + return 4; + case BIRCH: + return 1; + case JUNGLE: + return 3; + case ACACIA: + return 5; + case DARK_OAK: + return 6; + default: + return 0; + } } }