面向用户:
部分模组可能依赖本模组在后台执行的功能才能正常运行。只需在与客户端和服务器端需要它的任何模组一起安装即可。
使用场景:如果你安装的某个模组为同一种生物添加了多个刷怪蛋(例如用于不同的变种),而其中一个刷怪蛋因此丢失了颜色,本模组可以修复该颜色问题。
点击下方链接,结账时使用代码 "JACKBUSTERS" 可享服务器托管服务 25% 折扣。
面向开发者:
本模组将 SpawnEggItem 构造函数内部的 BY_ID#put() 调用改为 BY_ID#putIfAbsent()。虽然这一改动看似微小,但当你希望拥有多个具有相同实体类型的刷怪蛋时(例如,你希望有能生成变种的刷怪蛋),它会产生显著影响。
以下是关于在添加类似变种刷怪蛋时如何使用本模组的简短教程:
1) 创建一个继承自 SpawnEggItem 的新类(Mojang 官方映射表;请根据你选择的映射表将其转换为相应的父类)。
2) 在你创建的类内部,创建一个类型为 SpawnEggItem 的公共静态 ArrayList,如下所示:
public static final ArrayList<SpawnEggItem> EGGS = new ArrayList<>();
3) 在你的构造函数中,将当前实例添加到你所创建的 ArrayList 中,如下所示:
super(entityType, i, j, properties);
[...]
EGGS.add(this);
4) 在你的 ClientModInitializer 中,按以下方式向你的刷怪蛋注册颜色:
@Override
public void onInitializeClient() {
WolfVariantEgg.EGGS.forEach((egg) ->
ColorProviderRegistry.ITEM.register((stack, tintIndex)
-> egg.getColor(tintIndex), egg));
}
5) 如果现在运行模组,你会发现未指定为特定变种的通用刷怪蛋会丢失其颜色。只要你没有对 BY_ID 映射表进行任何操作,本模组无需你额外工作即可修复此问题。
其他大部分工作可能都需要通过重写 SpawnEggItem 的 useOn 方法来完成。由于这并不直接涉及本模组,我不会对此进行详细讲解,但如果你遇到任何问题,请告诉我,我会尽力提供帮助。
For users:
Some mods may rely on things this mod does in the background to function properly. Just install it alongside any mod that requires it on both client and server.
Use Case: If a mod you have installed adds multiple spawn eggs for the same type of mob (i.e. for different variants), and one of the spawn eggs lost its color as a result, this mod may fix the color.
Follow the link below and use code "JACKBUSTERS" at checkout for 25% off server hosting.
For Developers:
This mod makes BY_ID#put() inside of the SpawnEggItem constructor call BY_ID#putIfAbsent() instead. While this change may seem minor, it makes a big difference when you want to have multiple spawn eggs with the same entity type (For instance, if you want spawn eggs which spawn variants).
A short tutorial on how to go about using this mod when adding something like a variant spawn egg:
1) Create a new class extending SpawnEggItem (Mojang Official Mappings, extend whatever this is converted to the mappings of your choice).
2) Create a public static ArrayList of type SpawnEggItem inside the class you created like so:
public static final ArrayList<SpawnEggItem> EGGS = new ArrayList<>();
3) In your constructor, add the current instance to the ArrayList you created like so:
super(entityType, i, j, properties);
[...]
EGGS.add(this);
4) Inside your ClientModInitializer, register the colors to your spawn eggs like so:
@Override
public void onInitializeClient() {
WolfVariantEgg.EGGS.forEach((egg) ->
ColorProviderRegistry.ITEM.register((stack, tintIndex)
-> egg.getColor(tintIndex), egg));
}
5) If you run the mod now you'll notice that your general spawn egg, not specified to a variant, will have lost its color. That's what this mod fixes without any extra work on your part so long as you didn't do anything to the BY_ID map.
Most other work will probably be done by overriding the useOn method of SpawnEggItem. I won't be walking you through that one since it doesn't really pertain to this mod, but let me know if you run into any issues and I may try to help.
下载 Spawn Egg BYID Redirect
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Spawn Egg BYID Redirect
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Spawn Egg BYID Redirect
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Spawn Egg BYID Redirect
下载 Spawn Egg BYID Redirect
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- 支持 1.21.x,向后兼容 1.19.x 和 1.20.x
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