gpt4 book ai didi

java - 如何修复,AL lib : (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning:

转载 作者:太空宇宙 更新时间:2023-11-04 09:24:08 24 4
gpt4 key购买 nike

所以我是一个java菜鸟,我正在尝试制作一个Minecraft mod,我不知道发生了什么,因为在Eclipse中,当我运行Minecraft时,它会经历锻造加载屏幕,它会达到7,看起来即将完成,但随后崩溃并显示这些错误消息(full log):

[21:26:28] [main/WARN] [FML]: Registry Item: Override did not have an associated owner object. Name: mcadditions:netherinium_sword Value: superrobbie10.MinecraftAdditions.items.tools.ToolSword@67127bb1
[21:26:28] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ----
// I blame Dinnerbone.

Time: 9/14/19 9:26 PM
Description: Initializing game

java.lang.RuntimeException: One of more entry values did not copy to the correct id. Check log for details!
at net.minecraftforge.registries.ForgeRegistry.sync(ForgeRegistry.java:555)

我发现唯一可以解决这个问题的是,如果我删除名为RegistryHandler的文件,该文件显示


import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import superrobbie10.MinecraftAdditions.init.ModItems;
import superrobbie10.MinecraftAdditions.util.IHasModel;

@EventBusSubscriber
public class RegistryHandler
{

@SubscribeEvent
public static void onItemRegisterer(RegistryEvent.Register<Item> event)
{

event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
}

@SubscribeEvent
public static void onModelRegister(ModelRegistryEvent event)
{

for(Item item : ModItems.ITEMS)
{

if(item instanceof IHasModel)
{

((IHasModel)item).registerModels();
}
}
}
}

此外,这是我的 ToolSword.java:

package superrobbie10.MinecraftAdditions.items.tools;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemSword;
import superrobbie10.MinecraftAdditions.Main;
import superrobbie10.MinecraftAdditions.init.ModItems;
import superrobbie10.MinecraftAdditions.util.IHasModel;

public class ToolSword extends ItemSword implements IHasModel {

public ToolSword(String name, ToolMaterial material)
{
super(material);
setUnlocalizedName(name);
setRegistryName(name);
setCreativeTab(CreativeTabs.TOOLS);

ModItems.ITEMS.add(this);
}

@Override
public void registerModels()
{
Main.proxy.registerItemRenderer(this, 0, "inventory");
}

}

这是我的使用方法:

    public static final ItemSword NETHERINIUM_SWORD = new ToolSword("netherinium_sword", MATERIAL_NETHERINIUM);

但是当我这样做并进入我的 Minecraft 世界时,它说某些注册表内容被删除,导致我的所有 block 和项目消失

最佳答案

看起来这就是问题所在:

    setUnlocalizedName(name);
setRegistryName(name);

那里,名称“netherinium_sword”。您的未本地化名称和注册表名称不应相同,因为您的注册表名称需要命名空间。试试这个:

    setUnlocalizedName(name);
setRegistryName("mcadditions:" + name);

(或者,如果您的 mod ID 有一个常量,则可以使用它而不是硬编码。)

关于java - 如何修复,AL lib : (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57940867/

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