diff --git a/src/main/java/biomesoplenty/api/content/BOPCBlocks.java b/src/main/java/biomesoplenty/api/content/BOPCBlocks.java index 476e6d51f..fd67e004b 100644 --- a/src/main/java/biomesoplenty/api/content/BOPCBlocks.java +++ b/src/main/java/biomesoplenty/api/content/BOPCBlocks.java @@ -35,6 +35,7 @@ public class BOPCBlocks public static Block mudBricks; + public static Block soil; public static Block originGrass; public static Block longGrass; public static Block overgrownNetherrack; diff --git a/src/main/java/biomesoplenty/common/blocks/BlockBOPSoil.java b/src/main/java/biomesoplenty/common/blocks/BlockBOPSoil.java new file mode 100644 index 000000000..d1b9a9998 --- /dev/null +++ b/src/main/java/biomesoplenty/common/blocks/BlockBOPSoil.java @@ -0,0 +1,127 @@ +package biomesoplenty.common.blocks; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import biomesoplenty.BiomesOPlenty; +import biomesoplenty.api.content.BOPCBlocks; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBOPSoil extends Block +{ + public static final String[] types = new String[] {"grass_silty", "dirt_silty", "grass_sandy", "dirt_sandy", "grass_loamy", "dirt_loamy"}; + private IIcon[][] icon = new IIcon[6][6]; + + public BlockBOPSoil() + { + //TODO: Material.grass + super(Material.grass); + + //TODO: this.setHardness + this.setHardness(0.6F); + this.setHarvestLevel("shovel", 0); + + //TODO: setTickRandomly() + this.setTickRandomly(true); + //TODO setStepSound(Block.soundGrassFootstep) + this.setStepSound(Block.soundTypeGrass); + + //setLightValue(0.25F); + + //TODO: this.setCreativeTab() + this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty); + } + + @Override + //TODO: registerIcons() + public void registerBlockIcons(IIconRegister iconRegister) + { + this.icon[0][0] = iconRegister.registerIcon("biomesoplenty:dirt_silty"); + this.icon[0][1] = iconRegister.registerIcon("minecraft:grass_top"); + this.icon[0][2] = iconRegister.registerIcon("biomesoplenty:grass_silty"); + this.icon[0][3] = iconRegister.registerIcon("biomesoplenty:grass_silty"); + this.icon[0][4] = iconRegister.registerIcon("biomesoplenty:grass_silty"); + this.icon[0][5] = iconRegister.registerIcon("biomesoplenty:grass_silty"); + + this.icon[1][0] = iconRegister.registerIcon("biomesoplenty:dirt_silty"); + this.icon[1][1] = iconRegister.registerIcon("biomesoplenty:dirt_silty"); + this.icon[1][2] = iconRegister.registerIcon("biomesoplenty:dirt_silty"); + this.icon[1][3] = iconRegister.registerIcon("biomesoplenty:dirt_silty"); + this.icon[1][4] = iconRegister.registerIcon("biomesoplenty:dirt_silty"); + this.icon[1][5] = iconRegister.registerIcon("biomesoplenty:dirt_silty"); + + this.icon[2][0] = iconRegister.registerIcon("biomesoplenty:dirt_sandy"); + this.icon[2][1] = iconRegister.registerIcon("minecraft:grass_top"); + this.icon[2][2] = iconRegister.registerIcon("biomesoplenty:grass_sandy"); + this.icon[2][3] = iconRegister.registerIcon("biomesoplenty:grass_sandy"); + this.icon[2][4] = iconRegister.registerIcon("biomesoplenty:grass_sandy"); + this.icon[2][5] = iconRegister.registerIcon("biomesoplenty:grass_sandy"); + + this.icon[3][0] = iconRegister.registerIcon("biomesoplenty:dirt_sandy"); + this.icon[3][1] = iconRegister.registerIcon("biomesoplenty:dirt_sandy"); + this.icon[3][2] = iconRegister.registerIcon("biomesoplenty:dirt_sandy"); + this.icon[3][3] = iconRegister.registerIcon("biomesoplenty:dirt_sandy"); + this.icon[3][4] = iconRegister.registerIcon("biomesoplenty:dirt_sandy"); + this.icon[3][5] = iconRegister.registerIcon("biomesoplenty:dirt_sandy"); + + this.icon[4][0] = iconRegister.registerIcon("biomesoplenty:dirt_loamy"); + this.icon[4][1] = iconRegister.registerIcon("minecraft:grass_top"); + this.icon[4][2] = iconRegister.registerIcon("biomesoplenty:grass_loamy"); + this.icon[4][3] = iconRegister.registerIcon("biomesoplenty:grass_loamy"); + this.icon[4][4] = iconRegister.registerIcon("biomesoplenty:grass_loamy"); + this.icon[4][5] = iconRegister.registerIcon("biomesoplenty:grass_loamy"); + + this.icon[5][0] = iconRegister.registerIcon("biomesoplenty:dirt_loamy"); + this.icon[5][1] = iconRegister.registerIcon("biomesoplenty:dirt_loamy"); + this.icon[5][2] = iconRegister.registerIcon("biomesoplenty:dirt_loamy"); + this.icon[5][3] = iconRegister.registerIcon("biomesoplenty:dirt_loamy"); + this.icon[5][4] = iconRegister.registerIcon("biomesoplenty:dirt_loamy"); + this.icon[5][5] = iconRegister.registerIcon("biomesoplenty:dirt_loamy"); + } + + @Override + //TODO: getIcon() + public IIcon getIcon(int side, int meta) + { + if (meta < 0 || meta >= this.icon.length) meta = 1; + if (side < 0 || side >= this.icon[meta].length) side = 1; + + return this.icon[meta][side]; + } + + @Override + //TODO: getSubBlocks() + public void getSubBlocks(Item block, CreativeTabs creativeTabs, List list) + { + for (int i = 0; i < types.length; ++i) { + list.add(new ItemStack(block, 1, i)); + } + } + + @Override + //TODO damageDropped() + public int damageDropped(int meta) + { + return (meta % 2 == 0) ? meta + 1 : meta; + } + + @Override + //TODO: getCollisionBoundingBoxFromPool + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) + { + //TODO: getCollisionBoundingBoxFromPool() + return super.getCollisionBoundingBoxFromPool(world, x, y, z); + } + +} diff --git a/src/main/java/biomesoplenty/common/core/BOPBlocks.java b/src/main/java/biomesoplenty/common/core/BOPBlocks.java index 9c1074b2a..664909bfd 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBlocks.java +++ b/src/main/java/biomesoplenty/common/core/BOPBlocks.java @@ -18,6 +18,7 @@ import static biomesoplenty.api.content.BOPCBlocks.cragRock; import static biomesoplenty.api.content.BOPCBlocks.crystal; import static biomesoplenty.api.content.BOPCBlocks.darkStairs; import static biomesoplenty.api.content.BOPCBlocks.driedDirt; +import static biomesoplenty.api.content.BOPCBlocks.etherealStairs; import static biomesoplenty.api.content.BOPCBlocks.firStairs; import static biomesoplenty.api.content.BOPCBlocks.flesh; import static biomesoplenty.api.content.BOPCBlocks.flowerVine; @@ -31,7 +32,6 @@ import static biomesoplenty.api.content.BOPCBlocks.hardIce; import static biomesoplenty.api.content.BOPCBlocks.hardSand; import static biomesoplenty.api.content.BOPCBlocks.hellBarkStairs; import static biomesoplenty.api.content.BOPCBlocks.hive; -import static biomesoplenty.api.content.BOPCBlocks.etherealStairs; import static biomesoplenty.api.content.BOPCBlocks.honey; import static biomesoplenty.api.content.BOPCBlocks.honeyBlock; import static biomesoplenty.api.content.BOPCBlocks.ivy; @@ -66,6 +66,7 @@ import static biomesoplenty.api.content.BOPCBlocks.redwoodStairs; import static biomesoplenty.api.content.BOPCBlocks.rocks; import static biomesoplenty.api.content.BOPCBlocks.sacredoakStairs; import static biomesoplenty.api.content.BOPCBlocks.saplings; +import static biomesoplenty.api.content.BOPCBlocks.soil; import static biomesoplenty.api.content.BOPCBlocks.stoneDoubleSlab; import static biomesoplenty.api.content.BOPCBlocks.stoneFormations; import static biomesoplenty.api.content.BOPCBlocks.stoneSingleSlab; @@ -109,6 +110,7 @@ import biomesoplenty.common.blocks.BlockBOPRocks; import biomesoplenty.common.blocks.BlockBOPSapling; import biomesoplenty.common.blocks.BlockBOPSlab; import biomesoplenty.common.blocks.BlockBOPSlab.SlabCategory; +import biomesoplenty.common.blocks.BlockBOPSoil; import biomesoplenty.common.blocks.BlockBOPStairs; import biomesoplenty.common.blocks.BlockBOPStairs.Category; import biomesoplenty.common.blocks.BlockBamboo; @@ -157,6 +159,7 @@ import biomesoplenty.common.itemblocks.ItemBlockPlant; import biomesoplenty.common.itemblocks.ItemBlockRocks; import biomesoplenty.common.itemblocks.ItemBlockSapling; import biomesoplenty.common.itemblocks.ItemBlockSlab; +import biomesoplenty.common.itemblocks.ItemBlockSoil; import biomesoplenty.common.itemblocks.ItemBlockStoneFormations; import biomesoplenty.common.itemblocks.ItemBlockWillow; import cpw.mods.fml.common.registry.GameRegistry; @@ -202,6 +205,7 @@ public class BOPBlocks mudBricks = registerBlock(new BlockBOPGeneric(Material.rock, BlockType.MUD_BRICK).setBlockName("mudBricks")); + soil = registerBlock(new BlockBOPSoil().setBlockName("soil"), ItemBlockSoil.class); originGrass = registerBlock(new BlockOriginGrass().setBlockName("originGrass")); longGrass = registerBlock(new BlockLongGrass().setBlockName("longGrass")); overgrownNetherrack = registerBlock(new BlockOvergrownNetherrack().setBlockName("overgrownNetherrack")); diff --git a/src/main/java/biomesoplenty/common/itemblocks/ItemBlockSoil.java b/src/main/java/biomesoplenty/common/itemblocks/ItemBlockSoil.java new file mode 100644 index 000000000..77cb12a8e --- /dev/null +++ b/src/main/java/biomesoplenty/common/itemblocks/ItemBlockSoil.java @@ -0,0 +1,35 @@ +package biomesoplenty.common.itemblocks; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemBlockSoil extends ItemBlock +{ + private static final String[] types = new String[] {"grass_silty", "dirt_silty", "grass_sandy", "dirt_sandy", "grass_loamy", "dirt_loamy"}; + + public ItemBlockSoil(Block block) + { + super(block); + + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public int getMetadata(int meta) + { + return meta; + } + + @Override + public String getUnlocalizedName(ItemStack itemstack) + { + int meta = itemstack.getItemDamage(); + if (meta < 0 || meta >= types.length) { + meta = 0; + } + + return super.getUnlocalizedName() + "." + types[meta]; + } +} diff --git a/src/main/resources/assets/biomesoplenty/lang/en_US.lang b/src/main/resources/assets/biomesoplenty/lang/en_US.lang index 760b516f2..fe166324c 100644 --- a/src/main/resources/assets/biomesoplenty/lang/en_US.lang +++ b/src/main/resources/assets/biomesoplenty/lang/en_US.lang @@ -136,6 +136,13 @@ tile.coral1.bluecoral.name=Blue Coral tile.coral1.glowcoral.name=Glowing Coral tile.coral2.algae.name=Algae +tile.soil.grass_silty.name=Silty Grass Block +tile.soil.grass_sandy.name=Sandy Grass Block +tile.soil.grass_loamy.name=Loamy Grass Block +tile.soil.dirt_silty.name=Silty Dirt +tile.soil.dirt_sandy.name=Sandy Dirt +tile.soil.dirt_loamy.name=Loamy Dirt + tile.bopGrass.spectralmoss.name=Spectral Moss tile.bopGrass.smolderinggrass.name=Smoldering Grass Block diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/cloverpatch.png b/src/main/resources/assets/biomesoplenty/textures/blocks/cloverpatch.png index 75b3b8c7f..6138df90c 100644 Binary files a/src/main/resources/assets/biomesoplenty/textures/blocks/cloverpatch.png and b/src/main/resources/assets/biomesoplenty/textures/blocks/cloverpatch.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/dirt_loamy.png b/src/main/resources/assets/biomesoplenty/textures/blocks/dirt_loamy.png new file mode 100644 index 000000000..c1ca671e8 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/dirt_loamy.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/dirt_sandy.png b/src/main/resources/assets/biomesoplenty/textures/blocks/dirt_sandy.png new file mode 100644 index 000000000..1c443c1a1 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/dirt_sandy.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/dirt_silty.png b/src/main/resources/assets/biomesoplenty/textures/blocks/dirt_silty.png new file mode 100644 index 000000000..0164c59b8 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/dirt_silty.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/grass_loamy.png b/src/main/resources/assets/biomesoplenty/textures/blocks/grass_loamy.png new file mode 100644 index 000000000..4febfa9e2 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/grass_loamy.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/grass_sandy.png b/src/main/resources/assets/biomesoplenty/textures/blocks/grass_sandy.png new file mode 100644 index 000000000..4a8d1ab7a Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/grass_sandy.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/grass_silty.png b/src/main/resources/assets/biomesoplenty/textures/blocks/grass_silty.png new file mode 100644 index 000000000..7354a1d94 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/grass_silty.png differ