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
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
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
8 changes: 8 additions & 0 deletions gm4_towering_trees/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Towering Trees<!--$headerTitle--><!--$pmc:delete-->

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

### Features
- Adds mega and small tree variants to any sapling that is missing one.
- That's it! 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!"
24 changes: 24 additions & 0 deletions gm4_towering_trees/beet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
id: gm4_towering_trees
name: Towering Trees
version: 1.0.X

data_pack:
load: .

pipeline:
- 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:
- Djoness
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,15 @@
# generates the tree - mega
# @s = sapling marker
# located at @s (offset to be at the negative corner of the 2x2)
# run from generate_tree

# vanilla
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

# towering
execute if entity @s[tag=gm4_oak_tree_sapling] run function gm4_towering_trees:generate_tree_type/oak/pick_variant
execute if entity @s[tag=gm4_acacia_tree_sapling] run function gm4_towering_trees:generate_tree_type/oak/pick_variant
execute if entity @s[tag=gm4_cherry_tree_sapling] run function gm4_towering_trees:generate_tree_type/oak/pick_variant
execute if entity @s[tag=gm4_mangrove_tree_sapling] run function gm4_towering_trees:generate_tree_type/oak/pick_variant
execute if entity @s[tag=gm4_birch_tree_sapling] run function gm4_towering_trees:generate_tree_type/oak/pick_variant
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# generates the tree - small
# @s = sapling marker
# located at @s
# run from generate_tree

# mark sapling and clear the space
function gm4_towering_trees:mark_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 place feature minecraft:fancy_oak
execute if entity @s[tag=gm4_dark_oak_tree_sapling] store success score $tree_placed gm4_towering_trees_data run place feature minecraft:fancy_oak
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,20 @@
# generates the tree - mega oak
# @s = sapling marker
# located at @s (offset to be at the negative corner of the 2x2)
# run from generate_tree_type/oak/pick_variant

execute store result score $blocks_moved gm4_towering_trees_data positioned ~-1 ~ ~-1 run clone ~ ~ ~ ~4 ~14 ~4 ~ ~ ~ filtered #gm4_towering_trees:tree_placeable move
execute unless score $blocks_moved gm4_towering_trees_data matches 375 run return fail

execute store result score $blocks_moved gm4_towering_trees_data positioned ~-8 ~3 ~-9 run clone ~ ~ ~ ~19 ~11 ~18 ~ ~ ~ filtered #gm4_towering_trees:tree_placeable move
execute unless score $blocks_moved gm4_towering_trees_data matches 4560 run return fail

place feature gm4_towering_trees:leaf_litter ~ ~1 ~

execute store result score $tree_rotation gm4_towering_trees_data run random value 1..4
execute if score $tree_rotation gm4_towering_trees_data matches 1 run place template gm4_towering_trees:oak/1 ~-8 ~ ~-9
execute if score $tree_rotation gm4_towering_trees_data matches 2 run place template gm4_towering_trees:oak/1 ~9 ~ ~10 180
execute if score $tree_rotation gm4_towering_trees_data matches 3 run place template gm4_towering_trees:oak/1 ~10 ~ ~-8 clockwise_90
execute if score $tree_rotation gm4_towering_trees_data matches 4 run place template gm4_towering_trees:oak/1 ~-9 ~ ~9 counterclockwise_90

scoreboard players set $tree_placed gm4_towering_trees_data 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# generates the tree - mega oak
# @s = sapling marker
# located at @s (offset to be at the negative corner of the 2x2)
# run from generate_mega_tree

execute store result score $tree_variant gm4_towering_trees_data run random value 1..2

execute if score $tree_variant gm4_towering_trees_data matches 1 run function gm4_towering_trees:generate_tree_type/oak/1
execute if score $tree_variant gm4_towering_trees_data matches 2 run function gm4_towering_trees:generate_tree_type/oak/1

execute if score $tree_placed gm4_towering_trees_data matches 1 run fill ~ ~-1 ~ ~1 ~-1 ~1 dirt replace grass_block
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,6 @@
# verifies that the sapling type is from this module
# @s = gm4_tree_sapling marker
# located at @s
# run from gm4_trees:advance_stage via #gm4_trees:generate_tree

execute if entity @s[tag=gm4_towering_trees_sapling] run function gm4_towering_trees:generate_tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# verifies that the sapling type is from this module
# @s = player who just placed down a custom sapling
# located at the center sapling block
# run from gm4_trees:sapling/summon marker via #gm4_trees:initialize_sapling

# this module runs on vanilla saplings, so we want to check for no specific type
execute unless data storage gm4_trees:temp sapling{} align xyz unless entity @e[tag=smithed.block,dx=0,dy=0,dz=0,limit=1] positioned ~.5 ~.5 ~.5 run function gm4_towering_trees:initialize_sapling
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"id": "towering_trees",
"name": "Towering Trees",
"module_type": "module",
"icon": {
"id": "minecraft:oak_sapling"
},
"criteria": {
"obtain_sapling": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"oak_sapling",
"birch_sapling",
"acacia_sapling",
"dark_oak_sapling",
"cherry_sapling",
"pale_oak_sapling",
"mangrove_propagule"
]
}
]
}
}
},
"sections": [
{
"name": "towering_trees",
"enable": [],
"requirements": [
[
"obtain_sapling"
]
],
"pages": [
[
{
"insert": "title"
},
{
"translate": "text.gm4.guidebook.towering_trees.description",
"fallback": "Oak, Birch, Acacia, Cheery and Mangrove trees have mega (2x2) variants.\n\nDark Oak and Pale Oak have small variants."
}
]
]
}
]
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"oak_sapling",
"birch_sapling",
"acacia_sapling",
"dark_oak_sapling",
"cherry_sapling",
"pale_oak_sapling",
"mangrove_propagule"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values": [
"#minecraft:replaceable_by_trees",
"#air",
"#minecraft:logs",
"#gm4_towering_trees:supported_sapling"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"oak_sapling",
"birch_sapling",
"acacia_sapling",
"dark_oak_sapling",
"cherry_sapling",
"pale_oak_sapling",
"mangrove_propagule"
]
}
Loading
Loading