Ok i am Having problems with this mod.
this is the mod_Been
Code:
this is the BlockBeenStock
Code:
I get an error when i try to craft it and thear error is
Error Report
Please Help
this is the mod_Been
Code:
Click to reveal
package net.minecraft.src;
public class mod_Been extends BaseMod
{
public String Version()
{
return "Been Stock+ ModLoeder MC version 1.2.5";
}
public mod_Been()
{
//Adding Names
ModLoader.addName(BeenStock, "Cocoa Been Stock");
//Adding Recipe
ModLoader.addRecipe(new ItemStack(BeenStock, 2), new Object[]
{
"#X#", 'X', new ItemStack(Item.dyePowder, 1, 3), '#', Item.reed
});
ModLoader.addShapelessRecipe(new ItemStack(Item.dyePowder, 1, 3), new Object[]
{
BeenStock
});
}
static
{
BeenStock = (new BlockBeenStock(200, ModLoader.addOverride("/terrain.png", "/STM/BeenStock.png"))).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setBlockName("BeenStock").disableStats();
}
public static final Block BeenStock;
@Override
public String getVersion() {
// TODO Auto-generated method stub
return null;
}
@Override
public void load() {
// TODO Auto-generated method stub
}
}
this is the BlockBeenStock
Code:
Click to reveal
package net.minecraft.src;
import java.util.Random;
public class BlockBeenStock extends Block
{
protected BlockBeenStock(int par1, int par2)
{
super(par1, Material.plants);
blockIndexInTexture = par2;
float f = 0.375F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
setTickRandomly(true);
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (par1World.isAirBlock(par2, par3 + 1, par4))
{
int i;
for (i = 1; par1World.getBlockId(par2, par3 - i, par4) == blockID; i++) { }
if (i < 3)
{
int j = par1World.getBlockMetadata(par2, par3, par4);
if (j == 15)
{
par1World.setBlockWithNotify(par2, par3 + 1, par4, blockID);
par1World.setBlockMetadataWithNotify(par2, par3, par4, 0);
}
else
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, j + 1);
}
}
}
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
int i = par1World.getBlockId(par2, par3 - 1, par4);
if (i == blockID)
{
return true;
}
if (i != Block.grass.blockID && i != Block.dirt.blockID && i != Block.sand.blockID)
{
return false;
}
if (par1World.getBlockMaterial(par2 - 1, par3 - 1, par4) == Material.water)
{
return true;
}
if (par1World.getBlockMaterial(par2 + 1, par3 - 1, par4) == Material.water)
{
return true;
}
if (par1World.getBlockMaterial(par2, par3 - 1, par4 - 1) == Material.water)
{
return true;
}
return par1World.getBlockMaterial(par2, par3 - 1, par4 + 1) == Material.water;
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
checkBlockCoordValid(par1World, par2, par3, par4);
}
/**
* Checks if current block pos is valid, if not, breaks the block as dropable item. Used for reed and cactus.
*/
protected final void checkBlockCoordValid(World par1World, int par2, int par3, int par4)
{
if (!canBlockStay(par1World, par2, par3, par4))
{
dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
/**
* Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.
*/
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
{
return canPlaceBlockAt(par1World, par2, par3, par4);
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int i)
{
return null;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_Been.BeenStock.blockID;
}
/**
* Is this block (a) opaque and ([img]http://static.minecraftforum.net//public/style_emoticons/default/cool.png[/img] a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return 1;
}
}
I get an error when i try to craft it and thear error is
Error Report
Click to reveal
Mods loaded: 2
ModLoader 1.2.5
mod_Been null
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 6b5baea3 --------
Generated 4/5/12 10:41 AM
Minecraft: Minecraft 1.2.5
OS: Windows Vista (x86) version 6.0
Java: 1.6.0_31, Sun Microsystems Inc.
VM: Java HotSpot™ Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: Intel 945G version 1.4.0 - Build 7.14.10.1461, Intel
java.lang.NullPointerException
at net.minecraft.src.ItemStack.getIconIndex(ItemStack.java:105)
at net.minecraft.src.RenderItem.renderItemIntoGUI(RenderItem.java:270)
at net.minecraft.src.GuiContainer.drawSlotInventory(GuiContainer.java:228)
at net.minecraft.src.GuiContainer.drawScreen(GuiContainer.java:74)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1008)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 570323c ----------
Please Help
