Added chunk of flesh, fixed jars

This commit is contained in:
Matt Caughey 2013-11-14 21:56:00 -05:00
parent 557ec35bc7
commit b6c0cd41bd
10 changed files with 143 additions and 16 deletions

View file

@ -41,6 +41,8 @@ public class Items
public static Optional<? extends Item> enderporter = Optional.absent();
public static Optional<? extends Item> food = Optional.absent();
public static Optional<? extends Item> miscItems = Optional.absent();
public static Optional<? extends Item> jarEmpty = Optional.absent();
public static Optional<? extends Item> jarFilled = Optional.absent();
public static Optional<? extends Item> mudball = Optional.absent();
public static Optional<? extends Item> poison = Optional.absent();
public static Optional<? extends Item> dartBlower = Optional.absent();

View file

@ -77,4 +77,28 @@ public class BlockFlesh extends Block
entity.motionX *= 0.9D;
entity.motionZ *= 0.9D;
}
/**
* Returns the ID of the items to drop on destruction.
*/
@Override
public int idDropped(int par1, Random par2Random, int par3)
{
return Items.miscItems.get().itemID;
}
@Override
public int damageDropped(int meta)
{
return 3;
}
/**
* Returns the quantity of items to drop on block destruction.
*/
@Override
public int quantityDropped(Random par1Random)
{
return par1Random.nextInt(5);
}
}

View file

@ -259,12 +259,16 @@ public class BOPCrafting
{
GameRegistry.addRecipe(new ItemStack(Items.dartBlower.get(), 1), new Object[] {"R R", "R R", "R R", Character.valueOf('R'), new ItemStack(Blocks.plants.get(), 1, 8)});
GameRegistry.addRecipe(new ItemStack(Items.dart.get(), 4, 0), new Object[] {"T", "R", "F", Character.valueOf('T'), new ItemStack(Blocks.plants.get(), 1, 5), Character.valueOf('R'), new ItemStack(Blocks.plants.get(), 1, 8), Character.valueOf('F'), Item.feather});
GameRegistry.addShapelessRecipe(new ItemStack(Items.dart.get(), 1, 1), new Object[] {new ItemStack(Items.miscItems.get(), 1, 13), new ItemStack(Items.dart.get(), 1, 0)});
GameRegistry.addShapelessRecipe(new ItemStack(Items.dart.get(), 1, 1), new Object[] {new ItemStack(Items.jarFilled.get(), 1, 1), new ItemStack(Items.dart.get(), 1, 0)});
}
GameRegistry.addRecipe(new ItemStack(Items.bopDiscMud.get(), 1), new Object[] {" M ", "MDM", " M ", 'M', Items.mudball.get(), 'D', Items.bopDisc.get()});
GameRegistry.addRecipe(new ItemStack(Blocks.planks.get(), 1, 10), new Object[] {"##", "##", '#', Blocks.bamboo.get()});
GameRegistry.addRecipe(new ItemStack(Items.jarEmpty.get(), 3, 0), new Object[] {"# #", "# #", "###", '#', Block.glass});
GameRegistry.addRecipe(new ItemStack(Blocks.flesh.get(), 1, 0), new Object[] {"##", "##", '#', new ItemStack(Items.miscItems.get(), 1, 3)});
GameRegistry.addRecipe(new ItemStack(Item.rottenFlesh, 1, 0), new Object[] {"FFF", "FPF", "FFF", 'F', new ItemStack(Items.miscItems.get(), 1, 3), 'P', new ItemStack(Items.jarFilled.get(), 1, 1)});
GameRegistry.addRecipe(new ItemStack(Blocks.bamboo.get(), 8), new Object [] {" #", "# ", Character.valueOf('#'), new ItemStack(Blocks.planks.get(), 1, 10)});
GameRegistry.addRecipe(new ItemStack(Blocks.bamboo.get(), 8), new Object [] {"# ", " #", Character.valueOf('#'), new ItemStack(Blocks.planks.get(), 1, 10)});
@ -287,7 +291,7 @@ public class BOPCrafting
//Plants
GameRegistry.addShapelessRecipe(new ItemStack(Items.food.get(), 2, 1), new Object[] {new ItemStack(Blocks.mushrooms.get(),1,0)});
GameRegistry.addShapelessRecipe(new ItemStack(Items.miscItems.get(), 1, 13), new Object[] {new ItemStack(Blocks.foliage.get(),1,7), new ItemStack(Items.miscItems.get(),1, 11)});
GameRegistry.addShapelessRecipe(new ItemStack(Items.jarFilled.get(), 1, 1), new Object[] {new ItemStack(Blocks.foliage.get(),1,7), new ItemStack(Items.jarEmpty.get(),1, 0)});
GameRegistry.addShapelessRecipe(new ItemStack(Items.food.get(), 1, 4), new Object[] {Item.bowlEmpty, new ItemStack(Items.food.get(), 1, 0), Item.appleRed, Item.melon});
GameRegistry.addShapelessRecipe(new ItemStack(Items.food.get(), 1, 5), new Object[] {Item.bowlEmpty, new ItemStack(Items.food.get(), 1, 2), Item.carrot, Item.potato});
GameRegistry.addShapelessRecipe(new ItemStack(Items.food.get(), 1, 6), new Object[] {Item.bowlEmpty, new ItemStack(Blocks.mushrooms.get(), 1, 0), new ItemStack(Blocks.mushrooms.get(), 1, 1), new ItemStack(Blocks.mushrooms.get(), 1, 2)});

View file

@ -32,6 +32,8 @@ import biomesoplenty.items.ItemDart;
import biomesoplenty.items.ItemDartBlower;
import biomesoplenty.items.ItemEnderporter;
import biomesoplenty.items.ItemGems;
import biomesoplenty.items.ItemJarEmpty;
import biomesoplenty.items.ItemJarFilled;
import com.google.common.base.Optional;
@ -107,6 +109,8 @@ public class BOPItems {
// Item declaration
Items.food = Optional.of(new ItemBOPFood(BOPConfigurationIDs.foodID).setUnlocalizedName("bop.food"));
Items.miscItems = Optional.of(new ItemBOP(BOPConfigurationIDs.miscItemsID).setUnlocalizedName("bop.miscItems"));
Items.jarEmpty = Optional.of(new ItemJarEmpty(BOPConfigurationIDs.jarEmptyID).setUnlocalizedName("bop.jarEmpty"));
Items.jarFilled = Optional.of(new ItemJarFilled(BOPConfigurationIDs.jarFilledID).setUnlocalizedName("bop.jarFilled").setContainerItem(Items.jarEmpty.get()));
Items.gems = Optional.of(new ItemGems(BOPConfigurationIDs.gemsID).setUnlocalizedName("bop.gems"));
Items.mudball = Optional.of(new ItemBOPMudball(BOPConfigurationIDs.mudballID).setUnlocalizedName("bop.mudball"));
Items.dartBlower = Optional.of(new ItemDartBlower(BOPConfigurationIDs.dartBlowerID).setUnlocalizedName("bop.dartblower"));

View file

@ -113,6 +113,8 @@ public class BOPConfigurationIDs
public static int bopDiscMudID;
public static int miscItemsID;
public static int jarEmptyID;
public static int jarFilledID;
public static int mudballID;
public static int dartBlowerID;
public static int dartID;
@ -424,6 +426,11 @@ public class BOPConfigurationIDs
//Misc Items
miscItemsID = config.getItem("Misc Items ID", 21003).getInt();
//Jars
jarEmptyID = config.getItem("Jar (Empty) ID", 21005).getInt();
jarFilledID = config.getItem("Jar (Filled) ID", 21006).getInt();
mudballID = config.getItem("Mud Ball ID", 21007).getInt();
//Gems

View file

@ -14,7 +14,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemBOP extends Item
{
private static String[] items = {"mudbrick", "ash", "emptyhoneycomb", "thing", "crystalshard", "bluedye", "browndye", "greendye", "whitedye", "blackdye", "ghastlysoul", "jarempty", "jarhoney", "jarpoison"};
private static String[] items = {"mudbrick", "ash", "emptyhoneycomb", "fleshchunk", "crystalshard", "bluedye", "browndye", "greendye", "whitedye", "blackdye", "ghastlysoul"};
@SideOnly(Side.CLIENT)
private Icon[] textures;
@ -60,15 +60,7 @@ public class ItemBOP extends Item
@Override
public int getItemStackLimit(ItemStack par1ItemStack)
{
if (par1ItemStack.itemID == this.itemID && par1ItemStack.getItemDamage() == 11)
{
return 1;
}
if (par1ItemStack.itemID == this.itemID && par1ItemStack.getItemDamage() == 12)
{
return 1;
}
if (par1ItemStack.itemID == this.itemID && par1ItemStack.getItemDamage() == 13)
if (par1ItemStack.itemID == this.itemID && par1ItemStack.getItemDamage() == 10)
{
return 1;
}

View file

@ -0,0 +1,24 @@
package biomesoplenty.items;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.entities.projectiles.EntityMudball;
public class ItemJarEmpty extends Item
{
public ItemJarEmpty(int par1)
{
super(par1);
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("biomesoplenty:jarempty");
}
}

View file

@ -0,0 +1,69 @@
package biomesoplenty.items;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemJarFilled extends Item
{
private static String[] jars = {"jarhoney", "jarpoison"};
@SideOnly(Side.CLIENT)
private Icon[] textures;
public ItemJarFilled(int id)
{
super(id);
setMaxDamage(0);
setMaxStackSize(1);
setHasSubtypes(true);
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
public void registerIcons(IconRegister iconRegister)
{
textures = new Icon[jars.length];
for (int i = 0; i < jars.length; ++i) {
textures[i] = iconRegister.registerIcon("biomesoplenty:"+jars[i]);
}
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= jars.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + jars[meta];
}
@Override
public Icon getIconFromDamage(int meta)
{
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void getSubItems(int itemId, CreativeTabs creativeTab, List subTypes)
{
for(int meta = 0; meta < jars.length; ++meta) {
subTypes.add(new ItemStack(itemId, 1, meta));
}
}
}

View file

@ -307,7 +307,7 @@ item.bop.mudball.name=Mud Ball
item.bop.miscItems.mudbrick.name=Mud Brick
item.bop.miscItems.ash.name=Pile of Ashes
item.bop.miscItems.fleshchunk.name=Chunk of Flesh
item.bop.miscItems.emptyhoneycomb.name=Empty Honeycomb
item.bop.miscItems.crystalshard.name=Celestial Crystal Shard
item.bop.miscItems.bluedye.name=Blue Dye
@ -316,9 +316,10 @@ item.bop.miscItems.greendye.name=Green Dye
item.bop.miscItems.whitedye.name=White Dye
item.bop.miscItems.blackdye.name=Black Dye
item.bop.miscItems.ghastlysoul.name=Ghastly Soul
item.bop.miscItems.jarempty.name=Empty Jar
item.bop.miscItems.jarhoney.name=Honey Jar
item.bop.miscItems.jarpoison.name=Poison Extract Jar
item.bop.jarEmpty.name=Empty Jar
item.bop.jarFilled.jarhoney.name=Honey Jar
item.bop.jarFilled.jarpoison.name=Poison Extract Jar
item.bop.gems.amethyst.name=Amethyst
item.bop.gems.ruby.name=Ruby

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B