Structure Gel API

Structure Gel API

热度 851212357
最近更新11 个月前
一个用于简化创建生成结构的开发者端的 API。 An API for simplifying the devel...



一款用于简化生成结构开发端工作的API。

结构凝胶(Structure Gel)是一款API模组,旨在让开发者更轻松地创建结构,特别是那些使用拼图系统的开发者。所有代码均为开源且有文档说明。它的一些功能包括:

📚 在此处阅读结构凝胶API文档

如需查看此API的开源可用示例,请查看《地牢增强版》(Dungeons Plus)。

您可以找到根据Minecraft版本详细介绍如何开发和使用此API的信息。

最新文档

  • 1.16及以上版本

旧版文档

  • 1.15.2版本
  • 1.14.4版本

🧪 最新功能

🛠️ 建造工具

建造工具是一种仅在创造模式下可用的新物品,用于执行各种大规模的方块更改操作。

  • 它可以在创造模式的“结构物品”标签页中找到。
  • 在空中右键点击建造工具可打开GUI。打开后,您可以选择要使用的模式、撤销、重做、选择您的位置等等。

GUI

GUI包含各种用于修改建造工具设置的按钮,以及一些便捷工具。

  • 按下回车键、E键、Esc键,或点击屏幕上非按钮的任意位置,均可关闭GUI。
  • 将鼠标悬停在GUI上的任何物品上,右侧会显示一个工具提示,解释其功能和使用方法。
  • 使用径向菜单,您可以选择要使用的模式。
  • 有些模式支持位置选择。如果支持,左上角会出现一个按钮,可根据您当前的位置选择一个位置。当无法右键点击方块或右键点击极为不便时,此功能非常有用。
  • 左侧的撤销和重做按钮,顾名思义,用于撤销或重做您使用建造工具执行的最后一个操作。最多可保存32个操作并进行撤销。
  • 有些模式有额外的设置,这些设置将显示在撤销和重做按钮下方。
  • 中间的按钮用于选择您要使用的方块。点击它时,会打开一个文本框,您可以在其中输入方块状态。在游戏中也可以这样做,但像水这样的一些方块很难点击选中。

操作控制

  • 中键点击:选择您当前看向的方块状态(也可以在GUI中完成)。
  • 左键点击:根据您所处的模式,这通常是“执行操作”的按键。
  • 右键点击空气:打开GUI。
  • 右键点击方块:有些模式使用此操作来设置位置,但那些不使用此操作设置位置的模式,也允许右键点击方块来“执行操作”。
  • Shift + 右键点击:清除当前选定的位置。

模式

建造工具模式是建造工具可以执行的不同操作。

  • 延伸:根据您点击方块的侧面检测一种模式,并尝试在其前方放置方块以延续该模式。如果您熟悉旧版的“建造魔杖”模组,基本原理是一样的。

  • 填充:填充您点击的Y轴平面内的所有空气方块,直到遇到边界,然后继续向下填充。例如,这对于用水填充湖泊很有用。

  • 填充区域:与原版的填充命令非常相似。选择两个角,然后左键点击,用当前选定的方块填充这两个角之间的区域。有替换特定方块以及仅放置框架或空心方块的选项。

  • 画线:使用当前选定的方块在选定的位置之间放置一条方块线。

  • 克隆:复制选定区域,并将其粘贴到您点击的位置。允许旋转、镜像以及切割而非复制。

  • 移动:将选定区域朝您击打方向移动。

  • 清除:移除选定位置内的所有方块。

  • 形状:在您点击的位置放置一个形状。形状以及将被替换的方块可以通过GUI中该模式的属性进行更改。

模式属性

有些模式支持额外的设置,以修改其行为。例如:

  • 完整性:决定实际放置多少方块。
  • 替换:决定在放置方块时该模式将替换什么。“全部”替换所有方块,“空气”仅替换空气方块,“点击的方块”替换您点击的方块。
  • 旋转和镜像:旋转或镜像克隆区域。也允许选择随机值。

🍡 结构凝胶方块

此方块是一种创造工具,可轻松填充结构内部。当您的结构生成时,凝胶会被替换为空气,而放置时所有空气方块将被忽略。这确保您的结构不会在不应出现自然地形的地方出现自然地形。凝胶方块的行为类似于结构虚空方块,您可以从中穿过,同时它实际上是可见的。

潜行放置凝胶时,您可以触发扩散机制。每种凝胶的扩散方式不同,您可以将鼠标悬停在物品上查看其工作原理。

