功能介绍
Block-Item Tweaker 是一个面向整合包的实用工具,允许通过可重载的 JSON 配置文件将任意方块与任意物品关联。它会将两者合并,使得当你“放置”该物品时,实际上会放置对应的方块。
可以定义物品在右键点击和 Shift+右键点击(原版行为)时放置,或者仅在 Shift+右键点击时放置(这对于具有右键使用功能的物品非常有用)。
请注意,你将需要借助 Dropt 或 CraftTweaker 等模组手动调整方块的掉落物,使其重新掉落回对应的物品。
用途
你能用它做什么呢?你需要使用其他模组(如 ContentTweaker、Content Creator、BBLSOhMy 等)自行创建方块,或者构思一些合理的现有关系。举例来说,你可以制作可放置的原版木棍、碗、纸张、书籍等。只需将它们关联到对应的方块即可。
使用方法
前往 config\placeable.json 文件,如果该文件不存在则新建一个,然后定义 item:block(物品:方块)的关系。下面提供了一个可直接测试的示例。
使用命令 /placeable reload 在游戏中测试你的更改。
{
"normal": {
"minecraft:stick": "minecraft:planks",
"minecraft:coal": {
"block": "minecraft:stained_glass",
"mode": "direct",
"state": {
"color": "red"
}
},
"minecraft:coal:1": {
"block": "minecraft:stonebrick",
"mode": "set_item",
"meta": 0
},
"minecraft:dye": "minecraft:wool",
"minecraft:golden_apple": {
"block": "minecraft:wool",
"mode": "set_item"
}
},
"sneaking": {
"minecraft:coal": {
"block": "minecraft:stained_glass",
"mode": "direct",
"state": {
"color": "green"
}
},
"minecraft:iron_ingot": "minecraft:iron_block"
}
}
物品的元数据直接定义在物品键名中;方块的元数据/状态必须在专用字段中定义。
条目包含一个 "mode"(模式)字段,可以是 "direct"(直接)、"held_item"(手持物品)或 "set_item"(设置物品)。这是为了解决某些方块放置逻辑可能需要玩家实际手持该方块堆叠的问题。
如果未定义,默认为 "held_item" 模式,即直接使用指定的物品。
在 "set_item" 模式下,它会临时将玩家手持的物品更改为方块,尝试进行放置,然后再将其改回原来的物品。
在 "direct" 模式下,它会绕过正常的方块物品逻辑,直接将方块放置在世界中(对于放置没有关联物品的方块特别有用,例如火)。
请注意,本模组的放置操作绕过了 Forge 的方块放置事件,这意味着其他模组可能无法检测到玩家放置了这些方块;这可能会与领地保护类模组等产生潜在问题。
以下是该模组在 Rebirth of the Night 中的演示效果。
作者信息
由 phantamanta44 慷慨地完整编码实现
创意与 Logo 设计由 Foreck 提供
附录
PSA:mixinbooter 版本 11.5 至 11.14 与 Fermium 不兼容,因此如果你希望同时使用这两个加载器,建议降级 mixinbooter 或等待修复补丁。
演示视频中使用的方块包括:BBLSOhMy 的纸张块;碗来自 ContentTweaker;木棍来自 Better With Mods 的重新建模/重新纹理化的格栅。
What
Block-Item Tweaker is a straightforward utility for modpacks that allows to assign any arbitrary block to an arbitrary item by configuring their relation in a reloadable JSON. It effectively merges both, so that when you "place" the item, the block will be placed.
Block-items can be defined to be placed by right-clicking and shift-right-clicking (vanilla behavior) or ony when shift-right-clicking (useful for items with right-click uses)
Do note you will have to manually tweak the drops of the block to drop back the item with a mod like Dropt or CraftTweaker.
Why
What can you do with this? Well, you will have to create the blocks yourself with another mod (ContentTweaker, Content Creator, BBLSOhMy, etc) or think of existing relations that make sense, but to give an example, placeable vanilla sticks, bowls, paper, books, etc, etc. Just asign a block to them.
How
Go to config\placeable.json or create the file if it doesn't exist, then define the item:block relationship. Below is a ready-to-test example.
Use command /placeable reload to test your changes in-game
{
"normal": {
"minecraft:stick": "minecraft:planks",
"minecraft:coal": {
"block": "minecraft:stained_glass",
"mode": "direct",
"state": {
"color": "red"
}
},
"minecraft:coal:1": {
"block": "minecraft:stonebrick",
"mode": "set_item",
"meta": 0
},
"minecraft:dye": "minecraft:wool",
"minecraft:golden_apple": {
"block": "minecraft:wool",
"mode": "set_item"
}
},
"sneaking": {
"minecraft:coal": {
"block": "minecraft:stained_glass",
"mode": "direct",
"state": {
"color": "green"
}
},
"minecraft:iron_ingot": "minecraft:iron_block"
}
}
Item metadata is definided directly on the item key; block meta/state must be defined in the dedicated fields.
Entries have a "mode" field, which can be "direct", "held_item", or "set_item". This is to solve the problem of some block placement logic possibly requiring the player to be actually holding a stack of the block.
the default if not defined is "held_item" mode, which just uses the specified item
in "set_item" mode, it'll temporarily change the player's held item to the block, try to do the placement, then change it back to whatever the original item was
in "direct" mode, it directly sets the block in the world without going through the normal block item logic (particularly useful for placing blocks that don't have associated items, like fire)
Do note this mod's placement bypasses the forge block placement events, which means other mods might not be able to tell that the player placed the blocks; a potentiual issue with e.g. claim protection mods and the like.
Here is a demo of the mod as seen in Rebirth of the Night
Who
Graciously coded in its entirety by phantamanta44
Idea and logo by Foreck
Addenda
PSA: mixinbooter versions 11.5 to 11.14 are incompatible with Fermium and thus BBLSOhMy if you want to use both loaders, it is recommended to downgrade mixinbooter or wait for a fix
Used in the demo video are Papers: BBLSOhMy's litter blocks; Bowl: ContentTweaker; and Stick: remodeled/retextured grate from Better With Mods
评论 0
登录后参与评分
还没有评论,来抢沙发吧