Skip to content

Commit

Permalink
Add wolf variants to balloon animals (#1040)
Browse files Browse the repository at this point in the history
* Add armadillo to Balloon Animal pool

* Add wolf variants to Balloon Animals

* Separate Bat Leather into separate loot table

* Revert "Separate Bat Leather into separate loot table"

This reverts commit e8f3740.
Accidentally committed onto wrong branch...

* Revert "Add armadillo to Balloon Animal pool"

This reverts commit d41190f.

* Fix wolves not showing up in villager trades

* Swap rarity weights to correct values

* Revert "Swap rarity weights to correct values"

This reverts commit 84a95ca.
  • Loading branch information
catter1 authored Oct 7, 2024
1 parent 503ed93 commit 1bba3f3
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gm4_balloon_animals/animals.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Pig,minecraft:pig,FALSE,init_animal,"Bacon,Betty,Hamm,Hoagie,Piglet,Pua,Pumbaa,S
Sheep,minecraft:sheep,FALSE,init_animal,"Baabra,Bellwether,Blackie,Doug,Gruff,Lamb,Lambie,Sheera,Woolensworth,Woolter"
Horse,minecraft:horse,FALSE,init_animal,"Achilles,Buck,Bullseye,Galahad,Khan,Lancelot,Major,Maximus,Pearl,Shadow"
Rabbit,minecraft:rabbit,FALSE,init_animal,"Berry,Bouncy,Bushy,Clover,Houdini,Jack,Judy,March,Nibbles,Oswald,Roger,Squirt,Thumper"
Wolf,minecraft:wolf,FALSE,init_animal,"Beast,Bolt,Briar,Bruno,Buddy,Duke,Fenrir,Maugrim,Wolfie,Wolfsbane"
Wolf,minecraft:wolf,FALSE,init_wolf,"Beast,Bolt,Briar,Bruno,Buddy,Duke,Fenrir,Maugrim,Wolfie,Wolfsbane"
Llama,minecraft:llama,FALSE,init_animal,"Andes,Carl,Carlos,Flower,Kuzco,Paul,Roxy,Ruby,Wendy"
Frog,minecraft:frog,FALSE,init_animal,"Carlos,Croaker,Croaky,Flizard,Frankie,Frogini,Garko,Kermit,Naveen,Ribbiton,Sylvia,Stumpy,Tiana,Toadie"
Bee,minecraft:bee,FALSE,add_bee_nest,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# @s = wolf to be attached to trader, type=#gm4_balloon_animals:balloon_animal
# at wandering trader with no llamas, tag=gm4_balloon_animal_trader,tag=gm4_balloon_animal_trader_new
# run from wandering_trader/trade/pick_animal

tag @s add gm4_balloon_animal

effect give @s levitation infinite 0 true
effect give @s slow_falling infinite 0 true
effect give @s resistance infinite 4 true

data modify entity @s Age set value -2147483648
data modify entity @s leash.UUID set from storage gm4_balloon_animals:temp trader.uuid

execute store result score $variant_id gm4_balloon_animals_data run random value 0..8
for index, wolf_variant in enumerate(ctx.meta['wolf_variants']):
execute if score $variant_id gm4_balloon_animals_data matches index run data modify entity @s variant set value f"{wolf_variant}"

scoreboard players add $id gm4_balloon_animals_id 1
scoreboard players operation @s gm4_balloon_animals_id = $id gm4_balloon_animals_id
execute store result storage gm4_balloon_animals:temp gm4_balloon_animals.id int 1 run scoreboard players get $id gm4_balloon_animals_id

execute summon trader_llama run function gm4_balloon_animals:wandering_trader/trade/spawn_trade_llama

data modify entity @s CustomName set from storage gm4_balloon_animals:temp name_spliced
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
execute store result score $animal_id gm4_balloon_animals_data run loot spawn ~ ~-4096 ~ loot gm4_balloon_animals:technical/random/enumeration_value

for animal in ctx.meta['animals']:
if animal['function'] != 'init_animal':
if animal['function'] not in ['init_animal', 'init_wolf']:
execute if score $animal_id gm4_balloon_animals_data matches ctx.meta['enumeration'].index(animal['id']) summon minecraft:trader_llama run function f"gm4_balloon_animals:wandering_trader/trade/{animal['function']}"
continue

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @s = trader llama
# at wandering trader with no llamas, tag=gm4_balloon_animal_trader,tag=gm4_balloon_animal_trader_new
# run from wandering_trader/trade/pick_animal
# run from wandering_trader/trade/init_[animal|wolf]

tp @s ~ 0 ~
data merge entity @s {Silent:1b,NoGravity:1b,Invulnerable:1b,ChestedHorse:1b,Variant:0,Strength:1,DespawnDelay:1,Tags:["gm4_trade_option"],Items:[{},{id:"minecraft:emerald",count:12,Slot:1b},{}],body_armor_item:{id:"minecraft:light_blue_carpet",count:1,components:{"minecraft:custom_data":{gm4_trades:{options:{maxUses:1,rewardXp:1b,xp:1,priceMultiplier:0.05f}}}}}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
entries = []
for animal in ctx.meta['animals']:
if animal['function'] != "init_animal":
if animal['function'] not in ["init_animal", "init_wolf"]:
continue

for name in map(str.strip, animal['names'].split(',')):
Expand Down
4 changes: 4 additions & 0 deletions gm4_balloon_animals/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def beet_default(ctx: Context):
rare_animals.sort()
common_animals.sort()

# set wolf variants
wolf_variants = ["minecraft:pale", "minecraft:ashen", "minecraft:black", "minecraft:chestnut", "minecraft:rusty", "minecraft:snowy", "minecraft:spotted", "minecraft:striped", "minecraft:woods"]

# store to meta
ctx.meta['animals'] = animals
ctx.meta['enumeration'] = [*common_animals, *rare_animals]
ctx.meta['rare_start'] = len(common_animals)
ctx.meta['wolf_variants'] = wolf_variants

0 comments on commit 1bba3f3

Please sign in to comment.