1.16 Wood types for Barrels #330

This commit is contained in:
Sn0wStorm 2020-11-08 15:53:14 +01:00
parent 3fa16414d0
commit e28cd72af9
12 changed files with 60 additions and 42 deletions

View File

@ -245,7 +245,7 @@ cauldron:
# cookingtime: Zeit in Echtminuten die die Zutaten kochen müssen # cookingtime: Zeit in Echtminuten die die Zutaten kochen müssen
# distillruns: Wie oft destilliert werden muss für vollen Alkoholgehalt (0=ohne Destillieren) # 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 # 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 # Das Minecraft Fass besteht aus Eiche
# age: Zeit in Minecraft-Tagen, die das Getränk im Fass reifen muss 0= kein reifen # age: Zeit in Minecraft-Tagen, die das Getränk im Fass reifen muss 0= kein reifen
# color: Farbe des Getränks nach destillieren/reifen. # color: Farbe des Getränks nach destillieren/reifen.

View File

@ -246,7 +246,7 @@ cauldron:
# cookingtime: Time in real minutes ingredients have to boil # cookingtime: Time in real minutes ingredients have to boil
# distillruns: How often it has to be distilled for full alcohol (0=without distilling) # 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 # 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 # The Minecraft barrel is made of oak
# age: Time in Minecraft-days, the potion has to age in a barrel 0=no aging # age: Time in Minecraft-days, the potion has to age in a barrel 0=no aging
# color: Color of the potion after distilling/aging. # color: Color of the potion after distilling/aging.

View File

@ -248,7 +248,7 @@ cauldron:
# cookingtime: Temps en minutes réelles durant lesquelles les ingrédients devront bouillir # 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) # 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 # 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. # 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 # 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. # color: Couleur de la potion après distillation/avoir laissé vieillir.

View File

@ -244,7 +244,7 @@ cauldron:
# cookingtime: Tempo in minuti richiesto dagli ingredienti per bollire # 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). # 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 # 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 # 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). # 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 # color: Colore della pozione dopo essere stata distillata/invecchiata

View File

@ -415,7 +415,7 @@ cauldron:
# cookingtime: Zeit in Echtminuten die die Zutaten kochen müssen # cookingtime: Zeit in Echtminuten die die Zutaten kochen müssen
# distillruns: Wie oft destilliert werden muss für vollen Alkoholgehalt (0=ohne Destillieren) # 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 # 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 # Das Minecraft Fass besteht aus Eiche
# age: Zeit in Minecraft-Tagen, die das Getränk im Fass reifen muss 0= kein reifen # age: Zeit in Minecraft-Tagen, die das Getränk im Fass reifen muss 0= kein reifen
# color: Farbe des Getränks nach destillieren/reifen. # color: Farbe des Getränks nach destillieren/reifen.

View File

@ -415,7 +415,7 @@ cauldron:
# cookingtime: Time in real minutes ingredients have to boil # cookingtime: Time in real minutes ingredients have to boil
# distillruns: How often it has to be distilled for full alcohol (0=without distilling) # 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 # 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 # The Minecraft barrel is made of oak
# age: Time in Minecraft-days, the potion has to age in a barrel 0=no aging # age: Time in Minecraft-days, the potion has to age in a barrel 0=no aging
# color: Color of the potion after distilling/aging. # color: Color of the potion after distilling/aging.

View File

@ -415,7 +415,7 @@ cauldron:
# cookingtime: Time in real minutes ingredients have to boil # cookingtime: Time in real minutes ingredients have to boil
# distillruns: How often it has to be distilled for full alcohol (0=without distilling) # 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 # 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 # The Minecraft barrel is made of oak
# age: Time in Minecraft-days, the potion has to age in a barrel 0=no aging # age: Time in Minecraft-days, the potion has to age in a barrel 0=no aging
# color: Color of the potion after distilling/aging. # color: Color of the potion after distilling/aging.

View File

@ -418,7 +418,7 @@ cauldron:
# cookingtime: Temps en minutes réelles durant lesquelles les ingrédients devront bouillir # 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) # 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 # 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. # 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 # 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. # color: Couleur de la potion après distillation/avoir laissé vieillir.

View File

@ -415,7 +415,7 @@ cauldron:
# cookingtime: Tempo in minuti richiesto dagli ingredienti per bollire # 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). # 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 # 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 # 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). # 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 # color: Colore della pozione dopo essere stata distillata/invecchiata

View File

@ -417,7 +417,7 @@ cauldron:
# cookingtime: 原料需要在炼药锅内烹制发酵的时间, 单位为现实分钟. # cookingtime: 原料需要在炼药锅内烹制发酵的时间, 单位为现实分钟.
# distillruns: 饮品需要在酿造台上蒸馏的次数(0=无需蒸馏). # distillruns: 饮品需要在酿造台上蒸馏的次数(0=无需蒸馏).
# distilltime: 每次蒸馏所需要耗费的时间(0=默认值, 即40秒), MC默认则为20秒/ # 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的木桶默认为橡木桶. # MC的木桶默认为橡木桶.
# age: 饮品需要在木桶中熟成所需要的时间(MC天). 0=无需熟成. # age: 饮品需要在木桶中熟成所需要的时间(MC天). 0=无需熟成.
# color: 饮品制成后的颜色. # color: 饮品制成后的颜色.

