我的super(i, Material.wood)
线路有问题。它说“收缩器调用必须是构造函数中的第一个语句”。我不知道该怎么做或它意味着什么,所以如果你有一个想法或想要测试它并让我知道如何解决它,我将非常感激!
mod_new
package net.minecraft.src;
public class mod_new extends BaseMod {
public static Object ruby;
public mod_new(int i, Material rock) {
super(i, rock);
// TODO Auto-generated constructor stub
}
public static final Block newblock = (new Ruby(243, null).setHardness(3F).setResistance(4F).setLightValue(1-0F).setUnlocalizedName("newblock"));
public static final int blockID = 0;
public void load() {
Ruby ruby = null;
ModLoader.registerBlock(ruby);
ModLoader.addName(ruby, "ruby");
ModLoader.addRecipe(new ItemStack(ruby, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return null;
}
}
mod_Ruby
package net.minecraft.src;
import java.util.Random;
public class Ruby extends Block {
protected Ruby(int par1, Material par2Material) {
super(par1, par2Material);
// TODO Auto-generated constructor stub
}
public static void ruby (int i) {
super(i, Material.wood); // exception here
}
public int idDropped(int i, Random random, int j) {
return mod_new.blockID;
}
public int quantityDropped(Random random) {
return 1;
}
}
如果您注意到其他任何事情或需要知道一些事情,请告诉我。我没有对其他 Minecraft 文件进行任何更改,例如item.java
,除了modloder.java
.