我目前在开发第一手编写的mod时遇到了一些问题。我目前使用EclipsePhoton作为我的IDE,在64位机器上运行Windows10Home,有4GB的ram。
这是我的密码:
package com.haxium.basicmod.obsidian.armor;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import com.haxium.basicmod.obsidian.armor.ItemObsidianGeneric;
import com.haxium.basicmod.obsidian.armor.ItemObsidianArmor;
@Mod(modid = ObsidianArmor.MODID, version = ObsidianArmor.VERSION, name = ObsidianArmor.NAME)
public class ObsidianArmor {
public static final String MODID = "obsidian_armor";
public static final String VERSION = "1.7.10-Stable-1.1.0.1";
public static final String NAME = "HaxCraft Obsidian Edition";
//tools
public static Item obsidian_pickaxe;
public static Item obsidian_sword;
public static Item obsidian_ingot;
ToolMaterial obsidian = EnumHelper.addToolMaterial("obsidian", 3, 4500, 10.1F, 4.5F, 10);
//armor
public static Item obsidian_helmet;
public static Item obsidian_chest;
public static Item obsidian_leggings;
public static Item obsidian_boots;
ArmorMaterial hardened_obsidian = EnumHelper.addArmorMaterial("hardened_obsidian", 20, new int[] {3, 7, 6, 3}, 25);
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
//tools
obsidian_pickaxe = new ItemObsidianPickaxe(obsidian, "obsidian_pickaxe");
obsidian_sword = new ItemObsidianSword(obsidian, "obsidian_sword");
obsidian_ingot = new ItemObsidianGeneric("obsidian_ingot");
GameRegistry.registerItem(obsidian_ingot, "Obsidian Ingot");
GameRegistry.registerItem(obsidian_sword, "Obsidian Sword");
GameRegistry.registerItem(obsidian_pickaxe, "Obsidian Pickaxe");
//Armor
obsidian_boots = new ItemObsidianArmor(hardened_obsidian, 3, "obsidian_boots");
obsidian_helmet = new ItemObsidianArmor(hardened_obsidian, 0, "obsidian_helmet");
obsidian_chest = new ItemObsidianArmor(hardened_obsidian, 1, "obsidian_chest");
obsidian_leggings = new ItemObsidianArmor(hardened_obsidian, 2, "obsidian_leggings");
GameRegistry.registerItem(obsidian_helmet, "Obsidian Helmet");
GameRegistry.registerItem(obsidian_chest, "Obsidian Chestplate");
GameRegistry.registerItem(obsidian_leggings, "Obsidian Leggings");
GameRegistry.registerItem(obsidian_boots, "Obsidian Boots");
}
@EventHandler
public void init(FMLInitializationEvent event) {
GameRegistry.addRecipe(new ItemStack(Items.apple, 9),
"XXX",
"XXX",
"XXX",
'X', Blocks.leaves
);
GameRegistry.addRecipe(new ItemStack(ObsidianArmor.obsidian_ingot, 9),
"X",
'X', Blocks.obsidian
);
GameRegistry.addRecipe(new ItemStack(ObsidianArmor.obsidian_pickaxe),
"ABC",
"E",
"H",
'A', ObsidianArmor.obsidian_ingot, 'B', ObsidianArmor.obsidian_ingot, 'C', ObsidianArmor.obsidian_ingot, 'E', Items.stick, 'H', Items.stick
);
GameRegistry.addRecipe(new ItemStack(ObsidianArmor.obsidian_sword),
"B",
"E",
"HI",
'B', ObsidianArmor.obsidian_ingot, 'E', ObsidianArmor.obsidian_ingot, 'H', Items.stick
);
GameRegistry.addRecipe(new ItemStack(ObsidianArmor.obsidian_helmet),
"ABC",
"DF",
'A', ObsidianArmor.obsidian_ingot, 'B', ObsidianArmor.obsidian_ingot, 'C', ObsidianArmor.obsidian_ingot, 'D', ObsidianArmor.obsidian_ingot, 'F', ObsidianArmor.obsidian_ingot
);
GameRegistry.addRecipe(new ItemStack(ObsidianArmor.obsidian_chest),
"AC",
"DEF",
"GHI",
'A', ObsidianArmor.obsidian_ingot, 'C', ObsidianArmor.obsidian_ingot, 'D', ObsidianArmor.obsidian_ingot, 'E', ObsidianArmor.obsidian_ingot, 'F', ObsidianArmor.obsidian_ingot, 'G', ObsidianArmor.obsidian_ingot, 'H', ObsidianArmor.obsidian_ingot, 'I', ObsidianArmor.obsidian_ingot
);
GameRegistry.addRecipe(new ItemStack(ObsidianArmor.obsidian_leggings),
"ABC",
"DF",
"GI",
'A', ObsidianArmor.obsidian_ingot, 'B', ObsidianArmor.obsidian_ingot, 'C', ObsidianArmor.obsidian_ingot, 'D', ObsidianArmor.obsidian_ingot, 'F', ObsidianArmor.obsidian_ingot, 'G', ObsidianArmor.obsidian_ingot, 'I', ObsidianArmor.obsidian_ingot
);
GameRegistry.addRecipe(new ItemStack(ObsidianArmor.obsidian_boots),
"AC",
"DF",
'A', ObsidianArmor.obsidian_ingot, "C", ObsidianArmor.obsidian_ingot, 'D', ObsidianArmor.obsidian_ingot, 'F', ObsidianArmor.obsidian_ingot
);
}
}
关于为什么这一直失败有什么建议吗?如果需要,我确实有崩溃日志的本地副本。
在
GameRegistry.addRecipe(new ItemStack(ObsidianArmor.obsidian_sword),
"B",
"E",
"HI",
'B', ObsidianArmor.obsidian_ingot, 'E', ObsidianArmor.obsidian_ingot, 'H', Items.stick
);
你缺少I
应该是的东西。
在第69行的新代码中,您缺少几个空格来使re ipe平方。你应该总是填写3x3网格。或者确保定义食谱的数组中的每个项包含相等数量的项。
"B " // lacks a space
"E ", // lacks a space
"H ", // proper amount of spaces
在这些崩溃日志中,始终查找将为您提供导致崩溃的类中的行号的类
通用域名格式。哈休姆。基本模式。黑曜岩盔甲。黑曜石。init(ObsidianArmor.java:69)
这给了我们文件ObsidianA中的第69行rmour.java
和顶部的错误
JAVAlang.StringIndexOutOfBoundsException:字符串索引超出范围:7
告诉我们问题在于字符串。字符太少,而不是预期的9个字符。
食谱中的字符形状需要是矩形。如果食谱本身不是矩形,请在不需要物品的地方添加空格。例如,这个:
"ABC",
"E",
"H",
应该是这样的:
"ABC",
" E ",
" H ",
在你所有的食谱中做出改变,错误就会消失。
我使用的是GEOServer2.6.2。 我将GeoFence jar文件添加到~/geoserver/WEB-INF/lib中。 jar文件:、和。 详情:
我正在从ListView迁移到RecyclerView,但是在SQLite中输入一些数据之后,我的列表没有使用notifyDataSetChanged()更新;所以我总是必须调用setAdapter()方法; 回收器ViewAdapter 观赏者 模型
我正在试图找到一个解决方案,解决重新加载后在中崩溃的问题。情况: 树形结构 现在我必须添加。为此,我得到了,并使用方法I添加。 在这之后,我调用树的DefaultTreeModel上的方法。 问题是,在这个调用之后,树将全部崩溃: 而且我必须手动展开节点以确保节点被添加... 我的密码。。。 当我添加节点时。。。 问题在于节点的位置。和节点没有层次结构。 有没有办法避免这种行为?谢谢 也许另一种方
我尝试使用Android studio在谷歌地图上创建位置标记,并从Firebase实时数据库中获取位置。当我将Firebase实时数据库添加到我的应用程序中后,它就一直崩溃。请帮帮忙。下面是MapsActivity.java代码 这似乎是个问题 Path是一个唯一的关键字,我不知道如何创建Path,所以我尝试了substring并将其转换为float。谢谢你
在我的中,我有: 在中,我在回调中调用: 对一些顾客来说,最后一条线是崩溃的。
我的TableView没有更新,我需要一个监听器吗?(m是我的模型) 在一个新的阶段,我在我的模型列表中添加了一些Mitarbeiter 但是另一个阶段的TableView没有更新新数据。最后,观察列表不是指向模型中的ArrayList吗?