I'm having trouble with the Flower's coding, I did what the tutorial said, but when I load a world(or create a new one), The Screen get's stuck on "Loading World, Building Terrain" and then it freezes.
I'm having trouble with the Flower's coding, I did what the tutorial said, but when I load a world(or create a new one), The Screen get's stuck on "Loading World, Building Terrain" and then it freezes.
The Meaning of Life, the Universe, and Everything.
Location:
Sydney
Join Date:
8/26/2012
Posts:
50
Minecraft:
tehherb
Xbox:
Viol3ntHerb
Member Details
Bumping again.
Crops are planting except they don't grow they just start at their final stage.
mod_MUI
package net.minecraft.src;
import java.util.Random;
public class mod_MUI extends BaseMod
{
//OPIUM CROP SETUP
public static final Block opiumblock = new BlockOpiumBlock(165, 0).setBlockName("opiumblock");
public static final Item opiumseeds = new ItemOpiumSeeds(909, opiumblock.blockID, Block.tilledField.blockID).setItemName("opiumseeds");
//CROP STAGES
public static int opiumstageone = ModLoader.addOverride("/terrain.png", "/crops/opiumstageone.png");
public static int opiumstagetwo = ModLoader.addOverride("/terrain.png", "/crops/opiumstagetwo.png");
public static int opiumstagethree = ModLoader.addOverride("/terrain.png", "/crops/opiumstagethree.png");
public void load()
{
/////////
//CROPS//
/////////
//Opium Poppy
opiumblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/opoppy.png");
ModLoader.registerBlock(opiumblock);
ModLoader.addName(opiumblock, "Opium Poppy");
//Opium Seeds
opiumseeds.iconIndex = ModLoader.addOverride("/gui/items.png", "/opiumseeds.png");
ModLoader.addName(opiumseeds, "Opium Poppy Seeds");
opiumseeds.setTabToDisplayOn(CreativeTabs.tabMaterials);
}
public String getVersion()
{
return "0.1a";
}
}
BlockOpiumBlock
package net.minecraft.src;
import java.util.Random;
public class BlockOpiumBlock extends BlockFlower
{
protected BlockOpiumBlock(int i, int j)
{
super(i, j);
blockIndexInTexture = j;
setTickRandomly(true);
float f = 0.5F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
}
/**
* Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
* blockID passed in. Args: blockID.
* This basically checks to see if the block below is a tilled field/tilled dirt. If it is true then the crop can grow.
*/
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return par1 == Block.tilledField.blockID;
}
/**
* Ticks the block if it's been scheduled. This method gets scheduled to run because of the setTickRandomly part in the constructor of the class.
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
super.updateTick(par1World, par2, par3, par4, par5Random);
if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
if (i < 8)
{
float f = getGrowthRate(par1World, par2, par3, par4);
if (par5Random.nextInt((int)(25F / f) + 1) == 0)
{
i++;
par1World.setBlockMetadataWithNotify(par2, par3, par4, i);
}
}
}
}
/**
* This method allows you to use bonemeal on your crop. Code explanation below:
ItemStack itemstack = entityplayer.inventory.getCurrentItem(); - This line makes "itemstack" equal to the item currently in the players hand.
if(itemstack != null && itemstack.itemID == Item.dyePowder.shiftedIndex) - This line checks if the item in players hand is equal to dye.
if(itemstack.getItemDamage() == 15) - This line checks if the damage value of that item is 15. Item.dyePowder's damage value of 15 is bonemeal.
world.setBlockMetadataWithNotify(i, j, k, 8); - This line sets the metadata value of the block to 8 which is the final growth stage.
itemstack.stackSize--; - This line makes the stack size go down by one.
world.notifyBlockChange(i, j, k, 0); - This line notifys adjacent blocks that this block has updated its state.
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem();
if(itemstack != null && itemstack.itemID == Item.dyePowder.shiftedIndex)
{
if(itemstack.getItemDamage() == 15)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 8);
itemstack.stackSize--;
par1World.notifyBlockChange(par2, par3, par4, 0);
}
}
super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9);
return true;
}
/**
* Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on
* different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below
* this one). Args: x, y, z
*/
private float getGrowthRate(World par1World, int par2, int par3, int par4)
{
float f = 1.0F;
int i = par1World.getBlockId(par2, par3, par4 - 1);
int j = par1World.getBlockId(par2, par3, par4 + 1);
int k = par1World.getBlockId(par2 - 1, par3, par4);
int l = par1World.getBlockId(par2 + 1, par3, par4);
int i1 = par1World.getBlockId(par2 - 1, par3, par4 - 1);
int j1 = par1World.getBlockId(par2 + 1, par3, par4 - 1);
int k1 = par1World.getBlockId(par2 + 1, par3, par4 + 1);
int l1 = par1World.getBlockId(par2 - 1, par3, par4 + 1);
boolean flag = k == blockID || l == blockID;
boolean flag1 = i == blockID || j == blockID;
boolean flag2 = i1 == blockID || j1 == blockID || k1 == blockID || l1 == blockID;
for (int i2 = par2 - 1; i2 <= par2 + 1; i2++)
{
for (int j2 = par4 - 1; j2 <= par4 + 1; j2++)
{
int k2 = par1World.getBlockId(i2, par3 - 1, j2);
float f1 = 0.0F;
if (k2 == Block.tilledField.blockID)
{
f1 = 1.0F;
if (par1World.getBlockMetadata(i2, par3 - 1, j2) > 0)
{
f1 = 3F;
}
}
if (i2 != par2 || j2 != par4)
{
f1 /= 4F;
}
f += f1;
}
}
if (flag2 || flag && flag1)
{
f /= 2.0F;
}
return f;
}
/**
* The type of render function that is called for this block. The render type of 6 gets the texture and places it four times around the sides of the block and leaves nothing on the top or bottom.
*/
public int getRenderType()
{
return 6;
}
/**
* Drops the block items with a specified chance of dropping the specified items
*/
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
if (par1World.isRemote)
{
return;
}
int i = 3 + par7;
for (int j = 0; j < i; j++)
{
if (par1World.rand.nextInt(15) <= par5)
{
float f = 0.7F;
float f1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f3 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
EntityItem entityitem = new EntityItem(par1World, (float)par2 + f1, (float)par3 + f2, (float)par4 + f3, new ItemStack(mod_MUI.opiumseeds));
entityitem.delayBeforeCanPickup = 10;
par1World.spawnEntityInWorld(entityitem);
}
}
}
/**
* Returns the ID of the items to drop on destruction. "i" is equal to the blocks metadata value(explained slightly more in the getBlockTextureFromSideAndMetadata method below). This means that it will check that that value is equal to 8(the final stage of growth) and if it is then it will drop wheat. It may be fairly obvious, but the 'else' statement means that if the growth state is not equal to 7 then drop nothing (-1 means nothing)
*/
public int idDropped(int i, Random random, int j)
{
if (i == 8)
{
return mod_MUI.opiumblock.blockID;
}
else
{
return -1;
}
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random random)
{
return 1;
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata.
* As you may have been able to tell from the line above, "j" is equal to the metadata value of the block. This checks if that value is equal to a certain number then sets the blocks texture to what you have defined.
* The things that are being returned are the ints in your mod_ class which you created and set to your texture for the specific stages of growth.
*/
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(j == 0)
{
return blockIndexInTexture;
}
if(j == 1)
{
return mod_MUI.opiumstageone;
}
if(j == 2)
{
return mod_MUI.opiumstageone;
}
if(j == 3)
{
return mod_MUI.opiumstageone;
}
if(j == 4)
{
return mod_MUI.opiumstagetwo;
}
if(j == 5)
{
return mod_MUI.opiumstagetwo;
}
if(j == 6)
{
return mod_MUI.opiumstagetwo;
}
if(j == 7)
{
return mod_MUI.opiumstagetwo;
}
if(j == 8)
{
return mod_MUI.opiumstagethree;
}
return j;
}
}
ItemOpiumSeeds
package net.minecraft.src;
public class ItemOpiumSeeds extends Item
{
/** The type of block this seed turns into (wheat or pumpkin stems for instance)*/
private int blockType;
/** BlockID of the block the seeds can be planted on. */
private int soilBlockID;
public ItemOpiumSeeds(int i, int j, int k)
{
super(i);
blockType = j;
soilBlockID = k;
}
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS !
*/
public boolean tryPlaceIntoWorld(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par7 != 1)
{
return false;
}
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6) || !par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6))
{
return false;
}
int i = par3World.getBlockId(par4, par5, par6);
if (i == soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6))
{
par3World.setBlockWithNotify(par4, par5 + 1, par6, blockType);
par1ItemStack.stackSize--;
return true;
}
else
{
return false;
}
}
}
I'm trying to make "granite slabs", but the crafting recipe isn't working and it's not showing up in the creative inventory. Here's the code:
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class mod_EverythingFoodMod extends BaseMod
{
public void load()
{
}
public static final StepSound soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
public static final Block granite = new BlockGranite(150, 0).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep).setBlockName("Granite");
public mod_EverythingFoodMod()
{
ModLoader.registerBlock(granite);
ModLoader.addName(granite, "Granite");
granite.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Granite.png");
}
public void generateSurface(World world, Random rand , int i , int j)
{
for (int x = 0 ; x <30 ;x++)
{int Xcoord = i + rand.nextInt(16);
int Ycoord = rand.nextInt(40);
int Zcoord = j + rand.nextInt(16);
new WorldGenMinable(granite.blockID,16).generate(world, rand, Xcoord, Ycoord, Zcoord);
}
}
public static final Block GraniteSingleSlab = new BlockGraniteSlab(250, false).setBlockName("GraniteSlabSingle").setHardness(3F).setResistance(4F);
public static final Block GraniteDoubleSlab = new BlockGraniteSlab(251, true).setBlockName("GraniteSlabDouble").setHardness(3F).setResistance(4F);
public void load1()
{
GraniteSingleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/GraniteSingleSlab.png");
ModLoader.registerBlock(GraniteSingleSlab);
ModLoader.addName(GraniteSingleSlab, "Granite Slab");
ModLoader.addRecipe(new ItemStack(GraniteSingleSlab, 6), new Object [] {"#,#,#", Character.valueOf('#'), granite});
GraniteDoubleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/GraniteDoubleSlab.png");
ModLoader.registerBlock(GraniteDoubleSlab);
ModLoader.addName(GraniteDoubleSlab, "Granite Double Slab"); }
public String getVersion()
{
return "Everything Fodd Mod v1.0";
}
}
package net.minecraft.src;
import java.util.Random;
public class BlockGranite extends Block
{
protected BlockGranite (int x, int y)
{
super (x,y, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int idDropped(int x, Random rand,int y)
{
return mod_EverythingFoodMod.granite.blockID;
}
public int quantityDropped(Random rand)
{
return 1;
}
}
this.setCreativeTab(CreativeTabs.tabBlock);
setLightOpacity(0);
}
/**
* Returns the block texture based on the side being looked at. Args: side
*/
public int getBlockTextureFromSide(int par1)
{
return blockIndexInTexture;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_EverythingFoodMod.GraniteSingleSlab.blockID;
}
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
if(par1World.getBlockId(par2, par3 - 1, par4) == mod_EverythingFoodMod.GraniteSingleSlab.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
par1World.setBlockWithNotify(par2, par3 - 1, par4, mod_EverythingFoodMod.GraniteDoubleSlab.blockID);
}
}
/**
* Returns an item stack containing a single instance of the current block type. 'par1' is the block's subtype/damage
* and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null.
*/
protected ItemStack createStackedBlock(int par1)
{
return new ItemStack(mod_EverythingFoodMod.GraniteSingleSlab.blockID, 2, par1 & 7);
}
public String getFullSlabName(int var1)
{
return null;
}
}
I'm trying to make "granite slabs", but the crafting recipe isn't working and it's not showing up in the creative inventory. Here's the code:
I'm so lost by your code right now. You realize you did everything out of the public void load() area, don't you? Creating load1() will do nothing. Everything that is in your load1(), should go into the generated public void load(). I'll mark-up your code to show you what you need to do.
public void load()
{
}
public static final StepSound soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
public static final Block granite = new BlockGranite(150, 0).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep).setBlockName("Granite");
public mod_EverythingFoodMod()
{
ModLoader.registerBlock(granite);
ModLoader.addName(granite, "Granite");
public void generateSurface(World world, Random rand , int i , int j)
{
for (int x = 0 ; x <30 ;x++)
{int Xcoord = i + rand.nextInt(16);
int Ycoord = rand.nextInt(40);
int Zcoord = j + rand.nextInt(16);
new WorldGenMinable(granite.blockID,16).generate(world, rand, Xcoord, Ycoord, Zcoord);
}
}
public static final Block GraniteSingleSlab = new BlockGraniteSlab(250, false).setBlockName("GraniteSlabSingle").setHardness(3F).setResistance(4F);
public static final Block GraniteDoubleSlab = new BlockGraniteSlab(251, true).setBlockName("GraniteSlabDouble").setHardness(3F).setResistance(4F);
public void load1()
{
GraniteSingleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/GraniteSingleSlab.png");
ModLoader.registerBlock(GraniteSingleSlab);
ModLoader.addName(GraniteSingleSlab, "Granite Slab");
ModLoader.addRecipe(new ItemStack(GraniteSingleSlab, 6), new Object [] {"#,#,#", Character.valueOf('#'), granite});
public String getVersion()
{
return "Everything Fodd Mod v1.0";
}
}
Okay, here we go.
Everything blue needs to be deleted.
Everything red needs to be moved ABOVE public void load(), but IN Public Class mod_EverythingFoodMod extends BaseMod {}
Everything green needs to be moved INTO public void load()
You can't just create a new load method into your program. Not unless you actually know how to make the program call it. But even with that, you don't want more than one. I think that should be everything. I'll edit it if not. Also, you mis-spelled Food in public String getVersion()
this my error code can any 1 plz tell me what is wronge
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Unexpected error
This error has been saved to C:\Users\kristo\Desktop\Dótakassin\minecraft coding\jars\.\crash-reports\crash-2012-09-03_09.32.00-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT c206e5ba --------
Generated 9/3/12 9:32 AM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.6.0_30, Sun Microsystems Inc.
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
- Memory: 995546416 bytes (949 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_Block 1.3.2
- LWJGL: 2.4.2
- OpenGL: Intel(R) HD Graphics Family GL version 3.0.0 - Build 8.15.10.2353, Intel
- Is Modded: Very likely
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
java.lang.RuntimeException: java.lang.Exception: Image not found: /image.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1632)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1188)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:857)
at net.minecraft.client.Minecraft.run(Minecraft.java:751)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /image.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1105)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1624)
... 5 more
--- END ERROR REPORT fb041d13 ----------
public class mod_CreeperBerryBush extends BaseMod
{
public static final Block CreeperBerryBush= new BlockFlower(189, 0).setBlockName("CreeperBerryBush");
public void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 7; k++)
{
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = j + random.nextInt(16);
(new WorldGenFlowers(CreeperBerryBush.blockID)).generate(world, random, randPosX, randPosY, randPosZ);
}
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
Apparently not, because I've tried a lot of different scenarios, and they didn't work.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
Crops are planting except they don't grow they just start at their final stage.
mod_MUI
package net.minecraft.src;
import java.util.Random;
public class mod_MUI extends BaseMod
{
//OPIUM CROP SETUP
public static final Block opiumblock = new BlockOpiumBlock(165, 0).setBlockName("opiumblock");
public static final Item opiumseeds = new ItemOpiumSeeds(909, opiumblock.blockID, Block.tilledField.blockID).setItemName("opiumseeds");
//CROP STAGES
public static int opiumstageone = ModLoader.addOverride("/terrain.png", "/crops/opiumstageone.png");
public static int opiumstagetwo = ModLoader.addOverride("/terrain.png", "/crops/opiumstagetwo.png");
public static int opiumstagethree = ModLoader.addOverride("/terrain.png", "/crops/opiumstagethree.png");
public void load()
{
/////////
//CROPS//
/////////
//Opium Poppy
opiumblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/opoppy.png");
ModLoader.registerBlock(opiumblock);
ModLoader.addName(opiumblock, "Opium Poppy");
//Opium Seeds
opiumseeds.iconIndex = ModLoader.addOverride("/gui/items.png", "/opiumseeds.png");
ModLoader.addName(opiumseeds, "Opium Poppy Seeds");
opiumseeds.setTabToDisplayOn(CreativeTabs.tabMaterials);
}
public String getVersion()
{
return "0.1a";
}
}
BlockOpiumBlock
package net.minecraft.src;
import java.util.Random;
public class BlockOpiumBlock extends BlockFlower
{
protected BlockOpiumBlock(int i, int j)
{
super(i, j);
blockIndexInTexture = j;
setTickRandomly(true);
float f = 0.5F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
}
/**
* Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
* blockID passed in. Args: blockID.
* This basically checks to see if the block below is a tilled field/tilled dirt. If it is true then the crop can grow.
*/
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return par1 == Block.tilledField.blockID;
}
/**
* Ticks the block if it's been scheduled. This method gets scheduled to run because of the setTickRandomly part in the constructor of the class.
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
super.updateTick(par1World, par2, par3, par4, par5Random);
if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
if (i < 8)
{
float f = getGrowthRate(par1World, par2, par3, par4);
if (par5Random.nextInt((int)(25F / f) + 1) == 0)
{
i++;
par1World.setBlockMetadataWithNotify(par2, par3, par4, i);
}
}
}
}
/**
* This method allows you to use bonemeal on your crop. Code explanation below:
ItemStack itemstack = entityplayer.inventory.getCurrentItem(); - This line makes "itemstack" equal to the item currently in the players hand.
if(itemstack != null && itemstack.itemID == Item.dyePowder.shiftedIndex) - This line checks if the item in players hand is equal to dye.
if(itemstack.getItemDamage() == 15) - This line checks if the damage value of that item is 15. Item.dyePowder's damage value of 15 is bonemeal.
world.setBlockMetadataWithNotify(i, j, k, 8); - This line sets the metadata value of the block to 8 which is the final growth stage.
itemstack.stackSize--; - This line makes the stack size go down by one.
world.notifyBlockChange(i, j, k, 0); - This line notifys adjacent blocks that this block has updated its state.
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem();
if(itemstack != null && itemstack.itemID == Item.dyePowder.shiftedIndex)
{
if(itemstack.getItemDamage() == 15)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 8);
itemstack.stackSize--;
par1World.notifyBlockChange(par2, par3, par4, 0);
}
}
super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9);
return true;
}
/**
* Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on
* different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below
* this one). Args: x, y, z
*/
private float getGrowthRate(World par1World, int par2, int par3, int par4)
{
float f = 1.0F;
int i = par1World.getBlockId(par2, par3, par4 - 1);
int j = par1World.getBlockId(par2, par3, par4 + 1);
int k = par1World.getBlockId(par2 - 1, par3, par4);
int l = par1World.getBlockId(par2 + 1, par3, par4);
int i1 = par1World.getBlockId(par2 - 1, par3, par4 - 1);
int j1 = par1World.getBlockId(par2 + 1, par3, par4 - 1);
int k1 = par1World.getBlockId(par2 + 1, par3, par4 + 1);
int l1 = par1World.getBlockId(par2 - 1, par3, par4 + 1);
boolean flag = k == blockID || l == blockID;
boolean flag1 = i == blockID || j == blockID;
boolean flag2 = i1 == blockID || j1 == blockID || k1 == blockID || l1 == blockID;
for (int i2 = par2 - 1; i2 <= par2 + 1; i2++)
{
for (int j2 = par4 - 1; j2 <= par4 + 1; j2++)
{
int k2 = par1World.getBlockId(i2, par3 - 1, j2);
float f1 = 0.0F;
if (k2 == Block.tilledField.blockID)
{
f1 = 1.0F;
if (par1World.getBlockMetadata(i2, par3 - 1, j2) > 0)
{
f1 = 3F;
}
}
if (i2 != par2 || j2 != par4)
{
f1 /= 4F;
}
f += f1;
}
}
if (flag2 || flag && flag1)
{
f /= 2.0F;
}
return f;
}
/**
* The type of render function that is called for this block. The render type of 6 gets the texture and places it four times around the sides of the block and leaves nothing on the top or bottom.
*/
public int getRenderType()
{
return 6;
}
/**
* Drops the block items with a specified chance of dropping the specified items
*/
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
if (par1World.isRemote)
{
return;
}
int i = 3 + par7;
for (int j = 0; j < i; j++)
{
if (par1World.rand.nextInt(15) <= par5)
{
float f = 0.7F;
float f1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f3 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
EntityItem entityitem = new EntityItem(par1World, (float)par2 + f1, (float)par3 + f2, (float)par4 + f3, new ItemStack(mod_MUI.opiumseeds));
entityitem.delayBeforeCanPickup = 10;
par1World.spawnEntityInWorld(entityitem);
}
}
}
/**
* Returns the ID of the items to drop on destruction. "i" is equal to the blocks metadata value(explained slightly more in the getBlockTextureFromSideAndMetadata method below). This means that it will check that that value is equal to 8(the final stage of growth) and if it is then it will drop wheat. It may be fairly obvious, but the 'else' statement means that if the growth state is not equal to 7 then drop nothing (-1 means nothing)
*/
public int idDropped(int i, Random random, int j)
{
if (i == 8)
{
return mod_MUI.opiumblock.blockID;
}
else
{
return -1;
}
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random random)
{
return 1;
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata.
* As you may have been able to tell from the line above, "j" is equal to the metadata value of the block. This checks if that value is equal to a certain number then sets the blocks texture to what you have defined.
* The things that are being returned are the ints in your mod_ class which you created and set to your texture for the specific stages of growth.
*/
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(j == 0)
{
return blockIndexInTexture;
}
if(j == 1)
{
return mod_MUI.opiumstageone;
}
if(j == 2)
{
return mod_MUI.opiumstageone;
}
if(j == 3)
{
return mod_MUI.opiumstageone;
}
if(j == 4)
{
return mod_MUI.opiumstagetwo;
}
if(j == 5)
{
return mod_MUI.opiumstagetwo;
}
if(j == 6)
{
return mod_MUI.opiumstagetwo;
}
if(j == 7)
{
return mod_MUI.opiumstagetwo;
}
if(j == 8)
{
return mod_MUI.opiumstagethree;
}
return j;
}
}
ItemOpiumSeeds
package net.minecraft.src;
public class ItemOpiumSeeds extends Item
{
/** The type of block this seed turns into (wheat or pumpkin stems for instance)*/
private int blockType;
/** BlockID of the block the seeds can be planted on. */
private int soilBlockID;
public ItemOpiumSeeds(int i, int j, int k)
{
super(i);
blockType = j;
soilBlockID = k;
}
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS !
*/
public boolean tryPlaceIntoWorld(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par7 != 1)
{
return false;
}
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6) || !par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6))
{
return false;
}
int i = par3World.getBlockId(par4, par5, par6);
if (i == soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6))
{
par3World.setBlockWithNotify(par4, par5 + 1, par6, blockType);
par1ItemStack.stackSize--;
return true;
}
else
{
return false;
}
}
}
Seriously? Why? I hope you realize that the mods'll never let you release that, and I doubt anyone will help you.
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
this my error code can any 1 plz tell me what is wronge
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Unexpected error
This error has been saved to C:\Users\kristo\Desktop\Dótakassin\minecraft coding\jars\.\crash-reports\crash-2012-09-03_09.32.00-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT c206e5ba --------
Generated 9/3/12 9:32 AM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.6.0_30, Sun Microsystems Inc.
- Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
- Memory: 995546416 bytes (949 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_Block 1.3.2
- LWJGL: 2.4.2
- OpenGL: Intel® HD Graphics Family GL version 3.0.0 - Build 8.15.10.2353, Intel
- Is Modded: Very likely
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
java.lang.RuntimeException: java.lang.Exception: Image not found: /image.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1632)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1188)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:857)
at net.minecraft.client.Minecraft.run(Minecraft.java:751)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /image.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1105)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1624)
... 5 more
--- END ERROR REPORT fb041d13 ----------
You've most likely misplaced a texture file for your mod. A lot of people are under the impression that you need to put the textures into the .jar, but this is false. You simply need to put the textures in Your MCP Directory > bin > minecraft. It'd probably be better to place your textures within its own folder in there. Let's say we call this folder "Example". (You can call it whatever, as long as your code reflects that)
So your textures would be in Your MCP Directory > bin > minecraft > Example
Let's just assume you're trying to add a block. I'll call it blockExample. A texture override at that point would look like this;
Post the code.
Crops are planting except they don't grow they just start at their final stage.
mod_MUI
package net.minecraft.src; import java.util.Random; public class mod_MUI extends BaseMod { //OPIUM CROP SETUP public static final Block opiumblock = new BlockOpiumBlock(165, 0).setBlockName("opiumblock"); public static final Item opiumseeds = new ItemOpiumSeeds(909, opiumblock.blockID, Block.tilledField.blockID).setItemName("opiumseeds"); //CROP STAGES public static int opiumstageone = ModLoader.addOverride("/terrain.png", "/crops/opiumstageone.png"); public static int opiumstagetwo = ModLoader.addOverride("/terrain.png", "/crops/opiumstagetwo.png"); public static int opiumstagethree = ModLoader.addOverride("/terrain.png", "/crops/opiumstagethree.png"); public void load() { ///////// //CROPS// ///////// //Opium Poppy opiumblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/opoppy.png"); ModLoader.registerBlock(opiumblock); ModLoader.addName(opiumblock, "Opium Poppy"); //Opium Seeds opiumseeds.iconIndex = ModLoader.addOverride("/gui/items.png", "/opiumseeds.png"); ModLoader.addName(opiumseeds, "Opium Poppy Seeds"); opiumseeds.setTabToDisplayOn(CreativeTabs.tabMaterials); } public String getVersion() { return "0.1a"; } }package net.minecraft.src; import java.util.Random; public class BlockOpiumBlock extends BlockFlower { protected BlockOpiumBlock(int i, int j) { super(i, j); blockIndexInTexture = j; setTickRandomly(true); float f = 0.5F; setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); } /** * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of * blockID passed in. Args: blockID. * This basically checks to see if the block below is a tilled field/tilled dirt. If it is true then the crop can grow. */ protected boolean canThisPlantGrowOnThisBlockID(int par1) { return par1 == Block.tilledField.blockID; } /** * Ticks the block if it's been scheduled. This method gets scheduled to run because of the setTickRandomly part in the constructor of the class. */ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { super.updateTick(par1World, par2, par3, par4, par5Random); if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { int i = par1World.getBlockMetadata(par2, par3, par4); if (i < 8) { float f = getGrowthRate(par1World, par2, par3, par4); if (par5Random.nextInt((int)(25F / f) + 1) == 0) { i++; par1World.setBlockMetadataWithNotify(par2, par3, par4, i); } } } } /** * This method allows you to use bonemeal on your crop. Code explanation below: ItemStack itemstack = entityplayer.inventory.getCurrentItem(); - This line makes "itemstack" equal to the item currently in the players hand. if(itemstack != null && itemstack.itemID == Item.dyePowder.shiftedIndex) - This line checks if the item in players hand is equal to dye. if(itemstack.getItemDamage() == 15) - This line checks if the damage value of that item is 15. Item.dyePowder's damage value of 15 is bonemeal. world.setBlockMetadataWithNotify(i, j, k, 8); - This line sets the metadata value of the block to 8 which is the final growth stage. itemstack.stackSize--; - This line makes the stack size go down by one. world.notifyBlockChange(i, j, k, 0); - This line notifys adjacent blocks that this block has updated its state. */ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem(); if(itemstack != null && itemstack.itemID == Item.dyePowder.shiftedIndex) { if(itemstack.getItemDamage() == 15) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 8); itemstack.stackSize--; par1World.notifyBlockChange(par2, par3, par4, 0); } } super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); return true; } /** * Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on * different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below * this one). Args: x, y, z */ private float getGrowthRate(World par1World, int par2, int par3, int par4) { float f = 1.0F; int i = par1World.getBlockId(par2, par3, par4 - 1); int j = par1World.getBlockId(par2, par3, par4 + 1); int k = par1World.getBlockId(par2 - 1, par3, par4); int l = par1World.getBlockId(par2 + 1, par3, par4); int i1 = par1World.getBlockId(par2 - 1, par3, par4 - 1); int j1 = par1World.getBlockId(par2 + 1, par3, par4 - 1); int k1 = par1World.getBlockId(par2 + 1, par3, par4 + 1); int l1 = par1World.getBlockId(par2 - 1, par3, par4 + 1); boolean flag = k == blockID || l == blockID; boolean flag1 = i == blockID || j == blockID; boolean flag2 = i1 == blockID || j1 == blockID || k1 == blockID || l1 == blockID; for (int i2 = par2 - 1; i2 <= par2 + 1; i2++) { for (int j2 = par4 - 1; j2 <= par4 + 1; j2++) { int k2 = par1World.getBlockId(i2, par3 - 1, j2); float f1 = 0.0F; if (k2 == Block.tilledField.blockID) { f1 = 1.0F; if (par1World.getBlockMetadata(i2, par3 - 1, j2) > 0) { f1 = 3F; } } if (i2 != par2 || j2 != par4) { f1 /= 4F; } f += f1; } } if (flag2 || flag && flag1) { f /= 2.0F; } return f; } /** * The type of render function that is called for this block. The render type of 6 gets the texture and places it four times around the sides of the block and leaves nothing on the top or bottom. */ public int getRenderType() { return 6; } /** * Drops the block items with a specified chance of dropping the specified items */ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); if (par1World.isRemote) { return; } int i = 3 + par7; for (int j = 0; j < i; j++) { if (par1World.rand.nextInt(15) <= par5) { float f = 0.7F; float f1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; float f2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; float f3 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; EntityItem entityitem = new EntityItem(par1World, (float)par2 + f1, (float)par3 + f2, (float)par4 + f3, new ItemStack(mod_MUI.opiumseeds)); entityitem.delayBeforeCanPickup = 10; par1World.spawnEntityInWorld(entityitem); } } } /** * Returns the ID of the items to drop on destruction. "i" is equal to the blocks metadata value(explained slightly more in the getBlockTextureFromSideAndMetadata method below). This means that it will check that that value is equal to 8(the final stage of growth) and if it is then it will drop wheat. It may be fairly obvious, but the 'else' statement means that if the growth state is not equal to 7 then drop nothing (-1 means nothing) */ public int idDropped(int i, Random random, int j) { if (i == 8) { return mod_MUI.opiumblock.blockID; } else { return -1; } } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random random) { return 1; } /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata. * As you may have been able to tell from the line above, "j" is equal to the metadata value of the block. This checks if that value is equal to a certain number then sets the blocks texture to what you have defined. * The things that are being returned are the ints in your mod_ class which you created and set to your texture for the specific stages of growth. */ public int getBlockTextureFromSideAndMetadata(int i, int j) { if(j == 0) { return blockIndexInTexture; } if(j == 1) { return mod_MUI.opiumstageone; } if(j == 2) { return mod_MUI.opiumstageone; } if(j == 3) { return mod_MUI.opiumstageone; } if(j == 4) { return mod_MUI.opiumstagetwo; } if(j == 5) { return mod_MUI.opiumstagetwo; } if(j == 6) { return mod_MUI.opiumstagetwo; } if(j == 7) { return mod_MUI.opiumstagetwo; } if(j == 8) { return mod_MUI.opiumstagethree; } return j; } }package net.minecraft.src; public class ItemOpiumSeeds extends Item { /** The type of block this seed turns into (wheat or pumpkin stems for instance)*/ private int blockType; /** BlockID of the block the seeds can be planted on. */ private int soilBlockID; public ItemOpiumSeeds(int i, int j, int k) { super(i); blockType = j; soilBlockID = k; } /** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ! */ public boolean tryPlaceIntoWorld(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (par7 != 1) { return false; } if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6) || !par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6)) { return false; } int i = par3World.getBlockId(par4, par5, par6); if (i == soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6)) { par3World.setBlockWithNotify(par4, par5 + 1, par6, blockType); par1ItemStack.stackSize--; return true; } else { return false; } } }I'm not helping you make anything drug related.
package net.minecraft.src; import java.util.List; import java.util.Random; public class mod_EverythingFoodMod extends BaseMod { public void load() { } public static final StepSound soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F); public static final Block granite = new BlockGranite(150, 0).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep).setBlockName("Granite"); public mod_EverythingFoodMod() { ModLoader.registerBlock(granite); ModLoader.addName(granite, "Granite"); granite.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Granite.png"); } public void generateSurface(World world, Random rand , int i , int j) { for (int x = 0 ; x <30 ;x++) {int Xcoord = i + rand.nextInt(16); int Ycoord = rand.nextInt(40); int Zcoord = j + rand.nextInt(16); new WorldGenMinable(granite.blockID,16).generate(world, rand, Xcoord, Ycoord, Zcoord); } } public static final Block GraniteSingleSlab = new BlockGraniteSlab(250, false).setBlockName("GraniteSlabSingle").setHardness(3F).setResistance(4F); public static final Block GraniteDoubleSlab = new BlockGraniteSlab(251, true).setBlockName("GraniteSlabDouble").setHardness(3F).setResistance(4F); public void load1() { GraniteSingleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/GraniteSingleSlab.png"); ModLoader.registerBlock(GraniteSingleSlab); ModLoader.addName(GraniteSingleSlab, "Granite Slab"); ModLoader.addRecipe(new ItemStack(GraniteSingleSlab, 6), new Object [] {"#,#,#", Character.valueOf('#'), granite}); GraniteDoubleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/GraniteDoubleSlab.png"); ModLoader.registerBlock(GraniteDoubleSlab); ModLoader.addName(GraniteDoubleSlab, "Granite Double Slab"); } public String getVersion() { return "Everything Fodd Mod v1.0"; } }package net.minecraft.src; import java.util.Random; public class BlockGranite extends Block { protected BlockGranite (int x, int y) { super (x,y, Material.rock); this.setCreativeTab(CreativeTabs.tabBlock); } public int idDropped(int x, Random rand,int y) { return mod_EverythingFoodMod.granite.blockID; } public int quantityDropped(Random rand) { return 1; } }this.setCreativeTab(CreativeTabs.tabBlock); setLightOpacity(0); } /** * Returns the block texture based on the side being looked at. Args: side */ public int getBlockTextureFromSide(int par1) { return blockIndexInTexture; } /** * Returns the ID of the items to drop on destruction. */ public int idDropped(int par1, Random par2Random, int par3) { return mod_EverythingFoodMod.GraniteSingleSlab.blockID; } public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { if(par1World.getBlockId(par2, par3 - 1, par4) == mod_EverythingFoodMod.GraniteSingleSlab.blockID) { par1World.setBlockWithNotify(par2, par3, par4, 0); par1World.setBlockWithNotify(par2, par3 - 1, par4, mod_EverythingFoodMod.GraniteDoubleSlab.blockID); } } /** * Returns an item stack containing a single instance of the current block type. 'par1' is the block's subtype/damage * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. */ protected ItemStack createStackedBlock(int par1) { return new ItemStack(mod_EverythingFoodMod.GraniteSingleSlab.blockID, 2, par1 & 7); } public String getFullSlabName(int var1) { return null; } }Thanks. Used some other code. (New to coding)
Now the item won't be used up when i use them.
Thanks anyway
This was supposed to be a witty signature, but then it got lost somewhere.
What a hero.
I'm so lost by your code right now. You realize you did everything out of the public void load() area, don't you? Creating load1() will do nothing. Everything that is in your load1(), should go into the generated public void load(). I'll mark-up your code to show you what you need to do.
public void load()
{
}
public static final StepSound soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
public static final Block granite = new BlockGranite(150, 0).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep).setBlockName("Granite");
public mod_EverythingFoodMod()
{
ModLoader.registerBlock(granite);
ModLoader.addName(granite, "Granite");
granite.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Granite.png");
}
public void generateSurface(World world, Random rand , int i , int j)
{
for (int x = 0 ; x <30 ;x++)
{int Xcoord = i + rand.nextInt(16);
int Ycoord = rand.nextInt(40);
int Zcoord = j + rand.nextInt(16);
new WorldGenMinable(granite.blockID,16).generate(world, rand, Xcoord, Ycoord, Zcoord);
}
}
public static final Block GraniteSingleSlab = new BlockGraniteSlab(250, false).setBlockName("GraniteSlabSingle").setHardness(3F).setResistance(4F);
public static final Block GraniteDoubleSlab = new BlockGraniteSlab(251, true).setBlockName("GraniteSlabDouble").setHardness(3F).setResistance(4F);
public void load1()
{
GraniteSingleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/GraniteSingleSlab.png");
ModLoader.registerBlock(GraniteSingleSlab);
ModLoader.addName(GraniteSingleSlab, "Granite Slab");
ModLoader.addRecipe(new ItemStack(GraniteSingleSlab, 6), new Object [] {"#,#,#", Character.valueOf('#'), granite});
GraniteDoubleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/GraniteDoubleSlab.png");
ModLoader.registerBlock(GraniteDoubleSlab);
ModLoader.addName(GraniteDoubleSlab, "Granite Double Slab"); }
public String getVersion()
{
return "Everything Fodd Mod v1.0";
}
}
Okay, here we go.
Everything blue needs to be deleted.
Everything red needs to be moved ABOVE public void load(), but IN Public Class mod_EverythingFoodMod extends BaseMod {}
Everything green needs to be moved INTO public void load()
You can't just create a new load method into your program. Not unless you actually know how to make the program call it. But even with that, you don't want more than one. I think that should be everything. I'll edit it if not. Also, you mis-spelled Food in public String getVersion()
Your minus sign is on the wrong side.
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
It should be after .stackSize
This was supposed to be a witty signature, but then it got lost somewhere.
Look at my previous post.
Well, it worked as i wanted after i changed something!
I drank it up, so i got a empty glass back, perfecto, But thanks for the help anyway!
This was supposed to be a witty signature, but then it got lost somewhere.
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Unexpected error
This error has been saved to C:\Users\kristo\Desktop\Dótakassin\minecraft coding\jars\.\crash-reports\crash-2012-09-03_09.32.00-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT c206e5ba --------
Generated 9/3/12 9:32 AM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.6.0_30, Sun Microsystems Inc.
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
- Memory: 995546416 bytes (949 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_Block 1.3.2
- LWJGL: 2.4.2
- OpenGL: Intel(R) HD Graphics Family GL version 3.0.0 - Build 8.15.10.2353, Intel
- Is Modded: Very likely
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
java.lang.RuntimeException: java.lang.Exception: Image not found: /image.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1632)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1188)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:857)
at net.minecraft.client.Minecraft.run(Minecraft.java:751)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /image.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1105)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1624)
... 5 more
--- END ERROR REPORT fb041d13 ----------
Here's the Coding:
package net.minecraft.src;
import java.util.Random;
public class mod_CreeperBerryBush extends BaseMod
{
public static final Block CreeperBerryBush= new BlockFlower(189, 0).setBlockName("CreeperBerryBush");
public void load()
{
CreeperBerryBush.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/CreeperBerryBush.png");
ModLoader.registerBlock(CreeperBerryBush);
ModLoader.addName(CreeperBerryBush, "CreeperBerryBush");
}
public void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 7; k++)
{
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = j + random.nextInt(16);
(new WorldGenFlowers(CreeperBerryBush.blockID)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.3.2";
}
}
-
View User Profile
-
View Posts
-
Send Message
Retired StaffEveryone's having that problem. I've tried several things, and I get a StackOverflow after a while (at least that's what shows up in the console.)
Haha, creeper berry bush.
Is there anything I can do about this problem?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffApparently not, because I've tried a lot of different scenarios, and they didn't work.
Another Theory, what about making a block that generates on the surface?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffSeriously? Why? I hope you realize that the mods'll never let you release that, and I doubt anyone will help you.
Dunno. I just want my flowers!
-
View User Profile
-
View Posts
-
Send Message
Retired StaffYou've most likely misplaced a texture file for your mod. A lot of people are under the impression that you need to put the textures into the .jar, but this is false. You simply need to put the textures in Your MCP Directory > bin > minecraft. It'd probably be better to place your textures within its own folder in there. Let's say we call this folder "Example". (You can call it whatever, as long as your code reflects that)
So your textures would be in Your MCP Directory > bin > minecraft > Example
Let's just assume you're trying to add a block. I'll call it blockExample. A texture override at that point would look like this;
blockExample.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Example/blockExample.png");Hope that helps.