🍮 认识凝胶!

🟥 红色凝胶

红色凝胶使用默认的扩散机制,沿主方向扩散,仅替换空气。

🟦 蓝色凝胶

蓝色凝胶的功能与红色凝胶类似,只是它不会扩散到能看到天空的位置。

🟩 绿色凝胶

绿色凝胶的扩散方式与红色凝胶相同,此外还会沿对角线扩散。这使其能够穿过藤蔓或其他复杂建筑形成的角落。注意不要让它泄漏到您的建筑外部。

🟦 青色凝胶

青色凝胶结合了绿色凝胶和蓝色凝胶的特点,既沿对角线扩散又避开天空。

🟧 橙色凝胶

橙色凝胶的行为与红色凝胶相同,但它的扩散距离取决于您放置时手持的数量,这使其在开阔区域的建筑中很方便。

🟨 黄色凝胶

黄色凝胶只会沿着您放置时所面对的平面扩散,这使其非常适合封堵墙壁、窗户或凝胶可能穿过的其他孔洞。

移除凝胶

可以通过在凝胶上使用火药来移除它。这样做会触发连锁反应,移除所有相连的相同类型的凝胶。

示例

以下是它在建筑中使用的一个示例。如果将此结构加载到游戏中,内部的凝胶将被替换为空气,而外部的空气方块不会被放置。

此方块的代码设计方式使得,如果您需要尚未实现的行为,您可以轻松扩展它并通过blocks.IStructureGel中的方法挂钩到其行为。

这是一个核心模组,它修改了一些内部类。如果您使用此模组时出现崩溃,且仅在与另一个模组混合使用时才会发生,这可能就是原因。请先进行测试再报告。

🌐 翻译结构凝胶API - 打破语言障碍!

所有翻译人员均在此处致谢。感谢OneSkyApp,您可以轻松进行翻译!

https://moddinglegacy.oneskyapp.com/collaboration/project/388040

德语翻译:A1403、Barion
葡萄牙语(巴西)翻译:gabisaoo、simsgameboh
荷兰语(荷兰)翻译:faas.mr
西班牙语(西班牙)翻译:Minaderm、guillermojuegostablet、juggernogk
乌克兰语翻译:Queez
土耳其语翻译:asimemir58、demirgokler406
希伯来语翻译:pecan1245
西班牙语(阿根廷)翻译:patriciofagetti
意大利语(意大利)翻译:antonioauciello226
立陶宛语翻译:WaryRGMCA

🤚 支持:如果您对我们的模组有任何疑问或问题,请阅读常见问题解答!




An API for simplifying the developer end of creating generated structures.

Structure Gel is an API mod designed to make creating structures easier on the developers, specifically ones using the jigsaw system. All code is open source and documented. Some of its features include:

📚 Read the Structure Gel API Documentation Here

For an open source working example of this api, check out Dungeons Plus

You can find detailed information on how to develop and use this API by Minecraft version.

Latest Documentation

  • 1.16+

Older Documentation

  • 1.15.2
  • 1.14.4

🧪 Latest Features

🛠️ Building Tools

The Building Tool is a new creative mode only item used to perform various large scale block alterations.

  • It can be found in the Structure Items creative mode tab.
  • Right click the Building Tool in the air to open the GUI. Once open, you can select what mode you want to use, undo, redo, select your position, and more.

GUI

The GUI contains various buttons to modify the Building Tool's settings, as well as some convienent tools.

  • Pressing, enter, e, escape, or clicking anywhere on the screen that isn't a button will close the GUI.
  • Hovering over any item on the GUI will display a tooltip on the right side to explain what it does and how to use it.
  • Using the radial menu, you can select which mode you want to use.
  • Some modes support positions. If they do, a button will appear on the top left to select a position based on your current location. This is mainly useful when right clicking a block isn't possible or is highly inconvenient.
  • The Undo and Redo buttons on the left exist to do exactly what they say. They attempt to undo or redo the last action you performed with the Building Tool. Up to 32 actions are saved and can be undone.
  • Some modes have additional settings, these settings will appear below the undo and redo buttons.
  • The button in the middle is used to select what block you want to use. When you click it, a text box will open for you to type a block state. This can be done in game as well, but some blocks like water are more than difficult to click on.

Controls

  • Middle Click: Selects the current block state you're looking at (also can be done in the GUI).
  • Left Click: This is the general key for "do the thing" depending on what mode you're in.
  • Right Click Air: Opens the GUI.
  • Right Click Block: Some modes use this to set positions, but ones that don't also allow this to "do the thing" as well.
  • Shift + Right Click: Clears the currently selected positions.

