gpt4 book ai didi

java - Minecraft Forge mod 版本 1.7.10 在添加新配方后不断崩溃

转载 作者:行者123 更新时间:2023-11-30 02:04:19 25 4
gpt4 key购买 nike

我目前在开发我的第一个手写模组时遇到一些问题。我目前使用 Eclipse Photon 作为 IDE,在 64 位计算机上运行 Windows 10 Home,并拥有 4 GB 内存。

这是我的代码:

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
);
}
}

关于为什么总是失败有什么建议吗?如果需要,我有崩溃日志的本地副本。

最佳答案

食谱中的字符形状必须是矩形。如果食谱本身不是矩形,请在不需要的地方添加空格。例如,这个:

            "ABC",
"E",
"H",

应该是这样的:

            "ABC",
" E ",
" H ",

对所有食谱进行更改,错误就会消失。

关于java - Minecraft Forge mod 版本 1.7.10 在添加新配方后不断崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51803293/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com