Created
July 20, 2014 06:03
-
-
Save Propucani2/58a26a6d29240dba856b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mods.itemsmod.plants; | |
import java.util.Random; | |
import com.mods.itemsmod.MainClass; | |
import net.minecraft.client.renderer.texture.IIconRegister; | |
import net.minecraft.item.Item; | |
import net.minecraft.util.IIcon; | |
import cpw.mods.fml.relauncher.Side; | |
import cpw.mods.fml.relauncher.SideOnly; | |
public class BlockCucumber extends ItemBlockCrops { | |
public BlockCucumber() { | |
// Basic block setup | |
setBlockName("Cucumbers"); | |
setBlockTextureName(MainClass.MODID + ":cucumber_stage_0"); } | |
/** | |
* Returns the quantity of items to drop on block destruction. | |
*/ | |
@Override | |
public int quantityDropped(int parMetadata, int parFortune, Random parRand) | |
{ | |
return (parMetadata/2); | |
} | |
@Override | |
public Item getItemDropped(int parMetadata, Random parRand, int parFortune){ | |
// DEBUG | |
System.out.println("BlockBlueberry getItemDropped()"); | |
return (MainClass.CucumberItem); } | |
@Override | |
@SideOnly(Side.CLIENT) | |
public void registerBlockIcons(IIconRegister parIIconRegister) { | |
iIcon = new IIcon[8]; | |
// seems that crops like to have 8 growth icons, but okay to repeat actual texture if you want | |
iIcon[0] = parIIconRegister.registerIcon(MainClass.MODID + ":cucumber_stage_0"); | |
iIcon[1] = parIIconRegister.registerIcon(MainClass.MODID + ":cucumber_stage_0"); | |
iIcon[2] = parIIconRegister.registerIcon(MainClass.MODID + ":cucumber_stage_1"); | |
iIcon[3] = parIIconRegister.registerIcon(MainClass.MODID + ":cucumber_stage_1"); | |
iIcon[4] = parIIconRegister.registerIcon(MainClass.MODID + ":cucumber_stage_2"); | |
iIcon[5] = parIIconRegister.registerIcon(MainClass.MODID + ":cucumber_stage_2"); | |
iIcon[6] = parIIconRegister.registerIcon(MainClass.MODID + ":cucumber_stage_3"); | |
iIcon[7] = parIIconRegister.registerIcon(MainClass.MODID + ":cucumber_stage_3"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment