Skip to content

Commit 410e9f3

Browse files
committed
Document the focal frame
1 parent c50291c commit 410e9f3

File tree

8 files changed

+77
-7
lines changed

8 files changed

+77
-7
lines changed

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
"editor.rulers": [120],
1515
},
1616
"ruff.organizeImports": true,
17-
"ruff.lint.args": [
18-
"--extend-ignore=I", // format on save is enabled, so don't show the squiggles
19-
],
17+
"ruff.lint.ignore": ["I"],
2018
"python.languageServer": "Pylance",
2119
"python.analysis.diagnosticMode": "workspace",
2220
"python.analysis.packageIndexDepths": [
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
name: "hexdebug.category.items.entry.focus_holder",
3+
category: "hexcasting:items",
4+
icon: "hexdebug:focus_holder",
5+
advancement: "hexcasting:root",
6+
pages: [
7+
{
8+
type: "patchouli:text",
9+
text: "hexdebug.category.items.entry.focus_holder.page.1",
10+
},
11+
{
12+
type: "patchouli:text",
13+
text: "hexdebug.category.items.entry.focus_holder.page.2",
14+
},
15+
{
16+
type: "patchouli:crafting",
17+
recipe: "hexdebug:focus_holder",
18+
anchor: "focus_holder",
19+
text: "hexdebug.category.items.entry.focus_holder.page.recipe",
20+
},
21+
{
22+
type: "patchouli:crafting",
23+
recipe: "hexdebug:focus_holder_filling_shaped/new_holder",
24+
recipe2: "hexdebug:focus_holder_filling_shaped/new_focus",
25+
},
26+
{
27+
type: "patchouli:text",
28+
text: "hexdebug.category.items.entry.focus_holder.page.3",
29+
}
30+
],
31+
}

Common/src/main/resources/assets/hexdebug/lang/en_us.flatten.json5

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,16 @@
186186
thwonk: "$(italic)Thwonk!/$"
187187
},
188188
},
189+
focus_holder: {
190+
"": "Focal Frame",
191+
page: {
192+
"1": "$(l:items/focus)$(thing)Foci/$ are useful for storing _Hexes and other iotas in my inventory, but I sometimes find myself in need of a way to store iotas in the world. Item frames are too fragile, and $(l:greatwork/akashiclib)other methods/$ are inefficient and... distasteful. A cleaner solution is necessary, and I've devised one in the form of the $(thing)Focal Frame/$.",
193+
"2": "A $(thing)Focal Frame/$ by itself is useless; a $(l:items/focus)$(thing)Focus/$ must first be inserted. I can do that through crafting, or by right-clicking a placed $(thing)Focal Frame/$ with a $(l:items/focus)$(thing)Focus/$. Right-clicking with an empty hand removes the $(l:items/focus)$(thing)Focus/$ from the frame.$(br2)\
194+
As an item, I can use a filled $(thing)Focal Frame/$ anywhere I would normally use a $(l:items/focus)$(thing)Focus/$, including patterns such as $(l:patterns/readwrite#hexcasting:read)$(action)Scribe's Reflection/$. When placed in the world, I can access it using patterns like $(l:patterns/readwrite_blocks#hexcasting:read/entity)$(action)Chronicler's Purification/$.",
195+
recipe: "$(italic)Two thousand movies, four thousand albums, music and words and pictures like voices whispering from a sweet, sunny past./$",
196+
"3": "In addition to these recipes, I can craft an empty $(thing)Focal Frame/$ with a $(l:items/focus)$(thing)Focus/$ to insert it; and I can craft a filled $(thing)Focal Frame/$ by itself to remove the $(l:items/focus)$(thing)Focus/$ from it, leaving the empty frame behind."
197+
},
198+
},
189199
splicing_table: {
190200
"": "Splicing Table",
191201
page: {

doc/resources/assets/hexcasting/lang/en_us.flatten.json5

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
title: "HexDebug Book",
55
description: "The HexDebug Book, all in one place.",
66
},
7-
}
7+
},
8+
9+
"block.hexdebug.focus_holder.full": "Focal Frame",
810
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"parent": "hexdebug:block/focus_holder/full"
3+
}

doc/src/hexdoc_hexdebug/_hooks.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from hexdoc.plugin import (
44
HookReturn,
5+
LoadTaggedUnionsImpl,
56
ModPlugin,
67
ModPluginImpl,
78
ModPluginWithBook,
@@ -11,11 +12,17 @@
1112

1213
import hexdoc_hexdebug
1314

15+
from . import recipes
1416
from .__gradle_version__ import FULL_VERSION, MINECRAFT_VERSION, MOD_VERSION
1517
from .__version__ import PY_VERSION
1618

1719

18-
class HexDebugPlugin(ModPluginImpl):
20+
class HexDebugPlugin(LoadTaggedUnionsImpl, ModPluginImpl):
21+
@staticmethod
22+
@hookimpl
23+
def hexdoc_load_tagged_unions() -> HookReturn[Package]:
24+
return [recipes]
25+
1926
@staticmethod
2027
@hookimpl
2128
def hexdoc_mod_plugin(branch: str) -> ModPlugin:

doc/src/hexdoc_hexdebug/recipes.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from typing import Any
2+
3+
from hexdoc.minecraft.recipe import CraftingShapedRecipe, ItemResult
4+
from pydantic import field_validator
5+
6+
7+
class FocusHolderFillingShapedRecipe(
8+
CraftingShapedRecipe, type="hexdebug:focus_holder_filling_shaped"
9+
):
10+
@field_validator("result", mode="before")
11+
@classmethod
12+
def _replace_result(cls, value: Any):
13+
# hack: hexdoc doesn't support predicates, so add a fake model for the filled variant
14+
result = {"item": "hexdebug:focus_holder/full"}
15+
match value:
16+
case {"count": count} | ItemResult(count=count):
17+
return result | {"count": count}
18+
case _:
19+
return result

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies = [
4040

4141
[tool.hatch.metadata.hooks.version-catalog.optional-dependencies]
4242
dev = [
43-
"ruff~=0.3.7",
43+
"ruff~=0.13.1",
4444
]
4545

4646
# directory inclusion
@@ -103,7 +103,7 @@ exclude = [
103103
"**/__pycache__",
104104
]
105105

106-
typeCheckingMode = "basic"
106+
typeCheckingMode = "standard"
107107

108108
strictDictionaryInference = true
109109
strictListInference = true

0 commit comments

Comments
 (0)