Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.morefood.mod.crops;
- import java.util.ArrayList;
- import java.util.Random;
- import com.morefood.mod.Debugger;
- import com.morefood.mod.Morefood;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import net.minecraft.block.BlockCrops;
- import net.minecraft.client.renderer.texture.IIconRegister;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.IIcon;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.World;
- import net.minecraftforge.common.EnumPlantType;
- public class PapCrop extends BlockCrops
- {
- @SideOnly(Side.CLIENT)
- private IIcon[] iconArray;
- private Random r = new Random();
- private int bufferstage;
- @Override
- public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
- {
- return EnumPlantType.Crop;
- }
- @Override
- public Item getItemDropped(int stage, Random random, int j)
- {
- return customGetDropFunction(stage);
- }
- @Override
- public int quantityDropped(Random random) {
- Debugger.log(bufferstage);
- if (bufferstage == 4) {
- return 3;
- }else if (bufferstage == 5) {
- return 3;
- }else if (bufferstage == 6) {
- return 3;
- }else{
- return 1;
- }
- }
- public Item customGetDropFunction(int stage) {
- Debugger.log(bufferstage);
- bufferstage = stage;
- if (stage == 4) {
- return Morefood.cropGreenPaprika;
- }else if (stage == 5){
- return Morefood.cropYellowPaprika;
- }else if (stage == 6){
- return Morefood.cropRedPaprika;
- }else{
- return (Morefood.cropPaprikaSeeds);
- }
- }
- protected Item func_149866_i()
- {
- return null;
- }
- protected Item func_149865_P()
- {
- return null;
- }
- /**
- * Gets the block's texture. Args: side, meta
- */
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(int side, int metadata)
- {
- if (metadata < 7)
- {
- return this.iconArray[metadata];
- }
- else
- {
- return this.iconArray[6];
- }
- }
- @SideOnly(Side.CLIENT)
- public Item getItem(World world, int i, int j, int k)
- {
- return Morefood.cropPaprikaSeeds;
- }
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister iconRegister)
- {
- this.iconArray = new IIcon[7];
- for (int i = 0; i < this.iconArray.length; ++i)
- {
- this.iconArray[i] = iconRegister.registerIcon(Morefood.modid + ":" + this.getUnlocalizedName().substring(5) + (i + 1));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement