Add remaining BOP food items: ambrosia, salads, earth, ricebowl, shroompowder
|
@ -12,20 +12,32 @@ import net.minecraft.item.Item;
|
||||||
|
|
||||||
public class BOPItems
|
public class BOPItems
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public static Item berries;
|
||||||
|
public static Item shroompowder;
|
||||||
|
public static Item wildcarrots;
|
||||||
|
public static Item peach;
|
||||||
|
public static Item saladfruit;
|
||||||
|
public static Item saladveggie;
|
||||||
|
public static Item saladshroom;
|
||||||
|
public static Item earth;
|
||||||
|
public static Item persimmon;
|
||||||
|
public static Item filled_honeycomb;
|
||||||
|
public static Item ambrosia;
|
||||||
|
public static Item turnip;
|
||||||
|
public static Item pear;
|
||||||
|
public static Item ricebowl;
|
||||||
|
|
||||||
public static Item fleshchunk;
|
public static Item fleshchunk;
|
||||||
public static Item mudball;
|
public static Item mudball;
|
||||||
public static Item turnip;
|
|
||||||
public static Item turnip_seeds;
|
public static Item turnip_seeds;
|
||||||
public static Item persimmon;
|
|
||||||
public static Item peach;
|
|
||||||
public static Item pear;
|
|
||||||
public static Item crystal_shard;
|
public static Item crystal_shard;
|
||||||
public static Item honeycomb;
|
public static Item honeycomb;
|
||||||
public static Item filled_honeycomb;
|
|
||||||
public static Item gem;
|
public static Item gem;
|
||||||
public static Item ash;
|
public static Item ash;
|
||||||
public static Item berries;
|
|
||||||
public static Item wildcarrots;
|
public static Item dart;
|
||||||
|
public static Item dart_blower;
|
||||||
|
|
||||||
public static Item sacred_oak_door;
|
public static Item sacred_oak_door;
|
||||||
public static Item cherry_door;
|
public static Item cherry_door;
|
||||||
|
@ -73,9 +85,6 @@ public class BOPItems
|
||||||
public static Item gold_scythe;
|
public static Item gold_scythe;
|
||||||
public static Item diamond_scythe;
|
public static Item diamond_scythe;
|
||||||
public static Item amethyst_scythe;
|
public static Item amethyst_scythe;
|
||||||
|
|
||||||
public static Item dart;
|
|
||||||
public static Item dart_blower;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -17,6 +17,7 @@ import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.client.resources.model.ModelBakery;
|
import net.minecraft.client.resources.model.ModelBakery;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
|
@ -25,10 +26,12 @@ import net.minecraft.item.ItemFood;
|
||||||
import net.minecraft.item.ItemHoe;
|
import net.minecraft.item.ItemHoe;
|
||||||
import net.minecraft.item.ItemPickaxe;
|
import net.minecraft.item.ItemPickaxe;
|
||||||
import net.minecraft.item.ItemSeeds;
|
import net.minecraft.item.ItemSeeds;
|
||||||
|
import net.minecraft.item.ItemSoup;
|
||||||
import net.minecraft.item.ItemSpade;
|
import net.minecraft.item.ItemSpade;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.Item.ToolMaterial;
|
import net.minecraft.item.Item.ToolMaterial;
|
||||||
import net.minecraft.item.ItemSword;
|
import net.minecraft.item.ItemSword;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
import net.minecraftforge.common.util.EnumHelper;
|
import net.minecraftforge.common.util.EnumHelper;
|
||||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
|
@ -36,6 +39,8 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
import biomesoplenty.api.block.BOPBlocks;
|
||||||
import biomesoplenty.common.command.BOPCommand;
|
import biomesoplenty.common.command.BOPCommand;
|
||||||
|
import biomesoplenty.common.item.ItemAmbrosia;
|
||||||
|
import biomesoplenty.common.item.ItemBOPFood;
|
||||||
import biomesoplenty.common.item.ItemBOPScythe;
|
import biomesoplenty.common.item.ItemBOPScythe;
|
||||||
import biomesoplenty.common.item.ItemDart;
|
import biomesoplenty.common.item.ItemDart;
|
||||||
import biomesoplenty.common.item.ItemDartBlower;
|
import biomesoplenty.common.item.ItemDartBlower;
|
||||||
|
@ -49,20 +54,37 @@ public class ModItems
|
||||||
{
|
{
|
||||||
public static void init()
|
public static void init()
|
||||||
{
|
{
|
||||||
|
// food
|
||||||
|
ambrosia = registerItem(new ItemAmbrosia(), "ambrosia");
|
||||||
|
berries = registerItem(new ItemBOPFood(1, 0.1F, 8), "berries");
|
||||||
|
shroompowder = registerItem(new ItemFood(1, 0.1F, false), "shroompowder");
|
||||||
|
((ItemFood)shroompowder).setAlwaysEdible();
|
||||||
|
((ItemFood)shroompowder).setPotionEffect(Potion.confusion.id, 225, 0, 0.6F);
|
||||||
|
wildcarrots = registerItem(new ItemFood(3, 0.5F, false), "wildcarrots");
|
||||||
|
peach = registerItem(new ItemFood(5, 0.2F, false), "peach");
|
||||||
|
persimmon = registerItem(new ItemFood(5, 0.2F, false), "persimmon");
|
||||||
|
filled_honeycomb = registerItem(new ItemBOPFood(3, 0.4F, 16), "filled_honeycomb");
|
||||||
|
turnip = registerItem(new ItemFood(3, 0.4F, false), "turnip");
|
||||||
|
pear = registerItem(new ItemFood(5, 0.3F, false), "pear");
|
||||||
|
saladfruit = registerItem(new ItemSoup(6), "saladfruit");
|
||||||
|
((ItemFood)saladfruit).setPotionEffect(Potion.digSpeed.id, 775, 1, 0.05F);
|
||||||
|
saladveggie = registerItem(new ItemSoup(6), "saladveggie");
|
||||||
|
((ItemFood)saladveggie).setPotionEffect(Potion.nightVision.id, 1100, 1, 0.05F); // TODO: Is this the right potion effect for veggie salad?
|
||||||
|
saladshroom = registerItem(new ItemSoup(6), "saladshroom");
|
||||||
|
((ItemFood)saladshroom).setPotionEffect(Potion.jump.id, 550, 1, 0.05F);
|
||||||
|
ricebowl = registerItem(new ItemSoup(2), "ricebowl");
|
||||||
|
// TODO: eating earth is supposed to kill you isn't it?
|
||||||
|
earth = registerItem(new ItemFood(0, 0.0F, false), "earth", null); // no creative tab
|
||||||
|
|
||||||
|
|
||||||
fleshchunk = registerItem(new Item(), "fleshchunk");
|
fleshchunk = registerItem(new Item(), "fleshchunk");
|
||||||
mudball = registerItem(new ItemMudball(), "mudball");
|
mudball = registerItem(new ItemMudball(), "mudball");
|
||||||
turnip_seeds = registerItem(new ItemSeeds(BOPBlocks.turnip_block, Blocks.farmland), "turnip_seeds");
|
turnip_seeds = registerItem(new ItemSeeds(BOPBlocks.turnip_block, Blocks.farmland), "turnip_seeds");
|
||||||
turnip = registerItem(new ItemFood(3, 0.4F, false), "turnip");
|
|
||||||
persimmon = registerItem(new ItemFood(5, 0.2F, false), "persimmon");
|
|
||||||
peach = registerItem(new ItemFood(5, 0.5F, false), "peach");
|
|
||||||
pear = registerItem(new ItemFood(5, 0.3F, false), "pear");
|
|
||||||
crystal_shard = registerItem(new Item(), "crystal_shard");
|
crystal_shard = registerItem(new Item(), "crystal_shard");
|
||||||
honeycomb = registerItem(new Item(), "honeycomb");
|
honeycomb = registerItem(new Item(), "honeycomb");
|
||||||
filled_honeycomb = registerItem(new ItemFood(3, 0.4F, false), "filled_honeycomb");
|
|
||||||
gem = registerItem(new ItemGem(), "gem");
|
gem = registerItem(new ItemGem(), "gem");
|
||||||
ash = registerItem(new Item(), "ash");
|
ash = registerItem(new Item(), "ash");
|
||||||
berries = registerItem(new ItemFood(1, 0.1F, false), "berries");
|
|
||||||
wildcarrots = registerItem(new ItemFood(3, 0.5F, false), "wildcarrots");
|
|
||||||
|
|
||||||
dart = registerItem(new ItemDart(), "dart");
|
dart = registerItem(new ItemDart(), "dart");
|
||||||
dart_blower = registerItem(new ItemDartBlower(), "dart_blower");
|
dart_blower = registerItem(new ItemDartBlower(), "dart_blower");
|
||||||
|
@ -158,8 +180,17 @@ public class ModItems
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Item registerItem(Item item, String name)
|
public static Item registerItem(Item item, String name)
|
||||||
|
{
|
||||||
|
return registerItem(item, name, CreativeTabBOP.instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Item registerItem(Item item, String name, CreativeTabs tab)
|
||||||
{
|
{
|
||||||
item.setUnlocalizedName(name).setCreativeTab(CreativeTabBOP.instance);
|
item.setUnlocalizedName(name);
|
||||||
|
if (tab != null)
|
||||||
|
{
|
||||||
|
item.setCreativeTab(CreativeTabBOP.instance);
|
||||||
|
}
|
||||||
GameRegistry.registerItem(item,name);
|
GameRegistry.registerItem(item,name);
|
||||||
BOPCommand.itemCount++;
|
BOPCommand.itemCount++;
|
||||||
|
|
||||||
|
|
66
src/main/java/biomesoplenty/common/item/ItemAmbrosia.java
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright 2014, the Biomes O' Plenty Team
|
||||||
|
*
|
||||||
|
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
|
||||||
|
*
|
||||||
|
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
package biomesoplenty.common.item;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.EnumAction;
|
||||||
|
import net.minecraft.item.ItemFood;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ItemAmbrosia extends ItemFood
|
||||||
|
{
|
||||||
|
|
||||||
|
public ItemAmbrosia()
|
||||||
|
{
|
||||||
|
super(6, 0.8F, false);
|
||||||
|
// can drink even when full
|
||||||
|
this.setAlwaysEdible();
|
||||||
|
// dont' stack
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ambrosia takes twice as long as usual to finish
|
||||||
|
@Override
|
||||||
|
public int getMaxItemUseDuration(ItemStack stack)
|
||||||
|
{
|
||||||
|
return 64;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use drink action/sound instead of eat
|
||||||
|
@Override
|
||||||
|
public EnumAction getItemUseAction(ItemStack stack)
|
||||||
|
{
|
||||||
|
return EnumAction.DRINK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Loads of potion effects
|
||||||
|
@Override
|
||||||
|
protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player)
|
||||||
|
{
|
||||||
|
if (worldIn.isRemote) {return;}
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.absorption.id, 5000, 4));
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.saturation.id, 100, 1));
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 500, 2));
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 500, 2));
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.resistance.id, 600, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
// keep the empty bottle after finishing
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn)
|
||||||
|
{
|
||||||
|
super.onItemUseFinish(stack, worldIn, playerIn);
|
||||||
|
return new ItemStack(Items.glass_bottle);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
30
src/main/java/biomesoplenty/common/item/ItemBOPFood.java
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright 2014, the Biomes O' Plenty Team
|
||||||
|
*
|
||||||
|
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
|
||||||
|
*
|
||||||
|
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
package biomesoplenty.common.item;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemFood;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ItemBOPFood extends ItemFood
|
||||||
|
{
|
||||||
|
public int eatDuration;
|
||||||
|
|
||||||
|
public ItemBOPFood(int amount, float saturation, int eatDuration)
|
||||||
|
{
|
||||||
|
super(amount, saturation, false);
|
||||||
|
this.eatDuration = eatDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxItemUseDuration(ItemStack stack)
|
||||||
|
{
|
||||||
|
return this.eatDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -8,11 +8,10 @@
|
||||||
|
|
||||||
package biomesoplenty.common.util.inventory;
|
package biomesoplenty.common.util.inventory;
|
||||||
|
|
||||||
|
import biomesoplenty.api.item.BOPItems;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
//TODO: Fix icon
|
|
||||||
public class CreativeTabBOP extends CreativeTabs
|
public class CreativeTabBOP extends CreativeTabs
|
||||||
{
|
{
|
||||||
public static final CreativeTabs instance = new CreativeTabBOP(CreativeTabs.getNextID(), "tabBiomesOPlenty");
|
public static final CreativeTabs instance = new CreativeTabBOP(CreativeTabs.getNextID(), "tabBiomesOPlenty");
|
||||||
|
@ -25,6 +24,6 @@ public class CreativeTabBOP extends CreativeTabs
|
||||||
@Override
|
@Override
|
||||||
public Item getTabIconItem()
|
public Item getTabIconItem()
|
||||||
{
|
{
|
||||||
return Item.getItemFromBlock(Blocks.sapling);
|
return BOPItems.earth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "biomesoplenty:items/ambrosia"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ -90, 0, 0 ],
|
||||||
|
"translation": [ 0, 1, -3 ],
|
||||||
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "biomesoplenty:items/earth"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ -90, 0, 0 ],
|
||||||
|
"translation": [ 0, 1, -3 ],
|
||||||
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "biomesoplenty:items/ricebowl"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ -90, 0, 0 ],
|
||||||
|
"translation": [ 0, 1, -3 ],
|
||||||
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "biomesoplenty:items/saladfruit"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ -90, 0, 0 ],
|
||||||
|
"translation": [ 0, 1, -3 ],
|
||||||
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "biomesoplenty:items/saladshroom"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ -90, 0, 0 ],
|
||||||
|
"translation": [ 0, 1, -3 ],
|
||||||
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "biomesoplenty:items/saladveggie"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ -90, 0, 0 ],
|
||||||
|
"translation": [ 0, 1, -3 ],
|
||||||
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "biomesoplenty:items/shroompowder"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ -90, 0, 0 ],
|
||||||
|
"translation": [ 0, 1, -3 ],
|
||||||
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 380 B |
BIN
src/main/resources/assets/biomesoplenty/textures/items/earth.png
Normal file
After Width: | Height: | Size: 387 B |
After Width: | Height: | Size: 255 B |
After Width: | Height: | Size: 357 B |
After Width: | Height: | Size: 335 B |
After Width: | Height: | Size: 351 B |
After Width: | Height: | Size: 316 B |