我昨天在我的《我的世界》Mod编程时遇到了一个问题。
下面是代码:
主要的java类
package com.enricobilla.tempercraft;
import com.enricobilla.tempercraft.creativeTab.MyCreativeTab;
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.MOD_VERSION)
public class TemperCraft {
public static final MyCreativeTab tabTemperCraft = new MyCreativeTab("tabTemperCraft");
... other code ...
}
和MyCreativeTab。java类
package com.enricobilla.tempercraft.creativeTab;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public abstract class MyCreativeTab extends CreativeTabs {
public MyCreativeTab(String label) {
super(label);
this.setBackgroundImageName("tab_tempercraft.png");
}
}
所以,我的问题是Eclipse报告我“无法实例化类型MyCreativeTab”
new MyCreativeTab("tabTemperCraft)
在Main。java和我不知道为什么。。。
我已经在网上看过了,但任何人都有同样的问题。
有人能帮我吗?谢谢