Skip to content

Commit

Permalink
Added option for cooking pot to also cook ores.
Browse files Browse the repository at this point in the history
Signed-off-by: me4502 <mnmiller1@hotmail.com>
  • Loading branch information
me4502 committed Nov 13, 2012
1 parent fb22213 commit 98d99d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Expand Up @@ -229,11 +229,13 @@ public class CookingPotSettings {

public final boolean enable;
public final boolean requiresfuel;
public final boolean cooksOres;

private CookingPotSettings(BaseConfigurationSection section) {

enable = section.getBoolean("enable", true);
requiresfuel = section.getBoolean("requires-fuel", false);
cooksOres = section.getBoolean("cooks-ores", false);
}
}
public class CustomCraftingSettings {
Expand Down
Expand Up @@ -141,7 +141,8 @@ public void think() {
int z = b.getZ();
Block cb = sign.getWorld().getBlockAt(x, y, z);
if (cb.getTypeId() == BlockID.CHEST) {
if (ItemUtil.containsRawFood(((Chest) cb.getState()).getInventory())) {
if (ItemUtil.containsRawFood(((Chest) cb.getState()).getInventory())
|| ItemUtil.containsRawMinerals(((Chest) cb.getState()).getInventory()) && plugin.getLocalConfiguration().cookingPotSettings.cooksOres) {
decreaseMultiplier(sign, 1);
lastTick += getMultiplier(sign);
}
Expand All @@ -155,7 +156,10 @@ public void think() {
}
ItemStack cooked = ItemUtil.getCookedResult(i);
if (cooked == null) {
continue;
if(plugin.getLocalConfiguration().cookingPotSettings.cooksOres)
cooked = ItemUtil.getSmeletedResult(i);
if(cooked == null)
continue;
}
chest.getInventory().addItem(new ItemStack(cooked.getType(), 1));
chest.getInventory().removeItem(new ItemStack(i.getType(), 1));
Expand Down

0 comments on commit 98d99d0

Please sign in to comment.