View File

@ -405,12 +405,13 @@ public class Barrel implements InventoryHolder {
} }
} }
if (event.willDropItems()) { if (event.willDropItems()) {
byte wood = body.getWood();
for (ItemStack item : items) { for (ItemStack item : items) {
if (item != null) { if (item != null) {
Brew brew = Brew.get(item); Brew brew = Brew.get(item);
if (brew != null) { if (brew != null) {
// Brew before throwing // Brew before throwing
brew.age(item, time, body.getWood()); brew.age(item, time, wood);
PotionMeta meta = (PotionMeta) item.getItemMeta(); PotionMeta meta = (PotionMeta) item.getItemMeta();
if (BrewLore.hasColorLore(meta)) { if (BrewLore.hasColorLore(meta)) {
BrewLore lore = new BrewLore(brew, meta); BrewLore lore = new BrewLore(brew, meta);

View File

@ -50,6 +50,25 @@ public class LegacyUtil {
} }
PLANKS = planks; PLANKS = planks;
Set<Material> 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<Material> fences = EnumSet.noneOf(Material.class); Set<Material> fences = EnumSet.noneOf(Material.class);
for (Material m : Material.values()) { for (Material m : Material.values()) {
if (m.name().endsWith("FENCE")) { 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_CAMPFIRE = get("SOUL_CAMPFIRE");
public static final Material SOUL_FIRE = get("SOUL_FIRE"); public static final Material SOUL_FIRE = get("SOUL_FIRE");
public static final Material CLOCK = get("CLOCK", "WATCH"); 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<Material> PLANKS; public static final Set<Material> PLANKS;
public static final Set<Material> WOOD_STAIRS;
public static final Set<Material> FENCES; public static final Set<Material> FENCES;
// Materials removed in 1.13 // Materials removed in 1.13
@ -99,8 +113,7 @@ public class LegacyUtil {
} }
public static boolean isWoodStairs(Material type) { public static boolean isWoodStairs(Material type) {
return type == OAK_STAIRS || type == SPRUCE_STAIRS || type == BIRCH_STAIRS || type == JUNGLE_STAIRS return WOOD_STAIRS.contains(type);
|| (type == ACACIA_STAIRS && ACACIA_STAIRS != null) || (type == DARK_OAK_STAIRS && DARK_OAK_STAIRS != null);
} }
public static boolean isFence(Material type) { public static boolean isFence(Material type) {
@ -153,22 +166,25 @@ public class LegacyUtil {
} }
public static byte getWoodType(Block wood) throws NoSuchFieldError, NoClassDefFoundError { public static byte getWoodType(Block wood) throws NoSuchFieldError, NoClassDefFoundError {
TreeSpecies woodType;
if (P.use1_13 || isWoodStairs(wood.getType())) { if (P.use1_13 || isWoodStairs(wood.getType())) {
String material = wood.getType().name(); String material = wood.getType().name();
if (material.startsWith("OAK")) { if (material.startsWith("OAK")) {
woodType = TreeSpecies.GENERIC; return 2;
} else if (material.startsWith("SPRUCE")) { } else if (material.startsWith("SPRUCE")) {
woodType = TreeSpecies.REDWOOD; return 4;
} else if (material.startsWith("BIRCH")) { } else if (material.startsWith("BIRCH")) {
woodType = TreeSpecies.BIRCH; return 1;
} else if (material.startsWith("JUNGLE")) { } else if (material.startsWith("JUNGLE")) {
woodType = TreeSpecies.JUNGLE; return 3;
} else if (material.startsWith("ACACIA")) { } else if (material.startsWith("ACACIA")) {
woodType = TreeSpecies.ACACIA; return 5;
} else if (material.startsWith("DARK_OAK")) { } 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 { } else {
return 0; return 0;
} }
@ -176,6 +192,7 @@ public class LegacyUtil {
} else { } else {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
MaterialData data = wood.getState().getData(); MaterialData data = wood.getState().getData();
TreeSpecies woodType;
if (data instanceof Tree) { if (data instanceof Tree) {
woodType = ((Tree) data).getSpecies(); woodType = ((Tree) data).getSpecies();
} else if (data instanceof Wood) { } else if (data instanceof Wood) {
@ -183,23 +200,23 @@ public class LegacyUtil {
} else { } else {
return 0; return 0;
} }
}
switch (woodType) { switch (woodType) {
case GENERIC: case GENERIC:
return 2; return 2;
case REDWOOD: case REDWOOD:
return 4; return 4;
case BIRCH: case BIRCH:
return 1; return 1;
case JUNGLE: case JUNGLE:
return 3; return 3;
case ACACIA: case ACACIA:
return 5; return 5;
case DARK_OAK: case DARK_OAK:
return 6; return 6;
default: default:
return 0; return 0;
}
} }
} }