MC Modding
Please register and join the community!


Join the forum, it's quick and easy

MC Modding
Please register and join the community!
MC Modding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[1.8.1] Block

+6
ikke009
noctisbeta
mastereric
bottz2
TheCodeNewbie
Strengthowns
10 posters

Go down

[1.8.1] Block Empty [1.8.1] Block

Post by Strengthowns Wed Jun 15, 2011 5:48 am

Block

Spoiler:

[size="4"]SMP Block[/size]

Spoiler:
Strengthowns
Strengthowns
Admin

Posts : 79
Join date : 2011-06-14
Location : Right here!

http://www.mcmodding.4umer.com

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by TheCodeNewbie Tue Oct 25, 2011 1:18 pm

I posted this in the mc forums but no one replied so yeah, I'm getting this error when I try to recompile my block files:
Code:

== MCP v4.4 ==
> Recompiling client...
"C:\Program Files (x86)\Java\jdk1.7.0\bin\javac.exe" -g -source 1.6 -target 1.6
-classpath "lib/;lib/*;jars/bin/minecraft.jar;jars/bin/jinput.jar;jars/bin/lwjgl
.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecraft src/min
ecraft\net\minecraft\client\*.java src/minecraft\net\minecraft\isom\*.java src/m
inecraft\net\minecraft\src\*.java  conf/patches/*.java failed.
Return code : 1

== ERRORS FOUND ==

warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\Blockburner.java:8: error: invalid method declar
ation; return type required
public Blockburner(int i, int j)
^

src\minecraft\net\minecraft\src\mod_burner.java:12: error: <identifier> expected

public mod_burner)
^

2 errors
1 warning
==================

> Done in 2.31 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .
Any help?

EDIT: I fixed the second error, it just need an opening bracket.... derp. Would still appreciate any help on the first error =D

TheCodeNewbie
Member

Posts : 6
Join date : 2011-10-25

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by Strengthowns Wed Oct 26, 2011 1:29 am

Post this in the "Help" section.
Strengthowns
Strengthowns
Admin

Posts : 79
Join date : 2011-06-14
Location : Right here!

http://www.mcmodding.4umer.com

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by bottz2 Fri Oct 28, 2011 2:20 am

hey how do i make like a workbench or a chest

bottz2
Member

Posts : 14
Join date : 2011-10-24

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by mastereric Fri Oct 28, 2011 2:42 pm

bottz2 wrote:hey how do i make like a workbench or a chest
Copy-paste code from the workbench/chest's class file
mastereric
mastereric
Member

Posts : 30
Join date : 2011-10-26

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by bottz2 Sat Oct 29, 2011 2:12 am

its hard to understand though

bottz2
Member

Posts : 14
Join date : 2011-10-24

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by noctisbeta Thu Nov 03, 2011 11:36 pm

How do I make a block I made drop an item I made. I watched some tutorials and it says I have to type in
return mod_namehere.itemnamehere.shiftedIndex;
But I get an error saying that my itemname cannot be resolved or is not a field.
PLEASE HELP!

noctisbeta
Member

Posts : 4
Join date : 2011-11-03

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by ikke009 Fri Nov 04, 2011 9:48 am

of course the mod_namehere needs to be changed to the filename where you registered the item, and itemnamehere needs to be changed to the name of the item.
ikke009
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 29
Location : The netherlands

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by noctisbeta Fri Nov 04, 2011 3:31 pm

That's ok. I got it working, thanks! Now does anyone know what a "nullpointeexecption" is? A pro said it's the fault of my crashes and I don't know what it is or how to fix it. I have it in 3 files so, I really don't know what to do :S

noctisbeta
Member

Posts : 4
Join date : 2011-11-03

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by robinb96 Fri Nov 25, 2011 11:15 pm

Please update Tut to 1.0.0
Thanks Very Happy

robinb96
Member

Posts : 3
Join date : 2011-11-25

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by jesshankin22 Sat Nov 26, 2011 1:00 am

just for the time being, while this is not updated, the new code in MCP for blocks is...:
Code:
package net.minecraft.src;

package net.minecraft.src;

public class mod_Namehere extends BaseMod
{
  public static Block Namehere = new BlockNamehere (190, 0).setHardness(1.0F).setResistance(100.0F).setLightValue(0.0F).setBlockName("Namehere ");
 
  public String getVersion()
  {
      return "1.0.0";
  }
  public void load()
  {
  }
 
 
  public mod_Namehere ()
  {
      ModLoader.RegisterBlock(Namehere );
      Namhere .blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Namehere .png");
      ModLoader.AddName(Namehere , "Namehere ");
      ModLoader.AddRecipe(new ItemStack(Namehere, 1), new Object[] {
      "##", "##", Character.valueOf('#'), Block.dirt
      });
  }
}
and...
Code:
package net.minecraft.src;

import java.util.Random;

public class BlockNamehere extends Block
{

    public BlockNamehere(int i, int j)
    {
        super(i, j, Material.ground);     
    }
    public int idDropped(int i, Random random)
    {
      return mod_Namhere.Namehere.shiftedIndex;
    }
    public int quantityDropped(Random random)
    {
            return 1;
    }
}

jesshankin22
Member

Posts : 47
Join date : 2011-10-24

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by robinb96 Sat Nov 26, 2011 1:14 pm

I get this error when I recompile can someone fix it?
Code:
== ERRORS FOUND ==

src/minecraft/net/minecraft/src/BlockGreenore.java:3: class, interface, or enum expected
package net.minecraft.src;
^

1 error
==================
This are my files:
BlockGreenore.java
Spoiler:
and mod_Greenore.java
Spoiler:

robinb96
Member

Posts : 3
Join date : 2011-11-25

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by jesshankin22 Sat Nov 26, 2011 10:05 pm

oh whoops sorry I didn't post the right code... I must have gone over it twice, it should look like this...
Code:
package net.minecraft.src;

import java.util.Random;

public class Blockrereore extends Block
{

    public Blockrereore(int i, int j)
    {
        super(i, j, Material.ground);     
    }
    public int idDropped(int i, Random random)
    {
      return mod_RERE.rereore.blockID;
    }
    public int quantityDropped(Random random)
    {
            return 1;
    }
}
so just delete your code and replace all the rereores with your name and all the mod names with your name.... sorry about that

jesshankin22
Member

Posts : 47
Join date : 2011-10-24

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by robinb96 Sun Nov 27, 2011 1:06 am

I still get this error
Spoiler:

robinb96
Member

Posts : 3
Join date : 2011-11-25

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by xX_Lirianer_Xx Sun Nov 27, 2011 5:20 am

You wrote "package net.minecraft.src;" twice.
PD: You got the files names wrong if they are the ones you wrote above each code, they should be the other way round.

xX_Lirianer_Xx
Member

Posts : 2
Join date : 2011-11-14

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by Ranga179 Sun Nov 27, 2011 11:36 am

i think smp blocks are the same just you don't need the ModLoader.addName function in the code

Ranga179
Member

Posts : 9
Join date : 2011-10-19
Age : 27

Back to top Go down

[1.8.1] Block Empty Re: [1.8.1] Block

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum