我從塊中製作了一個工具,我在代碼中沒有犯錯。當我嘗試點擊構建時,它給了我這個終端錯誤: 我該如何解決這個問題?請。 下面是RecipesTools.addRecipes使用Eclipse的Minecraft的Mod在運行時出現錯誤
package net.minecraft.src;
public class RecipesTools
{
private String recipePatterns[][] =
{
{
"XXX", " # ", " # "
}, {
"X", "#", "#"
}, {
"XX", "X#", " #"
}, {
"XX", " #", " #"
}
};
private Object recipeItems[][];
public RecipesTools()
{
recipeItems = (new Object[][]
{
new Object[] {
Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold, Block.RadiatedStone
}, new Object[] {
Item.pickaxeWood, Item.pickaxeStone, Item.pickaxeSteel, Item.pickaxeDiamond, Item.pickaxeGold, Item.pickaxeRadiated
}, new Object[] {
Item.shovelWood, Item.shovelStone, Item.shovelSteel, Item.shovelDiamond, Item.shovelGold
}, new Object[] {
Item.axeWood, Item.axeStone, Item.axeSteel, Item.axeDiamond, Item.axeGold
}, new Object[] {
Item.hoeWood, Item.hoeStone, Item.hoeSteel, Item.hoeDiamond, Item.hoeGold
}
});
}
public void addRecipes(CraftingManager craftingmanager)
{
for (int i = 0; i < recipeItems[0].length; i++)
{
Object obj = recipeItems[0][i];
for (int j = 0; j < recipeItems.length - 1; j++)
{
Item item = (Item)recipeItems[j + 1][i];
craftingmanager.addRecipe(new ItemStack(item), new Object[]
{
recipePatterns[j], Character.valueOf('#'), Item.stick, Character.valueOf('X'), obj
});
}
}
craftingmanager.addRecipe(new ItemStack(Item.shears), new Object[]
{
" #", "# ", Character.valueOf('#'), Item.ingotIron
});
}
}
編輯 我也給的RAM 1024MB的Eclipe和刪除了我.Minecraft文件夾中的代碼。
CONFLICT @ 22
27 achievements
Exception in thread "main" java.lang.ExceptionInInitializerError
at net.minecraft.src.StatList.initCraftableStats(StatList.java:74)
at net.minecraft.src.StatList.initBreakableStats(StatList.java:55)
at net.minecraft.src.Block.<clinit>(Block.java:975)
at net.minecraft.src.TextureWaterFX.<init>(TextureWaterFX.java:13)
at net.minecraft.client.Minecraft.<init>(Minecraft.java:205)
at net.minecraft.src.MinecraftImpl.<init>(MinecraftImpl.java:13)
at net.minecraft.client.Minecraft.startMainThread(Minecraft.java:1984)
at net.minecraft.client.Minecraft.startMainThread1(Minecraft.java:1970)
at net.minecraft.client.Minecraft.main(Minecraft.java:2032)
at Start.main(Start.java:25)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 5
at net.minecraft.src.RecipesTools.addRecipes(RecipesTools.java:44)
at net.minecraft.src.CraftingManager.<init>(CraftingManager.java:19)
at net.minecraft.src.CraftingManager.<clinit>(CraftingManager.java:8)
... 10 more
我幾乎沒有編輯這個從原來的Minecraft代碼 – user1162004
當我幾乎沒有編輯我的類來指代'Strrrrring'它不編譯... –
我試圖解釋爲什麼我的集合類型是他們的方式 – user1162004