mirror of
https://github.com/BentoBoxWorld/Greenhouses.git
synced 2024-11-01 00:09:29 +01:00
Allow omitting LocalBlock in biomes.yml if you don't want a local block to be required.
This commit is contained in:
parent
db3054ab0c
commit
94e6ecc448
@ -182,7 +182,10 @@ public class RecipeManager {
|
|||||||
String[] split = conversions.split(":");
|
String[] split = conversions.split(":");
|
||||||
double convChance = Double.parseDouble(split[0]);
|
double convChance = Double.parseDouble(split[0]);
|
||||||
Material newMaterial = Material.valueOf(split[1]);
|
Material newMaterial = Material.valueOf(split[1]);
|
||||||
Material localMaterial = Material.valueOf(split[2]);
|
Material localMaterial = null;
|
||||||
|
if(split.length > 2) {
|
||||||
|
localMaterial = Material.valueOf(split[2]);
|
||||||
|
}
|
||||||
b.addConvBlocks(oldMaterial, newMaterial, convChance, localMaterial);
|
b.addConvBlocks(oldMaterial, newMaterial, convChance, localMaterial);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -199,7 +202,10 @@ public class RecipeManager {
|
|||||||
Material oldMaterial = Material.valueOf(split[0].toUpperCase());
|
Material oldMaterial = Material.valueOf(split[0].toUpperCase());
|
||||||
double convChance = Double.parseDouble(split[1]);
|
double convChance = Double.parseDouble(split[1]);
|
||||||
Material newMaterial = Material.valueOf(split[2]);
|
Material newMaterial = Material.valueOf(split[2]);
|
||||||
Material localMaterial = Material.valueOf(split[3]);
|
Material localMaterial = null;
|
||||||
|
if(split.length > 3) {
|
||||||
|
localMaterial = Material.valueOf(split[3]);
|
||||||
|
}
|
||||||
b.addConvBlocks(oldMaterial, newMaterial, convChance, localMaterial);
|
b.addConvBlocks(oldMaterial, newMaterial, convChance, localMaterial);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
addon.logError("Could not parse " + oldMat);
|
addon.logError("Could not parse " + oldMat);
|
||||||
|
Loading…
Reference in New Issue
Block a user