Added new soil types (Incomplete)
|
@ -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;
|
||||
|
|
127
src/main/java/biomesoplenty/common/blocks/BlockBOPSoil.java
Normal file
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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"));
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
||||
|
|
Before Width: | Height: | Size: 573 B After Width: | Height: | Size: 524 B |
After Width: | Height: | Size: 334 B |
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 338 B |
After Width: | Height: | Size: 458 B |
After Width: | Height: | Size: 464 B |
After Width: | Height: | Size: 463 B |