Skip to content
Open
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
16 changes: 12 additions & 4 deletions gm4/contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
"name": "Denniss",
"links": ["https://github.com/Dennis-0"]
},
{
"name": "Dinoguin_Jess",
"links": ["https://github.com/Dinoguin-Jess"]
},
{
"name": "Djones",
"links": ["https://bsky.app/profile/thanathor.bsky.social"]
},
{
"name": "DuckJr",
"links": ["https://twitter.com/DuckJr94"]
Expand Down Expand Up @@ -71,6 +79,10 @@
"name": "Lue",
"links": ["https://github.com/Luexa"]
},
{
"name": "Lune6",
"links": ["https://bsky.app/profile/lune6.bsky.social"]
},
{
"name": "Modulorium",
"links": ["https://www.modulorium.dev"]
Expand Down Expand Up @@ -115,10 +127,6 @@
"name": "SpecialBuilder32",
"links": ["https://bsky.app/profile/specialbuilder32.bsky.social"]
},
{
"name": "Thanathor",
"links": ["https://bsky.app/profile/thanathor.bsky.social"]
},
{
"name": "The8BitMonkey",
"links": ["https://youtube.com/the8bitmonkey"]
Expand Down
1 change: 1 addition & 0 deletions gm4/modeldata_registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,7 @@
"gm4_desire_lines:gui/advancement/desire_lines_8000": 1
},
"oak_sapling": {
"gm4_towering_trees:guidebook_icon/towering_trees": 1,
"gm4_apple_trees:item/apple_tree_sapling": 4
},
"oak_sign": {
Expand Down
2 changes: 1 addition & 1 deletion gm4_bookshelf_inspector/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ meta:
wiki: https://wiki.gm4.co/wiki/Bookshelf_Inspector
credits:
Creator:
- Thanathor
- Djones
Icon Design:
- Hozz
2 changes: 1 addition & 1 deletion gm4_dripleaf_launchers/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ meta:
wiki: https://wiki.gm4.co/wiki/Dripleaf_Launchers
credits:
Creator:
- Thanathor
- Djones
Icon Design:
- Hozz
3 changes: 2 additions & 1 deletion gm4_guidebook/triggers.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -108,6 +108,7 @@
"tinkering_compressors": 52,
"tipped_skeletons": 44,
"tower_structures": 89,
"towering_trees": 122,
"tunnel_bores": 59,
"undead_players": 67,
"vecto_shamir": 95,
Expand Down
2 changes: 1 addition & 1 deletion gm4_monsters_unbound/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ meta:
wiki: https://wiki.gm4.co/wiki/Monsters_Unbound
credits:
Creator:
- Thanathor
- Djones
Icon Design:
- Hozz
Textures:
Expand Down
2 changes: 1 addition & 1 deletion gm4_shapeless_portals/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ meta:
wiki: https://wiki.gm4.co/wiki/Shapeless_Portals
credits:
Creator:
- Thanathor
- Djones
Icon Design:
- Hozz
2 changes: 1 addition & 1 deletion gm4_survival_refightalized/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ meta:
wiki: https://wiki.gm4.co/wiki/Survival_Refightalized
credits:
Creator:
- Thanathor
- Djones
Icon Design:
- Hozz
2 changes: 1 addition & 1 deletion gm4_sweethearts/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ meta:
- The8BitMonkey
Updated by:
- BPR
- Thanathor
- Djones
Icon Design:
- DuckJr
10 changes: 10 additions & 0 deletions gm4_towering_trees/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Towering Trees<!--$headerTitle--><!--$pmc:delete-->

Adds mega and small tree variants to any sapling that is missing one! <!--$pmc:headerSize-->

![Mega Oak Tree](images/towering_trees.png)<!--$localAssetToURL--><!--$modrinth:replaceWithVideo--><!--$pmc:delete-->

### Features
- Adds mega and small tree variants to any vanilla sapling that is missing one.
- Grow a mega mangrove tree and admire it! Or chop it down, your choice!
- Works with natural growth or bonemeal, no special interaction required, just plant a 2x2 of saplings!
3 changes: 3 additions & 0 deletions gm4_towering_trees/assets/translations.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
key,en_us,de_de,en_ws
text.gm4.guidebook.towering_trees.description,"Oak, Birch, Acacia, Cheery and Mangrove trees have mega (2x2) variants.\n\nDark Oak and Pale Oak have small variants."
text.gm4.guidebook.module_desc.towering_trees,"Adds mega and small tree variants to any sapling that is missing one!"
31 changes: 31 additions & 0 deletions gm4_towering_trees/beet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
id: gm4_towering_trees
name: Towering Trees
version: 1.0.X

data_pack:
load: .

pipeline:
- gm4_towering_trees.generate
- gm4.plugins.extend.module
- gm4.plugins.include.lib_trees

meta:
gm4:
versioning:
required:
lib_trees: 1.4.0
website:
description: Adds mega and small tree variants to any sapling that is missing one!
recommended:
- gm4_metallurgy
wiki: https://wiki.gm4.co/wiki/Towering_Trees
credits:
Creator:
- Djones
- Kyrius
Tree Structures:
- BPR
- rednls
- Dinoguin_Jess
- Lune6
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"criteria": {
"place_sapling": {
"trigger": "minecraft:placed_block",
"conditions": {
"location": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": "#gm4_towering_trees:supported_sapling"
}
}
]
}
}
},
"rewards": {
"function": "gm4_towering_trees:place_sapling"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# check what orientation this big tree has (if it is a big tree)
# @s = sapling marker
# located at @s
# run from generate_tree

# SE = 1
execute if blocks ~1 ~ ~ ~1 ~ ~ ~ ~ ~ all if blocks ~1 ~ ~1 ~1 ~ ~1 ~ ~ ~ all if blocks ~ ~ ~1 ~ ~ ~1 ~ ~ ~ all run return 1
# NE = 2
execute if blocks ~1 ~ ~ ~1 ~ ~ ~ ~ ~ all if blocks ~1 ~ ~-1 ~1 ~ ~-1 ~ ~ ~ all if blocks ~ ~ ~-1 ~ ~ ~-1 ~ ~ ~ all run return 2
# SW = 3
execute if blocks ~-1 ~ ~ ~-1 ~ ~ ~ ~ ~ all if blocks ~-1 ~ ~1 ~-1 ~ ~1 ~ ~ ~ all if blocks ~ ~ ~1 ~ ~ ~1 ~ ~ ~ all run return 3
# NW = 4
execute if blocks ~-1 ~ ~ ~-1 ~ ~ ~ ~ ~ all if blocks ~-1 ~ ~-1 ~-1 ~ ~-1 ~ ~ ~ all if blocks ~ ~ ~-1 ~ ~ ~-1 ~ ~ ~ all run return 4

return 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# removes this sapling so features can be placed
# @s = sapling marker
# at @s
# run from generate_mega_tree
# run from generate_small_tree

execute if block ~ ~ ~ mangrove_propagule[waterlogged=true] run tag @s add gm4_mangrove_tree_sapling.waterlogged
execute unless entity @s[tag=gm4_mangrove_tree_sapling.waterlogged] run fill ~ ~ ~ ~ ~ ~ air replace #gm4_towering_trees:supported_sapling
execute if entity @s[tag=gm4_mangrove_tree_sapling.waterlogged] run setblock ~ ~ ~ water
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# generates the tree - mega
# @s = sapling marker
# located at @s (offset to be at the negative corner of the 2x2)
# run from generate_tree

# towering
execute if entity @s[tag=gm4_oak_tree_sapling] run return run function gm4_towering_trees:generate_tree_type/oak/pick_variant
execute if entity @s[tag=gm4_acacia_tree_sapling] run return run function gm4_towering_trees:generate_tree_type/acacia/pick_variant
execute if entity @s[tag=gm4_cherry_tree_sapling] run return run function gm4_towering_trees:generate_tree_type/cherry/pick_variant
execute if entity @s[tag=gm4_mangrove_tree_sapling] run return run function gm4_towering_trees:generate_tree_type/mangrove/pick_variant
execute if entity @s[tag=gm4_birch_tree_sapling] run return run function gm4_towering_trees:generate_tree_type/birch/pick_variant

# vanilla - needs to remove the saplings first so they can be placed
execute align xyz as @e[type=marker,tag=gm4_towering_trees_sapling,dx=1,dy=0,dz=1] at @s run function gm4_towering_trees:clear_sapling

execute if entity @s[tag=gm4_pale_oak_tree_sapling] store success score $tree_placed gm4_towering_trees_data run place feature minecraft:pale_oak_bonemeal
execute if entity @s[tag=gm4_dark_oak_tree_sapling] store success score $tree_placed gm4_towering_trees_data run place feature minecraft:dark_oak

# replace sapling if placement failed
execute if score $tree_placed gm4_towering_trees_data matches 0 align xyz as @e[type=marker,tag=gm4_towering_trees_sapling,dx=1,dy=0,dz=1] at @s run function gm4_towering_trees:replace_sapling
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# generates the tree - small
# @s = sapling marker
# located at @s
# run from generate_tree

# remove sapling to clear the space
function gm4_towering_trees:clear_sapling

# vanilla
execute if entity @s[tag=gm4_oak_tree_sapling] store success score $tree_placed gm4_towering_trees_data run place feature minecraft:oak
execute if entity @s[tag=gm4_acacia_tree_sapling] store success score $tree_placed gm4_towering_trees_data run place feature minecraft:acacia
execute if entity @s[tag=gm4_cherry_tree_sapling] store success score $tree_placed gm4_towering_trees_data run place feature minecraft:cherry
execute if entity @s[tag=gm4_mangrove_tree_sapling] store success score $tree_placed gm4_towering_trees_data run place feature minecraft:mangrove
execute if entity @s[tag=gm4_birch_tree_sapling] store success score $tree_placed gm4_towering_trees_data run place feature minecraft:birch

# towering
execute if entity @s[tag=gm4_pale_oak_tree_sapling] store success score $tree_placed gm4_towering_trees_data run function gm4_towering_trees:generate_tree_type/pale_oak/pick_variant
execute if entity @s[tag=gm4_dark_oak_tree_sapling] store success score $tree_placed gm4_towering_trees_data run function gm4_towering_trees:generate_tree_type/dark_oak/pick_variant

# replace sapling if placement failed
execute if score $tree_placed gm4_towering_trees_data matches 0 run function gm4_towering_trees:replace_sapling
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# generates the tree
# @s = sapling marker
# located at @s
# run from gm4_towering_trees:verify/generate_tree

scoreboard players set $tree_placed gm4_towering_trees_data 0

# check if this is a big tree
execute store result score $big_tree gm4_towering_trees_data run function gm4_towering_trees:check_for_mega_tree

# generate mega tree positionionally based on which sapling grew
execute if score $big_tree gm4_towering_trees_data matches 1 run function gm4_towering_trees:generate_mega_tree
execute if score $big_tree gm4_towering_trees_data matches 2 positioned ~ ~ ~-1 run function gm4_towering_trees:generate_mega_tree
execute if score $big_tree gm4_towering_trees_data matches 3 positioned ~-1 ~ ~ run function gm4_towering_trees:generate_mega_tree
execute if score $big_tree gm4_towering_trees_data matches 4 positioned ~-1 ~ ~-1 run function gm4_towering_trees:generate_mega_tree
# small trees
execute if score $big_tree gm4_towering_trees_data matches 0 run function gm4_towering_trees:generate_small_tree

# remove the saplings
execute if score $tree_placed gm4_towering_trees_data matches 1 run kill @e[type=marker,tag=gm4_towering_trees_sapling.target,limit=4,distance=..3]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# extra function for mangrove trees
# @s = sapling marker
# located at @s
# run from generate_tree_type/mangrove/place_tree

# remove the saplings, this doesn't always happen for mangrove trees
fill ~ ~ ~ ~1 ~ ~1 air replace mangrove_propagule[waterlogged=false]
fill ~ ~ ~ ~1 ~ ~1 water replace mangrove_propagule[waterlogged=true]

# place the roots after 1 tick to allow markers to load in
schedule function gm4_towering_trees:generate_tree_type/mangrove/roots/schedule 1t
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# build mangrove tree roots
# @s = mangrove tree root marker
# at @s positioned ^ ^-y ^z, randomly offset
# run from generate_tree_type/mangrove/roots/start
# run from here

# if block cannot be replaced with root or max length was reached return
execute unless block ~ ~ ~ #gm4_towering_trees:mangrove_root_replaceable run return fail
scoreboard players remove $max_length gm4_towering_trees_data 1
execute unless score $max_length gm4_towering_trees_data matches 1.. run return fail

# fill with muddy / waterlogged / normal roots
fill ~ ~ ~ ~ ~ ~ muddy_mangrove_roots replace mud
fill ~ ~ ~ ~ ~ ~ mangrove_roots[waterlogged=true] replace #gm4:water
execute unless block ~ ~ ~ mangrove_roots unless block ~ ~ ~ muddy_mangrove_roots run setblock ~ ~ ~ mangrove_roots

# random carpets
execute if predicate {condition:"random_chance",chance:0.5} run fill ~ ~1 ~ ~ ~1 ~ moss_carpet replace #air

# small chance to skew to ground from now on
execute if predicate {condition:"random_chance",chance:0.02} run tag @s add gm4_towering_trees.mangrove_root_skewed

# pick direction
execute if predicate {condition:"random_chance",chance:0.8} positioned ~ ~-1 ~ run return run function gm4_towering_trees:generate_tree_type/mangrove/roots/loop
execute if score $max_distance_from_tree gm4_towering_trees_data matches 0 positioned ~ ~-1 ~ run return run function gm4_towering_trees:generate_tree_type/mangrove/roots/loop

# if skewed to ground start a loop down if the root is going forward
scoreboard players set $max_skew_length gm4_towering_trees_data 5
execute if entity @s[tag=gm4_towering_trees.mangrove_root_skewed] positioned ~ ~-1 ~ run function gm4_towering_trees:generate_tree_type/mangrove/roots/loop_to_ground

scoreboard players remove $max_distance_from_tree gm4_towering_trees_data 1
execute positioned ^ ^ ^1 run function gm4_towering_trees:generate_tree_type/mangrove/roots/loop
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# build mangrove tree roots
# @s = mangrove tree root marker
# at @s positioned ^ ^-y ^z, randomly offset, then positioned ~ ~-n ~
# run from generate_tree_type/mangrove/roots/loop
# run from here

# if block cannot be replaced with root return
execute unless block ~ ~ ~ #gm4_towering_trees:mangrove_root_replaceable run return fail
scoreboard players remove $max_skew_length gm4_towering_trees_data 1
execute unless score $max_skew_length gm4_towering_trees_data matches 1.. run return fail

# fill with (muddy) roots
fill ~ ~ ~ ~ ~ ~ muddy_mangrove_roots replace mud
fill ~ ~ ~ ~ ~ ~ mangrove_roots[waterlogged=true] replace #gm4:water
execute unless block ~ ~ ~ mangrove_roots unless block ~ ~ ~ muddy_mangrove_roots run setblock ~ ~ ~ mangrove_roots

# go down to ground
execute positioned ~ ~-1 ~ run function gm4_towering_trees:generate_tree_type/mangrove/roots/loop_to_ground
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# look for mangrove tree root markers
# @s = unspecified
# at unspecified
# run from generate_tree_type/mangrove/extra

execute as @e[type=marker,tag=gm4_towering_trees.mangrove_root] at @s run function gm4_towering_trees:generate_tree_type/mangrove/roots/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# build mangrove tree roots
# @s = mangrove tree root marker
# at @s
# run from generate_tree_type/mangrove/roots/schedule

scoreboard players set $max_distance_from_tree gm4_towering_trees_data 7
scoreboard players set $max_length gm4_towering_trees_data 16
function gm4_towering_trees:generate_tree_type/mangrove/roots/loop
kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
execute unless score towering_trees gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Towering Trees"}
execute unless score towering_trees gm4_earliest_version < towering_trees gm4_modules run scoreboard players operation towering_trees gm4_earliest_version = towering_trees gm4_modules
scoreboard players set towering_trees gm4_modules 1

# to tree or not to tree

# scoreboards and constants
scoreboard objectives add gm4_towering_trees_data dummy

#$moduleUpdateList
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# initializes the vanilla tree's marker
# @s = player who placed down the vanilla tree sapling
# located at the center of the placed sapling
# run from verify/initialize_sapling

# summon marker
# spruce and jungle are not included as they already have both variants of tree
execute if block ~ ~ ~ oak_sapling run summon marker ~ ~ ~ {CustomName:"gm4_oak_tree_sapling",Tags:["gm4_tree_sapling","gm4_towering_trees_sapling","gm4_oak_tree_sapling","smithed.entity","smithed.strict","smithed.block"]}
execute if block ~ ~ ~ birch_sapling run summon marker ~ ~ ~ {CustomName:"gm4_birch_tree_sapling",Tags:["gm4_tree_sapling","gm4_towering_trees_sapling","gm4_birch_tree_sapling","smithed.entity","smithed.strict","smithed.block"]}
execute if block ~ ~ ~ acacia_sapling run summon marker ~ ~ ~ {CustomName:"gm4_acacia_tree_sapling",Tags:["gm4_tree_sapling","gm4_towering_trees_sapling","gm4_acacia_tree_sapling","smithed.entity","smithed.strict","smithed.block"]}
execute if block ~ ~ ~ dark_oak_sapling run summon marker ~ ~ ~ {CustomName:"gm4_dark_oak_tree_sapling",Tags:["gm4_tree_sapling","gm4_towering_trees_sapling","gm4_dark_oak_tree_sapling","smithed.entity","smithed.strict","smithed.block"]}
execute if block ~ ~ ~ cherry_sapling run summon marker ~ ~ ~ {CustomName:"gm4_cherry_tree_sapling",Tags:["gm4_tree_sapling","gm4_towering_trees_sapling","gm4_cherry_tree_sapling","smithed.entity","smithed.strict","smithed.block"]}
execute if block ~ ~ ~ pale_oak_sapling run summon marker ~ ~ ~ {CustomName:"gm4_pale_oak_tree_sapling",Tags:["gm4_tree_sapling","gm4_towering_trees_sapling","gm4_pale_oak_tree_sapling","smithed.entity","smithed.strict","smithed.block"]}
execute if block ~ ~ ~ mangrove_propagule run summon marker ~ ~ ~ {CustomName:"gm4_mangrove_tree_sapling",Tags:["gm4_tree_sapling","gm4_towering_trees_sapling","gm4_mangrove_tree_sapling","smithed.entity","smithed.strict","smithed.block"]}
# set stage requirement (higher = longer to grow)
scoreboard players set @e[type=marker,tag=gm4_towering_trees_sapling,distance=..0.1] gm4_sap_growth 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Initiates the search for the placed sapling
# @s = player that just placed a custom sapling
# at @s
advancement revoke @s only gm4_towering_trees:place_sapling

# have to engage lib_trees from here since this module works with vanilla saplings
function #gm4_trees:place_sapling
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# replaces this sapling if the tree could not be placed
# @s = sapling marker
# at @s
# run from generate_mega_tree
# run from generate_small_tree

execute if entity @s[tag=gm4_oak_tree_sapling] run setblock ~ ~ ~ oak_sapling[stage=0]
execute if entity @s[tag=gm4_acacia_tree_sapling] run setblock ~ ~ ~ acacia_sapling[stage=0]
execute if entity @s[tag=gm4_cherry_tree_sapling] run setblock ~ ~ ~ cherry_sapling[stage=0]
execute if entity @s[tag=gm4_mangrove_tree_sapling.waterlogged] run setblock ~ ~ ~ mangrove_propagule[stage=0,age=4,waterlogged=true]
execute if entity @s[tag=!gm4_mangrove_tree_sapling.waterlogged,tag=gm4_mangrove_tree_sapling] run setblock ~ ~ ~ mangrove_propagule[stage=0,age=4,waterlogged=false]
execute if entity @s[tag=gm4_birch_tree_sapling] run setblock ~ ~ ~ birch_sapling[stage=0]
execute if entity @s[tag=gm4_pale_oak_tree_sapling] run setblock ~ ~ ~ pale_oak_sapling[stage=0]
execute if entity @s[tag=gm4_dark_oak_tree_sapling] run setblock ~ ~ ~ dark_oak_sapling[stage=0]
Loading
Loading