i Get this error when starting my client
but it compiles correctly
---- Minecraft Crash Report ----
// Oops.
Time: 9/15/12 5:30 PM
Description: ModLoader has failed to initialize.
java.lang.StringIndexOutOfBoundsException: String index out of range: 4
at java.lang.String.charAt(String.java:695)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:185)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:507)
at net.minecraft.src.mod_MoreSwords.load(mod_MoreSwords.java:39)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Thread.java:722)
Relevant Details:
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_04, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 994662168 bytes (948 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_MoreSwords Minecraft 1.3.1 V Beta 0.1
Similar to the post above me, stairs do not work correctly.
Here are my mod_AdobeStairs and BlockAdobeStairs .java files:
package net.minecraft.src;
public class mod_AdobeStairs extends BaseMod
{
public static final Block AdobeStairs= new BlockAdobeStairs(203, 0).setBlockName("AdobeStairs").setHardness(1.3F).setResistance(12F);
public void load()
{
AdobeStairs.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Adobe.png");
ModLoader.registerBlock(AdobeStairs);
ModLoader.addName(AdobeStairs, "Adobe Stairs");
ModLoader.addRecipe(new ItemStack(AdobeStairs, 6), new Object [] {"A ", "AA ", "AAA", Character.valueOf('A'), mod_Adobe.Adobe});
}
public String getVersion()
{
return "1.3.2";
}
}
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class BlockAdobeStairs extends Block
{
private static final int[][] field_72159_a = new int[][] {{2, 6}, {3, 7}, {2, 3}, {6, 7}, {0, 4}, {1, 5}, {0, 1}, {4, 5}};
private boolean field_72156_cr = false;
private int field_72160_cs = 0;
protected BlockAdobeStairs(int i, int j)
{
super(i, j, Material.rock);
this.setLightOpacity(255);
this.setCreativeTab(CreativeTabs.tabBlock);
}
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
if (this.field_72156_cr)
{
this.setBlockBounds(0.5F * (float)(this.field_72160_cs % 2), 0.5F * (float)(this.field_72160_cs / 2 % 2), 0.5F * (float)(this.field_72160_cs / 4 % 2), 0.5F + 0.5F * (float)(this.field_72160_cs % 2), 0.5F + 0.5F * (float)(this.field_72160_cs / 2 % 2), 0.5F + 0.5F * (float)(this.field_72160_cs / 4 % 2));
}
else
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
}
/**
* Is this block (a) opaque and (B) 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 10;
}
/**
* if the specified block is in the given AABB, add its collision bounding box to the given list
*/
public void addCollidingBlockToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
{
int var8 = par1World.getBlockMetadata(par2, par3, par4);
int var9 = var8 & 3;
float var10 = 0.0F;
float var11 = 0.5F;
float var12 = 0.5F;
float var13 = 1.0F;
if ((var8 & 4) != 0)
{
var10 = 0.5F;
var11 = 1.0F;
var12 = 0.0F;
var13 = 0.5F;
}
this.setBlockBounds(0.0F, var10, 0.0F, 1.0F, var11, 1.0F);
super.addCollidingBlockToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
if (var9 == 0)
{
this.setBlockBounds(0.5F, var12, 0.0F, 1.0F, var13, 1.0F);
super.addCollidingBlockToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
else if (var9 == 1)
{
this.setBlockBounds(0.0F, var12, 0.0F, 0.5F, var13, 1.0F);
super.addCollidingBlockToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
else if (var9 == 2)
{
this.setBlockBounds(0.0F, var12, 0.5F, 1.0F, var13, 1.0F);
super.addCollidingBlockToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
else if (var9 == 3)
{
this.setBlockBounds(0.0F, var12, 0.0F, 1.0F, var13, 0.5F);
super.addCollidingBlockToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
/**
* Called when the block is placed in the world.
*/
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int var7 = par1World.getBlockMetadata(par2, par3, par4) & 4;
if (var6 == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | var7);
}
if (var6 == 1)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | var7);
}
if (var6 == 2)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | var7);
}
if (var6 == 3)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var7);
}
}
/**
* called before onBlockPlacedBy by ItemBlock and ItemReed
*/
public void updateBlockMetadata(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8)
{
if (par5 == 0 || par5 != 1 && (double)par7 > 0.5D)
{
int var9 = par1World.getBlockMetadata(par2, par3, par4);
par1World.setBlockMetadataWithNotify(par2, par3, par4, var9 | 4);
}
}
/**
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world,
* x, y, z, startVec, endVec
*/
public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3)
{
MovingObjectPosition[] var7 = new MovingObjectPosition[8];
int var8 = par1World.getBlockMetadata(par2, par3, par4);
int var9 = var8 & 3;
boolean var10 = (var8 & 4) == 4;
int[] var11 = field_72159_a[var9 + (var10 ? 4 : 0)];
this.field_72156_cr = true;
int var14;
int var15;
int var16;
for (int var12 = 0; var12 < 8; ++var12)
{
this.field_72160_cs = var12;
int[] var13 = var11;
var14 = var11.length;
for (var15 = 0; var15 < var14; ++var15)
{
var16 = var13[var15];
if (var16 == var12)
{
;
}
}
var7[var12] = super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3);
}
int[] var21 = var11;
int var24 = var11.length;
for (var14 = 0; var14 < var24; ++var14)
{
var15 = var21[var14];
var7[var15] = null;
}
MovingObjectPosition var23 = null;
double var22 = 0.0D;
MovingObjectPosition[] var25 = var7;
var16 = var7.length;
for (int var17 = 0; var17 < var16; ++var17)
{
MovingObjectPosition var18 = var25[var17];
if (var18 != null)
{
double var19 = var18.hitVec.squareDistanceTo(par6Vec3);
if (var19 > var22)
{
var23 = var18;
var22 = var19;
}
}
}
return var23;
}
}
And here is the error:
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Jonathan\AppData\Roaming\.minecraft\crash-reports\crash-2012-09-16_16.06.42-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT a804601 --------
Generated 9/16/12 4:06 PM
java.lang.StringIndexOutOfBoundsException: String index out of range: 8
at java.lang.String.charAt(Unknown Source)
at td.a(SourceFile:603)
at ModLoader.addRecipe(ModLoader.java:468)
at mod_AdobeStairs.load(mod_AdobeStairs.java:11)
at ModLoader.init(ModLoader.java:938)
at ModLoader.addAllRenderers(ModLoader.java:185)
at avy.<init>(RenderManager.java:87)
at avy.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.a(SourceFile:260)
at net.minecraft.client.Minecraft.run(SourceFile:516)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT d705800e ----------
Rollback Post to RevisionRollBack
Check out Boats Evolved; the fancy huge customizable boats Notch tweeted about brought to life!
Why do you say that, TechGuy?! Modloader's cool, it's easy to use and you make really great tuts, and I want to learn more about modloader modding! :(*MOAR NPC TUTS
*MOAR ADVANCED BIOME TUTS
*MOAR GENERATION TUTS (e.g. shapeless structures like strongholds)
*ARMOUR TUTS
*BREWING RECIPE TUTS
*POTION TUTS
*POTION EFFECT TUTS
It would be great if you added that stuff to the tutorials. I'd like to know that stuff eventually.
Hey guys. I'm having an issue with the crop code.
I have no clue what needs to go where, and what needs to be named what.
If anyone could point out some flaws I would really appreciate it.
mod_PotMod Spoiler:
BlockPotCrop (I didn't take out any of the comments because I'm probably going to need them.) Spoiler:
Dude, a mod that adds marijuana? Kids play this game! D:<
Also, if you're being nice, it would be an idea to add beer and alcohol, which are negative potions, and have it be crafted into molotovs that you throw to make an explosion.
When I type:
Technofreak:~ amal$ cd /Users/amal/Desktop/Minecraft/Modding/mcp72 sh decompile.sh
in Terminal, it comes up with this:
Technofreak:mcp72 amal$
I typed bash decompile.sh after that, so it said:
Technofreak:mcp72 amal$ bash decompile.sh
and pressed enter, and then this came up:
/Users/amal/Desktop/Minecraft/Modding/mcp72/runtime/commands.py:137: Warning: 'with' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "runtime/decompile.py", line 13, in <module>
from commands import Commands, CLIENT, SERVER, CalledProcessError
File "/Users/amal/Desktop/Minecraft/Modding/mcp72/runtime/commands.py", line 137
with open(csvfile, 'rb') as fh:
^
SyntaxError: invalid syntax
Technofreak:mcp72 amal$
Once I did this, I had a hunt around for any folders with source files inside, and I couldn't find any. Where are they?
Why do you say that, TechGuy?! Modloader's cool, it's easy to use and you make really great tuts, and I want to learn more about modloader modding!
*MOAR NPC TUTS
*MOAR ADVANCED BIOME TUTS
*MOAR GENERATION TUTS (e.g. shapeless structures like strongholds)
*ARMOUR TUTS
*BREWING RECIPE TUTS
*POTION TUTS
*POTION EFFECT TUTS
It would be great if you added that stuff to the tutorials. I'd like to know that stuff eventually.
The OP says I'm not taking requests/ideas. The majority of mods now use Forge. Forge is better; much, much better. ModLoader is useless compared to Forge.
When I type:
Technofreak:~ amal$ cd /Users/amal/Desktop/Minecraft/Modding/mcp72 sh decompile.sh
in Terminal, it comes up with this:
Technofreak:mcp72 amal$
I typed bash decompile.sh after that, so it said:
Technofreak:mcp72 amal$ bash decompile.sh
and pressed enter, and then this came up:
/Users/amal/Desktop/Minecraft/Modding/mcp72/runtime/commands.py:137: Warning: 'with' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "runtime/decompile.py", line 13, in <module>
from commands import Commands, CLIENT, SERVER, CalledProcessError
File "/Users/amal/Desktop/Minecraft/Modding/mcp72/runtime/commands.py", line 137
with open(csvfile, 'rb') as fh:
^
SyntaxError: invalid syntax
Technofreak:mcp72 amal$
Once I did this, I had a hunt around for any folders with source files inside, and I couldn't find any. Where are they?
~Technofreak301
I don't have a Mac so I can't help.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hi TechGuy543 why my crop wont grow alone ? grow only with BONEMEAL ,I have not changed anything in the code I just created the 10 textures for crops, the codes are on the first page of this TOPIC , pls help me is most important, THANKS
Post your code even if it is the same as it is in the tutorial.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
package net.minecraft.src;
import java.util.Map;
public class mod_Tomato extends BaseMod
{
//sativacrop CALL
//Replace "sativacrop" through out both of these files with your own crop's name
public static final Block sativacrop = new Blocksativacrop(150, 0).setBlockName("sativacrop").setRequiresSelfNotify();
public static final Item sativaseed = new ItemSeeds(151, mod_Tomato.sativaseed.blockID, Block.tilledField.blockID).setItemName("sativacrop");
//sativacrop IMAGES CALL
public static int sativacrop1;
public static int sativacrop2;
public static int sativacrop3;
public static int sativacrop4;
public static int sativacrop5;
public static int sativacrop6;
public static int sativacrop7;
public static int sativacrop8;
public void load()
{
ModLoader.addName(sativacrop, "Sativa Crops");
ModLoader.addName(sativaseed, "Sativa Seeds");
sativacrop.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Sativa/sativacrop.png");
sativaseed.iconIndex = ModLoader.addOverride("/gui/items.png", "/Sativa/sativaseed.png");
sativacrop1 = ModLoader.addOverride("/terrain.png", "/Sativa/sativacropOne.png");
sativacrop2 = ModLoader.addOverride("/terrain.png", "/Sativa/sativacropTwo.png");
sativacrop3 = ModLoader.addOverride("/terrain.png", "/Sativa/sativacropThree.png");
sativacrop4 = ModLoader.addOverride("/terrain.png", "/Sativa/sativacropFour.png");
sativacrop5 = ModLoader.addOverride("/terrain.png", "/Sativa/sativacropFive.png");
sativacrop6 = ModLoader.addOverride("/terrain.png", "/Sativa/sativacropSix.png");
sativacrop7 = ModLoader.addOverride("/terrain.png", "/Sativa/sativacropSeven.png");
sativacrop8 = ModLoader.addOverride("/terrain.png", "/Sativa/sativacropEight.png");
}
public String getVersion()
{
return "1.3.1";
}
}
Blocksativacrop
package net.minecraft.src;
import java.util.Random;
public class Blocksativacrop extends BlockFlower
{
public Blocksativacrop(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(Item.seeds));
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 Item.appleGold.shiftedIndex;
}
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_Tomato.sativacrop1;
}
if(j == 2)
{
return mod_Tomato.sativacrop2;
}
if(j == 3)
{
return mod_Tomato.sativacrop3;
}
if(j == 4)
{
return mod_Tomato.sativacrop4;
}
if(j == 5)
{
return mod_Tomato.sativacrop5;
}
if(j == 6)
{
return mod_Tomato.sativacrop6;
}
if(j == 7)
{
return mod_Tomato.sativacrop7;
}
if(j == 8)
{
return mod_Tomato.sativacrop8;
}
return j;
}
}
TechGuy543 THIS IS MY CODE , why crop wont grow alone ? only with BONEMEAL , my texture work and drop my item, but wont grow.
mod_Crop
package net.minecraft.src;
public class mod_Crop extends BaseMod
{
//Just a standard block.
public static final Block cropNameHere = new BlockCropNameHere(165, 0).setBlockName("cropNameHere");
//This is a fairly standard item but it has two new arguments. The first is the block it plants, in this case is our new crop "cropNameHere". The second is the block that is required to be right clicked on to plant the seeds.
//We are using tilled field/dirt for this crop but you can change it to whatever you like. Remember to change it in the block class as well.
public static final Item seedsNameHere = new ItemSeedsNameHere(2500, cropNameHere.blockID, Block.tilledField.blockID).setItemName("seedsNameHere");
//These static ints are the textures of the crop in its various stages of growth.
public static int cropStageOne = ModLoader.addOverride("/terrain.png", "/stageOne.png");
public static int cropStageTwo = ModLoader.addOverride("/terrain.png", "/stageTwo.png");
public static int cropStageThree = ModLoader.addOverride("/terrain.png", "/stageThree.png");
public static int cropStageFour = ModLoader.addOverride("/terrain.png", "/stageFour.png");
public static int cropStageFive = ModLoader.addOverride("/terrain.png", "/stageFive.png");
public static int cropStageSix = ModLoader.addOverride("/terrain.png", "/stageSix.png");
public static int cropStageSeven = ModLoader.addOverride("/terrain.png", "/stageSeven.png");
public static int cropStageEight = ModLoader.addOverride("/terrain.png", "/stageEight.png");
public void load()
{
cropNameHere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crop.png");
ModLoader.registerBlock(cropNameHere);
ModLoader.addName(cropNameHere, "In-Game Name Here");
seedsNameHere.iconIndex = ModLoader.addOverride("/gui/items.png", "/seeds.png");
ModLoader.addName(seedsNameHere, "In-Game Name Here");
ModLoader.addRecipe(new ItemStack(seedsNameHere), new Object [] {"#", '#', Block.dirt});
}
public String getVersion()
{
return "1.3.1";
}
}
BlockCropNameHere
package net.minecraft.src;
import java.util.Random;
public class BlockCropNameHere extends BlockFlower
{
public BlockCropNameHere(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_Crop.seedsNameHere));
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 Item.wheat.shiftedIndex;
}
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_Crop.cropStageOne;
}
if(j == 2)
{
return mod_Crop.cropStageTwo;
}
if(j == 3)
{
return mod_Crop.cropStageThree;
}
if(j == 4)
{
return mod_Crop.cropStageFour;
}
if(j == 5)
{
return mod_Crop.cropStageFive;
}
if(j == 6)
{
return mod_Crop.cropStageSix;
}
if(j == 7)
{
return mod_Crop.cropStageSeven;
}
if(j == 8)
{
return mod_Crop.cropStageEight;
}
return j;
}
}
ItemSeedsNameHere
package net.minecraft.src;
public class ItemSeedsNameHere 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 ItemSeedsNameHere(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;
}
}
}
If your going to be like that, why should I bother helping you?
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
how to be like that? in what sense? I did not realize I was wrong to post the code?
Sorry for my bad english
Writing with caps lock, red text and oversized fonts...
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class mod_OnyxBlock extends BaseMod{
public static final Block onyxBlock = new BlockOnyxBlock(163, 0).setStepSound(Block.soundMetalFootstep).setHardness(5F).setResistance(5F);
public void load(){
onyxBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Onyx Block.png");
ModLoader.registerBlock(onyxBlock);
ModLoader.addName(onyxBlock, "Block of Onyx");
ModLoader.addRecipe(new ItemStack(onyxBlock, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), mod_Onyx.onyx});
}
public String getVersion(){
return "Onyx Mod v. 1.0 for Minecraft 1.3.2";
}
}
Error report:
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Exception occured in ModLoader
This error has been saved to C:\Users\Syberia\Desktop\MCP\jars\.\crash-reports\crash-2012-09-17_16.01.19-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT a1ad628b --------
Generated 17.09.12 16:01
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 997819528 bytes (951 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 9
ModLoader 1.3.2
mod_MercuryBar Onyx Mod v. 1.0 for Minecraft 1.3.2
mod_MercuryBlock Onyx Mod v. 1.0 for Minecraft 1.3.2
mod_MercuryIngot Onyx Mod v. 1.0 for Minecraft 1.3.2
mod_MercuryOre Onyx Mod v. 1.0 for Minecraft 1.3.2
mod_MercuryRings Onyx Mod v. 1.0 for Minecraft 1.3.2
mod_Onyx Onyx Mod v. 1.0 for Minecraft 1.3.2
mod_OnyxBlock Onyx Mod v. 1.0 for Minecraft 1.3.2
mod_OnyxOre Onyx Mod v. 1.0 for Minecraft 1.3.2
java.lang.Exception: net.minecraft.src.BlockOnyxBlock@54443d7a is missing name tag!
at net.minecraft.src.ModLoader.addName(ModLoader.java:447)
at net.minecraft.src.ModLoader.addName(ModLoader.java:398)
at net.minecraft.src.mod_OnyxBlock.load(mod_OnyxBlock.java:16)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT fc7b20da ----------
You need to add .setBlockName like shown in the tutorial. Only use one mod_ class.
THIS IS MY CODE , why crop wont grow alone ? only with BONEMEAL , my texture work and drop my item, but wont grow.
mod_Crop
package net.minecraft.src;
public class mod_Crop extends BaseMod
{
//Just a standard block.
public static final Block cropNameHere = new BlockCropNameHere(165, 0).setBlockName("cropNameHere");
//This is a fairly standard item but it has two new arguments. The first is the block it plants, in this case is our new crop "cropNameHere". The second is the block that is required to be right clicked on to plant the seeds.
//We are using tilled field/dirt for this crop but you can change it to whatever you like. Remember to change it in the block class as well.
public static final Item seedsNameHere = new ItemSeedsNameHere(2500, cropNameHere.blockID, Block.tilledField.blockID).setItemName("seedsNameHere");
//These static ints are the textures of the crop in its various stages of growth.
public static int cropStageOne = ModLoader.addOverride("/terrain.png", "/stageOne.png");
public static int cropStageTwo = ModLoader.addOverride("/terrain.png", "/stageTwo.png");
public static int cropStageThree = ModLoader.addOverride("/terrain.png", "/stageThree.png");
public static int cropStageFour = ModLoader.addOverride("/terrain.png", "/stageFour.png");
public static int cropStageFive = ModLoader.addOverride("/terrain.png", "/stageFive.png");
public static int cropStageSix = ModLoader.addOverride("/terrain.png", "/stageSix.png");
public static int cropStageSeven = ModLoader.addOverride("/terrain.png", "/stageSeven.png");
public static int cropStageEight = ModLoader.addOverride("/terrain.png", "/stageEight.png");
public void load()
{
cropNameHere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crop.png");
ModLoader.registerBlock(cropNameHere);
ModLoader.addName(cropNameHere, "In-Game Name Here");
seedsNameHere.iconIndex = ModLoader.addOverride("/gui/items.png", "/seeds.png");
ModLoader.addName(seedsNameHere, "In-Game Name Here");
ModLoader.addRecipe(new ItemStack(seedsNameHere), new Object [] {"#", '#', Block.dirt});
}
public String getVersion()
{
return "1.3.1";
}
}
BlockCropNameHere
package net.minecraft.src;
import java.util.Random;
public class BlockCropNameHere extends BlockFlower
{
public BlockCropNameHere(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_Crop.seedsNameHere));
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 Item.wheat.shiftedIndex;
}
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_Crop.cropStageOne;
}
if(j == 2)
{
return mod_Crop.cropStageTwo;
}
if(j == 3)
{
return mod_Crop.cropStageThree;
}
if(j == 4)
{
return mod_Crop.cropStageFour;
}
if(j == 5)
{
return mod_Crop.cropStageFive;
}
if(j == 6)
{
return mod_Crop.cropStageSix;
}
if(j == 7)
{
return mod_Crop.cropStageSeven;
}
if(j == 8)
{
return mod_Crop.cropStageEight;
}
return j;
}
}
ItemSeedsNameHere
package net.minecraft.src;
public class ItemSeedsNameHere 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 ItemSeedsNameHere(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;
}
}
}
Sorry , now is right? psl help me this is frustrating, I'm working for a week and I can not find the solution.
Thanks a lot.
Is it growing to almost the final stage but not quite the final one?
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
hey i need help with the crop i get this error when i run:
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:287)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1279)
at net.minecraft.src.ModLoader.init(ModLoader.java:849)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at net.minecraft.src.mod_DragonBallZ.<clinit>(mod_DragonBallZ.java:17)
... 15 more
I have tested this enough times to come down to the error is in here:
public static final Item SeedsSenzu = (new ItemSeedsSenzu(9989, mod_DragonBallZ.CropSenzu.blockID, Block.tilledField.blockID).setItemName("Senzu Seeds"));
For the Structure Generation I want my house to spawn only on the surface. Not floating. Not underground. On the surface. How do I go about doing this.
Just some extra information: Much like when a village spawns in a ravine the bottom of the house goes all the way down until it hits the bottom. So yeah please help
Also when will you be doing the Dimensions tutorial. I don't need it now I am just wondering.
The OP says I'm not taking requests/ideas. The majority of mods now use Forge. Forge is better; much, much better. ModLoader is useless compared to Forge.
That's kind of sad, but could you at least keep the ModLoader tutorials? (Even if you don't update them)
Rollback Post to RevisionRollBack
The Minecraft Forum can be described as a "bunch of crazy people all disagreeing with each other"
That's kind of sad, but could you at least keep the ModLoader tutorials? (Even if you don't update them)
I'm not going to delete them - I've spent months working on them.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I got a bunch of errors when trying to recompile. I was trying to make a fryed egg food (hadn't even set a furnace recipe yet)
and I got this when I tryed recompiling. Any idea what I did wrong?
I got a bunch of errors when trying to recompile. I was trying to make a fryed egg food (hadn't even set a furnace recipe yet)
and I got this when I tryed recompiling. Any idea what I did wrong?
You are suppose to change the nameHeres to the name of your item, and in the future, please post your code
I finally got it working, just pasted fryedegg.png into a bunch of rndom folders until it worked.
No idea how installing it on a new Minecraft.jar will work, though.
I finally got it working, just pasted fryedegg.png into a bunch of rndom folders until it worked.
No idea how installing it on a new Minecraft.jar will work, though.
I think installing it would just be putting it in the mods folder because you do not edit base classestech guy I know you said you were going to start working on a tree tutorial but do you know any you can recommend so that I can start work on my biome I am hoping to make with custom trees.
but it compiles correctly
---- Minecraft Crash Report ----
// Oops.
Time: 9/15/12 5:30 PM
Description: ModLoader has failed to initialize.
java.lang.StringIndexOutOfBoundsException: String index out of range: 4
at java.lang.String.charAt(String.java:695)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:185)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:507)
at net.minecraft.src.mod_MoreSwords.load(mod_MoreSwords.java:39)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Thread.java:722)
Relevant Details:
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_04, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 994662168 bytes (948 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_MoreSwords Minecraft 1.3.1 V Beta 0.1
Here are my mod_AdobeStairs and BlockAdobeStairs .java files:
And here is the error:
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Jonathan\AppData\Roaming\.minecraft\crash-reports\crash-2012-09-16_16.06.42-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT a804601 --------
Generated 9/16/12 4:06 PM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (x86) version 6.1
- Java Version: 1.7.0_07, Oracle Corporation
- Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
- Memory: 408417568 bytes (389 MB) / 518979584 bytes (494 MB) up to 1037959168 bytes (989 MB)
- JVM Flags: 2 total; -Xms512m -Xmx1024m
- ModLoader: Mods loaded: 6
ModLoader 1.3.2
mod_Crystal Crystal Test Minecraft 1.3.2
mod_Adobe Adobe and Marble 1.3.2
mod_AdobeBrick Adobe & Marble 1.3.2
mod_AdobePillar Adobe & Marble 1.3.2
mod_AdobeStairs 1.3.2
java.lang.StringIndexOutOfBoundsException: String index out of range: 8
at java.lang.String.charAt(Unknown Source)
at td.a(SourceFile:603)
at ModLoader.addRecipe(ModLoader.java:468)
at mod_AdobeStairs.load(mod_AdobeStairs.java:11)
at ModLoader.init(ModLoader.java:938)
at ModLoader.addAllRenderers(ModLoader.java:185)
at avy.<init>(RenderManager.java:87)
at avy.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.a(SourceFile:260)
at net.minecraft.client.Minecraft.run(SourceFile:516)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT d705800e ----------
Why do you say that, TechGuy?! Modloader's cool, it's easy to use and you make really great tuts, and I want to learn more about modloader modding! :(*MOAR NPC TUTS
*MOAR ADVANCED BIOME TUTS
*MOAR GENERATION TUTS (e.g. shapeless structures like strongholds)
*ARMOUR TUTS
*BREWING RECIPE TUTS
*POTION TUTS
*POTION EFFECT TUTS
It would be great if you added that stuff to the tutorials. I'd like to know that stuff eventually.
Dude, a mod that adds marijuana? Kids play this game! D:<
Also, if you're being nice, it would be an idea to add beer and alcohol, which are negative potions, and have it be crafted into molotovs that you throw to make an explosion.
When I type:
Technofreak:~ amal$ cd /Users/amal/Desktop/Minecraft/Modding/mcp72 sh decompile.sh
in Terminal, it comes up with this:
Technofreak:mcp72 amal$
I typed bash decompile.sh after that, so it said:
Technofreak:mcp72 amal$ bash decompile.sh
and pressed enter, and then this came up:
/Users/amal/Desktop/Minecraft/Modding/mcp72/runtime/commands.py:137: Warning: 'with' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "runtime/decompile.py", line 13, in <module>
from commands import Commands, CLIENT, SERVER, CalledProcessError
File "/Users/amal/Desktop/Minecraft/Modding/mcp72/runtime/commands.py", line 137
with open(csvfile, 'rb') as fh:
^
SyntaxError: invalid syntax
Technofreak:mcp72 amal$
Once I did this, I had a hunt around for any folders with source files inside, and I couldn't find any. Where are they?
~Technofreak301
The OP says I'm not taking requests/ideas. The majority of mods now use Forge. Forge is better; much, much better. ModLoader is useless compared to Forge.
I don't have a Mac so I can't help.
together they are powerful beyond imagination."
Post your code even if it is the same as it is in the tutorial.
together they are powerful beyond imagination."
If your going to be like that, why should I bother helping you?
together they are powerful beyond imagination."
Writing with caps lock, red text and oversized fonts...
together they are powerful beyond imagination."
You need to add .setBlockName like shown in the tutorial. Only use one mod_ class.
Is it growing to almost the final stage but not quite the final one?
together they are powerful beyond imagination."
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:287)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1279)
at net.minecraft.src.ModLoader.init(ModLoader.java:849)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at net.minecraft.src.mod_DragonBallZ.<clinit>(mod_DragonBallZ.java:17)
... 15 more
I have tested this enough times to come down to the error is in here:
public static final Item SeedsSenzu = (new ItemSeedsSenzu(9989, mod_DragonBallZ.CropSenzu.blockID, Block.tilledField.blockID).setItemName("Senzu Seeds"));
I don't understand what to do, nothing works
thanks in advance
Can you show me how that would be setup/used
Heres the code;
Just some extra information: Much like when a village spawns in a ravine the bottom of the house goes all the way down until it hits the bottom. So yeah please help
Also when will you be doing the Dimensions tutorial. I don't need it now I am just wondering.
That's kind of sad, but could you at least keep the ModLoader tutorials? (Even if you don't update them)
I'm not going to delete them - I've spent months working on them.
together they are powerful beyond imagination."
and I got this when I tryed recompiling. Any idea what I did wrong?
You are suppose to change the nameHeres to the name of your item, and in the future, please post your code
I finally got it working, just pasted fryedegg.png into a bunch of rndom folders until it worked.
No idea how installing it on a new Minecraft.jar will work, though.
I think installing it would just be putting it in the mods folder because you do not edit base classestech guy I know you said you were going to start working on a tree tutorial but do you know any you can recommend so that I can start work on my biome I am hoping to make with custom trees.