Wiuld u liek me to post the bone splinter codes?? So you can check em [email protected]??
Yes, please. Ensure the file has a .java extension too.
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 think the reason that everyone ignores you is because it is hard to make a container, but if you want help you can PM me, and I will try to help you.
For some reason when my mod is in a minecraft.jar it can't find my pics but when it's in a folder called minecraft.jar it can. Do you know why?
I think i can help.
In your code did you do
(ModLoader.addOverride("/gui/items.png", "/<Yourtexturehere>.png"));
Or did you do
(ModLoader.addOverride("/gui/items.png", "/minecraft.jar/<Yourtexturehere>.png"));
The first one is correct if you want it in the minecraft.jar
The second one says
'The texuture will be in the file minecraft.jar'
the first says
'It will be in this file'
I was wondering how I would create a smelting recipe out of something with a data value? Specifically want to have Coco Beans (Item.dyePowder, 1, 3) smelt into a custom item of mine.
If anyone could help that would be very useful!
I don't think that the current smelting system can handle that. I believe Forge has a hook for metadata smelting but I'm not 100% sure.
package net.minecraft.src;
public class mod_bonesplinters extends BaseMod
{
public static final Item BoneSplinters = new ItemBoneSplinters(350).setItemName("Bone Splinters");
public static final Block BoneBlock = (new BoneBlock(150, 0)).setBlockName("Bone Block").setResistance(7.5F).setHardness(7.5F).setLightValue(8F);
public mod_bonesplinters()
{
}
public void load()
{
ModLoader.addName(BoneSplinters, "BoneSplinters");
BoneSplinters.iconIndex = ModLoader.addOverride("/gui/items.png", "/theotextures/bone splinters/splinters.png");
ModLoader.addRecipe(new ItemStack(BoneSplinters, 4), new Object[]
{
" O ", " O ", " ", 'O', Item.bone
});
ModLoader.registerBlock(BoneBlock);
ModLoader.addName(BoneBlock, "Bone Block");
BoneBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/theotextures/bone splinters/boneblock.png");
ModLoader.addRecipe(new ItemStack(BoneBlock, 1), new Object[]
{
"OOO", "OOO", "OOO", 'O', Item.bone
});
}
public String getVersion()
{
return "1.2.5";
}
}
ItemBoneSplinters.java
package net.minecraft.src;
public class ItemBoneSplinters extends Item
{
public ItemBoneSplinters(int i)
{
super(i);
maxStackSize = 64;
}
}
here it is
Hmmm, I'm not sure. Try asking in Mod Development.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
The Meaning of Life, the Universe, and Everything.
Join Date:
4/13/2012
Posts:
55
Minecraft:
DXPower
Member Details
Hey, could you fix this? I am trying to make a 5x5 square of Stone Bricks, and when I run this code, it successfully does the 5 blocks on the i axis, but then when it goes to fill in 5 blocks for each row, it does no block on the first, one on the second, one on the third, one on the fourth, and one on the fifth. It, it goes diagonal, so it looks like a line graph... sorta. Here's the code:
package net.minecraft.src;
import java.util.Random;
public class WorldGenCastles extends WorldGenerator
{
public WorldGenCastles()
{
}
public boolean generate(World world, Random random, int i, int j, int k)
{
int stoneBrick = Block.stoneBrick.blockID;
world.setBlockWithNotify(i, j, k, stoneBrick);
for (int counter=1; counter<5; counter++)
{
world.setBlockWithNotify(i + counter, j, k, stoneBrick);
for (int fillI=1; fillI<5; fillI++)
{
int current = k;
if (counter != 1)
{
current = k + counter;
}
world.setBlockWithNotify(i + counter, j, current, stoneBrick);
}
}
return true;
}
}
It should work fine, but I am thinking it has something to do with the second for loop.... Thanks for help in advanced.
Also, one random question, one button do you use to make Spoilers?Actually, I narrowed down the problem...
current = k + counter;
}
world.setBlockWithNotify(i + counter, j, current, stoneBrick);
I think I know what is happening, but I don't know how to fix it...
Oh, and the if statement is for to but it on the first column, because I was having trouble with that...
Hey, could you fix this? I am trying to make a 5x5 square of Stone Bricks, and when I run this code, it successfully does the 5 blocks on the i axis, but then when it goes to fill in 5 blocks for each row, it does no block on the first, one on the second, one on the third, one on the fourth, and one on the fifth. It, it goes diagonal, so it looks like a line graph... sorta. Here's the code:
package net.minecraft.src;
import java.util.Random;
public class WorldGenCastles extends WorldGenerator
{
public WorldGenCastles()
{
}
public boolean generate(World world, Random random, int i, int j, int k)
{
int stoneBrick = Block.stoneBrick.blockID;
world.setBlockWithNotify(i, j, k, stoneBrick);
for (int counter=1; counter<5; counter++)
{
world.setBlockWithNotify(i + counter, j, k, stoneBrick);
for (int fillI=1; fillI<5; fillI++)
{
int current = k;
if (counter != 1)
{
current = k + counter;
}
world.setBlockWithNotify(i + counter, j, current, stoneBrick);
}
}
return true;
}
}
It should work fine, but I am thinking it has something to do with the second for loop.... Thanks for help in advanced.
Also, one random question, one button do you use to make Spoilers?
Actually, I narrowed down the problem...
current = k + counter;
}
world.setBlockWithNotify(i + counter, j, current, stoneBrick);
I think I know what is happening, but I don't know how to fix it...
Oh, and the if statement is for to but it on the first column, because I was having trouble with that...
ModLoader.addRecipe(new ItemStack(BoneSplinters, 4), new Object[]
{
" O ", " O ", " ", 'O', Item.bone
});
I dunno what your problem is exactly but I think I see an error with this code in the line above, I believe it should look like this
ModLoader.addRecipe(new ItemStack(BoneSplinters, 4), new Object[]
{
" O ", " O ", " ", Character.valueOf('O'), Item.bone
});
Also if it cant find your file chances are it in the wrong section I made a class and somehow it wasn't in the right place..
Nice spotting I missed that before.
@THeo_sA80
As KingCharizard has pointed out, there is an error with your recipe. Remove the empty set of quotations. You would normally get a different error to the one you received but sometimes they are different for some reason.
ModLoader.addRecipe(new ItemStack(BoneSplinters, 4), new Object[]
{
" O ", " O ", 'O', Item.bone
});
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hey, in a mod I have been working on, I need to re-texture a bed(to different colors).. It seemed simple enough, so I tried it out, and failed miserably.
Here is my code(I copied it from BlockBed.java and attempted to change the textures to the ones I created)
package net.minecraft.src;
import java.util.*;
public class BlockBlueBed extends BlockDirectional
{
public static final int headBlockToFootBlockMap[][] =
{
{
0, 1
}, {
-1, 0
}, {
0, -1
}, {
1, 0
}
};
public BlockBlueBed(int par1)
{
super(par1, 134, Material.cloth);
setBounds();
}
/**
* Called upon block activation (left or right click on the block.). The three integers represent x,y,z of the
* block.
*/
public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
if (par1World.isRemote)
{
return true;
}
int i = par1World.getBlockMetadata(par2, par3, par4);
if (!isBlockFootOfBed(i))
{
int j = getDirection(i);
par2 += headBlockToFootBlockMap[j][0];
par4 += headBlockToFootBlockMap[j][1];
if (par1World.getBlockId(par2, par3, par4) != blockID)
{
return true;
}
i = par1World.getBlockMetadata(par2, par3, par4);
}
if (!par1World.worldProvider.canRespawnHere())
{
double d = (double)par2 + 0.5D;
double d1 = (double)par3 + 0.5D;
double d2 = (double)par4 + 0.5D;
par1World.setBlockWithNotify(par2, par3, par4, 0);
int k = getDirection(i);
par2 += headBlockToFootBlockMap[k][0];
par4 += headBlockToFootBlockMap[k][1];
if (par1World.getBlockId(par2, par3, par4) == blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
d = (d + (double)par2 + 0.5D) / 2D;
d1 = (d1 + (double)par3 + 0.5D) / 2D;
d2 = (d2 + (double)par4 + 0.5D) / 2D;
}
par1World.newExplosion(null, (float)par2 + 0.5F, (float)par3 + 0.5F, (float)par4 + 0.5F, 5F, true);
return true;
}
if (isBedOccupied(i))
{
EntityPlayer entityplayer = null;
Iterator iterator = par1World.playerEntities.iterator();
do
{
if (!iterator.hasNext())
{
break;
}
EntityPlayer entityplayer1 = (EntityPlayer)iterator.next();
if (entityplayer1.isPlayerSleeping())
{
ChunkCoordinates chunkcoordinates = entityplayer1.playerLocation;
if (chunkcoordinates.posX == par2 && chunkcoordinates.posY == par3 && chunkcoordinates.posZ == par4)
{
entityplayer = entityplayer1;
}
}
}
while (true);
if (entityplayer == null)
{
setBedOccupied(par1World, par2, par3, par4, false);
}
else
{
par5EntityPlayer.addChatMessage("tile.bed.occupied");
return true;
}
}
EnumStatus enumstatus = par5EntityPlayer.sleepInBedAt(par2, par3, par4);
if (enumstatus == EnumStatus.OK)
{
setBedOccupied(par1World, par2, par3, par4, true);
return true;
}
if (enumstatus == EnumStatus.NOT_POSSIBLE_NOW)
{
par5EntityPlayer.addChatMessage("tile.bed.noSleep");
}
else if (enumstatus == EnumStatus.NOT_SAFE)
{
par5EntityPlayer.addChatMessage("tile.bed.notSafe");
}
return true;
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
if (par1 == 0)
{
return Block.planks.blockIndexInTexture;
}
int i = getDirection(par2);
int j = Direction.bedDirection[i][par1];
if (isBlockFootOfBed(par2))
{
if (j == 2)
{
return mod_ColoredBeds.BlueFootTop;
}
if (j == 5 || j == 4)
{
return mod_ColoredBeds.BlueFootSides;
}
else
{
return mod_ColoredBeds.BlueFront;
}
}
if (j == 3)
{
return mod_ColoredBeds.BlueHeadTop;
}
if (j == 5 || j == 4)
{
return mod_ColoredBeds.BlueHeadSides;
}
else
{
return mod_ColoredBeds.Back;
}
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return 14;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
/**
* 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;
}
/**
* 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)
{
setBounds();
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
int j = getDirection(i);
if (isBlockFootOfBed(i))
{
if (par1World.getBlockId(par2 - headBlockToFootBlockMap[j][0], par3, par4 - headBlockToFootBlockMap[j][1]) != blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
else if (par1World.getBlockId(par2 + headBlockToFootBlockMap[j][0], par3, par4 + headBlockToFootBlockMap[j][1]) != blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
if (!par1World.isRemote)
{
dropBlockAsItem(par1World, par2, par3, par4, i, 0);
}
}
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
if (isBlockFootOfBed(par1))
{
return 0;
}
else
{
return Item.bed.shiftedIndex;
}
}
/**
* Set the bounds of the bed block.
*/
private void setBounds()
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F);
}
/**
* Returns whether or not this bed block is the foot of the bed.
*/
public static boolean isBlockFootOfBed(int par0)
{
return (par0 & 8) != 0;
}
/**
* Return whether or not the bed is occupied.
*/
public static boolean isBedOccupied(int par0)
{
return (par0 & 4) != 0;
}
/**
* Sets whether or not the bed is occupied.
*/
public static void setBedOccupied(World par0World, int par1, int par2, int par3, boolean par4)
{
int i = par0World.getBlockMetadata(par1, par2, par3);
if (par4)
{
i |= 4;
}
else
{
i &= -5;
}
par0World.setBlockMetadataWithNotify(par1, par2, par3, i);
}
/**
* Gets the nearest empty chunk coordinates for the player to wake up from a bed into.
*/
public static ChunkCoordinates getNearestEmptyChunkCoordinates(World par0World, int par1, int par2, int par3, int par4)
{
int i = par0World.getBlockMetadata(par1, par2, par3);
int j = BlockDirectional.getDirection(i);
for (int k = 0; k <= 1; k++)
{
int l = par1 - headBlockToFootBlockMap[j][0] * k - 1;
int i1 = par3 - headBlockToFootBlockMap[j][1] * k - 1;
int j1 = l + 2;
int k1 = i1 + 2;
for (int l1 = l; l1 <= j1; l1++)
{
for (int i2 = i1; i2 <= k1; i2++)
{
if (!par0World.isBlockNormalCube(l1, par2 - 1, i2) || !par0World.isAirBlock(l1, par2, i2) || !par0World.isAirBlock(l1, par2 + 1, i2))
{
continue;
}
if (par4 > 0)
{
par4--;
}
else
{
return new ChunkCoordinates(l1, par2, i2);
}
}
}
}
return null;
}
/**
* 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)
{
if (!isBlockFootOfBed(par5))
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
}
}
/**
* Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility
* and stop pistons
*/
public int getMobilityFlag()
{
return 1;
}
}
This is the only part I changed:
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
if (par1 == 0)
{
return Block.planks.blockIndexInTexture;
}
int i = getDirection(par2);
int j = Direction.bedDirection[i][par1];
if (isBlockFootOfBed(par2))
{
if (j == 2)
{
return mod_ColoredBeds.BlueFootTop;
}
if (j == 5 || j == 4)
{
return mod_ColoredBeds.BlueFootSides;
}
else
{
return mod_ColoredBeds.BlueFront;
}
}
if (j == 3)
{
return mod_ColoredBeds.BlueHeadTop;
}
if (j == 5 || j == 4)
{
return mod_ColoredBeds.BlueHeadSides;
}
else
{
return mod_ColoredBeds.Back;
}
}
It works well, with no errors, other than the fact that the bed is only 1 block and the textures don't show up on the sides I want them too... Obviously I did something wrong here lol. Can you explain to me what I should be doing?
Thanks!
Ok, I'm stuck and I'be been trying to sort this out for an hour and its annoying me,, why am I getting this error
--- BEGIN ERROR REPORT 9f578458 --------
Generated 6/2/12 12:08 AM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0_04, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: GeForce 8200M G/PCI/SSE2/3DNOW! version 3.0.0, NVIDIA Corporation
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.ArrayIndexOutOfBoundsException: 5010
at net.minecraft.src.Block.<init>(Block.java:230)
at net.minecraft.src.Block.<init>(Block.java:267)
at net.minecraft.src.BlockFertilizer.<init>(BlockFertilizer.java:9)
at net.minecraft.src.mod_ExtendingMinecraft.<clinit>(mod_ExtendingMinecraft.java:162)
... 15 more
--- END ERROR REPORT 9142f18c ----------
It just started out of no where after I added this line
public static final Item ironStick = (new ItemIronStick(5015)).setItemName("Iron Stick");
in this code in the spoiler
package net.minecraft.src;
import java.util.Random;
public class mod_ExtendingMinecraft extends BaseMod
{
public static final Achievement GoodDirt;
public static final Item rubyPickaxe;
public static final Item rubyShovel;
public static final Item rubyHoe;
public static final Item rubyAxe;
public static final Item rubySword;
public static final Item sapphirePickaxe;
public static final Item sapphireShovel;
public static final Item sapphireHoe;
public static final Item sapphireAxe;
public static final Item sapphireSword;
private static final StepSound soundGravelFootstep;
public static final Block BlockFertilizer;
public static final StepSound soundStoneFootstep;
public static final Block BlockRuby;
public static final Block BlockSapphire;
public static final Item Ruby = (new ItemRuby(5013)).setItemName("Ruby");
public static final Item Sapphire = (new ItemSapphire(5014)).setItemName("Sapphire");
public static final Item ironStick = (new ItemIronStick(5015)).setItemName("Iron Stick");
public void load()
{
ModLoader.addAchievementDesc(GoodDirt, "Dirt Master", "Create Fertilizer");
rubyPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubypickaxe.png");
ModLoader.addName(rubyPickaxe, "Ruby Pickaxe");
ModLoader.addRecipe(new ItemStack(rubyPickaxe, 1), new Object[]
{
"###", " $ ", " $ ", '#', Ruby, '$', ironStick
});
rubyShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyShovel.png");
ModLoader.addName(rubyShovel, "Ruby Shovel");
ModLoader.addRecipe(new ItemStack(rubyShovel, 1), new Object[]
{
" # ", " $ ", " $ ", '#', Ruby, '$', ironStick
});
rubyHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyHoe.png");
ModLoader.addName(rubyHoe, "Ruby Hoe");
ModLoader.addRecipe(new ItemStack(rubyHoe, 1), new Object[]
{
"## ", " $ ", " $ ", '#', Ruby, '$', ironStick
});
rubyAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyAxe.png");
ModLoader.addName(rubyAxe, "Ruby Axe");
ModLoader.addRecipe(new ItemStack(rubyAxe, 1), new Object[]
{
"## ", "#$ ", " $ ", '#', Ruby, '$', ironStick
});
rubySword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubySword.png");
ModLoader.addName(rubySword, "Ruby Sword");
ModLoader.addRecipe(new ItemStack(rubySword, 1), new Object[]
{
" # ", " # ", " $ ", '#', Ruby, '$', ironStick
});
sapphirePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphirePickaxe.png");
ModLoader.addName(sapphirePickaxe, "Sapphire Pickaxe");
ModLoader.addRecipe(new ItemStack(sapphirePickaxe, 1), new Object[]
{
"###", " $ ", " $ ", '#', Sapphire, '$', ironStick
});
sapphireShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireShovel.png");
ModLoader.addName(sapphireShovel, "Sapphire Shovel");
ModLoader.addRecipe(new ItemStack(sapphireShovel, 1), new Object[]
{
" # ", " $ ", " $ ", '#', Sapphire, '$', ironStick
});
sapphireHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireHoe.png");
ModLoader.addName(sapphireHoe, "Sapphire Hoe");
ModLoader.addRecipe(new ItemStack(sapphireHoe, 1), new Object[]
{
"## ", " $ ", " $ ", '#', Sapphire, '$', ironStick
});
sapphireAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireAxe.png");
ModLoader.addName(sapphireAxe, "Sapphire Axe");
ModLoader.addRecipe(new ItemStack(sapphireAxe, 1), new Object[]
{
"## ", "#$ ", " $ ", '#', Sapphire, '$', ironStick
});
sapphireSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireSword.png");
ModLoader.addName(sapphireSword, "Sapphire Sword");
ModLoader.addRecipe(new ItemStack(sapphireSword, 1), new Object[]
{
" # ", " # ", " $ ", '#', Sapphire, '$', ironStick
});
ironStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/ironStick.png");
ModLoader.addName(ironStick, "Iron Stick");
ModLoader.addRecipe(new ItemStack(ironStick, 4), new Object[]
{
"#", "#", '#', Item.ingotIron
});
BlockFertilizer.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/fertilizer.png");
ModLoader.registerBlock(BlockFertilizer);
ModLoader.addName(BlockFertilizer, "Fertilizer");
ModLoader.addRecipe(new ItemStack(BlockFertilizer, 4), new Object[]
{
"##", "##", '#', Block.dirt
});
BlockRuby.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/rubyBlock.png");
ModLoader.registerBlock(BlockRuby);
ModLoader.addName(BlockRuby, "Ruby");
ModLoader.addRecipe(new ItemStack(BlockRuby, 4), new Object[]
{
"##", "##", '#', Block.wood
});
BlockSapphire.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/sapphireBlock2.png");
ModLoader.registerBlock(BlockSapphire);
ModLoader.addName(BlockSapphire, "Sapphire");
ModLoader.addRecipe(new ItemStack(BlockSapphire, 4), new Object[]
{
"###", "###", '#', Block.wood
});
Ruby.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyIcon.png");
ModLoader.addName(Ruby, "Ruby");
Sapphire.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireIcon.png");
ModLoader.addName(Sapphire, "Sapphire");
}
public void takenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory)
{
if (itemstack.itemID == BlockFertilizer.blockID)
{
entityplayer.addStat(GoodDirt, 1);
}
}
public void generateSurface(World world, Random random, int i, int j)
{
for (int k = 0; k < 12; k++)
{
int l = i + random.nextInt(16);
int i1 = random.nextInt(96);
int j1 = j + random.nextInt(16);
(new WorldGenMinable(BlockRuby.blockID, 5)).generate(world, random, l, i1, j1);
(new WorldGenMinable(BlockSapphire.blockID, 3)).generate(world, random, l, i1, j1);
}
}
public String getVersion()
{
return "1.2.5";
}
static
{
GoodDirt = (new Achievement(3000, "GoodDirt", 5, 7, Item.diamond, null)).registerAchievement();
rubyPickaxe = (new ItemRubyPickaxe(5000, EnumOreToolMaterial.RUBY)).setItemName("Ruby Pickaxe");
rubyShovel = (new ItemRubyShovel(5001, EnumOreToolMaterial.RUBY)).setItemName("Ruby Shovel");
rubyHoe = (new ItemRubyHoe(5002, EnumOreToolMaterial.RUBY)).setItemName("Ruby Hoe");
rubyAxe = (new ItemRubyAxe(5003, EnumOreToolMaterial.RUBY)).setItemName("Ruby Axe");
rubySword = (new ItemRubySword(5004, EnumOreToolMaterial.RUBY)).setItemName("Ruby Sword");
sapphirePickaxe = (new ItemSapphirePickaxe(5005, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Pickaxe");
sapphireShovel = (new ItemSapphireShovel(5006, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Shovel");
sapphireHoe = (new ItemSapphireHoe(5007, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Hoe");
sapphireAxe = (new ItemSapphireAxe(5008, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Axe");
sapphireSword = (new ItemSapphireSword(5009, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Sword");
soundGravelFootstep = new StepSound("gravel", 1.0F, 1.0F);
BlockFertilizer = (new BlockFertilizer(5010, 0)).setBlockName("Fertilizer").setHardness(1.5F).setResistance(2.0F).setStepSound(soundGravelFootstep);
soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
BlockRuby = (new BlockRuby(5011, 0)).setBlockName("Ruby").setHardness(3F).setResistance(4F).setStepSound(soundStoneFootstep);
BlockSapphire = (new BlockSapphire(5012, 0)).setBlockName("Sapphire").setHardness(3F).setResistance(4F).setStepSound(soundStoneFootstep);
}
}
Hey, in a mod I have been working on, I need to re-texture a bed(to different colors).. It seemed simple enough, so I tried it out, and failed miserably.
Here is my code(I copied it from BlockBed.java and attempted to change the textures to the ones I created)
package net.minecraft.src;
import java.util.*;
public class BlockBlueBed extends BlockDirectional
{
public static final int headBlockToFootBlockMap[][] =
{
{
0, 1
}, {
-1, 0
}, {
0, -1
}, {
1, 0
}
};
public BlockBlueBed(int par1)
{
super(par1, 134, Material.cloth);
setBounds();
}
/**
* Called upon block activation (left or right click on the block.). The three integers represent x,y,z of the
* block.
*/
public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
if (par1World.isRemote)
{
return true;
}
int i = par1World.getBlockMetadata(par2, par3, par4);
if (!isBlockFootOfBed(i))
{
int j = getDirection(i);
par2 += headBlockToFootBlockMap[j][0];
par4 += headBlockToFootBlockMap[j][1];
if (par1World.getBlockId(par2, par3, par4) != blockID)
{
return true;
}
i = par1World.getBlockMetadata(par2, par3, par4);
}
if (!par1World.worldProvider.canRespawnHere())
{
double d = (double)par2 + 0.5D;
double d1 = (double)par3 + 0.5D;
double d2 = (double)par4 + 0.5D;
par1World.setBlockWithNotify(par2, par3, par4, 0);
int k = getDirection(i);
par2 += headBlockToFootBlockMap[k][0];
par4 += headBlockToFootBlockMap[k][1];
if (par1World.getBlockId(par2, par3, par4) == blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
d = (d + (double)par2 + 0.5D) / 2D;
d1 = (d1 + (double)par3 + 0.5D) / 2D;
d2 = (d2 + (double)par4 + 0.5D) / 2D;
}
par1World.newExplosion(null, (float)par2 + 0.5F, (float)par3 + 0.5F, (float)par4 + 0.5F, 5F, true);
return true;
}
if (isBedOccupied(i))
{
EntityPlayer entityplayer = null;
Iterator iterator = par1World.playerEntities.iterator();
do
{
if (!iterator.hasNext())
{
break;
}
EntityPlayer entityplayer1 = (EntityPlayer)iterator.next();
if (entityplayer1.isPlayerSleeping())
{
ChunkCoordinates chunkcoordinates = entityplayer1.playerLocation;
if (chunkcoordinates.posX == par2 && chunkcoordinates.posY == par3 && chunkcoordinates.posZ == par4)
{
entityplayer = entityplayer1;
}
}
}
while (true);
if (entityplayer == null)
{
setBedOccupied(par1World, par2, par3, par4, false);
}
else
{
par5EntityPlayer.addChatMessage("tile.bed.occupied");
return true;
}
}
EnumStatus enumstatus = par5EntityPlayer.sleepInBedAt(par2, par3, par4);
if (enumstatus == EnumStatus.OK)
{
setBedOccupied(par1World, par2, par3, par4, true);
return true;
}
if (enumstatus == EnumStatus.NOT_POSSIBLE_NOW)
{
par5EntityPlayer.addChatMessage("tile.bed.noSleep");
}
else if (enumstatus == EnumStatus.NOT_SAFE)
{
par5EntityPlayer.addChatMessage("tile.bed.notSafe");
}
return true;
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
if (par1 == 0)
{
return Block.planks.blockIndexInTexture;
}
int i = getDirection(par2);
int j = Direction.bedDirection[i][par1];
if (isBlockFootOfBed(par2))
{
if (j == 2)
{
return mod_ColoredBeds.BlueFootTop;
}
if (j == 5 || j == 4)
{
return mod_ColoredBeds.BlueFootSides;
}
else
{
return mod_ColoredBeds.BlueFront;
}
}
if (j == 3)
{
return mod_ColoredBeds.BlueHeadTop;
}
if (j == 5 || j == 4)
{
return mod_ColoredBeds.BlueHeadSides;
}
else
{
return mod_ColoredBeds.Back;
}
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return 14;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
/**
* 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;
}
/**
* 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)
{
setBounds();
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
int j = getDirection(i);
if (isBlockFootOfBed(i))
{
if (par1World.getBlockId(par2 - headBlockToFootBlockMap[j][0], par3, par4 - headBlockToFootBlockMap[j][1]) != blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
else if (par1World.getBlockId(par2 + headBlockToFootBlockMap[j][0], par3, par4 + headBlockToFootBlockMap[j][1]) != blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
if (!par1World.isRemote)
{
dropBlockAsItem(par1World, par2, par3, par4, i, 0);
}
}
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
if (isBlockFootOfBed(par1))
{
return 0;
}
else
{
return Item.bed.shiftedIndex;
}
}
/**
* Set the bounds of the bed block.
*/
private void setBounds()
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F);
}
/**
* Returns whether or not this bed block is the foot of the bed.
*/
public static boolean isBlockFootOfBed(int par0)
{
return (par0 & 8) != 0;
}
/**
* Return whether or not the bed is occupied.
*/
public static boolean isBedOccupied(int par0)
{
return (par0 & 4) != 0;
}
/**
* Sets whether or not the bed is occupied.
*/
public static void setBedOccupied(World par0World, int par1, int par2, int par3, boolean par4)
{
int i = par0World.getBlockMetadata(par1, par2, par3);
if (par4)
{
i |= 4;
}
else
{
i &= -5;
}
par0World.setBlockMetadataWithNotify(par1, par2, par3, i);
}
/**
* Gets the nearest empty chunk coordinates for the player to wake up from a bed into.
*/
public static ChunkCoordinates getNearestEmptyChunkCoordinates(World par0World, int par1, int par2, int par3, int par4)
{
int i = par0World.getBlockMetadata(par1, par2, par3);
int j = BlockDirectional.getDirection(i);
for (int k = 0; k <= 1; k++)
{
int l = par1 - headBlockToFootBlockMap[j][0] * k - 1;
int i1 = par3 - headBlockToFootBlockMap[j][1] * k - 1;
int j1 = l + 2;
int k1 = i1 + 2;
for (int l1 = l; l1 <= j1; l1++)
{
for (int i2 = i1; i2 <= k1; i2++)
{
if (!par0World.isBlockNormalCube(l1, par2 - 1, i2) || !par0World.isAirBlock(l1, par2, i2) || !par0World.isAirBlock(l1, par2 + 1, i2))
{
continue;
}
if (par4 > 0)
{
par4--;
}
else
{
return new ChunkCoordinates(l1, par2, i2);
}
}
}
}
return null;
}
/**
* 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)
{
if (!isBlockFootOfBed(par5))
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
}
}
/**
* Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility
* and stop pistons
*/
public int getMobilityFlag()
{
return 1;
}
}
This is the only part I changed:
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
if (par1 == 0)
{
return Block.planks.blockIndexInTexture;
}
int i = getDirection(par2);
int j = Direction.bedDirection[i][par1];
if (isBlockFootOfBed(par2))
{
if (j == 2)
{
return mod_ColoredBeds.BlueFootTop;
}
if (j == 5 || j == 4)
{
return mod_ColoredBeds.BlueFootSides;
}
else
{
return mod_ColoredBeds.BlueFront;
}
}
if (j == 3)
{
return mod_ColoredBeds.BlueHeadTop;
}
if (j == 5 || j == 4)
{
return mod_ColoredBeds.BlueHeadSides;
}
else
{
return mod_ColoredBeds.Back;
}
}
It works well, with no errors, other than the fact that the bed is only 1 block and the textures don't show up on the sides I want them too... Obviously I did something wrong here lol. Can you explain to me what I should be doing?
Thanks!
Ok, I'm stuck and I'be been trying to sort this out for an hour and its annoying me,, why am I getting this error
--- BEGIN ERROR REPORT 9f578458 --------
Generated 6/2/12 12:08 AM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0_04, Oracle Corporation
VM: Java HotSpot™ Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: GeForce 8200M G/PCI/SSE2/3DNOW! version 3.0.0, NVIDIA Corporation
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.ArrayIndexOutOfBoundsException: 5010
at net.minecraft.src.Block.<init>(Block.java:230)
at net.minecraft.src.Block.<init>(Block.java:267)
at net.minecraft.src.BlockFertilizer.<init>(BlockFertilizer.java:9)
at net.minecraft.src.mod_ExtendingMinecraft.<clinit>(mod_ExtendingMinecraft.java:162)
... 15 more
--- END ERROR REPORT 9142f18c ----------
It just started out of no where after I added this line
public static final Item ironStick = (new ItemIronStick(5015)).setItemName("Iron Stick");
in this code in the spoiler
package net.minecraft.src;
import java.util.Random;
public class mod_ExtendingMinecraft extends BaseMod
{
public static final Achievement GoodDirt;
public static final Item rubyPickaxe;
public static final Item rubyShovel;
public static final Item rubyHoe;
public static final Item rubyAxe;
public static final Item rubySword;
public static final Item sapphirePickaxe;
public static final Item sapphireShovel;
public static final Item sapphireHoe;
public static final Item sapphireAxe;
public static final Item sapphireSword;
private static final StepSound soundGravelFootstep;
public static final Block BlockFertilizer;
public static final StepSound soundStoneFootstep;
public static final Block BlockRuby;
public static final Block BlockSapphire;
public static final Item Ruby = (new ItemRuby(5013)).setItemName("Ruby");
public static final Item Sapphire = (new ItemSapphire(5014)).setItemName("Sapphire");
public static final Item ironStick = (new ItemIronStick(5015)).setItemName("Iron Stick");
public void load()
{
ModLoader.addAchievementDesc(GoodDirt, "Dirt Master", "Create Fertilizer");
rubyPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubypickaxe.png");
ModLoader.addName(rubyPickaxe, "Ruby Pickaxe");
ModLoader.addRecipe(new ItemStack(rubyPickaxe, 1), new Object[]
{
"###", " $ ", " $ ", '#', Ruby, '$', ironStick
});
rubyShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyShovel.png");
ModLoader.addName(rubyShovel, "Ruby Shovel");
ModLoader.addRecipe(new ItemStack(rubyShovel, 1), new Object[]
{
" # ", " $ ", " $ ", '#', Ruby, '$', ironStick
});
rubyHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyHoe.png");
ModLoader.addName(rubyHoe, "Ruby Hoe");
ModLoader.addRecipe(new ItemStack(rubyHoe, 1), new Object[]
{
"## ", " $ ", " $ ", '#', Ruby, '$', ironStick
});
rubyAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyAxe.png");
ModLoader.addName(rubyAxe, "Ruby Axe");
ModLoader.addRecipe(new ItemStack(rubyAxe, 1), new Object[]
{
"## ", "#$ ", " $ ", '#', Ruby, '$', ironStick
});
rubySword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubySword.png");
ModLoader.addName(rubySword, "Ruby Sword");
ModLoader.addRecipe(new ItemStack(rubySword, 1), new Object[]
{
" # ", " # ", " $ ", '#', Ruby, '$', ironStick
});
sapphirePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphirePickaxe.png");
ModLoader.addName(sapphirePickaxe, "Sapphire Pickaxe");
ModLoader.addRecipe(new ItemStack(sapphirePickaxe, 1), new Object[]
{
"###", " $ ", " $ ", '#', Sapphire, '$', ironStick
});
sapphireShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireShovel.png");
ModLoader.addName(sapphireShovel, "Sapphire Shovel");
ModLoader.addRecipe(new ItemStack(sapphireShovel, 1), new Object[]
{
" # ", " $ ", " $ ", '#', Sapphire, '$', ironStick
});
sapphireHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireHoe.png");
ModLoader.addName(sapphireHoe, "Sapphire Hoe");
ModLoader.addRecipe(new ItemStack(sapphireHoe, 1), new Object[]
{
"## ", " $ ", " $ ", '#', Sapphire, '$', ironStick
});
sapphireAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireAxe.png");
ModLoader.addName(sapphireAxe, "Sapphire Axe");
ModLoader.addRecipe(new ItemStack(sapphireAxe, 1), new Object[]
{
"## ", "#$ ", " $ ", '#', Sapphire, '$', ironStick
});
sapphireSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireSword.png");
ModLoader.addName(sapphireSword, "Sapphire Sword");
ModLoader.addRecipe(new ItemStack(sapphireSword, 1), new Object[]
{
" # ", " # ", " $ ", '#', Sapphire, '$', ironStick
});
ironStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/ironStick.png");
ModLoader.addName(ironStick, "Iron Stick");
ModLoader.addRecipe(new ItemStack(ironStick, 4), new Object[]
{
"#", "#", '#', Item.ingotIron
});
BlockFertilizer.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/fertilizer.png");
ModLoader.registerBlock(BlockFertilizer);
ModLoader.addName(BlockFertilizer, "Fertilizer");
ModLoader.addRecipe(new ItemStack(BlockFertilizer, 4), new Object[]
{
"##", "##", '#', Block.dirt
});
BlockRuby.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/rubyBlock.png");
ModLoader.registerBlock(BlockRuby);
ModLoader.addName(BlockRuby, "Ruby");
ModLoader.addRecipe(new ItemStack(BlockRuby, 4), new Object[]
{
"##", "##", '#', Block.wood
});
BlockSapphire.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/sapphireBlock2.png");
ModLoader.registerBlock(BlockSapphire);
ModLoader.addName(BlockSapphire, "Sapphire");
ModLoader.addRecipe(new ItemStack(BlockSapphire, 4), new Object[]
{
"###", "###", '#', Block.wood
});
Ruby.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyIcon.png");
ModLoader.addName(Ruby, "Ruby");
Sapphire.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireIcon.png");
ModLoader.addName(Sapphire, "Sapphire");
}
public void takenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory)
{
if (itemstack.itemID == BlockFertilizer.blockID)
{
entityplayer.addStat(GoodDirt, 1);
}
}
public void generateSurface(World world, Random random, int i, int j)
{
for (int k = 0; k < 12; k++)
{
int l = i + random.nextInt(16);
int i1 = random.nextInt(96);
int j1 = j + random.nextInt(16);
(new WorldGenMinable(BlockRuby.blockID, 5)).generate(world, random, l, i1, j1);
(new WorldGenMinable(BlockSapphire.blockID, 3)).generate(world, random, l, i1, j1);
}
}
public String getVersion()
{
return "1.2.5";
}
static
{
GoodDirt = (new Achievement(3000, "GoodDirt", 5, 7, Item.diamond, null)).registerAchievement();
rubyPickaxe = (new ItemRubyPickaxe(5000, EnumOreToolMaterial.RUBY)).setItemName("Ruby Pickaxe");
rubyShovel = (new ItemRubyShovel(5001, EnumOreToolMaterial.RUBY)).setItemName("Ruby Shovel");
rubyHoe = (new ItemRubyHoe(5002, EnumOreToolMaterial.RUBY)).setItemName("Ruby Hoe");
rubyAxe = (new ItemRubyAxe(5003, EnumOreToolMaterial.RUBY)).setItemName("Ruby Axe");
rubySword = (new ItemRubySword(5004, EnumOreToolMaterial.RUBY)).setItemName("Ruby Sword");
sapphirePickaxe = (new ItemSapphirePickaxe(5005, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Pickaxe");
sapphireShovel = (new ItemSapphireShovel(5006, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Shovel");
sapphireHoe = (new ItemSapphireHoe(5007, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Hoe");
sapphireAxe = (new ItemSapphireAxe(5008, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Axe");
sapphireSword = (new ItemSapphireSword(5009, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Sword");
soundGravelFootstep = new StepSound("gravel", 1.0F, 1.0F);
BlockFertilizer = (new BlockFertilizer(5010, 0)).setBlockName("Fertilizer").setHardness(1.5F).setResistance(2.0F).setStepSound(soundGravelFootstep);
soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
BlockRuby = (new BlockRuby(5011, 0)).setBlockName("Ruby").setHardness(3F).setResistance(4F).setStepSound(soundStoneFootstep);
BlockSapphire = (new BlockSapphire(5012, 0)).setBlockName("Sapphire").setHardness(3F).setResistance(4F).setStepSound(soundStoneFootstep);
}
}
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Someone know what this error is about? I just made some tools, they worked perfectly, but then i made another set of tools, my minecraft crashes then i try to run client. Any help? here is my code and crash report.
Crash report:
Mods loaded: 3
ModLoader 1.2.5
mod_ModLoaderMp 1.2.5v1
mod_Mystic 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 30d978f4 --------
Generated 2.6.2012 11:48
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_26, Sun Microsystems Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce GT 420/PCI/SSE2 version 4.0.0, NVIDIA Corporation
java.lang.StringIndexOutOfBoundsException: String index out of range: 8
at java.lang.String.charAt(String.java:686)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:394)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:412)
at net.minecraft.src.mod_Mystic.load(mod_Mystic.java:95)
at net.minecraft.src.ModLoader.init(ModLoader.java:856)
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(Thread.java:662)
--- END ERROR REPORT 9e4bd03f ----------
My code:
The code spoiler isn't working.
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 so much for your tutorials, they were very helpful.
I have just released two new mods that I couldn't have made without them. http://www.minecraft...n-lightsx8-v10/
Thank you so much for your tutorials, they were very helpful.
I have just released two new mods that I couldn't have made without them. http://www.minecraft...n-lightsx8-v10/
When I copied your 'add blocks to creative inventory' stuff, almos every line contained an error :S
When I run it I get this error:
Mods loaded: 2
ModLoader 1.2.5
mod_ArcadiaCraft 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT a53061f --------
Generated 2-6-12 21:31
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0_03, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode, sharing), Oracle Corporation
LWJGL: 2.4.2
OpenGL: Intel 965/963 Graphics Media Accelerator version 2.0.0 - Build 8.14.10.1930, Intel
java.lang.Error: Unresolved compilation problems:
Illegal modifier for parameter onTickInGame; only final is permitted
Syntax error on token "(", ; expected
Syntax error on token ",", ; expected
Syntax error on token ")", ; expected
creativeInventory cannot be resolved to a variable
Void methods cannot return a value
Illegal modifier for parameter onTickInGUI; only final is permitted
Syntax error on token "(", ; expected
Duplicate local variable f
Syntax error on token ",", ; expected
Duplicate local variable minecraft
Syntax error on token ",", ; expected
Syntax error on token ")", ; expected
creativeInventory cannot be resolved to a variable
block1 cannot be resolved to a variable
block2 cannot be resolved to a variable
block3 cannot be resolved to a variable
creativeInventory cannot be resolved to a variable
Void methods cannot return a value
Illegal modifier for parameter creativeInventory; only final is permitted
at net.minecraft.src.mod_ArcadiaCraft.load(mod_ArcadiaCraft.java:388)
at net.minecraft.src.ModLoader.init(ModLoader.java:856)
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)
--- END ERROR REPORT 5103bf9 ----------
And here is the code (It's pretty much):
package net.minecraft.src;
import java.util.Random;
import net.minecraft.client.Minecraft;
import java.util.List;
import java.util.Map;
//The "ArcadiaCraft" Mod was created by.[Nicholas Mitrenga-Abreu and Falco Rainier van der Meulen]
//The Mod(ArcadiaCraft)'s Code:
public class mod_ArcadiaCraft extends BaseMod
{
//declaration
//Arcraphys Blocks
public static final Block ArcraphysBlock = new BlockArcraphysBlock(160, 0).setBlockName("Arcraphys Block").setHardness(5F).setResistance(20F);
public static final Item Arcraphys = new ItemArcraphys(5000).setItemName("Arcraphys");
public static final Block ArcraphysStairs = new BlockArcraphysStairs(163, 0).setBlockName("Arcraphys Stairs").setHardness(5F).setResistance(20F);
public static final Block ArcraphysSlab = new BlockArcraphysSlab(164, 0).setBlockName("Arcraphys Slab").setHardness(5F).setResistance(20F);
public static final Block ArcraphysBrick = new BlockArcraphysBrick(165, 0).setBlockName("Arcraphys Bricks").setHardness(10F).setResistance(40F);
public static final Block ArcBrickStairs = new BlockArcBrickStairs(166, 0).setBlockName("Arcraphys Brick Stairs").setHardness(5F).setResistance(20F);
public static final Block ArcBrickSlab = new BlockArcBrickSlab(167, 0).setBlockName("Arcraphys Brick Slab").setHardness(5F).setResistance(20F);
//Skywill
//public static final BiomeGenBase Skywill = (new BiomeGenSkywill(25)).setColor(0xfa9418).setBiomeName("Skywill");
//Skywill Stuff
public static final Block Diphos = new BlockFlower(162, 0).setBlockName("Diphos");
//public static final Block SkyGrass = new BlockSkyGrass(175, 0).setBlockName("Sky Dirt").setHardness(5F).setResistance(5F);
public static final Block SkyWood = new BlockSkyWood(176).setBlockName("Sky Wood").setHardness(10F).setResistance(10F).setStepSound(Block.soundWoodFootstep);
public static final Block SkyPlanks = new Block(177, 0, Material.wood).setBlockName("Sky Planks").setHardness(7F).setResistance(7F);
public static final Item SkySticks = new Item(5051).setItemName("Sky Sticks");
public static final Block SkySapling = new BlockSkySapling(178, 0).setBlockName("Sky Sapling");
public static final Block SkyLeaf = new SkyLeaf(179, 0).setBlockName("Sky Leaf");
public static final Item SkyApple = new ItemFood(5052, 4, 1F, false).setItemName("Sky Apple");
//Tools and Weapons
// -Arcraphys Tools & Weapons:
public static final Item ArcSword = new ItemSword(5001, EnumToolMaterial.ARCRAPHYSII).setItemName("Arcraphys Sword");
public static final Item ArcGreatSword = new ItemSword(5002, EnumToolMaterial.ARCRAPHYSIII).setItemName("Arcraphys GreatSword");
public static final Item ArcDagger = new ItemSword(5003, EnumToolMaterial.ARCRAPHYSI).setItemName("Arcraphys Dagger");
public static final Item ArcSledge = new ItemSword(5005, EnumToolMaterial.ARCRAPHYSIII).setItemName("Arcraphys SledgeHammer");
public static final Item ArcPickaxe = new ItemPickaxe(5006, EnumToolMaterial.ARCRAPHYSI).setItemName("Arcraphys Pickaxe");
public static final Item ArcAxe = new ItemAxe(5007, EnumToolMaterial.ARCRAPHYSI).setItemName("Arcraphys Axe");
public static final Item ArcShovel = new ItemSpade(5008, EnumToolMaterial.ARCRAPHYSI).setItemName("Arcraphys Shovel");
public static final Item ArcHoe = new ItemHoe(5009, EnumToolMaterial.ARCRAPHYSI).setItemName("Arcraphys Hoe");
// -Copper Tools & Weapons:
public static final Item CopSword = new ItemSword(5010, EnumToolMaterial.COPPER).setItemName("Copper Sword");
public static final Item CopPickaxe = new ItemPickaxe(5011, EnumToolMaterial.COPPER).setItemName("Copper Pickaxe");
public static final Item CopAxe = new ItemAxe(5012, EnumToolMaterial.COPPER).setItemName("Copper Axe");
public static final Item CopShovel = new ItemSpade(5013, EnumToolMaterial.COPPER).setItemName("Copper Shovel");
public static final Item CopHoe = new ItemHoe(5014, EnumToolMaterial.COPPER).setItemName("Copper Hoe");
// -Silver Tools & Weapons:
public static final Item SilSword = new ItemSword(5014, EnumToolMaterial.SILVER).setItemName("Silver Sword");
public static final Item SilPickaxe = new ItemPickaxe(5015, EnumToolMaterial.SILVER).setItemName("Silver Pickaxe");
public static final Item SilAxe = new ItemAxe(5016, EnumToolMaterial.SILVER).setItemName("Silver Axe");
public static final Item SilShovel = new ItemSpade(5017, EnumToolMaterial.SILVER).setItemName("Silver Shovel");
public static final Item SilHoe = new ItemHoe(5018, EnumToolMaterial.SILVER).setItemName("Silver Hoe");
// -Platinum Tools & Weapons:
public static final Item PlatSword = new ItemSword(5019, EnumToolMaterial.PLATINUM).setItemName("Platinum Sword");
public static final Item PlatPickaxe = new ItemPickaxe(5020, EnumToolMaterial.PLATINUM).setItemName("Platinum Pickaxe");
public static final Item PlatAxe = new ItemAxe(5021, EnumToolMaterial.PLATINUM).setItemName("Platinum Axe");
public static final Item PlatShovel = new ItemSpade(5022, EnumToolMaterial.PLATINUM).setItemName("Platinum Shovel");
public static final Item PlatHoe = new ItemHoe(5023, EnumToolMaterial.PLATINUM).setItemName("Platinum Hoe");
// -Cobalt Tool & Weapons:
public static final Item ColSword = new ItemSword(5024, EnumToolMaterial.COBALT).setItemName("Cobalt Sword");
public static final Item ColPickaxe = new ItemPickaxe(5025, EnumToolMaterial.COBALT).setItemName("Cobalt Pickaxe");
public static final Item ColAxe = new ItemAxe(5026, EnumToolMaterial.COBALT).setItemName("Cobalt Axe");
public static final Item ColShovel = new ItemSpade(5027, EnumToolMaterial.COBALT).setItemName("Cobalt Shovel");
public static final Item ColHoe = new ItemHoe(5028, EnumToolMaterial.COBALT).setItemName("Cobalt Hoe");
//Derflinger
public static final Item Derflinger = new ItemSword(5029, EnumToolMaterial.DERFLINGER).setItemName("Derflinger");
public static final Item AncientHandle = new Item(5030).setItemName("Ancient Handle");
public static final Item AncientBlade = new Item(5031).setItemName("Ancient Blade");
public static final Item AncientHilt = new Item(5032).setItemName("Ancient Hilt");
//Ingots
public static final Item SilverIngot = new Item(5033).setItemName("Silver Ingot");
public static final Item CopperIngot = new Item(5034).setItemName("Copper Ingot");
public static final Item PlatinumIngot = new Item(5035).setItemName("Platinum Ingot");
public static final Item CobaltIngot = new Item(5036).setItemName("Cobalt Ingot");
//Noted Stuff
//public static final Item ShineDust = new Item(5014).setItemName("Shine Dust");
//public static final Item Hammer = new Item(5015).setItemName("Hammer");
//public static final Block ShineArcBlock = new BlockShineArcBlock(166, 0).setBlockName("Shiny Arcraphys Block").setHardness(5F).setResistance(20F).setLightValue(1F);
//Armor sets
public static final Item ArcHelmet = (new OreModItemArmor(5037, OreModArmorMaterial.ARCRAPHYS, ModLoader.addArmor("Arcraphys"), 0)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/arcHelm.png")).setItemName("ArcraphysHelmet");
public static final Item ArcChest = (new OreModItemArmor(5038, OreModArmorMaterial.ARCRAPHYS, ModLoader.addArmor("Arcraphys"), 1)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/arcChest.png")).setItemName("ArcraphysChestplate");
public static final Item ArcPants = (new OreModItemArmor(5039, OreModArmorMaterial.ARCRAPHYS, ModLoader.addArmor("Arcraphys"), 2)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/arcLeggings.png")).setItemName("ArcraphysLeggings");
public static final Item ArcBoots = (new OreModItemArmor(5040, OreModArmorMaterial.ARCRAPHYS, ModLoader.addArmor("Arcraphys"), 3)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/arcBoots.png")).setItemName("ArcraphysBoots");
public static final Item CopHelmet = (new OreModItemArmor(5041, OreModArmorMaterial.COPPER, ModLoader.addArmor("Copper"), 0)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/copHelm.png")).setItemName("CopperHelmet");
public static final Item CopChest = (new OreModItemArmor(5042, OreModArmorMaterial.COPPER, ModLoader.addArmor("Copper"), 1)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/copChest.png")).setItemName("CopperChestplate");
public static final Item CopPants = (new OreModItemArmor(5043, OreModArmorMaterial.COPPER, ModLoader.addArmor("Copper"), 2)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/copLeggings.png")).setItemName("CopperLeggings");
public static final Item CopBoots = (new OreModItemArmor(5044, OreModArmorMaterial.COPPER, ModLoader.addArmor("Copper"), 3)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/copBoots.png")).setItemName("CopperBoots");
public static final Item SilHelmet = (new OreModItemArmor(5045, OreModArmorMaterial.SILVER, ModLoader.addArmor("Silver"), 0)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/silHelm.png")).setItemName("SilverHelmet");
public static final Item SilChest = (new OreModItemArmor(5046, OreModArmorMaterial.SILVER, ModLoader.addArmor("Silver"), 1)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/silChest.png")).setItemName("SilverChestplate");
public static final Item SilPants = (new OreModItemArmor(5047, OreModArmorMaterial.SILVER, ModLoader.addArmor("Silver"), 2)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/silLeggings.png")).setItemName("SilverLeggings");
public static final Item SilBoots = (new OreModItemArmor(5048, OreModArmorMaterial.SILVER, ModLoader.addArmor("Silver"), 3)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/arc/Armour/silBoots.png")).setItemName("SilverBoots");
//Other Blocks and Items
public static final Block WonderStone = new BlockWonderStone(168, 0).setBlockName("WonderStone").setHardness(10F).setResistance(40F).setLightValue(1F);
public static final Item ak47 = new Item(5049).setItemName("Soldier's AK47");
//Nether Melon
public static final Block NetherMelon = new BlockNetherMelon(169, 0).setBlockName("NetherMelon").setHardness(3F).setResistance(5F);
public static final Item NetherMelonSlice = new ItemFood(5050, 6, 1F, false).setItemName("NetherMelonSlice");
//Ores
public static final Block CobaltOre = new BlockCobaltOre(170, 0).setBlockName("Cobalt Ore").setHardness(3F).setResistance(10F);
public static final Block CopperOre = new BlockCopperOre(171, 0).setBlockName("Copper Ore").setHardness(2F).setResistance(9F);
public static final Block SilverOre = new BlockSilverOre(172, 0).setBlockName("Silver Ore").setHardness(5F).setResistance(13F);
public static final Block ArcraphysOre = new BlockArcraphysOre(173, 0).setBlockName("Arcraphys Ore").setHardness(5F).setResistance(20F);
public static final Block PlatinumOre = new BlockPlatinumOre(174, 0).setBlockName("Platinum Ore").setHardness(15F).setResistance(30F);
//Multi-Textures
public static int NetherMelonBottom = ModLoader.addOverride("/terrain.png", "/arc/Blocks/NetherMelonTop.png");
public static int NetherMelonTop = ModLoader.addOverride("/terrain.png", "/arc/Blocks/NetherMelonBottom.png");
public static int NetherMelonSides = ModLoader.addOverride("/terrain.png", "/arc/Blocks/NetherMelonSide.png");
public static int SkyGrassBottom = ModLoader.addOverride("/terrain.png", "/arc/Blocks/Skywill/SkyGrassBottom.png");
public static int SkyGrassTop = ModLoader.addOverride("/terrain.png", "/arc/Blocks/Skywill/SkyGrassTop.png");
public static int SkyGrassSides = ModLoader.addOverride("/terrain.png", "/arc/Blocks/Skywill/SkyGrassSide.png");
public static int SkyWoodTop = ModLoader.addOverride("/terrain.png", "/arc/Blocks/Skywill/SkyWoodTop.png");
public static int SkyWoodSide = ModLoader.addOverride("/terrain.png", "/arc/Blocks/Skywill/SkyWoodSide.png");
public static int SkyWoodBottom = ModLoader.addOverride("/terrain.png", "/arc/Blocks/Skywill/SkyWoodBottom.png");
//Achievements
public static final Achievement Namehere = new Achievement(4560, "Namehere", 5, 7, Item.diamond, null).registerAchievement();
public void load()
{
//Texture Overrides
// -Arcraphys Blocks:
ArcraphysBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/arcBlock.png");
Arcraphys.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/arcraphys.png");
ArcraphysOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/arcOre.png");
ArcBrickStairs.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/arcBrickStairs.png");
ArcBrickSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/arcBrickSlab.png");
ArcraphysStairs.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/arcBlockStairs.png");
ArcraphysSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/arcBlockSlab.png");
ArcraphysBrick.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/arcBricks.png");
// -Arcraphys Tools & Weapons [Texture Overrides]:
ArcSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/ArcSword.png");
ArcGreatSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/arcGreatSword.png");
ArcDagger.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/arcDagger.png");
ArcSledge.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/arcSledge.png");
ArcPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/ArcPickaxe.png");
ArcAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/ArcAxe.png");
ArcShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/ArcShovel.png");
ArcHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/ArcHoe.png");
// -Copper Tools & Weapons [Texture Overrides]:
CopSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/copSword.png");
CopPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/copPickaxe.png");
CopAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/copAxe.png");
CopShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/copShovel.png");
CopHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/copHoe.png");
// -Copper Blocks:
CopperOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/copperOre.png");
CopperIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/CopIngot.png");
// -Silver Tools & Weapons:
//SilSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/SilSword.png");
//SilPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/SilPickaxe.png");
//SilAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/SilAxe.png");
//SilShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/SilShovel.png");
//SilHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/SilHoe.png");
// -Platinum Tools & Weapons:
//PlatSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/PlatSword.png");
//PlatPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/PlatPickaxe.png");
//PlatAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/platAxe.png");
//PlatShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/PlatShovel.png");
//PlatHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/platHoe.png");
// -Cobalt Tools & Weapons:
//ColSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/ColSword.png");
//ColPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/colPickaxe.png");
//ColAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/ColAxe.png");
//ColShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/ColShovel.png");
//ColHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/colHoe.png");
// -Derflinger:
Derflinger.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/Derflinger.png");
AncientHandle.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/derfHandle.png");
AncientBlade.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/derfBlade.png");
AncientHilt.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/derfHilt.png");
// -Skywill Biome:
Diphos.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Plants/Diphos.png");
SkyPlanks.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/arc/Blocks/Skywill/SkyPlanks.png");
SkySticks.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/SkyStick.png");
SkyLeaf.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/Skywill/SkyLeaf.png");
SkySapling.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/Skywill/SkySapling.png");
SkyApple.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/SkyApple.png");
// -Silver:
SilverOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/silvOre.png");
SilverIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/SilIngot.png");
// -Cobalt:
CobaltOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/cobaltOre.png");
CobaltIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/ColIngot.png");
// -Platinum:
PlatinumOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/platOre.png");
PlatinumIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/PlatIngot.png");
// Unused:
//ShineDust.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/ShineDust.png");
//Hammer.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/Hammer.png");
//ShineArcBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/arc/Blocks/ShineArcBlock.png");
WonderStone.blockIndexInTexture = ModLoader.addOverride("/gui/items.png", "/arc/Blocks/wonderStone.png");
ak47.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Weapons/ak47.png");
// -Nether+:
NetherMelonSlice.iconIndex = ModLoader.addOverride("/gui/items.png", "/arc/Items/NetherMelonSlice.png");
//Register Blocks
ModLoader.registerBlock(ArcraphysBlock);
ModLoader.registerBlock(ArcraphysOre);
ModLoader.registerBlock(Diphos);
ModLoader.registerBlock(ArcraphysStairs);
ModLoader.registerBlock(ArcraphysSlab);
ModLoader.registerBlock(ArcraphysBrick);
//ModLoader.registerBlock(ShineArcBlock);
ModLoader.registerBlock(WonderStone);
ModLoader.registerBlock(NetherMelon);
ModLoader.registerBlock(CobaltOre);
ModLoader.registerBlock(CopperOre);
ModLoader.registerBlock(SilverOre);
ModLoader.registerBlock(ArcBrickStairs);
ModLoader.registerBlock(ArcBrickSlab);
ModLoader.registerBlock(PlatinumOre);
//ModLoader.registerBlock(SkyGrass);
ModLoader.registerBlock(SkyWood);
ModLoader.registerBlock(SkyPlanks);
ModLoader.registerBlock(SkySapling);
ModLoader.registerBlock(SkyLeaf);
//Add Names
ModLoader.addName(ArcraphysBlock, "Block of Arcraphys");
ModLoader.addName(Arcraphys, "Arcraphys");
ModLoader.addName(ArcraphysOre, "Arcraphys Ore");
ModLoader.addName(ArcSword, "Arcraphys Sword");
ModLoader.addName(ArcGreatSword, "Arcraphys Greatsword");
ModLoader.addName(ArcDagger, "Arcraphys Dagger");
ModLoader.addName(ArcSledge, "Arcraphys Sledgehammer");
ModLoader.addName(ArcPickaxe, "Arcraphys Pickaxe");
ModLoader.addName(ArcAxe, "Arcraphys Axe");
ModLoader.addName(ArcShovel, "Arcraphys Shovel");
ModLoader.addName(ArcHoe, "Arcraphys Hoe");
ModLoader.addName(CopSword, "Copper Sword");
ModLoader.addName(CopPickaxe, "Copper Pickaxe");
ModLoader.addName(CopAxe, "Copper Axe");
ModLoader.addName(CopShovel, "Copper Shovel");
ModLoader.addName(CopHoe, "Copper Hoe");
ModLoader.addName(ColSword, "Colbalt Sword");
ModLoader.addName(ColPickaxe, "Colbalt Pickaxe");
ModLoader.addName(ColAxe, "Colbalt Axe");
ModLoader.addName(ColShovel, "Colbalt Shovel");
ModLoader.addName(ColHoe, "Colbalt Hoe");
ModLoader.addName(SilSword, "Silver Sword");
ModLoader.addName(SilPickaxe, "Silver Pickaxe");
ModLoader.addName(SilAxe, "Silver Axe");
ModLoader.addName(SilShovel, "Silver Shovel");
ModLoader.addName(SilHoe, "Silver Hoe");
ModLoader.addName(PlatSword, "Platinum Sword");
ModLoader.addName(PlatPickaxe, "Platinum Pickaxe");
ModLoader.addName(PlatAxe, "Platinum Axe");
ModLoader.addName(PlatShovel, "Platinum Shovel");
ModLoader.addName(PlatHoe, "Platinum Hoe");
ModLoader.addName(Derflinger, "Derflinger");
ModLoader.addName(AncientHandle, "Ancient Handle");
ModLoader.addName(AncientBlade, "Ancient Blade");
ModLoader.addName(AncientHilt, "Ancient Hilt");
ModLoader.addName(ArcraphysStairs, "Arcraphys Stairs");
ModLoader.addName(ArcraphysSlab, "Arcraphys Slab");
ModLoader.addName(ArcraphysBrick, "Arcraphys Bricks");
//ModLoader.addName(ShineDust, "Shine Dust");
//ModLoader.addName(Hammer, "Hammer");
//ModLoader.addName(ShineArcBlock, "Shining Block of Arcraphys");
ModLoader.addName(SilverIngot, "Silver Ingot");
ModLoader.addName(ArcHelmet, "Arcraphys Helmet");
ModLoader.addName(ArcChest, "Arcraphys Chestplate");
ModLoader.addName(ArcPants, "Arcraphys Leggings");
ModLoader.addName(ArcBoots, "Arcraphys Boots");
ModLoader.addName(WonderStone, "Wonder Stone");
ModLoader.addName(NetherMelon, "Nether Melon");
ModLoader.addName(NetherMelonSlice, "Nether Melon");
ModLoader.addName(CobaltOre, "Cobalt Ore");
ModLoader.addName(CobaltIngot, "Cobalt Ingot");
ModLoader.addName(CopperOre, "Copper Ore");
ModLoader.addName(SilverOre, "Silver Ore");
ModLoader.addName(ArcBrickStairs, "Arcraphys Brick Stairs");
ModLoader.addName(ArcBrickSlab, "Arcraphys Brick Slab");
ModLoader.addName(CopperIngot, "Copper Ingot");
ModLoader.addName(CopBoots, "Copper Boots");
ModLoader.addName(CopChest, "Copper Chestplate");
ModLoader.addName(CopPants, "Copper Leggings");
ModLoader.addName(CopHelmet, "Copper Helmet");
ModLoader.addName(SilBoots, "Silver Boots");
ModLoader.addName(SilChest, "Silver Chestplate");
ModLoader.addName(SilPants, "Silver Leggings");
ModLoader.addName(SilHelmet, "Silver Helmet");
ModLoader.addName(ak47, "Soldier's AK47");
ModLoader.addName(PlatinumOre, "Platinum Ore");
ModLoader.addName(PlatinumIngot, "Platinum Ingot");
//ModLoader.addName(SkyGrass, "Skywill Grass");
ModLoader.addName(Diphos, "Diphos Flower");
ModLoader.addName(SkyWood, "Skywill Wood");
ModLoader.addName(SkyPlanks, "Skywill Planks");
ModLoader.addName(SkySticks, "Skywill Sticks");
ModLoader.addName(SkyLeaf, "Skywill Leaves");
ModLoader.addName(SkySapling, "Skywill Tree Sapling");
ModLoader.addName(SkyApple, "Skywill Apple");
//Add Biomes:
// -Skywill
//ModLoader.addBiome(Skywill);
//Crafting Recipes
// -Arcraphys Crafting:
ModLoader.addRecipe(new ItemStack(ArcraphysBlock, 1), new Object [] {"###", "###", "###", '#', Arcraphys});
ModLoader.addRecipe(new ItemStack(ArcSword, 1), new Object [] {" # ", " # ", " @ ", '#', Arcraphys, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ArcGreatSword, 1), new Object [] {" # ", "###", " @ ", '#', Arcraphys, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ArcDagger, 1), new Object [] {" # ", " @ ", " @ ", '#', Arcraphys, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ArcSledge, 1), new Object [] {"###", " # ", " @ ", '#', Arcraphys, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ArcPickaxe, 1), new Object [] {"###", " @ ", " @ ", '#', Arcraphys, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ArcAxe, 1), new Object [] {"## ", "#@ ", " @ ", '#', Arcraphys, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ArcShovel, 1), new Object [] {" # ", " @ ", " @ ", '#', Arcraphys, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ArcHoe, 1), new Object [] {"## ", " @ ", " @ ", '#', Arcraphys, '@', Item.stick});
// -Copper Crafting:
ModLoader.addRecipe(new ItemStack(CopSword, 1), new Object [] {" # ", " # ", " @ ", '#', CopperIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(CopPickaxe, 1), new Object [] {"###", " @ ", " @ ", '#', CopperIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(CopAxe, 1), new Object [] {"## ", "#@ ", " @ ", '#', CopperIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(CopShovel, 1), new Object [] {" # ", " @ ", " @ ", '#', CopperIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(CopHoe, 1), new Object [] {"## ", " @ ", " @ ", '#', CopperIngot, '@', Item.stick});
// -Silver Crafting:
ModLoader.addRecipe(new ItemStack(SilSword, 1), new Object [] {" # ", " # ", " @ ", '#', SilverIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(SilPickaxe, 1), new Object [] {"###", " @ ", " @ ", '#', SilverIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(SilAxe, 1), new Object [] {"## ", "#@ ", " @ ", '#', SilverIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(SilShovel, 1), new Object [] {" # ", " @ ", " @ ", '#', SilverIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(SilHoe, 1), new Object [] {"## ", " @ ", " @ ", '#', SilverIngot, '@', Item.stick});
// -Cobalt Crafting:
ModLoader.addRecipe(new ItemStack(ColSword, 1), new Object [] {" # ", " # ", " @ ", '#', CobaltIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ColPickaxe, 1), new Object [] {"###", " @ ", " @ ", '#', CobaltIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ColAxe, 1), new Object [] {"## ", "#@ ", " @ ", '#', CobaltIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ColShovel, 1), new Object [] {" # ", " @ ", " @ ", '#', CobaltIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(ColHoe, 1), new Object [] {"## ", " @ ", " @ ", '#', CobaltIngot, '@', Item.stick});
// -Platinum Crafting:
ModLoader.addRecipe(new ItemStack(PlatSword, 1), new Object [] {" # ", " # ", " @ ", '#', PlatinumIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(PlatPickaxe, 1), new Object [] {"###", " @ ", " @ ", '#', PlatinumIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(PlatAxe, 1), new Object [] {"## ", "#@ ", " @ ", '#', PlatinumIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(PlatShovel, 1), new Object [] {" # ", " @ ", " @ ", '#', PlatinumIngot, '@', Item.stick});
ModLoader.addRecipe(new ItemStack(PlatHoe, 1), new Object [] {"## ", " @ ", " @ ", '#', PlatinumIngot, '@', Item.stick});
// -Skywill Crafting:
ModLoader.addShapelessRecipe(new ItemStack(SkyPlanks, 4), new Object [] {SkyWood});
ModLoader.addRecipe(new ItemStack(SkySticks, 4), new Object [] {"#", "#", Character.valueOf('#'), SkyPlanks});
ModLoader.addRecipe(new ItemStack(Derflinger, 1), new Object [] {" # ", " @ ", " ! ", '#', AncientBlade, '@', AncientHilt, '!', AncientHandle});
ModLoader.addRecipe(new ItemStack(ArcraphysStairs, 4), new Object [] {"# ", "## ", "###", '#', Arcraphys});
ModLoader.addRecipe(new ItemStack(ArcraphysSlab, 6), new Object [] {"###", '#', Arcraphys});
ModLoader.addRecipe(new ItemStack(ArcraphysBrick, 1), new Object [] {"##", "##", '#', ArcraphysBlock});
//ModLoader.addRecipe(new ItemStack(ShineDust, 8), new Object [] {"@#", '@', Hammer, '#', Block.glowStone});
//ModLoader.addRecipe(new ItemStack(Hammer, 1), new Object [] {" # ", "@ ", '#', Item.ingotIron, '@', Item.stick});
//ModLoader.addRecipe(new ItemStack(ShineArcBlock, 1), new Object [] {"###", "#@#", "###", '#', ShineDust, '@', ArcraphysBlock});
ModLoader.addRecipe(new ItemStack(ArcHelmet, 1), (new Object[] {"XXX", "X X", 'X', Arcraphys}));
ModLoader.addRecipe(new ItemStack(ArcChest, 1), (new Object[] {"X X", "XXX", "XXX", 'X', Arcraphys}));
ModLoader.addRecipe(new ItemStack(ArcPants, 1), (new Object[] {"XXX", "X X", "X X", 'X', Arcraphys}));
ModLoader.addRecipe(new ItemStack(ArcBoots, 1), (new Object[] {"X X", "X X", 'X', Arcraphys}));
//ModLoader.addRecipe(new ItemStack(WonderStone, 1), new Object [] {"@[email protected]", "#%#", "$&$", '#', ShineDust, '@', Item.redstone, '$', NetherMelonSlice, '%', Arcraphys});
ModLoader.addRecipe(new ItemStack(NetherMelon, 1), new Object [] {"###", "###", "###", '#', NetherMelonSlice});
ModLoader.addRecipe(new ItemStack(NetherMelonSlice, 1), new Object [] {"#", '#', NetherMelonSlice});
ModLoader.addRecipe(new ItemStack(ArcBrickStairs, 4), new Object [] {"# ", "## ", "###", '#', ArcraphysBrick});
ModLoader.addRecipe(new ItemStack(ArcBrickSlab, 6), new Object [] {"###", '#', ArcraphysBrick});
ModLoader.addRecipe(new ItemStack(CopHelmet, 1), (new Object[] {"XXX", "X X", 'X', CopperIngot}));
ModLoader.addRecipe(new ItemStack(CopChest, 1), (new Object[] {"X X", "XXX", "XXX", 'X', CopperIngot}));
ModLoader.addRecipe(new ItemStack(CopPants, 1), (new Object[] {"XXX", "X X", "X X", 'X', CopperIngot}));
ModLoader.addRecipe(new ItemStack(CopBoots, 1), (new Object[] {"X X", "X X", 'X', CopperIngot}));
ModLoader.addRecipe(new ItemStack(SilHelmet, 1), (new Object[] {"XXX", "X X", 'X', SilverIngot}));
ModLoader.addRecipe(new ItemStack(SilChest, 1), (new Object[] {"X X", "XXX", "XXX", 'X', SilverIngot}));
ModLoader.addRecipe(new ItemStack(SilPants, 1), (new Object[] {"XXX", "X X", "X X", 'X', SilverIngot}));
ModLoader.addRecipe(new ItemStack(SilBoots, 1), (new Object[] {"X X", "X X", 'X', SilverIngot}));
//Smelting Recipes
ModLoader.addSmelting(SilverOre.blockID, new ItemStack(SilverIngot, 1));
ModLoader.addSmelting(CopperOre.blockID, new ItemStack(CopperIngot, 1));
ModLoader.addSmelting(PlatinumOre.blockID, new ItemStack(PlatinumIngot, 1));
ModLoader.addSmelting(CobaltOre.blockID, new ItemStack(CobaltIngot, 1));
//Register Entity IDs
//Soldier
ModLoader.registerEntityID(EntitySoldier.class, "Soldier", ModLoader.getUniqueEntityId());
//Add Spawns
ModLoader.addSpawn(EntitySoldier.class, 1, 4, 6, EnumCreatureType.creature);
//Blocks in Creative Inventory
ModLoader.setInGameHook(this, true, false);
ModLoader.setInGUIHook(this, true, false);
public boolean onTickInGame(float f, Minecraft minecraft)
{
if(minecraft.currentScreen == null)
{
creativeInventory = null;
}
return true;
}
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
{
if((guiscreen instanceof GuiContainerCreative) && !(creativeInventory instanceof GuiContainerCreative) && !minecraft.theWorld.isRemote)
{
Container container = ((GuiContainer)guiscreen).inventorySlots;
List list = ((ContainerCreative)container).itemList;
int i = 0;
list.add(new ItemStack(block1, 1, i));
list.add(new ItemStack(block2, 1, i));
list.add(new ItemStack(block3, 1, i));
}
creativeInventory = guiscreen;
return true;
}
private static GuiScreen creativeInventory;
}
//Add Renderers
public void addRenderer(Map map)
{
map.put(EntitySoldier.class, new RenderBiped(new ModelBiped(), 0.5F));
}
//Ore Generation
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
//Start Arcraphys Ore
for (int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(10);
int randPosY = random.nextInt(10 - 4);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(ArcraphysOre.blockID, 10)).generate(world, random, randPosX, randPosY, randPosZ);
}
//end Arcraphys Ore
//Start Cobalt Ore
for (int i = 0; i < 14; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(40 - 20);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(CobaltOre.blockID, 12)).generate(world, random, randPosX, randPosY, randPosZ);
}
//End Cobalt Ore
//Start Copper Ore
for (int i = 0; i < 17; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(50 - 10);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(CopperOre.blockID, 14)).generate(world, random, randPosX, randPosY, randPosZ);
}
//End Copper Ore
//Start Silver Ore
for (int i = 0; i < 12; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(60 - 10);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SilverOre.blockID, 13)).generate(world, random, randPosX, randPosY, randPosZ);
}
//End Silver Ore
//Start Platinum Ore
for (int i = 0; i < 13; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(30 - 10);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(PlatinumOre.blockID, 13)).generate(world, random, randPosX, randPosY, randPosZ);
}
//End Platinum Ore
}
//trees
public void generateSurface1(World world, Random rand, int baseX, int baseZ)
{
for(int x = 0; x < 100; x++)
{
int Xcoord = baseX + rand.nextInt(16);
int Zcoord = baseZ + rand.nextInt(16);
int Ycoord = world.getHeightValue(Xcoord, Zcoord);
}
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(baseX, baseZ);
WorldGenSkyTree tree = new WorldGenSkyTree();
if((biome instanceof BiomeGenSwamp))
{
for(int x = 0; x < 2; x++)
{
int Xcoord = baseX + rand.nextInt(16);
int Zcoord = baseZ + rand.nextInt(16);
int i = world.getHeightValue(Xcoord, Zcoord);
tree.generate(world, rand, Xcoord, i, Zcoord);
}
}
}
public String getVersion()
{
return "1.2.5";
}
}
/** Notes:
* RULES:
* A. When "^" icon appears = Finished. B. When "!" icon appears = Not finished.
* 1. New Blocks:
* (Nether+): !NetherMelon,!NoirBlock,!Necronite,!ShineOre, !ShinyArcraphysBlock.
* (Arcraphys) ^ArcraphysOre,^ArcraphysBlock,^ArcraphysBricks,
* (Ores+) !SilverOre,!SilverBlock,!CopperOre,!CopperBlock,!PlatinumOre,!PlatinumBlock,!CobaltOre,!CobaltBlock,
* (Trees+) !Cherry Trees,!Skywill Trees, !Hallow Trees,
* (biome+) !CherryForest,!Skywill,[NetherBiomes]: !Dread,!Holy ground,
* 2.New Weapons:
* (Arcraphys)ArcSword,ArcShovel,ArcAxe,ArcPickaxe,ArcHoe
* (Silver): !SilverSword,SilverShovel,SilverAxe,SilverPickaxe,SilverHoe
* (Copper): !CopperSword,CopperShovel,CopperAxe,CopperPickaxe,CopperHoe
* (Cobalt): !CobaltSword,CobaltShovel,CobaltAxe,CobaltPickaxe,CobaltHoe
* (Platinum): !PlatinumSword,PlatinumShovel,PlatinumAxe,PlatinumPickaxe,PlatinumHoe
*3.New Items:
* (Nether+): !NetherMelonSlices,Reaper Cloth,SoulFlesh,RottenEyeball,Grapes, NetherMind
* (CherryForest): CherryWood,CherryLeaves,Cherry, Cherry Candy: [0,C,0]
C = Cherry, S = Stick [0,S,0]
[0,S,0]
*(Skywill Biome) Liserium(Dirt), LiserGrass, Skywill Armour SkyBlessing
* (Potions): NetherMind,Unlimitability,SkyBlessing,EnderSoul,CreeperSpit
* (Armours): ArcArmour,SilverArmour,CopperArmour,CobaltArmour,NetherArmour,SkywillCloths,CasualCloths,AssassinCloths,ArmyArmour,ArmySuit
* MORE COMING SOON!
*/
You put it inside the load method
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 have a major problem. I understand how to do everything you've shown here. That's all fine, dandy, and you've made everything extremely understandable. You've helped immensely!
My problem comes in when making tools. I have no idea how to go about adding a material type for tools without editing the base-file EnumToolMaterial. Nothing seems to work. I've tried creating a duplicate file with the appropriate changes. However, this seems not to work the same way it used to before version 1.2.
Can you or anyone else please tell me how to go about adding a new ToolMaterial without editing the original EnumToolMaterial.java?
This is an example of the code I'm using:
package net.minecraft.src;
import java.util.Random;
public enum EnumToolMaterialZL
{
NEW(1, 202, 5F, 1, 5),
MATERIAL(3, 256, 7F, 3, 14);
TYPE(2, 100, 5F, 2, 11);
private final int harvestLevel;
private final int maxUses;
private final float efficiencyOnProperMaterial;
private final int damageVsEntity;
private final int enchantability;
private EnumToolMaterialZL(int par3, int par4, float par5, int par6, int par7)
{
harvestLevel = par3;
maxUses = par4;
efficiencyOnProperMaterial = par5;
damageVsEntity = par6;
enchantability = par7;
}
public int getMaxUses()
{
return maxUses;
}
public float getEfficiencyOnProperMaterial()
{
return efficiencyOnProperMaterial;
}
public int getDamageVsEntity()
{
return damageVsEntity;
}
public int getHarvestLevel()
{
return harvestLevel;
}
public int getEnchantability()
{
return enchantability;
}
}
I got an error saying "EnumToolMaterial has already been declared" (or something), but that error disappeared. I tried making my tools register the new EnumToolMaterialZL instead of the original, but when I add the ZL it makes it all red-underlined-like.
Halp. It would be greatly appreciated. If anyone can help, I'd prefer it in PM form. But if you'd rather not, here's fine too!
I have a major problem. I understand how to do everything you've shown here. That's all fine, dandy, and you've made everything extremely understandable. You've helped immensely!
My problem comes in when making tools. I have no idea how to go about adding a material type for tools without editing the base-file EnumToolMaterial. Nothing seems to work. I've tried creating a duplicate file with the appropriate changes. However, this seems not to work the same way it used to before version 1.2.
Can you or anyone else please tell me how to go about adding a new ToolMaterial without editing the original EnumToolMaterial.java?
This is an example of the code I'm using:
package net.minecraft.src;
import java.util.Random;
public enum EnumToolMaterialZL
{
NEW(1, 202, 5F, 1, 5),
MATERIAL(3, 256, 7F, 3, 14);
TYPE(2, 100, 5F, 2, 11);
private final int harvestLevel;
private final int maxUses;
private final float efficiencyOnProperMaterial;
private final int damageVsEntity;
private final int enchantability;
private EnumToolMaterialZL(int par3, int par4, float par5, int par6, int par7)
{
harvestLevel = par3;
maxUses = par4;
efficiencyOnProperMaterial = par5;
damageVsEntity = par6;
enchantability = par7;
}
public int getMaxUses()
{
return maxUses;
}
public float getEfficiencyOnProperMaterial()
{
return efficiencyOnProperMaterial;
}
public int getDamageVsEntity()
{
return damageVsEntity;
}
public int getHarvestLevel()
{
return harvestLevel;
}
public int getEnchantability()
{
return enchantability;
}
}
I got an error saying "EnumToolMaterial has already been declared" (or something), but that error disappeared. I tried making my tools register the new EnumToolMaterialZL instead of the original, but when I add the ZL it makes it all red-underlined-like.
Halp. It would be greatly appreciated. If anyone can help, I'd prefer it in PM form. But if you'd rather not, here's fine too!
Tool tutorial on post below OP.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
To post a comment, please login or register a new account.
Yes, please. Ensure the file has a .java extension too.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI think the reason that everyone ignores you is because it is hard to make a container, but if you want help you can PM me, and I will try to help you.
-
View User Profile
-
View Posts
-
Send Message
Retired StaffI think i can help.
In your code did you do
(ModLoader.addOverride("/gui/items.png", "/<Yourtexturehere>.png"));
Or did you do
(ModLoader.addOverride("/gui/items.png", "/minecraft.jar/<Yourtexturehere>.png"));
The first one is correct if you want it in the minecraft.jar
The second one says
'The texuture will be in the file minecraft.jar'
the first says
'It will be in this file'
I don't think that the current smelting system can handle that. I believe Forge has a hook for metadata smelting but I'm not 100% sure.
Hmmm, I'm not sure. Try asking in Mod Development.
together they are powerful beyond imagination."
package net.minecraft.src; import java.util.Random; public class WorldGenCastles extends WorldGenerator { public WorldGenCastles() { } public boolean generate(World world, Random random, int i, int j, int k) { int stoneBrick = Block.stoneBrick.blockID; world.setBlockWithNotify(i, j, k, stoneBrick); for (int counter=1; counter<5; counter++) { world.setBlockWithNotify(i + counter, j, k, stoneBrick); for (int fillI=1; fillI<5; fillI++) { int current = k; if (counter != 1) { current = k + counter; } world.setBlockWithNotify(i + counter, j, current, stoneBrick); } } return true; } }It should work fine, but I am thinking it has something to do with the second for loop.... Thanks for help in advanced.
Also, one random question, one button do you use to make Spoilers?Actually, I narrowed down the problem...
I think I know what is happening, but I don't know how to fix it...
Oh, and the if statement is for to but it on the first column, because I was having trouble with that...
ModLoader.addRecipe(new ItemStack(BoneSplinters, 4), new Object[] { " O ", " O ", " ", 'O', Item.bone });I dunno what your problem is exactly but I think I see an error with this code in the line above, I believe it should look like this
ModLoader.addRecipe(new ItemStack(BoneSplinters, 4), new Object[] { " O ", " O ", " ", Character.valueOf('O'), Item.bone });Also if it cant find your file chances are it in the wrong section I made a class and somehow it wasn't in the right place..
I don't cover loops in my tutorials, do I?
Nice spotting
@THeo_sA80
As KingCharizard has pointed out, there is an error with your recipe. Remove the empty set of quotations. You would normally get a different error to the one you received but sometimes they are different for some reason.
ModLoader.addRecipe(new ItemStack(BoneSplinters, 4), new Object[] { " O ", " O ", 'O', Item.bone });together they are powerful beyond imagination."
Here is my code(I copied it from BlockBed.java and attempted to change the textures to the ones I created)
package net.minecraft.src; import java.util.*; public class BlockBlueBed extends BlockDirectional { public static final int headBlockToFootBlockMap[][] = { { 0, 1 }, { -1, 0 }, { 0, -1 }, { 1, 0 } }; public BlockBlueBed(int par1) { super(par1, 134, Material.cloth); setBounds(); } /** * Called upon block activation (left or right click on the block.). The three integers represent x,y,z of the * block. */ public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { if (par1World.isRemote) { return true; } int i = par1World.getBlockMetadata(par2, par3, par4); if (!isBlockFootOfBed(i)) { int j = getDirection(i); par2 += headBlockToFootBlockMap[j][0]; par4 += headBlockToFootBlockMap[j][1]; if (par1World.getBlockId(par2, par3, par4) != blockID) { return true; } i = par1World.getBlockMetadata(par2, par3, par4); } if (!par1World.worldProvider.canRespawnHere()) { double d = (double)par2 + 0.5D; double d1 = (double)par3 + 0.5D; double d2 = (double)par4 + 0.5D; par1World.setBlockWithNotify(par2, par3, par4, 0); int k = getDirection(i); par2 += headBlockToFootBlockMap[k][0]; par4 += headBlockToFootBlockMap[k][1]; if (par1World.getBlockId(par2, par3, par4) == blockID) { par1World.setBlockWithNotify(par2, par3, par4, 0); d = (d + (double)par2 + 0.5D) / 2D; d1 = (d1 + (double)par3 + 0.5D) / 2D; d2 = (d2 + (double)par4 + 0.5D) / 2D; } par1World.newExplosion(null, (float)par2 + 0.5F, (float)par3 + 0.5F, (float)par4 + 0.5F, 5F, true); return true; } if (isBedOccupied(i)) { EntityPlayer entityplayer = null; Iterator iterator = par1World.playerEntities.iterator(); do { if (!iterator.hasNext()) { break; } EntityPlayer entityplayer1 = (EntityPlayer)iterator.next(); if (entityplayer1.isPlayerSleeping()) { ChunkCoordinates chunkcoordinates = entityplayer1.playerLocation; if (chunkcoordinates.posX == par2 && chunkcoordinates.posY == par3 && chunkcoordinates.posZ == par4) { entityplayer = entityplayer1; } } } while (true); if (entityplayer == null) { setBedOccupied(par1World, par2, par3, par4, false); } else { par5EntityPlayer.addChatMessage("tile.bed.occupied"); return true; } } EnumStatus enumstatus = par5EntityPlayer.sleepInBedAt(par2, par3, par4); if (enumstatus == EnumStatus.OK) { setBedOccupied(par1World, par2, par3, par4, true); return true; } if (enumstatus == EnumStatus.NOT_POSSIBLE_NOW) { par5EntityPlayer.addChatMessage("tile.bed.noSleep"); } else if (enumstatus == EnumStatus.NOT_SAFE) { par5EntityPlayer.addChatMessage("tile.bed.notSafe"); } return true; } /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public int getBlockTextureFromSideAndMetadata(int par1, int par2) { if (par1 == 0) { return Block.planks.blockIndexInTexture; } int i = getDirection(par2); int j = Direction.bedDirection[i][par1]; if (isBlockFootOfBed(par2)) { if (j == 2) { return mod_ColoredBeds.BlueFootTop; } if (j == 5 || j == 4) { return mod_ColoredBeds.BlueFootSides; } else { return mod_ColoredBeds.BlueFront; } } if (j == 3) { return mod_ColoredBeds.BlueHeadTop; } if (j == 5 || j == 4) { return mod_ColoredBeds.BlueHeadSides; } else { return mod_ColoredBeds.Back; } } /** * The type of render function that is called for this block */ public int getRenderType() { return 14; } /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ public boolean renderAsNormalBlock() { return false; } /** * 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; } /** * 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) { setBounds(); } /** * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are * their own) Args: x, y, z, neighbor blockID */ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { int i = par1World.getBlockMetadata(par2, par3, par4); int j = getDirection(i); if (isBlockFootOfBed(i)) { if (par1World.getBlockId(par2 - headBlockToFootBlockMap[j][0], par3, par4 - headBlockToFootBlockMap[j][1]) != blockID) { par1World.setBlockWithNotify(par2, par3, par4, 0); } } else if (par1World.getBlockId(par2 + headBlockToFootBlockMap[j][0], par3, par4 + headBlockToFootBlockMap[j][1]) != blockID) { par1World.setBlockWithNotify(par2, par3, par4, 0); if (!par1World.isRemote) { dropBlockAsItem(par1World, par2, par3, par4, i, 0); } } } /** * Returns the ID of the items to drop on destruction. */ public int idDropped(int par1, Random par2Random, int par3) { if (isBlockFootOfBed(par1)) { return 0; } else { return Item.bed.shiftedIndex; } } /** * Set the bounds of the bed block. */ private void setBounds() { setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F); } /** * Returns whether or not this bed block is the foot of the bed. */ public static boolean isBlockFootOfBed(int par0) { return (par0 & 8) != 0; } /** * Return whether or not the bed is occupied. */ public static boolean isBedOccupied(int par0) { return (par0 & 4) != 0; } /** * Sets whether or not the bed is occupied. */ public static void setBedOccupied(World par0World, int par1, int par2, int par3, boolean par4) { int i = par0World.getBlockMetadata(par1, par2, par3); if (par4) { i |= 4; } else { i &= -5; } par0World.setBlockMetadataWithNotify(par1, par2, par3, i); } /** * Gets the nearest empty chunk coordinates for the player to wake up from a bed into. */ public static ChunkCoordinates getNearestEmptyChunkCoordinates(World par0World, int par1, int par2, int par3, int par4) { int i = par0World.getBlockMetadata(par1, par2, par3); int j = BlockDirectional.getDirection(i); for (int k = 0; k <= 1; k++) { int l = par1 - headBlockToFootBlockMap[j][0] * k - 1; int i1 = par3 - headBlockToFootBlockMap[j][1] * k - 1; int j1 = l + 2; int k1 = i1 + 2; for (int l1 = l; l1 <= j1; l1++) { for (int i2 = i1; i2 <= k1; i2++) { if (!par0World.isBlockNormalCube(l1, par2 - 1, i2) || !par0World.isAirBlock(l1, par2, i2) || !par0World.isAirBlock(l1, par2 + 1, i2)) { continue; } if (par4 > 0) { par4--; } else { return new ChunkCoordinates(l1, par2, i2); } } } } return null; } /** * 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) { if (!isBlockFootOfBed(par5)) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); } } /** * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility * and stop pistons */ public int getMobilityFlag() { return 1; } }This is the only part I changed:
public int getBlockTextureFromSideAndMetadata(int par1, int par2) { if (par1 == 0) { return Block.planks.blockIndexInTexture; } int i = getDirection(par2); int j = Direction.bedDirection[i][par1]; if (isBlockFootOfBed(par2)) { if (j == 2) { return mod_ColoredBeds.BlueFootTop; } if (j == 5 || j == 4) { return mod_ColoredBeds.BlueFootSides; } else { return mod_ColoredBeds.BlueFront; } } if (j == 3) { return mod_ColoredBeds.BlueHeadTop; } if (j == 5 || j == 4) { return mod_ColoredBeds.BlueHeadSides; } else { return mod_ColoredBeds.Back; } }It works well, with no errors, other than the fact that the bed is only 1 block and the textures don't show up on the sides I want them too... Obviously I did something wrong here lol. Can you explain to me what I should be doing?
Thanks!
No, but it is for a structure. But, can you possibly fix it? I am stumped...
Generated 6/2/12 12:08 AM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0_04, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: GeForce 8200M G/PCI/SSE2/3DNOW! version 3.0.0, NVIDIA Corporation
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.ArrayIndexOutOfBoundsException: 5010
at net.minecraft.src.Block.<init>(Block.java:230)
at net.minecraft.src.Block.<init>(Block.java:267)
at net.minecraft.src.BlockFertilizer.<init>(BlockFertilizer.java:9)
at net.minecraft.src.mod_ExtendingMinecraft.<clinit>(mod_ExtendingMinecraft.java:162)
... 15 more
--- END ERROR REPORT 9142f18c ----------
It just started out of no where after I added this line
public static final Item ironStick = (new ItemIronStick(5015)).setItemName("Iron Stick");in this code in the spoiler
package net.minecraft.src; import java.util.Random; public class mod_ExtendingMinecraft extends BaseMod { public static final Achievement GoodDirt; public static final Item rubyPickaxe; public static final Item rubyShovel; public static final Item rubyHoe; public static final Item rubyAxe; public static final Item rubySword; public static final Item sapphirePickaxe; public static final Item sapphireShovel; public static final Item sapphireHoe; public static final Item sapphireAxe; public static final Item sapphireSword; private static final StepSound soundGravelFootstep; public static final Block BlockFertilizer; public static final StepSound soundStoneFootstep; public static final Block BlockRuby; public static final Block BlockSapphire; public static final Item Ruby = (new ItemRuby(5013)).setItemName("Ruby"); public static final Item Sapphire = (new ItemSapphire(5014)).setItemName("Sapphire"); public static final Item ironStick = (new ItemIronStick(5015)).setItemName("Iron Stick"); public void load() { ModLoader.addAchievementDesc(GoodDirt, "Dirt Master", "Create Fertilizer"); rubyPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubypickaxe.png"); ModLoader.addName(rubyPickaxe, "Ruby Pickaxe"); ModLoader.addRecipe(new ItemStack(rubyPickaxe, 1), new Object[] { "###", " $ ", " $ ", '#', Ruby, '$', ironStick }); rubyShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyShovel.png"); ModLoader.addName(rubyShovel, "Ruby Shovel"); ModLoader.addRecipe(new ItemStack(rubyShovel, 1), new Object[] { " # ", " $ ", " $ ", '#', Ruby, '$', ironStick }); rubyHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyHoe.png"); ModLoader.addName(rubyHoe, "Ruby Hoe"); ModLoader.addRecipe(new ItemStack(rubyHoe, 1), new Object[] { "## ", " $ ", " $ ", '#', Ruby, '$', ironStick }); rubyAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyAxe.png"); ModLoader.addName(rubyAxe, "Ruby Axe"); ModLoader.addRecipe(new ItemStack(rubyAxe, 1), new Object[] { "## ", "#$ ", " $ ", '#', Ruby, '$', ironStick }); rubySword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubySword.png"); ModLoader.addName(rubySword, "Ruby Sword"); ModLoader.addRecipe(new ItemStack(rubySword, 1), new Object[] { " # ", " # ", " $ ", '#', Ruby, '$', ironStick }); sapphirePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphirePickaxe.png"); ModLoader.addName(sapphirePickaxe, "Sapphire Pickaxe"); ModLoader.addRecipe(new ItemStack(sapphirePickaxe, 1), new Object[] { "###", " $ ", " $ ", '#', Sapphire, '$', ironStick }); sapphireShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireShovel.png"); ModLoader.addName(sapphireShovel, "Sapphire Shovel"); ModLoader.addRecipe(new ItemStack(sapphireShovel, 1), new Object[] { " # ", " $ ", " $ ", '#', Sapphire, '$', ironStick }); sapphireHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireHoe.png"); ModLoader.addName(sapphireHoe, "Sapphire Hoe"); ModLoader.addRecipe(new ItemStack(sapphireHoe, 1), new Object[] { "## ", " $ ", " $ ", '#', Sapphire, '$', ironStick }); sapphireAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireAxe.png"); ModLoader.addName(sapphireAxe, "Sapphire Axe"); ModLoader.addRecipe(new ItemStack(sapphireAxe, 1), new Object[] { "## ", "#$ ", " $ ", '#', Sapphire, '$', ironStick }); sapphireSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireSword.png"); ModLoader.addName(sapphireSword, "Sapphire Sword"); ModLoader.addRecipe(new ItemStack(sapphireSword, 1), new Object[] { " # ", " # ", " $ ", '#', Sapphire, '$', ironStick }); ironStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/ironStick.png"); ModLoader.addName(ironStick, "Iron Stick"); ModLoader.addRecipe(new ItemStack(ironStick, 4), new Object[] { "#", "#", '#', Item.ingotIron }); BlockFertilizer.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/fertilizer.png"); ModLoader.registerBlock(BlockFertilizer); ModLoader.addName(BlockFertilizer, "Fertilizer"); ModLoader.addRecipe(new ItemStack(BlockFertilizer, 4), new Object[] { "##", "##", '#', Block.dirt }); BlockRuby.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/rubyBlock.png"); ModLoader.registerBlock(BlockRuby); ModLoader.addName(BlockRuby, "Ruby"); ModLoader.addRecipe(new ItemStack(BlockRuby, 4), new Object[] { "##", "##", '#', Block.wood }); BlockSapphire.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/sapphireBlock2.png"); ModLoader.registerBlock(BlockSapphire); ModLoader.addName(BlockSapphire, "Sapphire"); ModLoader.addRecipe(new ItemStack(BlockSapphire, 4), new Object[] { "###", "###", '#', Block.wood }); Ruby.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/rubyIcon.png"); ModLoader.addName(Ruby, "Ruby"); Sapphire.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/sapphireIcon.png"); ModLoader.addName(Sapphire, "Sapphire"); } public void takenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory) { if (itemstack.itemID == BlockFertilizer.blockID) { entityplayer.addStat(GoodDirt, 1); } } public void generateSurface(World world, Random random, int i, int j) { for (int k = 0; k < 12; k++) { int l = i + random.nextInt(16); int i1 = random.nextInt(96); int j1 = j + random.nextInt(16); (new WorldGenMinable(BlockRuby.blockID, 5)).generate(world, random, l, i1, j1); (new WorldGenMinable(BlockSapphire.blockID, 3)).generate(world, random, l, i1, j1); } } public String getVersion() { return "1.2.5"; } static { GoodDirt = (new Achievement(3000, "GoodDirt", 5, 7, Item.diamond, null)).registerAchievement(); rubyPickaxe = (new ItemRubyPickaxe(5000, EnumOreToolMaterial.RUBY)).setItemName("Ruby Pickaxe"); rubyShovel = (new ItemRubyShovel(5001, EnumOreToolMaterial.RUBY)).setItemName("Ruby Shovel"); rubyHoe = (new ItemRubyHoe(5002, EnumOreToolMaterial.RUBY)).setItemName("Ruby Hoe"); rubyAxe = (new ItemRubyAxe(5003, EnumOreToolMaterial.RUBY)).setItemName("Ruby Axe"); rubySword = (new ItemRubySword(5004, EnumOreToolMaterial.RUBY)).setItemName("Ruby Sword"); sapphirePickaxe = (new ItemSapphirePickaxe(5005, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Pickaxe"); sapphireShovel = (new ItemSapphireShovel(5006, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Shovel"); sapphireHoe = (new ItemSapphireHoe(5007, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Hoe"); sapphireAxe = (new ItemSapphireAxe(5008, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Axe"); sapphireSword = (new ItemSapphireSword(5009, EnumOreToolMaterial.SAPPHIRE)).setItemName("Sapphire Sword"); soundGravelFootstep = new StepSound("gravel", 1.0F, 1.0F); BlockFertilizer = (new BlockFertilizer(5010, 0)).setBlockName("Fertilizer").setHardness(1.5F).setResistance(2.0F).setStepSound(soundGravelFootstep); soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F); BlockRuby = (new BlockRuby(5011, 0)).setBlockName("Ruby").setHardness(3F).setResistance(4F).setStepSound(soundStoneFootstep); BlockSapphire = (new BlockSapphire(5012, 0)).setBlockName("Sapphire").setHardness(3F).setResistance(4F).setStepSound(soundStoneFootstep); } }public static final Block titanore = new Block(160, 4, Material.wood).setBlockName("titanore").setHardness(3F).setLightValue(1F);You need to make it create a new instance of Block, not your mod_ class. You need to add a Material in there as well like I did.
Mod Development - I don't cover beds in my tutorials.
PM me.
Block ids can't be over 255...
together they are powerful beyond imagination."
The code spoiler isn't working.
together they are powerful beyond imagination."
I have just released two new mods that I couldn't have made without them.
http://www.minecraft...n-lightsx8-v10/
Crafting Matrix recipes must have an equal amount of spaces. This one doesn't:
ModLoader.addRecipe(new ItemStack(mystichoegreen, 1), new Object [] { "XX", " S ", " S ", Character.valueOf('S'), Item.stick, Character.valueOf('X'), mysticgemgreen });There could be more but that is the only one I found
Thanks
You put it inside the load method
together they are powerful beyond imagination."
Also, these tutorials are awesome
-
View User Profile
-
View Posts
-
Send Message
Retired StaffMy problem comes in when making tools. I have no idea how to go about adding a material type for tools without editing the base-file EnumToolMaterial. Nothing seems to work. I've tried creating a duplicate file with the appropriate changes. However, this seems not to work the same way it used to before version 1.2.
Can you or anyone else please tell me how to go about adding a new ToolMaterial without editing the original EnumToolMaterial.java?
This is an example of the code I'm using:
package net.minecraft.src; import java.util.Random; public enum EnumToolMaterialZL { NEW(1, 202, 5F, 1, 5), MATERIAL(3, 256, 7F, 3, 14); TYPE(2, 100, 5F, 2, 11); private final int harvestLevel; private final int maxUses; private final float efficiencyOnProperMaterial; private final int damageVsEntity; private final int enchantability; private EnumToolMaterialZL(int par3, int par4, float par5, int par6, int par7) { harvestLevel = par3; maxUses = par4; efficiencyOnProperMaterial = par5; damageVsEntity = par6; enchantability = par7; } public int getMaxUses() { return maxUses; } public float getEfficiencyOnProperMaterial() { return efficiencyOnProperMaterial; } public int getDamageVsEntity() { return damageVsEntity; } public int getHarvestLevel() { return harvestLevel; } public int getEnchantability() { return enchantability; } }I got an error saying "EnumToolMaterial has already been declared" (or something), but that error disappeared. I tried making my tools register the new EnumToolMaterialZL instead of the original, but when I add the ZL it makes it all red-underlined-like.
Halp.
Have a look in EntitySkeleton how it triggers the achievement.
Tool tutorial on post below OP.
together they are powerful beyond imagination."