该库为模组和整合包开发者提供了大量以数据驱动的 API,并包含了我创作的 Create 附属模组及其他模组的通用代码。其大部分系统都旨在具备极高的通用性,使模组制作人和整合包开发者能够实现一些游戏原版通常无法做到的操作。
该库与 Create 深度集成,但并不依赖它。如果未安装 Create,则所有需要 Create 的功能将简单地被禁用。
以下是按规模和实用性排序的 API 功能列表:
API 功能
Flags(标记)
Flags 是可以添加到物品堆、液体堆以及方块实体等其他对象上的数据驱动型标记。它们会保留在合成、熔炼等原版流程,大多数 Create 流程,以及本库中的老化(Ageing)和回收(Recycling)等流程中(这些均可在配置文件中更改)。例如,由带有“poison”标记的物品合成的物品也将拥有“poison”标记。
Decaying Items(物品衰变)
衰变可以应用于物品,使其在经过指定时间后发生变化,即使它们处于任意的模组化背包中也是如此,从而实现物品腐烂或葡萄酒陈酿等功能。它们基于《异星工厂》(Factorio)中的类似功能,且为数据驱动。衰变可以改变物品本身,或修改组件(如添加或移除 Flags)。
Ageing Recipes(老化配方)
一种配方类型,可使放置在木桶(或其他实现了该接口的容器)中的物品开始指定的衰变过程。如果从容器中取出物品,衰变过程将停止。
Teams(队伍)
一个用于检查玩家是否属于特定群体并为该群体存储数据的系统。实现方式包括单人模式、原版的记分板队伍以及 FTB Teams(即将推出)。绑定到队伍的物品和方块实体允许玩家选择其所属的队伍,然后该队伍的任何成员都将访问该对象的相同信息。
Wishes(愿望) (开发中)
旨在消除随机刷取的枯燥感。愿望是一种可以作为任务奖励、餐厅奖励、合成等方式获得的物品,允许玩家选择物品(具体而言,是指定高级原料 Advanced Ingredient,见下文)。每当玩家进行战利品表投掷时,游戏会尽力调整战利品表以满足玩家现有的愿望。这远比简单地反复投掷战利品表直到找到物品更为复杂,因此它能够处理比单一特定物品更复杂的愿望,例如带有特定附魔的物品。
Extended Inventory(扩展背包) (实验性)
添加了两个新的属性类型 petrolpark:player.extra_inventory_slots 和 petrolpark:player.extra_hotbar_slots,顾名思义,它们的作用就是增加额外的格子。这些额外格子不仅会显示在背包界面中,还会在原版的菜单以及大多数模组化的菜单中显示。作为属性,它们可以通过盔甲、药水、附魔等进行修改,仅需数据包和/或命令即可实现。其目的是提供一种无需点击进入独立屏幕即可使用的背包系统。
Loot Table Modifications(战利品表修改)
以数据驱动的方式修改现有的原版或模组化战利品表,而无需覆盖整个战利品表,其通用性优于 NeoForge 的 Global Loot Modifiers(例如能够添加、移除和修改单个战利品池及战利品条目)。这使得多个模组或数据包可以同时修改现有战利品表。
Recycling(回收) (开发中)
一个通用且平衡的“拆解”系统。自动扫描配方并尝试创建逆向回收配方,该配方接受成分回收比例作为参数;如果一个物品有多种不同的配方,则除非明确定义,否则回收通常不会产生任何结果。如果配方的某个成分没有单一明显的逆向物品,则该成分将从回收结果中省略。成分的逆向关系可以通过数据包定义。例如,你可以将你的物品“Scrap Planks”注册到 minecraft:planks 标签成分中,那么任何以 minecraft:planks 标签为成分的配方在回收时都会生成相应数量的 Scrap Planks。
该系统与物品压缩系统(见下文)接口联动,因此如果某个模组配方需要一个 Moddium Ingot,那么对应的回收率为 25% 的回收配方将返回 2 或 3 个 Moddium Nuggets,无需你手动告知。模组制作人还可以注册回收输出修饰符,根据输入物品影响结果,内置的实现包括根据输入物品的耐久度降低产出率,并将输入物品的 Flags 转移到输出物品上。
Recipe Books(配方书)
允许通过名为“配方书”的物品来锁定配方,这些配方书可以作为任务奖励、餐厅奖励、高级合成产物等给予。除非放置了包含配方书的雕刻书架(或其他实现了该接口的方块),否则无法进行合成。
目前支持原版方块如工作台、制砖机和熔炉,以及大多数 Create 机器。如果安装了 JEI,配方书解锁的配方将以美观的方式渲染在该物品的工具提示中。
Item Compression(物品压缩) (开发中)
自动扫描并索引可逆的“压缩”合成,例如将九个锭合成为一个块,同时也包括那些添加了五重压缩圆石等内容的模组。这些压缩合成无需由模组注册;它们会被自动扫描到。随后可以在运行时轻松访问这些压缩合成。
高级原料
类似于原版/NeoForge 的原料(Ingredients),但具有泛型类型。它们还包含标题,以便在 JEI 等配方查看器中更轻松地看清复杂的原料实际需要什么,并与 Wishes 系统交互。该库提供了多种实现,例如测试对象是否具有特定的 Flag。
餐厅 (开发中)
一个数据驱动的随机生成物品请求系统,提供如物品(例如配方书)、村民闲聊、解锁交易和经验值等奖励。顾客会根据餐厅等级等因素选择随机请求,随机应用修饰符(例如如果物品具有此 Flag 则价格变为 1.5 倍)并随机选择奖励。所有这些随机选择均由数据驱动。
餐厅拥有等级并与团队(Teams)绑定,因此同一团队的玩家可以共同推进一家餐厅的发展。
兼容配方反序列化器
允许在你的模组的机器中完成来自其他模组的配方,而无需将该模组作为依赖项,甚至无需在构建环境中要求它存在,方法是直接读取该模组的配方 JSON 文件。
战利品数值提供者, 条件和函数
多个原版数据驱动数值提供者、战利品物品条件和战利品物品函数的新实现,使得战利品表等功能具有更高的灵活性。新增的数值提供者包括获取实体、物品和 Teams 的属性。
高级配方
用于对配方的使用施加额外限制的配方接口。
需要配方书的配方
参见上文。
依赖生物群系的配方
只能在特定的一组生物群系(Biomes)中进行的配方。此信息可以渲染在 JEI 及其衍生模组中。
首次幸运配方
用于具有随机结果的配方(特别是 Create 的处理配方),以确保玩家第一次执行该配方时获得结果,减少刷取过程。已为部分 Create 配方类型实现。
徽章
徽章 是我发放的游戏内装饰性奖励,用于奖励诸如提前下载我的模组、捐赠或赢得社区竞赛等行为。如果你解锁了徽章,它们将在你加入的任何世界中显示。如果安装了相应的饰品模组,它们可以放置在新的 Badge Curios 槽位中。
可自定义的创造模式标签页
允许更好地控制物品在创造模式标签页中的放置位置,并允许添加分区标签。
木材兼容
允许创建可由任何木材(原版或模组添加)制作的物品和方块,并调整其纹理以显示所使用的木材类型。
事件
几个新的事件,允许钩入以前无法接入的系统:
- 混合方块颜色:在方块与周围方块混合之前更改其颜色,从而实现比原版内置
BlockColor更平滑的过渡。 - 处理降水:当任意方块被雨或雪覆盖时触发
- 村民特殊价格:修改交易的奖金或惩罚(例如当你拥有村庄英雄或名声不佳时)
小型客户端功能
- 挤出方块模型:一种模型定义,接受遮罩和纹理,通过将遮罩应用于给定纹理然后按指定量进行挤出并附带侧面纹理来创建模型
- 均值漂移聚类精灵源:一种精灵加载器,通过平均纹理中的颜色来创建风格化的纹理
- 小型旗帜精灵源:一种精灵加载器,通过适当裁剪基础的双层版本来创建单层版本的旗帜图案
- 透明物品颜色:像皮革护甲这样可以具有任意颜色的物品现在也可以指定透明度
Create API 功能
如果在环境中也包含了 Create,则可用这些 API 和模板。
样条管状方块
在世界中放置和渲染任意弯曲的样条线。在 Petrol's Parts 中与液压传动和气动管道配合使用效果良好。
额外的 Ponder 指令
- 晃动摄像机
- 创建钓鱼线
- 高亮显示 Ponder 标签
- 使实体挥动手臂
- 勾勒任意方块的轮廓
非网格平铺方块
其纹理以大于单个方块的间隔进行平铺的方块,允许更多种类的镶嵌图案。
记住放置者行为
允许 Create 方块记住是谁放置了它们,用于诸如首次幸运配方等功能。
共享功能
这些是仅由某些依赖模组启用的内容添加功能(不仅仅是 API)。非 Petrolpark 模组也可以启用这些功能。
红石程序员
连接到 Create 的红石链接,并允许编程特定的信号序列。本质上是一个用于红石链接频率的 MIDI 编辑器。在 Destroy 和 Petrol's Parts 中使用。
搅拌盆盖子
灵感源自 Create: Diesel Generators(经许可借用)。放置在搅拌盆顶部以实现带盖搅拌盆配方(与其他搅拌盆配方完全相同,仅名称不同),例如发酵和热解。在 Destroy 中使用。带盖搅拌盆配方还支持生物群系特异性,这与基础 Create 搅拌盆配方不同。
挤出模具
通过 Create 机械装置推动方块进行切片,并呈现精美的动画效果。例如在 Destroy 中用于将土豆泥切成薯条、将石英块切成石英柱。配方均为数据驱动,任何模组、整合包或数据包均可添加自定义配方。
依赖项
This library provides a variety of largely data-driven APIs for mod and modpack developers, and contains code common to my Create add-ons and other mods. Most of its systems are designed to be very versatile to allow modders and modpack developers to do things with the game they can't normally.
The library is heavily integrated with Create, but does not depend on it. Create-required features will simply be disabled if the mod is not installed.
Here is a list of API features in order of size and utility:
API Features
Flags
Flags are data-driven things that can be added to items stacks, fluid stacks and other objects like block entities. They persist through vanilla processes like Crafting, Smelting etc., most Create processes, and processes from this library like Ageing and Recycling (these can all be changed in the Configs). For example, items crafted from an item flagged with "poison" will also have the "poison" Flag.
Decaying Items
Decay can be applied to items that will cause them to change after a given time, even if they are in an arbitrary modded inventory, allowing for things like rotting items or aging wine. They are based on the similar feature in Factorio, and are data-driven. Decays can change the item itself, or modify components (such as adding or removing Flags).
Ageing Recipes
A recipe type that causes items placed in a Barrel (or other implementing container) to start a given Decay. The Decay is stopped if the item is removed from the container.
Teams
A system for checking whether players belong to a specific group, and storing data for that group. Implementations include a single player, vanilla's scoreboard teams, and FTB Teams (upcoming). Team-bound items and block entities allow a player to select a Team of which they are a member, and then any members of that Team will access the same information for that object.
Wishes (WIP)
Designed to remove RNG grind, Wishes are items that can be granted as quest rewards, Restaurant rewards, crafted, etc. and allow the player to choose items (specifically, specify an Advanced Ingredient, see below). Whenever the player rolls a loot table, the game will try its best to manipulate the loot table to fulfill the player's existing Wishes. It is a lot more involved than just rolling the loot table until the item is found, and as such works for Wishes more complex than just a specific item, such as items with particular enchantments.
Extended Inventory (Experimental)
Adds two new attribute types, petrolpark:player.extra_inventory_slots and petrolpark:player.extra_hotbar_slots that do exactly what they say on the tin. The extra slots will not only show in the inventory screen, but in vanilla and most arbitrary modded menus. Being attributes, they can be modified by armor, potions, enchantments etc. just with datapacks and/or commands. The aim is to provide a backpack system that does not involve having to click into a separate screen.
Loot Table Modifications
Data-driven modification of existing vanilla or modded loot tables without having to overwrite the whole loot table, with greater versatility than NeoForge's Global Loot Modifiers (such as being able to add, remove and modify individual loot pools and loot pool Entries). This allows multiple mods or datapacks to modify an existing loot table at once with datapacks.
Recycling (WIP)
A versatile and balanced "uncrafting" system. Automatically scans recipes and tries to create reverse recycling recipes that accept as a parameter the proportion of ingredients to recycle, and if an item has numerous different recipes then recycling will usually produce nothing unless explicitly defined. If a recipe ingredient does not have a single obvious inverse item, it is omitted from the recycing results. Ingredient inverses can be defined with a datapack. For example, you can register your item "Scrap Planks" to the minecraft:planks tag ingredient, and then any recipe that takes the minecraft:planks tag as an ingredient will recycle into the corresponding number of Scrap Planks.
This system interfaces with the Item Compression system (see below), so if a modded recipe requires one Moddium Ingot, then the corresponding recycling recipe with 25% returns will give 2 or 3 Moddium Nuggets, without you having to tell it that. Modders can also register recycling output modifiers to affect the results based on the input item, and built-in implementations of this include reducing the returns based on the input item's durability and transferring Flags from the input to the outputs.
Recipe Books
Allows for the gating of recipes behind items called Recipe Books, which could be given as quest rewards, Restaurant rewards, from advanced crafts, etc. Crafts will not be possible unless a Chiseled Bookshelf (or other implementing nlock) containing the Recipe Book is placed next to the block doing the craft.
Implementation currently exists for vanilla blocks like Crafting Tables, Crafters and Furnaces, and for most Create machines. If JEI is installed, the recipe the Recipe Book unlocks will be rendered nicely in the tooltip for the item.
Item Compression (WIP)
Automatically scan for and index reversible "compression" recipes, e.g. nine Ingots into one Block, also including mods that add things like quintuple compressed Cobblestone. Compressions do not have to be registered by a mod; they are automatically scanned for. These compressions can then be easily accessed at runtime.
Advanced Ingredients
Like vanilla/NeoForge Ingredients, but generically typed. They also have captions to make it easier to see what a more complicated ingredient actually requires in recipe viewers like JEI, and interface with the Wishes system. The library provides several implementations, such as testing whether an object has a particular Flag.
Restaurants (WIP)
Data-driven system of randomly-generated requests for items that give rewards like items (e.g. Recipe Books), Villager gossips, unlocking trades, and XP. Customers pick random requests based on things like the Restaurant's level, randomly apply modifiers (e.g. 1.5x if the item has this Flag) and randomly pick rewards. All this random selection is data-driven.
Restaurants can have levels and are bound to Teams, so players in the same Team can progress a Restaurant together.
Compat Recipe Deserializers
Allow recipes from another mod to be done in machines from your mod, without having that mod as a dependency or even requiring it in the build environment, by reading the recipe JSON file for that mod directly.
Loot Number Providers, Conditions and Functions
Several new implementations of vanilla's data-driven number providers, loot item conditions and loot item functions, allowing for much greater versatility with things like loot tables. Added number providers include getting properties of entities, items and Teams.
Advanced Recipes
Interfaces for Recipes that impose additonal restrictions on their use.
Recipe-Book-Required Recipes
See above.
Biome-Dependent Recipes
Recipes than can only be conducted in a given set of Biomes. This information can be rendered in JEI and its derivatives.
First-Time-Lucky Recipes
Used with recipes with random results (particularly Create's processing Recipes) to guarantee a result the first time a player does the Recipe, reducing grind. Implemented for some Create recipe types.
Badges
Badges are in-game cosmetic rewards I give out for things like being early to download my mods, donating, or winning community competitions. If you have the Badge unlocked they will appear in any world you join. They can be placed in a new Badge Curios slot if that mod is installed.
Customizable Creative Mode Tabs
Allows better control over where Items are placed in the Creative mode tab, and allows the addition of section labels.
Wood Compat
Allows for the creation of items and blocks than can be crafted from any wood (vanilla or modded), and will adjust their textures to show it.
Events
A few new events allowing to hook into systems you couldn't prior:
- Blended Block Colors: change the color of a block before it is blended with surrounding blocks, allowing for much smoother transitions than just vanilla's built-in
BlockColors. - Handle Precipitation: for when any block is rained or snowed on
- Villager Special Prices: modify the price bonus or penalty for trades (like if you have Hero of the Village or a bad reputation)
Small Client Features
- Extruded Block Models: A model definition that takes a mask and textures and creates a model by applying that mask to a given texture, then extruding it by a given amount with a given side-texture
- Mean Shift Cluster Sprite Source: A sprite loader that averages the colors in a texture, creating stylized textures
- Small Banner Sprite Source: A sprite loader that creates one-block versions of banner patterns by suitably cutting the base two-block versions
- Transparent Item Colors: Things like Leather Armor that can have arbitrary colors can now also specify a transparency
Create API Features
These are APIs and templates available if Create is also in the environment.
Splined Tubular Blocks
The placement and rendering of arbitrarily curved splines in the world. Used to good effect in Petrol's Parts with the Hydraulic Transmission and Pneumatic Tube.
Additional Ponder Instructions
- Shake the camera
- Create a fishing line
- Highlight a Ponder tag
- Make an entity swing an arm
- Outline any box
Off-Grid Tiling Blocks
Blocks whose textures tile at intervals greater than a single block, allowing for a greater array of tesselating patterns.
Remember Placer Behaviour
Allows Create blocks to remember who placed them, used for things like First-Time-Lucky Recipes.
Shared Features
These are content-adding features (not just API) which are only enabled by certain dependent mods. Non-Petrolpark mods can also enable these.
Redstone Programmer
Connects to Create's Redstone Links and allows programming specific sequences of signals. Essentially a MIDI editor for Redstone Link frequencies. Used in Destroy and Petrol's Parts.
Basin Lid
Idea copied with permission from Create: Diesel Generators. Place on top of a Basin to to Lidded Basin Recipes (identically execept in name to other Basin Recipes) such as fermentation and pyrolysis. Used in Destroy. Lidded Basin Recipes also support biome specificity, unlike base Create Basin Recipes.
Extrusion Die
Push Blocks through with a Create contraption to slice them, with a beautiful animation. Used in Destroy to slice Mashed Potato into Fries and Quartz into Quartz Pillars, for example. Recipes are of course data-driven and can be added by any mod, modpack or datapack.
Dependents
下载 Petrolpark's Library
下载 Petrolpark's Library
下载 Petrolpark's Library
下载 Petrolpark's Library
下载 Petrolpark's Library
下载 Petrolpark's Library
下载 Petrolpark's Library
下载 Petrolpark's Library
下载 Petrolpark's Library
下载 Petrolpark's Library
修复
- 启动时因模组提前组装配方导致的崩溃
- 启动时因模组未实现空实体构造函数导致的崩溃
- 与 Immersive Portals 的不兼容问题
- 目标模组不存在时,兼容性混入代码仍会尝试加载
兼容性
- 更新至最新版的 JEI
兼容性
- 更新到最新版的 JEI
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