From dc3df3edd5843bde0c1335d6a8e460b2c832aa48 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Sat, 17 Jun 2017 08:12:18 +0300 Subject: full project files --- ihl/crop_harvestors/RubberTreeBlock.java | 165 ------------------------------- 1 file changed, 165 deletions(-) delete mode 100644 ihl/crop_harvestors/RubberTreeBlock.java (limited to 'ihl/crop_harvestors/RubberTreeBlock.java') diff --git a/ihl/crop_harvestors/RubberTreeBlock.java b/ihl/crop_harvestors/RubberTreeBlock.java deleted file mode 100644 index 9cfdea1..0000000 --- a/ihl/crop_harvestors/RubberTreeBlock.java +++ /dev/null @@ -1,165 +0,0 @@ -package ihl.crop_harvestors; - -import java.util.Random; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.item.IC2Items; -import ihl.IHLModInfo; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -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.util.ForgeDirection; - -public class RubberTreeBlock extends Block{ - - IIcon textureSide, textureTop; - TreeType type; - - public RubberTreeBlock(TreeType type1) - { - super(Material.wood); - type=type1; - } - - @Override - public Item getItemDropped(int var1, Random rnd, int var2) - { - switch(type) - { - case RUBBERTREE: - return IC2Items.getItem("rubberWood").getItem(); - case SPRUCE: - return Blocks.log.getItemDropped(var1, rnd, var2); - default: - return IC2Items.getItem("rubberWood").getItem(); - } - - } - - @Override - public boolean canSustainLeaves(IBlockAccess blockAccess, int x, int y, int z) - { - return true; - } - - @Override - public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) - { - ItemStack result; - switch(type) - { - case RUBBERTREE: - result = IC2Items.getItem("rubberWood").copy(); - case SPRUCE: - result = new ItemStack(Blocks.log,1,1); - default: - result = IC2Items.getItem("rubberWood").copy(); - } - this.dropBlockAsItem(world, x, y, z, result); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) - { - switch(type) - { - case RUBBERTREE: - this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":blockRubWoodFront"); - this.textureTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":blockRubWoodTop"); - this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":blockRubWoodSide"); - case SPRUCE: - this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":blockSpruceFront"); - this.textureTop = par1IconRegister.registerIcon("minecraft:log_spruce_top"); - this.textureSide = par1IconRegister.registerIcon("minecraft:log_spruce"); - } - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) - { - int facing=3; - int mask[] = { - 0,1,2,3,4,5, - 1,0,3,2,4,5, - 3,2,0,1,4,5, - 2,3,1,0,4,5, - 2,3,5,4,0,1, - 2,3,4,5,1,0 - }; - facing=world.getBlockMetadata(x, y, z); - switch (mask[facing*6+side]) - { - case 0: - return this.textureSide; - case 1: - return this.blockIcon; - case 2: - return this.textureTop; - case 3: - return this.textureTop; - case 4: - return this.textureSide; - case 5: - return this.textureSide; - default: - return this.textureSide; - } - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) - { - switch (side) - { - case 0: - return this.textureTop; - case 1: - return this.textureTop; - case 2: - return this.blockIcon; - case 3: - return this.textureSide; - case 4: - return this.textureSide; - case 5: - return this.textureSide; - default: - return this.textureSide; - } - } - - public enum TreeType - { - RUBBERTREE, - SPRUCE - } - - @Override - public boolean isWood(IBlockAccess world, int x, int y, int z) - { - return true; - } - - @Override - public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) - { - return 4; - } - - @Override - public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) - { - return 20; - } - -} -- cgit v1.2.3