Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
- name: Set up Python 3.14
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.14'

#----------------------------------------------
# ----- install & configure poetry -----
Expand Down
1,616 changes: 0 additions & 1,616 deletions poetry.lock

This file was deleted.

64 changes: 35 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,44 +1,50 @@
[tool.poetry]
[project]
name = "smithed-libraries"
version = "0.16.4"
description = "All of the Smithed Libraries"
authors = ["Smithed Council <team@smithed.dev>"]
license = "MIT"
authors = [{ name = "Smithed Council", email = "team@smithed.dev" }]
requires-python = ">=3.14,<4"
readme = "README.md"
license = "MIT"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"mecha>=0.103.0,<0.104",
"bolt>=0.50.0,<0.51",
"bolt-expressions>=0.17.0,<0.18",
"beet>=0.115.0",
"pydantic>=2.5.2,<3",
"rich>=13.9.2,<14",
]

[tool.poetry.dependencies]
python = "^3.10"
mecha = "^0.95.0"
bolt = "^0.49.0"
bolt-expressions = "^0.17.0"
beet = ">=0.108.5"
pydantic = "^2.5.2"
rich = "^13.9.2"
[dependency-groups]
dev = [
"devtools>=0.9.0,<0.10",
"python-semantic-release>=7.32.2,<8",
"requests>=2.28.1,<3",
"github-action-utils>=1.1.0,<2",
"ruff>=0.15.10",
"pytest>=9.0.3",
"pytest-insta>=0.4.1",
]

[tool.poetry.group.dev.dependencies]
black = "^22.8.0"
isort = "^5.10.1"
devtools = "^0.9.0"
python-semantic-release = "^7.32.2"
requests = "^2.28.1"
github-action-utils = "^1.1.0"
[tool.uv]
default-groups = "all"

[tool.semantic_release]
branch = "main"
version_variable = ["smithed_libraries/__init__.py:__version__"]
version_toml = "pyproject.toml:tool.poetry.version"
version_toml = "pyproject.toml:project.version"
major_on_zero = false
build_command = "poetry build"

[tool.isort]
profile = "black"
build_command = "uv build"

[tool.pyright]
typeCheckingMode = "strict"

[tool.poe.tasks]
format = {shell = "isort smithed_libraries & black smithed_libraries"}

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options]
filterwarnings = [
"ignore:GitWildMatchPattern:DeprecationWarning",
"ignore:Pydantic serializer warnings:UserWarning"
]
10 changes: 5 additions & 5 deletions smithed_libraries/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ meta:
# ex: smithed.actionbar/impl/reset -> smithed.actionbar/impl/v1.2.3/reset
# here, we need to specify `{{ ctx.project_id }}`
refactor:
match: "{{ project_id }}:*" # which files to look at
find: "{{ project_id }}:impl/" # which paths to look for
replace: "{{ project_id }}:v{{ version }}/" # what to replace path w/
match: "{{ ctx.project_id }}:*" # which files to look at
find: "{{ ctx.project_id }}:impl/" # which paths to look for
replace: "{{ ctx.project_id }}:v{{ version }}/" # what to replace path w/

# configures how APIs get generated and version checked
# this occurs **after** refactoring!
# any API with `# @public` on the first line generates the following:
# - function tag: "{{ namespace }}:{{ tag_path }}/{{ path_to_file }}"
# - version check: "{{ namespace }}:{{ version_check_path }}/{{ path_to_file}}"
api:
match: "{{ project_id }}:v{{ version }}" # match only implemented apis
implementation_prefix: "{{ project_id }}:v{{ version }}/" # which files match the internal path
match: "{{ ctx.project_id }}:v{{ version }}" # match only implemented apis
implementation_prefix: "{{ ctx.project_id }}:v{{ version }}/" # which files match the internal path
version_check_path: "v{{ version }}/_version_check" # base path for version_checks
tag_path: "" # base path for API tags
1 change: 1 addition & 0 deletions smithed_libraries/packs/damage/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ id: smithed.damage
name: Smithed Damage
version: "0.2.0"
description: Native Damage Library for Smithed
minecraft: "1.20"

data_pack:
name: Smithed Damage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# adapted from TCC

# get values (x100)
execute store result score #10armor smithed.damage run attribute @s minecraft:generic.armor get 10
execute store result score #10toughness smithed.damage run attribute @s minecraft:generic.armor_toughness get 10
raw execute store result score #10armor smithed.damage run attribute @s minecraft:generic.armor get 10
raw execute store result score #10toughness smithed.damage run attribute @s minecraft:generic.armor_toughness get 10
scoreboard players operation #damage smithed.damage = @s smithed.damage

#!dbg score "#10armor", "smithed.damage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# adapted from TCC

