Whats wrong with this?
I am having my problem in the emboldened, italicized, and underlined line.
mod_WhippedSugar:
package net.minecraft.src;
import java.util.Random;
public class mod_WhippedSugar extends BaseMod
{
public static final Item WhippedSugar = new ItemWhippedSugar(4120).setItemName("WhippedSugar");
public void load()
{
WhippedSugar.iconIndex = ModLoader.addOverride("/gui/items.png", "/Better Foods/Whipped Sugar.png");
ModLoader.addName(WhippedSugar, "Whipped Sugar"); ModLoader.addSmelting(mod_SugaronaStick.SugaronaStick, new ItemStack(WhippedSugar, 1), 1.0F);
package net.minecraft.src;
import java.util.Random;
public class ItemWhippedSugar extends Item
{
public ItemWhippedSugar(int par1)
{
super(par1);
this.setMaxStackSize(64);
this.setCreativeTab(CreativeTabs.tabMaterials);
}
public int quantityDropped(int par1)
{
return (1);
}
}
mod_SugaronaStick:
package net.minecraft.src;
public class mod_SugaronaStick extends BaseMod
{
public static final Item SugaronaStick = new ItemFood(4117, 1, 1.0F, false).setItemName("SugaronaStick");
public void load()
{
SugaronaStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/Better Foods/Sugar on a Stick.png");
ModLoader.addName(SugaronaStick, "Sugar on a Stick");
Well the thing is it drops a gem, like Emerald Ore. Its not for smelting at all
Anyways - I've kinda moved on... Maybe you can help me with this -> I've added a Throwable Spear. And basically copied the ItemSnowball, EntitySnowball & RenderSnowball. Added abit of hit damage. And all that works. My problem is that the Spear does'nt render when in flight
Heres my code...
Item
package net.minecraft.src;
import java.util.*;
public class ItemSpearFlint extends Item
{
public ItemSpearFlint(int par1)
{
super(par1);
this.maxStackSize = 1;
this.setMaxDamage (384);
this.setCreativeTab(CreativeTabs.tabCombat);
}
/** Throw Function **/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntitySpearFlint(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
}
Entity
package net.minecraft.src;
import java.util.*;
public class EntitySpearFlint extends EntityThrowable
{
public EntitySpearFlint(World par1World)
{
super(par1World);
}
public EntitySpearFlint(World par1World, EntityLiving par2EntityLiving)
{
super(par1World, par2EntityLiving);
}
public EntitySpearFlint(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
/**
* Called when this EntityThrowable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
if (par1MovingObjectPosition.entityHit != null)
{
byte var2 = 0;
if (par1MovingObjectPosition.entityHit instanceof EntityBlaze)
{
var2 = 3;
}
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 3);
}
for (int var3 = 0; var3 < 8; ++var3)
{
this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
}
if (!this.worldObj.isRemote)
{
this.setDead();
}
}
}
Render
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class RenderSpearFlint extends Render
{
/**
* Have the icon index (in items.png) that will be used to render the image. Currently, eggs and snowballs uses this
* classes.
*/
private int itemIconIndex;
public RenderSpearFlint(int par1)
{
this.itemIconIndex = par1;
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
this.loadTexture("/textures/spearflint.png");
Tessellator var10 = Tessellator.instance;
if (this.itemIconIndex == 154)
{
int var11 = PotionHelper.func_77915_a(((EntityPotion)par1Entity).getPotionDamage(), false);
float var12 = (float)(var11 >> 16 & 255) / 255.0F;
float var13 = (float)(var11 >> 8 & 255) / 255.0F;
float var14 = (float)(var11 & 255) / 255.0F;
GL11.glColor3f(var12, var13, var14);
GL11.glPushMatrix();
this.func_77026_a(var10, 141);
GL11.glPopMatrix();
GL11.glColor3f(1.0F, 1.0F, 1.0F);
}
this.func_77026_a(var10, this.itemIconIndex);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
private void func_77026_a(Tessellator par1Tessellator, int par2)
{
float var3 = (float)(par2 % 16 * 16 + 0) / 256.0F;
float var4 = (float)(par2 % 16 * 16 + 16) / 256.0F;
float var5 = (float)(par2 / 16 * 16 + 0) / 256.0F;
float var6 = (float)(par2 / 16 * 16 + 16) / 256.0F;
float var7 = 1.0F;
float var8 = 0.5F;
float var9 = 0.25F;
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
par1Tessellator.startDrawingQuads();
par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
par1Tessellator.addVertexWithUV((double)(0.0F - var8), (double)(0.0F - var9), 0.0D, (double)var3, (double)var6);
par1Tessellator.addVertexWithUV((double)(var7 - var8), (double)(0.0F - var9), 0.0D, (double)var4, (double)var6);
par1Tessellator.addVertexWithUV((double)(var7 - var8), (double)(var7 - var9), 0.0D, (double)var4, (double)var5);
par1Tessellator.addVertexWithUV((double)(0.0F - var8), (double)(var7 - var9), 0.0D, (double)var3, (double)var5);
par1Tessellator.draw();
}
}
Also, I've been looking around the tutorials and added this to my mod_*** - However I get an error at RenderSpearFlint - It asks for an int, and found float... I've tried changing the float in Render to int... But that just broke it all
public void addRenderer(Map map)
{
map.put(EntitySpearFlint.class, new RenderSpearFlint( 0.5F));
}
public mod_BetterMod()
{
ModLoader.registerEntityID(EntitySpearFlint.class, "spearFlint", ModLoader.getUniqueEntityId());
}
Hope you can help
Haven't worked with throwable items yet, but I'll help you to the best of my abilities.
Did you change this to the item ID number?
if (this.itemIconIndex == 154)
Also, Make sure you have the textures in the right folder.
Not really a "I need help!" question, but what about packaging the mods as .zip files? And also generating configs. Really good tutorial otherwise.
When you obfuscate you need to go to your "reobf" folder and copy all of those into a .jar folder. You need to add all of these into a minecraft.jar that has modloader installed.
Whats wrong with this?
I am having my problem in the emboldened, italicized, and underlined line.
mod_WhippedSugar:
package net.minecraft.src;
import java.util.Random;
public class mod_WhippedSugar extends BaseMod
{
public static final Item WhippedSugar = new ItemWhippedSugar(4120).setItemName("WhippedSugar");
public void load()
{
WhippedSugar.iconIndex = ModLoader.addOverride("/gui/items.png", "/Better Foods/Whipped Sugar.png");
ModLoader.addName(WhippedSugar, "Whipped Sugar"); ModLoader.addSmelting(mod_SugaronaStick.SugaronaStick, new ItemStack(WhippedSugar, 1), 1.0F);
package net.minecraft.src;
import java.util.Random;
public class ItemWhippedSugar extends Item
{
public ItemWhippedSugar(int par1)
{
super(par1);
this.setMaxStackSize(64);
this.setCreativeTab(CreativeTabs.tabMaterials);
}
public int quantityDropped(int par1)
{
return (1);
}
}
mod_SugaronaStick:
package net.minecraft.src;
public class mod_SugaronaStick extends BaseMod
{
public static final Item SugaronaStick = new ItemFood(4117, 1, 1.0F, false).setItemName("SugaronaStick");
public void load()
{
SugaronaStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/Better Foods/Sugar on a Stick.png");
ModLoader.addName(SugaronaStick, "Sugar on a Stick");
Haven't worked with throwable items yet, but I'll help you to the best of my abilities.
Did you change this to the item ID number?
if (this.itemIconIndex == 154)
Also, Make sure you have the textures in the right folder.
When you obfuscate you need to go to your "reobf" folder and copy all of those into a .jar folder. You need to add all of these into a minecraft.jar that has modloader installed.
You have it all correct, you just forgot to add one little thing.
mod_SugaronaStick.SugaronaStick
should be...
mod_SugaronaStick.SugaronaStick.shiftedIndex
//Or blockID depending on whether or not it's a block
thanks, worked. hate it when I make stupid mistakes like that!
Anyone got an idea how to make a growing plant like wheat? I want to make rice, tomatos, and other stuff.
thanks, worked. hate it when I make stupid mistakes like that!
Try checking the Wheats class files. Anything that has to do with wheat except breeding. I bet with what you know, you could do it. You just have to read a bit of coding.
I've added Bronze, Silver & Steel Tools to my mod. I want it so that to harvest Silver, you need atleast Iron (Iron now requires you to have atleast Bronze Tools).
Also for my Gem Ores, Amethyst, Sapphire & Ruby, you will need Iron, Steel or Diamond Tools.
I have looked at the ItemPickaxe, and added the new materials to the top of the file, Bronze is not required, as it is already defined with HarvestLevel...
So here goes...
package net.minecraft.src;
public class ItemPickaxe extends ItemTool
{
/** an array of the blocks this pickaxe is effective against */
/** As you can see I have added Amethyst, Sapphire, Ruby & Silver to this section **/
private static Block[] blocksEffectiveAgainst = new Block[] {Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered, mod_BetterMod.oreSilver, mod_BetterMod.oreAmethyst, mod_BetterMod.oreSapphire, mod_BetterMod.oreRuby};
protected ItemPickaxe(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1, 2, par2EnumToolMaterial, blocksEffectiveAgainst);
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
/** Now this section is the one that defines the what Materials a certain HarvestLevel can mine, and is where i need to define the required HarvestLevel - However I am abit confused as how to edit this section. **/
{
return par1Block == Block.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (par1Block != Block.blockDiamond && par1Block != Block.oreDiamond ? (par1Block != Block.oreEmerald && par1Block != Block.blockEmerald ? (par1Block != Block.blockGold && par1Block != Block.oreGold ? (par1Block != Block.blockSteel && par1Block != Block.oreIron ? (par1Block != Block.blockLapis && par1Block != Block.oreLapis ? (par1Block != Block.oreRedstone && par1Block != Block.oreRedstoneGlowing ? (par1Block.blockMaterial == Material.rock ? true : (par1Block.blockMaterial == Material.iron ? true : par1Block.blockMaterial == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2);
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.anvil || par2Block.blockMaterial == Material.rock) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block);
}
}
I've tried copying abit of the code and adding it where it seemed right (and editing it to refer to the correct block in the mod_file), however when I do it asks me for a ":"
I hope someone can help, this is kinda cruxial for my mod to work.
I've been trying to find this out for about 3 weeks now.
Rollback Post to RevisionRollBack
I fought through the Nether and all I got was this stupid signature.
Try checking the Wheats class files. Anything that has to do with wheat except breeding. I bet with what you know, you could do it. You just have to read a bit of coding.
What's the class file for wheat? couldn't find it.
I have an odd issue trying to decompile the mcp project:
!! Modified jar detected. Unpredictable results !! == Decompiling server using fernflower == > Creating SRGs > Applying RetroGuard '"C:\Program Files\Java\jdk1.7.0_09\bin\java" -cp "runtime\bin\retroguard.jar;lib;lib\*;jars\bin\mine...' failed : 1 == ERRORS FOUND == Unrecoverable error during obfuscation, see log file for details. RetroGuard error: COM.rl.obf.classfile.ClassFileException: ClassNotFound bbv ================== Decompile failed
Any ideas as to what could cause this error? This is my first time setting it up and it's giving me a big headache. I've been re-downloading everything and re-setting the jdk path and I can't seem to get this to work.
src/minecraft/net/minecraft/src/Blockcordiamond.java:19: error: cannot find symbol
return mod_corrupt.CorruptDiamondBlock.shiftedIndex;
^
symbol: variable CorruptDiamondBlock
location: class mod_corrupt
src/minecraft/net/minecraft/src/mod_corrupt.java:8: error: cannot find symbol
public static final Block cordiamond = Blockcordiamond(160,0).setStepSound(Block.soundStoneFootstep).setBlockName("cordiamond").setHardness(5.5F).setResistance(2000F).setLightValue(0.735F);
^
symbol: method Blockcordiamond(int,int)
location: class mod_corrupt
2 errors
==================
my mod_***:
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class mod_corrupt
{
public static final Block cordiamond = Blockcordiamond(160,0).setStepSound(Block.soundStoneFootstep).setBlockName("cordiamond").setHardness(5.5F).setResistance(2000F).setLightValue(0.735F);
public void load()
{
cordiamond.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/textures/cordiamond.png");
ModLoader.registerBlock(cordiamond);
ModLoader.addName(cordiamond, "Corrupt DiamondBlock");
}
public String getVersion()
{
return "Corrupt Block Mod V1.0 Minecraft 1.4.6";
}
}
my Block***:
package net.minecraft.src;
import java.util.Random;
public class Blockcordiamond extends Block
{
public Blockcordiamond(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1)
{
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
mod_BiomeTest
Its suppose to add more biome and a few block
The problem is that paulscode say me that there is a bug every time I try to launch the game but i havent add block yet
mod_NewBiomeShad
Its suppose to add more biome and a few block
The problem is that paulscode say me that there is a bug every time I try to launch the game but i havent add block yet
Could you help me cause its totaly anoying
You have to show us your files and the problem first. Otherwise how will we help?
---- Minecraft Crash Report ----
// This doesn't make any sense!
Time: 12-12-26 12:26
Description: Exception occured in ModLoader
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:395)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1406)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:190)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:93)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:421)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 6000
at net.minecraft.src.BiomeGenBase.<init>(BiomeGenBase.java:136)
at net.minecraft.src.BiomeGenGoldenDune.<init>(BiomeGenGoldenDune.java:7)
at net.minecraft.src.mod_BiomeTest.<clinit>(mod_BiomeTest.java:7)
... 16 more
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_04, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 992206552 bytes (946 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: Start[net.minecraft.src.IPlayerUsage, MinecraftFakeLauncher, ThreadShutdown, ...]
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
ModLoader: Mods loaded: 1
ModLoader 1.4.6
---- Minecraft Crash Report ----
// This doesn't make any sense!
Time: 12-12-26 12:26
Description: Exception occured in ModLoader
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:395)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1406)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:190)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:93)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:421)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 6000
at net.minecraft.src.BiomeGenBase.<init>(BiomeGenBase.java:136)
at net.minecraft.src.BiomeGenGoldenDune.<init>(BiomeGenGoldenDune.java:7)
at net.minecraft.src.mod_BiomeTest.<clinit>(mod_BiomeTest.java:7)
... 16 more
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_04, Oracle Corporation
Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 992206552 bytes (946 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: Start[net.minecraft.src.IPlayerUsage, MinecraftFakeLauncher, ThreadShutdown, ...]
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
ModLoader: Mods loaded: 1
ModLoader 1.4.6
public static final BiomeGenBase GoldenDune = (new BiomeGenGoldenDune(6000)).setBiomeName("0");
public void load()
{
ModLoader.addBiome(GoldenDune);
}
public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
{
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
WorldGenBigTree tree = new WorldGenBigTree(false);
if(biome instanceof BiomeGenGoldenDune)
{
for(int x = 0; x < 8; x++)
{
tree = new WorldGenBigTree(false);
int Xcoord = chunkX + rand.nextInt(16);
int Zcoord = chunkZ + rand.nextInt(16);
int i = world.getHeightValue(Xcoord, Zcoord);
tree.generate(world, rand, Xcoord, i, Zcoord);
}
}
}
public String getVersion()
{
return "3.14159265";
}
}
public static final BiomeGenBase GoldenDune = (new BiomeGenGoldenDune(6000)).setBiomeName("0");
public void load()
{
ModLoader.addBiome(GoldenDune);
}
public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
{
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
WorldGenBigTree tree = new WorldGenBigTree(false);
if(biome instanceof BiomeGenGoldenDune)
{
for(int x = 0; x < 8; x++)
{
tree = new WorldGenBigTree(false);
int Xcoord = chunkX + rand.nextInt(16);
int Zcoord = chunkZ + rand.nextInt(16);
int i = world.getHeightValue(Xcoord, Zcoord);
tree.generate(world, rand, Xcoord, i, Zcoord);
}
}
}
public String getVersion()
{
return "3.14159265";
}
}
It's fine. Forgetting the mod_*** I mean.
I can't try it on my computer yet, but I have a few guesses. First, 6000 for the BiomeGennumber is too high. also you have
(new BiomeGenGoldenDune(6000))
in parenthesis which you don't need(change this)
I'm not sure that WorldGenBigTree is a tree. but I haven't tried this on my computer yet, so actually don't change that and give me maybe thirty minutes.
I'm guessing 2, but you can look in the Block file.
Figured it out nevermind
-lvdicedealer 30/10/2012
I am having my problem in the emboldened, italicized, and underlined line.
mod_WhippedSugar:
package net.minecraft.src;
import java.util.Random;
public class mod_WhippedSugar extends BaseMod
{
public static final Item WhippedSugar = new ItemWhippedSugar(4120).setItemName("WhippedSugar");
public void load()
{
WhippedSugar.iconIndex = ModLoader.addOverride("/gui/items.png", "/Better Foods/Whipped Sugar.png");
ModLoader.addName(WhippedSugar, "Whipped Sugar");
ModLoader.addSmelting(mod_SugaronaStick.SugaronaStick, new ItemStack(WhippedSugar, 1), 1.0F);
}
public String getVersion()
{
return "1.4.5 Better Foods Mod";
}
}
ItemWhippedSugar:
package net.minecraft.src;
import java.util.Random;
public class ItemWhippedSugar extends Item
{
public ItemWhippedSugar(int par1)
{
super(par1);
this.setMaxStackSize(64);
this.setCreativeTab(CreativeTabs.tabMaterials);
}
public int quantityDropped(int par1)
{
return (1);
}
}
mod_SugaronaStick:
package net.minecraft.src;
public class mod_SugaronaStick extends BaseMod
{
public static final Item SugaronaStick = new ItemFood(4117, 1, 1.0F, false).setItemName("SugaronaStick");
public void load()
{
SugaronaStick.iconIndex = ModLoader.addOverride("/gui/items.png", "/Better Foods/Sugar on a Stick.png");
ModLoader.addName(SugaronaStick, "Sugar on a Stick");
ModLoader.addRecipe(new ItemStack(SugaronaStick, 1), new Object [] {"#", "X", Character.valueOf('#'), Item.sugar, Character.valueOf('X'), Item.stick});
}
public String getVersion()
{
return "1.4.5 Better Foods Mod";
}
}
I am having my problem in the emboldened, italicized, and underlined line.
Haven't worked with throwable items yet, but I'll help you to the best of my abilities.
Did you change this to the item ID number?
Also, Make sure you have the textures in the right folder.
When you obfuscate you need to go to your "reobf" folder and copy all of those into a .jar folder. You need to add all of these into a minecraft.jar that has modloader installed.
You have it all correct, you just forgot to add one little thing.
should be...
thanks, worked. hate it when I make stupid mistakes like that!
where are the tutorials that are not in the main page?
Where are the tutorials that aren't in the main thing?
Try checking the Wheats class files. Anything that has to do with wheat except breeding. I bet with what you know, you could do it. You just have to read a bit of coding.
I've been trying to find this out for about 3 weeks now.
!! Modified jar detected. Unpredictable results !!
== Decompiling server using fernflower ==
> Creating SRGs
> Applying RetroGuard
'"C:\Program Files\Java\jdk1.7.0_09\bin\java" -cp "runtime\bin\retroguard.jar;lib;lib\*;jars\bin\mine...' failed : 1
== ERRORS FOUND ==
Unrecoverable error during obfuscation, see log file for details.
RetroGuard error: COM.rl.obf.classfile.ClassFileException: ClassNotFound bbv
==================
Decompile failed
Any ideas as to what could cause this error? This is my first time setting it up and it's giving me a big headache. I've been re-downloading everything and re-setting the jdk path and I can't seem to get this to work.
u seem alot more experienced at modding them me (making my first mod now) could you please help me with my above error when re-compiling
errors:
== ERRORS FOUND ==
src/minecraft/net/minecraft/src/Blockcordiamond.java:19: error: cannot find symbol
return mod_corrupt.CorruptDiamondBlock.shiftedIndex;
^
symbol: variable CorruptDiamondBlock
location: class mod_corrupt
src/minecraft/net/minecraft/src/mod_corrupt.java:8: error: cannot find symbol
public static final Block cordiamond = Blockcordiamond(160,0).setStepSound(Block.soundStoneFootstep).setBlockName("cordiamond").setHardness(5.5F).setResistance(2000F).setLightValue(0.735F);
^
symbol: method Blockcordiamond(int,int)
location: class mod_corrupt
2 errors
==================
my mod_***:
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class mod_corrupt
{
public static final Block cordiamond = Blockcordiamond(160,0).setStepSound(Block.soundStoneFootstep).setBlockName("cordiamond").setHardness(5.5F).setResistance(2000F).setLightValue(0.735F);
public void load()
{
cordiamond.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/textures/cordiamond.png");
ModLoader.registerBlock(cordiamond);
ModLoader.addName(cordiamond, "Corrupt DiamondBlock");
}
public String getVersion()
{
return "Corrupt Block Mod V1.0 Minecraft 1.4.6";
}
}
my Block***:
package net.minecraft.src;
import java.util.Random;
public class Blockcordiamond extends Block
{
public Blockcordiamond(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1)
{
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_corrupt.Corrupt DiamondBlock.shiftedIndex;
}
}
Its suppose to add more biome and a few block
The problem is that paulscode say me that there is a bug every time I try to launch the game but i havent add block yet
Could you help me cause its totaly anoying
You have to show us your files and the problem first. Otherwise how will we help?
// This doesn't make any sense!
Time: 12-12-26 12:26
Description: Exception occured in ModLoader
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:395)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1406)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:190)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:93)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:421)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 6000
at net.minecraft.src.BiomeGenBase.<init>(BiomeGenBase.java:136)
at net.minecraft.src.BiomeGenGoldenDune.<init>(BiomeGenGoldenDune.java:7)
at net.minecraft.src.mod_BiomeTest.<clinit>(mod_BiomeTest.java:7)
... 16 more
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_04, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 992206552 bytes (946 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: Start[net.minecraft.src.IPlayerUsage, MinecraftFakeLauncher, ThreadShutdown, ...]
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
ModLoader: Mods loaded: 1
ModLoader 1.4.6
Forge has a lot of things that modloader doesn't include. But everything done in modloader can be put into forge.
We also need your mod_***
mod_BiomeTest
import java.util.Random;
public class mod_BiomeTest extends BaseMod
{
public static final BiomeGenBase GoldenDune = (new BiomeGenGoldenDune(6000)).setBiomeName("0");
public void load()
{
ModLoader.addBiome(GoldenDune);
}
public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
{
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
WorldGenBigTree tree = new WorldGenBigTree(false);
if(biome instanceof BiomeGenGoldenDune)
{
for(int x = 0; x < 8; x++)
{
tree = new WorldGenBigTree(false);
int Xcoord = chunkX + rand.nextInt(16);
int Zcoord = chunkZ + rand.nextInt(16);
int i = world.getHeightValue(Xcoord, Zcoord);
tree.generate(world, rand, Xcoord, i, Zcoord);
}
}
}
public String getVersion()
{
return "3.14159265";
}
}
BiomeGenGoldenDune
import java.util.Random;
public class BiomeGenGoldenDune extends BiomeGenBase
{
public BiomeGenGoldenDune(int par1)
{
super(par1);
this.spawnableCreatureList.clear();
this.spawnableMonsterList.clear();
this.spawnableWaterCreatureList.clear();
this.topBlock = (byte)Block.blockGold.blockID;
this.fillerBlock = (byte)Block.blockGold.blockID;
this.minHeight = 9.0F;
this.maxHeight = 10.0F;
}
}
It's fine. Forgetting the mod_*** I mean.
I can't try it on my computer yet, but I have a few guesses. First, 6000 for the BiomeGennumber is too high. also you have
(new BiomeGenGoldenDune(6000))
in parenthesis which you don't need(change this)
I'm not sure that WorldGenBigTree is a tree. but I haven't tried this on my computer yet, so actually don't change that and give me maybe thirty minutes.