Edit: Ich hab nun probiert meinen ersten Block zu erstellen, aber wenn ich versuche den Block zu finden bzw. zu craften passiert nichts. Bei Eclipse bekomm ich auch keine Fehlermeldungen.
Hier wär der Code:
Code:
package net.minecraft.src;
import java.util.Random;
public class firstblock extends BaseMod {
public static final Block sandblue;
static {
//Block
sandblue = new Block (240, 0, Material.sand).setHardness(1F).setBlockName("sandblue");
//Register
ModLoader.registerBlock(sandblue);
//Name
ModLoader.addName(sandblue, "sandblue");
//Texture
sandblue.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/SandBlue.png");
}
public void load () {
//Crafting
ModLoader.addShapelessRecipe(new ItemStack(sandblue,1), new Object []
{
Block.dirt
});
}
public String getVersion() {
return "1.3.2";
}
public void generateSurface (World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < (10); i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(60);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(sandblue.blockID, 20)).generate(world, rand, randPosX, randPosZ, randPosY);
}
}
}
Ich hab auch noch eine Texture erstellt, die SandBlue.jpg heißt, das hab ich auch in die minecraft.jar eingefügt.
Ich denk aber es liegt eher an dem decompile, denn dort steht immer folgendes:
[Only registered and activated users can see links. Click Here To Register...]
Ich hoffe jemand kann mir helfen. :(