Skip to content

Commit 797894e

Browse files
committed
Refactor
1 parent 13969a3 commit 797894e

File tree

12 files changed

+43
-39
lines changed

12 files changed

+43
-39
lines changed

gm4_lavish_livestock/data/gm4_lavish_livestock/advancements/breed_pig.json renamed to gm4_lavish_livestock/data/gm4_lavish_livestock/advancements/breed.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
}
1111
},
1212
"rewards": {
13-
"function": "gm4_lavish_livestock:breed/revoke_advancement"
13+
"function": "gm4_lavish_livestock:revoke_advancement"
1414
}
1515
}

gm4_lavish_livestock/data/gm4_lavish_livestock/advancements/feed_livestock.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

gm4_lavish_livestock/data/gm4_lavish_livestock/function/breed/initialize_marker.mcfunction

Lines changed: 0 additions & 2 deletions
This file was deleted.

gm4_lavish_livestock/data/gm4_lavish_livestock/function/breed/revoke_advancement.mcfunction

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Selects one of the two parents of the baby as the source of the inherited size
2+
# @s = parent of the baby
3+
# at location of player who has fed the parent
4+
# run from gm4_lavish_livestock:revoke_advancement
15

26
# if the other parent candidate was already tested and selected as the parent, abort
37
execute if score $parent_selected gm4_lavish_livestock_data matches 1.. run return fail
@@ -13,10 +17,7 @@ execute if score $parent_selected gm4_lavish_livestock_data matches 0 run return
1317
# this candidate is the parent, transfer its stats to breeding site marker
1418
execute unless score @s gm4_lavish_livestock_size matches 0..2 run scoreboard players set @s gm4_lavish_livestock_size 0
1519
scoreboard players operation $size gm4_lavish_livestock_size = @s gm4_lavish_livestock_size
16-
execute summon marker run function gm4_lavish_livestock:breed/initialize_marker
17-
18-
say am parent!
19-
effect give @s regeneration infinite 0 false
20+
execute summon marker run function gm4_lavish_livestock:initialize_marker
2021

2122
# delay for one tick until child is alive
2223
schedule function gm4_lavish_livestock:find_baby 1t

gm4_lavish_livestock/data/gm4_lavish_livestock/function/feed/revoke_advancement.mcfunction

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
# Called once the parent has given birth and initiates breeding sites to look for babies.
2+
# @s = undefined
3+
# at undefined
4+
# scheduled from gm4_lavish_livestock:revoke_advancement
5+
16
execute as @e[type=marker,tag=gm4_lavish_livestock_breeding_site] at @s run function gm4_lavish_livestock:pick_type

gm4_lavish_livestock/data/gm4_lavish_livestock/function/init.mcfunction

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,4 @@ scoreboard players set lavish_livestock gm4_modules 1
55
scoreboard objectives add gm4_lavish_livestock_data dummy
66
scoreboard objectives add gm4_lavish_livestock_size dummy
77

8-
schedule function gm4_lavish_livestock:main 1t
9-
10-
11-
128
#$moduleUpdateList
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Initializes the breeding site marker which sticks around awaiting birth
2+
# @s = new breeding site marker
3+
# at location of player who has fed the parent
4+
# run from gm4_lavish_livestock:determine_parent
5+
6+
scoreboard players operation @s gm4_lavish_livestock_size = $size gm4_lavish_livestock_size
7+
tag @s add gm4_lavish_livestock_breeding_site

gm4_lavish_livestock/data/gm4_lavish_livestock/function/modify_baby.mcfunction

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
say found me!
2-
effect give @s absorption infinite 0 false
1+
# Sets the size of the newborn baby
2+
# @s = the newborn baby
3+
# at location of breeding site marker
4+
# run from gm4_lavish_livestock:pick_type
35

46
scoreboard players operation @s gm4_lavish_livestock_size = $size gm4_lavish_livestock_size
57
execute if score @s gm4_lavish_livestock_size matches 0..1 if predicate {condition:"minecraft:random_chance",chance:1} run scoreboard players add @s gm4_lavish_livestock_size 1

0 commit comments

Comments
 (0)