Also, you should keep an archive of the older tutorials, because people (like me) who use forge, still need them as forge has not yet updated.
I would do that except that I am already at the line limit for the first post on this topic. I don't want to host code on something like PasteBin aswell.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Im trying to make my block smelt in to dirt but i get an error on shiftedIndex help.
ModLoader.addSmelting(orange.shiftedIndex, new ItemStack(Block.dirt, 1));
No error = no help.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
SO I have this item and when I try to spawn it doesn't spawn.
package net.minecraft.src;
public class mod_MoreWeapons extends BaseMod
{
public static final Item chain= new Item(204).setItemName("Chain");
public void load()
{
chain.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/chain.png");
ModLoader.addName(chain, "Chain");
ModLoader.addRecipe(new ItemStack(chain, 1), new Object [] {"#", "#", Character.valueOf('#'), Item.ingotIron});
}
public String getVersion()
{
return "1.3.1";
}
}
Spawning items on servers is a bit different. Try adding or subtracting 256 from your id and it should spawn it. Also change the id outside of the range that should be reserved for blocks (0 - 255).
public static final Item chocmilk = new ItemBucketChocMilk(165).setItemName("Bucket of Chocolate Milk");
package net.minecraft.src;
public class mod_MoreWeapons extends BaseMod
{
public static final Item chain = new Item(204).setItemName("Chain");
public void load()
{
chain.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/chain.png");
ModLoader.addName(chain, "Chain");
ModLoader.addRecipe(new ItemStack(chain, 1), new Object [] {"#", "#", Character.valueOf('#'), Item.ingotIron});
}
public String getVersion()
{
return "1.3.1";
}
}
There is no way in hell that will work. Why would you move a declaration outside of the class brackets and the package declaration? That will just cause more problems.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
where is this new modloader link? i went to the official thread and downloaded it and put its contents into my minecraft.jar and my ores and structures still wont generate.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
What changed for tool tuts? Then I know which files I have to update.
Sorry, the tutorial isn't updated yet. I changed its colour by mistake. It should be updated within the next 24-48 hours.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
As I suspected, I ran minecraft with my mod and it crashed.
The error:
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Exception occured in ModLoader
This error has been saved to /Users/raywendt/Library/Application Support/minecraft/crash-reports/crash-2012-08-11_14.18.51-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 7a02804c --------
Generated 8/11/12 2:18 PM
- Minecraft Version: 1.3.1
- Operating System: Mac OS X (i386) version 10.7.4
- Java Version: 1.6.0_33, Apple Inc.
- Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Apple Inc.
- Memory: 501802632 bytes (478 MB) / 535232512 bytes (510 MB) up to 1070399488 bytes (1020 MB)
- JVM Flags: 3 total; -Xbootclasspath/a:/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources/LauncherSupport.jar -Xms512M -Xmx1024M
- ModLoader: Mods loaded: 1
ModLoader 1.3.1
java.lang.ClassFormatError: Incompatible magic value 1885430635 in class file mod_Geology
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at ModLoader.addMod(ModLoader.java:319)
at ModLoader.readFromClassPath(ModLoader.java:1317)
at ModLoader.init(ModLoader.java:915)
at ModLoader.addAllRenderers(ModLoader.java:169)
at avx.<init>(RenderManager.java:86)
at avx.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.a(SourceFile:260)
at net.minecraft.client.Minecraft.run(SourceFile:516)
at java.lang.Thread.run(Thread.java:680)
--- END ERROR REPORT 53c58ad6 ----------
The files:
BlockGranite
package net.minecraft.src;
import java.util.Random;
public class BlockGranite extends Block
{
public BlockGranite(int i, int j)
{
super(i,j,Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.granite.blockID
}
public int quantityDropped(Random random)
{
return 1;
}
}
mod_Geology
package net.minecraft.src;
public class mod_Geology extends BaseMod
{
public static final Block granite = new BlockGranite(160,0).setBlockName("granite").setHardness(3F).setResistance(4F);
public void load()
{
granite.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/geology/granite.png");
ModLoader.registerBlock(granite);
ModLoader.addName(granite, "Granite");
ModLoader.addRecipe(new ItemStack(granite, 1), new Object [] {"#",Character.valueOf('#'),Block.dirt});
}
public String getVersion()
{
return "0.1";
}
}
The Meaning of Life, the Universe, and Everything.
Join Date:
7/1/2012
Posts:
76
Minecraft:
Nukeannihilation
Member Details
Ok, so I followed the updated half-slab tutorial and im stuck here, this is the only error I get out of all of it.
The constructor Blockmod_PslabD(int, boolean) is undefined
MCP gives me:
== MCP 7.0 (data: 7.0a, client: 1.3.1, server: 1.3.1) ==
# found jad, ff, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs
, param csvs, renumber csv, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_05\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Pslab.java:7: error: constructor Blockmod_Ps
labD in class Blockmod_PslabD cannot be applied to given types;
public static final Block PslabD = new Blockmod_PslabD(251,true).setBloc
kName("Pavement Double Slab").setHardness(4.5F).setResistance(20F);
^
required: int,int
found: int,boolean
reason: actual argument boolean cannot be converted to int by method invocatio
n conversion
1 error
==================
== Recompiling server ==
> Cleaning bin
> Recompiling
- Done in 10.66 seconds
Press any key to continue . . .
this is my code:
mod_***
package net.minecraft.src;
public class mod_Pslab extends BaseMod
{
public static final Block Pslab1 = new Blockmod_Pslab(250,false).setBlockName("Pavement Slab").setHardness(4.5F).setResistance(20F);
public static final Block PslabD = new Blockmod_PslabD(251,true).setBlockName("Pavement Double Slab").setHardness(4.5F).setResistance(20F);
public void load()
{
Pslab1.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/Pavement/Pavement.png");
ModLoader.registerBlock(Pslab1);
ModLoader.addName(Pslab1, "Pavement Slab");
ModLoader.addRecipe(new ItemStack(Pslab1,18), new Object []
{
"##","CC",Character.valueOf('#'),Block.sand,('C'),Block.cobblestone
});
}
public String getVersion()
{
return "1.3.1";
}
}
Blockmod_***
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class Blockmod_Pslab extends BlockHalfSlab
{
public Blockmod_Pslab(int par1, boolean par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
setLightOpacity(0);
}
public int getBlockTextureFromSide(int par1)
{
return blockIndexInTexture;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_Pslab.Pslab1.blockID;
}
public void onBlockPacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
if(par1World.getBlockId(par2, par3 - 1, par4) == mod_Pslab.Pslab1.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
par1World.setBlockWithNotify(par2, par3 -1, par4, mod_Pslab.PslabD.blockID);
}
}
protected ItemStack createStackedBlock(int par1)
{
return new ItemStack(mod_Pslab.Pslab1.blockID, 2, par1 & 7);
}
public String getFullSlabName(int var1)
{
return null;
}
}
Ok, so I followed the updated half-slab tutorial and im stuck here, this is the only error I get out of all of it.
The constructor Blockmod_PslabD(int, boolean) is undefined
MCP gives me:
== MCP 7.0 (data: 7.0a, client: 1.3.1, server: 1.3.1) ==
# found jad, ff, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs
, param csvs, renumber csv, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_05\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Pslab.java:7: error: constructor Blockmod_Ps
labD in class Blockmod_PslabD cannot be applied to given types;
public static final Block PslabD = new Blockmod_PslabD(251,true).setBloc
kName("Pavement Double Slab").setHardness(4.5F).setResistance(20F);
^
required: int,int
found: int,boolean
reason: actual argument boolean cannot be converted to int by method invocatio
n conversion
1 error
==================
== Recompiling server ==
> Cleaning bin
> Recompiling
- Done in 10.66 seconds
Press any key to continue . . .
this is my code:
mod_***
package net.minecraft.src;
public class mod_Pslab extends BaseMod
{
public static final Block Pslab1 = new Blockmod_Pslab(250,false).setBlockName("Pavement Slab").setHardness(4.5F).setResistance(20F);
public static final Block PslabD = new Blockmod_PslabD(251,true).setBlockName("Pavement Double Slab").setHardness(4.5F).setResistance(20F);
public void load()
{
Pslab1.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/Pavement/Pavement.png");
ModLoader.registerBlock(Pslab1);
ModLoader.addName(Pslab1, "Pavement Slab");
ModLoader.addRecipe(new ItemStack(Pslab1,18), new Object []
{
"##","CC",Character.valueOf('#'),Block.sand,('C'),Block.cobblestone
});
}
public String getVersion()
{
return "1.3.1";
}
}
Blockmod_***
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class Blockmod_Pslab extends BlockHalfSlab
{
public Blockmod_Pslab(int par1, boolean par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
setLightOpacity(0);
}
public int getBlockTextureFromSide(int par1)
{
return blockIndexInTexture;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_Pslab.Pslab1.blockID;
}
public void onBlockPacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
if(par1World.getBlockId(par2, par3 - 1, par4) == mod_Pslab.Pslab1.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
par1World.setBlockWithNotify(par2, par3 -1, par4, mod_Pslab.PslabD.blockID);
}
}
protected ItemStack createStackedBlock(int par1)
{
return new ItemStack(mod_Pslab.Pslab1.blockID, 2, par1 & 7);
}
public String getFullSlabName(int var1)
{
return null;
}
}
Did I miss something?
You're putting a boolean (the true) where another int should be, that'll never work. It has to be a number.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
To post a comment, please login or register a new account.
I would do that except that I am already at the line limit for the first post on this topic. I don't want to host code on something like PasteBin aswell.
Import Random like shown in the tutorial.
together they are powerful beyond imagination."
PLZ HELP!!!
Look up Equivalent exchange, they have tools and armor that are invincible.
Post a link to your post, I don't have the time to go searching through pages to find a post.
They're still there, just harder to find. I'm sick of people not reading simple yet important notices.
No error = no help.
together they are powerful beyond imagination."
how about this
package net.minecraft.src; import java.util.Random; public class mod_orange extends BaseMod { public static final Block orange = new Blockorange(160, 0).setBlockName("orange").setHardness(3F).setResistance(4F); public void load() { orange.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod/orange.png"); ModLoader.registerBlock(orange); ModLoader.addName(orange, "Walfordite"); ModLoader.addRecipe(new ItemStack(orange, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt}); ModLoader.addSmelting(Block.dirt.shiftedIndex, new ItemStack(orange, 1)); } public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int i = 0; i < 100; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(160); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenMinable(orange.blockID, 10)).generate(world, random, randPosX, randPosY, randPosZ); } } public String getVersion() { return "1.3.1"; } }List of Creative tabs
tabBlock
tabBrewing
tabCombat
tabDeco
tabFood
tabInventory
tabMaterial
tabMisc
tabRedstone
tabTools
tabTransport
Try this.
public class mod_MoreWeapons extends BaseMod { public static final Item chain = new Item(204).setItemName("Chain"); public void load() { chain.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/chain.png"); ModLoader.addName(chain, "Chain"); ModLoader.addRecipe(new ItemStack(chain, 1), new Object [] {"#", "#", Character.valueOf('#'), Item.ingotIron}); } public String getVersion() { return "1.3.1"; } }blockID is used for blocks, not shiftedIndex.
Spawning items on servers is a bit different. Try adding or subtracting 256 from your id and it should spawn it. Also change the id outside of the range that should be reserved for blocks (0 - 255).
Nice reading skills.
There is no way in hell that will work. Why would you move a declaration outside of the class brackets and the package declaration? That will just cause more problems.
together they are powerful beyond imagination."
Nice! That was the same thing I did.
in the ItemNamehereTool.
However, when I did that, eclipse gives me an error.
This is what eclipse says about the error.
What do I have to do?
together they are powerful beyond imagination."
Sorry, the tutorial isn't updated yet. I changed its colour by mistake. It should be updated within the next 24-48 hours.
together they are powerful beyond imagination."
My earlier post:
MCP gives me:
== MCP 7.0 (data: 7.0a, client: 1.3.1, server: 1.3.1) == # found jad, ff, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs , param csvs, renumber csv, astyle, astyle config == Recompiling client == > Cleaning bin > Recompiling '"C:\Program Files\Java\jdk1.7.0_05\bin\javac" -Xlint:-options -deprecation -g - source 1.6 -target 1....' failed : 1 == ERRORS FOUND == src\minecraft\net\minecraft\src\mod_Pslab.java:7: error: constructor Blockmod_Ps labD in class Blockmod_PslabD cannot be applied to given types; public static final Block PslabD = new Blockmod_PslabD(251,true).setBloc kName("Pavement Double Slab").setHardness(4.5F).setResistance(20F); ^ required: int,int found: int,boolean reason: actual argument boolean cannot be converted to int by method invocatio n conversion 1 error ================== == Recompiling server == > Cleaning bin > Recompiling - Done in 10.66 seconds Press any key to continue . . .this is my code:
mod_***
package net.minecraft.src; public class mod_Pslab extends BaseMod { public static final Block Pslab1 = new Blockmod_Pslab(250,false).setBlockName("Pavement Slab").setHardness(4.5F).setResistance(20F); public static final Block PslabD = new Blockmod_PslabD(251,true).setBlockName("Pavement Double Slab").setHardness(4.5F).setResistance(20F); public void load() { Pslab1.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/Pavement/Pavement.png"); ModLoader.registerBlock(Pslab1); ModLoader.addName(Pslab1, "Pavement Slab"); ModLoader.addRecipe(new ItemStack(Pslab1,18), new Object [] { "##","CC",Character.valueOf('#'),Block.sand,('C'),Block.cobblestone }); } public String getVersion() { return "1.3.1"; } }Blockmod_***
package net.minecraft.src; import java.util.List; import java.util.Random; public class Blockmod_Pslab extends BlockHalfSlab { public Blockmod_Pslab(int par1, boolean par2) { super(par1, par2, Material.rock); this.setCreativeTab(CreativeTabs.tabBlock); setLightOpacity(0); } public int getBlockTextureFromSide(int par1) { return blockIndexInTexture; } public int idDropped(int par1, Random par2Random, int par3) { return mod_Pslab.Pslab1.blockID; } public void onBlockPacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { if(par1World.getBlockId(par2, par3 - 1, par4) == mod_Pslab.Pslab1.blockID) { par1World.setBlockWithNotify(par2, par3, par4, 0); par1World.setBlockWithNotify(par2, par3 -1, par4, mod_Pslab.PslabD.blockID); } } protected ItemStack createStackedBlock(int par1) { return new ItemStack(mod_Pslab.Pslab1.blockID, 2, par1 & 7); } public String getFullSlabName(int var1) { return null; } }Did I miss something?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffYou're putting a boolean (the true) where another int should be, that'll never work. It has to be a number.