Thanks, that did the job. My multi-textures don't seem to work though...Here's the code again.
mod File
package net.minecraft.src;
import java.util.Random;
import java.util.Map;
import net.minecraft.src.forge.*;
public class mod_TGAEM extends NetworkMod
{
public static final BiomeGenBase BiomeHallow = (new BiomeGenHallow(30)).setColor(0xb0e2ff).setBiomeName("Hallowed Plains");
//Neutral
public static final Block mithrilOre = new BlockmithrilOre (200, 0).setHardness(1.0F).setResistance(1.0F).setBlockName("MithrilOre");
//Evil
public static final Block vileLog = new BlockvileLog (201).setHardness(2.0F).setStepSound(Block.soundWoodFootstep).setBlockName("VileLog");
public static final Block vilePlank = new BlockvilePlank (202, 0).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setBlockName("Vile Planks").setRequiresSelfNotify();
public static final Block vileSapling = new BlockvileSapling (203, 0).setHardness(1.0F).setResistance(1.0F).setStepSound(Block.soundGrassFootstep).setBlockName("VileSapling");
public static final Block vileLeaves = new BlockvileLeaves (204, 0).setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setBlockName("VileLeaves").setRequiresSelfNotify();
//Good
public static final Block exaltedLog = new BlockexaltedLog (205).setHardness(2.0F).setStepSound(Block.soundWoodFootstep).setBlockName("ExaltedLog");
public static final Block exaltedPlank = new BlockexaltedPlank (206, 0).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setBlockName("Exalted Planks").setRequiresSelfNotify();
public static final Block exaltedSapling = new BlockexaltedSapling (207, 0).setHardness(1.0F).setResistance(1.0F).setStepSound(Block.soundGrassFootstep).setBlockName("ExaltedSapling");
public static final Block exaltedLeaves = new BlockexaltedLeaves (208, 0).setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setBlockName("ExaltedLeaves").setRequiresSelfNotify();
public static final Block exaltedGround = new BlockexaltedGround (128, 0).setHardness(0.6F).setStepSound(Block.soundGrassFootstep).setBlockName("Consecrated Ground");
public static final Item vileStick = new Item (205).setItemName("Vile Stick");
public static final Item exaltedStick = new Item (206).setItemName("Exalted Stick");
//Texture Integers
public static int vlogside;
public static int vlogbottom;
public static int elogside;
public static int elogbottom;
public static int eGroundbottom;
public static int eGroundtop;
public static int eGroundside;
public mod_TGAEM()
{
//Textures
//EVIL
vlogside = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vlogside.png");
vlogbottom = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vlogbottom.png");
vilePlank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vileplank.png");
vileSapling.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vilesapling.png");
vileLeaves.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vileleaves.png");
vileStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/tgaem/evil/vilestick.png");
//GOOD
elogside = ModLoader.addOverride("/terrain.png", "/tgaem/good/elogside.png");
elogbottom = ModLoader.addOverride("/terrain.png", "/tgaem/good/elogbottom.png");
exaltedPlank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/good/exaltedplank.png");
exaltedSapling.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/good/exaltedsapling.png");
exaltedLeaves.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/good/exaltedleaves.png");
eGroundbottom = ModLoader.addOverride("/terrain.png", "/tgaem/good/egroundside.png");
eGroundtop = ModLoader.addOverride("/terrain.png", "/tgaem/good/egroundside.png");
eGroundside = ModLoader.addOverride("/terrain.png", "/tgaem/good/egroundside.png");
exaltedStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/tgaem/good/exaltedstick.png");
//NEUTRAL
//Block Registers/Names
//NEUTRAL
ModLoader.registerBlock(mithrilOre);
ModLoader.addName(mithrilOre, "Mithril Ore");
mithrilOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/item/mithrilore.png");
//Good Side
ModLoader.registerBlock(exaltedLog);
ModLoader.registerBlock(exaltedPlank);
ModLoader.registerBlock(exaltedSapling);
ModLoader.registerBlock(exaltedLeaves);
ModLoader.registerBlock(exaltedGround);
ModLoader.addName(exaltedLog, "Exalted Log");
ModLoader.addName(exaltedPlank, "Exalted Plank");
ModLoader.addName(exaltedSapling, "Exalted Sapling");
ModLoader.addName(exaltedLeaves, "Exalted Leaves");
ModLoader.addName(exaltedStick, "Exalted Stick");
ModLoader.addName(exaltedGround, "Exalted Ground");
//Evil Side
ModLoader.registerBlock(vileLog);
ModLoader.registerBlock(vilePlank);
ModLoader.registerBlock(vileSapling);
ModLoader.registerBlock(vileLeaves);
ModLoader.addName(vileLog, "Vile Log");
ModLoader.addName(vilePlank, "Vile Plank");
ModLoader.addName(vileSapling, "Vile Sapling");
ModLoader.addName(vileLeaves, "Vile Leaves");
ModLoader.addName(vileStick, "Vile Stick");
//Recipes
//EVIL
ModLoader.addRecipe(new ItemStack(mod_TGAEM.vilePlank, 4), new Object []{
"#", Character.valueOf('#'), mod_TGAEM.vileLog
});
ModLoader.addRecipe(new ItemStack(mod_TGAEM.vileStick, 4), new Object []{
"#", "#", Character.valueOf('#'), mod_TGAEM.vilePlank
});
//GOOD
ModLoader.addRecipe(new ItemStack(mod_TGAEM.exaltedPlank, 4), new Object []{
"#", Character.valueOf('#'), mod_TGAEM.exaltedLog
});
ModLoader.addRecipe(new ItemStack(mod_TGAEM.exaltedStick, 4), new Object []{
"#", "#", Character.valueOf('#'), mod_TGAEM.exaltedPlank
});
ModLoader.addRecipe(new ItemStack(mod_TGAEM.exaltedGround, 4), new Object []{
"#", Character.valueOf('#'), Block.dirt
});
}
//NEUTRAL
public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < (13); i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(23);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_TGAEM.mithrilOre.blockID, 7)).generate(world, rand, randPosX, randPosY, randPosZ);
System.out.println("Mithril Ores Generated.");
}
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
WorldGenVileTrees tree = new WorldGenVileTrees();
if((biome instanceof BiomeGenPlains) || (biome instanceof BiomeGenForest) || (biome instanceof BiomeGenHills) ||
(biome instanceof BiomeGenDesert) || (biome instanceof BiomeGenSwamp) || (biome instanceof BiomeGenTaiga))
{
for(int x = 0; x < 2; x++)
{
int Xcoord = chunkX + rand.nextInt(16);
int Zcoord = chunkZ + rand.nextInt(16);
int i = world.getHeightValue(Xcoord, Zcoord);
tree.generate(world, rand, Xcoord, i, Zcoord);
System.out.println("Vile Trees Generated.");
}
BiomeGenBase biome1 = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
WorldGenExaltedTrees tree1 = new WorldGenExaltedTrees();
if((biome1 instanceof BiomeGenPlains) || (biome1 instanceof BiomeGenForest) || (biome1 instanceof BiomeGenHills) ||
(biome1 instanceof BiomeGenDesert) || (biome1 instanceof BiomeGenSwamp) || (biome1 instanceof BiomeGenTaiga))
{
for(int x = 0; x < 2; x++)
{
int Xcoord = chunkX + rand.nextInt(16);
int Zcoord = chunkZ + rand.nextInt(16);
int i = world.getHeightValue(Xcoord, Zcoord);
tree1.generate(world, rand, Xcoord, i, Zcoord);
System.out.println("Exalted Trees Generated.");
}
}
}
}
public void load()
{
ModLoader.addBiome(BiomeHallow);
}
public String getVersion()
{
return "1.2.5";
}
}
BlockexaltedGround
package net.minecraft.src;
public class BlockexaltedGround extends Block
{
public BlockexaltedGround(int i, int j)
{
super(i, j, Material.grass);
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
public int getBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_TGAEM.eGroundbottom;
}
if (i == 1)
{
return mod_TGAEM.eGroundtop;
}
else
{
return mod_TGAEM.eGroundside;
}
}
}
Thanks, that did the job. My multi-textures don't seem to work though...Here's the code again.
mod File
package net.minecraft.src;
import java.util.Random;
import java.util.Map;
import net.minecraft.src.forge.*;
public class mod_TGAEM extends NetworkMod
{
public static final BiomeGenBase BiomeHallow = (new BiomeGenHallow(30)).setColor(0xb0e2ff).setBiomeName("Hallowed Plains");
//Neutral
public static final Block mithrilOre = new BlockmithrilOre (200, 0).setHardness(1.0F).setResistance(1.0F).setBlockName("MithrilOre");
//Evil
public static final Block vileLog = new BlockvileLog (201).setHardness(2.0F).setStepSound(Block.soundWoodFootstep).setBlockName("VileLog");
public static final Block vilePlank = new BlockvilePlank (202, 0).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setBlockName("Vile Planks").setRequiresSelfNotify();
public static final Block vileSapling = new BlockvileSapling (203, 0).setHardness(1.0F).setResistance(1.0F).setStepSound(Block.soundGrassFootstep).setBlockName("VileSapling");
public static final Block vileLeaves = new BlockvileLeaves (204, 0).setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setBlockName("VileLeaves").setRequiresSelfNotify();
//Good
public static final Block exaltedLog = new BlockexaltedLog (205).setHardness(2.0F).setStepSound(Block.soundWoodFootstep).setBlockName("ExaltedLog");
public static final Block exaltedPlank = new BlockexaltedPlank (206, 0).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setBlockName("Exalted Planks").setRequiresSelfNotify();
public static final Block exaltedSapling = new BlockexaltedSapling (207, 0).setHardness(1.0F).setResistance(1.0F).setStepSound(Block.soundGrassFootstep).setBlockName("ExaltedSapling");
public static final Block exaltedLeaves = new BlockexaltedLeaves (208, 0).setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setBlockName("ExaltedLeaves").setRequiresSelfNotify();
public static final Block exaltedGround = new BlockexaltedGround (128, 0).setHardness(0.6F).setStepSound(Block.soundGrassFootstep).setBlockName("Consecrated Ground");
public static final Item vileStick = new Item (205).setItemName("Vile Stick");
public static final Item exaltedStick = new Item (206).setItemName("Exalted Stick");
//Texture Integers
public static int vlogside;
public static int vlogbottom;
public static int elogside;
public static int elogbottom;
public static int eGroundbottom;
public static int eGroundtop;
public static int eGroundside;
public mod_TGAEM()
{
//Textures
//EVIL
vlogside = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vlogside.png");
vlogbottom = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vlogbottom.png");
vilePlank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vileplank.png");
vileSapling.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vilesapling.png");
vileLeaves.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vileleaves.png");
vileStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/tgaem/evil/vilestick.png");
//GOOD
elogside = ModLoader.addOverride("/terrain.png", "/tgaem/good/elogside.png");
elogbottom = ModLoader.addOverride("/terrain.png", "/tgaem/good/elogbottom.png");
exaltedPlank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/good/exaltedplank.png");
exaltedSapling.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/good/exaltedsapling.png");
exaltedLeaves.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/good/exaltedleaves.png");
eGroundbottom = ModLoader.addOverride("/terrain.png", "/tgaem/good/egroundside.png");
eGroundtop = ModLoader.addOverride("/terrain.png", "/tgaem/good/egroundside.png");
eGroundside = ModLoader.addOverride("/terrain.png", "/tgaem/good/egroundside.png");
exaltedStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/tgaem/good/exaltedstick.png");
//NEUTRAL
//Block Registers/Names
//NEUTRAL
ModLoader.registerBlock(mithrilOre);
ModLoader.addName(mithrilOre, "Mithril Ore");
mithrilOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/item/mithrilore.png");
//Good Side
ModLoader.registerBlock(exaltedLog);
ModLoader.registerBlock(exaltedPlank);
ModLoader.registerBlock(exaltedSapling);
ModLoader.registerBlock(exaltedLeaves);
ModLoader.registerBlock(exaltedGround);
ModLoader.addName(exaltedLog, "Exalted Log");
ModLoader.addName(exaltedPlank, "Exalted Plank");
ModLoader.addName(exaltedSapling, "Exalted Sapling");
ModLoader.addName(exaltedLeaves, "Exalted Leaves");
ModLoader.addName(exaltedStick, "Exalted Stick");
ModLoader.addName(exaltedGround, "Exalted Ground");
//Evil Side
ModLoader.registerBlock(vileLog);
ModLoader.registerBlock(vilePlank);
ModLoader.registerBlock(vileSapling);
ModLoader.registerBlock(vileLeaves);
ModLoader.addName(vileLog, "Vile Log");
ModLoader.addName(vilePlank, "Vile Plank");
ModLoader.addName(vileSapling, "Vile Sapling");
ModLoader.addName(vileLeaves, "Vile Leaves");
ModLoader.addName(vileStick, "Vile Stick");
//Recipes
//EVIL
ModLoader.addRecipe(new ItemStack(mod_TGAEM.vilePlank, 4), new Object []{
"#", Character.valueOf('#'), mod_TGAEM.vileLog
});
ModLoader.addRecipe(new ItemStack(mod_TGAEM.vileStick, 4), new Object []{
"#", "#", Character.valueOf('#'), mod_TGAEM.vilePlank
});
//GOOD
ModLoader.addRecipe(new ItemStack(mod_TGAEM.exaltedPlank, 4), new Object []{
"#", Character.valueOf('#'), mod_TGAEM.exaltedLog
});
ModLoader.addRecipe(new ItemStack(mod_TGAEM.exaltedStick, 4), new Object []{
"#", "#", Character.valueOf('#'), mod_TGAEM.exaltedPlank
});
ModLoader.addRecipe(new ItemStack(mod_TGAEM.exaltedGround, 4), new Object []{
"#", Character.valueOf('#'), Block.dirt
});
}
//NEUTRAL
public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < (13); i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(23);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_TGAEM.mithrilOre.blockID, 7)).generate(world, rand, randPosX, randPosY, randPosZ);
System.out.println("Mithril Ores Generated.");
}
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
WorldGenVileTrees tree = new WorldGenVileTrees();
if((biome instanceof BiomeGenPlains) || (biome instanceof BiomeGenForest) || (biome instanceof BiomeGenHills) ||
(biome instanceof BiomeGenDesert) || (biome instanceof BiomeGenSwamp) || (biome instanceof BiomeGenTaiga))
{
for(int x = 0; x < 2; x++)
{
int Xcoord = chunkX + rand.nextInt(16);
int Zcoord = chunkZ + rand.nextInt(16);
int i = world.getHeightValue(Xcoord, Zcoord);
tree.generate(world, rand, Xcoord, i, Zcoord);
System.out.println("Vile Trees Generated.");
}
BiomeGenBase biome1 = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
WorldGenExaltedTrees tree1 = new WorldGenExaltedTrees();
if((biome1 instanceof BiomeGenPlains) || (biome1 instanceof BiomeGenForest) || (biome1 instanceof BiomeGenHills) ||
(biome1 instanceof BiomeGenDesert) || (biome1 instanceof BiomeGenSwamp) || (biome1 instanceof BiomeGenTaiga))
{
for(int x = 0; x < 2; x++)
{
int Xcoord = chunkX + rand.nextInt(16);
int Zcoord = chunkZ + rand.nextInt(16);
int i = world.getHeightValue(Xcoord, Zcoord);
tree1.generate(world, rand, Xcoord, i, Zcoord);
System.out.println("Exalted Trees Generated.");
}
}
}
}
public void load()
{
ModLoader.addBiome(BiomeHallow);
}
public String getVersion()
{
return "1.2.5";
}
}
BlockexaltedGround
package net.minecraft.src;
public class BlockexaltedGround extends Block
{
public BlockexaltedGround(int i, int j)
{
super(i, j, Material.grass);
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
public int getBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_TGAEM.eGroundbottom;
}
if (i == 1)
{
return mod_TGAEM.eGroundtop;
}
else
{
return mod_TGAEM.eGroundside;
}
}
}
Make the static int lines like the ones in my tutorial. If you really don't want to do that then put the stuff relating to them from the constructor inside a static brace.
Something like that should work but I recommend you do it like the tutorial shows.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
root 245931453
313569700
java.lang.ClassCastException: net.minecraft.src.BlockCropDiaxium cannot be cast to net.minecraft.src.BlockStem
at net.minecraft.src.RenderBlocks.renderBlockStem(RenderBlocks.java:2538)
at net.minecraft.src.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:383)
at net.minecraft.src.WorldRenderer.updateRenderer(WorldRenderer.java:211)
at net.minecraft.src.RenderGlobal.updateRenderers(RenderGlobal.java:1461)
at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1070)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:907)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:873)
at net.minecraft.client.Minecraft.run(Minecraft.java:750)
at java.lang.Thread.run(Unknown Source)
2012-07-02 09:24:28 [SEVERE] A critical error has occurred.
java.lang.ClassCastException: net.minecraft.src.BlockCropDiaxium cannot be cast to net.minecraft.src.BlockStem
at net.minecraft.src.RenderBlocks.renderBlockStem(RenderBlocks.java:2538)
at net.minecraft.src.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:383)
at net.minecraft.src.WorldRenderer.updateRenderer(WorldRenderer.java:211)
at net.minecraft.src.RenderGlobal.updateRenderers(RenderGlobal.java:1461)
at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1070)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:907)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:873)
at net.minecraft.client.Minecraft.run(Minecraft.java:750)
at java.lang.Thread.run(Unknown Source)
2012-07-02 09:24:28 [SEVERE] 2 mods loaded
Minecraft Forge 3.3.8.151
FML v2.2.78.153
Forge Mod Loader version 2.2.78.153 for Minecraft 1.2.5
mod_MinecraftForge : Available (src)
mod_ZgAnimals : Available (src)
Stopping!
In one of the first lines is "minecraft.src.BlockStem"
But my code extends BlockFlower
Code of Crop:
package net.minecraft.src;
import java.util.Random;
public class BlockCropDiaxium extends BlockFlower
{
public BlockCropDiaxium(int i, int j)
{
super(i, j);
blockIndexInTexture = j;
setTickRandomly(true);
float f = 0.125F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
}
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return par1 == Block.obsidian.blockID;
}
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 < 6)
{
float f = getGrowthRate(par1World, par2, par3, par4);
if (par5Random.nextInt((int)(25F / f) + 1) == 0)
{
i++;
par1World.setBlockMetadataWithNotify(par2, par3, par4, i);
}
}
}
}
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.obsidian.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;
}
public int getRenderType()
{ return 19;
}
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 = 1 + 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_ZgAnimals.seedsDiaxium));
entityitem.delayBeforeCanPickup = 10;
par1World.spawnEntityInWorld(entityitem);
}
}
}
public int idDropped(int i, Random random, int j)
{
if (i == 6)
{
return Item.diamond.shiftedIndex;
}
else
{
return -1;
}
}
public int quantityDropped(Random random)
{
return 1;
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(j == 0)
{
return blockIndexInTexture;
}
if(j == 1)
{
return mod_ZgAnimals.cropStageOne;
}
if(j == 2)
{
return mod_ZgAnimals.cropStageTwo;
}
if(j == 3)
{
return mod_ZgAnimals.cropStageThree;
}
if(j == 4)
{
return mod_ZgAnimals.cropStageFour;
}
if(j == 5)
{
return mod_ZgAnimals.cropStageFive;
}
if(j == 6)
{ return mod_ZgAnimals.cropStageSix;
}
return j;
}
}
It is because of Minecraft's stupid hard coded render engine. You can't use render type 19 on a custom block.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
But, How can I fix this:
I tried:
- for(int k = 0; k < 10; k++)
- for(int k = 0; k < 1; k++)
- for(int k = 0; k < 900; k++)
- for(int k = 0; k < 0.0001; k++)
With the same effect.
What is it meant to be?
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Thank you sir for resolving my problem with the amethyst AND cutting down on the amount of files I use. Now go get yourself a nice cookie and ride a dolphin. Backwards.
hi dude. I have a question. How do you add a modded item to a recipe?
I assume you mean to use it in the recipe, not the recipe output... mod_yourclassnamehere:
public class yourclassnamehere extends BaseMod{
public static final Item testItem = (new Item(2012)).setItemName("Test Item").setIconIndex(0);
public static final Block testBlock = (new Block(202, 0)).setBlockName("Test Block");
public void load{
ModLoader.addRecipe(new ItemStack(testBlock), new Object[]{
"XX", "XX", 'X', testItem});
}
public String getVersion(){
return "v1.0.0";
}
}
What code do I change in this to make the pick faster and longer lasting?
package net.minecraft.src;
public class AustraliumPickaxe extends AustraliumTool
{
private static Block blocksEffectiveAgainst[];
protected AustraliumPickaxe(int par1, EnumToolAustralium par2EnumToolMaterialNamehere)
{
super(par1, 2, par2EnumToolMaterialNamehere, blocksEffectiveAgainst);
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
if (par1Block == Block.obsidian)
{
return toolMaterial.getHarvestLevel() == 2;
}
if (par1Block == Block.blockDiamond || par1Block == Block.oreDiamond)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (par1Block == Block.blockGold || par1Block == Block.oreGold)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (par1Block == Block.blockSteel || par1Block == Block.oreIron)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (par1Block == Block.blockLapis || par1Block == Block.oreLapis)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (par1Block == Block.oreRedstone || par1Block == Block.oreRedstoneGlowing)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (par1Block.blockMaterial == Material.rock)
{
return true;
}
return par1Block.blockMaterial == Material.iron;
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
if (par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock))
{
return efficiencyOnProperMaterial;
}
else
{
return super.getStrVsBlock(par1ItemStack, par2Block);
}
}
static
{
blocksEffectiveAgainst = (new Block[]
{
Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold,
Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail,
Block.railDetector, Block.railPowered
});
}
}
You need to edit the Enum object that you use for the tool. The format is:
MATERIALNAME(harvest level, max uses, efficiency, damage against entity, enchantability)
you can find the default values in the EnumToolMaterial class which is located in the net.minecraft.src package
hope that helps
How do you make structures rarer? I copied the code for structure generation, and it says that the 10 in the line beginning with for is the rarity, but editing it didn't change the rarity at all until I made it negative, which made it not spawn at all.
How do you make structures rarer? I copied the code for structure generation, and it says that the 10 in the line beginning with for is the rarity, but editing it didn't change the rarity at all until I made it negative, which made it not spawn at all.
Well, you could use a bit of basic math to make it rarer. In the generate method in the world gen class of the structure, you could add an if statement and a Random number generator. Example below because this isn't really an explanation.
public boolean generate(World world, Random random, int i, int j, int k)
{
int stoneBrick = Block.stoneBrick.blockID;
int number = random.nextInt(100);
if(number == 10)
{
world.setBlockWithNotify(i, j, k, stoneBrick);
world.setBlockAndMetadataWithNotify(i, j + 1, k, stoneBrick, 1);
return true;
}
return false;
}
The next nextInt method from Random will pick a random number between 0 and the number you put in brackets. In this case that number is 100. Then the if statement checks if the number is equal to 10. If it is then it allows the generation to go ahead but if it isn't it returns false not allowing it to do anything. This is a 1 in 100 chance of generating the structure. You can change that as much as you want to get your desired result.
Not sure of the problem with the watercan. Merge them both into the same mod_ class and see if you have the same problem. There is a tutorial on the bottom of the OP showing how to merge them.
How would I go about adding 3-4 bounding boxes for an entity, each one with different dimensions and coordinates relative to the entity?
I'm guessing your entity has different states? If yes, are they determined by booleans in the entity's class?
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 so I have some questions about the tools section.
What is a tool's material and how do you classify it?
So is a stone swords material stone? Is a diamond axe's material diamond?
If i made a custom ingot and then made that ingot included in the recipe for a pickaxe, would the ingot be that tools material?
Do you have to make an enum for each tool or each set of tools?
I used the tutorial to add your block to the creative inventory and i got 18 errors and I couldn't be bothered working it all out. So I'm wondering whether you tested it out before you posted it.
If you want to know the errors i got than here they are
Hey so I have some questions about the tools section.
What is a tool's material and how do you classify it?
So is a stone swords material stone? Is a diamond axe's material diamond?
If i made a custom ingot and then made that ingot included in the recipe for a pickaxe, would the ingot be that tools material?
Do you have to make an enum for each tool or each set of tools?
Thanks for answering these
A tool's material defines its strength(for example, whether or not it can mine ores), speed, the maximum amount of uses it allows the tool and the damage it does against entities. If by classifying it you mean how to assign it to a tool, you do it when you declare the tool in the public static final line.
Yes, a stone sword's material is stone. But we could have that stone sword set to use the material of Emerald(diamond). It is all changeable.
No, it wouldn't be the material. You set the tools material in the public static final line of it in the mod_ class(when you declare it).
You can use one Enum with as many materials to go with as many tools and sets as you like. If you look in EnumToolMaterial.java, you will see that all of the materials for every tool set in the game are in it.
I used the tutorial to add your block to the creative inventory and i got 18 errors and I couldn't be bothered working it all out. So I'm wondering whether you tested it out before you posted it.
If you want to know the errors i got than here they are
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.6.0_24\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Block.java:21: illegal start of expression
public void load()
^
src\minecraft\net\minecraft\src\mod_Block.java:21: illegal start of expression
public void load()
^
src\minecraft\net\minecraft\src\mod_Block.java:21: ';' expected
public void load()
^
src\minecraft\net\minecraft\src\mod_Block.java:30: illegal start of expression
public boolean onTickInGame(float f, Minecraft minecraft)
^
src\minecraft\net\minecraft\src\mod_Block.java:30: ';' expected
public boolean onTickInGame(float f, Minecraft minecraft)
^
src\minecraft\net\minecraft\src\mod_Block.java:30: ';' expected
public boolean onTickInGame(float f, Minecraft minecraft)
^
src\minecraft\net\minecraft\src\mod_Block.java:30: not a statement
public boolean onTickInGame(float f, Minecraft minecraft)
^
src\minecraft\net\minecraft\src\mod_Block.java:30: ';' expected
public boolean onTickInGame(float f, Minecraft minecraft)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: illegal start of expression
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: ';' expected
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: ';' expected
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: not a statement
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: ';' expected
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: ';' expected
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:52: illegal start of expression
private static GuiScreen creativeInventory;
^
src\minecraft\net\minecraft\src\mod_Block.java:52: illegal start of expression
private static GuiScreen creativeInventory;
^
src\minecraft\net\minecraft\src\mod_Block.java:52: ';' expected
private static GuiScreen creativeInventory;
^
src\minecraft\net\minecraft\src\mod_Block.java:52: not a statement
private static GuiScreen creativeInventory;
^
18 errors
==================
== Recompiling server ==
> Cleaning bin
> Recompiling
- Done in 5.97 seconds
Press any key to continue . . .
please help =D
Of course I tested it. I wrote it . It works for everyone else, including me in my mod so post your code. Put the code inside code tags and a spoiler.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Thank you Techguy your tutorials are amazing keep on doing them. I merged my 10 mod_ files together and noticed that 2 of my items had the same id i think that might of been the problem thanks for the help
Make the static int lines like the ones in my tutorial. If you really don't want to do that then put the stuff relating to them from the constructor inside a static brace.
Something like that should work but I recommend you do it like the tutorial shows.
Ah, ok. I actually figured out the error. I have a question about the biome spawning though. Does the
biomeDecorator.treesPerChunk = 5;
code pertain to how many trees that can be spawned in minecraft? I'm trying to spawn my own trees into the biome but I believe that it wouldn't work this way. World generation doesn't seem to do the job either as it spawns a fairly small amount of trees. Does this have to do with the biome?
How do you make it so that your block doesnt return to you but, a different block or item. Example: When your destroy stone you get cobblestone returned to you.
How do you make it so that your block doesnt return to you but, a different block or item. Example: When your destroy stone you get cobblestone returned to you.
How would I go about adding 3-4 bounding boxes for an entity, each one with different dimensions and coordinates relative to the entity?
I'm guessing your entity has different states? If yes, are they determined by booleans in the entity's class?
Nope. My entities more of an extra-large box that rotates. I'm planning new entities for each shape, but each shape still needs bounding boxes. I assumed the boxes rotated with the entity.
The main question is, again, how do I add multiple bounding boxes for a single entity?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Thanks, that did the job. My multi-textures don't seem to work though...Here's the code again.
mod File
package net.minecraft.src; import java.util.Random; import java.util.Map; import net.minecraft.src.forge.*; public class mod_TGAEM extends NetworkMod { public static final BiomeGenBase BiomeHallow = (new BiomeGenHallow(30)).setColor(0xb0e2ff).setBiomeName("Hallowed Plains"); //Neutral public static final Block mithrilOre = new BlockmithrilOre (200, 0).setHardness(1.0F).setResistance(1.0F).setBlockName("MithrilOre"); //Evil public static final Block vileLog = new BlockvileLog (201).setHardness(2.0F).setStepSound(Block.soundWoodFootstep).setBlockName("VileLog"); public static final Block vilePlank = new BlockvilePlank (202, 0).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setBlockName("Vile Planks").setRequiresSelfNotify(); public static final Block vileSapling = new BlockvileSapling (203, 0).setHardness(1.0F).setResistance(1.0F).setStepSound(Block.soundGrassFootstep).setBlockName("VileSapling"); public static final Block vileLeaves = new BlockvileLeaves (204, 0).setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setBlockName("VileLeaves").setRequiresSelfNotify(); //Good public static final Block exaltedLog = new BlockexaltedLog (205).setHardness(2.0F).setStepSound(Block.soundWoodFootstep).setBlockName("ExaltedLog"); public static final Block exaltedPlank = new BlockexaltedPlank (206, 0).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setBlockName("Exalted Planks").setRequiresSelfNotify(); public static final Block exaltedSapling = new BlockexaltedSapling (207, 0).setHardness(1.0F).setResistance(1.0F).setStepSound(Block.soundGrassFootstep).setBlockName("ExaltedSapling"); public static final Block exaltedLeaves = new BlockexaltedLeaves (208, 0).setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setBlockName("ExaltedLeaves").setRequiresSelfNotify(); public static final Block exaltedGround = new BlockexaltedGround (128, 0).setHardness(0.6F).setStepSound(Block.soundGrassFootstep).setBlockName("Consecrated Ground"); public static final Item vileStick = new Item (205).setItemName("Vile Stick"); public static final Item exaltedStick = new Item (206).setItemName("Exalted Stick"); //Texture Integers public static int vlogside; public static int vlogbottom; public static int elogside; public static int elogbottom; public static int eGroundbottom; public static int eGroundtop; public static int eGroundside; public mod_TGAEM() { //Textures //EVIL vlogside = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vlogside.png"); vlogbottom = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vlogbottom.png"); vilePlank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vileplank.png"); vileSapling.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vilesapling.png"); vileLeaves.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/evil/vileleaves.png"); vileStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/tgaem/evil/vilestick.png"); //GOOD elogside = ModLoader.addOverride("/terrain.png", "/tgaem/good/elogside.png"); elogbottom = ModLoader.addOverride("/terrain.png", "/tgaem/good/elogbottom.png"); exaltedPlank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/good/exaltedplank.png"); exaltedSapling.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/good/exaltedsapling.png"); exaltedLeaves.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/good/exaltedleaves.png"); eGroundbottom = ModLoader.addOverride("/terrain.png", "/tgaem/good/egroundside.png"); eGroundtop = ModLoader.addOverride("/terrain.png", "/tgaem/good/egroundside.png"); eGroundside = ModLoader.addOverride("/terrain.png", "/tgaem/good/egroundside.png"); exaltedStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/tgaem/good/exaltedstick.png"); //NEUTRAL //Block Registers/Names //NEUTRAL ModLoader.registerBlock(mithrilOre); ModLoader.addName(mithrilOre, "Mithril Ore"); mithrilOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tgaem/item/mithrilore.png"); //Good Side ModLoader.registerBlock(exaltedLog); ModLoader.registerBlock(exaltedPlank); ModLoader.registerBlock(exaltedSapling); ModLoader.registerBlock(exaltedLeaves); ModLoader.registerBlock(exaltedGround); ModLoader.addName(exaltedLog, "Exalted Log"); ModLoader.addName(exaltedPlank, "Exalted Plank"); ModLoader.addName(exaltedSapling, "Exalted Sapling"); ModLoader.addName(exaltedLeaves, "Exalted Leaves"); ModLoader.addName(exaltedStick, "Exalted Stick"); ModLoader.addName(exaltedGround, "Exalted Ground"); //Evil Side ModLoader.registerBlock(vileLog); ModLoader.registerBlock(vilePlank); ModLoader.registerBlock(vileSapling); ModLoader.registerBlock(vileLeaves); ModLoader.addName(vileLog, "Vile Log"); ModLoader.addName(vilePlank, "Vile Plank"); ModLoader.addName(vileSapling, "Vile Sapling"); ModLoader.addName(vileLeaves, "Vile Leaves"); ModLoader.addName(vileStick, "Vile Stick"); //Recipes //EVIL ModLoader.addRecipe(new ItemStack(mod_TGAEM.vilePlank, 4), new Object []{ "#", Character.valueOf('#'), mod_TGAEM.vileLog }); ModLoader.addRecipe(new ItemStack(mod_TGAEM.vileStick, 4), new Object []{ "#", "#", Character.valueOf('#'), mod_TGAEM.vilePlank }); //GOOD ModLoader.addRecipe(new ItemStack(mod_TGAEM.exaltedPlank, 4), new Object []{ "#", Character.valueOf('#'), mod_TGAEM.exaltedLog }); ModLoader.addRecipe(new ItemStack(mod_TGAEM.exaltedStick, 4), new Object []{ "#", "#", Character.valueOf('#'), mod_TGAEM.exaltedPlank }); ModLoader.addRecipe(new ItemStack(mod_TGAEM.exaltedGround, 4), new Object []{ "#", Character.valueOf('#'), Block.dirt }); } //NEUTRAL public void generateSurface(World world, Random rand, int chunkX, int chunkZ) { for(int i = 0; i < (13); i++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(23); int randPosZ = chunkZ + rand.nextInt(16); (new WorldGenMinable(mod_TGAEM.mithrilOre.blockID, 7)).generate(world, rand, randPosX, randPosY, randPosZ); System.out.println("Mithril Ores Generated."); } BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ); WorldGenVileTrees tree = new WorldGenVileTrees(); if((biome instanceof BiomeGenPlains) || (biome instanceof BiomeGenForest) || (biome instanceof BiomeGenHills) || (biome instanceof BiomeGenDesert) || (biome instanceof BiomeGenSwamp) || (biome instanceof BiomeGenTaiga)) { for(int x = 0; x < 2; x++) { int Xcoord = chunkX + rand.nextInt(16); int Zcoord = chunkZ + rand.nextInt(16); int i = world.getHeightValue(Xcoord, Zcoord); tree.generate(world, rand, Xcoord, i, Zcoord); System.out.println("Vile Trees Generated."); } BiomeGenBase biome1 = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ); WorldGenExaltedTrees tree1 = new WorldGenExaltedTrees(); if((biome1 instanceof BiomeGenPlains) || (biome1 instanceof BiomeGenForest) || (biome1 instanceof BiomeGenHills) || (biome1 instanceof BiomeGenDesert) || (biome1 instanceof BiomeGenSwamp) || (biome1 instanceof BiomeGenTaiga)) { for(int x = 0; x < 2; x++) { int Xcoord = chunkX + rand.nextInt(16); int Zcoord = chunkZ + rand.nextInt(16); int i = world.getHeightValue(Xcoord, Zcoord); tree1.generate(world, rand, Xcoord, i, Zcoord); System.out.println("Exalted Trees Generated."); } } } } public void load() { ModLoader.addBiome(BiomeHallow); } public String getVersion() { return "1.2.5"; } }BlockexaltedGround
package net.minecraft.src; public class BlockexaltedGround extends Block { public BlockexaltedGround(int i, int j) { super(i, j, Material.grass); } public int getBlockTextureFromSideAndMetadata(int i, int j) { return getBlockTextureFromSide(i); } public int getBlockTextureFromSide(int i) { if (i == 0) { return mod_TGAEM.eGroundbottom; } if (i == 1) { return mod_TGAEM.eGroundtop; } else { return mod_TGAEM.eGroundside; } } }Make the static int lines like the ones in my tutorial. If you really don't want to do that then put the stuff relating to them from the constructor inside a static brace.
static { groundBottomTexture = ModLoader.addOverride... //etc. }Something like that should work but I recommend you do it like the tutorial shows.
together they are powerful beyond imagination."
It is because of Minecraft's stupid hard coded render engine. You can't use render type 19 on a custom block.
together they are powerful beyond imagination."
What is it meant to be?
together they are powerful beyond imagination."
Thanks in advance
-EarthCrafterMan
Kill two stones with one bird whenever possible
I assume you mean to use it in the recipe, not the recipe output...
mod_yourclassnamehere:
public class yourclassnamehere extends BaseMod{ public static final Item testItem = (new Item(2012)).setItemName("Test Item").setIconIndex(0); public static final Block testBlock = (new Block(202, 0)).setBlockName("Test Block"); public void load{ ModLoader.addRecipe(new ItemStack(testBlock), new Object[]{ "XX", "XX", 'X', testItem}); } public String getVersion(){ return "v1.0.0"; } }Hope that helps
You need to edit the Enum object that you use for the tool. The format is:
MATERIALNAME(harvest level, max uses, efficiency, damage against entity, enchantability)
you can find the default values in the EnumToolMaterial class which is located in the net.minecraft.src package
hope that helps
package net.minecraft.src; public class mod_watercan extends BaseMod { public static final Item watercan = new watercan(5002).setItemName("watercan"); public void load() { watercan.iconIndex = ModLoader.addOverride("/gui/items.png", "/energycraft/watercan.png"); ModLoader.addName(watercan, "Can of Water"); ModLoader.addRecipe(new ItemStack(watercan, 1), new Object [] {"%%% ", "%#%", "%%%", Character.valueOf('#'), Item.bucketWater, Character.valueOf('%'), Item.ingotIron}); } public String getVersion() { return "1.2.5"; } }when i go to craft it nothing happens
also when i go to craft energy drink its already there in the output box
package net.minecraft.src; public class mod_energydrink extends BaseMod { public static final Item energydrink = new ItemFood(5001, 4, 1F, false).setPotionEffect(Potion.moveSpeed.id, 60, 0, 1F).setItemName("energydrink"); public void load() { energydrink.iconIndex = ModLoader.addOverride("/gui/items.png", "/energycraft/energydrink.png"); ModLoader.addName(energydrink, "Energy Drink"); ModLoader.addRecipe(new ItemStack(energydrink, 1), new Object [] {" # ", " % ", "", Character.valueOf('#'), mod_energytablet.energytablet, Character.valueOf('%'), mod_watercan.watercan}); } public String getVersion() { return "1.2.5"; } }please help
Read my reply to GrandmasterOcelot below.
Well, you could use a bit of basic math to make it rarer. In the generate method in the world gen class of the structure, you could add an if statement and a Random number generator. Example below because this isn't really an explanation.
public boolean generate(World world, Random random, int i, int j, int k) { int stoneBrick = Block.stoneBrick.blockID; int number = random.nextInt(100); if(number == 10) { world.setBlockWithNotify(i, j, k, stoneBrick); world.setBlockAndMetadataWithNotify(i, j + 1, k, stoneBrick, 1); return true; } return false; }The next nextInt method from Random will pick a random number between 0 and the number you put in brackets. In this case that number is 100. Then the if statement checks if the number is equal to 10. If it is then it allows the generation to go ahead but if it isn't it returns false not allowing it to do anything. This is a 1 in 100 chance of generating the structure. You can change that as much as you want to get your desired result.
The problem with the energy drink is because you have an empty " " for the bottom row. You just remove that because it isn't needed.
ModLoader.addRecipe(new ItemStack(energydrink, 1), new Object [] {"#", "%", Character.valueOf('#'), mod_energytablet.energytablet, Character.valueOf('%'), mod_watercan.watercan});Not sure of the problem with the watercan. Merge them both into the same mod_ class and see if you have the same problem. There is a tutorial on the bottom of the OP showing how to merge them.
I'm guessing your entity has different states? If yes, are they determined by booleans in the entity's class?
together they are powerful beyond imagination."
What is a tool's material and how do you classify it?
So is a stone swords material stone? Is a diamond axe's material diamond?
If i made a custom ingot and then made that ingot included in the recipe for a pickaxe, would the ingot be that tools material?
Do you have to make an enum for each tool or each set of tools?
Thanks for answering these
If you want to know the errors i got than here they are
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.6.0_24\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Block.java:21: illegal start of expression
public void load()
^
src\minecraft\net\minecraft\src\mod_Block.java:21: illegal start of expression
public void load()
^
src\minecraft\net\minecraft\src\mod_Block.java:21: ';' expected
public void load()
^
src\minecraft\net\minecraft\src\mod_Block.java:30: illegal start of expression
public boolean onTickInGame(float f, Minecraft minecraft)
^
src\minecraft\net\minecraft\src\mod_Block.java:30: ';' expected
public boolean onTickInGame(float f, Minecraft minecraft)
^
src\minecraft\net\minecraft\src\mod_Block.java:30: ';' expected
public boolean onTickInGame(float f, Minecraft minecraft)
^
src\minecraft\net\minecraft\src\mod_Block.java:30: not a statement
public boolean onTickInGame(float f, Minecraft minecraft)
^
src\minecraft\net\minecraft\src\mod_Block.java:30: ';' expected
public boolean onTickInGame(float f, Minecraft minecraft)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: illegal start of expression
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: ';' expected
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: ';' expected
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: not a statement
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: ';' expected
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:38: ';' expected
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
^
src\minecraft\net\minecraft\src\mod_Block.java:52: illegal start of expression
private static GuiScreen creativeInventory;
^
src\minecraft\net\minecraft\src\mod_Block.java:52: illegal start of expression
private static GuiScreen creativeInventory;
^
src\minecraft\net\minecraft\src\mod_Block.java:52: ';' expected
private static GuiScreen creativeInventory;
^
src\minecraft\net\minecraft\src\mod_Block.java:52: not a statement
private static GuiScreen creativeInventory;
^
18 errors
==================
== Recompiling server ==
> Cleaning bin
> Recompiling
- Done in 5.97 seconds
Press any key to continue . . .
please help =D
A tool's material defines its strength(for example, whether or not it can mine ores), speed, the maximum amount of uses it allows the tool and the damage it does against entities. If by classifying it you mean how to assign it to a tool, you do it when you declare the tool in the public static final line.
Yes, a stone sword's material is stone. But we could have that stone sword set to use the material of Emerald(diamond). It is all changeable.
No, it wouldn't be the material. You set the tools material in the public static final line of it in the mod_ class(when you declare it).
You can use one Enum with as many materials to go with as many tools and sets as you like. If you look in EnumToolMaterial.java, you will see that all of the materials for every tool set in the game are in it.
Of course I tested it. I wrote it
together they are powerful beyond imagination."
Ah, ok. I actually figured out the error. I have a question about the biome spawning though. Does the
code pertain to how many trees that can be spawned in minecraft? I'm trying to spawn my own trees into the biome but I believe that it wouldn't work this way. World generation doesn't seem to do the job either as it spawns a fairly small amount of trees. Does this have to do with the biome?
Block_Namehere:
package net.minecraft.src;
import java.util.Random;
public class BlockNamehere extends Block
{
public BlockNamehere(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.Namehere.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
See Bold
Replace italics (mod_Block.Namehere.blockID) with:
for mod_block: I 4Get probably where it's located or something
Namehere: Name of Block
blockID: Put in block ID
(EXAMPLE HERE SOON)
Kill two stones with one bird whenever possible
How would I go about adding 3-4 bounding boxes for an entity, each one with different dimensions and coordinates relative to the entity?
I'm guessing your entity has different states? If yes, are they determined by booleans in the entity's class?
Nope. My entities more of an extra-large box that rotates. I'm planning new entities for each shape, but each shape still needs bounding boxes. I assumed the boxes rotated with the entity.
The main question is, again, how do I add multiple bounding boxes for a single entity?