2014-05-02 21:31:20 +02:00
|
|
|
/*******************************************************************************
|
2014-08-07 08:29:25 +02:00
|
|
|
* Copyright (c) 2011-2014 SirSengir.
|
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
|
* are made available under the terms of the GNU Lesser Public License v3
|
|
|
|
|
* which accompanies this distribution, and is available at
|
2014-08-07 02:56:58 -07:00
|
|
|
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
2015-01-26 22:26:21 -08:00
|
|
|
*
|
2014-08-07 08:29:25 +02:00
|
|
|
* Various Contributors including, but not limited to:
|
|
|
|
|
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
2014-05-02 21:31:20 +02:00
|
|
|
******************************************************************************/
|
|
|
|
|
package forestry.plugins;
|
|
|
|
|
|
2015-01-26 22:26:21 -08:00
|
|
|
import net.minecraft.init.Items;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
2014-05-02 21:31:20 +02:00
|
|
|
import cpw.mods.fml.common.network.IGuiHandler;
|
2015-01-26 22:26:21 -08:00
|
|
|
|
2014-05-02 21:31:20 +02:00
|
|
|
import forestry.api.food.BeverageManager;
|
|
|
|
|
import forestry.api.food.IBeverageEffect;
|
|
|
|
|
import forestry.core.config.Defaults;
|
|
|
|
|
import forestry.core.config.ForestryItem;
|
2014-12-13 18:58:49 -08:00
|
|
|
import forestry.core.fluids.Fluids;
|
2014-05-02 21:31:20 +02:00
|
|
|
import forestry.core.interfaces.IOreDictionaryHandler;
|
|
|
|
|
import forestry.core.interfaces.ISaveEventHandler;
|
|
|
|
|
import forestry.core.items.ItemForestryFood;
|
|
|
|
|
import forestry.core.proxy.Proxies;
|
|
|
|
|
import forestry.core.utils.LiquidHelper;
|
|
|
|
|
import forestry.food.BeverageEffect;
|
|
|
|
|
import forestry.food.GuiHandlerFood;
|
|
|
|
|
import forestry.food.items.ItemAmbrosia;
|
|
|
|
|
import forestry.food.items.ItemBeverage;
|
|
|
|
|
import forestry.food.items.ItemBeverage.BeverageInfo;
|
|
|
|
|
import forestry.food.items.ItemInfuser;
|
|
|
|
|
|
2014-09-27 12:46:54 -07:00
|
|
|
@Plugin(pluginID = "Food", name = "Food", author = "SirSengir", url = Defaults.URL, unlocalizedDescription = "for.plugin.food.description")
|
2014-09-20 22:43:13 -07:00
|
|
|
public class PluginFood extends ForestryPlugin {
|
2014-05-02 21:31:20 +02:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void preInit() {
|
|
|
|
|
super.preInit();
|
|
|
|
|
|
|
|
|
|
// Init seasoner
|
|
|
|
|
BeverageManager.infuserManager = new ItemInfuser.MixtureManager();
|
|
|
|
|
BeverageManager.ingredientManager = new ItemInfuser.IngredientManager();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void postInit() {
|
|
|
|
|
super.postInit();
|
|
|
|
|
|
|
|
|
|
ItemInfuser.initialize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void registerItems() {
|
|
|
|
|
// / FOOD ITEMS
|
|
|
|
|
ForestryItem.honeyedSlice.registerItem(new ItemForestryFood(8, 0.6f), "honeyedSlice");
|
|
|
|
|
ForestryItem.beverage.registerItem(new ItemBeverage(
|
2015-01-26 22:26:21 -08:00
|
|
|
new BeverageInfo("meadShort", "glass", 0xec9a19, 0xffffff, 1, 0.2f, true),
|
|
|
|
|
new BeverageInfo("meadCurative", "glass", 0xc5feff, 0xffffff, 1, 0.2f, true)),
|
2014-08-18 17:45:04 +02:00
|
|
|
"beverage");
|
2014-05-02 21:31:20 +02:00
|
|
|
ForestryItem.ambrosia.registerItem(new ItemAmbrosia().setIsDrink(), "ambrosia");
|
|
|
|
|
ForestryItem.honeyPot.registerItem(new ItemForestryFood(2, 0.2f).setIsDrink(), "honeyPot");
|
|
|
|
|
|
|
|
|
|
// / SEASONER
|
|
|
|
|
ForestryItem.infuser.registerItem(new ItemInfuser(), "infuser");
|
|
|
|
|
|
|
|
|
|
// Mead
|
|
|
|
|
ItemStack meadBottle = ForestryItem.beverage.getItemStack();
|
2015-01-26 22:26:21 -08:00
|
|
|
((ItemBeverage) ForestryItem.beverage.item()).beverages[0].saveEffects(meadBottle, new IBeverageEffect[]{BeverageEffect.weakAlcoholic});
|
2014-05-02 21:31:20 +02:00
|
|
|
|
2014-12-13 18:58:49 -08:00
|
|
|
LiquidHelper.injectLiquidContainer(Fluids.SHORT_MEAD, Defaults.BUCKET_VOLUME, meadBottle, new ItemStack(Items.glass_bottle));
|
2014-05-02 21:31:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void registerBackpackItems() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void registerRecipes() {
|
|
|
|
|
// INFUSER
|
|
|
|
|
Proxies.common.addRecipe(ForestryItem.infuser.getItemStack(),
|
|
|
|
|
"X", "#", "X",
|
|
|
|
|
'#', Items.iron_ingot,
|
|
|
|
|
'X', "ingotBronze");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void registerCrates() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public IGuiHandler getGuiHandler() {
|
|
|
|
|
return new GuiHandlerFood();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ISaveEventHandler getSaveEventHandler() {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public IOreDictionaryHandler getDictionaryHandler() {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|