mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-17 19:05:31 +00:00
Move food items into PluginFood.items
This commit is contained in:
1 parent
fc289c16d4
commit
0e53fccfdb
10 files changed
+261
-177
No files matched your search
@@ -10,34 +10,29 @@
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.food.BeverageManager;
|
||||
import forestry.apiculture.items.EnumPollenCluster;
|
||||
import forestry.apiculture.items.ItemRegistryApiculture;
|
||||
import forestry.core.GuiHandlerBase;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.fluids.LiquidRegistryHelper;
|
||||
import forestry.core.items.ItemForestryFood;
|
||||
import forestry.core.items.ItemWithGui;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.food.BeverageEffect;
|
||||
import forestry.food.GuiHandlerFood;
|
||||
import forestry.food.InfuserIngredientManager;
|
||||
import forestry.food.InfuserMixtureManager;
|
||||
import forestry.food.items.ItemAmbrosia;
|
||||
import forestry.food.items.ItemBeverage;
|
||||
import forestry.food.items.ItemBeverage.BeverageInfo;
|
||||
import forestry.food.items.EnumBeverage;
|
||||
import forestry.food.items.ItemRegistryFood;
|
||||
|
||||
@Plugin(pluginID = "Food", name = "Food", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.food.description")
|
||||
public class PluginFood extends ForestryPlugin {
|
||||
|
||||
public static ItemRegistryFood items;
|
||||
|
||||
@Override
|
||||
protected void setupAPI() {
|
||||
super.setupAPI();
|
||||
@@ -49,33 +44,19 @@ public class PluginFood extends ForestryPlugin {
|
||||
|
||||
@Override
|
||||
protected void registerItemsAndBlocks() {
|
||||
// / FOOD ITEMS
|
||||
ForestryItem.honeyedSlice.registerItem(new ItemForestryFood(8, 0.6f), "honeyedSlice");
|
||||
ForestryItem.beverage.registerItem(new ItemBeverage(
|
||||
new BeverageInfo("meadShort", "glass", 0xec9a19, 0xffffff, 1, 0.2f, true),
|
||||
new BeverageInfo("meadCurative", "glass", 0xc5feff, 0xffffff, 1, 0.2f, true)),
|
||||
"beverage");
|
||||
ForestryItem.ambrosia.registerItem(new ItemAmbrosia().setIsDrink(), "ambrosia");
|
||||
ForestryItem.honeyPot.registerItem(new ItemForestryFood(2, 0.2f).setIsDrink(), "honeyPot");
|
||||
|
||||
// / SEASONER
|
||||
Item infuser = new ItemWithGui(GuiId.InfuserGUI);
|
||||
ForestryItem.infuser.registerItem(infuser, "infuser");
|
||||
|
||||
// Mead
|
||||
ItemStack meadBottle = ForestryItem.beverage.getItemStack();
|
||||
BeverageInfo.saveEffects(meadBottle, Collections.singletonList(BeverageEffect.weakAlcoholic));
|
||||
items = new ItemRegistryFood();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preInit() {
|
||||
super.preInit();
|
||||
|
||||
LiquidRegistryHelper.registerLiquidContainer(Fluids.SHORT_MEAD, Constants.BUCKET_VOLUME, ForestryItem.beverage.getItemStack(), new ItemStack(Items.glass_bottle));
|
||||
LiquidRegistryHelper.registerLiquidContainer(Fluids.SHORT_MEAD, Constants.BUCKET_VOLUME, items.beverage.get(EnumBeverage.MEAD_SHORT, 1), new ItemStack(Items.glass_bottle));
|
||||
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
ItemStack normalPollenCluster = PluginApiculture.items.pollenCluster.get(EnumPollenCluster.NORMAL, 1);
|
||||
ItemStack crystallinePollenCluster = PluginApiculture.items.pollenCluster.get(EnumPollenCluster.CRYSTALLINE, 1);
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
if (beeItems != null) {
|
||||
ItemStack normalPollenCluster = beeItems.pollenCluster.get(EnumPollenCluster.NORMAL, 1);
|
||||
ItemStack crystallinePollenCluster = beeItems.pollenCluster.get(EnumPollenCluster.CRYSTALLINE, 1);
|
||||
|
||||
BeverageManager.ingredientManager.addIngredient(normalPollenCluster, "Strong Curative");
|
||||
BeverageManager.ingredientManager.addIngredient(crystallinePollenCluster, "Weak Curative");
|
||||
@@ -87,7 +68,7 @@ public class PluginFood extends ForestryPlugin {
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
// INFUSER
|
||||
RecipeUtil.addRecipe(ForestryItem.infuser.getItemStack(),
|
||||
RecipeUtil.addRecipe(items.infuser.getItemStack(),
|
||||
"X", "#", "X",
|
||||
'#', "ingotIron",
|
||||
'X', "ingotBronze");
|
||||
|
||||
Reference in new issue
Block a user