не заметил)
--- Добавлено в 2011-12-22 22:44:25
Еще кое-что. Я попытался создать еще один второй блок, почти полностью скатанный с первого.
Но выдает 2 ошибки, с которыми я еще не встречался. В инете достойного объяснения не нашел.
Коды:
mod_gcc.java
package net.minecraft.src;
import java.util.Random;
public class mod_gcc extends BaseMod
{
public static Block newblock = new BlockNew(101,0).setHardness(0.5F).setResistance(1.0F).setLightValue(1.0F).setBlockName("newblock");
public static Block emeraldblock = new BlockEmerald(102,0).setHardness(0.7F).setResistance(1.8F).setLightValue(5.0F).setBlockName("emeraldblock");
public static final Item emeraldItem = new Emerald(2000).setItemName("emeraldItem");
public String Version()
{
return "1.7_03";
}
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < 150; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(150);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_gcc.newblock.blockID, 32)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public mod_gcc()
{
ModLoader.RegisterBlock(newblock);
ModLoader.AddName(newblock, "Emerald ore");
ModLoader.AddRecipe(new ItemStack(newblock, 1), new Object[]{ "##", "##", Character.valueOf('#'), Block.dirt});
newblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Emerald.png");
ModLoader.RegisterBlock(emeraldblock);
ModLoader.AddName(emeraldblock, "Emerald block");
ModLoader.AddRecipe(new ItemStack(emeraldblock, 1), new Object[]{ "###", "###", "###", Character.valueOf('#'), mod_gcc.emeraldItem});
emeraldblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/emerald_block.png");
emeraldItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/emerald_item.png");
ModLoader.AddName(emeraldItem, "Emerald");
ModLoader.AddRecipe(new ItemStack(emeraldItem, 5), new Object[]{ "X#", "#X", Character.valueOf('X'), Block.dirt});
}
}
BlockEmerald.java
package net.minecraft.src;
import java.util.Random;
public class BlockEmerald extends Block
{
public BlockEmerald(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, int j);
{
return mod_gcc.emeraldblock.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}