Skip to content

Commit 00a8bb2

Browse files
runcowsBloo-devTheThanathor
authored
Add Blossoming Pots (#1070)
Introduces runcow's Blossoming Pots to Gamemode 4. Co-authored-by: Bloo <[email protected]> Co-authored-by: Thanathor <[email protected]>
1 parent b122299 commit 00a8bb2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+11648
-0
lines changed

gm4/contributors.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
"name": "Nik3141",
8484
"links": ["https://youtube.com/channel/UCgKd6elt0L3w-d7ryLw-7HQ"]
8585
},
86+
{
87+
"name": "runcows",
88+
"links": ["https://bsky.app/profile/runcows.bsky.social"]
89+
},
8690
{
8791
"name": "Scommander",
8892
"links": ["https://github.com/Scommander"]

gm4_blossoming_pots/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Blossoming Pots<!--$headerTitle--><!--$pmc:delete-->
2+
3+
Decorated Pots and Flower Pots extended to allow all kinds of things to be placed in them! Decorate in Style! <!--$pmc:headerSize-->
4+
5+
### Features
6+
- Some plants have multiple different heights or options depending on how many items you put in the pot.
7+
- Directional plants are placed oriented towards you.
8+
- Allows you to plant the following
9+
- All Flowers (including 2 tall)
10+
- All Saplings (including azaleas and propagules)
11+
- All Leaves
12+
- Cactus
13+
- All Fungi
14+
- All Dead / Alive Coral & Coral Fans!
15+
- Nether Roots & Vines
16+
- Tall & Short Grass
17+
- Tall & Short Ferns
18+
- Dead Bush
19+
- All Lush Cave Plants
20+
- Sweet Berry Bush
21+
- Sea Pickle
22+
- Most Seeds
23+
- Netherwart
24+
- Chorus Flowers
25+
- All Amethyst Buds & Clusters
26+
- Dripstone

gm4_blossoming_pots/beet.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
id: gm4_blossoming_pots
2+
name: Blossoming Pots
3+
version: 3.1.X
4+
5+
data_pack:
6+
load: .
7+
overlays:
8+
- formats:
9+
min_inclusive: 61
10+
max_inclusive: 61
11+
directory: since_61
12+
13+
resource_pack:
14+
load: .
15+
16+
pipeline:
17+
- gm4.plugins.extend.module
18+
19+
meta:
20+
gm4:
21+
versioning:
22+
schedule_loops: [main]
23+
website:
24+
description: Decorated Pots and Flower Pots extended to allow all kinds of things to be placed in them! Decorate in Style!
25+
recommended: []
26+
notes: []
27+
#modrinth:
28+
#project_id: null
29+
#smithed:
30+
#pack_id: null
31+
planetminecraft:
32+
uid: null
33+
video: null
34+
wiki: https://wiki.gm4.co/wiki/Blossoming_Pots
35+
credits:
36+
Creator:
37+
- runcows
38+
Icon Design:
39+
- runcows
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"criteria": {
3+
"use_pot": {
4+
"conditions": {
5+
"location": [
6+
{
7+
"condition": "minecraft:location_check",
8+
"predicate": {
9+
"block": {
10+
"blocks": [
11+
"minecraft:decorated_pot"
12+
]
13+
}
14+
}
15+
}
16+
]
17+
},
18+
"trigger": "minecraft:any_block_use"
19+
}
20+
},
21+
"rewards": {
22+
"function": "gm4_blossoming_pots:decorated/as_player"
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"criteria": {
3+
"use_pot": {
4+
"conditions": {
5+
"location": [
6+
{
7+
"condition": "minecraft:location_check",
8+
"predicate": {
9+
"block": {
10+
"blocks": [
11+
"minecraft:flower_pot"
12+
]
13+
}
14+
}
15+
}
16+
]
17+
},
18+
"trigger": "minecraft:any_block_use"
19+
}
20+
},
21+
"rewards": {
22+
"function": "gm4_blossoming_pots:flower/as_player"
23+
}
24+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"criteria": {
3+
"use_pot": {
4+
"conditions": {
5+
"location": [
6+
{
7+
"condition": "minecraft:location_check",
8+
"predicate": {
9+
"block": {
10+
"blocks": "#gm4_blossoming_pots:potted_plants"
11+
}
12+
}
13+
}
14+
]
15+
},
16+
"trigger": "minecraft:any_block_use"
17+
}
18+
},
19+
"rewards": {
20+
"function": "gm4_blossoming_pots:vanilla_pot_handling/as_player"
21+
}
22+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Raycasts for pot the player interacted with, then proceeds if necessary
2+
# @s = player who interacted with a decorated pot
3+
# at @s
4+
# run from advancement gm4_blossoming_pots:interact_with_decorated_pot
5+
6+
# Reset advancement
7+
advancement revoke @s only gm4_blossoming_pots:interact_with_decorated_pot
8+
# Reset temp
9+
data remove storage gm4_blossoming_pots:decorated_pots temp
10+
11+
function gm4_blossoming_pots:decorated/get_player_rotation
12+
# raycast
13+
execute store result score @s gm4_blossoming_pots.range run attribute @s minecraft:block_interaction_range get 200
14+
execute anchored eyes positioned ^ ^ ^ run function gm4_blossoming_pots:decorated/raycast
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Checks if decorated pot has any items inside before trying to instantiate macro
2+
# @s = temp marker inside decorated pot
3+
# at @s align xyz positioned ~.5 ~.5 ~.5
4+
# with {id, count}
5+
# run from decorated/raycast
6+
7+
# kills marker and returns, if pot empty
8+
execute unless data block ~ ~ ~ item run return run kill @s
9+
function gm4_blossoming_pots:decorated/set_count with block ~ ~ ~ item
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Gets player rotation data for later
2+
# @s = player who interacted with a decorated pot
3+
# at @s
4+
# run from decorated/as_player
5+
6+
# player facing west
7+
execute if entity @s[y_rotation=45..135] unless entity @s[y_rotation=45] run return run data modify storage gm4_blossoming_pots:decorated_pots temp.rotation set value 0
8+
# player facing north
9+
execute if entity @s[y_rotation=135..225] unless entity @s[y_rotation=135] run return run data modify storage gm4_blossoming_pots:decorated_pots temp.rotation set value 90
10+
# player facing east
11+
execute if entity @s[y_rotation=225..315] unless entity @s[y_rotation=225] run return run data modify storage gm4_blossoming_pots:decorated_pots temp.rotation set value 180
12+
# player facing south
13+
execute if entity @s[y_rotation=315..405] unless entity @s[y_rotation=315] run return run data modify storage gm4_blossoming_pots:decorated_pots temp.rotation set value -90
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Checks the temp markers physical location in the block, to see if it is in the collision box of the decorated pot
2+
# @s = temp marker summoned in parent function
3+
# at @s
4+
# run from decorated/raycast
5+
6+
# merge marker data for if it doesn't get killed
7+
data merge entity @s {Tags:["gm4_blossoming_pots.temp.decorated_pot","smithed.strict","smithed.entity"],CustomName:'{"text":"gm4_blossoming_pots.temp_marker"}'}
8+
9+
# if temp marker in physical hit box, return 1
10+
# dxdydz all 0 bc of MC-123441.
11+
execute at @s align xyz positioned ~0.062499 ~ ~0.062499 if entity @s[dx=0,dy=0,dz=0] \
12+
at @s align xyz positioned ~-0.062499 ~ ~-0.062499 if entity @s[dx=0,dy=0,dz=0] \
13+
run return 1
14+
15+
# else, kill marker, return fail
16+
kill @s
17+
return fail

0 commit comments

Comments
 (0)