From fcd8d870f608fb006dbbefa9f958ba81d51dbe95 Mon Sep 17 00:00:00 2001 From: runcows <124551271+runcows@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:49:03 -0500 Subject: [PATCH 1/9] Uninitialized Value --- .../templates/function/determine_parent.mcfunction | 4 ++-- .../templates/function/revoke_advancement.mcfunction | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/determine_parent.mcfunction b/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/determine_parent.mcfunction index 76e26549a4..c46dc49d5e 100644 --- a/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/determine_parent.mcfunction +++ b/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/determine_parent.mcfunction @@ -7,5 +7,5 @@ scoreboard players add @s gm4_lavish_livestock_size 0 # store size of parent into fixed fake player (only one of these triggers, the other one triggers for the other parent) -execute unless score $parent_a gm4_lavish_livestock_size matches -2147483648..2147483647 run return run scoreboard players operation $parent_a gm4_lavish_livestock_size = @s gm4_lavish_livestock_size -execute unless score $parent_b gm4_lavish_livestock_size matches -2147483648..2147483647 run return run scoreboard players operation $parent_b gm4_lavish_livestock_size = @s gm4_lavish_livestock_size +execute if score $parent_a gm4_lavish_livestock_size matches -1 run return run scoreboard players operation $parent_a gm4_lavish_livestock_size = @s gm4_lavish_livestock_size +execute if score $parent_b gm4_lavish_livestock_size matches -1 run return run scoreboard players operation $parent_b gm4_lavish_livestock_size = @s gm4_lavish_livestock_size diff --git a/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/revoke_advancement.mcfunction b/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/revoke_advancement.mcfunction index 4fd873bffa..ad545285b2 100644 --- a/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/revoke_advancement.mcfunction +++ b/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/revoke_advancement.mcfunction @@ -6,8 +6,8 @@ advancement revoke @s only gm4_lavish_livestock:{{ entity_id }}/breed # get parent sizes -scoreboard players reset $parent_a gm4_lavish_livestock_size -scoreboard players reset $parent_b gm4_lavish_livestock_size +scoreboard players set $parent_a gm4_lavish_livestock_size -1 +scoreboard players set $parent_b gm4_lavish_livestock_size -1 execute as @e[type={{ entity_id }},distance=..10,limit=2,sort=nearest,nbt=!{InLove:0}] run function gm4_lavish_livestock:{{ entity_id }}/determine_parent # if the parents differ in size, chose the smaller one From 4529b9243baaa39bcd9b107f8726f224036282b2 Mon Sep 17 00:00:00 2001 From: runcows <124551271+runcows@users.noreply.github.com> Date: Mon, 22 Dec 2025 15:02:23 -0500 Subject: [PATCH 2/9] Remove unneeded score reset --- .../gm4_lavish_livestock/templates/function/find_baby.mcfunction | 1 - 1 file changed, 1 deletion(-) diff --git a/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/find_baby.mcfunction b/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/find_baby.mcfunction index c349f66f5a..747fdffd68 100644 --- a/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/find_baby.mcfunction +++ b/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/function/find_baby.mcfunction @@ -4,7 +4,6 @@ # run from gm4_lavish_livestock:{{ entity_id }}/find_marker # cache parent size -scoreboard players reset $size gm4_lavish_livestock_size scoreboard players operation $size gm4_lavish_livestock_size = @s gm4_lavish_livestock_size execute as @e[type={{ entity_id }},distance=..10,nbt={Age:-24000},limit=1,sort=nearest] run function gm4_lavish_livestock:{{ entity_id }}/modify_baby From 4d6d5e4e85b7afae0409bbad9a5015872556771a Mon Sep 17 00:00:00 2001 From: runcows <124551271+runcows@users.noreply.github.com> Date: Mon, 22 Dec 2025 15:05:17 -0500 Subject: [PATCH 3/9] Rename advancement criteria --- .../data/gm4_lavish_livestock/templates/advancement/breed.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/advancement/breed.json b/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/advancement/breed.json index 9d687e76e3..8b23c274d7 100644 --- a/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/advancement/breed.json +++ b/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/advancement/breed.json @@ -1,6 +1,6 @@ { "criteria": { - "breed_pigs": { + "breed_{{ entity_id }}s": { "trigger": "minecraft:bred_animals", "conditions": { "child": { From d93075cd4382df573c486430d0b1d491276f2af4 Mon Sep 17 00:00:00 2001 From: runcows <124551271+runcows@users.noreply.github.com> Date: Mon, 22 Dec 2025 15:20:14 -0500 Subject: [PATCH 4/9] CSV -> List in generate.py --- gm4_lavish_livestock/generate.py | 13 +++++++++---- gm4_lavish_livestock/raw/livestock.csv | 8 -------- 2 files changed, 9 insertions(+), 12 deletions(-) delete mode 100644 gm4_lavish_livestock/raw/livestock.csv diff --git a/gm4_lavish_livestock/generate.py b/gm4_lavish_livestock/generate.py index 957832396b..0be66b288f 100644 --- a/gm4_lavish_livestock/generate.py +++ b/gm4_lavish_livestock/generate.py @@ -8,11 +8,16 @@ def beet_default(ctx: Context): - # load csv - csv = CSV.from_file(Path('gm4_lavish_livestock', 'raw', 'livestock.csv')) - # prepare list of supported entities - entity_ids = [e.get('entity_id', "").removeprefix('minecraft:').strip() for e in csv] + entity_ids = [ + "chicken", + "cow", + "hoglin", + "mooshroom", + "pig", + "rabbit", + "sheep" + ] # for each supported entity, render a copy of the "templates" directory with the appropriate entity-id for entity in entity_ids: diff --git a/gm4_lavish_livestock/raw/livestock.csv b/gm4_lavish_livestock/raw/livestock.csv deleted file mode 100644 index 6014dc51fe..0000000000 --- a/gm4_lavish_livestock/raw/livestock.csv +++ /dev/null @@ -1,8 +0,0 @@ -entity_id, -chicken, -cow, -hoglin, -mooshroom, -pig, -rabbit, -sheep, From 0ad9e53161154e8aeafc76f025046a386d7c39c5 Mon Sep 17 00:00:00 2001 From: runcows Date: Tue, 23 Dec 2025 13:55:43 -0500 Subject: [PATCH 5/9] Basic Guidebook --- gm4/modeldata_registry.json | 3 +- gm4_guidebook/triggers.json | 3 +- .../guidebook/lavish_livestock.json | 58 +++++++++++++++++++ .../tags/entity_type/livestock.json | 3 + gm4_lavish_livestock/generate.py | 9 ++- gm4_lavish_livestock/translations.csv | 5 ++ 6 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 gm4_lavish_livestock/data/gm4_lavish_livestock/guidebook/lavish_livestock.json create mode 100644 gm4_lavish_livestock/data/gm4_lavish_livestock/tags/entity_type/livestock.json create mode 100644 gm4_lavish_livestock/translations.csv diff --git a/gm4/modeldata_registry.json b/gm4/modeldata_registry.json index 430a974d53..657f31cb86 100644 --- a/gm4/modeldata_registry.json +++ b/gm4/modeldata_registry.json @@ -1695,7 +1695,8 @@ "gm4_metallurgy:shamir/infinitas": 100 }, "wheat": { - "gm4_mysterious_midnights:guidebook_icon/harvest_moons": 1 + "gm4_mysterious_midnights:guidebook_icon/harvest_moons": 1, + "gm4_lavish_livestock:guidebook_icon/lavish_livestock": 2 }, "white_concrete_powder": { "gm4_zauber_cauldrons:block/liquid_magicol/white": 300 diff --git a/gm4_guidebook/triggers.json b/gm4_guidebook/triggers.json index 9d8930384d..47ceb32fbb 100644 --- a/gm4_guidebook/triggers.json +++ b/gm4_guidebook/triggers.json @@ -1,6 +1,6 @@ { "__important__": "Generated by generate_guidebooks.py. Don't manually update this", - "__next__": 122, + "__next__": 123, "animi_shamir": 91, "apple_trees": 83, "arborenda_shamir": 20, @@ -56,6 +56,7 @@ "illusioner_nights": 103, "infinitas_shamir": 23, "ink_spitting_squid": 78, + "lavish_livestock": 122, "lightning_in_a_bottle": 109, "liquid_minecarts": 47, "liquid_tanks": 63, diff --git a/gm4_lavish_livestock/data/gm4_lavish_livestock/guidebook/lavish_livestock.json b/gm4_lavish_livestock/data/gm4_lavish_livestock/guidebook/lavish_livestock.json new file mode 100644 index 0000000000..f8ccb5f2db --- /dev/null +++ b/gm4_lavish_livestock/data/gm4_lavish_livestock/guidebook/lavish_livestock.json @@ -0,0 +1,58 @@ +{ + "id": "lavish_livestock", + "name": "Lavish Livestock", + "module_type": "module", + "icon": { + "id": "minecraft:wheat" + }, + "criteria": { + "breed": { + "trigger": "minecraft:bred_animals", + "conditions": { + "child": { + "type": "#gm4_lavish_livestock:livestock" + } + } + } + }, + "sections": [ + { + "name": "display", + "enable": [], + "requirements": [ + [ + "breed" + ] + ], + "pages": [ + [ + { + "insert": "title" + }, + { + "text":"\n" + }, + { + "translate": "text.gm4.guidebook.lavish_livestock.description", + "fallback": "Breeding livestock may result in offspring that is abnormally large.\n\nLarger livestock drops more loot." + } + ], + [ + { + "translate":"text.gm4.guidebook.lavish_livestock.list_header", + "fallback":"Livestock", + "underlined":true + }, + { + "text":"\n\n" + }, + { + "translate":"text.gm4.guidebook.lavish_livestock.list", + "fallback": "Chicken\nCow\nHoglin\nMooshroom\nPig\nRabbit\nSheep", + "underlined":false + } + ] + ] + } + ] +} diff --git a/gm4_lavish_livestock/data/gm4_lavish_livestock/tags/entity_type/livestock.json b/gm4_lavish_livestock/data/gm4_lavish_livestock/tags/entity_type/livestock.json new file mode 100644 index 0000000000..c9cbc323a4 --- /dev/null +++ b/gm4_lavish_livestock/data/gm4_lavish_livestock/tags/entity_type/livestock.json @@ -0,0 +1,3 @@ +{ + "values": ctx.meta['animals'] +} diff --git a/gm4_lavish_livestock/generate.py b/gm4_lavish_livestock/generate.py index 0be66b288f..da5807addc 100644 --- a/gm4_lavish_livestock/generate.py +++ b/gm4_lavish_livestock/generate.py @@ -1,14 +1,12 @@ -from pathlib import Path import logging from beet import Context, subproject -from gm4.utils import CSV logger = logging.getLogger(__name__) def beet_default(ctx: Context): - - # prepare list of supported entities + # List of supported entities + # This list is defined in 2 other places, translations.csv and the guidebook entity_ids = [ "chicken", "cow", @@ -18,7 +16,8 @@ def beet_default(ctx: Context): "rabbit", "sheep" ] - + ctx.meta['animals'] = entity_ids + # for each supported entity, render a copy of the "templates" directory with the appropriate entity-id for entity in entity_ids: subproject_config = { diff --git a/gm4_lavish_livestock/translations.csv b/gm4_lavish_livestock/translations.csv new file mode 100644 index 0000000000..2a0dd33908 --- /dev/null +++ b/gm4_lavish_livestock/translations.csv @@ -0,0 +1,5 @@ +key,en_us +text.gm4.guidebook.module_desc.lavish_livestock,"Selectively breed your livestock for increased yields! Commercialize your farming!" +text.gm4.guidebook.lavish_livestock.description,"Breeding livestock may result in offspring that is abnormally large.\n\nLarger livestock drops more loot." +text.gm4.guidebook.lavish_livestock.list_header,"Livestock" +text.gm4.guidebook.lavish_livestock.list,"Chicken\nCow\nHoglin\nMooshroom\nPig\nRabbit\nSheep" From 83cd7da945d31acd7a037d3b2b4d00bd620df9f8 Mon Sep 17 00:00:00 2001 From: runcows Date: Mon, 29 Dec 2025 17:08:32 -0500 Subject: [PATCH 6/9] Change guidebook list for translated entity names --- .../guidebook/lavish_livestock.json | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/gm4_lavish_livestock/data/gm4_lavish_livestock/guidebook/lavish_livestock.json b/gm4_lavish_livestock/data/gm4_lavish_livestock/guidebook/lavish_livestock.json index f8ccb5f2db..2af67b0418 100644 --- a/gm4_lavish_livestock/data/gm4_lavish_livestock/guidebook/lavish_livestock.json +++ b/gm4_lavish_livestock/data/gm4_lavish_livestock/guidebook/lavish_livestock.json @@ -43,14 +43,20 @@ "fallback":"Livestock", "underlined":true }, - { - "text":"\n\n" - }, - { - "translate":"text.gm4.guidebook.lavish_livestock.list", - "fallback": "Chicken\nCow\nHoglin\nMooshroom\nPig\nRabbit\nSheep", - "underlined":false - } + {"text":"\n\n"}, + {"translate":"entity.minecraft.chicken", "underlined":false}, + {"text":"\n"}, + {"translate":"entity.minecraft.cow", "underlined":false}, + {"text":"\n"}, + {"translate":"entity.minecraft.hoglin", "underlined":false}, + {"text":"\n"}, + {"translate":"entity.minecraft.mooshroom", "underlined":false}, + {"text":"\n"}, + {"translate":"entity.minecraft.pig", "underlined":false}, + {"text":"\n"}, + {"translate":"entity.minecraft.rabbit", "underlined":false}, + {"text":"\n"}, + {"translate":"entity.minecraft.sheep", "underlined":false} ] ] } From 0d2b388cfd939eaf73976fed85b3d3aad529336d Mon Sep 17 00:00:00 2001 From: runcows Date: Mon, 29 Dec 2025 17:22:16 -0500 Subject: [PATCH 7/9] beeps is this good? --- .../data/gm4_lavish_livestock/templates/advancement/breed.json | 2 +- gm4_lavish_livestock/translations.csv | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/advancement/breed.json b/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/advancement/breed.json index 8b23c274d7..44c9ca24cb 100644 --- a/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/advancement/breed.json +++ b/gm4_lavish_livestock/data/gm4_lavish_livestock/templates/advancement/breed.json @@ -1,6 +1,6 @@ { "criteria": { - "breed_{{ entity_id }}s": { + "breed_{{ entity_id }}": { "trigger": "minecraft:bred_animals", "conditions": { "child": { diff --git a/gm4_lavish_livestock/translations.csv b/gm4_lavish_livestock/translations.csv index 2a0dd33908..c9b08327c8 100644 --- a/gm4_lavish_livestock/translations.csv +++ b/gm4_lavish_livestock/translations.csv @@ -2,4 +2,3 @@ key,en_us text.gm4.guidebook.module_desc.lavish_livestock,"Selectively breed your livestock for increased yields! Commercialize your farming!" text.gm4.guidebook.lavish_livestock.description,"Breeding livestock may result in offspring that is abnormally large.\n\nLarger livestock drops more loot." text.gm4.guidebook.lavish_livestock.list_header,"Livestock" -text.gm4.guidebook.lavish_livestock.list,"Chicken\nCow\nHoglin\nMooshroom\nPig\nRabbit\nSheep" From 4650e6ca4d1ebbd2944eca047cbf15014b952b65 Mon Sep 17 00:00:00 2001 From: runcows Date: Sun, 4 Jan 2026 12:26:40 -0500 Subject: [PATCH 8/9] Move list to beet.yaml --- gm4_lavish_livestock/beet.yaml | 8 ++++++++ gm4_lavish_livestock/generate.py | 16 ++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/gm4_lavish_livestock/beet.yaml b/gm4_lavish_livestock/beet.yaml index b0d9d8b489..30106828be 100644 --- a/gm4_lavish_livestock/beet.yaml +++ b/gm4_lavish_livestock/beet.yaml @@ -16,6 +16,14 @@ pipeline: - gm4.plugins.extend.module meta: + animals: + - chicken + - cow + - hoglin + - mooshroom + - pig + - rabbit + - sheep gm4: versioning: schedule_loops: [] diff --git a/gm4_lavish_livestock/generate.py b/gm4_lavish_livestock/generate.py index da5807addc..449a6d66b5 100644 --- a/gm4_lavish_livestock/generate.py +++ b/gm4_lavish_livestock/generate.py @@ -5,21 +5,9 @@ logger = logging.getLogger(__name__) def beet_default(ctx: Context): - # List of supported entities - # This list is defined in 2 other places, translations.csv and the guidebook - entity_ids = [ - "chicken", - "cow", - "hoglin", - "mooshroom", - "pig", - "rabbit", - "sheep" - ] - ctx.meta['animals'] = entity_ids - + # List of supported animals defined in beet.yaml as well as the guidebook page # for each supported entity, render a copy of the "templates" directory with the appropriate entity-id - for entity in entity_ids: + for entity in ctx.meta['animals']: subproject_config = { "data_pack": { "load": [ From bf1689af58f54a6612e597e3a7922f6a270e3599 Mon Sep 17 00:00:00 2001 From: runcows Date: Sun, 4 Jan 2026 17:32:50 -0500 Subject: [PATCH 9/9] Rename list to `livestock` --- gm4_lavish_livestock/beet.yaml | 2 +- .../data/gm4_lavish_livestock/tags/entity_type/livestock.json | 2 +- gm4_lavish_livestock/generate.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gm4_lavish_livestock/beet.yaml b/gm4_lavish_livestock/beet.yaml index 30106828be..fca7197fe5 100644 --- a/gm4_lavish_livestock/beet.yaml +++ b/gm4_lavish_livestock/beet.yaml @@ -16,7 +16,7 @@ pipeline: - gm4.plugins.extend.module meta: - animals: + livestock: - chicken - cow - hoglin diff --git a/gm4_lavish_livestock/data/gm4_lavish_livestock/tags/entity_type/livestock.json b/gm4_lavish_livestock/data/gm4_lavish_livestock/tags/entity_type/livestock.json index c9cbc323a4..9c30d358c8 100644 --- a/gm4_lavish_livestock/data/gm4_lavish_livestock/tags/entity_type/livestock.json +++ b/gm4_lavish_livestock/data/gm4_lavish_livestock/tags/entity_type/livestock.json @@ -1,3 +1,3 @@ { - "values": ctx.meta['animals'] + "values": ctx.meta['livestock'] } diff --git a/gm4_lavish_livestock/generate.py b/gm4_lavish_livestock/generate.py index 449a6d66b5..6c146c958c 100644 --- a/gm4_lavish_livestock/generate.py +++ b/gm4_lavish_livestock/generate.py @@ -7,7 +7,7 @@ def beet_default(ctx: Context): # List of supported animals defined in beet.yaml as well as the guidebook page # for each supported entity, render a copy of the "templates" directory with the appropriate entity-id - for entity in ctx.meta['animals']: + for entity in ctx.meta['livestock']: subproject_config = { "data_pack": { "load": [