Hello,
I'm trying to make a mod where a block (that I named "Terra Stone") speeds up the growth of plants around it, so how would I go about doing that? I'm new to Java and need help with this, so I would appreciate all the help I can get. So is there a way to do this? I would assume you need to make a TileEntity for the block, but I don't understand how, and probably screwed it up, big time.
Can someone help me? I'm using MCP and ModLoader on Minecraft 1.2.5. I'll post my codes below:
package net.minecraft.src;
import java.util.Random;
public class mod_TerraBlock extends BaseMod
{
public static final Block terraBlock = new BlockTerraStone(127,0).setHardness(50F).setResistance(2000.0F).setBlockName("mvas").setLightValue(0.80F);
public mod_TerraBlock()
{
ModLoader.registerBlock(terraBlock);
terraBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/terra.png");
ModLoader.addName(terraBlock, "Terra Stone");
ModLoader.addRecipe(new ItemStack(terraBlock, 1), new Object []{
"*%*","*#*","***", Character.valueOf('%'), Item.bucketWater, Character.valueOf('#'), Block.obsidian, Character.valueOf('*'), Block.dirt,
});
}
public String getVersion()
{
return "3.14159265";
}
public void load()
{
}
}
package net.minecraft.src;
import java.util.Random;
public class BlockTerraStone extends Block
{
public BlockTerraStone(int i, int j)
{
super(i,j,Material.rock);
}
public int idDropped(int i, Random random)
{
return mod_TerraBlock.terraBlock.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
and my murdered attempt at TileEntity
package net.minecraft.src;
import java.util.Random;
public class TileEntityTerraStone extends TileEntity
{
public mod_Block.terraStone;
public void checkForAdjacentCrops()
public boolean
{
worldObj.getBlockId(xCoord, yCoord, zCoord)
I obviously really need help on the last one, so thank you in advanced!