From 872b9955c13f73815dc48f9340f2bedcccca24e0 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Mon, 15 Apr 2013 20:55:41 +1000 Subject: [PATCH] Shutting eclipse git up about random files --- .../tdwp_ftw/biomesop/api/Blocks.java | 68 ++-- .../biomesop/blocks/BlockBOPFlower.java | 158 ++++---- .../tdwp_ftw/biomesop/blocks/BlockBOPLog.java | 312 +++++++-------- .../biomesop/blocks/BlockBOPSlab.java | 356 +++++++++--------- .../biomesop/blocks/BlockBOPStairs.java | 108 +++--- .../biomesop/items/ItemBOPLeaves.java | 56 +-- .../tdwp_ftw/biomesop/items/ItemBOPLog.java | 62 +-- 7 files changed, 560 insertions(+), 560 deletions(-) diff --git a/src/minecraft/tdwp_ftw/biomesop/api/Blocks.java b/src/minecraft/tdwp_ftw/biomesop/api/Blocks.java index c93d37f85..91e43d606 100644 --- a/src/minecraft/tdwp_ftw/biomesop/api/Blocks.java +++ b/src/minecraft/tdwp_ftw/biomesop/api/Blocks.java @@ -1,34 +1,34 @@ -package tdwp_ftw.biomesop.api; - -import com.google.common.base.Optional; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockHalfSlab; - -public class Blocks -{ - public static Optional planks = Optional.absent(); - public static Optional acaciaStairs = Optional.absent(); - public static Optional cherryStairs = Optional.absent(); - public static Optional darkStairs = Optional.absent(); - public static Optional firStairs = Optional.absent(); - public static Optional holyStairs = Optional.absent(); - public static Optional magicStairs = Optional.absent(); - public static Optional mangroveStairs = Optional.absent(); - public static Optional palmStairs = Optional.absent(); - public static Optional redwoodStairs = Optional.absent(); - public static Optional willowStairs = Optional.absent(); - - public static Optional woodenSingleSlab1 = Optional.absent(); - public static Optional woodenDoubleSlab1 = Optional.absent(); - public static Optional woodenSingleSlab2 = Optional.absent(); - public static Optional woodenDoubleSlab2 = Optional.absent(); - public static Optional stoneSingleSlab = Optional.absent(); - public static Optional stoneDoubleSlab = Optional.absent(); - public static Optional flowers = Optional.absent(); - public static Optional leaves = Optional.absent(); - public static Optional leavesColorized = Optional.absent(); - public static Optional logs1 = Optional.absent(); - public static Optional logs2 = Optional.absent(); - public static Optional logs3 = Optional.absent(); -} +package tdwp_ftw.biomesop.api; + +import com.google.common.base.Optional; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockHalfSlab; + +public class Blocks +{ + public static Optional planks = Optional.absent(); + public static Optional acaciaStairs = Optional.absent(); + public static Optional cherryStairs = Optional.absent(); + public static Optional darkStairs = Optional.absent(); + public static Optional firStairs = Optional.absent(); + public static Optional holyStairs = Optional.absent(); + public static Optional magicStairs = Optional.absent(); + public static Optional mangroveStairs = Optional.absent(); + public static Optional palmStairs = Optional.absent(); + public static Optional redwoodStairs = Optional.absent(); + public static Optional willowStairs = Optional.absent(); + + public static Optional woodenSingleSlab1 = Optional.absent(); + public static Optional woodenDoubleSlab1 = Optional.absent(); + public static Optional woodenSingleSlab2 = Optional.absent(); + public static Optional woodenDoubleSlab2 = Optional.absent(); + public static Optional stoneSingleSlab = Optional.absent(); + public static Optional stoneDoubleSlab = Optional.absent(); + public static Optional flowers = Optional.absent(); + public static Optional leaves = Optional.absent(); + public static Optional leavesColorized = Optional.absent(); + public static Optional logs1 = Optional.absent(); + public static Optional logs2 = Optional.absent(); + public static Optional logs3 = Optional.absent(); +} diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPFlower.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPFlower.java index 7188a3764..21d7ca239 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPFlower.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPFlower.java @@ -1,79 +1,79 @@ -package tdwp_ftw.biomesop.blocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import tdwp_ftw.biomesop.mod_BiomesOPlenty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockBOPFlower extends BlockFlower -{ - private static final String[] plants = new String[] {"swampflower", "deadbloom", "glowflower", "hydrangea", "orangeflower", "pinkflower", "purpleflower", "violet", "whiteflower"}; - @SideOnly(Side.CLIENT) - private Icon[] textures; - - protected BlockBOPFlower(int blockID, Material material) - { - super(blockID, material); - this.setTickRandomly(true); - float var4 = 0.2F; - this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var4 * 3.0F, 0.5F + var4); - this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); - } - - public BlockBOPFlower(int blockID) - { - this(blockID, Material.plants); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) - { - textures = new Icon[plants.length]; - - for (int i = 0; i < plants.length; ++i) - textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + plants[i]); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getBlockTextureFromSideAndMetadata(int side, int meta) - { - if (meta < 0 || meta >= textures.length) - meta = 0; - - return textures[meta]; - } - - public int getLightValue(IBlockAccess world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - if (meta == 2) - return 9; - else - return 0; - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { - for (int i = 0; i < plants.length; ++i) - list.add(new ItemStack(blockID, 1, i)); - } - - @Override - public int damageDropped(int meta) - { - return meta; - } -} +package tdwp_ftw.biomesop.blocks; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import tdwp_ftw.biomesop.mod_BiomesOPlenty; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBOPFlower extends BlockFlower +{ + private static final String[] plants = new String[] {"swampflower", "deadbloom", "glowflower", "hydrangea", "orangeflower", "pinkflower", "purpleflower", "violet", "whiteflower"}; + @SideOnly(Side.CLIENT) + private Icon[] textures; + + protected BlockBOPFlower(int blockID, Material material) + { + super(blockID, material); + this.setTickRandomly(true); + float var4 = 0.2F; + this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var4 * 3.0F, 0.5F + var4); + this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); + } + + public BlockBOPFlower(int blockID) + { + this(blockID, Material.plants); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) + { + textures = new Icon[plants.length]; + + for (int i = 0; i < plants.length; ++i) + textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + plants[i]); + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getBlockTextureFromSideAndMetadata(int side, int meta) + { + if (meta < 0 || meta >= textures.length) + meta = 0; + + return textures[meta]; + } + + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta == 2) + return 9; + else + return 0; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { + for (int i = 0; i < plants.length; ++i) + list.add(new ItemStack(blockID, 1, i)); + } + + @Override + public int damageDropped(int meta) + { + return meta; + } +} diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPLog.java index 0354b71da..0a41ea302 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPLog.java @@ -1,156 +1,156 @@ -package tdwp_ftw.biomesop.blocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import tdwp_ftw.biomesop.mod_BiomesOPlenty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockBOPLog extends Block -{ - public static enum LogCategory - { - CAT1, CAT2, CAT3; - } - - private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow", "dead"}; - @SideOnly(Side.CLIENT) - private Icon[] textures; - private Icon logHeart; - - private final LogCategory category; - - public BlockBOPLog(int blockID, LogCategory cat) - { - super(blockID, Material.wood); - category = cat; - setBurnProperties(this.blockID, 5, 5); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundWoodFootstep); - this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) - { - textures = new Icon[woodTypes.length]; - - logHeart = iconRegister.registerIcon("BiomesOPlenty:logTopBottum"); - - for (int i = 0; i < woodTypes.length; ++i) - textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"log"); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getBlockTextureFromSideAndMetadata(int side, int meta) - { - int pos = meta & 12; - if (pos == 0 && (side == 1 || side == 0) || pos == 4 && (side == 5 || side == 4) || pos == 8 && (side == 2 || side == 3)) - return logHeart; - return textures[(getTypeFromMeta(meta) + this.category.ordinal() * 4)]; - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { - for (int i = 0; i < 4; ++i) - if (category != LogCategory.CAT3 || i < 3) -// return; -// else - list.add(new ItemStack(this, 1, i)); - } - - @Override - public void breakBlock(World world, int x, int y, int z, int par5, int par6) - { - byte radius = 4; - int bounds = radius + 1; - - if (world.checkChunksExist(x - bounds, y - bounds, z - bounds, x + bounds, y + bounds, z + bounds)) - for (int i = -radius; i <= radius; ++i) - for (int j = -radius; j <= radius; ++j) - for (int k = -radius; k <= radius; ++k) - { - int blockID = world.getBlockId(x + i, y + j, z + k); - - if (Block.blocksList[blockID] != null) - Block.blocksList[blockID].beginLeavesDecay(world, x + i, y + j, z + k); - } - } - - @Override - public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) - { - int type = getTypeFromMeta(meta); - byte orientation = 0; - - switch (side) - { - case 0: - case 1: - orientation = 0; - break; - - case 2: - case 3: - orientation = 8; - break; - - case 4: - case 5: - orientation = 4; - } - - return type | orientation; - } - - @Override - public int damageDropped(int meta) - { - return getTypeFromMeta(meta); - } - - @Override - protected ItemStack createStackedBlock(int meta) - { - return new ItemStack(this.blockID, 1, getTypeFromMeta(meta)); - } - - @Override - public int getRenderType() - { - return 31; - } - - @Override - public boolean canSustainLeaves(World world, int x, int y, int z) - { - return true; - } - - @Override - public boolean isWood(World world, int x, int y, int z) - { - return true; - } - - public int getWoodType(int meta) - { - return getTypeFromMeta(meta) + category.ordinal() * 4; - } - - private static int getTypeFromMeta(int meta) - { - return meta & 3; - } -} +package tdwp_ftw.biomesop.blocks; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import tdwp_ftw.biomesop.mod_BiomesOPlenty; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBOPLog extends Block +{ + public static enum LogCategory + { + CAT1, CAT2, CAT3; + } + + private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow", "dead"}; + @SideOnly(Side.CLIENT) + private Icon[] textures; + private Icon logHeart; + + private final LogCategory category; + + public BlockBOPLog(int blockID, LogCategory cat) + { + super(blockID, Material.wood); + category = cat; + setBurnProperties(this.blockID, 5, 5); + setHardness(2.0F); + setResistance(5.0F); + setStepSound(Block.soundWoodFootstep); + this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) + { + textures = new Icon[woodTypes.length]; + + logHeart = iconRegister.registerIcon("BiomesOPlenty:logTopBottum"); + + for (int i = 0; i < woodTypes.length; ++i) + textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"log"); + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getBlockTextureFromSideAndMetadata(int side, int meta) + { + int pos = meta & 12; + if (pos == 0 && (side == 1 || side == 0) || pos == 4 && (side == 5 || side == 4) || pos == 8 && (side == 2 || side == 3)) + return logHeart; + return textures[(getTypeFromMeta(meta) + this.category.ordinal() * 4)]; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { + for (int i = 0; i < 4; ++i) + if (category != LogCategory.CAT3 || i < 3) +// return; +// else + list.add(new ItemStack(this, 1, i)); + } + + @Override + public void breakBlock(World world, int x, int y, int z, int par5, int par6) + { + byte radius = 4; + int bounds = radius + 1; + + if (world.checkChunksExist(x - bounds, y - bounds, z - bounds, x + bounds, y + bounds, z + bounds)) + for (int i = -radius; i <= radius; ++i) + for (int j = -radius; j <= radius; ++j) + for (int k = -radius; k <= radius; ++k) + { + int blockID = world.getBlockId(x + i, y + j, z + k); + + if (Block.blocksList[blockID] != null) + Block.blocksList[blockID].beginLeavesDecay(world, x + i, y + j, z + k); + } + } + + @Override + public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) + { + int type = getTypeFromMeta(meta); + byte orientation = 0; + + switch (side) + { + case 0: + case 1: + orientation = 0; + break; + + case 2: + case 3: + orientation = 8; + break; + + case 4: + case 5: + orientation = 4; + } + + return type | orientation; + } + + @Override + public int damageDropped(int meta) + { + return getTypeFromMeta(meta); + } + + @Override + protected ItemStack createStackedBlock(int meta) + { + return new ItemStack(this.blockID, 1, getTypeFromMeta(meta)); + } + + @Override + public int getRenderType() + { + return 31; + } + + @Override + public boolean canSustainLeaves(World world, int x, int y, int z) + { + return true; + } + + @Override + public boolean isWood(World world, int x, int y, int z) + { + return true; + } + + public int getWoodType(int meta) + { + return getTypeFromMeta(meta) + category.ordinal() * 4; + } + + private static int getTypeFromMeta(int meta) + { + return meta & 3; + } +} diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPSlab.java index 5891b215a..8a1d1a6d2 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPSlab.java @@ -1,178 +1,178 @@ -package tdwp_ftw.biomesop.blocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockHalfSlab; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import tdwp_ftw.biomesop.mod_BiomesOPlenty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockBOPSlab extends BlockHalfSlab -{ - public static enum SlabCategory - { - WOOD1, WOOD2, STONE; - } - private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow"}; - private static final String[] rockTypes = new String[] {"redbrick", "redcobble", "mudbrick"}; - @SideOnly(Side.CLIENT) - private Icon[] textures; - - private final SlabCategory category; - - public BlockBOPSlab(int par1, boolean par2, Material material, SlabCategory cat) - { - super(par1, par2, material); - category = cat; - if (material == Material.wood) - { - setBurnProperties(this.blockID, 5, 20); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundWoodFootstep); - } - else if (material == Material.rock) - setStepSound(Block.soundStoneFootstep); - - this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); - useNeighborBrightness[blockID] = true; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) - { - if (category == SlabCategory.STONE) - { - textures = new Icon[rockTypes.length]; - - for (int i = 0; i < rockTypes.length; ++i) - textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+rockTypes[i]); - } - else - { - textures = new Icon[woodTypes.length]; - - for (int i = 0; i < woodTypes.length; ++i) - textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"plank"); - } - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getBlockTextureFromSideAndMetadata(int side, int meta) - { - if (category == SlabCategory.STONE) - return textures[getTypeFromMeta(meta)]; - else - return textures[(getTypeFromMeta(meta) + this.category.ordinal() * 8)]; - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { - int max = 0; - - if (category == SlabCategory.WOOD1) - max = 8; - else if (category == SlabCategory.WOOD2) - max = 2; - else if (category == SlabCategory.STONE) - max = 3; - - for (int i = 0; i < max; ++i) - list.add(new ItemStack(blockID, 1, i)); - } - - @Override - public String getFullSlabName(int meta) - { - if (category == SlabCategory.STONE) - return (new StringBuilder()).append(rockTypes[getTypeFromMeta(meta)]).append("Slab").toString(); - else - return (new StringBuilder()).append(woodTypes[getWoodType(meta)]).append("Slab").toString(); - } - - @Override - public int damageDropped(int meta) - { - return meta; - } - - @Override - public float getBlockHardness(World world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - float hardness = this.blockHardness; - - if (category == SlabCategory.STONE) - { - switch (getTypeFromMeta(meta)) - { - case 0: - hardness = 1.1F; - break; - - case 1: - hardness = 1.6F; - break; - - case 2: - hardness = 1.0F; - break; - } - } - - return hardness; - } - - @Override - public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) - { - int meta = world.getBlockMetadata(x, y, z); - float resistance = this.blockHardness; - - if (category == SlabCategory.STONE) - { - switch (getTypeFromMeta(meta)) - { - case 0: - resistance = 7.5F; - break; - - case 1: - resistance = 7.0F; - break; - - case 2: - resistance = 2.0F; - break; - } - } - - return resistance / 5.0F; - } - - protected ItemStack createStackedBlock(int par1) - { - return new ItemStack(this.blockID, 2, par1); - } - - private int getWoodType(int meta) - { - return getTypeFromMeta(meta) + category.ordinal() * 8; - } - - private static int getTypeFromMeta(int meta) - { - return meta & 7; - } -} +package tdwp_ftw.biomesop.blocks; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockHalfSlab; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import tdwp_ftw.biomesop.mod_BiomesOPlenty; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBOPSlab extends BlockHalfSlab +{ + public static enum SlabCategory + { + WOOD1, WOOD2, STONE; + } + private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow"}; + private static final String[] rockTypes = new String[] {"redbrick", "redcobble", "mudbrick"}; + @SideOnly(Side.CLIENT) + private Icon[] textures; + + private final SlabCategory category; + + public BlockBOPSlab(int par1, boolean par2, Material material, SlabCategory cat) + { + super(par1, par2, material); + category = cat; + if (material == Material.wood) + { + setBurnProperties(this.blockID, 5, 20); + setHardness(2.0F); + setResistance(5.0F); + setStepSound(Block.soundWoodFootstep); + } + else if (material == Material.rock) + setStepSound(Block.soundStoneFootstep); + + this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); + useNeighborBrightness[blockID] = true; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) + { + if (category == SlabCategory.STONE) + { + textures = new Icon[rockTypes.length]; + + for (int i = 0; i < rockTypes.length; ++i) + textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+rockTypes[i]); + } + else + { + textures = new Icon[woodTypes.length]; + + for (int i = 0; i < woodTypes.length; ++i) + textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"plank"); + } + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getBlockTextureFromSideAndMetadata(int side, int meta) + { + if (category == SlabCategory.STONE) + return textures[getTypeFromMeta(meta)]; + else + return textures[(getTypeFromMeta(meta) + this.category.ordinal() * 8)]; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { + int max = 0; + + if (category == SlabCategory.WOOD1) + max = 8; + else if (category == SlabCategory.WOOD2) + max = 2; + else if (category == SlabCategory.STONE) + max = 3; + + for (int i = 0; i < max; ++i) + list.add(new ItemStack(blockID, 1, i)); + } + + @Override + public String getFullSlabName(int meta) + { + if (category == SlabCategory.STONE) + return (new StringBuilder()).append(rockTypes[getTypeFromMeta(meta)]).append("Slab").toString(); + else + return (new StringBuilder()).append(woodTypes[getWoodType(meta)]).append("Slab").toString(); + } + + @Override + public int damageDropped(int meta) + { + return meta; + } + + @Override + public float getBlockHardness(World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + float hardness = this.blockHardness; + + if (category == SlabCategory.STONE) + { + switch (getTypeFromMeta(meta)) + { + case 0: + hardness = 1.1F; + break; + + case 1: + hardness = 1.6F; + break; + + case 2: + hardness = 1.0F; + break; + } + } + + return hardness; + } + + @Override + public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + { + int meta = world.getBlockMetadata(x, y, z); + float resistance = this.blockHardness; + + if (category == SlabCategory.STONE) + { + switch (getTypeFromMeta(meta)) + { + case 0: + resistance = 7.5F; + break; + + case 1: + resistance = 7.0F; + break; + + case 2: + resistance = 2.0F; + break; + } + } + + return resistance / 5.0F; + } + + protected ItemStack createStackedBlock(int par1) + { + return new ItemStack(this.blockID, 2, par1); + } + + private int getWoodType(int meta) + { + return getTypeFromMeta(meta) + category.ordinal() * 8; + } + + private static int getTypeFromMeta(int meta) + { + return meta & 7; + } +} diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPStairs.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPStairs.java index 2f4570873..bfcda58d6 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPStairs.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPStairs.java @@ -1,54 +1,54 @@ -package tdwp_ftw.biomesop.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockStairs; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.util.Icon; -import tdwp_ftw.biomesop.mod_BiomesOPlenty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockBOPStairs extends BlockStairs -{ - public static enum WoodCategory - { - ACACIA, CHERRY, DARK, FIR, HOLY, MAGIC, MANGROVE, PALM, REDWOOD, WILLOW; - } - - private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow"}; - @SideOnly(Side.CLIENT) - private Icon[] textures; - private final WoodCategory category; - - public BlockBOPStairs(int blockID, Block model, WoodCategory cat) - { - super(blockID, model, 0); - category = cat; - setBurnProperties(this.blockID, 5, 20); - this.setLightOpacity(0); - this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) - { - textures = new Icon[woodTypes.length]; - - for (int i = 0; i < woodTypes.length; ++i) - textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"plank"); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getBlockTextureFromSideAndMetadata(int side, int meta) - { - return textures[category.ordinal()]; - } - - @Override - public int damageDropped(int meta) - { - return meta; - } -} +package tdwp_ftw.biomesop.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockStairs; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.util.Icon; +import tdwp_ftw.biomesop.mod_BiomesOPlenty; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBOPStairs extends BlockStairs +{ + public static enum WoodCategory + { + ACACIA, CHERRY, DARK, FIR, HOLY, MAGIC, MANGROVE, PALM, REDWOOD, WILLOW; + } + + private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow"}; + @SideOnly(Side.CLIENT) + private Icon[] textures; + private final WoodCategory category; + + public BlockBOPStairs(int blockID, Block model, WoodCategory cat) + { + super(blockID, model, 0); + category = cat; + setBurnProperties(this.blockID, 5, 20); + this.setLightOpacity(0); + this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) + { + textures = new Icon[woodTypes.length]; + + for (int i = 0; i < woodTypes.length; ++i) + textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"plank"); + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getBlockTextureFromSideAndMetadata(int side, int meta) + { + return textures[category.ordinal()]; + } + + @Override + public int damageDropped(int meta) + { + return meta; + } +} diff --git a/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLeaves.java b/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLeaves.java index 99a976444..b6efdc4e6 100644 --- a/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLeaves.java +++ b/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLeaves.java @@ -1,28 +1,28 @@ -package tdwp_ftw.biomesop.items; - -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemBOPLeaves extends ItemBlock -{ - private static final String[] leaves = new String[] {"autumn", "bamboo", "blue", "dark", "dead", "fir", "holy", "orange", "origin", "pink", "red", "white"}; - - public ItemBOPLeaves(int par1) - { - super(par1); - setMaxDamage(0); - setHasSubtypes(true); - } - - @Override - public int getMetadata(int meta) - { - return meta; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) - { - return (new StringBuilder()).append(leaves[itemStack.getItemDamage()]).append("Leaves").toString(); - } -} +package tdwp_ftw.biomesop.items; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemBOPLeaves extends ItemBlock +{ + private static final String[] leaves = new String[] {"autumn", "bamboo", "blue", "dark", "dead", "fir", "holy", "orange", "origin", "pink", "red", "white"}; + + public ItemBOPLeaves(int par1) + { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + } + + @Override + public int getMetadata(int meta) + { + return meta; + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) + { + return (new StringBuilder()).append(leaves[itemStack.getItemDamage()]).append("Leaves").toString(); + } +} diff --git a/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLog.java b/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLog.java index e71eab338..8a9eb6796 100644 --- a/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLog.java @@ -1,31 +1,31 @@ -package tdwp_ftw.biomesop.items; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import tdwp_ftw.biomesop.blocks.BlockBOPLog; - -public class ItemBOPLog extends ItemBlock -{ - private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow", "dead"}; - - public ItemBOPLog(int par1) - { - super(par1); - setMaxDamage(0); - setHasSubtypes(true); - } - - @Override - public int getMetadata(int meta) - { - return meta; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) - { - BlockBOPLog wood = (BlockBOPLog)Block.blocksList[itemStack.itemID]; - return (new StringBuilder()).append(woodTypes[wood.getWoodType(itemStack.getItemDamage())]).append("Wood").toString(); - } -} +package tdwp_ftw.biomesop.items; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import tdwp_ftw.biomesop.blocks.BlockBOPLog; + +public class ItemBOPLog extends ItemBlock +{ + private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow", "dead"}; + + public ItemBOPLog(int par1) + { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + } + + @Override + public int getMetadata(int meta) + { + return meta; + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) + { + BlockBOPLog wood = (BlockBOPLog)Block.blocksList[itemStack.itemID]; + return (new StringBuilder()).append(woodTypes[wood.getWoodType(itemStack.getItemDamage())]).append("Wood").toString(); + } +}