# get values (x100)
execute store result score #10armor smithed.damage run attribute @s minecraft:generic.armor get 10
execute store result score #10toughness smithed.damage run attribute @s minecraft:generic.armor_toughness get 10
raw execute store result score #10armor smithed.damage run attribute @s minecraft:generic.armor get 10
raw execute store result score #10toughness smithed.damage run attribute @s minecraft:generic.armor_toughness get 10
scoreboard players operation #damage smithed.damage = @s smithed.damage

#!dbg score "#10armor", "smithed.damage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# adapted from TCC

# get values (x100)
execute store result score #10armor smithed.damage run attribute @s minecraft:generic.armor get 10
execute store result score #10toughness smithed.damage run attribute @s minecraft:generic.armor_toughness get 10
raw execute store result score #10armor smithed.damage run attribute @s minecraft:generic.armor get 10
raw execute store result score #10toughness smithed.damage run attribute @s minecraft:generic.armor_toughness get 10
scoreboard players operation #damage smithed.damage = @s smithed.damage

#!dbg score "#10armor", "smithed.damage"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
tag @s remove smithed.damage.applied_damage
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa30
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa31
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa32
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa33
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa34
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa35
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa36
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa37
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa38
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa39
attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa3a
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa30
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa31
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa32
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa33
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa34
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa35
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa36
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa37
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa38
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa39
raw attribute @s generic.max_health modifier remove 8b138417-eccd-429b-a080-4beb98b7aa3a
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
execute store result score $maximumHealth smithed.damage run attribute @s generic.max_health get
raw execute store result score $maximumHealth smithed.damage run attribute @s generic.max_health get
execute store result score $currentHealth smithed.damage run data get entity @s Health
scoreboard players operation @s smithed.damage += $maximumHealth smithed.damage
scoreboard players operation @s smithed.damage -= $currentHealth smithed.damage
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"providers": [
{
"type": "space",
"advances": {
"0": 0,
"1": 4,
"2": 8,
"3": 12,
"4": 16,
"5": 20,
"6": 24,
"7": 28,
"8": 32,
"9": 36,
"A": 40,
"B": 44,
"C": 48,
"D": 52,
"E": 56,
"F": 60,
"G": 64
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "smithed.wiki:item/wiki"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"item.smithed.wiki.example": "Example Wiki"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "smithed.wiki:item/wiki"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions smithed_libraries/packs/wiki/beet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
extend: "@smithed_libraries/common.yaml"

id: smithed.wiki
name: Smithed Wiki
version: "0.1.0"
description: Native Library for Smithed
author: TheNuclearNexus
minecraft: "26.1"

data_pack:
name: Smithed Wiki
load: .
zipped: true
pack_format: 101

resource_pack:
name: Smithed Wiki RP
load: .
zipped: true
pack_format: 84

require:
- smithed_libraries.plugins.wiki
- bolt


output: dist

meta:
depends_on: # used for metadata
custom-block: "0.10.0"
minecraft_version: "26.1"
smithed.wiki:
implementation_folder: impl/wiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"components": {
"minecraft:item_model": "smithed.wiki:wiki",
"minecraft:item_name": { "translate": "item.smithed.wiki.example" },
"minecraft:rarity": "uncommon"
},
"sections": [
{
"type": "smithed.wiki:title",
"title": "Example",
"description": "An example wiki book",
"icon": ""
},
{
"type": "smithed.wiki:toc",
"title": "The table of contents",
"sections": [2]
},
{
"type": "smithed.wiki:reference",
"path": "smithed.wiki:category"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "smithed.wiki:article",
"title": "An article",
"content": "The contents of an article"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "smithed.wiki:category",
"title": "A category",
"description": "An example category",
"sections": [
{ "type": "smithed.wiki:reference", "path": "smithed.wiki:article" }
]
}
4 changes: 2 additions & 2 deletions smithed_libraries/plugins/crafter.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def generate_tag_args(ctx: Context):


ctx.data.functions[
f"smithed.crafter:v{ctx.project_version}/block/table/crafting/input/query_tags"
f"smithed.crafter:impl/block/table/crafting/input/query_tags"
].append(mc.serialize(mc.parse("\n".join(commands), multiline=True)))


Expand Down Expand Up @@ -83,5 +83,5 @@ def generate_advanced_remove_tool(ctx: Context):
commands.append(command)

ctx.data.functions[
f"smithed.crafter:v{ctx.project_version}/block/table/crafting/output/clear_input/delete_tool/vanilla"
f"smithed.crafter:impl/block/table/crafting/output/clear_input/delete_tool/vanilla"
].append(mc.serialize(mc.parse("\n".join(commands), multiline=True)))
Loading
Loading