mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-02-09 00:01:19 +01:00
Allow all ingedients of recipes into the cauldron
This commit is contained in:
parent
b8e0f1f38b
commit
82837e1977
@ -1,8 +1,10 @@
|
||||
package com.dre.brewery;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -11,7 +13,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
|
||||
public class BIngredients {
|
||||
public static ArrayList<Material> possibleIngredients = new ArrayList<Material>();
|
||||
public static Set<Material> possibleIngredients = new HashSet<Material>();
|
||||
public static ArrayList<BRecipe> recipes = new ArrayList<BRecipe>();
|
||||
public static Map<Material, String> cookedNames = new HashMap<Material, String>();
|
||||
private static int lastId = 0;
|
||||
|
@ -72,6 +72,7 @@ public class BRecipe {
|
||||
if (mat != null) {
|
||||
ItemStack stack = new ItemStack(mat, P.p.parseInt(ingredParts[1]), durability);
|
||||
this.ingredients.add(stack);
|
||||
BIngredients.possibleIngredients.add(mat);
|
||||
} else {
|
||||
P.p.errorLog("Unknown Material: " + ingredParts[0]);
|
||||
this.ingredients = null;
|
||||
|
@ -70,7 +70,15 @@ public class P extends JavaPlugin {
|
||||
String v = Bukkit.getBukkitVersion();
|
||||
useUUID = !v.matches(".*1\\.[1-6].*") && !v.matches(".*1\\.7\\.[0-5].*");
|
||||
|
||||
if (!readConfig()) {
|
||||
// load the Config
|
||||
try {
|
||||
if (!readConfig()) {
|
||||
p = null;
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
p = null;
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
@ -161,7 +169,18 @@ public class P extends JavaPlugin {
|
||||
}
|
||||
|
||||
// load the Config
|
||||
readConfig();
|
||||
try {
|
||||
if (!readConfig()) {
|
||||
p = null;
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
p = null;
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
}
|
||||
|
||||
// save and load LanguageReader
|
||||
languageReader.save();
|
||||
|
Loading…
Reference in New Issue
Block a user