Jump to content

Help
Latest News Article

[Tutorial] Modding with MCP and Modloader Videos [Blocks][1.0.0]


170 replies to this topic

#41

    eejin

    Carpenter

  • Members
  • 65 posts

Posted 13 May 2011 - 07:53 PM

Give us the full code please ?

Register or log in to remove.

#42

  • Minecraft: JoshJ5Hawk

Posted 13 May 2011 - 07:59 PM

eejin said:

Give us the full code please ?
I did give you the full code, in the original post o.O

#43

  • Minecraft: JoshJ5Hawk

Posted 13 May 2011 - 07:59 PM

Tjaden said:

OK so, I have made two blocks the second block can only be created by combining the first block with another material. When I defined the name for the first block in the recipe for the second block I get this error:

== MCP v3.1 ==
> Recompiling client...
javac.exe -g -verbose -classpath "jars/bin/minecraft.jar;jars/bin/jinput.jar;jar
s/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecr
aft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minecraft\isom\*
.java src/minecraft\net\minecraft\src\*.java  conf/patches/*.java failed.
Return code : 1

== ERRORS FOUND ==

src\minecraft\net\minecraft\src\mod_Fireproofplank.java:12: cannot find symbol
symbol  : variable FireproofwooD
location: class net.minecraft.src.Block
{"X", "#", Character.valueOf('X'), Block.FireproofwooD, Character.valueOf('#'),
Item.redstone});
^

1 error
==================

> Done in 3.88 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .

I have tried so many different syntaxes case sensitivitys and so on, Also this happens on some items which are by default already in the game.

Anyone know what to do?
Block.FireproofwooD
remove the Block. =]
and make it fireproofwood

#44

    Tjaden

    Iron Miner

  • Members
  • 339 posts

Posted 13 May 2011 - 08:07 PM

Joshj5hawk said:

Tjaden said:

OK so, I have made two blocks the second block can only be created by combining the first block with another material. When I defined the name for the first block in the recipe for the second block I get this error:

== MCP v3.1 ==
> Recompiling client...
javac.exe -g -verbose -classpath "jars/bin/minecraft.jar;jars/bin/jinput.jar;jar
s/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecr
aft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minecraft\isom\*
.java src/minecraft\net\minecraft\src\*.java  conf/patches/*.java failed.
Return code : 1

== ERRORS FOUND ==

src\minecraft\net\minecraft\src\mod_Fireproofplank.java:12: cannot find symbol
symbol  : variable FireproofwooD
location: class net.minecraft.src.Block
{"X", "#", Character.valueOf('X'), Block.FireproofwooD, Character.valueOf('#'),
Item.redstone});
^

1 error
==================

> Done in 3.88 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .

I have tried so many different syntaxes case sensitivitys and so on, Also this happens on some items which are by default already in the game.

Anyone know what to do?
Block.FireproofwooD
remove the Block. =]
and make it fireproofwood


Ok I tried this and it didnt work :log:

Here is my actual code for both blocks, I also have the blockFireproofwood and blockFireproofplank files, but I don't think they would need anything new.

mod_Fireproofwood:
package net.minecraft.src;

import java.util.Random;

public class mod_Fireproofwood extends BaseMod
{
   public mod_Fireproofwood()
   {
      ModLoader.RegisterBlock(Fireproofwood);
      ModLoader.AddName(Fireproofwood, "Fire Proofed Wood");
      ModLoader.AddRecipe(new ItemStack(Fireproofwood, 2), new Object[] {
         "X", "#", Character.valueOf('X'), Block.sapling, Character.valueOf('#'), Item.redstone
      });
   }
   
   public static Block Fireproofwood;
   
   static
   {
      Fireproofwood = new BlockFireproofwood(109, ModLoader.addOverride("/terrain.png", "/tjaden/blocks/trunk.png")).setHardness(0.6F).setResistance(2.0F).setBlockName("Fireproofwood");
   }

   public String Version()
   {
      return "Fireproofwood 1.0";
   }
}

And then

mod_Fireproofplank:
package net.minecraft.src;

import java.util.Random;

public class mod_Fireproofplank extends BaseMod
{
   public mod_Fireproofplank()
   {
      ModLoader.RegisterBlock(Fireproofplank);
      ModLoader.AddName(Fireproofplank, "Fire Proofed Plank");
	  ModLoader.AddRecipe(new ItemStack(Fireproofplank, 4), new Object[] {
          "#X#", Character.valueOf('#'), Fireproofwood, Character.valueOf('X'), Item.redstone
       });
    }
	   
   public static Block Fireproofplank;
   
   static
   {
      Fireproofplank = new BlockFireproofplank(110, ModLoader.addOverride("/terrain.png", "/tjaden/blocks/wood.png")).setHardness(0.5F).setResistance(0.5F).setBlockName("Fireproofplank");
   }

   public String Version()
   {
      return "Fireproofplank 1.0";
   }
}

And whatever i type in that recipe it comes up in the error log:
package net.minecraft.src;

import java.util.Random;

public class mod_Fireproofplank extends BaseMod
{
   public mod_Fireproofplank()
   {
      ModLoader.RegisterBlock(Fireproofplank);
      ModLoader.AddName(Fireproofplank, "Fire Proofed Plank");
	  ModLoader.AddRecipe(new ItemStack(Fireproofplank, 4), new Object[] {
          "#X#", Character.valueOf('#'), Fireproofwood, Character.valueOf('X'), Item.redstone
       });
    }
	   
   public static Block Fireproofplank;
   
   static
   {
      Fireproofplank = new BlockFireproofplank(110, ModLoader.addOverride("/terrain.png", "/tjaden/blocks/wood.png")).setHardness(0.5F).setResistance(0.5F).setBlockName("Fireproofplank");
   }

   public String Version()
   {
      return "Fireproofplank 1.0";
   }
}

This is so annoyying, I'm having to make the second material out of a basic item for the time being.
Posted Image

#45

  • Minecraft: JoshJ5Hawk

Posted 13 May 2011 - 08:18 PM

Tjaden said:

-snip-

This is so annoyying, I'm having to make the second material out of a basic item for the time being.
You don't need two mod_ files =] and make sure your Block files are BlockBlah.java

#46

  • Location: Canada

Posted 13 May 2011 - 08:19 PM

This is really good! Keep up the AWESOME work!! Really helpful!

#47

    Tjaden

    Iron Miner

  • Members
  • 339 posts

Posted 13 May 2011 - 08:32 PM

Joshj5hawk said:

Tjaden said:

-snip-

This is so annoyying, I'm having to make the second material out of a basic item for the time being.
You don't need two mod_ files =] and make sure your Block files are BlockBlah.java


Sorry it's still quite not working, this is my compile log now:
== MCP v3.1 ==
> Recompiling client...
javac.exe -g -verbose -classpath "jars/bin/minecraft.jar;jars/bin/jinput.jar;jar
s/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecr
aft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minecraft\isom\*
.java src/minecraft\net\minecraft\src\*.java  conf/patches/*.java failed.
Return code : 1

== ERRORS FOUND ==

src\minecraft\net\minecraft\src\mod_Fireproofwood.java:29: class mod_Fireproofpl
ank is public, should be declared in a file named mod_Fireproofplank.java
public class mod_Fireproofplank extends BaseMod
^

src\minecraft\net\minecraft\src\mod_Fireproofwood.java:36: cannot find symbol
symbol  : variable fireproofwood
location: class net.minecraft.src.mod_Fireproofplank
"#X#", Character.valueOf('#'), fireproofwood, Character.valueOf('X'), Item.redst
one
^

2 errors
==================

> Done in 2.57 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .

And then this is the one mod_Fireproofwood file:
package net.minecraft.src;

import java.util.Random;

public class mod_Fireproofwood extends BaseMod
{
   public mod_Fireproofwood()
   {
      ModLoader.RegisterBlock(Fireproofwood);
      ModLoader.AddName(Fireproofwood, "Fire Proof Wood");
      ModLoader.AddRecipe(new ItemStack(Fireproofwood, 2), new Object[] {
         "X", "#", Character.valueOf('X'), Block.sapling, Character.valueOf('#'), Item.redstone
      });
   }
   
   public static Block Fireproofwood;
   
   static
   {
      Fireproofwood = new BlockFireproofwood(109, ModLoader.addOverride("/terrain.png", "/tjaden/blocks/trunk.png")).setHardness(0.6F).setResistance(2.0F).setBlockName("Fireproofwood");
   }

   public String Version()
   {
      return "Fireproofwood 1.0";
   }
}

public class mod_Fireproofplank extends BaseMod
{
   public mod_Fireproofplank()
   {
      ModLoader.RegisterBlock(Fireproofplank);
      ModLoader.AddName(Fireproofplank, "Fire Proofed Plank");
	  ModLoader.AddRecipe(new ItemStack(Fireproofplank, 4), new Object[] {
          "#X#", Character.valueOf('#'), fireproofwood, Character.valueOf('X'), Item.redstone
       });
    }
	   
   public static Block Fireproofplank;
   
   static
   {
      Fireproofplank = new BlockFireproofplank(110, ModLoader.addOverride("/terrain.png", "/tjaden/blocks/wood.png")).setHardness(0.5F).setResistance(0.5F).setBlockName("Fireproofplank");
   }

   public String Version()
   {
      return "Fireproofplank 1.0";
   }
}

And then the two Block files are called:


"BlockFireproofwood.java"
"BlockFireproofplank.java"

Sorry this is turning out to be a right pain.
Posted Image

#48

  • Minecraft: JoshJ5Hawk

Posted 13 May 2011 - 09:08 PM

Tjaden said:

Joshj5hawk said:

Tjaden said:

-snip-

This is so annoyying, I'm having to make the second material out of a basic item for the time being.
You don't need two mod_ files =] and make sure your Block files are BlockBlah.java


Sorry it's still quite not working, this is my compile log now:
== MCP v3.1 ==
> Recompiling client...
javac.exe -g -verbose -classpath "jars/bin/minecraft.jar;jars/bin/jinput.jar;jar
s/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecr
aft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minecraft\isom\*
.java src/minecraft\net\minecraft\src\*.java  conf/patches/*.java failed.
Return code : 1

== ERRORS FOUND ==

src\minecraft\net\minecraft\src\mod_Fireproofwood.java:29: class mod_Fireproofpl
ank is public, should be declared in a file named mod_Fireproofplank.java
public class mod_Fireproofplank extends BaseMod
^

src\minecraft\net\minecraft\src\mod_Fireproofwood.java:36: cannot find symbol
symbol  : variable fireproofwood
location: class net.minecraft.src.mod_Fireproofplank
"#X#", Character.valueOf('#'), fireproofwood, Character.valueOf('X'), Item.redst
one
^

2 errors
==================

> Done in 2.57 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .

And then this is the one mod_Fireproofwood file:
package net.minecraft.src;

import java.util.Random;

public class mod_Fireproofwood extends BaseMod
{
   public mod_Fireproofwood()
   {
      ModLoader.RegisterBlock(Fireproofwood);
      ModLoader.AddName(Fireproofwood, "Fire Proof Wood");
      ModLoader.AddRecipe(new ItemStack(Fireproofwood, 2), new Object[] {
         "X", "#", Character.valueOf('X'), Block.sapling, Character.valueOf('#'), Item.redstone
      });
   }
   
   public static Block Fireproofwood;
   
   static
   {
      Fireproofwood = new BlockFireproofwood(109, ModLoader.addOverride("/terrain.png", "/tjaden/blocks/trunk.png")).setHardness(0.6F).setResistance(2.0F).setBlockName("Fireproofwood");
   }

   public String Version()
   {
      return "Fireproofwood 1.0";
   }
}

public class mod_Fireproofplank extends BaseMod
{
   public mod_Fireproofplank()
   {
      ModLoader.RegisterBlock(Fireproofplank);
      ModLoader.AddName(Fireproofplank, "Fire Proofed Plank");
	  ModLoader.AddRecipe(new ItemStack(Fireproofplank, 4), new Object[] {
          "#X#", Character.valueOf('#'), fireproofwood, Character.valueOf('X'), Item.redstone
       });
    }
	   
   public static Block Fireproofplank;
   
   static
   {
      Fireproofplank = new BlockFireproofplank(110, ModLoader.addOverride("/terrain.png", "/tjaden/blocks/wood.png")).setHardness(0.5F).setResistance(0.5F).setBlockName("Fireproofplank");
   }

   public String Version()
   {
      return "Fireproofplank 1.0";
   }
}

And then the two Block files are called:


"BlockFireproofwood.java"
"BlockFireproofplank.java"

Sorry this is turning out to be a right pain.
Not a problem at =] I'll help out more when I get home from work =]

#49

Posted 13 May 2011 - 09:30 PM

Well i just wanted to thankyou personally. Lets just say i have a difficult modding exsperiance so far. I have looked on another tuts, well they explain what everything does, but it so happens it never works. I have a basis and cant wait for the ore generation. So i can start on my first major mod, and then im going to help out with naturecraft, which is a work in progress. When i get better i am hoping to make a tornado mod, that will be awsome. Im sure if you really tried u could make one right :Notch:

#50

    eejin

    Carpenter

  • Members
  • 65 posts

Posted 13 May 2011 - 09:33 PM

Realy waiting till you make a mob creation tutorial :D You will get a diamond :)

#51

Posted 13 May 2011 - 11:37 PM

Well one of the errors that you had tjaden is that you messed up a capital letter, apperatly you put (fire) when it should be (Fire)

#52

Posted 14 May 2011 - 01:04 AM

Can you get out the custom mineral generation tut next

#53

Posted 14 May 2011 - 01:11 AM

I followed the tutorial exactly (or at least... I think I did) and get 4 errors where you in the vid dont get any?
== MCP v3.1 ==
> Recompiling client...
"C:\Program Files\Java\jdk1.6.0_20\bin\javac.exe" -g -verbose -classpath "jars/b
in/minecraft.jar;jars/bin/jinput.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar"
 -sourcepath src/minecraft -d bin/minecraft src/minecraft\net\minecraft\client\*
.java src/minecraft\net\minecraft\isom\*.java src/minecraft\net\minecraft\src\*.
java  conf/patches/*.java failed.
Return code : 1

== ERRORS FOUND ==

src\minecraft\net\minecraft\src\mod_ImpureDiamond.java:5: cannot find symbol
symbol: class BaseMod
public class mod_ImpureDiamond extends BaseMod
^

src\minecraft\net\minecraft\src\mod_ImpureDiamond.java:16: cannot find symbol
symbol  : class Block
location: class net.minecraft.source.mod_ImpureDiamond
public static Block impurediamond;
^

src\minecraft\net\minecraft\src\mod_ImpureDiamond.java:5: duplicate class: net.m
inecraft.source.mod_ImpureDiamond
public class mod_ImpureDiamond extends BaseMod
^

src\minecraft\net\minecraft\src\BlockImpureDiamond.java:13: cannot access net.mi
necraft.src.mod_ImpureDiamond
bad class file: src\minecraft\net\minecraft\src\mod_ImpureDiamond.java
file does not contain class net.minecraft.src.mod_ImpureDiamond
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
return mod_ImpureDiamond.ImpureDiamond.blockID;
^

4 errors
==================

> Done in 2.36 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .


help would be appreciated, but its still a good tutorial (I like how its a vid so we can follow everything you do and do the same for ours)

EDIT: fixed it, I must have screwed something up in the coding, because I copied yours into mine and just changed names and it worked fine...

EDIT2: Thanks so much for the tut, it got me started into modding :D viewtopic.php?f=1032&t=348736

Thank you for the tutorial.
Posted Image
Help the little guy hatch?

#54

  • Location: Canada

Posted 14 May 2011 - 05:03 AM

Uhh, welll see here, I've a problem. I used your Box as a template, and my block recompiles nicely, but when I go to
reobfuscate it, it freaks out and gives me this. :S

Posted Image

Any ideas?
I'm going to try redownloading MCP and some other stuff... :S

#55

  • Minecraft: JoshJ5Hawk

Posted 14 May 2011 - 05:19 AM

MiniatureLimo said:

Uhh, welll see here, I've a problem. I used your Box as a template, and my block recompiles nicely, but when I go to
reobfuscate it, it freaks out and gives me this. :S

Posted Image

Any ideas?
I'm going to try redownloading MCP and some other stuff... :S
Yea, I'd try redling MCP because I've honestly never seen that error before =\

#56

  • Location: Canada

Posted 14 May 2011 - 05:42 AM

Ok, i redl'd MCP, and had to recode it due to an unforseen error.
Me being a complete idiot.

Now it sits at 1 error, that being it says:

Error Log said:

\src\minecraft\net\minecraft\src\mod_SlimeBlock.java:5: '{' expected
public class mod_SlimeBlock extends BaseMod;

What I can gather is it wants a curved bracket on the " public class mod_[mod name] extends BaseMod; " line, but where?

#57

Posted 14 May 2011 - 07:24 AM

Thank!!! i find here a lot of valuable material about Moddling with MCP and Modloader.

#58

    eejin

    Carpenter

  • Members
  • 65 posts

Posted 14 May 2011 - 09:08 AM

For other tutorials what about making a new ore or maybe mobs ?

#59

  • Minecraft: JoshJ5Hawk

Posted 14 May 2011 - 04:08 PM

eejin said:

For other tutorials what about making a new ore or maybe mobs ?
I'm not 100% sure without seeing you're code, but I THINK that you need it on the line under it, or you may even have an extra one. Show me your code when you get a chance and I'll let you know =]

#60

Posted 14 May 2011 - 04:27 PM

Joshj5hawk said:

eejin said:

For other tutorials what about making a new ore or maybe mobs ?
I'm not 100% sure without seeing you're code, but I THINK that you need it on the line under it, or you may even have an extra one. Show me your code when you get a chance and I'll let you know =]

i think he was suggesting that you make more tutorials about making a new ore or making new mobs
Posted Image
Help the little guy hatch?