Modes

Building Tool Modes are different operations that the Building Tool can perform.

  • Extend: Detects a pattern based on the side of the block you click, and attempts to place blocks in front of that to continue that pattern. If you're familiar with the old Builder's Wands mod, it's essentially the same idea.

  • Flood: Fills all air blocks within the y level slice that you click, until it hits a border, then continues to fill going downward. This is useful for filling a lake with water for example.

  • Fill: Very similar to the vanilla fill command. Select two corners and then left click to fill the area between with the currently selected block. Has options for replacing specific blocks and only placing a frame or hollow box.

  • Line: Places a line of blocks between the selected positions using the currently selected block.

  • Clone: Copies the selected region and pastes it where you click. Allows for rotating, mirroring, and cutting instead of copying.

  • Move: Moves the selected region in the direction that you punch.

  • Clear: Removes all blocks within the selected positions.

  • Shape: Places a shape where you click. The shape and what blocks will be replaced can be changed though the mode's properties in the GUI.

Mode Properties

Some modes support additional settings to modify their behavior. Some examples include:

  • Integrity: Determines how many blocks will actually place.
  • Replace: Determines what the mode will replace when placing blocks. All replaces everything, Air replaces only air, and Clicked replaces the block you clicked on.
  • Rotation and Mirror: Rotates or mirrors the cloned region. Allows for selecting a random value as well.

🍡 Structure Gel Block

This block is a creative tool to fill the insides of structures easily. The gel is replaced with air when your structure generates while all air is ignored when being placed. This ensures that your structures won't have natural terrain where it shouldn't be. The gel block behaves similarly to structure voids in that you can walk through it, while actually being visible.

When placing gel while sneaking, you can trigger the spreading mechanic. Each gel spreads differently, and you can read how they work by hovering over the item.

🍮 Meet the Gels!

🟥 Red Gel

Red gel uses the default spreading mechanic, spreading along the cardinal directions, only replacing air.

🟦 Blue Gel

Blue gel functions similarly to red, except it won't spread into locations where the sky can be seen.

🟩 Green Gel

Green gel spreads the same as red gel, with the addition of also spreading diagonally. This allows it to get through corners created by vines or other complex builds. Be careful not to let it leak outside of your build.

🟦 Cyan Gel

Cyan gel acts as a combination of green and blue gel, by both spreading diagonally and avoiding the sky.

🟧 Orange Gel

Orange gel behaves the same as red gel, but the distance it spreads is determined by how many you're holding when you place it, making it handy for builds in open areas.

🟨 Yellow Gel

Yellow gel will only spread along the plane that you're facing when you place it, making it great for sealing off walls, windows, or other holes that the gel would otherwise go through.

Removing Gels

Gel can be removed by using gunpowder on it. Doing this will trigger a chain reaction, removing all connected gels of the same type.

Examples

Here's an example of how it could be used in a build. If this structure were loaded into the game, the gel inside would be replaced with air, while the air outside would not be placed.

The code for this block is designed in a way such that you can easily extend it and hook into its behavior with methods in blocks.IStructureGel, should you need behavior not already implemented.

This is a core mod that modifies a few internal classes. If you get a crash with this mod that only occurs when mixed with another mod, this may be the cause. Please test before reporting.

🌐 Translate Structure Gel API - Help break the language barrier!

All translators are credited here. Thanks to OneSkyApp, you can translate easily!

https://moddinglegacy.oneskyapp.com/collaboration/project/388040

Deutsch translations by: A1403, Barion
Português (Brasil) translations by: gabisaoo, simsgameboh
Nederlands (Nederland) translations by: faas.mr
Español (España) translations by: Minaderm , guillermojuegostablet, juggernogk
Українська (Ukrayins'ka) translations by: Queez
Türkçe (Türkiye) translations by: asimemir58, demirgokler406
עברית ('Ivriyþ) translations by: pecan1245
Español (Argentina) translations by: patriciofagetti
Italiano (Italia) translations by: antonioauciello226
Lietuvių translations by: WaryRGMCA

🤚 Support: If you have questions or any issues with our mods, read the FAQ! You can also either submit an issue on the issue tracker, or come into our Discord server where we can help you!

本站是资源分享站,资源均来自于互联网和用户自发分享,仅供学习和交流使用。如有版权问题,请联系管理员删除。

评论区 (0)

登录 后才能发表评论

暂无评论

快来发表第一条评论吧!