- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在学习如何编写 Minecraft mod(版本 1.14.4)并且能够制作一个项目。现在我正在尝试做一个 block 。我正在关注this tutorial video它实际上涵盖了 1.14.3,但我认为它已经足够接近了。
我目前收到此错误:
[20Mar2020 14:09:10.522] [服务器线程/信息] [net.minecraftforge.registries.ForgeRegistry/REGISTRIES]:注册表 block :发现世界中缺少的 id examplemod:examplemod[20Mar2020 14:09:10.613] [服务器线程/错误] [net.minecraftforge.registries.GameData/REGISTRIES]:注册表中的不明映射: block 示例修改:示例修改:676
我尝试过修改注册表的命名方式,但我似乎无法确定问题是什么。也许我没有正确格式化我的 json 文件?
请注意,ItemList 和 BlockList 只是包含我创建的每个 block /项目的静态实例的类。
ExampleMod.java:
// The value here should match an entry in the META-INF/mods.toml file
@Mod(ExampleMod.MOD_ID)
public class ExampleMod
{
// Directly reference a log4j logger.
private static final Logger LOGGER = LogManager.getLogger();
public static final String MOD_ID = "examplemod";
public ExampleMod() {
// Register the setup method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
// Register the enqueueIMC method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC);
// Register the processIMC method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC);
// Register the doClientStuff method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
}
private void setup(final FMLCommonSetupEvent event)
{
// some preinit code
LOGGER.info("HELLO FROM PREINIT");
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
}
private void doClientStuff(final FMLClientSetupEvent event) {
// do something that can only be done on the client
LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings);
}
private void enqueueIMC(final InterModEnqueueEvent event)
{
// some example code to dispatch IMC to another mod
InterModComms.sendTo(ExampleMod.MOD_ID, "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
}
private void processIMC(final InterModProcessEvent event)
{
// some example code to receive and process InterModComms from other mods
LOGGER.info("Got IMC {}", event.getIMCStream().
map(m->m.getMessageSupplier().get()).
collect(Collectors.toList()));
}
// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
public void onServerStarting(FMLServerStartingEvent event) {
// do something when the server starts
LOGGER.info("HELLO from server starting");
}
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
// Event bus for receiving Registry Events)
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents {
@SubscribeEvent
public static void onItemsRegistry(final RegistryEvent.Register<Item> blockItemEvent)
{
ItemList.bomb_item = new Item(new Item.Properties().group(ItemGroup.COMBAT));
ItemList.bomb_item.setRegistryName(new ResourceLocation(ExampleMod.MOD_ID, "bomb_item"));
ItemList.mystery_block = new BlockItem(BlockList.mystery_block, new Item.Properties().group(ItemGroup.MISC));
ItemList.mystery_block.setRegistryName(new ResourceLocation(ExampleMod.MOD_ID, "mystery_block"));
blockItemEvent.getRegistry().registerAll(ItemList.bomb_item, ItemList.mystery_block);
LOGGER.info("Items registered.");
}
@SubscribeEvent
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
BlockList.mystery_block = new Block(Block.Properties.create(Material.CAKE)
.hardnessAndResistance(2.0f, 2.0f)
.sound(SoundType.GLASS));
BlockList.mystery_block.setRegistryName(new ResourceLocation(MOD_ID, "mystery_block"));
blockRegistryEvent.getRegistry().registerAll(BlockList.mystery_block);
LOGGER.info("Blocks registered.");
}
}
}
blockstates/mystery_block.json:
{ “变体”:{ “”:{ “模型”:“examplemod: block /神秘_ block ” } } }
models/block/mystery_block.json:
{ “父”:“ block /cube_all”, “纹理”:{ “全部”:“examplemod: block /神秘_ block ” }}
models/item/mystery_block.json:
{ “父”:“examplemod: block /神秘_ block ”}
最佳答案
这意味着在某个时候您有一个 block 注册为“examplemod:examplemod”,但现在没有。您可以安全地忽略该消息。如果您开始一个新世界而不是打开一个旧世界,您将不会收到该消息。
顺便说一句,HarryTalks 并不是学习 mod 的推荐方法(在 Minecraft Forge forums 上)。显然他使用了一些不好的做法(我实际上没有使用它们)。替代建议是Cadiboo's example mod ,或McJty's tutorials .
关于java - 为什么我得到 "Unidentified mapping from registry minecraft:block"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60779991/
我不知道为什么当我从南边或东边看时我的纹理按预期渲染,但从北边或西边看时却隐藏了它们后面的对象。 我有一个不可见的 block ,它在其中渲染多个项目,并且在处理具有半透明纹理的 block 时遇到问
我想写一个 Minecraft 模组来增加一种新型的生物。那可能吗?我看到,在 Bukkit, EntityType is a predefined enum ,这让我相信可能没有办法添加新类型的实体
关闭。这个问题是not reproducible or was caused by typos .它目前不接受答案。 这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topi
我一直在尝试使用 MCP 将 Minecraft 源代码反编译到 eclipse 工作区。我正在使用 mcp940 反编译 Minecraft 1.12。当我运行 BATCH 文件 decompile
我正在尝试制作模组,但遇到了这个问题。当我尝试创建工艺配方时,它使我的游戏崩溃。我真的不知道为什么。我尝试使用Items.COOKED_BEEF 还尝试了 Item.cooked_beef。我导入了我
我最近正在开发 Minecraft mod,在处理函数的返回语句时,我发现它需要一个 INBT 实例作为返回类型。我有一个自定义对象,需要将其转换为 INBT 类型的 NBT?这是函数: public
我已经开始制作模组,它没有注册为元素。当我键入 /give Fidojj222 fcm:fuel_canister 时,它应该给我该项目,除非它说它不存在!我正在使用 eclipse 作为我的 IDE
我用 Python 为 Minecraft 1.12.2 编写了一个启动器,它只是准备一个命令并使用子进程运行它。 这是在 Linux Ubuntu 上形成的命令: #!/usr/bin/env ba
我想创建一个应用程序服务器可以联系的 Web 服务,以将自身添加到实现该应用程序的服务器列表中。然后,客户端可以联系该服务以获取服务器列表。类似于 minecraft's heartbeats wor
我在带有 OpenJDK 的 headless Linux 服务器上运行 Minecraft。我已经添加了太多的 mods 和它的滞后(即使在我的本地网络上)而没有使用太多的 CPU 或内存(例如它滞
我正在尝试制作一个插件来消除 Minecraft 中的饥饿感。但是,我找不到它的事件! 是否有玩家失去饥饿感时调用的事件? 类似 PlayerHungerChangeEvent 的东西? 最佳答案 我
我熟悉的唯一模型是漫射照明,但这看起来比那复杂得多。 最佳答案 每个方块的亮度级别从 15 到 0。每个级别都比它上面的级别低 20%。如果一个正方形包含一个光源,它会得到那个光源的光度,否则它会比最
我在学习东西的过程中对我的世界插件开发非常陌生。我正在开发一个 jail 插件,并创建了一种方法,可以让玩家知道他们的库存是否已满。它不起作用,我不明白为什么。代码: public void
我在启动我的世界服务器时遇到错误。我用于插件的外部库是推荐的构建 craftbukkit-1.6.4-R2.0。我使用 craftbukkit-1.6.4-R2.0 来启动服务器并作为 eclipse
我想用 launchProjectile 编写我自己的武器系统,我使用的是 Arrow。但是我怎样才能在不增加传播的情况下增加箭头速度呢?代码如下: @Override public void sho
我正在为 Android 编写 Minecraft 红石模拟器。我正在使用 Dijkstra 的一些变体进行模拟,但我听说,真正的模拟器会做一些不同的事情,并在每个红石滴答声中更新每个红石 block
我在尝试获取 Minecraft 插件中的标志线值时遇到问题。这是我的代码: package pl.maccraft.regssal; import org.bukkit.plugin.java.Ja
我需要找到一种方法来检查我的世界用户名和密码是否有效。 我发现这个文档讲述了很多有关 Minecraft 身份验证的事情:http://wiki.vg/Authentication 看起来它需要一个
对于一个 Minecraft 项目,我想让玩家逐渐面对 (0, 60, 0)。到目前为止,当玩家围绕 (0, 60, 0) 移动超过 720° 时,我尝试的一切似乎都失败了。 有人知道如何让相机无缝移
尝试编写 Minecraft 插件代码时,当我在游戏中运行/fakeop 时出现外部错误。/fakeop (playername) 虽然有效 public class CortexTroll exte
我是一名优秀的程序员,十分优秀!